diff --git a/packages/base/data/list-table.vue b/packages/base/data/list-table.vue
index 4498626..2345af6 100644
--- a/packages/base/data/list-table.vue
+++ b/packages/base/data/list-table.vue
@@ -2,12 +2,12 @@
+ :row-key="rowKey" :tree-porps="treeProps">
+ :align="item.align ? item.align : 'center'" show-overflow-tooltip
+ :formatter="(row: any, column: any, value: any) => formatter(row, column, value, item)">
@@ -66,10 +66,6 @@ const prop = defineProps({
type: Object,
default: null,
},
- defaultSort: {
- type: Object,
- default: {},
- },
});
const emit = defineEmits(["query", "selection-change"]);
@@ -100,7 +96,7 @@ const getValue = (
return value;
};
-const formatStamp = (row: any, column: any, value: any, index: number) => {
+const formatStamp = (value: any) => {
const date = new Date(value * 1000);
const month = date.getMonth() < 9 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
const day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
@@ -109,7 +105,7 @@ const formatStamp = (row: any, column: any, value: any, index: number) => {
const second = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
return date.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
};
-const formatFileSize = (row: any, column: any, value: any, index: number) => {
+const formatFileSize = (value: any) => {
const k = value / 1024;
if (k < 1) {
return value + "B";
@@ -125,7 +121,13 @@ const formatFileSize = (row: any, column: any, value: any, index: number) => {
return g.toFixed(2) + "G";
};
-const formatter = (row: any, column: any, value: any, index: number) => {
+const formatter = (row: any, column: any, value: any, item: any) => {
+ if (item.dict)
+ return formatterByDist(item.dict, value);
+ if (item.timestamp)
+ return formatStamp(value);
+ if (item.filesize)
+ return formatFileSize(value);
if (row.scheme)
return formatterByDist(row.scheme + '_' + column.property, value);
return getValue(null, '', value);