update:数据总览

This commit is contained in:
2025-11-11 20:29:34 +08:00
parent a5b3ddd8b6
commit 5e2f147e53
13 changed files with 125 additions and 71 deletions

View File

@@ -0,0 +1,22 @@
import { post, upload } from '@/api/request';
const env = import.meta.env;
const PREFIX = env.VITE_API_PREFIX_DATA;
// 查询目录详情
export const dataOverViewListSimulationNodeFilesApi = (params: any) => {
return post(`${PREFIX}dataOverView/listSimulationNodeFiles`, params);
};
// 删除文件
export const dataOverViewDeleteSimulationNodeFilesApi = (params: any) => {
return post(`${PREFIX}dataOverView/deleteSimulationNodeFiles`, params);
};
// 创建文件夹
export const dataOverViewCreateSimulationNodeDirApi = (params: any) => {
return post(`${PREFIX}dataOverView/createSimulationNodeDir`, params);
};
// 上传文件
export const dataOverViewUploadSimulationNodeFilesApi = (params: any) => {
return upload(`${PREFIX}dataOverView/uploadSimulationNodeFiles`, params);
};

View File

@@ -8,7 +8,7 @@ export const addNodeApi = (params: any) => {
};
export const queryNodeListApi = (params: any) => {
return get(`${PREFIX}node/list`, params);
return post(`${PREFIX}node/list`, params);
};
export const getChildrenNodeListApi = (params: any) => {

View File

@@ -18,6 +18,7 @@
children: 'children',
isLeaf: 'leaf',
}"
v-bind="$attrs"
@node-click="nodeClickFun"
@current-change="currentChangeFun"
>
@@ -246,7 +247,6 @@ defineExpose({
align-items: center;
overflow: hidden;
text-overflow: ellipsis;
color: var(--el-text-color-secondary);
.icon {
display: flex;
align-items: center;

View File

@@ -217,12 +217,12 @@ const getTableDataFun = () => {
props.render(res.data, (cbData: any) => {
const { data, total } = cbData;
tableData.value = data;
pageTotal.value = total;
pageTotal.value = total || 0;
});
} else {
const { data, total } = res.data;
tableData.value = data;
pageTotal.value = total;
pageTotal.value = total || 0;
}
}
}).finally(() => {

View File

@@ -436,16 +436,17 @@ defineExpose({
cursor: pointer;
}
}
.head-title {
position: relative;
.head-icon {
position: absolute;
top: 0;
right: -20px;
cursor: pointer;
&.active {
color: var(--el-color-primary);
}
}
.head-title {
position: relative;
padding-right: 20px;
.head-icon {
position: absolute;
top: 0;
right: 0;
cursor: pointer;
&.active {
color: var(--el-color-primary);
}
}
}
@@ -453,14 +454,14 @@ defineExpose({
width: 100%;
.search-item {
display: flex;
.btn {
margin-left: 5px;
}
}
.btns {
padding-top: 5px;
display: flex;
justify-content: flex-end;
.btn {
margin-left: 5px;
}
}
}
</style>

View File

@@ -1,7 +1,7 @@
<template>
<div class="comp-content comp-tree-case-table">
<TreeTable ref="TreeTableRef" :tableName="tableName" :data="treeData" :editMode="editMode" v-bind="$attrs">
<!-- 任务类型 -->
<!-- 任务名称 -->
<template #nodeName="{ row }">
<div class="node-name">
<el-icon v-if="row.nodeType === NODE_TYPE.TASK" :size="16" class="blue">
@@ -83,11 +83,11 @@
<template #method-edit="{ row,column }">
<dictLabel v-model="row[column.field]" dictName="methodOptions" :editable="true" />
</template>
<!-- 任务类型 -->
<template #nodeType="{ row, column }">
<TreeEditItem :data="row.nodeType" :editMode="editMode">
<dictLabel v-model="row[column.field]" :options="allNodeTypeOptions" />
</TreeEditItem>
<dictLabel v-model="row[column.field]" :options="allNodeTypeOptions" />
</template>
<!-- 指标类型 -->
<template #performanceType="{ row, column }">
<TreeEditItem
v-if="[NODE_TYPE.PERFORMANCE].includes(row.nodeType)"
@@ -109,6 +109,7 @@
<template #unit-edit="{ row, column }">
<dictLabel v-model="row[column.field]" dictName="PERFORMANCE_UNIT" :editable="true" />
</template>
<!-- 分析软件 -->
<template #analyseSoftware="{ row, column }">
<TreeEditItem v-if="[NODE_TYPE.TASK].includes(row.nodeType)" :data="row.analyseSoftware" :editMode="editMode">
<dictLabel v-model="row[column.field]" dictName="ANALYSIS_SOFTWARE" />
@@ -117,6 +118,7 @@
<template #analyseSoftware-edit="{ row, column }">
<dictLabel v-model="row[column.field]" dictName="ANALYSIS_SOFTWARE" :editable="true" :multiple="true" />
</template>
<!-- 仿真能力 -->
<template #bCapacity="{ row, column }">
<TreeEditItem v-if="[NODE_TYPE.TASK].includes(row.nodeType)" :data="row.department" :editMode="editMode">
<dictLabel v-model="row[column.field]" dictName="SIMULATION_CAPACITY" />
@@ -177,7 +179,6 @@ import TreeTable from '@/components/common/table/treeTable.vue';
import { Folder, Document, Operation } from '@element-plus/icons-vue';
import TreeEditItem from '@/components/common/table/treeEditItem.vue';
import { NODE_TYPE, nodeTypeList } from '@/utils/enum/node';
import { useDict } from '@/utils/useDict';
import { cloneDeep } from 'lodash';
import dictLabel from './dictLabel.vue';
import { poolCategoryTypeOptions } from '@/components/loadCaseTable/utils/project';

View File

@@ -29,7 +29,7 @@
<el-button @click="closeNodeListFun">取消</el-button>
<el-button @click="changeStepFun('pre')" v-if="props.dialogType === 'create'">上一步</el-button>
<el-button @click="changeStepFun('next')" v-if="props.dialogType === 'create'">下一步</el-button>
<el-button @click="addOrEditNode">完成</el-button>
<el-button type="primary" @click="addOrEditNode">完成</el-button>
</div>
</template>
</Dialog>
@@ -71,7 +71,7 @@
<template #footer>
<div>
<el-button @click="nodeFormVisible = false">取消</el-button>
<el-button @click="addOrEditOneNodeFun">确认</el-button>
<el-button type="primary" @click="addOrEditOneNodeFun">确认</el-button>
</div>
</template>
</Dialog>

View File

@@ -35,7 +35,7 @@
<el-button @click="closeNodeListFun">取消</el-button>
<el-button @click="changeStepFun('pre')" v-if="props.dialogType === 'create'">上一步</el-button>
<el-button @click="changeStepFun('next')" v-if="props.dialogType === 'create'">下一步</el-button>
<el-button @click="addOrEditNode">完成</el-button>
<el-button type="primary" @click="addOrEditNode">完成</el-button>
</div>
</template>
</Dialog>
@@ -78,7 +78,7 @@
<template #footer>
<div>
<el-button @click="nodeFormVisible = false">取消</el-button>
<el-button @click="addOrEditOneNodeFun">确认</el-button>
<el-button type="primary" @click="addOrEditOneNodeFun">确认</el-button>
</div>
</template>
</Dialog>

View File

@@ -22,9 +22,15 @@ export const hasNoSpecialChar = (str: string) => {
};
// 长度限制20
export const length20 = (str: string) => {
if (!str) {
return true;
}
return str.length <= 20;
};
// 长度限制100
export const length100 = (str: string) => {
if (!str) {
return true;
}
return str.length <= 100;
};

View File

@@ -22,7 +22,7 @@
import { ref, watch } from 'vue';
import { ElMessage } from 'element-plus';
import TableForm from '@/components/common/table/tableForm.vue';
import { dataCreateDirApi } from '@/api/data/data';
import { dataOverViewCreateSimulationNodeDirApi } from '@/api/data/dataOverView';
const emit = defineEmits(['update:modelValue', 'submit']);
const visible = ref(false);
@@ -55,7 +55,7 @@ const submitFun = async() => {
parentUuId: props.data.uuid,
...fromData,
};
dataCreateDirApi(params).then((res: any) => {
dataOverViewCreateSimulationNodeDirApi(params).then((res: any) => {
if (res.code === 200) {
ElMessage.success('操作成功');
closeFun();

View File

@@ -8,6 +8,7 @@
:params="{
dimensionTemplateId: currentDimension
}"
:default-expanded-keys="[currentData.id]"
@choseNode="choseNodeFun"
>
<template #options>
@@ -31,10 +32,8 @@
<template #table>
<BaseTable
tableName="DATA_OVERVIEW"
:api="dataQueryDirApi"
:params="{
uuid: currentData.uuid
}"
:api="dataOverViewListSimulationNodeFilesApi"
:params="tableParams"
showCheckbox
@checkbox-all="checkboxChangeFun"
@checkbox-change="checkboxChangeFun"
@@ -47,7 +46,7 @@
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="showProjectInfoDialog = true">新增项目</el-dropdown-item>
<el-dropdown-item @click="addFun">新增项目</el-dropdown-item>
<el-dropdown-item @click="openNodeFun">新增阶段</el-dropdown-item>
<el-dropdown-item @click="modalVisible = true">新增分类</el-dropdown-item>
<el-dropdown-item>新增任务</el-dropdown-item>
@@ -71,7 +70,7 @@
</template>
</el-dropdown>
<el-button :icon="Edit" type="primary" @click="editFun">编辑</el-button>
<el-button :icon="Delete" type="danger" @click="delFun">删除</el-button>
<el-button :icon="Delete" type="danger" :disabled="chosenData.length === 0" @click="delFun">删除</el-button>
<el-button :icon="Refresh" @click="reloadFun">刷新</el-button>
<el-button :icon="Warning" @click="infoShow = true">属性信息</el-button>
<el-button :icon="Search" @click="searchShow = true">搜索</el-button>
@@ -80,11 +79,14 @@
<template #originalName="{ row }">
<div class="file-name" @dblclick="goDetailFun(row)">
<el-icon :size="16">
<MessageBox />
<Folder />
</el-icon>
<el-link type="primary" class="name">{{ row.originalName }}</el-link>
</div>
</template>
<template #dataType="{ row }">
{{ DATA_TYPE.O[row.dataType] }}
</template>
</BaseTable>
</template>
</FileTree>
@@ -111,15 +113,16 @@
/>
<ProjectInfoDialog
v-model="showProjectInfoDialog"
:projectId="currentData.uuid"
:projectId="editId"
:nodeLevel1List="[]"
@completeFun="reloadFun"
/>
<nodeDetailDialog
<NodeDetailDialog
v-model="modalVisible"
tableName="PROJECT_TASK_MODAL"
diaTitle="新增"
:detail="{}"
@ok="reloadFun"
/>
</div>
</template>
@@ -128,19 +131,21 @@
import { ref, onMounted } from 'vue';
import FileTree from '@/components/common/fileTreeTemp/index.vue';
import { getSimulationNodeTreeApi, getAllTemplateApi } from '@/api/data/dimensionTemplate';
import { dataQueryDirApi, dataDelDirApi, dataUploadFilesApi } from '@/api/data/data';
import { dataOverViewListSimulationNodeFilesApi, dataOverViewDeleteSimulationNodeFilesApi, dataOverViewUploadSimulationNodeFilesApi } from '@/api/data/dataOverView';
import BaseTable from '@/components/common/table/baseTable.vue';
import Configuration from './components/configuration.vue';
import FileSearch from './components/search.vue';
import FileInfo from './components/info.vue';
import AddDir from './components/addDir.vue';
import PhaseInfoDia from '@/components/project/phaseInfoDialog.vue';
import nodeDetailDialog from '@/components/common/treeCaseTable/nodeDetailDialog.vue';
import { ElMessage } from 'element-plus';
import NodeDetailDialog from '@/components/common/treeCaseTable/nodeDetailDialog.vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import ProjectInfoDialog from '@/components/project/projectInfoDialog.vue';
import { CirclePlus, Upload, Search, Edit, Refresh, Delete, Warning } from '@element-plus/icons-vue';
import { CirclePlus, Upload, Search, Edit, Refresh, Delete, Warning, Folder } from '@element-plus/icons-vue';
import { NODE_TYPE } from '@/utils/enum/node';
import { useDict } from '@/utils/useDict';
const { DATA_TYPE } = useDict('DATA_TYPE');
const currentDimension = ref(1);
const templateList = ref<any>([]);
const configurationShow = ref(false);
@@ -152,7 +157,9 @@ const addDirShow = ref(false);
const modalVisible = ref(false);
const currentData = ref<any>('');
const FileTreeRef = ref();
let chosenData: any[] = [];
const editId = ref('');
const chosenData = ref<any>([]);
const tableParams = ref<any>({});
onMounted(() => {
getAllTemplateFun();
@@ -167,11 +174,17 @@ const getAllTemplateFun = () => {
});
};
const addFun = () => {
editId.value = '';
showProjectInfoDialog.value = true;
};
const editFun = () => {
if (!currentData.value) {
ElMessage.warning('请选择一个目录');
return;
}
editId.value = currentData.value.uuid;
if (currentData.value.nodeType === NODE_TYPE.PROJECT) {
showProjectInfoDialog.value = true;
}
@@ -181,24 +194,22 @@ const editFun = () => {
};
const delFun = () => {
if (chosenData.length === 0) {
ElMessage.warning('请选择要删除的数据');
return;
}
console.log(chosenData);
const proList: any[] = [];
chosenData.forEach((item: any) => {
proList.push(dataDelDirApi({ delDirId: item.id }));
});
Promise.all(proList).then((res: any) => {
console.log(res);
});
// const params = {
// delDirId: '',
// };
// dataDelDirApi(params).then((res: any) => {
// console.log(res);
// });
ElMessageBox.confirm('删除后不可恢复,确认删除吗?', '提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
const proList: any[] = [];
chosenData.value.forEach((item: any) => {
proList.push(dataOverViewDeleteSimulationNodeFilesApi({ deleteId: item.id, dataType: item.dataType }));
});
Promise.all(proList).then(() => {
ElMessage.success('操作成功');
reloadFun();
});
}).catch(() => {});
};
const beforeUploadFun = (file: any) => {
@@ -212,8 +223,7 @@ const beforeUploadFun = (file: any) => {
dirId: currentData.value.id,
file: file,
};
dataUploadFilesApi(params).then((res: any) => {
console.log(res);
dataOverViewUploadSimulationNodeFilesApi(params).then((res: any) => {
if (res.code === 200) {
ElMessage.success('上传成功');
}
@@ -223,7 +233,7 @@ const beforeUploadFun = (file: any) => {
const openNodeFun = () => {
if (!currentData.value || currentData.value.nodeType !== NODE_TYPE.PROJECT) {
ElMessage.warning('请选择一个项目目录');
ElMessage.warning('请在项目下创建阶段');
return;
}
showNodeInfoDialog.value = true;
@@ -239,19 +249,26 @@ const openAddDirFun = () => {
const goDetailFun = (data: any) => {
if (FileTreeRef.value) {
FileTreeRef.value.openDirFun(data.id);
FileTreeRef.value.openDirFun(data.uuid);
}
};
const choseNodeFun = (data: any) => {
tableParams.value = {
dimensionTemplateId: currentDimension.value,
chooseUuid: data.uuid,
chooseNodeType: data.nodeType,
// fileId: currentData.id,
};
currentData.value = data;
};
const checkboxChangeFun = (data: any) => {
chosenData = data.records;
chosenData.value = data.records;
};
const reloadFun = () => {
chosenData.value = [];
if (FileTreeRef.value) {
FileTreeRef.value.reloadFun();
}

View File

@@ -36,8 +36,8 @@ export default defineConfig(({ mode }) => {
},
'/local7101': {
// target: 'http://192.168.65.199:7101', // 李东洋
target: 'http://192.168.65.75:7100/simulation/project', // 朱欣茹
// target: 'http://192.168.65.161/api/simulation/project', // 开发环境
// target: 'http://192.168.65.75:7100/simulation/project', // 朱欣茹
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', // 戴琼瑶本地
@@ -58,8 +58,8 @@ export default defineConfig(({ mode }) => {
},
'/local7103': { // system系统模块
// target: 'http://192.168.65.199:7103', // 李东洋
// target: 'http://192.168.65.161:80/api/simulation/system', // 开发环境
target: 'http://192.168.65.75:7100/simulation/system', // 朱欣茹
target: 'http://192.168.65.161:80/api/simulation/system', // 开发环境
// target: 'http://192.168.65.75:7100/simulation/system', // 朱欣茹
changeOrigin: true,
// rewrite: (path) => path.replace(/^\/local7103/, ''),
rewrite: (path) => {
@@ -75,8 +75,8 @@ export default defineConfig(({ mode }) => {
},
'/local7107': { // data文件模块
// target: 'http://192.168.65.199:7104', // 李东洋
// target: 'http://192.168.65.161:80/api/simulation/data', // 开发环境
target: 'http://192.168.65.219:7107', // 戴琼瑶本地
target: 'http://192.168.65.161:80/api/simulation/data', // 开发环境
// target: 'http://192.168.65.219:7107', // 戴琼瑶本地
// target: 'http://192.168.65.161', // 开发环境
changeOrigin: true,
rewrite: (path) => path.replace(/^\/local7107/, ''),

View File

@@ -18,3 +18,10 @@
3.变量userName
4.方法todoFun = () => {};
##### js结束 ######
##### 自定义组件事件名称 ######
@close 关闭
@show 打开
@update 更新
@confirm 提交
##### 自定义组件事件名称 ######