Browse Source

Merge branch 'master' of http://47.111.81.118:3000/xf15575941817/admin-fiveFollowing

fanghuisheng 3 years ago
parent
commit
6accd02c44
92 changed files with 4216 additions and 1106 deletions
  1. 9 3
      public/static/config.js
  2. 11 0
      sh.exe.stackdump
  3. 31 1
      src/App.vue
  4. 9 0
      src/api/dataManage/energyReport.js
  5. 40 0
      src/api/powerQuality/loopMonitor.js
  6. 30 0
      src/api/powerQuality/loopReport.js
  7. 30 0
      src/api/powerQuality/scoreReport.js
  8. 0 2
      src/api/systemManage/userManage.js
  9. 15 2
      src/assets/css/index.scss
  10. 9 9
      src/config/default/net.config.js
  11. 4 2
      src/layout/vab-avatar/index.vue
  12. 2 2
      src/layout/vab-content/index.vue
  13. 1 1
      src/layout/vab-menu/components/MenuItem.vue
  14. 7 1
      src/layout/vab-menu/components/Submenu.vue
  15. 1 0
      src/layout/vab-tabs/index.vue
  16. 1 1
      src/main.js
  17. 108 106
      src/router/index.js
  18. 3 1
      src/store/index.js
  19. 15 2
      src/store/modules/routes.js
  20. 2 2
      src/store/modules/user.js
  21. 13 5
      src/utils/request.js
  22. 6 5
      src/utils/routes.js
  23. 26 3
      src/vab/plugins/permissions.js
  24. 4 6
      src/views/alarmManage/index.vue
  25. 53 22
      src/views/dataManage/chainAnalysis/ehcarts/index.vue
  26. 40 19
      src/views/dataManage/chainAnalysis/index.vue
  27. 1 1
      src/views/dataManage/demandAnalysis/ehcarts/index.vue
  28. 21 9
      src/views/dataManage/demandAnalysis/index.vue
  29. 3 6
      src/views/dataManage/energyReport/ehcarts/index.vue
  30. 20 10
      src/views/dataManage/energyReport/index.vue
  31. 65 13
      src/views/dataManage/energyReport/tables/index.vue
  32. 28 22
      src/views/dataManage/sameAnalysis/ehcarts/index.vue
  33. 12 0
      src/views/dataManage/sameAnalysis/ehcarts/json.js
  34. 43 8
      src/views/dataManage/sameAnalysis/index.vue
  35. 26 1
      src/views/deviceManage/powerEquip/communicateEquip/dialog/cloneDialog.vue
  36. 2 2
      src/views/deviceManage/powerEquip/communicateEquip/dialog/insert_update.vue
  37. 13 2
      src/views/deviceManage/powerEquip/communicateEquip/index.vue
  38. 2 2
      src/views/deviceManage/powerEquip/deviceDetails.vue
  39. 61 21
      src/views/deviceManage/powerEquip/index.vue
  40. 5 4
      src/views/deviceManage/powerEquip/powerDialog/insertDialog.vue
  41. 21 24
      src/views/deviceManage/powerEquip/videoEquip/checkVideo.vue
  42. 28 27
      src/views/deviceManage/powerEquip/videoEquip/index.vue
  43. 2 0
      src/views/index/index.vue
  44. 134 0
      src/views/login/JcRange.vue
  45. 30 8
      src/views/login/index.vue
  46. 4 3
      src/views/planOutage/dialogComponent.vue
  47. 2 0
      src/views/planOutage/index.vue
  48. 2 3
      src/views/powerQuality/asseReport/index.vue
  49. 525 97
      src/views/powerQuality/asseReport/loopReport.vue
  50. 540 82
      src/views/powerQuality/asseReport/scoreReport.vue
  51. 239 0
      src/views/powerQuality/asseReport/scoreReportComponent/descripDialog.vue
  52. 87 0
      src/views/powerQuality/asseReport/scoreReportComponent/dialogChartOne.vue
  53. 196 0
      src/views/powerQuality/asseReport/scoreReportComponent/innerLineChart.vue
  54. 196 0
      src/views/powerQuality/asseReport/scoreReportComponent/innerLineChart2.vue
  55. 70 56
      src/views/powerQuality/asseReport/scoreReportComponent/pieChart.vue
  56. 50 31
      src/views/powerQuality/asseReport/scoreReportComponent/radarChart.vue
  57. 9 8
      src/views/powerQuality/harmonicReport/curveCom.vue
  58. 32 13
      src/views/powerQuality/harmonicReport/index.vue
  59. 4 4
      src/views/powerQuality/harmonicReport/tableCom.vue
  60. 2 2
      src/views/powerQuality/realTimeMonitoring/index.vue
  61. 122 33
      src/views/powerQuality/realTimeMonitoring/loopMonitor.vue
  62. 186 0
      src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/descripDialog.vue
  63. 44 35
      src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/frequencyPanel.vue
  64. 3 3
      src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/harmonicPanel.vue
  65. 88 39
      src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/loopLineChart.vue
  66. 48 11
      src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/loopRadarChart.vue
  67. 185 0
      src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/loopRadarChart2.vue
  68. 74 32
      src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/powerPanel.vue
  69. 79 26
      src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/voltagePanel.vue
  70. 50 20
      src/views/powerQuality/realTimeMonitoring/realScore.vue
  71. 53 6
      src/views/powerQuality/realTimeMonitoring/realScoreComponent/descripDialog.vue
  72. 0 2
      src/views/powerQuality/realTimeMonitoring/realScoreComponent/innerLineChart2.vue
  73. 3 5
      src/views/powerQuality/realTimeMonitoring/realScoreComponent/pieChart.vue
  74. 3 10
      src/views/powerQuality/realTimeMonitoring/realScoreComponent/radarChart.vue
  75. 0 4
      src/views/powerQuality/unbalanceAnalysis/electricChart.vue
  76. 26 6
      src/views/powerQuality/unbalanceAnalysis/index.vue
  77. 1 1
      src/views/powerQuality/unbalanceAnalysis/voltageChart.vue
  78. 2 2
      src/views/siteManage/addSiteCom.vue
  79. 22 33
      src/views/siteManage/basicInfo/index.vue
  80. 3 4
      src/views/siteManage/camera/checkVideo.vue
  81. 42 40
      src/views/siteManage/camera/index.vue
  82. 1 1
      src/views/siteManage/groupInfoCom.vue
  83. 58 26
      src/views/siteManage/index.vue
  84. 18 2
      src/views/siteManage/powerScore/index.vue
  85. 0 1
      src/views/siteManage/variableList/dialogComponent.vue
  86. 23 13
      src/views/siteManage/variableList/index.vue
  87. 31 13
      src/views/siteManage/watchDog/index.vue
  88. 5 5
      src/views/stationManage/siteList.vue
  89. 7 10
      src/views/systemManage/rolePermission/index.vue
  90. 18 30
      src/views/systemManage/rolePermission/roleInfoCom/index.vue
  91. 56 32
      src/views/systemManage/userManage/dialogComponent.vue
  92. 20 7
      src/views/systemManage/userManage/index.vue

+ 9 - 3
public/static/config.js

@@ -3,9 +3,15 @@ var PLATFROM_CONFIG = {};
 // PLATFROM_CONFIG.baseUrl = "http://172.16.120.104:8010/" //杨强本地
 // PLATFROM_CONFIG.baseUrl = "http://172.16.1.196:8010/" //超博本地
 
-PLATFROM_CONFIG.baseUrl = "https://qhome.usky.cn/fivapi/" //线上
-PLATFROM_CONFIG.images = "https://qhome.usky.cn/file/" //线上图片
-PLATFROM_CONFIG.fileUrl = "https://qhome.usky.cn/file/" //xlsx文件访问路径
+// PLATFROM_CONFIG.baseUrl = "https://qhome.usky.cn/fivapi/" //线上
+// PLATFROM_CONFIG.images = "https://qhome.usky.cn/file/" //线上图片
+// PLATFROM_CONFIG.fileUrl = "https://qhome.usky.cn/file/" //xlsx文件访问路径
+
+PLATFROM_CONFIG.baseUrl = "https://wx.ewoogi.com/api/" //线上
+PLATFROM_CONFIG.images = "https://wx.ewoogi.com/file/" //线上图片
+PLATFROM_CONFIG.fileUrl = "https://wx.ewoogi.com/file/" //xlsx文件访问路径
+
+
 
 // 本地json文件请求路径
 PLATFROM_CONFIG.Interface = "/vuefiv/InterfaceReturn.json"

+ 11 - 0
sh.exe.stackdump

@@ -0,0 +1,11 @@
+Stack trace:
+Frame        Function    Args
+000FFFFB540  00180064365 (00180275F10, 00180266FD1, 000FFFFCA60, 000FFFFBA20)
+000FFFFBA70  001800499D2 (00100002000, 0018034EB80, 00000000001, 00000000128)
+000FFFFCA80  00180049A11 (00000000001, 0018034EE90, 000FFFFCA60, 00000000008)
+000FFFFCB10  0018005CFCD (00000000000, 000FFFFCC40, 001800DC3EF, 00000000000)
+000FFFFCBF0  0018005D12B (000FFFFCDF0, 00000000000, FFFFFFFFFFFFFFD7, 00000000000)
+000FFFFCCE0  0018004A1A8 (00000000000, 00000000000, 00000000000, 00000000000)
+000FFFFCDA0  00180048A2A (00000000000, 00000000000, 00000000000, 00000000000)
+000FFFFCE50  00180048AEC (00000000000, 00000000000, 00000000000, 00000000000)
+End of stack trace

+ 31 - 1
src/App.vue

@@ -1,6 +1,36 @@
 <template>
   <router-view />
 </template>
+<script>
+import { defineComponent, watchEffect } from 'vue'
+// import {useRouter} from 'vue-router'
+
+import store from '@/store'
+
+export default defineComponent({
+  setup() {
+    let hasToken = store.getters['user/accessToken']
+    // let router = useRouter();
+
+    watchEffect((fn, options) => {
+      fn, options
+      if (!hasToken) {
+        // router.push({
+        //   path: '/login',
+        // })
+      } else {
+        console.log(2)
+
+      }
+    })
+    return {
+      store,
+    }
+  },
+})
+
+</script>
+
 <style lang="less">
-  @import '~@/vab/styles/vab.less';
+@import '~@/vab/styles/vab.less';
 </style>

+ 9 - 0
src/api/dataManage/energyReport.js

@@ -19,4 +19,13 @@ export function deviceBoxList(params) {
         method: 'GET',
         params,
     })
+}
+
+//表格-导出
+export function monthlyReportExport(params) {
+    return request({
+        url: '/htAnalogData/monthlyReportExport',
+        method: 'GET',
+        params,
+    })
 }

+ 40 - 0
src/api/powerQuality/loopMonitor.js

@@ -0,0 +1,40 @@
+import request from '@/utils/request'
+
+
+
+//通信设备列表查询-无分页
+export function deviceListOne(params) {
+    return request({
+        url: '/device/deviceListOne',
+        method: 'GET',
+        params,
+    })
+}
+
+// // 实时评分主页面  (实时消费组模拟量-----电能质量(实时评分)
+// export function realScore(params) {
+//     return request({
+//         url: '/rtAnalogData/realScore',
+//         method: 'GET',
+//         params,
+//     })
+// }
+
+// // 实时评分弹框详情  (历史消费组模拟量----历史电流电压评分)
+// export function rtRealScore(params) {
+//     return request({
+//         url: '/htAnalogData/rtRealScore',
+//         method: 'GET',
+//         params,
+//     })
+// }
+
+
+// 单回路监测
+export function realScoreOne(params) {
+    return request({
+        url: '/rtAnalogData/realScoreOne',
+        method: 'GET',
+        params,
+    })
+}

+ 30 - 0
src/api/powerQuality/loopReport.js

@@ -0,0 +1,30 @@
+import request from '@/utils/request'
+
+
+
+//通信设备列表查询-无分页
+export function deviceListOne(params) {
+    return request({
+        url: '/device/deviceListOne',
+        method: 'GET',
+        params,
+    })
+}
+
+// 单回路报告主页面 
+export function SingleLoopReportData(params) {
+    return request({
+        url: '/htAnalogData/SingleLoopReportData',
+        method: 'GET',
+        params,
+    })
+}
+
+// // 实时评分弹框详情  (历史消费组模拟量----历史电流电压评分)
+// export function rtRealScore(params) {
+//     return request({
+//         url: '/htAnalogData/rtRealScore',
+//         method: 'GET',
+//         params,
+//     })
+// }

+ 30 - 0
src/api/powerQuality/scoreReport.js

@@ -0,0 +1,30 @@
+import request from '@/utils/request'
+
+
+
+//通信设备列表查询-无分页
+// export function deviceListOne(params) {
+//     return request({
+//         url: '/device/deviceListOne',
+//         method: 'GET',
+//         params,
+//     })
+// }
+
+// 评估报告主页面 
+export function evaluationReport(params) {
+    return request({
+        url: 'rtAnalogData/evaluationReport',
+        method: 'GET',
+        params,
+    })
+}
+
+// 实时评分弹框详情  (历史消费组模拟量----历史电流电压评分)
+export function rtRealScore(params) {
+    return request({
+        url: '/htAnalogData/rtRealScore',
+        method: 'GET',
+        params,
+    })
+}

+ 0 - 2
src/api/systemManage/userManage.js

@@ -38,8 +38,6 @@ export function userUpdate(params) {
     })
 }
 
-
-
 // 角色-回显
 export function authRole(params, userId) {
     return request({

+ 15 - 2
src/assets/css/index.scss

@@ -235,7 +235,12 @@ ul li {
 
 .goArchive {
     color: #056FFF;
-    text-decoration: underline;
+    // text-decoration: underline;
+    cursor: default;
+}
+
+.goArchive:hover {
+    cursor: text;
 }
 
 .blockTitle {
@@ -469,6 +474,10 @@ ul li {
 }
 
 //评估报告
+.defaultCursor:hover {
+    cursor: default!important;
+}
+
 .assePage .blanceChartTit {
     margin-bottom: 0;
     width: 100%;
@@ -590,6 +599,10 @@ ul li {
 }
 
 // 实时评分 
+.descIcon {
+    cursor: pointer
+}
+
 .descIcon img {
     position: relative;
     top: 2px;
@@ -795,7 +808,7 @@ ul li {
 }
 
 .harmonicCard {
-    height: calc(50% - 56px);
+    height: calc(50% - 78px);
     // border: 1px solid red;
 }
 

+ 9 - 9
src/config/default/net.config.js

@@ -2,13 +2,13 @@
  * @description 导出默认网路配置
  **/
 const network = {
-  //配后端数据的接收方式application/json;charset=UTF-8 或 application/x-www-form-urlencoded;charset=UTF-8
-  contentType: 'application/json;charset=UTF-8',
-  //消息框消失时间
-  messageDuration: 3000,
-  //最长请求时间
-  requestTimeout: 10000,
-  //操作正常code,支持String、Array、int多种类型
-  successCode: [200, 0],
+    //配后端数据的接收方式application/json;charset=UTF-8 或 application/x-www-form-urlencoded;charset=UTF-8
+    contentType: 'application/json;charset=UTF-8',
+    //消息框消失时间
+    messageDuration: 3000,
+    //最长请求时间
+    requestTimeout: 10000,
+    //操作正常code,支持String、Array、int多种类型
+    successCode: [200, 0],
 }
-module.exports = network
+module.exports = network

+ 4 - 2
src/layout/vab-avatar/index.vue

@@ -80,8 +80,10 @@ export default {
     async logout() {
       await this.$store.dispatch('user/logout')
       if (recordRoute) {
-        const fullPath = this.$route.fullPath
-        this.$router.push(`/login?redirect=${fullPath}`)
+        // const fullPath = this.$route.fullPath
+        // this.$router.push(`/login?redirect=${fullPath}`)
+
+        this.$router.push('/login')
       } else {
         this.$router.push('/login')
       }

+ 2 - 2
src/layout/vab-content/index.vue

@@ -1,9 +1,9 @@
 <template>
   <a-layout-content class="vab-content">
     <router-view v-slot="{ Component }">
-      <transition mode="out-in" name="fade-transform">
+      <!-- <transition mode="out-in" name="fade-transform"> -->
         <component :is="Component" />
-      </transition>
+      <!-- </transition> -->
     </router-view>
   </a-layout-content>
 </template>

+ 1 - 1
src/layout/vab-menu/components/MenuItem.vue

@@ -1,5 +1,5 @@
 <template>
-  <a-menu-item :key="routeChildren.path" @click.capture="handleLink">
+  <a-menu-item :key="routeChildren.path" @click.capture="handleLink" >
     <span class="anticon">
       <!-- <vab-icon :icon="routeChildren.meta.icon"></vab-icon> -->
       <svg-icon :iconClass="routeChildren.meta.icon"></svg-icon>

+ 7 - 1
src/layout/vab-menu/components/Submenu.vue

@@ -1,5 +1,5 @@
 <template>
-  <a-sub-menu :key="item.fullPath">
+  <a-sub-menu :key="item.fullPath" class="aa123">
     <template v-slot:title>
       <span class="anticon">
         <svg-icon :iconClass="item.meta.icon"></svg-icon>
@@ -33,3 +33,9 @@
     methods: {},
   }
 </script>
+<style>
+.aa123 li{
+  padding-left:24px!important
+
+}
+</style>

+ 1 - 0
src/layout/vab-tabs/index.vue

@@ -21,6 +21,7 @@
           v-for="(item, ind) in breadListLast"
           :key="ind"
           :to="item.path"
+         
         >
           {{ item.title }}
         </el-breadcrumb-item>

+ 1 - 1
src/main.js

@@ -54,7 +54,7 @@ router.beforeEach((to) => {
         store.commit('publicDeviceList')
     }
     if (to.path == '/home') {
-        window.location.href = "https://wx.ewoogi.com/vuefiv/#/home";
+        window.location.href = "https://wx.ewoogi.com/panel/#/home";
         // window.location.href = "http://localhost:8081/vuefiv#/home";
     }
 })

+ 108 - 106
src/router/index.js

@@ -2,32 +2,34 @@ import { createRouter, createWebHashHistory } from 'vue-router'
 import Layout from '@/layout'
 
 export const constantRoutes = [{
-    path: '/login',
-    component: () =>
-        import('@/views/login'),
-    hidden: true,
-},
-{
-    path: '/403',
-    name: '403',
-    component: () =>
-        import('@/views/403'),
-    hidden: true,
-},
-{
-    path: '/404',
-    name: '404',
-    component: () =>
-        import('@/views/404'),
-    hidden: true,
-},
-{
-    path: '/401',
-    name: '401',
-    component: () =>
-        import('@/views/401'),
-    hidden: true,
-},
+        path: '/login',
+        component: () =>
+            import ('@/views/login'),
+        hidden: true,
+    },
+    {
+        path: '/403',
+        name: '403',
+        component: () =>
+            import ('@/views/403'),
+        hidden: true,
+    },
+
+    {
+        path: '/401',
+        name: '401',
+        component: () =>
+            import ('@/views/401'),
+        hidden: true,
+    },
+    {
+        path: '/404',
+        name: '404',
+        component: () =>
+            import ('@/views/404'),
+        hidden: true,
+    },
+    // { path: '*', redirect: '/404', hidden: true }
 ]
 export const asyncRoutes = [
 
@@ -54,14 +56,14 @@ export const asyncRoutes = [
     // },
 
 
-    {
-        path: 'external-link',
-        component: Layout,
-        children: [{
-            path: '/home',
-            meta: { title: '首页', icon: 'home', }
-        }]
-    },
+    // {
+    //     path: 'external-link',
+    //     component: Layout,
+    //     children: [{
+    //         path: '/home',
+    //         meta: { title: '首页', icon: 'home', }
+    //     }]
+    // },
 
     {
         path: '/',
@@ -79,8 +81,8 @@ export const asyncRoutes = [
             },
             path: '/alarmManage/index',
             component: () =>
-                import('@/views/alarmManage/index'),
-        },]
+                import ('@/views/alarmManage/index'),
+        }, ]
     },
     // {
     //     path: '/alarmManage',
@@ -118,7 +120,7 @@ export const asyncRoutes = [
             },
             path: '/siteManage',
             component: () =>
-                import('@/views/siteManage/index'),
+                import ('@/views/siteManage/index'),
             hidden: true
         }]
     },
@@ -138,7 +140,7 @@ export const asyncRoutes = [
             },
             path: '/stationManage',
             component: () =>
-                import('@/views/stationManage/index'),
+                import ('@/views/stationManage/index'),
             hidden: true
         }]
     },
@@ -166,7 +168,7 @@ export const asyncRoutes = [
             },
             path: '/deviceManage',
             component: () =>
-                import('@/views/deviceManage/powerEquip'),
+                import ('@/views/deviceManage/powerEquip'),
             hidden: true
         }]
     },
@@ -209,38 +211,38 @@ export const asyncRoutes = [
         component: Layout,
         redirect: '/dataManage/sameAnalysis/index',
         children: [{
-            meta: { icon: 'sameAnalysis', title: '同比分析报表', },
-            path: 'sameAnalysis',
-            component: () =>
-                import('@/views/dataManage/sameAnalysis/index'),
-        },
-        {
-            meta: { icon: 'chainAnalysis', title: '环比分析报表', },
-            path: 'chainAnalysis',
-            component: () =>
-                import('@/views/dataManage/chainAnalysis/index'),
-        },
-        // {
-        //     meta: { icon: 'handOpera', title: '手动抄表', },
-        //     title: 'index-layout.menu.dataManage.handOpera',
-        //     path: 'handOpera',
-        //     component: () =>
-        //         import ('@/views/dataManage/handOpera/index.vue'),
-        // },
-        {
-            meta: { icon: 'energyReport', title: '用能月报', },
-            title: 'index-layout.menu.dataManage.energyReport',
-            path: 'energyReport',
-            component: () =>
-                import('@/views/dataManage/energyReport/index'),
-        },
-        {
-            meta: { icon: 'demandAnalysis', title: '需量分析', },
-            title: 'index-layout.menu.dataManage.demandAnalysis',
-            path: 'demandAnalysis',
-            component: () =>
-                import('@/views/dataManage/demandAnalysis/index'),
-        },
+                meta: { icon: 'sameAnalysis', title: '同比分析报表', },
+                path: 'sameAnalysis',
+                component: () =>
+                    import ('@/views/dataManage/sameAnalysis/index'),
+            },
+            {
+                meta: { icon: 'chainAnalysis', title: '环比分析报表', },
+                path: 'chainAnalysis',
+                component: () =>
+                    import ('@/views/dataManage/chainAnalysis/index'),
+            },
+            // {
+            //     meta: { icon: 'handOpera', title: '手动抄表', },
+            //     title: 'index-layout.menu.dataManage.handOpera',
+            //     path: 'handOpera',
+            //     component: () =>
+            //         import ('@/views/dataManage/handOpera/index.vue'),
+            // },
+            {
+                meta: { icon: 'energyReport', title: '用能月报', },
+                title: 'index-layout.menu.dataManage.energyReport',
+                path: 'energyReport',
+                component: () =>
+                    import ('@/views/dataManage/energyReport/index'),
+            },
+            {
+                meta: { icon: 'demandAnalysis', title: '需量分析', },
+                title: 'index-layout.menu.dataManage.demandAnalysis',
+                path: 'demandAnalysis',
+                component: () =>
+                    import ('@/views/dataManage/demandAnalysis/index'),
+            },
             // {
             //     meta: { icon: 'consumConfig', title: '能耗分析配置', },
             //     title: 'index-layout.menu.dataManage.consumConfig',
@@ -264,29 +266,29 @@ export const asyncRoutes = [
         component: Layout,
         redirect: '/powerQuality/harmonicReport/index',
         children: [{
-            meta: { icon: 'harmonicReport', title: '谐波报表', },
-            path: 'harmonicReport',
-            component: () =>
-                import('@/views/powerQuality/harmonicReport/index'),
-        },
-        {
-            meta: { icon: 'realTimeMonitoring', title: '实时监测' },
-            path: 'realTimeMonitoring',
-            component: () =>
-                import('@/views/powerQuality/realTimeMonitoring/index'),
-        },
-        {
-            meta: { icon: 'asseReport', title: '评估报告', },
-            path: 'asseReport',
-            component: () =>
-                import('@/views/powerQuality/asseReport/index'),
-        },
-        {
-            meta: { icon: 'unbalanceAnalysis', title: '三相不平衡分析', },
-            path: 'unbalanceAnalysis',
-            component: () =>
-                import('@/views/powerQuality/unbalanceAnalysis/index'),
-        },
+                meta: { icon: 'harmonicReport', title: '谐波报表', },
+                path: 'harmonicReport',
+                component: () =>
+                    import ('@/views/powerQuality/harmonicReport/index'),
+            },
+            {
+                meta: { icon: 'realTimeMonitoring', title: '实时监测' },
+                path: 'realTimeMonitoring',
+                component: () =>
+                    import ('@/views/powerQuality/realTimeMonitoring/index'),
+            },
+            {
+                meta: { icon: 'asseReport', title: '评估报告', },
+                path: 'asseReport',
+                component: () =>
+                    import ('@/views/powerQuality/asseReport/index'),
+            },
+            {
+                meta: { icon: 'unbalanceAnalysis', title: '三相不平衡分析', },
+                path: 'unbalanceAnalysis',
+                component: () =>
+                    import ('@/views/powerQuality/unbalanceAnalysis/index'),
+            },
 
         ]
     },
@@ -327,7 +329,7 @@ export const asyncRoutes = [
             meta: { title: '计划停电', icon: 'planOutage', },
             path: '/planOutage',
             component: () =>
-                import('@/views/planOutage/index'),
+                import ('@/views/planOutage/index'),
             hidden: true
         }],
     },
@@ -437,17 +439,17 @@ export const asyncRoutes = [
         component: Layout,
         redirect: '/systemManage/userManage/index',
         children: [{
-            meta: { title: '用户管理', icon: 'userManage', },
-            path: 'userManage',
-            component: () =>
-                import('@/views/systemManage/userManage/index'),
-        },
-        {
-            meta: { title: '权限管理', icon: 'rolePermission', },
-            path: 'rolePermission',
-            component: () =>
-                import('@/views/systemManage/rolePermission/index'),
-        },
+                meta: { title: '用户管理', icon: 'userManage', },
+                path: 'userManage',
+                component: () =>
+                    import ('@/views/systemManage/userManage/index'),
+            },
+            {
+                meta: { title: '权限管理', icon: 'rolePermission', },
+                path: 'rolePermission',
+                component: () =>
+                    import ('@/views/systemManage/rolePermission/index'),
+            },
         ]
     },
 

+ 3 - 1
src/store/index.js

@@ -56,7 +56,9 @@ export default createStore({
         realScoreLineDataTime: [], //图表时间线
         realScoreLineName: '',
         realScoreLineName2: '',
-        chartType: '' //点击表格传参类型
+        chartType: '', //点击表格传参类型
+
+        goUrl: 0 //立即前往变化
     },
     mutations: {
         /**

+ 15 - 2
src/store/modules/routes.js

@@ -44,8 +44,21 @@ const actions = {
     async setAllRoutes({ commit }) {
         let { data } = await getRouterList()
 
-        if (data[data.length - 1].path !== '*')
-            data.push({ path: '/*', redirect: '/404', hidden: true })
+        // data[4].redirect = "/dataManage/sameAnalysis"
+        console.log('data')
+        console.log(data)
+        data.unshift({
+            path: 'external-link',
+            component: 'Layout',
+            children: [{
+                path: '/home',
+                meta: { title: '首页', icon: 'home', }
+            }]
+        }, )
+
+        // if (data[data.length - 1].path !== '*')
+        //     data.push({ path: '/*', redirect: '/404', hidden: true })
+
         const asyncRoutes = convertRouter(data)
         const finallyRoutes = filterRoutes([...constantRoutes, ...asyncRoutes])
         commit('setRoutes', finallyRoutes)

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

@@ -29,7 +29,6 @@ const mutations = {
      * @param {*} accessToken
      */
     setAccessToken(state, accessToken) {
-        console.log(state, accessToken)
         state.accessToken = accessToken
         setAccessToken(accessToken)
     },
@@ -140,6 +139,7 @@ const actions = {
      * @param {*} { commit, dispatch }
      */
     async resetAll({ dispatch }) {
+
         await dispatch('setAccessToken', '')
         await dispatch('acl/setFull', false, { root: true })
         await dispatch('acl/setRole', [], { root: true })
@@ -151,7 +151,7 @@ const actions = {
      * @description 设置token
      */
     setAccessToken({ commit }, accessToken) {
-        console.log("11111111111111111111111", accessToken)
+        // console.log("11111111111111111111111", accessToken)
         commit('setAccessToken', accessToken)
     },
 }

+ 13 - 5
src/utils/request.js

@@ -17,6 +17,8 @@ import { message } from 'ant-design-vue'
 
 let loadingInstance
 
+var tag = true
+
 /**
  * @author chuzhixin 1204505056@qq.com
  * @description 处理code异常
@@ -24,12 +26,20 @@ let loadingInstance
  * @param {*} msg
  */
 const handleCode = (code, msg) => {
+
     switch (code) {
-        case 401:
-            message.error(msg || '登录失效')
+        case '401':
+            if (tag) {
+                message.error('登录状态已过期,请重新登陆!')
+                tag = false
+            }
             store.dispatch('user/resetAll').catch(() => {})
+            store.dispatch('user/logout').catch(() => {})
+            router.replace({ path: "/login" });
+
+
             break
-        case 403:
+        case '403':
             router.push({ path: '/401' }).catch(() => {})
             break
         default:
@@ -83,8 +93,6 @@ instance.interceptors.request.use(
 instance.interceptors.response.use(
     (response) => {
         if (loadingInstance) loadingInstance.close()
-
-
         const { data, config } = response
         const { code, msg } = data
         // 操作正常Code数组

+ 6 - 5
src/utils/routes.js

@@ -18,7 +18,7 @@ export function convertRouter(constantRoutes) {
                 // route.component = (resolve) => require([`@/${path}`], resolve)
                 route.component = Layout
             } else {
-                console.log(route.component)
+                // console.log(route.component)
                 let path = route.component
                 if (
                     new RegExp('^/views/.*$').test(route.component) ||
@@ -31,13 +31,14 @@ export function convertRouter(constantRoutes) {
                     path = route.component.slice(1)
                 } else {
                     path = route.component.slice(8);
-                    console.log('path', path)
+                    // console.log('path', path)
                 }
 
                 // route.component = (resolve) => require([`@/views/alarmManage/index`], resolve)
-                route.component = () => import(`@/views/${path}`)
-                // route.component = () => import(`@/views/alarmManage/index`)
-                // console.log(route)
+                route.component = () =>
+                    import (`@/views/${path}`)
+                    // route.component = () => import(`@/views/alarmManage/index`)
+                    // console.log(route)
             }
         }
         if (route.children && route.children.length)

+ 26 - 3
src/vab/plugins/permissions.js

@@ -12,20 +12,29 @@ import {
     routesWhiteList,
 } from '@/config'
 
-router.beforeEach(async (to, from, next) => {
+router.beforeEach(async(to, from, next) => {
+
     let hasToken = store.getters['user/accessToken']
 
     if (!loginInterception) hasToken = true
-
+    console.log(localStorage.getItem('accessToken'))
+    console.log(localStorage.getItem('accessToken'))
     if (hasToken) {
         if (to.path === '/login') {
             next({ path: '/' })
         } else {
+
             const hasRoles =
                 store.getters['acl/admin'] ||
                 store.getters['acl/role'].length > 0 ||
                 store.getters['acl/ability'].length > 0
             if (hasRoles) {
+                // console.log('to.matched')
+                // console.log(to.matched)
+                if (to.matched.length === 0) {
+                    // alert('没有匹配')
+                    next('/404') // 判断此跳转路由的来源路由是否存在,存在的情况跳转到来源路由,否则跳转到404页面
+                }
                 next()
             } else {
                 try {
@@ -44,9 +53,20 @@ router.beforeEach(async (to, from, next) => {
                     }
 
                     accessRoutes.forEach((item) => {
+
                         router.addRoute(item)
                     })
-                    next({ ...to, replace: true })
+
+                    if (accessRoutes[1].path != '/') {
+                        next(accessRoutes[1].path)
+
+                    } else {
+
+
+                        next({...to, replace: true })
+
+                    }
+
                 } catch {
                     await store.dispatch('user/resetAll')
                     if (recordRoute)
@@ -60,6 +80,9 @@ router.beforeEach(async (to, from, next) => {
             }
         }
     } else {
+
+        routesWhiteList
+        // next({ path: '/login', replace: true })
         if (routesWhiteList.indexOf(to.path) !== -1) {
             next()
         } else {

+ 4 - 6
src/views/alarmManage/index.vue

@@ -30,7 +30,7 @@
               start-placeholder="开始日期"
               end-placeholder="结束日期"
               style="width: auto"
-              @change="listSelect()"
+        
             ></el-date-picker>
           </div>
           <el-button
@@ -170,9 +170,7 @@ export default defineComponent({
 
     const pageShow = ref(true)
     const alarmGradeList = ref({})
-    // const dateValue = ref([new Date(2020, 10, 10, 10, 10), new Date()])
-    const dateValue = ref('')
-
+    const dateValue =ref('')
     const total = ref(0)
     const pageSize = ref(15)
     const currentPage = ref(1)
@@ -229,7 +227,7 @@ export default defineComponent({
 
     onMounted(() => {
       listSelect()
-      // console.log(store, router)
+      // window.location.reload()
     })
 
     //条数
@@ -270,7 +268,7 @@ export default defineComponent({
     const cellStyle = ({ row, column, rowIndex, columnIndex }) => {
       row, column, rowIndex
       // console.log(row, column, rowIndex)
-      if (columnIndex === 0) {
+      if (columnIndex !== 0) {
         return `color:#0284E8;cursor:pointer`
       }
       if (columnIndex) {

+ 53 - 22
src/views/dataManage/chainAnalysis/ehcarts/index.vue

@@ -1,8 +1,8 @@
 <template>
-  <div shadow="never" class="homeBoxCard" v-loading="loading">
-    <br>
+  <div shadow="never" class="homeBoxCard" >
+    <br />
     <div class="height300" ref="chainChartRef" />
-     <br>
+    <br />
   </div>
 </template>
 <script>
@@ -17,18 +17,35 @@ export default defineComponent({
 
   setup(props) {
     const chainChartRef = ref(null)
-    const resultListDate=ref([])
+    const resultListDate = ref([])
 
     // 读取数据 func
-    const loading = ref(true)
     const getData = async () => {
-      loading.value = false
       var aa = props.echartsDataOne.listDate
       var bb = props.echartsDataOne.listDate2
-     
-      resultListDate.value = aa.map(function (index, item) {
-        return index +' / '+ bb[item]
-      })
+      console.log(aa)
+      console.log(bb)
+      if (aa.length > bb.length) {
+        resultListDate.value = aa.map(function (index, item) {
+          // return index + ' / ' + (bb[item] ? bb[item] : '')
+
+          return  `           ${index.toString().substring(5)}
+           / 
+           ${bb[item] ? bb[item].toString().substring(5) : ''}`
+        })
+      }else{
+        resultListDate.value = bb.map(function (index, item) {
+          // return index + ' / ' + (aa[item] ? aa[item] : '')
+            return  `           ${index.toString().substring(5)}
+           / 
+           ${aa[item] ? aa[item].toString().substring(5) : ''}`
+        })
+
+      }
+      
+
+      console.log('resultListDate.value')
+      console.log(resultListDate.value)
     }
     function echarts2() {
       let myChart = echarts.init(chainChartRef.value)
@@ -61,15 +78,24 @@ export default defineComponent({
         toolbox: {
           show: true,
           feature: {
-            saveAsImage: { show: true, color: 'black' },
+            // dataView: { show: true, readOnly: false },
+            // magicType: { show: true, type: ["line", "bar"] },
+            // restore: { show: true },
+            saveAsImage: {
+              show: true,
+              color: 'black',
+              title: '',
+              name: '图表下载',
+            },
           },
           iconStyle: {
             borderColor: '#666',
           },
         },
         grid: {
-          left: '3%',
-          right: '4%',
+          top:'32%',
+          left: '5%',
+          right: '8%',
           bottom: '5%',
           containLabel: true,
         },
@@ -80,12 +106,19 @@ export default defineComponent({
           axisTick: {
             show: true, //去除刻度线
           },
-      //  axisLabel:false,
-          // axisLabel: {
-          //   interval:0,
-          //       rotate:"-12",
-          //   color: 'black', // 文本颜色
-          // },
+          // showMinLabel: true,//显示最小值
+            showMaxLabel: true,//显示最大值
+
+          //  axisLabel:false,
+          axisLabel: {
+            // interval:0,
+            //     rotate:"-12",
+            // color: 'black', // 文本颜色
+            showMinLabel: true,//显示最小值
+            showMaxLabel: true,//显示最大值
+          
+
+          },
           axisLine: {
             show: false, // 去除轴线
           },
@@ -152,7 +185,6 @@ export default defineComponent({
     }
 
     const writeValue = (val) => {
-   
       val
 
       getData()
@@ -179,9 +211,8 @@ export default defineComponent({
 
     return {
       chainChartRef,
-      loading,
       echarts,
-      resultListDate
+      resultListDate,
     }
   },
 })

+ 40 - 19
src/views/dataManage/chainAnalysis/index.vue

@@ -86,13 +86,13 @@
           </div>
         </el-radio-group>
       </div>
-      <div class="chainEcharts" >
+      <div class="chainEcharts"  v-loading="loading">
         <echarts
           v-for="(item, index) in echartsDataObj"
           :key="index"
           :echartsDataOne="item"
+          
         ></echarts>
-      
       </div>
     </div>
   </div>
@@ -114,7 +114,6 @@ export default defineComponent({
   setup() {
     const store = useStore()
     const listTabsChange = (value) => {
-      console.log(value)
       if (value == 'allValue') {
         typeSrarch.value = 0
       } else if (value == 'dailyValue') {
@@ -130,6 +129,7 @@ export default defineComponent({
     const typeSrarch = ref(0)
     const treeCheckedList = ref([])
     const valueCalculation = ref()
+     const loading=ref(false)
     // const dateTime = ref([
     //   new Date(2021, 9, 1, 10, 10),
     //   new Date(2021, 9, 30, 10, 10),
@@ -138,7 +138,7 @@ export default defineComponent({
     const ecahrtsData = ref({})
     const echartsDataCurrent = ref([])
     const echartsDataBefore = ref([])
-    const echartsDataObj=ref([])
+    const echartsDataObj = ref([])
     const state = reactive({
       value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
     })
@@ -146,6 +146,7 @@ export default defineComponent({
     //通过站点切换下拉框 change事件改变 tree树中的数据
     const siteChange = () => {
       store.commit('publicDeviceList')
+       treeCheckedList.value=[]
     }
     const currentChecked = (nodeObj, SelectedObj) => {
       nodeObj, SelectedObj
@@ -166,6 +167,7 @@ export default defineComponent({
 
     async function searchData() {
       if (!dateTime.value) {
+         loading.value=false
         ElNotification({
           title: '提示',
           message: '请选择开始和结束时间',
@@ -173,6 +175,7 @@ export default defineComponent({
         })
         return
       }
+      loading.value=true;
 
       if (treeCheckedList.value.length > 0) {
         store.commit('TimeAll_function', dateTime.value)
@@ -180,7 +183,6 @@ export default defineComponent({
 
         // 时间处理start
 
-        console.log(time[0])
 
         var startA = new Date(time[0]) //开始
         startA = startA.getTime()
@@ -192,9 +194,7 @@ export default defineComponent({
 
         var endB = startA - 60 * 1000 //前一个结束时间
         var startB = endB - distance //前一个开始时间
-        console.log('startB')
-        console.log(parseTime(startB))
-        console.log(parseTime(endB))
+       
 
         // 时间处理end
 
@@ -207,6 +207,7 @@ export default defineComponent({
             displayField: treeCheckedList.value,
           })
           .then((requset) => {
+          
             if (requset.status === 'SUCCESS') {
               flag.value = true
               echartsDataCurrent.value = requset.data
@@ -225,30 +226,32 @@ export default defineComponent({
           })
           .then((requset) => {
             if (requset.status === 'SUCCESS') {
+              
               flag2.value = true
               echartsDataBefore.value = requset.data
             } else {
               ElMessage.error(requset.msg)
             }
           })
+        if(echartsDataBefore.value&& echartsDataCurrent.value){
+           loading.value=false
 
-
+        }
         var jsona = JSON.stringify(echartsDataCurrent.value)
         var jsonb = jsona.replace(/"list"/g, '"list2"')
         jsonb = jsonb.replace(/"listDate"/g, '"listDate2"')
         var obj1 = JSON.parse(jsonb)
 
-        var obj2 = echartsDataBefore.value;
-         echartsDataObj.value = obj1.map((item, index) => {
+        var obj2 = echartsDataBefore.value
+        echartsDataObj.value = obj1.map((item, index) => {
           return { ...item, ...obj2[index] }
         })
-        console.log('echartsDataObj.value')
-        console.log(echartsDataObj.value)
-         if(echartsDataObj.value.length==[]){
-           ElMessage.error('暂无结果') 
-         }
-
+       
+        if (echartsDataObj.value.length == []) {
+          ElMessage.warning('暂无结果')
+        }
       } else {
+         loading.value=false
         console.log('', 1)
         ElNotification({
           title: '提示',
@@ -261,6 +264,7 @@ export default defineComponent({
     return {
       store,
       ...toRefs(state),
+      loading,
       listTabPosition: ref('allValue'),
       data: [
         {
@@ -311,7 +315,7 @@ export default defineComponent({
       ecahrtsData,
       echartsDataCurrent,
       echartsDataBefore,
-         echartsDataObj,
+      echartsDataObj,
 
       valueCalculation,
       typeSrarch,
@@ -327,6 +331,21 @@ export default defineComponent({
 </script>
 
 <style lang="scss" scoped>
+.chainSwitch::-webkit-scrollbar {
+  /*滚动条整体样式*/
+  width: 3px; /*高宽分别对应横竖滚动条的尺寸*/
+}
+.chainSwitch::-webkit-scrollbar-thumb {
+  /*滚动条里面小方块*/
+  border-radius: 10px;
+  background: rgb(226, 224, 224);
+}
+.chainSwitch::-webkit-scrollbar-track {
+  /*滚动条里面轨道*/
+  border-radius: 10px;
+  background: rgb(245, 245, 265);
+}
+
 .chainAnalysis {
   display: flex;
   height: calc(100vh - 130px);
@@ -339,12 +358,14 @@ export default defineComponent({
     margin-right: 25px;
     padding: 20px;
     min-width: 200px;
-        overflow-y: auto;
+    // overflow-y: auto;
     .chainSwitch {
       margin-top: 20px;
       width: 100%;
       height: 20px;
       cursor: pointer;
+      height: calc(100% - 50px);
+      overflow-y: auto;
       .chainSwitchOne {
         display: flex;
         border: 0.5px solid silver;

+ 1 - 1
src/views/dataManage/demandAnalysis/ehcarts/index.vue

@@ -52,7 +52,7 @@ export default defineComponent({
             // dataView: { show: true, readOnly: false },
             // magicType: { show: true, type: ["line", "bar"] },
             // restore: { show: true },
-            saveAsImage: { show: true, color: 'black' },
+            saveAsImage: { show: true, color: 'black' , title:'',name:'图表下载'},
           },
           iconStyle: {
             borderColor: '#666',

+ 21 - 9
src/views/dataManage/demandAnalysis/index.vue

@@ -35,7 +35,7 @@
       <div class="demDivOne">
         <div class="demDivTwo">
           <div class="block">
-            <span class="demonstration" style="color: black">日期:</span>
+            <span class="demonstration" style="margin-right:10px">日期:</span>
             <el-date-picker
               v-model="dateTime"
               type="month"
@@ -54,13 +54,16 @@
         </el-radio-group>
 
         <div style="margin-left: 10px">
-          <el-button icon="el-icon-search" type="primary" @click="searchData()">
+          <el-button icon="el-icon-search" type="primary" @click="searchData()" style="padding: 7px 12px;">
             查询
           </el-button>
         </div>
       </div>
-      <div class="demEcharTable" v-if="flag">
-        <div class="Echarts">
+       <div   v-loading="loading" style="  height: calc(100vh - 192px);
+      overflow-y: auto;">
+
+         <div class="demEcharTable" v-if="flag" >
+        <div class="Echarts"   >
           <div class="ehcartOne">
             <i
               class="el-icon-s-data el-input__icon"
@@ -86,6 +89,10 @@
           </el-table>
         </div>
       </div>
+
+
+       </div>
+      
     </div>
   </div>
 </template>
@@ -113,18 +120,16 @@ export default defineComponent({
     const typeSrarch = ref(1)
     const flag = ref(false)
     const echartsData = ref({})
+     const loading=ref(false)
 
     const siteOption = () => {
-      console.log(store.state)
     }
 
     const listTabsChange = (value) => {
       value == 'monthValue' ? (typeSrarch.value = 2) : (typeSrarch.value = 1)
-      console.log(value)
     }
     const handleNodeClick = (data, obj, node) => {
       data, node
-      console.log(obj.data.deviceCode)
       deviceChecked.value = obj.data.deviceCode
     }
 
@@ -143,6 +148,7 @@ export default defineComponent({
       deviceBoxList()
     }
     function deviceBoxList() {
+    
       api
         .deviceBoxList({
           siteId: store.state.siteId,
@@ -154,7 +160,6 @@ export default defineComponent({
               i.id = index
               i.children = []
             })
-            console.log(deviceBoxData.value)
           } else {
             ElMessage.error(requset.msg)
           }
@@ -162,6 +167,7 @@ export default defineComponent({
     }
     function searchData() {
       if (!dateTime.value) {
+         loading.value=false
         ElNotification({
           title: '提示',
           message: '请选择时间',
@@ -170,8 +176,9 @@ export default defineComponent({
         return
       }
 
-
+       loading.value=true;
       if (deviceChecked.value.length > 0) {
+         
         // alert(1)
         // store.commit('TimeAll_function', dateTime.value)
         // const time = store.state.Time_Data
@@ -184,7 +191,9 @@ export default defineComponent({
             deviceCode: deviceChecked.value,
           })
           .then((requset) => {
+             
             if (requset.status === 'SUCCESS') {
+               loading.value=false;
               flag.value = true
               echartsData.value = requset.data[0]
 
@@ -211,6 +220,7 @@ export default defineComponent({
             }
           })
       } else {
+         loading.value=false;
         console.log('', 1)
         ElNotification({
           title: '提示',
@@ -232,6 +242,7 @@ export default defineComponent({
       siteChange,
       searchData,
       handleNodeClick,
+      loading,
       store,
       listTabPosition: ref('cycleValue'), //单选按钮
       deviceBoxData,
@@ -345,6 +356,7 @@ export default defineComponent({
       .Echarts {
         width: 60%;
         margin-right: 5px;
+       
         .ehcartOne {
           padding-left: 10px;
           background-color: rgb(233 233 233);

+ 3 - 6
src/views/dataManage/energyReport/ehcarts/index.vue

@@ -1,10 +1,10 @@
 <template>
-  <div shadow="never" class="homeBoxCard" v-loading="loading">
+  <div shadow="never" class="homeBoxCard">
     <div :style="'height:' + Height" id="sumeChartRef" ref="sumeChartRef" />
   </div>
 </template>
 <script>
-import { computed, defineComponent, onMounted, ref, watch } from 'vue'
+import { computed, defineComponent, onMounted,  watch } from 'vue'
 import { useStore } from 'vuex'
 import * as echarts from 'echarts'
 // import { ChartDataType } from "../../data";
@@ -24,12 +24,10 @@ export default defineComponent({
     const num = computed(() => store.state.Home.worksChartData.num)
 
     // 读取数据 func
-    const loading = ref(true)
 
     const getData = async () => {
       console.log('ecahrts子组件中的props.ecahrtsData')
       console.log(props.echartsData)
-      loading.value = false
     }
 
     function echarts2() {
@@ -47,7 +45,7 @@ export default defineComponent({
             // dataView: { show: true, readOnly: false },
             // magicType: { show: true, type: ["line", "bar"] },
             // restore: { show: true },
-            saveAsImage: { show: true, color: 'black' },
+            saveAsImage: { show: true, color: 'black',title:'',name:'图表下载' },
           },
           iconStyle: {
             borderColor: '#666',
@@ -164,7 +162,6 @@ export default defineComponent({
     )
 
     return {
-      loading,
       total,
       num,
       echarts,

+ 20 - 10
src/views/dataManage/energyReport/index.vue

@@ -100,14 +100,14 @@
           </div>
         </div>
       </div>
-      <div class="energEcharts">
+      <div class="energEcharts" v-loading="loading">
         <template v-if="flag">
           <echarts
             v-if="rightTabsBool"
             :echartsData="echartsData"
             :Height="Height"
           ></echarts>
-          <tables v-else :tableDatas="echartsData" :Height="Height"></tables>
+          <tables v-else :tableDatas="echartsData" :Height="Height" :typeSrarch="typeSrarch" :dateTime="dateTime" :deviceChecked="deviceChecked"></tables>
         </template>
       </div>
     </div>
@@ -137,6 +137,7 @@ export default defineComponent({
     const typeSrarch = ref(1)
     const flag = ref(false)
     const echartsData = ref({})
+     const loading=ref(false)
 
     let dateType = ref('date')
 
@@ -146,7 +147,7 @@ export default defineComponent({
 
     const handleNodeClick = (data, obj, node) => {
       data, node
-      console.log(obj.data.deviceCode)
+      // console.log(obj.data.deviceCode)
       deviceChecked.value = obj.data.deviceCode
     }
     const listTabsChange = (value) => {
@@ -164,19 +165,15 @@ export default defineComponent({
         console.log()
       } else if (value == 'tables' || value == 'echarts') {
         searchData()
-        // timer.value = new Date().getTime()
-        //   console.log('timer.value')
-        //    console.log(timer.value)
-
         if (value == 'echarts') {
           rightTabsBool.value = true 
         } else {
           rightTabsBool.value = false
         }
-        console.log(rightTabsBool.value)
+        // console.log(rightTabsBool.value)
       }
 
-      console.log(dateType)
+      // console.log(dateType)
     }
 
     const state = reactive({
@@ -212,6 +209,7 @@ export default defineComponent({
 
     function searchData() {
       if (!dateTime.value) {
+        loading.value=false
         ElNotification({
           title: '提示',
           message: '请选择开始和结束时间',
@@ -219,6 +217,7 @@ export default defineComponent({
         })
         return
       }
+      loading.value=true;
 
 
       if (deviceChecked.value.length > 0) {
@@ -233,13 +232,19 @@ export default defineComponent({
           })
           .then((requset) => {
             if (requset.status === 'SUCCESS') {
+              loading.value=false
               flag.value = true
               echartsData.value = requset.data[0]
+
+              if (echartsData.value == []) {
+          ElMessage.warning('暂无结果')
+        }
             } else {
               ElMessage.error(requset.msg)
             }
           })
       } else {
+        loading.value=false
         console.log('', 1)
         ElNotification({
           title: '提示',
@@ -261,7 +266,7 @@ export default defineComponent({
               i.id = index
               i.children = []
             })
-            console.log(deviceBoxData.value)
+            // console.log(deviceBoxData.value)
           } else {
             ElMessage.error(requset.msg)
           }
@@ -283,6 +288,7 @@ export default defineComponent({
       checked: ref(false),
       siteChange,
       searchData,
+      loading,
       dateTime,
       deviceBoxList,
       // showTree,
@@ -363,6 +369,10 @@ export default defineComponent({
     width: 85%;
     min-width: 845px;
     height: 100%;
+    .energEcharts {
+      height: calc(100vh - 192px);
+      overflow-y: auto;
+    }
     .energDivOne {
       display: flex;
       margin: 15px 0px 15px 15px;

+ 65 - 13
src/views/dataManage/energyReport/tables/index.vue

@@ -1,15 +1,27 @@
 <template>
   <div>
     <div style="margin: 0 15px">
+      <div style="text-align: right">
+        <el-button type="primary" class="mb-20" @click="DataReportExport()">
+          导出
+        </el-button>
+      </div>
+
       <el-table
         :data="tableData6"
         border
         stripe
         style="max-width: 100%"
         :key="Math.random()"
+        :header-cell-style="headClass"
       >
         <template v-for="(item, index) in cols" :key="index">
-          <el-table-column :prop="item.prop" :label="item.label" align="center">
+          <el-table-column
+            :prop="item.prop"
+            :label="item.label"
+            align="center"
+            min-width="120"
+          >
             <template #default="scope">
               <span>
                 {{ scope.row[item.prop] }}
@@ -22,32 +34,40 @@
   </div>
 </template>
 <script>
-// import { useStore } from "vuex";
 import { defineComponent, watch, ref, onMounted } from 'vue'
+import * as api from '@/api/dataManage/energyReport.js'
+import { ElMessage } from 'element-plus'
+// import { ElNotification } from 'element-plus'
+import { useStore } from 'vuex'
 
 export default defineComponent({
   name: 'consumConfig',
   components: {},
-  props: ['Height', 'tableDatas'],
+  props: ['tableDatas', 'typeSrarch', 'deviceChecked', 'dateTime'],
 
   setup(props) {
+     const store = useStore()
     const Update = (row) => {
       console.log('', row)
     }
-    
+    const cycle = ref(0)
+    const deviceCode = ref('')
+    const timeArr = ref([])
+
     //处理数据
     const getData = async () => {
-      console.log('table子组件中的props.tableDatas')
-      console.log(props.tableDatas.listDate)
       var aa = props.tableDatas.listDate
-      var newArr=[]
+      var newArr = []
       aa.forEach((item, index) => {
         newArr.push({ label: item, prop: index.toString() })
       })
 
-      newArr.push({ label: '合计', prop: 'total' },{ label: '单位', prop: 'unit' })
+      newArr.push(
+        { label: '合计', prop: 'total' },
+        { label: '单位', prop: 'unit' }
+      )
       newArr.unshift({ label: '名称', prop: 'name' })
-      console.log(newArr)
+      // console.log(newArr)
       cols.value = newArr
 
       var bb = props.tableDatas.list
@@ -58,7 +78,7 @@ export default defineComponent({
       obj.name = props.tableDatas.name
       obj.unit = 'kWh'
       obj.total = sum(props.tableDatas.list).toFixed(2)
-      console.log(obj)
+      // console.log(obj)
       tableData6.value[0] = obj
     }
     const cols = ref([
@@ -83,7 +103,7 @@ export default defineComponent({
 
     // 表头样式设置
     const headClass = () => {
-      return 'background:#FAFAFA !important;color: black;'
+      return 'background:#FAFAFA !important;color: black'
     }
 
     // 求和
@@ -95,9 +115,36 @@ export default defineComponent({
       return s
     }
 
+    //导出
+    const DataReportExport = () => {
+      store.commit('TimeAll_function', timeArr.value)
+        const time = store.state.Time_Data
+
+      api.monthlyReportExport({
+          cycle: cycle.value,
+            startTime: time[0],
+            endTime: time[1],
+            deviceCode: deviceCode.value,
+      }).then((requset) => {
+        if (requset.status === 'SUCCESS') {
+          window.location.href = window.PLATFROM_CONFIG.fileUrl + requset.data
+          ElMessage.success({
+            message: '导出成功',
+            type: 'success',
+          })
+        } else {
+          ElMessage.error(requset.msg)
+        }
+      })
+    }
+
     const writeValue = (val) => {
       val
       getData()
+
+      cycle.value = props.typeSrarch
+      deviceCode.value = props.deviceChecked
+      timeArr.value = props.dateTime
     }
 
     //监听变化
@@ -106,7 +153,7 @@ export default defineComponent({
       (newVal, oldVal, clear) => {
         // 执行异步任务,并得到关闭异步任务的 id
         // alert(1)
-        console.log(newVal)
+        // console.log(newVal)
         let id = writeValue(newVal, oldVal)
         // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
         clear(() => clearTimeout(id))
@@ -121,9 +168,14 @@ export default defineComponent({
       headClass,
       Update, //修改偏差配置事件
       cols,
+      // cellStyle,
       tableData6,
+      DataReportExport,
+      cycle,
+      deviceCode,
+      timeArr,
+      store,
       // newArr
-     
     }
   },
 })

+ 28 - 22
src/views/dataManage/sameAnalysis/ehcarts/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div shadow="never" class="homeBoxCard" v-loading="loading">
+  <div shadow="never" class="homeBoxCard">
     <!-- <div>{{aa}}</div> -->
     <div :style="'height:' + Height" ref="sumeChartRef" />
   </div>
@@ -8,6 +8,7 @@
 import { computed, defineComponent, onMounted, ref, watch } from 'vue'
 import { useStore } from 'vuex'
 import * as echarts from 'echarts'
+import json from './json.js'
 // import { ChartDataType } from "../../data";
 
 // const dataAll = [
@@ -52,7 +53,7 @@ import * as echarts from 'echarts'
 //   },
 // ]
 
-const yName = 'kV'
+const yName = ''
 
 export default defineComponent({
   name: 'CurveCom',
@@ -77,9 +78,7 @@ export default defineComponent({
     const dataTime = ref([])
 
     // 读取数据 func
-    const loading = ref(true)
     const getData = async () => {
-      loading.value = false
       // console.log('props.ecahrtsData')
       // console.log(props.ecahrtsData)
       aa.value = props.ecahrtsData[0] ? props.ecahrtsData[0].name : ''
@@ -104,33 +103,29 @@ export default defineComponent({
 
       if (props.typeSrarch == 1) {
         dataTime.value = arr1.map(function (item) {
-          return item.toString().substring(5,10);
+          return item.toString().substring(5, 10)
         })
         console.log('dataTime.value')
         console.log(dataTime.value)
       } else if (props.typeSrarch == 2) {
-       dataTime.value = arr1.map(function (item) {
-          return item.toString().substring(5,7)+'月';
+        dataTime.value = arr1.map(function (item) {
+          return item.toString().substring(5, 7) + '月'
         })
-      }else{
-         dataTime.value = arr1.map(function (item) {
-          return item
+      } else {
+        dataTime.value = arr1.map(function (item) {
+          return item.toString().substring(5)
         })
       }
     }
 
+
     function ecahrts() {
+      console.log('json.color')
+      console.log(json.color)
       let myChart = echarts.init(sumeChartRef.value)
       myChart.setOption(
         {
-          color: [
-            '#FEB70D',
-            '#50F335',
-            '#0DC8FE',
-            '#e4ff40',
-            '#ff409a',
-            '#ff4040',
-          ],
+          color: json.color,
           title: {
             text: '同比分析',
             left: 'center',
@@ -145,9 +140,11 @@ export default defineComponent({
           },
           // 图列组件
           legend: {
+             type:'scroll',//就这一个属性 设置legend滚动轴的出现
             itemHeight: 10, //改变圆圈大小
             itemWidth: 26, //改变圆圈大小
             itemGap: 30,
+            width: '80%',
             textStyle: {
               color: 'black',
             },
@@ -157,8 +154,19 @@ export default defineComponent({
           },
           toolbox: {
             show: true,
+            // feature: {
+            //   saveAsImage: { show: true, color: 'black' },
+            // },
             feature: {
-              saveAsImage: { show: true, color: 'black' },
+              // dataView: { show: true, readOnly: false },
+              // magicType: { show: true, type: ["line", "bar"] },
+              // restore: { show: true },
+              saveAsImage: {
+                show: true,
+                color: 'black',
+                title: '',
+                name: '图表下载',
+              },
             },
             iconStyle: {
               borderColor: '#666',
@@ -227,11 +235,10 @@ export default defineComponent({
       getData()
       ecahrts()
     }
-     const writeValue2 = (val) => {
+    const writeValue2 = (val) => {
       val
 
       getData()
-  
     }
 
     //监听变化
@@ -274,7 +281,6 @@ export default defineComponent({
     return {
       Height,
       sumeChartRef,
-      loading,
       aa,
       num,
       newDataName,

+ 12 - 0
src/views/dataManage/sameAnalysis/ehcarts/json.js

@@ -0,0 +1,12 @@
+let color = ['#FEB70D', "#FFB6C1",
+    '#50F335',
+    '#0DC8FE',
+    '#e4ff40',
+    '#ff409a',
+    '#ff4040',
+    '#B0C4DE', '#778899', '#708090', '#4682B4', '#87CEFA', '#87CEEB', '#00BFFF', '#ADD8E6', '#B0E0E6', '#5F9EA0', '#00FFFF', '#00CED1', '#2F4F4F', '#008B8B', '#40E0D0', '#7FFFAA', '#00FA9A', '#3CB371', '#98FB98', '#00FF00', '#228B22', '#008000', '#006400', '#7FFF00', '#7CFC00', '#ADFF2F', '#556B2F', '#FFFFE0',
+];
+// 定义数据出口
+module.exports = {
+    color: color
+}

+ 43 - 8
src/views/dataManage/sameAnalysis/index.vue

@@ -26,6 +26,7 @@
           accordion
           :check-strictly="true"
           :props="defaultProps"
+          @change="changeTree"
           @check="currentChecked"
         />
       </div>
@@ -79,11 +80,12 @@
           </div>
         </el-radio-group>
       </div>
-      <div class="sameEcharts">
+      <div class="sameEcharts"  v-loading="loading">
         <echarts
           :ecahrtsData="ecahrtsData"
           :typeSrarch="typeSrarch"
           v-if="flag && ecahrtsData[0]"
+         
         ></echarts>
       </div>
     </div>
@@ -110,13 +112,17 @@ export default defineComponent({
     const tree = ref(null)
     const typeSrarch = ref(0)
     const flag = ref(false)
+     const loading=ref(false)
 
     const valueCalculation = ref()
     const dateTime = ref('')
     const ecahrtsData = ref({})
+    function changeTree(){
+
+    }
 
     const listTabsChange = (value) => {
-      console.log(value)
+      // console.log(value)
       if (value == 'allValue') {
         typeSrarch.value = 0
       } else if (value == 'dailyValue') {
@@ -147,6 +153,7 @@ export default defineComponent({
 
     function searchData() {
       if (!dateTime.value) {
+        loading.value=false
         ElNotification({
           title: '提示',
           message: '请选择开始和结束时间',
@@ -154,11 +161,12 @@ export default defineComponent({
         })
         return
       }
+      loading.value=true;
 
       if (treeCheckedList.value.length > 0) {
-        console.log('', store.state.deviceList)
-        console.log('treeCheckedList')
-        console.log(treeCheckedList.value)
+        // console.log('', store.state.deviceList)
+        // console.log('treeCheckedList')
+        // console.log(treeCheckedList.value)
         store.commit('TimeAll_function', dateTime.value)
         const time = store.state.Time_Data
         api
@@ -170,19 +178,21 @@ export default defineComponent({
             displayField: treeCheckedList.value,
           })
           .then((requset) => {
+            loading.value=false
             if (requset.status === 'SUCCESS') {
               flag.value = true
               ecahrtsData.value = requset.data
 
               if (!ecahrtsData.value[0]) {
-                ElMessage.error('暂无结果')
+                ElMessage.warning('暂无结果')
               }
             } else {
               ElMessage.error(requset.msg)
             }
           })
       } else {
-        console.log('', 1)
+         loading.value=false
+        // console.log('', 1)
         ElNotification({
           title: '提示',
           message: '请选择测点',
@@ -193,6 +203,7 @@ export default defineComponent({
 
     //通过站点切换下拉框 change事件改变 tree树中的数据
     const siteChange = () => {
+      treeCheckedList.value=[]
       store.commit('publicDeviceList')
     }
 
@@ -217,6 +228,7 @@ export default defineComponent({
       siteChange,
       listTabsChange,
       typeSrarch,
+      loading,
       options: ref([
         {
           value: 1,
@@ -237,12 +249,26 @@ export default defineComponent({
       ]),
       valueCalculation,
       ecahrtsData,
+      changeTree
     }
   },
 })
 </script>
 
 <style lang="scss" scoped>
+
+
+.sameSwitch::-webkit-scrollbar {/*滚动条整体样式*/
+        width: 3px;     /*高宽分别对应横竖滚动条的尺寸*/
+    }
+.sameSwitch::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
+        border-radius: 10px;
+        background: rgb(226, 224, 224);
+}
+.sameSwitch::-webkit-scrollbar-track {/*滚动条里面轨道*/
+        border-radius: 10px;
+        background: rgb(245, 245, 265);
+}
 .sameAnalysis {
   display: flex;
   height: calc(100vh - 130px);
@@ -255,12 +281,14 @@ export default defineComponent({
     margin-right: 25px;
     padding: 20px;
     min-width: 200px;
-        overflow-y: auto;
+        // overflow-y: auto;
     .sameSwitch {
       margin-top: 20px;
       width: 100%;
       height: 20px;
       cursor: pointer;
+      height: calc(100% - 50px);
+      overflow-y: auto;
       .sameSwitchOne {
         display: flex;
         border: 0.5px solid silver;
@@ -283,6 +311,10 @@ export default defineComponent({
     width: 85%;
     min-width: 845px;
     height: 100%;
+     .sameEcharts {
+      height: calc(100vh - 192px);
+      overflow-y: auto;
+    }
     .sameDivOne {
       display: flex;
       margin: 15px 0px 15px 15px;
@@ -294,9 +326,12 @@ export default defineComponent({
     }
   }
 }
+
 </style>
 
 <style lang="less">
+
+
 .sameSwitch {
   .el-tree-node__content .el-checkbox__input {
     display: none;

+ 26 - 1
src/views/deviceManage/powerEquip/communicateEquip/dialog/cloneDialog.vue

@@ -46,6 +46,25 @@
             clearable
           />
         </el-form-item>
+
+        <el-form-item label="选择站点:" v-if="form.type != 1">
+          <el-select
+              v-model="store.state.siteId"
+              @change="siteChange"
+              placeholder="请选择"
+              clearable
+              filterable
+            >
+              <el-option
+                v-for="item in store.state.siteList"
+                :key="item.id"
+                :label="item.siteName"
+                :value="item.id"
+              ></el-option>
+            </el-select>
+        </el-form-item>
+        
+       
         <el-form-item label="选择设备:" v-if="form.type != 1">
           <el-select
             filterable
@@ -179,11 +198,15 @@ export default defineComponent({
     function resetForm() {
       ruleForm.value.resetFields()
     }
+    // 通过站点切换下拉框 change事件改变
+    const siteChange = () => {
+      select_deviceList()
+    }
 
     function select_deviceList() {
       api
         .deviceList({
-          siteId: 0,
+          siteId: store.state.siteId,
         })
         .then((requset) => {
           if (requset.status === 'SUCCESS') {
@@ -208,6 +231,8 @@ export default defineComponent({
     })
 
     return {
+      siteChange,
+      store,
       open,
       close,
       clone,

+ 2 - 2
src/views/deviceManage/powerEquip/communicateEquip/dialog/insert_update.vue

@@ -215,9 +215,9 @@ export default defineComponent({
             trigger: 'blur',
           },
           {
-            min: 5,
+            min: 2,
             max: 50,
-            message: '设备安装位置长度不能小于5大于50',
+            message: '设备安装位置长度不能小于2大于50',
             trigger: 'blur',
           },
         ],

+ 13 - 2
src/views/deviceManage/powerEquip/communicateEquip/index.vue

@@ -51,6 +51,7 @@
           :action="fileUrl + 'device/deviceImport'"
           :on-progress="handleProgress"
           :on-success="handleUpAvatar"
+          :on-error="handleError"
           multiple
           :limit="1"
           :headers="{
@@ -118,13 +119,13 @@
         ></el-table-column>
         <el-table-column
           prop="offlineDuration"
-          label="离线时长"
+          label="离线时长(小时)"
           align="center"
           width=""
         ></el-table-column>
         <el-table-column
           prop="onlineDuration"
-          label="在线时长"
+          label="在线时长(小时)"
           align="center"
           width=""
         ></el-table-column>
@@ -267,6 +268,15 @@ export default defineComponent({
       })
       Select()
     }
+    const handleError = (res) => {
+      let myError = res.toString() //转字符串
+      myError = myError.replace('Error: ', '') //去掉前面的
+      myError = JSON.parse(myError) //转对象
+      ElMessage.error({
+        message: myError.msg,
+        type: 'error',
+      })
+    }
 
     //导出
     const DataReportExport = () => {
@@ -441,6 +451,7 @@ export default defineComponent({
       accessToken,
       handleProgress,
       handleUpAvatar,
+      handleError,
       store,
     }
   },

+ 2 - 2
src/views/deviceManage/powerEquip/deviceDetails.vue

@@ -63,7 +63,7 @@
       :header-cell-style="headClass"
       :height="Height"
     >
-      <el-table-column prop="status" align="center" label="状态" width="50">
+      <!-- <el-table-column prop="status" align="center" label="状态" width="50">
         <template #default="scope">
           <el-avatar
             class="status"
@@ -74,7 +74,7 @@
             "
           ></el-avatar>
         </template>
-      </el-table-column>
+      </el-table-column> -->
       <el-table-column
         prop="monitorDeviceName"
         label="监控设备名称"

+ 61 - 21
src/views/deviceManage/powerEquip/index.vue

@@ -10,7 +10,7 @@
         <div class="first">
           <div class="insertBox" v-if="deviceNumData.length == ''">
             <div class="firstTop">
-              <div class="firstTopLeft">
+              <div class="firstTopLeft ">
                 <!-- 选择站点:
                 <el-select
                   v-model="store.state.siteId"
@@ -24,15 +24,30 @@
                     :value="site.id"
                   ></el-option>
                 </el-select> -->
-
-                <span class="firstTopLeftTitle">站点名称:</span>
-                <el-input
-                  placeholder="输入关键字进行过滤"
-                  v-model="filterText"
-                  class="firstTopLeftInput"
-                >
-             
-                </el-input>
+                <div class="filter-item">
+                  <span class="firstTopLeftTitle">站点名称:</span>
+                  <el-input
+                    placeholder="输入关键字进行过滤"
+                    v-model="filterText"
+                    class="firstTopLeftInput"
+                  ></el-input>
+                </div>
+                <div class="filter-item">
+                  <span class="firstTopLeftTitle">联系人:</span>
+                  <el-input
+                    v-model="userName"
+                     placeholder="请输入联系人"
+                    class="firstTopLeftInput"
+                  ></el-input>
+                </div>
+                <div class="filter-item">
+                  <span class="firstTopLeftTitle">手机号:</span>
+                  <el-input
+                    v-model="phone"
+                     placeholder="请输入手机号码"
+                    class="firstTopLeftInput"
+                  ></el-input>
+                </div>
 
                 <el-button
                   type="primary"
@@ -56,8 +71,7 @@
 
             <div class="firstContent">
               <el-table
-                :data="
-                  tableData"
+                :data="tableData"
                 border
                 stripe
                 :header-cell-style="headClass"
@@ -129,7 +143,7 @@
               :Height="Height"
               :refresh="refresh"
               @updateRow="update"
-               @func="getMsgFormSon"
+              @func="getMsgFormSon"
             ></deviceDetails>
           </div>
 
@@ -146,8 +160,11 @@
       <el-tab-pane label="视频监测设备" name="videoEquip">
         <video-Equip :Height="Height" :activeName="activeName"></video-Equip>
       </el-tab-pane>
-      <el-tab-pane label="通信设备"  name="communicateEquip">
-        <communicate-Equip :Height="Height" :activeName="activeName"></communicate-Equip>
+      <el-tab-pane label="通信设备" name="communicateEquip">
+        <communicate-Equip
+          :Height="Height"
+          :activeName="activeName"
+        ></communicate-Equip>
       </el-tab-pane>
       <!-- <el-tab-pane label="通道列表" name="channelList">
         <channel-List :Height="Height"></channel-List>
@@ -157,7 +174,7 @@
 </template>
 <script>
 import { useStore } from 'vuex'
-import { defineComponent, ref, reactive, onMounted } from 'vue'
+import { defineComponent, ref, reactive, onMounted, watch } from 'vue'
 import deviceDetails from './deviceDetails.vue'
 import videoEquip from './videoEquip/index.vue'
 import insertDialog from './powerDialog/insertDialog.vue'
@@ -187,6 +204,8 @@ export default defineComponent({
     const refresh = ref(false) //设备列表详情table 是否重新调用
     const activeName = ref('powerEquip')
     const filterText = ref('')
+    const userName = ref('')
+    const phone = ref('')
     const show = ref(false)
     const updateTitle = ref('')
 
@@ -251,7 +270,9 @@ export default defineComponent({
         .monitorDeviceList({
           size: pageSize.value,
           current: currentPage.value,
-          siteName:filterText.value
+          siteName: filterText.value,
+          userName:userName.value,
+          phone:phone.value
         })
         .then((requset) => {
           if (requset.status === 'SUCCESS') {
@@ -282,13 +303,10 @@ export default defineComponent({
       monitorDeviceList()
     }
 
-
     const getMsgFormSon = () => {
       deviceNumData.value = ''
     }
 
-
-
     // 表头样式设置
     const headClass = () => {
       return 'background:#FAFAFA !important;color: black;'
@@ -298,9 +316,22 @@ export default defineComponent({
     window.addEventListener('resize', () => {
       Height.value = window.innerHeight - 300 + 'px'
     })
+
+    watch(
+      () => activeName.value,
+      (newVal) => {
+        newVal
+        if (newVal == 'powerEquip') {
+          // deviceNewsList()
+          deviceNumData.value = ''
+        }
+      }
+    )
+
     onMounted(() => {
       monitorDeviceList()
     })
+
     return {
       refresh,
       Height,
@@ -308,6 +339,8 @@ export default defineComponent({
       tableData,
       activeName,
       filterText,
+      userName,
+      phone,
       show,
       addItem,
       update,
@@ -347,7 +380,7 @@ export default defineComponent({
     height: 32px;
     line-height: 32px;
     .firstTopLeft {
-      width: 70%;
+      width: 100%;
       .goBack {
         margin-right: 15px;
       }
@@ -400,4 +433,11 @@ export default defineComponent({
   margin-top: 15px;
   float: right;
 }
+.filter-item{
+  display:inline-block;
+  margin-right:20px;
+  .firstTopLeftInput{
+    width:180px!important
+  }
+}
 </style>

+ 5 - 4
src/views/deviceManage/powerEquip/powerDialog/insertDialog.vue

@@ -31,6 +31,7 @@
           </el-form-item>
           <el-form-item label="所属站点:" prop="siteId">
             <el-select
+            filterable
               v-model="form.siteId"
               :disabled="
                 deviceNumDataContent != '' &&
@@ -261,8 +262,8 @@ export default defineComponent({
           },
           {
             min: 3,
-            max: 10,
-            message: '名称长度不能小于3大于10',
+            max: 25,
+            message: '设备名称字段长度应大于3,且小于25', 
             trigger: 'blur',
           },
         ],
@@ -273,9 +274,9 @@ export default defineComponent({
             trigger: 'blur',
           },
           {
-            min: 5,
+            min: 3,
             max: 25,
-            message: '设备编号长度不能小于5大于25',
+            message: '设备编号字段长度应大于3,且小于25',
             trigger: 'blur',
           },
         ],

+ 21 - 24
src/views/deviceManage/powerEquip/videoEquip/checkVideo.vue

@@ -1,20 +1,13 @@
 <template>
-
-    <el-dialog
-      :title="dialogTitle"
-      v-model="dialogVisible"
-      width="600px"
-  
-      @close="closeDialog(0)"
-       @open="open"
-    >
-    <div
-      v-html="randerHtml"
-      style="width: 100%; height: 400px; background: #000"
-    ></div>
-     
-    </el-dialog>
-
+  <el-dialog
+    :title="dialogTitle"
+    v-model="dialogVisible"
+    width="600px"
+    @close="closeDialog(0)"
+    @open="open"
+  >
+    <div v-html="randerHtml" style="width: 100%; background: #000"></div>
+  </el-dialog>
 </template>
 
 <script>
@@ -43,16 +36,17 @@ export default defineComponent({
 
     // open(): Dialog弹窗打开之前做的事
     const open = () => {
-
       // videoUrl.value = 'http://47.103.74.123/hls/'+props.deviceCode+'.m3u8';
-      videoUrl.value ='http://cctvalih5ca.v.myalicdn.com/live/cctv1_2/index.m3u8'
+      videoUrl.value = 'https://iot.usky.cn/hls/' + props.deviceCode + '.m3u8'
+      console.log(videoUrl.value)
+      //  alert(videoUrl.value)
+      // videoUrl.value ='http://cctvalih5ca.v.myalicdn.com/live/cctv1_2/index.m3u8'
 
       window.setTimeout(getVideo, 100)
-
     }
     function getVideo() {
       randerHtml.value =
-        '<video id="my-video" class="video-js vjs-default-skin" controls preload="auto" style="width: 100%; height: 400px" poster loop="loop" autoplay="autoplay" ></video>'
+        '<video id="my-video" class="video-js vjs-default-skin" controls preload="auto" style="width: 100%; min-height: 400px" poster loop="loop" autoplay="autoplay" ></video>'
 
       let options = {
         bigPlayButton: false,
@@ -71,7 +65,7 @@ export default defineComponent({
       }
 
       window.setTimeout(function () {
-        player.value = videojs('my-video', options,)
+        player.value = videojs('my-video', options)
       }, 100)
     }
 
@@ -79,6 +73,7 @@ export default defineComponent({
     const closeDialog = () => {
       if (player.value) {
         player.value.dispose()
+        //  player.value.distory()
         randerHtml.value = ''
       }
 
@@ -114,12 +109,14 @@ export default defineComponent({
 
 // label样式
 .el-form-item__label {
-    width: 150px
+  width: 150px;
 }
 .el-form-item__content {
-    margin-left: 150px
+  margin-left: 150px;
 }
 </style>
 <style >
-* { touch-action: pan-y; }
+* {
+  touch-action: pan-y;
+}
 </style>

+ 28 - 27
src/views/deviceManage/powerEquip/videoEquip/index.vue

@@ -57,11 +57,9 @@
         stripe
         :header-cell-style="headClass"
         :height="Height"
-
-         v-loading="loadingStatus"
-      element-loading-text="摄像头打开中...."
-      element-loading-background="rgba(255, 255, 255, 0.6)"
-      
+        v-loading="loadingStatus"
+        element-loading-text="摄像头打开中...."
+        element-loading-background="rgba(255, 255, 255, 0.6)"
       >
         <el-table-column
           prop="stationStatus"
@@ -128,10 +126,10 @@
         ></el-table-column>
         <el-table-column label="视频画面" align="center" width="150">
           <template #default="scope" style="text-align: center">
-           <a v-if="scope.row.ALIVEVALUE == 3" @click="open_video(scope.row)">
-            查看
-          </a>
-          <span v-else style="color: #aaa">--</span>
+            <a v-if="scope.row.ALIVEVALUE == 3" @click="open_video(scope.row)">
+              查看
+            </a>
+            <span v-else style="color: #aaa">--</span>
           </template>
         </el-table-column>
       </el-table>
@@ -153,6 +151,7 @@
         :dialogTitle="dialogTitle"
         @closeDialog="closeDialog"
         :flag="showDialog"
+        :deviceCode="deviceCode"
       ></check-video>
       <!--视频弹框组件结束-----------------------end-->
     </div>
@@ -162,7 +161,7 @@
 </template>
 <script>
 import { useStore } from 'vuex'
-import { defineComponent, ref, onMounted,watch } from 'vue'
+import { defineComponent, ref, onMounted, watch } from 'vue'
 import { ElMessage } from 'element-plus'
 import * as api from '@/api/deviceManage/videoEquip.js'
 import checkVideo from './checkVideo'
@@ -221,10 +220,12 @@ export default defineComponent({
       showDialog.value = false
       // videoMonitoringDeviceList()
     }
-    function searchData(){
+    function searchData() {
+      loadingStatus.value = false
+      reCount.value = 0
+      openId.value = ''
       videoMonitoringDeviceList()
       chk_video()
-
     }
 
     //视频列表
@@ -262,22 +263,22 @@ export default defineComponent({
           }
         )
         .then((response) => {
-          console.log('response cgi')
-          console.log(response.data.RESULT.LIST)
-          console.log(openId.value)
+          // console.log('response cgi')
+          // console.log(response.data.RESULT.LIST)
+          // console.log(openId.value)
           onLineVideoList.value = response.data.RESULT.LIST
 
           if (openId.value.length > 0) {
             // start
-            console.log('doododododododo')
+            // console.log('doododododododo')
             for (var n = 0; n < onLineVideoList.value.length; n++) {
               if (openId.value == onLineVideoList.value[n].DEVICE) {
-                console.log('再次打开摄像头')
-                console.log(openId.value)
-                console.log(onLineVideoList.value[n].DEVICE)
-                console.log(onLineVideoList.value[n].ONAIR)
+                // console.log('再次打开摄像头')
+                // console.log(openId.value)
+                // console.log(onLineVideoList.value[n].DEVICE)
+                // console.log(onLineVideoList.value[n].ONAIR)
                 reCount.value++
-                console.log(reCount.value)
+                // console.log(reCount.value)
                 if (onLineVideoList.value[n].ONAIR) {
                   if (++count.value > 2) {
                     loadingStatus.value = false
@@ -312,8 +313,8 @@ export default defineComponent({
                 }
               }
             }
-            console.log('处理后的,tableData.value')
-            console.log(tableData.value)
+            // console.log('处理后的,tableData.value')
+            // console.log(tableData.value)
           }
         })
         .catch((error) => {
@@ -329,10 +330,10 @@ export default defineComponent({
       }
       for (var n = 0; n < onLineVideoList.value.length; n++) {
         if (onLineVideoList.value[n].DEVICE == openId.value) {
-          console.log('第一次打开时设备及其状态')
-          console.log(onLineVideoList.value[n].DEVICE)
-          console.log(openId.value)
-          console.log(onLineVideoList.value[n].ONAIR)
+          // console.log('第一次打开时设备及其状态')
+          // console.log(onLineVideoList.value[n].DEVICE)
+          // console.log(openId.value)
+          // console.log(onLineVideoList.value[n].ONAIR)
           if (onLineVideoList.value[n].ONAIR) {
             dialogTitle.value = '查看视频'
             showDialog.value = true

+ 2 - 0
src/views/index/index.vue

@@ -8,5 +8,7 @@
 export default {
   name: 'Index',
   components: {},
+
 }
+
 </script>

+ 134 - 0
src/views/login/JcRange.vue

@@ -0,0 +1,134 @@
+<template>
+  <div class="jc-component__range">
+    <div class="jc-range" :class="rangeStatus?'success':''">
+      <i @mousedown="rangeMove" :class="rangeStatus?successIcon:startIcon"></i>
+      {{rangeStatus?successText:startText}}
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  props: {
+    // 成功之后的函数
+    // successFun: {
+    //   type: Function
+    // },
+    //成功图标
+    successIcon: {
+      type: String,
+      default: "el-icon-success"
+    },
+    //成功文字
+    successText: {
+      type: String,
+      default: "验证成功"
+    },
+    //开始的图标
+    startIcon: {
+      type: String,
+      default: "el-icon-d-arrow-right"
+    },
+    //开始的文字
+    startText: {
+      type: String,
+      default: "拖动滑块到最右边"
+    },
+    //失败之后的函数
+    // errorFun: {
+    //   type: Function
+    // },
+    //或者用值来进行监听
+    status: {
+      type: String
+    }
+  },
+  name: "Silder",
+  data() {
+    return {
+        rangeStatus:'',
+        
+    };
+  },
+  methods: {
+    rangeMove(e){
+			let ele = e.target;
+			let startX = e.clientX;
+			let eleWidth = ele.offsetWidth;
+			let parentWidth =  ele.parentElement.offsetWidth;
+			let MaxX = parentWidth - eleWidth;
+			if(this.rangeStatus){//不运行
+				return false;
+			}
+			document.onmousemove = (e) => {
+				let endX = e.clientX;
+				this.disX = endX - startX;
+				if(this.disX<=0){
+					this.disX = 0;
+				}
+				if(this.disX>=MaxX-eleWidth){//减去滑块的宽度,体验效果更好
+					this.disX = MaxX;
+				}
+				ele.style.transition = '.1s all';
+				ele.style.transform = 'translateX('+this.disX+'px)';
+				e.preventDefault();
+			}
+			document.onmouseup = ()=> {
+				
+				if(this.disX !== MaxX){
+					ele.style.transition = '.5s all';
+					ele.style.transform = 'translateX(0)';
+					this.rangeStatus = false;
+					//执行失败的函数
+
+					 this.$emit('errorFun')
+					// this.errorFun && this.errorFun();
+				}else{
+					this.rangeStatus = true;
+					if(this.status){
+						this.$parent[this.status] = true;
+					}
+					//执行成功的函数
+					this.$emit('successFun')
+					// this.successFun && this.successFun();
+				}
+				document.onmousemove = null;
+				document.onmouseup = null;
+			}
+		}
+  
+  }
+};
+</script>
+<style scoped>
+    .jc-range{
+	background-color: #CCC;
+	position: relative;
+	transition: 1s all;
+	user-select: none;
+	color: #333;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	height: 45px; /*no*/
+}
+.jc-range i{
+	position: absolute;
+	left: 0;
+	width: 60px;/*no*/
+	height: 100%;
+	color: #919191;
+	background-color: #fff;
+	border: 1px solid #bbb;
+	cursor: pointer;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+}
+.jc-range.success{
+	background-color: #7AC23C;
+	color: #fff;
+}
+.jc-range.success i{
+	color: #7AC23C;
+}
+</style>

+ 30 - 8
src/views/login/index.vue

@@ -25,11 +25,20 @@
                 </template>
               </a-input>
             </a-form-item>
+
+            <a-form-item>
+              <JcRange
+              :status="status"
+                @successFun="onSuccess()"
+                @errorFun="onError()"
+              ></JcRange>
+            </a-form-item>
+
             <a-form-item>
               <a-button
                 type="primary"
                 html-type="submit"
-                :disabled="form.username === '' || form.password === ''"
+                :disabled="form.username === '' || form.password === ''||status==false"
               >
                 登录
               </a-button>
@@ -51,11 +60,14 @@ import { mapActions, mapGetters } from 'vuex'
 import { useRouter } from 'vue-router'
 import { UserOutlined, LockOutlined } from '@ant-design/icons-vue'
 
+import JcRange from './JcRange.vue'
+
 export default {
   name: 'Login',
   components: {
     UserOutlined,
     LockOutlined,
+    JcRange,
   },
   data() {
     return {
@@ -63,6 +75,7 @@ export default {
         username: '',
         password: '',
       },
+      status: false,
       redirect: undefined,
       dependencies: dependencies,
       devDependencies: devDependencies,
@@ -83,17 +96,14 @@ export default {
     },
   },
   mounted() {
-    this.form.username = 'admin'
-    this.form.password = 'admin123'
+    this.form.username = ''   //admin
+    this.form.password = ''   //admin123
 
     const router = useRouter()
     console.log(router)
     if (router.currentRoute.value.query.userName === 'admin') {
       this.handleSubmit()
     }
-    // setTimeout(() => {
-    //   this.handleSubmit()
-    // }, 3000)
   },
   methods: {
     ...mapActions({
@@ -104,9 +114,19 @@ export default {
         ? '/'
         : this.redirect
     },
+    onSuccess() {
+      console.log('滑块成功')
+      this.status = true
+   
+    },
+    onError() {
+      console.log('滑块失败')
+      this.status = false
+    },
+
     async handleSubmit() {
       await this.login(this.form)
-      await this.$router.push(this.handleRoute())
+        await this.$router.push(this.handleRoute())
     },
   },
 }
@@ -119,7 +139,8 @@ export default {
   background-size: cover;
   &-form {
     width: calc(100% - 40px);
-    height: 380px;
+    min-width:360px;
+    height: 440px;
     padding: 4vh;
     margin-top: calc((100vh - 380px) / 2);
     margin-right: 20px;
@@ -160,3 +181,4 @@ export default {
   }
 }
 </style>
+l

+ 4 - 3
src/views/planOutage/dialogComponent.vue

@@ -47,7 +47,7 @@
       <el-form-item label="联系人:" prop="contacts">
         <el-input v-model="form.contacts"></el-input>
       </el-form-item>
-      <el-form-item label="状态:" prop="planType">
+      <el-form-item label="类型:" prop="planType">
         <el-select
           v-model="form.planType"
           placeholder="请选择"
@@ -289,9 +289,10 @@ export default defineComponent({
 .el-form-item__content {
   margin-left: 100px;
 }
-</style>
-<style>
 .demo-form-inline .el-form-item:not(.user-layout .el-form-item) {
   margin: 0 auto 20px 55px;
 }
+</style>
+<style>
+
 </style>

+ 2 - 0
src/views/planOutage/index.vue

@@ -82,6 +82,8 @@
         min-width="155px"
       ></el-table-column>
       <el-table-column prop="creator" label="提交人"  min-width="110px"></el-table-column>
+      <el-table-column prop="contacts" label="联系人"  min-width="110px"></el-table-column>
+      <el-table-column prop="phone" label="联系方式"  min-width="110px"></el-table-column>
       <el-table-column prop="type" label="状态" width="">
         <template #default="scope">
           <span

+ 2 - 3
src/views/powerQuality/asseReport/index.vue

@@ -5,16 +5,15 @@
     <el-tabs 
         v-model="activeName"
         type="card"
-        @tab-click="handleClick"
       >
         <el-tab-pane label="评分报告" name="first">
           <br>
-          <score-report></score-report>
+          <score-report :activeName="activeName"></score-report>
        
         </el-tab-pane>
         <el-tab-pane label="单回路报告" name="second">
           <br>
-           <loop-report></loop-report>
+           <loop-report :activeName="activeName"></loop-report>
         </el-tab-pane>
       </el-tabs>
       <br>

+ 525 - 97
src/views/powerQuality/asseReport/loopReport.vue

@@ -12,7 +12,7 @@
               style="width: 220px"
               clearable
               filterable
-               @change="linkDevice()"
+              @change="linkDevice()"
             >
               <el-option
                 v-for="site in store.state.siteList"
@@ -40,17 +40,35 @@
 
           <div class="filter-item">
             日期:
-            <el-date-picker
-              v-model="value4"
+            <!-- <el-date-picker
+              v-model="dateTime"
               type="dates"
               placeholder="请选择"
               style="width: 200px"
+            ></el-date-picker> -->
+
+            <el-date-picker
+              v-model="dateTime"
+              placeholder="请选择"
+              style="width: 150px; margin-left: 20px"
+              :clearable="false"
+              :editable="false"
             ></el-date-picker>
           </div>
 
-          <el-button type="primary" class="search-button">搜索</el-button>
+          <el-button
+            type="primary"
+            class="search-button"
+            @click="SingleLoopReportData()"
+          >
+            搜索
+          </el-button>
         </div>
       </div>
+      <div class="right descIcon" @click="descripDialog()">
+        <img src="@/assets/images/descIcon.png" alt="" />
+        指标说明
+      </div>
     </div>
     <!-- 筛选end -->
 
@@ -59,11 +77,14 @@
         <div class="grid-content bg-purple">
           <div class="blanceChartTit">
             <span>电压质量</span>
-            <span class="subs">标称电压:380V</span>
+            <span class="subs">
+              标称电压:
+              {{ getData.voltageLevel ? getData.voltageLevel : '-' }}V
+            </span>
           </div>
 
-          <el-row :gutter="20" style="padding: 20px">
-            <el-col  :md="24" :lg="8">
+          <el-row :gutter="20" style="padding: 20px" >
+            <el-col :md="24" :lg="8" v-loading="loading" >
               <div
                 class="grid-content bg-purple assCard"
                 style="text-align: center"
@@ -72,37 +93,81 @@
                 <el-row :gutter="20" style="padding: 0 20px">
                   <el-col :span="12">
                     <div class="grid-content bg-purple assSmallbox">
-                      <div class="assNum">0/128</div>
+                      <div class="assNum">
+                        {{ getData.proportionUa ? getData.proportionUa : '-' }}
+                      </div>
                       <div class="assTxt">超限数/测点数</div>
                     </div>
                   </el-col>
                   <el-col :span="12">
                     <div class="grid-content bg-purple assSmallbox">
-                      <div class="assNum greenRate">100%</div>
+                      <div class="assNum greenRate">
+                        {{ getData.qrUa==null ? '-' :getData.qrUa  }}%
+                      </div>
                       <div class="assTxt">合格率</div>
                     </div>
                   </el-col>
                 </el-row>
-                <el-button class="banlanceBtn" round type="primary">
-                  合格
+                <el-button
+                  class="banlanceBtn"
+                  round
+                  :type="
+                    getData.uaStatus == true
+                      ? 'primary'
+                      : getData.uaStatus == false
+                      ? 'danger'
+                      : 'warning'
+                  "
+                >
+                  {{
+                    getData.uaStatus == true
+                      ? '合格'
+                      : getData.uaStatus == false
+                      ? '不合格'
+                      : '暂无结论'
+                  }}
                 </el-button>
                 <ul>
                   <li>
-                    <div>最大值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>最大值:{{ getData.maxUa ? getData.maxUa : '-' }}</div>
+                    <span :class="getData.maxUaStatus ? '' : 'overLimit'">
+                      {{
+                        getData.maxUaStatus == true
+                          ? '未超限'
+                          : getData.maxUaStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                   <li>
-                    <div>最小值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>最小值:{{ getData.minUa ? getData.minUa : '-' }}</div>
+                    <span :class="getData.minUaStatus ? '' : 'overLimit'">
+                      {{
+                        getData.minUaStatus == true
+                          ? '未超限'
+                          : getData.minUaStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                   <li>
-                    <div>平均值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>平均值:{{ getData.avgUa ? getData.avgUa : '-' }}</div>
+                    <span :class="getData.avgUaStatus ? '' : 'overLimit'">
+                      {{
+                        getData.avgUaStatus == true
+                          ? '未超限'
+                          : getData.avgUaStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                 </ul>
               </div>
             </el-col>
-            <el-col  :md="24" :lg="8">
+            <el-col :md="24" :lg="8" v-loading="loading">
               <div
                 class="grid-content bg-purple assCard"
                 style="text-align: center"
@@ -111,37 +176,82 @@
                 <el-row :gutter="20" style="padding: 0 20px">
                   <el-col :span="12">
                     <div class="grid-content bg-purple assSmallbox">
-                      <div class="assNum">0/128</div>
+                      <div class="assNum">
+                        {{ getData.proportionUb ? getData.proportionUb : '-' }}
+                      </div>
                       <div class="assTxt">超限数/测点数</div>
                     </div>
                   </el-col>
                   <el-col :span="12">
                     <div class="grid-content bg-purple assSmallbox">
-                      <div class="assNum greenRate">100%</div>
+                      <div class="assNum greenRate">
+                        {{ getData.qrUb==null ? '-' :getData.qrUb  }}%
+                       
+                      </div>
                       <div class="assTxt">合格率</div>
                     </div>
                   </el-col>
                 </el-row>
-                <el-button class="banlanceBtn" round type="danger">
-                  不合格
+                <el-button
+                  class="banlanceBtn"
+                  round
+                  :type="
+                    getData.ubStatus == true
+                      ? 'primary'
+                      : getData.ubStatus == false
+                      ? 'danger'
+                      : 'warning'
+                  "
+                >
+                  {{
+                    getData.ubStatus == true
+                      ? '合格'
+                      : getData.ubStatus == false
+                      ? '不合格'
+                      : '暂无结论'
+                  }}
                 </el-button>
                 <ul>
                   <li>
-                    <div>最大值:234.87V(6.76%)</div>
-                    <span class="overLimit">超限</span>
+                    <div>最大值:{{ getData.maxUb ? getData.maxUb : '-' }}</div>
+                    <span :class="getData.maxUbStatus ? '' : 'overLimit'">
+                      {{
+                        getData.maxUbStatus == true
+                          ? '未超限'
+                          : getData.maxUbStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                   <li>
-                    <div>最小值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>最小值:{{ getData.minUb ? getData.minUb : '-' }}</div>
+                    <span :class="getData.minUbStatus ? '' : 'overLimit'">
+                      {{
+                        getData.minUbStatus == true
+                          ? '未超限'
+                          : getData.minUbStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                   <li>
-                    <div>平均值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>平均值:{{ getData.avgUb ? getData.avgUb : '-' }}</div>
+                    <span :class="getData.avgUbStatus ? '' : 'overLimit'">
+                      {{
+                        getData.avgUbStatus == true
+                          ? '未超限'
+                          : getData.avgUbStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                 </ul>
               </div>
             </el-col>
-            <el-col  :md="24" :lg="8">
+            <el-col :md="24" :lg="8" v-loading="loading">
               <div
                 class="grid-content bg-purple assCard"
                 style="text-align: center"
@@ -150,32 +260,77 @@
                 <el-row :gutter="20" style="padding: 0 20px">
                   <el-col :span="12">
                     <div class="grid-content bg-purple assSmallbox">
-                      <div class="assNum">0/128</div>
+                      <div class="assNum">
+                        {{ getData.proportionUc ? getData.proportionUc : '-' }}
+                      </div>
                       <div class="assTxt">超限数/测点数</div>
                     </div>
                   </el-col>
                   <el-col :span="12">
                     <div class="grid-content bg-purple assSmallbox">
-                      <div class="assNum greenRate">100%</div>
+                      <div class="assNum greenRate">
+                        {{ getData.qrUc==null ? '-' :getData.qrUc  }}%
+                      
+                      </div>
                       <div class="assTxt">合格率</div>
                     </div>
                   </el-col>
                 </el-row>
-                <el-button class="banlanceBtn" round type="primary">
-                  合格
+                <el-button
+                  class="banlanceBtn"
+                  round
+                  :type="
+                    getData.ucStatus == true
+                      ? 'primary'
+                      : getData.ucStatus == false
+                      ? 'danger'
+                      : 'warning'
+                  "
+                >
+                  {{
+                    getData.ucStatus == true
+                      ? '合格'
+                      : getData.ucStatus == false
+                      ? '不合格'
+                      : '暂无结论'
+                  }}
                 </el-button>
                 <ul>
                   <li>
-                    <div>最大值:234.87V(6.76%)</div>
-                    <span class="overLimit">超限</span>
+                    <div>最大值:{{ getData.maxUc ? getData.maxUc : '-' }}</div>
+                    <span :class="getData.maxUcStatus ? '' : 'overLimit'">
+                      {{
+                        getData.maxUcStatus == true
+                          ? '未超限'
+                          : getData.maxUcStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                   <li>
-                    <div>最小值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>最小值:{{ getData.minUc ? getData.minUc : '-' }}</div>
+                    <span :class="getData.minUcStatus ? '' : 'overLimit'">
+                      {{
+                        getData.minUcStatus == true
+                          ? '未超限'
+                          : getData.minUcStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                   <li>
-                    <div>平均值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>平均值:{{ getData.avgUc ? getData.avgUc : '-' }}</div>
+                    <span :class="getData.avgUcStatus ? '' : 'overLimit'">
+                      {{
+                        getData.avgUcStatus == true
+                          ? '未超限'
+                          : getData.avgUcStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                 </ul>
               </div>
@@ -183,11 +338,13 @@
           </el-row>
         </div>
       </el-col>
-      <el-col  :md="12" :lg="5">
+      <el-col :md="12" :lg="5" v-loading="loading">
         <div class="grid-content bg-purple">
           <div class="blanceChartTit">
             <span>频率质量</span>
-            <span class="subs">标称频率:50Hz</span>
+            <span class="subs">
+              标称频率:{{ getData.mhz ? getData.mhz : 0 }}Hz
+            </span>
           </div>
           <el-row :gutter="20" style="padding: 20px">
             <el-col :span="24">
@@ -199,32 +356,77 @@
                 <el-row :gutter="20" style="padding: 0 20px">
                   <el-col :span="12">
                     <div class="grid-content bg-purple assSmallbox">
-                      <div class="assNum">0/128</div>
+                      <div class="assNum">
+                        {{ getData.proportionF ? getData.proportionF : '-' }}
+                      </div>
                       <div class="assTxt">超限数/测点数</div>
                     </div>
                   </el-col>
                   <el-col :span="12">
                     <div class="grid-content bg-purple assSmallbox">
-                      <div class="assNum greenRate">100%</div>
+                      <div class="assNum greenRate">
+                        <!-- {{ getData.qrF ? getData.qrF : '-' }}% -->
+                        {{ getData.qrF==null ? '-' :getData.qrF  }}%
+                      </div>
                       <div class="assTxt">合格率</div>
                     </div>
                   </el-col>
                 </el-row>
-                <el-button class="banlanceBtn" round type="primary">
-                  合格
+                <el-button
+                  class="banlanceBtn"
+                  round
+                  :type="
+                    getData.fstatus == true
+                      ? 'primary'
+                      : getData.fstatus == false
+                      ? 'danger'
+                      : 'warning'
+                  "
+                >
+                  {{
+                    getData.fstatus == true
+                      ? '合格'
+                      : getData.fstatus == false
+                      ? '不合格'
+                      : '暂无结论'
+                  }}
                 </el-button>
                 <ul>
                   <li>
-                    <div>最大值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>最大值:{{ getData.maxF ? getData.maxF : '-' }}</div>
+                    <span :class="getData.maxFStatus ? '' : 'overLimit'">
+                      {{
+                        getData.maxFStatus == true
+                          ? '未超限'
+                          : getData.maxFStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                   <li>
-                    <div>最小值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>最小值:{{ getData.minF ? getData.minF : '-' }}</div>
+                    <span :class="getData.minFStatus ? '' : 'overLimit'">
+                      {{
+                        getData.minFStatus == true
+                          ? '未超限'
+                          : getData.minFStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                   <li>
-                    <div>平均值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>平均值:{{ getData.avgF ? getData.avgF : '-' }}</div>
+                    <span :class="getData.avgFStatus ? '' : 'overLimit'">
+                      {{
+                        getData.avgFStatus == true
+                          ? '未超限'
+                          : getData.avgFStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                 </ul>
               </div>
@@ -232,7 +434,7 @@
           </el-row>
         </div>
       </el-col>
-      <el-col  :md="12" :lg="5">
+      <el-col :md="12" :lg="5" v-loading="loading">
         <div class="grid-content bg-purple">
           <div class="blanceChartTit">功率因数分析</div>
           <el-row :gutter="20" style="padding: 20px">
@@ -245,19 +447,39 @@
                 <el-row :gutter="20" style="padding: 0 20px">
                   <el-col :span="24" style="margin-bottom: 20px">
                     <div class="grid-content bg-purple assSmallbox">
-                      <div class="assNum">0.9</div>
+                      <div class="assNum">
+                        {{ getData.appraise!=null ? getData.appraise : '-' }}
+                      </div>
                       <div class="assTxt">考核限值</div>
                     </div>
                   </el-col>
                   <el-col :span="24" style="margin-bottom: 20px">
                     <div class="grid-content bg-purple assSmallbox">
-                      <div class="assNum greenRate">-</div>
+                      <div class="assNum greenRate">
+                        {{ getData.cos!=null ? getData.cos : '-' }}
+                      </div>
                       <div class="assTxt">数值</div>
                     </div>
                   </el-col>
                 </el-row>
-                <el-button class="banlanceBtn" round type="warning">
-                  暂无数据
+                <el-button
+                  class="banlanceBtn"
+                  round
+                  :type="
+                    getData.cosStatus == true
+                      ? 'primary'
+                      : getData.cosStatus == false
+                      ? 'danger'
+                      : 'warning'
+                  "
+                >
+                  {{
+                    getData.cosStatus == true
+                      ? '合格'
+                      : getData.cosStatus == false
+                      ? '不合格'
+                      : '暂无结论'
+                  }}
                 </el-button>
               </div>
             </el-col>
@@ -267,7 +489,7 @@
     </el-row>
 
     <el-row :gutter="20" class="mt-20">
-      <el-col   :md="24" :lg="14">
+      <el-col :md="24" :lg="14" v-loading="loading">
         <div class="grid-content bg-purple">
           <div class="blanceChartTit">
             <span>谐波畸变率</span>
@@ -294,7 +516,12 @@
                 style="text-align: center"
               >
                 <div class="subTits">B相电流谐波畸变率</div>
-                <el-row :gutter="20" style="padding: 0 20px">
+                <img
+                  class="noDataImg"
+                  src="@/assets/images/noDataImg.png"
+                  alt=""
+                />
+                <!-- <el-row :gutter="20" style="padding: 0 20px">
                   <el-col :span="12">
                     <div class="grid-content bg-purple assSmallbox">
                       <div class="assNum">0/128</div>
@@ -324,7 +551,7 @@
                     <div>平均值:234.87V(6.76%)</div>
                     <span>未超限</span>
                   </li>
-                </ul>
+                </ul> -->
               </div>
             </el-col>
             <el-col :md="24" :lg="8">
@@ -333,7 +560,12 @@
                 style="text-align: center"
               >
                 <div class="subTits">C相电流谐波畸变率</div>
-                <el-row :gutter="20" style="padding: 0 20px">
+                <img
+                  class="noDataImg"
+                  src="@/assets/images/noDataImg.png"
+                  alt=""
+                />
+                <!-- <el-row :gutter="20" style="padding: 0 20px">
                   <el-col :span="12">
                     <div class="grid-content bg-purple assSmallbox">
                       <div class="assNum">0/128</div>
@@ -363,13 +595,13 @@
                     <div>平均值:234.87V(6.76%)</div>
                     <span>未超限</span>
                   </li>
-                </ul>
+                </ul> -->
               </div>
             </el-col>
           </el-row>
         </div>
       </el-col>
-      <el-col  :md="24" :lg="10">
+      <el-col :md="24" :lg="10">
         <div class="grid-content bg-purple">
           <div class="blanceChartTit">
             <span>不平衡度</span>
@@ -382,35 +614,95 @@
                 style="text-align: center"
               >
                 <div class="subTits">电流不平衡度</div>
-                <el-row :gutter="20" style="padding: 0 20px">
-                  <el-col :span="12">
+                <el-row :gutter="20" style="padding: 0 20px" v-loading="loading">
+                  <el-col :span="12" >
                     <div class="grid-content bg-purple assSmallbox">
-                      <div class="assNum">0/128</div>
+                      <div class="assNum">
+                        {{
+                          getData.proportionElBalun
+                            ? getData.proportionElBalun
+                            : '-'
+                        }}
+                      </div>
                       <div class="assTxt">超限数/测点数</div>
                     </div>
                   </el-col>
                   <el-col :span="12">
                     <div class="grid-content bg-purple assSmallbox">
-                      <div class="assNum greenRate">100%</div>
+                      <div class="assNum greenRate">
+                        {{ getData.qrElBalun==null ? '-' :getData.qrElBalun  }}%
+                      </div>
                       <div class="assTxt">合格率</div>
                     </div>
                   </el-col>
                 </el-row>
-                <el-button class="banlanceBtn" round type="primary">
-                  合格
+                <el-button
+                  class="banlanceBtn"
+                  round
+                  :type="
+                    getData.elBalunStatus == true
+                      ? 'primary'
+                      : getData.elBalunStatus == false
+                      ? 'danger'
+                      : 'warning'
+                  "
+                >
+                  {{
+                    getData.elBalunStatus == true
+                      ? '合格'
+                      : getData.elBalunStatus == false
+                      ? '不合格'
+                      : '暂无结论'
+                  }}
                 </el-button>
                 <ul>
                   <li>
-                    <div>最大值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>
+                      最大值:{{
+                        getData.maxElBalun!=null? getData.maxElBalun : '-'
+                      }}
+                    </div>
+                    <span :class="getData.maxElBalunStatus ? '' : 'overLimit'">
+                      {{
+                        getData.maxElBalunStatus == true
+                          ? '未超限'
+                          : getData.maxElBalunStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                   <li>
-                    <div>最小值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>
+                      最小值:{{
+                        getData.minElBalun!=null ? getData.minElBalun : '-'
+                      }}
+                    </div>
+                    <span :class="getData.minElBalunStatus ? '' : 'overLimit'">
+                      {{
+                        getData.minElBalunStatus == true
+                          ? '未超限'
+                          : getData.minElBalunStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                   <li>
-                    <div>平均值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>
+                      平均值:{{
+                        getData.avgElBalun!=null ? getData.avgElBalun : '-'
+                      }}
+                    </div>
+                    <span :class="getData.avgElBalunStatus ? '' : 'overLimit'">
+                      {{
+                        getData.avgElBalunStatus == true
+                          ? '未超限'
+                          : getData.avgElBalunStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                 </ul>
               </div>
@@ -422,35 +714,96 @@
                 style="text-align: center"
               >
                 <div class="subTits">电压不平衡度</div>
-                <el-row :gutter="20" style="padding: 0 20px">
+                <el-row :gutter="20" style="padding: 0 20px" v-loading="loading">
                   <el-col :span="12">
                     <div class="grid-content bg-purple assSmallbox">
-                      <div class="assNum">0/128</div>
+                      <div class="assNum">
+                        {{
+                          getData.proportionVtBalun
+                            ? getData.proportionVtBalun
+                            : '-'
+                        }}
+                      </div>
                       <div class="assTxt">超限数/测点数</div>
                     </div>
                   </el-col>
                   <el-col :span="12">
                     <div class="grid-content bg-purple assSmallbox">
-                      <div class="assNum greenRate">100%</div>
+                      <div class="assNum greenRate">
+                        {{ getData.qrVtBalun==null ? '-' :getData.qrVtBalun  }}%
+                      </div>
                       <div class="assTxt">合格率</div>
                     </div>
                   </el-col>
                 </el-row>
-                <el-button class="banlanceBtn" round type="primary">
-                  合格
+                <el-button
+                  class="banlanceBtn"
+                  round
+                  :type="
+                    getData.vtBalunStatus == true
+                      ? 'primary'
+                      : getData.vtBalunStatus == false
+                      ? 'danger'
+                      : 'warning'
+                  "
+                >
+                  {{
+                    getData.vtBalunStatus == true
+                      ? '合格'
+                      : getData.vtBalunStatus == false
+                      ? '不合格'
+                      : '暂无结论'
+                  }}
                 </el-button>
+
                 <ul>
                   <li>
-                    <div>最大值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>
+                      最大值:{{
+                        getData.maxVtBalun!=null ? getData.maxVtBalun : '-'
+                      }}
+                    </div>
+                    <span :class="getData.maxVtBalunStatus ? '' : 'overLimit'">
+                      {{
+                        getData.maxVtBalunStatus == true
+                          ? '未超限'
+                          : getData.maxVtBalunStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                   <li>
-                    <div>最小值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>
+                      最小值:{{
+                        getData.minVtBalun!=null ? getData.minVtBalun : '-'
+                      }}
+                    </div>
+                    <span :class="getData.minVtBalunStatus ? '' : 'overLimit'">
+                      {{
+                        getData.minVtBalunStatus == true
+                          ? '未超限'
+                          : getData.minVtBalunStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                   <li>
-                    <div>平均值:234.87V(6.76%)</div>
-                    <span>未超限</span>
+                    <div>
+                      平均值:{{
+                        getData.avgVtBalun!=null ? getData.avgVtBalun : '-'
+                      }}
+                    </div>
+                    <span :class="getData.avgVtBalunStatus ? '' : 'overLimit'">
+                      {{
+                        getData.avgVtBalunStatus == true
+                          ? '未超限'
+                          : getData.avgVtBalunStatus == false
+                          ? '超限'
+                          : '-'
+                      }}
+                    </span>
                   </li>
                 </ul>
               </div>
@@ -459,25 +812,43 @@
         </div>
       </el-col>
     </el-row>
+
+    <!--指标说明弹框组件开始-----------------------start-->
+    <descrip-dialog
+      @closeDialog="closeDialog"
+      :flag="showDialog2"
+      class="descripDialog"
+    ></descrip-dialog>
+    <!--指标说明弹框组件结束-----------------------end-->
   </div>
 </template>
 
 <script>
 import { useStore } from 'vuex'
-import { defineComponent, onMounted,ref } from 'vue'
-import * as api from '@/api/powerQuality/realScore.js'
+import { defineComponent, onMounted, ref, watch } from 'vue'
+import * as api from '@/api/powerQuality/loopReport.js'
+import descripDialog from './scoreReportComponent/descripDialog'
 import { ElMessage } from 'element-plus'
 export default defineComponent({
   name: 'LoopReport',
   components: {
+    descripDialog,
+  },
+  props: {
+    activeName: String,
   },
-  setup() {
+  setup(props) {
     const store = useStore()
-    
+    const loading=ref(false)
+    const getData = ref({})
+    const showDialog2 = ref(false)
+
     const deviceList = ref([])
     const deviceCode = ref('')
+    const dateTime = ref(new Date())
+    const dialogTitle = ref('')
 
-    function linkDevice(){
+    function linkDevice() {
       deviceSelect()
     }
 
@@ -492,10 +863,61 @@ export default defineComponent({
         }
       })
     }
-   
+
+    //单回路主页面请求
+    function SingleLoopReportData() {
+        loading.value=true
+      store.commit('getNowFormatDate', dateTime.value)
+      //  time:store.state.dateList,
+      // time:'2021-11-01'
+      api
+        .SingleLoopReportData({
+          deviceCode: deviceCode.value,
+          time: store.state.dateList,
+          type: 1,
+        })
+        .then((requset) => {
+           loading.value=false
+          if (requset.status === 'SUCCESS') {
+            // console.log('requset.data.uaStatus')
+            // console.log(requset.data.uaStatus)
+            
+            if(requset.data==null){
+               ElMessage.warning('暂无数据')
+            }else{
+              getData.value = requset.data
+
+            }
+          } else {
+            ElMessage.error(requset.msg)
+          }
+        })
+    }
+    // 查看指标说明
+    const descripDialog = () => {
+      dialogTitle.value = '指标说明'
+      showDialog2.value = true
+    }
+    // 关闭操作
+    const closeDialog = () => {
+      showDialog2.value = false
+    }
+
+    watch(
+      () => props.activeName,
+      (newVal) => {
+        if (newVal == 'second') {
+          // getData.value={}
+          deviceSelect()
+          setTimeout(function () {
+            SingleLoopReportData()
+          }, 1000)
+        }
+      }
+    )
+
     onMounted(() => {
       deviceSelect()
-      
     })
     return {
       store,
@@ -503,18 +925,24 @@ export default defineComponent({
       deviceCode,
       linkDevice,
       deviceSelect,
-      value4: '请选择',
+      SingleLoopReportData,
+      dateTime,
       region: '',
-     
+      getData,
+      closeDialog,
+      showDialog2,
+      descripDialog,
+      dialogTitle,
+      loading
     }
   },
 })
-
-
-
 </script>
  
 <style scoped lang="scss">
+.el-button {
+  cursor: default !important;
+}
 .el-row {
   margin-bottom: 20px;
   &:last-child {

+ 540 - 82
src/views/powerQuality/asseReport/scoreReport.vue

@@ -22,35 +22,37 @@
             </el-select>
           </div>
 
-          <el-button
-            class="search-button timeTab"
-            @click="num = 0"
-            :type="num == 0 ? 'primary' : ''"
+          <el-radio-group
+            v-model="listTabPosition"
+            @change="listTabsChange(listTabPosition)"
+            style="display: inline-block; position: relative; top: -3px"
           >
-            按日
-          </el-button>
+            <el-radio-button label="dayValue">按日</el-radio-button>
+            <el-radio-button label="monthValue">按月</el-radio-button>
+          </el-radio-group>
+
+          <el-date-picker
+            v-model="dateTime"
+            :type="dateType"
+            placeholder="请选择"
+            style="width: 150px; margin-left: 20px"
+            :clearable="false"
+            :editable="false"
+          ></el-date-picker>
+
           <el-button
-            class="search-button timeTab"
-            @click="num = 1"
-            :type="num == 1 ? 'primary' : ''"
-            style="margin-left: 0 !important; margin-right: 20px"
+            type="primary"
+            class="search-button"
+            @click="evaluationReport()"
           >
-            按月
+            搜索
           </el-button>
-
-          <div class="filter-item">
-            日期:
-            <el-date-picker
-              v-model="value4"
-              type="dates"
-              placeholder="请选择"
-              style="width: 200px"
-            ></el-date-picker>
-          </div>
-
-          <el-button type="primary" class="search-button">搜索</el-button>
         </div>
       </div>
+      <div class="right descIcon" @click="descripDialog()">
+        <img src="@/assets/images/descIcon.png" alt="" />
+        指标说明
+      </div>
     </div>
     <!-- 筛选end -->
 
@@ -61,10 +63,26 @@
             <span>评分</span>
           </div>
 
-          <radar-chart></radar-chart>
+          <radar-chart :getTableData="getData[0]" v-if="getData[0]" v-loading="loading"></radar-chart>
           <div class="totalScore">
-            总评分:40
-            <el-button type="danger">不合格</el-button>
+            总评分:{{ getData[0].score?getData[0].score:0 }}
+            <el-button
+              :type="
+                getData[0].score > 80
+                  ? 'success'
+                  : getData[0].score >= 60
+                  ? 'warning'
+                  : 'danger'
+              "
+            >
+              {{
+                getData[0].score > 80
+                  ? '优秀'
+                  : getData[0].score >= 60
+                  ? '合格'
+                  : '不合格'
+              }}
+            </el-button>
           </div>
         </div>
         <br />
@@ -73,25 +91,39 @@
             <span>回路统计</span>
           </div>
           <div>
-            <pie-chart></pie-chart>
+            <pie-chart :getTableData="getData[0]" v-loading="loading"></pie-chart>
           </div>
         </div>
       </el-col>
       <el-col :md="24" :lg="17">
         <!-- 表格start -->
         <el-table
-          :data="tableData"
+          :data="getData"
           style="width: 100%"
           :header-cell-style="headCellStyle"
+          v-loading="loading"
         >
-          <el-table-column prop="huilv" label="回路" width=""></el-table-column>
-          <el-table-column
-            prop="gongLv"
-            label="功率因数"
-            width=""
-          ></el-table-column>
+          <el-table-column label="回路" width="" align="center" >
+            <template #default="scope">
+              {{ scope.row.loop ? scope.row.loop : '-' }}
+            </template>
+          </el-table-column>
+          <el-table-column label="功率因数" width="" align="center">
+            <template #default="scope">
+              <div @click="oneClick('cos')">
+                <el-button
+                  size="mini"
+                  round
+                  :type="scope.row.cosQ ? 'success' : 'danger'"
+                  :class="flag?'':'defaultCursor'"
+                >
+                  {{ scope.row.cosQ ? '合格' : '不合格' }}
+                </el-button>
+              </div>
+            </template>
+          </el-table-column>
 
-          <el-table-column label="不平衡度">
+          <!-- <el-table-column label="不平衡度">
             <el-table-column label="电流" width="">
               <template #default="scope">
                 <el-button size="mini" round type="danger">
@@ -106,117 +138,541 @@
                 </el-button>
               </template>
             </el-table-column>
-          </el-table-column>
+          </el-table-column> -->
 
-          <el-table-column label="电压">
-            <el-table-column prop="name" label="A相" width="">
-              <template #default="scope">
-                <el-button size="mini" round>{{ scope.row.name }}</el-button>
-              </template>
-            </el-table-column>
-            <el-table-column prop="city" label="B相">
+          <el-table-column label="不平衡度">
+            <el-table-column label="电流" width="" align="center">
               <template #default="scope">
-                <el-button size="mini" round>{{ scope.row.city }}</el-button>
+                <div @click="oneClick('elBalun')">
+                  <el-button
+                    size="mini"
+                    round
+                    :type="scope.row.elBalunQ ? 'success' : 'danger'"
+                    :class="flag?'':'defaultCursor'"
+                  >
+                    {{ scope.row.elBalunQ ? '合格' : '不合格' }}
+                  </el-button>
+                </div>
               </template>
             </el-table-column>
-            <el-table-column prop="city" label="C相">
+            <el-table-column label="电压" align="center">
               <template #default="scope">
-                <el-button size="mini" round>{{ scope.row.city }}</el-button>
+                <div @click="oneClick('vtBalun')">
+                  <el-button
+                    size="mini"
+                    round
+                    :type="scope.row.vtBalunQ ? 'success' : 'danger'"
+                    :class="flag?'':'defaultCursor'"
+                  >
+                    {{ scope.row.vtBalunQ ? '合格' : '不合格' }}
+                  </el-button>
+                </div>
               </template>
             </el-table-column>
           </el-table-column>
-          <el-table-column label="电流负载率">
-            <el-table-column prop="name" label="A相" width="">
+
+          <el-table-column label="电压">
+            <el-table-column prop="name" label="A相" width="" align="center">
               <template #default="scope">
-                <el-button size="mini" round>{{ scope.row.name }}</el-button>
+                <div @click="oneClick('ua')">
+                  <el-button
+                    size="mini"
+                    round
+                    :type="scope.row.uaQ ? 'success' : 'danger'"
+                    :class="flag?'':'defaultCursor'"
+                  >
+                    {{ scope.row.uaQ ? '合格' : '不合格' }}
+                  </el-button>
+                </div>
               </template>
             </el-table-column>
-            <el-table-column prop="city" label="B相">
+            <el-table-column prop="city" label="B相" align="center">
               <template #default="scope">
-                <el-button size="mini" round>{{ scope.row.city }}</el-button>
+                <div @click="oneClick('ub')">
+                  <el-button
+                    size="mini"
+                    round
+                    :type="scope.row.ubQ ? 'success' : 'danger'"
+                    :class="flag?'':'defaultCursor'"
+                  >
+                    {{ scope.row.ubQ ? '合格' : '不合格' }}
+                  </el-button>
+                </div>
               </template>
             </el-table-column>
-            <el-table-column prop="city" label="C相">
+            <el-table-column prop="city" label="C相" align="center">
               <template #default="scope">
-                <el-button size="mini" round>{{ scope.row.city }}</el-button>
+                <div @click="oneClick('uc')">
+                  <el-button
+                    size="mini"
+                    round
+                    :type="scope.row.ucQ ? 'success' : 'danger'"
+                    :class="flag?'':'defaultCursor'"
+                  >
+                    {{ scope.row.ucQ ? '合格' : '不合格' }}
+                  </el-button>
+                </div>
               </template>
             </el-table-column>
           </el-table-column>
-          <el-table-column label="电流谐波畸变率">
-            <el-table-column prop="name" label="A相" width="">
+          <el-table-column label="电流负载率">
+            <el-table-column prop="name" label="A相" width="" align="center">
               <template #default="scope">
-                <el-button size="mini" round>{{ scope.row.name }}</el-button>
+                <div @click="oneClick('iaLoad')">
+                  <el-button
+                    size="mini"
+                    round
+                    :type="scope.row.iaLoadQ ? 'success' : 'danger'"
+                    :class="flag?'':'defaultCursor'"
+                  >
+                    {{ scope.row.iaLoadQ ? '合格' : '不合格' }}
+                  </el-button>
+                </div>
               </template>
             </el-table-column>
-            <el-table-column prop="city" label="B相">
+            <el-table-column prop="city" label="B相" align="center">
               <template #default="scope">
-                <el-button size="mini" round>{{ scope.row.city }}</el-button>
+                <div @click="oneClick('ibLoad')">
+                  <el-button
+                    size="mini"
+                    round
+                    :type="scope.row.ibLoadQ ? 'success' : 'danger'"
+                    :class="flag?'':'defaultCursor'"
+                  >
+                    {{ scope.row.ibLoadQ ? '合格' : '不合格' }}
+                  </el-button>
+                </div>
               </template>
             </el-table-column>
-            <el-table-column prop="city" label="C相">
+            <el-table-column prop="city" label="C相" align="center">
               <template #default="scope">
-                <el-button size="mini" round>{{ scope.row.city }}</el-button>
+                <div @click="oneClick('icLoad')">
+                  <el-button
+                    size="mini"
+                    round
+                    :type="scope.row.icLoadQ ? 'success' : 'danger'"
+                    :class="flag?'':'defaultCursor'"
+                  >
+                    {{ scope.row.icLoadQ ? '合格' : '不合格' }}
+                  </el-button>
+                </div>
               </template>
             </el-table-column>
           </el-table-column>
+          <el-table-column label="评分" width="" align="center">
+            <template #default="scope">
+              <el-button
+                size="mini"
+                :type="
+                  scope.row.score > 80
+                    ? 'success'
+                    : getData[0].score >= 60
+                    ? 'warning'
+                    : 'danger'
+                "
+               class="defaultCursor"
+              >
+                {{ scope.row.score }}
+              </el-button>
+            </template>
+          </el-table-column>
         </el-table>
         <!-- 表格end -->
       </el-col>
     </el-row>
+
+    <!--弹框组件开始-----------------------start-->
+    <dialog-chartOne
+      :dialogTitle="dialogTitle"
+      @closeDialog="closeDialog"
+      :flag="showDialog"
+      :echartsAllData="echartsAllData"
+   
+    ></dialog-chartOne>
+    <!--弹框组件结束-----------------------end-->
+
+    <!--指标说明弹框组件开始-----------------------start-->
+    <descrip-dialog
+      :dialogTitle="dialogTitle"
+      @closeDialog="closeDialog"
+      :flag="showDialog2"
+      class="descripDialog"
+    ></descrip-dialog>
+    <!--指标说明弹框组件结束-----------------------end-->
   </div>
 </template>
 
 <script>
 import { useStore } from 'vuex'
-import { defineComponent, onMounted } from 'vue'
-import radarChart from "./scoreReportComponent/radarChart.vue";
-import pieChart from "./scoreReportComponent/pieChart.vue";
+import { defineComponent, onMounted, ref,watch  } from 'vue'
+import radarChart from './scoreReportComponent/radarChart.vue'
+import pieChart from './scoreReportComponent/pieChart.vue'
+import dialogChartOne from './scoreReportComponent/dialogChartOne'
+import descripDialog from './scoreReportComponent/descripDialog'
+import * as api from '@/api/powerQuality/scoreReport.js'
+import { ElMessage } from 'element-plus'
+import { parseTime } from '@/utils'
+import { ElNotification } from 'element-plus'
 
 export default defineComponent({
   name: 'ScoreReport',
   components: {
     radarChart,
     pieChart,
+    dialogChartOne,
+    descripDialog,
+  },
+   props: {
+    activeName: String,
   },
-  setup() {
+  setup(props) {
     const store = useStore()
+     const loading=ref(false)
+    const listTabPosition = ref('dayValue')
+    const dateType = ref('date')
+    const dateTime = ref(new Date())
+    const deviceCode=ref('')
+    const flag=ref(false)
+    const getData = ref([
+      {
+        loop: '',
+        cos: '0%',
+        elBalun: '100%',
+        vtBalun: '0%',
+        name: '0%',
+        city: '0%',
+        score: '0',
+      },
+    ])
+    const dialogTitle = ref('')
+    const showDialog = ref(false)
+    const showDialog2 = ref(false)
+    const echartsAllData = ref([])
 
     function headCellStyle({ row, column, rowIndex, columnIndex }) {
-      row,column
+      row, column
       if (columnIndex !== 0 && columnIndex !== 1 && rowIndex === 0) {
-        return `text-align:center`;
+        return `text-align:center`
       } else {
-        return "";
+        return ''
       }
     }
-   
+    const listTabsChange = (value) => {
+      value == 'dayValue'
+        ? (dateType.value = 'date')
+        : (dateType.value = 'month')
+    }
+    //主页面数据请求
+    function evaluationReport() {
+
+       
+       
+       if(!store.state.siteId){
+         loading.value=false
+          ElNotification({
+          title: '提示',
+          message: '请选择站点',
+          type: 'warning',
+        })
+        return
+       }
+       loading.value=true;
+      
+      let list = {}
+
+      if (listTabPosition.value == 'dayValue') {
+        store.commit('getNowFormatDate', dateTime.value)
+        console.log(store.state.dateList)
+        list = {
+          // siteId: 6,
+          // time: '2021-11-01 00:00:00',
+          type: dateType.value == 'date' ? 1 : 2,
+          siteId: store.state.siteId,
+          time: store.state.dateList,
+        }
+      } else {
+        store.commit('getCurrentMonthLast', dateTime.value)
+        list = {
+          // siteId: 6,
+          // time: '2021-11-01 00:00:00',
+          type: dateType.value == 'date' ? 1 : 2,
+          siteId: store.state.siteId,
+          time: store.state.monthList[0].substring(0, 7),
+        }
+      }
+
+      
+
+      api.evaluationReport(list).then((requset) => {
+        loading.value=false
+        if (requset.status === 'SUCCESS') {
+          
+          if(requset.data[0]){
+            getData.value[0] = requset.data[0]
+            deviceCode.value= requset.data[0].deviceCode
+            flag.value=true
+     
+          }else{
+              ElMessage.warning('暂无数据')
+               flag.value=false
+          }
+        } else {
+          ElMessage.error(requset.msg)
+        }
+      })
+    }
+
+    // 折线图详情总数据请求
+    function rtRealScore(params) {
+      parseTime
+
+      // var start = parseTime(new Date().setHours(0, 0, 0, 0))
+      // var end=nowTime.value
+
+      // var start = '2021-12-01 00:00:00'
+      // var end = '2021-12-01 09:07:31'
+
+      store.state.chartType = params
+      // alert(store.state.chartType)
+
+      let list = {}
+
+      if (listTabPosition.value == 'dayValue') {
+        store.commit('getNowFormatDate', dateTime.value)
+        list = {
+          // deviceCode: 'DA00021026',
+          deviceCode:deviceCode.value,
+          startTime: store.state.dateList + ' ' + '00:00:00',
+          endTime: store.state.dateList + ' ' + '23:59:59',
+        }
+      } else {
+        store.commit('getCurrentMonthLast', dateTime.value)
+        list = {
+          // deviceCode:'DA00021026',
+          deviceCode:deviceCode.value,
+          startTime: store.state.monthList[0] + ' ' + '00:00:00',
+          endTime: store.state.monthList[1] + ' ' + '23:59:59',
+        }
+      }
+
+      api
+        .rtRealScore(list)
+        .then((requset) => {
+          if (requset.status === 'SUCCESS') {
+            echartsAllData.value = requset.data
+
+            // 处理数据
+            var arrOld = requset.data
+            let dataTime = arrOld.map((item) => {
+              return item.dataTime
+            })
+            //功率因数
+            let cos = arrOld.map((item) => {
+              return item.cos
+            })
+
+            //电压
+            let ua = arrOld.map((item) => {
+              return item.ua
+            })
+            let ub = arrOld.map((item) => {
+              return item.ub
+            })
+            let uc = arrOld.map((item) => {
+              return item.uc
+            })
+
+            //电流
+            let ia = arrOld.map((item) => {
+              return item.ia
+            })
+            let ib = arrOld.map((item) => {
+              return item.ib
+            })
+            let ic = arrOld.map((item) => {
+              return item.ic
+            })
+
+            // 电流不平衡度
+            let elBalun = arrOld.map((item) => {
+              return item.elBalun * 100
+            })
+            // 电压不平衡度
+            let vtBalun = arrOld.map((item) => {
+              return item.vtBalun * 100
+            })
+            //电流负载率
+            let iaLoad = arrOld.map((item) => {
+              return item.iaLoad
+            })
+            let ibLoad = arrOld.map((item) => {
+              return item.ibLoad
+            })
+            let icLoad = arrOld.map((item) => {
+              return item.icLoad
+            })
+
+            var echartsObj = []
+            var echartsObj2 = []
+            var lineName
+            var lineName2
+
+            ia
+            ib
+            ic
+
+            switch (params) {
+              case 'cos':
+                echartsObj = [{ name: '功率因数 ( 实时数据 )', data: cos }]
+                lineName = ''
+                break
+              case 'ua':
+                echartsObj = [{ name: 'A相电压 ( 实时数据 )', data: ua }]
+                lineName = 'kV'
+                break
+              case 'ub':
+                echartsObj = [{ name: 'B相电压 ( 实时数据 )', data: ub }]
+                lineName = 'kV'
+                break
+              case 'uc':
+                echartsObj = [{ name: 'c相电压 ( 实时数据 )', data: uc }]
+                lineName = 'kV'
+                break
+              case 'elBalun':
+                echartsObj = [
+                  { name: '电流不平衡度 ( 实时数据 )', data: elBalun },
+                ]
+                lineName = '%'
+                echartsObj2 = [
+                  { name: 'A相电流', data: ia },
+                  { name: 'B相电流', data: ib },
+                  { name: 'C相电流', data: ic },
+                ]
+                lineName2 = 'A'
+                break
+              case 'vtBalun':
+                echartsObj = [
+                  { name: '电压不平衡度 ( 实时数据 )', data: vtBalun },
+                ]
+                lineName = '%'
+
+                echartsObj2 = [
+                  { name: 'A相电压', data: ua },
+                  { name: 'B相电压', data: ub },
+                  { name: 'C相电压', data: uc },
+                ]
+                lineName2 = 'V'
+                break
+              case 'iaLoad':
+                echartsObj = [
+                  { name: 'A相电流负载率 ( 实时数据 )', data: iaLoad },
+                ]
+                lineName = '%'
+                echartsObj2 = [{ name: 'A相电流', data: ia }]
+                lineName2 = 'A'
+                break
+              case 'ibLoad':
+                echartsObj = [
+                  { name: 'B相电流负载率 ( 实时数据 )', data: ibLoad },
+                ]
+                lineName = '%'
+                echartsObj2 = [{ name: 'B相电流', data: ib }]
+                lineName2 = 'A'
+                break
+              case 'icLoad':
+                echartsObj = [
+                  { name: 'C相电流负载率 ( 实时数据 )', data: icLoad },
+                ]
+                lineName = '%'
+                echartsObj2 = [{ name: 'C相电流', data: ic }]
+                lineName2 = 'A'
+                break
+              default:
+            }
+
+            dataTime.value = dataTime
+
+            store.state.realScoreLineDataTime = dataTime
+            store.state.realScoreLineObj = echartsObj
+            store.state.realScoreLineObj2 = echartsObj2
+            store.state.realScoreLineName = lineName
+            store.state.realScoreLineName2 = lineName2
+          } else {
+            ElMessage.error(requset.msg)
+          }
+        })
+    }
+
+    // 点击表格弹框图表
+    function oneClick(params) {
+      if(!flag.value){
+        return
+      }
+      dialogTitle.value = params
+      showDialog.value = true
+      rtRealScore(params)
+    }
+    // 查看指标说明
+    const descripDialog = () => {
+      dialogTitle.value = '指标说明'
+      showDialog2.value = true
+    }
+
+    // 关闭操作
+    const closeDialog = () => {
+      showDialog.value = false
+      showDialog2.value = false
+    }
+
+    watch(
+      () => props.activeName,
+      (newVal) => {
+        if (newVal == 'first') {
+          evaluationReport()
+        }
+      }
+    )
+
     onMounted(() => {
-    
+        evaluationReport()
+      
       
     })
     return {
       store,
       headCellStyle,
+      listTabPosition,
       num: 0,
-      value4: "",
+      value4: '',
+      listTabsChange,
+      dateType,
+      dateTime,
+      flag,
       tableData: [
         {
-          huilv: "/HZ183",
-          gongLv: "合格",
-          dianLiu: "不合格",
-          dianYa: "合格",
-          name: "合格",
-          city: "不合格",
+          huilv: '/HZ183',
+          gongLv: '合格',
+          dianLiu: '不合格',
+          dianYa: '合格',
+          name: '合格',
+          city: '不合格',
         },
       ],
-    };
-     
-    
+      evaluationReport,
+      getData,
+      oneClick,
+      showDialog,
+      showDialog2,
+      dialogTitle,
+      rtRealScore,
+      echartsAllData,
+      closeDialog,
+      descripDialog,
+      deviceCode,
+      loading
+    }
   },
 })
-
-
-
 </script>
  
 <style scoped lang="scss">
@@ -246,4 +702,6 @@ export default defineComponent({
   padding: 10px 0;
   border: 1px solid #f9fafc;
 }
+
+
 </style>

+ 239 - 0
src/views/powerQuality/asseReport/scoreReportComponent/descripDialog.vue

@@ -0,0 +1,239 @@
+<template>
+  <div class="descripDialog">
+    <el-dialog
+      :title="dialogTitle"
+      v-model="dialogVisible"
+      width="600px"
+      @close="closeDialog(0)"
+      @open="open"
+    >
+      <div style="width: 100%; ">
+        <el-tabs v-model="activeName" @tab-click="handleClick">
+          <el-tab-pane label="判定标准" name="first">
+            <div class="desBlock">
+              <h3>【电压】</h3>
+              <span>电压偏差国标:</span>
+              <span>35KV及以上正、负偏差的绝对值之和不超过标称电压的10%;</span>
+              <span>20kv及以下电压偏差为标称电压的±7%;</span>
+              <span>400V及以下电压偏差为标称电压的+7%、-10%;</span>
+              <span>标称电压=额定电压,其数值为线电压</span>
+              <span>比如:额定电压为380V,电压偏差的上限 和 下限分别为235.4V 和 198V</span>
+            </div>
+            <div class="desBlock">
+              <h3>【频率】</h3>
+              <span>频率超限范围:50±0.2(Hz)</span>
+            </div>
+            <div class="desBlock">
+              <h3>【功率因数】</h3>
+              <span>功率因数超限范围:用户可配置功率因数标准值</span>
+            </div>
+            <div class="desBlock">
+              <h3>【三相不平衡】</h3>
+              <span>三相不平衡度超限范围:15%</span>
+            </div>
+            <div class="desBlock">
+              <h3>【电流负载率】</h3>
+              <span>电流负载率超限范围:用户可配置电流负载率门限值</span>
+              <span>电流负载率=电流/额定电流</span>
+            </div>
+             <div class="desBlock">
+              <h3>【单项结论】</h3>
+              <span>合格率:(测点数-超限数)/测点数×100%</span>
+              <span>合格率>=95% 「合格」</span>
+              <span>合格率95% 「不合格」</span>
+            </div>
+            
+          </el-tab-pane>
+          <el-tab-pane label="配置内容" name="second">
+            <div class="desBlock">
+              <h3>【站点级配置】<a @click="goSitePowerScore">立即前往</a></h3>
+              <p>请在 站点管理->电能质量评分配置中配置 或 联系运维管理员:</p>
+              <span>电能质量各要素权重、功率因数标准值</span>
+            </div>
+            <div class="desBlock">
+              <h3>【设备级配置】<a @click="goSiteWatchDog">立即前往</a></h3>
+              <p>请在 站点管理->监控设备中配置 或 联系运维管理员:</p>
+              <span>额定电压、额定电流、电流负载率门限、电能质量分析</span>
+              <span>如果设备没有配置额定电压,电压/谐波畸变率分析项可能没有数据</span>
+              <span>如果设备不勾选电能质量分析,该设备不参与电能质量分析</span>
+            </div>
+            <div class="desBlock">
+              <h3>【变量级配置】<a @click="goSiteVariableList">立即前往</a></h3>
+              <p>请在 站点管理->变量列表中配置 或 联系运维管理员:配置下列变量,且需要指定变量的变量属性</p>
+              <span>A/B/C相电压</span>
+              <span>A/B/C相电流</span>
+              <span>功率因数</span>
+              <span>频率</span>
+              <span>有功/无功功率</span>
+              <span>有功/无功电度</span>
+              <span>电压三相不平衡度</span>
+              <span>电流三相不平衡度</span>
+              <span>A/B/C相电压相角</span>
+              <span>A/B/C相电流相角</span>
+              <span>A/B/C相电压总谐波畸变率</span>
+              <span>A/B/C相电流总谐波畸变率</span>
+              <span>2~31次A/B/C相电压谐波含量或有效值 (可二选一)</span>
+              <span>2~31次A/B/C相电流谐波含量或有效值 (可二选一)</span>
+              <span>如果变量没有指定变量属性 或 变量没有数据,分析项可能没有数据</span>
+            </div>
+          </el-tab-pane>
+         
+        </el-tabs>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { useStore } from 'vuex'
+import {useRouter} from 'vue-router'
+
+import { defineComponent, ref, watchEffect } from 'vue'
+// import * as api from '@/api/siteManage/watchDog.js'
+// import { ElMessage } from 'element-plus'
+
+export default defineComponent({
+  name: 'DescripDialog',
+  emits: ['closeDialog'],
+  props: {
+    flag: Boolean,
+    dialogTitle: String,
+    itemInfo: Object,
+  },
+  setup(props, context) {
+    context
+     let router = useRouter();
+    const store = useStore()
+    const dialogVisible = ref(false)
+
+    const activeName=ref('first')
+
+
+    // open(): Dialog弹窗打开之前做的事
+    const open = () => {
+
+    
+    }
+
+   
+
+    // 关闭弹框
+    const closeDialog = () => {
+      context.emit('closeDialog', false)
+      dialogVisible.value = false
+    }
+
+    watchEffect((fn, options) => {
+      fn, options
+      dialogVisible.value = props.flag
+    })
+
+
+    function handleClick(tab, event) {
+      console.log(tab, event)
+    }
+
+     function goSiteWatchDog(){
+      store.state.goUrl=2
+      router.push({
+    //传递参数使用query的话,指定path或者name都行,但使用params的话,只能使用name指定 
+        path:'/siteManage',
+        query:{
+        activeName:'second',
+        siteId:store.state.siteId
+        }
+      })
+    }
+    function goSiteVariableList(){
+      store.state.goUrl=3
+      router.push({
+    //传递参数使用query的话,指定path或者name都行,但使用params的话,只能使用name指定 
+        path:'/siteManage',
+        query:{
+        activeName:'six',
+        siteId:store.state.siteId
+        }
+      })
+
+    }
+    function goSitePowerScore(){
+      store.state.goUrl=6
+      router.push({
+    //传递参数使用query的话,指定path或者name都行,但使用params的话,只能使用name指定 
+        path:'/siteManage',
+        query:{
+        activeName:'six',
+        siteId:store.state.siteId
+        }
+      })
+
+    }
+   
+
+    return {
+       store,
+      closeDialog,
+      dialogVisible,
+    
+      open,
+
+      handleClick,
+      activeName,
+
+      goSitePowerScore,
+      goSiteWatchDog,
+      goSiteVariableList
+    }
+  },
+})
+</script>
+ 
+<style scoped lang="scss">
+.el-input,
+.el-select {
+  width: 240px;
+}
+
+// label样式
+.el-form-item__label {
+  width: 150px;
+}
+.el-form-item__content {
+  margin-left: 150px;
+}
+.desBlock {
+  padding:15px 0;
+  border-bottom:1px solid rgba(0,0,0,0.06);
+  h3{
+    margin:0 0 10px  0;
+    position:relative;
+    a{
+      position:absolute;
+      right:0
+    }
+    span{
+      position:absolute;
+      right:0;
+      font-size:14px;
+      color:#409eff;
+      cursor:pointer
+    }
+  }
+  p{
+    // margin-bottom:0px;
+  }
+  span{
+    display:block;
+    color:#7e93a6
+  }
+}
+</style>
+<style>
+.descripDialog .el-dialog__body{
+  padding-top:0
+}
+.descripDialog .el-overlay-dialog {
+  /* left: auto !important; */
+  /* bottom: auto !important; */
+}
+</style>

+ 87 - 0
src/views/powerQuality/asseReport/scoreReportComponent/dialogChartOne.vue

@@ -0,0 +1,87 @@
+<template>
+  <el-dialog
+    :title="dialogTitle"
+    v-model="dialogVisible"
+    width="800px"
+    @close="closeDialog()"
+  >
+    <div style="width: 100%">
+       <inner-line-chart2 v-if="type=='elBalun'||type=='vtBalun'||type=='iaLoad'||type=='ibLoad'||type=='icLoad'"></inner-line-chart2>
+      <inner-line-chart></inner-line-chart>
+     
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { useStore } from 'vuex'
+import { defineComponent, ref, watchEffect, onMounted, watch } from 'vue'
+import innerLineChart from './innerLineChart'
+import innerLineChart2 from './innerLineChart2'
+
+export default defineComponent({
+  name: 'DialogChartOne',
+  components: {
+    innerLineChart,
+    innerLineChart2
+  },
+  emits: ['closeDialog'],
+  props: {
+    flag: Boolean,
+    dialogTitle: String,
+    itemInfo: Object,
+    echartsAllData: Array,
+    echartsTitle: String,
+  },
+  setup(props, context) {
+    context
+    const store = useStore()
+    const dialogVisible = ref(false)
+    const type = ref('')
+
+    const getData = async () => {
+      type.value = store.state.chartType
+    }
+
+    // 关闭弹框
+    const closeDialog = () => {
+      context.emit('closeDialog', false)
+      dialogVisible.value = false
+    }
+
+    watchEffect((fn) => {
+      fn
+      dialogVisible.value = props.flag
+    })
+
+    const writeValue = (val) => {
+      val
+      getData()
+    }
+
+    //监听变化
+    watch(
+      () => store.state.chartType,
+      (newVal, oldVal, clear) => {
+        // 执行异步任务,并得到关闭异步任务的 id
+
+        let id = writeValue(newVal, oldVal)
+        // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
+        clear(() => clearTimeout(id))
+      },
+      { lazy: true }
+    )
+
+    onMounted(() => {})
+
+    return {
+      closeDialog,
+      dialogVisible,
+      type
+    }
+  },
+})
+</script>
+ 
+<style scoped lang="scss">
+</style>

+ 196 - 0
src/views/powerQuality/asseReport/scoreReportComponent/innerLineChart.vue

@@ -0,0 +1,196 @@
+<template>
+  <div shadow="never" class="homeBoxCard" v-loading="loading">
+    <div class="height400" ref="lineChartBanlance" />
+  </div>
+</template>
+<script>
+import { useStore } from 'vuex'
+import { defineComponent, onMounted, ref, watch } from 'vue'
+import * as echarts from 'echarts'
+
+export default defineComponent({
+  name: 'lineChartValue',
+  props: {},
+  setup(props) {
+    props
+    const store = useStore()
+    let lineChartBanlance = ref(null)
+    const dataTimes = ref([])
+    const lineChartArr = ref([])
+
+    // 读取数据 func
+    const loading = ref(true)
+    const getData = async () => {
+      dataTimes.value = store.state.realScoreLineDataTime
+      lineChartArr.value = store.state.realScoreLineObj
+
+      lineChartArr.value.forEach((value) => {
+        value.type = 'line'
+        value.smooth = false
+        value.symbolSize = 7
+        // value.markPoint = {
+        //   data: [
+        //     { type: 'max', name: 'Max' },
+        //     { type: 'min', name: 'Min' },
+        //   ],
+        // }
+      })
+
+      loading.value = false
+    }
+ 
+    function echarts2() {
+      let myChart = echarts.init(lineChartBanlance.value)
+
+      
+
+      // 绘制图表
+      myChart.setOption({
+        color: ['#1187FF', '#48C964', '#fe8161'],
+
+        legend: {
+          top: '0',
+        },
+        tooltip: {
+          // show: true
+          trigger: 'axis',
+          axisPointer: { type: 'cross' },
+        },
+        grid: {
+          left: '20',
+          right: '40',
+          top: '40',
+          bottom: '30',
+          containLabel: true,
+        },
+        xAxis: {
+          axisLabel: {
+            color: '#444',
+            fontSize: 14,
+          },
+          /*改变xy轴颜色*/
+          axisLine: {
+            lineStyle: {
+              color: '#444',
+              width: 1, //这里是为了突出显示加上的
+            },
+          },
+          boundaryGap: false,
+          data: dataTimes.value,
+        },
+        yAxis: {
+          name: store.state.realScoreLineName,
+          textStyle: {
+            color: 'black',
+            fontSize: 10,
+          },
+          type: 'value',
+          axisTick: {
+            show: true, //去除刻度线
+          },
+          axisLabel: {
+            color: 'black', // 文本颜色
+          },
+          axisLine: {
+            show: true, // 去除轴线
+            lineStyle: {
+              color: 'black',
+            },
+          },
+          splitNumber: 5,
+          splitLine: {
+            show: true,
+            lineStyle: {
+              color: '#9d9d9d',
+            },
+          },
+        },
+
+        // series: [
+        //   {
+        //     name: 'A相电流',
+        //     type: 'line',
+        //     symbolSize: 7,
+        //     smooth: false,
+        //     data: [1, 2, 6, 4, 5, 58, 6, 7, 8],
+        //   },
+        //   {
+        //     name: 'B相电流',
+        //     type: 'line',
+        //     symbolSize: 7,
+        //     smooth: false,
+        //     data: [1, 2, 3, 4, 9, 5, 6, 7, 8],
+        //   },
+        //   {
+        //     name: 'C相电流',
+        //     type: 'line',
+        //     symbolSize: 7,
+        //     smooth: false,
+        //     data: [1, 2, 3, 4, 5, 6, 6, 7, 3],
+        //   },
+        // ],
+        series: lineChartArr.value,
+      })
+      window.addEventListener('resize', () => {
+        myChart.resize()
+      })
+    }
+
+    const writeValue = (val) => {
+      val
+      getData()
+      echarts2()
+    }
+
+    //监听变化
+    watch(
+      () => store.state.realScoreLineObj,
+      (newVal, oldVal, clear) => {
+        // 执行异步任务,并得到关闭异步任务的 id
+        // console.log(newVal)
+        let id = writeValue(newVal, oldVal)
+        // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
+        clear(() => clearTimeout(id))
+      },
+      { lazy: true }
+    )
+
+    onMounted(() => {
+      // getData()
+      // echarts2()
+    })
+
+    return {
+      lineChartBanlance,
+      loading,
+      store,
+      dataTimes,
+      lineChartArr,
+    }
+  },
+})
+</script>
+<style lang="scss" scoped>
+.homeBoxCard {
+  margin-bottom: 24px;
+  ::v-deep(.el-card__header) {
+    padding-left: 12px;
+    padding-right: 12px;
+  }
+  ::v-deep(.el-card__body) {
+    padding: 12px;
+    font-size: 14px;
+    line-height: 1.5715;
+  }
+  ::v-deep(.el-divider) {
+    margin: 8px 0;
+  }
+  .num {
+    font-size: 30px;
+    color: #515a6e;
+  }
+  .height400 {
+    height: 400px;
+  }
+}
+</style>

+ 196 - 0
src/views/powerQuality/asseReport/scoreReportComponent/innerLineChart2.vue

@@ -0,0 +1,196 @@
+<template>
+  <div shadow="never" class="homeBoxCard" v-loading="loading">
+    <div class="height400" ref="lineChartBanlance" />
+  </div>
+</template>
+<script>
+import { useStore } from 'vuex'
+import { defineComponent, onMounted, ref, watch } from 'vue'
+import * as echarts from 'echarts'
+
+export default defineComponent({
+  name: 'innerLineChart2',
+  props: {},
+  setup(props) {
+    props
+    const store = useStore()
+    let lineChartBanlance = ref(null)
+    const dataTimes = ref([])
+    const lineChartArr = ref([])
+
+    // 读取数据 func
+    const loading = ref(true)
+    const getData = async () => {
+      dataTimes.value = store.state.realScoreLineDataTime
+
+      lineChartArr.value = store.state.realScoreLineObj2
+      lineChartArr.value.forEach((value) => {
+        value.type = 'line'
+        value.smooth = false
+        value.symbolSize = 7
+        // value.markPoint = {
+        //   data: [
+        //     { type: 'max', name: 'Max' },
+        //     { type: 'min', name: 'Min' },
+        //   ],
+        // }
+      })
+
+      loading.value = false
+    }
+ 
+    function echarts2() {
+      let myChart = echarts.init(lineChartBanlance.value)
+
+      
+
+      // 绘制图表
+      myChart.setOption({
+        color: ['#1187FF', '#48C964', '#fe8161'],
+
+        legend: {
+          top: '0',
+        },
+        tooltip: {
+          // show: true
+          trigger: 'axis',
+          axisPointer: { type: 'cross' },
+        },
+        grid: {
+          left: '20',
+          right: '40',
+          top: '40',
+          bottom: '30',
+          containLabel: true,
+        },
+        xAxis: {
+          axisLabel: {
+            color: '#444',
+            fontSize: 14,
+          },
+          /*改变xy轴颜色*/
+          axisLine: {
+            lineStyle: {
+              color: '#444',
+              width: 1, //这里是为了突出显示加上的
+            },
+          },
+          boundaryGap: false,
+          data: dataTimes.value,
+        },
+        yAxis: {
+          name: store.state.realScoreLineName2,
+          textStyle: {
+            color: 'black',
+            fontSize: 10,
+          },
+          type: 'value',
+          axisTick: {
+            show: true, //去除刻度线
+          },
+          axisLabel: {
+            color: 'black', // 文本颜色
+          },
+          axisLine: {
+            show: true, // 去除轴线
+            lineStyle: {
+              color: 'black',
+            },
+          },
+          splitNumber: 5,
+          splitLine: {
+            show: true,
+            lineStyle: {
+              color: '#9d9d9d',
+            },
+          },
+        },
+
+        // series: [
+        //   {
+        //     name: 'A相电流',
+        //     type: 'line',
+        //     symbolSize: 7,
+        //     smooth: false,
+        //     data: [1, 2, 6, 4, 5, 58, 6, 7, 8],
+        //   },
+        //   {
+        //     name: 'B相电流',
+        //     type: 'line',
+        //     symbolSize: 7,
+        //     smooth: false,
+        //     data: [1, 2, 3, 4, 9, 5, 6, 7, 8],
+        //   },
+        //   {
+        //     name: 'C相电流',
+        //     type: 'line',
+        //     symbolSize: 7,
+        //     smooth: false,
+        //     data: [1, 2, 3, 4, 5, 6, 6, 7, 3],
+        //   },
+        // ],
+        series: lineChartArr.value,
+      },true)
+      window.addEventListener('resize', () => {
+        myChart.resize()
+      })
+    }
+
+    const writeValue = (val) => {
+      val
+      getData()
+      echarts2()
+    }
+
+    //监听变化
+    watch(
+      () => store.state.realScoreLineObj2,
+      (newVal, oldVal, clear) => {
+        // 执行异步任务,并得到关闭异步任务的 id
+        // console.log(newVal)
+        let id = writeValue(newVal, oldVal)
+        // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
+        clear(() => clearTimeout(id))
+      },
+      { lazy: true }
+    )
+
+    onMounted(() => {
+      // getData()
+      // echarts2()
+    })
+
+    return {
+      lineChartBanlance,
+      loading,
+      store,
+      dataTimes,
+      lineChartArr,
+    }
+  },
+})
+</script>
+<style lang="scss" scoped>
+.homeBoxCard {
+  margin-bottom: 24px;
+  ::v-deep(.el-card__header) {
+    padding-left: 12px;
+    padding-right: 12px;
+  }
+  ::v-deep(.el-card__body) {
+    padding: 12px;
+    font-size: 14px;
+    line-height: 1.5715;
+  }
+  ::v-deep(.el-divider) {
+    margin: 8px 0;
+  }
+  .num {
+    font-size: 30px;
+    color: #515a6e;
+  }
+  .height400 {
+    height: 400px;
+  }
+}
+</style>

+ 70 - 56
src/views/powerQuality/asseReport/scoreReportComponent/pieChart.vue

@@ -4,64 +4,34 @@
   </div>
 </template>
 <script>
-import { computed, defineComponent, onMounted, ref } from 'vue'
-import { useStore } from 'vuex'
+import { defineComponent, onMounted, ref ,watch} from 'vue'
+// import { useStore } from 'vuex'
 import * as echarts from 'echarts'
-// import { ChartDataType } from "../../data";
 
-var echartData = [
-  {
-    value: 335,
-    legendname: '优秀',
-    name: '优秀',
-    itemStyle: { color: '#40ABFE' },
-  },
-  {
-    value: 335,
-    legendname: '合格',
-    name: '合格',
-    itemStyle: { color: '#EEAA3F' },
-  },
-  {
-    value: 335,
-    legendname: '不合格',
-    name: '不合格',
-    itemStyle: { color: '#FF2222' },
-  },
-]
-
-var total_datas = 0
-for (var i = 0; i < echartData.length; i++) {
-  total_datas += Number(echartData[i].value)
-  console.log(typeof echartData[i].value)
-}
+// var total_datas = 0
+// for (var i = 0; i < echartData.length; i++) {
+//   total_datas += Number(echartData[i].value)
+//   console.log(typeof echartData[i].value)
+// }
 
 export default defineComponent({
   name: 'PieChart',
-  setup() {
-    const store = useStore()
-
-    // 总数
-    const total = computed(() => store.state.Home.worksChartData.total)
-    // num
-    const num = computed(() => store.state.Home.worksChartData.num)
-
+  props: {
+    getTableData: Object,
+  },
+  setup(props) {
     // 读取数据 func
     const loading = ref(true)
     const getData = async () => {
-      // loading.value = true
-      // await store.dispatch("Home/queryWorksChartData");
-      loading.value = false;
+      loading.value = false
     }
-
-    onMounted(() => {
-      getData()
+    function echarts2() {
       let myChart = echarts.init(document.getElementById('pieChart'))
       // 绘制图表
       myChart.setOption({
         title: [
           {
-            text: '' + total_datas,
+            text: 1,
             subtext: '共计回路',
             textStyle: {
               fontSize: 24,
@@ -80,18 +50,18 @@ export default defineComponent({
           trigger: 'item',
           formatter: function (parms) {
             var str =
-              parms.seriesName +
               '</br>' +
               parms.marker +
               '' +
               parms.data.legendname +
-              '</br>' +
-              '数量:' +
-              parms.data.value +
-              '</br>' +
-              '占比:' +
-              parms.percent +
-              '%'
+              '</br>' 
+              // +
+              // '数量:' +
+              // parms.data.value +
+              // '</br>' +
+              // '占比:' +
+              // parms.percent +
+              // '%'
             return str
           },
         },
@@ -100,6 +70,7 @@ export default defineComponent({
           orient: 'horizontal',
           bottom: '0%',
           align: 'left',
+           selectedMode: false, //取消图例上的点击事件
           // top:'middle',
           textStyle: {
             color: '#8C8C8C',
@@ -108,7 +79,7 @@ export default defineComponent({
         },
         series: [
           {
-            name: '标题',
+            // name: '标题',
             type: 'pie',
             center: ['50%', '50%'],
             radius: ['37%', '55%'],
@@ -121,19 +92,62 @@ export default defineComponent({
             labelLine: {
               show: false,
             },
-            data: echartData,
+            data: [
+              {
+                value: props.getTableData.score>=80?1:0,
+                legendname: '优秀',
+                name: '优秀',
+                itemStyle: { color: '#40ABFE' },
+              },
+              {
+                value: props.getTableData.score>=60?1:0,
+                legendname: '合格',
+                name: '合格',
+                itemStyle: { color: '#EEAA3F' },
+              },
+              {
+                value: props.getTableData.score<60?1:0,
+                legendname: '不合格',
+                name: '不合格',
+                itemStyle: { color: '#FF2222' },
+              },
+            ],
           },
         ],
       })
       window.addEventListener('resize', () => {
         myChart.resize()
       })
+    }
+
+    const writeValue = (val) => {
+      val
+      getData()
+      echarts2()
+    }
+
+    //监听变化
+    watch(
+      () => props.getTableData,
+      (newVal, oldVal, clear) => {
+        // 执行异步任务,并得到关闭异步任务的 id
+        // console.log(newVal)
+        let id = writeValue(newVal, oldVal)
+        // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
+        clear(() => clearTimeout(id))
+      },
+      { lazy: true }
+    )
+
+
+    onMounted(() => {
+      getData()
+      echarts2()
     })
 
     return {
       loading,
-      total,
-      num,
+      echarts2,
     }
   },
 })

+ 50 - 31
src/views/powerQuality/asseReport/scoreReportComponent/radarChart.vue

@@ -1,35 +1,29 @@
 <template>
   <div shadow="never" class="homeBoxCard" v-loading="loading">
-    <div class="height260" ref="lineChartBanlance" />
+    <div class="height260" id="radarChart" ref="radarChart" />
   </div>
 </template>
 <script>
-import { computed, defineComponent, onMounted, ref } from 'vue'
-import { useStore } from 'vuex'
+import {  defineComponent, onMounted, ref,watch } from 'vue'
 import * as echarts from 'echarts'
-// import { ChartDataType } from "../../data";
 
 export default defineComponent({
   name: 'RadarChart',
-  setup() {
-    const store = useStore()
-    const lineChartBanlance = ref(null)
-    // 总数
-    const total = computed(() => store.state.Home.worksChartData.total)
-    // num
-    const num = computed(() => store.state.Home.worksChartData.num)
+  props:{
+    getTableData:Object,
+  },
+  setup(props) {
 
     // 读取数据 func
     const loading = ref(true)
     const getData = async () => {
-      // loading.value = true
+
+      // loading.value = true;
       // await store.dispatch("Home/queryWorksChartData");
       loading.value = false
     }
-
-    onMounted(() => {
-      getData()
-      let myChart = echarts.init(lineChartBanlance.value)
+    function echarts2(){
+       let myChart = echarts.init(document.getElementById('radarChart'))
       // 绘制图表
       myChart.setOption({
         backgroundColor: '#FFF',
@@ -68,29 +62,25 @@ export default defineComponent({
             },
           },
           indicator: [
-            {
-              name: '谐波畸变率',
-              max: 100,
-            },
             {
               name: '电压平衡度',
-              max: 100,
+              max: 20,
             },
             {
-              name: '电压合格率',
-              max: 100,
+              name: '电流平衡度',
+              max: 20,
             },
             {
               name: '功率因数',
-              max: 100,
+              max: 20,
             },
             {
-              name: '电流平衡度',
-              max: 100,
+              name: '电压合格率',
+              max: 20,
             },
             {
               name: '负载率',
-              max: 100,
+              max: 20,
             },
           ],
         },
@@ -111,7 +101,7 @@ export default defineComponent({
                 itemStyle: {
                   color: '#5eb6db',
                 },
-                value: [20, 33, 80, 50, 30, 40, 100],
+                value: [props.getTableData.vtBalunQ?20:0,props.getTableData.elBalunQ?20:0, props.getTableData.cosQ?20:0, props.getTableData.uq?20:0, props.getTableData.iloadQ?20:0],
               },
             ],
           },
@@ -120,13 +110,42 @@ export default defineComponent({
       window.addEventListener('resize', () => {
         myChart.resize()
       })
+
+    }
+
+    const writeValue = (val) => {
+    
+      val
+
+      getData()
+      echarts2()
+    }
+
+    //监听变化
+    watch(
+      () => props.getTableData,
+      (newVal, oldVal, clear) => {
+        // 执行异步任务,并得到关闭异步任务的 id
+        // console.log(newVal)
+        let id = writeValue(newVal, oldVal)
+        // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
+        clear(() => clearTimeout(id))
+      },
+      { lazy: true }
+    )
+
+    onMounted(() => {
+      getData()
+      echarts2()
+
+     
     })
 
     return {
-      lineChartBanlance,
       loading,
-      total,
-      num,
+   
+      getData,
+      echarts2
     }
   },
 })

+ 9 - 8
src/views/powerQuality/harmonicReport/curveCom.vue

@@ -1,5 +1,5 @@
 <template>
-  <div shadow="never" class="homeBoxCard" v-loading="loading">
+  <div shadow="never" class="homeBoxCard">
     <div style="text-align: center; font-weight: bold">
       {{ curveComList.name }}
     </div>
@@ -27,14 +27,11 @@ export default defineComponent({
     const num = computed(() => store.state.Home.worksChartData.num)
 
     // 读取数据 func
-    const loading = ref(true)
     const getData = async () => {
-      // loading.value = true
-      // await store.dispatch("Home/queryWorksChartData");
-      loading.value = false
     }
 
     function ecahrts() {
+    
       let myChart = echarts.init(worksChartRef.value)
 
       // 绘制图表
@@ -109,7 +106,7 @@ export default defineComponent({
         series: [
           {
             name: props.curveComList.icontitle,
-            type: 'bar',
+            type: 'line',
             data: props.curveComList.data,
             barWidth: 10, //柱子宽度
             barGap: '1', //柱子之间间距
@@ -135,8 +132,13 @@ export default defineComponent({
     // 异步任务 用于给tree传值
     const writeValue = (val) => {
       val
-      //   console.log(val)
+      
       ecahrts()
+      setTimeout(()=>{
+        getData()
+      },200)
+      
+
     }
     // 定义 watch 监听
     watch(
@@ -153,7 +155,6 @@ export default defineComponent({
 
     return {
       worksChartRef,
-      loading,
       total,
       num,
     }

+ 32 - 13
src/views/powerQuality/harmonicReport/index.vue

@@ -29,7 +29,6 @@
               v-model="deviceCode"
               placeholder="请选择"
               style="width: 150px"
-              @change="listSelect()"
             >
               <el-option
                 v-for="device in deviceList"
@@ -48,7 +47,7 @@
               :type="dateType"
               placeholder="请选择"
               style="width: 150px"
-              @change="listSelect()"
+            
               :clearable="false"
               :editable="false"
             ></el-date-picker>
@@ -104,7 +103,7 @@
     </el-button>
     <div v-if="num2 == 0">
       <div v-for="curve in curveComList" :key="curve">
-        <curve-com :curveComList="curve"></curve-com>
+        <curve-com :curveComList="curve" v-loading="loading"></curve-com>
       </div>
 
       <!-- <curve-comA></curve-comA>
@@ -126,6 +125,7 @@ import { useStore } from 'vuex'
 import { defineComponent, onMounted, ref } from 'vue'
 import * as api from '@/api/powerQuality/harmonicReport'
 import { ElMessage } from 'element-plus'
+import { ElNotification } from 'element-plus'
 
 export default defineComponent({
   name: 'VariableList',
@@ -138,6 +138,7 @@ export default defineComponent({
   },
   setup() {
     const store = useStore()
+    const loading=ref(false)
     const dateType = ref('date')
     const listTabPosition = ref('dayValue')
     // const deviceCode = ref('')
@@ -148,19 +149,19 @@ export default defineComponent({
     const curveComList = ref([
       {
         name: 'A相电流(A)',
-        icontitle: 'ia',
+        icontitle: 'Ia',
         dateList: [],
         data: [],
       },
       {
         name: 'B相电流(A)',
-        icontitle: 'ib',
+        icontitle: 'Ib',
         dateList: [],
         data: [],
       },
       {
         name: 'C相电流(A)',
-        icontitle: 'ic',
+        icontitle: 'Ic',
         dateList: [],
         data: [],
       },
@@ -172,10 +173,8 @@ export default defineComponent({
     function deviceSelect() {
       api.deviceListOne({ siteId: store.state.siteId }).then((requset) => {
         if (requset.status === 'SUCCESS') {
-          console.log(111)
           deviceList.value = requset.data
           deviceCode.value = requset.data[0] ? requset.data[0].deviceCode : ''
-
           listTabsChange('dayValue')
 
         } else {
@@ -188,10 +187,10 @@ export default defineComponent({
       value == 'dayValue'
         ? (dateType.value = 'date')
         : (dateType.value = 'month')
-      listSelect()
     }
 
     function listSelect() {
+      
       let list = {}
 
       if (listTabPosition.value == 'dayValue') {
@@ -209,14 +208,24 @@ export default defineComponent({
           endTime: store.state.monthList[1] + ' ' + '23:59:59',
         }
       }
+      if(!deviceCode.value){
+         loading.value=false
+          ElNotification({
+          title: '提示',
+          message: '请选择左侧设备信息',
+          type: 'warning',
+        })
 
-      api.rtRealScore(list).then((requset) => {
+      }else{
+         loading.value=true
+        api.rtRealScore(list).then((requset) => {
+         loading.value=false
         if (requset.status === 'SUCCESS') {
+          
           tableList.value = requset.data
-           console.log('tableList.value')
-          console.log( tableList.value.length)
+      
           if (tableList.value.length==0) {
-            ElMessage.error('暂无结果')
+            ElMessage.warning('暂无结果')
           }
           curveComList.value[0].data = []
           curveComList.value[0].dateList = []
@@ -233,13 +242,22 @@ export default defineComponent({
             curveComList.value[2].dateList.push(val.dataTime)
           })
         } else {
+          
           ElMessage.error(requset.msg)
+         
+
+          
         }
       })
+
+      }
+
+      
     }
 
     onMounted(() => {
       deviceSelect()
+      listSelect()
     })
     return {
       listTabsChange,
@@ -264,6 +282,7 @@ export default defineComponent({
       tabPosition: 'one',
       input: '',
       region: '',
+      loading
     }
   },
 })

+ 4 - 4
src/views/powerQuality/harmonicReport/tableCom.vue

@@ -32,9 +32,9 @@
         <el-table-column prop="address" label="95%"></el-table-column>
       </el-table-column> -->
       <el-table-column prop="dataTime" label="时间" width="" />
-      <el-table-column label="A相" prop="ia" />
-      <el-table-column label="B相" prop="ib" />
-      <el-table-column label="C相" prop="ic" />
+      <el-table-column label="A相(A)" prop="ia" />
+      <el-table-column label="B相(A)" prop="ib" />
+      <el-table-column label="C相(A)" prop="ic" />
     </el-table>
     <!-- 表格end -->
 
@@ -127,7 +127,7 @@ export default {
     headCellStyle({ row, column, rowIndex, columnIndex }) {
       row, column
       if (columnIndex !== 0 && rowIndex === 0) {
-        return `text-align:center;`
+        // return `text-align:center;`
       } else {
         return ''
       }

+ 2 - 2
src/views/powerQuality/realTimeMonitoring/index.vue

@@ -8,12 +8,12 @@
       >
         <el-tab-pane label="实时评分" name="first">
           <br>
-          <real-score ></real-score>
+          <real-score :activeName="activeName"></real-score>
        
         </el-tab-pane>
         <el-tab-pane label="单回路监测" name="second"  :key='activeName'>
           <br>
-           <loop-monitor v-if="key='activeName'" ></loop-monitor >
+           <loop-monitor v-if="key='activeName'" :activeName="activeName"></loop-monitor >
         </el-tab-pane>
       </el-tabs>
       <br>

+ 122 - 33
src/views/powerQuality/realTimeMonitoring/loopMonitor.vue

@@ -12,7 +12,7 @@
               style="width: 220px"
               clearable
               filterable
-               @change="linkDevice()"
+              @change="linkDevice()"
             >
               <el-option
                 v-for="site in store.state.siteList"
@@ -37,10 +37,16 @@
               ></el-option>
             </el-select>
           </div>
-          <el-button type="primary" class="search-button">搜索</el-button>
+          <el-button
+            type="primary"
+            class="search-button"
+            @click="realScoreOne()"
+          >
+            搜索
+          </el-button>
         </div>
       </div>
-      <div class="right descIcon">
+      <div class="right descIcon" @click="descripDialog()">
         <img src="@/assets/images/descIcon.png" alt="" />
         指标说明
       </div>
@@ -60,7 +66,7 @@
           >
             <el-col :span="12" class="loopUnbanlanceCard">
               <div class="grid-content" style="text-align: center">
-                <loop-radarChart></loop-radarChart>
+                <loop-radarChart :getData="getData" v-loading="loading"></loop-radarChart>
               </div>
             </el-col>
             <el-col :span="12" class="loopUnbanlanceCard">
@@ -75,27 +81,33 @@
                 "
               >
                 <div class="mb-10">电压不平衡度</div>
-                <div>100%</div>
+                <div>{{ getData.vtBalun ? getData.vtBalun * 100 : 0 }}%</div>
               </div>
               <ul>
                 <li>
                   <div>A相电压</div>
                   <div>
-                    <div class="mb-5">幅值:9.72A</div>
+                    <div class="mb-5">
+                      幅值:{{ getData.ua ? getData.ua + ' V' : 0 }}
+                    </div>
                     <div>相角:-</div>
                   </div>
                 </li>
                 <li>
-                  <div>A相电压</div>
+                  <div>B相电压</div>
                   <div>
-                    <div class="mb-5">幅值:9.72A</div>
+                    <div class="mb-5">
+                      幅值:{{ getData.ub ? getData.ub + ' V' : 0 }}
+                    </div>
                     <div>相角:-</div>
                   </div>
                 </li>
                 <li>
-                  <div>A相电压</div>
+                  <div>C相电压</div>
                   <div>
-                    <div class="mb-5">幅值:9.72A</div>
+                    <div class="mb-5">
+                      幅值:{{ getData.uc ? getData.uc + ' V' : 0 }}
+                    </div>
                     <div>相角:-</div>
                   </div>
                 </li>
@@ -109,7 +121,7 @@
           >
             <el-col :span="12" class="loopUnbanlanceCard">
               <div class="grid-content" style="text-align: center">
-                <loop-radarChart></loop-radarChart>
+                <loop-radarChart2 :getData="getData" v-loading="loading"></loop-radarChart2>
               </div>
             </el-col>
             <el-col :span="12" class="loopUnbanlanceCard">
@@ -124,27 +136,33 @@
                 "
               >
                 <div class="mb-10">电流不平衡度</div>
-                <div>100%</div>
+                <div>{{ getData.elBalun ? getData.elBalun * 100 : 0 }}%</div>
               </div>
               <ul>
                 <li>
-                  <div>A相电</div>
+                  <div>A相电</div>
                   <div>
-                    <div class="mb-5">幅值:9.72A</div>
+                    <div class="mb-5">
+                      幅值:{{ getData.ua ? getData.ia + ' A' : 0 }}
+                    </div>
                     <div>相角:-</div>
                   </div>
                 </li>
                 <li>
-                  <div>A相电压</div>
+                  <div>B相电流</div>
                   <div>
-                    <div class="mb-5">幅值:9.72A</div>
+                    <div class="mb-5">
+                      幅值:{{ getData.ua ? getData.ib + ' A' : 0 }}
+                    </div>
                     <div>相角:-</div>
                   </div>
                 </li>
                 <li>
-                  <div>A相电压</div>
+                  <div>C相电流</div>
                   <div>
-                    <div class="mb-5">幅值:9.72A</div>
+                    <div class="mb-5">
+                      幅值:{{ getData.ua ? getData.ic + ' A' : 0 }}
+                    </div>
                     <div>相角:-</div>
                   </div>
                 </li>
@@ -157,7 +175,7 @@
 
       <!-- 谐波 -->
       <el-col :md="24" :lg="16">
-        <harmonic-panel></harmonic-panel>
+        <harmonic-panel v-loading="loading"></harmonic-panel>
       </el-col>
       <!-- 谐波 end -->
     </el-row>
@@ -165,54 +183,76 @@
     <el-row :gutter="20" class="mt-20">
       <!-- 电压start -->
       <el-col :md="24" :lg="8" class="mb-20">
-        <voltage-panel></voltage-panel>
+        <voltage-panel :getData="getData" v-loading="loading"></voltage-panel>
       </el-col>
       <!-- 电压end -->
 
       <!-- 频率 start-->
       <el-col :md="24" :lg="8" class="mb-20">
-        <frequency-panel></frequency-panel>
+        <frequency-panel :getData="getData" v-loading="loading"></frequency-panel>
       </el-col>
       <!-- 频率 end -->
 
       <!-- 有功功率 -->
       <el-col :md="24" :lg="8">
-        <power-panel></power-panel>
+        <power-panel :getData="getData" v-loading="loading"></power-panel>
       </el-col>
       <!-- 有功功率 end -->
     </el-row>
+
+    <!--指标说明弹框组件开始-----------------------start-->
+    <descrip-dialog
+      :dialogTitle="dialogTitle"
+      @closeDialog="closeDialog"
+      :flag="showDialog"
+      :siteId="siteId"
+      class="descripDialog"
+    ></descrip-dialog>
+    <!--指标说明弹框组件结束-----------------------end-->
   </div>
 </template>
 
 <script>
 import { useStore } from 'vuex'
-import { defineComponent, onMounted,ref } from 'vue'
+import { defineComponent, onMounted, ref} from 'vue'
 import loopRadarChart from './loopMonitorComponent/loopRadarChart'
-
+import loopRadarChart2 from './loopMonitorComponent/loopRadarChart2'
 import harmonicPanel from './loopMonitorComponent/harmonicPanel'
 import voltagePanel from './loopMonitorComponent/voltagePanel'
 import frequencyPanel from './loopMonitorComponent/frequencyPanel'
 import powerPanel from './loopMonitorComponent/powerPanel'
+import descripDialog from './loopMonitorComponent/descripDialog'
 
-import * as api from '@/api/powerQuality/realScore.js'
+import * as api from '@/api/powerQuality/loopMonitor.js'
 import { ElMessage } from 'element-plus'
+import { ElNotification } from 'element-plus'
+
 
 export default defineComponent({
   name: 'LoopMonitor',
   components: {
     loopRadarChart,
+    loopRadarChart2,
     harmonicPanel,
     voltagePanel,
     frequencyPanel,
     powerPanel,
+    descripDialog,
+  },
+  props: {
+    activeName: String,
   },
-  setup() {
+  setup(props) {
     const store = useStore()
-
+     const loading=ref(false)
+    const getData = ref({})
     const deviceList = ref([])
     const deviceCode = ref('')
+    const showDialog = ref(false)
+    const dialogTitle = ref('')
+    const siteId = ref(0)
 
-    function linkDevice(){
+    function linkDevice() {
       deviceSelect()
     }
 
@@ -227,18 +267,67 @@ export default defineComponent({
         }
       })
     }
-   
+
+    //数据请求
+    function realScoreOne() {
+      if(!deviceCode.value){
+        
+          ElNotification({
+          title: '提示',
+          message: '请选择左侧设备信息',
+          type: 'warning',
+        })
+        return
+      }
+       loading.value=true
+      api.realScoreOne({ deviceCode: deviceCode.value }).then((requset) => {
+        loading.value=false
+        if (requset.status === 'SUCCESS') {
+          getData.value = requset.data
+        } else {
+          ElMessage.error(requset.msg)
+        }
+      })
+      // nowTime.value = parseTime(new Date())
+    }
+
+    // 查看指标说明
+    const descripDialog = () => {
+      siteId.value = store.state.siteId
+      dialogTitle.value = '指标说明'
+      showDialog.value = true
+    }
+    // 关闭操作
+    const closeDialog = () => {
+      showDialog.value = false
+    }
+    
+
     onMounted(() => {
-      deviceSelect()
-      
+        deviceSelect()
+  
+       if (props.activeName == 'second') {
+          setTimeout(function () {
+            realScoreOne()
+           
+          }, 1000)
+        }
+     
     })
     return {
       store,
+      getData,
       deviceList,
       deviceCode,
       linkDevice,
-      deviceSelect
-     
+      deviceSelect,
+      realScoreOne,
+      descripDialog,
+      showDialog,
+      dialogTitle,
+      closeDialog,
+      siteId,
+      loading
     }
   },
 })

+ 186 - 0
src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/descripDialog.vue

@@ -0,0 +1,186 @@
+<template>
+  <div class="descripDialog">
+    <el-dialog
+      :title="dialogTitle"
+      v-model="dialogVisible"
+      width="600px"
+      @close="closeDialog(0)"
+      @open="open"
+    >
+      <div style="width: 100%; ">
+        <el-tabs v-model="activeName" @tab-click="handleClick">
+           <el-tab-pane label="配置内容" name="first">
+            <div class="desBlock">
+              <h3>【设备级配置】 <a @click="goSiteWatchDog">立即前往</a></h3>
+              <p>请在 站点管理->监控设备中配置 或 联系运维管理员:</p>
+              <span>额定电压、额定电流、电流负载率门限、电能质量分析</span>
+              <span>如果设备没有配置额定电压,电压/谐波畸变率分析项可能没有数据</span>
+              <span>如果设备不勾选电能质量分析,该设备不参与电能质量分析</span>
+            </div>
+            <div class="desBlock">
+              <h3>【变量级配置】<a @click="goSiteVariableList">立即前往</a></h3>
+              <p>请在 站点管理->变量列表中配置 或 联系运维管理员:配置下列变量,且需要指定变量的变量属性</p>
+              <span>A/B/C相电压</span>
+              <span>A/B/C相电流</span>
+              <span>频率</span>
+              <span>有功/无功功率</span>
+              <span>有功/无功电度</span>
+              <span>电压三相不平衡度</span>
+              <span>电流三相不平衡度</span>
+              <span>A/B/C相电压相角</span>
+              <span>A/B/C相电流相角</span>
+              <span>A/B/C相电压总谐波畸变率</span>
+              <span>A/B/C相电流总谐波畸变率</span>
+              <span>2~31次A/B/C相电压谐波含量或有效值 (可二选一)</span>
+              <span>2~31次A/B/C相电流谐波含量或有效值 (可二选一)</span>
+              <span>如果变量没有指定变量属性 或 变量没有数据,分析项可能没有数据</span>
+            </div>
+          
+          </el-tab-pane>
+       
+         
+         
+        </el-tabs>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { useStore } from 'vuex'
+import { defineComponent, ref, watchEffect } from 'vue'
+import {useRouter} from 'vue-router'
+// import * as api from '@/api/siteManage/watchDog.js'
+// import { ElMessage } from 'element-plus'
+
+export default defineComponent({
+  name: 'DescripDialog',
+  emits: ['closeDialog'],
+  props: {
+    flag: Boolean,
+    dialogTitle: String,
+    itemInfo: Object,
+    siteId:Number
+  },
+  setup(props, context) {
+    context
+    const store = useStore()
+    let router = useRouter();
+    const dialogVisible = ref(false)
+
+    const activeName=ref('first')
+
+
+    // open(): Dialog弹窗打开之前做的事
+    const open = () => {
+      // console.log('siteList.value')
+    
+    }
+
+   
+
+    // 关闭弹框
+    const closeDialog = () => {
+      context.emit('closeDialog', false)
+      dialogVisible.value = false
+    }
+
+    watchEffect((fn, options) => {
+      fn, options
+      dialogVisible.value = props.flag
+    })
+
+
+    function handleClick(tab, event) {
+      console.log(tab, event)
+    }
+    function goSiteWatchDog(){
+      store.state.goUrl=2
+      router.push({
+    //传递参数使用query的话,指定path或者name都行,但使用params的话,只能使用name指定 
+        path:'/siteManage',
+        query:{
+        activeName:'second',
+        siteId:store.state.siteId
+        }
+      })
+    }
+    function goSiteVariableList(){
+      store.state.goUrl=3
+      router.push({
+    //传递参数使用query的话,指定path或者name都行,但使用params的话,只能使用name指定 
+        path:'/siteManage',
+        query:{
+        activeName:'third',
+        siteId:store.state.siteId
+        }
+      })
+
+    }
+   
+
+    return {
+      store,
+      closeDialog,
+      dialogVisible,
+    
+      open,
+
+      handleClick,
+      activeName,
+      goSiteWatchDog,
+      goSiteVariableList
+    }
+  },
+})
+</script>
+ 
+<style scoped lang="scss">
+.el-input,
+.el-select {
+  width: 240px;
+}
+
+// label样式
+.el-form-item__label {
+  width: 150px;
+}
+.el-form-item__content {
+  margin-left: 150px;
+}
+.desBlock {
+  padding:15px 0;
+  border-bottom:1px solid rgba(0,0,0,0.06);
+  h3{
+    margin:0 0 10px  0;
+    position:relative;
+    a{
+      position:absolute;
+      right:0
+    }
+    span{
+      position:absolute;
+      right:0;
+      font-size:14px;
+      color:#409eff;
+      cursor:pointer
+    }
+  }
+  p{
+    // margin-bottom:0px;
+  }
+  span{
+    display:block;
+    color:#7e93a6
+  }
+}
+</style>
+<style>
+.descripDialog .el-dialog__body{
+  padding-top:0
+}
+.descripDialog .el-overlay-dialog {
+  /* left: auto !important; */
+  /* bottom: auto !important; */
+}
+</style>

+ 44 - 35
src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/frequencyPanel.vue

@@ -5,16 +5,16 @@
         <span>频率</span>
       </div>
       <div style="padding: 30px">
-        <div class="frequencyTit">当前频率 50.03hZ</div>
+        <div class="frequencyTit">当前频率  {{watchData.f?watchData.f:50.03}}hZ</div>
         <div class="frequencyTit2">
           频率偏差
-          <span>0.06%</span>
+          <span> {{watchData.fdeviation?watchData.fdeviation:0.06}}%</span>
         </div>
         <el-row class="mt-40 frequencyBox">
           <el-col :span="2"><div class="grid-content bg-purple"></div></el-col>
-          <el-col :span="5"
-            ><div class="grid-content bg-purple-light"></div
-          ></el-col>
+          <el-col :span="5">
+            <div class="grid-content bg-purple-light"></div>
+          </el-col>
           <el-col class="rightSplitRed" :span="5">
             <div class="grid-content bg-purple">
               <el-tooltip
@@ -25,17 +25,16 @@
               >
                 <div class="rightSplitRedInner"></div>
               </el-tooltip>
-              
             </div>
             <i class="el-icon-caret-top"></i>
             <div class="greenShadow"></div>
           </el-col>
-          <el-col :span="5"
-            ><div class="grid-content bg-purple-light"></div
-          ></el-col>
-          <el-col :span="5"
-            ><div class="grid-content bg-purple-light"></div
-          ></el-col>
+          <el-col :span="5">
+            <div class="grid-content bg-purple-light"></div>
+          </el-col>
+          <el-col :span="5">
+            <div class="grid-content bg-purple-light"></div>
+          </el-col>
           <el-col :span="2"><div class="grid-content bg-purple"></div></el-col>
         </el-row>
         <el-row class="mt-20" style="text-align: right">
@@ -50,32 +49,42 @@
   </div>
 </template>
 <script>
+import { ref, watch } from 'vue'
 export default {
-  name: "FrenquencyPanel",
-  data() {
+  name: 'FrenquencyPanel',
+  props: {
+    getData: Object,
+  },
+  setup(props) {
+    props
+    const watchData = ref({})
+    const getData = async () => {
+      watchData.value = props.getData
+    }
+
+    const writeValue = (val) => {
+      val
+      getData()
+    }
+
+    //监听变化
+    watch(
+      () => props.getData,
+      (newVal, oldVal, clear) => {
+        // 执行异步任务,并得到关闭异步任务的 id
+        newVal
+        let id = writeValue(newVal, oldVal)
+        // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
+        clear(() => clearTimeout(id))
+      },
+      { lazy: true }
+    )
+
     return {
-      tableData: [
-        {
-          date: "10.31(kV)",
-          name: "Tom",
-          pointNum: 60,
-          status: "warning",
-        },
-        {
-          date: "0(kV)",
-          name: "Tom2",
-          pointNum: 0,
-          status: "exception",
-        },
-        {
-          date: "10.35(kV)",
-          name: "Tom",
-          pointNum: 70,
-        },
-      ],
-    };
+      watchData,
+    }
   },
-};
+}
 </script>
 <style scoped lang="scss">
 .el-row {

+ 3 - 3
src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/harmonicPanel.vue

@@ -22,11 +22,11 @@
       </div>
       <div class="harmonicCard" style="border-bottom: 1px solid #d3dce6">
         <div style="text-align: center; margin-top:20px">电压谐波 / %</div>
-        <loopLine-Chart></loopLine-Chart>
+        <loopLine-Chart :num="num" :unit="' V'"></loopLine-Chart>
       </div>
       <div class="harmonicCard">
-        <div style="text-align: center; margin-top:20px">电谐波 / %</div>
-        <loopLine-Chart></loopLine-Chart>
+        <div style="text-align: center; margin-top:20px">电谐波 / %</div>
+        <loopLine-Chart :num="num" :unit="' A'"></loopLine-Chart>
       </div>
     </div>
   </div>

+ 88 - 39
src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/loopLineChart.vue

@@ -4,31 +4,26 @@
   </div>
 </template>
 <script>
-import { computed, defineComponent, onMounted, ref } from 'vue'
-import { useStore } from 'vuex'
+import { defineComponent, onMounted, ref, watch } from 'vue'
+// import { useStore } from 'vuex'
 import * as echarts from 'echarts'
 
 export default defineComponent({
   name: 'LoopLineChart',
-  setup() {
-    const store = useStore()
+  props: {
+    num: Number,
+    unit:String
+  },
+  setup(props) {
+    // const store = useStore()
     const lineChartBanlance = ref(null)
 
-    // 总数
-    const total = computed(() => store.state.Home.worksChartData.total)
-    // num
-    const num = computed(() => store.state.Home.worksChartData.num)
-
     // 读取数据 func
     const loading = ref(true)
     const getData = async () => {
-      // loading.value = true
-      // await store.dispatch('Home/queryWorksChartData')
       loading.value = false
     }
-
-    onMounted(() => {
-      getData()
+    function echarts2() {
       let myChart = echarts.init(lineChartBanlance.value)
       // 绘制图表
       myChart.setOption({
@@ -45,9 +40,18 @@ export default defineComponent({
         //   show: false,
         // },
         tooltip: {
-          // show: true
+          // trigger: 'axis',
+          // axisPointer: { type: 'cross' },
+
           trigger: 'axis',
-          axisPointer: { type: 'cross' },
+          formatter: function (params) {
+            var relVal = params[0].name
+            for (var i = 0, l = params.length; i < l; i++) {
+              relVal +=
+                '<br/>' + params[i].seriesName + ' : ' + params[i].value + props.unit
+            }
+            return relVal
+          },
         },
         grid: {
           left: '20',
@@ -69,21 +73,43 @@ export default defineComponent({
             },
           },
           boundaryGap: false,
-          data: [
-            '总谐波',
-            '3次谐波',
-            '5次谐波',
-            '7次谐波',
-            '9次谐波',
-            '11次谐波',
-            '13次谐波',
-            '15次谐波',
-            '17次谐波',
-            '19次谐波',
-            '21次谐波',
-            '23次谐波',
-            '25次谐波',
-          ],
+          data:
+            props.num == 0
+              ? [
+                  '总谐波',
+                  '3次谐波',
+                  '5次谐波',
+                  '7次谐波',
+                  '9次谐波',
+                  '11次谐波',
+                  '13次谐波',
+                  '15次谐波',
+                  '17次谐波',
+                  '19次谐波',
+                  '21次谐波',
+                  '23次谐波',
+                  '25次谐波',
+                  '27次谐波',
+                  '29次谐波',
+                  '31次谐波',
+                ]
+              : [
+                  '2总谐波',
+                  '4次谐波',
+                  '6次谐波',
+                  '8次谐波',
+                  '10次谐波',
+                  '12次谐波',
+                  '14次谐波',
+                  '16次谐波',
+                  '18次谐波',
+                  '20次谐波',
+                  '22次谐波',
+                  '24次谐波',
+                  '26次谐波',
+                  '28次谐波',
+                  '30次谐波',
+                ],
         },
         yAxis: {
           // name: "A",
@@ -112,8 +138,8 @@ export default defineComponent({
             symbolSize: 7,
             smooth: false,
             data: [
-              10, 2, 12, 0, 5, 10, 2, 12, 0, 5, 10, 2, 12, 0, 5, 10, 2, 12, 0,
-              5, 10, 2, 12, 0, 5,
+              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+              0, 0, 0, 0, 0, 0,
             ],
           },
           {
@@ -122,8 +148,8 @@ export default defineComponent({
             symbolSize: 7,
             smooth: false,
             data: [
-              10, 2, 12, 0, 7, 8, 9, 7, 19, 7, 8, 9, 7, 19, 7, 8, 9, 7, 19, 7,
-              8, 9, 7, 19, 7, 8, 9, 7, 19,
+              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+              0, 0, 0, 0, 0, 0,
             ],
           },
           {
@@ -132,8 +158,8 @@ export default defineComponent({
             symbolSize: 7,
             smooth: false,
             data: [
-              5, 3, 6, 5, 14, 5, 3, 6, 5, 14, 5, 3, 6, 5, 14, 5, 3, 6, 5, 14, 5,
-              3, 6, 5, 14, 5, 3, 6, 5, 14,
+              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+              0, 0, 0, 0, 0, 0,
             ],
           },
         ],
@@ -141,13 +167,36 @@ export default defineComponent({
       window.addEventListener('resize', () => {
         myChart.resize()
       })
+    }
+
+    const writeValue = (val) => {
+      val
+      getData()
+      echarts2()
+    }
+
+    //监听变化
+    watch(
+      () => props.num,
+      (newVal, oldVal, clear) => {
+        // 执行异步任务,并得到关闭异步任务的 id
+        newVal
+        let id = writeValue(newVal, oldVal)
+        // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
+        clear(() => clearTimeout(id))
+      },
+      { lazy: true }
+    )
+
+    onMounted(() => {
+      getData()
+      echarts2()
     })
 
     return {
       lineChartBanlance,
       loading,
-      total,
-      num,
+      echarts2,
     }
   },
 })

+ 48 - 11
src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/loopRadarChart.vue

@@ -1,19 +1,23 @@
 <template>
   <div shadow="never" class="homeBoxCard" v-loading="loading">
-    <div class="height260" ref="lineChartBanlance" />
+    <div class="height260" ref="lineChartBanlance" id="lineChartBanlance" />
   </div>
 </template>
 <script>
-import { computed, defineComponent, onMounted, ref } from 'vue'
+import { computed, defineComponent, onMounted, ref, watch } from 'vue'
 import { useStore } from 'vuex'
 import * as echarts from 'echarts'
 
 export default defineComponent({
   name: 'LoopRadarChart',
-  setup() {
+  props: {
+    getData: Object,
+  },
+  setup(props) {
     let lineChartBanlance = ref(null)
 
     const store = useStore()
+    const max=ref(0)
 
     // 总数
     const total = computed(() => store.state.Home.worksChartData.total)
@@ -26,11 +30,19 @@ export default defineComponent({
       // loading.value = true
       // await store.dispatch('Home/queryWorksChartData')
       loading.value = false
-    }
+      var aa = [props.getData.ua, props.getData.ub, props.getData.uc]
 
-    onMounted(() => {
-      getData()
-      let myChart = echarts.init(lineChartBanlance.value)
+      aa.sort(function (a, b) {
+        return a - b
+      })
+      max.value=  aa.pop()
+       if (!props.getData.ua && !props.getData.ub && !props.getData.uc) {
+        max.value = 1
+      }
+    
+    }
+    function echarts2() {
+      let myChart = echarts.init(document.getElementById('lineChartBanlance'))
       // 绘制图表
       myChart.setOption({
         backgroundColor: '#FFF',
@@ -72,15 +84,15 @@ export default defineComponent({
           indicator: [
             {
               name: 'Ua',
-              max: 100,
+              max: max.value?max.value:0,
             },
             {
               name: 'Ub',
-              max: 100,
+              max: max.value?max.value:0,
             },
             {
               name: 'Uc',
-              max: 100,
+              max: max.value?max.value:0,
             },
           ],
         },
@@ -101,7 +113,7 @@ export default defineComponent({
                 itemStyle: {
                   color: '#5eb6db',
                 },
-                value: [20, 33, 80, 50, 30, 40, 100],
+                value: [props.getData.ua, props.getData.ub, props.getData.uc],
               },
             ],
           },
@@ -110,6 +122,30 @@ export default defineComponent({
       window.addEventListener('resize', () => {
         myChart.resize()
       })
+    }
+
+    const writeValue = (val) => {
+      val
+      getData()
+      echarts2()
+    }
+
+    //监听变化
+    watch(
+      () => props.getData,
+      (newVal, oldVal, clear) => {
+        // 执行异步任务,并得到关闭异步任务的 id
+       newVal
+        let id = writeValue(newVal, oldVal)
+        // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
+        clear(() => clearTimeout(id))
+      },
+      { lazy: true }
+    )
+
+    onMounted(() => {
+      getData()
+      echarts2()
     })
 
     return {
@@ -117,6 +153,7 @@ export default defineComponent({
       loading,
       total,
       num,
+      echarts2,
     }
   },
 })

+ 185 - 0
src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/loopRadarChart2.vue

@@ -0,0 +1,185 @@
+<template>
+  <div shadow="never" class="homeBoxCard" v-loading="loading">
+    <div class="height260" ref="lineChartBanlance2" id="lineChartBanlance2" />
+  </div>
+</template>
+<script>
+import { computed, defineComponent, onMounted, ref, watch } from 'vue'
+import { useStore } from 'vuex'
+import * as echarts from 'echarts'
+
+export default defineComponent({
+  name: 'LoopRadarChart2',
+  props: {
+    getData: Object,
+  },
+  setup(props) {
+    let lineChartBanlance = ref(null)
+
+    const store = useStore()
+    const max = ref(0)
+
+    // 总数
+    const total = computed(() => store.state.Home.worksChartData.total)
+    // num
+    const num = computed(() => store.state.Home.worksChartData.num)
+
+    // 读取数据 func
+    const loading = ref(true)
+    const getData = async () => {
+      // loading.value = true
+      // await store.dispatch('Home/queryWorksChartData')
+      loading.value = false
+      var aa = [props.getData.ia, props.getData.ib, props.getData.ic]
+      aa.sort(function (a, b) {
+        return a - b
+      })
+      max.value = aa.pop()
+
+      if (!props.getData.ia && !props.getData.ib && !props.getData.ic) {
+        max.value = 1
+      }
+    }
+    function echarts2() {
+      let myChart = echarts.init(document.getElementById('lineChartBanlance2'))
+      // 绘制图表
+      myChart.setOption({
+        backgroundColor: '#FFF',
+        tooltip: {},
+        grid: {
+          left: '20',
+          right: '40',
+          top: '-20',
+          bottom: '0',
+          containLabel: true,
+        },
+        radar: {
+          shape: 'circle',
+          radius: '70%',
+          center: ['50%', '55%'],
+          splitNumber: 5,
+          nameGap: '15',
+          name: {
+            textStyle: {
+              color: '#a8a8a8',
+            },
+          },
+          axisLine: {
+            lineStyle: {
+              color: '#ebebeb',
+            },
+          },
+          splitLine: {
+            lineStyle: {
+              width: 1,
+              color: '#ebebeb',
+            },
+          },
+          splitArea: {
+            areaStyle: {
+              color: ['#f8f8f8', '#fff'].reverse(),
+            },
+          },
+          indicator: [
+            {
+              name: 'Ia',
+              max: max.value ? max.value : 0,
+            },
+            {
+              name: 'Ib',
+              max: max.value ? max.value : 0,
+            },
+            {
+              name: 'Ic',
+              max: max.value ? max.value : 0,
+            },
+          ],
+        },
+        series: [
+          {
+            name: 'Title✍',
+            type: 'radar',
+            symbolSize: 12,
+            itemStyle: {
+              borderColor: '#ebebeb',
+              borderWidth: 2,
+            },
+            areaStyle: {
+              opacity: 0.3,
+            },
+            data: [
+              {
+                itemStyle: {
+                  color: '#5eb6db',
+                },
+                value: [props.getData.ia, props.getData.ib, props.getData.ic],
+              },
+            ],
+          },
+        ],
+      })
+      window.addEventListener('resize', () => {
+        myChart.resize()
+      })
+    }
+
+    const writeValue = (val) => {
+      val
+      getData()
+      echarts2()
+    }
+
+    //监听变化
+    watch(
+      () => props.getData,
+      (newVal, oldVal, clear) => {
+        // 执行异步任务,并得到关闭异步任务的 id
+        newVal
+      
+        let id = writeValue(newVal, oldVal)
+        // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
+        clear(() => clearTimeout(id))
+      },
+      { lazy: true }
+    )
+
+    onMounted(() => {
+      getData()
+      echarts2()
+    })
+
+    return {
+      lineChartBanlance,
+      loading,
+      total,
+      num,
+      echarts2,
+      max,
+    }
+  },
+})
+</script>
+<style lang="scss" scoped>
+.homeBoxCard {
+  margin-bottom: 24px;
+  ::v-deep(.el-card__header) {
+    padding-left: 12px;
+    padding-right: 12px;
+  }
+  ::v-deep(.el-card__body) {
+    padding: 12px;
+    font-size: 14px;
+    line-height: 1.5715;
+  }
+  ::v-deep(.el-divider) {
+    margin: 8px 0;
+  }
+  .num {
+    font-size: 30px;
+    color: #515a6e;
+  }
+  .height260 {
+    height: 200px;
+  }
+}
+</style>

+ 74 - 32
src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/powerPanel.vue

@@ -4,7 +4,7 @@
       <div class="blanceChartTit">
         <span>有功功率和无功功率</span>
       </div>
-      <div style="padding: 70px 20px ">
+      <div style="padding: 70px 20px">
         <div style="display: flex">
           <div class="uList">
             <p>有功功率</p>
@@ -18,28 +18,28 @@
           >
             <el-table-column prop="name" label="进度条">
               <template #default="scope">
-                <div class="demo-progress" >
-
-                   <el-tooltip
+                <div class="demo-progress">
+                  <el-tooltip
                     class="item"
                     effect="dark"
-                    :content="scope.row.name+ ' ' + scope.row.date"
+                    :content="scope.row.name + ' ' + scope.row.date"
                     placement="top"
                   >
                     <el-progress
-                    :text-inside="true"
-                    :stroke-width="14"
-                    :percentage="scope.row.pointNum"
-                    :status="scope.row.status"
-                  />
+                      :text-inside="true"
+                      :stroke-width="14"
+                      :percentage="scope.row.pointNum"
+                      :status="scope.row.status"
+                    />
                   </el-tooltip>
-
-
-                  
                 </div>
               </template>
             </el-table-column>
-            <el-table-column prop="date" label="日期"  width="100"> </el-table-column>
+            <el-table-column
+              prop="date"
+              label="日期"
+              width="100"
+            ></el-table-column>
           </el-table>
         </div>
       </div>
@@ -47,27 +47,69 @@
   </div>
 </template>
 <script>
+import { ref, watch } from 'vue'
 export default {
-  name: "PowerPanel",
-  data() {
+  name: 'PowerPanel',
+  props: {
+    getData: Object,
+  },
+
+  setup(props) {
+    props
+    const tableData = ref([
+      {
+        date: (props.getData.p? props.getData.p:0) + '(kV)',
+        name: '有功功率',
+        pointNum: (props.getData.percentage?props.getData.percentage:0) * 100,
+        status: 'warning',
+      },
+      {
+        date: (props.getData.q?props.getData.q:0) + '(kV)',
+        name: '无功功率',
+        pointNum: (props.getData.qercentage?props.getData.qercentage:0) * 100,
+        status: 'exception',
+      },
+    ])
+    const getData = async () => {
+      tableData.value = [
+       {
+        date: (props.getData.p? props.getData.p:0) + '(kV)',
+        name: '有功功率',
+        pointNum: (props.getData.ppercentage?props.getData.ppercentage:0) * 100,
+        status: 'warning',
+      },
+      {
+        date: (props.getData.q?props.getData.q:0) + '(kV)',
+        name: '无功功率',
+        pointNum: (props.getData.qpercentage?props.getData.qpercentage:0) * 100,
+        status: 'exception',
+      },
+      ]
+    }
+
+    const writeValue = (val) => {
+      val
+      getData()
+    }
+
+    //监听变化
+    watch(
+      () => props.getData,
+      (newVal, oldVal, clear) => {
+        // 执行异步任务,并得到关闭异步任务的 id
+        newVal
+        let id = writeValue(newVal, oldVal)
+        // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
+        clear(() => clearTimeout(id))
+      },
+      { lazy: true }
+    )
+
     return {
-         tableData: [
-        {
-          date: "10.31(kV)",
-          name: "有功功率",
-          pointNum: 60,
-          status: "warning",
-        },
-        {
-          date: "0(kV)",
-          name: "无功功率",
-          pointNum: 0,
-          status: "exception",
-        },
-      ],
-    };
+      tableData,
+    }
   },
-};
+}
 </script>
 <style scoped lang="scss">
 .el-row {

+ 79 - 26
src/views/powerQuality/realTimeMonitoring/loopMonitorComponent/voltagePanel.vue

@@ -7,7 +7,7 @@
       </div>
       <div>
         <div class="shangXian" style="">
-          <div>下限5.37kv</div>
+          <div>下限5.37kV</div>
           <div>上限6.18kV</div>
         </div>
         <div style="padding: 20px; display: flex">
@@ -28,7 +28,7 @@
                   <el-tooltip
                     class="item"
                     effect="dark"
-                    :content="scope.row.name+ ' ' + scope.row.date"
+                    :content="scope.row.name + ' ' + scope.row.date"
                     placement="top"
                   >
                     <el-progress
@@ -42,7 +42,11 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column prop="date" label="日期" width="100px"> </el-table-column>
+            <el-table-column
+              prop="date"
+              label="日期"
+              width="100px"
+            ></el-table-column>
           </el-table>
         </div>
       </div>
@@ -50,32 +54,81 @@
   </div>
 </template>
 <script>
+import {  ref, watch } from 'vue'
 export default {
-  name: "VoltagePanel",
-  data() {
+  name: 'VoltagePanel',
+  props: {
+    getData: Object,
+  },
+  setup(props) {
+    props
+   const tableData = ref([
+      {
+        date: '0(kV)',
+        name: 'Ua',
+        pointNum: 0,
+        status: 'warning',
+      },
+      {
+        date: '0(kV)',
+        name: 'Ub',
+        pointNum: 0,
+        status: 'exception',
+      },
+      {
+        date: '0(kV)',
+        name: 'Uc',
+        pointNum: 0,
+      },
+    ])
+    const getData = async () => {
+      tableData.value=[
+      {
+        date: (props.getData.ua?props.getData.ua:0)+'kV',
+        name: 'Ua',
+        pointNum:props.getData.uaPercentage*100,
+        status: 'warning',
+      },
+      {
+        date: (props.getData.ub?props.getData.ub:0)+'kV',
+        name: 'Ub',
+        pointNum: props.getData.ubPercentage*100,
+        status: 'exception',
+      },
+      {
+        date: (props.getData.uc?props.getData.uc:0)+'kV',
+        name: 'Uc',
+        pointNum:  props.getData.ucPercentage*100,
+      },
+    ]
+     
+    }
+
+    const writeValue = (val) => {
+      val
+      getData()
+  
+    }
+
+    //监听变化
+    watch(
+      () => props.getData,
+      (newVal, oldVal, clear) => {
+        // 执行异步任务,并得到关闭异步任务的 id
+        newVal
+    
+        let id = writeValue(newVal, oldVal)
+        // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
+        clear(() => clearTimeout(id))
+      },
+      { lazy: true }
+    )
+
     return {
-      tableData: [
-        {
-          date: "10.31(kV)",
-          name: "Ua",
-          pointNum: 60,
-          status: "warning",
-        },
-        {
-          date: "0(kV)",
-          name: "Ub",
-          pointNum: 0,
-          status: "exception",
-        },
-        {
-          date: "10.35(kV)",
-          name: "Uc",
-          pointNum: 70,
-        },
-      ],
-    };
+      tableData,
+    }
   },
-};
+}
 </script>
 <style scoped lang="scss">
 .el-row {

+ 50 - 20
src/views/powerQuality/realTimeMonitoring/realScore.vue

@@ -43,7 +43,7 @@
           <el-button
             type="primary"
             class="search-button"
-            style="margin-left: 30px"
+            style="margin-left: 30px;cursor:pointer!important"
             @click="realScore()"
           >
             刷新
@@ -64,7 +64,7 @@
           <div class="blanceChartTit">
             <span>评分</span>
           </div>
-          <radar-chart :getTableData="getData[0]"></radar-chart>
+          <radar-chart :getTableData="getData[0]" v-loading="loading"></radar-chart>
           <div class="totalScore">
             总评分:{{ getData[0].score }}
             <el-button :type=" getData[0].score > 80
@@ -92,7 +92,7 @@
             <span>回路统计</span>
           </div>
           <div>
-            <pie-chart :getTableData="getData[0]"></pie-chart>
+            <pie-chart :getTableData="getData[0]" v-loading="loading"></pie-chart>
           </div>
         </div>
         <!-- 回路统计 end -->
@@ -105,6 +105,7 @@
           style="width: 100%"
           :header-cell-style="headCellStyle"
            :cell-style="cellStyle"
+           v-loading="loading"
         >
           <el-table-column label="回路" width="" align="center">
             <template #default="scope">
@@ -253,7 +254,6 @@
     <!--指标说明弹框组件开始-----------------------start-->
     <descrip-dialog
       :dialogTitle="dialogTitle"
-      :itemInfo="tableItem"
       @closeDialog="closeDialog"
       :flag="showDialog2"
       class="descripDialog"
@@ -270,10 +270,11 @@ import pieChart from './realScoreComponent/pieChart.vue'
 import dialogChartOne from './realScoreComponent/dialogChartOne'
 import descripDialog from './realScoreComponent/descripDialog'
 import { useStore } from 'vuex'
-import { defineComponent, onMounted, ref } from 'vue'
+import { defineComponent, onMounted, ref,watch } from 'vue'
 import * as api from '@/api/powerQuality/realScore.js'
 import { ElMessage } from 'element-plus'
 import { parseTime } from '@/utils'
+import { ElNotification } from 'element-plus'
 
 export default defineComponent({
   name: 'RealScore',
@@ -282,11 +283,13 @@ export default defineComponent({
     pieChart,
     dialogChartOne,
     descripDialog
-
-    
   },
-  setup() {
+   props: {
+    activeName: String,
+  },
+  setup(props) {
     const store = useStore()
+    const loading=ref(false)
     const num = ref(1)
     const nowTime = ref(parseTime(new Date()))
     const value4 = ref('')
@@ -338,17 +341,31 @@ export default defineComponent({
      await api.deviceListOne({ siteId: store.state.siteId }).then((requset) => {
         if (requset.status === 'SUCCESS') {
           deviceList.value = requset.data
-          deviceCode.value = requset.data[0].deviceCode
-          realScore()
+          // deviceCode.value = requset.data[0].deviceCode
+          deviceCode.value = requset.data[0]?requset.data[0].deviceCode:''
+          // realScore()
         } else {
           ElMessage.error(requset.msg)
         }
       })
     }
 
-    //表格数据请求
+    //主页面数据请求
     function realScore() {
+
+      if(!deviceCode.value){
+        
+          ElNotification({
+          title: '提示',
+          message: '请选择左侧设备信息',
+          type: 'warning',
+        })
+        return
+      }
+       loading.value=true
       api.realScore({ deviceCode: deviceCode.value }).then((requset) => {
+        loading.value=false
+        
         if (requset.status === 'SUCCESS') {
           getData.value[0] = requset.data
         } else {
@@ -361,10 +378,11 @@ export default defineComponent({
     // 折线图详情总数据请求
     function rtRealScore(params) {
 
-      // var start = parseTime(new Date().setHours(0, 0, 0, 0))
-      // var end = parseTime(new Date())
-      var start = '2021-12-01 00:00:00'
-      var end = '2021-12-01 09:07:31'
+      var start = parseTime(new Date().setHours(0, 0, 0, 0))
+      var end=nowTime.value
+
+      // var start = '2021-12-01 00:00:00'
+      // var end = '2021-12-01 09:07:31'
 
       store.state.chartType=params
       // alert(store.state.chartType)
@@ -495,9 +513,6 @@ export default defineComponent({
             store.state.realScoreLineName = lineName
             store.state.realScoreLineName2 = lineName2
 
-            // console.log('echartsObj')
-            // console.log(echartsObj)
-
           } else {
             ElMessage.error(requset.msg)
           }
@@ -511,7 +526,7 @@ export default defineComponent({
       rtRealScore(params)
     }
 
-     // 查看视频
+     // 查看指标说明
     const descripDialog = () => {
       dialogTitle.value = '指标说明'
       showDialog2.value = true
@@ -524,9 +539,23 @@ export default defineComponent({
       
     }
 
+    watch(
+      () => props.activeName,
+      (newVal) => {
+        if (newVal == 'first') {
+         setTimeout(function(){
+        realScore()
+      },400)
+        }
+      }
+    )
+
     onMounted(() => {
       deviceSelect()
-      // realScore()
+      setTimeout(function(){
+        realScore()
+      },500)
+      
     })
     return {
       store,
@@ -549,6 +578,7 @@ export default defineComponent({
       echartsTitle,
       rtRealScore,
       linkDevice,
+      loading,
 
       descripDialog
     }

+ 53 - 6
src/views/powerQuality/realTimeMonitoring/realScoreComponent/descripDialog.vue

@@ -46,19 +46,19 @@
           </el-tab-pane>
           <el-tab-pane label="配置内容" name="second">
             <div class="desBlock">
-              <h3>【站点级配置】</h3>
+              <h3>【站点级配置】<a @click="goSitePowerScore">立即前往</a></h3>
               <p>请在 站点管理->电能质量评分配置中配置 或 联系运维管理员:</p>
               <span>电能质量各要素权重、功率因数标准值</span>
             </div>
             <div class="desBlock">
-              <h3>【设备级配置】</h3>
+              <h3>【设备级配置】<a @click="goSiteWatchDog">立即前往</a></h3>
               <p>请在 站点管理->监控设备中配置 或 联系运维管理员:</p>
               <span>额定电压、额定电流、电流负载率门限、电能质量分析</span>
               <span>如果设备没有配置额定电压,电压/谐波畸变率分析项可能没有数据</span>
               <span>如果设备不勾选电能质量分析,该设备不参与电能质量分析</span>
             </div>
             <div class="desBlock">
-              <h3>【变量级配置】</h3>
+              <h3>【变量级配置】<a @click="goSiteVariableList">立即前往</a></h3>
               <p>请在 站点管理->变量列表中配置 或 联系运维管理员:配置下列变量,且需要指定变量的变量属性</p>
               <span>A/B/C相电压</span>
               <span>A/B/C相电流</span>
@@ -85,7 +85,9 @@
 </template>
 
 <script>
-// import { useStore } from 'vuex'
+import { useStore } from 'vuex'
+import {useRouter} from 'vue-router'
+
 import { defineComponent, ref, watchEffect } from 'vue'
 // import * as api from '@/api/siteManage/watchDog.js'
 // import { ElMessage } from 'element-plus'
@@ -100,7 +102,8 @@ export default defineComponent({
   },
   setup(props, context) {
     context
-    // const store = useStore()
+     let router = useRouter();
+    const store = useStore()
     const dialogVisible = ref(false)
 
     const activeName=ref('first')
@@ -109,7 +112,6 @@ export default defineComponent({
     // open(): Dialog弹窗打开之前做的事
     const open = () => {
 
-      console.log('siteList.value')
     
     }
 
@@ -130,9 +132,46 @@ export default defineComponent({
     function handleClick(tab, event) {
       console.log(tab, event)
     }
+
+     function goSiteWatchDog(){
+      store.state.goUrl=2
+      router.push({
+    //传递参数使用query的话,指定path或者name都行,但使用params的话,只能使用name指定 
+        path:'/siteManage',
+        query:{
+        activeName:'second',
+        siteId:store.state.siteId
+        }
+      })
+    }
+    function goSiteVariableList(){
+      store.state.goUrl=3
+      router.push({
+    //传递参数使用query的话,指定path或者name都行,但使用params的话,只能使用name指定 
+        path:'/siteManage',
+        query:{
+        activeName:'six',
+        siteId:store.state.siteId
+        }
+      })
+
+    }
+    function goSitePowerScore(){
+      store.state.goUrl=6
+      router.push({
+    //传递参数使用query的话,指定path或者name都行,但使用params的话,只能使用name指定 
+        path:'/siteManage',
+        query:{
+        activeName:'six',
+        siteId:store.state.siteId
+        }
+      })
+
+    }
    
 
     return {
+       store,
       closeDialog,
       dialogVisible,
     
@@ -140,6 +179,10 @@ export default defineComponent({
 
       handleClick,
       activeName,
+
+      goSitePowerScore,
+      goSiteWatchDog,
+      goSiteVariableList
     }
   },
 })
@@ -164,6 +207,10 @@ export default defineComponent({
   h3{
     margin:0 0 10px  0;
     position:relative;
+    a{
+      position:absolute;
+      right:0
+    }
     span{
       position:absolute;
       right:0;

+ 0 - 2
src/views/powerQuality/realTimeMonitoring/realScoreComponent/innerLineChart2.vue

@@ -24,8 +24,6 @@ export default defineComponent({
       dataTimes.value = store.state.realScoreLineDataTime
 
       lineChartArr.value = store.state.realScoreLineObj2
-      console.log('store.state.realScoreLineObj2')
-      console.log(store.state.realScoreLineObj2)
       lineChartArr.value.forEach((value) => {
         value.type = 'line'
         value.smooth = false

+ 3 - 5
src/views/powerQuality/realTimeMonitoring/realScoreComponent/pieChart.vue

@@ -1,10 +1,10 @@
 <template>
-  <div shadow="never" class="homeBoxCard" v-loading="loading">
+  <div shadow="never" class="homeBoxCard">
     <div class="height300" id="pieChart" ref="pieChart" />
   </div>
 </template>
 <script>
-import { defineComponent, onMounted, ref ,watch} from 'vue'
+import { defineComponent, onMounted,watch} from 'vue'
 // import { useStore } from 'vuex'
 import * as echarts from 'echarts'
 
@@ -21,9 +21,7 @@ export default defineComponent({
   },
   setup(props) {
     // 读取数据 func
-    const loading = ref(true)
     const getData = async () => {
-      loading.value = false
     }
     function echarts2() {
       let myChart = echarts.init(document.getElementById('pieChart'))
@@ -70,6 +68,7 @@ export default defineComponent({
           orient: 'horizontal',
           bottom: '0%',
           align: 'left',
+           selectedMode: false, //取消图例上的点击事件
           // top:'middle',
           textStyle: {
             color: '#8C8C8C',
@@ -145,7 +144,6 @@ export default defineComponent({
     })
 
     return {
-      loading,
       echarts2,
     }
   },

+ 3 - 10
src/views/powerQuality/realTimeMonitoring/realScoreComponent/radarChart.vue

@@ -1,10 +1,10 @@
 <template>
-  <div shadow="never" class="homeBoxCard" v-loading="loading">
+  <div shadow="never" class="homeBoxCard">
     <div class="height260" id="radarChart" ref="radarChart" />
   </div>
 </template>
 <script>
-import {  defineComponent, onMounted, ref,watch } from 'vue'
+import {  defineComponent, onMounted, watch } from 'vue'
 import * as echarts from 'echarts'
 
 export default defineComponent({
@@ -15,15 +15,9 @@ export default defineComponent({
   setup(props) {
 
     // 读取数据 func
-    const loading = ref(true)
     const getData = async () => {
 
-      // loading.value = true;
       // await store.dispatch("Home/queryWorksChartData");
-      loading.value = false
-      console.log('props.getTableData')
-      console.log(props.getTableData.cosQ)
-  
     }
     function echarts2(){
        let myChart = echarts.init(document.getElementById('radarChart'))
@@ -104,7 +98,7 @@ export default defineComponent({
                 itemStyle: {
                   color: '#5eb6db',
                 },
-                value: [props.getTableData.vtBalunQ?20:0,props.getTableData.elBalunQ?20:0, props.getTableData.cosQ?20:0, props.getTableData.uQ?20:0, props.getTableData.iLoadQ?20:0],
+                value: [props.getTableData.vtBalunQ?20:0,props.getTableData.elBalunQ?20:0, props.getTableData.cosQ?20:0, props.getTableData.uq?20:0, props.getTableData.iloadQ?20:0],
               },
             ],
           },
@@ -145,7 +139,6 @@ export default defineComponent({
     })
 
     return {
-      loading,
    
       getData,
       echarts2

+ 0 - 4
src/views/powerQuality/unbalanceAnalysis/electricChart.vue

@@ -20,10 +20,6 @@ export default defineComponent({
     // 读取数据 func
     const loading = ref(true)
     const getData = async () => {
-
-      console.log('props.electricChartData.value')
-      console.log(props.electricChartData)
-     
       var arrOld = props.echartsData
       let dataTime = arrOld.map((item) => {
         return item.dataTime

+ 26 - 6
src/views/powerQuality/unbalanceAnalysis/index.vue

@@ -69,10 +69,13 @@
           <div class="blanceChartTit">电压不平衡度</div>
           <voltage-chart
             :echartsData="echartsData"
+            v-loading="loading"
           ></voltage-chart>
           <el-divider></el-divider>
           <voltage-chart2
             :echartsData="echartsData"
+            v-loading="loading"
+            
           ></voltage-chart2>
         </div>
       </el-col>
@@ -81,10 +84,12 @@
           <div class="blanceChartTit">电流不平衡度</div>
           <electric-chart
             :echartsData="echartsData"
+            v-loading="loading"
           ></electric-chart>
           <el-divider></el-divider>
           <electric-chart2
             :echartsData="echartsData"
+            v-loading="loading"
           ></electric-chart2>
         </div>
       </el-col>
@@ -113,6 +118,7 @@ export default defineComponent({
   },
   setup() {
     const store = useStore()
+    const loading=ref(false)
     const value4 = ref('请选择')
     const region = ref('')
     // const deviceCode = ref('')
@@ -148,7 +154,7 @@ export default defineComponent({
       ])
     const voltageChartData = ref({})
 
-    const dateTime = ref([new Date(2021, 10, 10, 10, 10), new Date()])
+    const dateTime = ref('')
 
     function linkDevice(){
       deviceSelect()
@@ -159,27 +165,39 @@ export default defineComponent({
         .deviceListOne({ siteId: store.state.siteId })
         .then((requset) => {
           if (requset.status === 'SUCCESS') {
-            console.log('requset.data')
-            console.log(requset.data)
+        
             deviceList.value = requset.data
             deviceCode.value = requset.data[0]?requset.data[0].deviceCode:''
 
-             rtRealScore()
           } else {
+            
             ElMessage.error(requset.msg)
           }
         })
     }
 
     function rtRealScore() {
+      
+        console.log('dateTime.value')
+       console.log(dateTime.value)
       if (!dateTime.value) {
         ElNotification({
           title: '提示',
           message: '请选择开始和结束时间',
           type: 'warning',
+        })
+         return
+      }
+      if(!deviceCode.value){
+        
+          ElNotification({
+          title: '提示',
+          message: '请选择左侧设备信息',
+          type: 'warning',
         })
         return
       }
+       loading.value=true
       store.commit('TimeAll_function', dateTime.value)
       const time = store.state.Time_Data
       api
@@ -189,14 +207,14 @@ export default defineComponent({
           endTime: time[1],
         })
         .then((requset) => {
+          loading.value=false
           if (requset.status === 'SUCCESS') {
             echartsData.value = requset.data
 
             if(!echartsData.value[0]){
-               ElMessage.error('暂无数据') 
+               ElMessage.warning('暂无数据') 
                return
             }
-      
           } else {
             ElMessage.error(requset.msg)
           }
@@ -204,6 +222,7 @@ export default defineComponent({
     }
 
     onMounted(() => {
+      dateTime.value=store.state.se_defaultTime
       deviceSelect()
 
      
@@ -221,6 +240,7 @@ export default defineComponent({
 
       dateTime,
        linkDevice,
+       loading
     }
   },
 })

+ 1 - 1
src/views/powerQuality/unbalanceAnalysis/voltageChart.vue

@@ -79,7 +79,7 @@ export default defineComponent({
           data: voltageChart.value.dataTime,
         },
         yAxis: {
-          name: 'kV',
+          name: 'V',
           nameTextStyle: {
             color: 'black',
             fontSize: 10,

+ 2 - 2
src/views/siteManage/addSiteCom.vue

@@ -45,7 +45,7 @@ import { useStore } from 'vuex'
 
 export default defineComponent({
   name: 'AddSiteCom',
-  emits: ['closeDialog2'],
+  emits: ['closeDialog','changeFather'],
   props: {
     flag: Boolean,
     dialogTitle: String,
@@ -104,7 +104,7 @@ export default defineComponent({
 
     // 保存-修改操作
     const submitForm = () => {
-      store.state.basicInfoConst = 1
+      // store.state.basicInfoConst = 1
       console.log('form.region')
       console.log(form.value.region)
       console.log('form.siteName')

+ 22 - 33
src/views/siteManage/basicInfo/index.vue

@@ -183,7 +183,6 @@
                   :action="uploadUrl"
                   :on-success="handleUpAvatar"
                   :on-remove="handleRemove"
-                  :on-change="handleChange"
                   :show-file-list="true"
                   list-type="picture-card"
                   :limit="3"
@@ -222,7 +221,7 @@
               >
                 保存
               </el-button>
-              <el-button @click="resetForm('formInfo')">取消</el-button>
+              <!-- <el-button @click="resetForm('formInfo')">取消</el-button> -->
             </el-form-item>
           </div>
         </el-col>
@@ -268,8 +267,6 @@ export default defineComponent({
     const dataSetRe = ref([])
 
     function handlePictureCardPreview(file) {
-      console.log('file')
-      console.log(file)
       dialogImageUrl.value = file.url
       dialogVisible.value = true
     }
@@ -303,13 +300,7 @@ export default defineComponent({
     //   return arr
     // }
 
-    // function handleChange(file, fileList) {
-    //   // console.log('这是handleChange')
-    //   // console.log('这是file', file)
-    //   // console.log('这是fileList', fileList)
-    //   fileList = uniqueArr(fileList)
-    //    console.log('这是fileList', fileList)
-    // }
+  
 
     //上传成功的回调
     function handleUpAvatar(res) {
@@ -340,17 +331,13 @@ export default defineComponent({
         newArray.value.push(item.url.substring(27))
       })
 
-      console.log('newArray.value')
-      console.log(newArray.value)
+   
     }
 
     //删除照片
     function handleRemove(res) {
       newArray.value = []
-      console.log('删除')
-      console.log(res)
-      console.log('fileListImages.value')
-      console.log(fileListImages.value)
+   
 
       Array.prototype.indexOf = function (val) {
         for (var i = 0; i < this.length; i++) {
@@ -372,12 +359,10 @@ export default defineComponent({
         newArray.value.push(item.url.substring(27))
       })
 
-      console.log('newArray.value')
-      console.log(newArray.value)
     }
 
     function resetForm() {
-      formInfo.value.resetFields()
+      formInfo.value.clearValidate()
     }
 
     // 动态属性下拉请求
@@ -415,8 +400,6 @@ export default defineComponent({
       api.routeDroplist().then((requset) => {
         if (requset.status === 'SUCCESS') {
           routeDropData.value = requset.data
-          console.log('routeDropData.value')
-          console.log(routeDropData.value)
         } else {
           ElMessage.error(requset.msg)
         }
@@ -429,7 +412,7 @@ export default defineComponent({
 
       api.getSite({ id: props.siteId }).then((requset) => {
         if (requset.status === 'SUCCESS') {
-          console.log(requset.data[0])
+          // console.log(requset.data[0])
           ruleForm.value = requset.data[0]
           ruleForm.value.region
             ? (ruleForm.value.region = requset.data[0].region.toString())
@@ -461,8 +444,7 @@ export default defineComponent({
             ruleForm.value.siteName = store.state.basicInfoSiteName //站点名称重新赋值
           }
 
-          console.log('fileListImages.value')
-          console.log(fileListImages.value)
+       
         } else {
           ElMessage.error(requset.msg)
         }
@@ -556,7 +538,7 @@ export default defineComponent({
               }, 2000)
 
               formStatus.value = '修改'
-              context.emit('func')
+              context.emit('func',params.id)
             } else {
               ElMessage.error(requset.msg)
             }
@@ -572,17 +554,22 @@ export default defineComponent({
     watch(
       () => props.siteId,
       (newVal) => {
-        // alert(1)
-        // alert(newVal)
-        console.log('newVal')
-        console.log(newVal)
+       
+        newVal
         if (props.activeName == 'first') {
           dataSet.fileList = []
           newArray.value = []
 
+          resetForm()
+        
+
+          
+
           getSite()
           dynamicPropertiesDroplist(2)
           dynamicPropertiesDroplist(1)
+
+          
         }
       }
     )
@@ -592,6 +579,9 @@ export default defineComponent({
         if (newVal == 'first') {
           dataSet.fileList = []
           newArray.value = []
+
+          resetForm()
+
           getSite()
           dynamicPropertiesDroplist(2)
           dynamicPropertiesDroplist(1)
@@ -659,8 +649,8 @@ export default defineComponent({
           { required: true, message: '请输入站点名称', trigger: 'blur' },
           {
             min: 1,
-            max: 11,
-            message: '长度在 1 到 11 个字符',
+            max: 30,
+            message: '长度在 1 到 30 个字符',
             trigger: 'blur',
           },
         ],
@@ -766,7 +756,6 @@ export default defineComponent({
       fileImages,
       getSite,
       isDisable,
-      // handleChange,
       // uniqueArr,
 
       newArray,

+ 3 - 4
src/views/siteManage/camera/checkVideo.vue

@@ -41,16 +41,15 @@ export default defineComponent({
 
     // open(): Dialog弹窗打开之前做的事
     const open = () => {
-
       // videoUrl.value = 'http://47.103.74.123/hls/'+props.deviceCode+'.m3u8';
-      videoUrl.value ='http://cctvalih5ca.v.myalicdn.com/live/cctv1_2/index.m3u8'
-
+      videoUrl.value = 'https://iot.usky.cn/hls/'+props.deviceCode+'.m3u8';
+      // videoUrl.value ='http://cctvalih5ca.v.myalicdn.com/live/cctv1_2/index.m3u8'
       window.setTimeout(getVideo, 100)
 
     }
     function getVideo() {
       randerHtml.value =
-        '<video id="my-video" class="video-js vjs-default-skin" controls preload="auto" style="width: 100%; height: 400px" poster loop="loop" autoplay="autoplay" ></video>'
+        '<video id="my-video" class="video-js vjs-default-skin" controls preload="auto" style="width: 100%; min-height: 400px" poster loop="loop" autoplay="autoplay" ></video>'
 
       let options = {
         bigPlayButton: false,

+ 42 - 40
src/views/siteManage/camera/index.vue

@@ -4,14 +4,19 @@
     <div class="filter-container mb-20">
       <div class="left">
         <div>
-          <a class="" style="margin-right: 30px">
+          <span class="" style="margin-right: 30px">
             【{{ labelCom }}】站点的所有摄像头设备
-            
-          </a>
+          </span>
           <el-button icon="el-icon-plus" type="success" @click="addItem()">
             新增
           </el-button>
-          <a href="./static/伍继摄像头导入模板.xlsx" download class="downloadMb" >模板下载</a>
+          <a
+            href="./static/伍继摄像头导入模板.xlsx"
+            download
+            class="downloadMb"
+          >
+            模板下载
+          </a>
         </div>
       </div>
 
@@ -21,6 +26,7 @@
           :action="fileUrl + '/device/deviceImport'"
           :on-progress="handleProgress"
           :on-success="handleUpAvatar"
+          :on-error="handleError"
           multiple
           :limit="1"
           :headers="{
@@ -186,13 +192,7 @@
 
 <script>
 import { useStore } from 'vuex'
-import {
-  defineComponent,
-  ref,
-  reactive,
-  onMounted,
-  watch
-} from 'vue'
+import { defineComponent, ref, reactive, onMounted, watch } from 'vue'
 import DialogComponent from './dialogComponent'
 import checkVideo from './checkVideo'
 import * as api from '@/api/siteManage/camera.js'
@@ -232,7 +232,7 @@ export default defineComponent({
     const count = ref(0)
     const loadingStatus = ref(false)
     const timer = ref('')
-    const deviceCode=ref('')
+    const deviceCode = ref('')
 
     // 表头样式设置
     const headClass = () => {
@@ -260,8 +260,6 @@ export default defineComponent({
           if (requset.status === 'SUCCESS') {
             deviceData.value = requset.data.records
             total.value = requset.data.total
-            console.log('response 接口请求数据')
-            console.log(deviceData.value)
           } else {
             ElMessage.error(requset.msg)
           }
@@ -285,7 +283,6 @@ export default defineComponent({
 
     // 编辑操作
     const editRow = (row) => {
-      console.log
       tableItem.value = {
         id: row.id,
         deviceCode: row.deviceCode,
@@ -302,15 +299,14 @@ export default defineComponent({
 
     // 关闭操作
     const closeDialog = () => {
-    showDialog.value = false
-   
+      showDialog.value = false
+
       videoMonitoringDeviceList()
       chk_video()
     }
     const closeDialog2 = () => {
       showDialog2.value = false
-      count.value=0
-    
+      count.value = 0
     }
 
     //删除 是否删除  ---- 是
@@ -332,6 +328,7 @@ export default defineComponent({
     const cancelEvent = () => {
       console.log('cancel!')
     }
+
     //导入
     const handleProgress = (file, fileList) => {
       file
@@ -360,6 +357,16 @@ export default defineComponent({
       })
       videoMonitoringDeviceList()
     }
+
+    const handleError = (res) => {
+      let myError = res.toString() //转字符串
+      myError = myError.replace('Error: ', '') //去掉前面的
+      myError = JSON.parse(myError) //转对象
+      ElMessage.error({
+        message: myError.msg,
+        type: 'error',
+      })
+    }
     //导出
     const DataReportExport = () => {
       api
@@ -395,22 +402,19 @@ export default defineComponent({
           }
         )
         .then((response) => {
-          console.log('response cgi')
-          console.log(response.data.RESULT.LIST)
-          console.log(openId.value)
+    
           onLineVideoList.value = response.data.RESULT.LIST
 
           if (openId.value.length > 0) {
             // start
-            console.log('doododododododo')
             for (var n = 0; n < onLineVideoList.value.length; n++) {
               if (openId.value == onLineVideoList.value[n].DEVICE) {
-                console.log('再次打开摄像头')
-                console.log(openId.value)
-                console.log(onLineVideoList.value[n].DEVICE)
-                console.log(onLineVideoList.value[n].ONAIR)
+                // console.log('再次打开摄像头')
+                // console.log(openId.value)
+                // console.log(onLineVideoList.value[n].DEVICE)
+                // console.log(onLineVideoList.value[n].ONAIR)
                 reCount.value++
-                console.log(reCount.value)
+                // console.log(reCount.value)
                 if (onLineVideoList.value[n].ONAIR) {
                   if (++count.value > 2) {
                     loadingStatus.value = false
@@ -426,16 +430,15 @@ export default defineComponent({
                       resource: '',
                     }
                     dialogTitle.value = '查看视频'
-                    showDialog2.value = true;
+                    showDialog2.value = true
                   } else {
                     store.state.siteCameraTimer = setTimeout(chk_video, 5000)
                   }
                 } else {
                   if (reCount.value > 7) {
-                 
                     loadingStatus.value = false
                     alert('远程摄像头链接超时,请稍后再试')
-               
+
                     break
                   }
                   store.state.siteCameraTimer = setTimeout(chk_video, 5000)
@@ -466,16 +469,16 @@ export default defineComponent({
 
     // 查看视频
     const open_video = (item) => {
-      deviceCode.value=item.deviceCode
+      deviceCode.value = item.deviceCode
       if (openId.value != item.deviceCode) {
         openId.value = item.deviceCode
       }
       for (var n = 0; n < onLineVideoList.value.length; n++) {
         if (onLineVideoList.value[n].DEVICE == openId.value) {
-          console.log('第一次打开时设备及其状态')
-          console.log(onLineVideoList.value[n].DEVICE)
-          console.log(openId.value)
-          console.log(onLineVideoList.value[n].ONAIR)
+          // console.log('第一次打开时设备及其状态')
+          // console.log(onLineVideoList.value[n].DEVICE)
+          // console.log(openId.value)
+          // console.log(onLineVideoList.value[n].ONAIR)
           if (onLineVideoList.value[n].ONAIR) {
             tableItem.value = {
               id: '',
@@ -529,8 +532,7 @@ export default defineComponent({
     watch(
       () => props.siteId,
       (newVal) => {
-        console.log('newVal')
-        console.log(newVal)
+        newVal
 
         labelCom.value = store.state.siteManageLabelCom
         if (props.activeName == 'five') {
@@ -561,7 +563,6 @@ export default defineComponent({
 
     onMounted(() => {})
 
-
     return {
       deviceData,
       showDialog,
@@ -609,7 +610,8 @@ export default defineComponent({
       loadingStatus,
       open_video,
       timer,
-      deviceCode
+      deviceCode,
+      handleError,
     }
   },
 })

+ 1 - 1
src/views/siteManage/groupInfoCom.vue

@@ -86,7 +86,7 @@ export default defineComponent({
       }
     )
     onMounted(() => {
-      console.log(props.label)
+      // console.log(props.label)
       form.value.groupingName = props.label
     })
     return {

+ 58 - 26
src/views/siteManage/index.vue

@@ -102,7 +102,7 @@
             :siteId="siteId"
             :groupingId="groupingId"
             :siteName="siteName"
-            @func="getMsgFormSon2"
+            @func="getMsgFormSon3"
             :activeName="activeName"
           ></basic-info>
         </el-tab-pane>
@@ -118,7 +118,6 @@
           <variable-list
             :activeName="activeName"
             :siteId="siteId"
-            :labelCom="labelCom"
           ></variable-list>
         </el-tab-pane>
         <el-tab-pane label="摄像头" name="five">
@@ -178,6 +177,7 @@ import addSiteCom from './addSiteCom'
 import * as api from '@/api/siteManage/index'
 import { ElMessage } from 'element-plus'
 import { useStore } from 'vuex'
+import { useRoute } from 'vue-router'
 
 export default defineComponent({
   components: {
@@ -207,6 +207,10 @@ export default defineComponent({
     const label = ref('')
     const activeName = ref('first')
     const filterText = ref('')
+    const selectNode = ref(0)
+
+    const route = useRoute()
+    let num = route.query.num
     const data = ref([
       {
         label: '所有站点',
@@ -263,11 +267,23 @@ export default defineComponent({
     }
     const getMsgFormSon2 = () => {
       siteTreeList()
-
       setTimeout(() => {
         treeLevel.value = 1
       }, 1000)
     }
+    //站点基本信息保存后触发
+    const getMsgFormSon3 = (data) => {
+      siteTreeList()
+      setTimeout(() => {
+        tree.value.setCurrentKey(selectNode.value)
+      }, 1000)
+
+      if (data == 0) {
+        setTimeout(() => {
+          treeLevel.value = 1
+        }, 1000)
+      }
+    }
     function mouseenter(data) {
       data.show = true
     }
@@ -283,14 +299,12 @@ export default defineComponent({
       treeLevel.value = obj.level
       groupingId.value = obj.data.grouping_id
       label.value = obj.data.label
-      console.log('obj.data')
-      console.log(obj)
-      // console.log(groupingId.value)
+      // console.log('obj.data')
+      // console.log(obj.data.id)
+      selectNode.value = obj.data.id
       labelCom.value = obj.data.label
       store.state.siteManageLabelCom = obj.data.label
-      store.state.basicInfoSiteName=''
-      // console.log('labelCom.value')
-      // console.log(labelCom.value)
+      store.state.basicInfoSiteName = ''
 
       if (treeLevel.value == 3) {
         siteId.value = obj.data.id
@@ -322,10 +336,10 @@ export default defineComponent({
       // watch 刚被创建的时候不执行
       { lazy: true }
     )
-     watch(
+    watch(
       activeName,
       (newCount, old, clear) => {
-        newCount,old,clear
+        newCount, old, clear
         // 清除定时器
         clear(() => clearTimeout(store.state.siteCameraTimer))
       },
@@ -333,29 +347,31 @@ export default defineComponent({
       { lazy: true }
     )
 
-
-    // 新建分组关闭操作
+    // 新建分或站点的关闭操作
     const closeDialog = (res) => {
       if (store.state.basicInfoConst == 1 && res == '默认关闭') {
+        // alert('1 并  默认关闭')
         showDialog.value = false
-        showDialog2.value = false
+        showDialog2.value = false  //弹框关闭
         siteTreeList()
-        flag2.value = false
-        treeLevel.value = 3
+        flag2.value = false  //基本信息不显示
+        treeLevel.value = 3  //新建站点  新建分组 按钮不可点击
       } else if (store.state.basicInfoConst == 1) {
+          //  alert('1')
         showDialog.value = false
         showDialog2.value = false
       }
     }
 
+    //站点保存后关闭
     const getFromSon = (param, param2, param3) => {
-      // alert('保存后关闭')
+      // alert('站点保存后关闭')
       siteId.value = param2
       siteName.value = param
       groupingId.value = param3
 
-      flag2.value = true
-      treeLevel.value = 3
+      flag2.value = true //基本信息显示
+      treeLevel.value = 3 //新建站点  新建分组 按钮不可点击
     }
 
     //新建分组
@@ -402,22 +418,34 @@ export default defineComponent({
           jsonb = jsonb.replace(/"site_id"/g, '"id"')
           var jsonc = JSON.parse(jsonb)
           data.value[0].children = jsonc
-          //  data2.value[0].children = jsonc
-          console.log(data)
-          // console.log(data2)
+
+          if (route.query.activeName && route.query.siteId) {
+            setTimeout(() => {
+              tree.value.setCurrentKey(route.query.siteId)
+            }, 1000)
+            flag2.value = true
+            treeLevel.value = 3
+            activeName.value = route.query.activeName
+            siteId.value = route.query.siteId
+            var bb = []
+            jsonc.forEach(function (item) {
+              if (item.id == siteId.value) {
+                bb.push(item)
+              }
+            })
+            store.state.siteManageLabelCom = bb[0].label
+          }
         } else {
           ElMessage.error(requset.msg)
         }
       })
     }
+
     onMounted(() => {
       siteTreeList()
     })
 
-    nextTick(() => {
-      // defaultExpand.value = data.value[0].children.id
-      // tree.value.setCurrentKey(tree[0].node.id)
-    })
+    nextTick(() => {})
 
     return {
       showDialog,
@@ -443,6 +471,7 @@ export default defineComponent({
       defaultExpand,
       getMsgFormSon,
       getMsgFormSon2,
+      getMsgFormSon3,
       mouseenter,
       mouseleave,
       filterNode,
@@ -451,6 +480,9 @@ export default defineComponent({
       addGroup,
       addSite,
       remove,
+
+      selectNode,
+      num,
     }
   },
 })

+ 18 - 2
src/views/siteManage/powerScore/index.vue

@@ -74,6 +74,8 @@
 import { defineComponent, ref, onMounted, watch } from 'vue'
 import * as api from '@/api/siteManage/powerScore'
 import { ElMessage } from 'element-plus'
+import { useStore } from 'vuex'
+
 
 export default defineComponent({
   name: 'PowerScore',
@@ -82,6 +84,8 @@ export default defineComponent({
     activeName: String,
   },
   setup(props) {
+    const store = useStore()
+    store
     const formInfo = ref(null)
     const formStatus = ref('')
     const ruleForm = ref({})
@@ -108,6 +112,10 @@ export default defineComponent({
         })
     }
 
+    function resetForm() {
+      formInfo.value.clearValidate()
+    }
+
     //表单提交
     function submitForm() {
       ruleForm.value.siteId = props.siteId
@@ -158,10 +166,10 @@ export default defineComponent({
     watch(
       () => props.siteId,
       (newVal) => {
-        console.log('newVal')
-        console.log(newVal)
+        newVal
         ruleForm.value.siteId = newVal
         if (props.activeName == 'six') {
+          resetForm()
           powerQualityList()
         }
       }
@@ -170,18 +178,25 @@ export default defineComponent({
       () => props.activeName,
       (newVal) => {
         if (newVal == 'six') {
+          resetForm()
           powerQualityList()
         }
       }
     )
 
     onMounted(() => {
+
+       if (store.state.goUrl==6) {
+         resetForm()
+          powerQualityList()
+      }
       // powerQualityList()
       // console.log('props.siteId')
       // console.log(props.siteId)
     })
 
     return {
+      store,
       formInfo,
       ruleForm,
       rules: {
@@ -210,6 +225,7 @@ export default defineComponent({
       },
       submitForm,
       isDisable,
+      resetForm
     }
   },
 })

+ 0 - 1
src/views/siteManage/variableList/dialogComponent.vue

@@ -183,7 +183,6 @@ export default defineComponent({
     const submitForm = () => {
       formInfo.value.validate((valid) => {
         if (valid) {
-  
           if (props.dialogTitle === '新增') {
             api.variableAdd(form.value).then((requset) => {
               if (requset.status === 'SUCCESS') {

+ 23 - 13
src/views/siteManage/variableList/index.vue

@@ -4,10 +4,10 @@
     <div class="filter-container mb-20">
       <div class="left">
         <div>
-          <a class="" style="margin-right: 30px">
+          <span class="" style="margin-right: 30px">
             【{{ labelCom }}】 站点的所有变量
             
-          </a>
+          </span>
           <el-button icon="el-icon-plus" type="success" @click="addItem()">
             新增
           </el-button>
@@ -54,6 +54,7 @@
           :action="fileUrl + 'deviceAnalogVariableList/variableListImport'"
           :on-progress="handleProgress"
           :on-success="handleUpAvatar"
+          :on-error="handleError"
           multiple
           :limit="1"
           :headers="{
@@ -193,7 +194,7 @@ export default defineComponent({
   name: 'VariableList',
   props: {
     siteId: Number,
-    labelCom: String,
+    // labelCom: String,
     activeName: String,
   },
 
@@ -211,6 +212,7 @@ export default defineComponent({
 
     const select = ref(1)
     // const siteId = ref(1)
+    const labelCom = ref(store.state.siteManageLabelCom)
     const variableName = ref('')
     const showDialog = ref(false)
     const dialogTitle = ref('')
@@ -247,6 +249,15 @@ export default defineComponent({
       })
       query()
     }
+    const handleError = (res) => {
+      let myError = res.toString() //转字符串
+      myError = myError.replace('Error: ', '') //去掉前面的
+      myError = JSON.parse(myError) //转对象
+      ElMessage.error({
+        message: myError.msg,
+        type: 'error',
+      })
+    }
 
     //是否删除  ---- 否
     const cancelEvent = () => {
@@ -281,6 +292,7 @@ export default defineComponent({
     watch(
       () => props.siteId,
       () => {
+        labelCom.value = store.state.siteManageLabelCom
         if (props.activeName == 'third') {
           query()
         }
@@ -294,7 +306,11 @@ export default defineComponent({
         }
       }
     )
-    onMounted(() => {})
+    onMounted(() => {
+      if (store.state.goUrl==3) {
+         query()
+      }
+    })
 
      const handleSizeChange = (val) => {
       pageSize.value = val
@@ -334,15 +350,6 @@ export default defineComponent({
     }
     // 编辑操作
     const editRow = (row) => {
-      console.log('row')
-      console.log(row)
-      // tableItem.value = {
-      //   dataArea: row.dataArea.toString(),
-      //   monitoringEquipment: row.monitoringEquipment,
-      //   communicationEquipment: row.communicationEquipment,
-
-      // }
-
       tableItem.value = {
         deviceCode: row.deviceCode,
         variableName: row.variableName,
@@ -355,6 +362,7 @@ export default defineComponent({
         coefficient: row.coefficient,
         saveCycle: row.saveCycle,
         dataArea: row.dataArea.toString(),
+        id:row.id
       }
       dialogTitle.value = '编辑'
       showDialog.value = true
@@ -441,6 +449,8 @@ export default defineComponent({
       accessToken,
       handleProgress,
       handleUpAvatar,
+      handleError,
+      labelCom
     }
   },
 })

+ 31 - 13
src/views/siteManage/watchDog/index.vue

@@ -2,8 +2,16 @@
   <div class="siteManage-main watchDog">
     <!-- 筛选start -->
     <div class="filter-container mb-20">
-      <a class="">【{{ labelCom }}】站点的所有监控设备 <a href="./static/伍继监控设备导入模板.xlsx" download class="downloadMb" >模板下载</a></a>
-              
+      <span class="">
+        【{{ labelCom }}】站点的所有监控设备
+        <a
+          href="./static/伍继监控设备导入模板.xlsx"
+          download
+          class="downloadMb"
+        >
+          模板下载
+        </a>
+      </span>
 
       <!-- <el-button icon="el-icon-plus" type="success" @click="addItem()">新增</el-button > -->
 
@@ -13,6 +21,7 @@
           :action="fileUrl + '/deviceAttribute/deviceAttributeImport'"
           :on-progress="handleProgress"
           :on-success="handleUpAvatar"
+          :on-error="handleError"
           multiple
           :limit="1"
           :headers="{
@@ -62,13 +71,13 @@
       ></el-table-column>
       <el-table-column
         prop="ratedVoltage"
-        label="额定电压"
+        label="额定电压 (kV)"
         align="center"
         width=""
       ></el-table-column>
       <el-table-column
         prop="ratedCurrent"
-        label="额定电流"
+        label="额定电流 (A)"
         align="center"
         width=""
       ></el-table-column>
@@ -306,8 +315,15 @@ export default defineComponent({
       })
       deviceNewsList()
     }
-
-   
+    const handleError = (res) => {
+      let myError = res.toString() //转字符串
+      myError = myError.replace('Error: ', '') //去掉前面的
+      myError = JSON.parse(myError) //转对象
+      ElMessage.error({
+        message: myError.msg,
+        type: 'error',
+      })
+    }
 
     function goVariableList() {
       emit('func')
@@ -345,12 +361,11 @@ export default defineComponent({
         })
     }
 
-     //监听变化
+    //监听变化
     watch(
       () => props.siteId,
       (newVal) => {
-        console.log('newVal')
-        console.log(newVal)
+        newVal
         labelCom.value = store.state.siteManageLabelCom
         if (props.activeName == 'second') {
           deviceNewsList()
@@ -365,10 +380,12 @@ export default defineComponent({
         }
       }
     )
+   
 
-     onMounted(() => {
-      // console.log('props.siteId')
-      // console.log(props.siteId)
+    onMounted(() => {
+      if (store.state.goUrl==2) {
+        deviceNewsList()
+      }
     })
 
     return {
@@ -398,7 +415,7 @@ export default defineComponent({
       closeDialog,
       handleDelete,
       cancelEvent,
-      
+
       handleSizeChange,
       handleCurrentChange,
 
@@ -409,6 +426,7 @@ export default defineComponent({
       accessToken,
       handleProgress,
       handleUpAvatar,
+      handleError,
 
       labelCom,
     }

+ 5 - 5
src/views/stationManage/siteList.vue

@@ -113,10 +113,10 @@ export default defineComponent({
     }
 
     //查看
-    const handleClick = (row) => {
-      alert('查看对应站点(页面跳转)')
-      console.log(row)
-    }
+    // const handleClick = (row) => {
+    //   alert('查看对应站点(页面跳转)')
+    //   console.log(row)
+    // }
 
     //站点设备列表
     function siteDeviceList() {
@@ -144,7 +144,7 @@ export default defineComponent({
       headClass,
       cellStyle,
       goBack,
-      handleClick,
+      // handleClick,
     }
   },
 })

+ 7 - 10
src/views/systemManage/rolePermission/index.vue

@@ -108,7 +108,6 @@ export default defineComponent({
       // console.log(radio1.value)
       api.roleDetail({}, radio1.value).then((requset) => {
         if (requset.status === 'SUCCESS') {
-          console.log(requset.data)
 
           tableItem.value = {
             roleName: requset.data.roleName,
@@ -117,7 +116,6 @@ export default defineComponent({
             roleSort: Number(requset.data.roleSort),
             roleId: requset.data.roleId,
           }
-          console.log(tableItem.value)
 
           dialogTitle.value = '角色修改'
           showDialog.value = true
@@ -125,23 +123,25 @@ export default defineComponent({
           ElMessage.error(requset.msg)
         }
       })
+
     }
 
     const listTabsChange = (value, item) => {
       // console.log(value)
       radio1.value = value
       objItem.value = item
-      console.log('objItem')
-      console.log(objItem.value)
       roleMenuTreeselect()
 
       // console.log(radio1.value)
     }
     function roleMenuTreeselect() {
+      menuData.value = []
       api.roleMenuTreeselect({}, radio1.value).then((requset) => {
         if (requset.code == 200) {
           menuData.value = requset.data.menus
           checkedKeys.value = requset.data.checkedKeys
+
+          //当返回值没有选中菜单时,否
           if (!checkedKeys.value.length) {
             menuData.value.map((item) => {
               item.authority2 = '0'
@@ -159,15 +159,14 @@ export default defineComponent({
             }
           } else {
             menuData.value.map(function (item) {
+              item.authority2 = '0'
               checkedKeys.value.map(function (num) {
                 if (JSON.stringify(item).indexOf(num) != -1) {
                   item.authority2 = '1'
-                }
+                } 
               })
             })
-            console.log(11111)
-            console.log(checkedKeys.value)
-            console.log(menuData.value)
+          
           }
         } else {
           ElMessage.error(requset.msg)
@@ -186,8 +185,6 @@ export default defineComponent({
       api.roleList().then((requset) => {
         if (requset.code === 200) {
           roleData.value = requset.rows
-          console.log('requset.rows')
-          console.log(requset.rows[0])
           var item = requset.rows[0]
           objItem.value = {
             roleSort: item.roleSort,

+ 18 - 30
src/views/systemManage/rolePermission/roleInfoCom/index.vue

@@ -13,8 +13,12 @@
             v-model="scope.row.authority2"
             @change="listTabsChange(scope.row)"
           >
-            <el-radio label="1"  :disabled="radio1==1? true: false">是</el-radio>
-            <el-radio label="0" :disabled="radio1==1? true: false">否</el-radio>
+            <el-radio label="1" :disabled="radio1 == 1 ? true : false">
+              是
+            </el-radio>
+            <el-radio label="0" :disabled="radio1 == 1 ? true : false">
+              否
+            </el-radio>
           </el-radio-group>
         </template>
       </el-table-column>
@@ -42,11 +46,9 @@ export default defineComponent({
     const saveArr = ref([])
 
     function saveMenu() {
-      console.log('props.objItem.value')
-      console.log(props.objItem)
+   
+
 
-      console.log('props.radio1')
-      console.log(props.radio1)
 
       api
         .saveMenu({
@@ -71,43 +73,29 @@ export default defineComponent({
     const listTabsChange = (value) => {
       saveArr.value = []
       value
-      console.log(' props.menuData')
-      console.log(props.menuData)
+
 
       props.menuData.forEach(function (item) {
         if (item.authority2 == '1') {
           saveArr.value.push(item.id)
+          var aa = item.children
+          aa.forEach(function (item) {
+              saveArr.value.push(item.id)
+            
+          })
         }
       })
-      console.log('saveArr.value')
-      console.log(saveArr.value)
+   
     }
 
-    onMounted(() => {
-      // if (props.radio1 == 1) {
-      //   alert(1)
-      //   props.menuData.forEach(function (item) {
-      //     item.authority2 = '1'
-      //     saveArr.value.push(item.id)
-      //   })
-      //   console.log(' props.menuData')
-      //   console.log(props.menuData)
-      // } else {
-      //   props.menuData.forEach(function (item) {
-      //     if (item.authority2 == '1') {
-      //       saveArr.value.push(item.id)
-      //     }
-      //   })
-      // }
-    })
+    onMounted(() => {})
     //监听变化
     watch(
       () => props.radio1,
       (newVal) => {
         newVal
-        
-        // console.log('newVal')
-        // console.log(newVal)
+
+     
         // if (newVal == '1') {
         //   alert(1)
         //   props.menuData.forEach(function (item) {

+ 56 - 32
src/views/systemManage/userManage/dialogComponent.vue

@@ -59,7 +59,7 @@
         ></el-date-picker>
       </el-form-item> -->
 
-      <el-form-item label="角色名称:" prop="roleName">
+      <el-form-item label="角色名称:" prop="roleId">
         <!-- <el-input v-model="form.roleName"></el-input> -->
         <el-select
           v-model="form.roleId"
@@ -76,6 +76,28 @@
         </el-select>
       </el-form-item>
 
+      <el-form-item label="所属站点:" prop="siteId">
+         <el-select
+              v-model="form.siteId"
+              placeholder="请选择"
+              clearable
+               multiple
+              filterable
+              collapse-tags
+               @change="linkChange()"
+              
+            >
+              <el-option
+                v-for="site in store.state.siteList"
+                :key="site"
+                :label="site.siteName"
+                :value="site.id"
+                
+              ></el-option>
+            </el-select>
+      </el-form-item>
+
+
       <br />
       <br />
       <br />
@@ -85,6 +107,7 @@
           type="primary"
           @click="submitForm('formInfo')"
           :disabled="isDisable"
+          v-if="dialogTitle !== '查看'"
         >
           确定
         </el-button>
@@ -94,10 +117,11 @@
 </template>
 
 <script>
-import { defineComponent, ref, onMounted, watchEffect } from 'vue'
+import { defineComponent, ref, onMounted, watchEffect,watch } from 'vue'
 import * as api from '@/api/systemManage/userManage.js'
 import { ElMessage } from 'element-plus'
 import { parseTime, validatorPhone } from '@/utils'
+import { useStore } from 'vuex'
 
 export default defineComponent({
   name: 'DialogComponent',
@@ -109,7 +133,7 @@ export default defineComponent({
   },
   setup(props, context) {
     context
-
+    const store = useStore()
     const dialogVisible = ref(false)
     const formInfo = ref(null)
     const isDisable = ref(false)
@@ -119,33 +143,14 @@ export default defineComponent({
 
     // open(): Dialog弹窗打开之前做的事
     const open = () => {
+    
       form.value = props.itemInfo.value
-      console.log('form.value')
-      console.log(form.value)
+       console.log('form.value')
+       console.log(form.value)
+      console.log(form.value.siteId)
     }
 
-    const options = [
-      {
-        value: '选项1',
-        label: '站点一',
-      },
-      {
-        value: '选项2',
-        label: '站点二',
-      },
-      {
-        value: '选项3',
-        label: '站点三',
-      },
-      {
-        value: '选项4',
-        label: '站点四',
-      },
-      {
-        value: '选项5',
-        label: '站点五',
-      },
-    ]
+  
 
     // 关闭弹框
     const closeDialog = () => {
@@ -220,8 +225,7 @@ export default defineComponent({
     function optionselect() {
       api.optionselect().then((requset) => {
         if (requset.status === 'SUCCESS') {
-          console.log('requset.data')
-          console.log(requset.data)
+     
           roleSelectData.value = requset.data
         } else {
           ElMessage.error(requset.msg)
@@ -231,16 +235,34 @@ export default defineComponent({
 
     function resetForm() {
       formInfo.value.resetFields()
+      
+      
+     
     }
+    function linkChange(){
+
+
+    }
+
+     //监听变化
+    watch(
+      () => props.siteIdArr,
+      (newVal) => {
+        alert(1)
+        newVal
+       
+      }
+    )
 
     onMounted(() => {
       optionselect()
     })
 
     return {
+      store,
+      linkChange,
       closeDialog,
       dialogVisible,
-      options,
       roleValid,
       formInfo,
       form,
@@ -250,6 +272,7 @@ export default defineComponent({
       resetForm,
       isDisable,
       rules: {
+       
         nickName: [
           { required: true, message: '请输入用户名', trigger: 'blur' },
           {
@@ -277,11 +300,12 @@ export default defineComponent({
           },
         ],
         createTime: [
-          { required: true, message: '请输入创建时间', trigger: 'change' },
+          { required: true, message: '请输入创建时间', trigger: 'blur' },
         ],
         roleId: [
-          { required: true, message: '请选择角色名称', trigger: 'change' },
+          { required: true, message: '请选择角色名称', trigger: 'blur' },
         ],
+         siteId:  [{ required: true, message: '请选择站点', trigger: 'blur' }],
         password: [
           { required: true, message: '请输入密码', trigger: 'blur' },
           {

+ 20 - 7
src/views/systemManage/userManage/index.vue

@@ -122,6 +122,7 @@
       :itemInfo="tableItem"
       @closeDialog="closeDialog"
       :flag="showDialog"
+      v-if="tableItem"
     ></dialog-component>
     <!--弹框组件开始-----------------------end-->
   </div>
@@ -153,6 +154,7 @@ export default defineComponent({
     const dialogTitle = ref('')
     const showDialog = ref(false)
     const tableData = ref([])
+    const siteIdArr=ref([])
 
     // // 表头样式设置
     const headClass = () => {
@@ -172,8 +174,6 @@ export default defineComponent({
     function list() {
       store.commit('TimeAll_function', dateTime.value)
       const time = store.state.Time_Data
-      console.log('time[0]')
-      console.log(time[0])
       api
         .list({
           pageSize: pageSize.value,
@@ -186,7 +186,6 @@ export default defineComponent({
         })
         .then((requset) => {
           if (requset.status === 'SUCCESS') {
-            console.log(requset.data)
             tableData.value = requset.data.rows
             total.value = requset.data.total
           } else {
@@ -213,12 +212,17 @@ export default defineComponent({
 
     // 查看
     const checkItem = (row) => {
+      siteIdArr.value=[]
       console.log(row)
       api.authRole({}, row.userId).then((requset) => {
         if (requset.status === 'SUCCESS') {
-          console.log(requset.data.user.roles[0].roleId)
           tableItem.value.roleId= requset.data.user.roles[0].roleId
-          // row.roleIds = []
+          var newArray= requset.data.userSite
+           newArray.forEach(function(item){
+             siteIdArr.value.push(item.siteId)
+
+           })
+           tableItem.value.siteId= siteIdArr.value
         } else {
           ElMessage.error(requset.msg)
         }
@@ -230,12 +234,19 @@ export default defineComponent({
 
     // 编辑操作
     const editRow = (row) => {
+      siteIdArr.value=[]
       console.log(row)
       api.authRole({}, row.userId).then((requset) => {
         if (requset.status === 'SUCCESS') {
-          console.log(requset.data.user.roles[0].roleId)
           tableItem.value.roleId= requset.data.user.roles[0].roleId
-          // row.roleIds = []
+
+           var newArray= requset.data.userSite
+           newArray.forEach(function(item){
+             siteIdArr.value.push(item.siteId)
+
+           })
+           tableItem.value.siteId= siteIdArr.value
+            
         } else {
           ElMessage.error(requset.msg)
         }
@@ -261,6 +272,7 @@ export default defineComponent({
     // 关闭操作
     const closeDialog = () => {
       showDialog.value = false
+      
       list()
     }
 
@@ -284,6 +296,7 @@ export default defineComponent({
 
       dateTime,
       store,
+      siteIdArr,
       list,
       handleSizeChange,
       handleCurrentChange,