lsc 7 mesi fa
parent
commit
4b048f3f22

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.e20bc84b3337b0f80ce8d3a2357d9432.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.35dfb1d95a63059f336f.js></script><script type=text/javascript src=./static/js/app.aa9b3e9497bcdd3b31da.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.433863ab3c18a76b5c517d53d6b1e9df.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.35dfb1d95a63059f336f.js></script><script type=text/javascript src=./static/js/app.c947dbf06879bd3aaaca.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.433863ab3c18a76b5c517d53d6b1e9df.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.433863ab3c18a76b5c517d53d6b1e9df.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.c947dbf06879bd3aaaca.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.c947dbf06879bd3aaaca.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.571c38d63f24b1ae9e16.js.map


+ 29 - 8
src/components/pages/components/studentWorksDetail.vue

@@ -3589,16 +3589,37 @@ export default {
       } else {
         const element = document.getElementById(`${s}+${i}`);
         if (element) {
-          element.scrollIntoView({
-            behavior: 'smooth'
-          },()=>{
+          // element.scrollIntoView({
+          //   behavior: 'smooth', block: "start", inline: "nearest"
+          // }, ()=>{
+          //   let scrollBody = document.querySelector(".zyBoxC").parentElement
+          //   scrollBody.scrollTop = scrollBody.scrollTop - 70
+          // });
+          function scrollToElement(elementA) {
+            return new Promise((resolve) => {
+              const observer = new IntersectionObserver((entries) => {
+                if (entries[0].isIntersecting) {
+                  observer.disconnect(); // 停止观察
+                  setTimeout(() => {
+                    resolve(); // 延迟以确保滚动完成
+                  }, 300); // 可以调整延迟时间
+                }
+              }, { threshold: [1] }); // 阈值设为 1 确保完全可见
+
+              elementA.scrollIntoView({ behavior: 'smooth', block: "start" });
+              // elementA.scrollIntoView();
+              observer.observe(elementA);
+            });
+          }
+
+
+          // 使用示例
+          scrollToElement(element).then(()=>{
             let scrollBody = document.querySelector(".zyBoxC").parentElement
-            scrollBody.scrollTop = scrollBody.scrollTop - 30
+            setTimeout(() => {
+              scrollBody.scrollTop = scrollBody.scrollTop - 70;
+            }, 100); // 调整时间确保足够长
           });
-          setTimeout(() => {
-            let scrollBody = document.querySelector(".zyBoxC").parentElement
-            scrollBody.scrollTop = scrollBody.scrollTop - 70
-          }, 500);
         }
         var a = s + "-" + i;
         // var b = document.getElementById(a);

+ 59 - 17
src/components/pages/components/worksDetail2.vue

@@ -4641,16 +4641,37 @@ export default {
       } else {
         const element = document.getElementById(`${s}+${i}`);
         if (element) {
-          element.scrollIntoView({
-            behavior: 'smooth', block: "start", inline: "nearest"
-          },()=>{
+          // element.scrollIntoView({
+          //   behavior: 'smooth', block: "start", inline: "nearest"
+          // }, ()=>{
+          //   let scrollBody = document.querySelector(".zyBoxC").parentElement
+          //   scrollBody.scrollTop = scrollBody.scrollTop - 70
+          // });
+          function scrollToElement(elementA) {
+            return new Promise((resolve) => {
+              const observer = new IntersectionObserver((entries) => {
+                if (entries[0].isIntersecting) {
+                  observer.disconnect(); // 停止观察
+                  setTimeout(() => {
+                    resolve(); // 延迟以确保滚动完成
+                  }, 300); // 可以调整延迟时间
+                }
+              }, { threshold: [1] }); // 阈值设为 1 确保完全可见
+
+              elementA.scrollIntoView({ behavior: 'smooth', block: "start" });
+              // elementA.scrollIntoView();
+              observer.observe(elementA);
+            });
+          }
+
+
+          // 使用示例
+          scrollToElement(element).then(()=>{
             let scrollBody = document.querySelector(".zyBoxC").parentElement
-            scrollBody.scrollTop = scrollBody.scrollTop - 30
+            setTimeout(() => {
+              scrollBody.scrollTop = scrollBody.scrollTop - 70;
+            }, 100); // 调整时间确保足够长
           });
-          setTimeout(() => {
-            let scrollBody = document.querySelector(".zyBoxC").parentElement
-            scrollBody.scrollTop = scrollBody.scrollTop - 70
-          }, 500);
         }
         var a = s + "-" + i;
         // var b = document.getElementById(a);
@@ -4669,16 +4690,37 @@ export default {
 
       const element = document.getElementById(`${s}+${i}`);
       if (element) {
-        element.scrollIntoView({
-          behavior: 'smooth', block: "start", inline: "nearest"
-        },()=>{
-          let scrollBody = document.querySelector(".zyBoxC").parentElement
-          scrollBody.scrollTop = scrollBody.scrollTop - 70
-        });
-        setTimeout(() => {
+        // element.scrollIntoView({
+        //     behavior: 'smooth', block: "start", inline: "nearest"
+        //   }, ()=>{
+        //     let scrollBody = document.querySelector(".zyBoxC").parentElement
+        //     scrollBody.scrollTop = scrollBody.scrollTop - 70
+        //   });
+        function scrollToElement(elementA) {
+            return new Promise((resolve) => {
+              const observer = new IntersectionObserver((entries) => {
+                if (entries[0].isIntersecting) {
+                  observer.disconnect(); // 停止观察
+                  setTimeout(() => {
+                    resolve(); // 延迟以确保滚动完成
+                  }, 300); // 可以调整延迟时间
+                }
+              }, { threshold: [1] }); // 阈值设为 1 确保完全可见
+
+              elementA.scrollIntoView({ behavior: 'smooth', block: "start" });
+              // elementA.scrollIntoView();
+              observer.observe(elementA);
+            });
+          }
+
+
+          // 使用示例
+          scrollToElement(element).then(()=>{
             let scrollBody = document.querySelector(".zyBoxC").parentElement
-            scrollBody.scrollTop = scrollBody.scrollTop - 70
-          }, 500);
+            setTimeout(() => {
+              scrollBody.scrollTop = scrollBody.scrollTop - 70;
+            }, 100); // 调整时间确保足够长
+          });
       }
       var a = s + "-" + i;
     

+ 25 - 6
src/components/pages/test/add/addTest.vue

@@ -147,7 +147,7 @@ export default {
         goTo(path) {
             this.$router.push(path);
         },
-        addWork(look) {
+        addWork(look, callback) {
             let j3 = []
             if (this.typeInfo.length) {
                 this.typeInfo.forEach(e => {
@@ -191,9 +191,10 @@ export default {
                             this.role
                         );
                     }
-                    setTimeout(() => {
-                        this.getData(2);
-                    }, 1000);
+                    // setTimeout(() => {
+                    //     this.getData(2);
+                    // }, 1000);
+                    callback ? callback() : ''
                 })
                 .catch((err) => {
                     this.$message.error("网络不佳");
@@ -326,11 +327,29 @@ export default {
             }
         },
         save(look) {
-            this.updateWork(look == 4 ? look : this.look)
+            if (!this.title) {
+                this.$message.error("请补充填写课程名称");
+                return;
+            }
+            if (this.cid) {
+                this.updateWork(look == 4 ? look : this.look)
+            } else {
+                this.addWork();
+            }
             // this.updateWork(5)
         },
         publish() {
-            this.dialogVisible = true
+            if (!this.title) {
+                this.$message.error("请补充填写课程名称");
+                return;
+            }
+            if (this.cid) {
+                this.dialogVisible = true
+            } else {
+                this.addWork(this.look, ()=>{
+                    this.dialogVisible = true
+                });
+            }
             // this.updateWork(3)
         },
         //获取分类类名

Some files were not shown because too many files changed in this diff