earlyWarningDetail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. <!-- 预案报警信息 -->
  2. <template>
  3. <view class="earlyWarning">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  5. <!-- 预案报警 -->
  6. <view class="header" v-if="form.warningType==4">{{form.warningContent}}</view>
  7. <!-- 化学品 -->
  8. <view class="header_tow" v-if="form.warningType==2">{{form.warningContent}}</view>
  9. <!-- 气瓶 -->
  10. <view class="header_three" v-if="form.warningType==3">{{form.warningContent}}</view>
  11. <!-- 算法识别 -->
  12. <view class="header_four" v-if="form.warningType==1">{{form.warningContent}}</view>
  13. <!-- 预案报警 -->
  14. <view class="site" v-if="form.warningType==4">
  15. <img src="@/images/Version2.2/icon_wtzg_xx.png"/>
  16. <text>{{form.subName}}</text>
  17. <text></text>
  18. <text>{{form.buildName}}{{form.floorName}}{{form.roomNum}}</text>
  19. </view>
  20. <!-- 化学品 -->
  21. <view class="site_tow" v-if="form.warningType==2 || form.warningType==3 || form.warningType==1">
  22. <view class="site_tow_t">
  23. <img src="@/images/Version2.2/icon_wtzg_xx.png"/>
  24. <text>{{form.warningTime}}</text>
  25. </view>
  26. <view class="site_tow_b">
  27. <img src="@/images/Version2.2/icon_wtzg_xx.png"/>
  28. <text>{{form.subName}}</text>
  29. <text></text>
  30. <text>{{form.buildName}}{{form.floorName}}{{form.roomNum}}</text>
  31. </view>
  32. </view>
  33. <!-- 预案报警 -->
  34. <view class="basics" v-if="form.warningType==4">
  35. <view class="small_title"><text></text><text>风险概况</text></view>
  36. <view class="basics_li" style="margin-top:20rpx;">
  37. <text>发生时间:</text>
  38. <text>{{form.startTime}}至{{form.endTime?form.endTime:'-'}}</text>
  39. </view>
  40. <view class="basics_li">
  41. <text>持续时间:</text>
  42. <text>{{form.riskDuration}}秒</text>
  43. </view>
  44. <view class="basics_li">
  45. <text>风险响应人员:</text>
  46. <text>{{form.responder}}</text>
  47. </view>
  48. <view class="basics_li">
  49. <text>实验室内人员:</text>
  50. <text>{{form.indoorUser?form.indoorUser:'-'}}</text>
  51. </view>
  52. </view>
  53. <!-- 化学品 -->
  54. <view class="basics" v-if="form.warningType==2">
  55. <view class="small_title"><text></text><text>化学品信息</text></view>
  56. <view class="basics_li" style="margin-top:20rpx;">
  57. <text>{{form.name}}</text>
  58. <text></text>
  59. </view>
  60. <view class="basics_li">
  61. <text>存放位置:</text>
  62. <text>{{form.deposit}}</text>
  63. </view>
  64. <view class="basics_li">
  65. <text>化学品余量:</text>
  66. <text>{{form.margin}}</text>
  67. </view>
  68. <view class="basics_li" v-if="form.warningSubType==2">
  69. <text>申领人:</text>
  70. <text>{{form.apply}}</text>
  71. </view>
  72. <view class="basics_li" v-if="form.warningSubType==2">
  73. <text>申领时间:</text>
  74. <text>{{form.applyTime}}</text>
  75. </view>
  76. <view class="basics_li" v-if="form.warningSubType==3||form.warningSubType==4">
  77. <text>过期时间:</text>
  78. <text>{{form.expirationTime}}</text>
  79. </view>
  80. </view>
  81. <!-- 气瓶 -->
  82. <view class="basics" v-if="form.warningType==3">
  83. <view class="small_title"><text></text><text>气瓶信息</text></view>
  84. <view class="basics_li" style="margin-top:20rpx;">
  85. <text>{{form.name}}</text>
  86. <text></text>
  87. </view>
  88. <view class="basics_li">
  89. <text>气体余量:</text>
  90. <text>{{form.margin}}</text>
  91. </view>
  92. <view class="basics_li">
  93. <text>气瓶规格:</text>
  94. <text>{{form.specification}}</text>
  95. </view>
  96. <view class="basics_li">
  97. <text>所有人:</text>
  98. <text>{{form.holder}}</text>
  99. </view>
  100. <view class="basics_li">
  101. <text>入库时间:</text>
  102. <text>{{form.entryTime}}</text>
  103. </view>
  104. <view class="basics_li" v-if="form.warningSubType==2">
  105. <text>申领人:</text>
  106. <text>{{form.apply}}</text>
  107. </view>
  108. <view class="basics_li" v-if="form.warningSubType==2">
  109. <text>申领时间:</text>
  110. <text>{{form.applyTime}}</text>
  111. </view>
  112. </view>
  113. <view class="note" v-if="form.warningType==4 || form.warningType==1">
  114. <view class="small_title"><text></text><text>通知短信</text></view>
  115. <view class="note_li" style="margin-top:20rpx;" v-for="(item,index) in form.messageVOList">
  116. <text>{{item.name}}</text>
  117. <view class="note_li_r" v-if="item.isSuccess==1"><img src="@/images/icon_yjxx_ytz.png"/><text>已通知</text></view>
  118. </view>
  119. </view>
  120. <view class="note" v-if="(form.warningType==2 || form.warningType==3) && form.warningSubType==1 && form.voiceBroadcast==1">
  121. <view class="small_title"><text></text><text>预警通知</text></view>
  122. <view class="note_li" style="margin-top:20rpx;" >
  123. <text>声光报警通知</text>
  124. <view class="note_li_r" ><img src="@/images/icon_yjxx_ytz.png"/><text>已通知</text></view>
  125. </view>
  126. </view>
  127. <view class="note" v-if="(form.warningType==1 || form.warningType==4) && form.warningSubType==1 && form.voiceBroadcast==1">
  128. <view class="small_title"><text></text><text>预警通知</text></view>
  129. <view class="note_li" style="margin-top:20rpx;" >
  130. <text>语音播报</text>
  131. <view class="note_li_r"><img src="@/images/icon_yjxx_ytz.png"/><text>已通知</text></view>
  132. </view>
  133. </view>
  134. <view class="picture">
  135. <view class="small_title"><text></text><text>报警抓拍</text></view>
  136. <view class="picture_b" >
  137. <view class="video">
  138. <video id="myvideo" class="video_t" :src="configUrl+form.recordVideo"></video>
  139. <img class="video_b" @click="lockVideo()" src="@/images/icon_bjzp_spbof.png"/>
  140. </view>
  141. </view>
  142. </view>
  143. <view class="bottom_btn" v-if="timeStatus" @click="handleClick('','monitor')">查看监控</view>
  144. </scroll-view>
  145. </view>
  146. </template>
  147. <script>
  148. import { config } from '@/api/request/config.js'
  149. import {checkManageList,conditionCollegeInfo,warningNoticeLogDetail} from '@/api/index.js'
  150. export default {
  151. name: "rectifyList",
  152. components: {
  153. },
  154. data() {
  155. return {
  156. configUrl:config.base_url,
  157. //列表请求参数
  158. getData:{
  159. pageNum:1,
  160. pageSize:20,
  161. },
  162. total:0,
  163. warningId:'',
  164. form:{},
  165. currentTime:'',
  166. timeStatus:false,
  167. }
  168. },
  169. onLoad(option) {
  170. let self = this;
  171. //先判断是否是通过点击列表进入
  172. if(option.warningId){
  173. this.warningId=option.warningId;
  174. }else{
  175. //通过短信外链跳转进来
  176. if(option.id){
  177. if(!uni.getStorageSync('token')){
  178. uni.setStorageSync('warningId',option.id);
  179. uni.redirectTo({
  180. url: '/pages/login',
  181. });
  182. }
  183. }else{
  184. this.warningId = uni.getStorageSync('warningId');
  185. uni.removeStorageSync('warningId');
  186. }
  187. }
  188. },
  189. onShow() {
  190. },
  191. mounted(){
  192. this.getInfo();
  193. },
  194. methods: {
  195. //滚动事件
  196. scrollGet(){
  197. let self=this;
  198. },
  199. //判断预警时间是否超过30分钟
  200. compareTime (gettime){
  201. let timeOut = 30 * 60 * 1000;
  202. let currentTime = new Date().getTime() //获取当前时间
  203. let endTime = new Date(gettime).getTime() //预警时间
  204. if(currentTime-endTime>timeOut){
  205. console.log('预警时间超过30分钟')
  206. this.timeStatus=false;
  207. }else{
  208. console.log('预警没超过30分钟')
  209. this.timeStatus=true;
  210. }
  211. console.log(this.timeStatus)
  212. },
  213. //查看图片
  214. lockImg(list){
  215. console.log(list)
  216. if(!list[0]){
  217. return
  218. }
  219. let urlList=[];
  220. for(let i=0;i<list.length;i++){
  221. urlList.push(this.baseUrl+list[i].fileUrl)
  222. }
  223. wx.previewImage({
  224. urls: urlList, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  225. current: '', // 当前显示图片的http链接,默认是第一个
  226. success: function(res) {},
  227. fail: function(res) {},
  228. complete: function(res) {},
  229. })
  230. },
  231. //视频全屏播放
  232. lockVideo(){
  233. this.videoContext = uni.createVideoContext("myvideo", this);
  234. this.videoContext.requestFullScreen({ direction: 90 });
  235. this.videoContext.play();
  236. },
  237. //获取详情
  238. async getInfo(){
  239. let _this = this;
  240. console.log(_this.warningId)
  241. const {data} = await warningNoticeLogDetail({id:_this.warningId})
  242. if(data.code==200){
  243. let res=data.data
  244. this.form=res;
  245. if(res.warningType==1){
  246. uni.setNavigationBarTitle({
  247. title:'算法识别预警信息'
  248. })
  249. }else if(res.warningType==2){
  250. uni.setNavigationBarTitle({
  251. title:'化学品预警信息'
  252. })
  253. }else if(res.warningType==3){
  254. uni.setNavigationBarTitle({
  255. title:'气瓶预警信息'
  256. })
  257. }else if(res.warningType==4){
  258. uni.setNavigationBarTitle({
  259. title:'预案报警信息'
  260. })
  261. }
  262. this.compareTime(res.warningTime);
  263. }
  264. },
  265. handleClick(row,doType){
  266. let self=this;
  267. if( doType=='monitor'){//监控
  268. uni.navigateTo({
  269. url: '/pages/earlyWarningManage/videoMonitoring?subId='+this.form.subId+'&floorId='+this.form.floorId//我的实验室
  270. });
  271. }
  272. },
  273. }
  274. }
  275. </script>
  276. <style lang="stylus" scoped>
  277. .earlyWarning{
  278. height:100%;
  279. display flex;
  280. padding-bottom: 30rpx;
  281. box-sizing: border-box;
  282. .red_color{
  283. color: #D40000;
  284. border: 1rpx solid #D40000;
  285. }
  286. .orange_color{
  287. color: #FF4800;
  288. border: 1rpx solid #FF4800;
  289. }
  290. .yellow_color{
  291. color: #FFA34E;
  292. border: 1rpx solid #FFA34E;
  293. }
  294. .info-max-box{
  295. flex: 1;
  296. overflow: scroll;
  297. }
  298. .header{
  299. width: 750rpx;
  300. height: 80rpx;
  301. font-size: 28rpx;
  302. font-family: PingFang SC-Medium, PingFang SC;
  303. font-weight: 400;
  304. color: #D40000;
  305. line-height: 80rpx;
  306. text-align: center;
  307. background: rgba(212,0,0,0.2);
  308. }
  309. .header_tow{
  310. width: 750rpx;
  311. height: 80rpx;
  312. font-size: 28rpx;
  313. font-family: PingFang SC-Medium, PingFang SC;
  314. font-weight: 400;
  315. color: #FF4800;
  316. line-height: 80rpx;
  317. text-align: center;
  318. background: rgba(255,72,0,0.2);
  319. }
  320. .header_three{
  321. width: 750rpx;
  322. height: 80rpx;
  323. font-size: 28rpx;
  324. font-family: PingFang SC-Medium, PingFang SC;
  325. font-weight: 400;
  326. color: #FF4800;
  327. line-height: 80rpx;
  328. text-align: center;
  329. background: rgba(255,72,0,0.2);
  330. }
  331. .header_four{
  332. width: 750rpx;
  333. height: 80rpx;
  334. font-size: 28rpx;
  335. font-family: PingFang SC-Medium, PingFang SC;
  336. font-weight: 400;
  337. color: #FFA34E;
  338. line-height: 80rpx;
  339. text-align: center;
  340. background: rgba(255,163,78,0.2);
  341. }
  342. .site{
  343. width: 690rpx;
  344. height: 80rpx;
  345. background: #FFFFFF;
  346. display: flex;
  347. justify-content: flex-start;
  348. align-items: center;
  349. border-radius: 20rpx 20rpx 20rpx 20rpx;
  350. margin:20rpx 30rpx;
  351. >img{
  352. width: 30rpx;
  353. height: 30rpx;
  354. margin-right: 22rpx;
  355. margin-left: 30rpx;
  356. }
  357. >text:nth-of-type(1){
  358. font-size: 28rpx;
  359. font-family: PingFang SC-Medium, PingFang SC;
  360. font-weight: 400;
  361. color: #333333;
  362. line-height: 28rpx;
  363. }
  364. >text:nth-of-type(2){
  365. display: inline-block;
  366. width: 2rpx;
  367. height: 20rpx;
  368. background: #E0E0E0;
  369. margin: 0 24rpx 0 28rpx;
  370. }
  371. >text:nth-of-type(3){
  372. font-size: 28rpx;
  373. font-family: PingFang SC-Medium, PingFang SC;
  374. font-weight: 400;
  375. color: #333333;
  376. line-height: 28rpx;
  377. }
  378. }
  379. .site_tow{
  380. width: 690rpx;
  381. height: 170rpx;
  382. background: #FFFFFF;
  383. border-radius: 20rpx 20rpx 20rpx 20rpx;
  384. margin:20rpx 30rpx;
  385. overflow: hidden;
  386. .site_tow_t{
  387. height: 40rpx;
  388. display: flex;
  389. justify-content: flex-start;
  390. align-items: center;
  391. margin-top: 32rpx;
  392. >img{
  393. width: 30rpx;
  394. height: 30rpx;
  395. margin-right: 22rpx;
  396. margin-left: 30rpx;
  397. }
  398. >text:nth-of-type(1){
  399. font-size: 28rpx;
  400. font-family: PingFang SC-Medium, PingFang SC;
  401. font-weight: 400;
  402. color: #333333;
  403. line-height: 28rpx;
  404. }
  405. }
  406. .site_tow_b{
  407. height: 40rpx;
  408. display: flex;
  409. justify-content: flex-start;
  410. align-items: center;
  411. margin-top: 20rpx;
  412. >img{
  413. width: 30rpx;
  414. height: 30rpx;
  415. margin-right: 22rpx;
  416. margin-left: 30rpx;
  417. }
  418. >text:nth-of-type(1){
  419. font-size: 28rpx;
  420. font-family: PingFang SC-Medium, PingFang SC;
  421. font-weight: 400;
  422. color: #333333;
  423. line-height: 28rpx;
  424. }
  425. >text:nth-of-type(2){
  426. display: inline-block;
  427. width: 2rpx;
  428. height: 20rpx;
  429. background: #E0E0E0;
  430. margin: 0 24rpx 0 28rpx;
  431. }
  432. >text:nth-of-type(3){
  433. font-size: 28rpx;
  434. font-family: PingFang SC-Medium, PingFang SC;
  435. font-weight: 400;
  436. color: #333333;
  437. line-height: 28rpx;
  438. }
  439. }
  440. }
  441. .small_title{
  442. height: 90rpx;
  443. display: flex;
  444. justify-content: flex-start;
  445. align-items: center;
  446. border-bottom: 1rpx solid #E0E0E0;
  447. >text:nth-of-type(1){
  448. display: inline-block;
  449. width: 4rpx;
  450. height: 30rpx;
  451. background: #0183FA;
  452. margin: 0 22rpx 0 28rpx;
  453. }
  454. >text:nth-of-type(1){
  455. font-size: 30rpx;
  456. font-family: PingFang SC-Medium, PingFang SC;
  457. font-weight: 400;
  458. color: #333333;
  459. line-height: 30rpx;
  460. }
  461. }
  462. .basics{
  463. margin-left: 30rpx;
  464. width: 690rpx;
  465. height: auto;
  466. background: #FFFFFF;
  467. border-radius: 20rpx 20rpx 20rpx 20rpx;
  468. padding-bottom: 16rpx;
  469. box-sizing: border-box;
  470. .basics_li{
  471. display: flex;
  472. justify-content: space-between;
  473. margin: 0 30rpx;
  474. >text:nth-of-type(1){
  475. font-size: 28rpx;
  476. font-family: PingFang SC-Medium, PingFang SC;
  477. font-weight: 400;
  478. color: #333333;
  479. line-height: 60rpx;
  480. }
  481. >text:nth-of-type(2){
  482. font-size: 28rpx;
  483. font-family: PingFang SC-Medium, PingFang SC;
  484. font-weight: 400;
  485. color: #333333;
  486. line-height: 60rpx;
  487. flex: 1;
  488. text-align: right;
  489. }
  490. }
  491. }
  492. .note{
  493. margin-left: 30rpx;
  494. margin-top: 20rpx;
  495. width: 690rpx;
  496. height: auto;
  497. background: #FFFFFF;
  498. border-radius: 20rpx 20rpx 20rpx 20rpx;
  499. padding-bottom: 16rpx;
  500. box-sizing: border-box;
  501. .note_li{
  502. display: flex;
  503. justify-content: space-between;
  504. margin: 0 30rpx;
  505. >text:nth-of-type(1){
  506. font-size: 28rpx;
  507. font-family: PingFang SC-Medium, PingFang SC;
  508. font-weight: 400;
  509. color: #333333;
  510. line-height: 60rpx;
  511. }
  512. .note_li_r{
  513. display: flex;
  514. justify-content: flex-start;
  515. align-items: center;
  516. >img{
  517. width: 28rpx;
  518. height: 28rpx;
  519. margin-right: 10rpx;
  520. }
  521. font-size: 28rpx;
  522. font-family: PingFang SC-Medium, PingFang SC;
  523. font-weight: 400;
  524. color: #0183FA;
  525. line-height: 60rpx;
  526. }
  527. }
  528. }
  529. .picture{
  530. margin-left: 30rpx;
  531. width: 690rpx;
  532. height: auto;
  533. background: #FFFFFF;
  534. border-radius: 20rpx 20rpx 20rpx 20rpx;
  535. margin-top: 20rpx;
  536. .picture_b{
  537. display: flex;
  538. justify-content: flex-start;
  539. flex-wrap: wrap;
  540. padding: 40rpx 30rpx 10rpx;
  541. box-sizing: border-box;
  542. .video{
  543. position: relative;
  544. width: 150rpx;
  545. height: 150rpx;
  546. border-radius: 10rpx 10rpx 10rpx 10rpx;
  547. margin-right: 38rpx;
  548. margin-bottom: 10rpx;
  549. .video_t{
  550. width: 150rpx;
  551. height: 150rpx;
  552. border-radius: 10rpx 10rpx 10rpx 10rpx;
  553. position: absolute;
  554. }
  555. .video_b{
  556. width: 40rpx;
  557. height: 40rpx;
  558. position: absolute;
  559. left: 55rpx;
  560. top: 55rpx;
  561. }
  562. }
  563. }
  564. }
  565. .bottom_btn{
  566. width: 690rpx;
  567. height: 90rpx;
  568. border-radius: 10rpx 10rpx 10rpx 10rpx;
  569. opacity: 1;
  570. border: 1rpx solid #0183FA;
  571. font-size: 30rpx;
  572. font-family: PingFang SC-Medium, PingFang SC;
  573. font-weight: 400;
  574. color: #0183FA;
  575. line-height: 90rpx;
  576. text-align: center;
  577. background: #F5F5F5;
  578. margin: 90rpx 30rpx 30rpx;
  579. }
  580. }
  581. </style>