update:动态表格优化

This commit is contained in:
2025-11-05 09:53:35 +08:00
parent 8ee85bf4e2
commit 793a66c272
5 changed files with 31 additions and 16 deletions

View File

@@ -306,7 +306,7 @@ const searchLoadFun = () => {
watch(() => props.tableName, () => {
initFun();
}, { deep: true, immediate: true });
});
defineExpose({
tableData,

View File

@@ -34,7 +34,7 @@
<vxe-table
ref="vxeTableRef"
:loading="loading"
:data="data"
:data="formatData"
height="100%"
v-bind="$attrs"
:seq-config="{startIndex: (current - 1) * size}"
@@ -45,7 +45,7 @@
:tree-config="{
transform: true,
expandAll: true,
rowField: 'uuid',
rowField: 'fakeId',
parentField: 'parentId',
childrenField: 'children',
}"
@@ -163,6 +163,20 @@ const searchList = ref<any>(props.searchItems);
const editRowIndex = ref(0);
const editRowKey = ref('');
const editData = ref<any>([]);
const formatData = ref<any>([]);
watch(() => props.data, (data) => {
data.forEach((item: any) => {
for (const key in item) {
if (key === 'extras') {
item[key].forEach((val: any) => {
item[val.propertyName] = val.propertyValue;
});
}
}
});
formatData.value = data;
});
watch(() => props.params, (val) => {
resetFun(val);
@@ -321,7 +335,7 @@ const removeFun = (data: any) => {
watch(() => props.tableName, () => {
initFun();
}, { deep: true, immediate: true });
});
defineExpose({
tableData,

View File

@@ -95,6 +95,7 @@ import { Folder, Document, Operation } from '@element-plus/icons-vue';
import TreeEditItem from '@/components/common/table/treeEditItem.vue';
import { NODE_TYPE } from '@/utils/enum/node';
import { useDict } from '@/utils/useDict';
import { cloneDeep } from 'lodash';
const TreeTableRef = ref<any>();
const { PERFORMANCE_UNIT } = useDict('PERFORMANCE_UNIT');
@@ -120,9 +121,11 @@ watch(() => props.data, (val: any) => {
const treeDataFormatFun = (data: any, build: any, pId: any) => {
data.forEach((item: any) => {
item.parentId = pId;
const children = cloneDeep(item.children);
item.children = [];
build.push(item);
if (item.children && item.children.length > 0) {
treeDataFormatFun(item.children, build, item.uuid);
if (children && children.length > 0) {
treeDataFormatFun(children, build, item.fakeId);
}
});
return build;

View File

@@ -33,8 +33,6 @@
}
:deep(.el-select) {
width: 220px;
.el-input .el-input__inner {
height: 32px !important;
line-height: 32px !important;

View File

@@ -35,8 +35,8 @@ export default defineConfig(({ mode }) => {
ws: true,
},
'/local7101': {
target: 'http://192.168.65.199:7101', // 李东洋
// target: 'http://192.168.65.161/api/simulation/project', // 开发环境
// target: 'http://192.168.65.199:7101', // 李东洋
target: 'http://192.168.65.161/api/simulation/project', // 开发环境
// target: 'http://192.168.65.161', // 开发环境
// target: 'http://192.168.65.73:7100', // 开发环境
// target: 'http://192.168.65.53:8080', // 戴琼瑶本地
@@ -45,8 +45,8 @@ export default defineConfig(({ mode }) => {
rewrite: (path) => path.replace(/^\/local7101/, ''),
},
'/local7102': { // taskPool工况库模块
target: 'http://192.168.65.199:7102', // 李东洋
// target: 'http://192.168.65.161:80/api/simulation/task', // 开发环境
// target: 'http://192.168.65.199:7102', // 李东洋
target: 'http://192.168.65.161:80/api/simulation/task', // 开发环境
// target: 'http://192.168.65.161', // 开发环境
// target: 'http://192.168.65.73:7100', // 开发环境
// target: 'http://192.168.65.53:8080/simulation', // 戴琼瑶本地
@@ -55,8 +55,8 @@ export default defineConfig(({ mode }) => {
rewrite: (path) => path.replace(/^\/local7102/, ''),
},
'/local7103': { // system系统模块
target: 'http://192.168.65.199:7103',
// target: 'http://192.168.65.161:80/api/simulation/system', // 开发环境
// target: 'http://192.168.65.199:7103', // 李东洋
target: 'http://192.168.65.161:80/api/simulation/system', // 开发环境
changeOrigin: true,
// rewrite: (path) => path.replace(/^\/local7103/, ''),
rewrite: (path) => {
@@ -64,8 +64,8 @@ export default defineConfig(({ mode }) => {
},
},
'/local7104': { // data文件模块
target: 'http://192.168.65.199:7104',
// target: 'http://192.168.65.161:80/api/simulation/data', // 开发环境
// target: 'http://192.168.65.199:7104', // 李东洋
target: 'http://192.168.65.161:80/api/simulation/data', // 开发环境
// target: 'http://192.168.65.161', // 开发环境
changeOrigin: true,
rewrite: (path) => path.replace(/^\/local7104/, ''),