fix: 返回数据参数调整,显示文件大小

This commit is contained in:
TsMask
2025-06-16 18:40:34 +08:00
parent 951d48f470
commit 38c0e3d08d

View File

@@ -5,6 +5,7 @@ import { SizeType } from 'ant-design-vue/es/config-provider';
import { ColumnsType } from 'ant-design-vue/es/table';
import { Modal, message } from 'ant-design-vue/es';
import { parseDateToStr } from '@/utils/date-utils';
import { parseSizeFromFile } from '@/utils/parse-utils';
import { getNeFile, listNeFiles } from '@/api/tool/neFile';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useNeInfoStore from '@/store/modules/neinfo';
@@ -79,16 +80,19 @@ let tableColumns: ColumnsType = [
dataIndex: 'size',
align: 'left',
width: 100,
customRender(opt) {
return parseSizeFromFile(opt.value);
},
},
{
title: t('views.logManage.neFile.modifiedTime'),
dataIndex: 'modifiedTime',
align: 'left',
width: 200,
customRender(opt) {
if (!opt.value) return '';
return parseDateToStr(opt.value * 1000);
},
width: 250,
},
{
title: t('views.logManage.neFile.fileName'),
@@ -238,9 +242,10 @@ function fnGetList(pageNum?: number) {
}
queryParams.path = nePathArr.value.join('/');
listNeFiles(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
tablePagination.total = res.total;
tableState.data = res.rows;
if (res.code === RESULT_CODE_SUCCESS) {
const { total, rows } = res.data;
tablePagination.total = total;
tableState.data = rows;
if (
tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize &&