This commit is contained in:
X1627315083
2026-01-23 16:58:03 +08:00
parent df5cb918a2
commit 972743d3b8
7 changed files with 37 additions and 30 deletions

View File

@@ -119,7 +119,7 @@ export default defineComponent({
})
const palletRef = ref(null)
watch(()=>palletData.color_,(newVal:any)=>{
if(!newVal?.rgba?.r)return
if(newVal?.rgba?.r == null)return
if(palletData.color?.gradient?.gradientShow){
palletData.color.gradient.gradientList[palletData.color.gradient.selectIndex].rgba = {
r:newVal.rgba.r,
@@ -143,7 +143,7 @@ export default defineComponent({
},{deep: true })
const setOperate = ()=>{
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.gradientShow = true
if(!palletData.color.gradient){
@@ -257,7 +257,7 @@ export default defineComponent({
}
const openPallet = ()=>{
if(palletData.palletShow && props.selectColor?.rgba?.r){
if(palletData.palletShow && props.selectColor?.rgba?.r != null){
if(props.selectColor.gradient){
palletData.color_.rgba = props.selectColor.gradient.gradientList[0].rgba
}else{

View File

@@ -360,15 +360,16 @@ export default defineComponent({
let isCurrent = list[i].id == detailData?.selectDetail?.id
let color = ''
let gradient = null
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}`:''
if(newData?.color?.gradient){
gradient = newData?.color.gradient
}
}else if(isCurrent){
color = list[i].color?.rgba?.r?`${list[i].color.rgba.r} ${list[i].color.rgba.g} ${list[i].color.rgba.b}`:''
// if((detailData.currentDetailType == 'color' && detailData.isEditPattern.value == 'canvasEditor') && isCurrent){
// color = newData?.color?.rgba?.r != null?`${newData?.color.rgba.r} ${newData?.color.rgba.g} ${newData?.color.rgba.b}`:''
// if(newData?.color?.gradient){
// gradient = newData?.color.gradient
// }
// }else if(isCurrent){
// }
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
}
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}`:''
detailData.selectDetail.maskUrl = ''
@@ -486,6 +487,11 @@ export default defineComponent({
}
const submit = async ()=>{
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 clothes:any = await setClothes(detailData.designDetail.clothes,'sub')
let data = {
@@ -647,7 +653,7 @@ export default defineComponent({
const updateOtherLayers = async (str:any='all',type:any='noFirst')=>{//更新到画布图层
let otherData:any = {}
if(str == 'all'){
await uploadSelectDetail()
// await uploadSelectDetail()
otherData = {
color: detailData.selectDetail.color,
printObject: detailData.selectDetail.printObject || null,
@@ -738,7 +744,7 @@ export default defineComponent({
let color:any = {}
if(allInfo.color?.color?.rgba || allInfo.color?.color?.gradient){
let canvasColor = allInfo.color.color;
if(canvasColor?.rgba?.r){
if(canvasColor?.rgba?.r != null){
let colorData:any = await getColorName(allInfo.color.color?.rgba)
color = {
hsv:{
@@ -759,6 +765,7 @@ export default defineComponent({
detailData.detailLeftColorKey++
}
}
if(detailData.isEditPattern.value == 'canvasEditor'){
delete detailData.selectDetail.newDetail
detailData.selectDetail.trims.prints = allInfo.trims || []

View File

@@ -100,7 +100,7 @@ export default defineComponent({
tcxToColor:'',
})
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)
newVal.name = data.name
newVal.tcx = data.tcx
@@ -172,8 +172,8 @@ export default defineComponent({
colorData.colorList.list[newVal].push(item)
}
if(!isNoSelect){
let color = colorData.selectDetail.newDetail?.color?.rgba?.r?colorData.selectDetail.newDetail?.color:colorData.selectDetail.color
if(!color?.rgba?.r)return
let color = colorData.selectDetail.newDetail?.color?.rgba?.r != null?colorData.selectDetail.newDetail?.color:colorData.selectDetail.color
if(color?.rgba?.r == null)return
let item = {
hex:rgbaToHex([color.rgba.r,color.rgba.g,color.rgba.b]),
id:color.id,

View File

@@ -119,7 +119,7 @@ export default defineComponent({
})
const palletRef = ref(null)
watch(()=>palletData.color_,(newVal:any)=>{
if(!newVal?.rgba?.r)return
if(newVal?.rgba?.r == null)return
if(palletData.color?.gradient?.gradientShow){
palletData.color.gradient.gradientList[palletData.color.gradient.selectIndex].rgba = {
r:newVal.rgba.r,
@@ -146,7 +146,7 @@ export default defineComponent({
},{deep: true })
const setOperate = ()=>{
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.gradientShow = true
if(!palletData.color.gradient){
@@ -262,7 +262,7 @@ export default defineComponent({
const openPallet = ()=>{
palletData.palletShow = !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){
palletData.color_.rgba = props.selectColor.gradient.gradientList[0].rgba
}else{

View File

@@ -416,13 +416,13 @@ export default defineComponent({
if(!editPrintElementData.selectDetail.printObject.prints)return
let state = true
// 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'){
arr = editPrintElementData.selectDetail.newDetail?.element || editPrintElementData.selectDetail.trims.prints
}
if(editPrintElementData.selectDetail.newDetail?.[editPrintElementData.currentDetailType]){
arr = editPrintElementData.selectDetail.newDetail[editPrintElementData.currentDetailType]
arr = editPrintElementData.selectDetail.trims.prints
}
// if(editPrintElementData.selectDetail.newDetail?.[editPrintElementData.currentDetailType]){
// arr = editPrintElementData.selectDetail.newDetail[editPrintElementData.currentDetailType]
// }
if(arr && arr.length > 0){
editPrintElementData.printStyleList[props.type].single = []
editPrintElementData.printStyleList[props.type].overall = []

View File

@@ -271,7 +271,7 @@ export default defineComponent({
},
selectColor:{
handler(newVal,oldVal){
if(typeof newVal?.rgba?.r !== 'number' && typeof newVal?.rgba?.r !== 'string'){
if(newVal?.rgba?.r == null){
this.colorList[this.selectIndex] = {}
return
}
@@ -388,7 +388,7 @@ export default defineComponent({
//选择不同的色块
selectColorItem(index,color){
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])
}else{
hex = '#FFFFFF'
@@ -402,7 +402,7 @@ export default defineComponent({
if(this.driver__.driver){
driverObj__.moveNext()
}
if(color?.rgba?.r){
if(color?.rgba?.r != null){
this.selectColor = color
this.selectColor.hex = hex
}

View File

@@ -283,7 +283,7 @@ export default defineComponent({
},
selectColor:{
handler(newVal,oldVal){
if(typeof newVal?.rgba?.r !== 'number' && typeof newVal?.rgba?.r !== 'string'){
if(newVal?.rgba?.r == null){
this.colorList[this.selectIndex] = {}
return
}
@@ -400,7 +400,7 @@ export default defineComponent({
//选择不同的色块
selectColorItem(index,color){
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])
}else{
hex = '#FFFFFF'
@@ -414,7 +414,7 @@ export default defineComponent({
if(this.driver__.driver){
driverObj__.moveNext()
}
if(color?.rgba?.r){
if(color?.rgba?.r != null){
this.selectColor = color
this.selectColor.hex = hex
}