SanHQin 1 день назад
Родитель
Сommit
09963e91d3

+ 1 - 1
dist/index.html

@@ -37,7 +37,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.dceef85bf1b1590d38b480a15c66a052.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.23ea04dc469b57e2b4f8.js></script><script type=text/javascript src=./static/js/vendor.714ff2bfc93f2f096b79.js></script><script type=text/javascript src=./static/js/app.af05bda8977cad881b99.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.2c4e0ab28604ae578383e4f196fd96d1.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.23ea04dc469b57e2b4f8.js></script><script type=text/javascript src=./static/js/vendor.714ff2bfc93f2f096b79.js></script><script type=text/javascript src=./static/js/app.1485cfb7d19cb9b0c77a.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/css/app.2c4e0ab28604ae578383e4f196fd96d1.css


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/css/app.2c4e0ab28604ae578383e4f196fd96d1.css.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/css/workPage.287e393f4138b6b0b758c33eb77d603a.css.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/css/workPage.79baa6c19f14e5cd0c9e5cc97539f06a.css


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/css/workPage.79baa6c19f14e5cd0c9e5cc97539f06a.css.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/js/app.1485cfb7d19cb9b0c77a.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/js/app.1485cfb7d19cb9b0c77a.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/js/manifest.23ea04dc469b57e2b4f8.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/js/workPage-manifest.2ece51fa34be51c8610a.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/js/workPage.34f2fffc94017808263d.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/js/workPage.34f2fffc94017808263d.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/js/workPage.af44b0a8847dfef3bc6a.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/js/workPage.af44b0a8847dfef3bc6a.js.map


+ 1 - 1
dist/workPage.html

@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>工作页面 - CocoFlow</title><link rel=icon href=../static/logo.ico><link href=./static/css/workPage.287e393f4138b6b0b758c33eb77d603a.css rel=stylesheet></head><body><noscript><strong>We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script type=text/javascript src=./static/js/workPage-manifest.2ece51fa34be51c8610a.js></script><script type=text/javascript src=./static/js/workPage-vendor.7b2c55096449c94cc8fd.js></script><script type=text/javascript src=./static/js/workPage.af44b0a8847dfef3bc6a.js></script></body></html><script>function stopSafari() {
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>工作页面 - CocoFlow</title><link rel=icon href=../static/logo.ico><link href=./static/css/workPage.79baa6c19f14e5cd0c9e5cc97539f06a.css rel=stylesheet></head><body><noscript><strong>We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script type=text/javascript src=./static/js/workPage-manifest.2ece51fa34be51c8610a.js></script><script type=text/javascript src=./static/js/workPage-vendor.7b2c55096449c94cc8fd.js></script><script type=text/javascript src=./static/js/workPage.34f2fffc94017808263d.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

+ 6 - 2
src/components/common/GradeClassSelector.vue

@@ -164,11 +164,15 @@ export default {
   flex: 1;
 }
 
+.form-item.required .form-label::after {
+  content: " *";
+  color: #ff4d4f;
+}
+
 .form-label {
   display: block;
   margin-bottom: 8px;
-  font-size: 14px;
-  color: #333;
+  font-weight: 500;
 }
 
 .grade-selector,

+ 10 - 4
src/components/pages/pptEasy/addCourse3.vue

@@ -1924,9 +1924,12 @@ export default {
         _pptData2.slides.forEach((slide, index) => {
           let slideContent = ''
           if (slide.elements) {
-            const textElements = slide.elements.filter((element) => element.type === 'text')
+            const textElements = slide.elements.filter((element) => element.type === 'text' || (element.type === 'shape' && element.text && element.text.content))
             if (textElements.length > 0) {
-              slideContent = textElements.map((element) => element.content).join(' ')
+              slideContent = textElements.map((element) => {
+                const content = element.type === 'text' ? element.content : element.text.content
+                return content.replace(/<[^>]*>/g, '')
+              }).join(' ')
             }
           }
           pptContent.push(`第${index + 1}页: ${slideContent || '内容为空'}`)
@@ -2040,9 +2043,12 @@ export default {
         _pptData2.slides.forEach((slide, index) => {
           let slideContent = ''
           if (slide.elements) {
-            const textElements = slide.elements.filter((element) => element.type === 'text')
+            const textElements = slide.elements.filter((element) => element.type === 'text' || (element.type === 'shape' && element.text && element.text.content))
             if (textElements.length > 0) {
-              slideContent = textElements.map((element) => element.content).join(' ')
+              slideContent = textElements.map((element) => {
+                const content = element.type === 'text' ? element.content : element.text.content
+                return content.replace(/<[^>]*>/g, '')
+              }).join(' ')
             }
           }
           pptContent.push(`第${index + 1}页: ${slideContent || '内容为空'}`)

+ 97 - 90
src/components/pages/workPage/components/choiceQuestion.vue

@@ -10,72 +10,70 @@
     </div>
 
 
-    <img class="cq_image" v-if="work.testJson[showIndex] && work.testJson[showIndex].timuList && work.testJson[showIndex].timuList.length>0" :src="work.testJson[showIndex].timuList[0].src" @click="$hevueImgPreview(work.testJson[showIndex].timuList[0].src)">
+    <img class="cq_image"
+      v-if="work.testJson[showIndex] && work.testJson[showIndex].timuList && work.testJson[showIndex].timuList.length > 0"
+      :src="work.testJson[showIndex].timuList[0].src"
+      @click="$hevueImgPreview(work.testJson[showIndex].timuList[0].src)">
 
     <div class="cq_type" v-if="work.testJson[showIndex]">
-      {{lang.ssChoice}}
+      {{ lang.ssChoice }}
       <!-- {{ work.testJson[showIndex].type == '1' ? lang.SingleChoice : lang.MultipleChoice }} -->
       <!-- <span v-if="work.testJson.length>1">({{showIndex+1}}/{{work.testJson.length}})</span> -->
 
     </div>
     <div class="cq_checkListArea">
-      <div
-        class="cq_ca_type1"
-        v-if="
-          work.testJson[showIndex] && work.testJson[showIndex].showType == '1'
-        "
-      >
-        <div
-          class="cq_ca_t1_item"
-          :class="{
-            cq_ca_t1_item_active:
-              work.testJson[showIndex].type == '1'
-                ? work.testJson[showIndex].userAnswer === index
-                : work.testJson[showIndex].userAnswer.includes(index)
-          }"
-          v-for="(item, index) in work.testJson[showIndex].checkList"
-          :key="showIndex + '_' + index"
-          @click="choiceAnswer(index)"
-        >
+      <div class="cq_ca_type1" v-if="
+        work.testJson[showIndex] && work.testJson[showIndex].showType == '1'
+      ">
+        <div class="cq_ca_t1_item" :class="{
+          cq_ca_t1_item_active:
+            work.testJson[showIndex].type == '1'
+              ? work.testJson[showIndex].userAnswer === index
+              : work.testJson[showIndex].userAnswer.includes(index)
+        }" v-for="(item, index) in work.testJson[showIndex].checkList" :key="showIndex + '_' + index"
+          @click="choiceAnswer(index)">
           <div>
             <span>{{ options[index] }}</span>
           </div>
-          <img v-if="item.imgType && item.imgType=='1'" :src="item.src" @click="$hevueImgPreview(item.src)">
+          <img v-if="item.imgType && item.imgType == '1'" :src="item.src" @click="$hevueImgPreview(item.src)">
           <span v-else>{{ item }}</span>
         </div>
       </div>
 
       <div class="cq_ca_type2" v-if="
-          work.testJson[showIndex] && work.testJson[showIndex].showType == '2'
-        ">
-        <div
-          class="cq_ca_t2_item"
-          :class="{
-            cq_ca_t2_item_active:
-              work.testJson[showIndex].type == '1'
-                ? work.testJson[showIndex].userAnswer === index
-                : work.testJson[showIndex].userAnswer.includes(index)
-          }"
-          v-for="(item, index) in work.testJson[showIndex].checkList"
-          :key="showIndex + '_' + index"
-          @click="choiceAnswer(index)"
-        >
+        work.testJson[showIndex] && work.testJson[showIndex].showType == '2'
+      ">
+        <div class="cq_ca_t2_item" :class="{
+          cq_ca_t2_item_active:
+            work.testJson[showIndex].type == '1'
+              ? work.testJson[showIndex].userAnswer === index
+              : work.testJson[showIndex].userAnswer.includes(index)
+        }" v-for="(item, index) in work.testJson[showIndex].checkList" :key="showIndex + '_' + index"
+          @click="choiceAnswer(index)">
           <div>
             <span>{{ options[index] }}</span>
           </div>
-          <img v-if="item.imgType && item.imgType=='1'" :src="item.src" @click="$hevueImgPreview(item.src)">
+          <img v-if="item.imgType && item.imgType == '1'" :src="item.src" @click="$hevueImgPreview(item.src)">
           <span v-else>{{ item }}</span>
         </div>
       </div>
     </div>
 
-    <div class="cq_changeBtn" v-if="work.testJson.length>1">
-      <div :class="{cq_cb_disabled: showIndex == 0}" @click="changeQuestion('prev')">
-        <svg style="transform: rotate(-90deg);" viewBox="0 0 1024 1024" version="1.1" width="200" height="200"><path d="M512 330.666667c14.933333 0 29.866667 4.266667 40.533333 14.933333l277.33333399 234.666667c27.733333 23.466667 29.866667 64 8.53333301 89.6-23.466667 27.733333-64 29.866667-89.6 8.53333299L512 477.866667l-236.8 200.53333299c-27.733333 23.466667-68.266667 19.19999999-89.6-8.53333299-23.466667-27.733333-19.19999999-68.266667 8.53333301-89.6l277.33333399-234.666667c10.666667-10.666667 25.6-14.933333 40.533333-14.933333z" fill=""></path></svg>
+    <div class="cq_changeBtn" v-if="work.testJson.length > 1">
+      <div :class="{ cq_cb_disabled: showIndex == 0 }" @click="changeQuestion('prev')">
+        <svg style="transform: rotate(-90deg);" viewBox="0 0 1024 1024" version="1.1" width="200" height="200">
+          <path
+            d="M512 330.666667c14.933333 0 29.866667 4.266667 40.533333 14.933333l277.33333399 234.666667c27.733333 23.466667 29.866667 64 8.53333301 89.6-23.466667 27.733333-64 29.866667-89.6 8.53333299L512 477.866667l-236.8 200.53333299c-27.733333 23.466667-68.266667 19.19999999-89.6-8.53333299-23.466667-27.733333-19.19999999-68.266667 8.53333301-89.6l277.33333399-234.666667c10.666667-10.666667 25.6-14.933333 40.533333-14.933333z"
+            fill=""></path>
+        </svg>
       </div>
-      <span>{{ showIndex+1 }}/{{work.testJson.length}}</span>
-      <div :class="{cq_cb_disabled: showIndex == work.testJson.length - 1}" @click="changeQuestion('next')">
-        <svg style="transform: rotate(90deg);" viewBox="0 0 1024 1024" version="1.1" width="200" height="200"><path d="M512 330.666667c14.933333 0 29.866667 4.266667 40.533333 14.933333l277.33333399 234.666667c27.733333 23.466667 29.866667 64 8.53333301 89.6-23.466667 27.733333-64 29.866667-89.6 8.53333299L512 477.866667l-236.8 200.53333299c-27.733333 23.466667-68.266667 19.19999999-89.6-8.53333299-23.466667-27.733333-19.19999999-68.266667 8.53333301-89.6l277.33333399-234.666667c10.666667-10.666667 25.6-14.933333 40.533333-14.933333z" fill=""></path></svg>
+      <span>{{ showIndex + 1 }}/{{ work.testJson.length }}</span>
+      <div :class="{ cq_cb_disabled: showIndex == work.testJson.length - 1 }" @click="changeQuestion('next')">
+        <svg style="transform: rotate(90deg);" viewBox="0 0 1024 1024" version="1.1" width="200" height="200">
+          <path
+            d="M512 330.666667c14.933333 0 29.866667 4.266667 40.533333 14.933333l277.33333399 234.666667c27.733333 23.466667 29.866667 64 8.53333301 89.6-23.466667 27.733333-64 29.866667-89.6 8.53333299L512 477.866667l-236.8 200.53333299c-27.733333 23.466667-68.266667 19.19999999-89.6-8.53333299-23.466667-27.733333-19.19999999-68.266667 8.53333301-89.6l277.33333399-234.666667c10.666667-10.666667 25.6-14.933333 40.533333-14.933333z"
+            fill=""></path>
+        </svg>
       </div>
       <!-- <span :class="{cq_cba_disabled: showIndex == 0}" @click="changeQuestion('prev')">{{ lang.ssPrevQ }}</span>
       <span :class="{cq_cba_disabled: showIndex == work.testJson.length - 1}" @click="changeQuestion('next')">{{ lang.ssNextQ }}</span> -->
@@ -138,6 +136,25 @@ export default {
         }
       },
       deep: true
+    },
+    workData: {
+      handler(newValue) {
+        this.work = JSON.parse(JSON.stringify(newValue.json));
+        this.work.testJson.forEach(i => {
+          let maxLength = i.checkList.reduce((pre, cur) => {
+            if (pre < cur.length) return cur.length;
+            return pre;
+          }, 0);
+
+          if (maxLength <= 6 && i.checkList.length <= 4) {
+            i.showType = "1";
+          } else {
+            i.showType = "2";
+          }
+        });
+      },
+      deep: true,
+      immediate: true
     }
   },
   methods: {
@@ -149,7 +166,7 @@ export default {
       if (this.work.testJson[this.showIndex].type == "1") {
         this.work.testJson[this.showIndex].userAnswer = index;
       } else {
-        if(typeof this.work.testJson[this.showIndex].userAnswer !== 'object') this.work.testJson[this.showIndex].userAnswer = [];
+        if (typeof this.work.testJson[this.showIndex].userAnswer !== 'object') this.work.testJson[this.showIndex].userAnswer = [];
         if (this.work.testJson[this.showIndex].userAnswer.includes(index)) {
           this.work.testJson[this.showIndex].userAnswer = this.work.testJson[
             this.showIndex
@@ -160,38 +177,24 @@ export default {
       }
     },
     //切换题目
-    changeQuestion(type){
-      if(type == 'prev'){
-        if(this.showIndex == 0) return;
+    changeQuestion(type) {
+      if (type == 'prev') {
+        if (this.showIndex == 0) return;
         this.showIndex--;
-      }else{
-        if(this.showIndex == this.work.testJson.length - 1) return;
+      } else {
+        if (this.showIndex == this.work.testJson.length - 1) return;
         this.showIndex++;
       }
     }
 
   },
   mounted() {
-    this.work = JSON.parse(JSON.stringify(this.workData.json));
-    this.work.testJson.forEach(i => {
-      let maxLength = i.checkList.reduce((pre, cur) => {
-        if (pre < cur.length) return cur.length;
-        return pre;
-      }, 0);
-
-      if (maxLength <= 6 && i.checkList.length <= 4) {
-        i.showType = "1";
-      } else {
-        i.showType = "2";
-      }
-    });
+
   }
 };
 </script>
 
 <style scoped>
-
-
 .choiceQuestion {
   width: 100%;
   height: 100%;
@@ -200,7 +203,7 @@ export default {
   /* justify-content: center; */
   flex-direction: column;
   box-sizing: border-box;
-  padding: 70px 10%;
+  padding: 70px 5%;
   overflow: auto;
   position: relative;
 }
@@ -209,11 +212,11 @@ export default {
   font-size: 2rem;
   font-weight: bold;
   text-align: center;
-  width: 70%;
+  max-width: 95%;
   position: relative;
 }
 
-.cq_image{
+.cq_image {
   width: auto;
   height: 300px;
   object-fit: cover;
@@ -232,7 +235,7 @@ export default {
   align-items: flex-start;
 }
 
-.cq_changeBtnArea > span{
+.cq_changeBtnArea>span {
   padding: .5rem 1rem;
   background: #3681FC;
   border-radius: 8px;
@@ -249,11 +252,11 @@ export default {
   white-space: nowrap;
 }
 
-.cq_changeBtnArea > span:hover{
+.cq_changeBtnArea>span:hover {
   background: #5893FF;
 }
 
-.cq_cba_disabled{
+.cq_cba_disabled {
   background: #D9D9D9 !important;
   cursor: not-allowed !important;
 }
@@ -279,7 +282,8 @@ export default {
   display: grid;
   grid-template-columns: repeat(2, 1fr);
   grid-template-rows: repeat(2, 1fr);
-  gap: 30px; /* 可根据需要调整间距 */
+  gap: 30px;
+  /* 可根据需要调整间距 */
   justify-content: center;
   align-items: center;
   margin: 40px 20px;
@@ -312,27 +316,27 @@ export default {
   box-shadow: 4px 4px 14px 0px rgba(252, 207, 0, 0.5);
 }
 
-.cq_ca_t1_item > div {
+.cq_ca_t1_item>div {
   color: #fff;
   position: relative;
   margin-right: 20px;
 }
 
-.cq_ca_t1_item>img{
+.cq_ca_t1_item>img {
   width: 60px;
   height: 60px;
   cursor: pointer;
   object-fit: cover;
 }
 
-.cq_ca_t1_item > div > span {
+.cq_ca_t1_item>div>span {
   position: relative;
   z-index: 2;
   color: #fff;
   font-size: 1rem;
 }
 
-.cq_ca_t1_item > div::after {
+.cq_ca_t1_item>div::after {
   content: "";
   width: 30px;
   height: 30px;
@@ -342,11 +346,12 @@ export default {
   left: 50%;
   top: 50%;
   transform: translate(-50%, -50%);
-  z-index: 1; /* after在内容下方 */
+  z-index: 1;
+  /* after在内容下方 */
   pointer-events: none;
 }
 
-.cq_ca_type2{
+.cq_ca_type2 {
   width: 100%;
   height: auto;
   display: flex;
@@ -355,7 +360,7 @@ export default {
   flex-direction: column;
 }
 
-.cq_ca_t2_item{
+.cq_ca_t2_item {
   width: 100%;
   height: auto;
   min-height: 55px;
@@ -377,18 +382,18 @@ export default {
   overflow-y: hidden;
 }
 
-.cq_ca_t2_item>div{
+.cq_ca_t2_item>div {
   color: #fff;
   position: relative;
   margin-right: 20px;
 }
 
-.cq_ca_t2_item>span{
+.cq_ca_t2_item>span {
   display: flex;
   align-items: center;
 }
 
-.cq_ca_t2_item>img{
+.cq_ca_t2_item>img {
   width: 70px;
   height: 70px;
   cursor: pointer;
@@ -400,19 +405,20 @@ export default {
   box-shadow: 4px 4px 14px 0px rgba(252, 207, 0, 0.5);
 }
 
-.cq_ca_t2_item > div {
+.cq_ca_t2_item>div {
   color: #fff;
   position: relative;
   margin-right: 20px;
 }
-.cq_ca_t2_item > div > span {
+
+.cq_ca_t2_item>div>span {
   position: relative;
   z-index: 2;
   color: #fff;
   font-size: 1rem;
 }
 
-.cq_ca_t2_item > div::after {
+.cq_ca_t2_item>div::after {
   content: "";
   width: 30px;
   height: 30px;
@@ -422,18 +428,19 @@ export default {
   left: 50%;
   top: 50%;
   transform: translate(-50%, -50%);
-  z-index: 1; /* after在内容下方 */
+  z-index: 1;
+  /* after在内容下方 */
   pointer-events: none;
 }
 
-.cq_changeBtn{
+.cq_changeBtn {
   display: flex;
   align-items: center;
   gap: 1.5rem;
   margin-top: 2rem;
 }
 
-.cq_changeBtn>div{
+.cq_changeBtn>div {
   padding: .6rem;
   border-radius: .5rem;
   border: solid 2px #F6C82B;
@@ -444,22 +451,22 @@ export default {
 
 }
 
-.cq_changeBtn>span{
+.cq_changeBtn>span {
   font-weight: 500;
 }
 
-.cq_changeBtn>div>svg{
+.cq_changeBtn>div>svg {
   fill: #F6C82D;
   width: 1rem;
   height: 1rem;
 }
 
-.cq_cb_disabled{
+.cq_cb_disabled {
   cursor: not-allowed !important;
   border-color: #FEF8E9 !important;
 }
 
-.cq_cb_disabled>svg{
+.cq_cb_disabled>svg {
   fill: #A3A3A3 !important;
 }
 </style>

+ 10 - 1
src/components/pages/workPage/components/questionsAndAnswers.vue

@@ -108,6 +108,15 @@ export default {
           this.changeWorkData(newValue);
         }
       }
+    },
+    workData: {
+      handler: function (newValue, oldValue) {
+        if (JSON.stringify(newValue) != JSON.stringify(oldValue)) {
+          this.work = JSON.parse(JSON.stringify(this.workData.json));
+        }
+      },
+      deep: true,
+      immediate: true
     }
   },
   methods: {
@@ -224,7 +233,7 @@ export default {
     }
   },
   mounted() {
-    this.work = JSON.parse(JSON.stringify(this.workData.json));
+
   }
 };
 </script>

+ 18 - 5
src/components/pages/workPage/components/setQuestionsAndAnswers.vue

@@ -6,8 +6,7 @@
       </div>
 
       <div class="ti_title">
-        <div class="ti_t_input" contenteditable="true" v-text="jsonData.answerQ"
-          @input="setTestTitle($event.target.innerText)"></div>
+        <el-input class="ti_t_input" type="textarea" v-model="jsonData.answerQ" @input="setTestTitle"></el-input>
         <div class="uploadImage" @click="uploadImage()">
           <svg viewBox="0 0 1024 1024" version="1.1" p-id="15953" width="200" height="200">
             <path
@@ -265,13 +264,27 @@ export default {
   border: none;
   outline: none;
   background: none;
-  font-size: .8rem;
+  font-size: 1.2rem;
   resize: none;
-  max-height:10rem;
-  overflow:auto;
+  /* max-height: 10rem; */
+  overflow: auto;
   /* padding-right: 2rem; */
 }
 
+.ti_t_input /deep/ .el-textarea__inner {
+  padding: 0;
+  width: 100%;
+  height: 100%;
+  box-sizing: border-box;
+  border: none;
+  outline: none;
+  background: none;
+  font-size: 1.2rem;
+  resize: none;
+  /* max-height: 10rem; */
+  overflow: auto;
+}
+
 .uploadImage {
   position: absolute;
   bottom: 0.5rem;

+ 31 - 26
src/components/pages/workPage/index_new.vue

@@ -1,7 +1,9 @@
 <template>
   <div class="workPage" v-loading="loading">
-  <questionsAndAnswers ref="questionsAndAnswersRef" v-if="workData.type === '15'" :workData="workData" @changeWorkData="changeWorkData"/>
-  <choiceQuestion ref="choiceQuestionRef" v-if="workData.type === '45'" :workData="workData" @changeWorkData="changeWorkData"/>
+    <questionsAndAnswers ref="questionsAndAnswersRef" v-if="workData.type === '15'" :workData="workData"
+      @changeWorkData="changeWorkData" />
+    <choiceQuestion ref="choiceQuestionRef" v-if="workData.type === '45'" :workData="workData"
+      @changeWorkData="changeWorkData" />
   </div>
 </template>
 
@@ -11,7 +13,7 @@ import "katex/dist/katex.min.css";
 import questionsAndAnswers from "./components/questionsAndAnswers.vue";
 import choiceQuestion from "./components/choiceQuestion.vue";
 export default {
-  components:{
+  components: {
     questionsAndAnswers,
     choiceQuestion
   },
@@ -46,7 +48,7 @@ export default {
   },
   computed: {
     renderedFormula() {
-      return function(val) {
+      return function (val) {
         try {
           // 判断是否含有HTML标签,<tag ...>...</tag>
           const hasTag = /<([a-zA-Z][\w\-]*)([^>]*)>([\s\S]*?)<\/\1>/g.test(
@@ -192,11 +194,11 @@ export default {
           };
           bucket
             .upload(params, options)
-            .on("httpUploadProgress", function(evt) {
+            .on("httpUploadProgress", function (evt) {
               //这里可以写进度条
               // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
             })
-            .send(function(err, data) {
+            .send(function (err, data) {
               if (err) {
                 _this.$message.error(_this.lang.ssUploadFail);
                 resolve(null);
@@ -315,7 +317,7 @@ export default {
                 let _work = JSON.parse(decodeURIComponent(_data.content));
                 this.studentWork = _work;
                 this.studentWorkToWorkData();
-              }else{
+              } else {
                 console.log("工具不一致")
               }
             }
@@ -336,12 +338,13 @@ export default {
           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)
+              JSON.stringify(_work.testJson[index].checkList)
             ) {
               this.workData.json.testJson[index].userAnswer =
                 _work.testJson[index].userAnswer;
@@ -353,8 +356,10 @@ export default {
     },
 
     //更新workData
-    changeWorkData(newValue){
-      console.log("changeWorkData",newValue)
+    changeWorkData(newValue) {
+
+      if(JSON.stringify(newValue) == JSON.stringify(this.workData.json)) return
+      console.log("changeWorkData", newValue)
       this.workData.json = JSON.parse(newValue)
     }
   },
@@ -409,14 +414,14 @@ export default {
   margin: 20px 0;
 }
 
-.wp_tl15_inputArea >>> textarea {
+.wp_tl15_inputArea>>>textarea {
   border-color: #ececec;
   border-radius: 10px;
   padding: 10px 20px;
   box-shadow: 0 0 10px #ececec;
 }
 
-.wp_tl15_inputArea >>> textarea::placeholder {
+.wp_tl15_inputArea>>>textarea::placeholder {
   color: #7f7f7f;
 }
 
@@ -450,13 +455,13 @@ export default {
   background-color: #ececec;
 }
 
-.wp_tl_btn > svg {
+.wp_tl_btn>svg {
   width: 15px;
   height: 15px;
   margin-right: 5px;
 }
 
-.wp_tl15_uploadFileArea > span {
+.wp_tl15_uploadFileArea>span {
   font-size: 14px;
   color: #686868;
 }
@@ -478,11 +483,11 @@ export default {
   margin-right: 20px;
 }
 
-.wp_tl15_fileList_item:hover > svg {
+.wp_tl15_fileList_item:hover>svg {
   display: block;
 }
 
-.wp_tl15_fileList_item > img {
+.wp_tl15_fileList_item>img {
   width: 100%;
   height: 100%;
   object-fit: cover;
@@ -492,7 +497,7 @@ export default {
   cursor: pointer;
 }
 
-.wp_tl15_fileList_item > svg {
+.wp_tl15_fileList_item>svg {
   width: 20px;
   height: 20px;
   position: absolute;
@@ -534,7 +539,7 @@ export default {
   cursor: pointer;
 }
 
-.s_b_m_ti_option > span > img {
+.s_b_m_ti_option>span>img {
   max-height: 150px;
   border-radius: 2px;
   cursor: pointer;
@@ -550,7 +555,7 @@ export default {
   margin-right: 10px;
 }
 
-.s_b_m_ti_o_btn > span {
+.s_b_m_ti_o_btn>span {
   width: 20px;
   height: 20px;
   display: block;
@@ -559,7 +564,7 @@ export default {
   overflow: hidden;
 }
 
-.s_b_m_ti_o_btn > span > span {
+.s_b_m_ti_o_btn>span>span {
   width: 100%;
   height: 100%;
   display: flex;
@@ -573,7 +578,7 @@ export default {
   border-radius: 50%;
 }
 
-.s_b_m_ti_o_btn1 > span::after {
+.s_b_m_ti_o_btn1>span::after {
   content: "";
   width: 8px;
   height: 8px;
@@ -586,7 +591,7 @@ export default {
   border-radius: 2px;
 }
 
-.s_b_m_ti_o_btn2 > span::after {
+.s_b_m_ti_o_btn2>span::after {
   content: "";
   width: 8px;
   height: 8px;
@@ -603,7 +608,7 @@ export default {
   align-items: flex-start;
 }
 
-.s_b_m_ti_title > span:nth-of-type(1) {
+.s_b_m_ti_title>span:nth-of-type(1) {
   font-size: 30px;
   font-weight: bold;
   color: #3681fc;
@@ -614,7 +619,7 @@ export default {
   margin-top: -3px;
 }
 
-.s_b_m_ti_title > svg {
+.s_b_m_ti_title>svg {
   width: 30px;
   height: 30px;
   min-width: 30px;
@@ -622,7 +627,7 @@ export default {
   margin: 0 10px 0 0px;
 }
 
-.s_b_m_ti_title > span:nth-of-type(2) {
+.s_b_m_ti_title>span:nth-of-type(2) {
   font-size: 20px;
   font-weight: bold;
   display: flex;
@@ -633,7 +638,7 @@ export default {
   color: #1f1f1f;
 }
 
-.s_b_m_ti_title > div {
+.s_b_m_ti_title>div {
   font-size: 30px;
   font-weight: bold;
 }

+ 1 - 1
src/components/pages/workPage/setIndex.vue

@@ -101,7 +101,7 @@ export default {
         console.log("保存失败",err);
         // this.$message.error("保存失败");
       })
-    }, 500)
+    }, 300)
   },
   mounted() {
     this.getWorkData();

Некоторые файлы не были показаны из-за большого количества измененных файлов