平安校园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

690 lines
15 KiB

  1. <template>
  2. <view class="warningBox">
  3. <!-- 头部背景 -->
  4. <view class="headerBox">
  5. <image :src="modelObj.backgroundImg"></image>
  6. <view class="selectModel" @click="showSelectModel = true">
  7. <view class="modelName">
  8. {{modelObj.name}}
  9. </view>
  10. <image src="@/static/image/earlyWarning/down.png"></image>
  11. </view>
  12. <u-popup :show="showSelectModel" @close="close" @open="open" mode="top">
  13. <view class="selectPopupBox">
  14. <view class="modelLi" :class="item.id == isActive ? 'active' : ''" @click="modelChange(item)"
  15. v-for="(item,i) in modelList">
  16. {{item.name}}
  17. </view>
  18. </view>
  19. </u-popup>
  20. </view>
  21. <view class="contentBox" v-if="isActive == '1'">
  22. <view class="searchBox">
  23. <view class="searchLine">
  24. <view class="leftSearchBox">
  25. <view class="searchLabel">
  26. 筛选条件:
  27. </view>
  28. <view class="searchValue">
  29. 111111111111111111111111111111111111111111111111111111111111111111111111
  30. </view>
  31. </view>
  32. <view class="searchShow" @click="openSearch">
  33. <image v-show="isShowSearch==false" style="width:20px;height:20px;"
  34. src="@/static/image/earlyWarning/screen.png" mode="">
  35. </image>
  36. <image v-show="isShowSearch" style="width:20px;height:20px;"
  37. src="@/static/image/earlyWarning/screenActive.png" mode="">
  38. </image>
  39. </view>
  40. </view>
  41. <view @click="isShowSearch=false" class="searchDialog" v-if="isShowSearch">
  42. <view class="content" @click.stop="isSelect">
  43. <u-row justify="space-between" gutter="10">
  44. <u-col span="7">
  45. <view class="demo-layout" @click="toOpen">
  46. <view class="left-layout">
  47. <text>{{searchForm.alarmType}}</text>
  48. </view>
  49. <view class="right-layout">
  50. <image style="width: 30rpx;height:30rpx;"
  51. src="@/static/image/earlyWarning/arrowRight.png" mode=""></image>
  52. </view>
  53. </view>
  54. <!-- <jp-select-plus ref="selectPlus" :isShow="false" color="#2388FF" placeholder="请选择"
  55. isSearch v-model="va3" :list="listc"></jp-select-plus> -->
  56. </u-col>
  57. <u-col span="5">
  58. <view class="demo-layout">
  59. <view class="left-layout">
  60. <text>{{searchForm.warnHand}}</text>
  61. </view>
  62. <view class="right-layout">
  63. <image style="width: 30rpx;height:30rpx;"
  64. src="@/static/image/earlyWarning/arrowRight.png" mode=""></image>
  65. </view>
  66. </view>
  67. </u-col>
  68. </u-row>
  69. <u-row style="margin-top:10px;" justify="space-between" gutter="10">
  70. <u-col span="12">
  71. <uni-datetime-picker v-model="searchForm.tick" type="datetimerange">
  72. <view class="demo-layout">
  73. <view class="startBox">
  74. {{searchForm.StartTick}}
  75. </view>
  76. <text>至</text>
  77. <view class="endBox">
  78. {{searchForm.EndTick}}
  79. </view>
  80. <view class="timeIcon">
  81. <image style="width: 30rpx;height:30rpx;"
  82. src="@/static/image/earlyWarning/calendar.png" mode=""></image>
  83. </view>
  84. </view>
  85. </uni-datetime-picker>
  86. </u-col>
  87. </u-row>
  88. <view class="btnBox">
  89. <view class="leftBtn">
  90. 重置
  91. </view>
  92. <view class="rightBtn">
  93. 确认
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <view class="tableBox">
  100. <u-empty marginTop="100rpx" :show="false" mode="warnList" text="暂无数据"></u-empty>
  101. <u-list @scrolltolower="scrolltolower" style="height: calc(100% - 0rpx);">
  102. <u-list-item v-for="(item, index) in warnList" :key="index">
  103. <view class="liBox">
  104. <view class="topCard">
  105. <view class="pic">
  106. <image src="@/static/image/earlyWarning/warnBack.png" mode=""></image>
  107. </view>
  108. <view class="rightCard">
  109. <view class="firstCard">
  110. <view class="schoolName">
  111. 学校名称学校名称学校名称学校名称
  112. </view>
  113. <view class="statusBox" :class="[item.warnHand == 1?'handle':'nohandle']">
  114. {{item.warnHand == 1 ? '已处理' : '未处理'}}
  115. </view>
  116. </view>
  117. <view class="secondCard">
  118. <image style="width: 30rpx;height: 30rpx;"
  119. src="@/static/image/earlyWarning/warnType.png" mode=""></image>
  120. <view class="txt">
  121. 警告类型:周界入侵
  122. </view>
  123. </view>
  124. <view class="thirdCard">
  125. <image style="width: 30rpx;height: 30rpx;"
  126. src="@/static/image/earlyWarning/warnVideo.png" mode=""></image>
  127. <view class="txt">
  128. 警告摄像头:厨房(良景)
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. <view class="midCard">
  134. <u-row>
  135. <u-col span="6">
  136. <view class="midContent">
  137. 姓名:杨云
  138. </view>
  139. </u-col>
  140. <u-col span="6">
  141. <view class="midContent">
  142. 系部:安环部
  143. </view>
  144. </u-col>
  145. </u-row>
  146. <u-row>
  147. <u-col span="6">
  148. <view class="midContent">
  149. 专业:环艺
  150. </view>
  151. </u-col>
  152. <u-col span="6">
  153. <view class="midContent">
  154. 班级:第二班
  155. </view>
  156. </u-col>
  157. </u-row>
  158. <u-row>
  159. <u-col span="12">
  160. <view class="midContent">
  161. 时间:2024-08-15 11:59:12
  162. </view>
  163. </u-col>
  164. </u-row>
  165. </view>
  166. <view class="btoCard">
  167. <view class="leftBox btoBox">
  168. <image src="@/static/image/earlyWarning/detail.png" mode=""></image>
  169. <view class="txt">
  170. 查看
  171. </view>
  172. </view>
  173. <view class="midBox btoBox">
  174. <image v-if="item.warnHand == 1" src="@/static/image/earlyWarning/handle.png"
  175. mode=""></image>
  176. <image v-if="item.warnHand == 0"
  177. src="@/static/image/earlyWarning/handleDisabled.png" mode=""></image>
  178. <view :class="[item.warnHand == 1?'txt':'disabled']">
  179. 处理
  180. </view>
  181. </view>
  182. <view class="rightBox btoBox">
  183. <image src="@/static/image/earlyWarning/delete.png" mode=""></image>
  184. <view class="txt">
  185. 删除
  186. </view>
  187. </view>
  188. </view>
  189. </view>
  190. </u-list-item>
  191. <u-loadmore :status="status" />
  192. </u-list>
  193. </view>
  194. </view>
  195. </view>
  196. </template>
  197. <script>
  198. export default {
  199. data() {
  200. return {
  201. searchForm: {
  202. alarmType: '警告类型',
  203. warnHand: '处理状态',
  204. tick: [],
  205. StartTick: '开始时间',
  206. EndTick: '结束时间',
  207. },
  208. showSelectModel: false,
  209. modelObj: {
  210. name: '预警信息',
  211. backgroundImg: require(`@/static/image/earlyWarning/warnBack.png`)
  212. },
  213. isActive: '1',
  214. modelList: [{
  215. id: '1',
  216. name: '预警信息',
  217. imgUrl: require(`@/static/image/earlyWarning/warnBack.png`)
  218. },
  219. {
  220. id: '2',
  221. name: '巡检中心',
  222. imgUrl: require(`@/static/image/earlyWarning/majorBack.png`)
  223. }
  224. ],
  225. isShowSearch: false,
  226. warnList: [{
  227. warnHand: 0
  228. }, {}, {}, {}, {}, {}, {}, {}, {}, ],
  229. isLoading: false,
  230. status: 'loadmore', //loading正在加载 loadmore加载更多 nomore没有更多了
  231. listc: [{
  232. code: 1,
  233. name: 'dasda'
  234. }, {
  235. code: 2,
  236. name: 'dasda'
  237. },
  238. {
  239. code: 3,
  240. name: 'dasda'
  241. },
  242. {
  243. code: 4,
  244. name: 'dasda'
  245. },
  246. {
  247. code: 5,
  248. name: 'dasda'
  249. },
  250. {
  251. code: 6,
  252. name: 'dasda'
  253. },
  254. {
  255. code: 7,
  256. name: 'dasda'
  257. },
  258. {
  259. code: 8,
  260. name: 'dasda'
  261. },
  262. {
  263. code: 9,
  264. name: 'dasda'
  265. },
  266. {
  267. code: 10,
  268. name: 'dasda'
  269. },
  270. {
  271. code: 11,
  272. name: 'dasda'
  273. },
  274. {
  275. code: 12,
  276. name: 'dasda'
  277. },
  278. {
  279. code: 13,
  280. name: '你好'
  281. }
  282. ]
  283. }
  284. },
  285. watch: {
  286. "searchForm.tick"() {
  287. console.log('日期时间:', this.searchForm.tick);
  288. if(this.searchForm.tick && this.searchForm.tick.length>0) {
  289. this.searchForm.StartTick = this.searchForm.tick[0]
  290. this.searchForm.EndTick = this.searchForm.tick[1]
  291. }
  292. },
  293. },
  294. filters: {
  295. // statusChange(val) {
  296. // switch (val) {
  297. // case 'todo':
  298. // return '我的待办'
  299. // break;
  300. // case 'send':
  301. // return '由我发起'
  302. // break;
  303. // case 'done':
  304. // return '我的已办'
  305. // break;
  306. // default:
  307. // }
  308. // },
  309. },
  310. onLoad() {
  311. // 隐藏导航栏
  312. this.loadmore()
  313. },
  314. methods: {
  315. toOpen() {
  316. this.$refs.selectPlus.open()
  317. },
  318. open() {
  319. // console.log('open');
  320. },
  321. close() {
  322. this.showSelectModel = false;
  323. // console.log('close');
  324. },
  325. // 切换模块
  326. modelChange(item) {
  327. console.log(item)
  328. this.modelObj.name = item.name;
  329. this.modelObj.backgroundImg = item.imgUrl;
  330. this.isActive = item.id;
  331. this.showSelectModel = false;
  332. // switch (item.id) {
  333. // case '1':
  334. // break;
  335. // case '2':
  336. // break;
  337. // default:
  338. // break;
  339. // }
  340. },
  341. // 打开筛选框
  342. openSearch() {
  343. this.isShowSearch = !this.isShowSearch;
  344. },
  345. isSelect() {
  346. },
  347. scrolltolower() {
  348. this.loadmore()
  349. },
  350. loadmore() {
  351. if (this.status != 'loadmore') return
  352. this.status = 'loading'
  353. setTimeout(() => {
  354. for (let i = 0; i < 1; i++) {
  355. this.warnList.push({}, {})
  356. }
  357. // 获取到的总条数>=接口总条数
  358. if (this.warnList.length >= 14) {
  359. this.status = 'nomore'
  360. } else {
  361. this.status = 'loadmore'
  362. }
  363. }, 2000)
  364. }
  365. }
  366. }
  367. </script>
  368. <style lang="scss" scoped>
  369. .warningBox {
  370. height: 100%;
  371. .headerBox {
  372. height: 380rpx;
  373. // background: url("@/static/image/earlyWarning/warnBack.png") no-repeat center center / cover;
  374. position: relative;
  375. image {
  376. width: 100%;
  377. height: 100%;
  378. }
  379. .selectModel {
  380. position: absolute;
  381. left: 60rpx;
  382. top: 108rpx;
  383. display: flex;
  384. justify-content: center;
  385. align-items: center;
  386. .modelName {
  387. font-size: 34rpx;
  388. color: #fff;
  389. font-family: PingFang SC;
  390. margin-right: 20rpx;
  391. }
  392. image {
  393. width: 24rpx;
  394. height: 12rpx;
  395. }
  396. }
  397. .selectPopupBox {
  398. padding: 0 10px;
  399. box-sizing: border-box;
  400. .modelLi {
  401. height: 100rpx;
  402. line-height: 100rpx;
  403. text-align: center;
  404. border-bottom: 1px solid #efecec;
  405. }
  406. .active {
  407. color: rgb(35, 136, 255);
  408. }
  409. }
  410. }
  411. .contentBox {
  412. height: calc(100% - 375rpx);
  413. .searchBox {
  414. // height: calc(100% - 360rpx);
  415. position: relative;
  416. .searchLine {
  417. height: 88rpx;
  418. display: flex;
  419. justify-content: space-between;
  420. align-items: center;
  421. padding: 0 15px;
  422. box-sizing: border-box;
  423. background: #fff;
  424. .leftSearchBox {
  425. display: flex;
  426. align-items: center;
  427. width: calc(100% - 40px);
  428. .searchLabel {
  429. flex-shrink: 1;
  430. color: #333333;
  431. width: 80px;
  432. }
  433. .searchValue {
  434. width: calc(100% - 60px);
  435. margin-left: 10px;
  436. color: #2388FF;
  437. overflow: hidden;
  438. word-wrap: break-word;
  439. white-space: pre-wrap;
  440. // font-size: 14px;
  441. display: -webkit-box;
  442. -webkit-box-orient: vertical;
  443. -webkit-line-clamp: 1;
  444. }
  445. }
  446. }
  447. .searchDialog {
  448. position: absolute;
  449. z-index: 990;
  450. top: 89rpx;
  451. width: 100%;
  452. height: calc(100vh - 375rpx - 100rpx);
  453. font-size: 26rpx;
  454. background: rgba(0, 0, 0, 0.2);
  455. .content {
  456. background: #FFFFFF;
  457. padding: 15px;
  458. box-sizing: border-box;
  459. .demo-layout {
  460. height: 80rpx;
  461. border-radius: 8rpx;
  462. background: #F5F5F5;
  463. display: flex;
  464. justify-content: space-between;
  465. align-items: center;
  466. padding: 0 10px;
  467. box-sizing: border-box;
  468. .left-layout {
  469. color: #777777;
  470. }
  471. .right-layout {}
  472. .startBox {
  473. color: #777777;
  474. }
  475. text {
  476. color: #777777;
  477. }
  478. .endBox {
  479. color: #777777;
  480. }
  481. .timeIcon {}
  482. }
  483. }
  484. .btnBox {
  485. display: flex;
  486. align-items: center;
  487. margin-top: 15px;
  488. .leftBtn {
  489. width: 50%;
  490. height: 74rpx;
  491. line-height: 74rpx;
  492. border: 1px solid #BABABA;
  493. border-radius: 12rpx;
  494. color: #333333;
  495. text-align: center;
  496. }
  497. .rightBtn {
  498. width: 50%;
  499. height: 74rpx;
  500. line-height: 74rpx;
  501. border: 1px solid #2388FF;
  502. border-radius: 12rpx;
  503. color: #fff;
  504. text-align: center;
  505. background: #2388FF;
  506. margin-left: 15rpx;
  507. }
  508. }
  509. }
  510. }
  511. .tableBox {
  512. height: 100%;
  513. padding: 10px;
  514. box-sizing: border-box;
  515. // height: 600px;
  516. padding-bottom: 50px;
  517. .liBox {
  518. background: #fff;
  519. padding: 20px 15px;
  520. box-sizing: border-box;
  521. border-radius: 20px;
  522. margin-bottom: 10px;
  523. .topCard {
  524. display: flex;
  525. .pic {
  526. image {
  527. width: 160rpx;
  528. height: 160rpx;
  529. border-radius: 4px;
  530. }
  531. }
  532. .rightCard {
  533. margin-left: 20rpx;
  534. .firstCard {
  535. display: flex;
  536. justify-content: space-between;
  537. align-items: center;
  538. margin-bottom: 20rpx;
  539. .schoolName {
  540. font-size: 32rpx;
  541. color: #333333;
  542. overflow: hidden;
  543. word-wrap: break-word;
  544. white-space: pre-wrap;
  545. // font-size: 14px;
  546. display: -webkit-box;
  547. -webkit-box-orient: vertical;
  548. -webkit-line-clamp: 1;
  549. }
  550. .statusBox {
  551. width: 140rpx;
  552. flex-shrink: 1;
  553. text-align: center;
  554. height: 50rpx;
  555. line-height: 50rpx;
  556. font-size: 28rpx;
  557. border-radius: 8rpx;
  558. color: #fff;
  559. }
  560. .handle {
  561. background: rgba(15, 175, 118, 0.1);
  562. color: #0FAF76;
  563. }
  564. .nohandle {
  565. background: rgba(239, 45, 45, 0.1);
  566. color: rgba(239, 45, 45, 1);
  567. }
  568. }
  569. .secondCard,
  570. .thirdCard {
  571. display: flex;
  572. align-items: center;
  573. margin-top: 18rpx;
  574. .txt {
  575. font-size: 28rpx;
  576. margin-left: 10rpx;
  577. color: #333333;
  578. }
  579. }
  580. }
  581. }
  582. .midCard {
  583. font-size: 28rpx;
  584. .midContent {
  585. margin-top: 18rpx;
  586. }
  587. }
  588. .btoCard {
  589. border-top: 1px solid rgba(0, 0, 0, 0.1);
  590. margin-top: 30rpx;
  591. padding: 18px 0 0 0;
  592. display: flex;
  593. justify-content: center;
  594. align-items: center;
  595. .btoBox {
  596. width: 33.3%;
  597. display: flex;
  598. justify-content: center;
  599. align-items: center;
  600. position: relative;
  601. image {
  602. width: 40rpx;
  603. height: 40rpx;
  604. margin-right: 15rpx;
  605. }
  606. }
  607. .btoBox:not(:last-child)::before {
  608. content: '';
  609. display: block;
  610. width: 1px;
  611. height: 100%;
  612. background: rgba(0, 0, 0, 0.1);
  613. position: absolute;
  614. right: 0px;
  615. }
  616. .midBox {
  617. .txt {
  618. color: #333333;
  619. }
  620. .disabled {
  621. color: #777777;
  622. }
  623. }
  624. }
  625. }
  626. }
  627. }
  628. }
  629. </style>