Browse Source

修改BUG

408249787 2 years ago
parent
commit
9e62f72a5f

BIN
src/assets/bgView.png


+ 19 - 3
src/permission.js

@@ -44,10 +44,26 @@ router.beforeEach((to, from, next) => {
               // 根据roles权限生成可访问的路由表
               // 动态添加可访问路由表
               router.addRoutes(store.getters.addRouters)
-              const redirect = decodeURIComponent(from.query.redirect || to.path)
-              if (to.path === redirect) {
+              // 根据权限前往工作台
+              let newPath = null
+              if (to.path === '/toWorkplaceBacklog') {
+                const role = res.data.roles.join()
+                switch (true) {
+                  case role.includes('repair'):
+                    newPath = '/NewWorkplaceBacklog'
+                    break
+                  case role.includes('store'):
+                    newPath = '/StoreWorkplaceBacklog'
+                    break
+                }
+              } else {
+                newPath = to.path
+              }
+              const redirect = decodeURIComponent(from.query.redirect || newPath)
+
+              if (newPath === redirect) {
                 // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
-                next({ ...to, replace: true })
+                next({ ...to, path: newPath, replace: true })
               } else {
                 // 跳转到目的路由
                 next({ path: redirect })

+ 10 - 0
src/router/generator-platform-routers.js

@@ -390,6 +390,16 @@ export const constantRouterMap = [
     path: '/22',
     component: () => import('@/views/statisticView/22')
 
+  },
+  {
+    path: '/toWorkplaceBacklog',
+    component: () => import('@/views/statisticView/22')
+
+  },
+  {
+    path: '/44',
+    component: () => import('@/views/statisticView/44')
+
   },
   {
     path: '/single/login',

+ 1 - 1
src/views/Login.vue

@@ -235,7 +235,7 @@ export default {
     },
     loginSuccess (res) {
       // 延迟 1 秒显示欢迎信息
-      this.$router.push({ path: '/WorkplaceBacklog' })
+      this.$router.push({ path: '/toWorkplaceBacklog' })
       setTimeout(() => {
         this.$notification.success({
           message: '欢迎',

+ 2 - 2
src/views/check/checkjob/CheckJob.vue

@@ -112,7 +112,7 @@
       <div v-show="visible">
         <div class="table-operator" style="margin-bottom: 16px;">
           <a-row>
-            <a-col :md="16">
+            <a-col :span="21">
               <a-button v-if="$auth('check-polling-jobs-add')" type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
               <a-button style="margin-left: 8px" type="primary" v-if="($auth('check-spot-jobs-export') || $auth('check-polling-jobs-export'))" icon="download" @click="doExport">导出</a-button>
               <a-button style="margin-left:8px;" type="primary" @click="doImportForUpdate">
@@ -141,7 +141,7 @@
                 </a-button>
               </a-dropdown>
             </a-col>
-            <a-col style="text-align: right">
+            <a-col :span="3">
               <span class="table-page-search-submitButtons">
                 <a-button type="primary" @click="handleOk">查询</a-button>
                 <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>

+ 4 - 4
src/views/sqarepartmanage/sparepartinfo/modules/DetailA.vue

@@ -4,13 +4,13 @@
       <a-row :gutter="48" slot="extra">
         <a-col :md="48" :sm="48">
           <span style="float: left">
-            <a-badge :count="5" title="子设备总数" :number-style="{ backgroundColor: '#52c41a' }">
+            <!-- <a-badge :count="5" title="子设备总数" :number-style="{ backgroundColor: '#52c41a' }">
               <a-button style="margin-left: 20px" type="default">子设备</a-button>
             </a-badge>
             <a-badge :count="5" title="设备部位总数" :number-style="{ backgroundColor: '#52c41a' }">
               <a-button style="margin-left: 20px" type="default">设备部位</a-button>
             </a-badge>
-            <a-button style="margin-left: 20px" type="default">费用分析</a-button>
+            <a-button style="margin-left: 20px" type="default">费用分析</a-button> -->
             <a-button style="margin-left: 20px" @click="handleCancel()">返回</a-button>
 
           </span>
@@ -28,7 +28,7 @@
           :width="297"
           :height="297"></img-code>
         <a-divider style="background: #D6D6D6" />
-        <a-row type="flex" justify="space-between" :gutter="[16,16]">
+        <!-- <a-row type="flex" justify="space-between" :gutter="[16,16]">
           <a-col :span="10">
             <a-button shape="round" block>
               配件记录
@@ -63,7 +63,7 @@
               配件记录
             </a-button>
           </a-col>
-        </a-row>
+        </a-row> -->
 
       </a-layout-sider>
       <a-layout-content :style="{ background: '#fff',padding: '20px'}">

+ 26 - 2
src/views/statisticView/22.vue

@@ -1,12 +1,12 @@
 <template>
-  <div style="width:1920px;height:1080px;background:#16171C; padding:35px 21px">
+  <div class="view-container">
     <div class="title">
       <div style="position: absolute;">
         <img src="@/assets/22title.png" alt="">
       </div>
       <div class="text">
         <div> 设备管理系统数据大屏展示平台</div>
-        <div style="font-size: 15px;color: #A7DBFF;">Internet Food and Beverage Data Display Platform</div>
+        <div style="font-size: 15px;color: #A7DBFF;">Equipment management system data large screen display platform</div>
       </div>
     </div>
     <div class="main">
@@ -277,6 +277,10 @@ export default {
       chart.render()
     },
     getChart3 (id, data) {
+      registerTheme('myTheme', {
+        columnWidthRatio: 0.2,
+        colors10: ['#FFDB5C', '#FF9F7F', '#FB7293', '#E7BCF3', '#E7BCF3', '#78D3F8', '#9661BC', '#F6903D', '#008685', '#F08BB4']
+      })
       const chart = new Chart({
         container: id,
         autoFit: true,
@@ -316,6 +320,7 @@ export default {
             return `${data.population}个`
           }
         })
+      chart.theme('myTheme')
       chart.render()
     },
     getChart4 (id, data) {
@@ -379,6 +384,25 @@ export default {
 </script>
 
 <style lang="less" scoped>
+.view-container {
+width:1920px;
+height:1080px;
+background-color: black;
+padding:35px 21px;
+}
+.view-container::after {
+  content: "";
+  width:1920px;
+  height:1080px;
+  background: url(../../assets/bgView.png);
+  opacity: 0.3;
+  top: 0;
+  left: 0;
+  bottom: 0;
+  right: 0;
+  position: absolute;
+  // z-index: -1;
+}
 .title{
   height: 89px;
   position: relative;

+ 33 - 0
src/views/statisticView/44.vue

@@ -0,0 +1,33 @@
+<template>
+  <div class="view-container">
+    vcv
+  </div>
+</template>
+
+<script>
+export default {
+
+}
+</script>
+
+<style lang="less" scoped>
+.view-container {
+width:1920px;
+height:1080px;
+background-color: black;
+padding:35px 21px;
+}
+.view-container::after {
+  content: "";
+  width:1920px;
+  height:1080px;
+  background: url(../../assets/bgView.png);
+  opacity: 0.3;
+  top: 0;
+  left: 0;
+  bottom: 0;
+  right: 0;
+  position: absolute;
+  // z-index: -1;
+}
+</style>

+ 13 - 2
src/views/workplace/backlog/NewWorkplaceBacklog.vue

@@ -326,6 +326,17 @@ export default {
       }
     }
   },
+  computed: {
+    role () {
+      if (this.$store.state.user.roles.join().includes('manage')) {
+        return 'workplace-repair-manage'
+      } else if (this.$store.state.user.roles.join().includes('normal')) {
+        return 'workplace-repair-normal'
+      } else {
+        return ''
+      }
+    }
+  },
   created () {
     this.getDict()
     // this.getInfo()
@@ -339,12 +350,12 @@ export default {
     getDict () {
       this.typeDict = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.WORKPLACE_BACKLOG_TYPE)
       this.typeDetailDict = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.WORKPLACE_BACKLOG_DETAIL_TYPE)
-      getWorkplaceBacklogTopData('workplace-repair-manage').then(res => {
+      getWorkplaceBacklogTopData(this.role).then(res => {
         this.topData = res.data
       })
     },
     getInfo () {
-      Promise.all([getWorkplaceBacklogWeekData('workplace-repair-manage'), getWorkplaceBacklogPie('workplace-repair-manage')]).then(res => {
+      Promise.all([getWorkplaceBacklogWeekData(this.role), getWorkplaceBacklogPie(this.role)]).then(res => {
         console.log(res)
         this.lineData = res[0].data.reduce((pre, item) => {
           pre.push({

+ 25 - 10
src/views/workplace/backlog/StoreWorkplaceBacklog.vue

@@ -68,7 +68,7 @@
           <div style="display:flex;text-align:center;background:#fff;height: 170px;">
             <div style="width:48%;margin:auto;font-size:30px; line-height: 60px;">
               <div>仓库总数</div>
-              <div style="font-size:24px;">{{ topData.storeNums}}</div>
+              <div style="font-size:24px;">{{ topData.storeNums }}</div>
             </div>
             <div style="width: 1px;height: 70px;background: #999999;margin:auto;"></div>
             <div style="width:48%;margin:auto; font-size:30px;line-height: 60px;">
@@ -180,7 +180,7 @@
 
 <script>
 import { STable } from '@/components'
-import { getWorkplaceBacklogUserPage, getWorkplaceBacklogTopData, getWorkplaceBacklogWeekData, getWorkplaceBacklogPie} from '@/api/workplace/backlog'
+import { getWorkplaceBacklogUserPage, getWorkplaceBacklogTopData, getWorkplaceBacklogWeekData, getWorkplaceBacklogPie } from '@/api/workplace/backlog'
 import { Chart } from '@antv/g2'
 export default {
   name: 'NewWorkplaceBacklog',
@@ -211,7 +211,6 @@ export default {
       chartPie: null,
       chartLine: null,
       topData: null,
-      type: this.$route.query.type,
       queryParam: {
         status: 1
       },
@@ -316,8 +315,20 @@ export default {
       }
     }
   },
+  computed: {
+    role () {
+      if (this.$store.state.user.roles.join().includes('manage')) {
+        return 'workplace_store_manage'
+      } else if (this.$store.state.user.roles.join().includes('normal')) {
+        return 'workplace_store_normal'
+      } else {
+        return ''
+      }
+    }
+  },
   created () {
     this.getDict()
+    console.log(this.role)
     // this.getInfo()
   },
   mounted () {
@@ -329,12 +340,12 @@ export default {
     getDict () {
       this.typeDict = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.WORKPLACE_BACKLOG_TYPE)
       this.typeDetailDict = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.WORKPLACE_BACKLOG_DETAIL_TYPE)
-      getWorkplaceBacklogTopData('workplace_store_manage').then(res => {
+      getWorkplaceBacklogTopData(this.role).then(res => {
         this.topData = res.data
       })
     },
     getInfo () {
-      Promise.all([getWorkplaceBacklogWeekData('workplace_store_manage'), getWorkplaceBacklogPie('workplace_store_manage')]).then(res => {
+      Promise.all([getWorkplaceBacklogWeekData(this.role), getWorkplaceBacklogPie(this.role)]).then(res => {
         console.log(res)
         this.lineData = res[0].data.inStoreDetailVOS.reduce((pre, item) => {
           pre.push({
@@ -427,9 +438,7 @@ export default {
 
       this.chartLine.data(data)
       this.chartLine.scale({
-        week: {
-          range: [0, 1]
-        },
+
         value: {
           min: 0,
           nice: true
@@ -449,8 +458,14 @@ export default {
         }
       })
 
-      this.chartLine.area().position('week*value').color('name').shape('smooth')
-      this.chartLine.line().position('week*value').color('name').shape('smooth')
+      this.chartLine.interval().position('week*value').color('name').adjust([
+        {
+          type: 'dodge',
+          marginRatio: 0
+        }
+      ])
+
+      this.chartLine.interaction('active-region')
 
       this.chartLine.render()
     }