cate.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. define(["jquery", "easy-admin"], function ($, ea) {
  2. var init = {
  3. table_elem: '#currentTable',
  4. table_render_id: 'currentTableRenderId',
  5. index_url: 'mall.cate/index',
  6. add_url: 'mall.cate/add',
  7. edit_url: 'mall.cate/edit',
  8. delete_url: 'mall.cate/delete',
  9. export_url: 'mall.cate/export',
  10. modify_url: 'mall.cate/modify',
  11. };
  12. var Controller = {
  13. index: function () {
  14. ea.table.render({
  15. init: init,
  16. cols: [[
  17. {type: "checkbox"},
  18. {field: 'id', width: 80, title: 'ID'},
  19. {field: 'name', minWidth: 80, title: '分类名称'},
  20. {field:'urls', title: '选中图片', minWidth: 150,align: 'center',templet:'#img'},
  21. {field:'urls', title: '正常图片', minWidth: 150,align: 'center',templet:'#img1'},
  22. // {
  23. // field: 'sel_pic', minWidth: 250, title: '选中图片', templet:'#sel_pic'
  24. //
  25. // },
  26. // {
  27. // field: 'nor_pic', minWidth: 250, title: '正常图片', templet: function (d) {
  28. // 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>
  29. // </div>`
  30. // }
  31. // },
  32. {field: 'sort', width: 80, title: '排序', edit: 'text'},
  33. {field: 'status', title: '状态', width: 85, search: 'select', selectList: {0: '禁用', 1: '启用'}, templet: ea.table.switch},
  34. {width: 250, title: '操作', templet: ea.table.tool}
  35. ]],
  36. });
  37. ea.listen();
  38. },
  39. add: function () {
  40. ea.listen();
  41. },
  42. edit: function () {
  43. ea.listen();
  44. },
  45. };
  46. return Controller;
  47. });