List.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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: 'mailbox_title',
  89. addTitle: '校长信箱',
  90. addXtype: 'interaction-maibox-Detail',
  91. statusCodeField: null,
  92. dataUrl: me.dataUrl,
  93. caller: null,
  94. rootProperty: 'data.list',
  95. totalProperty: 'data.total',
  96. actionColumn: [],
  97. selModel: {
  98. checkOnly: true,
  99. type: 'checkboxmodel',
  100. mode: "MULTI",
  101. ignoreRightMouseSelection: false
  102. },
  103. hiddenTools: false,
  104. disableDetail: false,
  105. toolBtns: [{
  106. xtype: 'button',
  107. text: '忽略',
  108. handler: 'onIgnoreClick'
  109. }, {
  110. xtype: 'button',
  111. text: '取消忽略',
  112. handler: 'onUnIgnoreClick'
  113. }],
  114. columns : [{
  115. text: '标题',
  116. dataIndex: 'mailbox_title',
  117. width: 250
  118. }, {
  119. text: '内容',
  120. dataIndex: 'mailbox_context',
  121. xtype: 'widgetcolumn',
  122. tdCls: 'content-column',
  123. widget: {
  124. xtype: 'textareatrigger',
  125. winTitle: '内容',
  126. margin: '0',
  127. editable: false
  128. },
  129. width: 300
  130. }, {
  131. text: '回复状态',
  132. dataIndex: 'mailbox_status',
  133. renderer: function(v, m, r) {
  134. return v == 3 ? '已回复' : '未回复';
  135. }
  136. }, {
  137. text: '回复信息',
  138. dataIndex: 'mb_reply',
  139. width: 250
  140. }, {
  141. text: '忽略状态',
  142. dataIndex: 'mb_ignore',
  143. renderer: function(v, m, r) {
  144. return v == 1 ? '已忽略' : '正常';
  145. }
  146. }, {
  147. text: 'ID',
  148. dataIndex: 'mailbox_id',
  149. hidden: true
  150. }, {
  151. xtype: 'datecolumn',
  152. text: '日期',
  153. dataIndex: 'create_date',
  154. width: 150
  155. }, {
  156. text: '提出人',
  157. dataIndex: 'mb_creatorname',
  158. width: 120
  159. }, {
  160. text: '年级',
  161. dataIndex: 'mb_grade'
  162. }, {
  163. text: '班级',
  164. dataIndex: 'mb_class'
  165. }, {
  166. text: '学生',
  167. dataIndex: 'mb_student'
  168. }]
  169. },
  170. });
  171. this.callParent(arguments);
  172. },
  173. refresh: function() {
  174. Ext.StoreMgr.get('store_grade').load();
  175. Ext.StoreMgr.get('store_class').load();
  176. this.items.items[0].store.load();
  177. }
  178. });