This commit is contained in:
messi
2024-08-22 20:16:41 +08:00
parent da3519f3c7
commit 8a61017df2
7 changed files with 140 additions and 211 deletions

View File

@@ -6,30 +6,30 @@
class="monitor-card-tabs"
@change="onSaleTypeChange"
>
<a-tab-pane tab="商品销售排行(全门店)" key="saleroom" />
<a-tab-pane tab="用户消费排行(全门店)" />
<template #rightExtra>
<a-space
size="middle"
:class="[
'analysis-tabs-extra',
{ 'hidden-lg-and-down': styleResponsive }
]"
>
<a-radio-group v-model:value="saleSearch.dateType">
<a-radio-button value="1">今天</a-radio-button>
<a-radio-button value="2">本周</a-radio-button>
<a-radio-button value="3">本月</a-radio-button>
<a-radio-button value="4">本年</a-radio-button>
</a-radio-group>
<div style="width: 300px">
<a-range-picker
value-format="YYYY-MM-DD"
v-model:value="saleSearch.datetime"
/>
</div>
</a-space>
</template>
<a-tab-pane tab="消费统计(全门店)" key="saleroom" />
<!-- <a-tab-pane tab="用户消费排行(全门店)" />-->
<!-- <template #rightExtra>-->
<!-- <a-space-->
<!-- size="middle"-->
<!-- :class="[-->
<!-- 'analysis-tabs-extra',-->
<!-- { 'hidden-lg-and-down': styleResponsive }-->
<!-- ]"-->
<!-- >-->
<!-- <a-radio-group v-model:value="saleSearch.dateType">-->
<!-- <a-radio-button value="1">今天</a-radio-button>-->
<!-- <a-radio-button value="2">本周</a-radio-button>-->
<!-- <a-radio-button value="3">本月</a-radio-button>-->
<!-- <a-radio-button value="4">本年</a-radio-button>-->
<!-- </a-radio-group>-->
<!-- <div style="width: 300px">-->
<!-- <a-range-picker-->
<!-- value-format="YYYY-MM-DD"-->
<!-- v-model:value="saleSearch.datetime"-->
<!-- />-->
<!-- </div>-->
<!-- </a-space>-->
<!-- </template>-->
</a-tabs>
<div style="padding-bottom: 10px">
<a-row :gutter="16">
@@ -41,55 +41,14 @@
<div v-if="saleSearch.type === 'saleroom'" class="demo-monitor-title">
销售量趋势
</div>
<div v-else class="demo-monitor-title">访问量趋势</div>
<v-chart
ref="saleChartRef"
:option="saleChartOption"
style="height: 320px"
/>
</a-col>
<a-col
v-bind="
styleResponsive ? { lg: 7, md: 9, sm: 24, xs: 24 } : { span: 7 }
"
>
<div v-if="saleSearch.type === 'saleroom'">
<div class="demo-monitor-title">门店销售额排名</div>
<div
v-for="(item, index) in saleroomRankData"
:key="index"
class="demo-monitor-rank-item ele-cell"
>
<ele-tag
shape="circle"
:color="index < 3 ? '#314659' : ''"
style="border: none"
>
{{ index + 1 }}
</ele-tag>
<div class="ele-cell-content ele-elip">{{ item.name }}</div>
<div class="ele-text-secondary">{{ item.value }}</div>
</div>
</div>
<div v-else>
<div class="demo-monitor-title">门店访问量排名</div>
<div
v-for="(item, index) in visitsRankData"
:key="index"
class="demo-monitor-rank-item ele-cell"
>
<ele-tag
shape="circle"
:color="index < 3 ? '#314659' : ''"
style="border: none"
>
{{ index + 1 }}
</ele-tag>
<div class="ele-cell-content ele-elip">{{ item.name }}</div>
<div class="ele-text-secondary">{{ item.value }}</div>
</div>
</div>
</a-col>
</a-row>
</div>
</a-card>
@@ -169,8 +128,8 @@
const getSaleroomData = () => {
getSaleroomList()
.then((data) => {
saleroomData1.value = data.list1;
saleroomData2.value = data.list2;
saleroomData1.value = data.orderStatisticsList;
saleroomData2.value = data.salesAmountStatisticsList;
onSaleTypeChange();
})
.catch((e) => {
@@ -188,7 +147,7 @@
xAxis: [
{
type: 'category',
data: saleroomData1.value.map((d) => d.month)
data: saleroomData1.value.map((d) => d.startStatisticsDate)
}
],
yAxis: [
@@ -199,7 +158,7 @@
series: [
{
type: 'bar',
data: saleroomData1.value.map((d) => d.value)
data: saleroomData1.value.map((d) => d.dailyNewOrders)
}
]
});
@@ -211,7 +170,7 @@
xAxis: [
{
type: 'category',
data: saleroomData2.value.map((d) => d.month)
data: saleroomData2.value.map((d) => d.startStatisticsDate)
}
],
yAxis: [
@@ -222,7 +181,7 @@
series: [
{
type: 'bar',
data: saleroomData2.value.map((d) => d.value)
data: saleroomData2.value.map((d) => d.dailySale)
}
]
});