|
@@ -35,7 +35,10 @@
|
|
|
{{ image.title }}
|
|
|
</div>
|
|
|
<div class="image-action">
|
|
|
- <div class="image-action-li" title="标记" @click="toMark">
|
|
|
+ <div
|
|
|
+ :class="['image-action-li', { 'is-disabled': image.markDisabled }]"
|
|
|
+ @click="toMark"
|
|
|
+ >
|
|
|
<Icon :class="{ 'mark-act': image.mark }" type="md-bookmark" />
|
|
|
</div>
|
|
|
<div class="image-action-li" @click="toRotate">
|
|
@@ -49,7 +52,7 @@
|
|
|
|
|
|
<script>
|
|
|
import ImageViewContain from "@/components/ImageViewContain";
|
|
|
-import { markTask } from "@/api";
|
|
|
+import { markTask, markPaper } from "@/api";
|
|
|
|
|
|
export default {
|
|
|
name: "marker-image-view",
|
|
@@ -87,6 +90,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ curUserRoleType: this.$ls.get("user", { role: "" }).role,
|
|
|
initImage: {
|
|
|
id: "",
|
|
|
thumbSrc: "",
|
|
@@ -95,6 +99,7 @@ export default {
|
|
|
score: "",
|
|
|
deg: 0,
|
|
|
mark: false,
|
|
|
+ markDisabled: false,
|
|
|
sample: false,
|
|
|
selected: false
|
|
|
},
|
|
@@ -118,13 +123,22 @@ export default {
|
|
|
this.$refs.ImageViewContain.resizeImage(image.deg);
|
|
|
},
|
|
|
async toMark() {
|
|
|
+ if (this.image.markDisabled) return;
|
|
|
if (this.loading) return;
|
|
|
this.loading = true;
|
|
|
- const res = await markTask({
|
|
|
- markTaskId: this.image.id,
|
|
|
- isMark: !this.image.mark,
|
|
|
- stage: this.stage
|
|
|
- }).catch(() => {});
|
|
|
+ let res = null;
|
|
|
+ if (this.curUserRoleType === "MARK_LEADER") {
|
|
|
+ res = await markPaper({
|
|
|
+ paperId: this.image.id,
|
|
|
+ isMark: !this.image.mark,
|
|
|
+ role: this.curUserRoleType
|
|
|
+ }).catch(() => {});
|
|
|
+ } else {
|
|
|
+ res = await markTask({
|
|
|
+ markTaskId: this.image.id,
|
|
|
+ isMark: !this.image.mark
|
|
|
+ }).catch(() => {});
|
|
|
+ }
|
|
|
this.loading = false;
|
|
|
if (!res) return;
|
|
|
this.image.mark = !this.image.mark;
|