xunJian.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <scroll-view scroll-x>
  3. <view class="padding-sm">
  4. <!-- 图表 -->
  5. <view class="section1 section bg-white padding-xs">
  6. <chart v-if="currentDateList.length > 0" :currentDateList="currentDateList"></chart>
  7. </view>
  8. <!-- 图表 end-->
  9. <!-- <view class="cu-list menu-avatar">
  10. <view class="cu-item deviceTypeItem" v-for="(item,index) in inspectList" :key="index"
  11. @tap="goRecordPage(index)">
  12. <view class="cu-avatar round">
  13. <image class="image-bg" :src=item.imgUrl />
  14. </view>
  15. <view class="content">
  16. <view class="title">{{item.title}}</view>
  17. </view>
  18. <view class="nav-right num">
  19. <view>
  20. <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
  21. </view>
  22. </view>
  23. </view>
  24. </view> -->
  25. <!-- 宫格列表 -->
  26. <view class="section2 section bg-white margin-top-sm">
  27. <view class="cu-list grid col-4 no-border" style="padding-top: 0.3125rem">
  28. <view class="cu-item justify-center align-center" v-for="(item, index) in inspectList" :key="index" @tap="navItemClick(item.redirectUrl, item.id)">
  29. <image :src="item.imgUrl" style="width: 40px; height: 40px"></image>
  30. <view class="cu-tag badge" v-if="item.num != 0">
  31. <block v-if="item.num != 0">{{ item.num > 99 ? "99+" : item.num }}</block>
  32. </view>
  33. <text style="font-size: 14px">{{ item.title }}</text>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 宫格列表 end -->
  38. </view>
  39. </scroll-view>
  40. </template>
  41. <script setup>
  42. import { onLoad, onShow, onHide, onLaunch } from "@dcloudio/uni-app";
  43. import { ref, reactive, computed, onMounted, getCurrentInstance, toRefs, inject } from "vue";
  44. import { xunJianStores, publicStores } from "@/store/modules/index";
  45. import chart from "./components/echarts/chart.vue";
  46. import json from "@/static/js/json.js";
  47. import { appPlanStatistics } from "@/api/business/mhxf/xunJian/index.js";
  48. const publicStore = publicStores(); //全局公共Store
  49. const xunJianStore = xunJianStores(); //全局变量值Store
  50. const { proxy } = getCurrentInstance();
  51. const inspectList = json.xunJianList; //九宫格json数据
  52. const currentDate = publicStore.getDate().year + "-" + publicStore.getDate().month + "-" + publicStore.getDate().dates;
  53. const currentDateList = ref([]);
  54. function navItemClick(url, id) {
  55. if (url) {
  56. if (id == 1) {
  57. xunJianStore.planTabs = 0;
  58. } else if (id == 2) {
  59. xunJianStore.planTabs = 1;
  60. }
  61. uni.navigateTo({
  62. url: url,
  63. });
  64. } else {
  65. uni.showModal({
  66. title: "Tips",
  67. content: "此模块开发中~",
  68. showCancel: false,
  69. success: function (res) {
  70. if (res.confirm) {
  71. } else if (res.cancel) {
  72. }
  73. },
  74. });
  75. }
  76. }
  77. /**
  78. * @ehcarts
  79. * @api接口请求
  80. */
  81. async function echartsApi() {
  82. appPlanStatistics({
  83. currentDate: currentDate,
  84. }).then((res) => {
  85. if (res.status == "SUCCESS") {
  86. currentDateList.value = [res.data];
  87. } else {
  88. }
  89. });
  90. }
  91. onLoad(() => {
  92. echartsApi();
  93. });
  94. onShow(() => {
  95. //调用系统主题颜色
  96. proxy.$settingStore.systemThemeColor([1]);
  97. });
  98. </script>
  99. <style lang="scss"></style>