mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
新增filePreview表格模板,只能对uploadfile的模型使用,不再预览非image类型
This commit is contained in:
@@ -20,7 +20,7 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
||||
{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.image},
|
||||
{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类型'},
|
||||
|
||||
@@ -240,7 +240,7 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
$(".layui-table-fixed").each(function () {
|
||||
$($(this).find(".layui-table-body tbody tr")[index]).height($(val).height());
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var optionDone = function () { }
|
||||
@@ -727,8 +727,22 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
return option.selectList[value];
|
||||
}
|
||||
},
|
||||
image: function (data) {
|
||||
filePreview: function (data) {
|
||||
console.log(data);
|
||||
|
||||
if (!data.mime_type) {
|
||||
return admin.table.url(data);
|
||||
}
|
||||
|
||||
var mimeName = data.mime_type.split('/')[0];
|
||||
|
||||
if (mimeName == 'image') {
|
||||
return admin.table.image(data);
|
||||
}
|
||||
|
||||
return admin.table.url(data);
|
||||
},
|
||||
image: function (data) {
|
||||
var option = data.LAY_COL;
|
||||
option.imageWidth = option.imageWidth || 200;
|
||||
option.imageHeight = option.imageHeight || 40;
|
||||
@@ -1519,7 +1533,7 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
cols: [[
|
||||
{ type: selectCheck },
|
||||
{ field: 'id', title: 'ID' },
|
||||
{ field: 'url', minWidth: 80, search: false, title: '图片信息', imageHeight: 40, align: "center", templet: admin.table.image },
|
||||
{ field: 'url', minWidth: 80, search: false, title: '图片信息', imageHeight: 40, align: "center", templet: admin.table.filePreview },
|
||||
{ field: 'original_name', width: 150, title: '文件原名', align: "center" },
|
||||
{ field: 'mime_type', width: 120, title: 'mime类型', align: "center" },
|
||||
{ field: 'create_time', width: 200, title: '创建时间', align: "center", search: 'range' },
|
||||
|
||||
Reference in New Issue
Block a user