/** * 学校通知 */ Ext.define('school.view.interaction.notice.SchoolNotice', { extend: 'school.view.core.form.FormPanel', xtype: 'interaction-notice-schoolnotice', controller: 'interaction-notice-schoolnotice', // viewModel: 'purchase-purchase-formpanel', //字段属性 _title: '学校通知', _idField: 'notify_id', _codeField: null, // _readUrl: 'http://10.1.80.180:9520/api/school/notice/read', _readUrl: '/api/school/notice/read', // _saveUrl: 'http://10.1.80.180:9520/api/school/notice/save', _saveUrl: '/api/school/notice/save', _deleteUrl: '/api/school/notice/delete', initId: 0, initComponent: function () { Ext.apply(this, { defaultItems: [{ xtype: 'hidden', name: 'notify_id', fieldLabel: 'id' }, { xtype: "textfield", name: "notify_creator", fieldLabel: "发布人id", columnWidth: 0.5, defaultValue: school.util.BaseUtil.getCurrentUser().id, hidden: true }, { xtype: "textfield", name: "creator", fieldLabel: "发布人", columnWidth: 0.5, defaultValue: school.util.BaseUtil.getCurrentUser().username, readOnly: true }, { xtype: 'combobox', name: 'notify_status', fieldLabel: '发布状态', displayField: 'name', valueField: 'value', editable: false, readOnly: true, defaultValue: 2, store: Ext.create('Ext.data.ArrayStore', { fields: ['name', 'value'], data: [['未发布', 2], ['已发布', 1]] }), minChars: 0, queryMode: 'local' }, { xtype: 'datefield', name: 'publish_date', fieldLabel: '发布时间', readOnly: true, format: 'Y-m-d H:i:s', defaultValue: new Date(), readOnly: true }, { xtype: "textfield", name: "notify_title", fieldLabel: "标题", columnWidth: 1, allowBlank: false }, { xtype: "textareafield",//文本域 name: 'notify_details', fieldLabel: "内容", height: 300, columnWidth: 1, allowBlank: false }, { xtype: 'mfilefield', name: 'accessory', fieldLabel: '附件' }], applyBtns: [{ apply: true, text: '保存', bind: { hidden: '{!showSaveBtn || notify_status == 1}', disabled: '{!base.valid}' } }], toolBtns: [{ xtype: 'button', text: '发布', hidden: true, bind: { hidden: '{!notify_id || notify_status == 1}' }, handler: 'onPublish' }] }); this.callParent(); }, listeners: { load: function(form, data) { let fileField = form.down('mfilefield'); fileField.value = data.main.accessory fileField.renderMF(fileField); } } });