|
|
@@ -9,13 +9,13 @@ Ext.define('school.view.interaction.notice.List', {
|
|
|
dataUrl: '/api/school/notice/list',
|
|
|
_title: '学校通知',
|
|
|
|
|
|
- initComponent: function() {
|
|
|
+ initComponent: function () {
|
|
|
var me = this;
|
|
|
Ext.apply(this, {
|
|
|
searchField: [{
|
|
|
xtype: 'textfield',
|
|
|
name: 'keyword',
|
|
|
- fieldLabel:'关键字',
|
|
|
+ fieldLabel: '关键字',
|
|
|
getCondition: function (value) {
|
|
|
return ' (notify_title like\'%' + value + '%\' or notify_details like \'%' + value + '%\') ';
|
|
|
}
|
|
|
@@ -33,17 +33,39 @@ Ext.define('school.view.interaction.notice.List', {
|
|
|
clearable: true,
|
|
|
store: Ext.create('Ext.data.ArrayStore', {
|
|
|
fields: ['name', 'value'],
|
|
|
- data: [['已发布', 1], ['未发布', 2]]
|
|
|
+ data: [
|
|
|
+ ['已发布', 1],
|
|
|
+ ['未发布', 2]
|
|
|
+ ]
|
|
|
}),
|
|
|
minChars: 0,
|
|
|
- queryMode: 'local'
|
|
|
+ queryMode: 'local',
|
|
|
+ listeners: {
|
|
|
+ select: function (combo, record, e) {
|
|
|
+ let condatefield = combo.up('form').down('condatefield')
|
|
|
+ if (record.data.value == 1) {
|
|
|
+ condatefield.setHidden(false);
|
|
|
+ condatefield.ignore = false;
|
|
|
+ } else {
|
|
|
+ condatefield.setHidden(true);
|
|
|
+ condatefield.ignore = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ clear: function (combo) {
|
|
|
+ let condatefield = combo.up('form').down('condatefield')
|
|
|
+ condatefield.setHidden(true);
|
|
|
+ condatefield.ignore = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}, {
|
|
|
+ hidden: true,
|
|
|
+ ignore: true,
|
|
|
xtype: 'condatefield',
|
|
|
name: 'publish_date',
|
|
|
fieldLabel: '发布时间',
|
|
|
columnWidth: 0.5
|
|
|
}],
|
|
|
-
|
|
|
+
|
|
|
gridConfig: {
|
|
|
addTitle: '学校通知',
|
|
|
addXtype: 'interaction-notice-schoolnotice',
|
|
|
@@ -56,33 +78,33 @@ Ext.define('school.view.interaction.notice.List', {
|
|
|
totalProperty: 'data.total',
|
|
|
actionColumn: [],
|
|
|
selModel: {
|
|
|
- checkOnly:true,
|
|
|
- type:'checkboxmodel',
|
|
|
- mode : "MULTI" ,
|
|
|
- ignoreRightMouseSelection : false
|
|
|
+ checkOnly: true,
|
|
|
+ type: 'checkboxmodel',
|
|
|
+ mode: "MULTI",
|
|
|
+ ignoreRightMouseSelection: false
|
|
|
},
|
|
|
hiddenTools: false,
|
|
|
toolBtns: [{
|
|
|
xtype: 'button',
|
|
|
text: '新增',
|
|
|
- handler: function() {
|
|
|
+ handler: function () {
|
|
|
school.util.BaseUtil.openTab('interaction-notice-schoolnotice', '新增学校通知', 'interaction-notice-schoolnotice-add');
|
|
|
}
|
|
|
}, {
|
|
|
xtype: 'button',
|
|
|
text: '删除',
|
|
|
- handler: function() {
|
|
|
+ handler: function () {
|
|
|
let grid = this.up('grid'),
|
|
|
- selectedRecords = grid.getSelection();
|
|
|
+ selectedRecords = grid.getSelection();
|
|
|
let data;
|
|
|
|
|
|
- data = selectedRecords.map(function(r) {
|
|
|
+ data = selectedRecords.map(function (r) {
|
|
|
return {
|
|
|
id: r.get('notify_id')
|
|
|
};
|
|
|
});
|
|
|
|
|
|
- if(data.length == 0) {
|
|
|
+ if (data.length == 0) {
|
|
|
school.util.BaseUtil.showErrorToast('请先勾选需要删除的记录');
|
|
|
return;
|
|
|
}
|
|
|
@@ -95,17 +117,17 @@ Ext.define('school.view.interaction.notice.List', {
|
|
|
params: JSON.stringify({
|
|
|
baseDTOs: data
|
|
|
})
|
|
|
- }).then(function(res) {
|
|
|
+ }).then(function (res) {
|
|
|
grid.setLoading(false);
|
|
|
school.util.BaseUtil.showSuccessToast('成功删除' + data.length + '条记录');
|
|
|
grid.store.loadPage(grid.store.currentPage);
|
|
|
- }).catch(function(e) {
|
|
|
+ }).catch(function (e) {
|
|
|
grid.setLoading(false);
|
|
|
school.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
|
|
|
});
|
|
|
}
|
|
|
}],
|
|
|
- columns : [{
|
|
|
+ columns: [{
|
|
|
text: 'id',
|
|
|
dataIndex: 'notify_id',
|
|
|
hidden: true
|
|
|
@@ -134,7 +156,7 @@ Ext.define('school.view.interaction.notice.List', {
|
|
|
text: '发布状态',
|
|
|
dataIndex: 'notify_status',
|
|
|
width: 120,
|
|
|
- renderer: function(v) {
|
|
|
+ renderer: function (v) {
|
|
|
return !!v ? (v == 2 ? '未发布' : '已发布') : '未发布'
|
|
|
}
|
|
|
}, {
|