Commit b2d3d803cf64e5fae6bd4756bade1dd832109764

Authored by 梁保满
1 parent def690b2

批量设置答案优化

src/api/apis/login.js
... ... @@ -25,4 +25,10 @@ export default {
25 25 data
26 26 })
27 27 },
  28 + linkOld() {
  29 + return service({
  30 + url: loginUrls.linkOld,
  31 + method: 'POST',
  32 + })
  33 + },
28 34 }
... ...
src/api/urls/login.js
... ... @@ -3,5 +3,6 @@ export default {
3 3 // 账号密码登陆
4 4 login: "/web/login",
5 5 ssoLogin: "/sso/login",
6   - logout: "/api_html/logout"
  6 + logout: "/api_html/logout",
  7 + linkOld: "/api_html/linkOld"
7 8 }
... ...
src/components/setAnswer.vue
... ... @@ -420,7 +420,7 @@ export default {
420 420 str,
421 421 3,
422 422 obj.answerOptions.split(",").length,
423   - obj.answerList.length
  423 + obj.subNum
424 424 );
425 425 obj.answerList = str2;
426 426 this.$refs.formAnsIpt.$el.children[0].focus();
... ...
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
... ... @@ -518,7 +518,7 @@ export default {
518 518 str,
519 519 3,
520 520 obj.answerOptions.split(",").length,
521   - obj.answerList.length
  521 + obj.subNum
522 522 );
523 523 obj.answerList = str2;
524 524 this.$refs.formAnsIpt.$el.children[0].focus();
... ...
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
... ... @@ -495,7 +495,7 @@ export default {
495 495 str,
496 496 3,
497 497 obj.answerOptions.split(",").length,
498   - obj.answerList.length
  498 + obj.subNum
499 499 );
500 500 obj.answerList = str2;
501 501 this.$refs.formAnsIpt.$el.children[0].focus();
... ...