完善控制台
This commit is contained in:
parent
7acba96117
commit
57ff474ce0
@ -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,
|
||||
},
|
||||
};
|
||||
|
@ -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: '双十二限时特惠',
|
||||
|
Loading…
Reference in New Issue
Block a user