From c615c38eb9669d36e928ed92f88ebdef9e132313 Mon Sep 17 00:00:00 2001 From: huanghao1412 Date: Thu, 25 Jan 2024 16:57:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=BE=97=E5=88=86?= =?UTF-8?q?=E7=8E=AF=20=E8=BE=B9=E6=A1=86=20=E5=9B=BE=E7=89=87=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../images/chart/decorates/BorderCustom1.png | Bin 0 -> 2014 bytes .../Pages/ChartItemSetting/SettingItemBox.vue | 2 +- .../commonDataComponents/useSinglePointRes.ts | 10 ++ src/hooks/useChartCommonData.hook.ts | 44 +++-- .../Charts/Pies/PieCircle/config.ts | 17 ++ .../Charts/Pies/PieCircle/config.vue | 49 +++++- .../components/Charts/Pies/PieCircle/index.ts | 2 +- .../Charts/Pies/PieCircle/index.vue | 65 ++++++-- .../Charts/Pies/PieCommon/config.ts | 4 +- .../Charts/Pies/PieCommon/config.vue | 10 +- .../Charts/Pies/PieCommon/index.vue | 2 +- .../Charts/Pies/PieCommon1/config.ts | 78 +++++++++ .../Charts/Pies/PieCommon1/config.vue | 99 ++++++++++++ .../Charts/Pies/PieCommon1/data.json | 33 ++++ .../Charts/Pies/PieCommon1/index.ts | 14 ++ .../Charts/Pies/PieCommon1/index.vue | 151 +++++++++++++++++ .../Charts/Pies/PieCommon2/config.ts | 78 +++++++++ .../Charts/Pies/PieCommon2/config.vue | 99 ++++++++++++ .../Charts/Pies/PieCommon2/data.json | 33 ++++ .../Charts/Pies/PieCommon2/index.ts | 14 ++ .../Charts/Pies/PieCommon2/index.vue | 151 +++++++++++++++++ src/packages/components/Charts/Pies/index.ts | 6 +- .../Borders/BorderCustom1/BorderBox.vue | 58 +++++++ .../Decorates/Borders/BorderCustom1/config.ts | 31 ++++ .../Borders/BorderCustom1/config.vue | 7 + .../Borders/BorderCustom1/configData.vue | 14 ++ .../Decorates/Borders/BorderCustom1/index.ts | 15 ++ .../Decorates/Borders/BorderCustom1/index.vue | 54 +++++++ .../components/Decorates/Borders/index.ts | 2 + .../Informations/Texts/TextBarrage/config.ts | 5 + .../Informations/Texts/TextBarrage/index.ts | 2 +- .../Informations/Texts/TextCommon/config.ts | 5 + .../Informations/Texts/TextCommon/index.ts | 2 +- .../Informations/Texts/TextGradient/config.ts | 5 + .../Informations/Texts/TextGradient/index.ts | 2 +- .../components/Photos/Private/index.ts | 3 +- src/packages/index.d.ts | 6 +- src/packages/index.ts | 4 +- src/packages/public/publicConfig.ts | 11 ++ .../chartEditStore/chartEditStore.d.ts | 29 +++- .../modules/packagesStore/packagesStore.ts | 14 +- .../ChartDataV2/components/PointRealTime.vue | 2 +- .../components/RecordValueHistory.vue | 153 +++++++++--------- .../ChartDataV2/components/SinglePoint.vue | 32 ++++ .../components/ChartDataV2/index.d.ts | 26 ++- .../components/ChartDataV2/index.vue | 64 ++++++-- 46 files changed, 1351 insertions(+), 156 deletions(-) create mode 100644 src/assets/images/chart/decorates/BorderCustom1.png create mode 100644 src/hooks/commonDataComponents/useSinglePointRes.ts create mode 100644 src/packages/components/Charts/Pies/PieCommon1/config.ts create mode 100644 src/packages/components/Charts/Pies/PieCommon1/config.vue create mode 100644 src/packages/components/Charts/Pies/PieCommon1/data.json create mode 100644 src/packages/components/Charts/Pies/PieCommon1/index.ts create mode 100644 src/packages/components/Charts/Pies/PieCommon1/index.vue create mode 100644 src/packages/components/Charts/Pies/PieCommon2/config.ts create mode 100644 src/packages/components/Charts/Pies/PieCommon2/config.vue create mode 100644 src/packages/components/Charts/Pies/PieCommon2/data.json create mode 100644 src/packages/components/Charts/Pies/PieCommon2/index.ts create mode 100644 src/packages/components/Charts/Pies/PieCommon2/index.vue create mode 100644 src/packages/components/Decorates/Borders/BorderCustom1/BorderBox.vue create mode 100644 src/packages/components/Decorates/Borders/BorderCustom1/config.ts create mode 100644 src/packages/components/Decorates/Borders/BorderCustom1/config.vue create mode 100644 src/packages/components/Decorates/Borders/BorderCustom1/configData.vue create mode 100644 src/packages/components/Decorates/Borders/BorderCustom1/index.ts create mode 100644 src/packages/components/Decorates/Borders/BorderCustom1/index.vue create mode 100644 src/views/chart/ContentConfigurations/components/ChartDataV2/components/SinglePoint.vue diff --git a/src/assets/images/chart/decorates/BorderCustom1.png b/src/assets/images/chart/decorates/BorderCustom1.png new file mode 100644 index 0000000000000000000000000000000000000000..9c692f2e23f822e739eefb000a7e95e95b40535c GIT binary patch literal 2014 zcmeHI{a2C)7$sL)E}`0-8)ddiXIa*k7Ak};zbmbDYM5bJmQ4i#311Y)+O%@&R$0eS z)=uUpB7Tu6Xlb&gn5KdvAZm(fIYGCsJ~xwmB1j>)Skm(|r*2+v}zb`tl zLN)p@DKdfjDaSPD#OvpYxlY5yH$5&?kmSB;p^s_g!c4L_r!}B3p^u^dBVCm zg^Rt+zb^x`N8qB6=iW-N?rv;u_pN%FcO<9qyZQ{2z57vGdVj!Q_PIQIC3RtuwPq34cQ4Ask|x*nZq?Xr_SmSTh{4 zS02x7p zozu0{LET$VtZi}qOb2$@EM|3)MH9evxsHZOjtCc!_|QI0 zyYqB-s+pY*S<9Q|S=pQrl!g^qs{%=bwqvmB2XqR!Na$7vwkV;hHY?|hs=YXOFTo%e zZ61qj%;A~0JeDqI3DZQ*ST^Qc5ijcWR+z_9r3_?P?^iXad$^J!;5(|_%xgBZ<`a&7 z`7}AQ`X)y$uZKywp zy_^Z7!r8B1j`Yvr%G&aTtDZh-uP!IpDzUh{mD;ZRqB@FT@n(uVBjB9_Y?{t7j&~^N z9T|FXt;W-EYf<@#*gxKOW}J0*yG?UcLzoJQH-PKYi#yHgPd0s->ckWh5JF5ON(fL) ztZg}^g8aW|>ZDm@YpY&V2GD$a^$SOD7*A&@w|6y6&s{~qOY;5LE$ZKI9 zA8dO~{HaWP{GM~UhW zUQKC{qbi>StvK<1PZ;GOkGh<~nEzr-e~IzTZ|KO8{8W%TK{yPe+7T}MijSm#j;qv;cpjubZPFUJLW0{)h`|$VO^pDV{UpYOt?^$PF R^lCRl0(^qJYrc>E`Cpdo<&gjY literal 0 HcmV?d00001 diff --git a/src/components/Pages/ChartItemSetting/SettingItemBox.vue b/src/components/Pages/ChartItemSetting/SettingItemBox.vue index 6b1bd009..adb17037 100644 --- a/src/components/Pages/ChartItemSetting/SettingItemBox.vue +++ b/src/components/Pages/ChartItemSetting/SettingItemBox.vue @@ -38,7 +38,7 @@ defineProps({ diff --git a/src/packages/components/Decorates/Borders/BorderCustom1/config.ts b/src/packages/components/Decorates/Borders/BorderCustom1/config.ts new file mode 100644 index 00000000..cc8e79fc --- /dev/null +++ b/src/packages/components/Decorates/Borders/BorderCustom1/config.ts @@ -0,0 +1,31 @@ +import { PublicConfigClass } from '@/packages/public' +import { CreateComponentType } from '@/packages/index.d' +import { BorderCustom1Config } from './index' +import cloneDeep from 'lodash/cloneDeep' +// import logo from '@/assets/logo.png' + +export const option = { + // 图片路径 + dataset: '', + // 适应方式 + fit: 'contain', + // 圆角 + borderRadius: 0 +} + +export default class Config extends PublicConfigClass implements CreateComponentType +{ + constructor() { + super(); + this.attr.w = 450 + this.attr.h = 300 + this.request.requestInterval = 15 + } + public key = BorderCustom1Config.key + public chartConfig = cloneDeep(BorderCustom1Config) + public option = cloneDeep(option) + public customData = cloneDeep({ + title: '', + showInterval: false, + }) +} diff --git a/src/packages/components/Decorates/Borders/BorderCustom1/config.vue b/src/packages/components/Decorates/Borders/BorderCustom1/config.vue new file mode 100644 index 00000000..ae2cf42d --- /dev/null +++ b/src/packages/components/Decorates/Borders/BorderCustom1/config.vue @@ -0,0 +1,7 @@ + + + diff --git a/src/packages/components/Decorates/Borders/BorderCustom1/configData.vue b/src/packages/components/Decorates/Borders/BorderCustom1/configData.vue new file mode 100644 index 00000000..3e7f3fd6 --- /dev/null +++ b/src/packages/components/Decorates/Borders/BorderCustom1/configData.vue @@ -0,0 +1,14 @@ + + + + + diff --git a/src/packages/components/Decorates/Borders/BorderCustom1/index.ts b/src/packages/components/Decorates/Borders/BorderCustom1/index.ts new file mode 100644 index 00000000..43669683 --- /dev/null +++ b/src/packages/components/Decorates/Borders/BorderCustom1/index.ts @@ -0,0 +1,15 @@ +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' +import { ChatCategoryEnum, ChatCategoryEnumName } from '@/packages/components/Decorates/index.d' + +export const BorderCustom1Config: ConfigType = { + key: 'BorderCustom1', + chartKey: 'VBorderCustom1', + conKey: 'VCBorderCustom1', + conDataKey: 'VCDBorderCustom1', + title: '边框-自定义1', + category: ChatCategoryEnum.BORDER, + categoryName: ChatCategoryEnumName.BORDER, + package: PackagesCategoryEnum.DECORATES, + chartFrame: ChartFrameEnum.COMMON, + image: 'BorderCustom1.png' +} diff --git a/src/packages/components/Decorates/Borders/BorderCustom1/index.vue b/src/packages/components/Decorates/Borders/BorderCustom1/index.vue new file mode 100644 index 00000000..5c079b17 --- /dev/null +++ b/src/packages/components/Decorates/Borders/BorderCustom1/index.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/src/packages/components/Decorates/Borders/index.ts b/src/packages/components/Decorates/Borders/index.ts index 2e05e4be..059f4ae2 100644 --- a/src/packages/components/Decorates/Borders/index.ts +++ b/src/packages/components/Decorates/Borders/index.ts @@ -1,3 +1,4 @@ +import { BorderCustom1Config } from './BorderCustom1/index'; import { Border01Config } from './Border01/index' import { Border02Config } from './Border02/index' import { Border03Config } from './Border03/index' @@ -13,6 +14,7 @@ import { Border12Config } from './Border12/index' import { Border13Config } from './Border13/index' export default [ + BorderCustom1Config, Border01Config, Border02Config, Border03Config, diff --git a/src/packages/components/Informations/Texts/TextBarrage/config.ts b/src/packages/components/Informations/Texts/TextBarrage/config.ts index aefc4331..3bcdb554 100644 --- a/src/packages/components/Informations/Texts/TextBarrage/config.ts +++ b/src/packages/components/Informations/Texts/TextBarrage/config.ts @@ -3,6 +3,7 @@ import { CreateComponentType } from '@/packages/index.d' import { TextBarrageConfig } from './index' import { chartInitConfig } from '@/settings/designSetting' import cloneDeep from 'lodash/cloneDeep' +import { CurrentSourceEnum } from '@/store/modules/chartEditStore/chartEditStore.d' export enum FontWeightEnum { NORMAL = '常规', @@ -34,6 +35,10 @@ export const option = { } export default class Config extends PublicConfigClass implements CreateComponentType { + constructor() { + super(); + this.commonData.currentSource = CurrentSourceEnum.SINGLEPOINT + } public key = TextBarrageConfig.key public attr = { ...chartInitConfig, w: 500, h: 70, zIndex: -1 } public chartConfig = cloneDeep(TextBarrageConfig) diff --git a/src/packages/components/Informations/Texts/TextBarrage/index.ts b/src/packages/components/Informations/Texts/TextBarrage/index.ts index 245629fd..f73cc08e 100644 --- a/src/packages/components/Informations/Texts/TextBarrage/index.ts +++ b/src/packages/components/Informations/Texts/TextBarrage/index.ts @@ -9,6 +9,6 @@ export const TextBarrageConfig: ConfigType = { category: ChatCategoryEnum.TEXT, categoryName: ChatCategoryEnumName.TEXT, package: PackagesCategoryEnum.INFORMATIONS, - chartFrame: ChartFrameEnum.COMMON, + chartFrame: ChartFrameEnum.STATIC, image: 'text_barrage.png' } diff --git a/src/packages/components/Informations/Texts/TextCommon/config.ts b/src/packages/components/Informations/Texts/TextCommon/config.ts index 5ee2e1ab..b68439cf 100644 --- a/src/packages/components/Informations/Texts/TextCommon/config.ts +++ b/src/packages/components/Informations/Texts/TextCommon/config.ts @@ -2,6 +2,7 @@ import { PublicConfigClass } from '@/packages/public' import { CreateComponentType } from '@/packages/index.d' import { TextCommonConfig } from './index' import cloneDeep from 'lodash/cloneDeep' +import { CurrentSourceEnum } from '@/store/modules/chartEditStore/chartEditStore.d' export enum WritingModeEnum { HORIZONTAL = '水平', @@ -46,6 +47,10 @@ export const option = { } export default class Config extends PublicConfigClass implements CreateComponentType { + constructor() { + super(); + this.commonData.currentSource = CurrentSourceEnum.SINGLEPOINT + } public key = TextCommonConfig.key public chartConfig = cloneDeep(TextCommonConfig) public option = cloneDeep(option) diff --git a/src/packages/components/Informations/Texts/TextCommon/index.ts b/src/packages/components/Informations/Texts/TextCommon/index.ts index 68009064..dbb02038 100644 --- a/src/packages/components/Informations/Texts/TextCommon/index.ts +++ b/src/packages/components/Informations/Texts/TextCommon/index.ts @@ -9,6 +9,6 @@ export const TextCommonConfig: ConfigType = { category: ChatCategoryEnum.TEXT, categoryName: ChatCategoryEnumName.TEXT, package: PackagesCategoryEnum.INFORMATIONS, - chartFrame: ChartFrameEnum.COMMON, + chartFrame: ChartFrameEnum.STATIC, image: 'text_static.png' } diff --git a/src/packages/components/Informations/Texts/TextGradient/config.ts b/src/packages/components/Informations/Texts/TextGradient/config.ts index e5099523..2b5ec4f1 100644 --- a/src/packages/components/Informations/Texts/TextGradient/config.ts +++ b/src/packages/components/Informations/Texts/TextGradient/config.ts @@ -2,6 +2,7 @@ import { PublicConfigClass } from '@/packages/public' import { CreateComponentType } from '@/packages/index.d' import { TextGradientConfig } from './index' import cloneDeep from 'lodash/cloneDeep' +import { CurrentSourceEnum } from '@/store/modules/chartEditStore/chartEditStore.d' export const option = { dataset: '我是渐变文本', @@ -14,6 +15,10 @@ export const option = { } export default class Config extends PublicConfigClass implements CreateComponentType { + constructor() { + super(); + this.commonData.currentSource = CurrentSourceEnum.SINGLEPOINT + } public key = TextGradientConfig.key public chartConfig = cloneDeep(TextGradientConfig) public option = cloneDeep(option) diff --git a/src/packages/components/Informations/Texts/TextGradient/index.ts b/src/packages/components/Informations/Texts/TextGradient/index.ts index 1ab75ac0..00dd147f 100644 --- a/src/packages/components/Informations/Texts/TextGradient/index.ts +++ b/src/packages/components/Informations/Texts/TextGradient/index.ts @@ -9,6 +9,6 @@ export const TextGradientConfig: ConfigType = { category: ChatCategoryEnum.TEXT, categoryName: ChatCategoryEnumName.TEXT, package: PackagesCategoryEnum.INFORMATIONS, - chartFrame: ChartFrameEnum.NAIVE_UI, + chartFrame: ChartFrameEnum.STATIC, image: 'text_gradient.png' } diff --git a/src/packages/components/Photos/Private/index.ts b/src/packages/components/Photos/Private/index.ts index a975a41e..e5669a35 100644 --- a/src/packages/components/Photos/Private/index.ts +++ b/src/packages/components/Photos/Private/index.ts @@ -59,7 +59,8 @@ const addConfig = { // 点击上传事件 addHandle: (photoConfig: ConfigType) => { goDialog({ - message: `图片需小于 ${backgroundImageSize}M 且只暂存在浏览器中。当前图片暂存上限5M,超过不再缓存新图片,请自行对接后端接口!现编译成 base64 进行渲染,对接后端后请使用【URL地址】进行交互!`, + // message: `图片需小于 ${backgroundImageSize}M 且只暂存在浏览器中。当前图片暂存上限5M,超过不再缓存新图片,请自行对接后端接口!现编译成 base64 进行渲染,对接后端后请使用【URL地址】进行交互!`, + message: `图片需小于 ${backgroundImageSize}M 且只暂存在浏览器中。当前图片暂存上限5M,超过不再缓存新图片!`, transformOrigin: 'center', onPositiveCallback: () => { uploadFile((e: UploadCompletedEventType) => { diff --git a/src/packages/index.d.ts b/src/packages/index.d.ts index e79bd839..1c9bcfe1 100644 --- a/src/packages/index.d.ts +++ b/src/packages/index.d.ts @@ -1,7 +1,7 @@ import { BaseEvent, EventLife, InteractEvents, InteractEventOn, InteractActionsType } from '@/enums/eventEnum' import type { GlobalThemeJsonType } from '@/settings/chartThemes/index' import type { RequestConfigType } from '@/store/modules/chartEditStore/chartEditStore.d' -import {CustomComponentsList} from "@/packages/components/CustomComponents/index"; +import { CustomComponentsList } from "@/packages/components/CustomComponents/index"; import { commonDataType } from '@/store/modules/chartEditStore/chartEditStore.d' export enum ChartFrameEnum { @@ -47,8 +47,6 @@ export type ConfigType = { icon?: string // 事件 configEvents?: { [T: string]: Function } - // 自定义数据配置 - customData?: { [T: string]: any } } // 数据请求 @@ -216,7 +214,7 @@ export type PackagesType = { [PackagesCategoryEnum.CHARTS]: ConfigType[] [PackagesCategoryEnum.INFORMATIONS]: ConfigType[] // [PackagesCategoryEnum.TABLES]: ConfigType[] - // [PackagesCategoryEnum.PHOTOS]: ConfigType[] + [PackagesCategoryEnum.PHOTOS]: ConfigType[] [PackagesCategoryEnum.ICONS]: ConfigType[] [PackagesCategoryEnum.DECORATES]: ConfigType[] // [PackagesCategoryEnum.THEMESANDLAYOUTS]: ConfigType[] diff --git a/src/packages/index.ts b/src/packages/index.ts index de493518..eab2f25b 100644 --- a/src/packages/index.ts +++ b/src/packages/index.ts @@ -2,7 +2,7 @@ import { ChartList } from '@/packages/components/Charts/index' import { DecorateList } from '@/packages/components/Decorates/index' import { InformationList } from '@/packages/components/Informations/index' // import { TableList } from '@/packages/components/Tables/index' -// import { PhotoList } from '@/packages/components/Photos/index' +import { PhotoList } from '@/packages/components/Photos/index' import { IconList } from '@/packages/components/Icons/index' import { CustomComponentsList } from '@/packages/components/CustomComponents/index' import { PackagesCategoryEnum, PackagesType, ConfigType, FetchComFlagType } from '@/packages/index.d' @@ -26,7 +26,7 @@ export let packagesList: PackagesType = { [PackagesCategoryEnum.INFORMATIONS]: InformationList, // [PackagesCategoryEnum.TABLES]: TableList, [PackagesCategoryEnum.DECORATES]: DecorateList, - // [PackagesCategoryEnum.PHOTOS]: PhotoList, + [PackagesCategoryEnum.PHOTOS]: PhotoList, [PackagesCategoryEnum.ICONS]: IconList, [PackagesCategoryEnum.CUSTOMCOMPONENTS]: CustomComponentsList, } diff --git a/src/packages/public/publicConfig.ts b/src/packages/public/publicConfig.ts index 36411426..c7663e86 100644 --- a/src/packages/public/publicConfig.ts +++ b/src/packages/public/publicConfig.ts @@ -71,6 +71,17 @@ const commonData: commonDataType = { limit: 10, with_device_name: false, space_complete_name_prefix: false, + }, + singlePoint: { + enable: false, + pointId: '', + result: { + name: '', + status: null, + time: '', + unit: '', + value: 0 + } } } diff --git a/src/store/modules/chartEditStore/chartEditStore.d.ts b/src/store/modules/chartEditStore/chartEditStore.d.ts index cd81be53..2fbfd9da 100644 --- a/src/store/modules/chartEditStore/chartEditStore.d.ts +++ b/src/store/modules/chartEditStore/chartEditStore.d.ts @@ -259,7 +259,9 @@ export enum CurrentSourceEnum { // 记录值历史 RECORDVALUEHISTORY = 'recordValueHistory', // 测点实时值 - POINTREALTIME = 'pointRealTime' + POINTREALTIME = 'pointRealTime', + // 单测点实时值 + SINGLEPOINT = 'singlePoint' } // 测点历史参数 @@ -283,7 +285,7 @@ export enum PolicyTypeEnum { MAX = 1 } -// 记录值历史 +// 记录值历史参数 export interface RecordValueHistoryType { enable: boolean policy: PolicyTypeEnum[] @@ -291,6 +293,7 @@ export interface RecordValueHistoryType { dateType: DateTypeEnum } +// 测点实时值参数 export interface PointRealTimeType { enable: boolean point_uid: string[] @@ -299,13 +302,29 @@ export interface PointRealTimeType { space_complete_name_prefix: boolean } +export interface resultType { + name: string + status: number | null + time: string + unit: string + value: number | null +} + +// 单测点实时值 +export interface SinglePointType { + enable: boolean + pointId: string + result: resultType +} + // 通用组件数据 export interface commonDataType { - currentSource: CurrentSourceEnum, - pointHistory: PointHistoryType, - energyUseHistory: EnergyUseHistoryType, + currentSource: CurrentSourceEnum + pointHistory: PointHistoryType + energyUseHistory: EnergyUseHistoryType recordValueHistory: RecordValueHistoryType pointRealTime: PointRealTimeType + singlePoint: SinglePointType } // Store 类型 diff --git a/src/store/modules/packagesStore/packagesStore.ts b/src/store/modules/packagesStore/packagesStore.ts index a3a17b7a..f765ae71 100644 --- a/src/store/modules/packagesStore/packagesStore.ts +++ b/src/store/modules/packagesStore/packagesStore.ts @@ -18,15 +18,15 @@ export const usePackagesStore = defineStore({ }, actions: { addPhotos(newPhoto: ConfigType, index: number) { - // this.newPhoto = newPhoto - // this.packagesList.Photos.splice(index, 0, newPhoto) + this.newPhoto = newPhoto + this.packagesList.Photos.splice(index, 0, newPhoto) }, deletePhotos(photoInfo: ConfigType, index: number) { - // this.packagesList.Photos.splice(index, 1) - // const StoreKey = StorageEnum.GO_USER_MEDIA_PHOTOS - // const userPhotosList = getLocalStorage(StoreKey) - // userPhotosList.splice(index - 1, 1) - // setLocalStorage(StoreKey, userPhotosList) + this.packagesList.Photos.splice(index, 1) + const StoreKey = StorageEnum.GO_USER_MEDIA_PHOTOS + const userPhotosList = getLocalStorage(StoreKey) + userPhotosList.splice(index - 1, 1) + setLocalStorage(StoreKey, userPhotosList) } } }) diff --git a/src/views/chart/ContentConfigurations/components/ChartDataV2/components/PointRealTime.vue b/src/views/chart/ContentConfigurations/components/ChartDataV2/components/PointRealTime.vue index 3c31d935..897116a0 100644 --- a/src/views/chart/ContentConfigurations/components/ChartDataV2/components/PointRealTime.vue +++ b/src/views/chart/ContentConfigurations/components/ChartDataV2/components/PointRealTime.vue @@ -19,7 +19,7 @@ - - - + + + - + - + - - - - - - - - - -
+ + + + + + + + + +
+
-
- - - - - - \ No newline at end of file +} + + + + diff --git a/src/views/chart/ContentConfigurations/components/ChartDataV2/components/SinglePoint.vue b/src/views/chart/ContentConfigurations/components/ChartDataV2/components/SinglePoint.vue new file mode 100644 index 00000000..773444b6 --- /dev/null +++ b/src/views/chart/ContentConfigurations/components/ChartDataV2/components/SinglePoint.vue @@ -0,0 +1,32 @@ + + + + + \ No newline at end of file diff --git a/src/views/chart/ContentConfigurations/components/ChartDataV2/index.d.ts b/src/views/chart/ContentConfigurations/components/ChartDataV2/index.d.ts index 6bd20426..eea09135 100644 --- a/src/views/chart/ContentConfigurations/components/ChartDataV2/index.d.ts +++ b/src/views/chart/ContentConfigurations/components/ChartDataV2/index.d.ts @@ -110,26 +110,44 @@ export const selectTimeOptions: SelectHttpTimeType[] = [ }, ] +export enum optionTypeEnum { + // 多个值 + MULTIPLE = 'multiple', + // 单个值的数据源 环形图等 + SINGLE = 'single' +} + export interface sourceOptionsItemType { label: string, value: CurrentSourceEnum, + type: optionTypeEnum } + // 通用组件数据源选项 export const sourceOptions: sourceOptionsItemType[] = [ { label: '测点历史', - value: CurrentSourceEnum.POINTHISTORY + value: CurrentSourceEnum.POINTHISTORY, + type: optionTypeEnum.MULTIPLE, }, { label: '能耗历史', - value: CurrentSourceEnum.ENERGYUSEHISTORY + value: CurrentSourceEnum.ENERGYUSEHISTORY, + type: optionTypeEnum.MULTIPLE, }, { label: '记录值历史', - value: CurrentSourceEnum.RECORDVALUEHISTORY + value: CurrentSourceEnum.RECORDVALUEHISTORY, + type: optionTypeEnum.MULTIPLE, }, { label: '测点实时值', - value: CurrentSourceEnum.POINTREALTIME + value: CurrentSourceEnum.POINTREALTIME, + type: optionTypeEnum.MULTIPLE, + }, + { + label: '单测点实时值', + value: CurrentSourceEnum.SINGLEPOINT, + type: optionTypeEnum.SINGLE, }, ] diff --git a/src/views/chart/ContentConfigurations/components/ChartDataV2/index.vue b/src/views/chart/ContentConfigurations/components/ChartDataV2/index.vue index 2a1e92f3..10ee002d 100644 --- a/src/views/chart/ContentConfigurations/components/ChartDataV2/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartDataV2/index.vue @@ -1,12 +1,20 @@ @@ -51,14 +59,19 @@ import PointHistory from './components/PointHistory.vue' import EnergyUseHistory from './components/EnergyUseHistory.vue' import RecordValueHistory from './components/RecordValueHistory.vue' import PointRealTime from './components/PointRealTime.vue' +import SinglePoint from './components/SinglePoint.vue' +import { computed } from 'vue' import type { Ref } from 'vue' import { loadAsyncComponent } from '@/utils' import { SettingItemBox } from '@/components/Pages/ChartItemSetting' import { useTargetData } from '../hooks/useTargetData.hook' -import { sourceOptions, selectTimeOptions } from './index.d' +import { sourceOptions, optionTypeEnum, selectTimeOptions } from './index.d' import { CurrentSourceEnum } from '@/store/modules/chartEditStore/chartEditStore.d' import { PackagesCategoryEnum, CreateComponentType, CreateComponentGroupType, ChartFrameEnum } from '@/packages/index.d' - +import { PieCircleConfig } from '@/packages/components/Charts/Pies/PieCircle/index' +import { TextBarrageConfig } from "@/packages/components/Informations/Texts/TextBarrage/index"; +import { TextCommonConfig } from "@/packages/components/Informations/Texts/TextCommon/index"; +import { TextGradientConfig } from "@/packages/components/Informations/Texts/TextGradient/index"; // const ChartDataStatic = loadAsyncComponent(() => import('./components/ChartDataStatic/index.vue')) @@ -70,8 +83,31 @@ const { targetData } = useTargetData() as { targetData: Ref { +const IsStatic = computed(() => { return targetData.value.chartConfig.chartFrame === ChartFrameEnum.STATIC +}) + +/* +* 通用组件再分为: 多个点的数据和 一个点的数据(用于圆环图等) + */ +const IsCommonSingle = computed(() => { + let singleCharArr = [ + PieCircleConfig, + TextBarrageConfig, + TextCommonConfig, + TextGradientConfig, + ] + const { package:packageStr, category, key } = targetData.value.chartConfig + const flag = singleCharArr.some(_ => { + return _.package === packageStr && _.category === category && _.key === key + }) + return flag +}) + +const multipleSourceOptions = sourceOptions.filter(_ => _.type === optionTypeEnum.MULTIPLE) +const singleSourceOptions = sourceOptions.filter(_ => _.type === optionTypeEnum.SINGLE) + +const matchComponent = (name: string) => { + return targetData.value.commonData.currentSource === name }