SanHQin 12 uur geleden
bovenliggende
commit
301b3c23cd
63 gewijzigde bestanden met toevoegingen van 616 en 485 verwijderingen
  1. 1 1
      dist/index.html
  2. 0 0
      dist/static/css/app.9118a702faec4a8ac5fd3dda16543593.css
  3. 0 0
      dist/static/css/app.9118a702faec4a8ac5fd3dda16543593.css.map
  4. BIN
      dist/static/fonts/KaTeX_AMS-Regular.672c961.eot
  5. BIN
      dist/static/fonts/KaTeX_AMS-Regular.9971d27.ttf
  6. BIN
      dist/static/fonts/KaTeX_AMS-Regular.e78f217.woff
  7. BIN
      dist/static/fonts/KaTeX_AMS-Regular.f4c3270.woff2
  8. BIN
      dist/static/fonts/KaTeX_Caligraphic-Bold.3c3fce5.eot
  9. BIN
      dist/static/fonts/KaTeX_Caligraphic-Bold.743b42a.ttf
  10. BIN
      dist/static/fonts/KaTeX_Caligraphic-Bold.a2e0522.woff2
  11. BIN
      dist/static/fonts/KaTeX_Caligraphic-Bold.bac6199.woff
  12. BIN
      dist/static/fonts/KaTeX_Caligraphic-Regular.244db27.ttf
  13. BIN
      dist/static/fonts/KaTeX_Caligraphic-Regular.479a68e.woff2
  14. BIN
      dist/static/fonts/KaTeX_Caligraphic-Regular.a0ba281.eot
  15. BIN
      dist/static/fonts/KaTeX_Caligraphic-Regular.a64e134.woff
  16. BIN
      dist/static/fonts/KaTeX_Fraktur-Bold.0a0aa19.woff
  17. BIN
      dist/static/fonts/KaTeX_Fraktur-Bold.2b4454d.eot
  18. BIN
      dist/static/fonts/KaTeX_Fraktur-Bold.8e5f883.woff2
  19. BIN
      dist/static/fonts/KaTeX_Fraktur-Bold.ad26cc8.ttf
  20. BIN
      dist/static/fonts/KaTeX_Fraktur-Regular.ae2b6f4.woff2
  21. BIN
      dist/static/fonts/KaTeX_Fraktur-Regular.d459632.ttf
  22. BIN
      dist/static/fonts/KaTeX_Fraktur-Regular.dc81eae.eot
  23. BIN
      dist/static/fonts/KaTeX_Fraktur-Regular.f980ca7.woff
  24. BIN
      dist/static/fonts/KaTeX_Main-Bold.83f8b32.woff2
  25. BIN
      dist/static/fonts/KaTeX_Main-Bold.d327c21.eot
  26. BIN
      dist/static/fonts/KaTeX_Main-Bold.d8a629d.woff
  27. BIN
      dist/static/fonts/KaTeX_Main-Bold.e69b951.ttf
  28. BIN
      dist/static/fonts/KaTeX_Main-Italic.07510ed.woff2
  29. BIN
      dist/static/fonts/KaTeX_Main-Italic.1b22614.ttf
  30. BIN
      dist/static/fonts/KaTeX_Main-Italic.2702ac3.eot
  31. BIN
      dist/static/fonts/KaTeX_Main-Italic.8dd42e0.woff
  32. BIN
      dist/static/fonts/KaTeX_Main-Regular.2dffc87.woff
  33. BIN
      dist/static/fonts/KaTeX_Main-Regular.31ec450.eot
  34. BIN
      dist/static/fonts/KaTeX_Main-Regular.bd65225.woff2
  35. BIN
      dist/static/fonts/KaTeX_Main-Regular.d9162df.ttf
  36. BIN
      dist/static/fonts/KaTeX_Math-Italic.031026c.eot
  37. BIN
      dist/static/fonts/KaTeX_Math-Italic.55fbb3a.ttf
  38. BIN
      dist/static/fonts/KaTeX_Math-Italic.afeebb7.woff2
  39. BIN
      dist/static/fonts/KaTeX_Math-Italic.da58601.woff
  40. BIN
      dist/static/fonts/KaTeX_SansSerif-Regular.48c7df6.woff
  41. BIN
      dist/static/fonts/KaTeX_SansSerif-Regular.7d5fa3e.woff2
  42. BIN
      dist/static/fonts/KaTeX_SansSerif-Regular.8075d14.ttf
  43. BIN
      dist/static/fonts/KaTeX_SansSerif-Regular.a3319b7.eot
  44. BIN
      dist/static/fonts/KaTeX_Script-Regular.5acb381.woff
  45. BIN
      dist/static/fonts/KaTeX_Script-Regular.abb12fc.ttf
  46. BIN
      dist/static/fonts/KaTeX_Script-Regular.c472b57.woff2
  47. BIN
      dist/static/fonts/KaTeX_Script-Regular.cf8394e.eot
  48. BIN
      dist/static/fonts/KaTeX_Size1-Regular.5438d9d.eot
  49. BIN
      dist/static/fonts/KaTeX_Size1-Regular.8cc60fd.ttf
  50. BIN
      dist/static/fonts/KaTeX_Size2-Regular.1f5c2ab.eot
  51. BIN
      dist/static/fonts/KaTeX_Size2-Regular.5976fff.ttf
  52. BIN
      dist/static/fonts/KaTeX_Size4-Regular.5a3cee2.eot
  53. BIN
      dist/static/fonts/KaTeX_Size4-Regular.81ab95e.ttf
  54. BIN
      dist/static/fonts/KaTeX_Typewriter-Regular.2901747.ttf
  55. BIN
      dist/static/fonts/KaTeX_Typewriter-Regular.3e9e27f.woff
  56. BIN
      dist/static/fonts/KaTeX_Typewriter-Regular.8a6d8ed.woff2
  57. BIN
      dist/static/fonts/KaTeX_Typewriter-Regular.b2e9414.eot
  58. 0 0
      dist/static/js/app.243aa4b99eb9cdbdf58c.js
  59. 0 0
      dist/static/js/app.243aa4b99eb9cdbdf58c.js.map
  60. 0 0
      dist/static/js/manifest.161e82026ac2ae03ab6f.js.map
  61. 260 470
      src/components/pages/pptEasy/addCourse.vue
  62. 353 12
      src/components/pages/workPage/index.vue
  63. 2 2
      src/config/config.js

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.66d561219f38ae925802353081cd1c03.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.161e82026ac2ae03ab6f.js></script><script type=text/javascript src=./static/js/vendor.bb486323f0fa002ba2e7.js></script><script type=text/javascript src=./static/js/app.a8562978ffd93946fa9e.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.9118a702faec4a8ac5fd3dda16543593.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.161e82026ac2ae03ab6f.js></script><script type=text/javascript src=./static/js/vendor.bb486323f0fa002ba2e7.js></script><script type=text/javascript src=./static/js/app.243aa4b99eb9cdbdf58c.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.9118a702faec4a8ac5fd3dda16543593.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.9118a702faec4a8ac5fd3dda16543593.css.map


BIN
dist/static/fonts/KaTeX_AMS-Regular.672c961.eot


BIN
dist/static/fonts/KaTeX_AMS-Regular.9971d27.ttf


BIN
dist/static/fonts/KaTeX_AMS-Regular.e78f217.woff


BIN
dist/static/fonts/KaTeX_AMS-Regular.f4c3270.woff2


BIN
dist/static/fonts/KaTeX_Caligraphic-Bold.3c3fce5.eot


BIN
dist/static/fonts/KaTeX_Caligraphic-Bold.743b42a.ttf


BIN
dist/static/fonts/KaTeX_Caligraphic-Bold.a2e0522.woff2


BIN
dist/static/fonts/KaTeX_Caligraphic-Bold.bac6199.woff


BIN
dist/static/fonts/KaTeX_Caligraphic-Regular.244db27.ttf


BIN
dist/static/fonts/KaTeX_Caligraphic-Regular.479a68e.woff2


BIN
dist/static/fonts/KaTeX_Caligraphic-Regular.a0ba281.eot


BIN
dist/static/fonts/KaTeX_Caligraphic-Regular.a64e134.woff


BIN
dist/static/fonts/KaTeX_Fraktur-Bold.0a0aa19.woff


BIN
dist/static/fonts/KaTeX_Fraktur-Bold.2b4454d.eot


BIN
dist/static/fonts/KaTeX_Fraktur-Bold.8e5f883.woff2


BIN
dist/static/fonts/KaTeX_Fraktur-Bold.ad26cc8.ttf


BIN
dist/static/fonts/KaTeX_Fraktur-Regular.ae2b6f4.woff2


BIN
dist/static/fonts/KaTeX_Fraktur-Regular.d459632.ttf


BIN
dist/static/fonts/KaTeX_Fraktur-Regular.dc81eae.eot


BIN
dist/static/fonts/KaTeX_Fraktur-Regular.f980ca7.woff


BIN
dist/static/fonts/KaTeX_Main-Bold.83f8b32.woff2


BIN
dist/static/fonts/KaTeX_Main-Bold.d327c21.eot


BIN
dist/static/fonts/KaTeX_Main-Bold.d8a629d.woff


BIN
dist/static/fonts/KaTeX_Main-Bold.e69b951.ttf


BIN
dist/static/fonts/KaTeX_Main-Italic.07510ed.woff2


BIN
dist/static/fonts/KaTeX_Main-Italic.1b22614.ttf


BIN
dist/static/fonts/KaTeX_Main-Italic.2702ac3.eot


BIN
dist/static/fonts/KaTeX_Main-Italic.8dd42e0.woff


BIN
dist/static/fonts/KaTeX_Main-Regular.2dffc87.woff


BIN
dist/static/fonts/KaTeX_Main-Regular.31ec450.eot


BIN
dist/static/fonts/KaTeX_Main-Regular.bd65225.woff2


BIN
dist/static/fonts/KaTeX_Main-Regular.d9162df.ttf


BIN
dist/static/fonts/KaTeX_Math-Italic.031026c.eot


BIN
dist/static/fonts/KaTeX_Math-Italic.55fbb3a.ttf


BIN
dist/static/fonts/KaTeX_Math-Italic.afeebb7.woff2


BIN
dist/static/fonts/KaTeX_Math-Italic.da58601.woff


BIN
dist/static/fonts/KaTeX_SansSerif-Regular.48c7df6.woff


BIN
dist/static/fonts/KaTeX_SansSerif-Regular.7d5fa3e.woff2


BIN
dist/static/fonts/KaTeX_SansSerif-Regular.8075d14.ttf


BIN
dist/static/fonts/KaTeX_SansSerif-Regular.a3319b7.eot


BIN
dist/static/fonts/KaTeX_Script-Regular.5acb381.woff


BIN
dist/static/fonts/KaTeX_Script-Regular.abb12fc.ttf


BIN
dist/static/fonts/KaTeX_Script-Regular.c472b57.woff2


BIN
dist/static/fonts/KaTeX_Script-Regular.cf8394e.eot


BIN
dist/static/fonts/KaTeX_Size1-Regular.5438d9d.eot


BIN
dist/static/fonts/KaTeX_Size1-Regular.8cc60fd.ttf


BIN
dist/static/fonts/KaTeX_Size2-Regular.1f5c2ab.eot


BIN
dist/static/fonts/KaTeX_Size2-Regular.5976fff.ttf


BIN
dist/static/fonts/KaTeX_Size4-Regular.5a3cee2.eot


BIN
dist/static/fonts/KaTeX_Size4-Regular.81ab95e.ttf


BIN
dist/static/fonts/KaTeX_Typewriter-Regular.2901747.ttf


BIN
dist/static/fonts/KaTeX_Typewriter-Regular.3e9e27f.woff


BIN
dist/static/fonts/KaTeX_Typewriter-Regular.8a6d8ed.woff2


BIN
dist/static/fonts/KaTeX_Typewriter-Regular.b2e9414.eot


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.243aa4b99eb9cdbdf58c.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.243aa4b99eb9cdbdf58c.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.161e82026ac2ae03ab6f.js.map


+ 260 - 470
src/components/pages/pptEasy/addCourse.vue

@@ -230,31 +230,10 @@
                     </div>
                   </div>
                 </div>
-                <div style="margin-left: auto;">
-                  <!-- <button
-                class="c_pub_button_return pub_btn_return_img"
-                @click="lastSteps"
-              >
-                返回课程
-              </button>
-              <button
-                class="c_pub_button_confirm pub_btn_finish_img"
-                @click="nextSteps"
-              >
-                确认上传
-              </button> -->
-                  <button
-                    class="c_pub_button_add pub_btn_paste_img"
-                    @click="pasteTask"
-                    v-if="isPasteTask"
-                  >
-                    智能粘贴
-                  </button>
-                </div>
               </div>
             </div>
             <div class="pptIframeArea">
-              <iframe src="https://ppt.cocorobo.cn/" frameborder="0" ref="pptIframeRef"></iframe>
+              <iframe :src="`https://ppt.cocorobo.cn/?mode=editor&courseid=${cid}`" frameborder="0" ref="pptIframeRef"></iframe>
             </div>
 
             <div class="pptToolsArea">
@@ -279,35 +258,6 @@
                   <span>+</span>
                   <div>AI应用</div>
                 </div>
-                <!-- <div class="tool">
-                  <div class="whiteBIcon" @click.stop="addTool(45)">
-                    <img
-                      src="../../../assets/icon/thirdToolList/choose.png"
-                      alt
-                    />
-                    <div style="margin: 5px 0">选择题</div>
-                  </div>
-                </div>
-
-                <div class="tool">
-                  <div class="whiteBIcon" @click.stop="addTool(15)">
-                    <img
-                      src="../../../assets/icon/thirdToolList/answer.png"
-                      alt
-                    />
-                    <div style="margin: 5px 0">问答</div>
-                  </div>
-                </div>
-
-                <div class="tool">
-                  <div class="whiteBIcon" @click.stop="addTool(72)">
-                    <img
-                      src="../../../assets/icon/firstToolList/appStore.png"
-                      alt
-                    />
-                    <div style="margin: 5px 0">应用中心</div>
-                  </div>
-                </div> -->
               </div>
 
 
@@ -349,9 +299,18 @@
                       </div>
                     </div>
                     <div class="pta_tla_l_i_right">
-                      <div class="pta_tla_l_i_r_button" @click="toolBtn(0,item.id)">编辑</div>
-                      <div class="pta_tla_l_i_r_button" @click="toolBtn(1,item.id)">复制</div>
-                      <div class="pta_tla_l_i_r_button" @click="toolBtn(2,item.id)">删除</div>
+                      <div class="pta_tla_l_i_r_button edit" @click="toolBtn(0,item.id)">
+                        <svg t="1755224440400" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4991" width="200" height="200"><path d="M388.1856 93.0944a46.5408 46.5408 0 1 1 0 93.0816H139.648a46.5408 46.5408 0 0 0-46.5408 46.5536V884.352a46.5408 46.5408 0 0 0 46.5408 46.5408h651.648a46.5408 46.5408 0 0 0 46.5408-46.5408V635.8144a46.5408 46.5408 0 1 1 93.0816 0V884.352C930.9056 961.4848 868.3904 1024 791.2704 1024H139.648C62.5152 1024 0 961.4848 0 884.352V232.7424c0-77.12 62.5152-139.648 139.648-139.648h248.5376zM824.192 13.632l186.1888 186.1888a46.5408 46.5408 0 0 1 0 65.8176L544.896 731.0976A46.5408 46.5408 0 0 1 512 744.7296H325.824a46.5408 46.5408 0 0 1-46.5536-46.5536V512c0-12.3392 4.9024-24.192 13.632-32.9088L758.3616 13.632a46.5408 46.5408 0 0 1 65.8176 0zM791.296 112.384L372.352 531.2768v120.3584h120.3584L911.616 232.7296l-120.3584-120.3584z" fill="#ffffff" p-id="4992"></path></svg>
+                        <span>编辑</span>
+                      </div>
+                      <div class="pta_tla_l_i_r_button copy" @click="toolBtn(1,item.id)">
+                        <svg t="1755224487282" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6922" width="200" height="200"><path d="M931.84 675.84c0 12.288-8.192 20.48-20.48 20.48s-20.48-8.192-20.48-20.48V419.84c0-34.816-26.624-61.44-61.44-61.44h-409.6c-34.816 0-61.44 26.624-61.44 61.44v409.6c0 34.816 26.624 61.44 61.44 61.44h409.6c34.816 0 61.44-26.624 61.44-61.44v-45.056c0-12.288 8.192-20.48 20.48-20.48s20.48 8.192 20.48 20.48v45.056c0 57.344-45.056 102.4-102.4 102.4h-409.6c-57.344 0-102.4-45.056-102.4-102.4v-409.6c0-57.344 45.056-102.4 102.4-102.4h409.6c57.344 0 102.4 45.056 102.4 102.4v256z m-225.28-454.656c0 12.288-8.192 20.48-20.48 20.48s-20.48-8.192-20.48-20.48V194.56c0-34.816-26.624-61.44-61.44-61.44h-409.6c-34.816 0-61.44 26.624-61.44 61.44v409.6c0 34.816 26.624 61.44 61.44 61.44h32.768c12.288 0 20.48 8.192 20.48 20.48s-8.192 20.48-20.48 20.48h-32.768c-57.344 0-102.4-45.056-102.4-102.4v-409.6c0-57.344 45.056-102.4 102.4-102.4h409.6c57.344 0 102.4 45.056 102.4 102.4v26.624z" fill="#32373B" p-id="6923"></path></svg>
+                        <span>复制</span>
+                      </div>
+                      <div class="pta_tla_l_i_r_button delete" @click="toolBtn(2,item.id)">
+                        <svg t="1755224641218" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12953" width="200" height="200"><path d="M161.186909 205.591273h170.170182V126.277818C331.357091 74.519273 373.294545 32.581818 425.053091 32.581818h208.616727c51.758545 0 93.742545 41.937455 93.742546 93.696v79.313455h200.564363a30.254545 30.254545 0 1 1 0 60.509091h-30.021818v629.154909a93.742545 93.742545 0 0 1-93.742545 93.696H254.882909a93.742545 93.742545 0 0 1-93.696-93.696V266.100364h-41.146182a30.254545 30.254545 0 1 1 0-60.509091h41.146182z m676.305455 60.509091H221.649455v629.154909c0 18.338909 14.894545 33.186909 33.186909 33.186909h549.329454c18.385455 0 33.233455-14.894545 33.233455-33.186909V266.100364zM391.819636 204.148364h275.037091V126.277818A33.233455 33.233455 0 0 0 633.669818 93.090909H425.053091a33.233455 33.233455 0 0 0-33.186909 33.186909v77.870546z" fill="#32373B" p-id="12954"></path></svg>
+                        <span>删除</span>
+                      </div>
                     </div>
                   </div>
 
@@ -2425,7 +2384,7 @@ let converter = OpenCC.Converter({
   from: "hk",
   to: "cn"
 });
-import JSZip from "jszip";
+
 
 export default {
   mixins: [myMixin, uploadFileMixin],
@@ -2729,9 +2688,7 @@ export default {
     }
   },
   computed: {
-    // rightBoxHeight: function () {
-    //   return $(".rightBox")[0] ? $(".rightBox")[0].scrollHeight : 1000
-    // },
+
     offsetLetfPx: function() {
       //addnum可以直接在模板语法里面用,相当于data内的值
       return (
@@ -2863,39 +2820,7 @@ export default {
       this.isBtnDisplay = bool;
     },
     scrollChange() {
-      this.rightBoxHeight = $(".rightBox")[0].scrollHeight;
-      // document.querySelector('.course_left').scrollHeight
-      // document.querySelector('.stepsBottom2').scrollHeight
-
-      let stepsBottom2 = $(".stepsBottom2")[0].clientHeight;
-      // let client = $(".course_left")[0].clientHeight - stepsBottom2
-      let client = $(".course_left")[0].clientHeight - stepsBottom2;
-      let maxheight =
-        $(".whiteBg")[0].offsetHeight + $(".whiteBg")[1].offsetHeight + 120;
-      let top = $(".rightBox")[0].scrollTop - maxheight;
-      // if (top < client) {
-      //   $('.stepsBottom2')[0].style.position = 'absolute'
-      //   $('.stepsBottom2')[0].style.top = 0 + 'px'
-      //   // $('.stepsBottom2')[0].style.top = client + 'px'
-      // } else
-      if (top > 0) {
-        let top = $(".rightBox")[0].offsetTop;
-        $(".stepsBottom2")[0].style.position = "fixed";
-        $(".stepsBottom2")[0].style.top = top + "px";
-        this.heightPx = $(".rightBox")[0].offsetHeight - 40 + "px";
-        // $('.stepsBottom2')[0].style.top = top + 'px'
-      } else {
-        $(".stepsBottom2")[0].style.position = "absolute";
-        $(".stepsBottom2")[0].style.top = "0px";
-        this.heightPx = $(".basic_box2")[0].offsetHeight - 50 + "px";
-      }
 
-      const clientHeight = $(".rightBox")[0].clientHeight;
-      const scrollTop = $(".rightBox")[0].scrollTop;
-      const scrollHeight = $(".rightBox")[0].scrollHeight;
-      if (clientHeight + scrollTop > scrollHeight - 10 && top > 0) {
-        this.heightPx = $(".rightBox")[0].offsetHeight - 130 + "px";
-      }
     },
     addHw(e) {
       var el = e.currentTarget;
@@ -3138,7 +3063,7 @@ export default {
           // if (this.userid != this.courseUserid && this.role != "1") {
           //   this.updateWork2();
           // } else {
-          //   this.updateWork();
+          this.updateWork();
           // }
         }
       }
@@ -4637,9 +4562,9 @@ export default {
         this.$forceUpdate();
       }
     },
-    addWork() {
+    async addWork() {
 
-      // this.pptCourseJson.pptData = this.getPPtJson();
+      this.pptCourseJson.pptData = await this.getPPtJson();
       this.inputShow = true;
 
       for (var i = 0; i < this.unitJson.length; i++) {
@@ -4771,52 +4696,10 @@ export default {
           console.error(err);
         });
     },
-    updateWork() {
-      let cPan = 1;
-      for (var i = 0; i < this.unitJson.length; i++) {
-        for (
-          var j = 0;
-          j < this.unitJson[i].chapterInfo[0].taskJson.length;
-          j++
-        ) {
-          this.unitJson[i].chapterInfo[0].taskJson[j].proVisible = false;
-          this.unitJson[i].chapterInfo[0].taskJson[j].proVisible2 = false;
+    async updateWork() {
 
-          if (
-            this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose.length > 1
-          ) {
-            for (
-              var z = 0;
-              z < this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose.length;
-              z++
-            ) {
-              if (
-                !this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose[z].tool
-                  .length
-              ) {
-                this.$message.error("请把工具添加完整");
-                cPan = 2;
-                break;
-              }
-            }
-          }
+      this.pptCourseJson.pptData = await this.getPPtJson();
 
-          if (this.unitJson[i].chapterInfo[0].taskJson[j].eList) {
-            this.unitJson[i].chapterInfo[0].taskJson[j].eList = this.unitJson[
-              i
-            ].chapterInfo[0].taskJson[j].eList.filter(ele => {
-              return ele.value != "";
-            });
-          }
-        }
-      }
-      this.inputShow = true;
-      if (cPan == 2) {
-        return;
-      }
-      for (var i = 0; i < this.unitJson.length; i++) {
-        delete this.unitJson[i].isUpdate;
-      }
       let params = [
         {
           cid: this.cid,
@@ -4838,7 +4721,7 @@ export default {
           astudent:
             this.checkboxList2.length > 0 ? this.checkboxList2.join(",") : "",
           see: this.isTeacherSee == true ? 1 : 0,
-          chapters: JSON.stringify(this.unitJson),
+          chapters: JSON.stringify(this.pptCourseJson),
           template: this.myWord != "undefined" ? this.myWord : [],
           uid: this.userid,
           courseType: JSON.stringify(this.courseTypeId),
@@ -6391,188 +6274,188 @@ export default {
     },
     //自动获取剪贴板
     pasteOption() {
-      let iframe = window.topU.document.querySelectorAll("#AIChat iframe")[0];
-      if (!iframe) {
-        this.$message.error("请使用AI共创生成题目");
-        return;
-      }
-      let copyData = iframe.contentWindow.copyData;
-      if (!copyData || !copyData.selectData.length) {
-        this.$message.error("请使用AI共创生成题目");
-        return;
-      }
-      let selectData = copyData.selectData;
-      for (var i = 0; i < selectData.length; i++) {
-        let answer = 0;
-        switch (selectData[i].answer[0]) {
-          case "A":
-            answer = 0;
-            break;
-          case "B":
-            answer = 1;
-            break;
-          case "C":
-            answer = 2;
-            break;
-          case "D":
-            answer = 3;
-            break;
-          case "E":
-            answer = 4;
-            break;
-          default:
-            break;
-        }
-        this.testJson.testJson.push({
-          teststitle: selectData[i].subject,
-          testItem: selectData[i].options.length,
-          checkList: selectData[i].options,
-          timuList: [],
-          answer: answer,
-          type: "1"
-        });
-        this.testJson.testCount++;
-      }
-      var isTestJson = JSON.parse(JSON.stringify(this.testJson));
-      isTestJson.testJson = this.testJson.testJson.filter(el => {
-        var elc = el.checkList.filter(element => {
-          return element != "";
-        });
-        return el.teststitle != "" || el.timuList.length > 0 || elc.length != 0;
-      });
-      isTestJson.testCount = isTestJson.testJson.length;
-      if (!isTestJson.testCount) {
-        return;
-      }
-      this.testJson = isTestJson;
-      this.$forceUpdate();
+      // let iframe = window.topU.document.querySelectorAll("#AIChat iframe")[0];
+      // if (!iframe) {
+      //   this.$message.error("请使用AI共创生成题目");
+      //   return;
+      // }
+      // let copyData = iframe.contentWindow.copyData;
+      // if (!copyData || !copyData.selectData.length) {
+      //   this.$message.error("请使用AI共创生成题目");
+      //   return;
+      // }
+      // let selectData = copyData.selectData;
+      // for (var i = 0; i < selectData.length; i++) {
+      //   let answer = 0;
+      //   switch (selectData[i].answer[0]) {
+      //     case "A":
+      //       answer = 0;
+      //       break;
+      //     case "B":
+      //       answer = 1;
+      //       break;
+      //     case "C":
+      //       answer = 2;
+      //       break;
+      //     case "D":
+      //       answer = 3;
+      //       break;
+      //     case "E":
+      //       answer = 4;
+      //       break;
+      //     default:
+      //       break;
+      //   }
+      //   this.testJson.testJson.push({
+      //     teststitle: selectData[i].subject,
+      //     testItem: selectData[i].options.length,
+      //     checkList: selectData[i].options,
+      //     timuList: [],
+      //     answer: answer,
+      //     type: "1"
+      //   });
+      //   this.testJson.testCount++;
+      // }
+      // var isTestJson = JSON.parse(JSON.stringify(this.testJson));
+      // isTestJson.testJson = this.testJson.testJson.filter(el => {
+      //   var elc = el.checkList.filter(element => {
+      //     return element != "";
+      //   });
+      //   return el.teststitle != "" || el.timuList.length > 0 || elc.length != 0;
+      // });
+      // isTestJson.testCount = isTestJson.testJson.length;
+      // if (!isTestJson.testCount) {
+      //   return;
+      // }
+      // this.testJson = isTestJson;
+      // this.$forceUpdate();
     },
     pasteTask() {
-      let iframe = window.topU.document.querySelectorAll("#AIChat iframe")[0];
-      if (!iframe) {
-        this.$message.error("请使用AI共创生成");
-        return;
-      }
-      let copyData = iframe.contentWindow.copyData;
-      if (!copyData || !copyData.tasksData || !copyData.tasksData.length) {
-        this.$message.error("请使用AI共创生成");
-        return;
-      }
-      let stageTasksData = copyData.tasksData;
-      let taskA = [];
-      let tasks = stageTasksData;
-      for (var j = 0; j < tasks.length; j++) {
-        taskA.push({
-          task: tasks[j].taskName,
-          taskDetail: tasks[j].taskDecs,
-          chapterData: [],
-          toolText: "",
-          toolChoose: [
-            {
-              tool: [],
-              toolDetail: "",
-              toolType: 0,
-              askCount: 1,
-              askTitle: "",
-              askJson: [{ askstitle: "", askItem: 1, checkList: [] }]
-            }
-          ],
-          isShowTools: false,
-          askCount: 1,
-          isFold: 1,
-          askTitle: "",
-          askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-          checkJson: [{ checkCount: [], checkPerent: [] }],
-          homeworkList: []
-        });
-      }
-      this.unitJson[this.unitIndex].chapterInfo[0].taskJson = taskA;
-      this.$forceUpdate();
+      // let iframe = window.topU.document.querySelectorAll("#AIChat iframe")[0];
+      // if (!iframe) {
+      //   this.$message.error("请使用AI共创生成");
+      //   return;
+      // }
+      // let copyData = iframe.contentWindow.copyData;
+      // if (!copyData || !copyData.tasksData || !copyData.tasksData.length) {
+      //   this.$message.error("请使用AI共创生成");
+      //   return;
+      // }
+      // let stageTasksData = copyData.tasksData;
+      // let taskA = [];
+      // let tasks = stageTasksData;
+      // for (var j = 0; j < tasks.length; j++) {
+      //   taskA.push({
+      //     task: tasks[j].taskName,
+      //     taskDetail: tasks[j].taskDecs,
+      //     chapterData: [],
+      //     toolText: "",
+      //     toolChoose: [
+      //       {
+      //         tool: [],
+      //         toolDetail: "",
+      //         toolType: 0,
+      //         askCount: 1,
+      //         askTitle: "",
+      //         askJson: [{ askstitle: "", askItem: 1, checkList: [] }]
+      //       }
+      //     ],
+      //     isShowTools: false,
+      //     askCount: 1,
+      //     isFold: 1,
+      //     askTitle: "",
+      //     askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+      //     checkJson: [{ checkCount: [], checkPerent: [] }],
+      //     homeworkList: []
+      //   });
+      // }
+      // this.unitJson[this.unitIndex].chapterInfo[0].taskJson = taskA;
+      // this.$forceUpdate();
     },
     pasteStage(stageJson) {
-      let stageData = [];
-      if (stageJson) {
-        stageData = stageJson;
-      } else {
-        let iframe = window.topU.document.querySelectorAll("#AIChat iframe")[0];
-        if (!iframe) {
-          this.$message.error("请使用AI共创生成");
-          return;
-        }
-        let copyData = iframe.contentWindow.copyData;
-        if (!copyData || !copyData.stageData || !copyData.stageData.length) {
-          this.$message.error("请使用AI共创生成");
-          return;
-        }
-        stageData = copyData.stageData;
-      }
+      // let stageData = [];
+      // if (stageJson) {
+      //   stageData = stageJson;
+      // } else {
+      //   let iframe = window.topU.document.querySelectorAll("#AIChat iframe")[0];
+      //   if (!iframe) {
+      //     this.$message.error("请使用AI共创生成");
+      //     return;
+      //   }
+      //   let copyData = iframe.contentWindow.copyData;
+      //   if (!copyData || !copyData.stageData || !copyData.stageData.length) {
+      //     this.$message.error("请使用AI共创生成");
+      //     return;
+      //   }
+      //   stageData = copyData.stageData;
+      // }
 
-      let stage = [];
-      for (var i = 0; i < stageData.length; i++) {
-        stage.push({
-          dyName: stageData[i], //单元标题
-          chapterInfo: [
-            {
-              isread: false,
-              chapterid: this.guid(),
-              title: "",
-              courseName: "",
-              taskJson: [
-                {
-                  task: "",
-                  taskDetail: "",
-                  chapterData: [],
-                  toolText: "",
-                  toolChoose: [
-                    {
-                      tool: [],
-                      toolDetail: "",
-                      toolType: 0,
-                      askCount: 1,
-                      askTitle: "",
-                      askJson: [{ askstitle: "", askItem: 1, checkList: [] }]
-                    }
-                  ],
-                  isShowTools: false,
-                  askCount: 1,
-                  isFold: 1,
-                  askTitle: "",
-                  askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
-                  checkJson: [{ checkCount: [], checkPerent: [] }],
-                  homeworkList: []
-                }
-              ],
-              itemCount: 1,
-              fileList1: [],
-              video: [],
-              testData: [],
-              pData: [],
-              templateArray: []
-            }
-          ]
-        });
-      }
-      let _this = this;
-      if (stageJson) {
-        _this.unitIndex = 0;
-        _this.unitJson = stage;
-        _this.updateWork();
-      } else {
-        _this
-          .$confirm("确定选择智能粘贴模式吗?", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          })
-          .then(() => {
-            _this.unitIndex = 0;
-            _this.unitJson = stage;
-            _this.updateWork();
-          })
-          .catch(() => {
-            return;
-          });
-      }
+      // let stage = [];
+      // for (var i = 0; i < stageData.length; i++) {
+      //   stage.push({
+      //     dyName: stageData[i], //单元标题
+      //     chapterInfo: [
+      //       {
+      //         isread: false,
+      //         chapterid: this.guid(),
+      //         title: "",
+      //         courseName: "",
+      //         taskJson: [
+      //           {
+      //             task: "",
+      //             taskDetail: "",
+      //             chapterData: [],
+      //             toolText: "",
+      //             toolChoose: [
+      //               {
+      //                 tool: [],
+      //                 toolDetail: "",
+      //                 toolType: 0,
+      //                 askCount: 1,
+      //                 askTitle: "",
+      //                 askJson: [{ askstitle: "", askItem: 1, checkList: [] }]
+      //               }
+      //             ],
+      //             isShowTools: false,
+      //             askCount: 1,
+      //             isFold: 1,
+      //             askTitle: "",
+      //             askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+      //             checkJson: [{ checkCount: [], checkPerent: [] }],
+      //             homeworkList: []
+      //           }
+      //         ],
+      //         itemCount: 1,
+      //         fileList1: [],
+      //         video: [],
+      //         testData: [],
+      //         pData: [],
+      //         templateArray: []
+      //       }
+      //     ]
+      //   });
+      // }
+      // let _this = this;
+      // if (stageJson) {
+      //   _this.unitIndex = 0;
+      //   _this.unitJson = stage;
+      //   _this.updateWork();
+      // } else {
+      //   _this
+      //     .$confirm("确定选择智能粘贴模式吗?", "提示", {
+      //       confirmButtonText: "确定",
+      //       cancelButtonText: "取消",
+      //       type: "warning"
+      //     })
+      //     .then(() => {
+      //       _this.unitIndex = 0;
+      //       _this.unitJson = stage;
+      //       _this.updateWork();
+      //     })
+      //     .catch(() => {
+      //       return;
+      //     });
+      // }
     },
     addAnswer() {
       if (this.answerQ == "") {
@@ -6729,7 +6612,7 @@ export default {
           .then(res => {
             this.loading = true;
             this.pptCourseJson = JSON.parse(res.data[0][0].chapters);
-            this.setPPtToolList()
+
 
             this.$forceUpdate();
             this.courseName = res.data[0][0].title;
@@ -6778,9 +6661,11 @@ export default {
             // this.seleteCourseUpdate();
             this.setMan();
             this.selectAllType();
-            this.unitJson[
-              this.unitIndex
-            ].chapterInfo[0].taskJson[0].toolOpen = true;
+            this.setPPtToolList()
+            this.setPPtJson(this.pptCourseJson.pptData)
+            //this.unitJson[
+            //  this.unitIndex
+            //].chapterInfo[0].taskJson[0].toolOpen = true;
             // }, 5000);
             this.$forceUpdate();
             setTimeout(() => {
@@ -7937,20 +7822,20 @@ export default {
       }
     },
     getPaste() {
-      let iframe = window.topU.document.querySelectorAll("#AIChat iframe")[0];
-      if (!iframe) {
-        return;
-      }
-      let copyData = iframe.contentWindow.copyData;
-      // if (copyData && copyData.stageData && copyData.stageData.length) {
-      //   this.isPasteStage = true
+      // let iframe = window.topU.document.querySelectorAll("#AIChat iframe")[0];
+      // if (!iframe) {
+      //   return;
+      // }
+      // let copyData = iframe.contentWindow.copyData;
+      // // if (copyData && copyData.stageData && copyData.stageData.length) {
+      // //   this.isPasteStage = true
+      // // }
+      // if (copyData && copyData.selectData.length) {
+      //   this.isPasteChoice = true;
+      // }
+      // if (copyData && copyData.tasksData && copyData.tasksData.length) {
+      //   this.isPasteTask = true;
       // }
-      if (copyData && copyData.selectData.length) {
-        this.isPasteChoice = true;
-      }
-      if (copyData && copyData.tasksData && copyData.tasksData.length) {
-        this.isPasteTask = true;
-      }
     },
     searchImage() {
       var _this = this;
@@ -8217,52 +8102,6 @@ export default {
       this.editId = null;
       this.setPPtToolList();
     },
-    // zip压缩文件上传
-    uploadZIPFile(i) {
-      this.lineCount = i;
-      // 只支持上传zip文件
-      let input = document.createElement("input");
-      input.type = "file";
-      input.accept = ".zip";
-      input.style.display = "none";
-      // 只允许上传一个文件
-      input.multiple = false;
-      input.onchange = async e => {
-        let file = e.target.files[0];
-        if (!file) return;
-        if (file.type !== "application/zip" && !file.name.endsWith(".zip")) {
-          this.$message.error("只支持上传zip文件");
-          return;
-        }
-        // this.awsupload({file:file,path:"zip/"+file.name}).then(res=>{
-        //   console.log('uploadZIPFile', res);
-        //   // 转成正常的网址
-        //   let url = res && res.Location ? decodeURIComponent(res.Location) : "";
-        //   console.log('正常网址:', url);
-
-        // })
-        // 这里可以根据实际需求进行上传处理
-        try {
-          const zip = new JSZip();
-          const content = await zip.loadAsync(file);
-          let _fileStructure = this.buildFileStructure(file, content);
-          let _time = new Date().getTime();
-          let _resultList = await this.uploadZipFile(
-            _fileStructure.files,
-            `${_time}_${_fileStructure.folderName}`
-          );
-          console.log("_resultList", _resultList);
-        } catch (e) {
-          console.log(e);
-          this.$message.error("解析zip文件失败");
-        }
-      };
-      document.body.appendChild(input);
-      input.click();
-      setTimeout(() => {
-        document.body.removeChild(input);
-      }, 1000);
-    },
     // 构建文件结构树
     buildFileStructure(file, zip) {
       const root = {
@@ -8305,84 +8144,6 @@ export default {
 
       return root;
     },
-    //按路径上传文件
-    async uploadZipFile(fileList, path) {
-      return new Promise(async resolve => {
-        let _copyFileList = fileList;
-
-        let promise = [];
-        for (let i = 0; i < _copyFileList.length; i++) {
-          if (_copyFileList[i].folderName) {
-            let _path = `${path}/${_copyFileList[i].folderName}`;
-            promise.push(
-              this.uploadZipFile(_copyFileList[i].files, _path).then(res => {
-                _copyFileList[i].files = res;
-              })
-            );
-          } else if (_copyFileList[i].fileName) {
-            // 将 ZIP 条目转换为文件对象
-            const blob = await _copyFileList[i].file.async("blob");
-            // 根据文件名设置type
-            let type = "text/html";
-            if (_copyFileList[i].fileName.endsWith(".js")) {
-              type = "application/javascript";
-            } else if (_copyFileList[i].fileName.endsWith(".css")) {
-              type = "text/css";
-            } else if (_copyFileList[i].fileName.endsWith(".json")) {
-              type = "application/json";
-            } else if (_copyFileList[i].fileName.endsWith(".png")) {
-              type = "image/png";
-            } else if (
-              _copyFileList[i].fileName.endsWith(".jpg") ||
-              _copyFileList[i].fileName.endsWith(".jpeg")
-            ) {
-              type = "image/jpeg";
-            } else if (_copyFileList[i].fileName.endsWith(".gif")) {
-              type = "image/gif";
-            } else if (_copyFileList[i].fileName.endsWith(".svg")) {
-              type = "image/svg+xml";
-            } else if (
-              _copyFileList[i].fileName.endsWith(".html") ||
-              _copyFileList[i].fileName.endsWith(".htm")
-            ) {
-              type = "text/html";
-            } else if (_copyFileList[i].fileName.endsWith(".txt")) {
-              type = "text/plain";
-            } else if (_copyFileList[i].fileName.endsWith(".pdf")) {
-              type = "application/pdf";
-            } else if (_copyFileList[i].fileName.endsWith(".mp3")) {
-              type = "audio/mpeg";
-            } else if (_copyFileList[i].fileName.endsWith(".mp4")) {
-              type = "video/mp4";
-            } else if (_copyFileList[i].fileName.endsWith(".zip")) {
-              type = "application/zip";
-            } else if (_copyFileList[i].fileName.endsWith(".xml")) {
-              type = "application/xml";
-            } else if (_copyFileList[i].fileName.endsWith(".csv")) {
-              type = "text/csv";
-            } else if (_copyFileList[i].fileName.endsWith(".md")) {
-              type = "text/markdown";
-            }
-            let _file = new File([blob], _copyFileList[i].fileName, {
-              type: type,
-              lastModified: new Date().getTime()
-            });
-            promise.push(
-              this.awsupload({
-                file: _file,
-                path: `${path}/${_copyFileList[i].fileName}`
-              }).then(res => {
-                delete _copyFileList[i].file;
-                _copyFileList[i].url = decodeURIComponent(res.Location);
-              })
-            );
-          }
-        }
-        Promise.all(promise).then(res => {
-          resolve(_copyFileList);
-        });
-      });
-    },
     openToolDialog(){
       this.$refs.InteractiveToolDialogRef.open();
     },
@@ -8424,8 +8185,6 @@ export default {
         this.dialogVisible7 = true;
         // this.$message.info("添加H5页面");
       }
-
-      this.getPPtJson();
     },
     toolBtn(type,id){
       let _data = this.pptCourseJson.toolsList.find(i=>i.id===id);
@@ -8454,6 +8213,11 @@ export default {
           )
         }
       }else if(type==1){
+        let _copyData = JSON.parse(JSON.stringify(_data));
+        _copyData.id = new Date().getTime();
+        this.pptCourseJson.toolsList.push(_copyData);
+        this.setPPtToolList();
+        return this.$message.success("复制工具成功");
         // if(!_data.url)return this.$message.error("该工具未生成链接,请稍等");
         // const input = document.createElement("input");
 			  // // 设置 display为none会导致无法复制
@@ -8498,6 +8262,7 @@ export default {
     //获取ppt的数据
     async getPPtJson() {
       const checkLoaded = async (resolve) => {
+        console.log("获取ppt数据")
         let _pptIframe = this.$refs.pptIframeRef;
         if (
           _pptIframe &&
@@ -8519,6 +8284,7 @@ export default {
       });
     },
     setPPtJson(data){
+      console.log("设置ppt数据",data)
       let _pptIframe = this.$refs.pptIframeRef;
       // 判断iframe是否加载完成,加载完成再执行
       if (_pptIframe && _pptIframe.contentWindow && _pptIframe.contentWindow.window && typeof _pptIframe.contentWindow.window.readJSON === "function") {
@@ -8576,18 +8342,18 @@ export default {
     }, 500);
   },
   mounted() {
-    this.$nextTick(() => {
-      //监听这个dom的scroll事件
-      $(".rightBox")[0].addEventListener("scroll", this.scrollChange);
-      this.heightPx = $(".rightBox")[0].offsetHeight + "px";
-      this.unitJson[this.unitIndex].chapterInfo[0].taskJson[0].toolOpen = true;
-      this.$forceUpdate();
-    });
-
-    let _this = this;
-    window.pasteStage = function(json) {
-      _this.pasteStage(json);
-    };
+    // this.$nextTick(() => {
+    //   //监听这个dom的scroll事件
+    //   $(".rightBox")[0].addEventListener("scroll", this.scrollChange);
+    //   this.heightPx = $(".rightBox")[0].offsetHeight + "px";
+    //   this.unitJson[this.unitIndex].chapterInfo[0].taskJson[0].toolOpen = true;
+    //   this.$forceUpdate();
+    // });
+
+    // let _this = this;
+    // window.pasteStage = function(json) {
+    //   _this.pasteStage(json);
+    // };
   }
 };
 </script>
@@ -12627,6 +12393,30 @@ ol {
   padding: 0 20px;
   color:#4A5568;
   font-size:14px;
+  background: #fff;
   white-space:nowrap;
+  transition: .2s;
+}
+
+.pta_tla_l_i_right>div:hover{
+  background:#dadada;
+}
+
+.pta_tla_l_i_right>div>svg{
+  width:15px;
+  height:15px;
+  margin-right:5px;
+}
+
+.pta_tla_l_i_right>.edit{
+  color: #fff;
+  background:#0458D2;
+  border-color:#0458D2;
 }
+
+.pta_tla_l_i_right>.edit:hover{
+  background:#0349b3;
+  border-color:#0349b3;
+}
+
 </style>

+ 353 - 12
src/components/pages/workPage/index.vue

@@ -77,25 +77,93 @@
       </div>
     </div>
 
-    <div></div>
+    <div class="wp_tool wp_tool45" v-if="workData && workData.type == 45">
+      <div class="wp_t45_title">题目内容</div>
+      <div
+        class="s_b_m_toolItem"
+        v-for="(item, index) in workData.json.testJson"
+        :key="index + '_' + workData.id"
+      >
+        <div class="s_b_m_ti_title">
+          <span>{{ index + 1 }}</span>
+          <svg
+            width="16"
+            height="16"
+            viewBox="0 0 16 16"
+            fill="none"
+            xmlns="http://www.w3.org/2000/svg"
+          >
+            <path
+              d="M15.3536 8.35355C15.5488 8.15829 15.5488 7.84171 15.3536 7.64645L12.1716 4.46447C11.9763 4.2692 11.6597 4.2692 11.4645 4.46447C11.2692 4.65973 11.2692 4.97631 11.4645 5.17157L14.2929 8L11.4645 10.8284C11.2692 11.0237 11.2692 11.3403 11.4645 11.5355C11.6597 11.7308 11.9763 11.7308 12.1716 11.5355L15.3536 8.35355ZM1 8.5H15V7.5H1V8.5Z"
+              fill="#3681FC"
+            />
+          </svg>
+
+          <span style="display: flex;align-items: center;"
+            >{{ item.type == 1 ? "单选题:" : "多选题:"
+            }}<span v-html="renderedFormula(item.teststitle)"></span>
+          </span>
+        </div>
+        <div
+          class="s_b_m_ti_option"
+          v-for="(item2, index2) in item.checkList"
+          @click="chooseAnswer(index, index2)"
+          :key="index + '_' + index2 + 'index2T'"
+          :class="{
+            s_b_m_ti_o_choice:
+              item.type == '1'
+                ? workData.json.testJson[index].userAnswer === index2
+                : workData.json.testJson[index].userAnswer.includes(index2)
+          }"
+        >
+          <div class="s_b_m_ti_o_btn">
+            <span class="s_b_m_ti_o_btn1" v-if="item.type == 1">
+              <span
+                v-if="workData.json.testJson[index].userAnswer === index2"
+              ></span>
+            </span>
+            <span class="s_b_m_ti_o_btn2" v-else>
+              <span
+                v-if="workData.json.testJson[index].userAnswer.includes(index2)"
+              >
+              </span>
+            </span>
+          </div>
+          <span>
+            <img
+              v-if="item2.imgType && item2.imgType === 1"
+              :src="item2.src"
+              alt=""
+              @click.stop="$hevueImgPreview(item2.src)"
+            />
+            <span v-else>{{ item2 }}</span>
+          </span>
+        </div>
+      </div>
+    </div>
   </div>
 </template>
 
 <script>
+import katex from "katex";
+import "katex/dist/katex.min.css";
 export default {
   data() {
     return {
       id: this.$route.query.id,
-      wid: this.$route.query.wid,
+      courseid: this.$route.query.courseid,
       userid: this.$route.query.userid,
       oid: this.$route.query.oid,
       org: this.$route.query.org,
       role: this.$route.query.role,
+      stage: this.$route.query.stage,
+      task: this.$route.query.task,
+      tool: this.$route.query.tool,
       type: "",
       cid: this.$route.query.cid,
-      workId: this.$route.query.wid,
       workData: {},
-      loadingUploadFile: false
+      loadingUploadFile: false,
+      studentWork:null,
     };
   },
   watch: {
@@ -108,7 +176,54 @@ export default {
       }
     }
   },
-  computed: {},
+  computed: {
+    renderedFormula() {
+      return function(val) {
+        try {
+          // 判断是否含有HTML标签,<tag ...>...</tag>
+          const hasTag = /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g.test(
+            val
+          );
+          if (!hasTag) {
+            val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, "");
+
+            // 纯文本,整体渲染
+            try {
+              return katex.renderToString(val.trim(), {
+                throwOnError: false,
+                strict: false,
+                output: "htmlAndMathml"
+              });
+            } catch (e) {
+              return val; // 渲染失败原样输出
+            }
+          } else {
+            // 有标签,对每个标签内容渲染
+            return val.replace(
+              /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g,
+              (match, tag, attrs, inner) => {
+                let html;
+                val = val.trim().replace(/[\u200B-\u200D\uFEFF]/g, "");
+                try {
+                  html = katex.renderToString(inner.trim(), {
+                    throwOnError: false,
+                    strict: false,
+                    output: "htmlAndMathml"
+                  });
+                } catch (e) {
+                  html = inner;
+                }
+                return `<${tag}${attrs}>${html}</${tag}>`;
+              }
+            );
+          }
+        } catch (e) {
+          console.error("KaTeX渲染错误:", e);
+          return val;
+        }
+      };
+    }
+  },
   methods: {
     getWorkData() {
       if (!this.id) return console.log("无作业id");
@@ -122,9 +237,21 @@ export default {
           if (_data.length) {
             _data = _data[0];
             _data.json = JSON.parse(_data.json);
-            _data.json.answer = "";
-            _data.json.fileList = [];
+            if (_data.type == 15) {
+              _data.json.answer = "";
+              _data.json.fileList = [];
+            } else if (_data.type == 45) {
+              _data.json.testJson.forEach(item => {
+                if (item.type == "2") {
+                  item.userAnswer = [];
+                } else if (item.type == "1") {
+                  item.userAnswer = "";
+                }
+              });
+            }
+
             this.workData = _data;
+            this.studentWorkToWorkData();
           }
         });
     },
@@ -220,22 +347,35 @@ export default {
       this.workData.json.fileList.splice(index, 1);
       this.$forceUpdate();
     },
-    submitWork(uid, cid, stage, task, tool) {
+    submitWork(stage, task, tool) {
       return new Promise(resolve => {
         let params = [];
         if (this.workData.type == "15") {
           //问答题
           params.push({
-            uid: uid,
-            cid: cid,
+            uid: this.userid,
+            cid: this.courseid,
             stage: stage,
             task: task,
             tool: tool,
+            atool: "15",
             content: encodeURIComponent(JSON.stringify(this.workData.json)),
             type: "3"
           });
+        } else if (this.workData.type == "45") {
+          //选择题
+          params.push({
+            uid: this.userid,
+            cid: this.courseid,
+            stage: stage,
+            task: task,
+            tool: tool,
+            atool: "45",
+            content: encodeURIComponent(JSON.stringify(this.workData.json)),
+            type: "8"
+          });
         }
-        if (["3"].includes(params[0].type)) {
+        if (["3", "8"].includes(params[0].type) && params[0].uid && params[0].cid) {
           this.ajax
             .post(this.$store.state.api + "addCourseWorks_workPage", params)
             .then(res => {
@@ -253,10 +393,83 @@ export default {
             });
         }
       });
-    }
+    },
+    //选择题选择
+    chooseAnswer(index, index2) {
+      if (this.workData.json.testJson[index].type == "1") {
+        this.workData.json.testJson[index].userAnswer = index2;
+      } else if (this.workData.json.testJson[index].type == "2") {
+        if (this.workData.json.testJson[index].userAnswer.includes(index2)) {
+          this.workData.json.testJson[index].userAnswer.splice(
+            this.workData.json.testJson[index].userAnswer.indexOf(index2),
+            1
+          );
+        } else {
+          this.workData.json.testJson[index].userAnswer.push(index2);
+        }
+      }
+    },
+    //获取已经提交的作业
+    getSubmitWork() {
+      if (
+        this.userid &&
+        this.courseid &&
+        this.stage &&
+        this.task &&
+        this.tool
+      ) {
+        let params = {
+          uid: this.userid,
+          cid: this.courseid,
+          stage: this.stage,
+          task: this.task,
+          tool: this.tool
+        };
+        this.ajax
+          .get(
+            this.$store.state.api + "select_courseWorks_workPageData",
+            params
+          )
+          .then(res => {
+            let _data = res.data[0];
+            if (_data.length) {
+              _data = _data[0];
+              let _work = JSON.parse(decodeURIComponent(_data.content));
+              this.studentWork = _work;
+              this.studentWorkToWorkData();
+            }
+
+          })
+          .catch(err => {
+            console.error(err);
+          });
+      }
+    },
+    studentWorkToWorkData(){
+      if(this.studentWork && this.workData){
+        let _work = JSON.parse(JSON.stringify(this.studentWork));
+        if ( this.workData.type == "15") {
+          this.workData.json.answer = _work.answer;
+          this.workData.json.fileList = _work.fileList;
+        } else if ( this.workData.type == "45") {
+          this.workData.json.testJson.forEach((item, index) => {
+            if (
+              item.type == _work.testJson[index].type &&
+              item.teststitle == _work.testJson[index].teststitle &&
+              JSON.stringify(item.checkList) ==
+                JSON.stringify(_work.testJson[index].checkList)
+            ) {
+              this.workData.json.testJson[index].userAnswer = _work.testJson[index].userAnswer;
+            }
+          });
+        }
+        this.$forceUpdate();
+      }
+    },
   },
   mounted() {
     this.getWorkData();
+    this.getSubmitWork();
     window.submitWork = this.submitWork;
   }
 };
@@ -268,6 +481,9 @@ export default {
   height: 100vh;
   background-color: #fff;
   overflow: auto;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
 }
 
 .wp_tool {
@@ -389,4 +605,129 @@ export default {
   cursor: pointer;
   display: none;
 }
+
+/* 选择题 */
+
+.wp_tool45 {
+  width: 60%;
+  height: auto;
+}
+
+.wp_t45_title {
+  font-size: 3em;
+  font-weight: 300;
+  margin: 20px 0 40px 0;
+}
+
+.s_b_m_toolItem {
+  width: 100%;
+  height: auto;
+  margin-bottom: 40px;
+}
+
+.s_b_m_ti_option {
+  width: 100%;
+  height: auto;
+  padding: 15px 15px 15px 15px;
+  display: flex;
+  flex-wrap: wrap;
+  background-color: #f3f7fd;
+  border-radius: 30px;
+  margin: 10px 0 10px 0px;
+  box-sizing: border-box;
+  cursor: pointer;
+}
+
+.s_b_m_ti_option > span > img {
+  max-height: 150px;
+  border-radius: 2px;
+  cursor: pointer;
+}
+
+.s_b_m_ti_o_btn {
+  width: 20px;
+  height: 100%;
+  min-height: 20px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-right: 10px;
+}
+
+.s_b_m_ti_o_btn > span {
+  width: 20px;
+  height: 20px;
+  display: block;
+  box-sizing: border-box;
+  border: solid 1px #3681fc;
+  overflow: hidden;
+}
+
+.s_b_m_ti_o_btn > span > span {
+  width: 100%;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #3681fc;
+  position: relative;
+}
+
+.s_b_m_ti_o_btn1 {
+  border-radius: 50%;
+}
+
+.s_b_m_ti_o_btn1 > span::after {
+  content: "";
+  width: 8px;
+  height: 8px;
+  position: absolute;
+  background-color: #fff;
+  border-radius: 50%;
+}
+
+.s_b_m_ti_o_btn2 {
+  border-radius: 2px;
+}
+
+.s_b_m_ti_o_btn2 > span::after {
+  content: "";
+  width: 8px;
+  height: 8px;
+  position: absolute;
+  background-color: #fff;
+}
+
+.s_b_m_ti_o_choice {
+  border: solid 1px #3681fc;
+}
+
+.s_b_m_ti_title {
+  display: flex;
+  align-items: center;
+}
+
+.s_b_m_ti_title > span:nth-of-type(1) {
+  font-size: 30px;
+  font-weight: bold;
+  color: #3681fc;
+}
+
+.s_b_m_ti_title > svg {
+  width: 30px;
+  height: 30px;
+  margin: 0 20px 0 5px;
+}
+
+.s_b_m_ti_title > span:nth-of-type(2) {
+  font-size: 20px;
+  font-weight: bold;
+}
+
+.s_b_m_ti_title > div {
+  font-size: 30px;
+  font-weight: bold;
+}
+
+/* 选择题 */
 </style>

+ 2 - 2
src/config/config.js

@@ -10,7 +10,7 @@ const store = new Vuex.Store({
         userInfo: {},
         nCount: 0,
         report:"",
-		apiM: 'https://pbl.cocorobo.cn/api/mongo/',
+		    apiM: 'https://pbl.cocorobo.cn/api/mongo/',
         api: 'https://pbl.cocorobo.cn/api/pbl/',
         // fileApi: 'http://localhost:7004/file/',
         // fileApi: 'http://10.3.16.166:7004/file/',
@@ -27,4 +27,4 @@ const store = new Vuex.Store({
     }
 })
 
-export default store
+export default store

Some files were not shown because too many files changed in this diff