|
@@ -3,7 +3,12 @@ import { GET_UUIONID_TOKEN,GET_TOKEN,GetInfo,InfoWatch,InfoWatchDay,
|
|
|
TeacherAllot,UnallotHomeworkList,GetTeacherDetail,
|
|
|
GetStudentDetail,GetManagerDetail,Downgrade,SuperManagerList,
|
|
|
SuperApplyTeacherList,ApplyOperate,GetTeacherSalaryList,DealCorrectTeacher,
|
|
|
+<<<<<<< HEAD
|
|
|
GetAllotManagerList,AllotTeacherToManager,HomeworkRecoveryList,GetRemindCount,errorWarning,errorDetail,logout
|
|
|
+=======
|
|
|
+ GetAllotManagerList,AllotTeacherToManager,HomeworkRecoveryList,errorWarning,errorDetail,logout,
|
|
|
+ CheckHomeworkStatus,FindSubjectCharts
|
|
|
+>>>>>>> 5309336df77a73102e1ff47b84ac455ae67d8d75
|
|
|
} from '@/api'
|
|
|
import { APPOR_BASE_URL } from '@/ImgConfig'
|
|
|
import { getToken, setToken, removeToken } from '@/utils/auth'
|
|
@@ -39,7 +44,15 @@ const user = {
|
|
|
pictureIndex:0,
|
|
|
InfoTeacherstatues:"",
|
|
|
GetTeacherstatues:"",
|
|
|
+<<<<<<< HEAD
|
|
|
getRemindCount:"",
|
|
|
+=======
|
|
|
+ ApporingTeacherstatues:"",
|
|
|
+ currtHomeworkStatus:"",
|
|
|
+ FindSubjectCharts:[],
|
|
|
+ FindSubjectmathCharts:[],
|
|
|
+ FindSubjectEngCharts:[]
|
|
|
+>>>>>>> 5309336df77a73102e1ff47b84ac455ae67d8d75
|
|
|
},
|
|
|
|
|
|
mutations: {
|
|
@@ -118,6 +131,9 @@ const user = {
|
|
|
SET_GET_SUCCESS_TEACHERINFO_STUS:(state,InfoTeacherstatues) => {
|
|
|
state.InfoTeacherstatues = InfoTeacherstatues
|
|
|
},
|
|
|
+ SET_APPORING_STATUS:(state,ApporingTeacherstatues) => {
|
|
|
+ state.ApporingTeacherstatues = ApporingTeacherstatues
|
|
|
+ },
|
|
|
SET_GET_SUCCESS_MANAGER_DETAIL:(state,GetTeacherstatues) => {
|
|
|
state.GetTeacherstatues = GetTeacherstatues
|
|
|
},
|
|
@@ -135,6 +151,18 @@ const user = {
|
|
|
console.log(pictureIndex)
|
|
|
state.pictureIndex = pictureIndex
|
|
|
},
|
|
|
+ SET_CURRT_HOMEWORK_STATUS:(state,currtHomeworkStatus) => {
|
|
|
+ state.currtHomeworkStatus = currtHomeworkStatus
|
|
|
+ },
|
|
|
+ FIND_SUBJECT_CHARTS:(state,FindSubjectCharts) => {
|
|
|
+ state.FindSubjectCharts = FindSubjectCharts
|
|
|
+ },
|
|
|
+ FIND_SUBJECTMATH_CHARTS:(state,FindSubjectmathCharts) => {
|
|
|
+ state.FindSubjectmathCharts = FindSubjectmathCharts
|
|
|
+ },
|
|
|
+ FIND_SUBJECTENG_CHARTS:(state,FindSubjectEngCharts) => {
|
|
|
+ state.FindSubjectEngCharts = FindSubjectEngCharts
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
actions: {
|
|
@@ -150,17 +178,19 @@ const user = {
|
|
|
commit('SET_TOKEN', data);
|
|
|
localStorage.setItem("accessToken",data.accessToken)
|
|
|
dispatch('GetInfo').then(res => { // 拉取用户信息
|
|
|
- // debugger
|
|
|
const roles = res.data.role
|
|
|
const isBanned = res.data.isBanned
|
|
|
const userId = res.data.userId
|
|
|
localStorage.setItem("userId",userId)
|
|
|
if (isBanned == 0) {
|
|
|
if (roles == 0) {
|
|
|
- Message.error('无用户角色')
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
+ window.open(APPOR_BASE_URL + '?unionid=' + unionid);
|
|
|
+ Message.error('无用户角色,请先注册')
|
|
|
}
|
|
|
if (roles == 1) {
|
|
|
Message.success('在线批改老师角色登录成功')
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
window.open(APPOR_BASE_URL + '?unionid=' + unionid);
|
|
|
}
|
|
|
if (roles == 2) {
|
|
@@ -174,10 +204,12 @@ const user = {
|
|
|
// router.push({path: '/super', replace: true})
|
|
|
}
|
|
|
} if (isBanned == 1) {
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
Message.error('您已被封号')
|
|
|
router.push("/");
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
Message.error('用户信息验证失败,请重新登录')
|
|
|
})
|
|
|
} else {
|
|
@@ -208,10 +240,13 @@ const user = {
|
|
|
localStorage.setItem("userId",userId)
|
|
|
if (isBanned == 0) {
|
|
|
if (roles == 0) {
|
|
|
- Message.error('无用户角色')
|
|
|
+ Message.error('无用户角色,请先注册')
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
+ window.open(APPOR_BASE_URL + '?unionid=' + unionid);
|
|
|
}
|
|
|
if (roles == 1) {
|
|
|
Message.success('在线批改老师角色登录成功')
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
window.open(APPOR_BASE_URL + '?unionid=' + unionid);
|
|
|
}
|
|
|
if (roles == 2) {
|
|
@@ -227,10 +262,12 @@ const user = {
|
|
|
|
|
|
}
|
|
|
} if (isBanned == 1) {
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
Message.error('您已被封号')
|
|
|
router.push("/");
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
+ localStorage.removeItem("accessToken");
|
|
|
Message.error('用户信息验证失败,请重新登录')
|
|
|
})
|
|
|
} else {
|
|
@@ -302,13 +339,51 @@ const user = {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // 质检当前作业状态
|
|
|
+ CheckCurrHomeworkStatus({ commit, state }, data) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ axios.post(CheckHomeworkStatus, data).then(response => {
|
|
|
+ const data = response.data || {}
|
|
|
+ if (response.code === '999'){
|
|
|
+ if (data.status == 3){
|
|
|
+ commit('SET_CURRT_HOMEWORK_STATUS',new Date());
|
|
|
+ resolve(response)
|
|
|
+ }
|
|
|
+ if (data.status == 1){
|
|
|
+ Message.error("当前作业还未批改,请手动刷新当前作业列表!")
|
|
|
+ resolve(response)
|
|
|
+ }
|
|
|
+ if (data.status == 2){
|
|
|
+ Message.error("当前作业正在批改中,请手动刷新当前作业列表!")
|
|
|
+ resolve(response)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (response.code === '000'){
|
|
|
+ Message.error(response.msg)
|
|
|
+ resolve(response)
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ reject(error)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
// 查看可分配老师列表
|
|
|
TeacherAllotList({ commit, state }, data) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
axios.post(TeacherAllotList, data).then(response => {
|
|
|
const data = response.data || {}
|
|
|
- commit('SET_TEACHER_ALLOTIST', data);
|
|
|
- resolve(response)
|
|
|
+ if (response.code === '999'){
|
|
|
+ commit('SET_TEACHER_ALLOTIST', data);
|
|
|
+ resolve(response)
|
|
|
+ }
|
|
|
+ if (response.code === '000'){
|
|
|
+ Message.error(response.msg)
|
|
|
+ commit('SET_APPORING_STATUS',new Date());
|
|
|
+ resolve(response)
|
|
|
+ }
|
|
|
+ if (response.code === "") {
|
|
|
+ Message.error("出了点小问题,噢噢。。。")
|
|
|
+ }
|
|
|
}).catch(error => {
|
|
|
reject(error)
|
|
|
})
|
|
@@ -342,6 +417,21 @@ const user = {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // 管理员查看科目报表数据
|
|
|
+ FindSubjectChartsLists({ commit, state }, data) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ axios.post(FindSubjectCharts, data).then((response = {}) => {
|
|
|
+ const data = response.data.chartList || {}
|
|
|
+ if (response.code === "999"){
|
|
|
+ commit('FIND_SUBJECT_CHARTS', data[0]);
|
|
|
+ commit('FIND_SUBJECTMATH_CHARTS', data[1]);
|
|
|
+ commit('FIND_SUBJECTENG_CHARTS', data[2]);
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ reject(error)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
// 未批改作业列表
|
|
|
UnallotHomeworkList({ commit, state }, data) {
|
|
|
return new Promise((resolve, reject) => {
|
|
@@ -406,6 +496,11 @@ const user = {
|
|
|
commit('SET_GET_SUCCESS_CODE',new Date());
|
|
|
// Message.success('分配成功')
|
|
|
}
|
|
|
+ if (response.code === '000'){
|
|
|
+ Message.error(response.msg)
|
|
|
+ commit('SET_APPORING_STATUS',new Date());
|
|
|
+ resolve(response)
|
|
|
+ }
|
|
|
}).catch(error => {
|
|
|
reject(error)
|
|
|
})
|