Jelajahi Sumber

'教职工新增、删除接口对接'

zhuth 6 tahun lalu
induk
melakukan
b4366b29df

+ 147 - 0
frontend/pc-web/app/view/Interaction/homework/List.js

@@ -0,0 +1,147 @@
+/**
+ * 作业发布
+ */
+Ext.define('school.view.interaction.homework.List', {
+    extend: 'school.view.core.base.BasePanel',
+    xtype: 'interaction-homework-list',
+
+    dataUrl: '/api/school/homework/list',
+    _title: '作业发布',
+
+    initComponent: function() {
+        var me = this;
+        Ext.apply(this, {
+            searchField: [{
+                xtype: 'textfield',
+                name: 'creator',
+                fieldLabel: '发布人'
+            }, {
+                xtype: 'datefield',
+                name: 'createTime',
+                fieldLabel: '发布时间'
+            }, {
+                xtype: 'textfield',
+                name: 'keyword',
+                fieldLabel:'关键字'
+            }],
+        
+            gridConfig: {
+                addTitle: '作业发布',
+                addXtype: 'interaction-homework-release',
+                idField: 'teacher_id',
+                codeField: 'teacher_number',
+                dataUrl: me.dataUrl,
+                caller: null,
+                rootProperty: 'data.list',
+                totalProperty: 'data.total',
+                actionColumn: [],
+                selModel: {
+                    checkOnly:true,
+                    type:'checkboxmodel',
+                    mode : "MULTI" ,
+                    ignoreRightMouseSelection : false
+                },
+                hiddenTools: false,
+                toolBtns: [{
+                    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',
+                    hidden: true
+                }, {
+                    text: '发布人',
+                    dataIndex: 'stu_number',
+                    width: 150
+                }, {
+                    text: '发布时间',
+                    dataIndex: 'stu_name',
+                    width: 120
+                }, {
+                    text: '标题',
+                    dataIndex: 'stu_sex',
+                    width: 120,
+                }, {
+                    text: '内容',
+                    dataIndex: 'grade',
+                    width: 300
+                }, {
+                    text: '通知人',
+                    dataIndex: 'class'
+                }]
+            },
+        });
+        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;
+     },
+});

+ 147 - 0
frontend/pc-web/app/view/Interaction/notice/List.js

@@ -0,0 +1,147 @@
+/**
+ * 学校通知
+ */
+Ext.define('school.view.interaction.notice.List', {
+    extend: 'school.view.core.base.BasePanel',
+    xtype: 'interaction-notice-list',
+
+    dataUrl: '/api/school/notice/list',
+    _title: '学校通知',
+
+    initComponent: function() {
+        var me = this;
+        Ext.apply(this, {
+            searchField: [{
+                xtype: 'textfield',
+                name: 'creator',
+                fieldLabel: '发布人'
+            }, {
+                xtype: 'datefield',
+                name: 'createTime',
+                fieldLabel: '发布时间'
+            }, {
+                xtype: 'textfield',
+                name: 'keyword',
+                fieldLabel:'关键字'
+            }],
+        
+            gridConfig: {
+                addTitle: '学校通知',
+                addXtype: 'interaction-notice-schoolnotice',
+                idField: 'teacher_id',
+                codeField: 'teacher_number',
+                dataUrl: me.dataUrl,
+                caller: null,
+                rootProperty: 'data.list',
+                totalProperty: 'data.total',
+                actionColumn: [],
+                selModel: {
+                    checkOnly:true,
+                    type:'checkboxmodel',
+                    mode : "MULTI" ,
+                    ignoreRightMouseSelection : false
+                },
+                hiddenTools: false,
+                toolBtns: [{
+                    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',
+                    hidden: true
+                }, {
+                    text: '发布人',
+                    dataIndex: 'stu_number',
+                    width: 150
+                }, {
+                    text: '发布时间',
+                    dataIndex: 'stu_name',
+                    width: 120
+                }, {
+                    text: '标题',
+                    dataIndex: 'stu_sex',
+                    width: 120,
+                }, {
+                    text: '内容',
+                    dataIndex: 'grade',
+                    width: 300
+                }, {
+                    text: '通知人',
+                    dataIndex: 'class'
+                }]
+            },
+        });
+        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;
+     },
+});

+ 10 - 7
frontend/pc-web/app/view/basic/staff/StaffDetail.js

@@ -2,8 +2,7 @@ Ext.define('school.view.basic.staff.StaffDetail', {
     extend: 'school.view.core.form.FormPanel',
     xtype: 'basic-staff-staffdetail',
 
-    // controller: 'sale-b2b-purchasedetail',
-    // viewModel: 'sale-b2b-purchasedetail',
+    controller: 'basic-staff-staffdetail',
 
     //字段属性
     _title: '教职工信息',
@@ -13,17 +12,21 @@ Ext.define('school.view.basic.staff.StaffDetail', {
     _statusCodeField: null,
     _auditmanField: null,
     _auditdateField: null,
-    // _readUrl: 'http://10.1.80.35:8560/api/sale/saledown/read',
     _readUrl: '/api/school/teacher/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/teacher/save',
+    _saveUrl: '/api/school/teacher/save',
+    // _deleteUrl: 'http://10.1.80.47:9560/teacher/delete',
+    _deleteUrl: '/api/school/teacher/delete',
+    // _saveUrl: '/api/sale/saledown/update',
     initId: 0,
 
     initComponent: function () {
         Ext.apply(this, {
             defaultItems: [{
+                xtype: 'hidden',
+                name: 'teacher_id',
+                fieldLabel: 'id',
+            },{
                 xtype: 'textfield',
                 name: 'teacher_number',
                 fieldLabel: '工号'

+ 8 - 0
frontend/pc-web/app/view/basic/staff/StaffDetailController.js

@@ -0,0 +1,8 @@
+Ext.define('school.view.basic.staff.StaffDetailController', {
+    extend: 'school.view.core.form.FormPanelController',
+    alias: 'controller.basic-staff-staffdetail',
+
+    getMySaveParams: function(params) {
+        return params.main;
+    }
+});

+ 10 - 13
frontend/pc-web/app/view/basic/staff/StaffList.js

@@ -9,6 +9,7 @@ Ext.define('school.view.basic.staff.StaffList', {
     _title: '教职工信息导入',
     caller: 'Teacher',
     pathKey: 'teacher',
+    
 
     initComponent: function() {
         var me = this;
@@ -28,11 +29,11 @@ Ext.define('school.view.basic.staff.StaffList', {
             }],
         
             gridConfig: {
-                idField: null,
-                codeField: null,
-                statusCodeField: null,
+                addTitle: '教职工信息',
+                addXtype: 'basic-staff-staffdetail',
+                idField: 'teacher_id',
+                codeField: 'teacher_number',
                 dataUrl: me.dataUrl,
-                caller: null,
                 rootProperty: 'data.list',
                 totalProperty: 'data.total',
                 actionColumn: [],
@@ -58,7 +59,10 @@ Ext.define('school.view.basic.staff.StaffList', {
                     text: '一键开通'
                 }, {
                     xtype: 'button',
-                    text: '删除'
+                    text: '删除',
+                    handler: function() {
+                        // debugger;
+                    }
                 }, {
                     xtype: 'button',
                     text: '新增',
@@ -97,14 +101,7 @@ Ext.define('school.view.basic.staff.StaffList', {
                 }, {
                     text: '状态',
                     dataIndex: 'teacher_status'
-                }],
-                listeners: {
-                    itemclick: function(view, record, item, index, e, eOpts) {
-                        school.util.BaseUtil.openTab('basic-staff-staffdetail', '教职工信息(' + record.get('teacher_number') + ')', 'basic-staff-staffdetail'+record.get('teacher_id'), {
-                            initId: record.get('teacher_id')
-                        });
-                    }
-                }
+                }]
             },
         });
         this.callParent(arguments);

+ 5 - 12
frontend/pc-web/app/view/basic/student/StudentList.js

@@ -36,9 +36,10 @@ Ext.define('school.view.basic.student.StudentList', {
             }],
         
             gridConfig: {
-                idField: null,
-                codeField: null,
-                statusCodeField: null,
+                addTitle: '学生信息',
+                addXtype: 'basic-student-studentdetail',
+                idField: 'stu_id',
+                codeField: 'stu_number',
                 dataUrl: me.dataUrl,
                 caller: null,
                 rootProperty: 'data.list',
@@ -121,15 +122,7 @@ Ext.define('school.view.basic.student.StudentList', {
                 }, {
                     text: '状态',
                     dataIndex: 'stu_status'
-                }],
-                listeners: {
-                    itemclick: function(view, record, item, index, e, eOpts) {
-                        let number = record.get('stu_number');
-                        school.util.BaseUtil.openTab('basic-student-studentdetail', '学生信息' + '(' + number + ')', 'basic-student-studentdetail'+record.get('stu_id'), {
-                            initId: record.get('stu_id')
-                        });
-                    }
-                }
+                }]
             },
         });
         this.callParent(arguments);

+ 13 - 0
frontend/pc-web/app/view/core/base/BasePanel.js

@@ -25,6 +25,10 @@ Ext.define('school.view.core.base.BasePanel', {
     searchField:[],
     gridColumns: [],
 
+    addTitle: '',
+    addXtype: '',
+    idField: '',
+    codeField: '',
     deleteMoreMsg: '确认删除所选单据?',
     deleteOneMsg: '确认删除该单据?',
 
@@ -39,6 +43,15 @@ Ext.define('school.view.core.base.BasePanel', {
             xtype: 'core-base-gridpanel',
             padding: '8 12',
             _columns: gridColumns.map(function(c) {
+                if(c.dataIndex == gridConfig.codeField) {
+                    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'
+                }
                 return Object.assign({}, c);
             }),
         };

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

@@ -30,6 +30,14 @@
     }
 }
 .core-base-gridpanel{
+
+    .x-code-column {
+        .x-grid-cell-inner {
+            color: #3e80f6;
+            cursor: pointer;
+        }
+    }
+
     .x-grid-body{
         border:1px solid #abdaff !important;
         border-top-width: 0 !important;

+ 5 - 1
frontend/pc-web/app/view/core/form/FormPanelController.js

@@ -190,7 +190,7 @@ Ext.define('school.view.core.form.FormPanelController', {
         form.setLoading(true);
         school.util.BaseUtil.request({
             url: form._saveUrl,
-            params: JSON.stringify(params),
+            params: JSON.stringify(me.getMySaveParams(params)),
             method: 'POST',
         })
         .then(function(localJson) {
@@ -216,6 +216,10 @@ Ext.define('school.view.core.form.FormPanelController', {
             form.fireEvent('aftersave', false, form);
         });
     },
+    
+    getMySaveParams: function(params) {
+        return params;
+    },
 
     onAudit: function(){
         var me = this,

+ 4 - 4
frontend/pc-web/resources/json/navigation.json

@@ -38,13 +38,13 @@
     "text": "家校互动",
     "iconCls": "x-ss ss-nav-interaction",
     "items": [{
-        "id": "interaction-notice-schoolnotice", 
+        "id": "interaction-notice-list", 
         "text": "学校通知",
-        "view": "interaction-notice-schoolnotice"
+        "view": "interaction-notice-list"
     }, {
-        "id": "interaction-homework-release",
+        "id": "interaction-homework-list",
         "text": "作业发布",
-        "view": "interaction-homework-release"
+        "view": "interaction-homework-list"
     }, {
         "id": "interaction-timetable-list",
         "text": "课程表",