|
@@ -22,7 +22,7 @@
|
|
|
size="small"
|
|
|
class="btn-form-search"
|
|
|
type="primary"
|
|
|
- @click="getList"
|
|
|
+ @click="search"
|
|
|
>查询</Button
|
|
|
>
|
|
|
</FormItem>
|
|
@@ -62,13 +62,17 @@
|
|
|
@click="toReview(index)"
|
|
|
/>
|
|
|
</div>
|
|
|
- <div class="image-view-actions" v-if="canCancel">
|
|
|
+ <div class="image-view-actions">
|
|
|
<Button
|
|
|
type="error"
|
|
|
size="small"
|
|
|
@click="cancelPaper(image)"
|
|
|
:disabled="image.loading"
|
|
|
- >取消标准卷</Button
|
|
|
+ v-if="canCancel"
|
|
|
+ >取消</Button
|
|
|
+ >
|
|
|
+ <Button type="primary" size="small" @click="toChangePaper(image)"
|
|
|
+ >修改</Button
|
|
|
>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -85,6 +89,41 @@
|
|
|
@on-next="toNextPaper"
|
|
|
ref="SimpleImagePreview"
|
|
|
></simple-image-preview>
|
|
|
+ <!-- change-standard-paper-dialog -->
|
|
|
+ <Modal
|
|
|
+ class="change-standard-paper-dialog"
|
|
|
+ v-model="modalIsShow"
|
|
|
+ title="修改标准卷"
|
|
|
+ :mask-closable="false"
|
|
|
+ >
|
|
|
+ <div class="level-list">
|
|
|
+ <p
|
|
|
+ v-for="level in levels"
|
|
|
+ :key="level"
|
|
|
+ :class="[
|
|
|
+ 'level-item',
|
|
|
+ {
|
|
|
+ 'level-item-act': level === curSelectLevel,
|
|
|
+ 'level-item-disabled': level === curChangePaper.level
|
|
|
+ }
|
|
|
+ ]"
|
|
|
+ @click="selectLevel(level)"
|
|
|
+ >
|
|
|
+ {{ level }}
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div slot="footer">
|
|
|
+ <Button
|
|
|
+ shape="circle"
|
|
|
+ type="primary"
|
|
|
+ :disabled="isSubmit || !curSelectLevel"
|
|
|
+ @click="confirmChange"
|
|
|
+ >确认</Button
|
|
|
+ >
|
|
|
+ <Button shape="circle" @click="cancelChange">取消</Button>
|
|
|
+ </div>
|
|
|
+ </Modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -94,7 +133,8 @@ import {
|
|
|
subjectDetail,
|
|
|
sampleAreaList,
|
|
|
workLevelList,
|
|
|
- cancelStandardPaper
|
|
|
+ cancelStandardPaper,
|
|
|
+ leaderGradingPaper
|
|
|
} from "@/api";
|
|
|
import SimpleImagePreview from "@/components/SimpleImagePreview";
|
|
|
|
|
@@ -108,6 +148,7 @@ export default {
|
|
|
subject: "",
|
|
|
canCancel: false,
|
|
|
questionId: "",
|
|
|
+ lastQuestionId: "",
|
|
|
curLevel: "",
|
|
|
curLevelIndex: 0,
|
|
|
levels: [],
|
|
@@ -115,7 +156,12 @@ export default {
|
|
|
paperMap: {},
|
|
|
papers: [],
|
|
|
curPaper: {},
|
|
|
- curPaperIndex: 0
|
|
|
+ curPaperIndex: 0,
|
|
|
+ // change standard
|
|
|
+ modalIsShow: false,
|
|
|
+ curChangePaper: {},
|
|
|
+ curSelectLevel: null,
|
|
|
+ isSubmit: false
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -153,6 +199,11 @@ export default {
|
|
|
};
|
|
|
});
|
|
|
},
|
|
|
+ search() {
|
|
|
+ if (this.lastQuestionId !== this.questionId) this.paperMap = {};
|
|
|
+ this.lastQuestionId = this.questionId;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
async getList() {
|
|
|
if (this.paperMap[this.curLevel] && this.paperMap[this.curLevel].length) {
|
|
|
this.papers = this.paperMap[this.curLevel];
|
|
@@ -195,6 +246,44 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // change standard paper
|
|
|
+ toChangePaper(paper) {
|
|
|
+ this.curChangePaper = paper;
|
|
|
+ this.modalIsShow = true;
|
|
|
+ },
|
|
|
+ selectLevel(level) {
|
|
|
+ if (level === this.curChangePaper.level) return;
|
|
|
+ this.curSelectLevel = level;
|
|
|
+ },
|
|
|
+ async confirmChange() {
|
|
|
+ if (!this.curSelectLevel) return;
|
|
|
+ if (this.isSubmit) return;
|
|
|
+
|
|
|
+ this.isSubmit = true;
|
|
|
+ const datas = {
|
|
|
+ action: "sampling",
|
|
|
+ level: this.curSelectLevel,
|
|
|
+ originLevel: this.curChangePaper.level,
|
|
|
+ paperIds: this.curChangePaper.id
|
|
|
+ };
|
|
|
+ let result = true;
|
|
|
+ await leaderGradingPaper(datas).catch(() => {
|
|
|
+ result = false;
|
|
|
+ });
|
|
|
+ this.isSubmit = false;
|
|
|
+
|
|
|
+ if (!result) return;
|
|
|
+
|
|
|
+ this.$Message.success("操作成功!");
|
|
|
+ this.paperMap[datas.level] = [];
|
|
|
+ this.paperMap[this.curLevel] = [];
|
|
|
+ this.cancelChange();
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ cancelChange() {
|
|
|
+ this.curSelectLevel = null;
|
|
|
+ this.modalIsShow = false;
|
|
|
+ },
|
|
|
// to review
|
|
|
toReview(index) {
|
|
|
this.selectPaper(index);
|