| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- define(["jquery", "easy-admin"], function ($, ea) {
- var init = {
- table_elem: '#currentTable',
- table_render_id: 'currentTableRenderId',
- index_url: 'mall.cate/index',
- add_url: 'mall.cate/add',
- edit_url: 'mall.cate/edit',
- delete_url: 'mall.cate/delete',
- export_url: 'mall.cate/export',
- modify_url: 'mall.cate/modify',
- };
- var Controller = {
- index: function () {
- ea.table.render({
- init: init,
- cols: [[
- {type: "checkbox"},
- {field: 'id', width: 80, title: 'ID'},
- {field: 'name', minWidth: 80, title: '分类名称'},
- {field:'urls', title: '选中图片', minWidth: 150,align: 'center',templet:'#img'},
- {field:'urls', title: '正常图片', minWidth: 150,align: 'center',templet:'#img1'},
- // {
- // field: 'sel_pic', minWidth: 250, title: '选中图片', templet:'#sel_pic'
- //
- // },
- // {
- // field: 'nor_pic', minWidth: 250, title: '正常图片', templet: function (d) {
- // return `<div><div style="width: 100%;float: left;margin-right: 8px;"><img src="${QINIU_DOMIAN}${d.goods_img}" alt="" style="width: 50px;height: 50px"></div>
- // </div>`
- // }
- // },
- {field: 'sort', width: 80, title: '排序', edit: 'text'},
- {field: 'status', title: '状态', width: 85, search: 'select', selectList: {0: '禁用', 1: '启用'}, templet: ea.table.switch},
- {width: 250, title: '操作', templet: ea.table.tool}
- ]],
- });
- ea.listen();
- },
- add: function () {
- ea.listen();
- },
- edit: function () {
- ea.listen();
- },
- };
- return Controller;
- });
|