TpScoreBoard.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068
  1. <template>
  2. <div class="scoreboard pull-right">
  3. <div class="board-margin">
  4. <div class="first-board">
  5. <span class="title-font">操作方式切换:</span>
  6. <el-switch
  7. class="pull-right"
  8. v-model="isMouseMode"
  9. active-text="鼠标"
  10. inactive-text="键盘"
  11. active-color="#4cb0f9"
  12. inactive-color="#13ce66"
  13. ></el-switch>
  14. </div>
  15. <div class="second-board">
  16. <div class="board-title"><span>总分</span></div>
  17. <div class="board-score">
  18. <span>{{ this.totalScore }}分</span>
  19. </div>
  20. </div>
  21. <!-- 鼠标模式 -->
  22. <div v-if="isMouseMode">
  23. <div class="title-board"><span class="title-font">评分</span></div>
  24. <div class="itemScroll">
  25. <div
  26. :key="resultItem.markItem.id"
  27. v-for="(resultItem, index) in resultItems"
  28. class="pull-left scoretitle titlebutton"
  29. size="small"
  30. :id="resultItem.markItem.id"
  31. @click="
  32. itemClick(
  33. resultItem.markItem.id,
  34. $event,
  35. resultItem.markItem.orders
  36. )
  37. "
  38. >
  39. <div
  40. v-bind:class="{ 'active-btn': itemClass[index] }"
  41. class="title-item-top"
  42. >
  43. <span>
  44. {{ resultItem.markItem.mainNumber }}({{
  45. resultItem.markItem.orders
  46. }})
  47. </span>
  48. </div>
  49. <div
  50. class="title-item-bottom"
  51. v-bind:class="{ 'active-text': itemClass[index] }"
  52. >
  53. <span>{{ resultItem.score }}分</span>
  54. </div>
  55. </div>
  56. </div>
  57. <div v-if="markTypeView">
  58. <div class="step-board"></div>
  59. <div class="title-board"><span class="title-font">打分</span></div>
  60. <div class="itemScroll">
  61. <div
  62. :key="score"
  63. v-for="(score, index) in itemScores"
  64. class="pull-left scoretitle"
  65. >
  66. <div
  67. @click="scoreClick(score, index)"
  68. class="scorebutton"
  69. v-bind:class="{ 'score-btn': itemScoreBtn[index] }"
  70. >
  71. <span class="score-item">{{ score }}</span>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. <!-- 键盘模式 -->
  78. <div v-if="!isMouseMode">
  79. <div class="title-board"><span class="title-font">评分</span></div>
  80. <div>
  81. <div class="itemScroll">
  82. <div
  83. :key="resultItem.markItem.id"
  84. v-for="(resultItem, index) in resultItems"
  85. class="scoretitle"
  86. >
  87. <div class="box-card">
  88. <div class="item-title">
  89. <div class="pull-left item-number">
  90. {{ resultItem.markItem.mainNumber }}({{
  91. resultItem.markItem.orders
  92. }})
  93. </div>
  94. <div class="pull-left item-number2">
  95. <span>{{ resultItem.markItem.maxScore }}分</span>
  96. </div>
  97. <div class="pull-left item-number3">
  98. 间隔:{{ resultItem.markItem.scoreInterval }}
  99. </div>
  100. </div>
  101. <div class="item-score">
  102. <input
  103. :id="getItemId(resultItem.markItem.id)"
  104. @focus="scoreFocus(resultItem)"
  105. @keydown.enter="scoreEnter(index, resultItem)"
  106. @keydown.up="scoreUp(index, resultItem)"
  107. @keydown.down="scoreDown(index, resultItem)"
  108. @change="scoreChange(index, resultItem.score)"
  109. v-model="resultItem.score"
  110. class="score-input"
  111. />
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <div>
  119. <div class="step-board"></div>
  120. <div class="title-board">
  121. <span class="title-font">备注</span>
  122. <div
  123. v-if="!textareaflag"
  124. class="el-icon-caret-right remark-board"
  125. @click="showTextarea"
  126. ></div>
  127. <div
  128. v-if="textareaflag"
  129. class="el-icon-caret-top remark-board"
  130. @click="showTextarea"
  131. ></div>
  132. </div>
  133. <div class="remark-step" v-if="textareaflag">
  134. <textarea
  135. id="remark"
  136. type="text"
  137. rows="3"
  138. cols="35"
  139. placeholder="请输入内容"
  140. v-model="markedResult.markRemark"
  141. />
  142. </div>
  143. </div>
  144. <div>
  145. <div v-if="problemView">
  146. <div class="problem-button"></div>
  147. <span v-if="tagFlag">
  148. <el-radio-group
  149. v-model="markedResult.tag"
  150. @change="processTagPaper"
  151. >
  152. <div
  153. class="pull-left scoretitle"
  154. v-for="tag in tags"
  155. :key="tag.code"
  156. >
  157. <el-radio :label="tag.code">{{ tag.name }}</el-radio>
  158. </div>
  159. </el-radio-group>
  160. </span>
  161. <span v-if="!tagFlag">
  162. <el-radio-group v-model="unusualType" @change="processTagPaper">
  163. <div
  164. class="pull-left scoretitle"
  165. v-for="tag in tags"
  166. :key="tag.code"
  167. >
  168. <el-radio :label="tag.code" :key="tag.code">{{
  169. tag.name
  170. }}</el-radio>
  171. </div>
  172. </el-radio-group>
  173. </span>
  174. </div>
  175. <div class="pull-left btn" v-if="paperMark">
  176. <el-button
  177. id="subMarkBtn"
  178. class="submit-button"
  179. type="primary"
  180. size="small"
  181. @keydown.enter="submitMark"
  182. @click="submitMark"
  183. v-bind:round="true"
  184. :loading="loading"
  185. >
  186. <span class="sub-btn">提</span> <span>交</span>
  187. </el-button>
  188. </div>
  189. <div class="pull-left btn" v-if="paperMark">
  190. <el-button
  191. type="danger"
  192. v-bind:round="true"
  193. size="small"
  194. @click="problemClick"
  195. >问题卷</el-button
  196. >
  197. </div>
  198. <div class="pull-left btn" v-if="paperMark && problemView">
  199. <el-button
  200. type="danger"
  201. v-bind:round="true"
  202. size="small"
  203. @click="resetProblem"
  204. >清除问题卷</el-button
  205. >
  206. </div>
  207. </div>
  208. </div>
  209. </div>
  210. </template>
  211. <script>
  212. import { mapActions } from "vuex";
  213. import { USER_SIGNOUT } from "../../portal/store/user";
  214. import { mapState } from "vuex";
  215. import { CORE_API, MARKING_API } from "@/constants/constants";
  216. import { EVENTHUB } from "../constants/constants";
  217. export default {
  218. data() {
  219. return {
  220. activeName: "first",
  221. markType: "mouse",
  222. isMouseMode: true,
  223. op: "first",
  224. maxScore: 0,
  225. markItemId: "",
  226. resultItem: {
  227. markItem: {},
  228. score: 0
  229. },
  230. markTypeView: false,
  231. problemView: false,
  232. markBack: false,
  233. markSame: false,
  234. markBlank: false,
  235. markDiff: false,
  236. curIndex: 0,
  237. steps: [],
  238. btnflag: false,
  239. textareaflag: false,
  240. tmpSignItem: this.signItem,
  241. tags: [],
  242. unusualType: "",
  243. scoreError: [],
  244. itemScoreBtn: [],
  245. loading: false
  246. };
  247. },
  248. props: [
  249. "paperMarkSign",
  250. "signScores",
  251. "signChange",
  252. "signOption",
  253. "markSign",
  254. "markRange",
  255. "studentPaperId",
  256. "markTaskId",
  257. "resultItems",
  258. "markedResult",
  259. "paperMark"
  260. ],
  261. methods: {
  262. ...mapActions([USER_SIGNOUT]),
  263. resetProblem() {
  264. if (this.markedResult.tag) {
  265. this.markedResult.tag = "";
  266. }
  267. if (this.unusualType) {
  268. this.unusualType = "";
  269. }
  270. },
  271. //处理问题卷
  272. processTagPaper() {
  273. if (!this.markedResult.id) {
  274. if (this.unusualType) {
  275. for (let resultItem of this.resultItems) {
  276. resultItem.score = 0;
  277. }
  278. }
  279. } else {
  280. if (this.markedResult.tag) {
  281. for (let resultItem of this.resultItems) {
  282. resultItem.score = 0;
  283. }
  284. }
  285. }
  286. },
  287. getTags() {
  288. this.$http.get(MARKING_API + "/markResults/tag").then(response => {
  289. this.tags = response.data;
  290. //移除科目错误
  291. for (let i = 0; i < this.tags.length; i++) {
  292. if (this.tags[i].code === "SUBJECT_ERROR") {
  293. this.tags.splice(i, 1);
  294. }
  295. }
  296. });
  297. },
  298. //在内存中对试卷进行标记保存
  299. saveMarkSign() {
  300. localStorage.removeItem(this.paperKey);
  301. localStorage.setItem(this.paperKey, JSON.stringify(this.paperMarkSign));
  302. },
  303. checkItemClass(resultItem) {
  304. if (resultItem.score.length > 0) {
  305. return true;
  306. } else {
  307. return false;
  308. }
  309. },
  310. itemClick(id, event, order) {
  311. this.markTypeView = true;
  312. this.resultItems.find((value, index) => {
  313. if (value.markItem.id === id) {
  314. this.maxScore = value.markItem.maxScore;
  315. this.markItemId = value.markItem.id;
  316. if (value.score.length > 0) {
  317. this.resultItem = value;
  318. } else {
  319. this.resultItem = {
  320. markItem: value.markItem,
  321. score: ""
  322. };
  323. }
  324. this.curIndex = index;
  325. }
  326. });
  327. this.showItemTitle();
  328. if (this.markSign) {
  329. this.tmpSignItem = this.resultItem.markItem;
  330. this.signScores.splice(0, this.signScores.length);
  331. }
  332. this.positionDiv(order);
  333. //重置打分板样式
  334. this.itemScoreBtn = [];
  335. },
  336. positionDiv(order) {
  337. EVENTHUB.$emit("positionDiv", order);
  338. },
  339. showItemTitle() {
  340. var title =
  341. this.resultItem.markItem.mainNumber +
  342. "(" +
  343. this.resultItem.markItem.orders +
  344. ")";
  345. this.$notify({
  346. showClose: true,
  347. message: "当前选择题目为" + title,
  348. type: "warning"
  349. });
  350. },
  351. checkSignScore(score) {
  352. var sum = 0;
  353. for (let signScore of this.signScores) {
  354. sum += signScore;
  355. }
  356. if (sum + score > this.maxScore) {
  357. return false;
  358. } else {
  359. return true;
  360. }
  361. },
  362. //检查每项分数是否满足要求
  363. checkScore(resultItem) {
  364. var score = resultItem.score + "";
  365. var maxScore = resultItem.markItem.maxScore + "";
  366. var scoreInterval = resultItem.markItem.scoreInterval + "";
  367. if (score.trim().length === 0) {
  368. this.$notify({
  369. message: "分数不能为空",
  370. type: "error",
  371. duration: 1000
  372. });
  373. return false;
  374. } else {
  375. let regex = scoreInterval == 1 ? "^\\d+$" : "^\\d+(\\.[5])?$";
  376. if (!score.match(regex)) {
  377. this.$notify({
  378. message: "分数必须为数字,且格式要正确(包括间隔分)",
  379. type: "error",
  380. duration: 1000
  381. });
  382. return false;
  383. } else {
  384. if (parseFloat(score) > parseFloat(maxScore)) {
  385. this.$notify({
  386. message: "分数不能超过" + maxScore + "分",
  387. type: "error",
  388. duration: 1000
  389. });
  390. return false;
  391. }
  392. }
  393. }
  394. return true;
  395. },
  396. scoreClick(score, index1) {
  397. //轨迹模式处理分值问题
  398. if (this.markSign) {
  399. if (this.checkSignScore(score)) {
  400. this.signScores.push(score);
  401. this.signOption.score = score;
  402. this.resultItem.score = this.signScoreSum;
  403. this.resultItems[this.curIndex].score = this.signScoreSum;
  404. } else {
  405. this.$notify({
  406. message: "轨迹总分不能超过满分",
  407. type: "error"
  408. });
  409. }
  410. } else {
  411. //正常模式
  412. this.resultItem.score = score;
  413. this.resultItems[this.curIndex].score = score;
  414. //设置动态样式(打分板)
  415. this.itemScoreBtn = [];
  416. for (let i = 0; i < this.itemScores.length; i++) {
  417. if (i == index1) {
  418. this.itemScoreBtn.push(true);
  419. } else {
  420. this.itemScoreBtn.push(false);
  421. }
  422. }
  423. }
  424. },
  425. //键盘打分板change事件
  426. scoreChange(index, score) {
  427. this.resultItem.score = score;
  428. this.resultItems[index].score = score;
  429. },
  430. //键盘打分板聚焦后试卷跳转对应试题
  431. scoreFocus(resultItem) {
  432. var order = resultItem.markItem.orders;
  433. this.positionDiv(order);
  434. },
  435. //键盘打分板下键跳转下一题
  436. scoreDown(index, resultItem) {
  437. var curItemId = this.resultItems[index].markItem.id;
  438. var curItemInput = "item" + curItemId;
  439. if (!this.checkScore(resultItem)) {
  440. document.getElementById(curItemInput).focus();
  441. return;
  442. }
  443. if (index === this.resultItems.length - 1) {
  444. return;
  445. } else {
  446. var nextResultItem = this.resultItems[index + 1];
  447. var nextItemId = nextResultItem.markItem.id;
  448. var nextItemInput = "item" + nextItemId;
  449. var order = nextResultItem.markItem.orders;
  450. document.getElementById(nextItemInput).focus();
  451. this.positionDiv(order);
  452. }
  453. },
  454. //键盘打分板上键跳转上一题
  455. scoreUp(index, resultItem) {
  456. var curItemId = this.resultItems[index].markItem.id;
  457. var curItemInput = "item" + curItemId;
  458. if (!this.checkScore(resultItem)) {
  459. document.getElementById(curItemInput).focus();
  460. return;
  461. }
  462. if (index === 0) {
  463. let preResultItem = this.resultItems[0];
  464. let preItemId = preResultItem.markItem.id;
  465. let preItemInput = "item" + preItemId;
  466. let order = preResultItem.markItem.orders;
  467. document.getElementById(preItemInput).focus();
  468. this.positionDiv(order);
  469. } else {
  470. let preResultItem = this.resultItems[index - 1];
  471. let preItemId = preResultItem.markItem.id;
  472. let preItemInput = "item" + preItemId;
  473. let order = preResultItem.markItem.orders;
  474. document.getElementById(preItemInput).focus();
  475. this.positionDiv(order);
  476. }
  477. },
  478. //键盘打分板回车后跳转下一题
  479. scoreEnter(index, resultItem) {
  480. if (!this.checkScore(resultItem)) {
  481. var curItemId = this.resultItems[index].markItem.id;
  482. var curItemInput = "item" + curItemId;
  483. document.getElementById(curItemInput).focus();
  484. return;
  485. }
  486. if (index === this.resultItems.length - 1) {
  487. document.getElementById("subMarkBtn").focus();
  488. } else {
  489. var nextResultItem = this.resultItems[index + 1];
  490. var nextItemId = nextResultItem.markItem.id;
  491. var nextItemInput = "item" + nextItemId;
  492. var order = nextResultItem.markItem.orders;
  493. document.getElementById(nextItemInput).focus();
  494. this.positionDiv(order);
  495. }
  496. },
  497. getItemId(itemId) {
  498. return "item" + itemId;
  499. },
  500. problemClick() {
  501. this.problemView = !this.problemView;
  502. },
  503. //检查评分项
  504. checkItems() {
  505. var itemName = "";
  506. for (var resultItem of this.resultItems) {
  507. if (resultItem.score.length == 0) {
  508. itemName =
  509. Number.parseInt(resultItem.markItem.mainNumber) +
  510. "(" +
  511. resultItem.markItem.orders +
  512. ")";
  513. this.$notify({
  514. title: "警告",
  515. message: itemName + "没有打分,请打分",
  516. type: "warning"
  517. });
  518. return false;
  519. } else {
  520. if (!this.checkScore(resultItem)) {
  521. return false;
  522. }
  523. }
  524. }
  525. return true;
  526. },
  527. submitMark() {
  528. if (!this.checkItems()) {
  529. return;
  530. }
  531. this.processTagPaper();
  532. this.loading = true;
  533. this.$loading({ fullscreen: true });
  534. let remarkValue = "";
  535. if (document.getElementById("remark")) {
  536. remarkValue = document.getElementById("remark").value;
  537. }
  538. console.log("remarkValue: " + remarkValue);
  539. if (!this.markedResult.id) {
  540. //正常提交情况
  541. console.log("提交resultItems", this.resultItems);
  542. this.$httpWithMsg
  543. .post(
  544. MARKING_API +
  545. "/markResults?studentPaperId=" +
  546. this.studentPaperId +
  547. "&markTaskId=" +
  548. this.markTaskId +
  549. "&tag=" +
  550. this.unusualType +
  551. "&remark=" +
  552. remarkValue,
  553. this.resultItems
  554. )
  555. .then(
  556. response => {
  557. this.saveMarkSign();
  558. console.log(response);
  559. if (response.data.id) {
  560. this.$notify({
  561. message: "提交成功",
  562. type: "success"
  563. });
  564. } else {
  565. this.$notify({
  566. message: "提交失败",
  567. type: "error"
  568. });
  569. }
  570. //调用Marking.vue中方法:执行的是拿取下一份试卷
  571. this.$emit("submitMark");
  572. this.loading = false;
  573. this.markTypeView = false;
  574. this.problemView = false;
  575. this.unusualType = "";
  576. },
  577. error => {
  578. // 响应错误回调
  579. console.log(error);
  580. if (error.response.data.desc) {
  581. var errorInfo = error.response.data.desc;
  582. if (errorInfo.includes("超时")) {
  583. this.$loading().close();
  584. this.loading = false;
  585. this.$alert(
  586. "该评卷任务已超时,请点击确定重新登录!",
  587. "提示",
  588. {
  589. confirmButtonText: "确定",
  590. callback: () => {
  591. console.log("sessionStorage", sessionStorage);
  592. this.$http
  593. .post(CORE_API + "/auth/logout")
  594. .then(() => {
  595. const orgId = this.user.rootOrgId;
  596. this.USER_SIGNOUT();
  597. window.name = "";
  598. this.$router.replace({
  599. path: "/login" + "?orgId=" + orgId
  600. });
  601. })
  602. .catch(response => {
  603. const orgId = this.user.rootOrgId;
  604. if (response.status == 500) {
  605. this.$notify({
  606. showClose: true,
  607. message: response.data.desc,
  608. type: "error"
  609. });
  610. }
  611. this.USER_SIGNOUT();
  612. window.name = "";
  613. this.$router.replace({
  614. path: "/login" + "?orgId=" + orgId
  615. });
  616. });
  617. return;
  618. }
  619. }
  620. );
  621. } else {
  622. if (error.response.data.code == 403) {
  623. this.$loading().close();
  624. return;
  625. }
  626. this.$emit("submitMark");
  627. this.loading = false;
  628. this.markTypeView = false;
  629. this.problemView = false;
  630. this.unusualType = "";
  631. }
  632. } else {
  633. this.$notify({
  634. message: "提交失败",
  635. type: "error"
  636. });
  637. this.$emit("submitMark");
  638. this.loading = false;
  639. this.markTypeView = false;
  640. this.problemView = false;
  641. this.unusualType = "";
  642. }
  643. }
  644. );
  645. } else {
  646. console.log("markedResult", this.markedResult);
  647. this.markedResult.resultItems = this.resultItems;
  648. this.markedResult.remark = remarkValue;
  649. this.$httpWithMsg
  650. .put(MARKING_API + "/markResults", this.markedResult)
  651. .then(
  652. response => {
  653. this.saveMarkSign();
  654. console.log(response);
  655. this.$notify({
  656. message: "提交成功",
  657. type: "success"
  658. });
  659. this.$emit("submitMark");
  660. this.loading = false;
  661. this.markTypeView = false;
  662. this.problemView = false;
  663. this.unusualType = "";
  664. },
  665. error => {
  666. // 响应错误回调
  667. if (error.response.data.code == 403) {
  668. this.$loading().close();
  669. return;
  670. }
  671. this.$emit("submitMark");
  672. this.loading = false;
  673. this.markTypeView = false;
  674. this.problemView = false;
  675. this.unusualType = "";
  676. }
  677. );
  678. }
  679. },
  680. initKeyBoardMode() {
  681. if (this.resultItems[0]) {
  682. var itemId = this.resultItems[0].markItem.id;
  683. var order = this.resultItems[0].markItem.orders;
  684. var itemInput = "item" + itemId;
  685. setTimeout(function() {
  686. document.getElementById(itemInput).focus();
  687. }, 1);
  688. this.positionDiv(order);
  689. }
  690. },
  691. showTextarea() {
  692. if (this.textareaflag) {
  693. this.textareaflag = false;
  694. } else {
  695. this.textareaflag = true;
  696. }
  697. }
  698. },
  699. watch: {
  700. signItem(val) {
  701. this.tmpSignItem = val;
  702. },
  703. tmpSignItem(val) {
  704. this.$emit("changeSign", val);
  705. },
  706. isMouseMode(val) {
  707. if (!val) {
  708. this.initKeyBoardMode();
  709. }
  710. },
  711. studentPaperId() {
  712. if (!this.isMouseMode) {
  713. this.initKeyBoardMode();
  714. }
  715. }
  716. },
  717. computed: {
  718. tagFlag() {
  719. if (this.markedResult.id) {
  720. return true;
  721. } else {
  722. return false;
  723. }
  724. },
  725. paperKey() {
  726. if (!this.markSign) return "";
  727. return this.studentPaperId;
  728. },
  729. signScoreSum() {
  730. var sum = 0;
  731. for (let signScore of this.signScores) {
  732. sum += signScore;
  733. }
  734. return sum;
  735. },
  736. itemClass() {
  737. var itemClass = [];
  738. for (let resultItem of this.resultItems) {
  739. if (resultItem.score.length == 0) {
  740. itemClass.push(false);
  741. } else {
  742. itemClass.push(true);
  743. }
  744. }
  745. return itemClass;
  746. },
  747. totalScore() {
  748. var totalScore = 0;
  749. for (let resultItem of this.resultItems) {
  750. if (resultItem.score.length == 0) {
  751. totalScore += 0;
  752. } else {
  753. totalScore += Number.parseFloat(resultItem.score);
  754. }
  755. }
  756. return totalScore;
  757. },
  758. itemScores() {
  759. var itemScores = [];
  760. var scoreInterval = this.resultItem.markItem.scoreInterval;
  761. for (
  762. let i = 0, j = 0;
  763. i <= this.resultItem.markItem.maxScore;
  764. i += scoreInterval, j++
  765. ) {
  766. itemScores[j] = i;
  767. }
  768. return itemScores;
  769. },
  770. ...mapState({ user: state => state.user })
  771. },
  772. created() {
  773. this.getTags();
  774. }
  775. };
  776. </script>
  777. <style scoped>
  778. .scoreboard {
  779. width: 25%;
  780. min-height: 600px;
  781. }
  782. .itemScroll {
  783. overflow: hidden;
  784. height: 140px;
  785. margin-top: 15px;
  786. }
  787. .itemScroll:hover {
  788. overflow: auto;
  789. }
  790. .itemScroll::-webkit-scrollbar {
  791. /*滚动条整体样式*/
  792. width: 8px; /*高宽分别对应横竖滚动条的尺寸*/
  793. }
  794. .itemScroll::-webkit-scrollbar-thumb {
  795. box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  796. border-radius: 5px;
  797. background: rgba(0, 0, 0, 0.2);
  798. }
  799. .itemScroll::-webkit-scrollbar-track {
  800. /*滚动条里面轨道*/
  801. box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  802. border-radius: 0;
  803. background: rgba(0, 0, 0, 0.1);
  804. }
  805. .scoreScroll {
  806. overflow: auto;
  807. height: 100px;
  808. }
  809. .scoretitle {
  810. margin-right: 15px;
  811. margin-bottom: 15px;
  812. }
  813. li {
  814. list-style-type: none;
  815. }
  816. .actionbutton {
  817. width: 80px;
  818. height: 30px;
  819. }
  820. .second-board {
  821. color: white;
  822. margin-top: 20px;
  823. padding-bottom: 20px;
  824. border-bottom: 1px solid #ccc;
  825. }
  826. .clear {
  827. clear: both;
  828. }
  829. .board-margin {
  830. margin-left: 20px;
  831. }
  832. .sub-btn {
  833. margin-right: 15px;
  834. }
  835. .active-btn {
  836. background: rgb(85, 191, 255) !important;
  837. border-color: rgb(85, 191, 255) !important;
  838. }
  839. .score-input {
  840. border: 1px solid black;
  841. border-top: 0;
  842. border-left: 0;
  843. border-right: 0;
  844. box-sizing: border-box;
  845. color: rgb(77, 124, 196);
  846. font-size: 15px;
  847. height: 30px;
  848. width: 40px;
  849. padding: 2px 10px;
  850. transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  851. outline: none;
  852. text-align: center;
  853. }
  854. .el-switch__label {
  855. position: absolute;
  856. left: 0;
  857. top: 0;
  858. z-index: 2;
  859. }
  860. .button-border.button-small {
  861. line-height: 26px;
  862. }
  863. .button-small {
  864. font-size: 12px;
  865. }
  866. .button-border {
  867. border-width: 2px;
  868. border-style: solid;
  869. }
  870. .button-box {
  871. padding: 0 !important;
  872. border-radius: 10px;
  873. }
  874. .button-primary {
  875. border-color: #1b9af7;
  876. }
  877. .button {
  878. font-weight: 300;
  879. text-decoration: none;
  880. text-align: center;
  881. margin: 0;
  882. display: inline-block;
  883. outline: none;
  884. }
  885. .pull-left {
  886. float: left;
  887. }
  888. .pull-right {
  889. float: right;
  890. }
  891. .scorebutton {
  892. width: 40px;
  893. height: 40px;
  894. cursor: pointer;
  895. color: rgb(77, 124, 196);
  896. border-radius: 15px;
  897. font-weight: 600;
  898. border: 1px solid rgb(77, 124, 196);
  899. text-align: center;
  900. }
  901. .scorebutton:hover {
  902. background: rgb(85, 191, 255);
  903. color: white;
  904. border-color: rgb(85, 191, 255);
  905. }
  906. .titlebutton {
  907. border-radius: 15px;
  908. cursor: pointer;
  909. }
  910. .titlebutton:hover {
  911. background: yellow;
  912. }
  913. .title-font {
  914. font-size: 14px;
  915. font-weight: 800;
  916. }
  917. .first-board {
  918. margin-top: 20px;
  919. height: 50px;
  920. border-bottom: 1px solid #ccc;
  921. }
  922. .board-title {
  923. height: 50px;
  924. width: 80px;
  925. background: rgb(255, 109, 109);
  926. border: 2px solid rgb(255, 109, 109);
  927. text-align: center;
  928. padding-top: 20px;
  929. font-weight: 600;
  930. border-top-left-radius: 15px;
  931. border-bottom-left-radius: 15px;
  932. float: left;
  933. font-size: 30px;
  934. line-height: 0.5;
  935. }
  936. .board-score {
  937. height: 50px;
  938. width: 110px;
  939. border: 2px solid rgb(255, 109, 109);
  940. margin-left: 80px;
  941. text-align: center;
  942. padding-top: 20px;
  943. font-weight: 600;
  944. color: rgb(255, 109, 109);
  945. border-top-right-radius: 15px;
  946. border-bottom-right-radius: 15px;
  947. font-size: 30px;
  948. line-height: 0.5;
  949. }
  950. .title-board {
  951. margin-top: 20px;
  952. }
  953. .title-item-top {
  954. color: white;
  955. width: 50px;
  956. height: 25px;
  957. border: 1px solid rgb(77, 124, 196);
  958. text-align: center;
  959. line-height: 2;
  960. font-size: 12px;
  961. border-top-left-radius: 15px;
  962. border-top-right-radius: 15px;
  963. background: rgb(77, 124, 196);
  964. border-bottom: 0px;
  965. }
  966. .title-item-bottom {
  967. width: 50px;
  968. height: 30px;
  969. border: 1px solid rgb(77, 124, 196);
  970. text-align: center;
  971. font-size: 12px;
  972. line-height: 2.5;
  973. border-bottom-left-radius: 15px;
  974. border-bottom-right-radius: 15px;
  975. border-top: 0px;
  976. font-weight: 600;
  977. color: rgb(77, 124, 196);
  978. display: block;
  979. }
  980. .active-text {
  981. color: rgb(85, 191, 255) !important;
  982. border-color: rgb(85, 191, 255);
  983. }
  984. .score-item {
  985. line-height: 2.5;
  986. }
  987. textarea {
  988. background: rgb(245, 245, 245);
  989. border-radius: 10px;
  990. outline: none;
  991. }
  992. .step-board {
  993. margin-top: 20px;
  994. border-bottom: 1px solid #ccc;
  995. }
  996. .problem-button {
  997. border-bottom: 1px solid #ccc;
  998. margin-bottom: 15px;
  999. margin-top: 20px;
  1000. }
  1001. .remark-step {
  1002. height: 100px;
  1003. margin-top: 15px;
  1004. }
  1005. .box-card {
  1006. width: 160px;
  1007. height: 60px;
  1008. border: 1px solid rgb(77, 124, 196);
  1009. border-radius: 10px;
  1010. }
  1011. .item-title {
  1012. background: rgb(77, 124, 196);
  1013. color: white;
  1014. height: 25px;
  1015. border-top-left-radius: 10px;
  1016. border-top-right-radius: 10px;
  1017. font-size: 12px;
  1018. text-align: center;
  1019. }
  1020. .item-score {
  1021. height: 35px;
  1022. color: rgb(77, 124, 196);
  1023. font-weight: bold;
  1024. font-size: 15px;
  1025. text-align: center;
  1026. }
  1027. .item-number {
  1028. width: 52px;
  1029. height: 22px;
  1030. text-align: center;
  1031. line-height: 1.5;
  1032. }
  1033. .item-number2 {
  1034. width: 40px;
  1035. height: 22px;
  1036. border: 1px solid rgb(77, 124, 196);
  1037. border-right-color: white;
  1038. border-left-color: white;
  1039. text-align: center;
  1040. line-height: 1.5;
  1041. }
  1042. .item-number3 {
  1043. width: 62px;
  1044. height: 22px;
  1045. text-align: center;
  1046. line-height: 1.5;
  1047. }
  1048. .btn {
  1049. margin-top: 20px;
  1050. margin-bottom: 10px;
  1051. padding-right: 1px;
  1052. }
  1053. .score-btn {
  1054. background: rgb(85, 191, 255);
  1055. color: white;
  1056. border-color: rgb(85, 191, 255);
  1057. }
  1058. .remark-board {
  1059. cursor: pointer;
  1060. }
  1061. .el-button {
  1062. outline: none;
  1063. }
  1064. </style>