Browse Source

课程表 学期 学年 组件设计

zhuth 6 years ago
parent
commit
8377019f06

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

@@ -80,15 +80,52 @@ Ext.define('school.view.interaction.timetable.Detail', {
                     }
                 }
             }, {
-                xtype: 'textfield',
+                xtype: 'combobox',
                 name: 'termPart',
                 fieldLabel: '学年',
-                allowBlank: false
+                allowBlank: false,
+                queryModel: 'local',
+                displayField: 'value',
+                valueField: 'value',
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['value'],
+                    data: (function() {
+                        let now = new Date();
+                        let year = now.getFullYear();
+                        let op = [], o1, o2;
+                        o1 = [(year - 1) + '-' + year];
+                        o2 = [year + '-' + (year + 1)];
+                        op.push(o1);
+                        op.push(o2);
+                        return op;
+                    })()
+                }),
+                defaultValue: (function() {
+                    let now = new Date();
+                    let year = now.getFullYear();
+                    let month = now.getMonth() + 1;
+                    let o1, o2;
+                    o1 = [(year - 1) + '-' + year];
+                    o2 = [year + '-' + (year + 1)];
+                    return (month < 9) ? o1 : o2
+                })()
             }, {
-                xtype: "textfield",
+                xtype: "combobox",
                 name: "termName",
                 fieldLabel: "学期",
-                allowBlank: false
+                allowBlank: false,
+                queryModel: 'local',
+                displayField: 'value',
+                valueField: 'value',
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['value'],
+                    data: [['第一学期'], ['第二学期']]
+                }),
+                defaultValue: (function() {
+                    let now = new Date();
+                    let month = now.getMonth() + 1;
+                    return (month < 9) ? '第一学期' : '第二学期'
+                })()
             }, {
                 xtype: "textfield",
                 name: "creatorName",

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

@@ -54,13 +54,50 @@ Ext.define('school.view.interaction.timetable.List', {
                     }
                 }
             }, {
-                xtype: 'textfield',
+                xtype: 'combobox',
                 name: 'mcur_term_part',
-                fieldLabel: '学年'
+                fieldLabel: '学年',
+                queryModel: 'local',
+                displayField: 'value',
+                valueField: 'value',
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['value'],
+                    data: (function() {
+                        let now = new Date();
+                        let year = now.getFullYear();
+                        let op = [], o1, o2;
+                        o1 = [(year - 1) + '-' + year];
+                        o2 = [year + '-' + (year + 1)];
+                        op.push(o1);
+                        op.push(o2);
+                        return op;
+                    })()
+                }),
+                value: (function() {
+                    let now = new Date();
+                    let year = now.getFullYear();
+                    let month = now.getMonth() + 1;
+                    let o1, o2;
+                    o1 = [(year - 1) + '-' + year];
+                    o2 = [year + '-' + (year + 1)];
+                    return (month < 9) ? o1 : o2
+                })()
             }, {
-                xtype: 'textfield',
-                name: 'mcur_term_name',
-                fieldLabel: '学期'
+                xtype: "combobox",
+                name: "mcur_term_name",
+                fieldLabel: "学期",
+                queryModel: 'local',
+                displayField: 'value',
+                valueField: 'value',
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['value'],
+                    data: [['第一学期'], ['第二学期']]
+                }),
+                value: (function() {
+                    let now = new Date();
+                    let month = now.getMonth() + 1;
+                    return (month < 9) ? '第一学期' : '第二学期'
+                })()
             }],
         
             gridConfig: {