| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- /**
- * 学科信息
- */
- Ext.define('school.view.basic.subject.List', {
- extend: 'school.view.core.base.BasePanel',
- xtype: 'basic-subject-list',
- // dataUrl: 'http://10.1.80.47:9560/subject/list',
- dataUrl: '/api/school/subject/list',
- _title: '学科信息',
- caller: 'Subject',
- pathKey: 'subject',
-
- controller: 'basic-subject-list',
- viewModel: 'basic-subject-list',
- initComponent: function() {
- var me = this;
- Ext.apply(this, {
- searchField: [{
- xtype: 'textfield',
- name: 'subject_name',
- fieldLabel: '名称'
- }],
-
- gridConfig: {
- addTitle: '学科信息',
- addXtype: 'basic-subject-detail',
- idField: 'subject_id',
- codeField: null,
- detailField: null,
- dataUrl: me.dataUrl,
- caller: null,
- rootProperty: 'data.list',
- totalProperty: 'data.total',
- actionColumn: [],
- selModel: {
- type: 'cellmodel'
- },
- hiddenTools: false,
- toolBtns: [{
- xtype: 'button',
- text: '新增',
- handler: 'onAddClick'
- }],
- columns : [{
- text: 'id',
- dataIndex: 'subject_id',
- hidden: true
- }, {
- text: '名称',
- dataIndex: 'subject_name',
- width: 150
- }, {
- xtype:'actioncolumn',
- width:70,
- dataIndex:'actioncolumn',
- text:'操作',
- align: 'center',
- items: [{
- tooltip: '编辑',
- iconCls: 'x-fa fa-pencil fa-fw',
- scope:this,
- listeners: {
- click: function() {
- debugger;
- }
- }
- },{
- text:'删除',
- iconCls:'x-fa fa-trash-o fa-fw',
- tooltip: '删除',
- scope:this
- }],
- listeners: {
- click: 'onActionClick'
- }
- }]
- },
- });
- this.callParent(arguments);
- },
- /**
- * 处理部分字段值
- */
- getConditionValue: function (field, value) {
- var me = this,
- xtypes = field.getXTypes().split('/'),
- conditionValue;
- if (me.isContainsAny(xtypes, ['datefield'])) {
- conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
- } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
- var from = value.from,
- to = value.to;
- conditionValue = from + ',' + to;
- } else if (me.isContainsAny(xtypes, ['condatefield'])) {
- var from = value.from,
- to = value.to;
- conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
- } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
- conditionValue = value;
- } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
- conditionValue = value;
- } else if (me.isContainsAny(xtypes, ['multicombo'])) {
- conditionValue = value.map ? value.map(function (v) {
- return v.value;
- }).join(',') : '';
- } else {
- conditionValue = value;
- }
- return conditionValue;
- },
- getExtraParams: function(store, op, condition) {
- var temp = {};
- for(let x = 0; x < condition.length; x++) {
- let c = condition[x];
- if(c.field == 'keyword') {
- temp.keyword = c.value;
- }else if(c.field == 'date') {
- temp.fromDate = new Date(c.value.split(',')[0]).getTime();
- temp.endDate = new Date(c.value.split(',')[1]).getTime();
- }else if(c.field == 'quoted') {
- temp.quoted = c.value == 'all' ? null : c.value;
- }else if(c.field == 'closed') {
- // temp.endDate = c.value == 'all' ? null : (
- // c.value == '0' ?
- // );
- }
- }
- let obj = {
- pageNumber: store.exportNumber?store.exportNumber:op._page,
- pageSize: store.exportPageSize?store.exportPageSize:store.pageSize
- };
- for(let k in temp) {
- if(!!temp[k]) {
- obj[k] = temp[k];
- }
- }
- return obj;
- },
- });
|