Browse Source

关联表单-数据填充规则-v0.4 完成页面配置

lwx_v7
liwenxuan 1 year ago
parent
commit
fb0bfa775d
  1. 74
      src/components/DesignForm/formControlPropertiNew.vue
  2. 1
      src/widget/associatedforms/associatedFormsChildFillRole.vue
  3. 8
      src/widget/associatedforms/associatedFormsFillRole.vue

74
src/components/DesignForm/formControlPropertiNew.vue

@ -2658,7 +2658,76 @@ function selectedOrDelChildRole(){
} }
// //
function childRoleRightChanged(){ function childRoleRightChanged(){
alert(1) let masterSelectedArr: any[] = []
controlData.value.control?.fillRoles?.master.forEach(function(item: any) {
if(item.rightValue!=""){
masterSelectedArr.push(item)
}
});
let childSelectedArr: any[] = []
controlData.value.control?.fillRoles?.child.forEach(function(item: any) {
item.childRoles.forEach((element: any) => {
if(element.rightValue!=""){
childSelectedArr.push(element)
}
});
});
// start
if(associatedFormsCurrentFormFieldTree1.value){
associatedFormsCurrentFormFieldTree1.value[0].children?.forEach(function(item: any){
if(item.type=="table"){
item.children.forEach((element: any) => {
element.disabled = false
});
}else{
item.disabled = false
}
})
}
if(associatedFormsCurrentFormFieldTree1.value){
associatedFormsCurrentFormFieldTree1.value[0].children?.forEach(function(item: any){
if(item.type=="table"){
item.children.forEach((element: any) => {
masterSelectedArr.forEach((j:any) => {
if(j.rightValue==element.id){
element.disabled = true
}
})
});
}else{
masterSelectedArr.forEach((element:any) => {
if(element.rightValue==item.id){
item.disabled = true
}
})
}
})
}
// end
//start
if(currentFormChildTableFieldsForFillRole.value){
currentFormChildTableFieldsForFillRole.value[0]?.children?.forEach((element: any) => {
element.children.forEach((item: any) => {
childSelectedArr.forEach((j:any) => {
item.disabled = false
})
});
});
}
if(currentFormChildTableFieldsForFillRole.value){
currentFormChildTableFieldsForFillRole.value[0]?.children?.forEach((element: any) => {
element.children.forEach((item: any) => {
childSelectedArr.forEach((j:any) => {
if(j.rightValue==item.id){
item.disabled = true
}
})
});
});
}
//end
} }
// //
@ -2726,6 +2795,7 @@ function addChildFillRole(){
//currentChildTableCount //currentChildTableCount
//controlData.value.control.fillRoles.child.length //controlData.value.control.fillRoles.child.length
selectedOrDelChildRole() selectedOrDelChildRole()
childRoleRightChanged()
if(controlData.value.control.fillRoles.child.length<currentChildTableCount){ if(controlData.value.control.fillRoles.child.length<currentChildTableCount){
let onlyNumber = uuidv4().replaceAll('-','').toString(); // let onlyNumber = uuidv4().replaceAll('-','').toString(); //
let onlyNumber1 = uuidv4().replaceAll('-','').toString(); // let onlyNumber1 = uuidv4().replaceAll('-','').toString(); //
@ -2775,6 +2845,7 @@ function delChildRole(id:String){
} }
} }
selectedOrDelChildRole() selectedOrDelChildRole()
childRoleRightChanged()
} }
const associatedFormsChooseDialogFlag = ref(false) const associatedFormsChooseDialogFlag = ref(false)
function chooseAssociatedForm(){ function chooseAssociatedForm(){
@ -4641,6 +4712,7 @@ const radioChangeSet = (val:any) => {
:right-tree-source = "associatedFormsCurrentFormFieldTree1" :right-tree-source = "associatedFormsCurrentFormFieldTree1"
:current-key="controlData.control.fillRoles.master[index].id" :current-key="controlData.control.fillRoles.master[index].id"
@del-role = "delRole" @del-role = "delRole"
@child-role-right-changed = "childRoleRightChanged"
> >
</AssociatedFormsFillRole> </AssociatedFormsFillRole>
</template> </template>

1
src/widget/associatedforms/associatedFormsChildFillRole.vue

@ -268,6 +268,7 @@ function handleFieldTreeContextmenuRange(MouseEvent: any, object: any, Node: any
} }
onMounted(() => { onMounted(() => {
emit('selectedOrDelChildRole') emit('selectedOrDelChildRole')
emit('childRoleRightChanged')
}) })
</script> </script>

8
src/widget/associatedforms/associatedFormsFillRole.vue

@ -58,20 +58,24 @@ rightValue1.value = props.rightValue
let emit = defineEmits(["update:leftValue", "update:rightValue","delRole"]); let emit = defineEmits(["update:leftValue", "update:rightValue","delRole","childRoleRightChanged"]);
function leftChanged(){ function leftChanged(){
emit('update:leftValue',leftValue1) emit('update:leftValue',leftValue1)
} }
function rightChanged(){ function rightChanged(){
emit('update:rightValue',rightValue1) emit('update:rightValue',rightValue1)
emit('childRoleRightChanged')
} }
function delRole(){ function delRole(){
//alert(props.currentKey) //alert(props.currentKey)
emit('delRole',props.currentKey) emit('delRole',props.currentKey)
emit('childRoleRightChanged')
} }
onMounted(() => {
emit('childRoleRightChanged')
})
</script> </script>

Loading…
Cancel
Save