From 74df03ee777a387c2d5da5bb642e2fe51f8d8f38 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Tue, 13 Jan 2026 11:27:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=90=E8=A1=A8=E6=B7=BB=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E8=A1=8C=E5=BC=82=E5=B8=B8=E4=BF=AE=E5=A4=8D=20=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E6=97=A0=E6=B3=95=E7=BC=96=E8=BE=91=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/formTable/index.vue | 2 +- src/components/lowCode/tablePage.vue | 39 +++++++++++++++++++++++++--- src/views/formTable/pageInfo.vue | 10 ++++++- 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/src/components/formTable/index.vue b/src/components/formTable/index.vue index e367dc5..9231cb2 100644 --- a/src/components/formTable/index.vue +++ b/src/components/formTable/index.vue @@ -1457,7 +1457,7 @@ function showOrHide(data: any) { for (let j = 0; j < checkboxShowConfigArr2[i].length; j++) { //console.log(j) //console.log(checkboxShowConfigArr2[i][j].showFields) - if (checkboxShowConfigArr2[i][j].showFields.length > 0) { + if (checkboxShowConfigArr2[i][j] && checkboxShowConfigArr2[i][j].showFields && checkboxShowConfigArr2[i][j].showFields.length > 0) { for (let n = 0; n < checkboxShowConfigArr2[i][j].showFields.length; n++) { let fieldKeyArr = checkboxShowConfigArr2[i][j].showFields[n].split(":"); let fieldKeyStr = fieldKeyArr[fieldKeyArr.length - 1]; diff --git a/src/components/lowCode/tablePage.vue b/src/components/lowCode/tablePage.vue index 18be153..28eaadf 100644 --- a/src/components/lowCode/tablePage.vue +++ b/src/components/lowCode/tablePage.vue @@ -115,10 +115,11 @@ function autoAddColumnOne(){ if(defaultOneFlag.value){ if(orgAndManTreeLoadedFlag.value){ //alert(1) - addColumn() + //console.error("autoAddColumnOne") + addColumn2() defaultOneAddedFlag.value = true }else{ - console.log("wait autoAddColumnOne") + //console.log("wait autoAddColumnOne") if(defaultOneAddedFlag.value){ }else{ @@ -146,7 +147,8 @@ function autoAddColumnOne(){ function waitProvideFormPropsModelDo(){ setTimeout(()=>{ if(tableDataNew){ - addColumn() + //console.error("waitProvideFormPropsModelDo") + addColumn2() defaultOneAddedFlag.value = true }else{ waitProvideFormPropsModelDo @@ -156,7 +158,8 @@ function waitProvideFormPropsModelDo(){ } const addColumn = () => { - console.log("如果编辑页禁用时--------->",tableDataNew.value) + /* console.error("addColumn") + console.log("如果编辑页禁用时--------->",tableDataNew.value) */ const temp: any = {} if (props.data.list) { console.log(props.data.list) @@ -168,6 +171,34 @@ const addColumn = () => { //console.log(temp) tableDataNew.value.push(jsonParseStringify(temp)) + //console.log(tableDataNew.value) + addBtnFlag.value = false + } +} + +const addColumn2 = () => { + /* console.error("addColumn") + console.log("如果编辑页禁用时--------->", tableDataNew.value) */ + const temp: any = {} + if (props.data.list) { + //console.log(props.data.list) + props.data.list.forEach((item: any) => { + if (item.name) { + temp[item.name] = item.control.modelValue + } + }) + + // 核心新逻辑:检测数组是否已有元素(长度是否大于0),无元素时才执行push + if (tableDataNew.value.length === 0) { + // 仅当数组为空时,才添加新元素 + tableDataNew.value.push(jsonParseStringify(temp)); + //console.log("数组为空,已添加最新元素:", tableDataNew.value); + } else { + // 数组已有元素,不执行添加操作,可添加日志提示 + //console.log("数组中已存在元素,不重复添加"); + } + + console.log(tableDataNew.value) addBtnFlag.value = false } } diff --git a/src/views/formTable/pageInfo.vue b/src/views/formTable/pageInfo.vue index fe80e08..8e2b499 100644 --- a/src/views/formTable/pageInfo.vue +++ b/src/views/formTable/pageInfo.vue @@ -416,7 +416,15 @@ const changeKeyVal = (key: any, val: any, type: any, attribute: any) => { // gainFlowChart.nodelPeople = nodelUserList; // gainFlowChart.id = flowMap; console.log("获取工作流不进图--gainFlowChart--->",props.stateForm) - flowLogPage.value.refreshWorkFlow(props.stateForm.taskKey,flowFactor,nodelUserList) +/* + console.log(flowLogPage.value) + console.log(props.stateForm.taskKey) + console.log(flowFactor) + console.log(nodelUserList) */ + if(flowLogPage.value){ + flowLogPage.value.refreshWorkFlow(props.stateForm.taskKey,flowFactor,nodelUserList) + } + } }