diff --git a/src/components/DesignForm/assembly/index.ts b/src/components/DesignForm/assembly/index.ts index f1370b1..70c43ee 100644 --- a/src/components/DesignForm/assembly/index.ts +++ b/src/components/DesignForm/assembly/index.ts @@ -906,13 +906,31 @@ export default [ }, saveFlag: false, asfasfLabel:'', - fillRoles: [ - { - leftValue: '', - rightValue: '', - id: '', - } - ], + fillRoles: { + master: [ + { + leftValue: '', + rightValue: '', + id: '', + }, + ], + child: [ + { + id: '', + tableKey: '', + filterCondition:{ + conditionHtml: '', + conditionHtmlCopy: '', + gongShi:{ + formulaHtml:'', + mathsFormula:'', + mathsString:'', + }, + }, + childRoles:[] + }, + ], + }, }, config: {} }, diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index b4d902e..808c460 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -1775,9 +1775,15 @@ const showImagePreview = ref(false) } }); }else if(controlData.value.type==='associatedForms'){ - console.log(controlData.value.control.fillRoles) - if(controlData.value.control.fillRoles.length==0){ - controlData.value.control.fillRoles = [ + /* if(controlData.value.item.label){ + + }else{ + controlData.value.item.label = "关联表单" + } + controlData.value.item.showLabel = true */ + console.log(controlData.value.control.fillRoles.master) + if(controlData.value.control.fillRoles&&controlData.value.control.fillRoles.master.length==0){ + controlData.value.control.fillRoles.master = [ { leftValue: '', rightValue: '', @@ -1785,7 +1791,26 @@ const showImagePreview = ref(false) } ] } - controlData.value.control.fillRoles[0].id = uuidv4().replaceAll('-','').toString(); + if(controlData.value.control.fillRoles&&controlData.value.control.fillRoles.child.length==0){ + controlData.value.control.fillRoles.child = [ + { + id: '', + tableKey: '', + filterCondition:{ + conditionHtml: '', + conditionHtmlCopy: '', + gongShi:{ + formulaHtml:'', + mathsFormula:'', + mathsString:'', + }, + }, + childRoles:[] + }, + ] + } + controlData.value.control.fillRoles.master[0].id = uuidv4().replaceAll('-','').toString(); + controlData.value.control.fillRoles.child[0].id = uuidv4().replaceAll('-','').toString(); } //实现关联表单设置可选字段中没有当前字段效果 start // console.log(controlData.value.name) @@ -2005,6 +2030,7 @@ const transferDataSourceOptions = [ import AssociatedFormsTinyace from '@/widget/associatedforms/associatedFormsTinyace.vue' import AssociatedFormsTinyaceRange from '@/widget/associatedforms/associatedFormsTinyaceRange.vue' import AssociatedFormsFillRole from '@/widget/associatedforms/associatedFormsFillRole.vue' +import AssociatedFormsChildFillRole from '@/widget/associatedforms/associatedFormsChildFillRole.vue' const treeDefaultProps = { children: 'children', @@ -2071,8 +2097,14 @@ function getAsfasfFieldTreeOptionsValue3() { // const asfasfFieldTree = ref() +const asfasfMasterFieldTree = ref() + +const asfasfChildTableList = ref() + const asfasfFieldTreeOptionsValue3 = ref() +let currentChildTableCount = 0 + function formidChanged(){ if(controlData.value.control.formid===''){ @@ -2084,12 +2116,44 @@ function formidChanged(){ //alert("cfid为空") }else{ let resData = ref(data.children) - //let rootid_ = data.value.label + let dataExceptChild = JSON.parse(JSON.stringify(data.children)) + let dataOnlyChild = JSON.parse(JSON.stringify(data.children)) + dataExceptChild = dataExceptChild.filter((obj: { type: string }) => obj.type!== 'table'); + dataOnlyChild = dataOnlyChild.filter((obj: { type: string }) => obj.type== 'table'); + for(let m = 0;m { label: '当前表单-'+data.treeAttrs.show, children: [...resData.value], treeAttrs: data.treeAttrs, + disabled: true, }] resDataNoTable = resDataNoTable.filter((item: { type: string | null }) => item.type!="table") @@ -2376,13 +2441,47 @@ function associatedFormsDataRangeDialoghandle(){ //alert("cfid为空") }else{ let resData = ref(data.children) - //let rootid_ = data.value.label + let dataExceptChild = JSON.parse(JSON.stringify(data.children)) + let dataOnlyChild = JSON.parse(JSON.stringify(data.children)) + dataExceptChild = dataExceptChild.filter((obj: { type: string }) => obj.type!== 'table'); + dataOnlyChild = dataOnlyChild.filter((obj: { type: string }) => obj.type== 'table'); + for(let m = 0;mstore.activeKey, () => { function addFillRole(){ let onlyNumber = uuidv4().replaceAll('-','').toString(); //获取唯一编码 - controlData.value.control.fillRoles.push({ + controlData.value.control.fillRoles.master.push({ leftValue:'', rightValue:'', id:onlyNumber, }) } +function addChildFillRole(){ + //子表填充规则要受到子表数量的限制 + //currentChildTableCount + //controlData.value.control.fillRoles.child.length + if(controlData.value.control.fillRoles.child.length { - +