瀏覽代碼

列表、新增、删除、更新、批量删除接口对接测试

zhuth 6 年之前
父節點
當前提交
28170bc4b6

+ 4 - 3
frontend/pc-web/app/util/FormUtil.js

@@ -327,13 +327,13 @@ Ext.define('school.util.FormUtil', {
             form.setLoading(true);
             if(form.initId && form.initId!=0) {
                 let url = form._readUrl + '/' + form.initId;
-                school.util.BaseUtil.request({url })
+                return school.util.BaseUtil.request({url })
                 .then(function(res) {
                     form.setLoading(false);
                     if(res.success) {
                         let d = res.data;
                         let o = {
-                            main: d.main
+                            main: d.main || d // 返回数据可能没有主从表格式
                         };
                         if(d.hasOwnProperty('items')) {
                             o.detail0 = d.items;
@@ -346,6 +346,7 @@ Ext.define('school.util.FormUtil', {
                         }
                         form.initFormData(o);
                         form.fireEvent('load', form, o);
+                        return o;
                     }
                 })
                 .catch(function(e) {
@@ -353,7 +354,7 @@ Ext.define('school.util.FormUtil', {
                     school.util.BaseUtil.showErrorToast('读取单据数据错误: ' + e.message);
                 });
             }else {
-                new Ext.Promise(function (resolve, reject) {
+                return new Ext.Promise(function (resolve, reject) {
                     form.setLoading(false);
                     let viewModel = form.getViewModel();
                     let detailGrids = form.query('detailGridField');

+ 29 - 19
frontend/pc-web/app/view/Interaction/homework/List.js

@@ -5,6 +5,7 @@ Ext.define('school.view.interaction.homework.List', {
     extend: 'school.view.core.base.BasePanel',
     xtype: 'interaction-homework-list',
 
+    // dataUrl: 'http://10.1.80.47:9560/homework/list',
     dataUrl: '/api/school/homework/list',
     _title: '作业发布',
 
@@ -28,8 +29,8 @@ Ext.define('school.view.interaction.homework.List', {
             gridConfig: {
                 addTitle: '作业发布',
                 addXtype: 'interaction-homework-release',
-                idField: 'teacher_id',
-                codeField: 'teacher_number',
+                idField: 'task_id',
+                codeField: null,
                 dataUrl: me.dataUrl,
                 caller: null,
                 rootProperty: 'data.list',
@@ -44,38 +45,47 @@ Ext.define('school.view.interaction.homework.List', {
                 hiddenTools: false,
                 toolBtns: [{
                     xtype: 'button',
-                    text: '添加',
+                    text: '删除'
+                }, {
+                    xtype: 'button',
+                    text: '新增',
                     handler: function() {
                         school.util.BaseUtil.openTab('interaction-homework-release', '新增作业', 'interaction-homework-release-add');
                     }
-                }, {
-                    xtype: 'button',
-                    text: '删除'
                 }],
                 columns : [{
                     text: 'id',
-                    dataIndex: 'stu_id',
+                    dataIndex: 'task_id',
                     hidden: true
-                }, {
-                    text: '发布人',
-                    dataIndex: 'stu_number',
-                    width: 150
-                }, {
-                    text: '发布时间',
-                    dataIndex: 'stu_name',
-                    width: 120
                 }, {
                     text: '标题',
-                    dataIndex: 'stu_sex',
+                    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)
+                            });
+                        }
+                    }
                 }, {
                     text: '内容',
-                    dataIndex: 'grade',
+                    dataIndex: 'task_context',
                     width: 300
                 }, {
                     text: '通知人',
-                    dataIndex: 'class'
-                }]
+                    dataIndex: 'task_notifier'
+                }, {
+                    text: '发布人',
+                    dataIndex: 'task_creator',
+                    width: 150
+                }, {
+                    text: '发布时间',
+                    dataIndex: 'start_date',
+                    width: 120
+                },]
             },
         });
         this.callParent(arguments);

+ 17 - 59
frontend/pc-web/app/view/Interaction/homework/Release.js

@@ -5,100 +5,58 @@ Ext.define('school.view.interaction.homework.Release', {
     extend: 'school.view.core.form.FormPanel',
     xtype: 'interaction-homework-release',
 
-    // controller: 'purchase-purchase-formpanel',
+    controller: 'interaction-homework-release',
     // viewModel: 'purchase-purchase-formpanel',
 
     //字段属性
     _title: '作业发布',
-    _idField: 'id',
-    _codeField: 'pu_code',
-    _statusField: 'pu_status',
-    _statusCodeField: 'pu_statuscode',
-    _auditmanField: 'pu_auditman',
-    _auditdateField: 'pu_auditdate',
-    _relationColumn: 'pd_puid',
-    _readUrl: '/api/purchase/purchase/read',
-    _saveUrl: '/api/purchase/purchase/save',
-    _auditUrl: '/api/purchase/purchase/audit',
-    _unAuditUrl: '/api/purchase/purchase/unAudit',
-    _deleteUrl: '/api/purchase/purchase/delete',
-    _turnInUrl: '/api/purchase/purchase/turnProdin',
+    _idField: 'task_id',
+    _codeField: null,
+    // _readUrl: 'http://10.1.80.47:9560/homework/read',
+    _readUrl: '/api/school/homework/read',
+    // _saveUrl: 'http://10.1.80.47:9560/homework/save',
+    _saveUrl: '/api/school/homework/save',
+    _deleteUrl: '/api/school/homework/delete',
     initId: 0,
     initComponent: function () {
         Ext.apply(this, {
             defaultItems: [{
                 xtype: 'hidden',
-                name: 'id',
+                name: 'task_id',
                 fieldLabel: 'id'
             }, {
                 xtype: "textfield",
-                name: "Publisher",
+                name: "task_creator",
                 fieldLabel: "发布人",
                 columnWidth: 0.5
             }, {
                 xtype: 'datefield',
-                name: 'startDate',
+                name: 'start_date',
                 fieldLabel: '开始时间',
                 columnWidth: 0.5,
                 defaultValue: new Date()
             }, {
-                xtype: 'combobox',
-                name: 'Notifications',
+                xtype: 'textfield',
+                name: 'task_notifier',
                 fieldLabel: '通知人',
+                maxLength: 500,
                 columnWidth: 0.5,
-                queryMode: 'local',
-                displayField: 'name',
-                valueField: 'abbr',
-                store:Ext.create('Ext.data.Store', {
-                    fields: ['abbr', 'name'],
-                    data : [
-                        {"abbr":"AL", "name":"Alabama"},
-                        {"abbr":"AK", "name":"Alaska"},
-                        {"abbr":"AZ", "name":"Arizona"}
-                    ]
-                })
             }, {
                 xtype: 'datefield',
-                name: 'endDate',
+                name: 'end_date',
                 fieldLabel: '截止时间',
                 columnWidth: 0.5
             }, {
                 xtype: "textfield",
-                name: "title",
+                name: "task_title",
                 fieldLabel: "标题",
                 columnWidth: 1
             }, {
                 xtype: "textareafield",
-                name: 'content',
+                name: 'task_context',
                 fieldLabel: "内容",
                 columnWidth: 1,
                 height: 250
-            }],
-            toolBtns: [{
-                xtype: 'button',
-                text: '发布',
-                handler: function() {
-                    let form = this.up('form');
-                    let values = form.getSaveData().main;
-                    form.setLoading(true);
-                    school.util.BaseUtil.request({
-                        // url: 'http://10.1.80.47:9560/homework/save',
-                        url: '/api/school/homework/save',
-                        method: 'POST',
-                        params: JSON.stringify({
-                            task_title: values.title,
-                            start_date: values.startDate,
-                            end_date: values.endDate,
-                            task_context: values.content
-                        })
-                    }).then(function(res) {
-                        form.setLoading(false);
-                        school.util.BaseUtil.showSuccessToast('发布成功');
-                    }).catch(function(e) {
-                        form.setLoading(false);
-                        school.util.BaseUtil.showErrorToast('发布失败: ' + e.message);
-                    });
-                }
             }]
         });
         this.callParent();

+ 21 - 0
frontend/pc-web/app/view/Interaction/homework/ReleaseController.js

@@ -0,0 +1,21 @@
+Ext.define('school.view.interaction.homework.ReleaseController', {
+    extend: 'school.view.core.form.FormPanelController',
+    alias: 'controller.interaction-homework-release',
+
+    getMySaveParams: function(params) {
+        return params.main;
+    },
+
+    onAfterSave: function(localJson) {
+        var form = this.getView();
+        var id = localJson.data.id;
+        var code = localJson.data.code;
+        form.initId = id;
+        school.util.FormUtil.loadData(form).then(function(data) {
+            var newId = form.xtype + '-' + data.main.task_id;
+            var newTitle = form._title + '(' + data.main.task_title + ')';
+    
+            school.util.BaseUtil.refreshTabTitle(newId, newTitle);
+        });
+    },
+});

+ 29 - 19
frontend/pc-web/app/view/Interaction/notice/List.js

@@ -5,6 +5,7 @@ Ext.define('school.view.interaction.notice.List', {
     extend: 'school.view.core.base.BasePanel',
     xtype: 'interaction-notice-list',
 
+    // dataUrl: 'http://10.1.80.47:9560/notice/list',
     dataUrl: '/api/school/notice/list',
     _title: '学校通知',
 
@@ -28,8 +29,9 @@ Ext.define('school.view.interaction.notice.List', {
             gridConfig: {
                 addTitle: '学校通知',
                 addXtype: 'interaction-notice-schoolnotice',
-                idField: 'teacher_id',
-                codeField: 'teacher_number',
+                idField: 'notify_id',
+                codeField: null,
+                detailField: 'notify_title',
                 dataUrl: me.dataUrl,
                 caller: null,
                 rootProperty: 'data.list',
@@ -44,37 +46,45 @@ Ext.define('school.view.interaction.notice.List', {
                 hiddenTools: false,
                 toolBtns: [{
                     xtype: 'button',
-                    text: '添加',
+                    text: '删除'
+                }, {
+                    xtype: 'button',
+                    text: '新增',
                     handler: function() {
                         school.util.BaseUtil.openTab('interaction-notice-schoolnotice', '新增学校通知', 'interaction-notice-schoolnotice-add');
                     }
-                }, {
-                    xtype: 'button',
-                    text: '删除'
                 }],
                 columns : [{
                     text: 'id',
-                    dataIndex: 'stu_id',
+                    dataIndex: 'notify_id',
                     hidden: true
-                }, {
-                    text: '发布人',
-                    dataIndex: 'stu_number',
-                    width: 150
-                }, {
-                    text: '发布时间',
-                    dataIndex: 'stu_name',
-                    width: 120
                 }, {
                     text: '标题',
-                    dataIndex: 'stu_sex',
+                    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)
+                            });
+                        }
+                    }
                 }, {
                     text: '内容',
-                    dataIndex: 'grade',
+                    dataIndex: 'notify_details',
                     width: 300
                 }, {
-                    text: '通知人',
-                    dataIndex: 'class'
+                    text: '发布人',
+                    dataIndex: 'notify_creator',
+                    width: 150
+                }, {
+                    xtype: 'datecolumn',
+                    formate: 'Y-m-d H:i:s',
+                    text: '发布时间',
+                    dataIndex: 'create_date',
+                    width: 120
                 }]
             },
         });

+ 16 - 61
frontend/pc-web/app/view/Interaction/notice/SchoolNotice.js

@@ -5,92 +5,47 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
     extend: 'school.view.core.form.FormPanel',
     xtype: 'interaction-notice-schoolnotice',
 
-    // controller: 'purchase-purchase-formpanel',
+    controller: 'interaction-notice-schoolnotice',
     // viewModel: 'purchase-purchase-formpanel',
 
     //字段属性
     _title: '学校通知',
-    _idField: 'id',
-    _codeField: 'pu_code',
-    _statusField: 'pu_status',
-    _statusCodeField: 'pu_statuscode',
-    _auditmanField: 'pu_auditman',
-    _auditdateField: 'pu_auditdate',
-    _relationColumn: 'pd_puid',
-    _readUrl: '/api/purchase/purchase/read',
-    _saveUrl: '/api/purchase/purchase/save',
-    _auditUrl: '/api/purchase/purchase/audit',
-    _unAuditUrl: '/api/purchase/purchase/unAudit',
-    _deleteUrl: '/api/purchase/purchase/delete',
-    _turnInUrl: '/api/purchase/purchase/turnProdin',
+    _idField: 'notify_id',
+    _codeField: null,
+    // _readUrl: 'http://10.1.80.47:9560/notice/read',
+    _readUrl: '/api/school/notice/read',
+    // _saveUrl: 'http://10.1.80.47:9560/notice/save',
+    _saveUrl: '/api/school/notice/save',
+    _deleteUrl: '/api/school/notice/delete',
     initId: 0,
     initComponent: function () {
         Ext.apply(this, {
             defaultItems: [{
                 xtype: 'hidden',
-                name: 'id',
+                name: 'notify_id',
                 fieldLabel: 'id'
             }, {
                 xtype: "textfield",
-                name: "Publisher",
+                name: "notify_creator",
                 fieldLabel: "发布人",
                 columnWidth: 0.5
             }, {
-                xtype: 'textfield',
-                name: 'time',
+                xtype: 'datefield',
+                name: 'create_date',
                 fieldLabel: '发布时间',
-                columnWidth: 0.5
-            }, {
-                xtype: 'combobox',
-                name: 'Notifications',
-                fieldLabel: '通知人',
                 columnWidth: 0.5,
-                queryMode: 'local',
-                displayField: 'name',
-                valueField: 'abbr',
-                forceSelection: 'true',//阻止输入非列表内容
-                store:Ext.create('Ext.data.Store', {
-                    fields: ['abbr', 'name'],
-                    data : [
-                        {"abbr":"AL", "name":"Alabama"},
-                        {"abbr":"AK", "name":"Alaska"},
-                        {"abbr":"AZ", "name":"Arizona"}
-                    ]
-                })
+                formatter: 'Y-m-d H:i:s'
             }, {
                 xtype: "textfield",
-                name: "title",
+                name: "notify_title",
                 fieldLabel: "标题",
                 columnWidth: 1
             }, {
                 xtype: "textareafield",//文本域
-                name: 'content',
+                name: 'notify_details',
                 fieldLabel: "内容",
+                height: 300,
                 columnWidth: 1,
-            }],
-            toolBtns: [{
-                xtype: 'button',
-                text: '发布',
-                handler: function() {
-                    let form = this.up('form');
-                    let values = form.getValues();
-                    form.setLoading(true);
-                    school.util.BaseUtil.request({
-                        // url: 'http://10.1.80.47:9560/notice/save',
-                        url: '/api/school/notice/save',
-                        method: 'POST',
-                        params: JSON.stringify({
-                            notify_title: values.title,
-                            notify_details: values.content
-                        })
-                    }).then(function(res) {
-                        form.setLoading(false);
-                        school.util.BaseUtil.showSuccessToast('发布成功');
-                    }).catch(function(e) {
-                        form.setLoading(false);
-                        school.util.BaseUtil.showErrorToast('发布失败: ' + e.message);
-                    });
-                }
             }]
         });
         this.callParent();

+ 21 - 0
frontend/pc-web/app/view/Interaction/notice/SchoolNoticeController.js

@@ -0,0 +1,21 @@
+Ext.define('school.view.interaction.notice.SchoolNoticeController', {
+    extend: 'school.view.core.form.FormPanelController',
+    alias: 'controller.interaction-notice-schoolnotice',
+
+    getMySaveParams: function(params) {
+        return params.main;
+    },
+
+    onAfterSave: function(localJson) {
+        var form = this.getView();
+        var id = localJson.data.id;
+        var code = localJson.data.code;
+        form.initId = id;
+        school.util.FormUtil.loadData(form).then(function(data) {
+            var newId = form.xtype + '-' + id;
+            var newTitle = form._title + '(' + data.main.notify_title + ')';
+    
+            school.util.BaseUtil.refreshTabTitle(newId, newTitle);
+        });
+    },
+});

+ 24 - 36
frontend/pc-web/app/view/Interaction/timetable/List.js

@@ -7,7 +7,8 @@ Ext.define('school.view.interaction.timetable.List', {
 
     controller: 'interaction-timetable-list',
 
-    dataUrl: '/api/interaction/timetable/list',
+    // dataUrl: 'http://10.1.80.36:9520/api/school/curriculum/list',
+    dataUrl: '/api/school/curriculum/list',
     initComponent: function() {
         var me = this;
         Ext.apply(this, {
@@ -34,9 +35,11 @@ Ext.define('school.view.interaction.timetable.List', {
             _batchDeleteUrl: null,
         
             gridConfig: {
-                idField: null,
+                addTitle: '课程表',
+                addXtype: 'interaction-timetable-detail',
+                idField: 'notify_id',
                 codeField: null,
-                statusCodeField: null,
+                detailField: 'notify_title',
                 dataUrl: me.dataUrl,
                 caller: null,
                 rootProperty: 'data.list',
@@ -51,54 +54,39 @@ Ext.define('school.view.interaction.timetable.List', {
                 hiddenTools: false,
                 toolBtns: [{
                     xtype: 'button',
-                    text: '下载模板'
-                }, {
-                    xtype: 'button',
-                    text: '上传课表'
+                    text: '删除'
                 }, {
                     xtype: 'button',
-                    text: '添加',
+                    text: '新增',
                     handler: 'onAddClick'
-                }, {
-                    xtype: 'button',
-                    text: '删除'
                 }],
                 columns : [{
-                    text: '编号',
-                    dataIndex: 'code',
-                    width: 150
-                }, {
-                    text: '学期',
+                    text: '课表名称',
                     dataIndex: 'name',
-                    width: 120
-                }, {
-                    text: '性别',
-                    dataIndex: 'gender',
-                    width: 120
+                    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('name') + ')', gridConfig.addXtype + record.get(gridConfig.idField), {
+                                initId: record.get(gridConfig.idField)
+                            });
+                        }
+                    }
                 }, {
                     text: '年级',
-                    dataIndex: 'grade'
+                    dataIndex: 'gradeName'
                 }, {
                     text: '班级',
-                    dataIndex: 'class'
+                    dataIndex: 'clazzName'
                 }, {
-                    text: '出生日期',
-                    dataIndex: 'birth',
+                    text: '期',
+                    dataIndex: 'termName',
                     width: 120
-                }, {
-                    text: '年龄',
-                    dataIndex: 'open'
                 }, {
                     text: '状态',
                     dataIndex: 'status'
-                }],
-                listeners: {
-                    itemclick: function(view, record, item, index, e, eOpts) {
-                        school.util.BaseUtil.openTab('interaction-timetable-detail', '课程表', 'interaction-timetable-detail'+record.get('id'), {
-                            initId: record.get('id')
-                        }); 
-                    }
-                }
+                }]
             },
         });
         this.callParent(arguments);

+ 32 - 1
frontend/pc-web/app/view/basic/staff/StaffList.js

@@ -33,6 +33,7 @@ Ext.define('school.view.basic.staff.StaffList', {
                 addXtype: 'basic-staff-staffdetail',
                 idField: 'teacher_id',
                 codeField: 'teacher_number',
+                detailField: 'teacher_number',
                 dataUrl: me.dataUrl,
                 rootProperty: 'data.list',
                 totalProperty: 'data.total',
@@ -61,7 +62,37 @@ Ext.define('school.view.basic.staff.StaffList', {
                     xtype: 'button',
                     text: '删除',
                     handler: function() {
-                        // debugger;
+                        let grid = this.up('grid'),
+                        selectedRecords = grid.getSelection();
+                        let data;
+
+                        data = selectedRecords.map(function(r) {
+                            return {
+                                id: r.get('teacher_id')
+                            };
+                        });
+
+                        if(data.length == 0) {
+                            school.util.BaseUtil.showErrorToast('请先勾选需要删除的记录');
+                            return;
+                        }
+
+                        grid.setLoading(true);
+                        school.util.BaseUtil.request({
+                            // url: 'http://10.1.80.47:9560/teacher/batchDelete',
+                            url: '/api/school/teacher/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);
+                        });
                     }
                 }, {
                     xtype: 'button',

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

@@ -15,10 +15,10 @@ Ext.define('school.view.basic.student.StudentDetail', {
     _auditdateField: null,
     // _readUrl: 'http://10.1.80.35:8560/api/sale/saledown/read',
     _readUrl: '/api/school/student/read',
-    // _saveUrl: 'http://10.1.80.35:8560/api/sale/saledown/update',
-    _saveUrl: '/api/sale/saledown/update',
-    // _toSaleUrl: 'http://10.1.80.35:8560/api/sale/saledown/toSale',
-    _toSaleUrl: '/api/sale/saledown/toSale',
+    // _saveUrl: 'http://10.1.80.47:9560/student/save',
+    _saveUrl: '/api/school/student/save',
+    // _deleteUrl: 'http://10.1.80.47:9560/student/delete',
+    _deleteUrl: '/api/school/student/delete',
     initId: 0,
 
     initComponent: function () {

+ 37 - 3
frontend/pc-web/app/view/basic/student/StudentList.js

@@ -40,6 +40,7 @@ Ext.define('school.view.basic.student.StudentList', {
                 addXtype: 'basic-student-studentdetail',
                 idField: 'stu_id',
                 codeField: 'stu_number',
+                detailField: 'stu_number',
                 dataUrl: me.dataUrl,
                 caller: null,
                 rootProperty: 'data.list',
@@ -67,13 +68,46 @@ Ext.define('school.view.basic.student.StudentList', {
                     text: '一键开通'
                 }, {
                     xtype: 'button',
-                    text: '添加',
+                    text: '删除',
                     handler: function() {
-                        school.util.BaseUtil.openTab('basic-student-studentdetail', '新增学生信息', 'basic-student-studentdetail-add');
+                        let grid = this.up('grid'),
+                        selectedRecords = grid.getSelection();
+                        let data;
+
+                        data = selectedRecords.map(function(r) {
+                            return {
+                                id: r.get('stu_id')
+                            };
+                        });
+
+                        if(data.length == 0) {
+                            school.util.BaseUtil.showErrorToast('请先勾选需要删除的记录');
+                            return;
+                        }
+
+                        grid.setLoading(true);
+                        school.util.BaseUtil.request({
+                            // url: 'http://10.1.80.47:9560/student/batchDelete',
+                            url: '/api/school/student/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);
+                        });
                     }
                 }, {
                     xtype: 'button',
-                    text: '删除'
+                    text: '新增',
+                    handler: function() {
+                        school.util.BaseUtil.openTab('basic-student-studentdetail', '新增学生信息', 'basic-student-studentdetail-add');
+                    }
                 }],
                 columns : [{
                     text: 'id',

+ 9 - 7
frontend/pc-web/app/view/core/base/BasePanel.js

@@ -43,14 +43,16 @@ Ext.define('school.view.core.base.BasePanel', {
             xtype: 'core-base-gridpanel',
             padding: '8 12',
             _columns: gridColumns.map(function(c) {
-                if(c.dataIndex == gridConfig.codeField) {
+                if(c.dataIndex == gridConfig.detailField) {
                     c.listeners = c.listeners || {};
-                    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.tdCls = c.tdCls ? (c.tdCls + ' x-code-column') : 'x-code-column'
+                    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);
             }),

+ 1 - 1
frontend/pc-web/app/view/core/base/BasePanel.scss

@@ -31,7 +31,7 @@
 }
 .core-base-gridpanel{
 
-    .x-code-column {
+    .x-detail-column {
         .x-grid-cell-inner {
             color: #3e80f6;
             cursor: pointer;

+ 14 - 10
frontend/pc-web/app/view/core/form/FormPanelController.js

@@ -196,16 +196,7 @@ Ext.define('school.view.core.form.FormPanelController', {
         .then(function(localJson) {
             form.setLoading(false);
             if(localJson.success){
-                var id = localJson.data.id;
-                var code = localJson.data.code;
-                form.initId = id;
-                school.util.FormUtil.loadData(form);
-
-                var newId = form.xtype + '-' + id;
-                var newTitle = form._title + '(' + code + ')';
-
-                school.util.BaseUtil.refreshTabTitle(newId, newTitle);
-
+                me.onAfterSave(localJson);
                 school.util.BaseUtil.showSuccessToast('保存成功');
                 form.fireEvent('aftersave', true, form, localJson);
             }
@@ -221,6 +212,19 @@ Ext.define('school.view.core.form.FormPanelController', {
         return params;
     },
 
+    onAfterSave: function(localJson) {
+        var form = this.getView();
+        var id = localJson.data.id;
+        var code = localJson.data.code;
+        form.initId = id;
+        school.util.FormUtil.loadData(form);
+
+        var newId = form.xtype + '-' + id;
+        var newTitle = form._title + '(' + code + ')';
+
+        school.util.BaseUtil.refreshTabTitle(newId, newTitle);
+    },
+
     onAudit: function(){
         var me = this,
         form = this.getView(),