mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 19:12:48 +08:00
优化导出,开始图片导出;
This commit is contained in:
@@ -34,8 +34,9 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
||||
{ field: 'sort', width: 80, title: '排序', edit: 'text' },
|
||||
{ field: 'cate.title', minWidth: 80, title: '商品分类', },
|
||||
{ field: 'cate.id', minWidth: 80, title: '商品分类', hide: true, defaultSearchValue: ea.getQueryVariable('cate_id', '') },
|
||||
{ field: 'cate.image', minWidth: 80, title: '分类图片', search: false, templet: ea.table.image },
|
||||
{ field: 'title', minWidth: 80, title: '商品名称', },
|
||||
{ field: 'logo', minWidth: 80, title: '分类图片', search: false, templet: ea.table.image },
|
||||
{ field: 'logo', minWidth: 80, title: '商品图片', search: false, templet: ea.table.image },
|
||||
{ field: 'market_price', width: 100, title: '市场价', templet: ea.table.price },
|
||||
{ field: 'discount_price', width: 100, title: '折扣价', templet: ea.table.price },
|
||||
{ field: 'total_stock', width: 100, title: '库存统计' },
|
||||
|
||||
@@ -968,12 +968,20 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
}
|
||||
},
|
||||
listenExport: function (options) {
|
||||
|
||||
|
||||
var exportFields = {};
|
||||
|
||||
var imageFields = [];
|
||||
|
||||
options.cols[0].forEach(col => {
|
||||
if (col.field) {
|
||||
|
||||
exportFields[col.field] = col.title;
|
||||
|
||||
if(col.templet == admin.table.image){
|
||||
imageFields.push(col.field)
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -982,7 +990,6 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
var tableId = $(this).attr('data-table-export'),
|
||||
url = $(this).attr('data-url');
|
||||
|
||||
|
||||
var searchVals = form.val(tableId + '_filter_form');
|
||||
|
||||
var dataField = searchVals;
|
||||
@@ -1001,7 +1008,8 @@ define(["jquery", "tableSelect", "ckeditor"], function ($, tableSelect, undefine
|
||||
var searchQuery = {
|
||||
filter: JSON.stringify(formatFilter),
|
||||
op: JSON.stringify(formatOp),
|
||||
fields: JSON.stringify(exportFields)
|
||||
fields: JSON.stringify(exportFields),
|
||||
image_fields: JSON.stringify(imageFields),
|
||||
}
|
||||
|
||||
var query = $.param(searchQuery);
|
||||
|
||||
Reference in New Issue
Block a user