kunduin 7 роки тому
батько
коміт
55f32f83f6

Різницю між файлами не показано, бо вона завелика
+ 1 - 0
mock/util/makeLongMarkdown.js


+ 1 - 0
package.json

@@ -15,6 +15,7 @@
     "chart.js": "^2.7.3",
     "dayjs": "^1.7.8",
     "file-saver": "^2.0.1",
+    "marked": "^0.6.2",
     "register-service-worker": "^1.5.2",
     "vue": "^2.5.17",
     "vue-chartjs": "^3.4.0",

+ 10 - 0
src/components/Markdown/index.jsx

@@ -0,0 +1,10 @@
+import marked from "marked";
+
+export default {
+  name: "Markdown",
+  render() {
+    const content = this.$slots.default;
+    console.log(marked(content[0].text || ""));
+    return <div v-html={marked(content[0].text || "")} />;
+  }
+};

+ 18 - 8
src/views/student/Document/docContent.vue

@@ -17,11 +17,21 @@
       <template slot="content">
         题目名称:{{ contentResult.name }} <br />
         <br />
-      对应提交: <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/>
+        对应提交:
+        <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"
@@ -47,7 +57,7 @@
         <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>
+            <markdown>{{ contentResult.content }}</markdown>
           </div>
         </div>
       </div>
@@ -59,15 +69,15 @@
 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";
+import Markdown from "@/components/Markdown";
 export default {
   mixins: [timeMixins],
   components: {
+    Markdown,
     PageBody,
     PageHeader,
-    VueMarkdown,
     PageSectionLoading
   },
   methods: {

+ 4 - 4
src/views/student/Review/ReviewDetail/ReviewSelfDetail/index.vue

@@ -5,7 +5,7 @@
         <page-section-loading :show="selfDetailLoading" />
         <div v-if="!selfDetailLoading" class="page-section">
           <div v-if="detail.docContent" class="content">
-            <vue-markdown>{{ detail.docContent }}</vue-markdown>
+            <markdown>{{ detail.docContent }}</markdown>
           </div>
         </div>
       </div>
@@ -31,7 +31,6 @@
   </div>
 </template>
 <script>
-import VueMarkdown from "vue-markdown";
 import {
   getStudentReviewSelfDetail,
   postStudentArgueReview
@@ -39,11 +38,12 @@ import {
 import timeMixins from "@/mixins/time";
 import ResultCheckListItem from "@/components/CheckList/ResultCheckListItem";
 import PageSectionLoading from "@/components/PageBody/PageSectionLoading/index";
+import Markdown from "@/components/Markdown";
 export default {
   components: {
+    Markdown,
     PageSectionLoading,
-    ResultCheckListItem,
-    VueMarkdown
+    ResultCheckListItem
   },
   data() {
     return {

+ 4 - 4
src/views/student/Review/ReviewDocDetail/index.vue

@@ -23,7 +23,7 @@
           <div v-if="fetchLoading"><page-section-loading show /></div>
           <div v-else class="page-section">
             <div v-if="detail.docContent" class="content">
-              <vue-markdown>{{ detail.docContent }}</vue-markdown>
+              <markdown>{{ detail.docContent }}</markdown>
             </div>
           </div>
         </div>
@@ -57,7 +57,6 @@
 <script>
 import PageHeader from "@/components/PageHeader";
 import PageBody from "@/components/PageBody/index";
-import VueMarkdown from "vue-markdown";
 import {
   getStudentReviewDocDetail,
   postStudentArgueAcceptation,
@@ -68,14 +67,15 @@ import timeMixins from "@/mixins/time";
 import ReviewStateTag from "@/components/ReviewStateTag/index";
 import CheckList from "@/components/CheckList/index";
 import PageSectionLoading from "@/components/PageBody/PageSectionLoading/index";
+import Markdown from "@/components/Markdown";
 export default {
   components: {
+    Markdown,
     PageSectionLoading,
     CheckList,
     ReviewStateTag,
     PageBody,
-    PageHeader,
-    VueMarkdown
+    PageHeader
   },
   data() {
     return {

+ 11 - 6
src/views/teacher/Document/docContent.vue

@@ -17,9 +17,14 @@
       <template slot="content">
         题目名称:{{ contentResult.name }} <br />
         <br />
-        对应提交: <b-tag type="is-primary">{{contentResult.gitCommit ? contentResult.gitCommit.substring(0,8) : '暂无commit记录' }}</b-tag>
-        <br/>
-        <br/>
+        对应提交:
+        <b-tag type="is-primary">{{
+          contentResult.gitCommit
+            ? contentResult.gitCommit.substring(0, 8)
+            : "暂无commit记录"
+        }}</b-tag>
+        <br />
+        <br />
         小组成员:<span
           v-for="member in contentResult.group.members"
           :key="member.id"
@@ -45,7 +50,7 @@
         <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>
+            <markdown>{{ contentResult.content }}</markdown>
           </div>
         </div>
       </div>
@@ -57,15 +62,15 @@
 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";
+import Markdown from "@/components/Markdown";
 export default {
   mixins: [timeMixins],
   components: {
+    Markdown,
     PageBody,
     PageHeader,
-    VueMarkdown,
     PageSectionLoading
   },
   data() {

+ 4 - 4
src/views/teacher/Review/ReviewDetail/GroupArgueDetail/index.vue

@@ -32,7 +32,7 @@
         <div class="column is-8">
           <div class="page-section">
             <div v-if="detail.docContent" class="content">
-              <vue-markdown>{{ detail.docContent }}</vue-markdown>
+              <markdown>{{ detail.docContent }}</markdown>
             </div>
           </div>
         </div>
@@ -53,19 +53,19 @@
   </div>
 </template>
 <script>
-import VueMarkdown from "vue-markdown";
 import { getTeacherStartArgue, postTeacherArgueResult } from "@/api/review";
 import timeMixins from "@/mixins/time";
 import PageHeader from "@/components/PageHeader";
 import PageBody from "@/components/PageBody/index";
 import { getGroupDetail } from "@/api/group";
 import CheckList from "@/components/CheckList/index";
+import Markdown from "@/components/Markdown";
 export default {
   components: {
+    Markdown,
     PageBody,
     PageHeader,
-    CheckList,
-    VueMarkdown
+    CheckList
   },
   data() {
     return {

+ 4 - 4
src/views/teacher/Review/ReviewDetail/GroupDocDetail/index.vue

@@ -28,7 +28,7 @@
           <div v-if="detailLoading"><page-section-loading show /></div>
           <div v-else class="page-section">
             <div v-if="detail.docContent" class="content">
-              <vue-markdown>{{ detail.docContent }}</vue-markdown>
+              <markdown>{{ detail.docContent }}</markdown>
             </div>
           </div>
         </div>
@@ -48,7 +48,6 @@
   </div>
 </template>
 <script>
-import VueMarkdown from "vue-markdown";
 import { getTeacherReviewGroupDetail } from "@/api/review";
 import timeMixins from "@/mixins/time";
 import ResultCheckListItem from "@/components/CheckList/ResultCheckListItem";
@@ -56,13 +55,14 @@ import PageHeader from "@/components/PageHeader";
 import PageBody from "@/components/PageBody/index";
 import { getGroupDetail } from "@/api/group";
 import PageSectionLoading from "@/components/PageBody/PageSectionLoading/index";
+import Markdown from "@/components/Markdown";
 export default {
   components: {
+    Markdown,
     PageSectionLoading,
     PageBody,
     PageHeader,
-    ResultCheckListItem,
-    VueMarkdown
+    ResultCheckListItem
   },
   data() {
     return {

+ 2 - 2
vue.config.js

@@ -2,8 +2,8 @@ module.exports = {
   devServer: {
     proxy: {
       "^/api": {
-        // target: "http://localhost:4000/",
-        target: "http://10.1.1.198:8080/",
+        target: "http://localhost:4000/",
+        // target: "http://10.1.1.198:8080/",
         //target: "http://192.168.0.101:8080",
         // target: "http://10.1.2.3:8080/",
 

+ 43 - 0
yarn.lock

@@ -1976,6 +1976,15 @@ cli-width@^2.0.0:
   version "2.2.0"
   resolved "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639"
 
+clipboard@^2.0.0:
+  version "2.0.4"
+  resolved "https://registry.npm.taobao.org/clipboard/download/clipboard-2.0.4.tgz#836dafd66cf0fea5d71ce5d5b0bf6e958009112d"
+  integrity sha1-g22v1mzw/qXXHOXVsL9ulYAJES0=
+  dependencies:
+    good-listener "^1.2.2"
+    select "^1.1.2"
+    tiny-emitter "^2.0.0"
+
 clipboardy@^1.2.3:
   version "1.2.3"
   resolved "https://registry.npmjs.org/clipboardy/-/clipboardy-1.2.3.tgz#0526361bf78724c1f20be248d428e365433c07ef"
@@ -2651,6 +2660,11 @@ delayed-stream@~1.0.0:
   version "1.0.0"
   resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
 
+delegate@^3.1.2:
+  version "3.2.0"
+  resolved "https://registry.npm.taobao.org/delegate/download/delegate-3.2.0.tgz#b66b71c3158522e8ab5744f720d8ca0c2af59166"
+  integrity sha1-tmtxwxWFIuirV0T3INjKDCr1kWY=
+
 delegates@^1.0.0:
   version "1.0.0"
   resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
@@ -3794,6 +3808,13 @@ globule@^1.0.0:
     lodash "~4.17.10"
     minimatch "~3.0.2"
 
+good-listener@^1.2.2:
+  version "1.2.2"
+  resolved "https://registry.npm.taobao.org/good-listener/download/good-listener-1.2.2.tgz#d53b30cdf9313dffb7dc9a0d477096aa6d145c50"
+  integrity sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=
+  dependencies:
+    delegate "^3.1.2"
+
 graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6:
   version "4.1.15"
   resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
@@ -5103,6 +5124,11 @@ markdown-it@^6.0.1:
     mdurl "~1.0.1"
     uc.micro "^1.0.1"
 
+marked@^0.6.2:
+  version "0.6.2"
+  resolved "https://registry.npm.taobao.org/marked/download/marked-0.6.2.tgz#c574be8b545a8b48641456ca1dbe0e37b6dccc1a"
+  integrity sha1-xXS+i1Rai0hkFFbKHb4ON7bczBo=
+
 match-at@^0.1.0:
   version "0.1.1"
   resolved "http://registry.npm.taobao.org/match-at/download/match-at-0.1.1.tgz#25d040d291777704d5e6556bbb79230ec2de0540"
@@ -6953,6 +6979,11 @@ select-hose@^2.0.0:
   version "2.0.0"
   resolved "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca"
 
+select@^1.1.2:
+  version "1.1.2"
+  resolved "https://registry.npm.taobao.org/select/download/select-1.1.2.tgz#0e7350acdec80b1108528786ec1d4418d11b396d"
+  integrity sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=
+
 selfsigned@^1.9.1:
   version "1.10.4"
   resolved "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.4.tgz#cdd7eccfca4ed7635d47a08bf2d5d3074092e2cd"
@@ -7631,6 +7662,11 @@ timsort@^0.3.0:
   version "0.3.0"
   resolved "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4"
 
+tiny-emitter@^2.0.0:
+  version "2.1.0"
+  resolved "https://registry.npm.taobao.org/tiny-emitter/download/tiny-emitter-2.1.0.tgz#1d1a56edfc51c43e863cbb5382a72330e3555423"
+  integrity sha1-HRpW7fxRxD6GPLtTgqcjMONVVCM=
+
 tmp@^0.0.33:
   version "0.0.33"
   resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
@@ -7970,6 +8006,13 @@ vue-cli-plugin-buefy@^0.3.3:
   version "0.3.3"
   resolved "https://registry.npmjs.org/vue-cli-plugin-buefy/-/vue-cli-plugin-buefy-0.3.3.tgz#497942f854d1a578d8f8021f57323865b4c53d38"
 
+vue-clipboard2@^0.3.0:
+  version "0.3.0"
+  resolved "https://registry.npm.taobao.org/vue-clipboard2/download/vue-clipboard2-0.3.0.tgz#b04d3f9a2d46f12ca85178445930b38463640b22"
+  integrity sha1-sE0/mi1G8SyoUXhEWTCzhGNkCyI=
+  dependencies:
+    clipboard "^2.0.0"
+
 vue-eslint-parser@^2.0.3:
   version "2.0.3"
   resolved "http://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-2.0.3.tgz#c268c96c6d94cfe3d938a5f7593959b0ca3360d1"

Деякі файли не було показано, через те що забагато файлів було змінено