xunJian.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <scroll-view class="scroll-height" :scroll-y="true" :data-theme="'theme-' + proxy.$settingStore.themeColor.name">
  3. <view class="padding-sm">
  4. <!-- 图表 -->
  5. <view class="section1 section bg-white padding-xs">
  6. <chart :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=" 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/chart.vue";
  46. import { appPlanStatistics } from "@/api/business/mhxf/xunJian/index.js";
  47. const publicStore = publicStores(); //全局公共Store
  48. const xunJianStore = xunJianStores(); //全局变量值Store
  49. const { proxy } = getCurrentInstance();
  50. const inspectList = proxy.$grid.xunJianList; //九宫格json数据
  51. const currentDate = publicStore.getDate().year + "-" + publicStore.getDate().month + "-" + publicStore.getDate().dates;
  52. const currentDateList = ref([]);
  53. function navItemClick(url, id) {
  54. if (url) {
  55. if (id == 1) {
  56. xunJianStore.planTabs = 0;
  57. } else if (id == 2) {
  58. xunJianStore.planTabs = 1;
  59. }
  60. proxy.$tab.redirectTo(url);
  61. } else {
  62. uni.showModal({
  63. title: "Tips",
  64. content: "此模块开发中~",
  65. showCancel: false,
  66. success: function (res) {
  67. if (res.confirm) {
  68. } else if (res.cancel) {
  69. }
  70. },
  71. });
  72. }
  73. }
  74. /**
  75. * @ehcarts
  76. * @api接口请求
  77. */
  78. async function echartsApi() {
  79. appPlanStatistics({
  80. currentDate: currentDate,
  81. }).then((res) => {
  82. if (res.status == "SUCCESS") {
  83. currentDateList.value = [res.data];
  84. } else {
  85. }
  86. });
  87. }
  88. onLoad(() => {
  89. echartsApi();
  90. });
  91. onShow(() => {
  92. //调用系统主题颜色
  93. proxy.$settingStore.systemThemeColor([1]);
  94. });
  95. </script>
  96. <style lang="scss"></style>