|
@@ -31,6 +31,11 @@
|
|
>
|
|
>
|
|
NO.{{ paper.sn }}
|
|
NO.{{ paper.sn }}
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="image-action">
|
|
|
|
+ <div :class="['image-action-li']" @click="toMark(paper)">
|
|
|
|
+ <Icon :class="{ 'mark-act': paper.mark }" type="md-bookmark" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</marker-image-view>
|
|
</marker-image-view>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -42,7 +47,7 @@
|
|
<script>
|
|
<script>
|
|
import { mapState } from "vuex";
|
|
import { mapState } from "vuex";
|
|
|
|
|
|
-import { actionHistory, actionLeaderHistory } from "@/api";
|
|
|
|
|
|
+import { actionHistory, actionLeaderHistory, markTask, markPaper } from "@/api";
|
|
import MarkerImageView from "./MarkerImageView";
|
|
import MarkerImageView from "./MarkerImageView";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -59,13 +64,15 @@ export default {
|
|
components: { MarkerImageView },
|
|
components: { MarkerImageView },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ curUserRoleType: this.$ls.get("user", { role: "" }).role,
|
|
modalIsShow: false,
|
|
modalIsShow: false,
|
|
workId: "",
|
|
workId: "",
|
|
subject: "",
|
|
subject: "",
|
|
subjectId: this.$route.params.subjectId,
|
|
subjectId: this.$route.params.subjectId,
|
|
userId: "",
|
|
userId: "",
|
|
curPaper: {},
|
|
curPaper: {},
|
|
- papers: []
|
|
|
|
|
|
+ papers: [],
|
|
|
|
+ loading: false
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -148,6 +155,28 @@ export default {
|
|
});
|
|
});
|
|
this.papers = [...this.papers, ...papers].slice(-5);
|
|
this.papers = [...this.papers, ...papers].slice(-5);
|
|
},
|
|
},
|
|
|
|
+ async toMark(paper) {
|
|
|
|
+ if (this.loading) return;
|
|
|
|
+ this.loading = true;
|
|
|
|
+ let res = null;
|
|
|
|
+ if (this.curUserRoleType === "MARK_LEADER") {
|
|
|
|
+ res = await markPaper({
|
|
|
|
+ paperId: paper.id,
|
|
|
|
+ isMark: !paper.mark,
|
|
|
|
+ role: this.curUserRoleType
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ } else {
|
|
|
|
+ res = await markTask({
|
|
|
|
+ markTaskId: paper.id,
|
|
|
|
+ isMark: !paper.mark,
|
|
|
|
+ stage: this.stage
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ }
|
|
|
|
+ this.loading = false;
|
|
|
|
+ if (!res) return;
|
|
|
|
+ paper.mark = !paper.mark;
|
|
|
|
+ this.$emit("on-mark", paper.mark);
|
|
|
|
+ },
|
|
cancel() {
|
|
cancel() {
|
|
this.modalIsShow = false;
|
|
this.modalIsShow = false;
|
|
},
|
|
},
|