From 4299cce7387e8ea2c5222ff1357f2a6c3459e4a7 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期一, 22 七月 2024 17:13:38 +0800
Subject: [PATCH] 整理 summaryCom.vue,修改使用https

---
 src/components/chat/chatComponents/common.ts |   74 ++++++++++++++++++++++++++++++++++++
 1 files changed, 73 insertions(+), 1 deletions(-)

diff --git a/src/components/chat/chatComponents/common.ts b/src/components/chat/chatComponents/common.ts
index ce27b57..4cdc0c8 100644
--- a/src/components/chat/chatComponents/common.ts
+++ b/src/components/chat/chatComponents/common.ts
@@ -1,5 +1,8 @@
+import type * as echarts from 'echarts';
 import { buildProps } from 'element-plus/es/utils/vue/props/runtime';
+import _ from 'lodash';
 import type { ExtractPropTypes, PropType } from 'vue';
+import { axisLabelFormatter } from '/@/utils/chart';
 
 export const timeDataOptionToContent = (opt) => {
 	const headerList = [opt.xAxis[0]]
@@ -47,6 +50,75 @@
 export const chatComProps = buildProps({
 	data: {
 		type: Object as PropType<any>,
-	}
+	},
+	originData: {
+		type: Object as PropType<any>,
+	},
 } as const);
 export type ChatComPropsType = ExtractPropTypes<typeof chatComProps>;
+
+export const getChatChartOption = () => {
+	const option = {
+		grid: {
+			// bottom: 120,
+			// right: '15%',
+			left: 35,
+			right: 45,
+		},
+		tooltip: {
+			show: true,
+			trigger: 'axis',
+		},
+		toolbox: {
+			show: true,
+			feature: {
+				dataZoom: {
+					yAxisIndex: 'none',
+				},
+
+				myBar: {
+					title: '杞寲涓烘煴鐘跺浘',
+					show: true,
+					icon: PATH_ICON.bar,
+				},
+
+				myScatter: {
+					title: '杞寲涓烘暎鐐瑰浘',
+					show: true,
+					icon: PATH_ICON.scatter,
+				},
+				myLine: {
+					title: '杞寲涓烘洸绾垮浘',
+					show: true,
+					icon: PATH_ICON.line,
+				},
+				dataView: {
+					readOnly: true,
+					optionToContent: timeDataOptionToContent,
+				},
+				saveAsImage: {},
+			},
+		},
+
+		title: {
+			left: 'center',
+			textStyle: {
+				fontSize: 14,
+			},
+		},
+		xAxis: {
+			type: 'time',
+		},
+		yAxis: {
+			type: 'value',
+			axisLabel: {
+				formatter: axisLabelFormatter,
+			},
+		},
+		dataZoom: {
+			type: 'inside',
+		},
+	} as echarts.EChartsOption;
+
+	return _.cloneDeep(option);
+};

--
Gitblit v1.9.3