monitor.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="monitor-container">
  3. <playerContainer></playerContainer>
  4. <view class="footer">
  5. <u-row>
  6. <u-col :span="10" :offset="1">
  7. <u-button type="primary" :plain="false"
  8. text="清除全部" shape="circle"
  9. @click="handleClear"
  10. >
  11. </u-button>
  12. </u-col>
  13. </u-row>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import {vehVideo} from '@/api/monitor.js'
  19. import {isArray} from 'lodash'
  20. import playerContainer from './module/playerContainer.vue'
  21. export default {
  22. components: {
  23. playerContainer
  24. },
  25. data() {
  26. return {
  27. }
  28. },
  29. onLoad(option) {
  30. let {id} = option
  31. this.getVehVideo(id)
  32. },
  33. onShow() {
  34. },
  35. onHide() {
  36. },
  37. methods: {
  38. async getVehVideo(id) {
  39. let list = []
  40. let res = await vehVideo({id});
  41. if (res.code == "0") {
  42. if(isArray(res.data)) {
  43. res.data.forEach((item) => {
  44. list.push({
  45. ...item,
  46. objId: item.deviceId,
  47. code: 'camera',
  48. })
  49. })
  50. this.$store.dispatch('setCheckedArr',list)
  51. }
  52. }
  53. },
  54. handleClear() {
  55. // console.log(1231)
  56. this.$store.dispatch('setCheckedArr',[])
  57. }
  58. },
  59. beforeDestroy() {
  60. this.$store.dispatch('setCheckedArr',[])
  61. },
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. .monitor-container {
  66. width: 100%;
  67. // height: 100vh;
  68. position: relative;
  69. padding-bottom: 100rpx;
  70. .footer {
  71. position: fixed;
  72. bottom: 0;
  73. left: 0;
  74. width: 100%;
  75. padding-bottom: 20rpx;
  76. }
  77. }
  78. </style>