update:数据总览优化

This commit is contained in:
2025-12-01 09:49:34 +08:00
parent c2a451edbc
commit 18a28da763
2 changed files with 39 additions and 8 deletions

View File

@@ -194,10 +194,19 @@ const searchFun = () => {
emit('search'); emit('search');
}; };
const reloadNodeFun = (id: any) => {
const node = treeRef.value.getNode(id);
if (node) {
node.loaded = false;
node.expand();
}
};
defineExpose({ defineExpose({
backFun, backFun,
openDirFun, openDirFun,
reloadFun, reloadFun,
reloadNodeFun,
}); });
</script> </script>

View File

@@ -44,6 +44,7 @@
@checkbox-all="checkboxChangeFun" @checkbox-all="checkboxChangeFun"
@checkbox-change="checkboxChangeFun" @checkbox-change="checkboxChangeFun"
@cell-click="cellClickFun" @cell-click="cellClickFun"
:actionList="actionList"
> >
<template #leftOptions> <template #leftOptions>
<div> <div>
@@ -127,7 +128,7 @@
<Configuration <Configuration
v-model="configurationShow" v-model="configurationShow"
:dimensionId="currentDimension" :dimensionId="currentDimension"
@confirm="reloadFun" @confirm="reloadNodeFun"
/> />
<FileSearch <FileSearch
v-model="searchShow" v-model="searchShow"
@@ -137,20 +138,20 @@
<AddDir <AddDir
v-model="addDirShow" v-model="addDirShow"
:data="currentData" :data="currentData"
@submit="reloadFun" @submit="reloadNodeFun"
/> />
<PhaseInfoDia <PhaseInfoDia
v-if="showNodeInfoDialog" v-if="showNodeInfoDialog"
v-model:showNodeInfoDialog="showNodeInfoDialog" v-model:showNodeInfoDialog="showNodeInfoDialog"
:nodeLevel1Uuid="editId" :nodeLevel1Uuid="editId"
dialogType="edit" dialogType="edit"
@completeFun="reloadFun" @completeFun="reloadNodeFun"
/> />
<ProjectInfoDialog <ProjectInfoDialog
v-model="showProjectInfoDialog" v-model="showProjectInfoDialog"
:projectId="editId" :projectId="editId"
:nodeLevel1List="[]" :nodeLevel1List="[]"
@completeFun="reloadFun" @completeFun="reloadNodeFun"
/> />
<NodeDetailDialog <NodeDetailDialog
v-model="modalVisible" v-model="modalVisible"
@@ -185,6 +186,7 @@ import { useDict } from '@/utils/useDict';
import { formatFileSize } from '@/utils/file'; import { formatFileSize } from '@/utils/file';
import { isCategoryNodeType } from '@/utils/node'; import { isCategoryNodeType } from '@/utils/node';
const env = import.meta.env;
const { DATA_TYPE } = useDict('DATA_TYPE'); const { DATA_TYPE } = useDict('DATA_TYPE');
const currentDimension = ref(1); const currentDimension = ref(1);
const templateList = ref<any>([]); const templateList = ref<any>([]);
@@ -204,6 +206,20 @@ const BaseTableRef = ref();
const fileData = ref<any>({}); const fileData = ref<any>({});
const nodeType = ref<any>(''); const nodeType = ref<any>('');
const actionList = ref([
{
title: '下载',
type: 'primary',
click: (row: any) => {
const downloadUrl = `${env.VITE_API_FILE_URL}/data/downloadFile?fileId=${row.id}`;
window.open(downloadUrl, '_blank');
},
hide: (row: any) => {
return row.dataType === 1;
},
},
]);
onMounted(() => { onMounted(() => {
getAllTemplateFun(); getAllTemplateFun();
}); });
@@ -297,7 +313,7 @@ const delFun = () => {
}); });
Promise.all(proList).then(() => { Promise.all(proList).then(() => {
ElMessage.success('操作成功'); ElMessage.success('操作成功');
reloadFun(); reloadNodeFun();
}); });
}).catch(() => {}); }).catch(() => {});
}; };
@@ -321,7 +337,7 @@ const beforeUploadFun = (file: any) => {
dataOverViewUploadSimulationNodeFilesApi(params).then((res: any) => { dataOverViewUploadSimulationNodeFilesApi(params).then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
ElMessage.success('上传成功'); ElMessage.success('上传成功');
reloadFun(); reloadNodeFun();
} }
}); });
return false; return false;
@@ -363,7 +379,7 @@ const editClassFun = (data: any) => {
if (res.code === 200) { if (res.code === 200) {
ElMessage.success('操作成功'); ElMessage.success('操作成功');
modalVisible.value = false; modalVisible.value = false;
reloadFun(); reloadNodeFun();
} }
}); });
}; };
@@ -391,7 +407,7 @@ const editTaskFun = (data: any) => {
if (res.code === 200) { if (res.code === 200) {
ElMessage.success('操作成功'); ElMessage.success('操作成功');
modalVisible.value = false; modalVisible.value = false;
reloadFun(); reloadNodeFun();
} }
}); });
}; };
@@ -425,6 +441,12 @@ const reloadFun = () => {
FileTreeRef.value.reloadFun(); FileTreeRef.value.reloadFun();
} }
}; };
const reloadNodeFun = () => {
if (FileTreeRef.value) {
FileTreeRef.value.reloadNodeFun(currentData.value.id);
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>