Commit 1d0dc7fd741f96ed6d31b071d5771151c7ccd614
1 parent
5b4ea797
修改销售额bug
Showing
5 changed files
with
30 additions
and
8 deletions
src/store/modules/user.ts
... | ... | @@ -15,7 +15,7 @@ import { usePermissionStore } from '/@/store/modules/permission'; |
15 | 15 | import { RouteRecordRaw } from 'vue-router'; |
16 | 16 | import { PAGE_NOT_FOUND_ROUTE } from '/@/router/routes/basic'; |
17 | 17 | import { isArray } from '/@/utils/is'; |
18 | -import { h } from 'vue'; | |
18 | +import { h, ref } from 'vue'; | |
19 | 19 | |
20 | 20 | interface UserState { |
21 | 21 | userInfo: Nullable<UserInfo>; |
... | ... | @@ -188,3 +188,6 @@ export const useUserStore = defineStore({ |
188 | 188 | export function useUserStoreWithOut() { |
189 | 189 | return useUserStore(store); |
190 | 190 | } |
191 | + | |
192 | +//分析台切换页面变量 | |
193 | +export const exchangeTab = ref('tab1'); | ... | ... |
src/views/dashboard/analysis/components/SiteAnalysis.vue
... | ... | @@ -18,6 +18,7 @@ |
18 | 18 | import { Card } from 'ant-design-vue'; |
19 | 19 | import VisitAnalysis from './VisitAnalysis.vue'; |
20 | 20 | import VisitAnalysisBar from './VisitAnalysisBar.vue'; |
21 | + import { exchangeTab } from '@/store/modules/user'; | |
21 | 22 | |
22 | 23 | const activeKey = ref('tab1'); |
23 | 24 | |
... | ... | @@ -26,13 +27,14 @@ |
26 | 27 | key: 'tab1', |
27 | 28 | tab: '订单趋势', |
28 | 29 | }, |
29 | - // { | |
30 | - // key: 'tab2', | |
31 | - // tab: '访问量', | |
32 | - // }, | |
30 | + { | |
31 | + key: 'tab2', | |
32 | + tab: '销售额完成率', | |
33 | + }, | |
33 | 34 | ]; |
34 | 35 | |
35 | 36 | function onTabChange(key) { |
36 | 37 | activeKey.value = key; |
38 | + exchangeTab.value = key; | |
37 | 39 | } |
38 | 40 | </script> | ... | ... |
src/views/dashboard/analysis/components/VisitAnalysisBar.vue
... | ... | @@ -41,6 +41,17 @@ |
41 | 41 | type: 'bar', |
42 | 42 | barMaxWidth: 80, |
43 | 43 | }, |
44 | + { | |
45 | + smooth: true, | |
46 | + data: [111, 222, 4000, 1800, 3333, 555, 666, 333], | |
47 | + type: 'line', | |
48 | + areaStyle: { | |
49 | + color: 'rgba(255, 255, 255, 0)', | |
50 | + }, | |
51 | + itemStyle: { | |
52 | + color: 'rgba(124, 205, 214)', | |
53 | + }, | |
54 | + }, | |
44 | 55 | ], |
45 | 56 | }); |
46 | 57 | }); | ... | ... |
src/views/dashboard/analysis/index.vue
... | ... | @@ -10,14 +10,20 @@ |
10 | 10 | </div> |
11 | 11 | </template> |
12 | 12 | <script lang="ts" setup> |
13 | - import { onMounted, ref } from 'vue'; | |
13 | + import { onMounted, ref, watch } from 'vue'; | |
14 | 14 | import GrowCard from './components/GrowCard.vue'; |
15 | 15 | import SiteAnalysis from './components/SiteAnalysis.vue'; |
16 | 16 | import { useDataStoreWithOut } from '/@/store/modules/data'; |
17 | + import { exchangeTab } from '@/store/modules/user'; | |
17 | 18 | |
18 | 19 | const loading = ref(true); |
19 | 20 | const dataStore = useDataStoreWithOut(); |
20 | - | |
21 | + watch( | |
22 | + () => exchangeTab.value, | |
23 | + () => { | |
24 | + console.log(exchangeTab.value, 56562); | |
25 | + }, | |
26 | + ); | |
21 | 27 | onMounted(() => { |
22 | 28 | dataStore.getFetchData(); |
23 | 29 | dataStore.getFetchChartData(); | ... | ... |