| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- /**
- * 校长信箱
- */
- Ext.define('school.view.interaction.mailbox.List', {
- extend: 'school.view.core.base.BasePanel',
- xtype: 'interaction-mailbox-list',
- controller: 'interaction-mailbox-list',
- // dataUrl: 'http://10.1.80.47:9520/api/school/principal/list',
- dataUrl: '/api/school/principal/list',
- initComponent: function() {
- var me = this;
- Ext.apply(this, {
- searchField: [{
- xtype: 'textfield',
- name: 'keyword',
- fieldLabel: '关键字',
- getCondition: function (value) {
- return ' (mailbox_title like\'%' + value + '%\' or mailbox_context like \'%' + value + '%\') ';
- }
- }, {
- xtype: 'gradecombo',
- name: 'mb_grade',
- fieldLabel: '年级',
- listeners: {
- select: function (combo, record, eOpts) {
- combo.up('form').getForm().findField('mb_class').setValue(null);
- }
- }
- }, {
- xtype: 'classcombo',
- name: 'mb_class',
- fieldLabel: '班级',
- listeners: {
- expand: function (combo, eOpts) {
- combo.store.clearFilter();
- var gradeCombo = combo.up('form').getForm().findField('mb_grade');
- var gradeName = gradeCombo.getValue();
- var filter = new Ext.util.Filter({
- property: 'clazz_grade',
- value: gradeName
- });
- if (!!gradeName) {
- combo.store.setFilters([filter]);
- }
- },
- select: function (combo, record, eOpts) {
- combo.up('form').getForm().findField('mb_grade').setValue(record.get('clazz_grade'));
- }
- }
- }, {
- xtype: 'combobox',
- fieldLabel: '回复状态',
- name: 'mb_reply',
- displayField: 'name',
- valueField: 'value',
- editable: true,
- store: Ext.create('Ext.data.ArrayStore', {
- fields: ['name', 'value'],
- data: [['已回复', 3], ['未回复', 0]]
- }),
- minChars: 0,
- queryMode: 'local',
- getCondition: function(v) {
- return v == 3 ? ('mailbox_status = 3') : ('mailbox_status != 3 or mailbox_status is null')
- }
- }, {
- xtype: 'combobox',
- fieldLabel: '忽略状态',
- name: 'mb_ignore',
- displayField: 'name',
- valueField: 'value',
- editable: true,
- value: '0',
- store: Ext.create('Ext.data.ArrayStore', {
- fields: ['name', 'value'],
- data: [['已忽略', 1], ['正常', 0]]
- }),
- minChars: 0,
- queryMode: 'local',
- getCondition: function(v) {
- return v == 1 ? ('mb_ignore = 1') : ('mb_ignore != 1 or mb_ignore is null')
- }
- }],
- gridConfig: {
- idField: 'mailbox_id',
- codeField: null,
- statusCodeField: null,
- dataUrl: me.dataUrl,
- caller: null,
- rootProperty: 'data.list',
- totalProperty: 'data.total',
- actionColumn: [],
- selModel: {
- checkOnly: true,
- type: 'checkboxmodel',
- mode: "MULTI",
- ignoreRightMouseSelection: false
- },
- hiddenTools: false,
- disableDetail: true,
- toolBtns: [{
- xtype: 'button',
- text: '忽略',
- handler: 'onIgnoreClick'
- }, {
- xtype: 'button',
- text: '取消忽略',
- handler: 'onUnIgnoreClick'
- }],
- columns : [{
- text: '标题',
- dataIndex: 'mailbox_title',
- width: 120
- }, {
- text: '内容',
- dataIndex: 'mailbox_context',
- xtype: 'widgetcolumn',
- tdCls: 'content-column',
- widget: {
- xtype: 'textareatrigger',
- winTitle: '内容',
- margin: '0',
- editable: false
- },
- width: 300
- }, {
- text: '回复状态',
- dataIndex: 'mailbox_status',
- renderer: function(v, m, r) {
- return v == 3 ? '已回复' : '未回复';
- }
- }, {
- xtype:'actioncolumn',
- width:70,
- dataIndex:'actioncolumn',
- text:'回复',
- align: 'center',
- items: [{
- tooltip: '回复',
- iconCls: 'x-ss ss-reply fa-fw',
- scope:this
- }],
- listeners: {
- click: 'onActionClick'
- }
- }, {
- text: '回复信息',
- dataIndex: 'mb_reply',
- width: 250
- }, {
- text: '忽略状态',
- dataIndex: 'mb_ignore',
- renderer: function(v, m, r) {
- return v == 1 ? '已忽略' : '正常';
- }
- }, {
- text: 'ID',
- dataIndex: 'mailbox_id',
- hidden: true
- }, {
- xtype: 'datecolumn',
- text: '日期',
- dataIndex: 'create_date',
- width: 150
- }, {
- text: '提出人',
- dataIndex: 'mb_creatorname',
- width: 120
- }, {
- text: '年级',
- dataIndex: 'mb_grade'
- }, {
- text: '班级',
- dataIndex: 'mb_class'
- }, {
- text: '学生',
- dataIndex: 'mb_student'
- }]
- },
- });
- this.callParent(arguments);
- },
- refresh: function() {
- Ext.StoreMgr.get('store_grade').load();
- Ext.StoreMgr.get('store_class').load();
- this.items.items[0].store.load();
- }
- });
|