lsc преди 1 година
родител
ревизия
76a75d79c8

+ 1 - 1
dist/index.html

@@ -25,7 +25,7 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.4330f50cd1451d8b7af8c0d06b8db6af.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.f1661c5ebfd33221b88f.js></script><script type=text/javascript src=./static/js/app.94f9bc5253be4f6b3cf9.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.d0b5046950ef3cc1426b87484a3a37f2.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3512a67a6213c2df4180.js></script><script type=text/javascript src=./static/js/vendor.f1661c5ebfd33221b88f.js></script><script type=text/javascript src=./static/js/app.bb9aff2eeb346190585d.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/css/app.d0b5046950ef3cc1426b87484a3a37f2.css


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/css/app.d0b5046950ef3cc1426b87484a3a37f2.css.map


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/js/app.bb9aff2eeb346190585d.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/js/app.bb9aff2eeb346190585d.js.map


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/static/js/manifest.3512a67a6213c2df4180.js.map


+ 197 - 6
src/components/pages/student/addCourse.vue

@@ -8708,13 +8708,204 @@ export default {
             }
           }
           this.$forceUpdate();
-          if (this.timer) {
-            clearTimeout(this.timer);
-            this.timer = null;
+
+          let unitJson2 = JSON.parse(res.data[0][0].chapters);
+          this.unitJson2 = JSON.parse(res.data[0][0].chapters);
+          let _unitJson2 = JSON.parse(JSON.stringify(this.unitJson));
+          let _unitJson = [];
+          let _chapAarry = [];
+          let _unitIndex = JSON.parse(JSON.stringify(this.unitIndex));
+          let _unitIndex2 = JSON.parse(JSON.stringify(this.unitIndex));
+          let index = 1;
+          let chapindex;
+          if (_unitJson2.length > unitJson2.length) {
+            for (let c = 0; c < _unitJson2.length; c++) {
+              _chapAarry.push(_unitJson2[c].chapterInfo[0].chapterid);
+            }
+            for (let j = 0; j < unitJson2.length; j++) {
+              let count = 0;
+              for (let k = 0; k < _unitJson2.length; k++) {
+                if (
+                  unitJson2[j].chapterInfo[0].chapterid ==
+                  _unitJson2[k].chapterInfo[0].chapterid
+                ) {
+                  count++;
+                  _chapAarry.splice(
+                    _chapAarry.indexOf(_unitJson2[k].chapterInfo[0].chapterid),
+                    1
+                  );
+                  _unitJson.push(unitJson2[j]);
+                  break;
+                }
+              }
+              // if(count === 0){
+              //   this.$message.error("您所修改的阶段已经被其他老师删除了");
+              // }
+            }
+            for (let k = 0; k < _unitJson2.length; k++) {
+              if (_unitJson2[k].isUpdate == 1) {
+                _chapAarry.splice(
+                  _chapAarry.indexOf(_unitJson2[k].chapterInfo[0].chapterid),
+                  1
+                );
+                _unitJson.push(_unitJson2[k]);
+              }
+            }
+            console.log(_chapAarry);
+            for (let d = 0; d < _unitJson2.length; d++) {
+              if (
+                _chapAarry.indexOf(_unitJson2[d].chapterInfo[0].chapterid) != -1
+              ) {
+                if (_unitIndex == d) {
+                  index = 2;
+                }
+                chapindex = d;
+                // this.$message.error("您所修改的阶段已经被其他老师删除了");
+              }
+            }
+          } else {
+            _unitJson = JSON.parse(JSON.stringify(_unitJson2));
           }
-          this.timer = setTimeout(() => {
-            this.seleteCourseUpdate();
-          }, 1000);
+
+          for (let i = 0; i < unitJson2.length; i++) {
+            if (
+              (i < _unitJson.length - 1 || i == _unitJson.length - 1) &&
+              _unitJson[i].chapterInfo[0].chapterid !=
+              unitJson2[i].chapterInfo[0].chapterid
+            ) {
+              if (i == _unitJson.length - 1) {
+                // this.unitIndex++
+                _unitIndex2++;
+              }
+              _unitJson.splice(i, 0, unitJson2[i]);
+            } else if (i > _unitJson.length - 1) {
+              _unitJson.push(unitJson2[i]);
+            } else if (
+              _unitJson[i].chapterInfo[0].chapterid ==
+              unitJson2[i].chapterInfo[0].chapterid
+            ) {
+              _unitJson[i] = unitJson2[i];
+            }
+            // if (i == _unitIndex) {
+            //   continue;
+            // } else
+          }
+
+          if (_chapAarry.length && index != 2) {
+            if (chapindex < _unitIndex) {
+              this.isDelete = 2;
+              // this.unitIndex--;
+              _unitIndex2--;
+            } else if (
+              _unitJson2[_unitIndex].chapterInfo[0].chapterid !=
+              _unitJson[_unitIndex].chapterInfo[0].chapterid
+            ) {
+              this.isDelete = 2;
+              for (let n = 0; n < _unitJson.length; n++) {
+                if (
+                  _unitJson2[_unitIndex].chapterInfo[0].chapterid ==
+                  _unitJson[n].chapterInfo[0].chapterid
+                ) {
+                  // this.unitIndex = n;
+                  _unitIndex2 = n;
+                  _unitJson[n] = _unitJson2[_unitIndex];
+                  break;
+                }
+              }
+            }
+          } else if (index != 2) {
+            // _unitJson[this.unitIndex] = _unitJson2[_unitIndex];
+            _unitJson2[_unitIndex];
+            for (
+              var ci = 0;
+              ci < _unitJson2[_unitIndex].chapterInfo[0].taskJson.length;
+              ci++
+            ) {
+              _unitJson2[_unitIndex].chapterInfo[0].taskJson[ci].toolChoose =
+                _unitJson2[_unitIndex].chapterInfo[0].taskJson[ci].toolChoose
+                  ? _unitJson2[_unitIndex].chapterInfo[0].taskJson[ci]
+                    .toolChoose
+                  : [];
+              let _chapterData = [];
+              for (
+                var c = 0;
+                c <
+                _unitJson2[_unitIndex].chapterInfo[0].taskJson[ci].chapterData
+                  .length;
+                c++
+              ) {
+                if (
+                  _unitJson2[_unitIndex].chapterInfo[0].taskJson[ci]
+                    .chapterData[c]
+                ) {
+                  _chapterData.push(
+                    _unitJson2[_unitIndex].chapterInfo[0].taskJson[ci]
+                      .chapterData[c]
+                  );
+                }
+              }
+              _unitJson2[_unitIndex].chapterInfo[0].taskJson[ci].chapterData =
+                _chapterData;
+            }
+            _unitJson[_unitIndex2] = _unitJson2[_unitIndex];
+          }
+          if (index == 1) {
+            this.unitJson = _unitJson;
+            this.$forceUpdate();
+            setTimeout(() => {
+              if (this.unitIndex != _unitIndex2) {
+                this.isDelete = 2;
+                this.unitIndex = _unitIndex2;
+              }
+            }, 0);
+            this.timer = setTimeout(() => {
+              this.seleteCourseUpdate();
+            }, 1000);
+          } else if (index == 2) {
+            let _this = this;
+            _this
+              .$confirm(
+                "您所修改的阶段已经被其他老师删除了,需要恢复嘛?",
+                "提示",
+                {
+                  confirmButtonText: "需要",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                }
+              )
+              .then(() => {
+                if (_this.time()) {
+                  _this.restoreWork(
+                    _chapAarry[0],
+                    _unitJson,
+                    chapindex,
+                    _unitJson2,
+                    _unitIndex2
+                  );
+                }
+              })
+              .catch(() => {
+                _this.unitJson = _unitJson;
+                _this.$forceUpdate();
+                setTimeout(() => {
+                  if (this.unitIndex != _unitIndex2) {
+                    this.isDelete = 2;
+                    this.unitIndex = _unitIndex2;
+                  }
+                }, 0);
+                _this.timer = setTimeout(() => {
+                  _this.seleteCourseUpdate();
+                }, 1000);
+              });
+          }
+          // this.$forceUpdate();
+          // if (this.timer) {
+          //   clearTimeout(this.timer);
+          //   this.timer = null;
+          // }
+          // this.timer = setTimeout(() => {
+          //   this.seleteCourseUpdate();
+          // }, 1000);
         })
         .catch((err) => {
           console.error(err);

Някои файлове не бяха показани, защото твърде много файлове са промени