From 00a62953625f482f8c24b5fe3a62f34d7fe909c4 Mon Sep 17 00:00:00 2001 From: augushong Date: Thu, 28 Jul 2022 00:11:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E5=AE=B9=E9=87=8F=E6=A0=BC=E5=BC=8F=E5=8C=96=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/plugs/easy-admin/easy-admin.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/public/static/plugs/easy-admin/easy-admin.js b/public/static/plugs/easy-admin/easy-admin.js index b931dc1..02a4347 100644 --- a/public/static/plugs/easy-admin/easy-admin.js +++ b/public/static/plugs/easy-admin/easy-admin.js @@ -1072,7 +1072,18 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick } return '' + value + ''; }, - + 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) {