earlyWarningDetail.vue 17 KB

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