新增字段存储容量格式化;

This commit is contained in:
augushong
2022-07-28 00:11:00 +08:00
parent 34ed44299a
commit 00a6295362

View File

@@ -1072,7 +1072,18 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
}
return '<span>' + value + '</span>';
},
bytes: (data) => {
var size = admin.table.returnColumnValue(data);
if (size > 0) {
const kb = 1024
const unit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
const i = Math.floor(Math.log(size) / Math.log(kb))
const num = (size / Math.pow(kb, i)).toPrecision(3)
const u = unit[i]
return num + u;
}
return '0B'
},
// 统一列返回数据处理
returnColumnValue(data) {
if (!data.LAY_COL) {