Explorar o código

Merge branch 'beta' of https://git.cocorobo.cn/CocoRoboLabs/pbl-teacher-table into beta

zengyicheng hai 1 ano
pai
achega
c5de54e82c
Modificáronse 2 ficheiros con 90 adicións e 61 borrados
  1. 49 32
      src/components/pages/addCourse.vue
  2. 41 29
      src/components/pages/easy/addCourse.vue

+ 49 - 32
src/components/pages/addCourse.vue

@@ -511,9 +511,13 @@
                   <div v-for="(item, index) in unitJson" :key="index" class="cru_select"
                     :class="unitIndex == index ? 'cru_selected' : ''" @click="unitSet(index)">
                     <!-- item.dyName ? item.dyName :  -->
-                    {{
+                    <span v-if="(unitJson[unitJson.length - 1].easy == 4) ||
+                      (unitJson[unitJson.length - 1].easy == 6)">{{
+    item.dyName ? item.dyName : "第" + (index + 1) + "阶段"
+  }}</span>
+                    <span v-else>{{
                       "第" + (index + 1) + "阶段"
-                    }}
+                    }}</span>
                   </div>
                   <img src="../../assets/line.png" class="cru_line" :style="{
                     left: offsetLetfPx + 'px',
@@ -3813,7 +3817,7 @@ export default {
       var _this = this;
       if (_this.time()) {
         _this
-          .$confirm("确定删除此任务吗?", "提示", {
+          .$confirm(((_this.unitJson[_this.unitIndex].chapterInfo[0].taskJson.length - 1) == i) ? "确定删除此任务吗?" : "切换任务顺序将删除所有工具的提交成果,是否继续此操作?", "提示", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning",
@@ -7289,33 +7293,44 @@ export default {
       this.isClickColor = i + 1;
     },
     taskMove(type, index) {
-      if (type == 1) {
-        if (index > 0) {
-          let a = JSON.parse(
-            JSON.stringify(
-              this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index - 1]
-            )
-          );
-          this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index - 1] =
-            this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index];
-          this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index] = a;
-        }
-      } else {
-        if (
-          index <
-          this.unitJson[this.unitIndex].chapterInfo[0].taskJson.length - 1
-        ) {
-          let a = JSON.parse(
-            JSON.stringify(
-              this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index + 1]
-            )
-          );
-          this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index + 1] =
-            this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index];
-          this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index] = a;
-        }
-      }
-      this.$forceUpdate();
+      this
+        .$confirm("切换任务顺序将删除所有工具的提交成果,是否继续此操作?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+        .then(() => {
+          if (type == 1) {
+            if (index > 0) {
+              let a = JSON.parse(
+                JSON.stringify(
+                  this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index - 1]
+                )
+              );
+              this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index - 1] =
+                this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index];
+              this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index] = a;
+            }
+          } else {
+            if (
+              index <
+              this.unitJson[this.unitIndex].chapterInfo[0].taskJson.length - 1
+            ) {
+              let a = JSON.parse(
+                JSON.stringify(
+                  this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index + 1]
+                )
+              );
+              this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index + 1] =
+                this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index];
+              this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index] = a;
+            }
+          }
+          this.$forceUpdate();
+        })
+        .catch(() => {
+          return;
+        })
     },
     addGroup(i) {
       // this.groupJson.group.splice(i + 1, 0, { name: "第"+(i+1)+"组" });
@@ -8702,9 +8717,11 @@ ol {
 .addNewPP>>>.el-dialog__body {
   padding: 5px 20px;
 }
-.addNewPP>>>.el-dialog{
-  margin-top:5vh !important;
+
+.addNewPP>>>.el-dialog {
+  margin-top: 5vh !important;
 }
+
 .isHeight {
   height: 680px;
 }

+ 41 - 29
src/components/pages/easy/addCourse.vue

@@ -3505,7 +3505,7 @@ export default {
       let stepsBottom2 = $(".stepsBottom2")[0].clientHeight
       // let client = $(".course_left")[0].clientHeight - stepsBottom2
       let client = $(".course_left")[0].clientHeight - stepsBottom2
-      let top = $(".rightBox")[0].scrollTop - 300 - stepsBottom2
+      let top = $(".rightBox")[0].scrollTop - 400 - stepsBottom2
       // if (top < client) {
       //   $('.stepsBottom2')[0].style.position = 'absolute'
       //   $('.stepsBottom2')[0].style.top = 0 + 'px'
@@ -3740,8 +3740,9 @@ export default {
     },
     deleteTask(i) {
       var _this = this;
+      //((_this.unitJson[_this.unitIndex].chapterInfo[0].taskJson.length - 1) == i) ? "确定删除此任务吗?" : "切换任务顺序将删除所有工具的提交成果,是否继续此操作?"
       _this
-        .$confirm("确定删除此任务吗?", "提示", {
+        .$confirm("确定删除此任务吗?" , "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning",
@@ -7172,33 +7173,44 @@ export default {
       this.isClickColor = i + 1;
     },
     taskMove(type, index) {
-      if (type == 1) {
-        if (index > 0) {
-          let a = JSON.parse(
-            JSON.stringify(
-              this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index - 1]
-            )
-          );
-          this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index - 1] =
-            this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index];
-          this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index] = a;
-        }
-      } else {
-        if (
-          index <
-          this.unitJson[this.unitIndex].chapterInfo[0].taskJson.length - 1
-        ) {
-          let a = JSON.parse(
-            JSON.stringify(
-              this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index + 1]
-            )
-          );
-          this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index + 1] =
-            this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index];
-          this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index] = a;
-        }
-      }
-      this.$forceUpdate();
+      // this
+      //   .$confirm("切换任务顺序将删除所有工具的提交成果,是否继续此操作?", "提示", {
+      //     confirmButtonText: "确定",
+      //     cancelButtonText: "取消",
+      //     type: "warning",
+      //   })
+      //   .then(() => {
+          if (type == 1) {
+            if (index > 0) {
+              let a = JSON.parse(
+                JSON.stringify(
+                  this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index - 1]
+                )
+              );
+              this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index - 1] =
+                this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index];
+              this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index] = a;
+            }
+          } else {
+            if (
+              index <
+              this.unitJson[this.unitIndex].chapterInfo[0].taskJson.length - 1
+            ) {
+              let a = JSON.parse(
+                JSON.stringify(
+                  this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index + 1]
+                )
+              );
+              this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index + 1] =
+                this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index];
+              this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index] = a;
+            }
+          }
+          this.$forceUpdate();
+        // })
+        // .catch(() => {
+        //   return;
+        // })
     },
     addGroup(i) {
       // this.groupJson.group.splice(i + 1, 0, { name: "第"+(i+1)+"组" });