Bladeren bron

bug修复,新接口对接

ming 3 jaren geleden
bovenliggende
commit
3bc18e4102

+ 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,
+    })
+}

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

@@ -799,7 +799,7 @@ ul li {
 }
 
 .harmonicCard {
-    height: calc(50% - 56px);
+    height: calc(50% - 78px);
     // border: 1px solid red;
 }
 

+ 3 - 1
src/store/index.js

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

+ 1 - 5
src/views/dataManage/energyReport/index.vue

@@ -107,7 +107,7 @@
             :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>
@@ -164,10 +164,6 @@ 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 {

+ 60 - 12
src/views/dataManage/energyReport/tables/index.vue

@@ -1,16 +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"
+        :header-cell-style="headClass"
       >
         <template v-for="(item, index) in cols" :key="index">
-          <el-table-column :prop="item.prop" :label="item.label" align="center" min-width="120">
+          <el-table-column
+            :prop="item.prop"
+            :label="item.label"
+            align="center"
+            min-width="120"
+          >
             <template #default="scope">
               <span>
                 {{ scope.row[item.prop] }}
@@ -23,30 +34,38 @@
   </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)
       cols.value = newArr
@@ -87,8 +106,6 @@ export default defineComponent({
       return 'background:#FAFAFA !important;color: black'
     }
 
-    
-
     // 求和
     function sum(arr) {
       var s = 0
@@ -98,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
     }
 
     //监听变化
@@ -126,8 +170,12 @@ export default defineComponent({
       cols,
       // cellStyle,
       tableData6,
+      DataReportExport,
+      cycle,
+      deviceCode,
+      timeArr,
+      store,
       // newArr
-     
     }
   },
 })

+ 87 - 30
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"></loop-radarChart>
               </div>
             </el-col>
             <el-col :span="12" class="loopUnbanlanceCard">
@@ -75,27 +81,27 @@
                 "
               >
                 <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 +115,7 @@
           >
             <el-col :span="12" class="loopUnbanlanceCard">
               <div class="grid-content" style="text-align: center">
-                <loop-radarChart></loop-radarChart>
+                <loop-radarChart2 :getData="getData"></loop-radarChart2>
               </div>
             </el-col>
             <el-col :span="12" class="loopUnbanlanceCard">
@@ -124,27 +130,27 @@
                 "
               >
                 <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>
@@ -165,54 +171,72 @@
     <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"></voltage-panel>
       </el-col>
       <!-- 电压end -->
 
       <!-- 频率 start-->
       <el-col :md="24" :lg="8" class="mb-20">
-        <frequency-panel></frequency-panel>
+        <frequency-panel :getData="getData"></frequency-panel>
       </el-col>
       <!-- 频率 end -->
 
       <!-- 有功功率 -->
       <el-col :md="24" :lg="8">
-        <power-panel></power-panel>
+        <power-panel  :getData="getData"></power-panel>
       </el-col>
       <!-- 有功功率 end -->
     </el-row>
+
+    <!--指标说明弹框组件开始-----------------------start-->
+    <descrip-dialog
+      :dialogTitle="dialogTitle"
+      :itemInfo="tableItem"
+      @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'
 
 export default defineComponent({
   name: 'LoopMonitor',
   components: {
     loopRadarChart,
+    loopRadarChart2,
     harmonicPanel,
     voltagePanel,
     frequencyPanel,
     powerPanel,
+    descripDialog
   },
   setup() {
     const store = useStore()
-
+    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 +251,51 @@ export default defineComponent({
         }
       })
     }
-   
+
+    //数据请求
+    function realScoreOne() {
+      api.realScoreOne({ deviceCode: deviceCode.value }).then((requset) => {
+        if (requset.status === 'SUCCESS') {
+          getData.value = requset.data
+          console.log('getData.value')
+          console.log(getData.value)
+        } 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(() => {
+      descripDialog
       deviceSelect()
-      
+      // realScore()
     })
     return {
       store,
+      getData,
       deviceList,
       deviceCode,
       linkDevice,
-      deviceSelect
-     
+      deviceSelect,
+      realScoreOne,
+      descripDialog,
+      showDialog,
+      dialogTitle,
+      closeDialog,
+      siteId
     }
   },
 })

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

@@ -0,0 +1,174 @@
+<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>【变量级配置】</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
+      alert( store.state.goUrl)
+      router.push({
+    //传递参数使用query的话,指定path或者name都行,但使用params的话,只能使用name指定 
+        path:'/siteManage',
+        query:{
+        activeName:'second',
+        siteId:store.state.siteId
+        }
+      })
+    }
+   
+
+    return {
+      store,
+      closeDialog,
+      dialogVisible,
+    
+      open,
+
+      handleClick,
+      activeName,
+      goSiteWatchDog
+    }
+  },
+})
+</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>

+ 45 - 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,43 @@
   </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
+        console.log('newVal')
+        console.log(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>

+ 89 - 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,37 @@ export default defineComponent({
       window.addEventListener('resize', () => {
         myChart.resize()
       })
+    }
+
+    const writeValue = (val) => {
+      val
+      getData()
+      echarts2()
+    }
+
+    //监听变化
+    watch(
+      () => props.num,
+      (newVal, oldVal, clear) => {
+        // 执行异步任务,并得到关闭异步任务的 id
+        console.log('newVal')
+        console.log(newVal)
+        let id = writeValue(newVal, oldVal)
+        // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
+        clear(() => clearTimeout(id))
+      },
+      { lazy: true }
+    )
+
+    onMounted(() => {
+      getData()
+      echarts2()
     })
 
     return {
       lineChartBanlance,
       loading,
-      total,
-      num,
+      echarts2,
     }
   },
 })

+ 49 - 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,31 @@ export default defineComponent({
       window.addEventListener('resize', () => {
         myChart.resize()
       })
+    }
+
+    const writeValue = (val) => {
+      val
+      getData()
+      echarts2()
+    }
+
+    //监听变化
+    watch(
+      () => props.getData,
+      (newVal, oldVal, clear) => {
+        // 执行异步任务,并得到关闭异步任务的 id
+        console.log('newVal')
+        console.log(newVal)
+        let id = writeValue(newVal, oldVal)
+        // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
+        clear(() => clearTimeout(id))
+      },
+      { lazy: true }
+    )
+
+    onMounted(() => {
+      getData()
+      echarts2()
     })
 
     return {
@@ -117,6 +154,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
+        console.log('newVal')
+        console.log(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>

+ 76 - 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,71 @@
   </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
+
+        console.log('newVal')
+        console.log(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 {

+ 80 - 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,82 @@
   </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
+
+        console.log('newVal')
+        console.log(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 {

+ 1 - 1
src/views/powerQuality/realTimeMonitoring/realScore.vue

@@ -512,7 +512,7 @@ export default defineComponent({
       rtRealScore(params)
     }
 
-     // 查看视频
+     // 查看指标说明
     const descripDialog = () => {
       dialogTitle.value = '指标说明'
       showDialog2.value = true

+ 1 - 1
src/views/powerQuality/realTimeMonitoring/realScoreComponent/radarChart.vue

@@ -104,7 +104,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],
               },
             ],
           },

+ 28 - 4
src/views/siteManage/index.vue

@@ -178,6 +178,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: {
@@ -208,6 +209,9 @@ export default defineComponent({
     const activeName = ref('first')
     const filterText = ref('')
     const selectNode = ref(0)
+
+    const route = useRoute()
+    let num = route.query.num
     const data = ref([
       {
         label: '所有站点',
@@ -412,15 +416,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) {
+            alert(9999)
+            flag2.value = true
+            treeLevel.value = 3
+            activeName.value = route.query.activeName
+            siteId.value = route.query.siteId
+          
+            console.log(22222222222222111)
+            console.log(22222222222222111)
+            console.log(data.value[0].children)
+             console.log('siteId.value')
+            console.log(siteId.value)
+            var aa = data.value[0].children
+
+            var obj = aa.find(function (obj) {
+              return obj.id === siteId.value
+            })
+            console.log('obj')
+            console.log(obj)
+          }
         } else {
           ElMessage.error(requset.msg)
         }
       })
     }
-    onMounted(() => { 
+
+    onMounted(() => {
       //  console.log('tree.value')
       // console.log(tree.value)
       siteTreeList()
@@ -466,6 +489,7 @@ export default defineComponent({
       remove,
 
       selectNode,
+      num,
     }
   },
 })

+ 17 - 0
src/views/siteManage/watchDog/index.vue

@@ -381,8 +381,25 @@ export default defineComponent({
         }
       }
     )
+    watch(
+      () => store.state.goUrl,
+      (newVal) => {
+        // alert(1)
+        newVal
+
+        if (newVal == 'second') {
+          deviceNewsList()
+        }
+      }
+    )
 
     onMounted(() => {
+      alert('store.state.goUrl')
+      alert(store.state.goUrl)
+      if (store.state.goUrl) {
+        labelCom.value = store.state.siteManageLabelCom
+        deviceNewsList()
+      }
       // console.log('props.siteId')
       // console.log(props.siteId)
     })