Commit b2d3d803cf64e5fae6bd4756bade1dd832109764
1 parent
def690b2
批量设置答案优化
Showing
8 changed files
with
48 additions
and
26 deletions
src/api/apis/login.js
src/api/urls/login.js
src/components/setAnswer.vue
| @@ -420,7 +420,7 @@ export default { | @@ -420,7 +420,7 @@ export default { | ||
| 420 | str, | 420 | str, |
| 421 | 3, | 421 | 3, |
| 422 | obj.answerOptions.split(",").length, | 422 | obj.answerOptions.split(",").length, |
| 423 | - obj.answerList.length | 423 | + obj.subNum |
| 424 | ); | 424 | ); |
| 425 | obj.answerList = str2; | 425 | obj.answerList = str2; |
| 426 | this.$refs.formAnsIpt.$el.children[0].focus(); | 426 | this.$refs.formAnsIpt.$el.children[0].focus(); |
src/views/ask/index.vue
| @@ -471,7 +471,7 @@ | @@ -471,7 +471,7 @@ | ||
| 471 | 471 | ||
| 472 | <script> | 472 | <script> |
| 473 | import { formatDate, deepClone, downloadFile } from "utils"; | 473 | import { formatDate, deepClone, downloadFile } from "utils"; |
| 474 | -import BusEvent from "@/utils/busEvent"; | 474 | +import BusEvent from "@/utils/busEvent"; |
| 475 | export default { | 475 | export default { |
| 476 | data() { | 476 | data() { |
| 477 | return { | 477 | return { |
| @@ -977,12 +977,7 @@ export default { | @@ -977,12 +977,7 @@ export default { | ||
| 977 | let blob = new Blob([data], { | 977 | let blob = new Blob([data], { |
| 978 | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", | 978 | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", |
| 979 | }); | 979 | }); |
| 980 | - downloadFile( | ||
| 981 | - this.tabIndex == 2 | ||
| 982 | - ? "随堂问-阶段问答报表.xlsx" | ||
| 983 | - : "随堂问-阶段互动报表.xlsx", | ||
| 984 | - blob | ||
| 985 | - ); | 980 | + downloadFile("随堂问-阶段报表.xlsx", blob); |
| 986 | } else { | 981 | } else { |
| 987 | this.$message.error("下载失败"); | 982 | this.$message.error("下载失败"); |
| 988 | } | 983 | } |
src/views/examinationPaper/add.vue
| @@ -1106,7 +1106,6 @@ export default { | @@ -1106,7 +1106,6 @@ export default { | ||
| 1106 | answer | 1106 | answer |
| 1107 | ); | 1107 | ); |
| 1108 | obj.answerList = resault.text; | 1108 | obj.answerList = resault.text; |
| 1109 | - console.log(resault.startPos); | ||
| 1110 | let str = obj.answerList; | 1109 | let str = obj.answerList; |
| 1111 | let str2; | 1110 | let str2; |
| 1112 | if (!!obj.answerOptions) { | 1111 | if (!!obj.answerOptions) { |
| @@ -1114,10 +1113,10 @@ export default { | @@ -1114,10 +1113,10 @@ export default { | ||
| 1114 | str, | 1113 | str, |
| 1115 | 3, | 1114 | 3, |
| 1116 | obj.answerOptions.split(",").length, | 1115 | obj.answerOptions.split(",").length, |
| 1117 | - obj.answerList.length | 1116 | + obj.subNum |
| 1118 | ); | 1117 | ); |
| 1119 | } else { | 1118 | } else { |
| 1120 | - str2 = checkAnswer(str, 3, obj.selectNum, obj.answerList.length); | 1119 | + str2 = checkAnswer(str, 3, obj.selectNum, obj.number); |
| 1121 | } | 1120 | } |
| 1122 | obj.answerList = str2; | 1121 | obj.answerList = str2; |
| 1123 | elements.focus(); | 1122 | elements.focus(); |
| @@ -1501,6 +1500,7 @@ export default { | @@ -1501,6 +1500,7 @@ export default { | ||
| 1501 | subQuestions.answerOptions = this.rightOptions | 1500 | subQuestions.answerOptions = this.rightOptions |
| 1502 | .slice(0, subQuestions.selectNum) | 1501 | .slice(0, subQuestions.selectNum) |
| 1503 | .join(","); | 1502 | .join(","); |
| 1503 | + subQuestions.correctAnswer = subQuestions.correctAnswer.slice(0, subQuestions.selectNum) | ||
| 1504 | }, | 1504 | }, |
| 1505 | changAnswer(sub, option) { | 1505 | changAnswer(sub, option) { |
| 1506 | //设置多选答案 | 1506 | //设置多选答案 |
| @@ -1690,6 +1690,7 @@ export default { | @@ -1690,6 +1690,7 @@ export default { | ||
| 1690 | return { | 1690 | return { |
| 1691 | questionTitle: item.questionTitle, | 1691 | questionTitle: item.questionTitle, |
| 1692 | subQuestions: subQuestions, | 1692 | subQuestions: subQuestions, |
| 1693 | + show:false | ||
| 1693 | }; | 1694 | }; |
| 1694 | }); | 1695 | }); |
| 1695 | } else { | 1696 | } else { |
src/views/examinationPaper/edit.vue
| @@ -518,7 +518,7 @@ export default { | @@ -518,7 +518,7 @@ export default { | ||
| 518 | str, | 518 | str, |
| 519 | 3, | 519 | 3, |
| 520 | obj.answerOptions.split(",").length, | 520 | obj.answerOptions.split(",").length, |
| 521 | - obj.answerList.length | 521 | + obj.subNum |
| 522 | ); | 522 | ); |
| 523 | obj.answerList = str2; | 523 | obj.answerList = str2; |
| 524 | this.$refs.formAnsIpt.$el.children[0].focus(); | 524 | this.$refs.formAnsIpt.$el.children[0].focus(); |
src/views/layout/header/header.vue
| @@ -40,7 +40,17 @@ | @@ -40,7 +40,17 @@ | ||
| 40 | effect="dark" | 40 | effect="dark" |
| 41 | content="全屏" | 41 | content="全屏" |
| 42 | placement="bottom" | 42 | placement="bottom" |
| 43 | - ><i class="el-icon-rank"></i | 43 | + ><i class="el-icon el-icon-full-screen"></i |
| 44 | + ></el-tooltip> | ||
| 45 | + </li> | ||
| 46 | + <li v-if="code"> | ||
| 47 | + <el-tooltip | ||
| 48 | + class="item" | ||
| 49 | + effect="dark" | ||
| 50 | + content="老平台入口" | ||
| 51 | + placement="bottom" | ||
| 52 | + > | ||
| 53 | + <i @click="_LinkOld" class="el-icon el-icon-guide"></i | ||
| 44 | ></el-tooltip> | 54 | ></el-tooltip> |
| 45 | </li> | 55 | </li> |
| 46 | <li> | 56 | <li> |
| @@ -50,7 +60,7 @@ | @@ -50,7 +60,7 @@ | ||
| 50 | content="退出" | 60 | content="退出" |
| 51 | placement="bottom" | 61 | placement="bottom" |
| 52 | > | 62 | > |
| 53 | - <i @click="logOut" class="el-icon-switch-button"></i | 63 | + <i @click="logOut" class="el-icon el-icon-switch-button"></i |
| 54 | ></el-tooltip> | 64 | ></el-tooltip> |
| 55 | </li> | 65 | </li> |
| 56 | </ul> | 66 | </ul> |
| @@ -62,7 +72,7 @@ | @@ -62,7 +72,7 @@ | ||
| 62 | <script> | 72 | <script> |
| 63 | import langSelect from "../../../components/lang/langSelect"; | 73 | import langSelect from "../../../components/lang/langSelect"; |
| 64 | import tabNav from "./tabNav"; | 74 | import tabNav from "./tabNav"; |
| 65 | - | 75 | +import _ from "lodash"; |
| 66 | export default { | 76 | export default { |
| 67 | name: "Header", | 77 | name: "Header", |
| 68 | components: { tabNav, langSelect }, | 78 | components: { tabNav, langSelect }, |
| @@ -73,6 +83,7 @@ export default { | @@ -73,6 +83,7 @@ export default { | ||
| 73 | }, | 83 | }, |
| 74 | data() { | 84 | data() { |
| 75 | return { | 85 | return { |
| 86 | + code: "", | ||
| 76 | isfullScreen: true, | 87 | isfullScreen: true, |
| 77 | avatar: require("@/assets/images/womandefault.png"), | 88 | avatar: require("@/assets/images/womandefault.png"), |
| 78 | dialogInfoVisible: false, | 89 | dialogInfoVisible: false, |
| @@ -83,9 +94,22 @@ export default { | @@ -83,9 +94,22 @@ export default { | ||
| 83 | }; | 94 | }; |
| 84 | }, | 95 | }, |
| 85 | created() { | 96 | created() { |
| 97 | + this.code = localStorage.getItem("csCode") || ""; | ||
| 86 | this.isCollapse = this.$store.getters.isCollapse; | 98 | this.isCollapse = this.$store.getters.isCollapse; |
| 87 | }, | 99 | }, |
| 88 | methods: { | 100 | methods: { |
| 101 | + _LinkOld: _.throttle( | ||
| 102 | + async function () { | ||
| 103 | + const { data, status, info } = await this.$request.logout(); | ||
| 104 | + if (status == 0) { | ||
| 105 | + window.location.href = data; | ||
| 106 | + } else { | ||
| 107 | + this.$message.error(info); | ||
| 108 | + } | ||
| 109 | + }, | ||
| 110 | + 2000, | ||
| 111 | + { leading: true, trailing: false } | ||
| 112 | + ), | ||
| 89 | collapse() { | 113 | collapse() { |
| 90 | this.isCollapse = !this.isCollapse; | 114 | this.isCollapse = !this.isCollapse; |
| 91 | this.$store.dispatch("collapse"); | 115 | this.$store.dispatch("collapse"); |
| @@ -127,7 +151,7 @@ export default { | @@ -127,7 +151,7 @@ export default { | ||
| 127 | this.$store.dispatch("permissions", command); | 151 | this.$store.dispatch("permissions", command); |
| 128 | }, | 152 | }, |
| 129 | async logOut() { | 153 | async logOut() { |
| 130 | - const { data, status } = await this.$request.logout(); | 154 | + const { data, status, info } = await this.$request.logout(); |
| 131 | if (status == 0) { | 155 | if (status == 0) { |
| 132 | if (data) { | 156 | if (data) { |
| 133 | window.location.href = data; | 157 | window.location.href = data; |
| @@ -139,10 +163,10 @@ export default { | @@ -139,10 +163,10 @@ export default { | ||
| 139 | this.$router.push({ | 163 | this.$router.push({ |
| 140 | path: "/login", | 164 | path: "/login", |
| 141 | }); | 165 | }); |
| 142 | - window.location.reload() | 166 | + window.location.reload(); |
| 143 | } | 167 | } |
| 144 | } else { | 168 | } else { |
| 145 | - this.$message.error(message); | 169 | + this.$message.error(info); |
| 146 | } | 170 | } |
| 147 | }, | 171 | }, |
| 148 | }, | 172 | }, |
| @@ -230,13 +254,8 @@ ul.el-menu { | @@ -230,13 +254,8 @@ ul.el-menu { | ||
| 230 | height: 28px; | 254 | height: 28px; |
| 231 | } | 255 | } |
| 232 | } | 256 | } |
| 233 | - .el-icon-rank { | 257 | + .el-icon { |
| 234 | font-size: 20px; | 258 | font-size: 20px; |
| 235 | - transform: rotate(45deg); | ||
| 236 | - line-height: 50px; | ||
| 237 | - } | ||
| 238 | - .el-icon-switch-button { | ||
| 239 | - font-size: 18px; | ||
| 240 | line-height: 50px; | 259 | line-height: 50px; |
| 241 | } | 260 | } |
| 242 | .fa-lg { | 261 | .fa-lg { |
src/views/test/editAnswer.vue
| @@ -495,7 +495,7 @@ export default { | @@ -495,7 +495,7 @@ export default { | ||
| 495 | str, | 495 | str, |
| 496 | 3, | 496 | 3, |
| 497 | obj.answerOptions.split(",").length, | 497 | obj.answerOptions.split(",").length, |
| 498 | - obj.answerList.length | 498 | + obj.subNum |
| 499 | ); | 499 | ); |
| 500 | obj.answerList = str2; | 500 | obj.answerList = str2; |
| 501 | this.$refs.formAnsIpt.$el.children[0].focus(); | 501 | this.$refs.formAnsIpt.$el.children[0].focus(); |