Ver Fonte

fix(pptEasy/addCourse3): 修复条件判断逻辑错误

将多处冗余的if判断修正为else if,避免逻辑分支执行异常
lsc há 18 horas atrás
pai
commit
15b66908aa
1 ficheiros alterados com 8 adições e 8 exclusões
  1. 8 8
      src/components/pages/pptEasy/addCourse3.vue

+ 8 - 8
src/components/pages/pptEasy/addCourse3.vue

@@ -2892,7 +2892,7 @@ export default {
       let _data = { id: new Date().getTime(), tool: 72, title: data.name, brief: data.detail, json: data, icon: data.json.icon, url: data.url }
       let _data = { id: new Date().getTime(), tool: 72, title: data.name, brief: data.detail, json: data, icon: data.json.icon, url: data.url }
       if(this.editId === 111){
       if(this.editId === 111){
         this.pptCourseJson.toolsList.push(_data);
         this.pptCourseJson.toolsList.push(_data);
-      } if (this.editId) {
+      }else if (this.editId) {
         let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
         let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
         _data.id = oldData.id;
         _data.id = oldData.id;
         this.pptCourseJson.toolsList.splice(this.pptCourseJson.toolsList.findIndex(i => i.id === this.editId), 1, _data);
         this.pptCourseJson.toolsList.splice(this.pptCourseJson.toolsList.findIndex(i => i.id === this.editId), 1, _data);
@@ -2908,7 +2908,7 @@ export default {
         let _data = { id: new Date().getTime(), tool: 72, title: data[i].name, brief: data[i].detail, json: data[i], icon: data[i].json.icon, url: data[i].url }
         let _data = { id: new Date().getTime(), tool: 72, title: data[i].name, brief: data[i].detail, json: data[i], icon: data[i].json.icon, url: data[i].url }
         if(this.editId === 111){
         if(this.editId === 111){
           this.pptCourseJson.toolsList.push(_data);
           this.pptCourseJson.toolsList.push(_data);
-        } if (this.editId) {
+        }else if (this.editId) {
           let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
           let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
           _data.id = oldData.id;
           _data.id = oldData.id;
           this.pptCourseJson.toolsList.splice(this.pptCourseJson.toolsList.findIndex(i => i.id === this.editId), 1, _data);
           this.pptCourseJson.toolsList.splice(this.pptCourseJson.toolsList.findIndex(i => i.id === this.editId), 1, _data);
@@ -3049,7 +3049,7 @@ export default {
       let _data = { id: new Date().getTime(), tool: 45, title: this.lang.ssChoice, brief: this.lang.ssChoiceTool2, json: testJson, url: "" }
       let _data = { id: new Date().getTime(), tool: 45, title: this.lang.ssChoice, brief: this.lang.ssChoiceTool2, json: testJson, url: "" }
       if(this.editId === 111){
       if(this.editId === 111){
         this.pptCourseJson.toolsList.push(_data);
         this.pptCourseJson.toolsList.push(_data);
-      } if (this.editId) {
+      }else if (this.editId) {
         let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
         let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
         _data.id = oldData.id;
         _data.id = oldData.id;
         _data.title = oldData.title;
         _data.title = oldData.title;
@@ -3090,7 +3090,7 @@ export default {
       let _data = { id: new Date().getTime(), tool: 78, title: this.lang.ssChoice, brief: this.lang.ssChoiceTool2, json: testJson, url: "" }
       let _data = { id: new Date().getTime(), tool: 78, title: this.lang.ssChoice, brief: this.lang.ssChoiceTool2, json: testJson, url: "" }
       if(this.editId === 111){
       if(this.editId === 111){
         this.pptCourseJson.toolsList.push(_data);
         this.pptCourseJson.toolsList.push(_data);
-      } if (this.editId) {
+      }else if (this.editId) {
         let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
         let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
         _data.id = oldData.id;
         _data.id = oldData.id;
         _data.title = oldData.title;
         _data.title = oldData.title;
@@ -3349,7 +3349,7 @@ export default {
       let _data = { id: new Date().getTime(), tool: 15, title: this.lang.ssQAQuestion, brief: this.lang.ssQAQuestionTool, json: { answerQ: this.answerQ }, url: "" }
       let _data = { id: new Date().getTime(), tool: 15, title: this.lang.ssQAQuestion, brief: this.lang.ssQAQuestionTool, json: { answerQ: this.answerQ }, url: "" }
       if(this.editId === 111){
       if(this.editId === 111){
         this.pptCourseJson.toolsList.push(_data);
         this.pptCourseJson.toolsList.push(_data);
-      } if (this.editId) {
+      }else if (this.editId) {
         let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
         let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
         _data.id = oldData.id;
         _data.id = oldData.id;
         _data.title = oldData.title;
         _data.title = oldData.title;
@@ -3382,7 +3382,7 @@ export default {
       let _data = { id: new Date().getTime(), tool: 79, title: this.lang.ssPhoto, brief: this.lang.ssPhotoTool, json: { answerQ: this.answerQ, fileList: [] }, url: "" }
       let _data = { id: new Date().getTime(), tool: 79, title: this.lang.ssPhoto, brief: this.lang.ssPhotoTool, json: { answerQ: this.answerQ, fileList: [] }, url: "" }
       if(this.editId === 111){
       if(this.editId === 111){
         this.pptCourseJson.toolsList.push(_data);
         this.pptCourseJson.toolsList.push(_data);
-      } if (this.editId) {
+      }else if (this.editId) {
         let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
         let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
         _data.id = oldData.id;
         _data.id = oldData.id;
         _data.title = oldData.title;
         _data.title = oldData.title;
@@ -3415,7 +3415,7 @@ export default {
       let _data = { id: new Date().getTime(), tool: 84, title: this.lang.ssFile, brief: this.lang.ssFileTool, json: { answerQ: this.answerQ, fileList: [] }, url: "" }
       let _data = { id: new Date().getTime(), tool: 84, title: this.lang.ssFile, brief: this.lang.ssFileTool, json: { answerQ: this.answerQ, fileList: [] }, url: "" }
       if(this.editId === 111){
       if(this.editId === 111){
         this.pptCourseJson.toolsList.push(_data);
         this.pptCourseJson.toolsList.push(_data);
-      } if (this.editId) {
+      }else if (this.editId) {
         let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
         let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
         _data.id = oldData.id;
         _data.id = oldData.id;
         _data.title = oldData.title;
         _data.title = oldData.title;
@@ -3719,7 +3719,7 @@ export default {
       let _data = { id: new Date().getTime(), tool: 73, title: this.lineTitle, brief: this.lang.ssH5Page, json: { lineTitle: this.lineTitle, line: this.line }, url: this.line }
       let _data = { id: new Date().getTime(), tool: 73, title: this.lineTitle, brief: this.lang.ssH5Page, json: { lineTitle: this.lineTitle, line: this.line }, url: this.line }
       if(this.editId === 111){
       if(this.editId === 111){
         this.pptCourseJson.toolsList.push(_data);
         this.pptCourseJson.toolsList.push(_data);
-      } if (this.editId) {
+      }else if (this.editId) {
         let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
         let oldData = this.pptCourseJson.toolsList.find(i => i.id === this.editId);
         _data.id = oldData.id;
         _data.id = oldData.id;
         _data.brief = oldData.brief;
         _data.brief = oldData.brief;