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
src/views/ask/index.vue
... | ... | @@ -471,7 +471,7 @@ |
471 | 471 | |
472 | 472 | <script> |
473 | 473 | import { formatDate, deepClone, downloadFile } from "utils"; |
474 | -import BusEvent from "@/utils/busEvent"; | |
474 | +import BusEvent from "@/utils/busEvent"; | |
475 | 475 | export default { |
476 | 476 | data() { |
477 | 477 | return { |
... | ... | @@ -977,12 +977,7 @@ export default { |
977 | 977 | let blob = new Blob([data], { |
978 | 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 | 981 | } else { |
987 | 982 | this.$message.error("下载失败"); |
988 | 983 | } | ... | ... |
src/views/examinationPaper/add.vue
... | ... | @@ -1106,7 +1106,6 @@ export default { |
1106 | 1106 | answer |
1107 | 1107 | ); |
1108 | 1108 | obj.answerList = resault.text; |
1109 | - console.log(resault.startPos); | |
1110 | 1109 | let str = obj.answerList; |
1111 | 1110 | let str2; |
1112 | 1111 | if (!!obj.answerOptions) { |
... | ... | @@ -1114,10 +1113,10 @@ export default { |
1114 | 1113 | str, |
1115 | 1114 | 3, |
1116 | 1115 | obj.answerOptions.split(",").length, |
1117 | - obj.answerList.length | |
1116 | + obj.subNum | |
1118 | 1117 | ); |
1119 | 1118 | } else { |
1120 | - str2 = checkAnswer(str, 3, obj.selectNum, obj.answerList.length); | |
1119 | + str2 = checkAnswer(str, 3, obj.selectNum, obj.number); | |
1121 | 1120 | } |
1122 | 1121 | obj.answerList = str2; |
1123 | 1122 | elements.focus(); |
... | ... | @@ -1501,6 +1500,7 @@ export default { |
1501 | 1500 | subQuestions.answerOptions = this.rightOptions |
1502 | 1501 | .slice(0, subQuestions.selectNum) |
1503 | 1502 | .join(","); |
1503 | + subQuestions.correctAnswer = subQuestions.correctAnswer.slice(0, subQuestions.selectNum) | |
1504 | 1504 | }, |
1505 | 1505 | changAnswer(sub, option) { |
1506 | 1506 | //设置多选答案 |
... | ... | @@ -1690,6 +1690,7 @@ export default { |
1690 | 1690 | return { |
1691 | 1691 | questionTitle: item.questionTitle, |
1692 | 1692 | subQuestions: subQuestions, |
1693 | + show:false | |
1693 | 1694 | }; |
1694 | 1695 | }); |
1695 | 1696 | } else { | ... | ... |
src/views/examinationPaper/edit.vue
src/views/layout/header/header.vue
... | ... | @@ -40,7 +40,17 @@ |
40 | 40 | effect="dark" |
41 | 41 | content="全屏" |
42 | 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 | 54 | ></el-tooltip> |
45 | 55 | </li> |
46 | 56 | <li> |
... | ... | @@ -50,7 +60,7 @@ |
50 | 60 | content="退出" |
51 | 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 | 64 | ></el-tooltip> |
55 | 65 | </li> |
56 | 66 | </ul> |
... | ... | @@ -62,7 +72,7 @@ |
62 | 72 | <script> |
63 | 73 | import langSelect from "../../../components/lang/langSelect"; |
64 | 74 | import tabNav from "./tabNav"; |
65 | - | |
75 | +import _ from "lodash"; | |
66 | 76 | export default { |
67 | 77 | name: "Header", |
68 | 78 | components: { tabNav, langSelect }, |
... | ... | @@ -73,6 +83,7 @@ export default { |
73 | 83 | }, |
74 | 84 | data() { |
75 | 85 | return { |
86 | + code: "", | |
76 | 87 | isfullScreen: true, |
77 | 88 | avatar: require("@/assets/images/womandefault.png"), |
78 | 89 | dialogInfoVisible: false, |
... | ... | @@ -83,9 +94,22 @@ export default { |
83 | 94 | }; |
84 | 95 | }, |
85 | 96 | created() { |
97 | + this.code = localStorage.getItem("csCode") || ""; | |
86 | 98 | this.isCollapse = this.$store.getters.isCollapse; |
87 | 99 | }, |
88 | 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 | 113 | collapse() { |
90 | 114 | this.isCollapse = !this.isCollapse; |
91 | 115 | this.$store.dispatch("collapse"); |
... | ... | @@ -127,7 +151,7 @@ export default { |
127 | 151 | this.$store.dispatch("permissions", command); |
128 | 152 | }, |
129 | 153 | async logOut() { |
130 | - const { data, status } = await this.$request.logout(); | |
154 | + const { data, status, info } = await this.$request.logout(); | |
131 | 155 | if (status == 0) { |
132 | 156 | if (data) { |
133 | 157 | window.location.href = data; |
... | ... | @@ -139,10 +163,10 @@ export default { |
139 | 163 | this.$router.push({ |
140 | 164 | path: "/login", |
141 | 165 | }); |
142 | - window.location.reload() | |
166 | + window.location.reload(); | |
143 | 167 | } |
144 | 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 | 254 | height: 28px; |
231 | 255 | } |
232 | 256 | } |
233 | - .el-icon-rank { | |
257 | + .el-icon { | |
234 | 258 | font-size: 20px; |
235 | - transform: rotate(45deg); | |
236 | - line-height: 50px; | |
237 | - } | |
238 | - .el-icon-switch-button { | |
239 | - font-size: 18px; | |
240 | 259 | line-height: 50px; |
241 | 260 | } |
242 | 261 | .fa-lg { | ... | ... |
src/views/test/editAnswer.vue