index.vue 4.0 KB

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