|
@@ -30,8 +30,13 @@
|
|
|
<div v-if="image.level" class="image-level">{{ image.level }}</div>
|
|
|
<div v-if="image.score" class="image-level">{{ image.score }}</div>
|
|
|
</div>
|
|
|
- <div class="image-rotate" @click="toRotate">
|
|
|
- <Icon type="md-refresh-circle" />
|
|
|
+ <div class="image-action">
|
|
|
+ <div class="image-action-li" @click="toMark">
|
|
|
+ <Icon :class="{ 'mark-act': image.isMark }" type="md-bookmark" />
|
|
|
+ </div>
|
|
|
+ <div class="image-action-li" @click="toRotate">
|
|
|
+ <Icon type="md-refresh-circle" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</slot>
|
|
|
</div>
|
|
@@ -40,6 +45,7 @@
|
|
|
|
|
|
<script>
|
|
|
import ImageViewContain from "@/components/ImageViewContain";
|
|
|
+import { markTask } from "@/api";
|
|
|
|
|
|
export default {
|
|
|
name: "marker-image-view",
|
|
@@ -77,9 +83,11 @@ export default {
|
|
|
level: "",
|
|
|
score: "",
|
|
|
deg: 0,
|
|
|
+ isMark: false,
|
|
|
sample: false,
|
|
|
selected: false
|
|
|
},
|
|
|
+ loading: false,
|
|
|
image: {}
|
|
|
};
|
|
|
},
|
|
@@ -94,6 +102,17 @@ export default {
|
|
|
|
|
|
this.$refs.ImageViewContain.resizeImage(image.deg);
|
|
|
},
|
|
|
+ async toMark() {
|
|
|
+ if (this.loading) return;
|
|
|
+ this.loading = true;
|
|
|
+ const res = await markTask({
|
|
|
+ markTaskId: this.image.id,
|
|
|
+ isMark: !this.image.isMark
|
|
|
+ }).catch(() => {});
|
|
|
+ this.loading = false;
|
|
|
+ if (!res) return;
|
|
|
+ this.image.isMark = !this.image.isMark;
|
|
|
+ },
|
|
|
toSelect() {
|
|
|
if (this.image.sample) return;
|
|
|
this.image.selected = !this.image.selected;
|