/** * 编辑公告 */ Ext.define('saas.view.message.NoticeWindow', { extend: 'Ext.window.Window', xtype: 'sys-notice-win', viewModel: { data: { form: { id: null, content: null, status: 0, level: 0 } }, formulas: { title: function (get) { return (get('form.id') ? '编辑' : '新增') + '公告'; } } }, bind: { title: '{title}' }, bodyPadding: '10 20', width: '62%', ui: 'simple', layout: { type: 'vbox', pack: 'start', }, onConfirm: Ext.emptyFn, initComponent: function () { var me = this; me.items = [{ xtype: 'combobox', fieldLabel: '公告级别', labelWidth: 70, editable: false, bind: '{form.level}', queryMode: 'local', displayField: 'display', valueField: 'value', store: { data: [{ display: '普通', value: 0 }, { display: '重要', value: 1 }] } }, { xtype: 'htmleditor', fieldLabel: '公告内容', labelWidth: 70, allowBlank: false, bind: { value: '{form.content}' } }, { xtype: 'toolbar', items: [{ xtype: 'tbfill' }, { text: '保存', ui: 'primary', handler: function () { me.onConfirm(me.getViewModel().get('form'), me); }, scope: me, bind: { disabled: '{!form.content}' } }, { text: '取消', ui: 'simple', margin: '0', handler: 'close', scope: me }] }]; me.callParent(arguments); }, loadData: function (data) { this.getViewModel().set('form', data); } });