瀏覽代碼

Merge branch 'dev' of ssh://10.10.100.21/source/smartschool-platform into dev

zhaoy 7 年之前
父節點
當前提交
b9223d28ef

+ 0 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/interceptor/AuthRestInterceptor.java

@@ -19,8 +19,6 @@ import java.util.Enumeration;
  * @author chenwei
  * @date 2019/2/18
  */
-@Component
-@Configuration
 public class AuthRestInterceptor extends HandlerInterceptorAdapter {
 
     private static final Logger logger = LoggerFactory.getLogger(AuthRestInterceptor.class);

+ 23 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/interceptor/InterceptorConfig.java

@@ -0,0 +1,23 @@
+package com.usoftchina.smartschool.school.interceptor;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * @author: guq
+ * @create: 2019-03-01 16:00
+ **/
+@Configuration
+public class InterceptorConfig implements WebMvcConfigurer {
+    @Bean
+    public AuthRestInterceptor authRestInterceptor() {
+        return new AuthRestInterceptor();
+    }
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        registry.addInterceptor(authRestInterceptor());
+    }
+}

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

@@ -14,7 +14,8 @@ Ext.define('school.Application', {
     stores: [
         // TODO: add global / shared stores here
         'school.store.Grade',
-        'school.store.Class'
+        'school.store.Class',
+        'school.store.Subject'
     ],
 
     defaultToken: 'main',

+ 2 - 2
frontend/pc-web/app/model/Subject.js

@@ -4,10 +4,10 @@
 Ext.define('school.model.Subject', {
     extend: 'school.model.Base',
     fields: [{
-        name: 'code', // 学科代码
+        name: 'subject_id', // 学科代码
         type: 'string'
     }, {
-        name: 'name', // 学科名称
+        name: 'subject_name', // 学科名称
         type: 'string'
     }]
 });

+ 7 - 7
frontend/pc-web/app/model/Timetable.js

@@ -4,19 +4,19 @@
 Ext.define('school.model.Timetable', {
     extend: 'school.model.Base',
     fields: [{
-        name: 'mon', type: 'string'
+        name: 'mon', type: 'int'
     }, {
-        name: 'tues', type: 'string'
+        name: 'tues', type: 'int'
     }, {
-        name: 'wed', type: 'string'
+        name: 'wed', type: 'int'
     }, {
-        name: 'thur', type: 'string'
+        name: 'thur', type: 'int'
     }, {
-        name: 'fri', type: 'string'
+        name: 'fri', type: 'int'
     }, {
-        name: 'sat', type: 'string'
+        name: 'sat', type: 'int'
     }, {
-        name: 'sunday', type: 'string'
+        name: 'sunday', type: 'int'
     }, {
         name: 'startTime', type: 'string',
     }, {

+ 58 - 46
frontend/pc-web/app/store/Subject.js

@@ -4,53 +4,65 @@
 Ext.define('school.store.Subject', {
     extend: 'Ext.data.Store',
     alias: 'store.store_subject',
+    storeId: 'store_subject',
 
     model: 'school.model.Subject',
+    autoLoad: false,
+    proxy: {
+        type: 'ajax',
+        url: '/api/school/subject/list',
+        reader: {
+            type: 'json',
+            rootProperty: 'data.list'
+        }
+    },
+    // fields: ['subject_id', 'subject_name'],
+    // data: []
 
-    data: [{
-        code: '1',
-        name: '语文'
-    }, {
-        code: '2',
-        name: '数学'
-    }, {
-        code: '3',
-        name: '英语'
-    }, {
-        code: '4',
-        name: '物理'
-    }, {
-        code: '5',
-        name: '化学'
-    }, {
-        code: '6',
-        name: '生物'
-    }, {
-        code: '7',
-        name: '政治'
-    }, {
-        code: '8',
-        name: '历史'
-    }, {
-        code: '9',
-        name: '地理'
-    }, {
-        code: '10',
-        name: '体育'
-    }, {
-        code: '11',
-        name: '书法'
-    }, {
-        code: '12',
-        name: '美工'
-    }, {
-        code: '13',
-        name: '画画'
-    }, {
-        code: '14',
-        name: '自然'
-    }, {
-        code: '15',
-        name: '思想品德'
-    }]
+    // data: [{
+    //     code: '1',
+    //     name: '语文'
+    // }, {
+    //     code: '2',
+    //     name: '数学'
+    // }, {
+    //     code: '3',
+    //     name: '英语'
+    // }, {
+    //     code: '4',
+    //     name: '物理'
+    // }, {
+    //     code: '5',
+    //     name: '化学'
+    // }, {
+    //     code: '6',
+    //     name: '生物'
+    // }, {
+    //     code: '7',
+    //     name: '政治'
+    // }, {
+    //     code: '8',
+    //     name: '历史'
+    // }, {
+    //     code: '9',
+    //     name: '地理'
+    // }, {
+    //     code: '10',
+    //     name: '体育'
+    // }, {
+    //     code: '11',
+    //     name: '书法'
+    // }, {
+    //     code: '12',
+    //     name: '美工'
+    // }, {
+    //     code: '13',
+    //     name: '画画'
+    // }, {
+    //     code: '14',
+    //     name: '自然'
+    // }, {
+    //     code: '15',
+    //     name: '思想品德'
+    // }]
 });

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

@@ -54,7 +54,7 @@ Ext.define('school.view.interaction.homework.List', {
                 }
             }, {
                 xtype: 'textfield',
-                name: 'task_creator',
+                name: 'creator',
                 fieldLabel: '发布人'
             }, {
                 xtype: 'combobox',
@@ -168,7 +168,7 @@ Ext.define('school.view.interaction.homework.List', {
                     width: 300
                 }, {
                     text: '发布人',
-                    dataIndex: 'task_creator',
+                    dataIndex: 'creator',
                     width: 150
                 }, {
                     text: '发布状态',

+ 8 - 1
frontend/pc-web/app/view/Interaction/homework/Release.js

@@ -12,7 +12,7 @@ Ext.define('school.view.interaction.homework.Release', {
     _title: '作业发布',
     _idField: 'task_id',
     _codeField: null,
-    // _readUrl: 'http://10.1.80.47:9520/api/school/homework/read',
+    // _readUrl: 'http://10.1.80.180:9520/api/school/homework/read',
     _readUrl: '/api/school/homework/read',
     // _saveUrl: 'http://10.1.80.180:9520/api/school/homework/save',
     _saveUrl: '/api/school/homework/save',
@@ -27,6 +27,12 @@ Ext.define('school.view.interaction.homework.Release', {
             }, {
                 xtype: "textfield",
                 name: "task_creator",
+                fieldLabel: "发布人id",
+                defaultValue: school.util.BaseUtil.getCurrentUser().id,
+                hidden: true
+            }, {
+                xtype: "textfield",
+                name: "creator",
                 fieldLabel: "发布人",
                 defaultValue: school.util.BaseUtil.getCurrentUser().username,
                 readOnly: true
@@ -119,6 +125,7 @@ Ext.define('school.view.interaction.homework.Release', {
             toolBtns: [{
                 xtype: 'button',
                 text: '发布',
+                hidden: true,
                 bind: {
                     hidden: '{!task_id}'
                 },

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

@@ -5,7 +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: 'http://10.1.80.180:9520/api/school/notice/list',
     dataUrl: '/api/school/notice/list',
     _title: '学校通知',
 
@@ -21,7 +21,7 @@ Ext.define('school.view.interaction.notice.List', {
                 }
             }, {
                 xtype: 'textfield',
-                name: 'notify_creator',
+                name: 'creator',
                 fieldLabel: '发布人'
             }, {
                 xtype: 'combobox',
@@ -127,7 +127,7 @@ Ext.define('school.view.interaction.notice.List', {
                     width: 300
                 }, {
                     text: '发布人',
-                    dataIndex: 'notify_creator',
+                    dataIndex: 'creator',
                     width: 150
                 }, {
                     text: '发布状态',

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

@@ -12,9 +12,9 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
     _title: '学校通知',
     _idField: 'notify_id',
     _codeField: null,
-    // _readUrl: 'http://10.1.80.47:9560/notice/read',
+    // _readUrl: 'http://10.1.80.180:9520/api/school/notice/read',
     _readUrl: '/api/school/notice/read',
-    // _saveUrl: 'http://10.1.80.47:9560/notice/save',
+    // _saveUrl: 'http://10.1.80.180:9520/api/school/notice/save',
     _saveUrl: '/api/school/notice/save',
     _deleteUrl: '/api/school/notice/delete',
     initId: 0,
@@ -33,7 +33,7 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
                 hidden: true
             }, {
                 xtype: "textfield",
-                name: "notify_creator_name",
+                name: "creator",
                 fieldLabel: "发布人",
                 columnWidth: 0.5,
                 defaultValue: school.util.BaseUtil.getCurrentUser().username,
@@ -82,6 +82,7 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
             toolBtns: [{
                 xtype: 'button',
                 text: '发布',
+                hidden: true,
                 bind: {
                     hidden: '{!notify_id}'
                 },

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

@@ -7,9 +7,9 @@ Ext.define('school.view.interaction.timetable.Detail', {
     _title: '课程表',
     _idField: 'id',
     _codeField: null,
-    // _readUrl: 'http://10.1.80.36:9520/api/school/curriculum/read',
+    // _readUrl: 'http://10.1.80.47:9520/api/school/curriculum/read',
     _readUrl: '/api/school/curriculum/read',
-    // _saveUrl: 'http://10.1.80.36:9520/api/school/curriculum/save',
+    // _saveUrl: 'http://10.1.80.47:9520/api/school/curriculum/save',
     _saveUrl: '/api/school/curriculum/save',
     _deleteUrl: '/api/school/curriculum/delete',
     initId: 0,
@@ -253,5 +253,9 @@ Ext.define('school.view.interaction.timetable.Detail', {
         menu.setVisible(false);
         let classTime = Math.abs(Ext.Date.diff(me.currentRecord.get('_time1'), record.get('date'), Ext.Date.MINUTE));
         me.CLASS_TIME = classTime;
+    },
+
+    refresh: function() {
+        Ext.StoreMgr.get('store_subject').load();
     }
 });

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

@@ -7,7 +7,7 @@ Ext.define('school.view.interaction.timetable.List', {
 
     controller: 'interaction-timetable-list',
 
-    // dataUrl: 'http://10.1.80.36:9520/api/school/curriculum/list',
+    // dataUrl: 'http://10.1.80.47:9520/api/school/curriculum/list',
     dataUrl: '/api/school/curriculum/list',
     _title: '课程表',
     caller: 'Curriculum',

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

@@ -328,6 +328,7 @@ Ext.define('school.view.basic.class.ClassInfoController', {
                             }).then(function(res) {
                                 view.setLoading(false);
                                 currentNode.set('text', text);
+                                currentNode.set('pathText', text);
                                 currentNode.commit();
                                 win.close();
                                 listCard.showNode(currentNode);

+ 22 - 18
frontend/pc-web/app/view/core/form/FormPanelController.js

@@ -13,24 +13,28 @@ Ext.define('school.view.core.form.FormPanelController', {
     },
 
     refresh: function() {
-        var me = this,
-        form = me.getView(),
-        xtype = form.xtype,
-        _config = {
-            initId: form.initId,
-        },
-        currentTab = school.util.BaseUtil.getCurrentTab();
-        
-        var view = {
-            _config: _config,
-            xtype: xtype
-        };
-        Ext.apply(view, _config);
-        
-        Ext.suspendLayouts();
-        currentTab.removeAll();
-        currentTab.add(view);
-        Ext.resumeLayouts(true);
+        try {
+            var me = this,
+            form = me.getView(),
+            xtype = form.xtype,
+            _config = {
+                initId: form.initId,
+            },
+            currentTab = school.util.BaseUtil.getCurrentTab();
+            
+            var view = {
+                _config: _config,
+                xtype: xtype
+            };
+            Ext.apply(view, _config);
+            
+            Ext.suspendLayouts();
+            currentTab.removeAll();
+            currentTab.add(view);
+            Ext.resumeLayouts(true);
+        }catch(e) {
+            console.error(e);
+        }
     },
 
     add: function(){

+ 21 - 0
frontend/pc-web/app/view/core/form/field/SubjectComboBox.js

@@ -0,0 +1,21 @@
+Ext.define('school.view.core.form.field.SubjectComboBox', {
+    extend: 'Ext.form.field.ComboBox',
+    alias: 'widget.subjectcombo',
+
+    fieldLabel: '学科',
+    displayField: 'subject_name',
+    valueField: 'subject_id',
+    editable: true,
+    minChars: 0,
+    queryMode: 'local',
+    initComponent: function() {
+        var me = this;
+        var store = Ext.StoreMgr.get('store_subject');
+        store.load();
+        Ext.apply(me, {
+            store: store,
+        });
+
+        me.callParent(arguments);
+    }
+});

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

@@ -6,23 +6,18 @@ Ext.define('school.view.core.grid.column.SubjectColumn', {
     xtype: 'subjectcolumn',
 
     editor: {
-        xtype: 'combobox',
-        displayField: 'name',
-        valueField: 'code',
-        store: {
-            type: 'store_subject'
-        },
-        queryMode: 'local'
+        xtype: 'subjectcombo',
+        fieldLabel: null
     },
     renderer: function(v, m , r) {
         let store = m.column.getEditor().store;
-        let idx = store.find('code', v);
+        let idx = store.find('subject_id', v);
 
         if(idx != -1) {
             let subject = store.getAt(idx);
-            v = subject.get('name');
+            return subject.get('subject_name');
+        }else {
+            return null
         }
-
-        return v;
     }
 });