平安校园
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

798 líneas
19 KiB

  1. <template>
  2. <view class="warningBox">
  3. <!-- 头部背景 -->
  4. <view class="headerBox">
  5. <!-- <view class="">
  6. <image src="@/static/image/earlyWarning/back.png" mode="aspectFill"></image>
  7. </view> -->
  8. <view class="logo">
  9. <image :src="logo" mode="heightFix"></image>
  10. </view>
  11. <view class="logoTitle">
  12. {{title}}
  13. </view>
  14. </view>
  15. <view class="contentBox">
  16. <view class="warningInfo">
  17. <view class="searchBox">
  18. <view class="searchLine" @click="openSearch">
  19. <view class="searchLabels">
  20. <image v-show="isShowSearch==false" src="@/static/image/earlyWarning/screen.png" mode="">
  21. </image>
  22. <image v-show="isShowSearch" src="@/static/image/earlyWarning/screenActive.png" mode="">
  23. </image>
  24. <text class="labels">筛选</text>
  25. <view class="values">{{searchValue}}</view>
  26. </view>
  27. <view class="arrow">
  28. <image v-show="isShowSearch==false" src="@/static/image/earlyWarning/arrow1.png" mode="">
  29. </image>
  30. <image v-show="isShowSearch" src="@/static/image/earlyWarning/arrow2.png" mode=""></image>
  31. </view>
  32. </view>
  33. <view @click="isShowSearch=false" class="searchDialog" v-if="isShowSearch">
  34. <view class="content" @click.stop="isSelect">
  35. <u-row justify="space-between" gutter="10">
  36. <u-col span="7">
  37. <view class="demo-layout" @click="toOpen">
  38. <view class="left-layout">
  39. <text>{{searchForm.$alarmType || '预警类型'}}</text>
  40. </view>
  41. <view class="right-layout">
  42. <image style="width: 30rpx;height:30rpx;"
  43. src="@/static/image/earlyWarning/arrowRight.png" mode=""></image>
  44. </view>
  45. </view>
  46. </u-col>
  47. <u-col span="5">
  48. <view class="demo-layout" @click="toOpenSelect">
  49. <view class="left-layout">
  50. <text>{{searchForm.$warnHand || '处理状态'}}</text>
  51. </view>
  52. <view class="right-layout">
  53. <image style="width: 30rpx;height:30rpx;"
  54. src="@/static/image/earlyWarning/arrowRight.png" mode=""></image>
  55. </view>
  56. </view>
  57. </u-col>
  58. </u-row>
  59. <u-row style="margin-top:10px;" justify="space-between" gutter="10">
  60. <u-col span="12">
  61. <view class="demo-layout" @click="toOpenmanjor">
  62. <view class="left-layout">
  63. <text>{{searchForm.$cameraId || '预警摄像头'}}</text>
  64. </view>
  65. <view class="right-layout">
  66. <image style="width: 30rpx;height:30rpx;"
  67. src="@/static/image/earlyWarning/arrowRight.png" mode=""></image>
  68. </view>
  69. </view>
  70. </u-col>
  71. </u-row>
  72. <u-row style="margin-top:10px;" justify="space-between" gutter="10">
  73. <u-col span="12">
  74. <uni-datetime-picker v-model="searchForm.tick" type="datetimerange">
  75. <view class="demo-layout">
  76. <view class="startBox">
  77. {{searchForm.StartTick || '开始时间'}}
  78. </view>
  79. <text>至</text>
  80. <view class="endBox">
  81. {{searchForm.EndTick || '结束时间'}}
  82. </view>
  83. <view class="timeIcon">
  84. <image style="width: 30rpx;height:30rpx;"
  85. src="@/static/image/earlyWarning/calendar.png" mode=""></image>
  86. </view>
  87. </view>
  88. </uni-datetime-picker>
  89. </u-col>
  90. </u-row>
  91. <view class="btnBox">
  92. <view class="leftBtn" @click="clearform">
  93. 重置
  94. </view>
  95. <view class="rightBtn" @click="onsubmit">
  96. 确认
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="tableBox">
  103. <u-empty marginTop="100rpx" :show="warnList.length == 0&&status == 'nomore'" mode="list"
  104. text="暂无数据"></u-empty>
  105. <!-- <u-pull-refresh :refreshing="refreshing" @refresh="onRefresh"> -->
  106. <!-- <scroll-view class="scroll-view" scroll-y="true" refresher-enabled="true"
  107. @refresher-pull="onRefresh" @refresher-refresh="doRefresh" @refresher-restore="restore"
  108. @refresher-abort="abort"> -->
  109. <u-list :loading="isLoading" refresher-enabled :refresher-triggered="isTriggered"
  110. @refresher-pull="onRefresh" @scrolltolower="scrolltolower" style="height: calc(100% - 0rpx);">
  111. <u-list-item v-for="(item, index) in warnList" :key="index">
  112. <view class="liBox">
  113. <view class="headerCard">
  114. <view class="schoolName">
  115. {{item.sceneName || '--'}}
  116. </view>
  117. <view class="statusBox" :class="[item.warnHand == 1?'handle':'nohandle']">
  118. {{item.warnHand == 1 ? '已处理' : '未处理'}}
  119. </view>
  120. </view>
  121. <view class="topCard">
  122. <view class="pic">
  123. <image :src="item.snapshotUrl" mode="aspectFill"
  124. @click="previewImage(item.snapshotUrl,index)"></image>
  125. </view>
  126. <view class="rightCard">
  127. <u-row>
  128. <u-col span="6">
  129. <view class="midContent">
  130. 姓名:{{item.personName || '--'}}
  131. </view>
  132. </u-col>
  133. <u-col span="6">
  134. <view class="midContent">
  135. 系部:{{item.majorName || '--'}}
  136. </view>
  137. </u-col>
  138. </u-row>
  139. <u-row style="margin-top: 20rpx;">
  140. <u-col span="6">
  141. <view class="midContent">
  142. 专业:{{item.depName || '--'}}
  143. </view>
  144. </u-col>
  145. <u-col span="6">
  146. <view class="midContent">
  147. 班级:{{item.personSetName || '--'}}
  148. </view>
  149. </u-col>
  150. </u-row>
  151. </view>
  152. </view>
  153. <view class="midCard">
  154. <view class="secondCard">
  155. <image style="width: 30rpx;height: 30rpx;"
  156. src="@/static/image/earlyWarning/warnType.png" mode=""></image>
  157. <view class="txt">
  158. 预警类型:{{item.alarmTypeDesc || '--'}}
  159. </view>
  160. </view>
  161. <view class="thirdCard">
  162. <image style="width: 30rpx;height: 30rpx;"
  163. src="@/static/image/earlyWarning/warnVideo.png" mode=""></image>
  164. <view class="txt">
  165. 预警摄像头:{{item.cameraName || '--'}}
  166. </view>
  167. </view>
  168. </view>
  169. <view class="btoCard">
  170. <view class="btoContent">
  171. 预警时间:{{item.tick}}
  172. </view>
  173. <view class="rightBox btoBox" @click="toDetail(item)">
  174. <view class="txt">
  175. 查看
  176. </view>
  177. </view>
  178. </view>
  179. </view>
  180. </u-list-item>
  181. <u-loadmore :status="status" />
  182. </u-list>
  183. <!-- </scroll-view> -->
  184. <!-- </u-pull-refresh> -->
  185. </view>
  186. <selectSearch ref="selectSearchBox" :cellVisible="false" v-model="searchForm.alarmType"
  187. :options="warnOption" :title.sync="searchForm.$alarmType" placeholder="预警类型"
  188. search-placeholder="预警类型" />
  189. <selectSearch ref="selectmanjorBox" :cellVisible="false" v-model="searchForm.cameraId"
  190. :options="[{value:'',label:'全部'},...allOptions.monitorList]" :title.sync="searchForm.$cameraId" placeholder="预警摄像头"
  191. search-placeholder="预警摄像头" />
  192. <selectRadio ref="selectRadioBox" :cellVisible="false" v-model="searchForm.warnHand"
  193. :options="handOption" :title.sync="searchForm.$warnHand" placeholder="处理状态" />
  194. </view>
  195. </view>
  196. </view>
  197. </template>
  198. <script>
  199. import selectRadio from "@/components/selectRadio.vue"
  200. import selectSearch from "@/components/selectSearch.vue"
  201. import {
  202. page, //获取列表
  203. warnType, //获取预警类型
  204. } from '@/api/warn/index.js'
  205. export default {
  206. components: {
  207. selectRadio,
  208. selectSearch
  209. },
  210. data() {
  211. return {
  212. title: '',
  213. logo: '',
  214. searchValue: '全部',
  215. isShowSearch: false,
  216. isTriggered: true,
  217. searchForm: {
  218. alarmType: '',
  219. $alarmType: '全部',
  220. warnHand: '',
  221. $warnHand: '',
  222. cameraId: '',
  223. $cameraId: '',
  224. tick: [],
  225. StartTick: '',
  226. EndTick: '',
  227. pageNum: 1,
  228. pageSize: 10
  229. },
  230. warnOption: [{
  231. label: '全部',
  232. value: ''
  233. }],
  234. creamaData: [],
  235. handOption: [{
  236. label: '已处理',
  237. value: 1
  238. },
  239. {
  240. label: '未处理',
  241. value: 0
  242. },
  243. ],
  244. warnList: [],
  245. isLoading: false,
  246. finished: false,
  247. refreshing: false,
  248. status: 'loadmore', //loading正在加载 loadmore加载更多 nomore没有更多了
  249. }
  250. },
  251. watch: {
  252. "searchForm.tick"() {
  253. console.log('日期时间:', this.searchForm.tick);
  254. if (this.searchForm.tick && this.searchForm.tick.length > 0) {
  255. this.searchForm.StartTick = this.searchForm.tick[0]
  256. this.searchForm.EndTick = this.searchForm.tick[1]
  257. }
  258. },
  259. },
  260. onLoad() {
  261. // console.log(this.sysInfo,111)
  262. // 获取logo和平台名称
  263. const sysInfo = uni.getStorageSync('sysInfo');
  264. let titleObj = sysInfo.find(e=>e.configKey == 'SYS_NAME')
  265. if(titleObj)this.title = titleObj.configValue
  266. let logoObj = sysInfo.find(e=>e.configKey == 'SYS_LOGO')
  267. if(logoObj)this.logo = logoObj.configValue
  268. // 获取预警类型
  269. this.getWarnTypeList()
  270. // 隐藏导航栏
  271. this.loadmore()
  272. },
  273. onPullDownRefresh() {
  274. uni.stopPullDownRefresh()
  275. this.status = 'loadmore'
  276. this.searchForm.pageNum = 1;
  277. this.warnList = []
  278. this.loadmore()
  279. },
  280. methods: {
  281. selectChange(e) {
  282. console.log(e, 2323)
  283. },
  284. // 预览图片
  285. previewImage(url, index) {
  286. // 使用uni.previewImage API 进行图片预览
  287. uni.previewImage({
  288. current: index, // 当前显示图片索引
  289. urls: [url] // 需要预览的图片链接列表
  290. });
  291. },
  292. clearform() {
  293. this.searchForm = {
  294. alarmType: '',
  295. $alarmType: '全部',
  296. warnHand: '',
  297. $warnHand: '',
  298. cameraId: '',
  299. $cameraId: '',
  300. tick: [],
  301. StartTick: '',
  302. EndTick: '',
  303. pageNum: 1,
  304. pageSize: 10
  305. }
  306. // this.isShowSearch = false;
  307. },
  308. onsubmit() {
  309. let arr = []
  310. for (let key in this.searchForm) {
  311. if (['$alarmType','$cameraId', '$warnHand', 'StartTick', 'EndTick'].includes(key)) {
  312. if (Object.hasOwnProperty.call(this.searchForm, key) && this.searchForm[key]) {
  313. arr.push(this.searchForm[key])
  314. }
  315. }
  316. }
  317. this.searchValue = arr.join(',');
  318. this.isShowSearch = false;
  319. this.status = 'loadmore'
  320. this.searchForm.pageNum = 1;
  321. this.warnList = []
  322. this.loadmore()
  323. },
  324. // 获取预警类型
  325. getWarnTypeList() {
  326. warnType({}).then(res => {
  327. let {
  328. code,
  329. data
  330. } = res;
  331. if (code == 200) {
  332. let arr = data.map(item => {
  333. return {
  334. label: item.name,
  335. value: item.code
  336. };
  337. })
  338. this.warnOption = [...this.warnOption, ...arr]
  339. // this.warnOption.unshift({
  340. // label: '全部',
  341. // value: ''
  342. // })
  343. }
  344. });
  345. },
  346. // 获取摄像头
  347. // creamaData
  348. // 跳转详情页面
  349. toDetail(row) {
  350. uni.navigateTo({
  351. url: '/pages/earlyWarning/detail?id=' + row.id
  352. });
  353. },
  354. // 预警类型弹框筛选
  355. toOpen() {
  356. this.$refs.selectSearchBox.show = true;
  357. },
  358. // 预警摄像头弹框筛选
  359. toOpenmanjor() {
  360. this.$refs.selectmanjorBox.show = true;
  361. },
  362. // 处理情况筛选
  363. toOpenSelect() {
  364. this.$refs.selectRadioBox.show = true;
  365. },
  366. // 打开筛选框
  367. openSearch() {
  368. this.isShowSearch = !this.isShowSearch;
  369. },
  370. isSelect() {
  371. },
  372. scrolltolower() {
  373. if (this.status == 'loading' || this.status == 'nomore') {
  374. return;
  375. }
  376. this.searchForm.pageNum += 1;
  377. this.loadmore()
  378. },
  379. loadmore() {
  380. if (this.status != 'loadmore') return
  381. this.status = 'loading'
  382. this.isLoading = true;
  383. delete this.searchForm.tick
  384. page(this.searchForm).then(res => {
  385. if (res?.code === 200) {
  386. this.warnList = [...this.warnList, ...res?.data?.list];
  387. this.isLoading = false;
  388. // 获取到的总条数>=接口总条数
  389. if (this.warnList.length >= res.data.total) {
  390. this.status = 'nomore'
  391. } else {
  392. this.status = 'loadmore'
  393. }
  394. }
  395. })
  396. }
  397. }
  398. }
  399. </script>
  400. <style lang="scss" scoped>
  401. .warningBox {
  402. height: 100%;
  403. .headerBox {
  404. /*#ifdef H5*/
  405. height: 272rpx;
  406. background: url("@/static/image/earlyWarning/logoBack.png") no-repeat center center / cover;
  407. /*#endif*/
  408. /*#ifdef APP-PLUS || MP-ALIPAY || MP-WEIXIN*/
  409. height: 340rpx;
  410. background: url("@/static/image/earlyWarning/back.png") no-repeat center center / cover;
  411. /*#endif*/
  412. position: relative;
  413. image {
  414. width: 100%;
  415. height: 100%;
  416. }
  417. .logo {
  418. image {
  419. height: 46rpx;
  420. }
  421. image {
  422. height: 46rpx;
  423. }
  424. position: absolute;
  425. left: 36rpx;
  426. /*#ifdef H5*/
  427. top: 55rpx;
  428. /*#endif*/
  429. /*#ifdef APP-PLUS || MP-ALIPAY || MP-WEIXIN*/
  430. top: 110rpx;
  431. /*#endif*/
  432. }
  433. .logoTitle {
  434. position: absolute;
  435. left: 36rpx;
  436. /*#ifdef H5*/
  437. top: 150rpx;
  438. /*#endif*/
  439. /*#ifdef APP-PLUS || MP-ALIPAY || MP-WEIXIN*/
  440. top: 170rpx;
  441. /*#endif*/
  442. font-family: 'Alimama ShuHeiTi';
  443. font-weight: 700;
  444. color: #2388FF;
  445. font-size: 50rpx;
  446. letter-spacing: 6%;
  447. text-shadow: #fff 1px 0 0,#fff 0 1px 0,#fff -1px 0 0, #fff 0 -1px 0;
  448. }
  449. }
  450. .contentBox {
  451. /*#ifdef H5*/
  452. height: calc(100% - 303rpx);
  453. /*#endif*/
  454. /*#ifdef APP-PLUS || MP-ALIPAY || MP-WEIXIN*/
  455. height: calc(100% - 375rpx);
  456. /*#endif*/
  457. .warningInfo {
  458. width: 100%;
  459. height: 100%;
  460. background: #F6F8FA;
  461. .u-modal__title {
  462. color: #000000;
  463. }
  464. }
  465. .searchBox {
  466. // height: calc(100% - 360rpx);
  467. position: relative;
  468. .searchLine {
  469. height: 88rpx;
  470. display: flex;
  471. align-items: center;
  472. justify-content: space-between;
  473. padding: 0 15px;
  474. box-sizing: border-box;
  475. background: #fff;
  476. font-size: 28rpx;
  477. .searchLabels {
  478. display: flex;
  479. align-items: center;
  480. width: calc(100% - 34rpx);
  481. image {
  482. width: 40rpx;
  483. height: 40rpx;
  484. flex-shrink: 1;
  485. }
  486. .labels {
  487. width: 70rpx;
  488. display: block;
  489. color: #333333;
  490. margin-left: 10rpx;
  491. flex-shrink: 1;
  492. }
  493. .values {
  494. width: calc(100% - 40rpx - 50rpx);
  495. color: #2388FF;
  496. font-weight: 700;
  497. margin-left: 18rpx;
  498. overflow: hidden;
  499. word-wrap: break-word;
  500. white-space: pre-wrap;
  501. display: -webkit-box;
  502. -webkit-box-orient: vertical;
  503. -webkit-line-clamp: 1;
  504. }
  505. }
  506. .arrow {
  507. // text-align: right;
  508. // flex-shrink: 1;
  509. image {
  510. width: 34rpx;
  511. height: 34rpx;
  512. }
  513. }
  514. .leftSearchBox {
  515. display: flex;
  516. align-items: center;
  517. width: calc(100% - 40px);
  518. .searchLabel {
  519. flex-shrink: 1;
  520. color: #333333;
  521. width: 80px;
  522. }
  523. .searchValue {
  524. width: calc(100% - 60px);
  525. margin-left: 10px;
  526. color: #2388FF;
  527. overflow: hidden;
  528. word-wrap: break-word;
  529. white-space: pre-wrap;
  530. display: -webkit-box;
  531. -webkit-box-orient: vertical;
  532. -webkit-line-clamp: 1;
  533. }
  534. }
  535. }
  536. .searchDialog {
  537. position: absolute;
  538. z-index: 990;
  539. top: 89rpx;
  540. width: 100%;
  541. height: calc(100vh - 375rpx - 60rpx);
  542. font-size: 26rpx;
  543. background: rgba(0, 0, 0, 0.2);
  544. .content {
  545. background: #FFFFFF;
  546. padding: 15px;
  547. box-sizing: border-box;
  548. border-top: 1px solid rgba(0, 0, 0, 0.1);
  549. .demo-layout {
  550. height: 80rpx;
  551. border-radius: 8rpx;
  552. background: #F5F5F5;
  553. display: flex;
  554. justify-content: space-between;
  555. align-items: center;
  556. padding: 0 10px;
  557. box-sizing: border-box;
  558. .left-layout {
  559. color: #777777;
  560. }
  561. .right-layout {}
  562. .startBox {
  563. color: #777777;
  564. }
  565. text {
  566. color: #777777;
  567. }
  568. .endBox {
  569. color: #777777;
  570. }
  571. .timeIcon {}
  572. }
  573. }
  574. .btnBox {
  575. display: flex;
  576. align-items: center;
  577. margin-top: 15px;
  578. .leftBtn {
  579. width: 50%;
  580. height: 74rpx;
  581. line-height: 74rpx;
  582. border: 1px solid #ccc;
  583. border-radius: 12rpx;
  584. color: #333333;
  585. text-align: center;
  586. }
  587. .rightBtn {
  588. width: 50%;
  589. height: 74rpx;
  590. line-height: 74rpx;
  591. border: 1px solid #2388FF;
  592. border-radius: 12rpx;
  593. color: #fff;
  594. text-align: center;
  595. background: #2388FF;
  596. margin-left: 15rpx;
  597. }
  598. }
  599. }
  600. }
  601. .tableBox {
  602. height: 100%;
  603. padding: 30rpx;
  604. box-sizing: border-box;
  605. // height: 600px;
  606. padding-bottom: 30px;
  607. .liBox {
  608. background: #fff;
  609. padding: 0 30rpx;
  610. box-sizing: border-box;
  611. border-radius: 20rpx;
  612. margin-bottom: 30rpx;
  613. font-family: 'PingFang SC';
  614. .headerCard {
  615. display: flex;
  616. justify-content: space-between;
  617. align-items: center;
  618. padding: 24rpx 0;
  619. .schoolName {
  620. font-size: 32rpx;
  621. font-weight: 700;
  622. font-family: 'PingFang SC';
  623. color: #333333;
  624. overflow: hidden;
  625. word-wrap: break-word;
  626. white-space: pre-wrap;
  627. // font-size: 14px;
  628. display: -webkit-box;
  629. -webkit-box-orient: vertical;
  630. -webkit-line-clamp: 1;
  631. }
  632. .statusBox {
  633. width: 100rpx;
  634. flex-shrink: 1;
  635. text-align: center;
  636. font-size: 24rpx;
  637. border-radius: 8rpx;
  638. color: #fff;
  639. padding: 8rpx 12rpx;
  640. font-family: 'PingFang SC';
  641. }
  642. .handle {
  643. background: rgba(15, 175, 118, 0.1);
  644. color: #0FAF76;
  645. }
  646. .nohandle {
  647. background: rgba(239, 45, 45, 0.1);
  648. color: rgba(239, 45, 45, 1);
  649. }
  650. }
  651. .topCard {
  652. display: flex;
  653. border-top: 1px solid rgba(0, 0, 0, 0.1);
  654. align-items: center;
  655. padding: 20rpx 0;
  656. .pic {
  657. width: 120rpx;
  658. height: 120rpx;
  659. image {
  660. width: 120rpx;
  661. height: 120rpx;
  662. border-radius: 4px;
  663. }
  664. }
  665. .rightCard {
  666. margin-left: 20rpx;
  667. font-size: 26rpx;
  668. font-family: 'PingFang SC';
  669. width: calc(100% - 140rpx);
  670. .midContent {
  671. overflow: hidden;
  672. word-wrap: break-word;
  673. white-space: pre-wrap;
  674. // font-size: 14px;
  675. display: -webkit-box;
  676. -webkit-box-orient: vertical;
  677. -webkit-line-clamp: 1;
  678. }
  679. }
  680. }
  681. .midCard {
  682. font-size: 26rpx;
  683. .secondCard,
  684. .thirdCard {
  685. display: flex;
  686. align-items: center;
  687. .txt {
  688. font-size: 26rpx;
  689. font-family: 'PingFang SC';
  690. margin-left: 10rpx;
  691. color: #333333;
  692. }
  693. }
  694. .thirdCard {
  695. margin-top: 18rpx;
  696. }
  697. }
  698. .btoCard {
  699. border-top: 1px solid rgba(0, 0, 0, 0.1);
  700. margin-top: 20rpx;
  701. padding: 20rpx 0;
  702. display: flex;
  703. justify-content: space-between;
  704. align-items: center;
  705. font-size: 26rpx;
  706. font-family: 'PingFang SC';
  707. .rightBox {
  708. .txt {
  709. width: 120rpx;
  710. height: 60rpx;
  711. line-height: 60rpx;
  712. font-family: 'PingFang SC';
  713. text-align: center;
  714. background: #2388FF;
  715. color: #fff;
  716. border-radius: 80rpx;
  717. }
  718. }
  719. }
  720. }
  721. }
  722. }
  723. }
  724. </style>