Procházet zdrojové kódy

5-29 登录 刷新丢失数据问题

zhaomiao před 3 roky
rodič
revize
5e7e4c69df

+ 14 - 0
src/assets/css/base.scss

@@ -356,5 +356,19 @@ body,
 
 
 /***ElUI - 公共调整 - 开始***/
+.table_sty{
+  
+  th{
+    padding: 0 !important;
+    height: 30px;
+    line-height: 30px;
+  }
+  td{
+    padding: 0 !important;
+    font-size: 13px !important;
+    height: 30px;
+    line-height: 30px;
+  }
+}
 
 /***ElUI - 公共调整 - 结束***/

+ 1 - 1
src/assets/css/login.scss

@@ -2,7 +2,7 @@ $bg:#fff;
 $dark_gray:#889aa4;
 $light_gray:#eee;
 .bg{
-  background:url("/static/img/login.jpg") center center no-repeat;
+  background:url("~@/assets/images/login.jpg") center center no-repeat;
   background-size:100% 100%;
   height: 100%;
   width:100%;

+ 2 - 1
src/assets/js/login.js

@@ -30,7 +30,8 @@ export default {
           message: '登陆成功',
           type: 'success'
         });
-         this.$router.replace('/'); // 跳转到首页
+        
+         this.$router.push('/'); // 跳转到首页
 			} else {
         this.$message.error('登录失败');// ui弹窗提示
 			}

+ 0 - 21
src/jsonData/menu.json

@@ -6,27 +6,6 @@
       "children": []
     },
     {
-      "name": "后台管理",
-      "url": null,
-      "children": [
-        {
-          "name": "菜单",
-          "url": "/a",
-          "children": []
-        },
-        {
-          "name": "角色",
-          "url": "/a",
-          "children": []
-        },
-        {
-          "name": "权限",
-          "url": "/a",
-          "children": []
-        }
-      ]
-    },
-    {
       "name": "实时监控",
       "url": null,
       "children": [

+ 9 - 37
src/layout/aside.vue

@@ -14,45 +14,17 @@
     text-color="#fff"
   >
   <div>
-    <el-menu-item index="0" @click="open">
+    <el-menu-item index="0" >
       <i class="el-icon-s-operation"></i>
     </el-menu-item>
 
-    <el-submenu index="1">
-      <template slot="title">
-        <i class="el-icon-location"></i>
-
-        <span slot="title">导航一</span>
-      </template>
-
-      <el-menu-item index="1-1-1">选项1-1</el-menu-item>
-
-      <el-menu-item index="1-2-1">选项2-1</el-menu-item>
-
-      <el-menu-item index="1-3-1">选项3-1</el-menu-item>
-    </el-submenu>
-
-    <el-submenu index="6" @click="open">
-      <template slot="title">
-        <i class="el-icon-location"></i>
-        <span slot="title">导航一</span>
-      </template>
-
-      <el-submenu index="1-1">
-        <span slot="title">选项1</span>
-        <el-menu-item index="1-1-1">选项1-1</el-menu-item>
-      </el-submenu>
-
-      <el-submenu index="1-2">
-        <span slot="title">选项2</span>
-        <el-menu-item index="1-2-1">选项2-1</el-menu-item>
-      </el-submenu>
+    <el-menu-item index="0" >
+      <i class="el-icon-s-operation"></i>
+    </el-menu-item>
 
-      <el-submenu index="1-3">
-        <span slot="title">选项3</span>
-        <el-menu-item index="1-3-1">选项3-1</el-menu-item>
-      </el-submenu>
-    </el-submenu>
+    <el-menu-item index="0" >
+      <i class="el-icon-s-operation"></i>
+    </el-menu-item>
     </div>
   </el-menu>
 </template>
@@ -76,8 +48,8 @@ export default {
       this.isCollapse = "kik"
     },
     open_o(){
-      this.changeZ("width:7%");
-      this.changeY("width:93%");
+      this.changeZ("width:3%");
+      this.changeY("width:97%");
       this.isCollapse = null
     },
     open() {

+ 8 - 5
src/layout/header.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="top">
     <div class="title">
-      <div class="logo">国电电力宁夏新能源集中监控系统</div>
+      <div class="logo">智能综合分析系统</div>
       <div class="title_y">
         <menuZj :menu="menu" :menuIndex="menuIndex"></menuZj>
         <span
@@ -13,7 +13,7 @@
             font-weight: bold;
             color:#fff;
           "
-          >{{ name }}</span
+          >{{this.username == ""?this.name:this.username}}</span
         >
         <headPortrait style="margin: 8px"></headPortrait>
       </div>
@@ -31,17 +31,19 @@ export default {
     return {
       menuIndex: "1", // 菜单默认选中项
       menu: [], // 菜单数据
-      name: localStorage.getItem("username"),
+      name:localStorage.getItem('username'),
     };
   },
-  created() {
-    this.name = localStorage.getItem("username")
+  created(){
   },
   components: {
     menuZj,
     headPortrait,
   },
   mounted() {
+    window.onload=function() {
+       this.name = localStorage.getItem('username');
+    },
     this.getMenu();
   },
   computed: {
@@ -49,6 +51,7 @@ export default {
     ...mapGetters(["username"]),
   },
   methods: {
+    ...mapMutations("user", ["SET_NAME"]),
     // 获取菜单
     getMenu() {
       //   this.API.requestData({

+ 2 - 2
src/store/modules/user.js

@@ -1,7 +1,7 @@
 // import {getToken,setToken,removeToken} from '@/utils/auth'
 import { Message } from 'element-ui';
 const state = {
-  authToken: localStorage.getItem('authToken') ? localStorage.getItem('authToken') : '', //设置token为共享状态   初始化vuex的时候 就先从缓存中读取
+  authToken: '', //
   username: '',
 }
 const mutations = {
@@ -26,7 +26,7 @@ const mutations = {
     localStorage.setItem('username', token_name.username);
   },
   SET_NAME: (state, name) => {
-    state.name = name
+    state.username = name;
   },
 }
 const actions = {

+ 8 - 10
src/views/benchmarkingSys/singleTransverseBenchmark.vue

@@ -3,7 +3,7 @@
     <el-main>
       <el-tabs
         type="border-card"
-        style="height: 100%; width: 99.8%"
+        style="height: 100%; width: 100%"
         v-model="activeName"
         @tab-click="handleClick"
       >
@@ -63,27 +63,27 @@
                     >查询</el-button
                   >
                 </el-form-item>
-                <el-form-item>
+                <!-- <el-form-item>
                   <el-button type="primary" :plain="true" @click="clear"
                     >清空</el-button
                   >
-                </el-form-item>
+                </el-form-item> -->
               </el-form>
             </el-card>
 
             <el-table
+              class="table_sty"
               :data="tableData"
               :row-style="{ height: '1px' }"
               border
               style="width: 100%"
             >
               <el-table-column label="单机日信息对比">
-                <el-table-column prop="name" label="项目" width="220">
+                <el-table-column prop="name" label="项目">
                 </el-table-column>
                 <el-table-column
                   prop="value1"
                   label=""
-                  width="330"
                   align="center"
                 >
                   <template slot-scope="scope">
@@ -98,7 +98,6 @@
                 <el-table-column
                   prop="value1"
                   label=""
-                  width="330"
                   align="center"
                 >
                   <template slot-scope="scope">
@@ -113,7 +112,6 @@
                 <el-table-column
                   prop="value1"
                   label=""
-                  width="330"
                   align="center"
                 >
                   <template slot-scope="scope">
@@ -128,7 +126,6 @@
                 <el-table-column
                   prop="value1"
                   label=""
-                  width="330"
                   align="center"
                 >
                   <template slot-scope="scope">
@@ -143,7 +140,6 @@
                 <el-table-column
                   prop="value1"
                   label=""
-                  width="330"
                   align="center"
                 >
                   <template slot-scope="scope">
@@ -227,6 +223,7 @@
             </el-card>
 
             <el-table
+            class="table_sty"
               :data="tableData_y"
               :row-style="{ height: '1px' }"
               border
@@ -382,12 +379,13 @@
             </el-card>
 
             <el-table
+              class="table_sty"
               :data="tableData_n"
               :row-style="{ height: '1px' }"
               border
               style="width: 100%"
             >
-              <el-table-column label="单机信息对比">
+              <el-table-column label="单机信息对比">
                 <el-table-column prop="name" label="项目" width="220">
                 </el-table-column>
                 <el-table-column

+ 6 - 6
src/views/headPortrait.vue

@@ -3,7 +3,7 @@
     <el-popover placement="bottom" width="200" trigger="click">
       <div class="border">
         <p id="character">已登录用户:</p>
-        <p id="character-yh">{{ name }}</p>
+        <p id="character-yh">{{ this.username == ""?this.name:this.username }}</p>
       </div>
       <el-divider></el-divider>
       <div class="btn">
@@ -28,17 +28,17 @@ import { mapGetters, mapMutations } from "vuex";
 export default {
   data() {
     return {
-      name: "",
+      name:localStorage.getItem('username')
     };
   },
   computed: {
     // 使用对象展开运算符将 getter 混入 computed 对象中
     ...mapGetters(["username"]),
   },
-  created() {
-    this.name = this.username
-      ? this.username
-      : localStorage.getItem("username");
+  mounted() {
+    window.onload=function() {
+       this.name = localStorage.getItem('username');
+    }
   },
   methods: {
     ...mapMutations("user", ["REMOVE_TOKEN"]),

+ 4 - 10
src/views/normRanking/grossgenerationRank.vue

@@ -71,7 +71,7 @@
       </el-card>
     </el-header>
 
-    <el-main>
+    <div style="weidth:100%">
       <el-card style=" height: 759px">
         <el-table
           v-loading="loading"
@@ -80,26 +80,24 @@
           style="width: 100%"
           :cell-style="{ textAlign: 'center' }"
           :header-cell-style="headStyle"
-          max-height="739px"
           @selection-change="changeFun"
         >
           >
           <el-table-column label="总发电量排行榜">
+            
             <el-table-column type="index" width="80"> </el-table-column>
             <el-table-column
               type="selection"
               class="selection"
               @selection-change="changeFun"
-              width="60"
             >
             </el-table-column>
-            <el-table-column sortable prop="windfarm" label="风场" width="310">
+            <el-table-column sortable prop="windfarm" label="风场">
             </el-table-column>
             <el-table-column
               sortable
               prop="windturbine"
               label="风机"
-              width="310"
             >
             </el-table-column>
             <el-table-column
@@ -108,7 +106,6 @@
               :formatter="filter_bdate"
               value-format="yyyy-MM-dd"
               label="起始时间"
-              width="310"
             >
             </el-table-column>
             <el-table-column
@@ -117,7 +114,6 @@
               :formatter="filter_edate"
               value-format="yyyy-MM-dd"
               label="截至日期"
-              width="210"
             >
             </el-table-column>
             <el-table-column
@@ -125,7 +121,6 @@
               prop="speed"
               :formatter="filter_speed"
               label="平均风速"
-              width="290"
             >
             </el-table-column>
             <el-table-column
@@ -133,13 +128,12 @@
               prop="power"
               :formatter="filter_power"
               label="发电量"
-              width="280"
             >
             </el-table-column>
           </el-table-column>
         </el-table>
       </el-card>
-    </el-main>
+    </div>
   </el-container>
 </template>
 

+ 2 - 0
src/views/performanceAnalysis/cutAndSpeed.vue

@@ -40,6 +40,7 @@
             </el-form>
             </el-card>
             <el-table
+            class="table_sty"
             id="callthepolicetable"
             :data="gridData"
             style="width: 100%"
@@ -48,6 +49,7 @@
             :cell-style="{ textAlign: 'center'}" 
             :header-cell-style="headStyle"
             @sort-change="changeTableSort"
+            max-height="750px"
             >
             <!-- <el-table-column label="切入切出风速整合"> -->
             <el-table-column

+ 1 - 0
vue.config.js

@@ -12,6 +12,7 @@ module.exports = {
   runtimeCompiler: true, // 是否使用包含运行时编译器的 Vue 构建版本
   productionSourceMap: !IS_PROD, // 生产环境的 source map
   chainWebpack: config => {
+
     config.resolve.symlinks(true); // 修复热更新失效
     // 添加别名
     config.resolve.alias