diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index 2b75286..fa2fbe5 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -2581,14 +2581,33 @@ watch(associatedFormsDataRangeDialogFlag, (val) => { } }) //关联表单数据填充规则根据已选择子表的数目和id将已选择的子表置为不可选择 -watch(() => controlData.value.control?.fillRoles?.child?.length, (newValue, oldValue) => { - /* if (newValue!== oldValue) { - console.log('变量值发生变化:', newValue); - } */ - console.log(asfasfChildTableList.value) - console.log(controlData.value.control?.fillRoles?.child) -}); - +function selectedOrDelChildRole(){ + + //console.log(asfasfChildTableList.value) + //console.log(controlData.value.control?.fillRoles?.child) + let selectedArr: any[] = [] + controlData.value.control?.fillRoles?.child.forEach(function(item: any) { + if(item.tableKey!=""){ + selectedArr.push(item) + } + }); + //console.log(selectedArr) + if(asfasfChildTableList.value){ + asfasfChildTableList.value[0].children?.forEach(function(item: any){ + item.disabled=false + }) + } + if(asfasfChildTableList.value){ + asfasfChildTableList.value[0].children?.forEach(function(item: any){ + selectedArr.forEach(function(i: any){ + if(i.tableKey==item.id){ + item.disabled=true + } + }) + }) + } + +} //确定回调 @@ -2655,6 +2674,7 @@ function addChildFillRole(){ //子表填充规则要受到子表数量的限制 //currentChildTableCount //controlData.value.control.fillRoles.child.length + selectedOrDelChildRole() if(controlData.value.control.fillRoles.child.length { v-model:selected-child-table="controlData.control.fillRoles.child[index].tableKey" v-model:filter-condition="controlData.control.fillRoles.child[index].filterCondition" v-model:child-roles = "controlData.control.fillRoles.child[index].childRoles" - v-model:child-table-list="asfasfChildTableList" + :child-table-list="asfasfChildTableList" :asfasf-field-tree="asfasfFieldTree" :tree-default-props="treeDefaultProps" :filter-node="filterNode" @@ -4602,7 +4625,7 @@ const radioChangeSet = (val:any) => { :associated-forms-current-form-field-tree= "associatedFormsCurrentFormFieldTree" :asfasf-child-table-fields = "asfasfChildTableFields" :current-key="controlData.control.fillRoles.child[index].id" - + @selected-or-del-child-role = "selectedOrDelChildRole" @del-role = "delChildRole" > diff --git a/src/widget/associatedforms/associatedFormsChildFillRole.vue b/src/widget/associatedforms/associatedFormsChildFillRole.vue index 780f709..4ae6653 100644 --- a/src/widget/associatedforms/associatedFormsChildFillRole.vue +++ b/src/widget/associatedforms/associatedFormsChildFillRole.vue @@ -1,12 +1,12 @@