index.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <div class="layout-padding">
  3. <div class="!overflow-auto px-1">
  4. <Lcard :height="440">
  5. <template #default>
  6. <Title style="margin-bottom: 10px;" title="整体趋势">
  7. <el-popover class="box-item" placement="right" trigger="hover" width="250">
  8. <template #reference>
  9. <el-icon class="ml-1" style="color: #a4b8cf">
  10. <InfoFilled />
  11. </el-icon>
  12. </template>
  13. <template #default>
  14. <div class="ant-popover-inner-content">
  15. <div class="um-page-tips-content" style="line-height: 24px">
  16. <p><span class="highlight">新增用户:</span><span>第一次启动应用的用户(以设备为判断标准)</span></p>
  17. <p><span class="highlight">新增账号:</span><span>第一次启动应用的账号</span></p>
  18. <p><span class="highlight">新增用户占比:</span><span>某时段内新增用户占该时段活跃用户的比例</span></p>
  19. <p>
  20. <span>
  21. 按天、周或月查看数据可进行版本、渠道的交叉筛选,小时数据最多展示7天并且不支持筛选。周区间定义为周日至次周周六。按周(按月)显示时,界面上用每周的周日(每个月的第一日)来代表该周(该月)
  22. </span>
  23. </p>
  24. </div>
  25. </div>
  26. </template>
  27. </el-popover>
  28. </Title>
  29. <div class="msg">
  30. <el-icon class="ml-1" style="color: #a4b8cf; vertical-align: middle;">
  31. <InfoFilled />
  32. </el-icon>
  33. 前往
  34. <span class="link">U-DOP数据开放平台</span>
  35. ,获取用户访问明细日志,点击查看
  36. <span class="link">支持返还的字段</span>
  37. </div>
  38. <div class="box1">
  39. <Lcard :height="280" style="margin-right: 20px;">
  40. <div class="card-box1">
  41. <InfoCard title="订单数量" value="1,234" description="较昨日减少 1.2%">
  42. <template #icon>
  43. <img src="./icons/icon1.svg" alt="icon">
  44. </template>
  45. </InfoCard>
  46. <InfoCard title="订单数量" value="1,234" description="较昨日减少 1.2%">
  47. <template #icon>
  48. <img src="./icons/icon2.svg" alt="icon">
  49. </template>
  50. </InfoCard>
  51. <InfoCard title="订单数量" value="1,234" description="较昨日减少 1.2%">
  52. <template #icon>
  53. <img src="./icons/icon3.svg" alt="icon">
  54. </template>
  55. </InfoCard>
  56. <InfoCard title="订单数量" value="1,234" description="较昨日减少 1.2%">
  57. <template #icon>
  58. <img src="./icons/icon4.svg" alt="icon">
  59. </template>
  60. </InfoCard>
  61. </div>
  62. </Lcard>
  63. <Lcard :height="280">
  64. <div class="card-box2">
  65. <InfoCard title="订单数量" value="1,234" description="较昨日减少 1.2%">
  66. <template #icon>
  67. <img src="./icons/icon5.svg" alt="icon">
  68. </template>
  69. </InfoCard>
  70. <InfoCard title="订单数量" value="1,234" description="较昨日减少 1.2%">
  71. <template #icon>
  72. <img src="./icons/icon6.svg" alt="icon">
  73. </template>
  74. </InfoCard>
  75. <InfoCard title="订单数量" value="1,234" description="较昨日减少 1.2%">
  76. <template #icon>
  77. <img src="./icons/icon7.svg" alt="icon">
  78. </template>
  79. </InfoCard>
  80. <InfoCard title="订单数量" value="1,234" description="较昨日减少 1.2%">
  81. <template #icon>
  82. <img src="./icons/icon8.svg" alt="icon">
  83. </template>
  84. </InfoCard>
  85. <InfoCard title="订单数量" value="1,234" description="较昨日减少 1.2%">
  86. <template #icon>
  87. <img src="./icons/icon9.svg" alt="icon">
  88. </template>
  89. </InfoCard>
  90. </div>
  91. </Lcard>
  92. </div>
  93. </template>
  94. </Lcard>
  95. <Lcard :height="975">
  96. <el-date-picker
  97. style="float: left;"
  98. v-model="timeRange"
  99. type="datetimerange"
  100. range-separator="To"
  101. start-placeholder="Start date"
  102. end-placeholder="End date"
  103. />
  104. <div class="link" style="float: right;">订阅</div>
  105. <div class="link" style="float: right;">编辑指标</div>
  106. <div class="link" style="float: right;">生成AI简报</div>
  107. <div class="line"></div>
  108. <div class="flex items-center justify-between mb-2 mt-3">
  109. <el-form>
  110. <el-form-item>
  111. <el-select style="width: 140px" placeholder="渠道对比">
  112. <!-- <el-option v-for="item in channelCompareOptions" :key="item.value" :label="item.label" :value="item.value" /> -->
  113. </el-select>
  114. <el-button class="ml-2">对比时间</el-button>
  115. </el-form-item>
  116. </el-form>
  117. <div class="flex items-center">
  118. <el-radio-group size="small">
  119. <el-radio-button label="hour">新增用户</el-radio-button>
  120. <el-radio-button label="day">活跃用户</el-radio-button>
  121. <el-radio-button label="week">启动次数</el-radio-button>
  122. <el-radio-button label="month">累计用户</el-radio-button>
  123. </el-radio-group>
  124. </div>
  125. </div>
  126. <div class="relative">
  127. <div ref="qChartRef" style="width: 100%; height: 320px"></div>
  128. </div>
  129. </Lcard>
  130. <Lcard :height="440" />
  131. <Lcard :height="440" />
  132. <Lcard :height="440" />
  133. </div>
  134. </div>
  135. </template>
  136. <script lang="ts" name="countMainTrend" setup>
  137. import { ref, onMounted, watch, computed, defineAsyncComponent } from 'vue';
  138. import { useI18n } from 'vue-i18n';
  139. import * as echarts from 'echarts';
  140. // 引入组件
  141. const Lcard = defineAsyncComponent(() => import('/@/components/LYcom/Lcard/index.vue'));
  142. const Title = defineAsyncComponent(() => import('/@/components/Title/index.vue'));
  143. const InfoCard = defineAsyncComponent(() => import('./infoCard.vue'));
  144. const { t } = useI18n();
  145. const timeRange = ref(null);
  146. const qChartRef = ref<HTMLDivElement | null>(null);
  147. let qualityChart: echarts.ECharts | null = null;
  148. onMounted(() => {
  149. setTimeout(() => {
  150. initQualityChart();
  151. }, 500);
  152. });
  153. const qualityXAxis = ref<string[]>([
  154. '2025-07-01',
  155. '2025-07-08',
  156. '2025-07-15',
  157. '2025-07-22',
  158. '2025-07-29',
  159. '2025-08-05',
  160. '2025-08-12',
  161. '2025-08-19',
  162. '2025-08-26',
  163. '2025-09-02',
  164. '2025-09-09',
  165. '2025-09-16',
  166. ]);
  167. const retentionSeries = ref<number[]>([20, 23, 27, 24, 22, 15, 5, 4, 16, 26, 25, 2]);
  168. const industryAvgSeries = ref<number[]>([16, 18, 20, 24, 25, 24, 16, 10, 15, 22, 21, 12]);
  169. const peerSameScaleSeries = ref<number[]>([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
  170. function initQualityChart(): void {
  171. if (!qChartRef.value) return;
  172. if (qualityChart) qualityChart.dispose();
  173. qualityChart = echarts.init( qChartRef.value);
  174. debugger
  175. const option: echarts.EChartsOption = {
  176. tooltip: { trigger: 'axis', valueFormatter: (v) => `${v}%` },
  177. legend: { data: ['留存率', '同行业App', '同行业同规模App'] },
  178. grid: { left: 40, right: 20, top: 30, bottom: 30 },
  179. xAxis: { type: 'category', data: qualityXAxis.value },
  180. yAxis: {
  181. type: 'value',
  182. min: 0,
  183. max: 30,
  184. axisLabel: { formatter: '{value}%' },
  185. splitLine: { lineStyle: { color: '#f3f4f6' } },
  186. },
  187. series: [
  188. { name: '留存率', type: 'line', smooth: true, data: retentionSeries.value },
  189. { name: '同行业App', type: 'line', smooth: true, data: industryAvgSeries.value, color: '#f59e0b' },
  190. { name: '同行业同规模App', type: 'line', smooth: true, data: peerSameScaleSeries.value, color: '#60a5fa' },
  191. ],
  192. };
  193. qualityChart.setOption(option);
  194. }
  195. </script>
  196. <style lang="scss" scoped>
  197. .msg {
  198. height: 30px;
  199. background-color: #f4f5fa;
  200. line-height: 30px;
  201. font-size: 12px;
  202. }
  203. .link {
  204. color: #167af0;
  205. cursor: pointer;
  206. }
  207. .box1 {
  208. display: flex;
  209. margin-top: 30px;
  210. .card-box1,
  211. .card-box2 {
  212. display: flex;
  213. flex-wrap: wrap;
  214. justify-content: start;
  215. }
  216. .card-box1 {
  217. .info-card {
  218. width: 48%;
  219. }
  220. }
  221. .card-box2 {
  222. .info-card {
  223. width: 33%;
  224. }
  225. }
  226. }
  227. .line {
  228. margin: 90px -30px 30px;
  229. height: 1px;
  230. background-color: #E6E6E6;
  231. }
  232. </style>