|
|
@ -1775,9 +1775,15 @@ const showImagePreview = ref(false) |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}else if(controlData.value.type==='associatedForms'){ |
|
|
}else if(controlData.value.type==='associatedForms'){ |
|
|
console.log(controlData.value.control.fillRoles) |
|
|
/* if(controlData.value.item.label){ |
|
|
if(controlData.value.control.fillRoles.length==0){ |
|
|
|
|
|
controlData.value.control.fillRoles = [ |
|
|
}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: '', |
|
|
leftValue: '', |
|
|
rightValue: '', |
|
|
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 |
|
|
//实现关联表单设置可选字段中没有当前字段效果 start |
|
|
// console.log(controlData.value.name) |
|
|
// console.log(controlData.value.name) |
|
|
@ -2005,6 +2030,7 @@ const transferDataSourceOptions = [ |
|
|
import AssociatedFormsTinyace from '@/widget/associatedforms/associatedFormsTinyace.vue' |
|
|
import AssociatedFormsTinyace from '@/widget/associatedforms/associatedFormsTinyace.vue' |
|
|
import AssociatedFormsTinyaceRange from '@/widget/associatedforms/associatedFormsTinyaceRange.vue' |
|
|
import AssociatedFormsTinyaceRange from '@/widget/associatedforms/associatedFormsTinyaceRange.vue' |
|
|
import AssociatedFormsFillRole from '@/widget/associatedforms/associatedFormsFillRole.vue' |
|
|
import AssociatedFormsFillRole from '@/widget/associatedforms/associatedFormsFillRole.vue' |
|
|
|
|
|
import AssociatedFormsChildFillRole from '@/widget/associatedforms/associatedFormsChildFillRole.vue' |
|
|
|
|
|
|
|
|
const treeDefaultProps = { |
|
|
const treeDefaultProps = { |
|
|
children: 'children', |
|
|
children: 'children', |
|
|
@ -2071,8 +2097,14 @@ function getAsfasfFieldTreeOptionsValue3() { |
|
|
// |
|
|
// |
|
|
const asfasfFieldTree = ref<Tree[]>() |
|
|
const asfasfFieldTree = ref<Tree[]>() |
|
|
|
|
|
|
|
|
|
|
|
const asfasfMasterFieldTree = ref<Tree[]>() |
|
|
|
|
|
|
|
|
|
|
|
const asfasfChildTableList = ref<Tree[]>() |
|
|
|
|
|
|
|
|
const asfasfFieldTreeOptionsValue3 = ref<Tree[]>() |
|
|
const asfasfFieldTreeOptionsValue3 = ref<Tree[]>() |
|
|
|
|
|
|
|
|
|
|
|
let currentChildTableCount = 0 |
|
|
|
|
|
|
|
|
function formidChanged(){ |
|
|
function formidChanged(){ |
|
|
|
|
|
|
|
|
if(controlData.value.control.formid===''){ |
|
|
if(controlData.value.control.formid===''){ |
|
|
@ -2084,12 +2116,44 @@ function formidChanged(){ |
|
|
//alert("cfid为空") |
|
|
//alert("cfid为空") |
|
|
}else{ |
|
|
}else{ |
|
|
let resData = ref(data.children) |
|
|
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<dataOnlyChild.length;m++){ |
|
|
|
|
|
dataOnlyChild[m].children = [] |
|
|
|
|
|
} |
|
|
|
|
|
let resDataExceptChild = ref(dataExceptChild) |
|
|
|
|
|
let resDataOnlyChild = ref(dataOnlyChild) |
|
|
|
|
|
//console.log(resDataOnlyChild.value) |
|
|
|
|
|
let childTableCount = 0 |
|
|
|
|
|
for(let n = 0;n<resDataOnlyChild.value.length;n++){ |
|
|
|
|
|
console.log(resDataOnlyChild.value[n]) |
|
|
|
|
|
resDataOnlyChild.value[n].disabled=false |
|
|
|
|
|
childTableCount++ |
|
|
|
|
|
} |
|
|
|
|
|
console.log(childTableCount) |
|
|
|
|
|
currentChildTableCount = childTableCount |
|
|
asfasfFieldTree.value = [{ |
|
|
asfasfFieldTree.value = [{ |
|
|
id: 'rootid_'+data.label, |
|
|
id: 'rootid_'+data.label, |
|
|
label: '关联的表单-'+data.label, |
|
|
label: '关联的表单-'+data.label, |
|
|
children: [...resData.value], |
|
|
children: [...resData.value], |
|
|
treeAttrs: data.treeAttrs, |
|
|
treeAttrs: data.treeAttrs, |
|
|
|
|
|
disabled:true, |
|
|
|
|
|
}] |
|
|
|
|
|
asfasfMasterFieldTree.value = [{ |
|
|
|
|
|
id: 'rootid_'+data.label, |
|
|
|
|
|
label: '关联的表单-'+data.label, |
|
|
|
|
|
children: [...resDataExceptChild.value], |
|
|
|
|
|
treeAttrs: data.treeAttrs, |
|
|
|
|
|
disabled:true, |
|
|
|
|
|
}] |
|
|
|
|
|
asfasfChildTableList.value = [{ |
|
|
|
|
|
id: 'rootid_'+data.label, |
|
|
|
|
|
label: '关联的表单-'+data.label, |
|
|
|
|
|
children: [...resDataOnlyChild.value], |
|
|
|
|
|
treeAttrs: data.treeAttrs, |
|
|
|
|
|
disabled:true, |
|
|
}] |
|
|
}] |
|
|
} |
|
|
} |
|
|
controlData.value.control.asfasfLabel = data.label |
|
|
controlData.value.control.asfasfLabel = data.label |
|
|
@ -2184,6 +2248,7 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => { |
|
|
label: '当前表单-'+data.treeAttrs.show, |
|
|
label: '当前表单-'+data.treeAttrs.show, |
|
|
children: [...resData.value], |
|
|
children: [...resData.value], |
|
|
treeAttrs: data.treeAttrs, |
|
|
treeAttrs: data.treeAttrs, |
|
|
|
|
|
disabled: true, |
|
|
}] |
|
|
}] |
|
|
|
|
|
|
|
|
resDataNoTable = resDataNoTable.filter((item: { type: string | null }) => item.type!="table") |
|
|
resDataNoTable = resDataNoTable.filter((item: { type: string | null }) => item.type!="table") |
|
|
@ -2376,13 +2441,47 @@ function associatedFormsDataRangeDialoghandle(){ |
|
|
//alert("cfid为空") |
|
|
//alert("cfid为空") |
|
|
}else{ |
|
|
}else{ |
|
|
let resData = ref(data.children) |
|
|
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<dataOnlyChild.length;m++){ |
|
|
|
|
|
dataOnlyChild[m].children = [] |
|
|
|
|
|
} |
|
|
|
|
|
let resDataExceptChild = ref(dataExceptChild) |
|
|
|
|
|
let resDataOnlyChild = ref(dataOnlyChild) |
|
|
|
|
|
//console.log(asfasfChildTableList.value) |
|
|
|
|
|
//console.log(resDataOnlyChild.value) |
|
|
|
|
|
let childTableCount = 0 |
|
|
|
|
|
for(let n = 0;n<resDataOnlyChild.value.length;n++){ |
|
|
|
|
|
console.log(resDataOnlyChild.value[n]) |
|
|
|
|
|
resDataOnlyChild.value[n].disabled=false |
|
|
|
|
|
childTableCount = n; |
|
|
|
|
|
} |
|
|
|
|
|
console.log(childTableCount) |
|
|
|
|
|
currentChildTableCount = childTableCount |
|
|
asfasfFieldTree.value = [{ |
|
|
asfasfFieldTree.value = [{ |
|
|
id: 'rootid_'+data.label, |
|
|
id: 'rootid_'+data.label, |
|
|
label: '关联的表单-'+data.label, |
|
|
label: '关联的表单-'+data.label, |
|
|
children: [...resData.value], |
|
|
children: [...resData.value], |
|
|
treeAttrs: data.treeAttrs, |
|
|
treeAttrs: data.treeAttrs, |
|
|
|
|
|
disabled:true, |
|
|
|
|
|
}] |
|
|
|
|
|
asfasfMasterFieldTree.value = [{ |
|
|
|
|
|
id: 'rootid_'+data.label, |
|
|
|
|
|
label: '关联的表单-'+data.label, |
|
|
|
|
|
children: [...resDataExceptChild.value], |
|
|
|
|
|
treeAttrs: data.treeAttrs, |
|
|
|
|
|
disabled:true, |
|
|
|
|
|
}] |
|
|
|
|
|
asfasfChildTableList.value = [{ |
|
|
|
|
|
id: 'rootid_'+data.label, |
|
|
|
|
|
label: '关联的表单-'+data.label, |
|
|
|
|
|
children: [...resDataOnlyChild.value], |
|
|
|
|
|
treeAttrs: data.treeAttrs, |
|
|
|
|
|
disabled:true, |
|
|
}] |
|
|
}] |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
@ -2508,15 +2607,52 @@ watch(()=>store.activeKey, () => { |
|
|
|
|
|
|
|
|
function addFillRole(){ |
|
|
function addFillRole(){ |
|
|
let onlyNumber = uuidv4().replaceAll('-','').toString(); //获取唯一编码 |
|
|
let onlyNumber = uuidv4().replaceAll('-','').toString(); //获取唯一编码 |
|
|
controlData.value.control.fillRoles.push({ |
|
|
controlData.value.control.fillRoles.master.push({ |
|
|
leftValue:'', |
|
|
leftValue:'', |
|
|
rightValue:'', |
|
|
rightValue:'', |
|
|
id:onlyNumber, |
|
|
id:onlyNumber, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function addChildFillRole(){ |
|
|
|
|
|
//子表填充规则要受到子表数量的限制 |
|
|
|
|
|
//currentChildTableCount |
|
|
|
|
|
//controlData.value.control.fillRoles.child.length |
|
|
|
|
|
if(controlData.value.control.fillRoles.child.length<currentChildTableCount){ |
|
|
|
|
|
let onlyNumber = uuidv4().replaceAll('-','').toString(); //获取唯一编码 |
|
|
|
|
|
controlData.value.control.fillRoles.child.push({ |
|
|
|
|
|
id: onlyNumber, |
|
|
|
|
|
tableKey: '', |
|
|
|
|
|
filterCondition:{ |
|
|
|
|
|
conditionHtml: '', |
|
|
|
|
|
conditionHtmlCopy: '', |
|
|
|
|
|
gongShi:{ |
|
|
|
|
|
formulaHtml:'', |
|
|
|
|
|
mathsFormula:'', |
|
|
|
|
|
mathsString:'', |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
childRoles:[] |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
alert("当前关联表单共 "+controlData.value.control.fillRoles.child.length+" 张子表,不可再添加") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function delRole(id:String){ |
|
|
function delRole(id:String){ |
|
|
const delRoleData:any = controlData.value.control.fillRoles |
|
|
const delRoleData:any = controlData.value.control.fillRoles.master |
|
|
|
|
|
for (var i = 0; i < delRoleData.length; i++) { |
|
|
|
|
|
if(delRoleData[i].id===id){ |
|
|
|
|
|
delRoleData.splice(i, 1); |
|
|
|
|
|
i--; // 如果不减,将漏掉一个元素 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function delChildRole(id:String){ |
|
|
|
|
|
const delRoleData:any = controlData.value.control.fillRoles.child |
|
|
for (var i = 0; i < delRoleData.length; i++) { |
|
|
for (var i = 0; i < delRoleData.length; i++) { |
|
|
if(delRoleData[i].id===id){ |
|
|
if(delRoleData[i].id===id){ |
|
|
delRoleData.splice(i, 1); |
|
|
delRoleData.splice(i, 1); |
|
|
@ -4379,19 +4515,51 @@ const radioChangeSet = (val:any) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog v-model="associatedFormsFillRolesDialogFlag" title="数据填充规则" top="150px" :close-on-click-modal="false" :show-close="false" style="margin-top:70px ;min-height: 800px" width="80%" > |
|
|
<el-dialog v-model="associatedFormsFillRolesDialogFlag" title="数据填充规则" top="150px" :close-on-click-modal="false" :show-close="false" style="margin-top:70px ;min-height: 300px;max-height:800px" width="50%" > |
|
|
|
|
|
|
|
|
<template v-if="controlData.type=='associatedForms'"> |
|
|
<template v-if="controlData.type=='associatedForms'"> |
|
|
<el-divider style="margin-top: 0px;" /> |
|
|
|
|
|
<div style="margin-top: -10px;"><span style="color: grey;">当选择具体数据后,将按如下规则给当前表单字段填充数据 </span></div> |
|
|
<div style="height:300px;border:1px solid white;overflow-y:auto;"> |
|
|
<el-button style="font-size: large;margin-top: 3px;" type="primary" link append-to-body="true" modal="true" @click="addFillRole">十 添加规则</el-button> |
|
|
<el-button style="font-size: large;margin-top: 10px;margin-bottom: 15px;" type="primary" link append-to-body="true" modal="true" @click="addFillRole">十 主表填充规则</el-button> |
|
|
<el-divider /> |
|
|
<div style="background-color: #E6F3FE;padding: 12px;border-radius: 10px;padding-left:45px;margin-bottom:20px;padding-bottom: 1px;"><!-- #F5F7FA --> |
|
|
<div style="height:600px;border:1px solid white;overflow-y:auto"> |
|
|
<template v-for="(item, index) in controlData.control.fillRoles.master" :key="controlData.control.fillRoles.master[index].id"> |
|
|
|
|
|
<AssociatedFormsFillRole |
|
|
|
|
|
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" |
|
|
|
|
|
:current-key="controlData.control.fillRoles.master[index].id" |
|
|
|
|
|
@del-role = "delRole" |
|
|
|
|
|
> |
|
|
|
|
|
</AssociatedFormsFillRole> |
|
|
|
|
|
</template> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template v-for="(item, index) in controlData.control.fillRoles" :key="controlData.control.fillRoles[index].id"> |
|
|
<el-popover |
|
|
<AssociatedFormsFillRole v-model:left-value="controlData.control.fillRoles[index].leftValue" v-model:right-value="controlData.control.fillRoles[index].rightValue" :left-tree-source = "asfasfFieldTree" :right-tree-source = "associatedFormsCurrentFormFieldTree" :current-key="controlData.control.fillRoles[index].id" @del-Role = "delRole" ></AssociatedFormsFillRole> |
|
|
v-if="currentChildTableCount>0" |
|
|
|
|
|
placement="right-end" |
|
|
|
|
|
title="" |
|
|
|
|
|
:width="200" |
|
|
|
|
|
trigger="hover" |
|
|
|
|
|
content="【关联表单子表字段】暂不支持填充至【当前表单主表字段】; 若【设置筛选条件】,则仅填充满足筛选条件的子表数据" |
|
|
|
|
|
> |
|
|
|
|
|
<template #reference> |
|
|
|
|
|
<el-button style="font-size: large;margin-top: 3px;margin-bottom: 15px;" type="primary" link append-to-body="true" modal="true" @click="addChildFillRole">十 子表填充规则</el-button> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-popover> |
|
|
|
|
|
<div v-if="currentChildTableCount>0"><!-- asfasfChildTableList --> |
|
|
|
|
|
<template v-for="(item, index) in controlData.control.fillRoles.child" :key="controlData.control.fillRoles.child[index].id"> |
|
|
|
|
|
<AssociatedFormsChildFillRole |
|
|
|
|
|
v-model:selected-child-table="controlData.control.fillRoles.child[index].tableKey" |
|
|
|
|
|
:current-key="controlData.control.fillRoles.child[index].id" |
|
|
|
|
|
:child-table-list="asfasfChildTableList" |
|
|
|
|
|
@del-role = "delChildRole" |
|
|
|
|
|
> |
|
|
|
|
|
</AssociatedFormsChildFillRole> |
|
|
</template> |
|
|
</template> |
|
|
<div style="height:2000px"></div> |
|
|
</div> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|