123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257 |
- <template>
- <div class="scoreboard pull-right">
- <div class="board-margin">
- <div v-if="workId && workId != 1848" class="first-board">
- <span class="title-font">操作方式切换:</span>
- <el-switch
- v-model="isMouseMode"
- class="pull-right"
- active-text="鼠标"
- inactive-text="键盘"
- active-color="#4cb0f9"
- inactive-color="#13ce66"
- ></el-switch>
- </div>
- <div v-show="examType != 'OFFLINE'" class="first-board">
- <el-checkbox v-model="showBody">显示题干</el-checkbox
- ><el-checkbox v-model="showAnswer">显示标答</el-checkbox>
- </div>
- <div class="second-board">
- <div class="board-title"><span>总分</span></div>
- <div class="board-score">
- <span>{{ totalScore }}分</span>
- </div>
- <div class="total-all-score-title"><span>全卷分</span></div>
- <div class="total-all-score">
- <span>{{ totalAllScore }}</span>
- </div>
- </div>
- <!-- 鼠标模式 -->
- <div v-if="isMouseMode">
- <div class="title-board"><span class="title-font">评分</span></div>
- <div class="itemScroll">
- <div
- v-for="(resultItemInner, index) in resultItemsData"
- :id="resultItemInner.markItem.id"
- :key="resultItemInner.markItem.id"
- class="pull-left scoretitle titlebutton"
- size="small"
- @click="
- itemClick(
- resultItemInner.markItem.id,
- $event,
- resultItemInner.markItem.orders
- )
- "
- >
- <div
- :class="{ 'active-btn': itemClass[index] }"
- class="title-item-top"
- >
- <span>
- {{ resultItemInner.markItem.mainNumber }}({{
- resultItemInner.markItem.orders
- }})
- </span>
- </div>
- <div
- class="title-item-bottom"
- :class="{ 'active-text': itemClass[index] }"
- >
- <span>{{ resultItemInner.score }}分</span>
- </div>
- </div>
- </div>
- <div v-if="markTypeView">
- <div class="step-board"></div>
- <div class="title-board"><span class="title-font">打分</span></div>
- <div class="itemScroll">
- <div
- v-for="(score, index) in itemScores"
- :key="score"
- class="pull-left scoretitle"
- >
- <div
- class="scorebutton"
- :class="{ 'score-btn': itemScoreBtn[index] }"
- @click="scoreClick(score, index)"
- >
- <span class="score-item">
- {{
- workId && workId != 2410
- ? score
- : ["不及格", "及格", "良好", "优秀"][index] || "优秀"
- }}
- </span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 键盘模式 -->
- <div v-if="!isMouseMode">
- <div class="title-board"><span class="title-font">评分</span></div>
- <div>
- <div class="itemScroll">
- <div
- v-for="(resultItemInner, index) in resultItemsData"
- :key="resultItemInner.markItem.id"
- class="scoretitle"
- >
- <div class="box-card">
- <div class="item-title">
- <div class="pull-left item-number">
- {{ resultItemInner.markItem.mainNumber }}({{
- resultItemInner.markItem.orders
- }})
- </div>
- <div class="pull-left item-number2">
- <span>{{ resultItemInner.markItem.maxScore }}分</span>
- </div>
- <div class="pull-left item-number3">
- 间隔:{{
- itemScoreStep(resultItemInner.markItem.scoreInterval)
- }}
- </div>
- </div>
- <div class="item-score">
- <input
- :id="getItemId(resultItemInner.markItem.id)"
- v-model="resultItemInner.score"
- class="score-input"
- @focus="scoreFocus(resultItemInner)"
- @keydown.enter="scoreEnter(index, resultItemInner)"
- @keydown.up="scoreUp(index, resultItemInner)"
- @keydown.down="scoreDown(index, resultItemInner)"
- @change="scoreChange(index, resultItemInner.score)"
- />
- 分
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div>
- <div class="step-board"></div>
- <div class="title-board">
- <span class="title-font">备注</span>
- <div
- v-if="!textareaflag"
- class="el-icon-caret-right remark-board"
- @click="showTextarea"
- ></div>
- <div
- v-if="textareaflag"
- class="el-icon-caret-top remark-board"
- @click="showTextarea"
- ></div>
- </div>
- <div v-if="textareaflag" class="remark-step">
- <textarea
- id="remark"
- v-model="markedResultData.markRemark"
- type="text"
- rows="3"
- cols="35"
- placeholder="请输入内容"
- />
- </div>
- </div>
- <div>
- <div v-if="problemView">
- <div class="problem-button"></div>
- <span v-if="tagFlag">
- <el-radio-group
- v-model="markedResultData.tag"
- @change="processTagPaper"
- >
- <div
- v-for="tag in tags"
- :key="tag.code"
- class="pull-left scoretitle"
- >
- <el-radio :label="tag.code">{{ tag.name }}</el-radio>
- </div>
- </el-radio-group>
- </span>
- <span v-if="!tagFlag">
- <el-radio-group v-model="unusualType" @change="processTagPaper">
- <div
- v-for="tag in tags"
- :key="tag.code"
- class="pull-left scoretitle"
- >
- <el-radio :key="tag.code" :label="tag.code">{{
- tag.name
- }}</el-radio>
- </div>
- </el-radio-group>
- </span>
- </div>
- <div v-if="paperMark" class="pull-left btn">
- <el-button
- id="subMarkBtn"
- class="submit-button"
- type="primary"
- size="small"
- :round="true"
- :loading="loading"
- @keydown.enter="submitMark"
- @click="submitMark"
- >
- <span class="sub-btn">提</span> <span>交</span>
- </el-button>
- </div>
- <div v-if="paperMark" class="pull-left btn">
- <el-button
- type="danger"
- :round="true"
- size="small"
- @click="problemClick"
- >问题卷</el-button
- >
- </div>
- <div v-if="paperMark && problemView" class="pull-left btn">
- <el-button
- type="danger"
- :round="true"
- size="small"
- @click="resetProblem"
- >清除问题卷</el-button
- >
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { mapActions } from "vuex";
- import { USER_SIGNOUT } from "../../portal/store/user";
- import { mapState } from "vuex";
- import { CORE_API, MARKING_API } from "@/constants/constants";
- import { EVENTHUB } from "../constants/constants";
- export default {
- props: {
- objectiveScore: { type: Number, default: 0.0 },
- paperMarkSign: {
- type: Array,
- default: () => [],
- },
- signScores: {
- type: Array,
- default: () => [],
- },
- signOption: {
- type: Object,
- default: () => {},
- },
- markSign: {
- type: Boolean,
- default: false,
- },
- studentPaperId: {
- type: [String, Number],
- default: "",
- },
- markTaskId: {
- type: Number,
- default: 0,
- },
- resultItems: {
- type: Array,
- default: () => [],
- },
- markedResult: {
- type: Object,
- default: () => {},
- },
- paperMark: {
- type: Boolean,
- default: true,
- },
- scoreStep: {
- type: Number,
- default: 0.5,
- },
- examType: {
- type: String,
- default: "",
- },
- workId: {
- type: [Number, String],
- default: "",
- },
- },
- data() {
- return {
- showBody: true,
- showAnswer: true,
- resultItemsData: this.resultItems,
- signOptionData: this.signOption,
- signScoresData: this.signScores,
- markedResultData: this.markedResult,
- activeName: "first",
- markType: "mouse",
- isMouseMode: true,
- op: "first",
- maxScore: 0,
- markItemId: "",
- resultItem: {
- markItem: {},
- score: 0,
- },
- markTypeView: false,
- problemView: false,
- markBack: false,
- markSame: false,
- markBlank: false,
- markDiff: false,
- curIndex: 0,
- steps: [],
- btnflag: false,
- textareaflag: false,
- tmpSignItem: this.signItem,
- tags: [],
- unusualType: "",
- scoreError: [],
- itemScoreBtn: [],
- loading: false,
- };
- },
- computed: {
- tagFlag() {
- if (this.markedResultData.id) {
- return true;
- } else {
- return false;
- }
- },
- paperKey() {
- if (!this.markSign) return "";
- return this.studentPaperId;
- },
- signScoreSum() {
- var sum = 0;
- for (let signScore of this.signScoresData) {
- sum += signScore;
- }
- return sum;
- },
- itemClass() {
- var itemClass = [];
- for (let resultItem of this.resultItemsData) {
- if (resultItem.score.length == 0) {
- itemClass.push(false);
- } else {
- itemClass.push(true);
- }
- }
- return itemClass;
- },
- totalScore() {
- var totalScore = 0;
- for (let resultItem of this.resultItemsData) {
- if (resultItem.score.length == 0) {
- totalScore = this.accAdd(totalScore, 0);
- } else {
- totalScore = this.accAdd(
- totalScore,
- Number.parseFloat(resultItem.score)
- );
- }
- }
- return totalScore;
- },
- totalAllScore() {
- return this.accAdd(this.totalScore, this.objectiveScore);
- },
- itemScores() {
- var itemScores = [];
- var scoreInterval = this.resultItem.markItem.scoreInterval;
- if (this.scoreStep != null) {
- scoreInterval = this.scoreStep;
- }
- let i = 0;
- let j = 0;
- do {
- itemScores[j] = i;
- i = this.accAdd(i, scoreInterval);
- j++;
- } while (i <= this.resultItem.markItem.maxScore);
- if (
- itemScores[itemScores.length - 1] < this.resultItem.markItem.maxScore
- ) {
- itemScores[itemScores.length] = this.resultItem.markItem.maxScore;
- }
- return itemScores;
- },
- ...mapState({ user: (state) => state.user }),
- },
- watch: {
- resultItems: {
- immediate: false,
- handler(val) {
- this.resultItemsData = val;
- if (!this.isMouseMode) {
- //切换不同考试的试卷时,光标定位要在resultItems变化之后做
- this.initKeyBoardMode();
- }
- },
- },
- signOption: {
- immediate: false,
- handler(val) {
- this.signOptionData = val;
- },
- },
- signScores: {
- immediate: false,
- handler(val) {
- this.signScoresData = val;
- },
- },
- markedResult: {
- immediate: false,
- handler(val) {
- this.markedResultData = val;
- },
- },
- signItem(val) {
- this.tmpSignItem = val;
- },
- tmpSignItem(val) {
- this.$emit("changeSign", val);
- },
- isMouseMode(val) {
- if (!val) {
- this.initKeyBoardMode();
- }
- },
- studentPaperId() {
- if (!this.isMouseMode) {
- this.initKeyBoardMode();
- }
- },
- showAnswer: {
- immediate: false,
- handler() {
- this.showAnswerChange();
- },
- },
- showBody: {
- immediate: false,
- handler() {
- this.showBodyChange();
- },
- },
- },
- created() {
- this.getTags();
- },
- methods: {
- ...mapActions([USER_SIGNOUT]),
- showAnswerChange() {
- if (this.examType == "OFFLINE") {
- return;
- }
- var es = Array.from(document.getElementsByClassName("right-answer"));
- var displayVal = this.showAnswer ? "block" : "none";
- es.forEach((element) => {
- element.style.display = displayVal;
- });
- },
- showBodyChange() {
- if (this.examType == "OFFLINE") {
- return;
- }
- var es = Array.from(document.getElementsByClassName("question-body"));
- var displayVal = this.showBody ? "block" : "none";
- es.forEach((element) => {
- element.style.display = displayVal;
- });
- },
- resetProblem() {
- if (this.markedResultData.tag) {
- this.markedResultData.tag = "";
- }
- if (this.unusualType) {
- this.unusualType = "";
- }
- },
- //处理问题卷
- processTagPaper() {
- if (!this.markedResultData.id) {
- if (this.unusualType) {
- for (let resultItem of this.resultItemsData) {
- resultItem.score = 0;
- }
- }
- } else {
- if (this.markedResultData.tag) {
- for (let resultItem of this.resultItemsData) {
- resultItem.score = 0;
- }
- }
- }
- },
- getTags() {
- this.$http.get(MARKING_API + "/markResults/tag").then((response) => {
- this.tags = response.data;
- //移除科目错误
- for (let i = 0; i < this.tags.length; i++) {
- if (this.tags[i].code === "SUBJECT_ERROR") {
- this.tags.splice(i, 1);
- }
- }
- });
- },
- //在内存中对试卷进行标记保存
- saveMarkSign() {
- localStorage.removeItem(this.paperKey);
- localStorage.setItem(this.paperKey, JSON.stringify(this.paperMarkSign));
- },
- checkItemClass(resultItem) {
- if (resultItem.score.length > 0) {
- return true;
- } else {
- return false;
- }
- },
- itemClick(id, event, order) {
- this.markTypeView = true;
- this.resultItemsData.find((value, index) => {
- if (value.markItem.id === id) {
- this.maxScore = value.markItem.maxScore;
- this.markItemId = value.markItem.id;
- if (value.score.length > 0) {
- this.resultItem = value;
- } else {
- this.resultItem = {
- markItem: value.markItem,
- score: "",
- };
- }
- this.curIndex = index;
- }
- });
- this.showItemTitle();
- if (this.markSign) {
- this.tmpSignItem = this.resultItem.markItem;
- this.signScoresData.splice(0, this.signScoresData.length);
- }
- this.positionDiv(order);
- //重置打分板样式
- this.itemScoreBtn = [];
- },
- positionDiv(order) {
- EVENTHUB.$emit("positionDiv", order);
- },
- showItemTitle() {
- var title =
- this.resultItem.markItem.mainNumber +
- "(" +
- this.resultItem.markItem.orders +
- ")";
- this.$notify({
- showClose: true,
- message: "当前选择题目为" + title,
- type: "warning",
- });
- },
- checkSignScore(score) {
- var sum = 0;
- for (let signScore of this.signScoresData) {
- sum += signScore;
- }
- if (sum + score > this.maxScore) {
- return false;
- } else {
- return true;
- }
- },
- //检查每项分数是否满足要求
- checkScore(resultItem) {
- var score = resultItem.score + "";
- var maxScore = resultItem.markItem.maxScore + "";
- if (score.trim().length === 0) {
- this.$notify({
- message: "分数不能为空",
- type: "error",
- duration: 2000,
- });
- return false;
- } else {
- let regex = "^\\d+(\\.[\\d])?$";
- if (!score.match(regex)) {
- this.$notify({
- message: "分数必须为数字且最多一位小数",
- type: "error",
- duration: 2000,
- });
- return false;
- } else {
- if (parseFloat(score) > parseFloat(maxScore)) {
- this.$notify({
- message: "分数不能超过" + maxScore + "分",
- type: "error",
- duration: 2000,
- });
- return false;
- }
- }
- }
- //校验分数是否是间隔的倍数
- var scoreInterval = resultItem.markItem.scoreInterval;
- if (this.scoreStep != null) {
- scoreInterval = this.scoreStep;
- }
- if (
- parseFloat(score) != 0 &&
- parseFloat(score) != parseFloat(maxScore) &&
- (parseFloat(score) * 10) % (scoreInterval * 10) != 0
- ) {
- this.$notify({
- message: "分数必须是给分间隔的倍数或者零分、满分",
- type: "error",
- duration: 2000,
- });
- return false;
- }
- return true;
- },
- scoreClick(score, index1) {
- //轨迹模式处理分值问题
- if (this.markSign) {
- if (this.checkSignScore(score)) {
- this.signScoresData.push(score);
- this.signOptionData.score = score;
- this.resultItem.score = this.signScoreSum;
- this.resultItemsData[this.curIndex].score = this.signScoreSum;
- } else {
- this.$notify({
- message: "轨迹总分不能超过满分",
- type: "error",
- });
- }
- } else {
- //正常模式
- this.resultItem.score = score;
- this.resultItemsData[this.curIndex].score = score;
- //设置动态样式(打分板)
- this.itemScoreBtn = [];
- for (let i = 0; i < this.itemScores.length; i++) {
- if (i == index1) {
- this.itemScoreBtn.push(true);
- } else {
- this.itemScoreBtn.push(false);
- }
- }
- }
- },
- //键盘打分板change事件
- scoreChange(index, score) {
- this.resultItem.score = score;
- this.resultItemsData[index].score = score;
- },
- //键盘打分板聚焦后试卷跳转对应试题
- scoreFocus(resultItem) {
- var order = resultItem.markItem.orders;
- this.positionDiv(order);
- },
- //键盘打分板下键跳转下一题
- scoreDown(index, resultItem) {
- var curItemId = this.resultItemsData[index].markItem.id;
- var curItemInput = "item" + curItemId;
- if (!this.checkScore(resultItem)) {
- document.getElementById(curItemInput).focus();
- return;
- }
- if (index === this.resultItemsData.length - 1) {
- return;
- } else {
- var nextResultItem = this.resultItemsData[index + 1];
- var nextItemId = nextResultItem.markItem.id;
- var nextItemInput = "item" + nextItemId;
- var order = nextResultItem.markItem.orders;
- document.getElementById(nextItemInput).focus();
- this.positionDiv(order);
- }
- },
- //键盘打分板上键跳转上一题
- scoreUp(index, resultItem) {
- var curItemId = this.resultItemsData[index].markItem.id;
- var curItemInput = "item" + curItemId;
- if (!this.checkScore(resultItem)) {
- document.getElementById(curItemInput).focus();
- return;
- }
- if (index === 0) {
- let preResultItem = this.resultItemsData[0];
- let preItemId = preResultItem.markItem.id;
- let preItemInput = "item" + preItemId;
- let order = preResultItem.markItem.orders;
- document.getElementById(preItemInput).focus();
- this.positionDiv(order);
- } else {
- let preResultItem = this.resultItemsData[index - 1];
- let preItemId = preResultItem.markItem.id;
- let preItemInput = "item" + preItemId;
- let order = preResultItem.markItem.orders;
- document.getElementById(preItemInput).focus();
- this.positionDiv(order);
- }
- },
- //键盘打分板回车后跳转下一题
- scoreEnter(index, resultItem) {
- if (!this.checkScore(resultItem)) {
- var curItemId = this.resultItemsData[index].markItem.id;
- var curItemInput = "item" + curItemId;
- document.getElementById(curItemInput).focus();
- return;
- }
- if (index === this.resultItemsData.length - 1) {
- document.getElementById("subMarkBtn").focus();
- } else {
- var nextResultItem = this.resultItemsData[index + 1];
- var nextItemId = nextResultItem.markItem.id;
- var nextItemInput = "item" + nextItemId;
- var order = nextResultItem.markItem.orders;
- document.getElementById(nextItemInput).focus();
- this.positionDiv(order);
- }
- },
- getItemId(itemId) {
- return "item" + itemId;
- },
- problemClick() {
- this.problemView = !this.problemView;
- },
- //检查评分项
- checkItems() {
- var itemName = "";
- for (var resultItem of this.resultItemsData) {
- if (resultItem.score.length == 0) {
- itemName =
- Number.parseInt(resultItem.markItem.mainNumber) +
- "(" +
- resultItem.markItem.orders +
- ")";
- this.$notify({
- title: "警告",
- message: itemName + "没有打分,请打分",
- type: "warning",
- });
- if (!this.isMouseMode) {
- let curItemInput = "item" + resultItem.markItem.id;
- document.getElementById(curItemInput).focus();
- }
- return false;
- } else {
- if (!this.checkScore(resultItem)) {
- if (!this.isMouseMode) {
- let curItemInput = "item" + resultItem.markItem.id;
- document.getElementById(curItemInput).focus();
- }
- return false;
- }
- }
- }
- return true;
- },
- submitMark() {
- if (!this.checkItems()) {
- return;
- }
- this.processTagPaper();
- this.loading = true;
- this.$loading({ fullscreen: true });
- let remarkValue = "";
- if (document.getElementById("remark")) {
- remarkValue = document.getElementById("remark").value;
- }
- if (!this.markedResultData.id) {
- //正常提交情况
- this.$httpWithMsg
- .post(
- MARKING_API +
- "/markResults?studentPaperId=" +
- this.studentPaperId +
- "&markTaskId=" +
- this.markTaskId +
- "&tag=" +
- this.unusualType +
- "&remark=" +
- remarkValue,
- this.resultItemsData
- )
- .then(
- (response) => {
- this.saveMarkSign();
- if (response.data.id) {
- this.$notify({
- message: "提交成功",
- type: "success",
- });
- } else {
- this.$notify({
- message: "提交失败",
- type: "error",
- });
- }
- //调用Marking.vue中方法:执行的是拿取下一份试卷
- this.$emit("submitMark");
- this.loading = false;
- this.markTypeView = false;
- this.problemView = false;
- this.unusualType = "";
- },
- (error) => {
- // 响应错误回调
- if (error.response.data.desc) {
- var errorInfo = error.response.data.desc;
- if (errorInfo.includes("超时")) {
- this.$loading().close();
- this.loading = false;
- this.$alert(
- "该评卷任务已超时,请点击确定重新登录!",
- "提示",
- {
- confirmButtonText: "确定",
- callback: () => {
- this.$http
- .post(CORE_API + "/auth/logout")
- .then(() => {
- const orgId = this.user.rootOrgId;
- this.USER_SIGNOUT();
- window.name = "";
- this.$router.replace({
- path: "/login" + "?orgId=" + orgId,
- });
- })
- .catch((response) => {
- const orgId = this.user.rootOrgId;
- if (response.status == 500) {
- this.$notify({
- showClose: true,
- message: response.data.desc,
- type: "error",
- });
- }
- this.USER_SIGNOUT();
- window.name = "";
- this.$router.replace({
- path: "/login" + "?orgId=" + orgId,
- });
- });
- return;
- },
- }
- );
- } else {
- if (error.response.data.code == 403) {
- this.$loading().close();
- return;
- }
- this.$emit("submitMark");
- this.loading = false;
- this.markTypeView = false;
- this.problemView = false;
- this.unusualType = "";
- }
- } else {
- this.$notify({
- message: "提交失败",
- type: "error",
- });
- this.$emit("submitMark");
- this.loading = false;
- this.markTypeView = false;
- this.problemView = false;
- this.unusualType = "";
- }
- }
- );
- } else {
- this.markedResultData.resultItems = this.resultItemsData;
- this.markedResultData.remark = remarkValue;
- this.$httpWithMsg
- .put(MARKING_API + "/markResults", this.markedResultData)
- .then(
- () => {
- this.saveMarkSign();
- this.$notify({
- message: "提交成功",
- type: "success",
- });
- this.$emit("submitMark");
- this.loading = false;
- this.markTypeView = false;
- this.problemView = false;
- this.unusualType = "";
- },
- (error) => {
- // 响应错误回调
- if (error.response.data.code == 403) {
- this.$loading().close();
- return;
- }
- this.$emit("submitMark");
- this.loading = false;
- this.markTypeView = false;
- this.problemView = false;
- this.unusualType = "";
- }
- );
- }
- },
- initKeyBoardMode() {
- if (this.resultItemsData[0]) {
- var itemId = this.resultItemsData[0].markItem.id;
- var order = this.resultItemsData[0].markItem.orders;
- var itemInput = "item" + itemId;
- this.$nextTick(() => {
- var firstInput = document.getElementById(itemInput);
- if (firstInput) {
- firstInput.focus();
- }
- });
- this.positionDiv(order);
- }
- },
- showTextarea() {
- if (this.textareaflag) {
- this.textareaflag = false;
- } else {
- this.textareaflag = true;
- }
- },
- accAdd(num1, num2) {
- let sq1, sq2, m;
- try {
- sq1 = num1.toString().split(".")[1].length;
- } catch (e) {
- sq1 = 0;
- }
- try {
- sq2 = num2.toString().split(".")[1].length;
- } catch (e) {
- sq2 = 0;
- }
- m = Math.pow(10, Math.max(sq1, sq2));
- return (num1 * m + num2 * m) / m;
- },
- itemScoreStep(scoreInterval) {
- if (this.scoreStep != null) {
- return this.scoreStep;
- }
- return scoreInterval;
- },
- },
- };
- </script>
- <style scoped>
- .scoreboard {
- width: 25%;
- min-height: 600px;
- }
- .itemScroll {
- overflow: hidden;
- height: 140px;
- margin-top: 15px;
- }
- .itemScroll:hover {
- overflow: auto;
- }
- .itemScroll::-webkit-scrollbar {
- /*滚动条整体样式*/
- width: 8px; /*高宽分别对应横竖滚动条的尺寸*/
- }
- .itemScroll::-webkit-scrollbar-thumb {
- box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
- border-radius: 5px;
- background: rgba(0, 0, 0, 0.2);
- }
- .itemScroll::-webkit-scrollbar-track {
- /*滚动条里面轨道*/
- box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
- border-radius: 0;
- background: rgba(0, 0, 0, 0.1);
- }
- .scoreScroll {
- overflow: auto;
- height: 100px;
- }
- .scoretitle {
- margin-right: 15px;
- margin-bottom: 15px;
- }
- li {
- list-style-type: none;
- }
- .actionbutton {
- width: 80px;
- height: 30px;
- }
- .second-board {
- color: white;
- margin-top: 20px;
- padding-bottom: 54px;
- border-bottom: 1px solid #ccc;
- }
- .clear {
- clear: both;
- }
- .board-margin {
- margin-left: 20px;
- }
- .sub-btn {
- margin-right: 15px;
- }
- .active-btn {
- background: rgb(85, 191, 255) !important;
- border-color: rgb(85, 191, 255) !important;
- }
- .score-input {
- border: 1px solid black;
- border-top: 0;
- border-left: 0;
- border-right: 0;
- box-sizing: border-box;
- color: rgb(77, 124, 196);
- font-size: 15px;
- height: 30px;
- width: 40px;
- padding: 2px 10px;
- transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
- outline: none;
- text-align: center;
- }
- .el-switch__label {
- position: absolute;
- left: 0;
- top: 0;
- z-index: 2;
- }
- .button-border.button-small {
- line-height: 26px;
- }
- .button-small {
- font-size: 12px;
- }
- .button-border {
- border-width: 2px;
- border-style: solid;
- }
- .button-box {
- padding: 0 !important;
- border-radius: 10px;
- }
- .button-primary {
- border-color: #1b9af7;
- }
- .button {
- font-weight: 300;
- text-decoration: none;
- text-align: center;
- margin: 0;
- display: inline-block;
- outline: none;
- }
- .pull-left {
- float: left;
- }
- .pull-right {
- float: right;
- }
- .scorebutton {
- display: inline-block;
- min-width: 40px;
- height: 40px;
- cursor: pointer;
- color: rgb(77, 124, 196);
- border-radius: 15px;
- font-weight: 600;
- border: 1px solid rgb(77, 124, 196);
- text-align: center;
- }
- .scorebutton:hover {
- background: rgb(85, 191, 255);
- color: white;
- border-color: rgb(85, 191, 255);
- }
- .titlebutton {
- border-radius: 15px;
- cursor: pointer;
- }
- .titlebutton:hover {
- background: yellow;
- }
- .title-font {
- font-size: 14px;
- font-weight: 800;
- }
- .first-board {
- margin-top: 20px;
- height: 50px;
- border-bottom: 1px solid #ccc;
- }
- .board-title {
- height: 34px;
- width: 80px;
- background: rgb(255, 109, 109);
- border: 2px solid rgb(255, 109, 109);
- text-align: center;
- padding-top: 20px;
- font-weight: 600;
- border-top-left-radius: 15px;
- border-bottom-left-radius: 15px;
- float: left;
- font-size: 24px;
- line-height: 0;
- }
- .board-score {
- float: left;
- height: 34px;
- border: 2px solid rgb(255, 109, 109);
- text-align: center;
- padding-top: 20px;
- padding-right: 10px;
- font-weight: 600;
- color: rgb(255, 109, 109);
- border-top-right-radius: 15px;
- border-bottom-right-radius: 15px;
- font-size: 20px;
- line-height: 0;
- }
- .total-all-score-title {
- color: black;
- margin-left: 10px;
- float: left;
- font-weight: 600;
- line-height: 3;
- }
- .total-all-score {
- color: red;
- margin-left: 10px;
- font-weight: 600;
- line-height: 3;
- float: left;
- }
- .title-board {
- margin-top: 20px;
- }
- .title-item-top {
- color: white;
- width: 50px;
- height: 25px;
- border: 1px solid rgb(77, 124, 196);
- text-align: center;
- line-height: 2;
- font-size: 12px;
- border-top-left-radius: 15px;
- border-top-right-radius: 15px;
- background: rgb(77, 124, 196);
- border-bottom: 0px;
- }
- .title-item-bottom {
- width: 50px;
- height: 30px;
- border: 1px solid rgb(77, 124, 196);
- text-align: center;
- font-size: 12px;
- line-height: 2.5;
- border-bottom-left-radius: 15px;
- border-bottom-right-radius: 15px;
- border-top: 0px;
- font-weight: 600;
- color: rgb(77, 124, 196);
- display: block;
- }
- .active-text {
- color: rgb(85, 191, 255) !important;
- border-color: rgb(85, 191, 255);
- }
- .score-item {
- line-height: 2.5;
- }
- textarea {
- background: rgb(245, 245, 245);
- border-radius: 10px;
- outline: none;
- }
- .step-board {
- margin-top: 20px;
- border-bottom: 1px solid #ccc;
- }
- .problem-button {
- border-bottom: 1px solid #ccc;
- margin-bottom: 15px;
- margin-top: 20px;
- }
- .remark-step {
- height: 100px;
- margin-top: 15px;
- }
- .box-card {
- width: 160px;
- height: 60px;
- border: 1px solid rgb(77, 124, 196);
- border-radius: 10px;
- }
- .item-title {
- background: rgb(77, 124, 196);
- color: white;
- height: 25px;
- border-top-left-radius: 10px;
- border-top-right-radius: 10px;
- font-size: 12px;
- text-align: center;
- }
- .item-score {
- height: 35px;
- color: rgb(77, 124, 196);
- font-weight: bold;
- font-size: 15px;
- text-align: center;
- }
- .item-number {
- width: 52px;
- height: 22px;
- text-align: center;
- line-height: 1.5;
- }
- .item-number2 {
- width: 40px;
- height: 22px;
- border: 1px solid rgb(77, 124, 196);
- border-right-color: white;
- border-left-color: white;
- text-align: center;
- line-height: 1.5;
- }
- .item-number3 {
- width: 62px;
- height: 22px;
- text-align: center;
- line-height: 1.5;
- }
- .btn {
- margin-top: 20px;
- margin-bottom: 10px;
- padding-right: 1px;
- }
- .score-btn {
- background: rgb(85, 191, 255);
- color: white;
- border-color: rgb(85, 191, 255);
- }
- .remark-board {
- cursor: pointer;
- }
- .el-button {
- outline: none;
- }
- </style>
|