Browse Source

Merge remote-tracking branch 'origin/dev' into dev

guq 7 years ago
parent
commit
b414b08985

+ 8 - 2
frontend/pc-web/app/Application.js

@@ -11,10 +11,16 @@ Ext.define('school.Application', {
 
     mainView: 'school.view.viewport.Viewport',
 
+    stores: [
+        // TODO: add global / shared stores here
+        'school.store.Grade',
+        'school.store.Class'
+    ],
+
     defaultToken: 'main',
 
-    launch: function(profile) {
+    launch: function (profile) {
         Ext.getBody().removeCls('launching');
         this.callParent([profile]);
     }
-});
+});

+ 3 - 0
frontend/pc-web/app/model/Session.js

@@ -12,6 +12,9 @@ Ext.define('school.model.Session', {
     statics: {
         login: function(username, password) {
             return new Ext.Promise(function (resolve, reject) {
+                Ext.getCmp('rootView').getController().setRequestToken(null);
+                Ext.getCmp('rootView').getController().saveSession(null);
+
 				Ext.Ajax.request({
                     // url: 'http://10.1.80.23:9520/api/auth/authorize',
                     url: '/api/auth/authorize',

+ 12 - 0
frontend/pc-web/app/store/Class.js

@@ -0,0 +1,12 @@
+/**
+ * 班级
+ */
+Ext.define('school.store.Class', {
+    extend: 'Ext.data.Store',
+    alias: 'store.store_class',
+
+    storeId: 'store_class',
+
+    fields: ['name', 'value'],
+    data: []
+});

+ 5 - 3
frontend/pc-web/app/store/Grade.js

@@ -1,11 +1,13 @@
 /**
- * 学科
+ * 年级
  */
 Ext.define('school.store.Grade', {
     extend: 'Ext.data.Store',
-    alias: 'store.subject',
+    alias: 'store.store_grade',
 
-    model: 'school.model.Grade',
+    storeId: 'store_grade',
+
+    fields: ['name', 'value'],
 
     data: []
 });

+ 1 - 1
frontend/pc-web/app/store/Subject.js

@@ -3,7 +3,7 @@
  */
 Ext.define('school.store.Subject', {
     extend: 'Ext.data.Store',
-    alias: 'store.subject',
+    alias: 'store.store_subject',
 
     model: 'school.model.Subject',
 

+ 21 - 85
frontend/pc-web/app/view/Interaction/homework/List.js

@@ -43,18 +43,18 @@ Ext.define('school.view.interaction.homework.List', {
                 }),
                 minChars: 0,
                 queryMode: 'local'
-            }, {
-                xtype: 'condatefield',
-                name: 'publish_date',
-                fieldLabel: '发布时间',
-                columnWidth: 0.5
+            // }, {
+            //     xtype: 'condatefield',
+            //     name: 'publish_date',
+            //     fieldLabel: '发布时间',
+            //     columnWidth: 0.5
             }],
 
             gridConfig: {
                 addTitle: '作业发布',
                 addXtype: 'interaction-homework-release',
                 idField: 'task_id',
-                codeField: null,
+                codeField: 'task_title',
                 dataUrl: me.dataUrl,
                 caller: null,
                 rootProperty: 'data.list',
@@ -68,6 +68,12 @@ Ext.define('school.view.interaction.homework.List', {
                 },
                 hiddenTools: false,
                 toolBtns: [{
+                    xtype: 'button',
+                    text: '新增',
+                    handler: function () {
+                        school.util.BaseUtil.openTab('interaction-homework-release', '新增作业', 'interaction-homework-release-add');
+                    }
+                }, {
                     xtype: 'button',
                     text: '删除',
                     handler: function () {
@@ -103,12 +109,6 @@ Ext.define('school.view.interaction.homework.List', {
                             school.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
                         });
                     }
-                }, {
-                    xtype: 'button',
-                    text: '新增',
-                    handler: function () {
-                        school.util.BaseUtil.openTab('interaction-homework-release', '新增作业', 'interaction-homework-release-add');
-                    }
                 }],
                 columns: [{
                     text: 'id',
@@ -124,15 +124,15 @@ Ext.define('school.view.interaction.homework.List', {
                     text: '标题',
                     dataIndex: 'task_title',
                     width: 120,
-                    tdCls: 'x-detail-column',
-                    listeners: {
-                        click: function (view, td, row, col, e, record, tr, eOpts, event) {
-                            let gridConfig = me.gridConfig;
-                            school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get('task_title') + ')', gridConfig.addXtype + '-' + record.get(gridConfig.idField), {
-                                initId: record.get(gridConfig.idField)
-                            });
-                        }
-                    }
+                    // tdCls: 'x-detail-column',
+                    // listeners: {
+                    //     click: function (view, td, row, col, e, record, tr, eOpts, event) {
+                    //         let gridConfig = me.gridConfig;
+                    //         school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get('task_title') + ')', gridConfig.addXtype + '-' + record.get(gridConfig.idField), {
+                    //             initId: record.get(gridConfig.idField)
+                    //         });
+                    //     }
+                    // }
                 }, {
                     text: '内容',
                     dataIndex: 'task_context',
@@ -156,69 +156,5 @@ Ext.define('school.view.interaction.homework.List', {
             },
         });
         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;
     }
 });

+ 40 - 13
frontend/pc-web/app/view/Interaction/homework/Release.js

@@ -28,31 +28,51 @@ Ext.define('school.view.interaction.homework.Release', {
                 xtype: "textfield",
                 name: "task_creator",
                 fieldLabel: "发布人",
-                columnWidth: 0.5
             }, {
-                xtype: 'textfield',
+                xtype: 'gradecombo',
                 name: 'grade_name',
-                fieldLabel: '年级'
+                fieldLabel: '年级',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('classz_name').setValue(null);
+                    }
+                },
+                allowBlank: false
             }, {
-                xtype: 'textfield',
+                xtype: 'classcombo',
                 name: 'classz_name',
-                fieldLabel: '班级'
+                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: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('grade_name').setValue(record.get('gradeName'));
+                    }
+                },
+                allowBlank: false
             }, {
                 xtype: 'datefield',
                 name: 'start_date',
                 fieldLabel: '开始时间',
-                columnWidth: 0.5,
                 defaultValue: new Date()
             }, {
                 xtype: 'datefield',
                 name: 'end_date',
                 fieldLabel: '截止时间',
-                columnWidth: 0.5
-            }, {
-                xtype: "textfield",
-                name: "task_title",
-                fieldLabel: "标题",
-                columnWidth: 1
+                allowBlank: false
             }, {
                 xtype: 'combobox',
                 name: 'task_status',
@@ -74,12 +94,19 @@ Ext.define('school.view.interaction.homework.Release', {
                 fieldLabel: '发布时间',
                 readOnly: true,
                 format: 'Y-m-d H:i:s'
+            }, {
+                xtype: "textfield",
+                name: "task_title",
+                fieldLabel: "标题",
+                columnWidth: 1,
+                allowBlank: false
             }, {
                 xtype: "textareafield",
                 name: 'task_context',
                 fieldLabel: "内容",
                 columnWidth: 1,
-                height: 250
+                height: 250,
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'fj',

+ 22 - 86
frontend/pc-web/app/view/Interaction/notice/List.js

@@ -36,18 +36,18 @@ Ext.define('school.view.interaction.notice.List', {
                 }),
                 minChars: 0,
                 queryMode: 'local'
-            }, {
-                xtype: 'condatefield',
-                name: 'publish_date',
-                fieldLabel: '发布时间',
-                columnWidth: 0.5
+            // }, {
+            //     xtype: 'condatefield',
+            //     name: 'publish_date',
+            //     fieldLabel: '发布时间',
+            //     columnWidth: 0.5
             }],
         
             gridConfig: {
                 addTitle: '学校通知',
                 addXtype: 'interaction-notice-schoolnotice',
                 idField: 'notify_id',
-                codeField: null,
+                codeField: 'notify_title',
                 detailField: 'notify_title',
                 dataUrl: me.dataUrl,
                 caller: null,
@@ -62,6 +62,12 @@ Ext.define('school.view.interaction.notice.List', {
                 },
                 hiddenTools: false,
                 toolBtns: [{
+                    xtype: 'button',
+                    text: '新增',
+                    handler: function() {
+                        school.util.BaseUtil.openTab('interaction-notice-schoolnotice', '新增学校通知', 'interaction-notice-schoolnotice-add');
+                    }
+                }, {
                     xtype: 'button',
                     text: '删除',
                     handler: function() {
@@ -97,12 +103,6 @@ Ext.define('school.view.interaction.notice.List', {
                             school.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
                         });
                     }
-                }, {
-                    xtype: 'button',
-                    text: '新增',
-                    handler: function() {
-                        school.util.BaseUtil.openTab('interaction-notice-schoolnotice', '新增学校通知', 'interaction-notice-schoolnotice-add');
-                    }
                 }],
                 columns : [{
                     text: 'id',
@@ -112,15 +112,15 @@ Ext.define('school.view.interaction.notice.List', {
                     text: '标题',
                     dataIndex: 'notify_title',
                     width: 120,
-                    tdCls: 'x-detail-column',
-                    listeners: {
-                        click: function(view, td, row, col, e, record, tr, eOpts, event) {
-                            let gridConfig = me.gridConfig;
-                            school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get('notify_title') + ')', gridConfig.addXtype + record.get(gridConfig.idField), {
-                                initId: record.get(gridConfig.idField)
-                            });
-                        }
-                    }
+                    // tdCls: 'x-detail-column',
+                    // listeners: {
+                    //     click: function(view, td, row, col, e, record, tr, eOpts, event) {
+                    //         let gridConfig = me.gridConfig;
+                    //         school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get('notify_title') + ')', gridConfig.addXtype + record.get(gridConfig.idField), {
+                    //             initId: record.get(gridConfig.idField)
+                    //         });
+                    //     }
+                    // }
                 }, {
                     text: '内容',
                     dataIndex: 'notify_details',
@@ -146,69 +146,5 @@ Ext.define('school.view.interaction.notice.List', {
             },
         });
         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;
-     },
+    }
 });

+ 3 - 1
frontend/pc-web/app/view/Interaction/notice/SchoolNotice.js

@@ -54,13 +54,15 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
                 xtype: "textfield",
                 name: "notify_title",
                 fieldLabel: "标题",
-                columnWidth: 1
+                columnWidth: 1,
+                allowBlank: false
             }, {
                 xtype: "textareafield",//文本域
                 name: 'notify_details',
                 fieldLabel: "内容",
                 height: 300,
                 columnWidth: 1,
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'fj',

+ 42 - 24
frontend/pc-web/app/view/Interaction/score/List.js

@@ -17,13 +17,38 @@ Ext.define('school.view.interaction.score.List', {
                 name: 'term',
                 fieldLabel: '学期'
             }, {
-                xtype: 'textfield',
+                xtype: 'gradecombo',
                 name: 'grade',
-                fieldLabel: '年级'
+                fieldLabel: '年级',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('class').setValue(null);
+                    }
+                }
             }, {
-                xtype: 'textfield',
+                xtype: 'classcombo',
                 name: 'class',
-                fieldLabel: '班级'
+                fieldLabel: '班级',
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('grade');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('grade').setValue(record.get('gradeName'));
+                    }
+                }
             }],
 
             caller: null,
@@ -54,41 +79,34 @@ Ext.define('school.view.interaction.score.List', {
                 hiddenTools: false,
                 toolBtns: [{
                     xtype: 'button',
-                    text: '导入'
+                    text: '新增',
+                    handler: 'onAddClick'
                 }, {
                     xtype: 'button',
-                    text: '删除'
+                    text: '导入'
                 }, {
                     xtype: 'button',
-                    text: '新增',
-                    // handler: 'onAddClick'
+                    text: '删除'
                 }],
                 columns: [{
                     text: 'ID',
                     dataIndex: 'score_id',
                     hidden: true
                 }, {
-                    text: '编号',
-                    dataIndex: 'score_num',
-                    width: 150
-                }, {
-                    text: '成绩类型',
-                    dataIndex: 'score_name',
-                    width: 120
+                    text: '考试标题',
+                    dataIndex: ''
                 }, {
                     text: '考试时间',
-                    dataIndex: 'score_date',
-                    width: 150
+                    dataIndex: ''
                 }, {
-                    text: '年级',
-                    dataIndex: 'score_scope'
+                    text: '考试范围',
+                    dataIndex: ''
                 }, {
-                    text: '类型',
-                    dataIndex: 'score_type'
+                    text: '年级',
+                    dataIndex: ''
                 }, {
-                    text: '备注',
-                    dataIndex: 'score_remarks',
-                    width: 120
+                    text: '班级',
+                    dataIndex: ''
                 }]
             },
         });

+ 40 - 6
frontend/pc-web/app/view/Interaction/timetable/Detail.js

@@ -34,27 +34,61 @@ Ext.define('school.view.interaction.timetable.Detail', {
             }, {
                 xtype: 'numberfield',
                 name: 'gradeId',
-                fieldLabel: '年级ID'
+                fieldLabel: '年级ID',
+                hidden: true
             }, {
-                xtype: 'textfield',
+                xtype: 'gradecombo',
                 name: 'gradeName',
                 fieldLabel: '年级',
+                allowBlank: false,
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('gradeId').setValue(record.get('value'));
+                        combo.up('form').getForm().findField('clazzId').setValue(null);
+                        combo.up('form').getForm().findField('clazzName').setValue(null);
+                    }
+                }
             }, {
                 xtype: 'numberfield',
                 name: 'clazzId',
-                fieldLabel: '班级ID'
+                fieldLabel: '班级ID',
+                hidden: true
             }, {
-                xtype: 'textfield',
+                xtype: 'classcombo',
                 name: 'clazzName',
                 fieldLabel: '班级',
+                allowBlank: false,
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('gradeName');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('clazzId').setValue(record.get('value'));
+                        combo.up('form').getForm().findField('gradeName').setValue(record.get('gradeName'));
+                    }
+                }
             }, {
                 xtype: 'textfield',
                 name: 'termPart',
-                fieldLabel: '学年'
+                fieldLabel: '学年',
+                allowBlank: false
             }, {
                 xtype: "textfield",
                 name: "termName",
-                fieldLabel: "学期"
+                fieldLabel: "学期",
+                allowBlank: false
             }, {
                 xtype: "textfield",
                 name: "creatorName",

+ 39 - 14
frontend/pc-web/app/view/Interaction/timetable/List.js

@@ -21,13 +21,38 @@ Ext.define('school.view.interaction.timetable.List', {
                 name: 'mcur_name',
                 fieldLabel: '课表名称'
             }, {
-                xtype: 'textfield',
+                xtype: 'gradecombo',
                 name: 'grade_name',
-                fieldLabel: '年级'
+                fieldLabel: '年级',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('clazz_name').setValue(null);
+                    }
+                }
             }, {
-                xtype: 'textfield',
+                xtype: 'classcombo',
                 name: 'clazz_name',
-                fieldLabel: '班级'
+                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: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('grade_name').setValue(record.get('gradeName'));
+                    }
+                }
             }, {
                 xtype: 'textfield',
                 name: 'mcur_term_part',
@@ -42,7 +67,7 @@ Ext.define('school.view.interaction.timetable.List', {
                 addTitle: '课程表',
                 addXtype: 'interaction-timetable-detail',
                 idField: 'id',
-                codeField: null,
+                codeField: 'id',
                 detailField: 'name',
                 dataUrl: me.dataUrl,
                 caller: null,
@@ -115,15 +140,15 @@ Ext.define('school.view.interaction.timetable.List', {
                     text: '课表名称',
                     dataIndex: 'name',
                     width: 120,
-                    tdCls: 'x-detail-column',
-                    listeners: {
-                        click: function(view, td, row, col, e, record, tr, eOpts, event) {
-                            let gridConfig = me.gridConfig;
-                            school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get('id') + ')', gridConfig.addXtype + record.get(gridConfig.idField), {
-                                initId: record.get(gridConfig.idField)
-                            });
-                        }
-                    }
+                    // tdCls: 'x-detail-column',
+                    // listeners: {
+                    //     click: function(view, td, row, col, e, record, tr, eOpts, event) {
+                    //         let gridConfig = me.gridConfig;
+                    //         school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get('id') + ')', gridConfig.addXtype + record.get(gridConfig.idField), {
+                    //             initId: record.get(gridConfig.idField)
+                    //         });
+                    //     }
+                    // }
                 }, {
                     text: '年级',
                     dataIndex: 'gradeName'

+ 2 - 2
frontend/pc-web/app/view/basic/class/ClassInfo.js

@@ -29,7 +29,7 @@ Ext.define('school.view.basic.class.ClassInfo', {
                 xtype: 'treepanel',
                 reference: 'treelist',
                 bind: {
-                    store: '{store_grade}',
+                    store: '{store_gradeclass}',
                     width: '{treeWidth}'
                 },
                 // viewConfig: {
@@ -83,7 +83,7 @@ Ext.define('school.view.basic.class.ClassInfo', {
                     onSuccess: function() {
                         let viewModel = me.getViewModel();
         
-                        viewModel.get('store_grade').load();
+                        viewModel.get('store_gradeclass').load();
                     }
                 }, '->'],
                 listeners: {

+ 2 - 1
frontend/pc-web/app/view/basic/class/ClassInfoController.js

@@ -7,7 +7,7 @@ Ext.define('school.view.basic.class.ClassInfoController', {
         view = me.getView(),
         viewModel = me.getViewModel();
 
-        viewModel.get('store_grade').load();
+        viewModel.get('store_gradeclass').load();
     },
 
     onItemMouseEnter: function(tree, record, item, index, e, eOpts)  {
@@ -330,6 +330,7 @@ Ext.define('school.view.basic.class.ClassInfoController', {
                                 currentNode.set('text', text);
                                 currentNode.commit();
                                 win.close();
+                                listCard.showNode(currentNode);
                             }).catch(function(e) {
                                 view.setLoading(false);
                                 school.util.BaseUtil.showErrorToast(e.message);

+ 1 - 1
frontend/pc-web/app/view/basic/class/ListCardController.js

@@ -6,7 +6,7 @@ Ext.define('school.view.basic.class.ListCardController', {
         var me = this,
         view = me.view,
         viewModel = me.getViewModel(),
-        grade = viewModel.get('store_grade');
+        grade = viewModel.get('store_gradeclass');
 
         view.showNode(grade.getRootNode());
     },

+ 14 - 6
frontend/pc-web/app/view/basic/staff/StaffDetail.js

@@ -30,19 +30,24 @@ Ext.define('school.view.basic.staff.StaffDetail', {
             },{
                 xtype: 'textfield',
                 name: 'teacher_number',
-                fieldLabel: '工号'
+                fieldLabel: '工号',
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'teacher_name',
-                fieldLabel: '姓名'
+                fieldLabel: '姓名',
+                allowBlank: false
             }, {
                 xtype: 'gendercombo',
                 name: 'teacher_sex',
                 fieldLabel: '性别',
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'teacher_phone',
-                fieldLabel: '手机号'
+                fieldLabel: '手机号',
+                maxLength: 25,
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'teacher_email',
@@ -102,16 +107,19 @@ Ext.define('school.view.basic.staff.StaffDetail', {
                     data: [['博士后'], ['博士'], ['硕士'], ['研究生'], ['本科(统招)'], ['本科(成人高考)'], ['本科(专升本)'], ['大专'], ['高中'], ['职高'], ['初中'], ['小学']]
                 }),
                 minChars: 0,
-                queryMode: 'local'
+                queryMode: 'local',
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'teacher_major',
-                fieldLabel: '专业'
+                fieldLabel: '专业',
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'teacher_address',
                 fieldLabel: '现居住址',
-                columnWidth: 0.5
+                columnWidth: 0.5,
+                allowBlank: false
             }, {
                 name: "detailGridField",
                 xtype: "detailGridField",

+ 65 - 14
frontend/pc-web/app/view/basic/student/StudentDetail.js

@@ -30,11 +30,13 @@ Ext.define('school.view.basic.student.StudentDetail', {
             }, {
                 xtype: 'textfield',
                 name: 'stu_number',
-                fieldLabel: '学号'
+                fieldLabel: '学号',
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'stu_name',
-                fieldLabel: '姓名'
+                fieldLabel: '姓名',
+                allowBlank: false
             }, {
                 xtype: 'combobox',
                 name: 'stu_sex',
@@ -46,7 +48,8 @@ Ext.define('school.view.basic.student.StudentDetail', {
                     type: 'store_gender'
                 },
                 minChars: 0,
-                queryMode: 'local'
+                queryMode: 'local',
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'stu_native',
@@ -64,14 +67,20 @@ Ext.define('school.view.basic.student.StudentDetail', {
                 editable: false,
                 store: Ext.create('Ext.data.ArrayStore', {
                     fields: ['name'],
-                    data: [['中共党员'], ['中共预备党员'], ['共青团员'], ['群众']]
+                    data: [
+                        ['中共党员'],
+                        ['中共预备党员'],
+                        ['共青团员'],
+                        ['群众']
+                    ]
                 }),
                 minChars: 0,
                 queryMode: 'local'
             }, {
                 xtype: 'datefield',
                 name: 'stu_birthday',
-                fieldLabel: '出生日期'
+                fieldLabel: '出生日期',
+                allowBlank: false
             }, {
                 xtype: 'numberfield',
                 name: 'stu_age',
@@ -80,24 +89,58 @@ Ext.define('school.view.basic.student.StudentDetail', {
                 xtype: "textfield",
                 name: "stu_address",
                 fieldLabel: "家庭住址",
-                columnWidth: 0.5
+                columnWidth: 0.5,
+                allowBlank: false
             }, {
                 xtype: 'datefield',
                 name: 'stu_enroll_date',
-                fieldLabel: '入学日期'
+                fieldLabel: '入学日期',
+                allowBlank: false
             }, {
-                xtype: 'textfield',
+                xtype: 'gradecombo',
                 name: 'stu_grade',
-                fieldLabel: '年级'
+                valueField: 'name',
+                fieldLabel: '年级',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('clazz_id').setValue(null);
+                        combo.up('form').getForm().findField('stu_class').setValue(null);
+                    }
+                },
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'clazz_id',
                 fieldLabel: '班级id',
-                hidden: true
+                hidden: true,
+                allowBlank: false
             }, {
-                xtype: 'textfield',
+                xtype: 'classcombo',
                 name: 'stu_class',
-                fieldLabel: '班级'
+                fieldLabel: '班级',
+                valueField: 'name',
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('stu_grade');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('clazz_id').setValue(record.get('value'));
+                        combo.up('form').getForm().findField('stu_grade').setValue(record.get('gradeName'));
+                    }
+                },
+                allowBlank: false
             }, {
                 name: "parent",
                 xtype: "detailGridField",
@@ -128,8 +171,16 @@ Ext.define('school.view.basic.student.StudentDetail', {
                     text: '关系',
                     dataIndex: 'parent_rel',
                     editor: {
-                        xtype: 'textfield'
-                    }
+                        xtype: 'combobox',
+                        displayField: 'name',
+                        valueField: 'name',
+                        editable: true,
+                        store: Ext.create('Ext.data.ArrayStore', {
+                            fields: ['name'],
+                            data: [['父子'], ['母子'], ['兄弟'], ['兄妹'], ['姐弟'], ['姐妹'], ['祖孙'], ['其他']]
+                        }),
+                        queryMode: 'local'
+                    },
                 }]
             }],
         });

+ 46 - 73
frontend/pc-web/app/view/basic/student/StudentList.js

@@ -6,6 +6,7 @@ Ext.define('school.view.basic.student.StudentList', {
     xtype: 'basic-student-studentlist',
 
     dataUrl: '/api/school/student/list',
+    // dataUrl: 'http:/api/school/student/list',
     _title: '学生信息',
     caller: 'Student',
     pathKey: 'student',
@@ -14,13 +15,40 @@ Ext.define('school.view.basic.student.StudentList', {
         var me = this;
         Ext.apply(this, {
             searchField: [{
-                xtype: 'textfield',
-                name: 'grade',
-                fieldLabel: '年级'
+                xtype: 'gradecombo',
+                name: 'stu_grade',
+                fieldLabel: '年级',
+                valueField: 'name',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('stu_class').setValue(null);
+                    }
+                }
             }, {
-                xtype: 'textfield',
-                name: 'class',
-                fieldLabel: '班级'
+                xtype: 'classcombo',
+                name: 'stu_class',
+                fieldLabel: '班级',
+                valueField: 'name',
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('stu_grade');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('stu_grade').setValue(record.get('gradeName'));
+                    }
+                }
             }, {
                 xtype: 'textfield',
                 name: 'stu_number',
@@ -128,10 +156,19 @@ Ext.define('school.view.basic.student.StudentList', {
                     }
                 }, {
                     text: '年级',
-                    dataIndex: 'grade'
+                    dataIndex: 'stu_grade',
+                    editor: {
+                        xtype: 'combobox',
+                        displayField: 'name',
+                        valueField: 'value',
+                        store: {
+                            type: 'store_grade'
+                        },
+                        queryMode: 'local'
+                    },
                 }, {
                     text: '班级',
-                    dataIndex: 'class'
+                    dataIndex: 'stu_class'
                 }, {
                     text: '入学日期',
                     dataIndex: 'stu_enroll_date',
@@ -147,69 +184,5 @@ Ext.define('school.view.basic.student.StudentList', {
             },
         });
         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;
-     },
+    }
 });

+ 8 - 10
frontend/pc-web/app/view/core/base/BasePanel.js

@@ -43,16 +43,14 @@ Ext.define('school.view.core.base.BasePanel', {
             xtype: 'core-base-gridpanel',
             padding: '8 12',
             _columns: gridColumns.map(function(c) {
-                if(c.dataIndex == gridConfig.detailField) {
-                    c.listeners = c.listeners || {};
-                    if(!c.listeners['click']) {
-                        c.tdCls = c.tdCls ? (c.tdCls + ' x-detail-column') : 'x-detail-column'
-                        c.listeners['click'] = function(view, td, row, col, e, record, tr, eOpts, event) {
-                            school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get(gridConfig.codeField) + ')', gridConfig.addXtype + record.get(gridConfig.idField), {
-                                initId: record.get(gridConfig.idField)
-                            });
-                        };
-                    }
+                c.listeners = c.listeners || {};
+                if(!c.listeners['click']) {
+                    // c.tdCls = c.tdCls ? (c.tdCls + ' x-detail-column') : 'x-detail-column'
+                    c.listeners['click'] = function(view, td, row, col, e, record, tr, eOpts, event) {
+                        school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get(gridConfig.codeField) + ')', gridConfig.addXtype + record.get(gridConfig.idField), {
+                            initId: record.get(gridConfig.idField)
+                        });
+                    };
                 }
                 return Object.assign({}, c);
             }),

+ 20 - 0
frontend/pc-web/app/view/core/form/field/ClassComboBox.js

@@ -0,0 +1,20 @@
+Ext.define('school.view.core.form.field.ClassComboBox', {
+    extend: 'Ext.form.field.ComboBox',
+    alias: 'widget.classcombo',
+
+    fieldLabel: '班级',
+    displayField: 'name',
+    valueField: 'name',
+    editable: true,
+    minChars: 0,
+    queryMode: 'local',
+    initComponent: function() {
+        var me = this;
+
+        Ext.apply(me, {
+            store: Ext.StoreMgr.get('store_class'),
+        });
+
+        me.callParent(arguments);
+    }
+});

+ 20 - 0
frontend/pc-web/app/view/core/form/field/GradeComboBox.js

@@ -0,0 +1,20 @@
+Ext.define('school.view.core.form.field.GradeComboBox', {
+    extend: 'Ext.form.field.ComboBox',
+    alias: 'widget.gradecombo',
+
+    fieldLabel: '年级',
+    displayField: 'name',
+    valueField: 'name',
+    editable: true,
+    minChars: 0,
+    queryMode: 'local',
+    initComponent: function() {
+        var me = this;
+
+        Ext.apply(me, {
+            store: Ext.StoreMgr.get('store_grade'),
+        });
+
+        me.callParent(arguments);
+    }
+});

+ 1 - 1
frontend/pc-web/app/view/core/grid/column/SubjectColumn.js

@@ -10,7 +10,7 @@ Ext.define('school.view.core.grid.column.SubjectColumn', {
         displayField: 'name',
         valueField: 'code',
         store: {
-            type: 'subject'
+            type: 'store_subject'
         },
         queryMode: 'local'
     },

+ 1 - 1
frontend/pc-web/app/view/viewport/ViewportController.js

@@ -63,7 +63,7 @@ Ext.define('school.view.viewport.ViewportController', {
                     schoolSecret: res.data.school_secret,
                 };
                 me.getViewModel().setData(d);
-                me.getViewModel().get('store_grade').load();
+                me.getViewModel().get('store_gradeclass').load();
             }
         })
         .catch(function(e) {

+ 18 - 11
frontend/pc-web/app/view/viewport/ViewportModel.js

@@ -25,7 +25,7 @@ Ext.define('school.view.viewport.ViewportModel', {
                 }
             }
         },
-        store_grade: {
+        store_gradeclass: {
             type: 'tree',
             autoLoad: false,
             // model: 'school.model.Grade',
@@ -64,18 +64,25 @@ Ext.define('school.view.viewport.ViewportModel', {
             },
             listeners: {
                 load: function(store, records) {
-                    let stores = school.store;
-                    let mainModel = Ext.getCmp('mainView').getViewModel();
-                    let gradeStore = Ext.create('school.store.Grade', {
-                        data: records.map(function(r) {
-                            let d = r.data;
+                    let classData = [];
+                    let gradeData = records.map(function(r) {
+                        let d = r.data;
+                        let c = d.children.map(function(h) {
                             return {
-                                grade_id: d._id,
-                                grade_name: d.text,
+                                value: h._id,
+                                name: h.text,
+                                gradeId: d._id,
+                                gradeName: d.text
                             }
-                        })
-                    });
-                    mainModel.set('grade_store', gradeStore);
+                        });
+                        classData = classData.concat(c);
+                        return {
+                            value: d._id,
+                            name: d.text,
+                        }
+                    })
+                    Ext.StoreMgr.get('store_grade').loadData(gradeData);
+                    Ext.StoreMgr.get('store_class').loadData(classData);
                 }
             }
         }