Ver Fonte

feat(pptEasy): 添加工具按钮点击事件处理函数并优化对话框关闭逻辑

添加toolBtn2方法处理特定工具按钮点击事件,支持测试和答案功能初始化
将appDialog关闭逻辑从handleClose方法改为直接控制dialogVisible变量
lsc há 3 semanas atrás
pai
commit
9530e38076

+ 27 - 0
src/components/pages/pptEasy/addCourse3.vue

@@ -3072,6 +3072,32 @@ export default {
         });
       }
     },
+    toolBtn2(type, id, tool){
+      let _data = this.pptCourseJson.toolsList.find(i => i.id === id || i.url === id);
+      this.editId = _data.id;
+      if (tool == 45) {
+        this.testJsonName = "";
+        this.testJsonBrief = "";
+        this.testJson = {
+          testCount: 1,
+          testTitle: "",
+          testJson: [
+            {
+              teststitle: "",
+              testItem: 1,
+              checkList: [],
+              timuList: [],
+              answer: [],
+              type: "1"
+            }
+          ]
+        };
+         this.addTest()
+      } else if (tool == 15) {
+        this.answerQ = "";
+        this.addAnswer();
+      }
+    },
     clearLine() {
       this.line = "";
       this.dialogVisible7 = false;
@@ -3290,6 +3316,7 @@ export default {
     window.openVideoUploadDialog = () => this.openVideoUploadDialog(); // 打开视频上传弹窗
     window.openApplicationCenter = () => this.openApplicationCenter(); // 打开应用中心弹窗
     window.toolBtn = (type, id) => this.toolBtn(type, id); // 工具按钮点击事件
+    window.toolBtn2 = (type, id) => this.toolBtn2(type, id, tool); // 工具按钮点击事件
     window.previewVideo = (id) => this.previewVideo(id); // 预览视频
     window.goBack = () => this.goTo(`/course?userid=${this.userid}&oid=${this.oid}&org=${this.org}&role=${this.role}`);
     window.lastSteps = () => this.lastSteps(); // 上一步

+ 1 - 1
src/components/pages/pptEasy/dialog/appDialog.vue

@@ -5,7 +5,7 @@
       <template #title>
         <div class="title_container">
           <div>{{ lang.ssAppCenter }}</div>
-          <div class="close_btn" @click="handleClose">×</div>
+          <div class="close_btn" @click="dialogVisible = false">×</div>
         </div>
       </template>
       <div class="ac_right" v-loading.lock="getDataLoading" :style="{overflow: getDataLoading ? 'hidden' : 'auto'}">