|
@@ -33,8 +33,13 @@
|
|
|
{{ image.title }}
|
|
|
</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>
|
|
@@ -43,6 +48,7 @@
|
|
|
|
|
|
<script>
|
|
|
import ImageViewContain from "@/components/ImageViewContain";
|
|
|
+import { markTask } from "@/api";
|
|
|
|
|
|
export default {
|
|
|
name: "marker-image-view",
|
|
@@ -80,9 +86,11 @@ export default {
|
|
|
level: "",
|
|
|
score: "",
|
|
|
deg: 0,
|
|
|
+ isMark: false,
|
|
|
sample: false,
|
|
|
selected: false
|
|
|
},
|
|
|
+ loading: false,
|
|
|
image: {}
|
|
|
};
|
|
|
},
|
|
@@ -97,6 +105,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;
|