fix
This commit is contained in:
@@ -100,12 +100,17 @@ export default defineComponent({
|
||||
tcxToColor:'',
|
||||
})
|
||||
watch(()=>colorData.selectColor,async (newVal,oldVal)=>{
|
||||
if(newVal.rgba && newVal.rgba?.r != null){
|
||||
let data:any = await getColorName(newVal.rgba)
|
||||
newVal.name = data.name
|
||||
newVal.tcx = data.tcx
|
||||
colorData.colorList.list[colorData.selectDetail.id][colorData.colorList.index] = newVal
|
||||
data.rgba = newVal.rgba
|
||||
console.log('=======',123)
|
||||
if((newVal.rgba && newVal.rgba?.r != null) || newVal.gradient != null){
|
||||
console.log('=======',123)
|
||||
let data :any = {}
|
||||
if(newVal.rgba?.r != null){
|
||||
data = await getColorName(newVal.rgba)
|
||||
newVal.name = data.name
|
||||
newVal.tcx = data.tcx
|
||||
colorData.colorList.list[colorData.selectDetail.id][colorData.colorList.index] = newVal
|
||||
data.rgba = newVal.rgba
|
||||
}
|
||||
if(newVal.gradient){
|
||||
data.gradient = newVal.gradient
|
||||
}
|
||||
@@ -115,6 +120,7 @@ export default defineComponent({
|
||||
}
|
||||
store.commit('DesignDetail/setNewDetail',value)
|
||||
}else{
|
||||
console.log('=======',123)
|
||||
let value = {
|
||||
data:{},
|
||||
str:'color'
|
||||
@@ -124,13 +130,11 @@ export default defineComponent({
|
||||
})
|
||||
watch(()=>colorData.selectDetail.id,(newVal,oldVal)=>{
|
||||
if(!newVal)return
|
||||
console.log(12312)
|
||||
if(!colorData.colorList?.list?.[newVal]){
|
||||
colorData.colorList.list[newVal] = []
|
||||
}else{
|
||||
return
|
||||
}
|
||||
console.log(12312)
|
||||
let isNoSelect = false
|
||||
let pushIndex = 0
|
||||
for (let index = 0; index < 9; index++) {
|
||||
@@ -146,7 +150,6 @@ export default defineComponent({
|
||||
colorData.selectDetail.color.rgba?.b == color?.rgba?.b) ||
|
||||
(JSON.stringify(colorData.selectDetail.color.gradient) == JSON.stringify(color?.gradient) && colorData.selectDetail.color.gradient)
|
||||
){
|
||||
console.log(123)
|
||||
isNoSelect = true
|
||||
colorData.selectColor = item
|
||||
colorData.colorList.index = index
|
||||
@@ -173,18 +176,21 @@ export default defineComponent({
|
||||
}
|
||||
if(!isNoSelect){
|
||||
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,
|
||||
rgba:{
|
||||
r:color.rgba.r,
|
||||
g:color.rgba.g,
|
||||
b:color.rgba.b,
|
||||
},
|
||||
tcx:color.tcx,
|
||||
name:color.name,
|
||||
} as any
|
||||
let item:any = {}
|
||||
if(color?.rgba?.r != null){
|
||||
item = {
|
||||
hex:rgbaToHex([color.rgba.r,color.rgba.g,color.rgba.b]),
|
||||
id:color.id,
|
||||
rgba:{
|
||||
r:color.rgba.r,
|
||||
g:color.rgba.g,
|
||||
b:color.rgba.b,
|
||||
},
|
||||
tcx:color.tcx,
|
||||
name:color.name,
|
||||
} as any
|
||||
}
|
||||
|
||||
if(color.gradient){
|
||||
item.gradient = color.gradient
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user