Commit ee6e762832d1ccd2a0812e97fbbfa9b157e2495f
1 parent
b769660c
备题组卷借口数据对接调整
Showing
20 changed files
with
625 additions
and
540 deletions
src/api/apis/answerSheet.js
| ... | ... | @@ -4,9 +4,17 @@ import answerSheet from "../urls/answerSheet" |
| 4 | 4 | |
| 5 | 5 | export default { |
| 6 | 6 | // 答题卡列表 |
| 7 | - fetchAnswerList(data) { | |
| 7 | + fetchPaperList(data) { | |
| 8 | 8 | return service({ |
| 9 | - url: answerSheet.answerList, | |
| 9 | + url: answerSheet.paperList, | |
| 10 | + method: 'POST', | |
| 11 | + data | |
| 12 | + }) | |
| 13 | + }, | |
| 14 | + // 答题卡详情 | |
| 15 | + fetchPaperDetail(data) { | |
| 16 | + return service({ | |
| 17 | + url: answerSheet.paperDetail, | |
| 10 | 18 | method: 'POST', |
| 11 | 19 | data |
| 12 | 20 | }) |
| ... | ... | @@ -44,41 +52,33 @@ export default { |
| 44 | 52 | }) |
| 45 | 53 | }, |
| 46 | 54 | // 添加测验类型 |
| 47 | - addAnswerTypeName(data) { | |
| 55 | + addPaperType(data) { | |
| 48 | 56 | return service({ |
| 49 | - url: answerSheet.addAnswerTypeName, | |
| 57 | + url: answerSheet.addPaperType, | |
| 50 | 58 | method: 'POST', |
| 51 | 59 | data |
| 52 | 60 | }) |
| 53 | 61 | }, |
| 54 | 62 | // 保存答题卡 |
| 55 | - saveAnswerSheet(data) { | |
| 63 | + addPaper(data) { | |
| 56 | 64 | return service({ |
| 57 | - url: answerSheet.saveAnswerSheet, | |
| 65 | + url: answerSheet.addPaper, | |
| 58 | 66 | method: 'POST', |
| 59 | 67 | data |
| 60 | 68 | }) |
| 61 | 69 | }, |
| 62 | 70 | // 删除答题卡 |
| 63 | - removeAnswerSheet(data) { | |
| 64 | - return service({ | |
| 65 | - url: answerSheet.removeAnswerSheet, | |
| 66 | - method: 'POST', | |
| 67 | - data | |
| 68 | - }) | |
| 69 | - }, | |
| 70 | - // 恢复答题卡 | |
| 71 | - useAnswerSheet(data) { | |
| 71 | + delPaper(data) { | |
| 72 | 72 | return service({ |
| 73 | - url: answerSheet.useAnswerSheet, | |
| 73 | + url: answerSheet.delPaper, | |
| 74 | 74 | method: 'POST', |
| 75 | 75 | data |
| 76 | 76 | }) |
| 77 | 77 | }, |
| 78 | - // 恢复答题卡 | |
| 79 | - updateAnswerSheet(data) { | |
| 78 | + // 修改答题卡 | |
| 79 | + modifyPaper(data) { | |
| 80 | 80 | return service({ |
| 81 | - url: answerSheet.updateAnswerSheet, | |
| 81 | + url: answerSheet.modifyPaper, | |
| 82 | 82 | method: 'POST', |
| 83 | 83 | data |
| 84 | 84 | }) | ... | ... |
src/api/apis/ask.js
| ... | ... | @@ -3,7 +3,7 @@ import service from "../axios" |
| 3 | 3 | import askUrls from "../urls/login" |
| 4 | 4 | |
| 5 | 5 | export default { |
| 6 | - // 账号密码登陆 | |
| 6 | + // 随堂问列表 | |
| 7 | 7 | fetchQuizList(data) { |
| 8 | 8 | return service({ |
| 9 | 9 | url: askUrls.quizList, |
| ... | ... | @@ -11,4 +11,12 @@ export default { |
| 11 | 11 | data |
| 12 | 12 | }) |
| 13 | 13 | }, |
| 14 | + // 随堂问详情 | |
| 15 | + quizDetail(data) { | |
| 16 | + return service({ | |
| 17 | + url: askUrls.quizDetail, | |
| 18 | + method: 'POST', | |
| 19 | + data | |
| 20 | + }) | |
| 21 | + }, | |
| 14 | 22 | } | ... | ... |
src/api/apis/login.js
| ... | ... | @@ -4,11 +4,25 @@ import loginUrls from "../urls/login" |
| 4 | 4 | |
| 5 | 5 | export default { |
| 6 | 6 | // 账号密码登陆 |
| 7 | - fetchLogin(data) { | |
| 7 | + login(data) { | |
| 8 | 8 | return service({ |
| 9 | 9 | url: loginUrls.login, |
| 10 | 10 | method: 'POST', |
| 11 | 11 | data |
| 12 | 12 | }) |
| 13 | 13 | }, |
| 14 | + ssoLogin(data) { | |
| 15 | + return service({ | |
| 16 | + url: loginUrls.ssoLogin, | |
| 17 | + method: 'POST', | |
| 18 | + data | |
| 19 | + }) | |
| 20 | + }, | |
| 21 | + logout(data) { | |
| 22 | + return service({ | |
| 23 | + url: loginUrls.logout, | |
| 24 | + method: 'POST', | |
| 25 | + data | |
| 26 | + }) | |
| 27 | + }, | |
| 14 | 28 | } | ... | ... |
src/api/axios.js
| ... | ... | @@ -37,7 +37,7 @@ service.interceptors.response.use( |
| 37 | 37 | store.commit('delTokenSources', response.config.cancelToken) |
| 38 | 38 | } |
| 39 | 39 | if (response.status == 200) { |
| 40 | - Cookies.set("access_token", response.data.message, { expires: 1 / 12 }) | |
| 40 | + // Cookies.set("access_token", response.data.message, { expires: 1 / 12 }) | |
| 41 | 41 | // console.log(response.status) |
| 42 | 42 | if (res.code == 999) { |
| 43 | 43 | if (!location.href.includes('localhost')) { |
| ... | ... | @@ -56,7 +56,7 @@ service.interceptors.response.use( |
| 56 | 56 | } |
| 57 | 57 | return |
| 58 | 58 | } else { |
| 59 | - Cookies.set("access_token", response.data.message, { expires: 1 / 12 }) | |
| 59 | + // Cookies.set("access_token", response.data.message, { expires: 1 / 12 }) | |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | return Promise.resolve(response) |
| ... | ... | @@ -72,20 +72,23 @@ service.interceptors.response.use( |
| 72 | 72 | } |
| 73 | 73 | Message.closeAll() |
| 74 | 74 | const { |
| 75 | + data, | |
| 75 | 76 | status |
| 76 | 77 | } = error.response |
| 77 | 78 | if (status === 403 || status === 401) { |
| 78 | 79 | Message({ |
| 79 | - message: "未登录或登录超时,即将跳转到登录页面", | |
| 80 | + message: data.info||"未登录或登录超时,即将跳转到登录页面", | |
| 80 | 81 | type: 'error', |
| 81 | 82 | duration: 3 * 1000 |
| 82 | 83 | }) |
| 83 | - router.push({ | |
| 84 | - path: '/login', | |
| 85 | - query: { | |
| 86 | - url: window.location.href | |
| 87 | - } | |
| 88 | - }) | |
| 84 | + if (!window.location.href.includes('login')) { | |
| 85 | + router.push({ | |
| 86 | + path: '/login', | |
| 87 | + query: { | |
| 88 | + url: window.location.href | |
| 89 | + } | |
| 90 | + }) | |
| 91 | + } | |
| 89 | 92 | return |
| 90 | 93 | } |
| 91 | 94 | return Promise.reject(error.response) // 返回接口返回的错误信息 | ... | ... |
src/api/urls/answerSheet.js
| 1 | 1 | export default { |
| 2 | 2 | // 答题卡列表 |
| 3 | - answerList: "/apis/answerList", | |
| 4 | - // 测验类型 | |
| 5 | - typeNames: "/apis/typeNames", | |
| 3 | + paperList: "/api_html/teaching/paperList", | |
| 4 | + // 答题卡详情 | |
| 5 | + paperList: "/api_html/teaching/paperDetail", | |
| 6 | 6 | // 查找年级 |
| 7 | - gradeList: "/apis/gradeList", | |
| 7 | + gradeList: "/api_html/teaching/gradeList", | |
| 8 | + // 测验类型 | |
| 9 | + typeNames: "/api_html/teaching/tagList", | |
| 8 | 10 | // 查找班级 |
| 9 | - classList: "/apis/classList", | |
| 11 | + classList: "/api_html/teaching/classList", | |
| 10 | 12 | // 查找科目 |
| 11 | - subjectList: "/apis/subjectList", | |
| 12 | - // 天假答题卡测验类型 | |
| 13 | - addAnswerTypeName: "/apis/addAnswerTypeName", | |
| 13 | + subjectList: "/api_html/teaching/subjectList", | |
| 14 | + // 添加答题卡测验类型 | |
| 15 | + addPaperType: "/api_html/teaching/addPaperType", | |
| 14 | 16 | // 保存答题卡 |
| 15 | - saveAnswerSheet: "/apis/saveAnswerSheet", | |
| 17 | + addPaper: "/api_html/teaching/addPaper", | |
| 16 | 18 | // 删除答题卡 |
| 17 | - removeAnswerSheet: "/apis/removeAnswerSheet", | |
| 18 | - // 恢复使用答题卡 | |
| 19 | - useAnswerSheet: "/apis/useAnswerSheet", | |
| 19 | + delPaper: "/api_html/teaching/delPaper", | |
| 20 | 20 | // 更新答题卡 |
| 21 | - updateAnswerSheet: "/apis/updateAnswerSheet", | |
| 21 | + modifyPaper: "/api_html/teaching/modifyPaper", | |
| 22 | 22 | } |
| 23 | 23 | \ No newline at end of file | ... | ... |
src/api/urls/ask.js
src/api/urls/login.js
src/components/userForm/editPassword.vue deleted
| 1 | -<template> | |
| 2 | - <el-dialog title="修改密码" width="700px" :visible.sync="visible" destroy-on-close @close="closeCallback"> | |
| 3 | - <div class="card"> | |
| 4 | - <p class="title"><i class="fa fa-th-large fa-lg"></i>修改密码</p> | |
| 5 | - <el-form :model="ruleForm2" status-icon :rules="rules2" ref="ruleForm2" label-width="100px" class="demo-ruleForm"> | |
| 6 | - <el-form-item label="原密码" prop="oldPassword"> | |
| 7 | - <el-input type="password" v-model="ruleForm2.oldPassword" autocomplete="off"></el-input> | |
| 8 | - </el-form-item> | |
| 9 | - <el-form-item label="密码" prop="password"> | |
| 10 | - <el-input type="password" v-model="ruleForm2.password" autocomplete="off"></el-input> | |
| 11 | - </el-form-item> | |
| 12 | - <el-form-item label="确认密码" prop="checkPass"> | |
| 13 | - <el-input type="password" v-model="ruleForm2.checkPass" autocomplete="off"></el-input> | |
| 14 | - </el-form-item> | |
| 15 | - <el-form-item> | |
| 16 | - <el-button type="primary" @click="submitForm('ruleForm2')">提交</el-button> | |
| 17 | - <el-button @click="resetForm('ruleForm2')">重置</el-button> | |
| 18 | - </el-form-item> | |
| 19 | - </el-form> | |
| 20 | - </div> | |
| 21 | - </el-dialog> | |
| 22 | -</template> | |
| 23 | - | |
| 24 | -<script> | |
| 25 | -import Cookies from "js-cookie" | |
| 26 | -export default { | |
| 27 | - name: "editPassword", | |
| 28 | - props: { | |
| 29 | - dialogVisible: { | |
| 30 | - type: Boolean, | |
| 31 | - default: false | |
| 32 | - } | |
| 33 | - }, | |
| 34 | - data () { | |
| 35 | - var validatePass = (rule, value, callback) => { | |
| 36 | - if (value === "") { | |
| 37 | - callback(new Error("请输入密码")) | |
| 38 | - } else if (value.toString().length < 6) { | |
| 39 | - callback(new Error("密码长度不能低于6位")) | |
| 40 | - } else { | |
| 41 | - if (this.ruleForm2.checkPass !== "") { | |
| 42 | - this.$refs.ruleForm2.validateField("checkPass") | |
| 43 | - } | |
| 44 | - callback() | |
| 45 | - } | |
| 46 | - } | |
| 47 | - var validatePass2 = (rule, value, callback) => { | |
| 48 | - if (value === "") { | |
| 49 | - callback(new Error("请再次输入密码")) | |
| 50 | - } else if (value.toString().length < 6) { | |
| 51 | - callback(new Error("密码长度不能低于6位")) | |
| 52 | - } else if (value !== this.ruleForm2.password) { | |
| 53 | - callback(new Error("两次输入密码不一致!")) | |
| 54 | - } else { | |
| 55 | - callback() | |
| 56 | - } | |
| 57 | - } | |
| 58 | - return { | |
| 59 | - visible: this.dialogVisible, | |
| 60 | - ruleForm2: { | |
| 61 | - oldPassword: "", | |
| 62 | - password: "", | |
| 63 | - checkPass: "" | |
| 64 | - }, | |
| 65 | - rules2: { | |
| 66 | - oldPassword: [ | |
| 67 | - {required: true, validator: validatePass, trigger: "blur"} | |
| 68 | - ], | |
| 69 | - password: [ | |
| 70 | - {required: true, validator: validatePass, trigger: "blur"} | |
| 71 | - ], | |
| 72 | - checkPass: [ | |
| 73 | - {required: true, validator: validatePass2, trigger: "blur"} | |
| 74 | - ] | |
| 75 | - } | |
| 76 | - } | |
| 77 | - }, | |
| 78 | - methods: { | |
| 79 | - closeCallback () { | |
| 80 | - this.$emit("editPwdCallback") | |
| 81 | - }, | |
| 82 | - submitForm (formName) { | |
| 83 | - let that = this | |
| 84 | - this.$refs[formName].validate((valid) => { | |
| 85 | - if (valid) { | |
| 86 | - this.$request.fetchEditPassword({ | |
| 87 | - oldPassword: that.ruleForm2.oldPassword, | |
| 88 | - newPassword: that.ruleForm2.password | |
| 89 | - }).then((res) => { | |
| 90 | - that.$message({ | |
| 91 | - showClose: true, | |
| 92 | - message: res.data.message, | |
| 93 | - type: "success" | |
| 94 | - }) | |
| 95 | - setTimeout(function () { | |
| 96 | - Cookies.remove("access_token") | |
| 97 | - location.reload() | |
| 98 | - }, 3000) | |
| 99 | - }).catch((err) => { | |
| 100 | - that.$message({ | |
| 101 | - showClose: true, | |
| 102 | - message: err.data.message, | |
| 103 | - type: "error" | |
| 104 | - }) | |
| 105 | - }) | |
| 106 | - } else { | |
| 107 | - console.log("error submit!!") | |
| 108 | - return false | |
| 109 | - } | |
| 110 | - }) | |
| 111 | - }, | |
| 112 | - resetForm (formName) { | |
| 113 | - this.$refs[formName].resetFields() | |
| 114 | - } | |
| 115 | - } | |
| 116 | -} | |
| 117 | -</script> | |
| 118 | - | |
| 119 | -<style scoped> | |
| 120 | - .demo-ruleForm { | |
| 121 | - width: 460px; | |
| 122 | - padding-top: 25px; | |
| 123 | - } | |
| 124 | - | |
| 125 | - .card { | |
| 126 | - width: 560px; | |
| 127 | - padding-bottom: 15px; | |
| 128 | - margin: 0px auto; | |
| 129 | - } | |
| 130 | -</style> |
src/router/permission.js
| ... | ... | @@ -92,47 +92,3 @@ router.onError((error) => { |
| 92 | 92 | const targetPath = router.history.pending.fullPath; |
| 93 | 93 | if (isChunkLoadFailed) { router.replace(targetPath); } |
| 94 | 94 | }); |
| 95 | - | |
| 96 | - | |
| 97 | - | |
| 98 | -// // 真实使用 | |
| 99 | -// import fetchUser from "@/api/apis/user" | |
| 100 | -// | |
| 101 | -// router.beforeEach((to, from, next) => { | |
| 102 | -// if (store.getters.token && store.getters.token !== "undefined") { | |
| 103 | -// // store.dispatch('setToken', store.getters.token) | |
| 104 | -// if (to.path === "/login") { | |
| 105 | -// next({path: "/"}) | |
| 106 | -// } else { | |
| 107 | -// if (!store.getters.info) { | |
| 108 | -// (async function getAddRouters () { | |
| 109 | -// fetchUser.fetchGetUserInfo().then(async function (response) { | |
| 110 | -// await store.dispatch("setInfo", response.data) | |
| 111 | - // await store.dispatch("newRoutes", store.getters.info.authorityRouter) | |
| 112 | -// await router.addRoutes(store.getters.addRouters) | |
| 113 | -// next({path: "/index"}) | |
| 114 | -// }).catch(function (error) { | |
| 115 | -// console.log(error) | |
| 116 | -// }) | |
| 117 | -// }()) | |
| 118 | -// } else { | |
| 119 | -// let is404 = to.matched.some(record => { | |
| 120 | -// console.log(record) | |
| 121 | -// if (record.meta.role) { | |
| 122 | -// return store.getters.info.authorityRouter === -1 | |
| 123 | -// } | |
| 124 | -// }) | |
| 125 | -// if (is404) { | |
| 126 | -// next({path: "/404"}) | |
| 127 | -// return false | |
| 128 | -// } | |
| 129 | -// next() | |
| 130 | -// } | |
| 131 | -// } | |
| 132 | -// } else { | |
| 133 | -// if (to.path === "/login") { | |
| 134 | -// next() | |
| 135 | -// } | |
| 136 | -// next({path: "/login"}) | |
| 137 | -// } | |
| 138 | -// }) | ... | ... |
src/store/index.js
| ... | ... | @@ -64,7 +64,7 @@ const store = new Vuex.Store({ |
| 64 | 64 | let loginForm = {} |
| 65 | 65 | loginForm.username = params.username; |
| 66 | 66 | loginForm.password = encryptLoginPassword(params.password); |
| 67 | - request.fetchLogin({ ...loginForm }).then(res => { | |
| 67 | + request.login({ ...loginForm }).then(res => { | |
| 68 | 68 | let response = res.data |
| 69 | 69 | if (response.status == 0) { |
| 70 | 70 | const userInfo = { ...response.data } |
| ... | ... | @@ -92,7 +92,7 @@ const store = new Vuex.Store({ |
| 92 | 92 | }) |
| 93 | 93 | }, |
| 94 | 94 | permissions({ state, commit }, that) { |
| 95 | - // request.fetchLogin(that.loginForm).then(res => { | |
| 95 | + // request.login(that.loginForm).then(res => { | |
| 96 | 96 | // if (res.status == 200) { |
| 97 | 97 | commit("setToken", "xxxx") |
| 98 | 98 | commit("setInfo", { | ... | ... |
src/views/ask/analysis.vue
| ... | ... | @@ -5,23 +5,161 @@ |
| 5 | 5 | <span>单课分析</span> |
| 6 | 6 | </template> |
| 7 | 7 | </back-box> |
| 8 | - <div class="tab-box"> | |
| 9 | - <span class="tab-item active">答题表现</span> | |
| 10 | - <span class="tab-item">学生问答表现</span> | |
| 11 | - <span class="tab-item">学生互动表现</span> | |
| 12 | - <span class="tab-item">签到明细</span> | |
| 8 | + <div class="page-content"> | |
| 9 | + <div class="tab-box"> | |
| 10 | + <span | |
| 11 | + class="tab-item" | |
| 12 | + :class="type == 1 ? 'active' : ''" | |
| 13 | + @click="type = 1" | |
| 14 | + >答题表现</span | |
| 15 | + > | |
| 16 | + <span | |
| 17 | + class="tab-item" | |
| 18 | + :class="type == 2 ? 'active' : ''" | |
| 19 | + @click="type = 2" | |
| 20 | + >学生问答表现</span | |
| 21 | + > | |
| 22 | + <span | |
| 23 | + class="tab-item" | |
| 24 | + :class="type == 3 ? 'active' : ''" | |
| 25 | + @click="type = 3" | |
| 26 | + >学生互动表现</span | |
| 27 | + > | |
| 28 | + <span | |
| 29 | + class="tab-item" | |
| 30 | + :class="type == 4 ? 'active' : ''" | |
| 31 | + @click="type = 4" | |
| 32 | + >签到明细</span | |
| 33 | + > | |
| 34 | + </div> | |
| 35 | + <ul class="info"> | |
| 36 | + <li class="info-item">科目:语文</li> | |
| 37 | + <li class="info-item">课时:课时1</li> | |
| 38 | + <li class="info-item">上课时间:2022-11-9 21:30</li> | |
| 39 | + <li class="info-item">下课时间:2022-11-9 21:30</li> | |
| 40 | + <li class="info-item">签到人数:45</li> | |
| 41 | + <li class="info-item">题目总数:8</li> | |
| 42 | + <li class="info-item">答题总数:8</li> | |
| 43 | + <li class="info-item">课时时长:45分钟</li> | |
| 44 | + <li class="info-item">总参与度::80%</li> | |
| 45 | + <li class="info-item">班级总正确率:82%</li> | |
| 46 | + <li class="info-item">已答总正确率:89%</li> | |
| 47 | + <li class="info-item">反馈时长:15分钟</li> | |
| 48 | + </ul> | |
| 49 | + <el-table | |
| 50 | + :data="tableData" | |
| 51 | + border | |
| 52 | + style="width: 100%" | |
| 53 | + :default-sort="{ prop: 'dadui', order: 'descending' }" | |
| 54 | + > | |
| 55 | + <el-table-column | |
| 56 | + prop="questionIndex" | |
| 57 | + label="题号" | |
| 58 | + align="center" | |
| 59 | + ><template slot-scope="scoped">Q{{scoped.row.questionIndex}}</template></el-table-column> | |
| 60 | + <el-table-column | |
| 61 | + prop="questionType" | |
| 62 | + label="题型" | |
| 63 | + align="center" | |
| 64 | + ></el-table-column> | |
| 65 | + <el-table-column | |
| 66 | + prop="dati" | |
| 67 | + label="答题人数" | |
| 68 | + sortable | |
| 69 | + align="center" | |
| 70 | + ></el-table-column> | |
| 71 | + <el-table-column | |
| 72 | + prop="dadui" | |
| 73 | + label="答对人数" | |
| 74 | + sortable | |
| 75 | + align="center" | |
| 76 | + ></el-table-column> | |
| 77 | + <el-table-column | |
| 78 | + prop="canyu" | |
| 79 | + label="班级参与度" | |
| 80 | + sortable | |
| 81 | + align="center" | |
| 82 | + ><template slot-scope="scoped">{{scoped.row.canyu}}%</template></el-table-column> | |
| 83 | + <el-table-column | |
| 84 | + prop="banjidadui" | |
| 85 | + label="班级正确率" | |
| 86 | + sortable | |
| 87 | + align="center" | |
| 88 | + ><template slot-scope="scoped">{{scoped.row.banjidadui}}%</template></el-table-column> | |
| 89 | + <el-table-column | |
| 90 | + prop="yida" | |
| 91 | + label="已答正确率" | |
| 92 | + sortable | |
| 93 | + align="center" | |
| 94 | + ><template slot-scope="scoped">{{scoped.row.yida}}%</template></el-table-column> | |
| 95 | + <el-table-column | |
| 96 | + prop="correctAnswer" | |
| 97 | + label="正确答案" | |
| 98 | + align="center" | |
| 99 | + ></el-table-column> | |
| 100 | + <el-table-column | |
| 101 | + prop="ganrao" | |
| 102 | + label="干扰答案" | |
| 103 | + align="center" | |
| 104 | + ></el-table-column> | |
| 105 | + </el-table> | |
| 13 | 106 | </div> |
| 14 | 107 | </div> |
| 15 | 108 | </template> |
| 16 | 109 | |
| 17 | 110 | <script> |
| 18 | -export default {}; | |
| 111 | +export default { | |
| 112 | + data() { | |
| 113 | + return { | |
| 114 | + id: "", | |
| 115 | + type: 1, | |
| 116 | + tableData: [ | |
| 117 | + { | |
| 118 | + questionIndex: 1, | |
| 119 | + questionType: "单选题", | |
| 120 | + dati: 5, | |
| 121 | + dadui: 60, | |
| 122 | + canyu: 50, | |
| 123 | + banjidadui: 80, | |
| 124 | + yida: 90, | |
| 125 | + correctAnswer:"A", | |
| 126 | + ganrao:"C" | |
| 127 | + }, | |
| 128 | + { | |
| 129 | + questionIndex: 2, | |
| 130 | + questionType: "单选题", | |
| 131 | + dati: 6, | |
| 132 | + dadui: 80, | |
| 133 | + canyu: 60, | |
| 134 | + banjidadui: 90, | |
| 135 | + yida: 100, | |
| 136 | + correctAnswer:"B", | |
| 137 | + ganrao:"D" | |
| 138 | + }, | |
| 139 | + ], | |
| 140 | + }; | |
| 141 | + }, | |
| 142 | + created() { | |
| 143 | + this.id = this.$route.query.id; | |
| 144 | + // this._QueryData() | |
| 145 | + }, | |
| 146 | + methods: { | |
| 147 | + async _QueryData() { | |
| 148 | + let { data, info, status } = this.$request.quizDetail({ | |
| 149 | + id: this.id, | |
| 150 | + }); | |
| 151 | + }, | |
| 152 | + }, | |
| 153 | +}; | |
| 19 | 154 | </script> |
| 20 | 155 | |
| 21 | 156 | <style lang="scss" scoped> |
| 157 | +.page-content { | |
| 158 | + padding: 20px 20px 0; | |
| 159 | +} | |
| 22 | 160 | .tab-box { |
| 23 | 161 | width: 800px; |
| 24 | - margin: 20px auto; | |
| 162 | + margin: 0 auto 12px; | |
| 25 | 163 | background: #f8f8f8; |
| 26 | 164 | border-radius: 20px; |
| 27 | 165 | display: flex; |
| ... | ... | @@ -35,10 +173,29 @@ export default {}; |
| 35 | 173 | font-weight: 500; |
| 36 | 174 | background: transparent; |
| 37 | 175 | border-radius: 20px; |
| 176 | + cursor: pointer; | |
| 38 | 177 | &.active { |
| 39 | 178 | background: #667ffd; |
| 40 | 179 | color: #fff; |
| 41 | 180 | } |
| 42 | 181 | } |
| 43 | 182 | } |
| 183 | +.info { | |
| 184 | + display: flex; | |
| 185 | + flex-wrap: wrap; | |
| 186 | + border-left: 1px solid #e2e2e2; | |
| 187 | + border-top: 1px solid #e2e2e2; | |
| 188 | + margin-bottom: 12px; | |
| 189 | + .info-item { | |
| 190 | + width: 25%; | |
| 191 | + height: 50px; | |
| 192 | + box-sizing: border-box; | |
| 193 | + flex-shrink: 0; | |
| 194 | + background: #f8f8f8; | |
| 195 | + border-right: 1px solid #e2e2e2; | |
| 196 | + border-bottom: 1px solid #e2e2e2; | |
| 197 | + line-height: 50px; | |
| 198 | + text-align: center; | |
| 199 | + } | |
| 200 | +} | |
| 44 | 201 | </style> |
| 45 | 202 | \ No newline at end of file | ... | ... |
src/views/ask/index.vue
| ... | ... | @@ -774,7 +774,7 @@ export default { |
| 774 | 774 | } |
| 775 | 775 | }, |
| 776 | 776 | async saveAnswer(){ |
| 777 | - // const { data, code, message } = await this.$request.updateAnswerSheet({...this.form}); | |
| 777 | + // const { data, code, message } = await this.$request.modifyPaper({...this.form}); | |
| 778 | 778 | // if (code == 0) { |
| 779 | 779 | this.dialogVisible = false |
| 780 | 780 | // } else { | ... | ... |
src/views/examinationPaper/add.vue
| ... | ... | @@ -37,7 +37,7 @@ |
| 37 | 37 | ></el-col> |
| 38 | 38 | </el-form-item> |
| 39 | 39 | <el-form-item label="测验类型:"> |
| 40 | - <el-select v-model="form.tag" placeholder="选择测验类型"> | |
| 40 | + <el-select v-model="form.tagId" placeholder="选择测验类型"> | |
| 41 | 41 | <el-option |
| 42 | 42 | v-for="item in answerTypeList" |
| 43 | 43 | :key="item.id" |
| ... | ... | @@ -71,8 +71,8 @@ |
| 71 | 71 | </el-option> |
| 72 | 72 | </el-select> |
| 73 | 73 | </el-form-item> |
| 74 | - <el-form-item label="科目:" prop="subjectId"> | |
| 75 | - <el-select class="sel" v-model="form.subjectId" placeholder=""> | |
| 74 | + <el-form-item label="科目:" prop="subjectName"> | |
| 75 | + <el-select class="sel" v-model="form.subjectName" placeholder=""> | |
| 76 | 76 | <el-option |
| 77 | 77 | v-for="item in subjectList" |
| 78 | 78 | :key="item.value" |
| ... | ... | @@ -91,8 +91,8 @@ |
| 91 | 91 | label="考试时长" |
| 92 | 92 | ></el-input-number> |
| 93 | 93 | </el-form-item> |
| 94 | - <el-form-item label="分享范围:" prop="share"> | |
| 95 | - <el-radio-group v-model="form.share"> | |
| 94 | + <el-form-item label="分享范围:" prop="sharingType"> | |
| 95 | + <el-radio-group v-model="form.sharingType"> | |
| 96 | 96 | <el-radio :label="1">任课班级分享</el-radio> |
| 97 | 97 | <el-radio :label="2">全年级分享</el-radio> |
| 98 | 98 | </el-radio-group> |
| ... | ... | @@ -105,7 +105,7 @@ |
| 105 | 105 | <el-button type="primary" round @click="setStep1">下一步</el-button> |
| 106 | 106 | </div> |
| 107 | 107 | <el-dialog |
| 108 | - title="天假测验类型" | |
| 108 | + title="添加测验类型" | |
| 109 | 109 | :visible.sync="dialogVisible" |
| 110 | 110 | width="500px" |
| 111 | 111 | > |
| ... | ... | @@ -122,9 +122,7 @@ |
| 122 | 122 | </p> |
| 123 | 123 | </div> |
| 124 | 124 | <div class="" slot="footer"> |
| 125 | - <el-button type="primary" @click="addAnswerTypeName" | |
| 126 | - >确 定</el-button | |
| 127 | - > | |
| 125 | + <el-button type="primary" @click="addPaperType">确 定</el-button> | |
| 128 | 126 | <el-button @click="dialogVisible = false">取 消</el-button> |
| 129 | 127 | </div> |
| 130 | 128 | </el-dialog> |
| ... | ... | @@ -218,7 +216,7 @@ |
| 218 | 216 | <p v-else class="answer-box"> |
| 219 | 217 | <span |
| 220 | 218 | class="answer-s" |
| 221 | - v-for="option in subQuestions.answerOptions" | |
| 219 | + v-for="option in subQuestions.answerOptions.split(',')" | |
| 222 | 220 | :key="option" |
| 223 | 221 | >{{ option }}</span |
| 224 | 222 | > |
| ... | ... | @@ -394,7 +392,7 @@ |
| 394 | 392 | <p v-if="subQuestions.questionType == 3" class="answer-box"> |
| 395 | 393 | <span |
| 396 | 394 | class="answer-s" |
| 397 | - v-for="option in subQuestions.answerOptions" | |
| 395 | + v-for="option in subQuestions.answerOptions.split(',')" | |
| 398 | 396 | :class=" |
| 399 | 397 | subQuestions.correctAnswer.includes(option) |
| 400 | 398 | ? 'active' |
| ... | ... | @@ -408,7 +406,7 @@ |
| 408 | 406 | <p v-if="subQuestions.questionType == 2" class="answer-box"> |
| 409 | 407 | <span |
| 410 | 408 | class="answer-s" |
| 411 | - v-for="option in subQuestions.answerOptions" | |
| 409 | + v-for="option in subQuestions.answerOptions.split(',')" | |
| 412 | 410 | :class=" |
| 413 | 411 | subQuestions.correctAnswer == option ? 'active' : '' |
| 414 | 412 | " |
| ... | ... | @@ -434,6 +432,8 @@ |
| 434 | 432 | </template> |
| 435 | 433 | |
| 436 | 434 | <script> |
| 435 | +import { formatDate, deepClone } from "utils"; | |
| 436 | +import { number } from "echarts"; | |
| 437 | 437 | const questionForm = { |
| 438 | 438 | questionTitle: "", |
| 439 | 439 | questionType: 2, |
| ... | ... | @@ -444,7 +444,7 @@ const subQuesOptions = { |
| 444 | 444 | score: 1, |
| 445 | 445 | partScore: 0, |
| 446 | 446 | selectNum: 4, |
| 447 | - answerOptions: ["A", "B", "C", "D"], | |
| 447 | + answerOptions: "A,B,C,D", | |
| 448 | 448 | correctAnswer: "", |
| 449 | 449 | }; |
| 450 | 450 | export default { |
| ... | ... | @@ -471,7 +471,7 @@ export default { |
| 471 | 471 | { label: "判断题", value: 4 }, |
| 472 | 472 | { label: "主观题", value: 5 }, |
| 473 | 473 | ], |
| 474 | - rightOptions: ["A", "B", "C", "D", "E", "F", "G"], | |
| 474 | + rightOptions: ["A","B","C","D","E","F","G"], | |
| 475 | 475 | addSubQuestionsType: "", |
| 476 | 476 | step: 0, //步骤 |
| 477 | 477 | gradeList: [], //年级 |
| ... | ... | @@ -481,11 +481,11 @@ export default { |
| 481 | 481 | form: { |
| 482 | 482 | //答题卡详情 |
| 483 | 483 | title: "", |
| 484 | - tag: "", | |
| 485 | - subjectId: "", | |
| 486 | - examsDuration: 0, | |
| 484 | + tagId: "", | |
| 487 | 485 | gradeName: "", |
| 488 | - share: 1, | |
| 486 | + subjectName: "", | |
| 487 | + examsDuration: 0, | |
| 488 | + sharingType: 1, | |
| 489 | 489 | questionList: [], |
| 490 | 490 | }, |
| 491 | 491 | formRules: { |
| ... | ... | @@ -500,7 +500,9 @@ export default { |
| 500 | 500 | }, |
| 501 | 501 | ], |
| 502 | 502 | gradeName: [{ required: true, message: "请选择年级", trigger: "blur" }], |
| 503 | - subjectId: [{ required: true, message: "请选择科目", trigger: "blur" }], | |
| 503 | + subjectName: [ | |
| 504 | + { required: true, message: "请选择科目", trigger: "blur" }, | |
| 505 | + ], | |
| 504 | 506 | examsDuration: [ |
| 505 | 507 | { required: true, message: "请设置考试时长", trigger: "blur" }, |
| 506 | 508 | ], |
| ... | ... | @@ -510,9 +512,7 @@ export default { |
| 510 | 512 | created() { |
| 511 | 513 | this.type = this.$route.query.type ? this.$route.query.type : 1; |
| 512 | 514 | if (this.type == 2) { |
| 513 | - this.form = this.$route.query.form && JSON.parse(this.$route.query.form); | |
| 514 | - console.log(this.form.examsDuration) | |
| 515 | - this.form.examsDuration = Number(this.form.examsDuration)/60 | |
| 515 | + this._QueryDetail(); | |
| 516 | 516 | } |
| 517 | 517 | }, |
| 518 | 518 | methods: { |
| ... | ... | @@ -632,13 +632,13 @@ export default { |
| 632 | 632 | questionsOptions.answerOptions = this.rightOptions.slice( |
| 633 | 633 | 0, |
| 634 | 634 | questionsOptions.selectNum |
| 635 | - ); | |
| 635 | + ).join(','); | |
| 636 | 636 | break; |
| 637 | 637 | case 3: |
| 638 | 638 | questionsOptions.answerOptions = this.rightOptions.slice( |
| 639 | 639 | 0, |
| 640 | 640 | questionsOptions.selectNum |
| 641 | - ); | |
| 641 | + ).join(','); | |
| 642 | 642 | questionsOptions.partScore = 0.5; |
| 643 | 643 | break; |
| 644 | 644 | case 4: |
| ... | ... | @@ -667,7 +667,7 @@ export default { |
| 667 | 667 | let score = question.subQuestions.reduce((a, b) => { |
| 668 | 668 | return a + b.score; |
| 669 | 669 | }, 0); |
| 670 | - return score; | |
| 670 | + return Number(score).toFixed(2); | |
| 671 | 671 | }, |
| 672 | 672 | changeAddSubQuestions(val, question) { |
| 673 | 673 | if (val) { |
| ... | ... | @@ -680,13 +680,13 @@ export default { |
| 680 | 680 | questionsOptions.answerOptions = this.rightOptions.slice( |
| 681 | 681 | 0, |
| 682 | 682 | questionsOptions.selectNum |
| 683 | - ); | |
| 683 | + ).join(','); | |
| 684 | 684 | break; |
| 685 | 685 | case 3: |
| 686 | 686 | questionsOptions.answerOptions = this.rightOptions.slice( |
| 687 | 687 | 0, |
| 688 | 688 | questionsOptions.selectNum |
| 689 | - ); | |
| 689 | + ).join(','); | |
| 690 | 690 | questionsOptions.partScore = 0.5; |
| 691 | 691 | break; |
| 692 | 692 | case 4: |
| ... | ... | @@ -710,13 +710,13 @@ export default { |
| 710 | 710 | subQuestions.answerOptions = that.rightOptions.slice( |
| 711 | 711 | 0, |
| 712 | 712 | subQuestions.selectNum |
| 713 | - ); | |
| 713 | + ).join(','); | |
| 714 | 714 | break; |
| 715 | 715 | case 3: |
| 716 | 716 | subQuestions.answerOptions = that.rightOptions.slice( |
| 717 | 717 | 0, |
| 718 | 718 | subQuestions.selectNum |
| 719 | - ); | |
| 719 | + ).join(','); | |
| 720 | 720 | subQuestions.partScore = 0.5; |
| 721 | 721 | break; |
| 722 | 722 | case 4: |
| ... | ... | @@ -727,23 +727,23 @@ export default { |
| 727 | 727 | }, |
| 728 | 728 | addOptions(subQuestions) { |
| 729 | 729 | //添加选项 |
| 730 | - let length = subQuestions.answerOptions.length; | |
| 730 | + let length = subQuestions.answerOptions.split(',').length; | |
| 731 | 731 | if (length > 6) return; |
| 732 | 732 | subQuestions.selectNum = length + 1; |
| 733 | 733 | subQuestions.answerOptions = this.rightOptions.slice( |
| 734 | 734 | 0, |
| 735 | 735 | subQuestions.selectNum |
| 736 | - ); | |
| 736 | + ).join(','); | |
| 737 | 737 | }, |
| 738 | 738 | removeOptions(subQuestions) { |
| 739 | 739 | //删除选项 |
| 740 | - let length = subQuestions.answerOptions.length; | |
| 740 | + let length = subQuestions.answerOptions.split(',').length; | |
| 741 | 741 | if (length < 2) return; |
| 742 | 742 | subQuestions.selectNum = length - 1; |
| 743 | 743 | subQuestions.answerOptions = this.rightOptions.slice( |
| 744 | 744 | 0, |
| 745 | 745 | subQuestions.selectNum |
| 746 | - ); | |
| 746 | + ).join(','); | |
| 747 | 747 | }, |
| 748 | 748 | changAnswer(sub, option) { |
| 749 | 749 | //设置多选答案 |
| ... | ... | @@ -756,17 +756,17 @@ export default { |
| 756 | 756 | sub.correctAnswer = arrs.sort().join(""); |
| 757 | 757 | } |
| 758 | 758 | }, |
| 759 | - async addAnswerTypeName() { | |
| 759 | + async addPaperType() { | |
| 760 | 760 | //保存测验类型 |
| 761 | 761 | if (!this.answerTypeName) { |
| 762 | 762 | this.$message.error("请填写测验名称!"); |
| 763 | 763 | return; |
| 764 | 764 | } |
| 765 | 765 | //添加测验类型 |
| 766 | - const { data, code, message } = await this.$request.addAnswerTypeName({ | |
| 766 | + const { data, status, message } = await this.$request.addPaperType({ | |
| 767 | 767 | typeName: this.answerTypeName, |
| 768 | 768 | }); |
| 769 | - if (code == 0) { | |
| 769 | + if (status == 0) { | |
| 770 | 770 | this._CreatedTypeList(); |
| 771 | 771 | this.dialogVisible = false; |
| 772 | 772 | this.answerTypeName = ""; |
| ... | ... | @@ -778,14 +778,24 @@ export default { |
| 778 | 778 | async save() { |
| 779 | 779 | if (this.saceLoading) return; |
| 780 | 780 | this.saceLoading = true; |
| 781 | - const { data, code, message } = await this.$request.saveAnswerSheet({ | |
| 781 | + //添加题目ID、序号 | |
| 782 | + this.form.questionList.map((item, index) => { | |
| 783 | + item.questionId = index + 1; | |
| 784 | + item.questionIndex = index + 1; | |
| 785 | + item.questionType = 0; | |
| 786 | + item.subQuestions.map((items, indexs) => { | |
| 787 | + items.questionId = indexs + 1; | |
| 788 | + items.questionIndex = indexs + 1; | |
| 789 | + }); | |
| 790 | + }); | |
| 791 | + const { data, status, message } = await this.$request.addPaper({ | |
| 782 | 792 | ...this.form, |
| 783 | 793 | }); |
| 784 | 794 | this.saceLoading = false; |
| 785 | - if (code == 0) { | |
| 795 | + if (status == 0) { | |
| 786 | 796 | this.$router.push({ |
| 787 | - path:"/examinationPaper" | |
| 788 | - }) | |
| 797 | + path: "/examinationPaper", | |
| 798 | + }); | |
| 789 | 799 | } else { |
| 790 | 800 | this.$message.error(message); |
| 791 | 801 | } |
| ... | ... | @@ -796,15 +806,15 @@ export default { |
| 796 | 806 | }, |
| 797 | 807 | async _CreatedTypeList() { |
| 798 | 808 | //测验类型查询 |
| 799 | - const { data, code, message } = await this.$request.fetchTypeNames(); | |
| 800 | - if (code == 0) { | |
| 809 | + const { data, status, message } = await this.$request.fetchTypeNames(); | |
| 810 | + if (status == 0) { | |
| 801 | 811 | this.answerTypeList = [...data.list] || []; |
| 802 | 812 | this.answerTypeList.unshift({ |
| 803 | - typeName: "--", | |
| 813 | + typeName: "", | |
| 804 | 814 | id: "", |
| 805 | 815 | }); |
| 806 | 816 | if (this.type != 2) { |
| 807 | - this.form.tag = this.answerTypeList[0].id || ""; | |
| 817 | + this.form.tagId = this.answerTypeList[0].id || ""; | |
| 808 | 818 | } |
| 809 | 819 | } else { |
| 810 | 820 | this.$message.error(message); |
| ... | ... | @@ -812,8 +822,8 @@ export default { |
| 812 | 822 | }, |
| 813 | 823 | async _GradeList() { |
| 814 | 824 | //查询年级列表 |
| 815 | - const { data, code, message } = await this.$request.fetchGradeList(); | |
| 816 | - if (code == 0) { | |
| 825 | + const { data, status, message } = await this.$request.fetchGradeList(); | |
| 826 | + if (status == 0) { | |
| 817 | 827 | this.gradeList = [...data.gradeNames] || []; |
| 818 | 828 | if (this.type != 2) { |
| 819 | 829 | this.form.gradeName = this.gradeList[0]; |
| ... | ... | @@ -829,38 +839,56 @@ export default { |
| 829 | 839 | if (grade) { |
| 830 | 840 | param.gradeName = grade; |
| 831 | 841 | } |
| 832 | - const { data, code, message } = await this.$request.fetchSubjectList( | |
| 842 | + const { data, status, message } = await this.$request.fetchSubjectList( | |
| 833 | 843 | param |
| 834 | 844 | ); |
| 835 | - if (code === 0) { | |
| 845 | + if (status === 0) { | |
| 836 | 846 | this.subjectList = data.list.map((item) => { |
| 837 | 847 | return { |
| 838 | - value: item.subjectId, | |
| 848 | + value: item.subjectName, | |
| 839 | 849 | label: item.subjectName, |
| 840 | 850 | }; |
| 841 | 851 | }); |
| 842 | - if (this.subjectList.length > 1) { | |
| 843 | - let isTeachingCourse = false; | |
| 844 | - this.subjectList.map((item) => { | |
| 845 | - if (item.isTeachingCourse) { | |
| 846 | - isTeachingCourse = true; | |
| 847 | - } | |
| 848 | - }); | |
| 849 | - if (this.type != 2) { | |
| 850 | - !isTeachingCourse && !dont | |
| 851 | - ? (this.form.subjectId = this.subjectList[0].value) | |
| 852 | - : ""; | |
| 853 | - } | |
| 854 | - } | |
| 855 | - if (this.subjectList.length > 0 && !dont) { | |
| 856 | - this.form.subjectId = this.subjectList[0].value; | |
| 852 | + if (this.subjectList.length) { | |
| 853 | + this.form.subjectName = this.subjectList[0].value; | |
| 857 | 854 | } |
| 858 | 855 | } else { |
| 859 | 856 | this.$message.error(message); |
| 860 | 857 | } |
| 861 | 858 | }, |
| 862 | - | |
| 863 | - | |
| 859 | + async _QueryDetail() { | |
| 860 | + //查询年级列表 | |
| 861 | + const { data, status, message } = await this.$request.fetchPaperDetail({ | |
| 862 | + paperId: this.$route.query.paperId, | |
| 863 | + }); | |
| 864 | + if (status == 0) { | |
| 865 | + this.form.title = data.title; | |
| 866 | + this.form.tagId = data.tagId; | |
| 867 | + this.form.subjectName = data.subjectName; | |
| 868 | + this.form.gradeName = data.gradeName; | |
| 869 | + this.form.examsDuration = data.examsDuration; | |
| 870 | + this.form.sharingType = data.sharingType; | |
| 871 | + this.form.questionList = data.questionList?.map((item) => { | |
| 872 | + let subQuestions = | |
| 873 | + item.subQuestions?.map((items) => { | |
| 874 | + return { | |
| 875 | + questionType: items.questionType, | |
| 876 | + score: items.score, | |
| 877 | + partScore: items.partScore, | |
| 878 | + selectNum: items.answerOptions.split(',').length, | |
| 879 | + answerOptions: [...items.answerOptions], | |
| 880 | + correctAnswer: items.correctAnswer, | |
| 881 | + }; | |
| 882 | + }) || []; | |
| 883 | + return { | |
| 884 | + questionTitle: item.questionTitle, | |
| 885 | + subQuestions: subQuestions, | |
| 886 | + }; | |
| 887 | + }); | |
| 888 | + } else { | |
| 889 | + this.$message.error(message); | |
| 890 | + } | |
| 891 | + }, | |
| 864 | 892 | }, |
| 865 | 893 | }; |
| 866 | 894 | </script> | ... | ... |
src/views/examinationPaper/edit.vue
| ... | ... | @@ -104,6 +104,7 @@ |
| 104 | 104 | export default { |
| 105 | 105 | data() { |
| 106 | 106 | return { |
| 107 | + questionList:[], | |
| 107 | 108 | form: { |
| 108 | 109 | //答题卡详情 |
| 109 | 110 | title: "", |
| ... | ... | @@ -128,7 +129,7 @@ export default { |
| 128 | 129 | }, |
| 129 | 130 | }, |
| 130 | 131 | created() { |
| 131 | - this.form = this.$route.query.form && JSON.parse(this.$route.query.form); | |
| 132 | + this._QueryDetail() | |
| 132 | 133 | }, |
| 133 | 134 | methods: { |
| 134 | 135 | linkBack() { |
| ... | ... | @@ -199,17 +200,36 @@ export default { |
| 199 | 200 | sub.correctAnswer = arrs.sort().join(""); |
| 200 | 201 | } |
| 201 | 202 | }, |
| 202 | - save(){ | |
| 203 | - //删除答题卡 | |
| 204 | - // const { data, code, message } = await this.$request.updateAnswerSheet({...this.form}); | |
| 205 | - // if (code == 0) { | |
| 203 | + async save(){ | |
| 204 | + let questionList = [] | |
| 205 | + //更新答题卡 | |
| 206 | + const { data, status, message } = await this.$request.modifyPaper({ | |
| 207 | + paperId:this.form.id, | |
| 208 | + questionList:questionList | |
| 209 | + }); | |
| 210 | + if (status == 0) { | |
| 206 | 211 | this.$router.push({ |
| 207 | 212 | path:"/examinationPaper" |
| 208 | 213 | }) |
| 209 | - // } else { | |
| 210 | - // this.$message.error(message); | |
| 211 | - // } | |
| 212 | - } | |
| 214 | + } else { | |
| 215 | + this.$message.error(message); | |
| 216 | + } | |
| 217 | + }, | |
| 218 | + async _QueryDetail() { | |
| 219 | + //查询年级列表 | |
| 220 | + const { data, status, message } = await this.$request.fetchPaperDetail({ | |
| 221 | + paperId:this.$route.query.paperId | |
| 222 | + }); | |
| 223 | + if (status == 0) { | |
| 224 | + this.form = deepClone(data) | |
| 225 | + this.questionList = deepClone(data.questionList) | |
| 226 | + this.form.questionList.map(item=>{ | |
| 227 | + item.score = "" | |
| 228 | + }) | |
| 229 | + } else { | |
| 230 | + this.$message.error(message); | |
| 231 | + } | |
| 232 | + }, | |
| 213 | 233 | }, |
| 214 | 234 | }; |
| 215 | 235 | </script> | ... | ... |
src/views/examinationPaper/index.vue
| ... | ... | @@ -19,23 +19,23 @@ |
| 19 | 19 | |
| 20 | 20 | <div class="answer-header"> |
| 21 | 21 | <div class="sel-box"> |
| 22 | - <el-cascader | |
| 23 | - class="sel sel2" | |
| 24 | - :options="options" | |
| 25 | - :props="props" | |
| 26 | - collapse-tags | |
| 27 | - clearable | |
| 28 | - placeholder="选择年级-班级" | |
| 29 | - v-model="query.gradeClass" | |
| 30 | - @change="changeGrade" | |
| 31 | - ><template slot-scope="{ node, data }"> | |
| 32 | - <span>{{ data.label }}</span> | |
| 33 | - <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> | |
| 34 | - </template></el-cascader | |
| 22 | + <el-select | |
| 23 | + class="sel" | |
| 24 | + v-model="query.classId" | |
| 25 | + placeholder="选择班级" | |
| 26 | + @change="changClazz" | |
| 35 | 27 | > |
| 28 | + <el-option | |
| 29 | + v-for="item in classList" | |
| 30 | + :key="item.value" | |
| 31 | + :label="item.label" | |
| 32 | + :value="item.value" | |
| 33 | + > | |
| 34 | + </el-option> | |
| 35 | + </el-select> | |
| 36 | 36 | <el-select |
| 37 | 37 | class="sel" |
| 38 | - v-model="query.subjectId" | |
| 38 | + v-model="query.subjectName" | |
| 39 | 39 | placeholder="选择科目" |
| 40 | 40 | @change="_QueryData()" |
| 41 | 41 | > |
| ... | ... | @@ -49,15 +49,15 @@ |
| 49 | 49 | </el-select> |
| 50 | 50 | <el-select |
| 51 | 51 | class="sel" |
| 52 | - v-model="query.typeName" | |
| 52 | + v-model="query.tagId" | |
| 53 | 53 | placeholder="选择类型" |
| 54 | 54 | @change="_QueryData()" |
| 55 | 55 | > |
| 56 | 56 | <el-option |
| 57 | 57 | v-for="item in typeList" |
| 58 | 58 | :key="item" |
| 59 | - :label="item" | |
| 60 | - :value="item" | |
| 59 | + :label="item.label" | |
| 60 | + :value="item.value" | |
| 61 | 61 | >{{ item }} |
| 62 | 62 | </el-option> |
| 63 | 63 | </el-select> |
| ... | ... | @@ -76,7 +76,7 @@ |
| 76 | 76 | </div> |
| 77 | 77 | </div> |
| 78 | 78 | <p class="tips"> |
| 79 | - <span>另有25份已经归档的答题卡,</span> | |
| 79 | + <span>另有{{ archivedTotal }}份已经归档的答题卡,</span> | |
| 80 | 80 | <router-link to="/examinationPaperRecycle">点击查看>></router-link> |
| 81 | 81 | </p> |
| 82 | 82 | <ul class="content"> |
| ... | ... | @@ -87,29 +87,29 @@ |
| 87 | 87 | </div> |
| 88 | 88 | <div class="info"> |
| 89 | 89 | <p class="title"> |
| 90 | - {{ item.title }} <span class="label">{{ item.typeName }}</span> | |
| 90 | + {{ item.title }} <span class="label">{{ item.tag }}</span> | |
| 91 | 91 | </p> |
| 92 | 92 | <p class="num"> |
| 93 | - 总题数:{{ item.answerNum }} | |
| 93 | + 总题数:{{ item.questionNum }} | |
| 94 | 94 | <em class="s-line">|</em> |
| 95 | - 预计时长:{{ item.time }} | |
| 95 | + 预计时长:{{ item.examsDuration }} | |
| 96 | 96 | <em class="s-line">|</em> |
| 97 | 97 | 授课端同步: |
| 98 | 98 | <span |
| 99 | 99 | class="clazz" |
| 100 | - v-for="(clazzChild, indexs) in item.aboutClazz" | |
| 101 | - :key="clazzChild" | |
| 100 | + v-for="(clazzChild, indexs) in item.classList" | |
| 101 | + :key="clazzChild.classId" | |
| 102 | 102 | >{{ |
| 103 | - `${clazzChild}班${ | |
| 103 | + `${clazzChild.className}班${ | |
| 104 | 104 | indexs != item.aboutClazz.length - 1 ? "、" : "" |
| 105 | 105 | }` |
| 106 | 106 | }} |
| 107 | - <i class="el-icon-success"></i | |
| 107 | + <i v-if="clazzChild.keepStatus == 1" class="el-icon-success"></i | |
| 108 | 108 | ></span> |
| 109 | 109 | </p> |
| 110 | 110 | <p class="person"> |
| 111 | - {{ item.teacher }}<em class="s-line">|</em | |
| 112 | - ><span class="date">{{ item.date }}</span> | |
| 111 | + {{ item.realName }}<em class="s-line">|</em | |
| 112 | + ><span class="date">{{ item.modifiedTime }}</span> | |
| 113 | 113 | </p> |
| 114 | 114 | </div> |
| 115 | 115 | <div class="btn-box"> |
| ... | ... | @@ -134,7 +134,9 @@ |
| 134 | 134 | icon="el-icon-more" |
| 135 | 135 | ></el-button> |
| 136 | 136 | <el-dropdown-menu slot="dropdown"> |
| 137 | - <el-dropdown-item :command="1" v-if="this.$store.info.id == item.id">修改分享范围</el-dropdown-item> | |
| 137 | + <el-dropdown-item :command="1" v-if="userId == item.id" | |
| 138 | + >修改分享范围</el-dropdown-item | |
| 139 | + > | |
| 138 | 140 | <el-dropdown-item :command="2">复制</el-dropdown-item> |
| 139 | 141 | <el-dropdown-item :command="3">归档</el-dropdown-item> |
| 140 | 142 | </el-dropdown-menu> |
| ... | ... | @@ -144,11 +146,6 @@ |
| 144 | 146 | </ul> |
| 145 | 147 | <el-dialog title="选择分享范围" :visible.sync="dialogVisible" width="400"> |
| 146 | 148 | <el-form :model="shareForm" :rules="shareRulesForm" label-width="160px"> |
| 147 | - <el-form-item label="适用年级:"> | |
| 148 | - <el-col :span="11"> | |
| 149 | - <el-input v-model="shareForm.grade"></el-input> | |
| 150 | - </el-col> | |
| 151 | - </el-form-item> | |
| 152 | 149 | <el-form-item prop="share" label="分享范围:"> |
| 153 | 150 | <el-radio-group v-model="shareForm.share"> |
| 154 | 151 | <el-radio :label="1">任课班级分享</el-radio> |
| ... | ... | @@ -169,62 +166,23 @@ export default { |
| 169 | 166 | name: "examinationPaper", |
| 170 | 167 | data() { |
| 171 | 168 | return { |
| 172 | - props: { multiple: true, checkStrictly: true }, | |
| 173 | - options: [ | |
| 174 | - { | |
| 175 | - value: 1, | |
| 176 | - label: "一年级", | |
| 177 | - children: [ | |
| 178 | - { | |
| 179 | - value: 2, | |
| 180 | - label: "二班", | |
| 181 | - }, | |
| 182 | - { | |
| 183 | - value: 3, | |
| 184 | - label: "三班", | |
| 185 | - }, | |
| 186 | - ], | |
| 187 | - }, | |
| 188 | - { | |
| 189 | - value: 4, | |
| 190 | - label: "二年级", | |
| 191 | - children: [ | |
| 192 | - { | |
| 193 | - value: 5, | |
| 194 | - label: "二班", | |
| 195 | - }, | |
| 196 | - { | |
| 197 | - value: 6, | |
| 198 | - label: "三班", | |
| 199 | - }, | |
| 200 | - ], | |
| 201 | - }, | |
| 202 | - ], | |
| 169 | + userId: "", | |
| 203 | 170 | dialogVisible: false, |
| 204 | 171 | query: { |
| 205 | - gradeClass: [], | |
| 206 | - subjectId: "0", | |
| 207 | - typeName: "周测", | |
| 172 | + classId: "", | |
| 173 | + subjectName: "", | |
| 174 | + tagId: "", | |
| 208 | 175 | title: "", |
| 209 | 176 | }, |
| 210 | - classList: [ | |
| 211 | - { | |
| 212 | - label: "2003班", | |
| 213 | - value: "2003", | |
| 214 | - }, | |
| 215 | - ], | |
| 216 | - subjectList: [ | |
| 217 | - { | |
| 218 | - label: "语文", | |
| 219 | - value: "0", | |
| 220 | - }, | |
| 221 | - ], | |
| 222 | - typeList: ["周测"], | |
| 177 | + classList: [], | |
| 178 | + subjectList: [], | |
| 179 | + typeList: [], | |
| 180 | + archivedTotal: 0, //已归档答题卡数量 | |
| 223 | 181 | tableData: [ |
| 224 | 182 | { |
| 225 | 183 | title: "数学样例试卷202211-324654", |
| 226 | 184 | id: "1062837", |
| 227 | - typeName: "周测", | |
| 185 | + tag: "周测", | |
| 228 | 186 | answerNum: 45, |
| 229 | 187 | time: 90, |
| 230 | 188 | aboutClazz: [203, 204], |
| ... | ... | @@ -246,7 +204,7 @@ export default { |
| 246 | 204 | score: 1, |
| 247 | 205 | partScore: 0, |
| 248 | 206 | selectNum: 4, |
| 249 | - answerOptions: ["A", "B", "C", "D"], | |
| 207 | + answerOptions: "A,B,C,D", | |
| 250 | 208 | correctAnswer: "B", |
| 251 | 209 | }, |
| 252 | 210 | ], |
| ... | ... | @@ -256,7 +214,7 @@ export default { |
| 256 | 214 | { |
| 257 | 215 | title: "数学样例试卷202211-4180949", |
| 258 | 216 | id: "1062838", |
| 259 | - typeName: "周测", | |
| 217 | + tag: "周测", | |
| 260 | 218 | answerNum: 45, |
| 261 | 219 | time: 90, |
| 262 | 220 | aboutClazz: [203, 204], |
| ... | ... | @@ -288,14 +246,22 @@ export default { |
| 288 | 246 | ], |
| 289 | 247 | shareForm: { |
| 290 | 248 | id: "", |
| 291 | - grade: "", | |
| 292 | 249 | share: 1, |
| 293 | 250 | }, |
| 294 | 251 | shareRulesForm: { |
| 295 | 252 | share: [{ required: true, message: "选择分享范围", trigger: "blur" }], |
| 296 | 253 | }, |
| 254 | + page: 1, | |
| 255 | + size: 20, | |
| 297 | 256 | }; |
| 298 | 257 | }, |
| 258 | + async created() { | |
| 259 | + this.userId = this.$store.getters.info.uid || ""; | |
| 260 | + await this._QueryClassList(); | |
| 261 | + await this._QuerySubjectList(); | |
| 262 | + this._QueryData(); | |
| 263 | + this._QueryTypeList(); | |
| 264 | + }, | |
| 299 | 265 | methods: { |
| 300 | 266 | toAdd(query) { |
| 301 | 267 | let routerItem = { |
| ... | ... | @@ -308,7 +274,7 @@ export default { |
| 308 | 274 | this.$router.push({ |
| 309 | 275 | path: "/examinationPaperEdit", |
| 310 | 276 | query: { |
| 311 | - form: JSON.stringify(item), | |
| 277 | + paperId: item.id, | |
| 312 | 278 | }, |
| 313 | 279 | }); |
| 314 | 280 | }, |
| ... | ... | @@ -319,13 +285,12 @@ export default { |
| 319 | 285 | case 1: |
| 320 | 286 | //修改分享范围 |
| 321 | 287 | that.shareForm.id = item.id; |
| 322 | - that.shareForm.grade = item.grade; | |
| 323 | 288 | that.shareForm.share = item.share || 1; |
| 324 | 289 | that.dialogVisible = true; |
| 325 | 290 | break; |
| 326 | 291 | case 2: |
| 327 | 292 | //复制 |
| 328 | - that.toAdd({ type: 2, form: JSON.stringify(item) }); | |
| 293 | + that.toAdd({ type: 2, paperId: item.id }); | |
| 329 | 294 | break; |
| 330 | 295 | case 3: |
| 331 | 296 | //归档 |
| ... | ... | @@ -335,51 +300,61 @@ export default { |
| 335 | 300 | }, |
| 336 | 301 | async saveShare() { |
| 337 | 302 | //修改分享范围 |
| 338 | - // const { data, code, message } = await this.$request.fetchAnswerList({ | |
| 339 | - // ...this.shareForm, | |
| 340 | - // }); | |
| 341 | - // this.loading = false; | |
| 342 | - // if (code === 0) { | |
| 343 | - this.shareForm.id = ""; | |
| 344 | - this.shareForm.grade = ""; | |
| 345 | - this.shareForm.share = 1; | |
| 346 | - dialogVisible = false; | |
| 347 | - // } else { | |
| 348 | - // this.$message.error(message); | |
| 349 | - // } | |
| 303 | + const { data, status, message } = await this.$request.modifyPaper({ | |
| 304 | + paperId: that.shareForm.id, | |
| 305 | + sharingType: that.shareForm.share, | |
| 306 | + }); | |
| 307 | + this.loading = false; | |
| 308 | + if (status === 0) { | |
| 309 | + this.shareForm.id = ""; | |
| 310 | + this.shareForm.share = 1; | |
| 311 | + dialogVisible = false; | |
| 312 | + } else { | |
| 313 | + this.$message.error(message); | |
| 314 | + } | |
| 350 | 315 | }, |
| 351 | 316 | async recovery(item) { |
| 352 | 317 | //归档 |
| 353 | - // const { data, code, message } = await this.$request.fetchAnswerList({ | |
| 354 | - // ...this.shareForm, | |
| 355 | - // }); | |
| 356 | - // if (code === 0) { | |
| 357 | - this.tableData = this.tableData.filter((items) => { | |
| 358 | - return items.id != item.id; | |
| 318 | + const { data, status, message } = await this.$request.modifyPaper({ | |
| 319 | + paperId: item.id, | |
| 320 | + status: 2, | |
| 359 | 321 | }); |
| 360 | - // } else { | |
| 361 | - // this.$message.error(message); | |
| 362 | - // } | |
| 322 | + if (status === 0) { | |
| 323 | + let type = this.query.title ? 1 : 0; | |
| 324 | + this.page = 1; | |
| 325 | + this._QueryData(type); | |
| 326 | + } else { | |
| 327 | + this.$message.error(message); | |
| 328 | + } | |
| 363 | 329 | }, |
| 364 | - async changeGrade() { | |
| 365 | - //切换班级 | |
| 330 | + //切换班级 | |
| 331 | + async changClazz() { | |
| 366 | 332 | await this._QuerySubjectList(); |
| 367 | - this._QueryData(); | |
| 333 | + this._QueryData(false); | |
| 368 | 334 | }, |
| 369 | - async changClazz() {}, | |
| 370 | 335 | // 查找答题卡类型 |
| 371 | 336 | async _QueryTypeList() { |
| 372 | - const { data, code, message } = await this.$request.fetchTypeNames(); | |
| 373 | - if (code === 0) { | |
| 374 | - this.typeList = [...data.typeNames] || []; | |
| 337 | + const { data, status, message } = await this.$request.fetchTypeNames(); | |
| 338 | + if (status === 0) { | |
| 339 | + this.typeList = | |
| 340 | + data.subjectNames.map((item) => { | |
| 341 | + return { | |
| 342 | + value: item.tagId, | |
| 343 | + label: item.tag, | |
| 344 | + }; | |
| 345 | + }) || []; | |
| 346 | + this.subjectNames.unshift({ | |
| 347 | + value: "", | |
| 348 | + label: "--", | |
| 349 | + }); | |
| 375 | 350 | } else { |
| 376 | 351 | this.$message.error(message); |
| 377 | 352 | } |
| 378 | 353 | }, |
| 379 | 354 | // 查找班级 |
| 380 | 355 | async _QueryClassList() { |
| 381 | - const { data, code, message } = await this.$request.fetchClassList(); | |
| 382 | - if (code === 0) { | |
| 356 | + const { data, status, message } = await this.$request.fetchClassList(); | |
| 357 | + if (status === 0) { | |
| 383 | 358 | if (!!data.list) { |
| 384 | 359 | this.classList = data.list.map((item) => { |
| 385 | 360 | return { |
| ... | ... | @@ -395,14 +370,14 @@ export default { |
| 395 | 370 | }, |
| 396 | 371 | // 查找科目 |
| 397 | 372 | async _QuerySubjectList() { |
| 398 | - const { data, code, message } = await this.$request.fetchSubjectList({ | |
| 373 | + const { data, status, message } = await this.$request.fetchSubjectList({ | |
| 399 | 374 | clazzId: this.query.clazzId, |
| 400 | 375 | }); |
| 401 | - if (code === 0) { | |
| 402 | - this.subjectList = data.list.map((item) => { | |
| 376 | + if (status === 0) { | |
| 377 | + this.subjectList = data.subjectNames.map((item) => { | |
| 403 | 378 | return { |
| 404 | - value: item.subjectId, | |
| 405 | - label: item.subjectName, | |
| 379 | + value: item, | |
| 380 | + label: item, | |
| 406 | 381 | }; |
| 407 | 382 | }); |
| 408 | 383 | this.query.clazzId = this.subjectList[0]?.value; |
| ... | ... | @@ -418,8 +393,8 @@ export default { |
| 418 | 393 | query = { ...this.query }; |
| 419 | 394 | } else { |
| 420 | 395 | query = { title: this.query.title }; |
| 421 | - this.query.typeName = ""; | |
| 422 | - this.query.subjectId = ""; | |
| 396 | + this.query.tagId = ""; | |
| 397 | + this.query.subjectName = ""; | |
| 423 | 398 | } |
| 424 | 399 | query.clazzId = this.query.clazzId; |
| 425 | 400 | for (let key in query) { |
| ... | ... | @@ -434,11 +409,14 @@ export default { |
| 434 | 409 | return; |
| 435 | 410 | } |
| 436 | 411 | this.loading = true; |
| 437 | - const { data, code, message } = await this.$request.fetchAnswerList({ | |
| 412 | + const { data, status, message } = await this.$request.fetchPaperList({ | |
| 438 | 413 | ...query, |
| 414 | + status: 1, | |
| 415 | + page: this.page, | |
| 416 | + size: this.size, | |
| 439 | 417 | }); |
| 440 | 418 | this.loading = false; |
| 441 | - if (code === 0) { | |
| 419 | + if (status === 0) { | |
| 442 | 420 | this.total = data.total; |
| 443 | 421 | this.tableData = (data.list && [...data.list]) || []; |
| 444 | 422 | } else { | ... | ... |
src/views/examinationPaper/recycle.vue
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | </back-box> |
| 8 | 8 | <div class="answer-header"> |
| 9 | 9 | <div class="sel-box"> |
| 10 | - <el-cascader | |
| 10 | + <!-- <el-cascader | |
| 11 | 11 | class="sel sel2" |
| 12 | 12 | :options="options" |
| 13 | 13 | :props="props" |
| ... | ... | @@ -20,14 +20,27 @@ |
| 20 | 20 | <span>{{ data.label }}</span> |
| 21 | 21 | <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> |
| 22 | 22 | </template></el-cascader |
| 23 | + > --> | |
| 24 | + <el-select | |
| 25 | + class="sel" | |
| 26 | + v-model="query.classId" | |
| 27 | + placeholder="选择班级" | |
| 28 | + @change="changClazz" | |
| 23 | 29 | > |
| 30 | + <el-option | |
| 31 | + v-for="item in classList" | |
| 32 | + :key="item.value" | |
| 33 | + :label="item.label" | |
| 34 | + :value="item.value" | |
| 35 | + > | |
| 36 | + </el-option> | |
| 37 | + </el-select> | |
| 24 | 38 | <el-select |
| 25 | 39 | class="sel" |
| 26 | - v-model="query.subjectId" | |
| 40 | + v-model="query.subjectName" | |
| 27 | 41 | placeholder="选择科目" |
| 28 | 42 | @change="_QueryData()" |
| 29 | 43 | > |
| 30 | - <el-option label="全部" value=""></el-option> | |
| 31 | 44 | <el-option |
| 32 | 45 | v-for="item in subjectList" |
| 33 | 46 | :key="item.value" |
| ... | ... | @@ -38,17 +51,16 @@ |
| 38 | 51 | </el-select> |
| 39 | 52 | <el-select |
| 40 | 53 | class="sel" |
| 41 | - v-model="query.type" | |
| 54 | + v-model="query.tagId" | |
| 42 | 55 | placeholder="选择类型" |
| 43 | 56 | @change="_QueryData()" |
| 44 | 57 | > |
| 45 | - <el-option label="全部" value=""></el-option> | |
| 46 | 58 | <el-option |
| 47 | 59 | v-for="item in typeList" |
| 48 | - :key="item.value" | |
| 60 | + :key="item" | |
| 49 | 61 | :label="item.label" |
| 50 | 62 | :value="item.value" |
| 51 | - >{{ item.label }} | |
| 63 | + >{{ item }} | |
| 52 | 64 | </el-option> |
| 53 | 65 | </el-select> |
| 54 | 66 | |
| ... | ... | @@ -74,19 +86,18 @@ |
| 74 | 86 | </div> |
| 75 | 87 | <div class="info"> |
| 76 | 88 | <p class="title"> |
| 77 | - {{ item.title }} <span class="label">{{ item.typeName }}</span> | |
| 89 | + {{ item.title }} <span class="label">{{ item.tag }}</span> | |
| 78 | 90 | </p> |
| 79 | 91 | <p class="num"> |
| 80 | 92 | {{ item.gradeName }} |
| 81 | 93 | <em class="s-line">|</em> |
| 82 | - 总题数:{{ item.answerNum }} | |
| 83 | - <em class="s-line">|</em> | |
| 84 | - 预计时长:{{ item.time }} | |
| 94 | + 总题数:{{ item.questionNum }} | |
| 85 | 95 | <em class="s-line">|</em> |
| 96 | + 预计时长:{{ item.examsDuration }} | |
| 86 | 97 | </p> |
| 87 | 98 | <p class="person"> |
| 88 | - {{ item.teacher }}<em class="s-line">|</em | |
| 89 | - ><span class="date">{{ item.date }}</span> | |
| 99 | + {{ item.realName }}<em class="s-line">|</em | |
| 100 | + ><span class="date">{{ item.modifiedTime }}</span> | |
| 90 | 101 | </p> |
| 91 | 102 | </div> |
| 92 | 103 | <div class="btn-box"> |
| ... | ... | @@ -97,7 +108,7 @@ |
| 97 | 108 | size="mini" |
| 98 | 109 | circle |
| 99 | 110 | icon="fa fa-mail-reply" |
| 100 | - @click="have(item)" | |
| 111 | + @click="modify(item)" | |
| 101 | 112 | ></el-button> |
| 102 | 113 | </el-tooltip> |
| 103 | 114 | <el-popconfirm title="确定删除这张答题卡吗?" @confirm="remove(item)"> |
| ... | ... | @@ -152,17 +163,29 @@ export default { |
| 152 | 163 | }, |
| 153 | 164 | ], |
| 154 | 165 | query: { |
| 155 | - gradeClass: [], | |
| 156 | - type: "", | |
| 157 | - subjectId: "", | |
| 166 | + classId: 2003, | |
| 167 | + subjectName: "语文", | |
| 168 | + tagId: 1, | |
| 158 | 169 | title: "", |
| 159 | 170 | }, |
| 160 | - gradeList: ["二年级"], | |
| 171 | + classList: [ | |
| 172 | + { | |
| 173 | + label: "2003班", | |
| 174 | + value: 2003, | |
| 175 | + }, | |
| 176 | + ], | |
| 177 | + subjectList: [ | |
| 178 | + { | |
| 179 | + label: "语文", | |
| 180 | + value: "语文", | |
| 181 | + }, | |
| 182 | + ], | |
| 161 | 183 | typeList: [ |
| 162 | - { label: "周测", value: 1 }, | |
| 163 | - { label: "月测", value: 2 }, | |
| 184 | + { | |
| 185 | + label: "周测", | |
| 186 | + value: 1, | |
| 187 | + }, | |
| 164 | 188 | ], |
| 165 | - subjectList: [], | |
| 166 | 189 | tableData: [ |
| 167 | 190 | { |
| 168 | 191 | title: "数学样例试卷202211-324654", |
| ... | ... | @@ -192,28 +215,42 @@ export default { |
| 192 | 215 | total: 0, |
| 193 | 216 | }; |
| 194 | 217 | }, |
| 218 | + async created() { | |
| 219 | + await this._QueryClassList(); | |
| 220 | + await this._QuerySubjectList(); | |
| 221 | + this._QueryTypeList(); | |
| 222 | + this._QueryData(false); | |
| 223 | + }, | |
| 195 | 224 | methods: { |
| 196 | - have(obj) { | |
| 197 | - //删除答题卡 | |
| 198 | - // const { data, code, message } = await this.$request.useAnswerSheet(); | |
| 199 | - // if (code == 0) { | |
| 200 | - this.tableData = this.tableData.filter((item) => { | |
| 201 | - return obj.if != item.id; | |
| 225 | + async modify(obj) { | |
| 226 | + //恢复答题卡 | |
| 227 | + const { data, status, message } = await this.$request.modifyPaper({ | |
| 228 | + paperId: obj.id, | |
| 229 | + status: 2, | |
| 202 | 230 | }); |
| 203 | - // } else { | |
| 204 | - // this.$message.error(message); | |
| 205 | - // } | |
| 231 | + if (status == 0) { | |
| 232 | + let type = this.query.title ? 1 : 0; | |
| 233 | + this._QueryData(type); | |
| 234 | + } else { | |
| 235 | + this.$message.error(message); | |
| 236 | + } | |
| 206 | 237 | }, |
| 207 | - remove(obj) { | |
| 238 | + async remove(obj) { | |
| 208 | 239 | //删除答题卡 |
| 209 | - // const { data, code, message } = await this.$request.removeAnswerSheet(); | |
| 210 | - // if (code == 0) { | |
| 211 | - this.tableData = this.tableData.filter((item) => { | |
| 212 | - return obj.if != item.id; | |
| 240 | + const { data, status, message } = await this.$request.delPaper({ | |
| 241 | + paperId: obj.id, | |
| 213 | 242 | }); |
| 214 | - // } else { | |
| 215 | - // this.$message.error(message); | |
| 216 | - // } | |
| 243 | + if (status == 0) { | |
| 244 | + let type = this.query.title ? 1 : 0; | |
| 245 | + this._QueryData(type); | |
| 246 | + } else { | |
| 247 | + this.$message.error(message); | |
| 248 | + } | |
| 249 | + }, | |
| 250 | + //切换班级 | |
| 251 | + async changClazz() { | |
| 252 | + await this._QuerySubjectList(); | |
| 253 | + this._QueryData(false); | |
| 217 | 254 | }, |
| 218 | 255 | async _QueryData(type) { |
| 219 | 256 | //获取答题卡列表 |
| ... | ... | @@ -232,58 +269,62 @@ export default { |
| 232 | 269 | } |
| 233 | 270 | } |
| 234 | 271 | this.loading = true; |
| 235 | - const { data, code, message } = await this.$request.fetchAnswerList({ | |
| 272 | + const { data, status, message } = await this.$request.fetchAnswerList({ | |
| 236 | 273 | ...query, |
| 237 | 274 | }); |
| 238 | 275 | this.loading = false; |
| 239 | - if (code === 0) { | |
| 276 | + if (status === 0) { | |
| 240 | 277 | this.total = data.total; |
| 241 | 278 | this.tableData = (data.list && [...data.list]) || []; |
| 242 | 279 | } else { |
| 243 | 280 | this.$message.error(message); |
| 244 | 281 | } |
| 245 | 282 | }, |
| 246 | - // 查找答题卡类型 | |
| 247 | - async _QueryTypeList() { | |
| 248 | - const { data, code, message } = await this.$request.fetchTypeNames(); | |
| 249 | - if (code === 0) { | |
| 250 | - this.typeList = [...data.typeNames] || []; | |
| 283 | + // 查找班级 | |
| 284 | + async _QueryClassList() { | |
| 285 | + const { data, status, message } = await this.$request.fetchClassList(); | |
| 286 | + if (status === 0) { | |
| 287 | + if (!!data.list) { | |
| 288 | + this.classList = data.list.map((item) => { | |
| 289 | + return { | |
| 290 | + value: item.clazzId, | |
| 291 | + label: item.clazzName, | |
| 292 | + }; | |
| 293 | + }); | |
| 294 | + this.query.clazzId = this.classList[0]?.value; | |
| 295 | + } | |
| 251 | 296 | } else { |
| 252 | 297 | this.$message.error(message); |
| 253 | 298 | } |
| 254 | 299 | }, |
| 255 | - async changeGrade() { | |
| 256 | - // this._QueryData(); | |
| 257 | - // this._GradeList(); | |
| 258 | - // this._QuerySubjectList(); | |
| 259 | - }, | |
| 260 | - async _GradeList() { | |
| 261 | - //查询年级列表 | |
| 262 | - const { data, code, message } = await this.$request.fetchGradeList(); | |
| 263 | - if (code == 0) { | |
| 264 | - this.gradeList = [...data.gradeNames] || []; | |
| 265 | - this.query.gradeName = this.gradeList[0]; | |
| 266 | - this._QuerySubjectList(this.gradeList[0]); | |
| 300 | + // 查找科目 | |
| 301 | + async _QuerySubjectList() { | |
| 302 | + const { data, status, message } = await this.$request.fetchSubjectList({ | |
| 303 | + clazzId: this.query.clazzId, | |
| 304 | + }); | |
| 305 | + if (status === 0) { | |
| 306 | + this.subjectList = data.subjectNames.map((item) => { | |
| 307 | + return { | |
| 308 | + value: item, | |
| 309 | + label: item, | |
| 310 | + }; | |
| 311 | + }); | |
| 312 | + this.query.clazzId = this.subjectList[0]?.value; | |
| 267 | 313 | } else { |
| 268 | 314 | this.$message.error(message); |
| 269 | 315 | } |
| 270 | 316 | }, |
| 271 | - async _QuerySubjectList(grade, dont) { | |
| 272 | - //查询科目列表 | |
| 273 | - let param = {}; | |
| 274 | - if (grade) { | |
| 275 | - param.gradeName = grade; | |
| 276 | - } | |
| 277 | - const { data, code, message } = await this.$request.fetchSubjectList( | |
| 278 | - param | |
| 279 | - ); | |
| 280 | - if (code === 0) { | |
| 281 | - this.subjectList = data.list.map((item) => { | |
| 282 | - return { | |
| 283 | - value: item.subjectId, | |
| 284 | - label: item.subjectName, | |
| 285 | - }; | |
| 286 | - }); | |
| 317 | + // 查找答题卡类型 | |
| 318 | + async _QueryTypeList() { | |
| 319 | + const { data, status, message } = await this.$request.fetchTypeNames(); | |
| 320 | + if (status === 0) { | |
| 321 | + this.typeList = | |
| 322 | + data.subjectNames.map((item) => { | |
| 323 | + return { | |
| 324 | + value: item.tagId, | |
| 325 | + label: item.tag, | |
| 326 | + }; | |
| 327 | + }) || []; | |
| 287 | 328 | } else { |
| 288 | 329 | this.$message.error(message); |
| 289 | 330 | } | ... | ... |
src/views/index/mainIndex.vue
| 1 | 1 | <template> |
| 2 | 2 | <div class="container"> |
| 3 | - <ul class="nav-list" v-if="type == '学校管理员'"> | |
| 3 | + <ul class="nav-list" v-if="type == 'ROLE_XUEXIAO'"> | |
| 4 | 4 | <li class="nav-item item1" @click="links('/setUpAccount')"> |
| 5 | 5 | <img class="icon" src="../../assets/nav/setUpAccount.png" alt="" /> |
| 6 | 6 | <div class="text"> |
| ... | ... | @@ -44,7 +44,7 @@ |
| 44 | 44 | </ul> |
| 45 | 45 | <ul class="nav-list" v-if="type == 'ROLE_JITUAN'"> |
| 46 | 46 | <template v-for="item in navList"> |
| 47 | - <li v-if="item.path!='dataSync'" :key="item.path" class="nav-item item4" @click="links(item.path)"> | |
| 47 | + <li v-if="!item.path.includes('dataSync')" :key="item.path" class="nav-item item4" @click="links(item.path)"> | |
| 48 | 48 | <img class="icon" :src="getImgs(item.path)" alt="" /> |
| 49 | 49 | <div class="text" v-if="item.path == '/setUpConglomerate'"> |
| 50 | 50 | <p class="p1">学校管理</p> |
| ... | ... | @@ -65,9 +65,9 @@ |
| 65 | 65 | </li> |
| 66 | 66 | </template> |
| 67 | 67 | </ul> |
| 68 | - <ul class="nav-list" v-if="type == 'superAdmin' || type == '任课老师' "> | |
| 69 | - <template v-for="item in navList"> | |
| 70 | - <li v-if="item.path!='dataSync'" :key="item.path" class="nav-item item4" @click="links(item.path)"> | |
| 68 | + <ul class="nav-list" v-if="type == 'ROLE_JIAOSHI' || type == 'ROLE_BANZHUREN' "> | |
| 69 | + <template v-for="(item) in navList"> | |
| 70 | + <li v-if="!item.path.includes('dataSync')" :key="item.path" class="nav-item item4" @click="links(item.path)"> | |
| 71 | 71 | <img class="icon" :src="getImgs(item.path)" alt="" /> |
| 72 | 72 | <div class="text" v-if="item.path == '/examinationPaper'"> |
| 73 | 73 | <p class="p1">备题组卷</p> | ... | ... |
src/views/layout/header/header.vue
| ... | ... | @@ -3,7 +3,8 @@ |
| 3 | 3 | <el-header id="header"> |
| 4 | 4 | <span class="hideAside" @click="collapse" |
| 5 | 5 | ><i class="el-icon-s-fold" v-show="!isCollapse"></i> |
| 6 | - <i class="el-icon-s-unfold" v-show="isCollapse"></i></span> | |
| 6 | + <i class="el-icon-s-unfold" v-show="isCollapse"></i | |
| 7 | + ></span> | |
| 7 | 8 | <ul class="personal"> |
| 8 | 9 | <!-- <li> |
| 9 | 10 | <langSelect></langSelect> |
| ... | ... | @@ -63,11 +64,10 @@ import Cookies from "js-cookie"; |
| 63 | 64 | import langSelect from "../../../components/lang/langSelect"; |
| 64 | 65 | import tabNav from "./tabNav"; |
| 65 | 66 | import UserInfo from "../../../components/userForm/userInfo"; |
| 66 | -import EditPassword from "../../../components/userForm/editPassword"; | |
| 67 | 67 | |
| 68 | 68 | export default { |
| 69 | 69 | name: "Header", |
| 70 | - components: { EditPassword, tabNav, langSelect, UserInfo }, | |
| 70 | + components: { tabNav, langSelect, UserInfo }, | |
| 71 | 71 | computed: { |
| 72 | 72 | permissions: function () { |
| 73 | 73 | return this.$store.getters.info.permissions || []; |
| ... | ... | @@ -81,15 +81,15 @@ export default { |
| 81 | 81 | dialogPassVisible: false, |
| 82 | 82 | title: "", |
| 83 | 83 | userId: "", |
| 84 | - isCollapse:false, | |
| 84 | + isCollapse: false, | |
| 85 | 85 | }; |
| 86 | 86 | }, |
| 87 | - created(){ | |
| 88 | - this.isCollapse = this.$store.getters.isCollapse | |
| 87 | + created() { | |
| 88 | + this.isCollapse = this.$store.getters.isCollapse; | |
| 89 | 89 | }, |
| 90 | 90 | methods: { |
| 91 | 91 | collapse() { |
| 92 | - this.isCollapse = !this.isCollapse | |
| 92 | + this.isCollapse = !this.isCollapse; | |
| 93 | 93 | this.$store.dispatch("collapse"); |
| 94 | 94 | }, |
| 95 | 95 | successCallback() { |
| ... | ... | @@ -128,10 +128,19 @@ export default { |
| 128 | 128 | //刷新权限跳转首页 |
| 129 | 129 | this.$store.dispatch("permissions", this); |
| 130 | 130 | }, |
| 131 | - logOut() { | |
| 132 | - this.$router.push({ | |
| 133 | - path: "/login", | |
| 134 | - }); | |
| 131 | + async logOut() { | |
| 132 | + const { data } = await this.$request.logout(); | |
| 133 | + if (data.status == 0) { | |
| 134 | + if (data.data) { | |
| 135 | + window.location.href = data; | |
| 136 | + } else { | |
| 137 | + this.$router.push({ | |
| 138 | + path: "/login", | |
| 139 | + }); | |
| 140 | + } | |
| 141 | + } else { | |
| 142 | + this.$message.error(message); | |
| 143 | + } | |
| 135 | 144 | }, |
| 136 | 145 | }, |
| 137 | 146 | }; |
| ... | ... | @@ -178,11 +187,11 @@ ul.el-menu { |
| 178 | 187 | display: flex; |
| 179 | 188 | justify-content: space-between; |
| 180 | 189 | color: #fff; |
| 181 | - padding:0 20px 0 10px; | |
| 190 | + padding: 0 20px 0 10px; | |
| 182 | 191 | .hideAside { |
| 183 | 192 | @extend %cursor; |
| 184 | - i{ | |
| 185 | - font-size:24px; | |
| 193 | + i { | |
| 194 | + font-size: 24px; | |
| 186 | 195 | line-height: 50px; |
| 187 | 196 | } |
| 188 | 197 | } | ... | ... |
src/views/login/index.vue
| ... | ... | @@ -90,16 +90,16 @@ export default { |
| 90 | 90 | disableClick: true, |
| 91 | 91 | passwordType: "password", |
| 92 | 92 | loginForm: { |
| 93 | - username: "15911715665", | |
| 94 | - password: "Csiy88888", | |
| 93 | + username: "13028102196", | |
| 94 | + password: "Pw102196#", | |
| 95 | 95 | }, |
| 96 | 96 | loginRules: { |
| 97 | 97 | username: [ |
| 98 | - { required: true, message: "请输入用户账号",trigger: "blur" } | |
| 98 | + { required: true, message: "请输入用户账号", trigger: "blur" }, | |
| 99 | 99 | ], |
| 100 | 100 | password: [ |
| 101 | - { required: true, message: "请输入账号密码",trigger: "blur" } | |
| 102 | - ] | |
| 101 | + { required: true, message: "请输入账号密码", trigger: "blur" }, | |
| 102 | + ], | |
| 103 | 103 | }, |
| 104 | 104 | url: "", |
| 105 | 105 | }; |
| ... | ... | @@ -127,7 +127,7 @@ export default { |
| 127 | 127 | }); |
| 128 | 128 | return false; |
| 129 | 129 | } else { |
| 130 | - this.$store.dispatch("Login",{...this.loginForm,url:this.url}) | |
| 130 | + this.$store.dispatch("Login", { ...this.loginForm, url: this.url }); | |
| 131 | 131 | } |
| 132 | 132 | }, |
| 133 | 133 | }, |
| ... | ... | @@ -140,10 +140,8 @@ $dark_gray: #889aa4; |
| 140 | 140 | $light_gray: #000; |
| 141 | 141 | $cursor: #000; |
| 142 | 142 | |
| 143 | -@supports (-webkit-mask: none) and (not (cater-color: $cursor)) { | |
| 144 | - .login-container .el-input input { | |
| 145 | - color: $cursor; | |
| 146 | - } | |
| 143 | +.login-container .el-input input { | |
| 144 | + color: $cursor; | |
| 147 | 145 | } |
| 148 | 146 | .login-container { |
| 149 | 147 | width: 100%; |
| ... | ... | @@ -166,7 +164,7 @@ $cursor: #000; |
| 166 | 164 | border: 0px; |
| 167 | 165 | -webkit-appearance: none; |
| 168 | 166 | border-radius: 0px; |
| 169 | - font-size:16px; | |
| 167 | + font-size: 16px; | |
| 170 | 168 | color: $light_gray; |
| 171 | 169 | height: 52px; |
| 172 | 170 | caret-color: $cursor; | ... | ... |
vue.config.js
| ... | ... | @@ -20,13 +20,13 @@ module.exports = { |
| 20 | 20 | warnings: false, |
| 21 | 21 | errors: true, |
| 22 | 22 | }, |
| 23 | - // proxy: { | |
| 24 | - // "/": { | |
| 25 | - // target:"http://192.168.3.29:8080", | |
| 26 | - // changeOrigin: true, | |
| 27 | - // ws:true, | |
| 28 | - // }, | |
| 29 | - // }, | |
| 23 | + proxy: { | |
| 24 | + "/": { | |
| 25 | + target:"http://192.168.3.29:8080", | |
| 26 | + changeOrigin: true, | |
| 27 | + ws:true, | |
| 28 | + }, | |
| 29 | + }, | |
| 30 | 30 | disableHostCheck: true |
| 31 | 31 | }, |
| 32 | 32 | css: { | ... | ... |