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 { GaoProductStockMovementDailyStatView } from "@/types/GaoChart";
|
||||
import { buildAxisChartOption, getDailyItem, getNumber } from "@/pages/product/component/chartUtils";
|
||||
import { buildRestDayMarkArea, useRestDayCalendar } from "@/pages/store/component/useRestDayCalendar";
|
||||
|
||||
defineOptions({
|
||||
name: "ProductStockMovementChart"
|
||||
@@ -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 {
|
||||
@@ -40,11 +44,14 @@ function buildOption(visibleDateTextList: string[]): EChartsOption {
|
||||
{
|
||||
name: "入库",
|
||||
type: "bar",
|
||||
stack: "stock-movement",
|
||||
markArea: buildRestDayMarkArea(visibleDateTextList, restDaySet.value, window.innerWidth - 32),
|
||||
data: visibleDateTextList.map(dateText => Math.abs(getNumber(getDailyItem(props.list, dateText)?.inQuantity)))
|
||||
},
|
||||
{
|
||||
name: "出库",
|
||||
type: "bar",
|
||||
stack: "stock-movement",
|
||||
data: visibleDateTextList.map(dateText => -Math.abs(getNumber(getDailyItem(props.list, dateText)?.outQuantity)))
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user