From 4635366147624ea65cbc4b5e40aa003a88f5e769 Mon Sep 17 00:00:00 2001 From: Free-sss <630042479@qq.com> Date: Mon, 8 Sep 2025 17:24:40 +0800 Subject: [PATCH] =?UTF-8?q?refactor(Charts):=20=E9=87=8D=E6=9E=84=E6=9C=89?= =?UTF-8?q?=E9=99=90=E7=A9=BA=E9=97=B4=E7=BB=84=E4=BB=B6=E5=B9=B6=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=97=A7=E6=8A=98=E7=BA=BF=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 重构了 AlarmNowList 和 FiniteSpatialDistribution 组件的结构 - 更新了组件样式和布局 - 删除了未使用的 LineDropdownConfined 组件相关文件 --- .../ConfinedSpace/AlarmNowList/config.ts | 11 +- .../ConfinedSpace/AlarmNowList/index.vue | 17 +- .../FiniteSpatialDistribution/config.ts | 5 +- .../FiniteSpatialDistribution/index.vue | 69 +-- .../LineDropdownConfined/config.ts | 114 ---- .../LineDropdownConfined/config.vue | 16 - .../LineDropdownConfined/data.json | 81 --- .../LineDropdownConfined/index.ts | 14 - .../LineDropdownConfined/index.vue | 485 ------------------ .../ConfinedSpace/PieCircleCommen/config.ts | 14 +- .../ConfinedSpace/PieCircleCommen/index.vue | 11 +- .../Charts/ConfinedSpace/videoCheck/index.vue | 11 +- 12 files changed, 39 insertions(+), 809 deletions(-) delete mode 100644 src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/config.ts delete mode 100644 src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/config.vue delete mode 100644 src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/data.json delete mode 100644 src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/index.ts delete mode 100644 src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/index.vue diff --git a/src/packages/components/Charts/ConfinedSpace/AlarmNowList/config.ts b/src/packages/components/Charts/ConfinedSpace/AlarmNowList/config.ts index 433690e..abeccc1 100644 --- a/src/packages/components/Charts/ConfinedSpace/AlarmNowList/config.ts +++ b/src/packages/components/Charts/ConfinedSpace/AlarmNowList/config.ts @@ -6,16 +6,9 @@ import dataJson from './data.json' import { chartInitConfig } from '@/settings/designSetting' export const styleConfig = { titleText: '实时报警', - titleOption: { - }, - headerOption: { - paddingLeft: 0, - paddingRight: 0, - paddingTop: 0, - paddingBottom: 0 - } } export const option = { + ...styleConfig, sceneCode: 'T01', dataset: dataJson, rowNum: 4, @@ -27,5 +20,5 @@ export default class Config extends PublicConfigClass implements CreateComponent public key = AlarmNowListConfig.key public chartConfig = cloneDeep(AlarmNowListConfig) public option = cloneDeep(option) - public attr = { ...chartInitConfig, x: 0, y: 0, w: 430, h: 300, zIndex: 1 } + public attr = { ...chartInitConfig, x: 0, y: 0, w: 450, h: 300, zIndex: 1 } } diff --git a/src/packages/components/Charts/ConfinedSpace/AlarmNowList/index.vue b/src/packages/components/Charts/ConfinedSpace/AlarmNowList/index.vue index 935d134..c126a6b 100644 --- a/src/packages/components/Charts/ConfinedSpace/AlarmNowList/index.vue +++ b/src/packages/components/Charts/ConfinedSpace/AlarmNowList/index.vue @@ -1,11 +1,10 @@ \ No newline at end of file diff --git a/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/config.ts b/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/config.ts deleted file mode 100644 index 20b3242..0000000 --- a/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/config.ts +++ /dev/null @@ -1,114 +0,0 @@ -import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public' -import { LineDropdownConfinedConfig } from './index' -import { CreateComponentType } from '@/packages/index.d' -import cloneDeep from 'lodash/cloneDeep' -import dataJson from './data.json' - -export const includes = ['xAxis', 'yAxis', 'grid'] - -const option = { - backgroundColor: 'rgba(13, 16, 22, 1)', - grid: { - left: '8%', - right: '8%', - top: '15%', - bottom: '15%', - containLabel: true - }, - xAxis: { - type: 'category', - boundaryGap: false, - axisLine: { - show: false - }, - axisTick: { - show: false - }, - axisLabel: { - color: 'rgba(255, 255, 255, 0.6)', - fontSize: 12 - }, - }, - yAxis: { - type: 'value', - axisLine: { - show: false - }, - axisTick: { - show: false - }, - axisLabel: { - color: 'rgba(255, 255, 255, 0.6)', - fontSize: 12 - }, - splitLine: { - show: true, - lineStyle: { - color: 'rgba(255, 255, 255, 0.1)', - type: 'solid' - } - } - }, - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'line', - lineStyle: { - color: 'rgba(58, 160, 255, 1)', - type: 'solid' - } - } - }, - dataset: { ...dataJson }, - series: [ - { - type: 'line', - smooth: true, - symbol: 'none', // 默认不显示点 - symbolSize: 8, - lineStyle: { - width: 2, - color: { - type: 'linear', - x: 0, - y: 0, - x2: 1, - y2: 0, - colorStops: [ - { offset: 0, color: 'rgba(58, 160, 255, 1)' }, - { offset: 1, color: 'rgba(127, 216, 255, 1)' } - ] - } - }, - emphasis: { - focus: 'series', - symbol: 'circle', // 鼠标悬停时显示圆点 - symbolSize: 8, - itemStyle: { - color: 'rgba(58, 160, 255, 1)', - borderColor: 'rgba(255, 255, 255, 0.8)', - borderWidth: 2 - } - }, - areaStyle: { - color: { - type: 'linear', - x: 0, - y: 0, - x2: 0, - y2: 1, - colorStops: [ - { offset: 0, color: 'rgba(58, 160, 255, 0.5)' }, - { offset: 1, color: 'rgba(58, 160, 255, 0.05)' } - ] - } - } - } - ] -} - -export default class Config extends PublicConfigClass implements CreateComponentType { - public key: string = LineDropdownConfinedConfig.key - public chartConfig = cloneDeep(LineDropdownConfinedConfig) - public option = echartOptionProfixHandle(option, includes) -} \ No newline at end of file diff --git a/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/config.vue b/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/config.vue deleted file mode 100644 index ce1a89d..0000000 --- a/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/config.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - \ No newline at end of file diff --git a/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/data.json b/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/data.json deleted file mode 100644 index b558988..0000000 --- a/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/data.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "dimensions": ["time", "value"], - "source": [ - { - "time": "13:00", - "value": 50 - }, - { - "time": "13:05", - "value": 45 - }, - { - "time": "13:10", - "value": 55 - }, - { - "time": "13:15", - "value": 48 - }, - { - "time": "13:20", - "value": 42 - }, - { - "time": "13:25", - "value": 38 - }, - { - "time": "13:30", - "value": 35 - }, - { - "time": "13:35", - "value": 40 - }, - { - "time": "13:40", - "value": 50 - }, - { - "time": "13:45", - "value": 65 - }, - { - "time": "13:50", - "value": 78 - }, - { - "time": "13:55", - "value": 80 - }, - { - "time": "14:00", - "value": 75 - }, - { - "time": "14:05", - "value": 68 - }, - { - "time": "14:10", - "value": 60 - }, - { - "time": "14:15", - "value": 55 - }, - { - "time": "14:20", - "value": 52 - }, - { - "time": "14:25", - "value": 58 - }, - { - "time": "14:30", - "value": 62 - } - ] -} \ No newline at end of file diff --git a/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/index.ts b/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/index.ts deleted file mode 100644 index 8df5735..0000000 --- a/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' -// import { ChatCategoryEnum, ChatCategoryEnumName } from '../..' - -export const LineDropdownConfinedConfig: ConfigType = { - key: 'LineDropdownConfined', - chartKey: 'VLineDropdownConfined', - conKey: 'VCLineDropdownConfined', - title: '下拉折线图', - category: 'ConfinedSpace', - categoryName: '有限空间组件', - package: PackagesCategoryEnum.CHARTS, - chartFrame: ChartFrameEnum.ECHARTS, - image: 'line_warn.png' -} \ No newline at end of file diff --git a/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/index.vue b/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/index.vue deleted file mode 100644 index 369eddd..0000000 --- a/src/packages/components/Charts/ConfinedSpace/LineDropdownConfined/index.vue +++ /dev/null @@ -1,485 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/packages/components/Charts/ConfinedSpace/PieCircleCommen/config.ts b/src/packages/components/Charts/ConfinedSpace/PieCircleCommen/config.ts index 9b35c33..dfc0056 100644 --- a/src/packages/components/Charts/ConfinedSpace/PieCircleCommen/config.ts +++ b/src/packages/components/Charts/ConfinedSpace/PieCircleCommen/config.ts @@ -19,7 +19,6 @@ const otherConfig = { isCarousel: false, color: ['#3B72E8', '#45B5E3', '#50D4A8', '#F8B55B'], selectOption: { - show: true, selectValue: 'month', dataset: [ { @@ -45,15 +44,8 @@ const otherConfig = { ] }, titleText: '报警统计', - titleOption: { - }, - headerOption: { - paddingLeft: 0, - paddingRight: 0, - paddingTop: 0, - paddingBottom: 0 - }, selectStyleOption: { - + selectStyleOption: { + ...selectStyleOption } } // ECharts配置 @@ -139,7 +131,7 @@ export default class Config extends PublicConfigClass implements CreateComponent public key: string = PieCircleCommenConfig.key public chartConfig = cloneDeep(PieCircleCommenConfig) - public attr = { ...chartInitConfig, x: 0, y: 0, w: 430, h: 300, zIndex: 1 } + public attr = { ...chartInitConfig, x: 0, y: 0, w: 450, h: 300, zIndex: 1 } // 图表配置项 public option = echartOptionProfixHandle(option, includes) } diff --git a/src/packages/components/Charts/ConfinedSpace/PieCircleCommen/index.vue b/src/packages/components/Charts/ConfinedSpace/PieCircleCommen/index.vue index a8c25fb..0de5e49 100644 --- a/src/packages/components/Charts/ConfinedSpace/PieCircleCommen/index.vue +++ b/src/packages/components/Charts/ConfinedSpace/PieCircleCommen/index.vue @@ -1,12 +1,10 @@ @@ -21,7 +19,8 @@ import { mergeTheme } from '@/packages/public/chart' import config, { includes, selectStyleOption } from './config' import { useChartDataFetch } from '@/hooks' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' -import SmallBaorder01 from '../SmallBorder01Co/index.vue' +// import SmallBaorder01 from '../SmallBorder01Co/index.vue' +import PublicSmallBorder from '../../PublicSmallBorder/index.vue' import { DatasetComponent, GridComponent, diff --git a/src/packages/components/Charts/ConfinedSpace/videoCheck/index.vue b/src/packages/components/Charts/ConfinedSpace/videoCheck/index.vue index b0eb9f4..2042beb 100644 --- a/src/packages/components/Charts/ConfinedSpace/videoCheck/index.vue +++ b/src/packages/components/Charts/ConfinedSpace/videoCheck/index.vue @@ -1,8 +1,7 @@ @@ -44,9 +41,9 @@ import { PageEnum } from '@/enums/pageEnum' import axios from 'axios' import { getUUID, isPreview } from '@/utils' import { useYushiVideoStore } from '@/store/modules/yushiVideoStore/yushiVideoStore' -import SmallBaorder01 from '../SmallBorder01Co/index.vue' +// import SmallBaorder01 from '../SmallBorder01Co/index.vue' import axiosInstance from '@/api/axios' - +import PublicSmallBorder from '../../PublicSmallBorder/index.vue' const yushiStore = useYushiVideoStore() let selectedList = []