Browse Source

校级查看区级评测

liqk 3 years ago
parent
commit
c91ef09bde

+ 0 - 6
TEAMModelOS/ClientApp/src/view/areatrain/Create.vue

@@ -671,17 +671,11 @@ export default {
                         sas: '?' + sas
                     }
                     if (this.trainInfo.setting.includes('exam')) {
-                        // examInfo.id = item.examId
                         examInfo.id = res.acId
-                        // examInfo.school = item.school
-                        // this.doUploadBlob(examInfo, examItems, schoolInfo)
                         this.doUploadBlob(examInfo, examItems, areaBlob, 'exam')
                     }
                     if (this.trainInfo.setting.includes('survey')) {
-                        // surveyInfo.id = item.surveyId
                         surveyInfo.id = res.acId
-                        // surveyInfo.school = item.school
-                        // this.doUploadBlob(surveyInfo, surveyItems, schoolInfo)
                         this.doUploadBlob(surveyInfo, surveyItems, areaBlob, 'survey')
                     }
                 },

+ 15 - 8
TEAMModelOS/ClientApp/src/view/train/SurveyDetail.vue

@@ -139,16 +139,19 @@ export default {
         getBlobItems(qnItem) {
             return new Promise(async (resolve, reject) => {
                 console.log(qnItem);
-                let blobHost = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri
                 // 根据试卷的Blob地址 去读取JSON文件
+                // let blobHost = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri
                 let sasString = await this.$tools.getSchoolSas()
+                let blobHost = qnItem.owner === 'area' ? this.$store.state.user.osblob_uri : JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri
+                console.log('blob地址',blobHost)
+                let sas = qnItem.owner === 'area' ?  ('?' + this.$store.state.user.osblob_sas) : sasString.sas
                 let promiseArr = []
-                let indexJson = await this.getBlobJsonFile(qnItem.scope, qnItem.blob)
+                let indexJson = await this.getBlobJsonFile(qnItem.owner, qnItem.blob)
                 if (indexJson.slides.length) {
                     for (let item of indexJson.slides) {
                         promiseArr.push(new Promise(async (r, j) => {
                             try {
-                                let itemJson = JSON.parse(await this.$tools.getFile(blobHost + item + sasString.sas))
+                                let itemJson = JSON.parse(await this.$tools.getFile(blobHost + item + sas))
                                 r(itemJson)
                             } catch (e) {
                                 j(e)
@@ -168,13 +171,17 @@ export default {
         },
 
         // 获取blob里的试题数据
-        getBlobJsonFile(scope, url) {
+        getBlobJsonFile(owner, url) {
             return new Promise(async (resolve, reject) => {
-                let blobHost = scope === 'private' ? JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8")).blob_uri : JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri
-                // 根据试卷的Blob地址 去读取JSON文件
-                let sasString = scope === 'private' ? await this.$tools.getPrivateSas() : await this.$tools.getSchoolSas()
+                // let blobHost = scope === 'private' ? JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8")).blob_uri : JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri
+                // // 根据试卷的Blob地址 去读取JSON文件
+                // let sasString = scope === 'private' ? await this.$tools.getPrivateSas() : await this.$tools.getSchoolSas()
+
+                let sasString = await this.$tools.getSchoolSas()
+                let blobHost = owner === 'area' ? this.$store.state.user.osblob_uri : JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri
+                let sas = owner === 'area' ?  ('?' + this.$store.state.user.osblob_sas) : sasString.sas
                 try {
-                    let itemJson = JSON.parse(await this.$tools.getFile(blobHost + url + sasString.sas))
+                    let itemJson = JSON.parse(await this.$tools.getFile(blobHost + url + sas))
                     resolve(itemJson)
                 } catch (e) {
                     reject(e)

+ 2 - 2
TEAMModelOS/ClientApp/src/view/train/TrainDetail.vue

@@ -377,10 +377,10 @@
             </div>
         </Modal>
         <Modal v-model="surveyStatus" title="作答详情" width="800">
-            <SurveyDetail v-if="surveyInfo" :survey="surveyInfo" :answer="surveyTableData[surveyIndex].answer"></SurveyDetail>
+            <SurveyDetail v-if="surveyInfo" :survey="surveyInfo" :answer="surveyTableData[surveyIndex].answer || []"></SurveyDetail>
         </Modal>
         <Modal v-model="examStatus" title="作答详情" width="800">
-            <SurveyDetail v-if="examInfo && tableData[examIndex]" :survey="examInfo" :answer="tableData[examIndex].examAnswer"></SurveyDetail>
+            <SurveyDetail v-if="examInfo && tableData[examIndex]" :survey="examInfo" :answer="tableData[examIndex].examAnswer || []"></SurveyDetail>
         </Modal>
     </div>
 </template>