From 934476675043ff22c013776f2a3df350e03c732e Mon Sep 17 00:00:00 2001 From: wangyilin <1454641981@qq.com> Date: Wed, 14 May 2025 15:35:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/center/chart/draw.tsx | 92 ---------------- .../components/center/chart/draw.vue | 103 ++++++++++++++++++ .../components/center/index.vue | 4 +- src/views/overviewLargeScreen/index.vue | 5 +- 4 files changed, 108 insertions(+), 96 deletions(-) delete mode 100644 src/views/overviewLargeScreen/components/center/chart/draw.tsx create mode 100644 src/views/overviewLargeScreen/components/center/chart/draw.vue diff --git a/src/views/overviewLargeScreen/components/center/chart/draw.tsx b/src/views/overviewLargeScreen/components/center/chart/draw.tsx deleted file mode 100644 index 6ed09ec..0000000 --- a/src/views/overviewLargeScreen/components/center/chart/draw.tsx +++ /dev/null @@ -1,92 +0,0 @@ -import { defineComponent, watch, shallowReactive } from 'vue' - -// 声明类型 -const PropsType = { - tips: { - type: Number, - default: 50, - require: true - }, - colorObj: { - type: Object, - default: () => ({ - textStyle: "#3fc0fb", - series: { - color: ["#00bcd44a", "transparent"], - dataColor: { - normal: "#03a9f4", - shadowColor: "#97e2f5" - } - } - }) - } -} as const - -// 定义主体 -export default defineComponent({ - props: PropsType, - setup(props) { - // 配置项 - let options = shallowReactive({title:null,series:null}) - - watch( - () => props.tips, - (val: any) => { - options = { - title: { - text: val * 1 + "%", - x: "center", - y: "center", - textStyle: { - color: props.colorObj.textStyle, - fontSize: 16 - } - }, - series: [ - { - type: "pie", - radius: ["75%", "80%"], - center: ["50%", "50%"], - hoverAnimation: false, - color: props.colorObj.series.color, - label: { - normal: { - show: false - } - }, - data: [ - { - value: val, - itemStyle: { - normal: { - color: props.colorObj.series.dataColor.normal, - shadowBlur: 10, - shadowColor: props.colorObj.series.dataColor.shadowColor - } - } - }, - { - value: 100 - val - } - ] - } - ] - } - }, - { - immediate: true, - deep: true - } - ) - - return () => { - const height = "100px" - const width = "120px" - - return