manuscript.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2. var Controller = {
  3. index: function () {
  4. // 初始化表格参数配置
  5. Table.api.init({
  6. extend: {
  7. index_url: 'cms/author/manuscript/index' + location.search,
  8. add_url: 'cms/author/manuscript/add',
  9. edit_url: 'cms/author/manuscript/edit',
  10. del_url: 'cms/author/manuscript/del',
  11. multi_url: 'cms/author/manuscript/multi',
  12. import_url: 'cms/author/manuscript/import',
  13. table: 'cms_author_manuscript',
  14. }
  15. });
  16. var table = $("#table");
  17. // 初始化表格
  18. table.bootstrapTable({
  19. url: $.fn.bootstrapTable.defaults.extend.index_url,
  20. pk: 'id',
  21. sortName: 'id',
  22. fixedColumns: true,
  23. fixedRightNumber: 1,
  24. columns: [
  25. [
  26. {checkbox: true},
  27. {field: 'id', title: __('Id')},
  28. {field: 'user_id', title: __('User_id')},
  29. {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
  30. {field: 'manuscript_zip', title: __('Manuscript_zip'), operate: 'LIKE'},
  31. {field: 'manuscript_pdf', title: __('Manuscript_pdf'), operate: 'LIKE'},
  32. {field: 'cover_letter', title: __('Cover_letter'), operate: 'LIKE'},
  33. {field: 'graphical_abstract', title: __('Graphical_abstract'), operate: 'LIKE'},
  34. {field: 'non_material', title: __('Non_material'), operate: 'LIKE'},
  35. {field: 'is_copyright', title: __('Is_copyright'), searchList: {"normal":__('Normal'),"hidden":__('Hidden')}, formatter: Table.api.formatter.normal},
  36. {field: 'copyright_files', title: __('Copyright_files'), operate: false, formatter: Table.api.formatter.files},
  37. {field: 'journal', title: __('Journal'), operate: 'LIKE'},
  38. {field: 'article_type', title: __('Article_type'), operate: 'LIKE'},
  39. {field: 'title', title: __('Title'), operate: 'LIKE'},
  40. {field: 'abstract', title: __('Abstract'), operate: 'LIKE'},
  41. {field: 'keywords', title: __('Keywords'), operate: 'LIKE'},
  42. {field: 'number_page', title: __('Number_page'), operate: 'LIKE'},
  43. {field: 'is_funding', title: __('Is_funding'), searchList: {"normal":__('Normal'),"hidden":__('Hidden')}, formatter: Table.api.formatter.normal},
  44. {field: 'funding_content', title: __('Funding_content'), operate: 'LIKE'},
  45. {field: 'is_interest', title: __('Is_interest'), searchList: {"normal":__('Normal'),"hidden":__('Hidden')}, formatter: Table.api.formatter.normal},
  46. {field: 'interest_content', title: __('Interest_content'), operate: 'LIKE'},
  47. {field: 'statement_type', title: __('Statement_type'), searchList: {"normal":__('Normal'),"hidden":__('Hidden')}, formatter: Table.api.formatter.normal},
  48. {field: 'article_one', title: __('Article_one'), operate: 'LIKE'},
  49. {field: 'article_two', title: __('Article_two'), operate: 'LIKE'},
  50. {field: 'article_three', title: __('Article_three'), operate: 'LIKE'},
  51. {field: 'status', title: __('Status'), searchList: {"100":__('Status 100')}, formatter: Table.api.formatter.status},
  52. {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  53. {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  54. {field: 'country', title: __('Country'), operate: 'LIKE'},
  55. {field: 'affiliation', title: __('Affiliation'), operate: 'LIKE'},
  56. {field: 'name', title: __('Name'), operate: 'LIKE'},
  57. {field: 'invoice_email', title: __('Invoice_email'), operate: 'LIKE'},
  58. {field: 'order_email', title: __('Order_email'), operate: 'LIKE'},
  59. {field: 'address', title: __('Address'), operate: 'LIKE'},
  60. {field: 'zip_code', title: __('Zip_code'), operate: 'LIKE'},
  61. {field: 'city', title: __('City'), operate: 'LIKE'},
  62. {field: 'telephone', title: __('Telephone'), operate: 'LIKE'},
  63. {field: 'fax', title: __('Fax'), operate: 'LIKE'},
  64. {field: 'vat', title: __('Vat'), operate: 'LIKE'},
  65. {field: 'editor_ids', title: __('Editor_ids'), operate: 'LIKE'},
  66. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  67. ]
  68. ]
  69. });
  70. // 为表格绑定事件
  71. Table.api.bindevent(table);
  72. },
  73. add: function () {
  74. Controller.api.bindevent();
  75. },
  76. edit: function () {
  77. Controller.api.bindevent();
  78. },
  79. api: {
  80. bindevent: function () {
  81. Form.api.bindevent($("form[role=form]"));
  82. }
  83. }
  84. };
  85. return Controller;
  86. });