fireWork.vue 16 KB

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