xunJian.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <u-navbar :titleStyle="{ color: '#fff' }" :autoBack="true" title="巡检" :placeholder="true" :safeAreaInsetTop="true" :bgColor="proxy.$settingStore.themeColor.color">
  3. <template #left>
  4. <view class="u-navbar__content__left__item">
  5. <u-icon name="arrow-left" size="20" color="#fff"></u-icon>
  6. </view>
  7. </template>
  8. </u-navbar>
  9. <oa-scroll
  10. customClass="scroll-height"
  11. :customStyle="{ height: `calc(100vh - (44px + ${proxy.$settingStore.StatusBarHeight} + ${proxy.$settingStore.tabBarHeight}))` }"
  12. :refresherLoad="false"
  13. :refresherEnabled="false"
  14. :refresherEnabledTitle="false"
  15. :refresherDefaultStyle="'none'"
  16. :refresherThreshold="44"
  17. :refresherBackground="'#f5f6f7'"
  18. :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
  19. >
  20. <template #default>
  21. <view class="p10">
  22. <!-- 图表 -->
  23. <view class="bg-white p5">
  24. <chart :currentDateList="currentDateList"></chart>
  25. </view>
  26. <!-- 图表 end-->
  27. <!-- 宫格列表 -->
  28. <view class="bg-white mt10">
  29. <view class="cu-list grid col-4 no-border" style="padding-top: 0.3125rem">
  30. <view class="cu-item justify-center align-center" v-for="(item, index) in inspectList" :key="index" @tap="navItemClick(item.redirectUrl, item.id)">
  31. <image :src="item.imgUrl" style="width: 40px; height: 40px"></image>
  32. <view class="cu-tag badge" v-if="item.num != 0">
  33. <block v-if="item.num != 0">{{ item.num > 99 ? "99+" : item.num }}</block>
  34. </view>
  35. <text style="font-size: 14px">{{ item.title }}</text>
  36. </view>
  37. </view>
  38. </view>
  39. <!-- 宫格列表 end -->
  40. </view>
  41. </template>
  42. </oa-scroll>
  43. </template>
  44. <script setup>
  45. /*----------------------------------依赖引入-----------------------------------*/
  46. import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
  47. import { ref, reactive, computed, onMounted, getCurrentInstance, toRefs, inject } from "vue";
  48. /*----------------------------------接口引入-----------------------------------*/
  49. import { appPlanStatistics } from "@/api/business/zhaf/xunJian/index.js";
  50. /*----------------------------------组件引入-----------------------------------*/
  51. import chart from "./components/chart.vue";
  52. /*----------------------------------store引入-----------------------------------*/
  53. import { xunJianStores, commonStores } from "@/store/modules/index";
  54. /*----------------------------------公共方法引入-----------------------------------*/
  55. /*----------------------------------公共变量-----------------------------------*/
  56. const { proxy } = getCurrentInstance();
  57. const commonStore = commonStores(); //全局公共Store
  58. const xunJianStore = xunJianStores(); //全局变量值Store
  59. /*----------------------------------变量声明-----------------------------------*/
  60. const inspectList = proxy.$constData.xunJianList; //九宫格json数据
  61. const currentDate = proxy.$dayjs().format("YYYY-MM-DD");
  62. const currentDateList = ref([]);
  63. function navItemClick(url, id) {
  64. if (url) {
  65. if (id == 1) {
  66. xunJianStore.planTabs = 0;
  67. } else if (id == 2) {
  68. xunJianStore.planTabs = 1;
  69. }
  70. proxy.$tab.redirectTo(url);
  71. } else {
  72. uni.showModal({
  73. title: "Tips",
  74. content: "此模块开发中~",
  75. showCancel: false,
  76. success: function (res) {
  77. if (res.confirm) {
  78. } else if (res.cancel) {
  79. }
  80. },
  81. });
  82. }
  83. }
  84. /**
  85. * @ehcarts
  86. * @api接口请求
  87. */
  88. async function echartsApi() {
  89. appPlanStatistics({
  90. currentDate: currentDate,
  91. }).then((res) => {
  92. if (res.status == "SUCCESS") {
  93. currentDateList.value = [res.data];
  94. } else {
  95. }
  96. });
  97. }
  98. onLoad(() => {
  99. echartsApi();
  100. });
  101. onShow(() => {
  102. //调用系统主题颜色
  103. proxy.$settingStore.systemThemeColor([1]);
  104. });
  105. </script>
  106. <style lang="scss"></style>