|
|
@@ -5,6 +5,9 @@ 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;
|
|
|
@@ -12,11 +15,80 @@ Ext.define('school.view.interaction.mailbox.List', {
|
|
|
searchField: [{
|
|
|
xtype: 'textfield',
|
|
|
name: 'keyword',
|
|
|
- fieldLabel: '关键字'
|
|
|
+ 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: 'gradeName',
|
|
|
+ value: gradeName
|
|
|
+ });
|
|
|
+
|
|
|
+ if (!!gradeName) {
|
|
|
+ combo.store.setFilters([filter]);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ select: function (combo, record, eOpts) {
|
|
|
+ combo.up('form').getForm().findField('mb_grade').setValue(record.get('gradeName'));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ 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: false,
|
|
|
+ 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: null,
|
|
|
+ idField: 'mailbox_id',
|
|
|
codeField: null,
|
|
|
statusCodeField: null,
|
|
|
dataUrl: me.dataUrl,
|
|
|
@@ -25,103 +97,88 @@ Ext.define('school.view.interaction.mailbox.List', {
|
|
|
totalProperty: 'data.total',
|
|
|
actionColumn: [],
|
|
|
selModel: {
|
|
|
- type: 'cellmodel'
|
|
|
+ checkOnly: true,
|
|
|
+ type: 'checkboxmodel',
|
|
|
+ mode: "MULTI",
|
|
|
+ ignoreRightMouseSelection: false
|
|
|
},
|
|
|
hiddenTools: false,
|
|
|
disableDetail: true,
|
|
|
toolBtns: [{
|
|
|
xtype: 'button',
|
|
|
- text: '导出'
|
|
|
+ text: '忽略',
|
|
|
+ handler: 'onIgnoreClick'
|
|
|
}, {
|
|
|
xtype: 'button',
|
|
|
- text: '批量回复'
|
|
|
+ text: '取消忽略',
|
|
|
+ handler: 'onUnIgnoreClick'
|
|
|
}, {
|
|
|
xtype: 'button',
|
|
|
text: '删除'
|
|
|
}],
|
|
|
columns : [{
|
|
|
+ text: 'ID',
|
|
|
+ dataIndex: 'mailbox_id',
|
|
|
+ hidden: true
|
|
|
+ }, {
|
|
|
text: '标题',
|
|
|
- dataIndex: 'mailboxTitle',
|
|
|
+ dataIndex: 'mailbox_title',
|
|
|
width: 120
|
|
|
}, {
|
|
|
text: '内容',
|
|
|
- dataIndex: 'mailboxContext',
|
|
|
+ dataIndex: 'mailbox_context',
|
|
|
width: 300
|
|
|
}, {
|
|
|
xtype: 'datecolumn',
|
|
|
text: '日期',
|
|
|
- dataIndex: 'createDate'
|
|
|
+ dataIndex: 'create_date',
|
|
|
+ width: 150
|
|
|
}, {
|
|
|
text: '提出人',
|
|
|
- dataIndex: 'mailboxCreator',
|
|
|
+ dataIndex: 'mb_creatorname',
|
|
|
width: 120
|
|
|
+ }, {
|
|
|
+ text: '年级',
|
|
|
+ dataIndex: 'mb_grade'
|
|
|
+ }, {
|
|
|
+ text: '班级',
|
|
|
+ dataIndex: 'mb_class'
|
|
|
+ }, {
|
|
|
+ text: '学生',
|
|
|
+ dataIndex: 'mb_student'
|
|
|
+ }, {
|
|
|
+ text: '回复状态',
|
|
|
+ dataIndex: 'mailbox_status',
|
|
|
+ renderer: function(v, m, r) {
|
|
|
+ return v == 3 ? '已回复' : '未回复';
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: '忽略状态',
|
|
|
+ dataIndex: 'mb_ignore',
|
|
|
+ renderer: function(v, m, r) {
|
|
|
+ return v == 1 ? '已忽略' : '正常';
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: '回复信息',
|
|
|
+ dataIndex: 'mb_reply',
|
|
|
+ width: 250
|
|
|
+ }, {
|
|
|
+ xtype:'actioncolumn',
|
|
|
+ width:70,
|
|
|
+ dataIndex:'actioncolumn',
|
|
|
+ text:'操作',
|
|
|
+ align: 'center',
|
|
|
+ items: [{
|
|
|
+ tooltip: '回复',
|
|
|
+ iconCls: 'x-fa fa-pencil fa-fw',
|
|
|
+ scope:this
|
|
|
+ }],
|
|
|
+ listeners: {
|
|
|
+ click: 'onActionClick'
|
|
|
+ }
|
|
|
}]
|
|
|
},
|
|
|
});
|
|
|
this.callParent(arguments);
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * 处理部分字段值
|
|
|
- */
|
|
|
- getConditionValue: function (field, value) {
|
|
|
- var me = this,
|
|
|
- xtypes = field.getXTypes().split('/'),
|
|
|
- conditionValue;
|
|
|
- if (me.isContainsAny(xtypes, ['datefield'])) {
|
|
|
- conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
|
|
|
- } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
|
|
|
- var from = value.from,
|
|
|
- to = value.to;
|
|
|
-
|
|
|
- conditionValue = from + ',' + to;
|
|
|
- } else if (me.isContainsAny(xtypes, ['condatefield'])) {
|
|
|
- var from = value.from,
|
|
|
- to = value.to;
|
|
|
-
|
|
|
- conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
|
|
|
- } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
|
|
|
- conditionValue = value;
|
|
|
- } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
|
|
|
- conditionValue = value;
|
|
|
- } else if (me.isContainsAny(xtypes, ['multicombo'])) {
|
|
|
- conditionValue = value.map ? value.map(function (v) {
|
|
|
- return v.value;
|
|
|
- }).join(',') : '';
|
|
|
- } else {
|
|
|
- conditionValue = value;
|
|
|
- }
|
|
|
-
|
|
|
- return conditionValue;
|
|
|
- },
|
|
|
-
|
|
|
- getExtraParams: function(store, op, condition) {
|
|
|
- var temp = {};
|
|
|
-
|
|
|
- for(let x = 0; x < condition.length; x++) {
|
|
|
- let c = condition[x];
|
|
|
- if(c.field == 'keyword') {
|
|
|
- temp.keyword = c.value;
|
|
|
- }else if(c.field == 'date') {
|
|
|
- temp.fromDate = new Date(c.value.split(',')[0]).getTime();
|
|
|
- temp.endDate = new Date(c.value.split(',')[1]).getTime();
|
|
|
- }else if(c.field == 'quoted') {
|
|
|
- temp.quoted = c.value == 'all' ? null : c.value;
|
|
|
- }else if(c.field == 'closed') {
|
|
|
- // temp.endDate = c.value == 'all' ? null : (
|
|
|
- // c.value == '0' ?
|
|
|
- // );
|
|
|
- }
|
|
|
- }
|
|
|
- let obj = {
|
|
|
- pageNumber: store.exportNumber?store.exportNumber:op._page,
|
|
|
- pageSize: store.exportPageSize?store.exportPageSize:store.pageSize
|
|
|
- };
|
|
|
- for(let k in temp) {
|
|
|
- if(!!temp[k]) {
|
|
|
- obj[k] = temp[k];
|
|
|
- }
|
|
|
- }
|
|
|
- return obj;
|
|
|
- },
|
|
|
+ }
|
|
|
});
|