12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- /**
- * 目录编辑
- */
- Ext.define('saas.view.help.DocItemWindow', {
- extend: 'Ext.window.Window',
- xtype: 'help-docitem-win',
- viewModel: {
- data: {
- form: {
- id: null,
- code: null,
- name: null,
- article: true
- }
- },
- formulas: {
- title: function (get) {
- return (get('form.id') ? '编辑' : '新增') + (get('form.article') ? '文档' : '文件夹');
- }
- }
- },
- bind: {
- title: '{title}'
- },
- bodyPadding: '10 20',
- width: 500,
- ui: 'simple',
- layout: {
- type: 'vbox',
- pack: 'start',
- align: 'stretch'
- },
- onConfirm: Ext.emptyFn,
- initComponent: function () {
- var me = this;
- me.items = [{
- xtype: 'textfield',
- fieldLabel: '编码',
- labelWidth: 50,
- bind: '{form.code}'
- }, {
- xtype: 'textfield',
- fieldLabel: '名称',
- labelWidth: 50,
- bind: '{form.name}'
- }, {
- xtype: 'toolbar',
- items: [{
- xtype: 'tbfill'
- }, {
- text: '保存',
- ui: 'primary',
- handler: function () {
- var data = Ext.clone(me.getViewModel().get('form'));
- me.close();
- me.onConfirm(data, me);
- },
- scope: me,
- bind: {
- disabled: '{!form.code||!form.name}'
- }
- }, {
- text: '取消',
- ui: 'simple',
- margin: '0',
- handler: 'close',
- scope: me
- }]
- }];
- me.callParent(arguments);
- },
- loadData: function (data) {
- this.getViewModel().set('form', data);
- }
- });
|