List.js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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: true,
  57. store: Ext.create('Ext.data.ArrayStore', {
  58. fields: ['name', 'value'],
  59. data: [['已回复', 3], ['未回复', 0]]
  60. }),
  61. minChars: 0,
  62. queryMode: 'local',
  63. getCondition: function(v) {
  64. return v == 3 ? ('mailbox_status = 3') : ('mailbox_status != 3 or mailbox_status is null')
  65. }
  66. }, {
  67. xtype: 'combobox',
  68. fieldLabel: '忽略状态',
  69. name: 'mb_ignore',
  70. displayField: 'name',
  71. valueField: 'value',
  72. editable: true,
  73. value: '0',
  74. store: Ext.create('Ext.data.ArrayStore', {
  75. fields: ['name', 'value'],
  76. data: [['已忽略', 1], ['正常', 0]]
  77. }),
  78. minChars: 0,
  79. queryMode: 'local',
  80. getCondition: function(v) {
  81. return v == 1 ? ('mb_ignore = 1') : ('mb_ignore != 1 or mb_ignore is null')
  82. }
  83. }],
  84. gridConfig: {
  85. idField: 'mailbox_id',
  86. codeField: null,
  87. statusCodeField: null,
  88. dataUrl: me.dataUrl,
  89. caller: null,
  90. rootProperty: 'data.list',
  91. totalProperty: 'data.total',
  92. actionColumn: [],
  93. selModel: {
  94. checkOnly: true,
  95. type: 'checkboxmodel',
  96. mode: "MULTI",
  97. ignoreRightMouseSelection: false
  98. },
  99. hiddenTools: false,
  100. disableDetail: true,
  101. toolBtns: [{
  102. xtype: 'button',
  103. text: '忽略',
  104. handler: 'onIgnoreClick'
  105. }, {
  106. xtype: 'button',
  107. text: '取消忽略',
  108. handler: 'onUnIgnoreClick'
  109. }],
  110. columns : [{
  111. text: '标题',
  112. dataIndex: 'mailbox_title',
  113. width: 120
  114. }, {
  115. text: '内容',
  116. dataIndex: 'mailbox_context',
  117. xtype: 'widgetcolumn',
  118. tdCls: 'content-column',
  119. widget: {
  120. xtype: 'textareatrigger',
  121. winTitle: '内容',
  122. margin: '0',
  123. editable: false
  124. },
  125. width: 300
  126. }, {
  127. text: '回复状态',
  128. dataIndex: 'mailbox_status',
  129. renderer: function(v, m, r) {
  130. return v == 3 ? '已回复' : '未回复';
  131. }
  132. }, {
  133. xtype:'actioncolumn',
  134. width:70,
  135. dataIndex:'actioncolumn',
  136. text:'回复',
  137. align: 'center',
  138. items: [{
  139. tooltip: '回复',
  140. iconCls: 'x-ss ss-reply fa-fw',
  141. scope:this
  142. }],
  143. listeners: {
  144. click: 'onActionClick'
  145. }
  146. }, {
  147. text: '回复信息',
  148. dataIndex: 'mb_reply',
  149. width: 250
  150. }, {
  151. text: '忽略状态',
  152. dataIndex: 'mb_ignore',
  153. renderer: function(v, m, r) {
  154. return v == 1 ? '已忽略' : '正常';
  155. }
  156. }, {
  157. text: 'ID',
  158. dataIndex: 'mailbox_id',
  159. hidden: true
  160. }, {
  161. xtype: 'datecolumn',
  162. text: '日期',
  163. dataIndex: 'create_date',
  164. width: 150
  165. }, {
  166. text: '提出人',
  167. dataIndex: 'mb_creatorname',
  168. width: 120
  169. }, {
  170. text: '年级',
  171. dataIndex: 'mb_grade'
  172. }, {
  173. text: '班级',
  174. dataIndex: 'mb_class'
  175. }, {
  176. text: '学生',
  177. dataIndex: 'mb_student'
  178. }]
  179. },
  180. });
  181. this.callParent(arguments);
  182. },
  183. refresh: function() {
  184. Ext.StoreMgr.get('store_grade').load();
  185. Ext.StoreMgr.get('store_class').load();
  186. this.items.items[0].store.load();
  187. }
  188. });