beltTunGasHome.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <template>
  2. <a-spin tip="Loading..." :spinning="loading">
  3. <div class="monitor-container">
  4. <div class="lr left-box">
  5. <ventBox1>
  6. <template #title>
  7. <div>工作面瓦斯监控</div>
  8. </template>
  9. <template #container>
  10. <div class="data-group">
  11. <div class="data-item" v-for="(item, index) in gasMonitor" :key="index">
  12. <div class="title">{{ item.title }}</div>
  13. <div class="value">-</div>
  14. </div>
  15. </div>
  16. </template>
  17. </ventBox1>
  18. <ventBox1 class="vent-margin-t-10">
  19. <template #title>
  20. <div>当前抽采地质测定 (<span class="param-set"> 参数设定 </span> ) </div>
  21. </template>
  22. <template #container>
  23. <div class="data-group">
  24. <div class="data-item" v-for="(item, index) in currentGasMonitor" :key="index">
  25. <div class="title">{{ item.title }}</div>
  26. <div class="value">-</div>
  27. </div>
  28. </div>
  29. </template>
  30. </ventBox1>
  31. <ventBox1 class="vent-margin-t-10">
  32. <template #title>
  33. <div>工作面瓦斯抽采基础属性参数</div>
  34. </template>
  35. <template #container>
  36. <div class="data-group">
  37. <div class="data-item" v-for="(item, index) in gasParamData" :key="index">
  38. <div class="title">{{ item.title }}</div>
  39. <div class="value">-</div>
  40. </div>
  41. </div>
  42. </template>
  43. </ventBox1>
  44. </div>
  45. <div class="lr right-box">
  46. <div class="item-box sensor-container">
  47. <ventBox1>
  48. <template #title>
  49. <div>瓦斯抽采监测与控制</div>
  50. </template>
  51. <template #container>
  52. <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="42" name="alarm-icon"/><span>抽采泵监测与控制</span></div>
  53. <div class="vent-margin-b-10 vent-padding-lr-5">
  54. <div class="vent-flex-row-between vent-padding-lr-5 gas-pump-item" v-for="(item, index) in gasPump" :key="index">
  55. <div class="title">{{ item.title }}</div>
  56. <div><span class="signal-round vent-margin-r-8" :class="{ 'signal-round-gry': item.value == '0', 'signal-round-blue': item.value == '1' }"></span>{{ item.value == '0' ? '关闭' : '开启' }}</div>
  57. <a-switch v-model:checked="gasPumpCtr[item.ctrCode]" checked-children="开启" un-checked-children="关闭" checkedValue="1" unCheckedValue="0" />
  58. </div>
  59. </div>
  60. <div class="parameter-title group-parameter-title vent-margin-t-15"><SvgIcon class="icon" size="42" name="alarm-icon"/><span>阀门开度管理</span></div>
  61. <div class="input-box">
  62. <div v-for="(item, index) in gasPumpValve" :key="index" class="input-item">
  63. <div class="">{{ item.title }}</div>
  64. <div class="value">-</div>
  65. <a-input class="input-value" v-model="item.inputNum" placeholder="" />
  66. <span class="btn btn1">保存</span>
  67. </div>
  68. </div>
  69. <div class="parameter-title group-parameter-title vent-margin-t-15"><SvgIcon class="icon" size="42" name="alarm-icon"/><span>高负压管路监测与控制</span></div>
  70. <div v-for="num in highTensionNum" :key="num">
  71. <div class="vent-flex-row-between">
  72. <span class="base-title">抽采单元{{ num }}</span>
  73. <div class="detail">详情</div>
  74. </div>
  75. <div class="data-group vent-padding-lr-5">
  76. <div class="data-item" v-for="(item, index) in gasExtractionUnit" :key="index">
  77. <div class="title">{{ item.title }}</div>
  78. <div class="value">-</div>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="42" name="alarm-icon"/><span>低负压管路监测与控制</span></div>
  83. <div v-for="num in lowTensionNum" :key="num">
  84. <div class="vent-flex-row-between">
  85. <span class="base-title">抽采单元{{ num }}</span>
  86. <span class="detail">详情</span>
  87. </div>
  88. <div class="data-group vent-padding-lr-5">
  89. <div class="data-item" v-for="(item, index) in gasExtractionUnit" :key="index">
  90. <div class="title">{{ item.title }}</div>
  91. <div class="value">-</div>
  92. </div>
  93. </div>
  94. </div>
  95. </template>
  96. </ventBox1>
  97. </div>
  98. </div>
  99. </div>
  100. </a-spin>
  101. </template>
  102. <script setup lang="ts">
  103. import { onBeforeMount, ref, onMounted, onUnmounted, reactive, defineProps } from 'vue';
  104. import { ArrowRightOutlined } from '@ant-design/icons-vue';
  105. import ventBox1 from '/@/components/vent/ventBox1.vue'
  106. import { SvgIcon } from '/@/components/Icon';
  107. import { list } from '../beltTun.api';
  108. import { gasMonitor, gasParamData, currentGasMonitor, gasPumpValve, gasPump, gasExtractionUnit, highTensionNum, lowTensionNum, gasPumpCtr } from '../beltTun.data'
  109. const props = defineProps({
  110. deviceId: {
  111. type: String,
  112. require: true
  113. }
  114. })
  115. const loading = ref(false)
  116. // 默认初始是第一行
  117. const beltTunSource = ref({});
  118. const beltTunHistorySource = ref([])
  119. const gateDataSource = ref([]);
  120. const windowDataSource = ref([]);
  121. const windDataSource = ref([]);
  122. const temperatureDataSource = ref([]);
  123. const fireDataSource = ref([]);
  124. // 监测数据
  125. const selectData = reactive({});
  126. // https获取监测数据
  127. let timer: null | NodeJS.Timeout = null;
  128. function getMonitor(flag?) {
  129. if (Object.prototype.toString.call(timer) === '[object Null]') {
  130. timer = setTimeout(async () => {
  131. if (props.deviceId) {
  132. const data = await getDataSource(props.deviceId)
  133. Object.assign(selectData, data);
  134. }
  135. if (timer) {
  136. timer = null;
  137. }
  138. await getMonitor();
  139. loading.value = false
  140. }, flag ? 0 :1000);
  141. }
  142. };
  143. async function getDataSource(systemID) {
  144. const res = await list({ devicetype: 'sys', systemID });
  145. const result = res.msgTxt;
  146. result.forEach(item => {
  147. // ''.startsWith
  148. if (item.type.startsWith('gate')) {
  149. // 风门
  150. gateDataSource.value = item['datalist'].filter((data: any) => {
  151. const readData = data.readData;
  152. return Object.assign(data, readData);
  153. })
  154. }
  155. if (item.type.startsWith('window')) {
  156. // 风窗
  157. windowDataSource.value = item['datalist'].filter((data: any) => {
  158. const readData = data.readData;
  159. return Object.assign(data, readData);
  160. })
  161. }
  162. if (item.type.startsWith('windrect')) {
  163. // 测风
  164. windDataSource.value = item['datalist'].filter((data: any) => {
  165. const readData = data.readData;
  166. return Object.assign(data, readData);
  167. })
  168. }
  169. if (item.type === 'modelsensor_temperature') {
  170. // 温度
  171. temperatureDataSource.value = item['datalist'].filter((data: any) => {
  172. const readData = data.readData;
  173. return Object.assign(data, readData);
  174. })
  175. }
  176. if (item.type === 'modelsensor_fire') {
  177. // 火焰
  178. fireDataSource.value = item['datalist'].filter((data: any) => {
  179. const readData = data.readData;
  180. return Object.assign(data, readData);
  181. })
  182. }
  183. if (item.type === 'sys') {
  184. beltTunSource.value = Object.assign(item['datalist'][0], item['datalist'][0].readData);
  185. }
  186. if (item.type === 'surface_history') {
  187. beltTunHistorySource.value = item['datalist'][0]
  188. }
  189. loading.value = false;
  190. })
  191. }
  192. function toDetail() {
  193. }
  194. onBeforeMount(() => {
  195. });
  196. onMounted(async () => {
  197. loading.value = true;
  198. timer = null
  199. await getMonitor(true)
  200. });
  201. onUnmounted(() => {
  202. if (timer) {
  203. clearTimeout(timer);
  204. timer = undefined;
  205. }
  206. });
  207. </script>
  208. <style lang="less">
  209. @import '/@/design/vent/modal.less';
  210. .@{ventSpace}-select-dropdown {
  211. background: #ffffff !important;
  212. border-bottom: 1px solid rgba(236, 236, 236, 0.4);
  213. backdrop-filter: blur(10px);
  214. .@{ventSpace}-select-item-option-selected,
  215. .@{ventSpace}-select-item-option-active {
  216. background-color: #ffffff33 !important;
  217. }
  218. .@{ventSpace}-select-item:hover {
  219. background-color: #ffffff33 !important;
  220. }
  221. }
  222. </style>
  223. <style lang="less" scoped>
  224. @ventSpace: zxm;
  225. @import '/@/design/vent/modal.less';
  226. @import '../../comment/less/workFace.less';
  227. .left-box{
  228. width: 360px;
  229. }
  230. .gas-pump-item{
  231. padding: 3px 0;
  232. }
  233. .param-set{
  234. color: #45d3fd;
  235. cursor: pointer;
  236. &:hover{
  237. color: #38a6c8;
  238. }
  239. }
  240. .input-item{
  241. margin: 3px 0 !important;
  242. .value{
  243. width: 80px;
  244. text-align: center;
  245. }
  246. }
  247. .data-group{
  248. display: flex;
  249. flex-wrap: wrap;
  250. justify-content: space-between;
  251. padding-bottom: 8px;
  252. .data-item{
  253. width: calc(50% - 10px);
  254. display: flex;
  255. justify-content: space-between;
  256. line-height: 24px;
  257. background-image: linear-gradient(to right, #39A3FF00, #39A3FF10, #39A3FF02);
  258. margin: 4px 0;
  259. }
  260. .value{
  261. color: #00eefffe;
  262. }
  263. .data-item1{
  264. width: 100%;
  265. line-height: 24px;
  266. background-image: linear-gradient(to right, #39A3FF00, #39A3FF10, #39A3FF02);
  267. margin: 4px 0;
  268. }
  269. }
  270. .base-title{
  271. line-height: 26px;
  272. position: relative;
  273. padding-left: 15px;
  274. color: #9bf2ff;
  275. &::after{
  276. content: '';
  277. position: absolute;
  278. display: block;
  279. width: 4px;
  280. height: 12px;
  281. top: 8px;
  282. left: 5px;
  283. background: #45d3fd;
  284. border-radius: 4px;
  285. }
  286. }
  287. .detail{
  288. border: 1px solid #9bf2ff88;
  289. padding: 0 5px;
  290. background-color: #ffffff11;
  291. margin-right: 4px;
  292. &:hover{
  293. background-color: #ffffff05;
  294. }
  295. }
  296. </style>