From 9229eb2151660ba7e59879f3b9ac2b14d72a9530 Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期一, 28 六月 2021 18:49:01 +0800
Subject: [PATCH] 应用中心图标修改

---
 src/pages/systemSettings/views/NetSettings.vue |  185 +++++++++++++++++++++++++++-------------------
 1 files changed, 108 insertions(+), 77 deletions(-)

diff --git a/src/pages/systemSettings/views/NetSettings.vue b/src/pages/systemSettings/views/NetSettings.vue
index c82ce15..600cf6e 100644
--- a/src/pages/systemSettings/views/NetSettings.vue
+++ b/src/pages/systemSettings/views/NetSettings.vue
@@ -2,21 +2,19 @@
   <div class="all">
     <div class="cluster-content">
       <div class="cluster-center" ref="left">
-        <div class="menu-item" @click="openRight('net')">
-          <div><span class="icon iconfont">&#xe646;</span>缃戠粶璁剧疆</div>
-          <div class="status">宸茶繛鎺�</div>
-        </div>
-        <div class="menu-item" @click="openRight('wifi')">
-          <div><span class="icon iconfont">&#xe646;</span>鏃犵嚎缃戠粶</div>
-          <div class="status">宸茶繛鎺�</div>
-        </div>
-        <div class="menu-item" @click="openRight('wire')">
-          <div><span class="icon iconfont">&#xe646;</span>鏈夌嚎缃戠粶</div>
+        <div
+          class="menu-item"
+          v-for="(item, i) in tabList"
+          :key="i"
+          @click="openRight(item, i)"
+          ref="leftbar"
+        >
+          <div><span class="icon iconfont">&#xe646;</span>{{ item.name }}</div>
           <div class="status">宸茶繛鎺�</div>
         </div>
       </div>
       <div class="cluster-right">
-        <div class="net-set" v-if="activePage == 'net'">
+        <div class="net-set" v-if="activePage == '缃戠粶璁剧疆'">
           <div class="title">缃戠粶璁剧疆</div>
           <el-form
             :model="ruleForm"
@@ -24,7 +22,6 @@
             ref="joinForm"
             class="join-form"
             label-width="150px"
-            v-loading="joinLoading"
           >
             <el-form-item label="璁惧鍚嶇О" prop="deviceName">
               <el-input
@@ -41,11 +38,11 @@
                 size="small"
               ></el-input>
             </el-form-item>
-            <div class="save-btn" @click="saveServerName">淇濆瓨</div>
           </el-form>
+          <div class="save-btn" @click="saveServerName">淇濆瓨</div>
         </div>
 
-        <div class="wifi" v-if="activePage == 'wifi' && !inWifiDetail">
+        <div class="wifi" v-if="activePage == '鏃犵嚎缃戠粶' && !inWifiDetail">
           <switchBar
             :barName="`鏃犵嚎缃戝崱`"
             @switchChange="wifiControl"
@@ -60,16 +57,19 @@
 
             <div class="more-detail">
               <span class="icon iconfont">&#xe676;</span>
-              <span
+              <span 
                 class="icon iconfont"
-                style="margin-left: 10px"
+                style="margin-left:10px;cursor:pointer;"
                 @click="checkWifi(item)"
                 >&#xe640;</span
               >
             </div>
           </div>
         </div>
-        <div class="wifi-detail" v-if="activePage == 'wifi' && inWifiDetail">
+        <div
+          class="wifi-detail"
+          v-if="activePage == '鏃犵嚎缃戠粶' && inWifiDetail"
+        >
           <div class="btns">
             <div class="left">鍒犻櫎</div>
             <div class="right">鏂紑杩炴帴</div>
@@ -84,7 +84,6 @@
             class="join-form"
             label-width="150px"
           >
-            <!-- v-loading="joinLoading" -->
             <el-form-item label="鍚嶇О" prop="name">
               <div class="wifi-name">{{ 12123 }}</div>
             </el-form-item>
@@ -105,23 +104,6 @@
             :value="isHighClass"
           ></switchBar>
           <div class="title">IPV4</div>
-
-          <!-- <el-form
-            :model="ipv4Form"
-            :rules="ipv4FormRules"
-            ref="ipv4Form"
-            class="join-form"
-            label-width="150px"
-          >
-            <el-form-item label="瀵嗙爜" prop="password">
-              <el-input
-                v-model="wifiForm.password"
-                placeholder="璇疯緭鍏ュ瘑鐮�"
-                size="small"
-                show-password
-              ></el-input>
-            </el-form-item>
-          </el-form> -->
 
           <el-form
             :model="ipv4Form"
@@ -233,14 +215,13 @@
           </el-form>
 
           <div class="btns">
-            <div class="left">鍙栨秷</div>
+            <div class="left" @click="inWifiDetail = false">鍙栨秷</div>
             <div class="right">淇濆瓨</div>
           </div>
         </div>
 
-        <div class="wire" v-if="activePage == 'wire' && !inWireDetail">
+        <div class="wire" v-if="activePage == '鏈夌嚎缃戠粶' && !inWireDetail">
           <div
-            
             class="wire-bar"
             v-for="(item, i) in wireArr"
             :key="i"
@@ -260,7 +241,10 @@
             </div>
           </div>
         </div>
-        <div class="wire-detail" v-if="activePage == 'wire' && inWireDetail">
+        <div
+          class="wire-detail"
+          v-if="activePage == '鏈夌嚎缃戠粶' && inWireDetail"
+        >
           <div class="title">缃戠粶璁剧疆</div>
           <el-form
             :model="wireForm"
@@ -269,7 +253,7 @@
             label-width="150px"
           >
             <el-form-item label="缃戠粶鍚嶇О" prop="name">
-              <div class="wifi-name">{{"缃戠粶" + activeWireItem.index }}</div>
+              <div class="wifi-name">{{ "缃戠粶" + activeWireItem.index }}</div>
             </el-form-item>
             <el-form-item label="缃戝崱" prop="ifname">
               <div class="wifi-name">{{ activeWireItem.name }}</div>
@@ -328,7 +312,13 @@
   addESNode,
   getEsClusterInfo,
 } from "@/api/clusterManage";
-import { setServerName, getWireList, setNetWorkCard,getNetWorkCardInfo } from "@/api/system";
+import {
+  setServerName,
+  getWireList,
+  setNetWorkCard,
+  getNetWorkCardInfo,
+  getDevInfo,
+} from "@/api/system";
 
 import cloudNode from "../components/CloudNode";
 import ipInput from "@/components/subComponents/IPInput";
@@ -366,13 +356,13 @@
       isOpenWifi: false,
       inWireDetail: false,
       wireForm: {
-        dns:"",
-        subMask:"",
-        gateway:"",
-        ip:"",
+        dns: "",
+        subMask: "",
+        gateway: "",
+        ip: "",
       },
       wireFormRules: {},
-      activePage: "net",
+      activePage: "缃戠粶璁剧疆",
       activeWireItem: {},
       rules: {
         deviceName: [
@@ -382,6 +372,11 @@
       ipv4Form: {},
       ipv6Form: {},
       ipv4FormRules: {},
+      tabList: [
+        { name: "缃戠粶璁剧疆" },
+        { name: "鏃犵嚎缃戠粶" },
+        { name: "鏈夌嚎缃戠粶" },
+      ],
       ipv6FormRules: {},
       options: [
         {
@@ -401,20 +396,32 @@
     ipInput,
     switchBar,
   },
-  mounted() {},
+  mounted() {
+    this.getCurServer();
+    this.fetchWireList();
+  },
   beforeDestroy() {},
   props: ["barName"],
   methods: {
+    getCurServer() {
+      getDevInfo().then((res) => {
+        this.ruleForm.deviceName = res.data.server_name;
+        this.ruleForm.port = res.data.server_port;
+      });
+    },
     fetchWireList() {
       getWireList().then((res) => {
         if (res && res.success) {
-          console.log(res);
           this.wireArr = res.data;
         }
       });
     },
     cancelSaveWire() {
       this.inWireDetail = false;
+      this.wireForm.ip = '';
+          this.wireForm.gateway = '';
+          this.wireForm.dns = '';
+          this.wireForm.subMask = '';
     },
     saveServerName() {
       setServerName({
@@ -427,28 +434,37 @@
         }
       });
     },
-    openRight(typ) {
-      this.activePage = typ;
-      if (typ == "wire") {
-        this.fetchWireList();
+    openRight(item, i) {
+      this.activePage = item.name;
+      if (i == 1) {
+        this.inWifiDetail = false;
       }
+      this.$refs["leftbar"].forEach((x) => {
+        x.style.backgroundColor = "rgba(248, 248, 248, 1)";
+        x.style.color = "#333";
+      });
+      this.$refs["leftbar"][i].style.backgroundColor = "rgb(61, 104, 225)";
+      this.$refs["leftbar"][i].style.color = "white";
     },
     saveWire(ifname) {
-      debugger
-      let data ={
+      debugger;
+      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)
+      };
+      setNetWorkCard(data).then(
+        (res) => {
+          if (res && res.success) {
+            this.$message.success(res.data);
+          }
+        },
+        (err) => {
+          this.$message.error("淇濆瓨澶辫触锛�" + err.msg);
         }
-      },(err) => {
-        this.$message.error("淇濆瓨澶辫触锛�"+ err.msg)
-      });
+      );
     },
     wifiControl(val) {},
     checkWifi() {
@@ -458,16 +474,17 @@
       this.inWireDetail = true;
       this.activeWireItem = item;
       getNetWorkCardInfo({
-        ifname:item.name
+        ifname: item.name,
       }).then((res) => {
-        if (res&&res.success) {
-          debugger
-          this.wireForm.ip = res.data.ip
-          this.wireForm.gateway = res.data.gateway
-          this.wireForm.dns = res.data.dns
-          this.wireForm.subMask = res.data.subMask
+        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)
+      });
     },
   },
 };
@@ -497,7 +514,21 @@
     }
   }
 }
-
+.net-set {
+  .title {
+    font-size: 16px;
+    margin-bottom: 12px;
+  }
+  .el-input--small .el-input__inner {
+    height: 35px;
+    line-height: 35px;
+    background-color: rgba(240, 240, 240, 1);
+    border: none;
+  }
+  .el-input__inner::placeholder {
+    color: rgba(134, 134, 134, 1);
+  }
+}
 .cluster-content {
   height: 100%;
   display: flex;
@@ -514,7 +545,6 @@
     padding: 10px;
     border-right: 5px solid #f8f8f8;
 
-    // background-color: lavender;
     .menu-item {
       background-color: #f8f8f8;
       height: 40px;
@@ -549,9 +579,9 @@
     }
     .el-form-item {
       margin-bottom: 10px;
-      height: 50px;
+      height: 54px;
+      padding: 6px 20px;
       background: #f8f8f8;
-      padding: 4px 20px;
       -webkit-box-sizing: border-box;
       box-sizing: border-box;
       border-radius: 10px;
@@ -563,7 +593,7 @@
     .el-form-item__content {
       line-height: 40px;
       position: relative;
-      font-size: 14px;
+      font-size: 15px;
     }
     .ip-input-container {
       max-width: none !important;
@@ -620,12 +650,13 @@
     .wire {
       .wire-bar {
         height: 50px;
-        background-color: aliceblue;
+        background-color: #f8f8f8;
         display: flex;
         justify-content: space-between;
+        align-items: center;
         box-sizing: border-box;
         padding: 0 20px;
-        align-items: center;
+        margin-bottom: 10px;
       }
       .wifi-name {
         height: 40px;
@@ -644,7 +675,7 @@
       color: #fff;
       line-height: 40px;
       font-size: 14px;
-      margin-top: 20px;
+      margin-top: 30px;
     }
   }
 }

--
Gitblit v1.8.0