新增表格初始化搜索功能;新增getQueryVariable助手函数.

This commit is contained in:
augushong
2021-12-14 15:40:58 +08:00
parent 644f9ffbfe
commit 6bb2b70807
2 changed files with 52 additions and 16 deletions

View File

@@ -29,20 +29,21 @@ define(["jquery", "easy-admin"], function ($, ea) {
}],
'delete', 'export'],
cols: [[
{type: "checkbox"},
{field: 'id', width: 80, title: 'ID'},
{field: 'sort', width: 80, title: '排序', edit: 'text'},
{field: 'cate.title', minWidth: 80, title: '商品分类'},
{field: 'title', minWidth: 80, title: '商品名称'},
{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: '库存统计'},
{field: 'stock', width: 100, title: '剩余库存'},
{field: 'virtual_sales', width: 100, title: '虚拟销量'},
{field: 'sales', width: 80, title: '销量'},
{field: 'status', title: '状态', width: 85, selectList: {0: '禁用', 1: '启用'}, templet: ea.table.switch},
{field: 'create_time', minWidth: 80, title: '创建时间', search: 'range'},
{ type: "checkbox" },
{ field: 'id', width: 80, title: 'ID' },
{ 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: 'title', minWidth: 80, title: '商品名称', },
{ 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: '库存统计' },
{ field: 'stock', width: 100, title: '剩余库存' },
{ field: 'virtual_sales', width: 100, title: '虚拟销量' },
{ field: 'sales', width: 80, title: '销量' },
{ field: 'status', title: '状态', width: 85, selectList: { 0: '禁用', 1: '启用' }, templet: ea.table.switch },
{ field: 'create_time', minWidth: 80, title: '创建时间', search: 'range' },
{
width: 250,
title: '操作',