Просмотр исходного кода

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

FANGLH 7 лет назад
Родитель
Сommit
75476c0b30

+ 1 - 1
frontend/wechat-web/package.json

@@ -40,7 +40,7 @@
     "not ie <= 11",
     "not op_mini all"
   ],
-  "homepage": "/smart-school",
+  "homepage": "",
   "devDependencies": {
     "babel-plugin-import": "^1.10.0",
     "circular-json": "^0.5.9",

+ 1 - 1
frontend/wechat-web/runtime/nginx/default.conf

@@ -9,7 +9,7 @@ server {
         index  index.html index.htm;
     }
 
-    #error_page  404              /404.html;
+    error_page  404              /index.html;
 
     # redirect server error pages to the static page /50x.html
     #

+ 9 - 7
frontend/wechat-web/src/configs/api.config.js

@@ -89,8 +89,6 @@ export const API = {
 
 
     //TODO 接口修改后的
-    // 获取抄送老师
-    getAllTeacher: _baseURL + '/wxSchool/user/getAllTeacher',
     //创建会议
     createMeeting: _baseURL + '/wxSchool/meeting/createMeeting',
     //会议列表
@@ -102,17 +100,21 @@ export const API = {
     //会议签到
     MEETING_SIGN: _baseURL + '/wxSchool/meeting/meetingSign',
     //删除会议
-    deleteMeeting:_baseURL + '/wxSchool/meeting/deleteMeeting',
+    deleteMeeting: _baseURL + '/wxSchool/meeting/deleteMeeting',
     //通过验证码修改手机号
     updatePhone: _baseURL + '/wxSchool/user/updatePhone',
     //成绩通知
     getScoreByStu: _baseURL + '/wxSchool/stuScore/getScoreByStu',
-    //获取家长和老师所有对象
-    getClazzByTeacherId:_baseURL + '/wxSchool/user/getClazzByTeacherId',
     //学生端  学生所在班级的课表  按星期的每天分map
-    curriculumListByTeacherId:_baseURL + '/wxSchool/clazzCurriculum/curriculumListByTeacherId',
+    curriculumListByTeacherId: _baseURL + '/wxSchool/clazzCurriculum/curriculumListByTeacherId',
     //创建校长信箱
-    PRINCIPAL_MAILBOX:_baseURL + '/wxSchool/principalMailbox/mailboxString',
+    PRINCIPAL_MAILBOX: _baseURL + '/wxSchool/principalMailbox/mailboxString',
+    //获取学生和老师所有对象
+    getClazzByTeacherId: _baseURL + '/wxSchool/user/getClazzByTeacherId',
+    // 获取抄送老师
+    getAllTeacher: _baseURL + '/wxSchool/user/getAllTeacher',
+    //获取家长
+    GET_ALL_PARENT: _baseURL + '/wxSchool/user/getParentsByTeacherId',
     //学生请假
     leaveCreate: _baseURL + "/wxSchool/oaLeave/leaveCreate",
     //家长端请假单列表

+ 1 - 1
frontend/wechat-web/src/configs/router.config.js

@@ -68,7 +68,7 @@ export default class RouteConfig extends Component {
 
     render() {
         return (
-            <Router basename="/smart-school">
+            <Router>
                 <div>
                     <Route exact path='/' render={() => (
                         <Redirect to='/bindMenu/app/'/>

+ 4 - 0
frontend/wechat-web/src/modules/album/ClassAlbum.jsx

@@ -64,6 +64,10 @@ class ClassAlbum extends Component {
         }
     }
 
+    componentWillUnmount() {
+        Toast.hide()
+    }
+
     render() {
         const {albumList, classList, classValue} = this.state
 

+ 46 - 62
frontend/wechat-web/src/modules/announce/AnnounceRelease.jsx

@@ -100,77 +100,61 @@ class AnnounceRelease extends Component {
     getOrganization = () => {
         Toast.loading('', 0)
 
-        fetchGet(API.USER_GETOBJECT, {
-            userId: this.props.userInfo.userId
+        fetchGet(API.getClazzByTeacherId, {
+            teacherId: this.props.userInfo.user.userFunId,
         }).then(response => {
             Toast.hide()
             const {targetData} = this.state
             targetData.length = 0
             if (response && response.data) {
-                const schoolArray = response.data.schools
-                const teacherArray = response.data.teachers
-
-                if (!isObjEmpty(teacherArray)) {
-                    const teacherData = []
-                    teacherArray.forEach((teacherObj, index) => {
-                        if (teacherObj) {
-                            teacherData.push({
-                                title: getStrValue(teacherObj, 'userName'),
-                                userId: getIntValue(teacherObj, 'userId'),
-                                userPhone: getStrValue(teacherObj, 'userPhone'),
-                                value: getStrValue(teacherObj, 'userName') + `-1-${index}`,
-                                key: `1-${index}`,
-                            })
-                        }
-                    })
-
-                    targetData.push({
-                        title: `全体老师`,
-                        value: `1`,
-                        key: `1`,
-                        children: teacherData,
-                    })
-                }
-
-                if (!isObjEmpty(schoolArray)) {
-                    const classData = []
-
-                    schoolArray.forEach((schoolObj, sIndex) => {
-                        if (schoolObj) {
-                            const parentArray = schoolObj.parents
-
-                            const parentData = []
-                            if (!isObjEmpty(parentArray)) {
-                                parentArray.forEach((parentObj, pIndex) => {
-                                    parentData.push({
-                                        title: getStrValue(parentObj, 'userName'),
-                                        userId: getIntValue(parentObj, 'userId'),
-                                        userPhone: getStrValue(parentObj, 'userPhone'),
-                                        value: getStrValue(parentObj, 'userName') + `-0-${sIndex}-${pIndex}`,
-                                        key: `0-${sIndex}-${pIndex}`,
-                                    })
-                                })
-
+                response.data.forEach((dataObj, data_index) => {
+                    const stusDOSArray = dataObj.studentDOS
+                    const teacherDOSArray = dataObj.teacherDOS
+                    if (!isObjEmpty(stusDOSArray)) {
+                        const classData = []
+                        stusDOSArray.forEach((stuObj, index) => {
+                            if (stuObj) {
                                 classData.push({
-                                    title: getStrValue(schoolObj, 'parentName') + getStrValue(schoolObj, 'schName'),
-                                    value: getStrValue(schoolObj, 'parentName') + getStrValue(schoolObj, 'schName') + `-0-${sIndex}`,
-                                    key: `0-${sIndex}`,
-                                    children: parentData,
+                                    title: getStrValue(stuObj, 'stuName'),
+                                    userId: getIntValue(stuObj, 'stuId'),
+                                    userPhone: getStrValue(stuObj, 'userPhone'),
+                                    value: `2-${data_index}-${index}-` + getStrValue(stuObj, 'stuName'),
+                                    key: `2-${data_index}-${index}`,
                                 })
                             }
-                        }
-                    })
-
-                    targetData.push({
-                        title: `全体家长`,
-                        value: `0`,
-                        key: `0`,
-                        children: classData,
-                    })
-                }
+                        })
+
+                        targetData.push({
+                            title: dataObj.gradeName + dataObj.clazzName + '全体学生',
+                            value: `2-${data_index}-` + dataObj.gradeName + dataObj.clazzName + '全体学生',
+                            key: `2-${data_index}`,
+                            children: classData,
+                        })
+                    }
+
+                    if (!isObjEmpty(teacherDOSArray)) {
+                        const teacherData = []
+                        teacherDOSArray.forEach((teacherObj, index) => {
+                            if (teacherObj) {
+                                teacherData.push({
+                                    title: getStrValue(teacherObj, 'teacherName'),
+                                    userId: getIntValue(teacherObj, 'teacherId'),
+                                    userPhone: getStrValue(teacherObj, 'userPhone'),
+                                    value: `0-${data_index}-${index}-` + getStrValue(teacherObj, 'teacherName'),
+                                    key: `0-${data_index}-${index}`,
+                                })
+                            }
+                        })
+
+                        targetData.push({
+                            title: dataObj.gradeName + dataObj.clazzName + '全体老师',
+                            value: `0-${data_index}-` + dataObj.gradeName + dataObj.clazzName + '全体老师',
+                            key: `0-${data_index}`,
+                            children: teacherData,
+                        })
+                    }
+                })
             }
-
-            console.log('targetData', targetData)
             this.setState({
                 targetData,
             })

+ 24 - 25
frontend/wechat-web/src/modules/hiPages/send-vote/SendVote.js

@@ -35,33 +35,33 @@ class SendVote extends Component {
         Toast.loading('', 0)
 
         fetchGet(API.getClazzByTeacherId, {
-            teacherId: this.props.userInfo.userId,
+            teacherId: this.props.userInfo.user.userFunId,
         }).then(response => {
             Toast.hide()
             const {targetData} = this.state
             targetData.length = 0
             if (response && response.data) {
-                response.data.forEach((dataObj,data_index) =>{
-                    const parentsDOSArray = dataObj.parentsDOS
+                response.data.forEach((dataObj, data_index) => {
+                    const stusDOSArray = dataObj.studentDOS
                     const teacherDOSArray = dataObj.teacherDOS
-                    if (!isObjEmpty(parentsDOSArray)) {
+                    if (!isObjEmpty(stusDOSArray)) {
                         const classData = []
-                        parentsDOSArray.forEach((parentObj, index) => {
-                            if (parentObj) {
+                        stusDOSArray.forEach((stuObj, index) => {
+                            if (stuObj) {
                                 classData.push({
-                                    title: getStrValue(parentObj, 'parentsName'),
-                                    userId: getIntValue(parentObj, 'parentId'),
-                                    userPhone: getStrValue(parentObj, 'userPhone'),
-                                    value: getStrValue(parentObj, 'parentsName') + `-${data_index}-0-${index}`,
-                                    key: `${data_index}-0-${index}`,
+                                    title: getStrValue(stuObj, 'stuName'),
+                                    userId: getIntValue(stuObj, 'stuId'),
+                                    userPhone: getStrValue(stuObj, 'userPhone'),
+                                    value: `2-${data_index}-${index}-` + getStrValue(stuObj, 'stuName'),
+                                    key: `2-${data_index}-${index}`,
                                 })
                             }
                         })
 
                         targetData.push({
-                            title: dataObj.gradeName+dataObj.clazzName + '全部家长',
-                            value: `${data_index}-0`,
-                            key: `${data_index}-0`,
+                            title: dataObj.gradeName + dataObj.clazzName + '全体学生',
+                            value: `2-${data_index}-` + dataObj.gradeName + dataObj.clazzName + '全体学生',
+                            key: `2-${data_index}`,
                             children: classData,
                         })
                     }
@@ -74,22 +74,21 @@ class SendVote extends Component {
                                     title: getStrValue(teacherObj, 'teacherName'),
                                     userId: getIntValue(teacherObj, 'teacherId'),
                                     userPhone: getStrValue(teacherObj, 'userPhone'),
-                                    value: getStrValue(teacherObj, 'teacherName') + `${data_index}-1-${index}`,
-                                    key: `${data_index}-1-${index}`,
+                                    value: `0-${data_index}-${index}-` + getStrValue(teacherObj, 'teacherName'),
+                                    key: `0-${data_index}-${index}`,
                                 })
                             }
                         })
 
                         targetData.push({
-                            title: dataObj.gradeName+dataObj.clazzName + '全部老师',
-                            value: `${data_index}-1`,
-                            key: `${data_index}-1`,
+                            title: dataObj.gradeName + dataObj.clazzName + '全体老师',
+                            value: `0-${data_index}-` + dataObj.gradeName + dataObj.clazzName + '全体老师',
+                            key: `0-${data_index}`,
                             children: teacherData,
                         })
                     }
                 })
             }
-            console.log('targetData', targetData)
             this.setState({
                 targetData,
             })
@@ -260,8 +259,8 @@ class SendVote extends Component {
             Toast.fail('请填写投票主题...', 1)
             return
         }
-        for(let i=0;i<this.state.voteOptionss.length;i++){
-            if(this.state.voteOptionss[i] == null ||  this.state.voteOptionss[i].trim().length == 0 ){
+        for (let i = 0; i < this.state.voteOptionss.length; i++) {
+            if (this.state.voteOptionss[i] == null || this.state.voteOptionss[i].trim().length == 0) {
                 Toast.fail('存在选项内容为空...')
                 return
             }
@@ -271,7 +270,7 @@ class SendVote extends Component {
             Toast.fail('请选择投票类型...')
             return
         }
-        if (this.state.endValue == null ) {
+        if (this.state.endValue == null) {
             Toast.fail('请选择正确结束时间...')
             return
         }
@@ -302,7 +301,7 @@ class SendVote extends Component {
 
         var params = {
             topicName: this.state.voteTitle,
-            topicType:this.state.voteType[0],
+            topicType: this.state.voteType[0],
             topicFiles: approveFiles,
             creator: this.props.userInfo.userId,
 
@@ -311,7 +310,7 @@ class SendVote extends Component {
             voteName: this.state.voteTitle,
             voter: JSON.stringify(this.state.votePerson),
             voteEndDate: moment(this.state.endValue).format('YYYY-MM-DD HH:mm:ss'),
-            voteType:1,
+            voteType: 1,
             optionName: [
                 {
                     optionStatus: 1,

+ 25 - 65
frontend/wechat-web/src/modules/homework/ReleaseAssignmentPage.js

@@ -188,7 +188,7 @@ class ReleaseAssignmentPage extends React.Component {
         }).then((response) => {
             Toast.hide();
             if (response.success) {
-                Toast.success("发布成功!",1)
+                Toast.success("发布成功!", 1)
                 this.initPageData()
 
                 this.backTask = setTimeout(() => {
@@ -305,80 +305,40 @@ class ReleaseAssignmentPage extends React.Component {
     getOrganization = () => {
         Toast.loading('', 0)
 
-        fetchGet(API.USER_GETOBJECT, {
-            userId: this.props.userInfo.userId,
-            stuId: this.props.userInfo.userId
+        fetchGet(API.getClazzByTeacherId, {
+            teacherId: this.props.userInfo.user.userFunId,
         }).then(response => {
             Toast.hide()
             const {targetData} = this.state
             targetData.length = 0
             if (response && response.data) {
-                const schoolArray = response.data.schools
-                const teacherArray = response.data.teachers
-
-                if (!isObjEmpty(teacherArray)) {
-                    const teacherData = []
-                    teacherArray.forEach((teacherObj, index) => {
-                        if (teacherObj) {
-                            teacherData.push({
-                                title: getStrValue(teacherObj, 'userName'),
-                                userId: getIntValue(teacherObj, 'userId'),
-                                userPhone: getStrValue(teacherObj, 'userPhone'),
-                                value: getStrValue(teacherObj, 'userName') + `-1-${index}`,
-                                key: `1-${index}`,
-                            })
-                        }
-                    })
-
-                    targetData.push({
-                        title: `全体老师`,
-                        value: `1`,
-                        key: `1`,
-                        children: teacherData,
-                    })
-                }
-
-                if (!isObjEmpty(schoolArray)) {
-                    const classData = []
-
-                    schoolArray.forEach((schoolObj, sIndex) => {
-                        if (schoolObj) {
-                            const parentArray = schoolObj.parents
-
-                            const parentData = []
-                            if (!isObjEmpty(parentArray)) {
-                                parentArray.forEach((parentObj, pIndex) => {
-                                    parentData.push({
-                                        title: getStrValue(parentObj, 'userName'),
-                                        userId: getIntValue(parentObj, 'userId'),
-                                        userPhone: getStrValue(parentObj, 'userPhone'),
-                                        value: getStrValue(parentObj, 'userName') + `-0-${sIndex}-${pIndex}`,
-                                        key: `0-${sIndex}-${pIndex}`,
-                                    })
-                                })
-
+                response.data.forEach((dataObj, data_index) => {
+                    const stusDOSArray = dataObj.studentDOS
+                    if (!isObjEmpty(stusDOSArray)) {
+                        const classData = []
+                        stusDOSArray.forEach((stuObj, index) => {
+                            if (stuObj) {
                                 classData.push({
-                                    title: getStrValue(schoolObj, 'parentName') + getStrValue(schoolObj, 'schName'),
-                                    value: getStrValue(schoolObj, 'parentName') + getStrValue(schoolObj, 'schName') + `-0-${sIndex}`,
-                                    key: `0-${sIndex}`,
-                                    children: parentData,
+                                    title: getStrValue(stuObj, 'stuName'),
+                                    userId: getIntValue(stuObj, 'stuId'),
+                                    userPhone: getStrValue(stuObj, 'userPhone'),
+                                    value: `2-${data_index}-${index}-` + getStrValue(stuObj, 'stuName'),
+                                    key: `2-${data_index}-${index}`,
                                 })
                             }
-                        }
-                    })
-
-                    targetData.push({
-                        title: `全体家长`,
-                        value: `0`,
-                        key: `0`,
-                        children: classData,
-                    })
-                }
+                        })
+
+                        targetData.push({
+                            title: dataObj.gradeName + dataObj.clazzName + '全体学生',
+                            value: `2-${data_index}` + dataObj.gradeName + dataObj.clazzName + '全体学生',
+                            key: `2-${data_index}`,
+                            children: classData,
+                        })
+                    }
+                })
             }
-
-            console.log('targetData', targetData)
             this.setState({
-                targetData
+                targetData,
             })
         }).catch(error => {
             Toast.hide()

+ 4 - 4
frontend/wechat-web/src/modules/message/SystemMessage.jsx

@@ -10,7 +10,7 @@ import 'css/message.css'
 import SystemMsgItem from 'components/SystemMsgItem'
 import {Toast} from 'antd-mobile'
 import LoadingMore from 'components/LoadingMore'
-import {fetchGet} from "../../utils/fetchRequest";
+import {fetchGet, fetchPost} from "../../utils/fetchRequest";
 import {API} from "../../configs/api.config";
 import {getStrValue, isObjEmpty} from "../../utils/common";
 
@@ -59,7 +59,7 @@ export default class SystemMessage extends Component {
         if (!this.dataLoading) {
             const {systemMsgs} = this.state
 
-            fetchGet(API.SYSTEM_MESSAGE, {
+            fetchPost(API.SYSTEM_MESSAGE, {
                 notifyType: 1,
                 pageIndex: index,
                 pageSize: mPageSize
@@ -72,8 +72,8 @@ export default class SystemMessage extends Component {
                     if (!isObjEmpty(dataArray) && dataArray != []) {
                         dataArray.forEach((dataObject, index) => {
                             systemMsgs.push({
-                                time: getStrValue(dataObject, 'creat_date'),
-                                content: getStrValue(dataObject, 'notify_details')
+                                time: getStrValue(dataObject, 'createDate'),
+                                content: getStrValue(dataObject, 'notifyDetails')
                             })
                         })
                     } else {

+ 3 - 3
frontend/wechat-web/src/modules/message/UseHelp.jsx

@@ -60,7 +60,7 @@ export default class UseHelp extends Component {
             const {helpList} = this.state
             this.dataLoading = true
 
-            fetchGet(API.SYSTEM_MESSAGE, {
+            fetchPost(API.SYSTEM_MESSAGE, {
                 notifyType: 2,
                 pageIndex: index,
                 pageSize: mPageSize
@@ -72,8 +72,8 @@ export default class UseHelp extends Component {
                     if (!isObjEmpty(dataArray) && dataArray != []) {
                         dataArray.forEach((dataObject, index) => {
                             helpList.push({
-                                title: getStrValue(dataObject, 'notify_name'),
-                                content: getStrValue(dataObject, 'notify_details')
+                                title: getStrValue(dataObject, 'notifyTitle'),
+                                content: getStrValue(dataObject, 'notifyDetails')
                             })
                         })
                     } else {

+ 2 - 2
frontend/wechat-web/src/modules/vote/VoteListParent.jsx

@@ -6,7 +6,7 @@
 import React, {Component} from 'react'
 import {connect} from 'react-redux'
 import ReactDOM from 'react-dom'
-import {fetchGet} from "../../utils/fetchRequest";
+import {fetchGet, fetchPost} from "../../utils/fetchRequest";
 import {API} from "../../configs/api.config";
 import RefreshLayout from "../../components/RefreshLayout";
 import {Toast} from 'antd-mobile'
@@ -91,7 +91,7 @@ class VoteListParent extends Component {
             voteList.length = 0
         }
 
-        fetchGet(API.voteList, {
+        fetchPost(API.voteList, {
             userId: this.props.userInfo.user.userFunId,
             pageIndex: mPageIndex,
             pageSize: mPageSize,

+ 2 - 2
frontend/wechat-web/src/modules/vote/VoteListTeacher.jsx

@@ -161,7 +161,7 @@ class VoteListTeacher extends Component {
             releaseList.length = 0
         }
 
-        fetchGet(API.voteListTeacher, {
+        fetchPost(API.voteListTeacher, {
             userId: this.props.userInfo.user.userFunId,
             voteType: '1',
             pageIndex: mReleaseIndex,
@@ -231,7 +231,7 @@ class VoteListTeacher extends Component {
             receiveList.length = 0
         }
 
-        fetchGet(API.voteListTeacher, {
+        fetchPost(API.voteListTeacher, {
             userId: this.props.userInfo.user.userFunId,
             voteType: '1',
             pageIndex: mReceiveIndex,