loopMonitor.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <div>
  3. <!-- 筛选start -->
  4. <div class="filter-container">
  5. <div class="left">
  6. <div>
  7. <div class="filter-item">
  8. 选择站点:
  9. <el-select v-model="store.state.siteId" placeholder="请选择" style="width: 220px" clearable filterable
  10. @change="linkDevice()" :disabled="store.state.authorities.indexOf('查询') == -1">
  11. <el-option v-for="site in store.state.siteList" :key="site" :label="site.siteName"
  12. :value="site.id"></el-option>
  13. </el-select>
  14. </div>
  15. <div class="filter-item" style="margin-right: 20px">
  16. 选择设备:
  17. <el-select v-model="deviceCode" placeholder="请选择" style="width: 150px"
  18. :disabled="store.state.authorities.indexOf('查询') == -1">
  19. <el-option v-for="device in deviceList" :key="device" :label="device.deviceName"
  20. :value="device.deviceCode"></el-option>
  21. </el-select>
  22. </div>
  23. <el-button type="primary" class="search-button" @click="realScoreOne()"
  24. :disabled="store.state.authorities.indexOf('查询') == -1">
  25. 搜索
  26. </el-button>
  27. </div>
  28. </div>
  29. <div class="right descIcon" @click="descripDialog()">
  30. <img src="@/assets/images/descIcon.png" alt="" />
  31. 指标说明
  32. </div>
  33. </div>
  34. <!-- 筛选end -->
  35. <el-row :gutter="20" class="mt-20">
  36. <!-- 三项不平衡度 -->
  37. <el-col :md="24" :lg="8">
  38. <div class="grid-content bg-purple loopUnbanlancePanel">
  39. <div class="blanceChartTit">
  40. <span>三项不平衡度</span>
  41. </div>
  42. <el-row :gutter="20" style="padding: 20px; border-bottom: 1px solid #d3dce6">
  43. <el-col :span="12" class="loopUnbanlanceCard">
  44. <div class="grid-content" style="text-align: center">
  45. <loop-radarChart :getData="getData" v-loading="loading"></loop-radarChart>
  46. </div>
  47. </el-col>
  48. <el-col :span="12" class="loopUnbanlanceCard">
  49. <div style="
  50. width: 90%;
  51. background: #1187ff;
  52. margin: 0px auto;
  53. text-align: center;
  54. color: #fff;
  55. padding: 10px 0px;
  56. ">
  57. <div class="mb-10">电压不平衡度</div>
  58. <div>{{ getData.vtBalun ? getData.vtBalun * 100 : 0 }}%</div>
  59. </div>
  60. <ul>
  61. <li>
  62. <div>A相电压</div>
  63. <div>
  64. <div class="mb-5">
  65. 幅值:{{ getData.ua ? getData.ua + ' V' : 0 }}
  66. </div>
  67. <div>相角:-</div>
  68. </div>
  69. </li>
  70. <li>
  71. <div>B相电压</div>
  72. <div>
  73. <div class="mb-5">
  74. 幅值:{{ getData.ub ? getData.ub + ' V' : 0 }}
  75. </div>
  76. <div>相角:-</div>
  77. </div>
  78. </li>
  79. <li>
  80. <div>C相电压</div>
  81. <div>
  82. <div class="mb-5">
  83. 幅值:{{ getData.uc ? getData.uc + ' V' : 0 }}
  84. </div>
  85. <div>相角:-</div>
  86. </div>
  87. </li>
  88. </ul>
  89. </el-col>
  90. </el-row>
  91. <el-row :gutter="20" style="padding: 20px; border-bottom: 1px solid #d3dce6">
  92. <el-col :span="12" class="loopUnbanlanceCard">
  93. <div class="grid-content" style="text-align: center">
  94. <loop-radarChart2 :getData="getData" v-loading="loading"></loop-radarChart2>
  95. </div>
  96. </el-col>
  97. <el-col :span="12" class="loopUnbanlanceCard">
  98. <div style="
  99. width: 90%;
  100. background: #1187ff;
  101. margin: 0px auto;
  102. text-align: center;
  103. color: #fff;
  104. padding: 10px 0px;
  105. ">
  106. <div class="mb-10">电流不平衡度</div>
  107. <div>{{ getData.elBalun ? getData.elBalun * 100 : 0 }}%</div>
  108. </div>
  109. <ul>
  110. <li>
  111. <div>A相电流</div>
  112. <div>
  113. <div class="mb-5">
  114. 幅值:{{ getData.ua ? getData.ia + ' A' : 0 }}
  115. </div>
  116. <div>相角:-</div>
  117. </div>
  118. </li>
  119. <li>
  120. <div>B相电流</div>
  121. <div>
  122. <div class="mb-5">
  123. 幅值:{{ getData.ua ? getData.ib + ' A' : 0 }}
  124. </div>
  125. <div>相角:-</div>
  126. </div>
  127. </li>
  128. <li>
  129. <div>C相电流</div>
  130. <div>
  131. <div class="mb-5">
  132. 幅值:{{ getData.ua ? getData.ic + ' A' : 0 }}
  133. </div>
  134. <div>相角:-</div>
  135. </div>
  136. </li>
  137. </ul>
  138. </el-col>
  139. </el-row>
  140. </div>
  141. </el-col>
  142. <!-- 三项不平衡度 end -->
  143. <!-- 谐波 -->
  144. <el-col :md="24" :lg="16">
  145. <harmonic-panel v-loading="loading"></harmonic-panel>
  146. </el-col>
  147. <!-- 谐波 end -->
  148. </el-row>
  149. <el-row :gutter="20" class="mt-20">
  150. <!-- 电压start -->
  151. <el-col :md="24" :lg="8" class="mb-20">
  152. <voltage-panel :getData="getData" v-loading="loading"></voltage-panel>
  153. </el-col>
  154. <!-- 电压end -->
  155. <!-- 频率 start-->
  156. <el-col :md="24" :lg="8" class="mb-20">
  157. <frequency-panel :getData="getData" v-loading="loading"></frequency-panel>
  158. </el-col>
  159. <!-- 频率 end -->
  160. <!-- 有功功率 -->
  161. <el-col :md="24" :lg="8">
  162. <power-panel :getData="getData" v-loading="loading"></power-panel>
  163. </el-col>
  164. <!-- 有功功率 end -->
  165. </el-row>
  166. <!--指标说明弹框组件开始-----------------------start-->
  167. <descrip-dialog :dialogTitle="dialogTitle" @closeDialog="closeDialog" :flag="showDialog" :siteId="siteId"
  168. class="descripDialog"></descrip-dialog>
  169. <!--指标说明弹框组件结束-----------------------end-->
  170. </div>
  171. </template>
  172. <script>
  173. import { useStore } from 'vuex'
  174. import { defineComponent, onMounted, ref } from 'vue'
  175. import loopRadarChart from './loopMonitorComponent/loopRadarChart'
  176. import loopRadarChart2 from './loopMonitorComponent/loopRadarChart2'
  177. import harmonicPanel from './loopMonitorComponent/harmonicPanel'
  178. import voltagePanel from './loopMonitorComponent/voltagePanel'
  179. import frequencyPanel from './loopMonitorComponent/frequencyPanel'
  180. import powerPanel from './loopMonitorComponent/powerPanel'
  181. import descripDialog from './loopMonitorComponent/descripDialog'
  182. import * as api from '@/api/powerQuality/loopMonitor.js'
  183. import { ElMessage } from 'element-plus'
  184. import { ElNotification } from 'element-plus'
  185. export default defineComponent({
  186. name: 'LoopMonitor',
  187. components: {
  188. loopRadarChart,
  189. loopRadarChart2,
  190. harmonicPanel,
  191. voltagePanel,
  192. frequencyPanel,
  193. powerPanel,
  194. descripDialog,
  195. },
  196. props: {
  197. activeName: String,
  198. },
  199. setup(props) {
  200. const store = useStore()
  201. const loading = ref(false)
  202. const getData = ref({})
  203. const deviceList = ref([])
  204. const deviceCode = ref('')
  205. const showDialog = ref(false)
  206. const dialogTitle = ref('')
  207. const siteId = ref(0)
  208. function linkDevice() {
  209. deviceSelect()
  210. }
  211. //设备下拉请求
  212. function deviceSelect() {
  213. api.deviceListOne({ siteId: store.state.siteId }).then((requset) => {
  214. if (requset.status === 'SUCCESS') {
  215. deviceList.value = requset.data
  216. deviceCode.value = requset.data[0] ? requset.data[0].deviceCode : ''
  217. } else {
  218. ElMessage.error(requset.msg)
  219. }
  220. })
  221. }
  222. //数据请求
  223. function realScoreOne() {
  224. if (!deviceCode.value) {
  225. ElNotification({
  226. title: '提示',
  227. message: '请选择左侧设备信息',
  228. type: 'warning',
  229. })
  230. return
  231. }
  232. loading.value = true
  233. api.realScoreOne({ deviceCode: deviceCode.value }).then((requset) => {
  234. loading.value = false
  235. if (requset.status === 'SUCCESS') {
  236. getData.value = requset.data
  237. } else {
  238. ElMessage.error(requset.msg)
  239. }
  240. })
  241. // nowTime.value = parseTime(new Date())
  242. }
  243. // 查看指标说明
  244. const descripDialog = () => {
  245. siteId.value = store.state.siteId
  246. dialogTitle.value = '指标说明'
  247. showDialog.value = true
  248. }
  249. // 关闭操作
  250. const closeDialog = () => {
  251. showDialog.value = false
  252. }
  253. onMounted(() => {
  254. deviceSelect()
  255. if (props.activeName == 'second') {
  256. setTimeout(function () {
  257. realScoreOne()
  258. }, 1000)
  259. }
  260. })
  261. return {
  262. store,
  263. getData,
  264. deviceList,
  265. deviceCode,
  266. linkDevice,
  267. deviceSelect,
  268. realScoreOne,
  269. descripDialog,
  270. showDialog,
  271. dialogTitle,
  272. closeDialog,
  273. siteId,
  274. loading
  275. }
  276. },
  277. })
  278. </script>
  279. <style lang="scss" scoped>
  280. .el-row {
  281. margin-bottom: 20px;
  282. &:last-child {
  283. margin-bottom: 0;
  284. }
  285. }
  286. .el-col {
  287. border-radius: 4px;
  288. }
  289. .bg-purple-dark {
  290. border: 1px solid #99a9bf;
  291. }
  292. .bg-purple {
  293. border: 1px solid #d3dce6;
  294. }
  295. .bg-purple-light {
  296. border: 1px solid #e5e9f2;
  297. }
  298. .grid-content {
  299. border-radius: 4px;
  300. min-height: 36px;
  301. }
  302. .row-bg {
  303. padding: 10px 0;
  304. border: 1px solid #f9fafc;
  305. }
  306. ul li {
  307. padding: 0;
  308. margin: 0;
  309. list-style: none
  310. }
  311. </style>