Ext.define('erp.view.common.init.InitStep', { extend: 'Ext.Viewport', style: 'background: #f1f2f5;', initComponent : function(){ var me = this; Ext.apply(me, { items: [{ xtype: 'panel', bodyStyle: 'background: #f1f2f5;', width: '100%', layout: { type: 'hbox', pack: 'center' }, items: [ this.createStaticGrid(), this.createDynamicGrid() ], buttonAlign: 'center', buttons: [{ text: '上一步', cls: 'custom-button', name: 'prev' }, { text: '刷新', name: 'refresh', cls: 'custom-button' }, { text: '下一步', name: 'next', cls: 'custom-button' }] }] }); me.callParent(arguments); }, createStaticGrid: function() { var me = this; Ext.define('Import', { extend : 'Ext.data.Model', fields : [ { name : 'no', type : 'number' }, { name : 'caller', type : 'string' }, { name : 'table', type : 'string' }, { name : 'cond', type : 'string' }, { name : 'module', type : 'string' }, { name : 'data', type : 'string' }, { name : 'count', type : 'string' }, { name : 'method', type : 'string' }] }); var store = Ext.create('Ext.data.Store', { model : 'Import', sorters: [{ property : 'no', direction: 'ASC' }], data: this._data }); this.staticgrid = Ext.create('Ext.grid.Panel', { title: '静态数据', bodyStyle: 'background: #f1f1f1;min-height: 450px;', cls: 'custom', columns: [{ text: '顺序', dataIndex: 'no', width: 40, tdCls: 'x-grid-cell-special', align: 'center' }, { text: '模块', dataIndex: 'module', width: 80 }, { text: '数据', dataIndex: 'data', width: 140 }, { text: '引入方式', dataIndex: 'method', width: 100 }, { text: '已记录数', dataIndex: 'count', align: 'right', width: 70, renderer: function(val, meta, record) { if(val == 'loading') { meta.tdCls = 'loading'; return ''; } meta.tdCls = ''; return val; } },{ text: '导入', width: 50, cls: 'x-grid-header', renderer: function(val, meta){ meta.tdCls = 'x-form-excel-trigger'; meta.style = 'cursor:pointer;'; return val; }, processEvent: function(type, view, cell, recordIndex, cellIndex, e) { if (type == 'mousedown' || (type == 'keydown' && (e.getKey() == e.ENTER || e.getKey() == e.SPACE))) { var grid = view.ownerCt, record = grid.store.getAt(recordIndex); me.createTemplate(record); } return false; } }], columnLines: true, store: store }); return this.staticgrid; }, createDynamicGrid: function() { var me = this; Ext.define('Import', { extend : 'Ext.data.Model', fields : [ { name : 'no', type : 'number' }, { name : 'caller', type : 'string' }, { name : 'table', type : 'string' }, { name : 'cond', type : 'string' }, { name : 'module', type : 'string' }, { name : 'data', type : 'string' }, { name : 'count', type : 'string' }, { name : 'method', type : 'string' }] }); var store = Ext.create('Ext.data.Store', { model : 'Import', sorters: [{ property : 'no', direction: 'ASC' }], data: this.__data }); this.dynamicgrid = Ext.create('Ext.grid.Panel', { title: '动态数据', bodyStyle: 'background: #f1f1f1;min-height: 450px;', cls: 'custom', name: 'dynamic', columns: [{ text: '顺序', dataIndex: 'no', width: 40, tdCls: 'x-grid-cell-special', align: 'center' }, { text: '模块', dataIndex: 'module', width: 80 }, { text: '数据', dataIndex: 'data', width: 140 }, { text: '引入方式', dataIndex: 'method', width: 100 }, { text: '已记录数', dataIndex: 'count', align: 'right', width: 70, renderer: function(val, meta, record) { if(val == 'loading') { meta.tdCls = 'loading'; return ''; } meta.tdCls = ''; return val; } },{ text: '引入', width: 50, cls: 'x-grid-header', renderer: function(val, meta){ meta.tdCls = 'x-form-excel-trigger'; meta.style = 'cursor:pointer;'; return val; }, processEvent: function(type, view, cell, recordIndex, cellIndex, e) { if (type == 'mousedown' || (type == 'keydown' && (e.getKey() == e.ENTER || e.getKey() == e.SPACE))) { var grid = view.ownerCt, record = grid.store.getAt(recordIndex); me.createTemplate(record); } return false; } }], columnLines: true, store: store }); return this.dynamicgrid; }, createTemplate: function(record) { var c = record.get('caller'); if(!c) return; Ext.create('Ext.Window', { title: record.get('data'), width: '80%', height: '100%', autoShow: true, items: [{ width: '100%', height: '100%', html: '