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

600 lines
12 KiB

  1. <template>
  2. <view class="inspectionCenter">
  3. <view class="searchBox">
  4. <view class="searchLine">
  5. <view class="leftSearchBox">
  6. <view class="searchLabel">
  7. 筛选条件:
  8. </view>
  9. <view class="searchValue">
  10. </view>
  11. </view>
  12. <view class="searchShow" @click="openSearch">
  13. <image v-show="isShowSearch==false" style="width:20px;height:20px;"
  14. src="@/static/image/earlyWarning/screen.png" mode="">
  15. </image>
  16. <image v-show="isShowSearch" style="width:20px;height:20px;"
  17. src="@/static/image/earlyWarning/screenActive.png" mode="">
  18. </image>
  19. </view>
  20. </view>
  21. <view @click="isShowSearch=false" class="searchDialog" v-if="isShowSearch">
  22. <view class="content" @click.stop="isSelect">
  23. <u-row justify="space-between" gutter="10">
  24. <u-col span="7">
  25. <view class="demo-layout" @click="toOpen">
  26. <view class="left-layout">
  27. <text>{{searchForm.alarmType}}</text>
  28. </view>
  29. <view class="right-layout">
  30. <image style="width: 30rpx;height:30rpx;"
  31. src="@/static/image/earlyWarning/arrowRight.png" mode=""></image>
  32. </view>
  33. </view>
  34. <!-- <jp-select-plus ref="selectPlus" :isShow="false" color="#2388FF" placeholder="请选择"
  35. isSearch v-model="va3" :list="listc"></jp-select-plus> -->
  36. </u-col>
  37. <u-col span="5">
  38. <view class="demo-layout" @click="toOpenSelect">
  39. <view class="left-layout">
  40. <text>{{searchForm.warnHand}}</text>
  41. </view>
  42. <view class="right-layout">
  43. <image style="width: 30rpx;height:30rpx;"
  44. src="@/static/image/earlyWarning/arrowRight.png" mode=""></image>
  45. </view>
  46. </view>
  47. </u-col>
  48. </u-row>
  49. <u-row style="margin-top:10px;" justify="space-between" gutter="10">
  50. <u-col span="12">
  51. <uni-datetime-picker v-model="searchForm.tick" type="datetimerange">
  52. <view class="demo-layout">
  53. <view class="startBox">
  54. {{searchForm.StartTick}}
  55. </view>
  56. <text>至</text>
  57. <view class="endBox">
  58. {{searchForm.EndTick}}
  59. </view>
  60. <view class="timeIcon">
  61. <image style="width: 30rpx;height:30rpx;"
  62. src="@/static/image/earlyWarning/calendar.png" mode=""></image>
  63. </view>
  64. </view>
  65. </uni-datetime-picker>
  66. </u-col>
  67. </u-row>
  68. <view class="btnBox">
  69. <view class="leftBtn">
  70. 重置
  71. </view>
  72. <view class="rightBtn">
  73. 确认
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="tableBox">
  80. <u-empty marginTop="100rpx" :show="false" mode="warnList" text="暂无数据"></u-empty>
  81. <u-list @scrolltolower="scrolltolower" style="height: calc(100% - 0rpx);">
  82. <u-list-item v-for="(item, index) in warnList" :key="index">
  83. <view class="liBox">
  84. <view class="topCard">
  85. <view class="pic">
  86. <image src="@/static/image/earlyWarning/warnBack.png" mode="aspectFill"></image>
  87. <view class="resolvingPower">
  88. 2560*1440
  89. </view>
  90. </view>
  91. <view class="rightCard">
  92. <view class="firstCard">
  93. <view class="schoolName">
  94. 摄像头ID:SXT001
  95. </view>
  96. </view>
  97. <view class="secondCard">
  98. <view class="txt">
  99. 摄像头名称:厨房(良景)
  100. </view>
  101. </view>
  102. <view class="thirdCard">
  103. <view class="txt">
  104. 设备IP:192.168.10.130
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <view class="btoCard">
  110. <view class="leftBox btoBox">
  111. <image src="@/static/image/earlyWarning/school.png" mode=""></image>
  112. <view class="txt">
  113. 所属学校:演示学校
  114. </view>
  115. </view>
  116. <view class="rightBox btoBox" @click="deleteClick">
  117. <view class="txt">
  118. 播放
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </u-list-item>
  124. <u-loadmore :status="status" />
  125. </u-list>
  126. </view>
  127. <u-modal :show="showDelete" :title="deleteTitle" :showCancelButton="true" @confirm="confirmDelete"
  128. @cancel="cancelDelete">
  129. <view class="slot-content">
  130. <text style="text-align: center;">是否确定删除该预警吗?</text>
  131. </view>
  132. </u-modal>
  133. <selectSearch ref="selectSearchBox" :cellVisible="false" :value.sync="searchForm.alarmType"
  134. :options="[{value:1,label:'qinshi1'},{value:2,label:'qinshi2'}]" title="预警类型" search-place-holder="预警类型" />
  135. <selectRadio ref="selectRadioBox" :cellVisible="false" :value.sync="searchForm.warnHand"
  136. :options="[{value:1,label:'loudong1'},{value:2,label:'loudong2'}]" title="楼栋" />
  137. </view>
  138. </template>
  139. <script>
  140. import selectRadio from "@/components/selectRadio.vue"
  141. import selectSearch from "@/components/selectSearch.vue"
  142. export default {
  143. components: {
  144. selectRadio,
  145. selectSearch,
  146. },
  147. data() {
  148. return {
  149. showDelete: false,
  150. deleteTitle: '提示',
  151. deleteContent: '是否确定删除该预警吗?',
  152. isShowSearch: false,
  153. searchForm: {
  154. alarmType: '警告类型',
  155. warnHand: '处理状态',
  156. tick: [],
  157. StartTick: '开始时间',
  158. EndTick: '结束时间',
  159. },
  160. warnList: [{
  161. warnHand: 1
  162. }, {
  163. warnHand: 0
  164. }, {
  165. warnHand: 1
  166. }, {
  167. warnHand: 1
  168. }, {
  169. warnHand: 1
  170. }, {}, {}, {}, {}, ],
  171. isLoading: false,
  172. status: 'loadmore', //loading正在加载 loadmore加载更多 nomore没有更多了
  173. listc: [{
  174. code: 1,
  175. name: 'dasda'
  176. }, {
  177. code: 2,
  178. name: 'dasda'
  179. },
  180. {
  181. code: 3,
  182. name: 'dasda'
  183. },
  184. {
  185. code: 4,
  186. name: 'dasda'
  187. },
  188. {
  189. code: 5,
  190. name: 'dasda'
  191. },
  192. {
  193. code: 6,
  194. name: 'dasda'
  195. },
  196. {
  197. code: 7,
  198. name: 'dasda'
  199. },
  200. {
  201. code: 8,
  202. name: 'dasda'
  203. },
  204. {
  205. code: 9,
  206. name: 'dasda'
  207. },
  208. {
  209. code: 10,
  210. name: 'dasda'
  211. },
  212. {
  213. code: 11,
  214. name: 'dasda'
  215. },
  216. {
  217. code: 12,
  218. name: 'dasda'
  219. },
  220. {
  221. code: 13,
  222. name: '你好'
  223. }
  224. ]
  225. }
  226. },
  227. watch: {
  228. "searchForm.tick"() {
  229. console.log('日期时间:', this.searchForm.tick);
  230. if (this.searchForm.tick && this.searchForm.tick.length > 0) {
  231. this.searchForm.StartTick = this.searchForm.tick[0]
  232. this.searchForm.EndTick = this.searchForm.tick[1]
  233. }
  234. },
  235. },
  236. filters: {
  237. // statusChange(val) {
  238. // switch (val) {
  239. // case 'todo':
  240. // return '我的待办'
  241. // break;
  242. // case 'send':
  243. // return '由我发起'
  244. // break;
  245. // case 'done':
  246. // return '我的已办'
  247. // break;
  248. // default:
  249. // }
  250. // },
  251. },
  252. onLoad() {
  253. // 隐藏导航栏
  254. this.loadmore()
  255. },
  256. methods: {
  257. cancelDelete() {
  258. this.showDelete = false;
  259. },
  260. deleteClick() {
  261. this.showDelete = true;
  262. },
  263. confirmDelete() {
  264. this.showDelete = false;
  265. },
  266. // 跳转处理页面
  267. toHandle(row) {
  268. if (row.warnHand == 1) {
  269. uni.navigateTo({
  270. url: '/pages/earlyWarning/handlingSuggestions'
  271. });
  272. }
  273. },
  274. // 跳转详情页面
  275. toDetail(row) {
  276. uni.navigateTo({
  277. url: '/pages/earlyWarning/detail'
  278. });
  279. },
  280. // 预警类型弹框筛选
  281. toOpen() {
  282. this.$refs.selectSearchBox.show = true;
  283. },
  284. // 处理情况筛选
  285. toOpenSelect() {
  286. this.$refs.selectRadioBox.show = true;
  287. },
  288. // 打开筛选框
  289. openSearch() {
  290. this.isShowSearch = !this.isShowSearch;
  291. },
  292. isSelect() {
  293. },
  294. scrolltolower() {
  295. this.loadmore()
  296. },
  297. loadmore() {
  298. if (this.status != 'loadmore') return
  299. this.status = 'loading'
  300. setTimeout(() => {
  301. for (let i = 0; i < 1; i++) {
  302. this.warnList.push({}, {})
  303. }
  304. // 获取到的总条数>=接口总条数
  305. if (this.warnList.length >= 14) {
  306. this.status = 'nomore'
  307. } else {
  308. this.status = 'loadmore'
  309. }
  310. }, 2000)
  311. }
  312. }
  313. }
  314. </script>
  315. <style lang="scss" scoped>
  316. // .contentBox {
  317. // height: calc(100% - 375rpx);
  318. .inspectionCenter {
  319. width: 100%;
  320. height: 100%;
  321. .u-modal__title {
  322. color: #000000;
  323. }
  324. }
  325. .searchBox {
  326. // height: calc(100% - 360rpx);
  327. position: relative;
  328. .searchLine {
  329. height: 88rpx;
  330. display: flex;
  331. justify-content: space-between;
  332. align-items: center;
  333. padding: 0 15px;
  334. box-sizing: border-box;
  335. background: #fff;
  336. .leftSearchBox {
  337. display: flex;
  338. align-items: center;
  339. width: calc(100% - 40px);
  340. .searchLabel {
  341. flex-shrink: 1;
  342. color: #333333;
  343. width: 80px;
  344. }
  345. .searchValue {
  346. width: calc(100% - 60px);
  347. margin-left: 10px;
  348. color: #2388FF;
  349. overflow: hidden;
  350. word-wrap: break-word;
  351. white-space: pre-wrap;
  352. // font-size: 14px;
  353. display: -webkit-box;
  354. -webkit-box-orient: vertical;
  355. -webkit-line-clamp: 1;
  356. }
  357. }
  358. }
  359. .searchDialog {
  360. position: absolute;
  361. z-index: 990;
  362. top: 89rpx;
  363. width: 100%;
  364. height: calc(100vh - 375rpx - 100rpx);
  365. font-size: 26rpx;
  366. background: rgba(0, 0, 0, 0.2);
  367. .content {
  368. background: #FFFFFF;
  369. padding: 15px;
  370. box-sizing: border-box;
  371. .demo-layout {
  372. height: 80rpx;
  373. border-radius: 8rpx;
  374. background: #F5F5F5;
  375. display: flex;
  376. justify-content: space-between;
  377. align-items: center;
  378. padding: 0 10px;
  379. box-sizing: border-box;
  380. .left-layout {
  381. color: #777777;
  382. }
  383. .right-layout {}
  384. .startBox {
  385. color: #777777;
  386. }
  387. text {
  388. color: #777777;
  389. }
  390. .endBox {
  391. color: #777777;
  392. }
  393. .timeIcon {}
  394. }
  395. }
  396. .btnBox {
  397. display: flex;
  398. align-items: center;
  399. margin-top: 15px;
  400. .leftBtn {
  401. width: 50%;
  402. height: 74rpx;
  403. line-height: 74rpx;
  404. border: 1px solid #BABABA;
  405. border-radius: 12rpx;
  406. color: #333333;
  407. text-align: center;
  408. }
  409. .rightBtn {
  410. width: 50%;
  411. height: 74rpx;
  412. line-height: 74rpx;
  413. border: 1px solid #2388FF;
  414. border-radius: 12rpx;
  415. color: #fff;
  416. text-align: center;
  417. background: #2388FF;
  418. margin-left: 15rpx;
  419. }
  420. }
  421. }
  422. }
  423. .tableBox {
  424. height: 100%;
  425. padding: 10px;
  426. box-sizing: border-box;
  427. // height: 600px;
  428. padding-bottom: 30px;
  429. .liBox {
  430. background: #fff;
  431. padding: 20px 15px;
  432. box-sizing: border-box;
  433. border-radius: 20px;
  434. margin-bottom: 10px;
  435. .topCard {
  436. display: flex;
  437. .pic {
  438. position: relative;
  439. image {
  440. width: 310rpx;
  441. height: 220rpx;
  442. border-radius: 4px;
  443. }
  444. .resolvingPower {
  445. position: absolute;
  446. top: 15rpx;
  447. right: 15rpx;
  448. background: #000000;
  449. color: #fff;
  450. padding: 8rpx;
  451. box-sizing: border-box;
  452. font-size: 20rpx;
  453. border-radius: 4rpx;
  454. }
  455. }
  456. .rightCard {
  457. margin-left: 20rpx;
  458. margin-top: 15rpx;
  459. .firstCard {
  460. display: flex;
  461. justify-content: space-between;
  462. align-items: center;
  463. margin-bottom: 60rpx;
  464. .schoolName {
  465. font-size: 32rpx;
  466. font-weight: 700;
  467. color: #333333;
  468. overflow: hidden;
  469. word-wrap: break-word;
  470. white-space: pre-wrap;
  471. // font-size: 14px;
  472. display: -webkit-box;
  473. -webkit-box-orient: vertical;
  474. -webkit-line-clamp: 1;
  475. }
  476. .statusBox {
  477. width: 140rpx;
  478. flex-shrink: 1;
  479. text-align: center;
  480. height: 50rpx;
  481. line-height: 50rpx;
  482. font-size: 28rpx;
  483. border-radius: 8rpx;
  484. color: #fff;
  485. }
  486. .handle {
  487. background: rgba(15, 175, 118, 0.1);
  488. color: #0FAF76;
  489. }
  490. .nohandle {
  491. background: rgba(239, 45, 45, 0.1);
  492. color: rgba(239, 45, 45, 1);
  493. }
  494. }
  495. .secondCard,
  496. .thirdCard {
  497. display: flex;
  498. align-items: center;
  499. margin-top: 18rpx;
  500. .txt {
  501. font-size: 26rpx;
  502. color: #333333;
  503. }
  504. }
  505. }
  506. }
  507. .midCard {
  508. font-size: 28rpx;
  509. .midContent {
  510. margin-top: 18rpx;
  511. }
  512. }
  513. .btoCard {
  514. border-top: 1px solid rgba(0, 0, 0, 0.1);
  515. margin-top: 30rpx;
  516. padding: 18px 0 0 0;
  517. display: flex;
  518. justify-content: space-between;
  519. align-items: center;
  520. .btoBox {
  521. // width: 33.3%;
  522. display: flex;
  523. justify-content: center;
  524. align-items: center;
  525. position: relative;
  526. image {
  527. width: 40rpx;
  528. height: 40rpx;
  529. margin-right: 15rpx;
  530. }
  531. }
  532. .rightBox {
  533. width: 180rpx;
  534. height: 74rpx;
  535. background: #2388FF;
  536. color: #fff;
  537. border-radius: 80rpx;
  538. }
  539. }
  540. }
  541. }
  542. // }
  543. </style>