Bläddra i källkod

修复以前的bug

lusa 3 år sedan
förälder
incheckning
9b3c65d7d2
3 ändrade filer med 41 tillägg och 34 borttagningar
  1. 3 3
      src/components/menu.vue
  2. 6 0
      src/store/index.js
  3. 32 31
      src/views/dashbord.vue

+ 3 - 3
src/components/menu.vue

@@ -20,7 +20,7 @@
                     </submenu>
                 </template>
             </template>
-            <div class="current-baled">当前模块:{{currentIndex}}</div>
+            <div class="current-baled">当前模块:{{currName}}</div>
         </Menu>
 
 
@@ -83,8 +83,8 @@
             }
         },
         computed:{
-            currentIndex(){
-                return this.$store.state.currentIndex
+            currName(){
+                return this.$store.state.currName
             }
         },
         watch: {

+ 6 - 0
src/store/index.js

@@ -8,6 +8,7 @@ Vue.use(Vuex);
 const store = new Vuex.Store({
     state: {
         // 状态
+        currName:  sessionStorage.getItem('currName'),
         currentIndex: sessionStorage.getItem('currentIndex')
     },
     mutations: {
@@ -15,6 +16,11 @@ const store = new Vuex.Store({
         setIndex(state, index){
             sessionStorage.setItem('currentIndex', index)
             state.currentIndex = index
+        },
+        // 改变方法
+        currName(state, currName){
+            sessionStorage.setItem('currName', currName)
+            state.currentIndex = currName
         }
     },
     actions: {

+ 32 - 31
src/views/dashbord.vue

@@ -35,36 +35,7 @@
 						</div>
 					</div>
 					</Col>
-                    <Col span="24">
-                        <div class="dashboard_item">
-                            <div class="dashboard_item_title">
-                                BMC设备信息
-                            </div>
-                            <div class='info_detail'>
-                                <Row class='margin_btm'>
-                                    <Col span="8">固件版本:</Col>
-                                    <Col span="14">{{deviceInfo.fwVersion}}</Col>
-                                </Row>
-                                <Row class='margin_btm'>
-                                    <Col span="8">固件编译时间:</Col>
-                                    <Col span="14">{{deviceInfo.buildTime}}</Col>
-                                </Row>
-                                <Row class='margin_btm'>
-                                    <Col span="8">MAC地址:</Col>
-                                    <Col span="14">{{deviceInfo.macAddr}}</Col>
-                                </Row>
-                                <Row class='margin_btm'>
-                                    <Col span="8">V4网络模式:</Col>
-                                    <Col span="14">{{deviceInfo.netMode}}</Col>
-                                </Row>
-                                <Row class='margin_btm'>
-                                    <Col span="8">IPv4地址:</Col>
-                                    <Col span="14">{{deviceInfo.ipAddr}}</Col>
-                                </Row>
 
-                            </div>
-                        </div>
-                    </Col>
 
 				</Row>
 			</div>
@@ -129,7 +100,36 @@
 
                             </div>
                         </div>
-
+                        <Col span="24">
+                            <div class="dashboard_SensorBox" style="margin-top: 20px">
+                                <div class="dashboard_item_title">
+                                    BMC设备信息
+                                </div>
+                                <div class='info_detail'>
+                                    <Row class='margin_btm'>
+                                        <Col span="8">固件版本:</Col>
+                                        <Col span="14">{{deviceInfo.fwVersion}}</Col>
+                                    </Row>
+                                    <Row class='margin_btm'>
+                                        <Col span="8">固件编译时间:</Col>
+                                        <Col span="14">{{deviceInfo.buildTime}}</Col>
+                                    </Row>
+                                    <Row class='margin_btm'>
+                                        <Col span="8">MAC地址:</Col>
+                                        <Col span="14">{{deviceInfo.macAddr}}</Col>
+                                    </Row>
+                                    <Row class='margin_btm'>
+                                        <Col span="8">V4网络模式:</Col>
+                                        <Col span="14">{{deviceInfo.netMode}}</Col>
+                                    </Row>
+                                    <Row class='margin_btm'>
+                                        <Col span="8">IPv4地址:</Col>
+                                        <Col span="14">{{deviceInfo.ipAddr}}</Col>
+                                    </Row>
+
+                                </div>
+                            </div>
+                        </Col>
 
 					</Col>
 				</Row>
@@ -267,6 +267,7 @@ export default {
                         if(res.data[i].isChMC == 1) {
                             this.currentIndex = i
                             this.$store.commit('setIndex', i)
+                            this.$store.commit('currName', res.data[i].name)
                         }
                     }
                     t.serverList = res.data
@@ -552,7 +553,7 @@ export default {
 	}
 
 	.model-contect {
-
+        padding-bottom: 20px;
 		margin-top: 0 !important;
 		padding-top: 8px;
 		/*padding: 8px 20px 0 20px;*/