videoList.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <!-- <u-sticky class="shadow-default" bgColor="#fff" style="top: 0">
  3. <u-tabs :list="tabsList" :current="tabsCurrent" @click="tabsClick" lineColor="#333" :activeStyle="{ color: '#333' }" :inactiveStyle="{ color: '#909399' }" :scrollable="false"></u-tabs>
  4. </u-sticky> -->
  5. <oa-scroll
  6. customClass="repairManage-container scroll-height"
  7. :pageSize="pageSize"
  8. :total="total"
  9. :refresherLoad="true"
  10. :refresherEnabled="true"
  11. :refresherDefaultStyle="'none'"
  12. :refresherThreshold="44"
  13. :lowerThreshold="44"
  14. :refresherBackground="'#f5f6f7'"
  15. @load="load"
  16. @refresh="refresh"
  17. :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
  18. >
  19. <template #default>
  20. <view class="menu-list m0">
  21. <view class="list-cell list-cell-arrow" style=" line-height: 25px" v-for="(base, index) in dataList" :key="index" @click="handleToDetails(base)">
  22. <view class="menu-item">
  23. <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>
  24. <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>
  25. <view style="width: calc(100% - 51px); display: flex; justify-content: space-between; padding-right: 10px">
  26. <view class="deviceHeader">
  27. <view class="deviceName text-ellipsis">{{ base.deviceName }}</view>
  28. </view>
  29. <view class="" v-if="base.deviceStatus == 1" style="color: #16bf00;margin-right:10px"> 在线 </view>
  30. <view class="" v-if="base.deviceStatus == 2" style="color: #333;margin-right:10px"> 离线 </view>
  31. </view>
  32. <view>
  33. </view>
  34. </view>
  35. <!-- <view class="content-area-top menu-item">
  36. <view class="content-area-top-status" v-if="base.deviceStatus == 1" style="background-color: #23dedc"> 在线 </view>
  37. <view class="content-area-top-status" v-if="base.deviceStatus == 2" style="background-color: #16bf00"> 离线 </view>
  38. </view>
  39. <view class="content-area-row_wrap menu-item">
  40. <view class="content-area-row_wrap-view"> {{ base.reflectPhone }} </view>
  41. </view> -->
  42. </view>
  43. </view>
  44. </template>
  45. </oa-scroll>
  46. </template>
  47. <script setup>
  48. import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
  49. import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
  50. import { useStores, commonStores } from "@/store/modules/index";
  51. import { pageQuery } from "@/api/business/videoMonitor.js";
  52. const { proxy } = getCurrentInstance();
  53. const commonStore = commonStores();
  54. const tabsList = ref([
  55. {
  56. name: "全部",
  57. value: "",
  58. },
  59. {
  60. name: "受理中",
  61. value: 1,
  62. },
  63. {
  64. name: "处理完成",
  65. value: 2,
  66. },
  67. ]);
  68. const tabsCurrent = ref(1);
  69. const dataList = ref([]);
  70. const pageSize = ref(20);
  71. const current = ref(1);
  72. const total = ref(0);
  73. /**
  74. * @页面初始化
  75. */
  76. function init() {
  77. selectListApi();
  78. }
  79. /**
  80. * @列表查询
  81. * @api接口查询
  82. */
  83. function selectListApi() {
  84. pageQuery({
  85. // deviceStatus: tabsList.value[tabsCurrent.value].value,
  86. current: current.value,
  87. size: pageSize.value,
  88. }).then((requset) => {
  89. if (requset.status === "SUCCESS") {
  90. dataList.value = requset.data.records;
  91. total.value = requset.data.total;
  92. }
  93. });
  94. }
  95. /**
  96. * @跳转详情事件
  97. */
  98. function handleToDetails(e) {
  99. proxy.$tab.navigateTo(`/pages/business/videoMonitor/videoDetail?deviceName=${e.deviceName}`);
  100. if(e.deviceStatus==1){
  101. }
  102. }
  103. /**
  104. * @scrollView加载数据
  105. */
  106. function load() {
  107. pageSize.value += 10;
  108. init();
  109. }
  110. /**
  111. * @scrollView刷新数据
  112. */
  113. function refresh() {
  114. pageSize.value = 20;
  115. total.value = 0;
  116. init();
  117. }
  118. /**
  119. * @tabs点击事件
  120. */
  121. function tabsClick(e) {
  122. tabsCurrent.value = e.index;
  123. init();
  124. }
  125. onReady(() => {});
  126. onShow(() => {
  127. //调用系统主题颜色
  128. proxy.$settingStore.systemThemeColor([1]);
  129. });
  130. onLoad((options) => {
  131. init();
  132. });
  133. </script>
  134. <style lang="scss" scoped>
  135. .repairManage-container {
  136. .content-area {
  137. &-top {
  138. padding-right: 10px;
  139. font-size: 16px;
  140. font-weight: 600;
  141. color: #000000;
  142. &-time {
  143. max-width: 70%;
  144. margin: auto 0;
  145. font-size: 14px;
  146. color: rgb(102, 102, 102);
  147. }
  148. &-name {
  149. max-width: 70%;
  150. color: #000;
  151. }
  152. &-status {
  153. max-width: 30%;
  154. margin: auto 0 auto auto;
  155. font-size: 12px;
  156. color: #ffffff;
  157. padding: 0 5px;
  158. border-radius: 20px;
  159. line-height: 20px;
  160. }
  161. }
  162. &-row_wrap {
  163. padding-right: 10px;
  164. font-size: 13px;
  165. flex-flow: row wrap;
  166. &-view {
  167. display: flex;
  168. min-width: 50%;
  169. > .iconfont {
  170. font-size: 14px;
  171. color: #909399;
  172. margin-left: 5px;
  173. }
  174. }
  175. }
  176. }
  177. }
  178. </style>