From 534533425b15b183cea60fa162d9884e5d3c6243 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 13 十月 2026 17:55:50 +0800
Subject: [PATCH] Merge branch 'dev_海西州_北京同仁堂' into dev_海西州_惠牧
---
src/views/erp/finance/statistics/modules/trend-chart.vue | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 101 insertions(+), 0 deletions(-)
diff --git a/src/views/erp/finance/statistics/modules/trend-chart.vue b/src/views/erp/finance/statistics/modules/trend-chart.vue
new file mode 100644
index 0000000..b3e3626
--- /dev/null
+++ b/src/views/erp/finance/statistics/modules/trend-chart.vue
@@ -0,0 +1,101 @@
+<script lang="ts" setup>
+import type { EChartsOption, EchartsUIType } from '@vben/plugins/echarts';
+import type { FinStatisticsApi } from '#/api/erp/finance/statistics';
+
+import { ref, watch } from 'vue';
+
+import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
+
+import { Card } from 'ant-design-vue';
+
+interface Props {
+ list?: FinStatisticsApi.StatisticsTrend[];
+ loading?: boolean;
+}
+
+const props = withDefaults(defineProps<Props>(), {
+ list: () => [],
+ loading: false,
+});
+
+const chartRef = ref<EchartsUIType>();
+const { renderEcharts } = useEcharts(chartRef);
+
+/** 鏌辩姸绯诲垪鍏叡閰嶇疆锛坱ype 闇�涓哄瓧闈㈤噺锛屾晠鐢� as const锛� */
+const BAR_SERIES = { type: 'bar', barMaxWidth: 24 } as const;
+/** 鎶樼嚎绯诲垪鍏叡閰嶇疆 */
+const LINE_SERIES = { type: 'line', smooth: true, symbolSize: 6 } as const;
+
+/** 閲戦鎶樼嚎/鏌辩姸鍥鹃厤缃紙series 鍦� watch 涓寜鏈堜唤鏁版嵁濉厖锛� */
+const baseChartOptions: EChartsOption = {
+ grid: {
+ left: 20,
+ right: 20,
+ bottom: 20,
+ top: 60,
+ containLabel: true,
+ },
+ legend: {
+ top: 15,
+ },
+ toolbox: {
+ feature: {
+ saveAsImage: { show: true, name: '鏀舵敮瓒嬪娍' },
+ },
+ },
+ tooltip: {
+ trigger: 'axis',
+ axisPointer: { type: 'cross' },
+ padding: [5, 10],
+ },
+ xAxis: {
+ type: 'category',
+ axisTick: { show: false },
+ data: [],
+ },
+ yAxis: {
+ type: 'value',
+ axisTick: { show: false },
+ },
+};
+
+watch(
+ () => props.list,
+ (list) => {
+ if (!list) {
+ return;
+ }
+ renderEcharts({
+ ...baseChartOptions,
+ xAxis: {
+ ...baseChartOptions.xAxis,
+ data: list.map((item) => item.month),
+ },
+ series: [
+ {
+ ...BAR_SERIES,
+ name: '鏀舵閲戦',
+ data: list.map((item) => item.receiptPrice ?? 0),
+ },
+ {
+ ...BAR_SERIES,
+ name: '浠樻閲戦',
+ data: list.map((item) => item.paymentPrice ?? 0),
+ },
+ {
+ ...LINE_SERIES,
+ name: '鍑�鍒╂鼎',
+ data: list.map((item) => item.netProfit ?? 0),
+ },
+ ],
+ });
+ },
+ { immediate: true, deep: true },
+);
+</script>
+
+<template>
+ <Card title="鏈堝害鏀舵敮瓒嬪娍" class="h-full shadow-sm" :loading="loading">
+ <EchartsUI ref="chartRef" height="360px" />
+ </Card>
+</template>
--
Gitblit v1.9.3