publish.js 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. define(['jquery', 'table'], function($, Table) {
  2. Yzn.config.openArea = ['90%', '90%'];
  3. var Controller = {
  4. index: function() {
  5. Table.init = {
  6. table_elem: '#currentTable',
  7. table_render_id: 'currentTable',
  8. delete_url: "cms.publish/del",
  9. edit_url: 'cms.cms/edit',
  10. multi_url: 'cms.publish/multi',
  11. };
  12. Table.render({
  13. init: Table.init,
  14. toolbar: ['refresh', 'delete',
  15. {
  16. text: '通过审核',
  17. auth: 'pass',
  18. icon: 'iconfont icon-check-line',
  19. class: 'layui-btn layui-btn-sm layui-btn-normal layui-btn-disabled btn-disabled',
  20. extend: 'data-params="status=1" lay-event="btn-multi"',
  21. }, {
  22. text: '退稿',
  23. auth: 'reject',
  24. icon: 'iconfont icon-close-line',
  25. class: 'layui-btn layui-btn-sm layui-btn-warm layui-btn-normal layui-btn-disabled btn-disabled',
  26. extend: 'data-params="status=-1" lay-event="btn-multi"',
  27. }
  28. ],
  29. url: 'cms.publish/index',
  30. cols: [
  31. [
  32. { type: 'checkbox', fixed: 'left' },
  33. { field: 'id', width: 80, title: 'ID' },
  34. { field: 'title', title: '标题', search: false },
  35. { field: 'catname', width: 180, title: '所属栏目', search: false },
  36. { field: 'create_time', width: 180, title: '发布时间' },
  37. { field: 'url', width: 60, align: "center", title: 'URL', search: false, templet: Table.formatter.url },
  38. { field: 'status', width: 90, align: "center", title: '状态', templet: '#status' },
  39. {
  40. fixed: 'right',
  41. width: 90,
  42. title: '操作',
  43. templet: Table.formatter.tool,
  44. operat: [
  45. {
  46. class: 'layui-btn layui-btn-success layui-btn-xs btn-dialog',
  47. icon: 'iconfont icon-edit-2-line',
  48. auth: 'edit',
  49. text: "",
  50. title: '编辑信息',
  51. url: function(row) {
  52. return Table.init.edit_url + '?catid=' + row.catid + '&id=' + row.content_id;
  53. },
  54. }, 'delete'
  55. ]
  56. }
  57. ]
  58. ],
  59. page: {}
  60. });
  61. Table.api.bindevent();
  62. }
  63. };
  64. return Controller;
  65. });