|
|
@@ -7,18 +7,17 @@ Ext.define('school.view.interaction.score.List', {
|
|
|
|
|
|
controller: 'interaction-score-list',
|
|
|
|
|
|
- // dataUrl: 'http://10.1.80.47:9560/score/list',
|
|
|
+ // dataUrl: 'http://10.1.80.47:9520/api/school/score/list',
|
|
|
dataUrl: '/api/school/score/list',
|
|
|
+ caller: 'ScorePublish',
|
|
|
+ pathKey: 'score',
|
|
|
+
|
|
|
initComponent: function () {
|
|
|
var me = this;
|
|
|
Ext.apply(this, {
|
|
|
searchField: [{
|
|
|
- xtype: 'textfield',
|
|
|
- name: 'term',
|
|
|
- fieldLabel: '学期'
|
|
|
- }, {
|
|
|
xtype: 'gradecombo',
|
|
|
- name: 'grade',
|
|
|
+ name: 'si_grade',
|
|
|
fieldLabel: '年级',
|
|
|
listeners: {
|
|
|
select: function (combo, record, eOpts) {
|
|
|
@@ -27,7 +26,7 @@ Ext.define('school.view.interaction.score.List', {
|
|
|
}
|
|
|
}, {
|
|
|
xtype: 'classcombo',
|
|
|
- name: 'class',
|
|
|
+ name: 'si_class',
|
|
|
fieldLabel: '班级',
|
|
|
listeners: {
|
|
|
expand: function (combo, eOpts) {
|
|
|
@@ -49,24 +48,22 @@ Ext.define('school.view.interaction.score.List', {
|
|
|
combo.up('form').getForm().findField('grade').setValue(record.get('gradeName'));
|
|
|
}
|
|
|
}
|
|
|
+ }, {
|
|
|
+ xtype: 'textfield',
|
|
|
+ name: 'keyword',
|
|
|
+ fieldLabel: '学生',
|
|
|
+ getCondition: function (value) {
|
|
|
+ return ' (sd_stu like\'%' + value + '%\') ';
|
|
|
+ }
|
|
|
}],
|
|
|
|
|
|
- caller: null,
|
|
|
- _formXtype: null,
|
|
|
- _title: null,
|
|
|
- _deleteUrl: null,
|
|
|
- _batchOpenUrl: null,
|
|
|
- _batchCloseUrl: null,
|
|
|
- _batchDeleteUrl: null,
|
|
|
-
|
|
|
gridConfig: {
|
|
|
addTitle: '成绩录入',
|
|
|
addXtype: 'interaction-score-detail',
|
|
|
- idField: 'score_id',
|
|
|
- codeField: 'score_num',
|
|
|
- detailField: null,
|
|
|
+ idField: 'si_id',
|
|
|
+ codeField: 'si_id',
|
|
|
+ detailField: '',
|
|
|
dataUrl: me.dataUrl,
|
|
|
- caller: null,
|
|
|
rootProperty: 'data.list',
|
|
|
totalProperty: 'data.total',
|
|
|
actionColumn: [],
|
|
|
@@ -82,88 +79,117 @@ Ext.define('school.view.interaction.score.List', {
|
|
|
text: '新增',
|
|
|
handler: 'onAddClick'
|
|
|
}, {
|
|
|
- xtype: 'button',
|
|
|
- text: '导入'
|
|
|
+ xtype: 'importbutton',
|
|
|
+ text: '导入',
|
|
|
+ belong: me,
|
|
|
+ caller: me.caller,
|
|
|
+ pathKey: me.pathKey,
|
|
|
+ onSuccess: function () {
|
|
|
+ //刷新界面
|
|
|
+ var g = me.down('grid');
|
|
|
+ g.store.loadPage(g.store.currentPage);
|
|
|
+ }
|
|
|
}, {
|
|
|
xtype: 'button',
|
|
|
- text: '删除'
|
|
|
+ text: '删除',
|
|
|
+ handler: function() {
|
|
|
+ let grid = this.up('grid'),
|
|
|
+ selectedRecords = grid.getSelection();
|
|
|
+ let data;
|
|
|
+
|
|
|
+ data = selectedRecords.map(function(r) {
|
|
|
+ return {
|
|
|
+ id: r.get('si_id')
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ if(data.length == 0) {
|
|
|
+ school.util.BaseUtil.showErrorToast('请先勾选需要删除的记录');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ grid.setLoading(true);
|
|
|
+ school.util.BaseUtil.request({
|
|
|
+ // url: 'http://10.1.80.47:9520/api/school/score/batchDelete',
|
|
|
+ url: '/api/school/score/batchDelete',
|
|
|
+ method: 'POST',
|
|
|
+ params: JSON.stringify({
|
|
|
+ baseDTOs: data
|
|
|
+ })
|
|
|
+ }).then(function(res) {
|
|
|
+ grid.setLoading(false);
|
|
|
+ school.util.BaseUtil.showSuccessToast('成功删除' + data.length + '条记录');
|
|
|
+ grid.store.loadPage(grid.store.currentPage);
|
|
|
+ }).catch(function(e) {
|
|
|
+ grid.setLoading(false);
|
|
|
+ school.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
|
|
|
+ });
|
|
|
+ }
|
|
|
}],
|
|
|
columns: [{
|
|
|
text: 'ID',
|
|
|
- dataIndex: 'score_id',
|
|
|
+ dataIndex: 'si_id',
|
|
|
hidden: true
|
|
|
}, {
|
|
|
text: '考试标题',
|
|
|
- dataIndex: 'score_name'
|
|
|
+ dataIndex: 'si_examtitle'
|
|
|
}, {
|
|
|
text: '考试时间',
|
|
|
- dataIndex: 'score_date',
|
|
|
+ dataIndex: 'si_examdate',
|
|
|
width: 150
|
|
|
}, {
|
|
|
text: '考试范围',
|
|
|
- dataIndex: 'score_scope'
|
|
|
+ dataIndex: 'si_examscope'
|
|
|
}, {
|
|
|
text: '年级',
|
|
|
- dataIndex: ''
|
|
|
+ dataIndex: 'si_grade'
|
|
|
}, {
|
|
|
text: '班级',
|
|
|
- dataIndex: ''
|
|
|
+ dataIndex: 'si_class'
|
|
|
+ }],
|
|
|
+ supColumns: [{
|
|
|
+ // text: '学生编号',
|
|
|
+ // dataIndex: ''
|
|
|
+ // }, {
|
|
|
+ text: '学生姓名',
|
|
|
+ dataIndex: 'sd_stu'
|
|
|
+ }, {
|
|
|
+ text: '科目',
|
|
|
+ dataIndex: 'sd_subject'
|
|
|
+ }, {
|
|
|
+ text: '成绩',
|
|
|
+ dataIndex: 'sd_score'
|
|
|
}]
|
|
|
},
|
|
|
});
|
|
|
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;
|
|
|
+ listeners: {
|
|
|
+ load: function(store, grid, panel, condition) {
|
|
|
+ let flag = false,
|
|
|
+ columns = panel.gridConfig.columns;
|
|
|
+ Ext.Array.each(condition, function(c) {
|
|
|
+ if(c.type == 'condition') {
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(flag) {
|
|
|
+ columns = columns.concat(panel.gridConfig.supColumns);
|
|
|
+ }
|
|
|
|
|
|
- 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;
|
|
|
+ grid.reconfigure(store, columns);
|
|
|
+ grid.applyScrollable(true)
|
|
|
}
|
|
|
-
|
|
|
- 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' ?
|
|
|
- // );
|
|
|
+ if (c.type == 'condition') {
|
|
|
+ temp.mode = 'DETAIL';
|
|
|
}
|
|
|
}
|
|
|
let obj = {
|