diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index 5806406..fb497c1 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -1763,12 +1763,16 @@ const transferDialogTableVisible = ref(false) //图片展示显示控制 const showImagePreview = ref(false) + + +const currentAsfChangeCount = ref(0) //最近点击的上传按钮对应的imgId let currentUploadImgid = ""; //刚拖拽视频组件时,初始化imgid监听designForm.activeKey,变化时,如果controlData.value.type=='lowcodeCarsusel',就遍历轮播图数组把imgid=''的都生成uuid watch(()=>store.activeKey, (newVal) => { + //啊啊啊啊 if(controlData.value.type==='lowcodeCarsusel'){ const carsuselConfigData:CarsuselConfig[] = controlData.value.control.carsuselConfigArr @@ -1781,6 +1785,8 @@ const showImagePreview = ref(false) } }); }else if(controlData.value.type==='associatedForms'){ + currentAsfChangeCount.value = 0 + //alert(1) /* if(controlData.value.item.label){ }else{ @@ -2664,8 +2670,30 @@ function selectedOrDelChildRole(){ } } -//将已被选择的要填充的关联其他表单的表单的子表字段设为不可选择 +//将已被选择的要填充的关联其他表单的表单的子表字段设为不可选择 function childRoleRightChanged(){ + + let selectedArr: any[] = [] + let otherMasterSelectedArr: any[] = [] + let otherChildSelectedArr: any[] = [] + asfsExpectCurrent.forEach(function(item: any) { + let master = item.control.fillRoles.master + let child = item.control.fillRoles.child + /* console.log(master) + console.log(child) */ + master.forEach(function(item: any) { + if(item.rightValue!=""){ + otherMasterSelectedArr.push(item) + } + }); + child.forEach(function(item: any) { + item.childRoles.forEach((element: any) => { + if(element.rightValue!=""){ + otherChildSelectedArr.push(element) + } + }); + }); + }); let masterSelectedArr: any[] = [] controlData.value.control?.fillRoles?.master.forEach(function(item: any) { if(item.rightValue!=""){ @@ -2680,12 +2708,20 @@ function childRoleRightChanged(){ } }); }); - let selectedArr: any[] = [] + + /* 1.得到当前子表填充规则块在所有子表填充规则块数组中的index + 2.得到所有index在当前子表填充规则块之前的子表填充规则块 + 3.得到2中所有right,凡是出现过的子表,就把这些子表的所有选项全部置为不可选 */ + //console.log(asfs) + + + selectedArr.push(...otherMasterSelectedArr) + selectedArr.push(...otherChildSelectedArr) selectedArr.push(...masterSelectedArr) selectedArr.push(...childSelectedArr) //主表控制 start if(associatedFormsCurrentFormFieldTree1.value){ - associatedFormsCurrentFormFieldTree1.value[0].children?.forEach(function(item: any){ + associatedFormsCurrentFormFieldTree1.value[0].children?.forEach(function(item: any){ if(item.type=="table"){ item.children.forEach((element: any) => { element.disabled = false @@ -2697,7 +2733,7 @@ function childRoleRightChanged(){ }) } if(associatedFormsCurrentFormFieldTree1.value){ - associatedFormsCurrentFormFieldTree1.value[0].children?.forEach(function(item: any){ + associatedFormsCurrentFormFieldTree1.value[0].children?.forEach(function(item: any){ if(item.type=="table"){ item.children.forEach((element: any) => { selectedArr.forEach((j:any) => { @@ -3090,11 +3126,98 @@ const gainFormGroupList = () =>{ loadingmore.value = false; }) } +let asfs: any[] = [] +let asfsExpectCurrent: any[] = [] + + + +watch(()=>props.formList,(dataList:any)=>{ + //console.log(dataList) + + if(dataList&&Array.isArray(dataList)&&dataList.length>0&&controlData.value.type=="associatedForms"&¤tAsfChangeCount.value==0){ + //console.log(1) + asfsExpectCurrent = [] + asfs = [] + currentAsfChangeCount.value = 1 + for(let i = 0;i { + if(element.type=="associatedForms"){ + asfs.push(element) + } + }); + }else if(dataList[i].type=="grid"){ + let columns = JSON.parse(JSON.stringify(dataList[i].columns)); + //console.log(columns) + if(columns.length>0){ + for(let z = 0;z0){ + for(let z = 0;z0){ + for(let m = 0;m0){ + asfsExpectCurrent = asfs.filter((item:any)=>{ + return item.name!=controlData.value.name + }) + /* if(asfsExpectCurrent.length>0){ + console.log(asfsExpectCurrent) + } */ + } + } + + +},{ + deep:true +}) + + onMounted(() => { + //console.log("------------------->",props.formData,props.formList) + + + gainFormGroupList() + + + + }) /** @@ -3301,6 +3424,7 @@ const radioChangeSet = (val:any) => { }