index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <oa-scroll
  3. customClass="scroll-height"
  4. :refresherLoad="false"
  5. :refresherLoadTitle="false"
  6. :refresherEnabled="true"
  7. :refresherDefaultStyle="'none'"
  8. :refresherThreshold="44"
  9. :refresherBackground="'#f5f6f7'"
  10. @refresh="refresh"
  11. :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
  12. >
  13. <template #default>
  14. <view class="flex padding-tb-sm bg-white">
  15. <view class="padding-lr-sm text-center" style="width: 50%">设施类型:{{ typeNum || 0 }}</view>
  16. <view class="divider-default"></view>
  17. <view class="padding-lr-sm text-center" style="width: 50%">设施总数:{{ facilityNum || 0 }}</view>
  18. </view>
  19. <view class="flex bg-white margin-lr-sm margin-top-sm padding-sm shadow-default radius" v-for="(data, index) in dataList" :key="index">
  20. <view class="margin-right-sm" style="margin-top: auto; margin-bottom: auto" @click="handleToDevice(data.id, data.typeName)">
  21. <image style="width: 40px" :src="data.typeImg ? data.typeImg : '/static/images/404.png'" mode="widthFix"></image>
  22. </view>
  23. <view style="width: 100%" @click="handleToDevice(data.id, data.typeName)">
  24. <view class="flex margin-bottom-xl">
  25. <view class="text-dfl text-bold">{{ data.typeName }}</view>
  26. <view style="font-size: 14px; margin-top: auto; margin-right: auto">({{ data.typeFacilityNum || 0 }})</view>
  27. </view>
  28. <view>
  29. <view class="flex">
  30. <view style="font-size: 14px; width: 33.33%">正常:{{ data.normalFacilityNum || 0 }}</view>
  31. <view style="font-size: 14px; width: 33.33%">维修:{{ data.upkeepFacilityNum || 0 }}</view>
  32. <view style="font-size: 14px; width: 33.33%">关闭:{{ data.closeFacilityNum || 0 }}</view>
  33. </view>
  34. </view>
  35. </view>
  36. <view style="margin-top: auto; margin-bottom: auto" @click="handleToMap(data.typeCode)">
  37. <view class="iconfont ucicon-app-map icon" :style="{ color: proxy.$settingStore.themeColor.color, fontSize: '22px' }"></view>
  38. </view>
  39. </view>
  40. </template>
  41. </oa-scroll>
  42. <view class="app-scan-fixed">
  43. <u-image width="67" height="67" src="@/static/images/add.png" shape="circle" @tap="handleToPage()"></u-image>
  44. </view>
  45. </template>
  46. <script setup>
  47. import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
  48. import { ref, reactive, computed, onMounted, getCurrentInstance, toRefs, inject } from "vue";
  49. import { xunJianStores, publicStores } from "@/store/modules/index";
  50. import { baseFacilityType } from "@/api/business/fireIot/facilitiesManage.js";
  51. const publicStore = publicStores(); //全局公共Store
  52. const xunJianStore = xunJianStores(); //全局变量值Store
  53. const { proxy } = getCurrentInstance();
  54. const typeNum = ref(0);
  55. const facilityNum = ref(0);
  56. const dataList = ref([]);
  57. /**
  58. * @页面初始化
  59. */
  60. function init() {
  61. baseFacilityType({
  62. pageNum: 1,
  63. pageSize: 20000,
  64. }).then((requset) => {
  65. if (requset.status === "SUCCESS") {
  66. if (requset.data.length > 0) {
  67. dataList.value = requset.data[0].baseGgpFacilityTypeNumVO;
  68. typeNum.value = requset.data[0].typeNum;
  69. facilityNum.value = requset.data[0].facilityNum;
  70. }
  71. }
  72. });
  73. }
  74. /**
  75. * @scrollView刷新数据
  76. */
  77. function refresh() {
  78. init();
  79. }
  80. /**
  81. * @设施详情列表跳转点击事件
  82. */
  83. function handleToDevice(id, typeName) {
  84. proxy.$tab.navigateTo(`/pages/business/fireIot/facilitiesManage/facilitiesDetailsList?id=${id}&typeName=${typeName}`);
  85. }
  86. /**
  87. * @设施地图查看
  88. */
  89. function handleToMap(typeCode) {
  90. proxy.$tab.navigateTo(`/pages/business/fireIot/facilitiesManage/mapFacilitiesView?typeCode=${typeCode}`);
  91. }
  92. /**
  93. * @设施地图采集
  94. */
  95. function handleToPage() {
  96. proxy.$tab.navigateTo(`/pages/business/fireIot/facilitiesGather/index`);
  97. }
  98. onLoad(() => {
  99. init();
  100. });
  101. onShow(() => {
  102. //调用系统主题颜色
  103. proxy.$settingStore.systemThemeColor([1]);
  104. });
  105. </script>
  106. <style lang="scss"></style>