完善控制台

This commit is contained in:
zjl 2024-12-16 19:22:20 +08:00
parent 7acba96117
commit 57ff474ce0
2 changed files with 63 additions and 6 deletions

View File

@ -31,8 +31,38 @@ export interface TypeConsole {
//获取主控台信息
export function getConsoleInfo() {
return http.request<TypeConsole>({
url: '/dashboard/console',
method: 'get',
});
return consoleInfo;
}
/**
*
*/
const consoleInfo = {
//访问量
visits: {
dayVisits: 32335,
rise: 48,
decline: 85,
amount: 948113,
},
//销售额
saleroom: {
weekSaleroom: 90758,
amount: 411553,
degree: 38.245882,
},
//订单量
orderLarge: {
weekLarge: 35704,
rise: 28,
decline: 28,
amount: 480578,
},
//成交额度
volume: {
weekLarge: 67800,
rise: 96,
decline: 81,
amount: 826814,
},
};

View File

@ -292,7 +292,8 @@
</template>
<script lang="ts" setup>
import { onMounted, h } from 'vue';
import { ref, onMounted, h } from 'vue';
import { getConsoleInfo } from '@/api/dashboard/console';
import { useNotification } from 'naive-ui';
import NewVisitAmount from './components/NewVisitAmount.vue';
import VisitSource from './components/VisitSource.vue';
@ -310,6 +311,21 @@
TagsOutlined,
SettingOutlined,
} from '@vicons/antd';
import type {
TypeConsole,
TypeOrderLarge,
TypeSaleroom,
TypeVisits,
} from '@/api/dashboard/console';
/**
* 定义参数
*/
const loading = ref(true);
const visits = ref<TypeVisits>();
const saleroom = ref<TypeSaleroom>();
const orderLarge = ref<TypeOrderLarge>();
const volume = ref<TypeOrderLarge>();
//
const iconList = [
@ -387,8 +403,19 @@
},
];
/**
* 钩子函数
*/
const notification = useNotification();
onMounted(() => {
onMounted(async () => {
const res: TypeConsole = await getConsoleInfo();
visits.value = res.visits;
saleroom.value = res.saleroom;
orderLarge.value = res.orderLarge;
volume.value = res.volume;
loading.value = false;
//
if (!localStorage.getItem('adClosed')) {
notification.info({
title: '双十二限时特惠',