From a1d7e81859f554f3a53680cc35f0f49bf1f77098 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 14 五月 2026 14:37:02 +0800
Subject: [PATCH] 导入项目

---
 src/views/erp/home/components/TimeSummaryChart.vue |   86 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/src/views/erp/home/components/TimeSummaryChart.vue b/src/views/erp/home/components/TimeSummaryChart.vue
new file mode 100644
index 0000000..127fa87
--- /dev/null
+++ b/src/views/erp/home/components/TimeSummaryChart.vue
@@ -0,0 +1,86 @@
+<template>
+  <el-card shadow="never">
+    <template #header>
+      <CardTitle :title="props.title" />
+    </template>
+    <!-- 鎶樼嚎鍥� -->
+    <Echart :height="300" :options="lineChartOptions" />
+  </el-card>
+</template>
+<script lang="ts" setup>
+import { EChartsOption } from 'echarts'
+import { formatDate } from '@/utils/formatTime'
+import { CardTitle } from '@/components/Card'
+import { propTypes } from '@/utils/propTypes'
+
+/** 浼氬憳鐢ㄦ埛缁熻鍗$墖 */
+defineOptions({ name: 'MemberStatisticsCard' })
+
+const props = defineProps({
+  title: propTypes.string.def('').isRequired,
+  value: propTypes.object.isRequired
+})
+
+/** 鎶樼嚎鍥鹃厤缃� */
+const lineChartOptions = reactive<EChartsOption>({
+  dataset: {
+    dimensions: ['time', 'price'],
+    source: []
+  },
+  grid: {
+    left: 20,
+    right: 20,
+    bottom: 20,
+    top: 80,
+    containLabel: true
+  },
+  legend: {
+    top: 50
+  },
+  series: [{ name: '閲戦', type: 'line', smooth: true, areaStyle: {} }],
+  toolbox: {
+    feature: {
+      // 鏁版嵁鍖哄煙缂╂斁
+      dataZoom: {
+        yAxisIndex: false // Y杞翠笉缂╂斁
+      },
+      brush: {
+        type: ['lineX', 'clear'] // 鍖哄煙缂╂斁鎸夐挳銆佽繕鍘熸寜閽�
+      },
+      saveAsImage: { show: true, name: props.title } // 淇濆瓨涓哄浘鐗�
+    }
+  },
+  tooltip: {
+    trigger: 'axis',
+    axisPointer: {
+      type: 'cross'
+    },
+    padding: [5, 10]
+  },
+  xAxis: {
+    type: 'category',
+    boundaryGap: false,
+    axisTick: {
+      show: false
+    }
+  },
+  yAxis: {
+    axisTick: {
+      show: false
+    }
+  }
+}) as EChartsOption
+
+watch(
+  () => props.value,
+  (val) => {
+    if (!val) {
+      return
+    }
+    // 鏇存柊 Echarts 鏁版嵁
+    if (lineChartOptions.dataset && lineChartOptions.dataset['source']) {
+      lineChartOptions.dataset['source'] = val
+    }
+  }
+)
+</script>

--
Gitblit v1.8.0