company.js 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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: 'company/index' + location.search,
  8. add_url: 'company/add',
  9. edit_url: 'company/edit',
  10. del_url: 'company/del',
  11. multi_url: 'company/multi',
  12. import_url: 'company/import',
  13. table: 'company',
  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. columns: [
  23. [
  24. {checkbox: true},
  25. {field: 'id', title: __('Id')},
  26. {field: 'company_name', title: __('Company_name'), operate: 'LIKE'},
  27. {field: 'company_tel', title: __('Company_tel'), operate: 'LIKE'},
  28. {field: 'sys_appid', title: __('Sys_appid'), operate: 'LIKE'},
  29. {field: 'sys_appsecret', title: __('Sys_appsecret'), operate: 'LIKE'},
  30. {field: 'wechat_appid', title: __('Wechat_appid'), operate: 'LIKE'},
  31. {field: 'wechat_appsecret', title: __('Wechat_appsecret'), operate: 'LIKE'},
  32. {field: 'wechat_token', title: __('Wechat_token'), operate: 'LIKE'},
  33. {field: 'wechat_encode', title: __('Wechat_encode'), searchList: {"0":__('Wechat_encode 0'),"1":__('Wechat_encode 1'),"2":__('Wechat_encode 2')}, formatter: Table.api.formatter.normal},
  34. {field: 'wechat_encodingaeskey', title: __('Wechat_encodingaeskey'), operate: 'LIKE'},
  35. {field: 'wechat_share_image', title: __('Wechat_share_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
  36. {field: 'wechat_qrcode_image', title: __('Wechat_qrcode_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
  37. {field: 'pay_weixin_open', title: __('Pay_weixin_open'), searchList: {"0":__('Pay_weixin_open 0'),"1":__('Pay_weixin_open 1')}, formatter: Table.api.formatter.normal},
  38. {field: 'pay_weixin_mchid', title: __('Pay_weixin_mchid'), operate: 'LIKE'},
  39. {field: 'pay_weixin_client_certfile', title: __('Pay_weixin_client_certfile'), operate: false},
  40. {field: 'pay_weixin_client_keyfile', title: __('Pay_weixin_client_keyfile'), operate: false},
  41. {field: 'pay_weixin_key', title: __('Pay_weixin_key'), operate: 'LIKE'},
  42. {field: 'routine_appid', title: __('Routine_appid'), operate: 'LIKE'},
  43. {field: 'routine_appsecret', title: __('Routine_appsecret'), operate: 'LIKE'},
  44. {field: 'routine_qrcode_image', title: __('Routine_qrcode_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
  45. {field: 'pay_routine_open', title: __('Pay_routine_open'), searchList: {"0":__('Pay_routine_open 0'),"1":__('Pay_routine_open 1')}, formatter: Table.api.formatter.normal},
  46. {field: 'pay_routine_mchid', title: __('Pay_routine_mchid'), operate: 'LIKE'},
  47. {field: 'pay_routine_key', title: __('Pay_routine_key'), operate: 'LIKE'},
  48. {field: 'pay_routine_client_cert', title: __('Pay_routine_client_cert'), operate: 'LIKE'},
  49. {field: 'pay_routine_client_key', title: __('Pay_routine_client_key'), operate: 'LIKE'},
  50. {field: 'share_title', title: __('Share_title'), operate: 'LIKE'},
  51. {field: 'share_info', title: __('Share_info'), operate: 'LIKE'},
  52. {field: 'wx_open_platform', title: __('Wx_open_platform'), searchList: {"0":__('Wx_open_platform 0'),"1":__('Wx_open_platform 1')}, formatter: Table.api.formatter.normal},
  53. {field: 'wx_open_appid', title: __('Wx_open_appid'), operate: 'LIKE'},
  54. {field: 'wx_open_appsecret', title: __('Wx_open_appsecret'), operate: 'LIKE'},
  55. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  56. ]
  57. ]
  58. });
  59. // 为表格绑定事件
  60. Table.api.bindevent(table);
  61. },
  62. add: function () {
  63. Controller.api.bindevent();
  64. },
  65. edit: function () {
  66. Controller.api.bindevent();
  67. },
  68. api: {
  69. bindevent: function () {
  70. Form.api.bindevent($("form[role=form]"));
  71. }
  72. }
  73. };
  74. return Controller;
  75. });