Browse Source

解决若干bug

zhuth 6 years ago
parent
commit
dcad74890d

+ 3 - 0
frontend/pc-web/app/model/basic/StudentParents.js

@@ -54,5 +54,8 @@ Ext.define('school.model.basic.StudentParents', {
     }, {
         name: 'parent_rel',
         type: 'string'
+    }, {
+        name: 'ps_relation',
+        type: 'string'
     }],
 });

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

@@ -74,7 +74,7 @@ Ext.define('school.view.interaction.mailbox.List', {
                 name: 'mb_ignore',
                 displayField: 'name',
                 valueField: 'value',
-                editable: false,
+                editable: true,
                 value: '0',
                 store: Ext.create('Ext.data.ArrayStore', {
                     fields: ['name', 'value'],
@@ -112,9 +112,6 @@ Ext.define('school.view.interaction.mailbox.List', {
                     xtype: 'button',
                     text: '取消忽略',
                     handler: 'onUnIgnoreClick'
-                }, {
-                    xtype: 'button',
-                    text: '删除'
                 }],
                 columns : [{
                     text: 'ID',

+ 2 - 2
frontend/pc-web/app/view/Interaction/mailbox/ListController.js

@@ -119,7 +119,7 @@ Ext.define('school.view.interaction.mailbox.ListController', {
         });
 
         if(data.length == 0) {
-            school.util.BaseUtil.showErrorToast('请先勾选需要删除的记录');
+            school.util.BaseUtil.showErrorToast('请先勾选需要忽略的记录');
             return;
         }
 
@@ -165,7 +165,7 @@ Ext.define('school.view.interaction.mailbox.ListController', {
         });
 
         if(data.length == 0) {
-            school.util.BaseUtil.showErrorToast('请先勾选需要删除的记录');
+            school.util.BaseUtil.showErrorToast('请先勾选需要取消忽略的记录');
             return;
         }
 

+ 0 - 85
frontend/pc-web/app/view/Interaction/mailbox/MailboxController.js

@@ -1,85 +0,0 @@
-Ext.define('school.view.Interaction.mailbox.MailboxController', {
-    extend: 'Ext.app.ViewController',
-    alias: 'controller.interaction-mailbox-mailbox',
-    // 回复
-    ReplyClick: function () {
-        Ext.MessageBox.show({
-            title: '回复处理',
-            msg: '回复对象:'+rec.data.code,
-            width:500,
-            height:600,
-            buttons: Ext.MessageBox.OKCANCEL,
-            multiline: true,
-            scope: this,
-            fn: this.showResultText,//处理输入的文字
-        });
-    },
-    // 导出
-    exportClick: function () {
-        Ext.Msg.alert('导出', '我是导出');
-    },
-    //删除
-    deleteClick: function (o) {
-        let gird = o.ownerCt.ownerCt;
-        let data = gird.getSelectionModel().getSelection();
-        if(data.length == 0){
-            Ext.Msg.alert("提示","您最少要选择一条数据");
-        }else{
-            //1.先得到ID的数据(name)
-            let st = gird.getStore();
-            let ids = [];
-            Ext.Array.each(data,function(record){
-                ids.push(record.get('name'));
-            })
-            Ext.MessageBox.confirm('删除邮件','你确定要删除吗?',function(btn){
-                if (btn == 'yes') {
-                    //2.后台操作(delet)
-                    // Ext.Ajax.request({
-                    //     url:'/extjs/extjs!deleteData.action',
-                    //     params:{ids:ids.join(",")},
-                    //     method:'POST',
-                    //     timeout:2000,
-                    //     success:function(response,opts){
-                    //         Ext.Array.each(data,function(record){
-                    //             st.remove(record);
-                    //         })
-                    //     }
-                    // })
-                    //3.前端操作DOM进行删除(ExtJs)
-                    Ext.Array.each(data,function(record){
-                        st.remove(record);
-                    })
-                }
-            });
-        }
-    },
-    // 批量回复
-    batchClick: function (o) {
-        let gird = o.ownerCt.ownerCt;
-        let items = gird.getStore().data.items;//所有的内容
-        let batch = [];
-        for (let i = 0; i < items.length; i++) {
-            if (items[i].data.Handle) {
-                batch.push(items[i].data.code)
-                Ext.MessageBox.show({
-                    title: '回复处理',
-                    msg: '回复对象:'+batch.join(','),
-                    width:500,
-                    height:600,
-                    buttons: Ext.MessageBox.OKCANCEL,
-                    multiline: true,
-                    scope: this,
-                    fn: this.showResultText,//回调函数
-                });
-            }
-        }
-    },
-    // 回调函数
-    showResultText: function (btn,text) {
-        if (btn == 'ok') {
-            alert('点击的按钮是:'+btn+'内容是:'+text);
-        } else {
-            return
-        }
-    },
-});

+ 0 - 110
frontend/pc-web/app/view/Interaction/mailbox/mailbox.js

@@ -1,110 +0,0 @@
-/**
- * 校长信箱
- */
-Ext.define('school.view.interaction.mailbox.Mailbox', {
-    extend: 'Ext.grid.Panel',
-    xtype: 'interaction-mailbox-mailbox',
-    // dataUrl: '/api/interact/timetable/list',
-
-    controller: 'interaction-mailbox-mailbox',
-
-    //字段属性
-    _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',
-    initId: 0,
-    initComponent: function() {
-        Ext.apply(this, {
-            // title: '校长信箱',
-            store: Ext.create('Ext.data.Store', {
-                fields:['code', 'content', 'Enclosure', 'time', 'name', 'Handle'],
-                data:[
-                    {code:"U001", content:"孩子作业太少了,回家每天玩王者荣耀,希望学校老师布置作业多一点,让我孩子忙起来", Enclosure:'无', time:"01/10/2004 16:00", name:'张三', Handle:true},
-                    {code:"U002", content:"学校课本费收入明细未公开,希望课本费明细能够向我们家长公开", Enclosure:'有', time:"01/10/2004 16:00", name:'张三', Handle:false},
-                    {code:"U003", content:"觉得十分激烈的交锋了", Enclosure:'无', time:"01/10/2004 16:00", name:'张三', Handle:true},
-                ]
-            }),
-            columns : [
-                {text: '编号',dataIndex: 'code', flex: 0.1}, 
-                {text: '内容',dataIndex: 'content', flex: 0.3},
-                {text: '附件',dataIndex: 'Enclosure', flex: 0.1}, 
-                {text: '日期',dataIndex: 'time',xtype: 'datecolumn',format:'Y-m-d H:i', flex: 0.2}, 
-                {text: '提出人',dataIndex: 'name', flex: 0.1}, 
-                {text: '处理', flex: 0.2, align:'center', dataIndex: 'Handle',
-                    renderer: function(val,meta,rec) {
-                        // 为元素生成唯一id
-                        var id = Ext.id();
-                        if (!rec.data.Handle) {
-                            return Ext.String.format('<div>已回复</div>');
-                        } else {
-                            Ext.defer(function() {
-                                Ext.widget('button', {
-                                    renderTo: id,
-                                    text: '回复',
-                                    // handler: 'ReplyClick'//点击回复事件
-                                    handler: function () {//点击回复事件
-                                        Ext.MessageBox.show({
-                                            title: '回复处理',
-                                            msg: '回复对象:'+rec.data.code,
-                                            width:500,
-                                            height:600,
-                                            buttons: Ext.MessageBox.OKCANCEL,
-                                            multiline: true,
-                                            scope: this,
-                                            fn: function (btn,text) {//回调函数
-                                                if (btn == 'ok') {
-                                                    alert('点击的按钮是:'+btn+'内容是:'+text);
-                                                } else {
-                                                    return
-                                                }
-                                            },
-                                        });
-                                    } 
-                                });
-                            }, 50);
-                            return Ext.String.format('<div id="{0}"></div>', id);
-                        }
-                    }
-                },
-            ],
-            listeners: {// 每一行添加点击事件
-                'rowclick': function(grid, rowIndex, e) {
-                    let data = rowIndex.data//获取点击行的数据
-                    // console.log(data);
-                },
-            },
-            tbar: ['->',{
-                xtype: 'button',
-                text: '导出',
-                handler: 'exportClick'
-            }, {
-                xtype: 'button',
-                text: '删除',
-                handler: 'deleteClick'
-            }, {
-                xtype: 'button',
-                text: '批量回复',
-                handler: 'batchClick'
-            }],
-            multiSelect:true,//运行多选,默认是单选
-            dockedItems :[{//分页组件
-				xtype:'pagingtoolbar',//分页组件 
-				store:Ext.data.StoreManager.lookup('s_user'),//分页组件也需要获取到数据
-				dock:'bottom',//定位到底部
-				displayInfo:true//是否展示信息
-			}],
-        });
-        this.callParent();
-    },
-})

+ 13 - 2
frontend/pc-web/app/view/basic/class/ClassDetail.js

@@ -124,16 +124,26 @@ Ext.define('school.view.basic.class.ClassDetail', {
                 }, {
                     text: '学科id',
                     dataIndex: 'subject_id',
+                    hidden: true,
                     editor: {
                         xtype: 'textfield'
                     }
+                    /**
+                     * TODO 未写入id
+                     */
                 }, {
                     text: '学科',
                     dataIndex: 'subject_name',
-                    xtype: 'subjectcolumn'
+                    xtype: 'subjectcolumn',
+                    listeners: {
+                        select: function(column, combo, record, e) {
+                            column.up('grid').selection.set('subject_id', record.get('subject_id'));
+                        }
+                    }
                 }, {
                     text: '任课教师id',
                     dataIndex: 'teacher_id',
+                    hidden: true,
                     editor: {
                         xtype: 'textfield'
                     }
@@ -150,7 +160,8 @@ Ext.define('school.view.basic.class.ClassDetail', {
                             field:'teacher_name',width:150
                         }],
                         dbfinds:[{
-                            from:'teacher_name',to:'teacher_name'
+                            from: 'teacher_name', to: 'teacher_name',
+                            from: 'teacher_id', to: 'teacher_id'
                         }],
                         defaultCondition: "1=1",
                         dbSearchFields:[{

+ 2 - 1
frontend/pc-web/app/view/core/form/field/FileField.js

@@ -47,7 +47,7 @@ Ext.define('school.view.core.form.field.FileField', {
 	        },
 			listeners: {
 				change: function(field){
-					if(field.value != null){
+					if(!!field.value){
 						field.ownerCt.ownerCt.upload(field.ownerCt, field);
 					}
 				}
@@ -172,6 +172,7 @@ Ext.define('school.view.core.form.field.FileField', {
 				fieldStyle: 'background:#E0EEEE;'
 			}));
 		});
+		me.dirty = false;
 	},
 	
 	checkUploadAmount:function(form){

+ 25 - 13
frontend/pc-web/app/view/core/grid/column/SubjectColumn.js

@@ -5,19 +5,31 @@ Ext.define('school.view.core.grid.column.SubjectColumn', {
     extend: 'Ext.grid.column.Column',
     xtype: 'subjectcolumn',
 
-    editor: {
-        xtype: 'subjectcombo',
-        fieldLabel: null
-    },
-    renderer: function(v, m , r) {
-        let store = m.column.getEditor().store;
-        let idx = store.find('subject_id', v);
+    initComponent: function() {
+        var me = this;
+        Ext.apply(me, {
+            editor: {
+                xtype: 'subjectcombo',
+                fieldLabel: null,
+                listeners: {
+                    select: function(combo, r, e) {
+                        me.fireEvent('select', me, combo, r, e);
+                    }
+                }
+            },
+            renderer: function(v, m , r) {
+                let store = m.column.getEditor().store;
+                let idx = store.find('subject_id', v);
+        
+                if(idx != -1) {
+                    let subject = store.getAt(idx);
+                    return subject.get('subject_name');
+                }else {
+                    return null
+                }
+            }
+        });
 
-        if(idx != -1) {
-            let subject = store.getAt(idx);
-            return subject.get('subject_name');
-        }else {
-            return null
-        }
+        me.callParent(arguments);
     }
 });

+ 5 - 0
frontend/pc-web/overrides/form/field/TextField.js

@@ -0,0 +1,5 @@
+Ext.define('school.override.form.field.TextField', {
+    override: 'Ext.form.field.Text',
+    maxLength: 50
+
+});