List.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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: 'gradeName',
  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('gradeName'));
  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: false,
  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. xtype: 'button',
  111. text: '删除'
  112. }],
  113. columns : [{
  114. text: 'ID',
  115. dataIndex: 'mailbox_id',
  116. hidden: true
  117. }, {
  118. text: '标题',
  119. dataIndex: 'mailbox_title',
  120. width: 120
  121. }, {
  122. text: '内容',
  123. dataIndex: 'mailbox_context',
  124. width: 300
  125. }, {
  126. xtype: 'datecolumn',
  127. text: '日期',
  128. dataIndex: 'create_date',
  129. width: 150
  130. }, {
  131. text: '提出人',
  132. dataIndex: 'mb_creatorname',
  133. width: 120
  134. }, {
  135. text: '年级',
  136. dataIndex: 'mb_grade'
  137. }, {
  138. text: '班级',
  139. dataIndex: 'mb_class'
  140. }, {
  141. text: '学生',
  142. dataIndex: 'mb_student'
  143. }, {
  144. text: '回复状态',
  145. dataIndex: 'mailbox_status',
  146. renderer: function(v, m, r) {
  147. return v == 3 ? '已回复' : '未回复';
  148. }
  149. }, {
  150. text: '忽略状态',
  151. dataIndex: 'mb_ignore',
  152. renderer: function(v, m, r) {
  153. return v == 1 ? '已忽略' : '正常';
  154. }
  155. }, {
  156. text: '回复信息',
  157. dataIndex: 'mb_reply',
  158. width: 250
  159. }, {
  160. xtype:'actioncolumn',
  161. width:70,
  162. dataIndex:'actioncolumn',
  163. text:'操作',
  164. align: 'center',
  165. items: [{
  166. tooltip: '回复',
  167. iconCls: 'x-fa fa-pencil fa-fw',
  168. scope:this
  169. }],
  170. listeners: {
  171. click: 'onActionClick'
  172. }
  173. }]
  174. },
  175. });
  176. this.callParent(arguments);
  177. }
  178. });