|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="workbench">
|
|
|
<div class="md:flex">
|
|
|
- <el-card class="!border-none mb-4 md:mr-4" shadow="never">
|
|
|
+ <el-card class="!border-none mb-4 md:mr-4" shadow="never" style="flex-grow: 1">
|
|
|
<template #header>
|
|
|
<span class="card-title">店铺信息</span>
|
|
|
</template>
|
|
@@ -39,10 +39,10 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
- <el-card class="!border-none mb-4 flex-1" shadow="never">
|
|
|
+ <el-card class="!border-none mb-4 flex-1" shadow="never" style="flex-grow: 4">
|
|
|
<template #header>
|
|
|
<div>
|
|
|
- <span class="card-title">今日数据</span>
|
|
|
+ <span class="card-title">统计数据</span>
|
|
|
<!-- <span class="text-tx-secondary text-xs ml-4">
|
|
|
更新时间:{{ workbenchData.today.time }}
|
|
|
</span> -->
|
|
@@ -51,25 +51,34 @@
|
|
|
|
|
|
<div class="flex flex-wrap">
|
|
|
<div class="w-1/2 md:w-1/3">
|
|
|
- <div class="leading-10">到店人次</div>
|
|
|
- <div class="text-6xl">{{ workbenchData.today.todayVisits }}</div>
|
|
|
- <!-- <div class="text-tx-secondary text-xs">
|
|
|
- 总访问量:{{ workbenchData.today.totalVisits }}
|
|
|
- </div> -->
|
|
|
+ <div class="leading-10">下单人数</div>
|
|
|
+ <div class="text-6xl">{{ workbenchData.statistic.todayVisits }}</div>
|
|
|
+ <div class="text-tx-secondary text-lg">
|
|
|
+ 当月:{{ workbenchData.statistic.monthVisits }}
|
|
|
+ </div>
|
|
|
+ <div class="text-tx-secondary text-lg">
|
|
|
+ 累计:{{ workbenchData.statistic.totalVisits }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="w-1/2 md:w-1/3">
|
|
|
- <div class="leading-10">销售额(元)</div>
|
|
|
- <div class="text-6xl">{{ workbenchData.today.todaySales }}</div>
|
|
|
- <!-- <div class="text-tx-secondary text-xs">
|
|
|
- 总销售额:{{ workbenchData.today.totalSales }}
|
|
|
- </div> -->
|
|
|
+ <div class="leading-10">订单数(笔)</div>
|
|
|
+ <div class="text-6xl">{{ workbenchData.statistic.todayOrder }}</div>
|
|
|
+ <div class="text-tx-secondary text-lg">
|
|
|
+ 当月:{{ workbenchData.statistic.monthOrder }}
|
|
|
+ </div>
|
|
|
+ <div class="text-tx-secondary text-lg">
|
|
|
+ 累计:{{ workbenchData.statistic.totalOrder }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="w-1/2 md:w-1/3">
|
|
|
- <div class="leading-10">订单量(笔)</div>
|
|
|
- <div class="text-6xl">{{ workbenchData.today.todayOrder }}</div>
|
|
|
- <!-- <div class="text-tx-secondary text-xs">
|
|
|
- 总订单量:{{ workbenchData.today.totalOrder }}
|
|
|
- </div> -->
|
|
|
+ <div class="leading-10">营收额(元)</div>
|
|
|
+ <div class="text-6xl">{{ workbenchData.statistic.todaySales }}</div>
|
|
|
+ <div class="text-tx-secondary text-lg">
|
|
|
+ 当月:{{ workbenchData.statistic.monthSales }}
|
|
|
+ </div>
|
|
|
+ <div class="text-tx-secondary text-lg">
|
|
|
+ 累计:{{ workbenchData.statistic.totalSales }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<!-- <div class="w-1/2 md:w-1/4">
|
|
|
<div class="leading-10">新到店人数</div>
|
|
@@ -115,7 +124,7 @@
|
|
|
</el-card>
|
|
|
<el-card class="!border-none mb-4" shadow="never">
|
|
|
<template #header>
|
|
|
- <span>昨日被点菜品TOP10</span>
|
|
|
+ <span>过去7天被点菜品Top10</span>
|
|
|
</template>
|
|
|
<div>
|
|
|
<v-charts
|
|
@@ -184,7 +193,7 @@ const workbenchData: any = reactive({
|
|
|
desc: '想了解更多请添加客服'
|
|
|
}
|
|
|
],
|
|
|
- today: {}, // 今日数据
|
|
|
+ statistic: {}, // 今日数据
|
|
|
menu: [
|
|
|
{
|
|
|
name: '管理员',
|
|
@@ -354,7 +363,7 @@ const workbenchData: any = reactive({
|
|
|
const getData = async () => {
|
|
|
const res = await getWorkbench()
|
|
|
workbenchData.version = res.version
|
|
|
- workbenchData.today = res.today
|
|
|
+ workbenchData.statistic = res.statistic
|
|
|
workbenchData.visitor = res.visitor
|
|
|
|
|
|
// 清空echarts 数据
|
|
@@ -382,12 +391,12 @@ const changeStatus = () => {
|
|
|
}
|
|
|
const dishTop10 = () => {
|
|
|
statisticsDishTop10().then((res) => {
|
|
|
- let list = res || [];
|
|
|
+ const list = res || []
|
|
|
// 按照 quantity 倒序排列
|
|
|
- list.sort((a: { quantity: number }, b: { quantity: number }) => b.quantity - a.quantity);
|
|
|
+ list.sort((a: { quantity: number }, b: { quantity: number }) => b.quantity - a.quantity)
|
|
|
// console.warn("**statisticsDishTop10****",list)
|
|
|
- workbenchData.listOption.yAxis.data = list.map((it: { title: any })=>it.title);
|
|
|
- workbenchData.listOption.series[0].data = list.map((it: { quantity: any })=>it.quantity);
|
|
|
+ workbenchData.listOption.yAxis.data = list.map((it: { title: any }) => it.title)
|
|
|
+ workbenchData.listOption.series[0].data = list.map((it: { quantity: any }) => it.quantity)
|
|
|
})
|
|
|
}
|
|
|
shopInfo()
|