From 0eeb704487d183a2844c551ad8516b876d588156 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Wed, 18 Jun 2025 11:44:44 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=A9=BF=E6=A2=AD=E6=A1=86=E5=B7=B2=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=85=83=E7=B4=A0=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E4=BC=98=E5=8C=96=202.=E7=A9=BF=E9=94=81=E6=89=A3=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E8=AE=B0=E5=BD=95=E5=B1=95=E7=A4=BA=E4=BC=98=E5=8C=96?= =?UTF-8?q?id=E4=B8=BAlabel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/app/index.vue | 13 +-- .../DesignForm/tableListPage/formPageCont.vue | 82 ++++++++++++++++++- .../DesignForm/tableListPage/index.vue | 40 ++++----- .../lowcodetransfer/lowcodeTransfer.vue | 4 +- 4 files changed, 110 insertions(+), 29 deletions(-) diff --git a/src/components/DesignForm/app/index.vue b/src/components/DesignForm/app/index.vue index f06e0de..7d8cab5 100644 --- a/src/components/DesignForm/app/index.vue +++ b/src/components/DesignForm/app/index.vue @@ -1087,7 +1087,7 @@ function mapIdsToLabels(treeNodes: TreeNode[], ids1: string): string[] { treeNodes.forEach(root => traverse(root)); //console.log(ids) // 将id数组转换为label数组 - return ids.map(id => idToLabelMap[id]); + return ids.map(id => idToLabelMap[id] || "已删除的节点(id):"+id); } const asfGetPageData = (asfFormId: any, asfToSelectMastersKey: any) => { @@ -1862,8 +1862,9 @@ const readerColumnSun = (column: any) => { > { { { + + + //console.log(objMastesform.list) + transferDetails = objMastesform.list.filter((item: any) => { + return item.type == "lowcodeTransfer"; + }); formLoading.value = false; //alert(props.pageInfo.masters_key) gainEditDataLog({ id: props.pageInfo.masters_key }).then(({ data }) => { - // console.log("获取修改记录-1111-->",data) + //console.log(formState.formData.list) + + //console.log("获取修改记录-1111-->",data) + transferDetails.forEach((element: any) => { + //console.log(element) + data.forEach((obj: any) => { + //console.log(obj.masterdata) + obj.masterdata.forEach((item: any) => { + if(item.field==element.name){ + //console.log(element.control.fixedOptions) + //console.log(item) + + for (const key in item) { + const value = item[key]; + // 确保只处理对象自身的属性(不包括原型链上的) + if (Object.prototype.hasOwnProperty.call(item, key)) { + + if(key=="value"){ + + // 特殊处理数组/嵌套对象(使用JSON格式化) + const formattedValue = + (Array.isArray(value) || (typeof value === 'object' && value !== null)) + ? JSON.stringify(value, null, 2) + : value; + + //console.log(`${key}: ${formattedValue}`); + if(item[key]&&item[key].length>0){ + item[key] = mapIdsToLabels(element.control.fixedOptions,item[key]) + } + + } + } + } + + } + }); + }); + }); + pageLog.value = data; }); }); @@ -169,6 +215,38 @@ watch( } } ); + + + +interface TreeNode { + id: string; + label: string; + disabled: boolean; + children: TreeNode[]; +} + +function mapIdsToLabels(treeNodes: TreeNode[], ids1: string): string[] { + /* console.log(treeNodes) + console.log(ids1) */ + const ids: string[] = JSON.parse(ids1); + // 创建id到label的映射字典 + const idToLabelMap: Record = {}; + + // 递归遍历树节点并填充映射字典 + function traverse(node: TreeNode) { + idToLabelMap[node.id] = node.label; // 存储当前节点的映射 + node.children.forEach(child => traverse(child)); // 递归处理子节点 + } + + // 遍历根节点列表 + treeNodes.forEach(root => traverse(root)); + //console.log(ids) + // 将id数组转换为label数组 + return ids.map(id => idToLabelMap[id]); +} + + + /** @ 作者: 秦东 @ 时间: 2024-04-03 14:25:15 @@ -194,6 +272,8 @@ const pageLog = ref([]); let gainTaskFormInfoData: customerFormVersionCont; let gainTaskFormInfoPromise: any[] = []; + + /** @ 作者: 秦东 @ 时间: 2024-04-03 14:33:15 diff --git a/src/components/DesignForm/tableListPage/index.vue b/src/components/DesignForm/tableListPage/index.vue index a29e9ac..3e631a9 100644 --- a/src/components/DesignForm/tableListPage/index.vue +++ b/src/components/DesignForm/tableListPage/index.vue @@ -1020,25 +1020,25 @@ const getPageData = () => { data.data.list.forEach((obj: any) => { //console.log(obj) for (const key in obj) { - // 确保只处理对象自身的属性(不包括原型链上的) - if (Object.prototype.hasOwnProperty.call(obj, key)) { - const value = obj[key]; - - // 特殊处理数组/嵌套对象(使用JSON格式化) - const formattedValue = - (Array.isArray(value) || (typeof value === 'object' && value !== null)) - ? JSON.stringify(value, null, 2) - : value; - - //console.log(`${key}: ${formattedValue}`); - if(key==element.field){ - //console.log(key) - /* console.log(element.control.fixedOptions) - console.log(obj[key]) */ - obj[key] = mapIdsToLabels(element.control.fixedOptions,obj[key]) - } - } - } + // 确保只处理对象自身的属性(不包括原型链上的) + if (Object.prototype.hasOwnProperty.call(obj, key)) { + const value = obj[key]; + + // 特殊处理数组/嵌套对象(使用JSON格式化) + const formattedValue = + (Array.isArray(value) || (typeof value === 'object' && value !== null)) + ? JSON.stringify(value, null, 2) + : value; + + //console.log(`${key}: ${formattedValue}`); + if(key==element.field){ + //console.log(key) + /* console.log(element.control.fixedOptions) + console.log(obj[key]) */ + obj[key] = mapIdsToLabels(element.control.fixedOptions,obj[key]) + } + } + } }); }); @@ -1085,7 +1085,7 @@ function mapIdsToLabels(treeNodes: TreeNode[], ids1: string): string[] { treeNodes.forEach(root => traverse(root)); //console.log(ids) // 将id数组转换为label数组 - return ids.map(id => idToLabelMap[id]); + return ids.map(id => idToLabelMap[id] || "已删除的节点( id : "+id+") "); } const asfGetPageData = (asfFormId: any, asfToSelectMastersKey: any) => { diff --git a/src/widget/lowcodetransfer/lowcodeTransfer.vue b/src/widget/lowcodetransfer/lowcodeTransfer.vue index 90b00fd..a7b9525 100644 --- a/src/widget/lowcodetransfer/lowcodeTransfer.vue +++ b/src/widget/lowcodetransfer/lowcodeTransfer.vue @@ -450,11 +450,11 @@ watch(keyword, (newVal) => { - console.log(fuzzyTreeSearch(userList.value,newVal)) + //console.log(fuzzyTreeSearch(userList.value,newVal)) userList1.value = fuzzyTreeSearch(userList.value,newVal) - console.log(userList1.value) + //console.log(userList1.value) //treeRef.value.data = fuzzyTreeSearch(treeRefValueData,newVal) watchCount++ isShowMore()