|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div :class="classes">
|
|
|
- <div class="image-view" v-for="(image, index) in data" :key="image.id">
|
|
|
+ <div class="image-view" v-for="(image, index) in data" :key="image.key">
|
|
|
<div class="image-view-container">
|
|
|
<h5 class="image-view-title">{{ image.title }}</h5>
|
|
|
<image-view-contain
|
|
@@ -18,30 +18,42 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="image-view-actions" v-if="actions.length">
|
|
|
- <Button
|
|
|
- class="view-action-save"
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- @click="toSaveRotate(image)"
|
|
|
- :disabled="saving"
|
|
|
- v-if="canRotate && image['stepDeg']"
|
|
|
- >保存</Button
|
|
|
- >
|
|
|
- <Button
|
|
|
- class="view-action-rotate"
|
|
|
- size="small"
|
|
|
- icon="md-refresh"
|
|
|
- @click="toRotate(image)"
|
|
|
- v-if="canRotate"
|
|
|
- ></Button>
|
|
|
- <Button
|
|
|
- class="view-action-absent"
|
|
|
- :type="image.missing ? 'error' : 'default'"
|
|
|
- size="small"
|
|
|
- @click="toSignAbsent(image)"
|
|
|
- v-if="canAbsent"
|
|
|
- >缺考</Button
|
|
|
- >
|
|
|
+ <div>
|
|
|
+ <Button
|
|
|
+ class="view-action-rotate"
|
|
|
+ size="small"
|
|
|
+ icon="md-refresh"
|
|
|
+ @click="toRotate(image)"
|
|
|
+ v-if="canRotate"
|
|
|
+ ></Button>
|
|
|
+ <Button
|
|
|
+ class="view-action-save"
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click="toSaveRotate(image)"
|
|
|
+ :disabled="saving"
|
|
|
+ v-if="canRotate && image['stepDeg']"
|
|
|
+ >保存</Button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <Button
|
|
|
+ class="view-action-absent"
|
|
|
+ :type="image.missing ? 'error' : 'default'"
|
|
|
+ size="small"
|
|
|
+ @click="toSignAbsent(image)"
|
|
|
+ v-if="canAbsent"
|
|
|
+ >缺考</Button
|
|
|
+ >
|
|
|
+ <Button
|
|
|
+ v-if="canMark"
|
|
|
+ :class="['view-action-mark', { 'mark-act': image.isMark }]"
|
|
|
+ :type="image.missing ? 'error' : 'default'"
|
|
|
+ size="small"
|
|
|
+ icon="md-bookmark"
|
|
|
+ @click="toMark(image)"
|
|
|
+ ></Button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -49,7 +61,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { rotatePaper, absentPaper } from "@/api";
|
|
|
+import { rotatePaper, absentPaper, markPaper } from "@/api";
|
|
|
import ImageViewContain from "../../../components/ImageViewContain";
|
|
|
|
|
|
export default {
|
|
@@ -93,6 +105,9 @@ export default {
|
|
|
},
|
|
|
canAbsent() {
|
|
|
return this.actions.includes("absent");
|
|
|
+ },
|
|
|
+ canMark() {
|
|
|
+ return this.actions.includes("mark");
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -126,6 +141,13 @@ export default {
|
|
|
await absentPaper(image.id);
|
|
|
image.missing = !image.missing;
|
|
|
},
|
|
|
+ async toMark(image) {
|
|
|
+ await markPaper({
|
|
|
+ paperId: image.id,
|
|
|
+ isMark: !image.isMark
|
|
|
+ });
|
|
|
+ image.isMark = !image.isMark;
|
|
|
+ },
|
|
|
toReview(index) {
|
|
|
this.$emit("on-review", index);
|
|
|
}
|