From 804d59e162b72be684d0087a8cd74dbd6fecbf4d Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期五, 30 十二月 2022 16:57:18 +0800
Subject: [PATCH] 添加投影配置页面

---
 src/pages/settings/views/NetSettings.vue |   96 +++++++++++++++++++++---------------------------
 1 files changed, 42 insertions(+), 54 deletions(-)

diff --git a/src/pages/settings/views/NetSettings.vue b/src/pages/settings/views/NetSettings.vue
index f115a26..b23ecd6 100644
--- a/src/pages/settings/views/NetSettings.vue
+++ b/src/pages/settings/views/NetSettings.vue
@@ -17,7 +17,7 @@
           <!-- <span v-if="showStatus && i == 2" class="status">宸茶繛鎺�</span> -->
         </div>
       </div>
-      <div class="net-right">
+      <div class="net-right" v-loading="configLoading">
         <div class="net-set" v-if="activePage == 0">
           <div class="title">缃戠粶璁剧疆</div>
           <el-form :model="ruleForm" :rules="rules" ref="joinForm" class="join-form">
@@ -374,7 +374,8 @@
       ],
       value: "",
       IPV4_hid: false,
-      IPV6_hid: false
+      IPV6_hid: false,
+      configLoading: false
     }
   },
   mounted() {
@@ -383,7 +384,6 @@
   },
   methods: {
     minusPrefix() {
-      debugger
       this.ipv6Form.prefix
     },
     switchNetCard(item) {
@@ -462,24 +462,6 @@
       this.activePage = i
     },
     saveWire(ifname) {
-      // let data = {
-      //   ip: this.wireForm.ip,
-      //   gateway: this.wireForm.gateway,
-      //   dns: this.wireForm.dns,
-      //   subMask: this.wireForm.subMask,
-      //   ifname: this.activeWireItem.name,
-      // };
-      // setNetWorkCard(data).then(
-      //   (res) => {
-      //     if (res && res.success) {
-      //       this.$message.success(res.data);
-      //     }
-      //   },
-      //   (err) => {
-      //     this.$message.error("淇濆瓨澶辫触锛�" + err.msg);
-      //   }
-      // );
-
       this.$refs["wireForm"].validate((valid) => {
         if (valid) {
           let data = {
@@ -490,24 +472,7 @@
             ifname: this.activeWireItem.name
           }
 
-          let newUri = location.protocol + "//" + data.ip + location.port == 80 ? "" : ":" + location.port
-
-          if (this.wireForm.ip !== this.originalConfig.ip) {
-            var changeIPTimer = setTimeout(() => {
-              this.$alert(
-                '<strong>鎮ㄥ凡淇敼浜嗘湇鍔″櫒ip, 璇烽噸鏂扮櫥褰�</strong><a target="_parent" href="' +
-                  newUri +
-                  '"> ' +
-                  newUri +
-                  "<a/>",
-                "鎻愮ず",
-                {
-                  dangerouslyUseHTMLString: true,
-                  customClass: "noticeBox"
-                }
-              )
-            }, 10000)
-          }
+          let newUri = location.protocol + "//" + data.ip + (location.port == 80 ? "" : ":" + location.port)
 
           this.$confirm("纭闇�瑕佷慨鏀规湇鍔″櫒閰嶇疆鍚楋紵", {
             center: true,
@@ -515,8 +480,29 @@
             confirmButtonClass: "comfirm-class-sure"
           })
             .then(() => {
+              this.configLoading = true
+              if (this.wireForm.ip !== this.originalConfig.ip) {
+                this.configLoading = false
+                console.log("set time out")
+                var changeIPTimer = setTimeout(() => {
+                  this.$alert(
+                    '<strong>鎮ㄥ凡淇敼浜嗘湇鍔″櫒ip, 璇烽噸鏂扮櫥褰�</strong><a target="_parent" href="' +
+                      newUri +
+                      '"> ' +
+                      newUri +
+                      "<a/>",
+                    "鎻愮ず",
+                    {
+                      dangerouslyUseHTMLString: true,
+                      customClass: "noticeBox"
+                    }
+                  )
+                }, 10000)
+              }
+
               setNetWorkCard(data)
                 .then((rsp) => {
+                  this.configLoading = false
                   if (rsp && rsp.success) {
                     this.$notify({
                       type: "success",
@@ -524,13 +510,7 @@
                     })
                   }
                 })
-                .catch((err) => {
-                  clearTimeout(changeIPTimer)
-                  this.$notify({
-                    type: "error",
-                    message: "淇濆瓨澶辫触"
-                  })
-                })
+                .catch((err) => {})
               this.$message({
                 message: "鎿嶄綔瀹屾垚,璇风◢鍚�",
                 type: "success"
@@ -606,11 +586,11 @@
   width: 100%;
 }
 .wire {
-  width: 456px;
+  //  width: 456px;
   margin: 0 auto;
 }
 .wire-detail {
-  width: 456px;
+  //  width: 456px;
   margin: 0 auto;
   .title {
     font-size: 16px;
@@ -648,7 +628,7 @@
   }
 }
 .net-set {
-  max-width: 456px;
+  // max-width: 456px;
   margin: 0 auto;
   .title {
     font-size: 16px;
@@ -821,7 +801,7 @@
       max-width: none !important;
     }
     .wifi-set {
-      max-width: 456px;
+      //   max-width: 456px;
       margin: 0 auto;
       .switch-bar {
         background: #f2f2f7;
@@ -872,7 +852,7 @@
       }
     }
     .wifi-detail {
-      max-width: 454px;
+      //  max-width: 454px;
       margin: 0 auto;
       transition: all 0.3s linear 0s;
       .general-box {
@@ -884,10 +864,15 @@
         margin-bottom: 20px;
         &.fold {
           height: 342px;
+
+          .in-title {
+            display: flex;
+            justify-content: space-between;
+          }
+
           .icon-fold {
             display: inline-block;
             font-size: 14px;
-            margin-left: 360px;
             transition: all 0.3s linear 0s;
             cursor: pointer;
           }
@@ -979,14 +964,17 @@
           align-items: center;
           .el-switch__core {
             height: 14px;
-            background-color: var(--colorCard) !important;
-            border-color: var(--colorCard) !important;
           }
           .el-switch.is-checked .el-switch__core::after {
             left: 100%;
             margin-left: -12px;
           }
 
+          .el-switch.is-checked .el-switch__core {
+            background-color: var(--colorCard) !important;
+            border-color: var(--colorCard) !important;
+          }
+
           .el-switch__core:after {
             content: "";
             position: absolute;

--
Gitblit v1.8.0