tunFaceHome.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  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="vent-param">
  11. <div class="light-group">
  12. <div class="param-item">
  13. <div class="param">
  14. <div class="param-icon">
  15. <div class="param-title">局扇吸风量</div>
  16. <div class="param-unit">(m³/min)</div>
  17. </div>
  18. <div class="param-val-box">
  19. <div class="param-val-icon"></div>
  20. <div class="param-val">{{ workFaceSource['jin'] || '-' }}</div>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="param-item">
  25. <div class="param">
  26. <div class="param-icon">
  27. <div class="param-title">局扇供风量</div>
  28. <div class="param-unit">(m³/min)</div>
  29. </div>
  30. <div class="param-val-box">
  31. <div class="param-val-icon"></div>
  32. <div class="param-val">{{ workFaceSource['hui'] || '-' }}</div>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="param-item">
  37. <div class="param">
  38. <div class="param-icon">
  39. <div class="param-title">总需风量</div>
  40. <div class="param-unit">(m³/min)</div>
  41. </div>
  42. <div class="param-val-box">
  43. <div class="param-val-icon"></div>
  44. <div class="param-val">-</div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <BarAndLineCustom xAxisPropType="time" :chartData="workFaceHistorySource" height="220px"
  51. :propTypeArr="['jin', 'hui']" :option="echartsOption" />
  52. </template>
  53. </ventBox1>
  54. <ventBox1 class="vent-margin-t-10">
  55. <template #title>
  56. <div>预警报警实时监测</div>
  57. </template>
  58. <template #container>
  59. <div class="warning-monitor">
  60. <div class="warning-item">
  61. <div class="title" :class="{ 'active-title': warningType == 'ventS' }" @click="showWarningList('ventS')">通风</div>
  62. <div class="state-box">
  63. <span class="signal-round signal-round-blue"></span><span class="state vent-margin-l-8">正常</span>
  64. </div>
  65. </div>
  66. <div class="warning-item">
  67. <div class="title" :class="{ 'active-title': warningType == 'fireS' }" @click="showWarningList('fireS')">火灾</div>
  68. <div class="state-box">
  69. <span class="signal-round signal-round-blue"></span><span class="state vent-margin-l-8">正常</span>
  70. </div>
  71. </div>
  72. <div class="warning-item">
  73. <div class="title" :class="{ 'active-title': warningType == 'dustS' }" @click="showWarningList('dustS')">粉尘</div>
  74. <div class="state-box">
  75. <span class="signal-round signal-round-blue"></span><span class="state vent-margin-l-8">正常</span>
  76. </div>
  77. </div>
  78. <div class="warning-item">
  79. <div class="title" :class="{ 'active-title': warningType == 'gasS' }" @click="showWarningList('gasS')">瓦斯</div>
  80. <div class="state-box">
  81. <span class="signal-round signal-round-blue"></span><span class="state vent-margin-l-8">正常</span>
  82. </div>
  83. </div>
  84. </div>
  85. <dv-scroll-board ref="scrollBoard" :config="warningConfig" style="width: 100%; height: 240px; overflow-y: auto; " />
  86. </template>
  87. </ventBox1>
  88. </div>
  89. <div class="lr right-box">
  90. <div class="item-box sensor-container">
  91. <ventBox1>
  92. <template #title>
  93. <div>风排瓦斯应急管控</div>
  94. </template>
  95. <template #container>
  96. <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="22" name="ytws"/><span>迎头瓦斯分析</span></div>
  97. <div class="gas-analyze">
  98. <div>
  99. <p>迎头瓦斯含量(%)</p>
  100. <div class="barnav">
  101. <div class="bar2">
  102. <span :style="{ 'width': gasContent+'%' }"></span>
  103. </div>
  104. <span class="num">{{ gasContent }}</span>
  105. </div>
  106. </div>
  107. <div>
  108. <div class="zaf">
  109. <p>增长率</p>
  110. <p class="vent-flex-row"><span class="rate">34<i>%</i></span><img src="/src/assets/images/vent/up.png"></p>
  111. </div>
  112. </div>
  113. <div>
  114. <div class="zaf">
  115. <p>增速分析</p>
  116. <div class="vent-row-center result">正常</div>
  117. </div>
  118. </div>
  119. </div>
  120. <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="22" name="shandian"/><span>局扇应急管控</span></div>
  121. <div class="input-item">
  122. <div class="title-auto">风量调控策略;</div>
  123. <div class="">
  124. <a-radio-group v-model:value="compressorMode">
  125. <a-radio :value="1">手动</a-radio>
  126. <a-radio :value="2">自动</a-radio>
  127. </a-radio-group>
  128. </div>
  129. </div>
  130. <div class="input-item" v-for="(item, index) in compressorParam" :key="index">
  131. <div class="title-auto">{{ item.title }}:</div>
  132. <div>
  133. <a-input class="input-value" v-model="item.value" />
  134. <span class="btn btn1 vent-margin-l-8">保存</span>
  135. </div>
  136. </div>
  137. <template v-if="compressorMode === 1">
  138. <div class="input-item" v-for="(item, index) in compressorDeviceParam" :key="index">
  139. <div class="title-auto">{{ item.title }}:</div>
  140. <div>
  141. <a-input class="input-value" v-model="item.value" />
  142. <span class="btn btn1 vent-margin-l-8">保存</span>
  143. </div>
  144. </div>
  145. </template>
  146. </template>
  147. </ventBox1>
  148. <ventBox1 class="vent-margin-t-10">
  149. <template #title>
  150. <div>工作面人员信息</div>
  151. </template>
  152. <template #container>
  153. <div class="vent-flex-row-between vent-padding-lr-5 person-num">
  154. <div class="vent-row-center">
  155. <SvgIcon class="icon-style" size="20" name="person"/>
  156. <div class="vent-margin-l-8">当前工作面人数</div>
  157. </div>
  158. <div class="">0</div>
  159. </div>
  160. <div style="height: 180px; overflow-y: auto; position: relative;">
  161. <dv-scroll-board v-if="warningType" ref="scrollBoard" :config="locationConfig" style="width: 100%; height: 200px; overflow-y: auto; " />
  162. </div>
  163. </template>
  164. </ventBox1>
  165. <div class="item-box vent-margin-t-10" >
  166. <LivePlayer id="fm-player1" style="height: 220px;" ref="player1" :videoUrl="flvURL1()" muted live loading controls />
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. </a-spin>
  172. </template>
  173. <script setup lang="ts">
  174. import { nextTick, onBeforeMount, ref, onMounted, onUnmounted, reactive, defineProps } from 'vue';
  175. import { list } from '../tunFace.api';
  176. import ventBox1 from '/@/components/vent/ventBox1.vue'
  177. import { ScrollBoard as DvScrollBoard } from '@kjgl77/datav-vue3';
  178. import { echartsOption, warningConfig, locationConfig, compressorParam, compressorDeviceParam } from '../tunFace.data'
  179. import { SvgIcon } from '/@/components/Icon';
  180. import BarAndLineCustom from '/@/components/chart/BarAndLineCustom.vue';
  181. import LivePlayer from '@liveqing/liveplayer-v3';
  182. const props = defineProps({
  183. deviceId: {
  184. type: String,
  185. require: true
  186. }
  187. })
  188. const player1 = ref(null)
  189. const loading = ref(false)
  190. // 默认初始是第一行
  191. const workFaceSource = ref({});
  192. const workFaceHistorySource = ref([])
  193. const gasContent = ref(24)
  194. const compressorMode = ref(1)
  195. // 监测数据
  196. const selectData = reactive({});
  197. const warnInfo = reactive({
  198. dustS: { warningList: [], dataList: [] },
  199. fireS: { warningList: [], dataList: [] },
  200. gasS: { warningList: [], dataList: [] },
  201. synthesizeS: { warningList: [], dataList: [] },
  202. ventS: { warningList: [], dataList: [] },
  203. })
  204. const warningType = ref('ventS')
  205. const flvURL1 = () => {
  206. return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  207. };
  208. function showWarningList(type) {
  209. warningType.value = ''
  210. nextTick(() => {
  211. warningType.value = type
  212. warningConfig.data = warnInfo[type]['dataList']
  213. })
  214. }
  215. // https获取监测数据
  216. let timer: null | NodeJS.Timeout = null;
  217. function getMonitor(flag?) {
  218. if (Object.prototype.toString.call(timer) === '[object Null]') {
  219. timer = setTimeout(async () => {
  220. if (props.deviceId) {
  221. const data = await getDataSource(props.deviceId)
  222. Object.assign(selectData, data);
  223. }
  224. if (timer) {
  225. timer = null;
  226. }
  227. await getMonitor();
  228. loading.value = false
  229. }, flag ? 0 : 1000);
  230. }
  231. };
  232. async function getDataSource(systemID) {
  233. const res = await list({ devicetype: 'sys', systemID, type: 'all' });
  234. const result = res.deviceInfo;
  235. for (const key in result) {
  236. const item = result[key]
  237. // ''.startsWith
  238. if (item.type === 'location') {
  239. const locationData = <any[]>[]
  240. item['datalist'].filter((data: any) => {
  241. locationData.push([data['strname'], data['strinstallpos'], data['readData']['flen']])
  242. const readData = data.readData;
  243. return Object.assign(data, readData);
  244. })
  245. locationConfig.data = locationData
  246. }
  247. loading.value = false;
  248. }
  249. workFaceHistorySource.value = res['sysInfo']['history']
  250. workFaceSource.value = Object.assign(res['sysInfo'], res['sysInfo']['readData']);
  251. warnInfo.dustS = { warningList: res['warnInfo']['dustS']['devices'] || [], dataList: initWarningData(res['warnInfo']['dustS']['devices']) }
  252. warnInfo.fireS = { warningList: res['warnInfo']['fireS']['devices'] || [], dataList: initWarningData(res['warnInfo']['fireS']['devices']) }
  253. warnInfo.gasS = { warningList: res['warnInfo']['gasS']['devices'] || [], dataList: initWarningData(res['warnInfo']['gasS']['devices']) }
  254. warnInfo.synthesizeS = { warningList: res['warnInfo']['synthesizeS']['devices'] || [], dataList: initWarningData(res['warnInfo']['synthesizeS']['devices']) }
  255. warnInfo.ventS = { warningList: res['warnInfo']['ventS']['devices'] || [], dataList: initWarningData(res['warnInfo']['ventS']['devices']) }
  256. }
  257. function initWarningData(devices: any[]) {
  258. const dataArr = <any[]>[]
  259. for (let i = 0; i < devices.length; i++) {
  260. const item = devices[i]
  261. dataArr.push([item['typeName'], item['warnLevel_str'], item['warnTime']])
  262. }
  263. return dataArr
  264. }
  265. function toDetail() {
  266. }
  267. onBeforeMount(() => {
  268. });
  269. onMounted(async () => {
  270. loading.value = true;
  271. timer = null
  272. await getMonitor(true)
  273. });
  274. onUnmounted(() => {
  275. if (timer) {
  276. clearTimeout(timer);
  277. timer = undefined;
  278. }
  279. });
  280. </script>
  281. <style lang="less">
  282. @import '/@/design/vent/modal.less';
  283. .@{ventSpace}-select-dropdown {
  284. background: transparent !important;
  285. border-bottom: 1px solid rgba(236, 236, 236, 0.4);
  286. backdrop-filter: blur(10px);
  287. .@{ventSpace}-select-item {
  288. color: #fff !important;
  289. }
  290. .@{ventSpace}-select-item-option-selected,
  291. .@{ventSpace}-select-item-option-active {
  292. background-color: #00678b66 !important;
  293. }
  294. .@{ventSpace}-select-item:hover {
  295. background-color: #008fc366 !important;
  296. }
  297. }
  298. </style>
  299. <style lang="less" scoped>
  300. @import '../../comment/less/workFace.less';
  301. @ventSpace: zxm;
  302. .person-num{
  303. width: 100%;
  304. height: 28px;
  305. padding: 0 10px;
  306. background: linear-gradient(to right, #00ffff10, #00ccff02, #00ffff10);
  307. position: relative;
  308. margin-bottom: 5px;
  309. &::before{
  310. position: absolute;
  311. content: '';
  312. left: 0;
  313. width: 8px;
  314. height: 30px;
  315. background: url('/src/assets/images/vent/title-boder-left.png');
  316. }
  317. &::after{
  318. position: absolute;
  319. content: '';
  320. right: 0;
  321. width: 8px;
  322. height: 30px;
  323. background: url('/src/assets/images/vent/title-boder-right.png');
  324. }
  325. }
  326. .gas-analyze{
  327. width: 100%;
  328. display: flex;
  329. justify-content: space-between;
  330. margin-top: 10px;
  331. margin-bottom: 5px;
  332. p{
  333. color: #acf9ff;
  334. height: 20px;
  335. font-size: 14px;
  336. }
  337. .barnav{
  338. display: flex;
  339. justify-content: center;
  340. align-items: center;
  341. position: relative;
  342. top: -5px;
  343. .bar2 {
  344. width: 120px;
  345. display: inline-block;
  346. border: 1px solid #00deff;
  347. height: 20px;
  348. padding: 4px;
  349. border-radius: 10px;
  350. margin-right: 10px;
  351. span{
  352. display: block;
  353. height: 100%;
  354. background: linear-gradient(to right,#14b6ff,#9cefff);
  355. border-radius: 8px
  356. }
  357. }
  358. .zaf{
  359. p{
  360. text-align: center;
  361. }
  362. }
  363. }
  364. .num{
  365. color: rgb(247, 232, 13);
  366. font-size: 18px;
  367. }
  368. .rate{
  369. color: rgb(0, 211, 255);
  370. font-family: Impact;
  371. font-size: 20px;
  372. margin-right: 2px;
  373. }
  374. .result{
  375. font-family: 'electronicFont';
  376. font-size: 18px;
  377. color: #61ddb1;
  378. }
  379. }
  380. </style>