fireWork.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. <template>
  2. <div class="fireWork">
  3. <!-- 顶部区域 -->
  4. <div class="work-nav">
  5. <div class="nav" v-for="(item, index) in topList" :key="index">
  6. <div class="pic" v-if="item.imgSrc">
  7. <img :src="imgUrl" alt="" />
  8. </div>
  9. <div class="content" v-if="item.label && item.value">
  10. <span>{{ item.label }}</span>
  11. <span>{{ item.value }}</span>
  12. </div>
  13. <div class="text" v-if="item.text">{{ item.text }}</div>
  14. <div class="percent" v-if="item.list.length != 0">
  15. <div class="title">{{ item.label }}</div>
  16. <div class="value">
  17. <div class="box" v-for="(items, ind) in item.list" :key="ind">
  18. <span style="color: #b3b8cc">{{ `${items.label} :` }}</span>
  19. <span style="color: #3df6ff; margin-left: 10px">{{ `${items.value}%` }}</span>
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. <!-- 中间区域 -->
  26. <div class="center-echart">
  27. <div class="nav-title">
  28. <div class="title">光纤测温系统温度实时监测</div>
  29. <!-- <a-select style="width: 240px; margin-left: 10px" v-model="pointCode" allowClear class="code-mode-select"
  30. placeholder="请选择" @change="handleChange">
  31. <a-select-option v-for="device in pointList" :key="device.value" :value="device.value">{{ device.label
  32. }}
  33. </a-select-option>
  34. </a-select> -->
  35. </div>
  36. <div class="echart-box">
  37. <echartLine :echartDataGq="echartDataGq" :maxY="maxY" :echartDw="echartDw"></echartLine>
  38. </div>
  39. </div>
  40. <!-- 底部区域 -->
  41. <div class="bot-content">
  42. <div class="title">
  43. <div class="text">束管系统监测</div>
  44. <!-- <div class="search">
  45. <a-range-picker v-model="TimeRange" :show-time="{ format: 'HH:mm:ss' }" format="YYYY-MM-DD HH:mm:ss"
  46. :placeholder="['开始时间', '终止时间']" @change="onDataChange" />
  47. <a-select style="width: 240px; margin-left: 10px" v-model="pointCode1" allowClear
  48. class="code-mode-select" placeholder="请选择" @change="handleChange1">
  49. <a-select-option v-for="device in pointList1" :key="device.value" :value="device.value">{{
  50. device.label }}
  51. </a-select-option>
  52. </a-select>
  53. </div> -->
  54. </div>
  55. <div class="content">
  56. <div class="box" v-for="(item, index) in contentList" :key="index">
  57. <div class="box-item" v-for="(items, ind) in item.list" :key="ind" @click="getSgClick(items)">
  58. <div class="content-title">{{ items.title }}</div>
  59. <div class="content-item">
  60. <span>{{ items.label }}</span>
  61. <span class="bolds">{{ items.value }}</span>
  62. </div>
  63. <div class="content-item">
  64. <span>{{ items.label1 }}</span>
  65. <span class="bolds">{{ items.time }}</span>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="echart-box">
  71. <echartLine1 :echartDataSg="echartDataSg"></echartLine1>
  72. </div>
  73. </div>
  74. </div>
  75. </template>
  76. <script lang="ts" setup>
  77. import { onMounted, ref, reactive, watch, defineProps } from 'vue';
  78. import imgUrl from '../../../../../assets/images/fire/pie.png'
  79. import echartLine from './common/echartLine.vue'
  80. import echartLine1 from './common/echartLine1.vue'
  81. import { topList, contentList, } from '../fire.data'
  82. let props = defineProps({
  83. listData: Object,
  84. });
  85. let maxY = ref(2000)
  86. let echartDw = ref('(­°C)')
  87. //光钎测温-图表数据
  88. let echartDataGq = reactive({
  89. maxData: {
  90. lengedData: '当前温度',
  91. data: []
  92. },
  93. xData: [],
  94. })
  95. //束管监测-图表数据
  96. let echartDataSg = reactive({
  97. xData: [],
  98. yData: [],
  99. lengedData: 'O2',
  100. })
  101. let echartDataSgList = reactive<any[]>([])
  102. //光钎测温测点编号
  103. // let pointCode = ref('')
  104. //束管监测-查询时间
  105. // let TimeRange = reactive<any>([])
  106. //束管监测-测点编号
  107. // let pointCode1 = ref('')
  108. //光钎测温测点编号选项切换
  109. // function handleChange(val) {
  110. // pointCode.value = val
  111. // }
  112. //束管监测-时间选项切换
  113. // function onDataChange(value, dateString) {
  114. // TimeRange = [dateString[0], dateString[1]]
  115. // }
  116. //束管监测测点编号选项切换
  117. // function handleChange1(val) {
  118. // pointCode1.value = val
  119. // }
  120. //束管实时数据选项点击
  121. function getSgClick(items) {
  122. echartDataSg.xData.length = 0
  123. echartDataSg.yData.length = 0
  124. echartDataSg.lengedData = items.title
  125. switch (items.title) {
  126. case 'O2':
  127. echartDataSgList.forEach(el => {
  128. echartDataSg.xData.push(el.time)
  129. echartDataSg.yData.push(el.o2val)
  130. })
  131. break;
  132. case 'C2H4':
  133. echartDataSgList.forEach(el => {
  134. echartDataSg.xData.push(el.time)
  135. echartDataSg.yData.push(el.ch2val)
  136. })
  137. break;
  138. case 'CO':
  139. echartDataSgList.forEach(el => {
  140. echartDataSg.xData.push(el.time)
  141. echartDataSg.yData.push(el.coval)
  142. })
  143. break;
  144. case 'CH4':
  145. echartDataSgList.forEach(el => {
  146. echartDataSg.xData.push(el.time)
  147. echartDataSg.yData.push(el.chval)
  148. })
  149. break;
  150. case 'CO2':
  151. echartDataSgList.forEach(el => {
  152. echartDataSg.xData.push(el.time)
  153. echartDataSg.yData.push(el.co2val)
  154. })
  155. break;
  156. case 'C2H2':
  157. echartDataSgList.forEach(el => {
  158. echartDataSg.xData.push(el.time)
  159. echartDataSg.yData.push(el.gasval)
  160. })
  161. break;
  162. }
  163. }
  164. watch(() => props.listData, (val, val1) => {
  165. console.log(val, '火灾详情')
  166. if (JSON.stringify(val) != '{}') {
  167. echartDataGq.xData.length = 0
  168. echartDataGq.maxData.data.length = 0
  169. echartDataSgList.length = 0
  170. echartDataSg.xData.length = 0
  171. echartDataSg.yData.length = 0
  172. if (val.fiber.length != 0) {
  173. topList[0].value = val.fiber[0].readData.fmax
  174. topList[1].value = val.fiber[0].readData.fmin
  175. topList[2].value = val.fiber[0].readData.favg
  176. topList[3].text = val.fiber[0].warnFlag ? '报警' : '未报警'
  177. JSON.parse(val.fiber[0].readData.fibreTemperature).forEach(el => {
  178. echartDataGq.xData.push(el.pos)
  179. echartDataGq.maxData.data.push(el.value)
  180. })
  181. }
  182. if (val.bundletube.length != 0) {
  183. contentList[0].list[0].value = val.bundletube[0].readData.o2val
  184. contentList[0].list[1].value = val.bundletube[0].readData.ch2val
  185. contentList[1].list[0].value = val.bundletube[0].readData.coval
  186. contentList[1].list[1].value = val.bundletube[0].readData.chval
  187. contentList[2].list[0].value = val.bundletube[0].readData.co2val
  188. contentList[2].list[1].value = val.bundletube[0].readData.gasval
  189. contentList.forEach(el => {
  190. el.list.forEach(v => {
  191. v.time = val.bundletube[0].readTime.substring(0, val.bundletube[0].readTime.lastIndexOf(':'))
  192. })
  193. })
  194. val.bundletube[0].history.forEach(el => {
  195. echartDataSg.xData.push(el.time)
  196. if (echartDataSg.lengedData == 'O2') {
  197. echartDataSg.yData.push(el.o2val)
  198. } else if (echartDataSg.lengedData == 'C2H4') {
  199. echartDataSg.yData.push(el.ch2val)
  200. } else if (echartDataSg.lengedData == 'C2H2') {
  201. echartDataSg.yData.push(el.gasval)
  202. } else if (echartDataSg.lengedData == 'CH4') {
  203. echartDataSg.yData.push(el.chval)
  204. } else if (echartDataSg.lengedData == 'CO') {
  205. echartDataSg.yData.push(el.coval)
  206. } else if (echartDataSg.lengedData == 'CO2') {
  207. echartDataSg.yData.push(el.co2val)
  208. }
  209. echartDataSgList.push(el)
  210. })
  211. }
  212. }
  213. }, { deep: true })
  214. </script>
  215. <style lang="less" scoped>
  216. .fireWork {
  217. width: 100%;
  218. height: 100%;
  219. padding: 20px;
  220. box-sizing: border-box;
  221. .work-nav {
  222. height: 115px;
  223. width: 100%;
  224. margin-bottom: 20px;
  225. background: url('../../../../../assets/images/fire/bj1.png') no-repeat;
  226. background-size: 100% 100%;
  227. display: flex;
  228. justify-content: space-between;
  229. align-items: center;
  230. .nav {
  231. display: flex;
  232. justify-content: center;
  233. align-items: center;
  234. &:nth-child(1) {
  235. flex: 1;
  236. height: 100%;
  237. border-right: 2px solid;
  238. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  239. }
  240. &:nth-child(2) {
  241. flex: 1;
  242. height: 100%;
  243. border-right: 2px solid;
  244. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  245. }
  246. &:nth-child(3) {
  247. flex: 1;
  248. height: 100%;
  249. border-right: 2px solid;
  250. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  251. }
  252. &:nth-child(4) {
  253. flex: 0.6;
  254. color: #b3b8cc;
  255. font-size: 16px;
  256. height: 100%;
  257. border-right: 2px solid;
  258. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  259. }
  260. &:nth-child(5) {
  261. flex: 1.4;
  262. height: 100%;
  263. .percent {
  264. width: 100%;
  265. height: 94px;
  266. padding: 0px 20px;
  267. box-sizing: border-box;
  268. display: flex;
  269. flex-direction: column;
  270. justify-content: space-around;
  271. .title {
  272. font-size: 14px;
  273. padding: 5px 0px;
  274. color: #b3b8cc;
  275. text-align: center;
  276. }
  277. .value {
  278. display: flex;
  279. justify-content: space-between;
  280. span {
  281. font-family: 'douyuFont';
  282. font-size: 18px;
  283. }
  284. }
  285. }
  286. }
  287. .pic {
  288. width: 94px;
  289. height: 94px;
  290. img {
  291. width: 100%;
  292. height: 100%;
  293. }
  294. }
  295. .content {
  296. height: 94px;
  297. margin-left: 15px;
  298. color: #fff;
  299. display: flex;
  300. flex-direction: column;
  301. justify-content: space-around;
  302. span {
  303. font-size: 14px;
  304. &:nth-child(1) {
  305. padding: 5px 0px;
  306. color: #b3b8cc;
  307. }
  308. &:nth-child(2) {
  309. font-family: 'douyuFont';
  310. font-size: 24px;
  311. color: #3df6ff;
  312. }
  313. }
  314. }
  315. }
  316. .nav:nth-child(1) .pic {
  317. background: url('../../../../../assets/images/fire/max.svg') no-repeat;
  318. background-position: 50% 50%;
  319. }
  320. .nav:nth-child(2) .pic {
  321. background: url('../../../../../assets/images/fire/min.svg') no-repeat;
  322. background-position: 50% 50%;
  323. }
  324. .nav:nth-child(3) .pic {
  325. background: url('../../../../../assets/images/fire/pj.svg') no-repeat;
  326. background-position: 50% 50%;
  327. }
  328. }
  329. .center-echart {
  330. width: 100%;
  331. height: 242px;
  332. padding: 15px;
  333. margin-bottom: 20px;
  334. box-sizing: border-box;
  335. background: url('../../../../../assets/images/fire/bj1.png') no-repeat;
  336. background-size: 100% 100%;
  337. .nav-title {
  338. height: 30px;
  339. display: flex;
  340. justify-content: space-between;
  341. align-items: center;
  342. .title {
  343. font-family: 'douyuFont';
  344. font-size: 16px;
  345. color: #3df6ff;
  346. }
  347. }
  348. .echart-box {
  349. width: 100%;
  350. height: calc(100% - 30px);
  351. }
  352. }
  353. .bot-content {
  354. position: relative;
  355. width: 100%;
  356. height: calc(100% - 397px);
  357. padding: 15px 15px 0px 15px;
  358. box-sizing: border-box;
  359. background: url('../../../../../assets/images/fire/bj1.png') no-repeat;
  360. background-size: 100% 100%;
  361. .title {
  362. height: 32px;
  363. display: flex;
  364. justify-content: space-between;
  365. margin-bottom: 10px;
  366. .text {
  367. height: 32px;
  368. line-height: 32px;
  369. font-family: 'douyuFont';
  370. font-size: 16px;
  371. color: #3df6ff;
  372. }
  373. }
  374. .content {
  375. height: calc(100% - 42px);
  376. display: flex;
  377. flex-direction: column;
  378. justify-content: space-between;
  379. .box {
  380. width: 100%;
  381. height: 90px;
  382. display: flex;
  383. justify-content: space-between;
  384. .box-item {
  385. position: relative;
  386. width: 242px;
  387. height: 100%;
  388. background: url('../../../../../assets/images/fire/14174.png') no-repeat;
  389. background-size: 100% 100%;
  390. cursor: pointer;
  391. .content-title {
  392. position: absolute;
  393. left: 50%;
  394. top: 0;
  395. transform: translate(-50%);
  396. color: #fff;
  397. font-size: 16px;
  398. }
  399. .content-item {
  400. position: absolute;
  401. width: 226px;
  402. height: 24px;
  403. line-height: 24px;
  404. padding: 0px 10px;
  405. box-sizing: border-box;
  406. color: #fff;
  407. font-size: 14px;
  408. background: url('../../../../../assets/images/fire/contetn.png') no-repeat;
  409. background-size: 100% 100%;
  410. &:nth-child(2) {
  411. left: 50%;
  412. top: 26px;
  413. transform: translate(-50%);
  414. display: flex;
  415. justify-content: space-between;
  416. }
  417. &:nth-child(3) {
  418. left: 50%;
  419. top: 56px;
  420. transform: translate(-50%);
  421. display: flex;
  422. justify-content: space-between;
  423. }
  424. .bolds {
  425. font-family: 'douyuFont';
  426. color: #3df6ff;
  427. font-size: 12px;
  428. }
  429. }
  430. }
  431. }
  432. }
  433. .echart-box {
  434. position: absolute;
  435. left: 50%;
  436. top: 57px;
  437. transform: translate(-50%, 0);
  438. width: calc(100% - 514px);
  439. height: calc(100% - 57px);
  440. }
  441. }
  442. }
  443. </style>