Browse Source

修改问题

zengyicheng 2 years ago
parent
commit
b06f61343e

+ 7 - 15
src/components/pages/components/worksDetail2.vue

@@ -965,11 +965,13 @@
 
 <script>
 import StudentData from "./studentData";
+import pdf from "./vpdf";
 import htmlDocx from "html-docx-js/dist/html-docx";
 import saveAs from "file-saver";
 export default {
   components: {
     StudentData,
+    pdf,
   },
   props: ["cid", "uid", "ooid"],
   data() {
@@ -1377,13 +1379,12 @@ export default {
               _rate[k] = [];
               _rateList[k] = [];
             }
-
             for (var i = 0; i < worksDetail.length; i++) {
               if (
                 res.data[0][k].stage == worksDetail[i].stage &&
                 res.data[0][k].task == worksDetail[i].task
               ) {
-                workJson[k].img.push({ src: worksDetail[i].content, id: i });
+                workJson[k].img.push({ src: JSON.parse(worksDetail[i].content).url, id: i });
               }
             }
             for (var i = 0; i < askInfo.length; i++) {
@@ -1506,7 +1507,6 @@ export default {
                 this.checkJson[k].allRight = isCount / t.radio.length;
               }
             }
-
             for (var i = 0; i < pptInfo.length; i++) {
               if (
                 res.data[0][k].stage == pptInfo[i].stage &&
@@ -1515,26 +1515,18 @@ export default {
                 var a = ["PPT", "PPTX", "XLSX", "XLS", "DOC", "DOCX"];
                 if (
                   a.indexOf(
-                    pptInfo[i].content
-                      .split(".")
-                      [
-                        pptInfo[i].content.split(".").length - 1
-                      ].toLocaleUpperCase()
+                    JSON.parse(pptInfo[i].content).url.split(".")[JSON.parse(pptInfo[i].content).url.split(".").length - 1].toLocaleUpperCase()
                   ) != -1
                 ) {
                   var a =
                     "https://view.officeapps.live.com/op/view.aspx?src=" +
-                    pptInfo[i].content;
+                    JSON.parse(pptInfo[i].content).url;
                   workJson[k].wpptInfo.push(a);
                   this.showPDF = false;
                 } else if (
-                  pptInfo[i].content
-                    .split(".")
-                    [
-                      pptInfo[i].content.split(".").length - 1
-                    ].toLocaleUpperCase() == "PDF"
+                  JSON.parse(pptInfo[i].content).url.split(".")[JSON.parse(pptInfo[i].content).url.split(".").length - 1].toLocaleUpperCase() == "PDF"
                 ) {
-                  workJson[k].wpptInfo.push(pptInfo[i].content);
+                  workJson[k].wpptInfo.push(JSON.parse(pptInfo[i].content).url);
                   this.showPDF = true;
                 }
               }

+ 4 - 3
src/components/pages/learnAnalysis/components/beDataBase.vue

@@ -474,12 +474,13 @@ export default {
                 }
               }
             }
-
             var allToolWorks = tool;
             var isFinishTaskWorks = isFinish;
             if (allToolWorks > 0) {
-              overPer.toolSubRate =
-                (isFinishTaskWorks / allToolWorks).toFixed(2) * 100;
+              overPer.toolSubRate = (
+                (isFinishTaskWorks / allToolWorks) *
+                100
+              ).toFixed(2);
             } else {
               overPer.toolSubRate = 0;
             }