流程卡片组回显

dianlixunjian
Zhufu 2024-07-12 10:51:08 +08:00
parent a0af3af494
commit a7f0b7a2d3
3 changed files with 24 additions and 0 deletions

View File

@ -84,6 +84,21 @@
showActionButtonGroup: false,
baseColProps: { lg: 24, md: 24 },
});
watch(() => subTableDataStore.getToSetGroupData, () => {
if(subTableDataStore.getToSetGroupData){
if (Object.keys(subTableDataStore.getGroupData).includes(tableData.field)) {
noTitleKey.value = subTableDataStore.getGroupData[tableData.field];
if (tableData.ifShow) {
onTabChange({ target: { value: noTitleKey.value } }, tableData.field);
}
} else {
noTitleKey.value = tableData.componentProps.options[0].value;
if (tableData.ifShow) {
onTabChange({ target: { value: noTitleKey.value } }, tableData.field);
}
}
}
})
watch(
() => props.formData,
(newVal) => {

View File

@ -369,6 +369,7 @@
}
cardGourpFormData.value = obj;
subTableDataStore.setGroupData(obj);
subTableDataStore.setToSetGroupData();
FieldsValue.value = obj;
setFieldsValue({
...obj,

View File

@ -5,6 +5,7 @@ export const subTableStore = defineStore({
state: () => ({
tableDta: [],
groupData: {},
toSetGroupData: false,
}),
getters: {
getTableData(state) {
@ -13,11 +14,17 @@ export const subTableStore = defineStore({
getGroupData(state) {
return state.groupData;
},
getToSetGroupData(state){
return state.toSetGroupData;
}
},
actions: {
setTableData(data) {
this.tableDta = data;
},
setToSetGroupData(){
this.toSetGroupData = true
},
setSingleData(parentFileId, data) {
this.tableDta.forEach((item, i) => {
if (item.parentFileId == parentFileId) {
@ -38,6 +45,7 @@ export const subTableStore = defineStore({
},
clearGoupData() {
this.groupData = {};
this.toSetGroupData = false;
},
},
});