|
|
@@ -0,0 +1,130 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <page-header
|
|
|
+ :loading="loadingDocContent"
|
|
|
+ :routes="[
|
|
|
+ { name: '文档作业', path: 'document' },
|
|
|
+ {
|
|
|
+ name: `作业详情`,
|
|
|
+ path: `document/${$route.params.documentId}`
|
|
|
+ },
|
|
|
+ { name: `文档内容`, path: `${$route.path}` }
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ <template slot="title">
|
|
|
+ 文档内容
|
|
|
+ </template>
|
|
|
+ <template slot="content">
|
|
|
+ 题目名称:{{ contentResult.name }} <br />
|
|
|
+ <br />
|
|
|
+ commit: <b-tag type="is-primary">{{contentResult.gitCommit ? contentResult.gitCommit.substring(0,8) : '暂无commit记录' }}</b-tag>
|
|
|
+ <a class="button is-small" v-clipboard:copy="message"
|
|
|
+ v-clipboard:success="onCopy"
|
|
|
+ v-clipboard:error="onError" style="margin-left:10px;">复制</a>
|
|
|
+ <br/><br/>
|
|
|
+ 小组成员:<span
|
|
|
+ v-for="member in contentResult.group.members"
|
|
|
+ :key="member.id"
|
|
|
+ >{{ member.username }} </span
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ <template slot="extraContent">
|
|
|
+ <b-tag type="is-light" style="margin-right: 5px"
|
|
|
+ >上次修改时间:{{
|
|
|
+ displayUnixTime(contentResult.lastUpdateAt)
|
|
|
+ }}</b-tag
|
|
|
+ >
|
|
|
+ <br />
|
|
|
+ <b-tag type="is-info" style="margin-right: 5px" size="is-medium"
|
|
|
+ >成绩:{{
|
|
|
+ contentResult.result === null ? "暂无" : contentResult.result
|
|
|
+ }}</b-tag
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </page-header>
|
|
|
+ <page-body>
|
|
|
+ <div class="data-table">
|
|
|
+ <page-section-loading :show="loadingDocContent" />
|
|
|
+ <div v-if="!loadingDocContent" class="page-section">
|
|
|
+ <div v-if="contentResult.content" class="content">
|
|
|
+ <vue-markdown>{{ contentResult.content }}</vue-markdown>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </page-body>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import PageHeader from "@/components/PageHeader";
|
|
|
+import PageBody from "@/components/PageBody/index";
|
|
|
+import { getDocAssignmentContentByDocId } from "@/api/assignment";
|
|
|
+import VueMarkdown from "vue-markdown";
|
|
|
+import PageSectionLoading from "@/components/PageBody/PageSectionLoading/index";
|
|
|
+import timeMixins from "@/mixins/time";
|
|
|
+export default {
|
|
|
+ mixins: [timeMixins],
|
|
|
+ components: {
|
|
|
+ PageBody,
|
|
|
+ PageHeader,
|
|
|
+ VueMarkdown,
|
|
|
+ PageSectionLoading
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ onCopy() {
|
|
|
+ this.$toast.open({
|
|
|
+ message: "复制成功",
|
|
|
+ type: "is-success"
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onError() {
|
|
|
+ this.$toast.open({
|
|
|
+ message: "复制失败",
|
|
|
+ type: "is-danger"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ contentResult: {
|
|
|
+ content: "",
|
|
|
+ group: "",
|
|
|
+ result: null,
|
|
|
+ lastUpdateAt: "",
|
|
|
+ name: "",
|
|
|
+ message: ""
|
|
|
+ },
|
|
|
+ loadingDocContent: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ mounted() {
|
|
|
+ this.loadingDocContent = true;
|
|
|
+ const { groupWorkId } = this.$route.params;
|
|
|
+ getDocAssignmentContentByDocId(groupWorkId).then(res => {
|
|
|
+ this.contentResult = res.data;
|
|
|
+ this.message = res.data.gitCommit;
|
|
|
+ this.loadingDocContent = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import "../../../assets/scss/app";
|
|
|
+.right-part {
|
|
|
+ margin-bottom: -1.5rem;
|
|
|
+ margin-right: -1.5rem;
|
|
|
+ background: white;
|
|
|
+ border-top: 1px solid #eff2f7;
|
|
|
+ /*position: sticky;*/
|
|
|
+ top: 0;
|
|
|
+ /*max-height: 100vh;*/
|
|
|
+ /*overflow-y: auto;*/
|
|
|
+ box-shadow: $default-shadow;
|
|
|
+}
|
|
|
+
|
|
|
+.action-button {
|
|
|
+ width: 100%;
|
|
|
+ border-radius: 0;
|
|
|
+}
|
|
|
+</style>
|