From fb0bfa775d8750205b9c2590095a22e94f558b13 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Thu, 22 Aug 2024 16:17:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E8=81=94=E8=A1=A8=E5=8D=95-=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=A1=AB=E5=85=85=E8=A7=84=E5=88=99-v0.4=20=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E9=A1=B5=E9=9D=A2=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignForm/formControlPropertiNew.vue | 76 ++++++++++++++++++- .../associatedFormsChildFillRole.vue | 1 + .../associatedFormsFillRole.vue | 8 +- 3 files changed, 81 insertions(+), 4 deletions(-) diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index 144f5e3..1b1ddd6 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -2658,7 +2658,76 @@ function selectedOrDelChildRole(){ } //将已被选择的要填充的关联其他表单的表单的子表字段设为不可选择 function childRoleRightChanged(){ - alert(1) + let masterSelectedArr: any[] = [] + controlData.value.control?.fillRoles?.master.forEach(function(item: any) { + if(item.rightValue!=""){ + masterSelectedArr.push(item) + } + }); + let childSelectedArr: any[] = [] + controlData.value.control?.fillRoles?.child.forEach(function(item: any) { + item.childRoles.forEach((element: any) => { + if(element.rightValue!=""){ + childSelectedArr.push(element) + } + }); + }); + //主表控制 start + if(associatedFormsCurrentFormFieldTree1.value){ + associatedFormsCurrentFormFieldTree1.value[0].children?.forEach(function(item: any){ + if(item.type=="table"){ + item.children.forEach((element: any) => { + element.disabled = false + }); + }else{ + item.disabled = false + } + + }) + } + if(associatedFormsCurrentFormFieldTree1.value){ + associatedFormsCurrentFormFieldTree1.value[0].children?.forEach(function(item: any){ + if(item.type=="table"){ + item.children.forEach((element: any) => { + masterSelectedArr.forEach((j:any) => { + if(j.rightValue==element.id){ + element.disabled = true + } + }) + }); + }else{ + masterSelectedArr.forEach((element:any) => { + if(element.rightValue==item.id){ + item.disabled = true + } + }) + } + }) + } + //主表控制 end + + //子表控制start + if(currentFormChildTableFieldsForFillRole.value){ + currentFormChildTableFieldsForFillRole.value[0]?.children?.forEach((element: any) => { + element.children.forEach((item: any) => { + childSelectedArr.forEach((j:any) => { + item.disabled = false + }) + }); + }); + } + if(currentFormChildTableFieldsForFillRole.value){ + currentFormChildTableFieldsForFillRole.value[0]?.children?.forEach((element: any) => { + element.children.forEach((item: any) => { + childSelectedArr.forEach((j:any) => { + if(j.rightValue==item.id){ + item.disabled = true + } + }) + }); + }); + } + //子表控制end } //确定回调 @@ -2726,6 +2795,7 @@ function addChildFillRole(){ //currentChildTableCount //controlData.value.control.fillRoles.child.length selectedOrDelChildRole() + childRoleRightChanged() if(controlData.value.control.fillRoles.child.length { :left-tree-source = "asfasfMasterFieldTree" :right-tree-source = "associatedFormsCurrentFormFieldTree1" :current-key="controlData.control.fillRoles.master[index].id" - @del-role = "delRole" + @del-role = "delRole" + @child-role-right-changed = "childRoleRightChanged" > diff --git a/src/widget/associatedforms/associatedFormsChildFillRole.vue b/src/widget/associatedforms/associatedFormsChildFillRole.vue index 9de0b4a..ec45768 100644 --- a/src/widget/associatedforms/associatedFormsChildFillRole.vue +++ b/src/widget/associatedforms/associatedFormsChildFillRole.vue @@ -268,6 +268,7 @@ function handleFieldTreeContextmenuRange(MouseEvent: any, object: any, Node: any } onMounted(() => { emit('selectedOrDelChildRole') + emit('childRoleRightChanged') }) diff --git a/src/widget/associatedforms/associatedFormsFillRole.vue b/src/widget/associatedforms/associatedFormsFillRole.vue index 4a1ab27..0b2f4e0 100644 --- a/src/widget/associatedforms/associatedFormsFillRole.vue +++ b/src/widget/associatedforms/associatedFormsFillRole.vue @@ -58,20 +58,24 @@ rightValue1.value = props.rightValue -let emit = defineEmits(["update:leftValue", "update:rightValue","delRole"]); +let emit = defineEmits(["update:leftValue", "update:rightValue","delRole","childRoleRightChanged"]); function leftChanged(){ emit('update:leftValue',leftValue1) } function rightChanged(){ emit('update:rightValue',rightValue1) + emit('childRoleRightChanged') } function delRole(){ //alert(props.currentKey) emit('delRole',props.currentKey) + emit('childRoleRightChanged') } - +onMounted(() => { + emit('childRoleRightChanged') +})