平安校园
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.
 
 
 
 
 
 

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