Browse Source

关联表单数据填充时无法获取当前表单新增且保存的字段,只有关闭重启后方能获取----bug修改

lwx_v10
liwenxuan 1 year ago
parent
commit
881d1e1ed8
  1. 44
      src/components/DesignForm/formControlPropertiNew.vue
  2. 12
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageForm.vue

44
src/components/DesignForm/formControlPropertiNew.vue

@ -1260,6 +1260,29 @@ const getPropByPath = (obj: any, path: string, val: any) => {
}
}
//
const showAssociatedFormsFillRole = ref(true)
//----bug
const saveRefreshFormControlAttr = () => {
//
//setTimeout(() => {
getAssociatedFormsCurrentFieldTree1()
showAssociatedFormsFillRole.value = false;
//
setTimeout(() => {
showAssociatedFormsFillRole.value = true;
}, 200);
//}, 13000);
};
//
const delSelectOption = (index: number, type?: string) => {
//liwenxuan 20240508 checkbox start
@ -1616,7 +1639,7 @@ const eventClick = (type: string, tooltip?: string) => {
emits('openDialog', { type: type, title: tooltip, direction: 'ltr' })
}
getDataSource()
defineExpose({ getFormFieldBySource })
defineExpose({ getFormFieldBySource,saveRefreshFormControlAttr })
//
const isNotWrite = (val:any) =>{
// console.log("--->",val,props.customerformid)
@ -2266,22 +2289,26 @@ function formidChangedOptionsValue3(){
});
}
}
const currentFormChildTableFieldsForFillRole = ref<Tree[]>()
const associatedFormsCurrentFormFieldTree = ref<Tree[]>()
const associatedFormsCurrentFormFieldTree1 = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeNoTable = ref<Tree[]>()
const associatedFormsCurrentFormFieldTreeForGlxxsz = ref<Tree[]>()
let currentFormChildTableFieldsForFillRole = ref<Tree[]>()
let associatedFormsCurrentFormFieldTree = ref<Tree[]>()
let associatedFormsCurrentFormFieldTree1 = ref<Tree[]>()
let associatedFormsCurrentFormFieldTreeNoTable = ref<Tree[]>()
let associatedFormsCurrentFormFieldTreeForGlxxsz = ref<Tree[]>()
let associatedFormsCurrentFormFieldTreeForGlxxszExceptSelf = ref<Tree[]>()
let resDataForGlxxszExceptself: any[] = []
let resDataForGlxxszExceptself1: any[] = []
let getAssociatedFormsCurrentFieldTreeData:any
getAssociatedFormsCurrentFieldTree1()
function getAssociatedFormsCurrentFieldTree1(){
getAssociatedFormsCurrentFieldTree().then(({ data }) => {
// console.log(data)
getAssociatedFormsCurrentFieldTreeData = JSON.parse(JSON.stringify(data))
// console.log(getAssociatedFormsCurrentFieldTreeData)
if(data.id==="cfid为空"||data.id==="masterTable为null"){
//alert("cfid")
}else{
let resData = ref(data.children)
let resDataExceptSystemFields = JSON.parse(JSON.stringify(data.children))
let currentFormChildTableFields = JSON.parse(JSON.stringify(data.children))
@ -2357,7 +2384,7 @@ getAssociatedFormsCurrentFieldTree().then(({ data }) => {
}
});
}
const customerFormTree = ref<Tree[]>()
@ -4834,13 +4861,14 @@ 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: 300px;max-height:900px" width="50%" >
<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:900px" width="80%" >
<template v-if="controlData.type=='associatedForms'">
<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>
<div style="max-height:230px;border:1px solid white;overflow-y:auto;">
<div style="background-color: #F0F0F0;padding: 12px;border-radius: 5px;padding-left:45px;padding-bottom: 10px;margin-right: 10px;"><!-- #F5F7FA #E6F3FE #F0F0F0 #F5F7FA-->
<template v-for="(item, index) in controlData.control.fillRoles.master" :key="controlData.control.fillRoles.master[index].id">
<AssociatedFormsFillRole
v-if="showAssociatedFormsFillRole"
v-model:left-value="controlData.control.fillRoles.master[index].leftValue"
v-model:right-value="controlData.control.fillRoles.master[index].rightValue"
:left-tree-source = "asfasfMasterFieldTree"

12
src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageForm.vue

@ -79,6 +79,8 @@ const state = computed({
}
});
const formControlAttrEl = ref(null)
provide('formDesignType', state.value.designType)
const appFormKeyVal = computed({
get() {
@ -330,6 +332,15 @@ const gainTableForm = () => {
})
}
}
function saveRefreshFormControlAttr1(){
formControlAttrEl.value.saveRefreshFormControlAttr()
}
onMounted(() => {
if (route.source) {
formControlAttrEl.value.getFormFieldBySource(route.source)
@ -425,6 +436,7 @@ const editAppFormTable = () => {
})
.finally(() => {
state.value.loading=false;
saveRefreshFormControlAttr1()
})
}
/**

Loading…
Cancel
Save