From 191ceaa547ee9134fcdbcbafce89457619f963d3 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Thu, 22 Aug 2024 11:45:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=90=E8=A1=A8=E5=A1=AB=E5=85=85=E8=A7=84?= =?UTF-8?q?=E5=88=99=E8=A6=81=E5=8F=97=E5=88=B0=E5=AD=90=E8=A1=A8=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E7=9A=84=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联表单数据填充规则根据已选择子表的数目和id将已选择的子表置为不可选择 已选择子表后不允许修改,只能删除重选 可选择的字段中将系统默认字段全部去除 --- .../DesignForm/formControlPropertiNew.vue | 42 ++++++++++++++++++- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index fa2fbe5..84098f5 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -2107,6 +2107,13 @@ const asfasfFieldTreeOptionsValue3 = ref() let currentChildTableCount = 0 +function removeFirstNumElements(arr: string | any[],num:number) { + if (arr.length < num) { + return []; + } + return arr.slice(num); +} + function formidChanged(){ if(controlData.value.control.formid===''){ @@ -2122,8 +2129,14 @@ function formidChanged(){ let dataOnlyChild = JSON.parse(JSON.stringify(data.children)) let dataOnlyChild1 = JSON.parse(JSON.stringify(data.children)) dataExceptChild = dataExceptChild.filter((obj: { type: string }) => obj.type!== 'table'); + console.log(dataExceptChild) + dataExceptChild = removeFirstNumElements(dataExceptChild,8); dataOnlyChild = dataOnlyChild.filter((obj: { type: string }) => obj.type== 'table'); dataOnlyChild1 = dataOnlyChild1.filter((obj: { type: string }) => obj.type== 'table'); + console.log(dataOnlyChild1) + dataOnlyChild1.forEach((element: any) => { + element.children = removeFirstNumElements(element.children,6); + }); /* console.log(dataOnlyChild1) console.log(dataOnlyChild) */ for(let m = 0;m() +const associatedFormsCurrentFormFieldTree1 = ref() const associatedFormsCurrentFormFieldTreeNoTable = ref() const associatedFormsCurrentFormFieldTreeForGlxxsz = ref() let associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf = ref() @@ -2255,8 +2269,17 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => { //alert("cfid为空") }else{ let resData = ref(data.children) + let resDataExceptSystemFields = JSON.parse(JSON.stringify(data.children)) let resDataNoTable = JSON.parse(JSON.stringify(data.children)) - + console.log("fdsfdsasdfahjdsaflksjl;kjsdolkfjlksdjiofweklsdjknfsadkoljsfdao") + resDataExceptSystemFields = removeFirstNumElements(resDataExceptSystemFields,8) + resDataExceptSystemFields.forEach((element: any) => { + if(element.type=="table"){ + //console.log(element) + element.children = removeFirstNumElements(element.children,6) + } + }); + console.log(resDataExceptSystemFields) //let rootid_ = data.value.label associatedFormsCurrentFormFieldTree.value = [{ id: 'rootid_'+data.label, @@ -2265,6 +2288,15 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => { treeAttrs: data.treeAttrs, disabled: true, }] + + + associatedFormsCurrentFormFieldTree1.value = [{ + id: 'rootid_'+data.label, + label: '当前表单-'+data.treeAttrs.show, + children: [...resDataExceptSystemFields], + treeAttrs: data.treeAttrs, + disabled: true, + }] resDataNoTable = resDataNoTable.filter((item: { type: string | null }) => item.type!="table") @@ -2460,8 +2492,14 @@ function associatedFormsDataRangeDialoghandle(){ let dataOnlyChild = JSON.parse(JSON.stringify(data.children)) let dataOnlyChild1 = JSON.parse(JSON.stringify(data.children)) dataExceptChild = dataExceptChild.filter((obj: { type: string }) => obj.type!== 'table'); + console.log(dataExceptChild) + dataExceptChild = removeFirstNumElements(dataExceptChild,8); dataOnlyChild = dataOnlyChild.filter((obj: { type: string }) => obj.type== 'table'); dataOnlyChild1 = dataOnlyChild1.filter((obj: { type: string }) => obj.type== 'table'); + console.log(dataOnlyChild1) + dataOnlyChild1.forEach((element: any) => { + element.children = removeFirstNumElements(element.children,6); + }); /* console.log(dataOnlyChild1) console.log(dataOnlyChild) */ for(let m = 0;m { v-model:left-value="controlData.control.fillRoles.master[index].leftValue" v-model:right-value="controlData.control.fillRoles.master[index].rightValue" :left-tree-source = "asfasfMasterFieldTree" - :right-tree-source = "associatedFormsCurrentFormFieldTree" + :right-tree-source = "associatedFormsCurrentFormFieldTree1" :current-key="controlData.control.fillRoles.master[index].id" @del-role = "delRole" >