|
|
@@ -13,27 +13,89 @@
|
|
|
<template slot="title">
|
|
|
文档内容
|
|
|
</template>
|
|
|
+ <template slot="content">
|
|
|
+ 题目名称:{{ contentResult.name }}
|
|
|
+ </template>
|
|
|
+ <template slot="extraContent">
|
|
|
+ 小组成员:<span
|
|
|
+ v-for="member in contentResult.group.members"
|
|
|
+ :key="member.id"
|
|
|
+ >{{ member.username }} </span
|
|
|
+ >
|
|
|
+ </template>
|
|
|
</page-header>
|
|
|
- <page-body> <div class="data-table">文档内容</div> </page-body>
|
|
|
+ <page-body>
|
|
|
+ <div class="data-table">
|
|
|
+ <div style="text-align: right">
|
|
|
+ 上次修改时间:{{ displayUnixTime(contentResult.lastUpdateAt) }}
|
|
|
+ </div>
|
|
|
+ <hr />
|
|
|
+ <div v-if="fetchLoading"><page-section-loading show /></div>
|
|
|
+ <div v-else 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 { getDocContentByDocId } 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
|
|
|
+ PageHeader,
|
|
|
+ VueMarkdown,
|
|
|
+ PageSectionLoading
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- docId: null
|
|
|
+ docId: null,
|
|
|
+ contentResult: {
|
|
|
+ content: "",
|
|
|
+ group: "",
|
|
|
+ lastUpdateAt: "",
|
|
|
+ name: ""
|
|
|
+ },
|
|
|
+ fetchLoading: false
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.docId = this.$route.query.assignId;
|
|
|
},
|
|
|
- mounted() {}
|
|
|
+ mounted() {
|
|
|
+ this.fetchLoading = true;
|
|
|
+ getDocContentByDocId(this.docId).then(res => {
|
|
|
+ this.contentResult = res.data;
|
|
|
+ this.fetchLoading = 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>
|