Browse Source

子表填充规则要受到子表数量的限制

关联表单数据填充规则根据已选择子表的数目和id将已选择的子表置为不可选择

已选择子表后不允许修改,只能删除重选

可选择的字段中将系统默认字段全部去除
lwx_v7
liwenxuan 1 year ago
parent
commit
191ceaa547
  1. 42
      src/components/DesignForm/formControlPropertiNew.vue

42
src/components/DesignForm/formControlPropertiNew.vue

@ -2107,6 +2107,13 @@ const asfasfFieldTreeOptionsValue3 = ref<Tree[]>()
let currentChildTableCount = 0
function removeFirstNumElements(arr: string | any[],num:number) {
if (arr.length < num) {
return [];
}
return arr.slice(num);
}
function formidChanged(){
if(controlData.value.control.formid===''){
@ -2122,8 +2129,14 @@ 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)
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)
dataOnlyChild1.forEach((element: any) => {
element.children = removeFirstNumElements(element.children,6);
});
/* console.log(dataOnlyChild1)
console.log(dataOnlyChild) */
for(let m = 0;m<dataOnlyChild.length;m++){
@ -2241,6 +2254,7 @@ function formidChangedOptionsValue3(){
}
const associatedFormsCurrentFormFieldTree = ref<Tree[]>()
const associatedFormsCurrentFormFieldTree1 = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeNoTable = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeForGlxxsz = ref<Tree[]>()
let associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf = ref<Tree[]>()
@ -2255,8 +2269,17 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
//alert("cfid")
}else{
let resData = ref(data.children)
let resDataExceptSystemFields = 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"){
//console.log(element)
element.children = removeFirstNumElements(element.children,6)
}
});
console.log(resDataExceptSystemFields)
//let rootid_ = data.value.label
associatedFormsCurrentFormFieldTree.value = [{
id: 'rootid_'+data.label,
@ -2266,6 +2289,15 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
disabled: true,
}]
associatedFormsCurrentFormFieldTree1.value = [{
id: 'rootid_'+data.label,
label: '当前表单-'+data.treeAttrs.show,
children: [...resDataExceptSystemFields],
treeAttrs: data.treeAttrs,
disabled: true,
}]
resDataNoTable = resDataNoTable.filter((item: { type: string | null }) => item.type!="table")
associatedFormsCurrentFormFieldTreeNoTable.value = [{
@ -2460,8 +2492,14 @@ function associatedFormsDataRangeDialoghandle(){
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)
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)
dataOnlyChild1.forEach((element: any) => {
element.children = removeFirstNumElements(element.children,6);
});
/* console.log(dataOnlyChild1)
console.log(dataOnlyChild) */
for(let m = 0;m<dataOnlyChild.length;m++){
@ -4587,7 +4625,7 @@ const radioChangeSet = (val:any) => {
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"
:right-tree-source = "associatedFormsCurrentFormFieldTree1"
:current-key="controlData.control.fillRoles.master[index].id"
@del-role = "delRole"
>

Loading…
Cancel
Save