【表单信息】卡片组信息回显
parent
c29319fd54
commit
fe421eb3ba
|
|
@ -31,7 +31,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { BasicForm, useForm } from '@/components/Form';
|
import { BasicForm, useForm } from '@/components/Form';
|
||||||
import { CardGourp } from './index';
|
import { CardGourp } from './index';
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch, nextTick } from 'vue';
|
||||||
import { subTableStore } from '@/store/modules/subTable';
|
import { subTableStore } from '@/store/modules/subTable';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
|
|
@ -86,6 +86,30 @@
|
||||||
},
|
},
|
||||||
{ deep: true },
|
{ deep: true },
|
||||||
);
|
);
|
||||||
|
const onTabChange = (event, field) => {
|
||||||
|
let value = event.target.value
|
||||||
|
subTableDataStore.setOneGroupData(field, value)
|
||||||
|
noTitleKey.value = value;
|
||||||
|
var currentIndex = (childGourp.value || []).findIndex((element) => element.index === value);
|
||||||
|
|
||||||
|
if (currentIndex == -1) {
|
||||||
|
childItem.value = {};
|
||||||
|
} else {
|
||||||
|
childItem.value = childGourp.value[currentIndex];
|
||||||
|
}
|
||||||
|
formColumns.forEach((element) => {
|
||||||
|
element.show = false;
|
||||||
|
updateSchema([{ field: element.field, show: false }]);
|
||||||
|
if (element.index == value) {
|
||||||
|
element.show = true;
|
||||||
|
updateSchema([{ field: element.field, show: true }]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
resetFields();
|
||||||
|
setFieldsValue(subTableDataStore.getGroupData);
|
||||||
|
}, 10);
|
||||||
|
};
|
||||||
if (tableData.componentProps) {
|
if (tableData.componentProps) {
|
||||||
tableData.componentProps.options.forEach((element, index) => {
|
tableData.componentProps.options.forEach((element, index) => {
|
||||||
tabListNoTitle.value.push({
|
tabListNoTitle.value.push({
|
||||||
|
|
@ -121,34 +145,17 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
nextTick(() => {
|
||||||
|
if(Object.keys(subTableDataStore.getGroupData).includes(tableData.field)){
|
||||||
|
noTitleKey.value = subTableDataStore.getGroupData[tableData.field].toString()
|
||||||
|
onTabChange({target:{value: noTitleKey.value}},tableData.field)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
resetFields();
|
resetFields();
|
||||||
}, 10);
|
}, 10);
|
||||||
const onTabChange = (event, field) => {
|
|
||||||
let value = event.target.value
|
|
||||||
subTableDataStore.setOneGroupData(field, value)
|
|
||||||
noTitleKey.value = value;
|
|
||||||
var currentIndex = (childGourp.value || []).findIndex((element) => element.index === value);
|
|
||||||
console.log(currentIndex);
|
|
||||||
if (currentIndex == -1) {
|
|
||||||
childItem.value = {};
|
|
||||||
} else {
|
|
||||||
childItem.value = childGourp.value[currentIndex];
|
|
||||||
}
|
|
||||||
formColumns.forEach((element) => {
|
|
||||||
element.show = false;
|
|
||||||
updateSchema([{ field: element.field, show: false }]);
|
|
||||||
if (element.index == value) {
|
|
||||||
element.show = true;
|
|
||||||
updateSchema([{ field: element.field, show: true }]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
resetFields();
|
|
||||||
setFieldsValue(subTableDataStore.getGroupData);
|
|
||||||
}, 10);
|
|
||||||
};
|
|
||||||
function changeForm() {
|
function changeForm() {
|
||||||
subTableDataStore.setGroupData(getFieldsValue());
|
subTableDataStore.setGroupData(getFieldsValue());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue