/** * 出入校记录 */ Ext.define('school.view.interaction.access.List', { extend: 'school.view.core.base.BasePanel', xtype: 'interaction-access-list', // dataUrl: 'http://10.1.80.180:9520/api/school/record/list', dataUrl: '/api/school/record/list', initComponent: function () { var me = this; Ext.apply(this, { searchField: [{ xtype: 'textfield', name: 'keyword', fieldLabel: '姓名', getCondition: function (value) { return ' (record_name like\'%' + value + '%\') '; } }, { xtype: 'gradecombo', name: 'grade_name', fieldLabel: '年级', listeners: { select: function (combo, record, eOpts) { combo.up('form').getForm().findField('clazz_name').setValue(null); } } }, { xtype: 'classcombo', name: 'clazz_name', fieldLabel: '班级', listeners: { expand: function (combo, eOpts) { combo.store.clearFilter(); var gradeCombo = combo.up('form').getForm().findField('grade_name'); var gradeName = gradeCombo.getValue(); var filter = new Ext.util.Filter({ property: 'clazz_grade', value: gradeName }); if (!!gradeName) { combo.store.setFilters([filter]); } }, select: function (combo, record, eOpts) { combo.up('form').getForm().findField('grade_name').setValue(record.get('clazz_grade')); } } }], caller: null, _formXtype: null, _title: null, _deleteUrl: null, _batchOpenUrl: null, _batchCloseUrl: null, _batchDeleteUrl: null, gridConfig: { idField: null, codeField: null, statusCodeField: null, dataUrl: me.dataUrl, caller: null, rootProperty: 'data.list', totalProperty: 'data.total', actionColumn: [], selModel: { type: 'cellmodel' }, hiddenTools: true, disableDetail: true, toolBtns: [], columns: [{ text: 'id', dataIndex: 'record_id', hidden: true }, { text: '类型', dataIndex: 'record_type', renderer: function(v,m,r) { return v == 1 ? '入校' : (v == 2 ? '出校' : '其他') } }, { text: '学号', dataIndex: 'stu_number', width: 160 }, { text: '姓名', dataIndex: 'record_name' }, { text: '年级', dataIndex: 'grade_name' }, { text: '班级', dataIndex: 'clazz_name' }, { text: '时间', dataIndex: 'record_date', xtype: 'datecolumn', format: 'Y-m-d H:i:s', width: 150, }] }, }); this.callParent(arguments); }, refresh: function() { Ext.StoreMgr.get('store_grade').load(); Ext.StoreMgr.get('store_class').load(); this.items.items[0].store.load(); } });