ソースを参照

Merge branch 'develop6.0-tmd' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop6.0-tmd

liqk 3 年 前
コミット
a28cd2de29
1 ファイル変更23 行追加9 行削除
  1. 23 9
      TEAMModelOS/ClientApp/src/view/learnactivity/StuReport.vue

+ 23 - 9
TEAMModelOS/ClientApp/src/view/learnactivity/StuReport.vue

@@ -149,10 +149,10 @@
                                         <span style="margin:5px;">{{ $t("studentWeb.exam.report.mark") }}:</span>
                                         <span style="margin:5px;">{{ $t("studentWeb.exam.report.mark") }}:</span>
                                     </div>
                                     </div>
                                     <div style="margin-left:10px;" class="annotation">
                                     <div style="margin-left:10px;" class="annotation">
-                                        <img :src="markData[index][0].imgUrl" alt="" v-if="markData[index].length == 1">
+                                        <img :src="markData[index][0].mark" alt="" v-if="markData[index].length == 1">
                                         <Tabs v-else type="card">
                                         <Tabs v-else type="card">
                                             <TabPane :label="$t('studentWeb.exam.report.mark') + (mIndex + 1)" v-for="(mDate, mIndex) in markData[index]" :key="mIndex">
                                             <TabPane :label="$t('studentWeb.exam.report.mark') + (mIndex + 1)" v-for="(mDate, mIndex) in markData[index]" :key="mIndex">
-                                                <img :src="mDate.imgUrl" alt="">
+                                                <img :src="mDate.mark" alt="">
                                             </TabPane>
                                             </TabPane>
                                         </Tabs>
                                         </Tabs>
                                     </div>
                                     </div>
@@ -266,7 +266,7 @@ export default {
             let paper = []
             let paper = []
             this.paperData.length = 0
             this.paperData.length = 0
             this.ansData.length = 0
             this.ansData.length = 0
-            this.markData.length = 0
+            // this.markData.length = 0
             let exam = this.paperInfo.item || []
             let exam = this.paperInfo.item || []
             if (exam.length) {
             if (exam.length) {
                 for (let i = 0; i < exam.length; i++) {
                 for (let i = 0; i < exam.length; i++) {
@@ -318,6 +318,7 @@ export default {
             }
             }
         },
         },
         findStuData() {
         findStuData() {
+            this.markData.length = 0
             let params = {
             let params = {
                 id: this.examInfo.id,
                 id: this.examInfo.id,
                 studentId: this.stuData.id,
                 studentId: this.stuData.id,
@@ -333,6 +334,16 @@ export default {
                     this.average = res.average[subjectIndex]
                     this.average = res.average[subjectIndex]
                     this.knowledge = res.knowledge[subjectIndex]
                     this.knowledge = res.knowledge[subjectIndex]
                     this.filed = res.filed[subjectIndex]
                     this.filed = res.filed[subjectIndex]
+                    let sas = this.examInfo.scope === 'school' ? this.$store.state.user.schoolProfile.blob_sas : this.$store.state.user.userProfile.blob_sas
+                    let blobUrl = this.examInfo.scope === 'school' ? JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri : JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8")).blob_uri
+                    this.markData = res.mark[subjectIndex].map(item => {
+                        if(item.length) {
+                            for (const mark of item) {
+                                mark.mark =  blobUrl + "/" + mark.mark + "?" + sas
+                            }
+                        }
+                        return item
+                    })
                 },
                 },
                 err => {
                 err => {
                     console.error(err)
                     console.error(err)
@@ -350,12 +361,15 @@ export default {
 
 
     },
     },
     watch: {
     watch: {
-        'stuData.id'(n, o) {
-            console.log(n)
-            if (n) {
-                this.findStuData()
-                this.getStuAnswer()
-            }
+        stuData: {
+            handler(n, o) {
+                console.log(n)
+                if (n) {
+                    this.findStuData()
+                    this.getStuAnswer()
+                }
+            },
+            deep: true,
         },
         },
         examInfo: {
         examInfo: {
             handler(n, o) {
             handler(n, o) {