videoList.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <oa-scroll
  3. customClass="repairManage-container scroll-height"
  4. :pageSize="state.pageSize"
  5. :total="state.total"
  6. :isSticky="false"
  7. :refresherLoad="true"
  8. :refresherEnabled="true"
  9. :refresherDefaultStyle="'none'"
  10. :refresherThreshold="44"
  11. :refresherBackground="'#f5f6f7'"
  12. @load="load"
  13. @refresh="refresh"
  14. :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
  15. >
  16. <template #default>
  17. <view class="menu-list m0">
  18. <view class="list-cell list-cell-arrow" style="line-height: 25px" v-for="(base, index) in state.dataList" :key="index" @click="handleToDetails(base)">
  19. <view class="menu-item">
  20. <image v-if="base.deviceStatus == 1" class="image-bg" style="width: 80rpx; height: 80rpx; margin: auto 10px auto 0" src="@/static/images/videoMonitor/video-icon-on.png"></image>
  21. <image v-if="base.deviceStatus == 2" class="image-bg" style="width: 80rpx; height: 80rpx; margin: auto 10px auto 0" src="@/static/images/videoMonitor/video-icon-off.png"></image>
  22. <view style="width: calc(100% - 51px); display: flex; justify-content: space-between; padding-right: 10px">
  23. <view class="deviceHeader">
  24. <view class="deviceName text-ellipsis">{{ base.deviceName }}</view>
  25. </view>
  26. <view class="" v-if="base.deviceStatus == 1" style="color: #16bf00; margin-right: 10px"> 在线 </view>
  27. <view class="" v-if="base.deviceStatus == 2" style="color: #333; margin-right: 10px"> 离线 </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. </oa-scroll>
  34. </template>
  35. <script setup>
  36. /*----------------------------------依赖引入-----------------------------------*/
  37. import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
  38. import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
  39. /*----------------------------------接口引入-----------------------------------*/
  40. import { pageQuery } from "@/api/business/videoMonitor.js";
  41. /*----------------------------------组件引入-----------------------------------*/
  42. /*----------------------------------store引入-----------------------------------*/
  43. import { useStores, commonStores } from "@/store/modules/index";
  44. /*----------------------------------公共方法引入-----------------------------------*/
  45. /*----------------------------------公共变量-----------------------------------*/
  46. const { proxy } = getCurrentInstance();
  47. const commonStore = commonStores();
  48. /*----------------------------------变量声明-----------------------------------*/
  49. const state = reactive({
  50. dataList: [],
  51. pageSize: 20,
  52. current: 1,
  53. total: 0,
  54. });
  55. /**
  56. * @页面初始化
  57. */
  58. function init() {
  59. selectListApi();
  60. }
  61. /**
  62. * @列表查询
  63. * @api接口查询
  64. */
  65. function selectListApi() {
  66. pageQuery({
  67. current: state.current,
  68. size: state.pageSize,
  69. }).then((requset) => {
  70. if (requset.status === "SUCCESS") {
  71. state.dataList = requset.data.records;
  72. state.total = requset.data.total;
  73. }
  74. });
  75. }
  76. /**
  77. * @跳转详情事件
  78. */
  79. function handleToDetails(e) {
  80. proxy.$tab.navigateTo(`/pages/business/common/videoMonitor/videoDetail?deviceName=${e.deviceName}`);
  81. if (e.deviceStatus == 1) {
  82. }
  83. }
  84. /**
  85. * @scrollView加载数据
  86. */
  87. function load() {
  88. state.pageSize += 10;
  89. init();
  90. }
  91. /**
  92. * @scrollView刷新数据
  93. */
  94. function refresh() {
  95. state.pageSize = 20;
  96. init();
  97. }
  98. onReady(() => {});
  99. onShow(() => {
  100. //调用系统主题颜色
  101. proxy.$settingStore.systemThemeColor([1]);
  102. });
  103. onLoad((options) => {
  104. init();
  105. });
  106. </script>
  107. <style lang="scss" scoped>
  108. .repairManage-container {
  109. .content-area {
  110. &-top {
  111. padding-right: 10px;
  112. font-size: 16px;
  113. font-weight: 600;
  114. color: #000000;
  115. &-time {
  116. max-width: 70%;
  117. margin: auto 0;
  118. font-size: 14px;
  119. color: rgb(102, 102, 102);
  120. }
  121. &-name {
  122. max-width: 70%;
  123. color: #000;
  124. }
  125. &-status {
  126. max-width: 30%;
  127. margin: auto 0 auto auto;
  128. font-size: 12px;
  129. color: #ffffff;
  130. padding: 0 5px;
  131. border-radius: 20px;
  132. line-height: 20px;
  133. }
  134. }
  135. &-row_wrap {
  136. padding-right: 10px;
  137. font-size: 13px;
  138. flex-flow: row wrap;
  139. &-view {
  140. display: flex;
  141. min-width: 50%;
  142. > .iconfont {
  143. font-size: 14px;
  144. color: #909399;
  145. margin-left: 5px;
  146. }
  147. }
  148. }
  149. }
  150. }
  151. </style>