update
This commit is contained in:
@@ -385,7 +385,7 @@ const getFormatDataFun = () => {
|
||||
});
|
||||
}
|
||||
if (unit.type === 'table') {
|
||||
unitData.head = unit.head.map((i: any) => i.title);
|
||||
unitData.head = unit.head?.map((i: any) => i.title);
|
||||
}
|
||||
build.push(unitData);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ import FormItem from './formItem.vue';
|
||||
import { getFormConfigureApi } from '@/api/system/systemData';
|
||||
import { isPhone, isEmail, hasNoSpecialChar, length20, length100 } from '@/utils/validate';
|
||||
import { formOptionsFormat } from './lib';
|
||||
import { isEqual } from 'lodash-es';
|
||||
|
||||
const emit = defineEmits(['change', 'remove', 'load']);
|
||||
const minHeight = ref(0);
|
||||
@@ -70,7 +71,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
watch(
|
||||
() => props.data,
|
||||
(data: any, oldData: any) => {
|
||||
if (JSON.stringify(data) !== JSON.stringify(oldData)) {
|
||||
if (!isEqual(data, oldData)) {
|
||||
formData.value = formatDataFun(data);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div class="toper">
|
||||
<div class="total">共{{ tableData.length }}个列表字段</div>
|
||||
<div class="add-btn">
|
||||
<el-button type="primary" plain @click="previewVisible = true">预览列表</el-button>
|
||||
<!-- <el-button type="primary" plain @click="previewVisible = true">预览列表</el-button> -->
|
||||
<el-button v-if="!disabled" type="primary" :icon="Plus" @click="addFun">
|
||||
新增字段
|
||||
</el-button>
|
||||
@@ -361,7 +361,7 @@ const updateFun = () => {
|
||||
};
|
||||
updateFormConfigureApi(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('操作成功');
|
||||
ElMessage.success('更新成功,刷新页面后生效');
|
||||
closeFun();
|
||||
emit('update');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user