define(["jquery", "easy-admin"], function ($, ea) { var init = { table_elem: '#currentTable', table_render_id: 'currentTableRenderId', index_url: 'box.AppointList/index', add_url: 'coupon.couponarea/add', edit_url: 'coupon.couponarea/edit', delete_url: 'coupon.couponarea/delete', opentime_url:'coupon.couponarea/addtime', export_url: 'mall.cate/export', modify_url: 'coupon.couponarea/modify', }; var Controller = { index: function () { ea.table.render({ init: init, toolbar:['refresh', [ // { // text: '添加', // url: init.add_url, // method: 'open', // auth: 'add', // class: 'layui-btn layui-btn-normal layui-btn-sm', // icon: 'fa fa-plus ' // }, // { // text: '导入', // url: init.putin_url, // method: 'import', // auth: 'putin', // class: 'layui-btn layui-btn-success layui-btn-sm', // icon: 'fa fa-plus ', // } ] ], cols: [[ {type: "checkbox"}, {field: 'id', width: 80, title: 'ID'}, {field: 'box_id', minWidth: 80, title: '盒子id'}, {field: 'qi_count', minWidth: 80, title: '第几期'}, {field: 'lun_count', minWidth: 80, title: '第几轮'}, {field: 'user.nickname', minWidth: 180, title: '用户昵称'}, {field: 'user.mobile', minWidth: 120, title: '手机号'}, {field: 'num', minWidth: 80, title: '数量'}, // {field: 'add_scale', minWidth: 80, title: '增长比例',templet: function (d) { // return '' + d.add_scale+'%'; // // }}, {field: 'status', minWidth: 150, title: '状态', search: 'select', selectList: {'1': '预约成功', '2': '已匹配', '3':'已拆开'}}, // {field: 'box_type', minWidth: 150, title: '拆出来的类型', search: 'select', selectList: {'0': '预约成功', '2': '普通', '3':'稀有', '4':'史诗', '5':'传说'}}, {field: 'create_time', minWidth: 200, title: '创建时间'}, {field: 'box_img', width: 120, title: '图片封面', templet: function (d) { return ''; }}, {field: 'box_title', minWidth: 50, title: '福袋名字'} // {width: 250, title: '操作', templet: ea.table.tool, // operat: ['edit', // [{ // text: '配置时间', // url: init.opentime_url, // method: 'open', // auth: 'addtime', // refresh:false, // class: 'layui-btn layui-btn-normal layui-btn-xs', // }] // ]}, ]], }); ea.listen(); }, add: function () { ea.listen(); }, edit: function () { ea.listen(); }, addtime: function () { ea.listen(); } }; return Controller; });