diff --git a/public/static/admin/js/system/uploadfile.js b/public/static/admin/js/system/uploadfile.js
index ec76496..cea31fb 100644
--- a/public/static/admin/js/system/uploadfile.js
+++ b/public/static/admin/js/system/uploadfile.js
@@ -8,7 +8,7 @@ define(["jquery", "easy-admin"], function ($, ea) {
edit_url: 'system.uploadfile/edit',
delete_url: 'system.uploadfile/delete',
modify_url: 'system.uploadfile/modify',
- export_url:'system.uploadfile/export',
+ export_url: 'system.uploadfile/export',
};
var Controller = {
@@ -17,16 +17,20 @@ define(["jquery", "easy-admin"], function ($, ea) {
ea.table.render({
init: init,
cols: [[
- {type: "checkbox"},
- {field: 'id', width: 80, title: 'ID'},
- {field: 'upload_type', minWidth: 80, title: '存储位置', search: 'select', selectList: {'local': '本地', 'alioss': '阿里云', 'qnoss': '七牛云', ',txcos': '腾讯云'}},
- {field: 'url', minWidth: 80, search: false, title: '图片信息', templet: ea.table.filePreview},
- {field: 'url', minWidth: 120, title: '保存地址', templet: ea.table.url},
- {field: 'original_name', minWidth: 80, title: '文件原名'},
- {field: 'mime_type', minWidth: 80, title: 'mime类型'},
- {field: 'file_ext', minWidth: 80, title: '文件后缀'},
- {field: 'create_time', minWidth: 80, title: '创建时间', search: 'range'},
- {width: 250, title: '操作', templet: ea.table.tool, operat: ['delete'],fixed:'right'}
+ { type: "checkbox" },
+ { field: 'id', width: 80, title: 'ID' },
+ { field: 'upload_type', minWidth: 80, title: '存储位置', search: 'select', selectList: { 'local': '本地', 'alioss': '阿里云', 'qnoss': '七牛云', ',txcos': '腾讯云' } },
+ { field: 'url', minWidth: 80, search: false, title: '文件预览', templet: ea.table.filePreview },
+ {
+ field: 'url', minWidth: 120, title: '保存地址', templet: ea.table.url, urlNameField: function (data) {
+ return data.url;
+ }
+ },
+ { field: 'original_name', minWidth: 80, title: '文件原名' },
+ { field: 'mime_type', minWidth: 80, title: 'mime类型' },
+ { field: 'file_ext', minWidth: 80, title: '文件后缀' },
+ { field: 'create_time', minWidth: 80, title: '创建时间', search: 'range' },
+ { width: 250, title: '操作', templet: ea.table.tool, operat: ['delete'], fixed: 'right' }
]],
});
diff --git a/public/static/plugs/easy-admin/easy-admin.js b/public/static/plugs/easy-admin/easy-admin.js
index 26c5cd8..cb50bb0 100644
--- a/public/static/plugs/easy-admin/easy-admin.js
+++ b/public/static/plugs/easy-admin/easy-admin.js
@@ -43,6 +43,7 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
'video': ['mp4', 'avi', 'wmv', '3gp', 'flv'],
// visio扩展名数组
'visio': ['vsd', 'vsdx'],
+ 'file': []
}
for (const extGroupName in extGroup) {
@@ -852,18 +853,25 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
}
},
filePreview: function (data) {
-
- if (!data.mime_type) {
- return admin.table.url(data);
- }
-
+ var option = data.LAY_COL;
var mimeName = data.mime_type.split('/')[0];
+ var field = option.field;
if (mimeName == 'image') {
return admin.table.image(data);
+ } else {
+
+ try {
+ var value = eval("data." + field);
+ } catch (e) {
+ var value = undefined;
+ }
+
+ var groupName = admin.getExtGroupName(data.file_ext);
+
+ return '
'
}
- return admin.table.url(data);
},
image: function (data) {
var option = data.LAY_COL;
@@ -893,12 +901,32 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
url: function (data) {
var option = data.LAY_COL;
var field = option.field;
+ var urlNameField = option.urlNameField || '';
+
try {
var value = eval("data." + field);
} catch (e) {
var value = undefined;
}
- return '' + value + '';
+
+ var urlName = value;
+
+ if (urlNameField != '') {
+ try {
+ var urlNameFieldType = typeof urlNameField;
+
+ if (urlNameFieldType == 'string') {
+ urlName = data[urlNameField]
+ } else if (urlNameFieldType == 'function') {
+ urlName = urlNameField(data)
+ }
+
+ } catch (e) {
+
+ }
+ }
+
+ return '' + urlName + '';
},
switch: function (data) {
var option = data.LAY_COL;
@@ -1705,15 +1733,7 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
// 不是图片
// 遍历extGroup数组找到扩展名所在的索引
- for (const extGroupName in extGroup) {
- if (Object.hasOwnProperty.call(extGroup, extGroupName)) {
- const extGroupList = extGroup[extGroupName];
- if (extGroupList.indexOf(ext) != -1) {
- uploadIcon = extGroupName;
- break;
- }
- }
- }
+ uploadIcon = admin.getExtGroupName(ext);
liHtml += '