Browse Source

学校通知/作业发布

zhuth 6 years ago
parent
commit
c5da8956e8

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

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

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

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

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

@@ -4,53 +4,65 @@
 Ext.define('school.store.Subject', {
 Ext.define('school.store.Subject', {
     extend: 'Ext.data.Store',
     extend: 'Ext.data.Store',
     alias: 'store.store_subject',
     alias: 'store.store_subject',
+    storeId: 'store_subject',
 
 
     model: 'school.model.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: '思想品德'
+    // }]
 });
 });

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

@@ -5,8 +5,8 @@ Ext.define('school.view.interaction.homework.List', {
     extend: 'school.view.core.base.BasePanel',
     extend: 'school.view.core.base.BasePanel',
     xtype: 'interaction-homework-list',
     xtype: 'interaction-homework-list',
 
 
-    // dataUrl: 'http://10.1.80.180:9520/api/school/homework/list',
-    dataUrl: '/api/school/homework/list',
+    dataUrl: 'http://10.1.80.180:9520/api/school/homework/list',
+    // dataUrl: '/api/school/homework/list',
     _title: '作业发布',
     _title: '作业发布',
 
 
     initComponent: function () {
     initComponent: function () {
@@ -54,7 +54,7 @@ Ext.define('school.view.interaction.homework.List', {
                 }
                 }
             }, {
             }, {
                 xtype: 'textfield',
                 xtype: 'textfield',
-                name: 'task_creator',
+                name: 'creator',
                 fieldLabel: '发布人'
                 fieldLabel: '发布人'
             }, {
             }, {
                 xtype: 'combobox',
                 xtype: 'combobox',
@@ -168,7 +168,7 @@ Ext.define('school.view.interaction.homework.List', {
                     width: 300
                     width: 300
                 }, {
                 }, {
                     text: '发布人',
                     text: '发布人',
-                    dataIndex: 'task_creator',
+                    dataIndex: 'creator',
                     width: 150
                     width: 150
                 }, {
                 }, {
                     text: '发布状态',
                     text: '发布状态',

+ 11 - 4
frontend/pc-web/app/view/Interaction/homework/Release.js

@@ -12,10 +12,10 @@ Ext.define('school.view.interaction.homework.Release', {
     _title: '作业发布',
     _title: '作业发布',
     _idField: 'task_id',
     _idField: 'task_id',
     _codeField: null,
     _codeField: null,
-    // _readUrl: 'http://10.1.80.47: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',
+    _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',
     _deleteUrl: '/api/school/homework/delete',
     _deleteUrl: '/api/school/homework/delete',
     initId: 0,
     initId: 0,
     initComponent: function () {
     initComponent: function () {
@@ -27,6 +27,12 @@ Ext.define('school.view.interaction.homework.Release', {
             }, {
             }, {
                 xtype: "textfield",
                 xtype: "textfield",
                 name: "task_creator",
                 name: "task_creator",
+                fieldLabel: "发布人id",
+                defaultValue: school.util.BaseUtil.getCurrentUser().id,
+                hidden: true
+            }, {
+                xtype: "textfield",
+                name: "creator",
                 fieldLabel: "发布人",
                 fieldLabel: "发布人",
                 defaultValue: school.util.BaseUtil.getCurrentUser().username,
                 defaultValue: school.util.BaseUtil.getCurrentUser().username,
                 readOnly: true
                 readOnly: true
@@ -119,6 +125,7 @@ Ext.define('school.view.interaction.homework.Release', {
             toolBtns: [{
             toolBtns: [{
                 xtype: 'button',
                 xtype: 'button',
                 text: '发布',
                 text: '发布',
+                hidden: true,
                 bind: {
                 bind: {
                     hidden: '{!task_id}'
                     hidden: '{!task_id}'
                 },
                 },

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

@@ -5,8 +5,8 @@ Ext.define('school.view.interaction.notice.List', {
     extend: 'school.view.core.base.BasePanel',
     extend: 'school.view.core.base.BasePanel',
     xtype: 'interaction-notice-list',
     xtype: 'interaction-notice-list',
 
 
-    // dataUrl: 'http://10.1.80.47:9560/notice/list',
-    dataUrl: '/api/school/notice/list',
+    dataUrl: 'http://10.1.80.180:9520/api/school/notice/list',
+    // dataUrl: '/api/school/notice/list',
     _title: '学校通知',
     _title: '学校通知',
 
 
     initComponent: function() {
     initComponent: function() {
@@ -21,7 +21,7 @@ Ext.define('school.view.interaction.notice.List', {
                 }
                 }
             }, {
             }, {
                 xtype: 'textfield',
                 xtype: 'textfield',
-                name: 'notify_creator',
+                name: 'creator',
                 fieldLabel: '发布人'
                 fieldLabel: '发布人'
             }, {
             }, {
                 xtype: 'combobox',
                 xtype: 'combobox',
@@ -127,7 +127,7 @@ Ext.define('school.view.interaction.notice.List', {
                     width: 300
                     width: 300
                 }, {
                 }, {
                     text: '发布人',
                     text: '发布人',
-                    dataIndex: 'notify_creator',
+                    dataIndex: 'creator',
                     width: 150
                     width: 150
                 }, {
                 }, {
                     text: '发布状态',
                     text: '发布状态',

+ 6 - 5
frontend/pc-web/app/view/Interaction/notice/SchoolNotice.js

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

+ 8 - 4
frontend/pc-web/app/view/Interaction/timetable/Detail.js

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

+ 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);
+    }
+});

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

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