List.js 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /**
  2. * 校长信箱
  3. */
  4. Ext.define('school.view.interaction.mailbox.List', {
  5. extend: 'school.view.core.base.BasePanel',
  6. xtype: 'interaction-mailbox-list',
  7. controller: 'interaction-mailbox-list',
  8. // dataUrl: 'http://10.1.80.47:9520/api/school/principal/list',
  9. dataUrl: '/api/school/principal/list',
  10. initComponent: function() {
  11. var me = this;
  12. Ext.apply(this, {
  13. searchField: [{
  14. xtype: 'textfield',
  15. name: 'keyword',
  16. fieldLabel: '关键字',
  17. getCondition: function (value) {
  18. return ' (mailbox_title like\'%' + value + '%\' or mailbox_context like \'%' + value + '%\') ';
  19. }
  20. }, {
  21. xtype: 'gradecombo',
  22. name: 'mb_grade',
  23. fieldLabel: '年级',
  24. listeners: {
  25. select: function (combo, record, eOpts) {
  26. combo.up('form').getForm().findField('mb_class').setValue(null);
  27. }
  28. }
  29. }, {
  30. xtype: 'classcombo',
  31. name: 'mb_class',
  32. fieldLabel: '班级',
  33. listeners: {
  34. expand: function (combo, eOpts) {
  35. combo.store.clearFilter();
  36. var gradeCombo = combo.up('form').getForm().findField('mb_grade');
  37. var gradeName = gradeCombo.getValue();
  38. var filter = new Ext.util.Filter({
  39. property: 'clazz_grade',
  40. value: gradeName
  41. });
  42. if (!!gradeName) {
  43. combo.store.setFilters([filter]);
  44. }
  45. },
  46. select: function (combo, record, eOpts) {
  47. combo.up('form').getForm().findField('mb_grade').setValue(record.get('clazz_grade'));
  48. }
  49. }
  50. }, {
  51. xtype: 'combobox',
  52. fieldLabel: '回复状态',
  53. name: 'mb_reply',
  54. displayField: 'name',
  55. valueField: 'value',
  56. editable: false,
  57. clearable: true,
  58. store: Ext.create('Ext.data.ArrayStore', {
  59. fields: ['name', 'value'],
  60. data: [['已回复', 3], ['未回复', 0]]
  61. }),
  62. minChars: 0,
  63. queryMode: 'local',
  64. getCondition: function(v) {
  65. return v == 3 ? ('mailbox_status = 3') : ('mailbox_status != 3 or mailbox_status is null')
  66. }
  67. }, {
  68. xtype: 'combobox',
  69. fieldLabel: '忽略状态',
  70. name: 'mb_ignore',
  71. displayField: 'name',
  72. valueField: 'value',
  73. editable: false,
  74. clearable: true,
  75. value: '0',
  76. store: Ext.create('Ext.data.ArrayStore', {
  77. fields: ['name', 'value'],
  78. data: [['已忽略', 1], ['正常', 0]]
  79. }),
  80. minChars: 0,
  81. queryMode: 'local',
  82. getCondition: function(v) {
  83. return v == 1 ? ('mb_ignore = 1') : ('mb_ignore != 1 or mb_ignore is null')
  84. }
  85. }],
  86. gridConfig: {
  87. idField: 'mailbox_id',
  88. codeField: null,
  89. statusCodeField: null,
  90. dataUrl: me.dataUrl,
  91. caller: null,
  92. rootProperty: 'data.list',
  93. totalProperty: 'data.total',
  94. actionColumn: [],
  95. selModel: {
  96. checkOnly: true,
  97. type: 'checkboxmodel',
  98. mode: "MULTI",
  99. ignoreRightMouseSelection: false
  100. },
  101. hiddenTools: false,
  102. disableDetail: true,
  103. toolBtns: [{
  104. xtype: 'button',
  105. text: '忽略',
  106. handler: 'onIgnoreClick'
  107. }, {
  108. xtype: 'button',
  109. text: '取消忽略',
  110. handler: 'onUnIgnoreClick'
  111. }],
  112. columns : [{
  113. text: '标题',
  114. dataIndex: 'mailbox_title',
  115. width: 250
  116. }, {
  117. text: '内容',
  118. dataIndex: 'mailbox_context',
  119. xtype: 'widgetcolumn',
  120. tdCls: 'content-column',
  121. widget: {
  122. xtype: 'textareatrigger',
  123. winTitle: '内容',
  124. margin: '0',
  125. editable: false
  126. },
  127. width: 300
  128. }, {
  129. text: '回复状态',
  130. dataIndex: 'mailbox_status',
  131. renderer: function(v, m, r) {
  132. return v == 3 ? '已回复' : '未回复';
  133. }
  134. }, {
  135. xtype:'actioncolumn',
  136. width:70,
  137. dataIndex:'actioncolumn',
  138. text:'回复',
  139. align: 'center',
  140. items: [{
  141. tooltip: '回复',
  142. iconCls: 'x-ss ss-reply fa-fw',
  143. scope:this
  144. }],
  145. listeners: {
  146. click: 'onActionClick'
  147. }
  148. }, {
  149. text: '回复信息',
  150. dataIndex: 'mb_reply',
  151. width: 250
  152. }, {
  153. text: '忽略状态',
  154. dataIndex: 'mb_ignore',
  155. renderer: function(v, m, r) {
  156. return v == 1 ? '已忽略' : '正常';
  157. }
  158. }, {
  159. text: 'ID',
  160. dataIndex: 'mailbox_id',
  161. hidden: true
  162. }, {
  163. xtype: 'datecolumn',
  164. text: '日期',
  165. dataIndex: 'create_date',
  166. width: 150
  167. }, {
  168. text: '提出人',
  169. dataIndex: 'mb_creatorname',
  170. width: 120
  171. }, {
  172. text: '年级',
  173. dataIndex: 'mb_grade'
  174. }, {
  175. text: '班级',
  176. dataIndex: 'mb_class'
  177. }, {
  178. text: '学生',
  179. dataIndex: 'mb_student'
  180. }]
  181. },
  182. });
  183. this.callParent(arguments);
  184. },
  185. refresh: function() {
  186. Ext.StoreMgr.get('store_grade').load();
  187. Ext.StoreMgr.get('store_class').load();
  188. this.items.items[0].store.load();
  189. }
  190. });