Explorar o código

1、组件重做 2、权限控制修改

dsy hai 1 mes
pai
achega
1c9cdae4ef

+ 1 - 8
src/views/book/courseware/create/components/base/common/UploadFile.vue

@@ -18,14 +18,7 @@
         >
           <el-button>{{ type === 'h5_games' ? '选择Zip压缩包或单个html文件' : '选取' + labelText + '文件' }}</el-button>
         </el-upload>
-        <el-button
-          v-if="isEnable(projectResourcePopedom.is_can_upload)"
-          size="small"
-          type="primary"
-          @click="uploadFiles"
-        >
-          上传
-        </el-button>
+        <el-button size="small" type="primary" @click="uploadFiles"> 上传 </el-button>
         <el-button v-if="isEnable(projectResourcePopedom.is_can_use)" size="small" type="primary" @click="useResource">
           使用资源
         </el-button>

+ 4 - 3
src/views/book/courseware/preview/common/SoundRecord.vue

@@ -42,7 +42,6 @@
       >
       <div
         :class="['playBack', hasMicro]"
-        @click="playmicrophone(selectIndex || selectIndex == 0 ? recordList[selectIndex].toltime : '')"
         :style="{
           backgroundColor: (microphoneStatus || hasMicro) && attrib && attrib.topic_color ? attrib.topic_color : '#000',
           maskImage: hasMicro
@@ -52,6 +51,7 @@
             : `url(${require('@/assets/voice_matrix/luyin-play.png')})`,
         }"
         class="icon-mask"
+        @click="playmicrophone(selectIndex || selectIndex == 0 ? recordList[selectIndex].toltime : '')"
       >
         <!-- <SvgIcon icon-class="luyin-radio-play" size="24" /> -->
       </div>
@@ -89,7 +89,6 @@
       </el-select>
       <div
         :class="['playBack', hasMicro]"
-        @click="playmicrophone(selectIndex || selectIndex == 0 ? recordList[selectIndex].toltime : '')"
         :style="{
           backgroundColor: (microphoneStatus || hasMicro) && attrib && attrib.topic_color ? attrib.topic_color : '#000',
           maskImage: hasMicro
@@ -99,6 +98,7 @@
             : `url(${require('@/assets/voice_matrix/luyin-play.png')})`,
         }"
         class="icon-mask"
+        @click="playmicrophone(selectIndex || selectIndex == 0 ? recordList[selectIndex].toltime : '')"
       >
         <!-- <SvgIcon icon-class="luyin-radio-play" size="24" /> -->
       </div>
@@ -156,7 +156,6 @@
       </el-select>
       <div
         :class="['playBack', hasMicro]"
-        @click="playmicrophone(selectIndex || selectIndex == 0 ? recordList[selectIndex].toltime : '')"
         :style="{
           backgroundColor: (microphoneStatus || hasMicro) && attrib && attrib.topic_color ? attrib.topic_color : '#000',
           maskImage: hasMicro
@@ -166,6 +165,7 @@
             : `url(${require('@/assets/voice_matrix/luyin-play.png')})`,
         }"
         class="icon-mask"
+        @click="playmicrophone(selectIndex || selectIndex == 0 ? recordList[selectIndex].toltime : '')"
       >
         <!-- <SvgIcon icon-class="luyin-radio-play" size="24" /> -->
       </div>
@@ -451,6 +451,7 @@ export default {
     handleReset() {
       this.hasMicro = '';
       this.recordtime = 0;
+      this.recordFile = 1;
       window.stopAudioSound = () => {
         if (this.audio) {
           this.audio.pause();

+ 4 - 1
src/views/book/courseware/preview/components/input/InputPreview.vue

@@ -28,7 +28,7 @@
       </div>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
@@ -106,6 +106,9 @@ export default {
         gridTemplateAreas: this.showLang ? "'rich input' 'lang lang'" : "'rich input'",
       };
     },
+    retry() {
+      this.data.answer.text = '';
+    },
   },
 };
 </script>

+ 4 - 1
src/views/book/courseware/preview/components/judge/JudgePreview.vue

@@ -56,7 +56,7 @@
       </ul>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
@@ -211,6 +211,9 @@ export default {
       }
       return isCorrectType && !(selectOption.option_type === option_type) ? 'answer-right' : '';
     },
+    retry() {
+      this.answer.answer_list = [];
+    },
   },
 };
 </script>

+ 10 - 1
src/views/book/courseware/preview/components/matching/MatchingPreview.vue

@@ -36,7 +36,7 @@
       </ul>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
@@ -514,6 +514,15 @@ export default {
 
       return isRight ? 'right' : 'wrong';
     },
+    retry() {
+      this.clearLine();
+      this.$set(
+        this,
+        'answerList',
+        this.answerList.map((item) => item.map(({ mark }) => ({ mark, preMark: [], nextMark: [] }))),
+      );
+      this.$set(this, 'answer', { answer_list: [], is_right: false });
+    },
   },
 };
 </script>

+ 5 - 1
src/views/book/courseware/preview/components/select/SelectPreview.vue

@@ -39,7 +39,7 @@
       </ul>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
@@ -174,6 +174,10 @@ export default {
       }
       return answerClass;
     },
+
+    retry() {
+      this.answer.answer_list = [];
+    },
   },
 };
 </script>

+ 10 - 1
src/views/book/courseware/preview/components/sort/SortPreview.vue

@@ -41,7 +41,7 @@
       </ul>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
@@ -195,6 +195,15 @@ export default {
       this.clickIndexList = [];
       this.answer.answer_list = this.move_list.map(({ mark }) => mark);
     },
+    retry() {
+      const optionList = structuredClone(this.data.option_list);
+      this.move_list =
+        this.data.property.order_type === orderTypeList[0].value
+          ? optionList
+          : optionList.sort(() => Math.random() - 0.5);
+      this.answer.answer_list = [];
+      this.is_all_right = false;
+    },
   },
 };
 </script>

+ 11 - 1
src/views/book/courseware/preview/components/voice_matrix/VoiceMatrixPreview.vue

@@ -209,7 +209,7 @@
       </div>
     </div>
 
-    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" />
+    <PreviewOperation @showAnswerAnalysis="showAnswerAnalysis" @retry="retry" />
     <AnswerCorrect
       :answer-correct="data?.answer_correct"
       :visible.sync="visibleAnswerCorrect"
@@ -581,6 +581,16 @@ export default {
         });
       });
     },
+
+    retry() {
+      this.clearSelectCell();
+      this.selectedLine = { type: '', index: -1 };
+      this.handleParentPlay();
+      this.wavblob = null;
+      this.matrixSelectLrc = null;
+      this.data.record_list = [];
+      this.$refs.luyin?.handleReset();
+    },
   },
 };
 </script>