|
|
@@ -0,0 +1,143 @@
|
|
|
+<template>
|
|
|
+ <card-judge-item :success="pass">
|
|
|
+ <div class="result-section">
|
|
|
+ <strong>{{ checkResultItem.content }}</strong>
|
|
|
+ <div
|
|
|
+ :class="{ 'group-line--hover': !result.isArgued }"
|
|
|
+ class="group-line"
|
|
|
+ v-for="result in checkResultItem.results"
|
|
|
+ :key="result.rid"
|
|
|
+ @click="argue(result)"
|
|
|
+ >
|
|
|
+ <strong style="padding-right:10px;color:grey"
|
|
|
+ >+ id:{{ result.groupId + "\t" }}</strong
|
|
|
+ >
|
|
|
+ <span class="state state-success" v-if="result.level">PASS</span>
|
|
|
+ <span class="state state-error" v-else>ERROR</span>
|
|
|
+ <span class="comments">{{ result.comment }}</span>
|
|
|
+ <b-tag
|
|
|
+ v-if="result.isArgued"
|
|
|
+ type="is-warning"
|
|
|
+ class="state"
|
|
|
+ style="margin-left: 10px;"
|
|
|
+ >已申请
|
|
|
+ </b-tag>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <b-modal :active.sync="showModal" :width="400">
|
|
|
+ <div class="card">
|
|
|
+ <div class="title">申请重判</div>
|
|
|
+ <div class="content">
|
|
|
+ <b-field label="理由">
|
|
|
+ <b-input maxlength="200" type="textarea" v-model="remark"></b-input>
|
|
|
+ </b-field>
|
|
|
+
|
|
|
+ <a
|
|
|
+ class="button is-link"
|
|
|
+ :class="{ 'is-loading': submitLoading }"
|
|
|
+ @click="submit()"
|
|
|
+ >
|
|
|
+ 提交重判申请
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </b-modal>
|
|
|
+ </card-judge-item>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import CardJudgeItem from "@/components/CardJudgeItem/index";
|
|
|
+export default {
|
|
|
+ name: "ResultCheckListItem",
|
|
|
+ components: { CardJudgeItem },
|
|
|
+ props: {
|
|
|
+ checkResultItem: {
|
|
|
+ type: Object,
|
|
|
+ default: () => ({
|
|
|
+ results: []
|
|
|
+ })
|
|
|
+ },
|
|
|
+ arguable: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ selectedResult: {},
|
|
|
+ showModal: false,
|
|
|
+ remark: "",
|
|
|
+ submitLoading: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ pass() {
|
|
|
+ const { results = [] } = this.checkResultItem;
|
|
|
+ return results.filter(result => result.level === false).length === 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ argue(result) {
|
|
|
+ if (this.arguable && !result.isArgued) {
|
|
|
+ this.selectedResult = result;
|
|
|
+ this.showModal = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async submit() {
|
|
|
+ this.submitLoading = true;
|
|
|
+ await this.$emit("argue", {
|
|
|
+ id: this.checkResultItem.id,
|
|
|
+ groupId: this.selectedResult.groupId,
|
|
|
+ remark: this.remark
|
|
|
+ });
|
|
|
+ this.submitLoading = false;
|
|
|
+ this.showModal = false;
|
|
|
+ this.remark = "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import "../../assets/scss/app";
|
|
|
+.result-section {
|
|
|
+ padding: $default-margin;
|
|
|
+ border-bottom: 1px solid rgba(0, 0, 0, 0.12);
|
|
|
+}
|
|
|
+
|
|
|
+.card {
|
|
|
+ padding: $default-margin-between;
|
|
|
+ border-radius: $default-radius;
|
|
|
+}
|
|
|
+
|
|
|
+.state {
|
|
|
+ padding: 2px 5px;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 12px;
|
|
|
+ border-radius: 3px;
|
|
|
+ color: white;
|
|
|
+}
|
|
|
+
|
|
|
+.state-success {
|
|
|
+ background: $success;
|
|
|
+}
|
|
|
+.state-error {
|
|
|
+ background: $danger;
|
|
|
+}
|
|
|
+.comments {
|
|
|
+ padding-left: 10px;
|
|
|
+ display: inline-block;
|
|
|
+ color: $grey;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
+
|
|
|
+.group-line {
|
|
|
+ padding: 2px 0;
|
|
|
+ border-radius: $default-radius;
|
|
|
+}
|
|
|
+
|
|
|
+.group-line--hover:hover {
|
|
|
+ cursor: pointer;
|
|
|
+ background-color: #f4f4f4;
|
|
|
+}
|
|
|
+</style>
|