From ba060c40315dddd119c2713457bc17d3a52c26ca Mon Sep 17 00:00:00 2001 From: YuanFeng <770153798@qq.com> Date: Mon, 25 Nov 2024 09:09:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DraftDesign/components/DesignPropEdit.vue | 46 ++++++++++--------- .../DraftDesign/components/DesignPropEdit.vue | 46 ++++++++++--------- 2 files changed, 50 insertions(+), 42 deletions(-) diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue index b89de94..c8b9a15 100644 --- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue +++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/components/DesignPropEdit.vue @@ -201,7 +201,8 @@ v-for="(img,index) in that.propInfo[tmp.key].dataInfo" :key="index" style="display: flex">
-
+
{ } const findProcessTypeIndex = (index) => { - if(index < 0){ + if (index < 0) { return index; } let processType = 0; @@ -565,8 +566,8 @@ const findProcessTypeIndex = (index) => { // 找到最后一个位置 if (that.propOrderByList[i].shape === ShapeType.vueShapeImage) { processType++; - console.log("@@@@@@",index,i) - if(index === i){ + console.log("@@@@@@", index, i) + if (index === i) { return processType } } @@ -574,7 +575,7 @@ const findProcessTypeIndex = (index) => { return processType; } -const washingInfoListByType = (type,index = -1) => { +const washingInfoListByType = (type, index = -1) => { const typeIndex = findProcessTypeIndex(index); return that.washingInfoList.filter(item => { if (item.type === type && (typeIndex < 0 || (item.processType === `${typeIndex}`))) { @@ -840,7 +841,7 @@ const queryUseLabel = (label) => { } }) // - console.log("lables",that.propInfo) + console.log("lables", that.propInfo) } }) ProductCareItemApi.queryList({ @@ -884,7 +885,7 @@ const showPng = () => { ...that.propInfo || {}, ...that.restInfo || {}, }; - console.log("that.propInfo",that.propInfo) + console.log("that.propInfo", that.propInfo) that.propOrderByList = info.propOrderByList; loading.value = false; }, { @@ -937,8 +938,12 @@ const checkPropInfo = (info) => { return new Promise((resolve, reject) => { let newInfo = cloneDeep(info) let newInfo2 = cloneDeep(info) + const keys = []; + + for (let i = 0; i < that.propOrderByList.length; i++) { + keys.push(that.propOrderByList[i].key); + } - const keys = Object.keys(newInfo); for (let i = 0; i < keys.length; i++) { const key = keys[i]; // 合并相同语言的文字 @@ -1212,21 +1217,20 @@ const checkPropInfo = (info) => { // 查询所有的icon const dis = []; - const keys = Object.keys(that.propInfo); for (let i = 0; i < keys.length; i++) { const tmpKey2 = keys[i] if (that.propInfo[tmpKey2].groupType === GroupTypeEnum.ICON) { - if(that.propInfo[tmpKey2].dataInfo[0].showLabel){ - if( dis.includes(that.propInfo[tmpKey2].dataInfo[0].showLabel)){ - useMessage().notifyError(`${that.propInfo[tmpKey2].groupName}中第${i + 1}项重复`); - that.errorList.push({ - key: `${tmpKey2}_${0}`, - message: "数据重复" - }) - reject("数据重复") - return + if (that.propInfo[tmpKey2].dataInfo[0].showLabel) { + if (dis.includes(that.propInfo[tmpKey2].dataInfo[0].showLabel)) { + useMessage().notifyError(`${that.propInfo[tmpKey2].groupName}中第${i + 1}项重复`); + that.errorList.push({ + key: `${tmpKey2}_${0}`, + message: "数据重复" + }) + reject("数据重复") + return } - dis.push(that.propInfo[keys[i]].dataInfo[0].showLabel) + dis.push(that.propInfo[keys[i]].dataInfo[0].showLabel) } } @@ -1236,7 +1240,7 @@ const checkPropInfo = (info) => { for (let i = 0; i < infoList.length; i++) { mapping[infoList[i].label] = infoList[i].langMapping; } - const keyList = Object.keys(newInfo); + const keyList = keys; const allIcon = []; for (let j = 0; j < keyList.length; j++) { for (let k = 0; k < newInfo[keyList[j]].dataInfo.length; k++) { @@ -1276,7 +1280,7 @@ const checkPropInfo = (info) => { for (let j = 0; j < newArr.length; j++) { // 如果没有选择的不显示 if (newArr[j].label && newArr[j].showLabel) { - newArr[j].label = i === 0 ? mergeLabelStr : '' + newArr[j].label = mergeLabelStr resArr.push(newArr[j]) } } diff --git a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/DesignPropEdit.vue b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/DesignPropEdit.vue index b89de94..c8b9a15 100644 --- a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/DesignPropEdit.vue +++ b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/components/DesignPropEdit.vue @@ -201,7 +201,8 @@ v-for="(img,index) in that.propInfo[tmp.key].dataInfo" :key="index" style="display: flex">
-
+
{ } const findProcessTypeIndex = (index) => { - if(index < 0){ + if (index < 0) { return index; } let processType = 0; @@ -565,8 +566,8 @@ const findProcessTypeIndex = (index) => { // 找到最后一个位置 if (that.propOrderByList[i].shape === ShapeType.vueShapeImage) { processType++; - console.log("@@@@@@",index,i) - if(index === i){ + console.log("@@@@@@", index, i) + if (index === i) { return processType } } @@ -574,7 +575,7 @@ const findProcessTypeIndex = (index) => { return processType; } -const washingInfoListByType = (type,index = -1) => { +const washingInfoListByType = (type, index = -1) => { const typeIndex = findProcessTypeIndex(index); return that.washingInfoList.filter(item => { if (item.type === type && (typeIndex < 0 || (item.processType === `${typeIndex}`))) { @@ -840,7 +841,7 @@ const queryUseLabel = (label) => { } }) // - console.log("lables",that.propInfo) + console.log("lables", that.propInfo) } }) ProductCareItemApi.queryList({ @@ -884,7 +885,7 @@ const showPng = () => { ...that.propInfo || {}, ...that.restInfo || {}, }; - console.log("that.propInfo",that.propInfo) + console.log("that.propInfo", that.propInfo) that.propOrderByList = info.propOrderByList; loading.value = false; }, { @@ -937,8 +938,12 @@ const checkPropInfo = (info) => { return new Promise((resolve, reject) => { let newInfo = cloneDeep(info) let newInfo2 = cloneDeep(info) + const keys = []; + + for (let i = 0; i < that.propOrderByList.length; i++) { + keys.push(that.propOrderByList[i].key); + } - const keys = Object.keys(newInfo); for (let i = 0; i < keys.length; i++) { const key = keys[i]; // 合并相同语言的文字 @@ -1212,21 +1217,20 @@ const checkPropInfo = (info) => { // 查询所有的icon const dis = []; - const keys = Object.keys(that.propInfo); for (let i = 0; i < keys.length; i++) { const tmpKey2 = keys[i] if (that.propInfo[tmpKey2].groupType === GroupTypeEnum.ICON) { - if(that.propInfo[tmpKey2].dataInfo[0].showLabel){ - if( dis.includes(that.propInfo[tmpKey2].dataInfo[0].showLabel)){ - useMessage().notifyError(`${that.propInfo[tmpKey2].groupName}中第${i + 1}项重复`); - that.errorList.push({ - key: `${tmpKey2}_${0}`, - message: "数据重复" - }) - reject("数据重复") - return + if (that.propInfo[tmpKey2].dataInfo[0].showLabel) { + if (dis.includes(that.propInfo[tmpKey2].dataInfo[0].showLabel)) { + useMessage().notifyError(`${that.propInfo[tmpKey2].groupName}中第${i + 1}项重复`); + that.errorList.push({ + key: `${tmpKey2}_${0}`, + message: "数据重复" + }) + reject("数据重复") + return } - dis.push(that.propInfo[keys[i]].dataInfo[0].showLabel) + dis.push(that.propInfo[keys[i]].dataInfo[0].showLabel) } } @@ -1236,7 +1240,7 @@ const checkPropInfo = (info) => { for (let i = 0; i < infoList.length; i++) { mapping[infoList[i].label] = infoList[i].langMapping; } - const keyList = Object.keys(newInfo); + const keyList = keys; const allIcon = []; for (let j = 0; j < keyList.length; j++) { for (let k = 0; k < newInfo[keyList[j]].dataInfo.length; k++) { @@ -1276,7 +1280,7 @@ const checkPropInfo = (info) => { for (let j = 0; j < newArr.length; j++) { // 如果没有选择的不显示 if (newArr[j].label && newArr[j].showLabel) { - newArr[j].label = i === 0 ? mergeLabelStr : '' + newArr[j].label = mergeLabelStr resArr.push(newArr[j]) } }