faq.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. define(["jquery", "easy-admin"], function ($, ea) {
  2. var init = {
  3. table_elem: '#currentTable',
  4. table_render_id: 'currentTableRenderId',
  5. index_url: 'system.faq/index',
  6. add_url: 'system.faq/add',
  7. edit_url: 'system.faq/edit',
  8. delete_url: 'system.faq/delete',
  9. export_url: 'system.faq/export',
  10. modify_url: 'system.faq/modify',
  11. };
  12. var Controller = {
  13. index: function () {
  14. ea.table.render({
  15. init: init,
  16. cols: [[
  17. {type: 'checkbox'},
  18. {field: 'id', title: 'id', searchOP: '='},
  19. {field: 'title', title: '标题', searchOP: '='},
  20. {field: 'parent_id', title: '父级名称', searchOP: '='},
  21. {field: 'sort', title: '序号', edit: 'text', search: false},
  22. {field: 'status', title: '状态', templet: ea.table.switch, selectList: {0: '禁用', 1: '正常'}},
  23. {width: 250, title: '操作', templet: ea.table.tool},
  24. ]],
  25. });
  26. ea.listen();
  27. },
  28. add: function () {
  29. ea.listen();
  30. },
  31. edit: function () {
  32. ea.listen();
  33. },
  34. };
  35. return Controller;
  36. });