ソースを参照

同坐太统计

wangziqian 4 年 前
コミット
56a7e1c9d1

+ 17 - 5
src/layout/components/Sidebar/SidebarItem.vue

@@ -4,7 +4,7 @@
       <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
         <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
           <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
-          <div v-show="onlyOneChild.meta.title === '个人工作台'" class="if-notice" />
+          <div v-show="onlyOneChild.meta.title === '个人工作台' && showTips" class="if-notice" />
         </el-menu-item>
       </app-link>
     </template>
@@ -48,13 +48,25 @@ export default {
     basePath: {
       type: String,
       default: ''
+    },
+    showTips: {
+      type: Boolean,
+      default: false,
+      required: false
     }
   },
   data() {
     // To fix https://github.com/PanJiaChen/vue-admin-template/issues/237
     // TODO: refactor with render function
     this.onlyOneChild = null
-    return {}
+    return {
+    }
+  },
+  watch: {
+    showTips: {
+      handler(newV) {},
+      immediate: true
+    }
   },
   methods: {
     hasOneShowingChild(children = [], parent) {
@@ -98,10 +110,10 @@ export default {
   position: absolute;
   height: 10px;
   width: 10px;
-  background-color: tomato;
+  background-color: #E02020;
   border-radius: 50%;
-  top: 50%;
-  right: 20%;
+  top: 43%;
+  right: 37%;
   transform: translateY(-50%);
 }
 </style>

+ 17 - 1
src/layout/components/Sidebar/index.vue

@@ -13,7 +13,7 @@
           :collapse-transition="false"
           mode="vertical"
         >
-          <sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" />
+          <sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" :show-tips="showTips" />
         </el-menu>
       </el-scrollbar>
     </el-main>
@@ -31,9 +31,16 @@ import SidebarItem from './SidebarItem'
 import variables from '@/styles/variables.scss'
 import { logoutUrl } from '@/apiConfig/requestIP.js'
 import Hamburger from '@/components/Hamburger'
+import websocket from '@/views/workbench/mixins/websocket'
 
 export default {
   components: { SidebarItem, Logo, Hamburger },
+  mixins: [websocket],
+  data() {
+    return {
+      showTips: false
+    }
+  },
   computed: {
     ...mapGetters([
       'sidebar',
@@ -67,6 +74,15 @@ export default {
     },
     Logout() {
       location.href = logoutUrl
+    },
+    websocketonmessage(e) { // websocket数据接收
+      const { hasReminding } = JSON.parse(e.data)
+      if (hasReminding) {
+        this.showTips = true
+      } else {
+        this.showTips = false
+      }
+      console.log(this.showTips)
     }
   }
 }

+ 2 - 1
src/views/quality/components/statusChart.vue

@@ -107,7 +107,8 @@ export default {
           {
             type: 'category',
             boundaryGap: false,
-            data: this.handlerXdata(this.seriesData)
+            data: this.handlerXdata(this.seriesData),
+            axisLabel: { rotate: 15, align: 'center', margin: 20 }
           }
         ],
         yAxis: [{ type: 'value' }],

+ 10 - 11
src/views/workbench/components/statisticsSection.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="drawer-statistics" :class="{'drawer-padding': show}">
+  <div class="drawer-statistics" :class="{'drawer-padding': !show}">
     <transition name="fade-drawer">
       <div v-show="show" class="statistics">
         <div class="statistics-data">
@@ -45,11 +45,9 @@
         </div>
       </div>
     </transition>
-    <div v-show="show" class="drawer" @click="show = !show">
-      <i class="el-icon-arrow-up" />
-    </div>
-    <div v-show="!show" class="drawer drawer-pull" @click="show = !show">
-      <i class="el-icon-arrow-down" />
+    <div class="drawer" @click="show = !show">
+      <i v-show="show" class="el-icon-arrow-up" />
+      <i v-show="!show" class="el-icon-arrow-down" />
     </div>
   </div>
 </template>
@@ -195,7 +193,7 @@ export default {
   padding-bottom: 1px;
 }
 .drawer-padding {
-  padding-bottom: 14px;
+  padding-bottom: 13px;
 }
 //.fade-drawer-enter-active {
 //  transition: all 1.5s ease
@@ -285,7 +283,7 @@ export default {
 }
 .drawer {
   width: 26px;
-  height: 13px;
+  height: 12px;
   left: 50%;
   position: absolute;
   bottom: 1px;
@@ -297,9 +295,10 @@ export default {
   color: #666666;
   font-weight: bold;
   background-color: #ffffff;
-  border-bottom: 1px solid #999999;
-  border-left: 1px solid #999999;
-  border-right: 1px solid #999999;
+  // border-bottom: 1px solid #999999;
+  // border-left: 1px solid #999999;
+  // border-right: 1px solid #999999;
+  box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2);
   border-bottom-left-radius: 2px;
   border-bottom-right-radius: 2px;
 }

+ 1 - 1
src/views/workbench/mixins/websocket.js

@@ -13,7 +13,7 @@ export default {
   },
   methods: {
     initWebSocket() { // 初始化weosocket
-      const wsUri = 'ws://172.23.141.110:8980/self/remind?ename=' + localStorage.getItem('username')
+      const wsUri = 'ws://10.179.17.170:8980/self/remind?ename=' + localStorage.getItem('username')
       this.websock = new WebSocket(wsUri)
       this.websock.onmessage = this.websocketonmessage
       this.websock.onopen = this.websocketonopen

+ 11 - 6
src/views/workbench/person/index.vue

@@ -535,7 +535,7 @@ export default {
       }
     },
     websocketonmessage(e) { // websocket数据接收
-      const { bugHasReminding, requireHasReminding, taskHasReminding } = JSON.parse(JSON.parse(e.data))
+      const { bugHasReminding, requireHasReminding, taskHasReminding } = JSON.parse(e.data)
       this.tabTips = { // 顶部tab红点提示
         require: requireHasReminding,
         task: taskHasReminding,
@@ -562,9 +562,15 @@ export default {
 @include hide-open-header;
 .bg-person {
   @include bg-project;
+  padding-top: 60px;
 }
 .main-header {
   @include main-header;
+  margin-bottom: 0;
+  border-bottom: 1px solid rgba(155, 155, 155, .2);
+  >>>.el-tabs__nav-wrap::after {
+    height: 0;
+  }
   .top-tabs {
     position: absolute;
     left: 50%;
@@ -573,7 +579,7 @@ export default {
   .tips {
     height: 10px;
     width: 10px;
-    background-color: tomato;
+    background-color: #E02020;
     border-radius: 50%;
     position: absolute;
     top: 18px;
@@ -582,18 +588,17 @@ export default {
   .tips-last {
     height: 10px;
     width: 10px;
-    background-color: tomato;
+    background-color: #E02020;
     border-radius: 50%;
     position: absolute;
     top: 18px;
     right: 0;
   }
 }
-.main-header::after {
-  @include main-header-after;
-}
 .main-section {
   @include main-section;
+  margin-right: 0;
+  width: calc(100% - 10px);
   .title-name {
     font-size:20px;
     font-family:PingFangSC-Medium;

+ 19 - 12
src/views/workbench/team/index.vue

@@ -501,7 +501,7 @@ export default {
       }
     },
     websocketonmessage(e) { // websocket数据接收
-      const { bugHasReminding, requireHasReminding, taskHasReminding } = JSON.parse(JSON.parse(e.data))
+      const { bugHasReminding, requireHasReminding, taskHasReminding } = JSON.parse(e.data)
       this.tabTips = { // 顶部tab红点提示
         require: requireHasReminding,
         task: taskHasReminding,
@@ -518,17 +518,25 @@ export default {
 .el-container{
   width: 100%;
 }
-.hideSidebar .main-header {
-  width: calc(100% - 54px);
-}
-.openSidebar .main-header {
-  width: calc(100% - 210px);
-}
+// .hideSidebar .main-header {
+//   width: calc(100% - 54px);
+// }
+// .openSidebar .main-header {
+//   width: calc(100% - 210px);
+// }
+@include hide-open-header;
 .bg-team {
   @include bg-project;
+  padding-top: 60px;
 }
 .main-header {
   @include main-header;
+  margin-bottom: 0;
+  margin-right: 0;
+  border-bottom: 1px solid rgba(155, 155, 155, .2);
+  >>>.el-tabs__nav-wrap::after {
+    height: 0;
+  }
   .top-tabs {
     position: absolute;
     left: 50%;
@@ -537,7 +545,7 @@ export default {
   .tips {
     height: 10px;
     width: 10px;
-    background-color: tomato;
+    background-color: #E02020;
     border-radius: 50%;
     position: absolute;
     top: 18px;
@@ -546,18 +554,17 @@ export default {
   .tips-last {
     height: 10px;
     width: 10px;
-    background-color: tomato;
+    background-color: #E02020;
     border-radius: 50%;
     position: absolute;
     top: 18px;
     right: 0;
   }
 }
-.main-header::after {
-  @include main-header-after;
-}
 .main-section {
   @include main-section;
+  margin-right: 0;
+  width: calc(100% - 10px);
   .title-name {
     font-size:20px;
     font-family:PingFangSC-Medium;