gasUnit.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <template>
  2. <CustomBadges class="w-1710px ml-100px mt-50px" :badges="unitHeaderBadges" />
  3. <div class="monitor-container">
  4. <transition enter-active-class="animate__animated animate__fadeInLeft" leave-active-class="animate__animated animate__fadeOutLeft">
  5. <div class="lr left-box" v-if="loading">
  6. <ventBox1>
  7. <template #title>
  8. <div>评价单元基础信息</div>
  9. </template>
  10. <template #container>
  11. <ListItem
  12. v-for="(item, index) in gasUnitBase"
  13. :key="index"
  14. class="w-100% mb-5px"
  15. :value="get(dataSource, item.code)"
  16. :label="item.title"
  17. labelWidth="200px"
  18. />
  19. </template>
  20. </ventBox1>
  21. <ventBox1 class="vent-margin-t-10">
  22. <template #title>
  23. <div>单元累计抽采混量</div>
  24. </template>
  25. <template #container>
  26. <CustomChart :chart-config="gasUnitHlOption" :chart-data="mockGasUnitHlData" height="280px" />
  27. </template>
  28. </ventBox1>
  29. </div>
  30. </transition>
  31. <transition enter-active-class="animate__animated animate__fadeInRight" leave-active-class="animate__animated animate__fadeOutRight">
  32. <div class="lr right-box" v-if="loading">
  33. <div class="item-box">
  34. <ventBox1>
  35. <template #title>
  36. <div>实时监测数据</div>
  37. </template>
  38. <template #container>
  39. <ListItem
  40. v-for="(item, index) in gasUnitMonitor"
  41. :key="index"
  42. class="w-100% mb-5px"
  43. :value="get(dataSource, item.code)"
  44. :label="item.title"
  45. labelWidth="200px"
  46. />
  47. </template>
  48. </ventBox1>
  49. <ventBox1 class="vent-margin-t-10">
  50. <template #title>
  51. <div>单元累计抽采纯量</div>
  52. </template>
  53. <template #container>
  54. <CustomChart :chart-config="gasUnitClOption" :chart-data="mockGasUnitClData" height="280px" />
  55. </template>
  56. </ventBox1>
  57. </div>
  58. </div>
  59. </transition>
  60. </div>
  61. </template>
  62. <script setup lang="ts">
  63. import { onBeforeMount, ref, onMounted, onUnmounted } from 'vue';
  64. import ventBox1 from '/@/components/vent/ventBox1.vue';
  65. import CustomBadges from './customHeader.vue';
  66. import {
  67. gasUnitMonitor,
  68. unitHeaderBadges,
  69. gasUnitBase,
  70. gasUnitHlOption,
  71. mockGasUnitHlData,
  72. gasUnitClOption,
  73. mockGasUnitClData,
  74. } from '../gasAssessment.data';
  75. import ListItem from '@/views/vent/gas/components/list/listItem.vue';
  76. import { get } from '@/utils/ventutil';
  77. import CustomChart from '@/views/vent/home/configurable/components/detail/CustomChart.vue';
  78. import { list } from '../gasAssessment.api';
  79. let props = withDefaults(
  80. defineProps<{
  81. unitId: string;
  82. }>(),
  83. {
  84. unitId: '',
  85. }
  86. );
  87. const loading = ref(false);
  88. const dataSource = ref({});
  89. // // https获取监测数据
  90. let timer: null | NodeJS.Timeout = null;
  91. function getMonitor(flag?) {
  92. if (Object.prototype.toString.call(timer) === '[object Null]') {
  93. timer = setTimeout(
  94. async () => {
  95. const res = await list({ ids: props.unitId, pagetype: 'normal' });
  96. if (res.msgTxt && res.msgTxt[0]) {
  97. const data = res.msgTxt[0].datalist[0] || [];
  98. dataSource.value = Object.assign(data, data['readData']);
  99. if (timer) {
  100. timer = null;
  101. }
  102. getMonitor();
  103. }
  104. if (timer) {
  105. timer = null;
  106. }
  107. await getMonitor();
  108. },
  109. flag ? 0 : 1000
  110. );
  111. }
  112. }
  113. onBeforeMount(() => {});
  114. onMounted(async () => {
  115. getMonitor(true);
  116. loading.value = true;
  117. });
  118. onUnmounted(() => {
  119. if (timer) {
  120. clearTimeout(timer);
  121. }
  122. });
  123. </script>
  124. <style lang="less">
  125. @import '/@/design/vent/modal.less';
  126. .@{ventSpace}-select-dropdown {
  127. background: #ffffff !important;
  128. border-bottom: 1px solid rgba(236, 236, 236, 0.4);
  129. backdrop-filter: blur(10px);
  130. .@{ventSpace}-select-item-option-selected,
  131. .@{ventSpace}-select-item-option-active {
  132. background-color: #ffffff33 !important;
  133. }
  134. .@{ventSpace}-select-item:hover {
  135. background-color: #ffffff33 !important;
  136. }
  137. }
  138. </style>
  139. <style lang="less" scoped>
  140. @ventSpace: zxm;
  141. @import '/@/design/vent/modal.less';
  142. @import '@/views/vent/monitorManager/comment/less/workFace.less';
  143. .bg {
  144. width: 100%;
  145. height: 100%;
  146. display: flex;
  147. justify-content: center;
  148. align-items: center;
  149. overflow: hidden;
  150. position: absolute;
  151. pointer-events: auto;
  152. z-index: 0;
  153. }
  154. .monitor-container {
  155. height: 850px;
  156. pointer-events: none;
  157. }
  158. .modal-monitor {
  159. position: absolute;
  160. z-index: -1;
  161. flex-direction: row-reverse;
  162. .main-container {
  163. background-color: #00000078;
  164. }
  165. .monitor-item {
  166. width: 180px;
  167. display: flex;
  168. flex-direction: row;
  169. width: auto;
  170. margin-bottom: 3px;
  171. .monitor-title {
  172. width: 120px;
  173. color: #7af5ff;
  174. font-weight: 400;
  175. font-size: 13px;
  176. }
  177. .monitor-val {
  178. color: #ffb700;
  179. display: flex;
  180. width: auto;
  181. .val {
  182. width: 60px;
  183. font-size: 13px;
  184. text-align: center;
  185. }
  186. .unit {
  187. color: #ffffffbb;
  188. font-size: 13px;
  189. }
  190. }
  191. }
  192. .title {
  193. text-align: center;
  194. }
  195. }
  196. .left-box {
  197. width: 360px;
  198. }
  199. .gas-pump-item {
  200. padding: 3px 0;
  201. }
  202. .param-set {
  203. color: #45d3fd;
  204. cursor: pointer;
  205. &:hover {
  206. color: #38a6c8;
  207. }
  208. }
  209. .input-item {
  210. margin: 3px 0 !important;
  211. .value {
  212. width: 80px;
  213. text-align: center;
  214. }
  215. }
  216. .data-group {
  217. display: flex;
  218. flex-wrap: wrap;
  219. justify-content: space-between;
  220. padding-bottom: 8px;
  221. .data-item {
  222. width: calc(50% - 10px);
  223. display: flex;
  224. justify-content: space-between;
  225. line-height: 24px;
  226. background-image: linear-gradient(to right, #39a3ff00, #39a3ff10, #39a3ff02);
  227. margin: 4px 0;
  228. }
  229. .value {
  230. color: #00eefffe;
  231. }
  232. .data-item1 {
  233. width: 100%;
  234. line-height: 24px;
  235. background-image: linear-gradient(to right, #39a3ff00, #39a3ff10, #39a3ff02);
  236. margin: 4px 0;
  237. }
  238. }
  239. .base-title {
  240. line-height: 26px;
  241. position: relative;
  242. padding-left: 15px;
  243. color: #9bf2ff;
  244. &::after {
  245. content: '';
  246. position: absolute;
  247. display: block;
  248. width: 4px;
  249. height: 12px;
  250. top: 8px;
  251. left: 5px;
  252. background: #45d3fd;
  253. border-radius: 4px;
  254. }
  255. }
  256. .detail {
  257. border: 1px solid #9bf2ff88;
  258. padding: 0 5px;
  259. background-color: #ffffff11;
  260. margin-right: 4px;
  261. &:hover {
  262. background-color: #ffffff05;
  263. }
  264. }
  265. </style>