qinnamin 3 år sedan
förälder
incheckning
61b442acfc

+ 29 - 6
src/App.vue

@@ -1,12 +1,35 @@
 <template>
-  <div id="app">
-    <router-view/>
+  <div id="app" class="main">
+    <router-view />
   </div>
 </template>
 
-
 <script>
-</script>
-<style>
+export default {
+  created() {
+    //在页面加载时读取sessionStorage里的状态信息
+    if (sessionStorage.getItem("store")) {
+      this.$store.replaceState(
+        Object.assign(
+          {},
+          this.$store.state,
+          JSON.parse(sessionStorage.getItem("store"))
+        )
+      );
+    }
 
-</style>
+    //在页面刷新时将vuex里的信息保存到sessionStorage里
+    window.addEventListener("beforeunload", () => {
+      sessionStorage.setItem("store", JSON.stringify(this.$store.state));
+    });
+  },
+};
+</script>
+<style scoped>
+.main {
+  background-color: #eceef3;
+  background: url("./assets/wave.svg") no-repeat;
+  /* background-size: contain; */
+  background-position: left bottom;
+}
+</style>

BIN
src/assets/avatar.png


+ 75 - 37
src/assets/css/global.css

@@ -3,59 +3,60 @@
 html,
 body,
 #app {
-    height: 100%;
-    margin: 0px;
-    padding: 0px;
-    min-width: 1366px;
+  height: 100%;
+  margin: 0px;
+  padding: 0px;
+  min-width: 1366px;
+
 }
 
 .el-breadcrumb {
-    padding: 15px 0 15px 10px;
-    font-size: 13px;
+  padding: 15px 0 15px 10px;
+  font-size: 13px;
 }
 
 .el-card {
-    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15) !important;
+  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15) !important;
 }
 
 .el-footer {
-    background-color: #444C5B;
-    display: flex;
-    justify-content: space-around;
-    align-items: center;
-    font-size: 12px;
-    color: #ffffff;
+  background-color: #444c5b;
+  display: flex;
+  justify-content: space-around;
+  align-items: center;
+  font-size: 12px;
+  color: #ffffff;
 }
 
 .el-form {
-    margin-top: 12px;
+  margin-top: 12px;
 }
 
 .divi {
-    display: block;
-    height: 1px;
-    width: 100%;
-    margin: 24px 0;
-    background-color: #dcdfe6;
-    position: relative;
+  display: block;
+  height: 1px;
+  width: 100%;
+  margin: 24px 0;
+  background-color: #dcdfe6;
+  position: relative;
 }
 
 .centered {
-    margin: 0 auto;
+  margin: 0 auto;
 }
 
 .coalblock {
-    width: 115px;
-    height: 77px;
-    border: solid 1px #dcdfe6;
-    padding-top: 20px;
-    margin-left: 25px;
-    text-align: center;
-    display: inline-block;
+  width: 115px;
+  height: 77px;
+  border: solid 1px #dcdfe6;
+  padding-top: 20px;
+  margin-left: 25px;
+  text-align: center;
+  display: inline-block;
 }
 
 .el-select {
-    margin-bottom: 10px;
+  margin-bottom: 10px;
 }
 
 .com-container {
@@ -69,11 +70,48 @@ body,
   height: 100%;
   overflow: hidden;
 }
-/* .table-wrapper ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
-    width: 6px;
-    height: 6px;
-  } */
-  .el-tabs__nav-scroll {
-    overflow: hidden;
-    background-color: aliceblue;
-}
+
+.el-tabs__item {
+  width: 166px;
+  height: 47px;
+  line-height: 47px;
+  text-align: center;
+  font-size: 16px;
+  font-weight: bold;
+}
+
+.el-tabs__nav-scroll {
+  background-color: #696969;
+  /* color: #eceef3; */
+  /* background-color: rgba(255, 255, 255, 100); */
+}
+
+.el-tabs--card > .el-tabs__header .el-tabs__nav {
+  border: none;
+}
+.el-tabs__item {
+  /* color: #4adefe; */
+  color:#FFFFFF;
+}
+
+.el-tabs__header {
+    padding: 0;
+    position: relative;
+    margin: 0;
+}
+.el-tabs--card>.el-tabs__header .el-tabs__item {
+  border-left: 0px;
+}
+.el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
+  /* border-bottom-color: #FFF; */
+  border-bottom-color: #696969;
+}
+
+.el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
+  /* background-color: rgba(255, 255, 255, 100); */
+  background-color: #696969;
+  border-bottom-color: none;
+  /* color: rgba(97, 154, 241, 100); */
+  
+  /* color: #FDD000; */
+}

+ 1 - 0
src/assets/wave.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="#1a1a1a" fill-opacity="0.8" d="M0,32L34.3,69.3C68.6,107,137,181,206,192C274.3,203,343,149,411,117.3C480,85,549,75,617,80C685.7,85,754,107,823,138.7C891.4,171,960,213,1029,229.3C1097.1,245,1166,235,1234,202.7C1302.9,171,1371,117,1406,90.7L1440,64L1440,320L1405.7,320C1371.4,320,1303,320,1234,320C1165.7,320,1097,320,1029,320C960,320,891,320,823,320C754.3,320,686,320,617,320C548.6,320,480,320,411,320C342.9,320,274,320,206,320C137.1,320,69,320,34,320L0,320Z"></path></svg>

+ 57 - 3
src/common/headline.vue

@@ -1,19 +1,73 @@
 <template>
   <div class="title">
-    {{title}}
+    {{ title }}
+    <div class="right">
+      <el-dropdown>
+        <span class="el-dropdown-link">
+          <img src="~@/assets/avatar.png" :alt="userName" /><span class="center">{{ userName }}</span>
+        </span>
+        <template #dropdown>
+          <el-dropdown-menu>
+            <el-dropdown-item @click="handleChange('logout')">大数据平台</el-dropdown-item>
+            <el-dropdown-item @click="handleChange('logout')">算法平台</el-dropdown-item>
+            <el-dropdown-item @click="handleChange('logout')">云平台</el-dropdown-item>
+            <el-dropdown-item @click="handleChange('logout')">退出</el-dropdown-item>
+          </el-dropdown-menu>
+        </template>
+      </el-dropdown>
+    </div>
   </div>
 </template>
 
 <script>
 export default {
-  props: ["title"]
+  name:'headline',
+  methods: {
+    handleChange(val) {
+      switch (val) {
+        case "logout":
+          window.location.href = "http://112.126.68.148/#/";
+          break;
+      }
+    }
+  },
+  computed: {
+    userName: {
+      get() {
+        if(this.$store.state.name == "" | this.$store.state.name == undefined | this.$store.state.name == null) {
+          this.$store.commit("updateName", "admin");
+        }
+        return this.$store.state.name;
+      }
+    },
+    title() {
+      return this.$store.state.title;
+    }
+  }
 };
 </script>
 
 <style scoped>
 .title {
-  color: #4adefe;
+  /* color: #4adefe; */
+  color: black;
   text-align: center;
   font-size: 30px;
+  background-color: #eceef3;
+  /* border-bottom:1px solid #000; */
+}
+.right {
+  float: right;
+}
+img {
+  height: 40px;
+  margin-top: -20px;
+  border-radius: 50%;
+}
+.center {
+  font-size: 20px;
+  font-weight:bold;
+  position: relative;
+  bottom: 5px;
 }
 </style>

+ 8 - 1
src/store/index.js

@@ -6,10 +6,17 @@ Vue.use(Vuex)
 export default new Vuex.Store({
   state: {
     websocketIP: "182.92.79.148:8081",
+    name: "",
+    title: "主界面",
 
   },
   mutations: {
-
+    updateName (state, name) {
+      state.name = name
+    },
+    updateTitle (state, title) {
+      state.title = title
+    }
   },
   actions: {
 

+ 13 - 5
src/views/Home.vue

@@ -27,6 +27,7 @@
         </div>
         <el-menu
           class="el-menu-vertical-demo"
+          style="margin-left: -2px"
           :default-active="$route.path"
           @select="handleSelect"
         >
@@ -71,6 +72,9 @@
         </el-menu>
       </el-col>
       <el-col :span="20">
+        <el-row style="margin-top: 0px">
+          <headline></headline>
+        </el-row>
         <!-- 展示   -->
         <router-view></router-view>
       </el-col>
@@ -139,13 +143,13 @@
             </el-menu-item>
           </template>
         </el-menu>
-        <div class="logout" @click="loginOut">退出</div>
       </el-col>
     </el-row>
   </div>
 </template>
 
 <script>
+import headline from "@/common/headline";
 export default {
   name: "Home",
   data() {
@@ -191,9 +195,10 @@ export default {
       this.$router.push({
         path: key,
       });
+      this.$store.commit("updateTitle", this.findTitleName(key).name);
     },
-    loginOut() {
-      window.location.href = "http://112.126.68.148/#/";
+    findTitleName(key){
+      return this.menu_left.find(item => item.path == key) ? this.menu_left.find(item => item.path == key) : this.menu_right.find(item => item.path == key);
     },
   },
   computed: {
@@ -209,6 +214,9 @@ export default {
       );
     },
   },
+  components: {
+    headline
+  }
 };
 </script>
 
@@ -219,7 +227,7 @@ export default {
 .el-menu-vertical-demo {
   width: 1px;
 }
-.logout {
+/* .logout {
   background-color: #c0c0c0;
   width: 120px;
   height: 33px;
@@ -229,7 +237,7 @@ export default {
   text-align: center;
   margin-left: 20px;
   margin-top: 20px;
-}
+} */
 /* .toggle-button {
         font-size: 10px;
         line-height: 24px;

+ 4 - 4
src/views/drain/configImg/tableData.vue

@@ -22,19 +22,19 @@
     </ul>
     <ul class="bottom1">
       <li>
-        {{ id }}号正压:<span>{{ tableData.positivePressure }}</span>
+        {{ id }}号正压:<span>{{ tableData.positivePressure }}MPa</span>
       </li>
       <li>
-        {{ id }}号负压:<span>{{ tableData.negativePressure }}</span>
+        {{ id }}号负压:<span>{{ tableData.negativePressure }}MPa</span>
       </li>
     </ul>
     <ul class="bottom2">
       <li>
-        {{ id }}号电压:<span>{{ tableData.positivePressure }}</span
+        {{ id }}号电压:<span>{{ tableData.positivePressure }}V</span
         >{{ id }}号前轴温度:<span>{{ tableData.frontAxleTemp }}℃</span>
       </li>
       <li>
-        {{ id }}号电流:<span>{{ tableData.negativePressure }}</span
+        {{ id }}号电流:<span>{{ tableData.negativePressure }}A</span
         >{{ id }}号后轴温度:<span>{{ tableData.rearAxleTemp }}℃</span>
       </li>
     </ul>

+ 2 - 1
src/views/main.vue

@@ -33,4 +33,5 @@ export default {
 };
 </script>
 
-<style scoped></style>
+<style scoped>
+</style>

+ 1 - 13
src/views/mining/Monitor/Index.vue

@@ -1,8 +1,5 @@
 <template>
   <div class="monitor">
-    <el-row style="margin-top: 0px">
-      <headline title="采煤工作面系统图"></headline>
-    </el-row>
     <el-row :gutter="20">
       <el-col :span="14">
         <div class="grid-content bg-purple">
@@ -46,7 +43,6 @@ import processStatistics from "../../../components/mining/monitor/process_statis
 import safetyStatistics from "../../../components/mining/monitor/safety_statistics";
 import CoalMining from "./CoalMining.vue";
 import bar from "./echarts/Bars.vue";
-import headline from "@/common/headline";
 export default {
   /**
    * Components 包含子组件
@@ -56,7 +52,6 @@ export default {
    * @prop {Component} errorRecording 故障记录
    * @prop {Component} processStatistics 生产统计
    * @prop {Component} safetyStatistics 安全统计
-   * @prop {Component} headline 标题组件
    */
   components: {
     Emulsion,
@@ -65,7 +60,6 @@ export default {
     errorRecording,
     processStatistics,
     safetyStatistics,
-    headline,
   },
   data() {
     return {};
@@ -76,7 +70,7 @@ export default {
 <style scoped>
 .monitor {
   width: 100%;
-  height: 900px;
+  height: 845px;
   position: relative;
   background: linear-gradient(to bottom, #323232 0%, #3f3f3f 40%, #1c1c1c 150%),
     linear-gradient(
@@ -85,11 +79,5 @@ export default {
       rgba(0, 0, 0, 0.25) 200%
     );
   background-blend-mode: multiply;
-  /* background-image: linear-gradient(
-    to right,
-    #06133c 0%,
-    #011669 50%,
-    #06133c 100%
-  ); */
 }
 </style>

+ 10 - 13
src/views/mining/envTest/index.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="main">
-    <div class="header"><headline title="采煤工作面环境监测"></headline></div>
     <div class="left">
       <div class="center">
         <span class="title">工作面信息</span>
@@ -246,21 +245,19 @@ export default {
 <style lang="less" scoped>
 .main {
   width: 100%;
-  height: 900px;
+  height: 845px;
   position: relative;
   display: flex;
-  background-image: linear-gradient(
-    to right,
-    #06133c 0%,
-    #011669 5045 #06133c 100%
-  );
-}
-.header {
-  position: absolute;
-  left: 600px;
+  background: linear-gradient(to bottom, #323232 0%, #3f3f3f 40%, #1c1c1c 150%),
+    linear-gradient(
+      to top,
+      rgba(255, 255, 255, 0.4) 0%,
+      rgba(0, 0, 0, 0.25) 200%
+    );
+  background-blend-mode: multiply;
 }
 .left {
-  margin-top: 50px;
+  margin-top: 5px;
   width: 30%;
   height: 100%;
 }
@@ -322,7 +319,7 @@ export default {
   }
 }
 .right {
-  margin-top: 50px;
+  margin-top: 5px;
   height: 100%;
   width: 70%;
   span {

+ 8 - 10
src/views/mining/machines/index.vue

@@ -1,8 +1,5 @@
 <template>
   <div id="outer">
-    <div class="title">
-      <p style="color: #4adefe">三机监控</p>
-    </div>
     <img style="width: 1300px; margin-left: 100px" src="./顶部.png" />
     <div style="height: 50px"></div>
     <div class="row">
@@ -273,13 +270,14 @@ export default {
 <style lang="less" scoped>
 #outer {
   width: 100%;
-  height: 900px;
-  background-image: linear-gradient(
-    to right,
-    rgb(6, 19, 60) 0%,
-    rgb(1, 22, 105) 50%,
-    rgb(6, 19, 60) 100%
-  );
+  height: 845px;
+  background: linear-gradient(to bottom, #323232 0%, #3f3f3f 40%, #1c1c1c 150%),
+    linear-gradient(
+      to top,
+      rgba(255, 255, 255, 0.4) 0%,
+      rgba(0, 0, 0, 0.25) 200%
+    );
+  background-blend-mode: multiply;
   position: relative;
   .title {
     position: relative;

+ 8 - 8
src/views/mining/supporting/supporting.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="wrapper">
-    <div><headline title="采煤工作面支护系统"></headline></div>
    <img class="leftImg" src="@/assets/img/supportRight.png" alt="">
    <img class="rightImg" src="@/assets/img/supportLeft.png" alt="">
    <!-- <div class="leftImg"></div> -->
@@ -141,14 +140,15 @@ export default {
 <style scoped>
 .wrapper {
   width: 100%;
-  height: 900px;
+  height: 845px;
   position: relative;
-  background-image: linear-gradient(
-    to right,
-    #06133c 0%,
-    #011669 50%,
-    #06133c 100%
-  );
+  background: linear-gradient(to bottom, #323232 0%, #3f3f3f 40%, #1c1c1c 150%),
+    linear-gradient(
+      to top,
+      rgba(255, 255, 255, 0.4) 0%,
+      rgba(0, 0, 0, 0.25) 200%
+    );
+  background-blend-mode: multiply;
 }
 
 .leftImg{