rest day in chart
This commit is contained in:
@@ -14,6 +14,7 @@ import type { EChartsOption } from "echarts";
|
||||
import DateRangeChartCard from "@/components/DateRangeChartCard.vue";
|
||||
import type { GaoProductSalesDailyStatView } from "@/types/GaoChart";
|
||||
import { buildAxisChartOption, getDailyItem, getNumber } from "@/pages/product/component/chartUtils";
|
||||
import { buildRestDayMarkArea, useRestDayCalendar } from "@/pages/store/component/useRestDayCalendar";
|
||||
|
||||
defineOptions({
|
||||
name: "ProductSalesTrendChart"
|
||||
@@ -25,6 +26,9 @@ const props = defineProps<{
|
||||
loading: boolean;
|
||||
}>();
|
||||
|
||||
const dateTextList = computed(() => props.dateTextList);
|
||||
const { restDaySet } = useRestDayCalendar(dateTextList);
|
||||
|
||||
function buildOption(visibleDateTextList: string[]): EChartsOption {
|
||||
const labelList = visibleDateTextList.map(item => item.slice(5));
|
||||
return {
|
||||
@@ -58,6 +62,7 @@ function buildOption(visibleDateTextList: string[]): EChartsOption {
|
||||
type: "bar",
|
||||
stack: "quantity",
|
||||
yAxisIndex: 0,
|
||||
markArea: buildRestDayMarkArea(visibleDateTextList, restDaySet.value, window.innerWidth - 32),
|
||||
data: visibleDateTextList.map(dateText => getNumber(getDailyItem(props.list, dateText)?.directBaseQuantity))
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user