diff --git a/.env b/.env index 30a49059..d02e0c1c 100644 --- a/.env +++ b/.env @@ -3,8 +3,9 @@ VITE_DEV_PORT = '8080' # development path # VITE_DEV_PATH = 'http://192.168.0.34:11887' -VITE_DEV_PATH = 'http://192.168.0.34:18077' +VITE_DEV_PATH = 'http://192.168.0.34:8022' # VITE_DEV_PATH = 'http://192.168.0.120:3001' +VITE_DEV_TOKEN = '0e1e851b-8522-477c-9f84-d415999816d1' # production path -VITE_PRO_PATH = 'http://192.168.0.34:11887' +VITE_PRO_PATH = 'http://192.168.0.235:8177' diff --git a/src/App.vue b/src/App.vue index 029253c6..a644623b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -88,7 +88,12 @@ getMessageByParent('getStore', (e) => { getMessageByParent('loaded', (e) => { if(e.data.type === 'changeRoute' && e.data.page === 'customLargeScreen') { - routerStore.setToken(e.data.token) + if(import.meta.env.MODE === 'production') { + routerStore.setToken(e.data.token) + } + else { + routerStore.setToken(import.meta.env.VITE_DEV_TOKEN) + } router.replace(e.data.path ? e.data.path : '/chart/preview/null') } }) diff --git a/src/api/path/business.api.ts b/src/api/path/business.api.ts index 5fd4262e..c00d35a0 100644 --- a/src/api/path/business.api.ts +++ b/src/api/path/business.api.ts @@ -46,7 +46,14 @@ export async function getToken() { export const publicInterface = async (paramType:string, interfaceType:string, paramData?:unknown) =>{ try { - const access_token = await getToken() + let access_token = '' + if(import.meta.env.MODE === 'production') { + access_token = await getToken() as string + } + else { + console.log(import.meta.env, 777) + access_token = import.meta.env.VITE_DEV_TOKEN + } const res = await http(RequestHttpEnum.POST)(paramType, { access_token, type: interfaceType, diff --git a/src/assets/images/chart/customponents/ComprehensivePUE1.png b/src/assets/images/chart/customponents/ComprehensivePUE1.png new file mode 100644 index 00000000..b01e01dc Binary files /dev/null and b/src/assets/images/chart/customponents/ComprehensivePUE1.png differ diff --git a/src/assets/images/chart/customponents/PowerCapacity.png b/src/assets/images/chart/customponents/PowerCapacity.png new file mode 100644 index 00000000..9c9966ba Binary files /dev/null and b/src/assets/images/chart/customponents/PowerCapacity.png differ diff --git a/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/Svg.vue b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/Svg.vue new file mode 100644 index 00000000..2a855324 --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/Svg.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/VCircle.vue b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/VCircle.vue new file mode 100644 index 00000000..0ffb6e25 --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/VCircle.vue @@ -0,0 +1,370 @@ + + + + + diff --git a/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/config.ts b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/config.ts new file mode 100644 index 00000000..69344956 --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/config.ts @@ -0,0 +1,67 @@ +import { PublicConfigClass } from '@/packages/public' +import { CreateComponentType } from '@/packages/index.d' +import { ComprehensivePUEV4Config } from './index' +import cloneDeep from 'lodash/cloneDeep' +// import logo from '@/assets/logo.png' + +export const option = { + // // 图片路径 + // dataset: '', + // // 适应方式 + // fit: 'contain', + // // 圆角 + // borderRadius: 0 +} +export const customData = { + title: '综合PUE', + circle: { + title: '实时PUE', + id: null + }, + leftBottom: [ + { + title: '昨日PUE', + id: null + }, + { + title: '上周PUE', + id: null + }, + { + title: '上月PUE', + id: null + } + ], + right: [ + { + title: '总市电负载', + unit: '(kWh)', + id: null + }, + { + title: 'IT用电负载', + unit: '(kWh)', + id: null + }, + { + title: '其他负载', + unit: '(kWh)', + id: null + } + ], + showInterval: true, +} + +export default class Config extends PublicConfigClass implements CreateComponentType +{ + constructor() { + super(); + this.attr.w = 450 + this.attr.h = 300 + this.request.requestInterval = 15 + } + public key = ComprehensivePUEV4Config.key + public chartConfig = cloneDeep(ComprehensivePUEV4Config) + public option = cloneDeep(option) + public customData = cloneDeep(customData) +} diff --git a/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/config.vue b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/config.vue new file mode 100644 index 00000000..d1759a1d --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/config.vue @@ -0,0 +1,67 @@ + + + diff --git a/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/configData.vue b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/configData.vue new file mode 100644 index 00000000..deb68af3 --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/configData.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/index.ts b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/index.ts new file mode 100644 index 00000000..860c314e --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/index.ts @@ -0,0 +1,15 @@ +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' +import { ChatCategoryEnum, ChatCategoryEnumName } from '@/packages/components/CustomComponents/index.d' + +export const ComprehensivePUEV4Config: ConfigType = { + key: 'ComprehensivePUEV4', + chartKey: 'VComprehensivePUEV4', + conKey: 'VCComprehensivePUEV4', + conDataKey: 'VCDComprehensivePUEV4', + title: '综合PUE通用1', + category: ChatCategoryEnum.CUSTOMCOMPONENTS, + categoryName: ChatCategoryEnumName.CUSTOMCOMPONENTS, + package: PackagesCategoryEnum.CUSTOMCOMPONENTS, + chartFrame: ChartFrameEnum.COMMON, + image: 'ComprehensivePUE1.png' +} diff --git a/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/index.vue b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/index.vue new file mode 100644 index 00000000..1618dda5 --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUEV4/index.vue @@ -0,0 +1,565 @@ + + + + + diff --git a/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/config.ts b/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/config.ts new file mode 100644 index 00000000..e7046886 --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/config.ts @@ -0,0 +1,42 @@ +import { PublicConfigClass } from '@/packages/public' +import { CreateComponentType } from '@/packages/index.d' +import { PowerCapacityConfig } from './index' +import cloneDeep from 'lodash/cloneDeep' +// import logo from '@/assets/logo.png' + +export const option = {} +export const customData = { + title: '功率容量', + enable: false, + topBox: { + name: '一号楼', label: '设计容量', value: 20000, label1: '已使用', calculation: '', name1: '', upper_limit: 0, floor: [ + {label: '1F', calculation: '', name: '', upper_limit: 0}, + {label: '2F', calculation: '', name: '', upper_limit: 0}, + {label: '3F', calculation: '', name: '', upper_limit: 0}, + {label: '4F', calculation: '', name: '', upper_limit: 0}, + ] + }, + bottomBox: { + name: '二号楼', label: '设计容量', value: 20000, label1: '已使用', calculation: '', name1: '', upper_limit: 0, floor: [ + {label: '1F', calculation: '', name: '', upper_limit: 0}, + {label: '2F', calculation: '', name: '', upper_limit: 0}, + {label: '3F', calculation: '', name: '', upper_limit: 0}, + {label: '4F', calculation: '', name: '', upper_limit: 0}, + {label: '5F', calculation: '', name: '', upper_limit: 0}, + ] + }, + showInterval: true, +} + +export default class Config extends PublicConfigClass implements CreateComponentType { + constructor() { + super(); + this.attr.w = 450 + this.attr.h = 300 + this.request.requestInterval = 15 + } + public key = PowerCapacityConfig.key + public chartConfig = cloneDeep(PowerCapacityConfig) + public option = cloneDeep(option) + public customData = cloneDeep(customData) +} diff --git a/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/config.vue b/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/config.vue new file mode 100644 index 00000000..293cea0c --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/config.vue @@ -0,0 +1,65 @@ + + + + + \ No newline at end of file diff --git a/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/configData.vue b/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/configData.vue new file mode 100644 index 00000000..bf7e9601 --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/configData.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/index.ts b/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/index.ts new file mode 100644 index 00000000..1d4345b0 --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/index.ts @@ -0,0 +1,16 @@ +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' +import { ChatCategoryEnum, ChatCategoryEnumName } from '@/packages/components/CustomComponents/index.d' + +export const PowerCapacityConfig: ConfigType = { + key: 'PowerCapacity', + chartKey: 'VPowerCapacity', + conKey: 'VCPowerCapacity', + // VCD开头 + conDataKey: 'VCDPowerCapacity', + title: '功率容量', + category: ChatCategoryEnum.CUSTOMCOMPONENTS, + categoryName: ChatCategoryEnumName.CUSTOMCOMPONENTS, + package: PackagesCategoryEnum.CUSTOMCOMPONENTS, + chartFrame: ChartFrameEnum.COMMON, + image: 'PowerCapacity.png' +} diff --git a/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/index.vue b/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/index.vue new file mode 100644 index 00000000..712f0711 --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/PowerCapacity/index.vue @@ -0,0 +1,253 @@ + + + + + \ No newline at end of file diff --git a/src/packages/components/CustomComponents/CustomComponents/index.ts b/src/packages/components/CustomComponents/CustomComponents/index.ts index 99352371..7a284e4a 100644 --- a/src/packages/components/CustomComponents/CustomComponents/index.ts +++ b/src/packages/components/CustomComponents/CustomComponents/index.ts @@ -1,6 +1,7 @@ // import { Theme1Config } from './Theme1/index' import { ComprehensivePUEConfig } from './ComprehensivePUE' import { ComprehensivePUEV3Config } from './ComprehensivePUEV3' +import { ComprehensivePUEV4Config } from './ComprehensivePUEV4' import { RealTimeTrafficConfig } from './RealTimeTraffic' import { OverviewOfComputingNodesConfig } from './OverviewOfComputingNodes' import { GDMapConfig } from './GDMap' @@ -11,11 +12,13 @@ import { SystemRuntimeConfig } from './SystemRuntime' import { VideoListConfig } from './VideoList' import { AirConditioningTableConfig } from './AirConditioningTable' import { SiteStatisticsConfig } from './SiteStatistics' +import { PowerCapacityConfig } from './PowerCapacity' export default [ // Theme1Config, ComprehensivePUEConfig, ComprehensivePUEV3Config, + ComprehensivePUEV4Config, RealTimeTrafficConfig, OverviewOfComputingNodesConfig, GDMapConfig, @@ -26,4 +29,5 @@ export default [ VideoListConfig, AirConditioningTableConfig, SiteStatisticsConfig, + PowerCapacityConfig, ] diff --git a/src/views/preview/hooks/useScale.hook.ts b/src/views/preview/hooks/useScale.hook.ts index 62f5be28..e3feb5fe 100644 --- a/src/views/preview/hooks/useScale.hook.ts +++ b/src/views/preview/hooks/useScale.hook.ts @@ -139,13 +139,13 @@ export const useScale = (localStorageInfo: ChartEditStorageType) => { // 屏幕适配 onMounted(fn) - watch(() => localStorageInfo.editCanvasConfig, (v) => { - width.value = v.width - height.value = v.height - fn() - }, { - deep: true - }) + // watch(() => localStorageInfo.editCanvasConfig, (v) => { + // width.value = v.width + // height.value = v.height + // fn() + // }, { + // deep: true + // }) return { entityRef,