diff --git a/src/components/common/filePreview/csvView.vue b/src/components/common/filePreview/csvView.vue index 7baab1bb..2242662f 100644 --- a/src/components/common/filePreview/csvView.vue +++ b/src/components/common/filePreview/csvView.vue @@ -85,7 +85,9 @@ const initCsvChartFun = async (id: any) => { xAxis: { type: 'value', // type: 'category', - name: props.row.xquantityType + '( 单位:' + props.row.xunits + ' )', + name: props.row.xquantityType + ? props.row.xquantityType + '( 单位:' + props.row.xunits + ' )' + : '', nameGap: 40, // 与轴线的距离 nameTextStyle: { align: 'right', // 文字右对齐 @@ -109,7 +111,9 @@ const initCsvChartFun = async (id: any) => { }, }, yAxis: { - name: props.row.yquantityType + '(单位:' + props.row.yunits + ')', + name: props.row.yquantityType + ? props.row.yquantityType + '(单位:' + props.row.yunits + ')' + : '', type: 'value', axisLine: { show: true, @@ -154,6 +158,6 @@ watch( diff --git a/src/components/common/filePreview/index.vue b/src/components/common/filePreview/index.vue index 22193a01..43329285 100644 --- a/src/components/common/filePreview/index.vue +++ b/src/components/common/filePreview/index.vue @@ -1,9 +1,9 @@ @@ -143,7 +138,6 @@ import { getRunListByRunIdListApi } from '@/api/project/node'; import { queryFlowTemplateDetailApi } from '@/api/capability/flow'; import { useDict } from '@/utils/useDict'; import FilePreview from '@/components/common/filePreview/index.vue'; -import csvFileReview from '@/views/data/analysis/components/csvFileReview.vue'; import { downloadFileById } from '@/utils/file'; import { cloneDeep } from 'lodash-es'; @@ -151,7 +145,7 @@ interface Props { currentNode?: string; runId?: string; rowData?: Record; - defaultKeyResultType?: '1' | '2' | '3'| string; + defaultKeyResultType?: '1' | '2' | '3' | string; } const props = withDefaults(defineProps(), { @@ -164,19 +158,12 @@ const { PERFORMANCE_UNIT } = useDict('PERFORMANCE_UNIT'); const previewVisible = ref(false); const currentRow = ref(null); -const showCsvFileDialog = ref(false); -const csvFileId = ref(0); const previewFileFun = (row: any) => { currentRow.value = row; previewVisible.value = true; }; -const previewCsvFileFun = (row: any) => { - csvFileId.value = row.id; - showCsvFileDialog.value = true; -}; - const downloadFileFun = (row: any) => { downloadFileById(row.id); }; @@ -191,7 +178,7 @@ const cloudImageActionList = [ { title: '下载', type: 'primary', click: downloadFileFun }, ]; const curveActionList = [ - { title: '预览', type: 'primary', click: previewCsvFileFun }, + { title: '预览', type: 'primary', click: previewFileFun }, { title: '下载', type: 'primary', click: downloadFileFun }, ]; const reportActionList = [ diff --git a/src/views/data/analysis/index.vue b/src/views/data/analysis/index.vue index d232d7f6..38b7663e 100644 --- a/src/views/data/analysis/index.vue +++ b/src/views/data/analysis/index.vue @@ -273,11 +273,6 @@ @cancel="showPerformanceInfoDialog = false" @submit="updatePerformanceFun" /> - ({}); const tableRef = ref(); -const csvFileId = ref(0); // 更新选中数据 const checkboxChangeFun = (data: any) => { @@ -548,8 +540,7 @@ const modeChangeFun = () => { title: '预览', type: 'primary', click: (row: any) => { - csvFileId.value = row.id; - showCsvFileDialog.value = true; + previewFileFun(row); }, }, { diff --git a/src/views/task/execution/components/runDetailPage/runPagecomponent/reportResult.vue b/src/views/task/execution/components/runDetailPage/runPagecomponent/reportResult.vue index 1b696114..50d530d5 100644 --- a/src/views/task/execution/components/runDetailPage/runPagecomponent/reportResult.vue +++ b/src/views/task/execution/components/runDetailPage/runPagecomponent/reportResult.vue @@ -24,13 +24,7 @@ - - + ({}); const currentDirName = ref(); const currentFileInfo = ref({}); -const showCsvFileDialog = ref(false); const diaPngVisible = ref(false); const columnPngData = ref(1); const comparePngData = ref([]); @@ -679,12 +671,7 @@ const currentRow = ref(); const previewVisible = ref(false); const previewFileFun = (row: any) => { currentRow.value = row; - - if (row.name.endsWith('.csv')) { - showCsvFileDialog.value = true; - } else { - previewVisible.value = true; - } + previewVisible.value = true; }; const fileList = ref([]); diff --git a/src/views/task/execution/components/runDetailPage/runPagecomponent/resultData.vue b/src/views/task/execution/components/runDetailPage/runPagecomponent/resultData.vue index e6d3aac1..7d1e7b21 100644 --- a/src/views/task/execution/components/runDetailPage/runPagecomponent/resultData.vue +++ b/src/views/task/execution/components/runDetailPage/runPagecomponent/resultData.vue @@ -43,13 +43,7 @@ - - + ({}); const currentDirName = ref(); const currentFileInfo = ref({}); -const showCsvFileDialog = ref(false); const diaPngVisible = ref(false); const columnPngData = ref(1); const comparePngData = ref([]); @@ -703,12 +695,7 @@ const currentRow = ref(); const previewVisible = ref(false); const previewFileFun = (row: any) => { currentRow.value = row; - - if (row.name.endsWith('.csv')) { - showCsvFileDialog.value = true; - } else { - previewVisible.value = true; - } + previewVisible.value = true; }; const fileList = ref([]);