平安校园
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

761 linhas
17 KiB

  1. <template>
  2. <view @touchmove.stop@touch.stop class="inspectionCenter">
  3. <!-- <web-view v-if="showVideo" :webview-styles="styles" src="/hybrid/html/players.html"></web-view> -->
  4. <view v-show="showVideo" class="poupBox">
  5. <view class="contentBox">
  6. <!-- <web-view :webview-styles="styles" src="/hybrid/html/players.html"></web-view> -->
  7. <view id="url-player-test"></view>
  8. </view>
  9. <view class="bottom-content" @click="closeDialog">
  10. </view>
  11. </view>
  12. <view class="searchBox">
  13. <view class="searchLine" @click="showTree">
  14. <!-- <view class="searchShow"> -->
  15. <view class="searchLabels">
  16. <image v-show="isShowSearch==false" src="@/static/image/earlyWarning/group.png" mode="">
  17. </image>
  18. <image v-show="isShowSearch" src="@/static/image/earlyWarning/group2.png" mode="">
  19. </image>
  20. <text class="labels">选择分组</text>
  21. <view class="values">一号楼/厨房</view>
  22. </view>
  23. <view class="arrow">
  24. <image v-show="isShowSearch==false" src="@/static/image/earlyWarning/arrow1.png" mode="">
  25. </image>
  26. <image v-show="isShowSearch" src="@/static/image/earlyWarning/arrow2.png" mode=""></image>
  27. </view>
  28. <!-- </view> -->
  29. </view>
  30. <view @click="isShowSearch=false" class="searchDialog" v-if="isShowSearch">
  31. <view class="content" @click.stop="isSelect">
  32. <u-row justify="space-between" gutter="10">
  33. <u-col span="7">
  34. <view class="demo-layout" @click="toOpen">
  35. <view class="left-layout">
  36. <text>{{searchForm.alarmType}}</text>
  37. </view>
  38. <view class="right-layout">
  39. <image style="width: 30rpx;height:30rpx;"
  40. src="@/static/image/earlyWarning/arrowRight.png" mode=""></image>
  41. </view>
  42. </view>
  43. <!-- <jp-select-plus ref="selectPlus" :isShow="false" color="#2388FF" placeholder="请选择"
  44. isSearch v-model="va3" :list="listc"></jp-select-plus> -->
  45. </u-col>
  46. <u-col span="5">
  47. <view class="demo-layout" @click="toOpenSelect">
  48. <view class="left-layout">
  49. <text>{{searchForm.warnHand}}</text>
  50. </view>
  51. <view class="right-layout">
  52. <image style="width: 30rpx;height:30rpx;"
  53. src="@/static/image/earlyWarning/arrowRight.png" mode=""></image>
  54. </view>
  55. </view>
  56. </u-col>
  57. </u-row>
  58. <u-row style="margin-top:10px;" justify="space-between" gutter="10">
  59. <u-col span="12">
  60. <uni-datetime-picker v-model="searchForm.tick" type="datetimerange">
  61. <view class="demo-layout">
  62. <view class="startBox">
  63. {{searchForm.StartTick}}
  64. </view>
  65. <text>至</text>
  66. <view class="endBox">
  67. {{searchForm.EndTick}}
  68. </view>
  69. <view class="timeIcon">
  70. <image style="width: 30rpx;height:30rpx;"
  71. src="@/static/image/earlyWarning/calendar.png" mode=""></image>
  72. </view>
  73. </view>
  74. </uni-datetime-picker>
  75. </u-col>
  76. </u-row>
  77. <view class="btnBox">
  78. <view class="leftBtn">
  79. 重置
  80. </view>
  81. <view class="rightBtn">
  82. 确认
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. <view class="tableBox">
  89. <u-empty marginTop="100rpx" :show="false" mode="warnList" text="暂无数据"></u-empty>
  90. <u-list @scrolltolower="scrolltolower" style="height: calc(100% - 0rpx);">
  91. <u-list-item v-for="(item, index) in warnList" :key="index">
  92. <view class="liBox">
  93. <view class="topCard">
  94. <view class="pic">
  95. <image src="@/static/image/earlyWarning/warnBack.png" mode="aspectFill"></image>
  96. <view class="resolvingPower">
  97. 2560*1440
  98. </view>
  99. </view>
  100. <view class="rightCard">
  101. <view class="firstCard">
  102. <view class="schoolName">
  103. 摄像头ID:SXT001
  104. </view>
  105. </view>
  106. <view class="secondCard">
  107. <view class="txt">
  108. 摄像头名称:厨房(良景)
  109. </view>
  110. </view>
  111. <view class="thirdCard">
  112. <view class="txt">
  113. 设备IP:192.168.10.130
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. <view class="btoCard">
  119. <view class="leftBox btoBox">
  120. <image src="@/static/image/earlyWarning/school.png" mode=""></image>
  121. <view class="txt">
  122. 所属学校:演示学校
  123. </view>
  124. </view>
  125. <view class="rightBox btoBox" @click="deleteClick(item)">
  126. <view class="txt">
  127. 播放
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. </u-list-item>
  133. <u-loadmore :status="status" />
  134. </u-list>
  135. </view>
  136. <!-- <web-view :webview-styles="styles" src="/hybrid/html/players.html"></web-view> -->
  137. <!-- <u-modal :show="showVideo" :title="videoTitle" :closeOnClickOverlay="false" :showCancelButton="true"
  138. @confirm="confirmVideo" @cancel="cancelVideo">
  139. <view class="slot-content">
  140. <cover-view style="width: 100%;height:500px">
  141. </cover-view>
  142. </view>
  143. </u-modal> -->
  144. <tki-tree ref="tkitree" :selectParent="selectParent" :multiple="multiple" :range="treelist" :foldAll="flod"
  145. rangeKey="name" @confirm="treeConfirm" @cancel="treeCancel"></tki-tree>
  146. </view>
  147. </template>
  148. <script>
  149. import tkiTree from '@/components/tki-tree/tki-tree.vue';
  150. export default {
  151. components: {
  152. tkiTree
  153. },
  154. data() {
  155. return {
  156. styles: {
  157. width: '100%',
  158. height: '100%',
  159. zIndex: '999999999999999999999999999'
  160. // bottom: '56px'
  161. },
  162. showVideo: false,
  163. videoTitle: '',
  164. isShowSearch: false,
  165. searchForm: {
  166. alarmType: '警告类型',
  167. warnHand: '处理状态',
  168. tick: [],
  169. StartTick: '开始时间',
  170. EndTick: '结束时间',
  171. },
  172. warnList: [{
  173. warnHand: 1
  174. }, {
  175. warnHand: 0
  176. }, {
  177. warnHand: 1
  178. }, {
  179. warnHand: 1
  180. }, {
  181. warnHand: 1
  182. }, {}, {}, {}, {}, ],
  183. isLoading: false,
  184. status: 'loadmore', //loading正在加载 loadmore加载更多 nomore没有更多了
  185. listc: [{
  186. code: 1,
  187. name: 'dasda'
  188. }, {
  189. code: 2,
  190. name: 'dasda'
  191. },
  192. {
  193. code: 3,
  194. name: 'dasda'
  195. },
  196. {
  197. code: 4,
  198. name: 'dasda'
  199. },
  200. {
  201. code: 5,
  202. name: 'dasda'
  203. },
  204. {
  205. code: 6,
  206. name: 'dasda'
  207. },
  208. {
  209. code: 7,
  210. name: 'dasda'
  211. },
  212. {
  213. code: 8,
  214. name: 'dasda'
  215. },
  216. {
  217. code: 9,
  218. name: 'dasda'
  219. },
  220. {
  221. code: 10,
  222. name: 'dasda'
  223. },
  224. {
  225. code: 11,
  226. name: 'dasda'
  227. },
  228. {
  229. code: 12,
  230. name: 'dasda'
  231. },
  232. {
  233. code: 13,
  234. name: '你好'
  235. }
  236. ],
  237. treelist: [{
  238. name: '111',
  239. value: '1',
  240. children: [{
  241. name: '111',
  242. value: '2',
  243. }]
  244. }],
  245. multiple: false, //是否多选
  246. selectParent: true, //父级可选择
  247. flod: false, //折叠
  248. player: null
  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. mounted() {
  261. },
  262. onLoad() {
  263. // 隐藏导航栏
  264. this.loadmore()
  265. },
  266. methods: {
  267. setVideo() {
  268. this.loadWebPlayerSDK().then(() => {
  269. // 如果需要使用自定义组件,打开以下注释
  270. // this.loadComponent().then(() => {
  271. this.player = new Aliplayer({
  272. id: "url-player-test",
  273. source: "artc://rts-pull-live.deepeleph.com/quanjiang_DEMO00001/SXT003-0?auth_key=1724987674-0-0-df36ae3670785249c50e05cdb93e28ea&aliyun_uuid=286f58e41cc04c0393434b6856f29d07",
  274. width: "100%",
  275. height: "100%",
  276. isLive: true,
  277. rtsFallback: true,
  278. rtsFallbackType: 'HLS',
  279. }, function(player) {
  280. player.mute()
  281. });
  282. this.player.one('canplay', function() {
  283. // console.log('canplay', this.player.tag);
  284. this.player.tag.play();
  285. });
  286. // }).catch((e) => { console.log("加载组件失败", e) })
  287. }).catch((e) => {
  288. console.log("加载播放器SDK失败", e);
  289. });
  290. },
  291. closeDialog() {
  292. this.player.dispose();
  293. this.showVideo = false;
  294. },
  295. loadWebPlayerSDK() {
  296. return new Promise((resolve, reject) => {
  297. const s_tag = document.createElement('script'); // 引入播放器js
  298. s_tag.type = 'text/javascript';
  299. s_tag.src = 'https://g.alicdn.com/apsara-media-box/imp-web-player/2.25.1/aliplayer-min.js'
  300. // s_tag.src = 'https://g.alicdn.com/apsara-media-box/imp-web-player/2.20.3/aliplayer-min.js';
  301. s_tag.charset = 'utf-8';
  302. s_tag.onload = () => {
  303. resolve();
  304. }
  305. document.body.appendChild(s_tag);
  306. const l_tag = document.createElement('link'); // 引入播放器css
  307. l_tag.rel = 'stylesheet';
  308. l_tag.href =
  309. 'https://g.alicdn.com/apsara-media-box/imp-web-player/2.25.1/skins/default/aliplayer-min.css'
  310. // 'https://g.alicdn.com/apsara-media-box/imp-web-player/2.20.3/skins/default/aliplayer-min.css';
  311. document.body.appendChild(l_tag);
  312. });
  313. },
  314. loadComponent() {
  315. return new Promise((resolve, reject) => {
  316. const s_tag = document.createElement('script');
  317. s_tag.type = 'text/javascript';
  318. // 需要先下载组件 js 文件,放到项目 /static/ 目录下
  319. // 下载地址:https://github.com/aliyunvideo/AliyunPlayer_Web/blob/master/customComponents/dist/aliplayer-components/aliplayercomponents-1.0.9.min.js
  320. s_tag.src = './static/aliplayercomponents-1.0.9.min.js';
  321. s_tag.charset = 'utf-8';
  322. s_tag.onload = () => {
  323. resolve();
  324. }
  325. document.body.appendChild(s_tag);
  326. });
  327. },
  328. addAttribute(data) { // tree结构递归添加属性
  329. for (var i = 0; i < data.length; i++) {
  330. data[i].isShow = false
  331. data[i].name = data[i].title
  332. if (data[i].children && data[i].children.length > 0) {
  333. this.addAttribute(data[i].children)
  334. }
  335. }
  336. return data
  337. },
  338. // 确定回调事件
  339. treeConfirm(e) {
  340. // this.form.groupName = e[0].name
  341. // this.form.groupId = e[0].id
  342. },
  343. // 取消回调事件
  344. treeCancel(e) {
  345. // console.log(e)
  346. },
  347. // 显示树形选择器
  348. showTree() {
  349. this.$refs.tkitree._show();
  350. },
  351. cancelVideo() {
  352. console.log(11111)
  353. this.showVideo = false;
  354. },
  355. deleteClick() {
  356. this.showVideo = true;
  357. this.setVideo()
  358. },
  359. confirmVideo() {
  360. this.showVideo = false;
  361. },
  362. // 跳转处理页面
  363. toHandle(row) {
  364. if (row.warnHand == 1) {
  365. uni.navigateTo({
  366. url: '/pages/earlyWarning/handlingSuggestions'
  367. });
  368. }
  369. },
  370. // 跳转详情页面
  371. toDetail(row) {
  372. uni.navigateTo({
  373. url: '/pages/earlyWarning/detail'
  374. });
  375. },
  376. // 预警类型弹框筛选
  377. toOpen() {
  378. this.$refs.selectSearchBox.show = true;
  379. },
  380. // 处理情况筛选
  381. toOpenSelect() {
  382. this.$refs.selectRadioBox.show = true;
  383. },
  384. // 打开筛选框
  385. openSearch() {
  386. this.isShowSearch = !this.isShowSearch;
  387. },
  388. isSelect() {
  389. },
  390. scrolltolower() {
  391. this.loadmore()
  392. },
  393. loadmore() {
  394. if (this.status != 'loadmore') return
  395. this.status = 'loading'
  396. setTimeout(() => {
  397. for (let i = 0; i < 1; i++) {
  398. this.warnList.push({}, {})
  399. }
  400. // 获取到的总条数>=接口总条数
  401. if (this.warnList.length >= 14) {
  402. this.status = 'nomore'
  403. } else {
  404. this.status = 'loadmore'
  405. }
  406. }, 2000)
  407. }
  408. }
  409. }
  410. </script>
  411. <style lang="scss" scoped>
  412. .container {
  413. padding: 20px;
  414. font-size: 14px;
  415. height: 800px;
  416. }
  417. // .contentBox {
  418. // height: calc(100% - 375rpx);
  419. .inspectionCenter {
  420. width: 100%;
  421. height: 100%;
  422. position: relative;
  423. .u-modal__title {
  424. color: #000000;
  425. }
  426. .poupBox {
  427. height: 100vh;
  428. position: absolute;
  429. left: 0;
  430. top: 0;
  431. width: 100%;
  432. z-index: 100000000000000;
  433. // background: red;
  434. background: rgba(0, 0, 0, 0.2);
  435. .contentBox {
  436. // z-index: 1000000;
  437. width: 100%;
  438. height: 500rpx;
  439. // margin: 50rpx auto;
  440. }
  441. .bottom-content {
  442. height: calc(100% - 500rpx);
  443. }
  444. }
  445. }
  446. .searchBox {
  447. // height: calc(100% - 360rpx);
  448. position: relative;
  449. .searchLine {
  450. height: 88rpx;
  451. display: flex;
  452. align-items: center;
  453. justify-content: space-between;
  454. padding: 0 15px;
  455. box-sizing: border-box;
  456. background: #fff;
  457. font-size: 28rpx;
  458. .searchLabels {
  459. display: flex;
  460. align-items: center;
  461. width: calc(100% - 34rpx);
  462. image {
  463. width: 40rpx;
  464. height: 40rpx;
  465. flex-shrink: 1;
  466. }
  467. .labels {
  468. width: 120rpx;
  469. display: block;
  470. color: #333333;
  471. margin-left: 10rpx;
  472. flex-shrink: 1;
  473. }
  474. .values {
  475. width: calc(100% - 40rpx - 120rpx);
  476. color: #2388FF;
  477. font-weight: 700;
  478. margin-left: 18rpx;
  479. overflow: hidden;
  480. word-wrap: break-word;
  481. white-space: pre-wrap;
  482. display: -webkit-box;
  483. -webkit-box-orient: vertical;
  484. -webkit-line-clamp: 1;
  485. }
  486. }
  487. .arrow {
  488. // text-align: right;
  489. // flex-shrink: 1;
  490. image {
  491. width: 34rpx;
  492. height: 34rpx;
  493. }
  494. }
  495. .leftSearchBox {
  496. display: flex;
  497. align-items: center;
  498. width: calc(100% - 40px);
  499. .searchLabel {
  500. flex-shrink: 1;
  501. color: #333333;
  502. width: 80px;
  503. }
  504. .searchValue {
  505. width: calc(100% - 60px);
  506. margin-left: 10px;
  507. color: #2388FF;
  508. overflow: hidden;
  509. word-wrap: break-word;
  510. white-space: pre-wrap;
  511. display: -webkit-box;
  512. -webkit-box-orient: vertical;
  513. -webkit-line-clamp: 1;
  514. }
  515. }
  516. }
  517. .searchDialog {
  518. position: absolute;
  519. z-index: 990;
  520. top: 89rpx;
  521. width: 100%;
  522. height: calc(100vh - 375rpx - 100rpx);
  523. font-size: 26rpx;
  524. background: rgba(0, 0, 0, 0.2);
  525. .content {
  526. background: #FFFFFF;
  527. padding: 15px;
  528. box-sizing: border-box;
  529. border-top: 1px solid rgba(0, 0, 0, 0.1);
  530. .demo-layout {
  531. height: 80rpx;
  532. border-radius: 8rpx;
  533. background: #F5F5F5;
  534. display: flex;
  535. justify-content: space-between;
  536. align-items: center;
  537. padding: 0 10px;
  538. box-sizing: border-box;
  539. .left-layout {
  540. color: #777777;
  541. }
  542. .right-layout {}
  543. .startBox {
  544. color: #777777;
  545. }
  546. text {
  547. color: #777777;
  548. }
  549. .endBox {
  550. color: #777777;
  551. }
  552. .timeIcon {}
  553. }
  554. }
  555. .btnBox {
  556. display: flex;
  557. align-items: center;
  558. margin-top: 15px;
  559. .leftBtn {
  560. width: 50%;
  561. height: 74rpx;
  562. line-height: 74rpx;
  563. border: 1px solid #BABABA;
  564. border-radius: 12rpx;
  565. color: #333333;
  566. text-align: center;
  567. }
  568. .rightBtn {
  569. width: 50%;
  570. height: 74rpx;
  571. line-height: 74rpx;
  572. border: 1px solid #2388FF;
  573. border-radius: 12rpx;
  574. color: #fff;
  575. text-align: center;
  576. background: #2388FF;
  577. margin-left: 15rpx;
  578. }
  579. }
  580. }
  581. }
  582. .tableBox {
  583. height: 100%;
  584. padding: 0 30rpx;
  585. box-sizing: border-box;
  586. .liBox {
  587. background: #fff;
  588. padding: 24rpx 30rpx;
  589. box-sizing: border-box;
  590. border-radius: 20rpx;
  591. margin-top: 30rpx;
  592. .topCard {
  593. display: flex;
  594. align-items: center;
  595. .pic {
  596. position: relative;
  597. width: 268rpx;
  598. height: 201rpx;
  599. image {
  600. width: 268rpx;
  601. height: 201rpx;
  602. border-radius: 4px;
  603. }
  604. .resolvingPower {
  605. position: absolute;
  606. top: 15rpx;
  607. right: 15rpx;
  608. background: #000000;
  609. color: #fff;
  610. padding: 8rpx;
  611. box-sizing: border-box;
  612. font-size: 20rpx;
  613. border-radius: 4rpx;
  614. font-family: 'PingFang SC';
  615. }
  616. }
  617. .rightCard {
  618. margin-left: 20rpx;
  619. .firstCard {
  620. display: flex;
  621. justify-content: space-between;
  622. align-items: center;
  623. margin-bottom: 60rpx;
  624. .schoolName {
  625. font-size: 32rpx;
  626. font-family: 'PingFang SC';
  627. font-weight: 700;
  628. color: #333333;
  629. overflow: hidden;
  630. word-wrap: break-word;
  631. white-space: pre-wrap;
  632. // font-size: 14px;
  633. display: -webkit-box;
  634. -webkit-box-orient: vertical;
  635. -webkit-line-clamp: 1;
  636. }
  637. }
  638. .secondCard,
  639. .thirdCard {
  640. display: flex;
  641. align-items: center;
  642. margin-top: 16rpx;
  643. .txt {
  644. font-size: 26rpx;
  645. font-family: 'PingFang SC';
  646. color: #333333;
  647. }
  648. }
  649. }
  650. }
  651. .btoCard {
  652. border-top: 1px solid rgba(0, 0, 0, 0.1);
  653. margin-top: 24rpx;
  654. padding: 24rpx 0 0 0;
  655. display: flex;
  656. justify-content: space-between;
  657. align-items: center;
  658. .btoBox {
  659. // width: 33.3%;
  660. display: flex;
  661. justify-content: center;
  662. align-items: center;
  663. position: relative;
  664. font-size: 26rpx;
  665. color: #333;
  666. font-family: 'PingFang SC';
  667. image {
  668. width: 36rpx;
  669. height: 36rpx;
  670. margin-right: 15rpx;
  671. }
  672. }
  673. .rightBox {
  674. width: 120rpx;
  675. height: 60rpx;
  676. background: #2388FF;
  677. color: #fff;
  678. border-radius: 80rpx;
  679. }
  680. }
  681. }
  682. }
  683. // }
  684. </style>