index.vue 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 ? typeNum : 0 }}</view>
  5. <view class="divider-default"></view>
  6. <view class="padding-lr-sm text-center" style="width: 50%">设施总数:{{ facilityNum ? 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" @click="handleToDevice(data.id, data.typeName)">
  9. <view class="margin-right-sm" style="margin-top: auto; margin-bottom: auto">
  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%">
  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 ? data.typeFacilityNum : 0 }})</view>
  16. <view style="font-size: 14px; margin-top: auto" :style="{ color: proxy.$settingStore.themeColor.color }">查看地图</view>
  17. </view>
  18. <view>
  19. <view class="flex">
  20. <view style="font-size: 14px; width: 33.33%">正常:{{ data.normalFacilityNum ? data.normalFacilityNum : 0 }}</view>
  21. <view style="font-size: 14px; width: 33.33%">维修:{{ data.upkeepFacilityNum ? data.upkeepFacilityNum : 0 }}</view>
  22. <view style="font-size: 14px; width: 33.33%">关闭:{{ data.closeFacilityNum ? data.closeFacilityNum : 0 }}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </scroll-view>
  28. </template>
  29. <script setup>
  30. import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
  31. import { ref, reactive, computed, onMounted, getCurrentInstance, toRefs, inject } from "vue";
  32. import { xunJianStores, publicStores } from "@/store/modules/index";
  33. import json from "@/static/js/json.js";
  34. import { baseFacilityType } from "@/api/business/fireIot/facilitiesView/index";
  35. const publicStore = publicStores(); //全局公共Store
  36. const xunJianStore = xunJianStores(); //全局变量值Store
  37. const { proxy } = getCurrentInstance();
  38. const typeNum = ref(0);
  39. const facilityNum = ref(0);
  40. const dataList = ref([]);
  41. /**
  42. * @页面初始化
  43. */
  44. function init() {
  45. baseFacilityType().then((requset) => {
  46. if (requset.status === "SUCCESS") {
  47. dataList.value = requset.data[0].baseGgpFacilityTypeNumVO;
  48. typeNum.value = requset.data[0].typeNum;
  49. facilityNum.value = requset.data[0].facilityNum;
  50. }
  51. });
  52. }
  53. /**
  54. * @设施详情列表跳转点击事件
  55. */
  56. function handleToDevice(id, typeName) {
  57. proxy.$tab.navigateTo(`/pages/business/fireIot/facilitiesView/facilitiesDetailsList?id=${id}&typeName=${typeName}`);
  58. }
  59. onLoad(() => {
  60. init();
  61. });
  62. onShow(() => {
  63. //调用系统主题颜色
  64. proxy.$settingStore.systemThemeColor([1]);
  65. });
  66. </script>
  67. <style lang="scss"></style>