fix
This commit is contained in:
@@ -119,7 +119,7 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
const palletRef = ref(null)
|
const palletRef = ref(null)
|
||||||
watch(()=>palletData.color_,(newVal:any)=>{
|
watch(()=>palletData.color_,(newVal:any)=>{
|
||||||
if(!newVal?.rgba?.r)return
|
if(newVal?.rgba?.r == null)return
|
||||||
if(palletData.color?.gradient?.gradientShow){
|
if(palletData.color?.gradient?.gradientShow){
|
||||||
palletData.color.gradient.gradientList[palletData.color.gradient.selectIndex].rgba = {
|
palletData.color.gradient.gradientList[palletData.color.gradient.selectIndex].rgba = {
|
||||||
r:newVal.rgba.r,
|
r:newVal.rgba.r,
|
||||||
@@ -143,7 +143,7 @@ export default defineComponent({
|
|||||||
},{deep: true })
|
},{deep: true })
|
||||||
const setOperate = ()=>{
|
const setOperate = ()=>{
|
||||||
if(!palletData.color.rgba)return message.info(t('DesignDetailAlter.jsContent7'))
|
if(!palletData.color.rgba)return message.info(t('DesignDetailAlter.jsContent7'))
|
||||||
palletData.color.rgba = palletData.color?.rgba?.r?palletData.color.rgba:{r:0,g:0,b:0,a:1}
|
palletData.color.rgba = palletData.color?.rgba?.r != null?palletData.color.rgba:{r:0,g:0,b:0,a:1}
|
||||||
palletData.gradient.selectIndex = 0
|
palletData.gradient.selectIndex = 0
|
||||||
palletData.gradient.gradientShow = true
|
palletData.gradient.gradientShow = true
|
||||||
if(!palletData.color.gradient){
|
if(!palletData.color.gradient){
|
||||||
@@ -257,7 +257,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
}
|
}
|
||||||
const openPallet = ()=>{
|
const openPallet = ()=>{
|
||||||
if(palletData.palletShow && props.selectColor?.rgba?.r){
|
if(palletData.palletShow && props.selectColor?.rgba?.r != null){
|
||||||
if(props.selectColor.gradient){
|
if(props.selectColor.gradient){
|
||||||
palletData.color_.rgba = props.selectColor.gradient.gradientList[0].rgba
|
palletData.color_.rgba = props.selectColor.gradient.gradientList[0].rgba
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -360,15 +360,16 @@ export default defineComponent({
|
|||||||
let isCurrent = list[i].id == detailData?.selectDetail?.id
|
let isCurrent = list[i].id == detailData?.selectDetail?.id
|
||||||
let color = ''
|
let color = ''
|
||||||
let gradient = null
|
let gradient = null
|
||||||
if((detailData.currentDetailType == 'color' || detailData.isEditPattern.value == 'canvasEditor') && isCurrent){
|
// if((detailData.currentDetailType == 'color' && detailData.isEditPattern.value == 'canvasEditor') && isCurrent){
|
||||||
color = newData?.color?.rgba?.r?`${newData?.color.rgba.r} ${newData?.color.rgba.g} ${newData?.color.rgba.b}`:''
|
// color = newData?.color?.rgba?.r != null?`${newData?.color.rgba.r} ${newData?.color.rgba.g} ${newData?.color.rgba.b}`:''
|
||||||
if(newData?.color?.gradient){
|
// if(newData?.color?.gradient){
|
||||||
gradient = newData?.color.gradient
|
// gradient = newData?.color.gradient
|
||||||
}
|
// }
|
||||||
}else if(isCurrent){
|
// }else if(isCurrent){
|
||||||
color = list[i].color?.rgba?.r?`${list[i].color.rgba.r} ${list[i].color.rgba.g} ${list[i].color.rgba.b}`:''
|
|
||||||
|
// }
|
||||||
|
color = list[i].color?.rgba?.r != null?`${list[i].color.rgba.r} ${list[i].color.rgba.g} ${list[i].color.rgba.b}`:''
|
||||||
gradient = list[i].gradient
|
gradient = list[i].gradient
|
||||||
}
|
|
||||||
if(detailData.currentDetailType == 'sketch' && newData?.sketch){
|
if(detailData.currentDetailType == 'sketch' && newData?.sketch){
|
||||||
color = detailData.designDetail.clothes?.[0]?.color?.rgba?.r?`${detailData.designDetail.clothes?.[0].color.rgba.r} ${detailData.designDetail.clothes[0].color.rgba.g} ${detailData.designDetail.clothes[0].color.rgba.b}`:''
|
color = detailData.designDetail.clothes?.[0]?.color?.rgba?.r?`${detailData.designDetail.clothes?.[0].color.rgba.r} ${detailData.designDetail.clothes[0].color.rgba.g} ${detailData.designDetail.clothes[0].color.rgba.b}`:''
|
||||||
detailData.selectDetail.maskUrl = ''
|
detailData.selectDetail.maskUrl = ''
|
||||||
@@ -486,6 +487,11 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
const submit = async ()=>{
|
const submit = async ()=>{
|
||||||
detailData.loadingShow = true
|
detailData.loadingShow = true
|
||||||
|
if(detailData.isEditPattern.value !== 'canvasEditor'){
|
||||||
|
if(detailDom.detailRight?.privewDetail)await (detailDom.detailRight as any).privewDetail()
|
||||||
|
let otherData = await updateOtherLayers('single')
|
||||||
|
await detailDom.canvasBox.updateOtherLayers(otherData)
|
||||||
|
}
|
||||||
let workspace = store.state.Workspace.probjects
|
let workspace = store.state.Workspace.probjects
|
||||||
let clothes:any = await setClothes(detailData.designDetail.clothes,'sub')
|
let clothes:any = await setClothes(detailData.designDetail.clothes,'sub')
|
||||||
let data = {
|
let data = {
|
||||||
@@ -647,7 +653,7 @@ export default defineComponent({
|
|||||||
const updateOtherLayers = async (str:any='all',type:any='noFirst')=>{//更新到画布图层
|
const updateOtherLayers = async (str:any='all',type:any='noFirst')=>{//更新到画布图层
|
||||||
let otherData:any = {}
|
let otherData:any = {}
|
||||||
if(str == 'all'){
|
if(str == 'all'){
|
||||||
await uploadSelectDetail()
|
// await uploadSelectDetail()
|
||||||
otherData = {
|
otherData = {
|
||||||
color: detailData.selectDetail.color,
|
color: detailData.selectDetail.color,
|
||||||
printObject: detailData.selectDetail.printObject || null,
|
printObject: detailData.selectDetail.printObject || null,
|
||||||
@@ -738,7 +744,7 @@ export default defineComponent({
|
|||||||
let color:any = {}
|
let color:any = {}
|
||||||
if(allInfo.color?.color?.rgba || allInfo.color?.color?.gradient){
|
if(allInfo.color?.color?.rgba || allInfo.color?.color?.gradient){
|
||||||
let canvasColor = allInfo.color.color;
|
let canvasColor = allInfo.color.color;
|
||||||
if(canvasColor?.rgba?.r){
|
if(canvasColor?.rgba?.r != null){
|
||||||
let colorData:any = await getColorName(allInfo.color.color?.rgba)
|
let colorData:any = await getColorName(allInfo.color.color?.rgba)
|
||||||
color = {
|
color = {
|
||||||
hsv:{
|
hsv:{
|
||||||
@@ -759,6 +765,7 @@ export default defineComponent({
|
|||||||
detailData.detailLeftColorKey++
|
detailData.detailLeftColorKey++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(detailData.isEditPattern.value == 'canvasEditor'){
|
if(detailData.isEditPattern.value == 'canvasEditor'){
|
||||||
delete detailData.selectDetail.newDetail
|
delete detailData.selectDetail.newDetail
|
||||||
detailData.selectDetail.trims.prints = allInfo.trims || []
|
detailData.selectDetail.trims.prints = allInfo.trims || []
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export default defineComponent({
|
|||||||
tcxToColor:'',
|
tcxToColor:'',
|
||||||
})
|
})
|
||||||
watch(()=>colorData.selectColor,async (newVal,oldVal)=>{
|
watch(()=>colorData.selectColor,async (newVal,oldVal)=>{
|
||||||
if(newVal.rgba && newVal.rgba?.r){
|
if(newVal.rgba && newVal.rgba?.r != null){
|
||||||
let data:any = await getColorName(newVal.rgba)
|
let data:any = await getColorName(newVal.rgba)
|
||||||
newVal.name = data.name
|
newVal.name = data.name
|
||||||
newVal.tcx = data.tcx
|
newVal.tcx = data.tcx
|
||||||
@@ -172,8 +172,8 @@ export default defineComponent({
|
|||||||
colorData.colorList.list[newVal].push(item)
|
colorData.colorList.list[newVal].push(item)
|
||||||
}
|
}
|
||||||
if(!isNoSelect){
|
if(!isNoSelect){
|
||||||
let color = colorData.selectDetail.newDetail?.color?.rgba?.r?colorData.selectDetail.newDetail?.color:colorData.selectDetail.color
|
let color = colorData.selectDetail.newDetail?.color?.rgba?.r != null?colorData.selectDetail.newDetail?.color:colorData.selectDetail.color
|
||||||
if(!color?.rgba?.r)return
|
if(color?.rgba?.r == null)return
|
||||||
let item = {
|
let item = {
|
||||||
hex:rgbaToHex([color.rgba.r,color.rgba.g,color.rgba.b]),
|
hex:rgbaToHex([color.rgba.r,color.rgba.g,color.rgba.b]),
|
||||||
id:color.id,
|
id:color.id,
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
const palletRef = ref(null)
|
const palletRef = ref(null)
|
||||||
watch(()=>palletData.color_,(newVal:any)=>{
|
watch(()=>palletData.color_,(newVal:any)=>{
|
||||||
if(!newVal?.rgba?.r)return
|
if(newVal?.rgba?.r == null)return
|
||||||
if(palletData.color?.gradient?.gradientShow){
|
if(palletData.color?.gradient?.gradientShow){
|
||||||
palletData.color.gradient.gradientList[palletData.color.gradient.selectIndex].rgba = {
|
palletData.color.gradient.gradientList[palletData.color.gradient.selectIndex].rgba = {
|
||||||
r:newVal.rgba.r,
|
r:newVal.rgba.r,
|
||||||
@@ -146,7 +146,7 @@ export default defineComponent({
|
|||||||
},{deep: true })
|
},{deep: true })
|
||||||
const setOperate = ()=>{
|
const setOperate = ()=>{
|
||||||
if(!palletData.color.rgba)return message.info(t('DesignDetailAlter.jsContent7'))
|
if(!palletData.color.rgba)return message.info(t('DesignDetailAlter.jsContent7'))
|
||||||
palletData.color.rgba = palletData.color?.rgba?.r?palletData.color.rgba:{r:0,g:0,b:0,a:1}
|
palletData.color.rgba = palletData.color?.rgba?.r != null?palletData.color.rgba:{r:0,g:0,b:0,a:1}
|
||||||
palletData.gradient.selectIndex = 0
|
palletData.gradient.selectIndex = 0
|
||||||
palletData.gradient.gradientShow = true
|
palletData.gradient.gradientShow = true
|
||||||
if(!palletData.color.gradient){
|
if(!palletData.color.gradient){
|
||||||
@@ -262,7 +262,7 @@ export default defineComponent({
|
|||||||
const openPallet = ()=>{
|
const openPallet = ()=>{
|
||||||
palletData.palletShow = !palletData.palletShow
|
palletData.palletShow = !palletData.palletShow
|
||||||
console.log(props.selectColor,palletData.palletShow)
|
console.log(props.selectColor,palletData.palletShow)
|
||||||
if(palletData.palletShow && props.selectColor?.rgba?.r){
|
if(palletData.palletShow && props.selectColor?.rgba?.r != null){
|
||||||
if(props.selectColor.gradient){
|
if(props.selectColor.gradient){
|
||||||
palletData.color_.rgba = props.selectColor.gradient.gradientList[0].rgba
|
palletData.color_.rgba = props.selectColor.gradient.gradientList[0].rgba
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -416,13 +416,13 @@ export default defineComponent({
|
|||||||
if(!editPrintElementData.selectDetail.printObject.prints)return
|
if(!editPrintElementData.selectDetail.printObject.prints)return
|
||||||
let state = true
|
let state = true
|
||||||
// editPrintElementData.stateOverallSingle = 'single'
|
// editPrintElementData.stateOverallSingle = 'single'
|
||||||
let arr:any = editPrintElementData.selectDetail.newDetail?.print || editPrintElementData.selectDetail.printObject.prints
|
let arr:any = editPrintElementData.selectDetail.printObject.prints
|
||||||
if(props.type == 'element'){
|
if(props.type == 'element'){
|
||||||
arr = editPrintElementData.selectDetail.newDetail?.element || editPrintElementData.selectDetail.trims.prints
|
arr = editPrintElementData.selectDetail.trims.prints
|
||||||
}
|
|
||||||
if(editPrintElementData.selectDetail.newDetail?.[editPrintElementData.currentDetailType]){
|
|
||||||
arr = editPrintElementData.selectDetail.newDetail[editPrintElementData.currentDetailType]
|
|
||||||
}
|
}
|
||||||
|
// if(editPrintElementData.selectDetail.newDetail?.[editPrintElementData.currentDetailType]){
|
||||||
|
// arr = editPrintElementData.selectDetail.newDetail[editPrintElementData.currentDetailType]
|
||||||
|
// }
|
||||||
if(arr && arr.length > 0){
|
if(arr && arr.length > 0){
|
||||||
editPrintElementData.printStyleList[props.type].single = []
|
editPrintElementData.printStyleList[props.type].single = []
|
||||||
editPrintElementData.printStyleList[props.type].overall = []
|
editPrintElementData.printStyleList[props.type].overall = []
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
selectColor:{
|
selectColor:{
|
||||||
handler(newVal,oldVal){
|
handler(newVal,oldVal){
|
||||||
if(typeof newVal?.rgba?.r !== 'number' && typeof newVal?.rgba?.r !== 'string'){
|
if(newVal?.rgba?.r == null){
|
||||||
this.colorList[this.selectIndex] = {}
|
this.colorList[this.selectIndex] = {}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -388,7 +388,7 @@ export default defineComponent({
|
|||||||
//选择不同的色块
|
//选择不同的色块
|
||||||
selectColorItem(index,color){
|
selectColorItem(index,color){
|
||||||
let hex
|
let hex
|
||||||
if(color?.rgba?.r){
|
if(color?.rgba?.r != null){
|
||||||
hex = this.rgbaToHex([color.rgba.r,color.rgba.g,color.rgba.b,color.rgba.a?color.rgba.a:1])
|
hex = this.rgbaToHex([color.rgba.r,color.rgba.g,color.rgba.b,color.rgba.a?color.rgba.a:1])
|
||||||
}else{
|
}else{
|
||||||
hex = '#FFFFFF'
|
hex = '#FFFFFF'
|
||||||
@@ -402,7 +402,7 @@ export default defineComponent({
|
|||||||
if(this.driver__.driver){
|
if(this.driver__.driver){
|
||||||
driverObj__.moveNext()
|
driverObj__.moveNext()
|
||||||
}
|
}
|
||||||
if(color?.rgba?.r){
|
if(color?.rgba?.r != null){
|
||||||
this.selectColor = color
|
this.selectColor = color
|
||||||
this.selectColor.hex = hex
|
this.selectColor.hex = hex
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
selectColor:{
|
selectColor:{
|
||||||
handler(newVal,oldVal){
|
handler(newVal,oldVal){
|
||||||
if(typeof newVal?.rgba?.r !== 'number' && typeof newVal?.rgba?.r !== 'string'){
|
if(newVal?.rgba?.r == null){
|
||||||
this.colorList[this.selectIndex] = {}
|
this.colorList[this.selectIndex] = {}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -400,7 +400,7 @@ export default defineComponent({
|
|||||||
//选择不同的色块
|
//选择不同的色块
|
||||||
selectColorItem(index,color){
|
selectColorItem(index,color){
|
||||||
let hex
|
let hex
|
||||||
if(color?.rgba?.r){
|
if(color?.rgba?.r != null){
|
||||||
hex = this.rgbaToHex([color.rgba.r,color.rgba.g,color.rgba.b,color.rgba.a?color.rgba.a:1])
|
hex = this.rgbaToHex([color.rgba.r,color.rgba.g,color.rgba.b,color.rgba.a?color.rgba.a:1])
|
||||||
}else{
|
}else{
|
||||||
hex = '#FFFFFF'
|
hex = '#FFFFFF'
|
||||||
@@ -414,7 +414,7 @@ export default defineComponent({
|
|||||||
if(this.driver__.driver){
|
if(this.driver__.driver){
|
||||||
driverObj__.moveNext()
|
driverObj__.moveNext()
|
||||||
}
|
}
|
||||||
if(color?.rgba?.r){
|
if(color?.rgba?.r != null){
|
||||||
this.selectColor = color
|
this.selectColor = color
|
||||||
this.selectColor.hex = hex
|
this.selectColor.hex = hex
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user