xunJian.vue 3.4 KB

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