overview.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <!-- 对应页面:支付统计-概况 -->
  3. <view class="fix-top-window">
  4. <view class="uni-header">
  5. <uni-stat-breadcrumb class="uni-stat-breadcrumb-on-phone" />
  6. </view>
  7. <view class="uni-container">
  8. <view class="uni-stat--x flex p-1015">
  9. <view class="uni-stat--app-select">
  10. <uni-data-select collection="opendb-app-list" field="appid as value, name as text" orderby="text asc" :defItem="1" label="应用选择" v-model="query.appid" :clear="false" />
  11. <uni-data-select collection="opendb-app-versions" :where="versionQuery" class="ml-m" field="_id as value, version as text, uni_platform as label, create_date as date" format="{label} - {text}" orderby="date desc" label="版本选择" v-model="query.version_id" />
  12. </view>
  13. </view>
  14. <view class="uni-stat--x">
  15. <uni-stat-tabs label="平台选择" type="boldLine" mode="platform" v-model="query.platform_id" @change="platformChange" />
  16. <uni-data-select v-if="query.platform_id && query.platform_id.indexOf('==') === -1" collection="uni-stat-app-channels" :where="channelQuery" class="p-channel" field="_id as value, channel_name as text" orderby="text asc" label="渠道/场景值选择" v-model="query.channel_id" />
  17. </view>
  18. <!-- 下面2个组件用到了uni-table,而uni-table在VUE3模式下部分情况会有问题,目前原因不明,后续修复-->
  19. <!-- 历史数据统计面板(最近7天,本月,本季度,本月,总和 -->
  20. <statPanelTotal :query="query"></statPanelTotal>
  21. <!-- 今日数据统计面板 -->
  22. <statPanelToday :query="query"></statPanelToday>
  23. <!-- 趋势图 -->
  24. <trendChart :query="query"></trendChart>
  25. </view>
  26. <!-- #ifndef H5 -->
  27. <fix-window />
  28. <!-- #endif -->
  29. </view>
  30. </template>
  31. <script>
  32. import {
  33. stringifyQuery,
  34. } from '@/js_sdk/uni-stat/util.js'
  35. import statPanelTotal from "./components/statPanelTotal"
  36. import statPanelToday from "./components/statPanelToday"
  37. import trendChart from "./components/trendChart"
  38. export default {
  39. components: {
  40. statPanelTotal,
  41. statPanelToday,
  42. trendChart,
  43. },
  44. data() {
  45. return {
  46. query: {
  47. appid: '',
  48. platform_id: '',
  49. uni_platform: '',
  50. version_id: '',
  51. channel_id: '',
  52. }
  53. }
  54. },
  55. onLoad(option) {
  56. const {
  57. appid
  58. } = option
  59. if (appid) {
  60. this.query.appid = appid
  61. }
  62. },
  63. computed: {
  64. versionQuery() {
  65. const {
  66. appid,
  67. uni_platform
  68. } = this.query
  69. const query = stringifyQuery({
  70. appid,
  71. uni_platform
  72. })
  73. return query
  74. },
  75. channelQuery() {
  76. const {
  77. appid,
  78. platform_id,
  79. } = this.query
  80. const query = stringifyQuery({
  81. appid,
  82. platform_id
  83. })
  84. return query
  85. },
  86. },
  87. created() {
  88. },
  89. methods: {
  90. platformChange(id, index, name, item) {
  91. this.query.version_id = 0
  92. this.query.uni_platform = item.code
  93. },
  94. },
  95. watch: {
  96. // versionQuery(){
  97. // if (this.$refs["version-select"]) {
  98. // this.$refs["version-select"].mixinDatacomEasyGet();
  99. // }
  100. // }
  101. },
  102. }
  103. </script>
  104. <style>
  105. </style>