diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index 84098f5..144f5e3 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -1781,7 +1781,7 @@ const showImagePreview = ref(false) controlData.value.item.label = "关联表单" } controlData.value.item.showLabel = true */ - console.log(controlData.value.control.fillRoles.master) + //console.log(controlData.value.control.fillRoles.master) if(controlData.value.control.fillRoles&&controlData.value.control.fillRoles.master.length==0){ controlData.value.control.fillRoles.master = [ { @@ -2129,11 +2129,11 @@ 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) + //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) + //console.log(dataOnlyChild1) dataOnlyChild1.forEach((element: any) => { element.children = removeFirstNumElements(element.children,6); }); @@ -2145,15 +2145,15 @@ function formidChanged(){ let resDataExceptChild = ref(dataExceptChild) let resDataOnlyChild = ref(dataOnlyChild) let resDataOnlyChild1 = ref(dataOnlyChild1) - console.log(resDataOnlyChild1.value) + //console.log(resDataOnlyChild1.value) //console.log(resDataOnlyChild.value) let childTableCount = 0 for(let n = 0;n() const associatedFormsCurrentFormFieldTree = ref() const associatedFormsCurrentFormFieldTree1 = ref() const associatedFormsCurrentFormFieldTreeNoTable = ref() @@ -2270,8 +2270,9 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => { }else{ let resData = ref(data.children) let resDataExceptSystemFields = JSON.parse(JSON.stringify(data.children)) + let currentFormChildTableFields = 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"){ @@ -2279,8 +2280,12 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => { element.children = removeFirstNumElements(element.children,6) } }); - console.log(resDataExceptSystemFields) - //let rootid_ = data.value.label + //在此组装当前表单子表字段数据 + currentFormChildTableFields = currentFormChildTableFields.filter( (item: { type: string }) => item.type == "table" ) + currentFormChildTableFields.forEach((element: any) => { + element.children = removeFirstNumElements(element.children,6) + }); + associatedFormsCurrentFormFieldTree.value = [{ id: 'rootid_'+data.label, label: '当前表单-'+data.treeAttrs.show, @@ -2288,8 +2293,6 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => { treeAttrs: data.treeAttrs, disabled: true, }] - - associatedFormsCurrentFormFieldTree1.value = [{ id: 'rootid_'+data.label, label: '当前表单-'+data.treeAttrs.show, @@ -2297,6 +2300,13 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => { treeAttrs: data.treeAttrs, disabled: true, }] + currentFormChildTableFieldsForFillRole.value = [{ + id: 'rootid_'+data.label, + label: '当前表单-'+data.treeAttrs.show, + children: [...currentFormChildTableFields], + treeAttrs: data.treeAttrs, + disabled: true, + }] resDataNoTable = resDataNoTable.filter((item: { type: string | null }) => item.type!="table") @@ -2646,7 +2656,10 @@ function selectedOrDelChildRole(){ } } - +//将已被选择的要填充的关联其他表单的表单的子表字段设为不可选择 +function childRoleRightChanged(){ + alert(1) +} //确定回调 function handleDetermine(){ @@ -4663,7 +4676,9 @@ const radioChangeSet = (val:any) => { :associated-forms-current-form-field-tree= "associatedFormsCurrentFormFieldTree" :asfasf-child-table-fields = "asfasfChildTableFields" :current-key="controlData.control.fillRoles.child[index].id" + :current-form-child-table-fields-for-fill-role = "currentFormChildTableFieldsForFillRole" @selected-or-del-child-role = "selectedOrDelChildRole" + @child-role-right-changed = "childRoleRightChanged" @del-role = "delChildRole" > diff --git a/src/components/DesignForm/public/form/formItem.vue b/src/components/DesignForm/public/form/formItem.vue index 15b4597..ae70550 100644 --- a/src/components/DesignForm/public/form/formItem.vue +++ b/src/components/DesignForm/public/form/formItem.vue @@ -293,7 +293,7 @@ const getAxiosOptions = debounce((data?: any) => { /* 在这里请求后台获取字段 */ - console.log("formItem---291",props.data.control.optionsValue3Field) + //console.log("formItem---291",props.data.control.optionsValue3Field) if(props.data.control.optionsValue3Field && props.data.control.optionsValue3Field != "" && props.data.control.optionsValue3Field != null && props.data.control.optionsValue3Field != "undefined"){ getFieldRecord(props.data.control.optionsValue3Field).then(({ data }) => { diff --git a/src/widget/associatedforms/associatedFormsChildFillRole.vue b/src/widget/associatedforms/associatedFormsChildFillRole.vue index 4ae6653..9de0b4a 100644 --- a/src/widget/associatedforms/associatedFormsChildFillRole.vue +++ b/src/widget/associatedforms/associatedFormsChildFillRole.vue @@ -32,8 +32,8 @@ check-strictly :render-after-expand="false" filterable /> 的值填充到 + v-model="childRoles1[index].rightValue" style="width: 270px;" :data="currentFormChildTableFieldsForFillRole[0].children" + check-strictly :render-after-expand="false" placeholder="当前表单子表字段" filterable @change="childRoleRightChanged" /> @@ -112,8 +112,14 @@ import { Close } from '@element-plus/icons-vue' import AsfTmFillRoleFilterCondi from '@/widget/associatedforms/asfTmFillRoleFilterCondi.vue' import { v4 as uuidv4 } from "uuid"; -let emit = defineEmits(["delRole", "update:selectedChildTable","update:childTableList","selectedOrDelChildRole"]); +let emit = defineEmits(["delRole", "update:selectedChildTable","update:childTableList","selectedOrDelChildRole","childRoleRightChanged"]); const props = defineProps({ + currentFormChildTableFieldsForFillRole: { + type: Object, + default() { + return {} + } + }, asfasfChildTableFields: { type: Object, default() { @@ -227,6 +233,10 @@ function selectedChildTableChanged(event:any) { emit('selectedOrDelChildRole') } +function childRoleRightChanged(){ + emit('childRoleRightChanged') +} + function delChildRole(item: any) { let id = item.id for (var i = 0; i < childRoles1.value.length; i++) {