index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <scroll-view class="scroll-height" :scroll-y="true" :data-theme="'theme-' + proxy.$settingStore.themeColor.name">
  3. <view class="flex padding-tb-sm bg-white">
  4. <view class="padding-lr-sm text-center" style="width: 50%">设施类型:{{ typeNum || 0 }}</view>
  5. <view class="divider-default"></view>
  6. <view class="padding-lr-sm text-center" style="width: 50%">设施总数:{{ facilityNum || 0 }}</view>
  7. </view>
  8. <view class="flex bg-white margin-lr-sm margin-top-sm padding-sm shadow-default radius" v-for="(data, index) in dataList" :key="index">
  9. <view class="margin-right-sm" style="margin-top: auto; margin-bottom: auto" @click="handleToDevice(data.id, data.typeName)">
  10. <image style="width: 40px; height: 40px" :src="data.typeImg ? data.typeImg : '/static/images/404.png'" mode="aspectFill"></image>
  11. </view>
  12. <view style="width: 100%" @click="handleToDevice(data.id, data.typeName)">
  13. <view class="flex margin-bottom-xl">
  14. <view class="text-dfl text-bold">{{ data.typeName }}</view>
  15. <view style="font-size: 14px; margin-top: auto; margin-right: auto">({{ data.typeFacilityNum || 0 }})</view>
  16. </view>
  17. <view>
  18. <view class="flex">
  19. <view style="font-size: 14px; width: 33.33%">正常:{{ data.normalFacilityNum || 0 }}</view>
  20. <view style="font-size: 14px; width: 33.33%">维修:{{ data.upkeepFacilityNum || 0 }}</view>
  21. <view style="font-size: 14px; width: 33.33%">关闭:{{ data.closeFacilityNum || 0 }}</view>
  22. </view>
  23. </view>
  24. </view>
  25. <view style="margin-top: auto; margin-bottom: auto" @click="handleToMap(data.id)">
  26. <view class="iconfont ucicon-app-map icon" :style="{ color: proxy.$settingStore.themeColor.color, fontSize: '22px' }"></view>
  27. </view>
  28. </view>
  29. </scroll-view>
  30. </template>
  31. <script setup>
  32. import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
  33. import { ref, reactive, computed, onMounted, getCurrentInstance, toRefs, inject } from "vue";
  34. import { xunJianStores, publicStores } from "@/store/modules/index";
  35. import { baseFacilityType } from "@/api/business/fireIot/facilitiesView/index";
  36. const publicStore = publicStores(); //全局公共Store
  37. const xunJianStore = xunJianStores(); //全局变量值Store
  38. const { proxy } = getCurrentInstance();
  39. const typeNum = ref(0);
  40. const facilityNum = ref(0);
  41. const dataList = ref([]);
  42. /**
  43. * @页面初始化
  44. */
  45. function init() {
  46. baseFacilityType().then((requset) => {
  47. if (requset.status === "SUCCESS") {
  48. if (requset.data.length > 0) {
  49. dataList.value = requset.data[0].baseGgpFacilityTypeNumVO;
  50. typeNum.value = requset.data[0].typeNum;
  51. facilityNum.value = requset.data[0].facilityNum;
  52. }
  53. }
  54. });
  55. }
  56. /**
  57. * @设施详情列表跳转点击事件
  58. */
  59. function handleToDevice(id, typeName) {
  60. proxy.$tab.navigateTo(`/pages/business/fireIot/facilitiesView/facilitiesDetailsList?id=${id}&typeName=${typeName}`);
  61. }
  62. /**
  63. * @设施地图查看
  64. */
  65. function handleToMap(id) {
  66. proxy.$tab.navigateTo(`/pages/business/fireIot/facilitiesView/mapGatherView?facilitiesId=${id}`);
  67. }
  68. onLoad(() => {
  69. init();
  70. });
  71. onShow(() => {
  72. //调用系统主题颜色
  73. proxy.$settingStore.systemThemeColor([1]);
  74. });
  75. </script>
  76. <style lang="scss"></style>