From 8bc0a52ab8e33186e3b71b6e0fe1e37a72e05edc Mon Sep 17 00:00:00 2001 From: X1627315083 <1627315083@qq.com> Date: Thu, 8 May 2025 15:20:22 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=9C=E8=89=B2=E9=97=AE=E9=A2=98=E9=83=A8?= =?UTF-8?q?=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 2 +- src/component/DetailCopy/designDetail.vue | 8 ++-- .../DetailCopy/detailLeft/colorBox/index.vue | 45 ++++++++++--------- .../DetailCopy/model/modelPosition.vue | 20 +++++---- 4 files changed, 41 insertions(+), 34 deletions(-) diff --git a/.env.dev b/.env.dev index a3e58cee..e7d91588 100644 --- a/.env.dev +++ b/.env.dev @@ -6,7 +6,7 @@ NODE_ENV = 'development' VUE_APP_BASE_URL = 'https://develop.api.aida.com.hk' # VUE_APP_BASE_URL = 'https://www.api.aida.com.hk' # 徐佩 -# VUE_APP_BASE_URL = 'http://192.168.1.3:5567' +# VUE_APP_BASE_URL = 'http://192.168.31.118:5567' # 海波 # VUE_APP_BASE_URL = 'http://192.168.1.7:5567' diff --git a/src/component/DetailCopy/designDetail.vue b/src/component/DetailCopy/designDetail.vue index c49d5554..c89b653b 100644 --- a/src/component/DetailCopy/designDetail.vue +++ b/src/component/DetailCopy/designDetail.vue @@ -168,9 +168,9 @@ export default defineComponent({ }else{ item.color = { rgba:{ - r:255, - g:255, - b:255, + r:undefined, + g:undefined, + b:undefined, } } } @@ -264,7 +264,7 @@ export default defineComponent({ let isCurrent = list[i].id == detailData?.selectDetail?.id let data:any = { changed:false, - color:(detailData.currentDetailType == 'color' && isCurrent)?(newData?.rgba?`${newData.rgba.r} ${newData.rgba.g} ${newData.rgba.b}`:''):`${list[i].color.rgba.r} ${list[i].color.rgba.g} ${list[i].color.rgba.b}`, + color:(detailData.currentDetailType == 'color' && isCurrent)?(newData?.rgba?.r?`${newData.rgba.r} ${newData.rgba.g} ${newData.rgba.b}`:''):(list[i].color.rgba.r?`${list[i].color.rgba.r} ${list[i].color.rgba.g} ${list[i].color.rgba.b}`:''), designType:(newData && detailData.currentDetailType == 'sketch' && isCurrent)?newData.designType:list[i].designType, id:(newData && detailData.currentDetailType == 'sketch' && isCurrent)?newData.id:list[i].id, // maskMinioUrl:'', diff --git a/src/component/DetailCopy/detailLeft/colorBox/index.vue b/src/component/DetailCopy/detailLeft/colorBox/index.vue index 17ab6a0f..6365c38f 100644 --- a/src/component/DetailCopy/detailLeft/colorBox/index.vue +++ b/src/component/DetailCopy/detailLeft/colorBox/index.vue @@ -7,10 +7,12 @@
Color pelette
-
-
{{ item.hex }}
-
{{ item.name }}
-
+
+
+
{{ item.hex }}
+
{{ item.name }}
+
+
Choose color from image
@@ -79,7 +81,7 @@ export default defineComponent({ tcxToColor:'', }) watch(()=>colorData.selectColor,async (newVal,oldVal)=>{ - if(!newVal?.name && newVal.rgba){ + if(!newVal?.name && newVal.rgba && newVal.rgba?.r){ let data:any = await getColorName(newVal.rgba) newVal.name = data.name newVal.tcx = data.tcx @@ -111,6 +113,7 @@ export default defineComponent({ colorData.selectDetail.color.rgba?.g == colorData.allBoardData.colorBoards?.[index]?.rgba?.[1] && colorData.selectDetail.color.rgba?.b == colorData.allBoardData.colorBoards?.[index]?.rgba?.[2] && JSON.stringify(colorData.selectDetail.color.gradient) == JSON.stringify(colorData.allBoardData.colorBoards?.[index]?.gradient) + && colorData.selectDetail.color.rgba?.r ){ if(!isOneChecked){ isOneChecked = true @@ -120,7 +123,7 @@ export default defineComponent({ colorData.selectColor = item colorData.colorList.index = index } - }else{ + }else if(colorData.selectDetail.color.rgba?.r){ if(!isNoSelect){ item = { hex:rgbaToHex([colorData.selectDetail.color.rgba.r,colorData.selectDetail.color.rgba.g,colorData.selectDetail.color.rgba.b]), @@ -174,7 +177,7 @@ export default defineComponent({ } const setSelectColor = (item:any,index:number)=>{ colorData.colorList.index = index - if(item.rgba){ + if(item?.rgba){ colorData.selectColor = item }else{ // colorData.colorList.list[colorData.selectDetail.id][index] = {} @@ -269,19 +272,21 @@ export default defineComponent({ &.active{ border: 2px solid #000; } - > .background{ - flex: 1; - height: 7rem; - width: 100%; - } - > .text{ - font-weight: 600; - line-height: 2rem; - text-align: center; - } - > .backgroundImg{ - width: 100%; - height: 100%; + >.box{ + > .background{ + flex: 1; + height: 7rem; + width: 100%; + } + > .text{ + font-weight: 600; + line-height: 2rem; + text-align: center; + } + > .backgroundImg{ + width: 100%; + height: 100%; + } } } } diff --git a/src/component/DetailCopy/model/modelPosition.vue b/src/component/DetailCopy/model/modelPosition.vue index 22b9ec1a..863e7b14 100644 --- a/src/component/DetailCopy/model/modelPosition.vue +++ b/src/component/DetailCopy/model/modelPosition.vue @@ -8,7 +8,7 @@
-
+