Browse Source

修改赛事问题

zengyicheng 2 years ago
parent
commit
50963bd1b7

+ 67 - 24
src/components/pages/race/addRace.vue

@@ -83,6 +83,7 @@
         <el-button type="primary" @click="setTime" v-if="steps == 2"
           >跳过</el-button
         >
+        <el-button type="primary" @click="saveRace(1)">保存</el-button>
         <el-button type="primary" @click="lastSteps" v-if="steps != 1"
           >上一步</el-button
         >
@@ -199,11 +200,12 @@ export default {
       dialogVisible: false,
       dialogVisible1: false,
       dialogVisible2: false,
+      isNoDia: 0,
       isJump: 0,
       raceInfo: {
         title: "",
         type: [],
-        typeOtherName:"",
+        typeOtherName: "",
         cover: [],
         autor: [],
         tableData: [],
@@ -409,7 +411,7 @@ export default {
       //   this.dialogVisible1 = true;
       //   this.steps++;
       // }
-      this.isAddOrUpRace1(3);
+      // this.isAddOrUpRace1(3);
     },
     lastSteps() {
       this.steps--;
@@ -484,6 +486,15 @@ export default {
         // this.$message.error("课程分类不能为空");
       }
     },
+    saveRace(noDia) {
+      this.isNoDia = noDia;
+      if (this.aid == "" || this.aid == undefined) {
+        this.isAddOrUpRace(0);
+        // this.addRace();
+      } else {
+        this.updateRace();
+      }
+    },
     isAddOrUpRace1(t) {
       this.isJump = t;
       if (this.aid == "" || this.aid == undefined) {
@@ -513,18 +524,34 @@ export default {
         .then((res) => {
           this.aid = res.data.courseId;
           if (this.isJump == 0) {
-            this.$message({
-              message: "新增成功",
-              type: "success",
-            });
-            this.dialogVisible = true;
+            if (this.isNoDia == 0) {
+              this.dialogVisible = true;
+              this.$message({
+                message: "新增成功",
+                type: "success",
+              });
+            } else {
+              this.$message({
+                message: "保存成功",
+                type: "success",
+              });
+              this.isNoDia = 0;
+            }
           } else if (this.isJump == 1) {
-            this.$message({
-              message: "新增成功",
-              type: "success",
-            });
-            this.goTo("/eventCenter?steps=" + "2");
-            this.dialogVisible1 = false;
+            if (this.isNoDia == 0) {
+              this.$message({
+                message: "新增成功",
+                type: "success",
+              });
+              this.goTo("/eventCenter?steps=" + "2");
+              this.dialogVisible1 = false;
+            } else {
+              this.$message({
+                message: "保存成功",
+                type: "success",
+              });
+              this.isNoDia = 0;
+            }
           } else {
             console.log("下一步");
           }
@@ -555,18 +582,34 @@ export default {
         .post(this.$store.state.api + "updateRace", params)
         .then((res) => {
           if (this.isJump == 0) {
-            this.$message({
-              message: "修改成功",
-              type: "success",
-            });
-            this.dialogVisible = true;
+            if (this.isNoDia == 0) {
+              this.dialogVisible = true;
+              this.$message({
+                message: "修改成功",
+                type: "success",
+              });
+            } else {
+              this.$message({
+                message: "保存成功",
+                type: "success",
+              });
+              this.isNoDia = 0;
+            }
           } else if (this.isJump == 1) {
-            this.$message({
-              message: "修改成功",
-              type: "success",
-            });
-            this.goTo("/eventCenter?steps=" + "2");
-            this.dialogVisible1 = false;
+            if (this.isNoDia == 0) {
+              this.$message({
+                message: "修改成功",
+                type: "success",
+              });
+              this.goTo("/eventCenter?steps=" + "2");
+              this.dialogVisible1 = false;
+            } else {
+              this.$message({
+                message: "保存成功",
+                type: "success",
+              });
+              this.isNoDia = 0;
+            }
           } else {
             console.log("下一步");
           }

+ 6 - 3
src/components/pages/race/addRace/projectProcess.vue

@@ -100,7 +100,7 @@
                   <div class="lineTitle">活动目标</div>
                   <div class="strLine"></div>
                 </div>
-                <div class="editorCss">
+                <div class="editorCss isNoHeight">
                   <editor-bar
                     v-model="race.driQuestion.brief"
                     @change="upRacePro"
@@ -355,7 +355,7 @@
                   <div class="lineTitle">预期成果</div>
                   <div class="strLine"></div>
                 </div>
-                <div class="editorCss">
+                <div class="editorCss isNoHeight">
                   <editor-bar
                     v-model="race.actiDesign.brief"
                     @change="upRacePro"
@@ -483,7 +483,7 @@
                   <div class="lineTitle">活动评价</div>
                   <div class="strLine"></div>
                 </div>
-                <div class="editorCss">
+                <div class="editorCss isNoHeight">
                   <editor-bar
                     v-model="race.evaDesign.brief"
                     @change="upRacePro"
@@ -1728,4 +1728,7 @@ export default {
   margin-left: 10px;
   color: #ccc;
 }
+.isNoHeight >>> .text {
+  height: 200px !important;
+}
 </style>