|
|
@ -457,7 +457,7 @@ layui.use(['layer', 'listPage', 'globalTree', 'gtable', 'form', 'element', 'drop |
|
|
|
searchFieldNames: 'search', |
|
|
|
searchFieldNames: 'search', |
|
|
|
url: `${ctx}/search/full/file?metaId=${id}`, |
|
|
|
url: `${ctx}/search/full/file?metaId=${id}`, |
|
|
|
height: 'full-110', |
|
|
|
height: 'full-110', |
|
|
|
where: {searchFields: THeadSetLayer.filterConfigData(fileTableId).filter(conf=>conf.isShow).map(conf => conf.colName).join(',')}, |
|
|
|
where: {searchFields: THeadSetLayer.filterConfigData(fileTableId).filter(conf => conf.isShow).map(conf => conf.colName).join(',')}, |
|
|
|
request: {pageName: 'page', limitName: 'size'}, |
|
|
|
request: {pageName: 'page', limitName: 'size'}, |
|
|
|
defaultToolbar: [{title: '列表配置', layEvent: 'theadSet2', icon: 'layui-icon-cols'}], |
|
|
|
defaultToolbar: [{title: '列表配置', layEvent: 'theadSet2', icon: 'layui-icon-cols'}], |
|
|
|
autoSort: false, |
|
|
|
autoSort: false, |
|
|
@ -610,6 +610,7 @@ class THeadSetLayer { |
|
|
|
exerciseData: data => data.exerciseData ? '是' : '否', |
|
|
|
exerciseData: data => data.exerciseData ? '是' : '否', |
|
|
|
resourceType: data => data.resourceType === 'file' ? '文件' : '数据库表', |
|
|
|
resourceType: data => data.resourceType === 'file' ? '文件' : '数据库表', |
|
|
|
fileSize: data => { |
|
|
|
fileSize: data => { |
|
|
|
|
|
|
|
return fileSizeFormat(data.fileSize, 'M'); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -634,4 +635,18 @@ class THeadSetLayer { |
|
|
|
cols.push(operateCol); |
|
|
|
cols.push(operateCol); |
|
|
|
return [cols]; |
|
|
|
return [cols]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const units = ['B', 'K', 'M', 'G', 'T', 'P']; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function fileSizeFormat(size, initUnit = 'B') { |
|
|
|
|
|
|
|
initUnit = initUnit.toUpperCase(); |
|
|
|
|
|
|
|
const i = units.indexOf(initUnit); |
|
|
|
|
|
|
|
if (size > 1024 && i < units.length - 1) { |
|
|
|
|
|
|
|
return fileSizeFormat(size / 1024, units[i + 1]); |
|
|
|
|
|
|
|
} else if (size < 1 && i > -1) { |
|
|
|
|
|
|
|
return fileSizeFormat(size * 1024, units[i - 1]); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return Math.round(size * 100) / 100 + initUnit; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |