From 790c8124a913595818247279f50cfd2cfd892799 Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期三, 30 六月 2021 14:25:36 +0800
Subject: [PATCH] gettasklist修改

---
 src/pages/systemSettings/views/NetSettings.vue |   66 ++++++++++++++++++++++++---------
 1 files changed, 48 insertions(+), 18 deletions(-)

diff --git a/src/pages/systemSettings/views/NetSettings.vue b/src/pages/systemSettings/views/NetSettings.vue
index 600cf6e..71fb93e 100644
--- a/src/pages/systemSettings/views/NetSettings.vue
+++ b/src/pages/systemSettings/views/NetSettings.vue
@@ -57,9 +57,9 @@
 
             <div class="more-detail">
               <span class="icon iconfont">&#xe676;</span>
-              <span 
+              <span
                 class="icon iconfont"
-                style="margin-left:10px;cursor:pointer;"
+                style="margin-left: 10px; cursor: pointer"
                 @click="checkWifi(item)"
                 >&#xe640;</span
               >
@@ -233,12 +233,15 @@
               <span class="icon iconfont">&#xe676;</span>
 
               <el-switch
-                v-model="value"
+                v-model="item.active"
                 active-color="rgba(61, 104, 225, 1)"
-                @change="switchChange"
+                @change="switchNetCard"
               >
               </el-switch>
             </div>
+
+
+            
           </div>
         </div>
         <div
@@ -389,6 +392,7 @@
         },
       ],
       value: "",
+      netCardValue: "",
     };
   },
   components: {
@@ -403,6 +407,13 @@
   beforeDestroy() {},
   props: ["barName"],
   methods: {
+    // parseFlags(flags) {
+    //   let arr = flags.split("|");
+    //   if (arr.length) {
+    //     return arr[0] == "up";
+    //   }
+    //   return false;
+    // },
     getCurServer() {
       getDevInfo().then((res) => {
         this.ruleForm.deviceName = res.data.server_name;
@@ -412,16 +423,32 @@
     fetchWireList() {
       getWireList().then((res) => {
         if (res && res.success) {
-          this.wireArr = res.data;
+          this.wireArr = res.data
+            .filter((x) => x.wireless == false)
+            .map((itm) => {
+              let arr = itm.flags.split("|");
+              let f = false;
+              if (arr.length) {
+                f = arr[0] == "up";
+              }
+              return {
+                flags: itm.flags,
+                index: itm.index,
+                mtu:itm.mtu,
+                name: itm.name,
+                wireless: itm.wireless,
+                active:f
+              }
+            });
         }
       });
     },
     cancelSaveWire() {
       this.inWireDetail = false;
-      this.wireForm.ip = '';
-          this.wireForm.gateway = '';
-          this.wireForm.dns = '';
-          this.wireForm.subMask = '';
+      this.wireForm.ip = "";
+      this.wireForm.gateway = "";
+      this.wireForm.dns = "";
+      this.wireForm.subMask = "";
     },
     saveServerName() {
       setServerName({
@@ -475,16 +502,19 @@
       this.activeWireItem = item;
       getNetWorkCardInfo({
         ifname: item.name,
-      }).then((res) => {
-        if (res && res.success) {
-          this.wireForm.ip = res.data.ip;
-          this.wireForm.gateway = res.data.gateway;
-          this.wireForm.dns = res.data.dns;
-          this.wireForm.subMask = res.data.subMask;
+      }).then(
+        (res) => {
+          if (res && res.success) {
+            this.wireForm.ip = res.data.ip;
+            this.wireForm.gateway = res.data.gateway;
+            this.wireForm.dns = res.data.dns;
+            this.wireForm.subMask = res.data.subMask;
+          }
+        },
+        (err) => {
+          this.$message.error("鏌ユ壘涓嶅埌鏁版嵁: " + err.msg);
         }
-      },(err) => {
-        this.$message.error("鏌ユ壘涓嶅埌鏁版嵁: "+err.msg)
-      });
+      );
     },
   },
 };

--
Gitblit v1.8.0