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" >