diff --git a/package.json b/package.json index 8cc295e7..142b68e5 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,6 @@ "@types/crypto-js": "^4.1.1", "@types/keymaster": "^1.6.30", "@types/lodash": "^4.14.184", - "@vicons/fluent": "^0.12.0", - "@vicons/tabler": "^0.12.0", "animate.css": "^4.1.1", "axios": "^1.4.0", "color": "^4.2.3", @@ -60,7 +58,10 @@ "@typescript-eslint/eslint-plugin": "^5.18.0", "@typescript-eslint/parser": "^5.18.0", "@vicons/carbon": "^0.12.0", + "@vicons/fluent": "^0.12.0", "@vicons/ionicons5": "~0.11.0", + "@vicons/material": "^0.12.0", + "@vicons/tabler": "^0.12.0", "@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue-jsx": "^3.0.1", "@vue/compiler-sfc": "^3.2.31", diff --git a/src/App.vue b/src/App.vue index 04025bcf..442c1031 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,26 +19,27 @@ import { GoAppProvider } from '@/components/GoAppProvider' import { I18n } from '@/components/I18n' import { useSystemInit, useDarkThemeHook, useThemeOverridesHook, useCode, useLang } from '@/hooks' import { getToken } from '@/api/path' -import { onMounted, onUnmounted } from 'vue' import { useRouterStore } from '@/store/modules/routerStore/routerStore' +import { useOriginStore } from '@/store/modules/originStore/originStore' +import { useGetMessageByParent } from '@/utils/utils' + +const {getMessageByParent} = useGetMessageByParent() const routerStore = useRouterStore() -let handleMessage = function(event:{data:string}) { - const {data}:{data:any} = event - if(data.page === 'customLargeScreen' && data.type === 'setCallByParent') { - routerStore.setCallByParent(data.callByParent) +getMessageByParent('setCallByParent', (e) => { + if(e.data.type === 'setCallByParent' && e.data.page === 'customLargeScreen') { + const {data}:{data:any} = e + if(data.page === 'customLargeScreen' && data.type === 'setCallByParent') { + routerStore.setCallByParent(data.callByParent) + } } -} -onMounted(() => { - window.addEventListener('message', handleMessage); - let obj = { - page: 'customLargeScreen', - type: 'bindPostMessageEvent' - } - window.parent.postMessage(JSON.stringify(obj), '*'); }) -onUnmounted(() => { - window.removeEventListener('message', handleMessage); + +const originStore = useOriginStore() +getMessageByParent('getStore', (e) => { + if(e.data.type === 'getStore' && e.data.page === 'customLargeScreen') { + originStore.setOriginStore(e.data.data, false) + } }) getToken() diff --git a/src/api/path/business.api.ts b/src/api/path/business.api.ts index c1b06b6d..c04c209e 100644 --- a/src/api/path/business.api.ts +++ b/src/api/path/business.api.ts @@ -2,10 +2,15 @@ import { http } from "@/api/http"; import { RequestHttpEnum } from "@/enums/httpEnum"; import { httpErrorHandle } from '@/utils' +import moment from 'moment' export function getToken() { - const storage_access_token = localStorage.getItem('access_token') - if(storage_access_token) return storage_access_token + const storage_access_token = localStorage.getItem('access_token_obj') + if(storage_access_token) { + const obj = JSON.parse(storage_access_token) + const { access_token, expiration } = obj + if(expiration >= moment().format('x')) return access_token + } let queryStr = window.location.href queryStr = queryStr.split('?')[1] if(queryStr && queryStr.indexOf('#') > -1) queryStr = queryStr.split('#')[0] @@ -13,7 +18,11 @@ export function getToken() { queryStr && queryStr.split('&').forEach((item:string) => { query[item.split('=')[0]] = item.split('=')[1] }) - if(query.access_token) localStorage.setItem('access_token', query.access_token) + const obj = { + access_token: query.access_token, + expiration: 86400000 + moment().format('x') + } + if(query.access_token) localStorage.setItem('access_token_obj', JSON.stringify(obj)) return query.access_token } diff --git a/src/assets/images/chart/customponents/OverviewOfComputingNodes.png b/src/assets/images/chart/customponents/OverviewOfComputingNodes.png new file mode 100644 index 00000000..0ec3e482 Binary files /dev/null and b/src/assets/images/chart/customponents/OverviewOfComputingNodes.png differ diff --git a/src/assets/images/chart/customponents/RealTimeEvent.png b/src/assets/images/chart/customponents/RealTimeEvent.png new file mode 100644 index 00000000..3d8f370a Binary files /dev/null and b/src/assets/images/chart/customponents/RealTimeEvent.png differ diff --git a/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUE/index.vue b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUE/index.vue index cf411daa..976c5db1 100644 --- a/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUE/index.vue +++ b/src/packages/components/CustomComponents/CustomComponents/ComprehensivePUE/index.vue @@ -45,7 +45,7 @@ const props = defineProps({ } }) Object.assign(props.chartConfig.attr, { w: 380, h: 250 }) -Object.assign(props.chartConfig.request, { requestInterval: 15, requestIntervalUnit: RequestHttpIntervalEnum.SECOND }) +if(!props.chartConfig.request.requestInterval) Object.assign(props.chartConfig.request, { requestInterval: 15, requestIntervalUnit: RequestHttpIntervalEnum.SECOND }) const { w, h } = toRefs(props.chartConfig.attr) const { dataset, fit, borderRadius } = toRefs(props.chartConfig.option) @@ -58,7 +58,7 @@ const getStyle = (radius: number) => { } const value = reactive([ - {label: '实时PUE', value: '0.000'}, + {label: '实时PUE', value: '1.000'}, {label: '昨日PUE', value: '0.000'}, {label: '上周PUE', value: '0.000'}, {label: '上月PUE', value: '0.000'}, diff --git a/src/packages/components/CustomComponents/CustomComponents/DeviceAlarmOverview/index.vue b/src/packages/components/CustomComponents/CustomComponents/DeviceAlarmOverview/index.vue index 3d61a791..9a72a595 100644 --- a/src/packages/components/CustomComponents/CustomComponents/DeviceAlarmOverview/index.vue +++ b/src/packages/components/CustomComponents/CustomComponents/DeviceAlarmOverview/index.vue @@ -53,7 +53,7 @@ const props = defineProps({ } }) Object.assign(props.chartConfig.attr, { w: 380, h: 250 }) -Object.assign(props.chartConfig.request, { requestInterval: 15, requestIntervalUnit: RequestHttpIntervalEnum.SECOND }) +if(!props.chartConfig.request.requestInterval) Object.assign(props.chartConfig.request, { requestInterval: 15, requestIntervalUnit: RequestHttpIntervalEnum.SECOND }) const { w, h } = toRefs(props.chartConfig.attr) const { dataset, fit, borderRadius } = toRefs(props.chartConfig.option) diff --git a/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/config.ts b/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/config.ts new file mode 100644 index 00000000..19de6e7f --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/config.ts @@ -0,0 +1,25 @@ +import { PublicConfigClass } from '@/packages/public' +import { CreateComponentType } from '@/packages/index.d' +import { OverviewOfComputingNodesConfig } 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 +{ + public key = OverviewOfComputingNodesConfig.key + public chartConfig = cloneDeep(OverviewOfComputingNodesConfig) + public option = cloneDeep(option) + public customData = cloneDeep({ + title: '计算节点运行概况', + showInterval: true, + }) +} diff --git a/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/config.vue b/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/config.vue new file mode 100644 index 00000000..d1759a1d --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/config.vue @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/configData.vue b/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/configData.vue new file mode 100644 index 00000000..2c83af5e --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/configData.vue @@ -0,0 +1,16 @@ + + + + + + + + + + + diff --git a/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/index.ts b/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/index.ts new file mode 100644 index 00000000..5c61d155 --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/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 OverviewOfComputingNodesConfig: ConfigType = { + key: 'OverviewOfComputingNodes', + chartKey: 'VOverviewOfComputingNodes', + conKey: 'VCOverviewOfComputingNodes', + // VCD开头 + conDataKey: 'VCDOverviewOfComputingNodes', + title: '计算节点运行概况', + category: ChatCategoryEnum.CUSTOMCOMPONENTS, + categoryName: ChatCategoryEnumName.CUSTOMCOMPONENTS, + package: PackagesCategoryEnum.CUSTOMCOMPONENTS, + chartFrame: ChartFrameEnum.COMMON, + image: 'OverviewOfComputingNodes.png' +} diff --git a/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/index.vue b/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/index.vue new file mode 100644 index 00000000..9ec7b6f7 --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/OverviewOfComputingNodes/index.vue @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ computeNodeData.sever_count }} + + 服务总数 + + + + + {{ computeNodeData.offline_server_count }} + + 离线服务 + + + + + + + {{ computeNodeData.busy_server_count }} + + 拥堵服务 + + + + + + + {{ computeNodeData.loss_server_count }} + + 缺失服务 + + + + + + 计算节点服务统计 + + + + + {{ computeNodeData.node_count }} + 计算节点 + 待更新 + 异常节点 + 异常服务 + {{ computeNodeData.need_updated_count }} + {{ computeNodeData.abnormal_count }} + {{ computeNodeData.abnormal_server_count }} + + + + + + + + diff --git a/src/packages/components/CustomComponents/CustomComponents/RealTimeAlarmStatistics/Svg.vue b/src/packages/components/CustomComponents/CustomComponents/RealTimeAlarmStatistics/Svg.vue index 2b797fe4..10c2eb72 100644 --- a/src/packages/components/CustomComponents/CustomComponents/RealTimeAlarmStatistics/Svg.vue +++ b/src/packages/components/CustomComponents/CustomComponents/RealTimeAlarmStatistics/Svg.vue @@ -1,510 +1,513 @@ - - - - - - - + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ eventName }} + + + {{ commonName }} + + + {{ importantName }} + + + {{ seriousName }} + + + {{ urgentName }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - {{ eventName }} - - - {{ commonName }} - - - {{ importantName }} - - - {{ seriousName }} - - - {{ urgentName }} - - - - - - - - - - - - - - - - - - - - - - - - - - {{ alarmMonitorData ? alarmMonitorData["urgent"] : 0 }} - - - {{ alarmMonitorData ? alarmMonitorData["serious"] : 0 }} - - - {{ alarmMonitorData ? alarmMonitorData["important"] : 0 }} - - - - - - - - {{ alarmMonitorData ? alarmMonitorData["secondary"] : 0 }} - - - {{ alarmMonitorData ? alarmMonitorData["record"] : 0 }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ commonName }} - {{ importantName }} - {{ seriousName }} - {{ urgentName }} - - - - - - - - - - - - - - {{ alarmMonitorData ? alarmMonitorData["urgent"] : 0 }} - {{ alarmMonitorData ? alarmMonitorData["serious"] : 0 }} - {{ alarmMonitorData ? alarmMonitorData["important"] : 0 }} - {{ alarmMonitorData ? alarmMonitorData["secondary"] : 0 }} - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + {{ alarmMonitorData ? alarmMonitorData["urgent"] : 0 }} + + + {{ alarmMonitorData ? alarmMonitorData["serious"] : 0 }} + + + {{ alarmMonitorData ? alarmMonitorData["important"] : 0 }} + + + + + + + + {{ alarmMonitorData ? alarmMonitorData["secondary"] : 0 }} + + + {{ alarmMonitorData ? alarmMonitorData["record"] : 0 }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ importantName }} - - - {{ seriousName }} - - - {{ urgentName }} - - - - - - - - - - - - - - - - - - - - - {{ alarmMonitorData ? alarmMonitorData["urgent"] : 0 }} - - - {{ alarmMonitorData ? alarmMonitorData["serious"] : 0 }} - - - {{ alarmMonitorData ? alarmMonitorData["important"] : 0 }} - - - - - - - - - - - - - - - - - + + + + + + - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ commonName }} + {{ importantName }} + {{ seriousName }} + {{ urgentName }} + + + + + + + + + + + + + + {{ alarmMonitorData ? alarmMonitorData["urgent"] : 0 }} + {{ alarmMonitorData ? alarmMonitorData["serious"] : 0 }} + {{ alarmMonitorData ? alarmMonitorData["important"] : 0 }} + {{ alarmMonitorData ? alarmMonitorData["secondary"] : 0 }} + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ importantName }} + + + {{ seriousName }} + + + {{ urgentName }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - {{ urgentName }} - - - {{ seriousName }} - - - - - - - - - - - - - - - - {{ alarmMonitorData ? alarmMonitorData["urgent"] : 0 }} - - - {{ alarmMonitorData ? alarmMonitorData["serious"] : 0 }} - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + {{ alarmMonitorData ? alarmMonitorData["urgent"] : 0 }} + + + {{ alarmMonitorData ? alarmMonitorData["serious"] : 0 }} + + + {{ alarmMonitorData ? alarmMonitorData["important"] : 0 }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ urgentName }} + + + {{ seriousName }} + + - {{ alarmMonitorData ? alarmMonitorData["urgent"] : 0 }} + + + + + + + + + + + + {{ alarmMonitorData ? alarmMonitorData["urgent"] : 0 }} + + + {{ alarmMonitorData ? alarmMonitorData["serious"] : 0 }} + + + - {{ urgentName }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + {{ alarmMonitorData ? alarmMonitorData["urgent"] : 0 }} + + + {{ urgentName }} + + + + diff --git a/src/packages/components/CustomComponents/CustomComponents/RealTimeAlarmStatistics/index.vue b/src/packages/components/CustomComponents/CustomComponents/RealTimeAlarmStatistics/index.vue index 8b58f06e..459f5ee8 100644 --- a/src/packages/components/CustomComponents/CustomComponents/RealTimeAlarmStatistics/index.vue +++ b/src/packages/components/CustomComponents/CustomComponents/RealTimeAlarmStatistics/index.vue @@ -1,13 +1,12 @@ - diff --git a/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/config.ts b/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/config.ts new file mode 100644 index 00000000..bb4e1c96 --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/config.ts @@ -0,0 +1,25 @@ +import { PublicConfigClass } from '@/packages/public' +import { CreateComponentType } from '@/packages/index.d' +import { RealTimeEventConfig } 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 +{ + public key = RealTimeEventConfig.key + public chartConfig = cloneDeep(RealTimeEventConfig) + public option = cloneDeep(option) + public customData = cloneDeep({ + title: '实时事件', + showInterval: true, + }) +} diff --git a/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/config.vue b/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/config.vue new file mode 100644 index 00000000..d1759a1d --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/config.vue @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/configData.vue b/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/configData.vue new file mode 100644 index 00000000..2c83af5e --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/configData.vue @@ -0,0 +1,16 @@ + + + + + + + + + + + diff --git a/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/index.ts b/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/index.ts new file mode 100644 index 00000000..1eb07a3f --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/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 RealTimeEventConfig: ConfigType = { + key: 'RealTimeEvent', + chartKey: 'VRealTimeEvent', + conKey: 'VCRealTimeEvent', + // VCD开头 + conDataKey: 'VCDRealTimeEvent', + title: '实时事件', + category: ChatCategoryEnum.CUSTOMCOMPONENTS, + categoryName: ChatCategoryEnumName.CUSTOMCOMPONENTS, + package: PackagesCategoryEnum.CUSTOMCOMPONENTS, + chartFrame: ChartFrameEnum.COMMON, + image: 'RealTimeEvent.png' +} diff --git a/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/index.vue b/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/index.vue new file mode 100644 index 00000000..29267763 --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/RealTimeEvent/index.vue @@ -0,0 +1,210 @@ + + + + + + {{ item.confirm_status === 'ok'?'已确认':'未确认' }} + {{select1.options[item.level - 1].label}} + {{ item.content }} + + {{ moment(item.generate_time).format('yyyy-MM-DD HH:mm:ss') }} + + + + + + + + + + + diff --git a/src/packages/components/CustomComponents/CustomComponents/RealTimeTraffic/index.vue b/src/packages/components/CustomComponents/CustomComponents/RealTimeTraffic/index.vue index d2804ef9..f19e9424 100644 --- a/src/packages/components/CustomComponents/CustomComponents/RealTimeTraffic/index.vue +++ b/src/packages/components/CustomComponents/CustomComponents/RealTimeTraffic/index.vue @@ -38,7 +38,7 @@ const props = defineProps({ } }) Object.assign(props.chartConfig.attr, { w: 380, h: 250 }) -Object.assign(props.chartConfig.request, { requestInterval: 15, requestIntervalUnit: RequestHttpIntervalEnum.SECOND }) +if(!props.chartConfig.request.requestInterval) Object.assign(props.chartConfig.request, { requestInterval: 15, requestIntervalUnit: RequestHttpIntervalEnum.SECOND }) const { w, h } = toRefs(props.chartConfig.attr) const { dataset, fit, borderRadius } = toRefs(props.chartConfig.option) diff --git a/src/packages/components/CustomComponents/CustomComponents/components/BorderBox.vue b/src/packages/components/CustomComponents/CustomComponents/components/BorderBox.vue index ad7458c9..8e9d1e58 100644 --- a/src/packages/components/CustomComponents/CustomComponents/components/BorderBox.vue +++ b/src/packages/components/CustomComponents/CustomComponents/components/BorderBox.vue @@ -22,7 +22,7 @@ const { title } = toRefs(props) background: rgba(65,150,255,.04); .title{ position: relative; - padding-left: 20px; + padding: 0 20px; height: 38px; line-height: 38px; font-size: 16px; diff --git a/src/packages/components/CustomComponents/CustomComponents/components/BorderBoxV2.vue b/src/packages/components/CustomComponents/CustomComponents/components/BorderBoxV2.vue new file mode 100644 index 00000000..daaf924b --- /dev/null +++ b/src/packages/components/CustomComponents/CustomComponents/components/BorderBoxV2.vue @@ -0,0 +1,88 @@ + + + + + {{title}} + 全选 + + + 批量确认 + + + + + + {{item.label}} + ({{item.number}}) + + + + + + + {{item.label}} + ({{item.number}}) + + + + 更多>> + + + + + + + + + + + diff --git a/src/packages/components/CustomComponents/CustomComponents/index.ts b/src/packages/components/CustomComponents/CustomComponents/index.ts index 5c119d46..c977ca8e 100644 --- a/src/packages/components/CustomComponents/CustomComponents/index.ts +++ b/src/packages/components/CustomComponents/CustomComponents/index.ts @@ -3,5 +3,15 @@ import { ComprehensivePUEConfig } from './ComprehensivePUE' import { DeviceAlarmOverviewConfig } from './DeviceAlarmOverview' import { RealTimeTrafficConfig } from './RealTimeTraffic' import { RealTimeAlarmStatisticsConfig } from './RealTimeAlarmStatistics' +import { OverviewOfComputingNodesConfig } from './OverviewOfComputingNodes' +import { RealTimeEventConfig } from './RealTimeEvent' -export default [ Theme1Config, ComprehensivePUEConfig, DeviceAlarmOverviewConfig, RealTimeTrafficConfig, RealTimeAlarmStatisticsConfig ] +export default [ + Theme1Config, + ComprehensivePUEConfig, + DeviceAlarmOverviewConfig, + RealTimeTrafficConfig, + RealTimeAlarmStatisticsConfig, + OverviewOfComputingNodesConfig, + RealTimeEventConfig +] diff --git a/src/plugins/icon.ts b/src/plugins/icon.ts index b98cab0f..acc6e589 100644 --- a/src/plugins/icon.ts +++ b/src/plugins/icon.ts @@ -105,12 +105,18 @@ import { FilterEdit as FilterEditIcon, Laptop as LaptopIcon, AreaCustom as AreaCustomIcon, + Location as LocationIcon } from '@vicons/carbon' import { Apps20Regular as Apps20RegularIcon } from '@vicons/fluent' +import { + AssignmentTurnedInRound as AssignmentTurnedInRoundIcon, + CheckCircleOutlined as CheckCircleOutlinedIcon +} from '@vicons/material' + const ionicons5 = { // 新增 AddIcon, @@ -311,6 +317,8 @@ const carbon = { LaptopIcon, // 自定义 AreaCustomIcon, + // 地点 + LocationIcon, } const fluent = { @@ -318,10 +326,18 @@ const fluent = { Apps20RegularIcon } +const material = { + // 批量确认 + AssignmentTurnedInRoundIcon, + // 圆圈 勾 + CheckCircleOutlinedIcon +} + // https://www.xicons.org/#/ 还有很多 export const icon = { ionicons5, carbon, - fluent + fluent, + material } diff --git a/src/store/modules/originStore/originStore.ts b/src/store/modules/originStore/originStore.ts new file mode 100644 index 00000000..5bec992e --- /dev/null +++ b/src/store/modules/originStore/originStore.ts @@ -0,0 +1,24 @@ +import { defineStore } from 'pinia' +import { cloneDeep } from 'lodash' + +export const useOriginStore = defineStore({ + id: 'useOriginStore', + state: () => ({ + originStore: {} + }), + getters: { + getOriginStore():{[k:string]: any} { + return this.originStore + } + }, + actions: { + setOriginStore(originStore: {[k:string]: any}, merge: boolean = true) { + if(merge) { + this.originStore = cloneDeep(originStore) + } + else { + Object.assign(this.originStore, originStore) + } + } + } +}) diff --git a/src/utils/utils.ts b/src/utils/utils.ts index a91cfe59..34fd48e3 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -356,25 +356,25 @@ export const addWindowUnload = () => { /** * 向父页面发送消息 */ -export const postMessageToParent = (obj = {}) => { - const routerStore:any = useRouterStore() - if (routerStore && routerStore.getCallByParent) { - // 获取父页面的 window 对象 - var parentWindow = window.parent; - const message = { - // 属于哪个页面 - page: 'customLargeScreen', - // 属于什么类型 - // type: 'goHome', - ...obj - } - parentWindow.postMessage(JSON.stringify(message), '*'); - return - } -} +// export const postMessageToParent = (obj = {}) => { +// const routerStore:any = useRouterStore() +// if (routerStore && routerStore.getCallByParent) { +// // 获取父页面的 window 对象 +// var parentWindow = window.parent; +// const message = { +// // 属于哪个页面 +// page: 'customLargeScreen', +// // 属于什么类型 +// // type: 'goHome', +// ...obj +// } +// parentWindow.postMessage(JSON.stringify(message), '*'); +// return +// } +// } /** - * 从父页面接收消息 + * 从父页面发送并接收消息 */ export const useGetMessageByParent = () => { const getMessageByParent = (type = '', cb = (e:any) => {}) => {