mirror of
https://gitee.com/dromara/go-view.git
synced 2025-06-30 08:39:15 +08:00
feat: 添加系统运行时间组件 禁用组态组件全屏
This commit is contained in:
parent
c316b34681
commit
16927e2c03
BIN
src/assets/images/chart/customponents/SystemRuntime.png
Normal file
BIN
src/assets/images/chart/customponents/SystemRuntime.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
@ -32,7 +32,7 @@ let url = computed(() => {
|
||||
// const account = originStore?.getOriginStore?.user?.user?.account
|
||||
const account = 'admin'
|
||||
const password = 'laimi@123'
|
||||
let origin = process.env.NODE_ENV === 'production' ? window.location.origin : 'http://192.168.0.55:9528'
|
||||
let origin = process.env.NODE_ENV === 'production' ? window.location.origin : 'http://192.168.0.61:9528'
|
||||
// let str = `${origin}/static/#/dynamicRing/schematicDiagram/${props.chartConfig.customData.mapId}?parentOrigin=${window.location.origin}&isScreenIframe=true&account=${account}&password=${password}`
|
||||
let str = `${origin}/static/#/dynamicRing/schematicDiagram/${props.chartConfig.customData.mapId}?parentOrigin=${window.location.origin}&isScreenIframe=true&access_token=${routerStore.token}`
|
||||
return str
|
||||
@ -116,7 +116,7 @@ watch(() => setIframeStr, () => {
|
||||
|
||||
const postMsgToChild = (obj: Object) => {
|
||||
if(iframe.value) {
|
||||
let origin = process.env.NODE_ENV === 'production' ? window.location.origin : 'http://192.168.0.55:9528'
|
||||
let origin = process.env.NODE_ENV === 'production' ? window.location.origin : 'http://192.168.0.61:9528'
|
||||
iframe.value.contentWindow.postMessage(obj, origin);
|
||||
}
|
||||
}
|
||||
@ -142,6 +142,15 @@ watch(() => option.value.enableInner, (v) => {
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('message', handleMsg);
|
||||
if(iframe.value) {
|
||||
iframe.value.addEventListener('keydown', function(e: KeyboardEvent) {
|
||||
if (e.key === 'F11') {
|
||||
e.preventDefault();
|
||||
// 可以在这里添加代码来告知用户 F11 已被禁用
|
||||
console.log(1234)
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
})
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('message', handleMsg)
|
||||
|
@ -0,0 +1,21 @@
|
||||
import { PublicConfigClass } from '@/packages/public'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import { SystemRuntimeConfig } from './index'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
// import logo from '@/assets/logo.png'
|
||||
|
||||
export const option = {
|
||||
|
||||
}
|
||||
|
||||
export default class Config extends PublicConfigClass implements CreateComponentType
|
||||
{
|
||||
constructor() {
|
||||
super();
|
||||
this.attr.w = 500
|
||||
this.attr.h = 150
|
||||
}
|
||||
public key = SystemRuntimeConfig.key
|
||||
public chartConfig = cloneDeep(SystemRuntimeConfig)
|
||||
public option = cloneDeep(option)
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType } from 'vue'
|
||||
import { option } from './config'
|
||||
import {
|
||||
CollapseItem,
|
||||
SettingItemBox,
|
||||
SettingItem,
|
||||
} from '@/components/Pages/ChartItemSetting'
|
||||
|
||||
const props = defineProps({
|
||||
optionData: {
|
||||
type: Object as PropType<typeof option>,
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
</script>
|
@ -0,0 +1,14 @@
|
||||
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
|
||||
import { ChatCategoryEnum, ChatCategoryEnumName } from '@/packages/components/CustomComponents/index.d'
|
||||
|
||||
export const SystemRuntimeConfig: ConfigType = {
|
||||
key: 'SystemRuntime',
|
||||
chartKey: 'VSystemRuntime',
|
||||
conKey: 'VCSystemRuntime',
|
||||
title: '系统运行时间',
|
||||
category: ChatCategoryEnum.CUSTOMCOMPONENTS,
|
||||
categoryName: ChatCategoryEnumName.CUSTOMCOMPONENTS,
|
||||
package: PackagesCategoryEnum.CUSTOMCOMPONENTS,
|
||||
chartFrame: ChartFrameEnum.STATIC,
|
||||
image: 'SystemRuntime.png'
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<svg data-v-1c6f5df4="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 423.5 40" >
|
||||
<defs data-v-1c6f5df4="">
|
||||
<linearGradient data-v-1c6f5df4="" id="linear-gradient-staqyxts" x1="212.5" y1="40" x2="212.5" y2="30"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop data-v-1c6f5df4="" offset="0" stop-color="#4196ff" stop-opacity="0.5"></stop>
|
||||
<stop data-v-1c6f5df4="" offset="1" stop-color="#4196ff" stop-opacity="0"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g data-v-1c6f5df4="" id="图层_2" data-name="图层 2">
|
||||
<g data-v-1c6f5df4="" id="内容">
|
||||
<polygon data-v-1c6f5df4=""
|
||||
points="161.68 39.5 157 35.76 157 5.21 161.71 0.5 183.29 0.5 188 5.21 188 35.76 183.32 39.5 161.68 39.5"
|
||||
style="fill: rgb(23, 30, 40); opacity: 0.8;"></polygon>
|
||||
<path data-v-1c6f5df4=""
|
||||
d="M183.09,1l4.41,4.41V35.52L183.15,39h-21.3l-4.35-3.48V5.41L161.91,1h21.17m.41-1h-22l-5,5V36l5,4h22l5-4V5l-5-5Z"
|
||||
style="fill: rgb(39, 85, 142);"></path>
|
||||
<polygon data-v-1c6f5df4=""
|
||||
points="201.68 39.5 197 35.76 197 5.21 201.71 0.5 223.29 0.5 228 5.21 228 35.76 223.32 39.5 201.68 39.5"
|
||||
style="fill: rgb(23, 30, 40); opacity: 0.8;"></polygon>
|
||||
<path data-v-1c6f5df4=""
|
||||
d="M223.09,1l4.41,4.41V35.52L223.15,39h-21.3l-4.35-3.48V5.41L201.91,1h21.17m.41-1h-22l-5,5V36l5,4h22l5-4V5l-5-5Z"
|
||||
style="fill: rgb(39, 85, 142);"></path>
|
||||
<polygon data-v-1c6f5df4=""
|
||||
points="241.68 39.5 237 35.76 237 5.21 241.71 0.5 263.29 0.5 268 5.21 268 35.76 263.32 39.5 241.68 39.5"
|
||||
style="fill: rgb(23, 30, 40); opacity: 0.8;"></polygon>
|
||||
<path data-v-1c6f5df4=""
|
||||
d="M263.09,1l4.41,4.41V35.52L263.15,39h-21.3l-4.35-3.48V5.41L241.91,1h21.17m.41-1h-22l-5,5V36l5,4h22l5-4V5l-5-5Z"
|
||||
style="fill: rgb(39, 85, 142);"></path>
|
||||
<polygon data-v-1c6f5df4=""
|
||||
points="281.68 39.5 277 35.76 277 5.21 281.71 0.5 303.29 0.5 308 5.21 308 35.76 303.32 39.5 281.68 39.5"
|
||||
style="fill: rgb(23, 30, 40); opacity: 0.8;"></polygon>
|
||||
<path data-v-1c6f5df4=""
|
||||
d="M303.09,1l4.41,4.41V35.52L303.15,39h-21.3l-4.35-3.48V5.41L281.91,1h21.17m.41-1h-22l-5,5V36l5,4h22l5-4V5l-5-5Z"
|
||||
style="fill: rgb(39, 85, 142);"></path>
|
||||
<polygon data-v-1c6f5df4=""
|
||||
points="321.68 39.5 317 35.76 317 5.21 321.71 0.5 343.29 0.5 348 5.21 348 35.76 343.32 39.5 321.68 39.5"
|
||||
style="fill: rgb(23, 30, 40); opacity: 0.8;"></polygon>
|
||||
<path data-v-1c6f5df4=""
|
||||
d="M343.09,1l4.41,4.41V35.52L343.15,39h-21.3l-4.35-3.48V5.41L321.91,1h21.17m.41-1h-22l-5,5V36l5,4h22l5-4V5l-5-5Z"
|
||||
style="fill: rgb(39, 85, 142);"></path>
|
||||
<polygon data-v-1c6f5df4=""
|
||||
points="361.68 39.5 357 35.76 357 5.21 361.71 0.5 383.29 0.5 388 5.21 388 35.76 383.32 39.5 361.68 39.5"
|
||||
style="fill: rgb(23, 30, 40); opacity: 0.8;"></polygon>
|
||||
<path data-v-1c6f5df4=""
|
||||
d="M383.09,1l4.41,4.41V35.52L383.15,39h-21.3l-4.35-3.48V5.41L361.91,1h21.17m.41-1h-22l-5,5V36l5,4h22l5-4V5l-5-5Z"
|
||||
style="fill: rgb(39, 85, 142);"></path>
|
||||
<rect data-v-1c6f5df4="" x="2.5" y="30" width="420" height="10"
|
||||
style="fill: url("#linear-gradient-staqyxts");"></rect>
|
||||
<text data-v-1c6f5df4="" transform="translate(166.36 30)"
|
||||
style="font-size: 24px; fill: aqua; font-family: LCDUltra, LCDUltra;">{{safeDaysList[0]}}
|
||||
</text>
|
||||
<text data-v-1c6f5df4="" transform="translate(206.34 30)"
|
||||
style="font-size: 24px; fill: aqua; font-family: LCDUltra, LCDUltra;">{{safeDaysList[1]}}
|
||||
</text>
|
||||
<text data-v-1c6f5df4="" transform="translate(246.34 30)"
|
||||
style="font-size: 24px; fill: aqua; font-family: LCDUltra, LCDUltra;">{{safeDaysList[2]}}
|
||||
</text>
|
||||
<text data-v-1c6f5df4="" transform="translate(286.34 30)"
|
||||
style="font-size: 24px; fill: aqua; font-family: LCDUltra, LCDUltra;">{{safeDaysList[3]}}
|
||||
</text>
|
||||
<text data-v-1c6f5df4="" transform="translate(326.34 30)"
|
||||
style="font-size: 24px; fill: aqua; font-family: LCDUltra, LCDUltra;">{{safeDaysList[4]}}
|
||||
</text>
|
||||
<text data-v-1c6f5df4="" transform="translate(366.34 30)"
|
||||
style="font-size: 24px; fill: aqua; font-family: LCDUltra, LCDUltra;">{{safeDaysList[5]}}
|
||||
</text>
|
||||
<text data-v-1c6f5df4="" transform="translate(0 29.12)"
|
||||
style="font-size: 24px; fill: rgb(255, 255, 255); font-weight: 700;">系统安全运行
|
||||
</text>
|
||||
<text data-v-1c6f5df4="" transform="translate(399.5 29.12)"
|
||||
style="font-size: 24px; fill: rgb(255, 255, 255); font-weight: 700;">天
|
||||
</text>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {PropType, ref, computed, onUnmounted} from "vue";
|
||||
import config from './config'
|
||||
import { useOriginStore } from '@/store/modules/originStore/originStore'
|
||||
import moment from 'moment'
|
||||
import { isPreview } from '@/utils'
|
||||
|
||||
const props = defineProps({
|
||||
chartConfig: {
|
||||
type: Object as PropType<config>,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const originStore = useOriginStore()
|
||||
|
||||
let systemConfig = originStore.getOriginStore.user.systemConfig
|
||||
|
||||
let safeDaysList = ref(['0', '0', '0', '0', '0', '0'])
|
||||
|
||||
const refreshTime = systemConfig['refresh_time_overview'] ? Number(systemConfig['refresh_time_overview']) * 1000 : 15000
|
||||
let timer:any
|
||||
|
||||
safeDaysList.value = `${moment().diff(moment(systemConfig.overview_dglt_idc_operation_date), 'days') + 1}`.padStart(6, '0').split('')
|
||||
|
||||
if (refreshTime && isPreview()) {
|
||||
timer = setInterval(() => {
|
||||
safeDaysList.value = `${moment().diff(moment(systemConfig.overview_dglt_idc_operation_date), 'days') + 1}`.padStart(6, '0').split('')
|
||||
}, refreshTime)
|
||||
}
|
||||
onUnmounted(() => {
|
||||
if(timer) clearInterval(timer)
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
@ -6,6 +6,7 @@ import { GDMapConfig } from './GDMap'
|
||||
import { EngineeringConfig } from './EngineeringConfig'
|
||||
import { MonitorRealTimeEventsConfig } from './MonitorRealTimeEvents'
|
||||
import { DashboardConfig } from './Dashboard'
|
||||
import { SystemRuntimeConfig } from './SystemRuntime'
|
||||
|
||||
export default [
|
||||
// Theme1Config,
|
||||
@ -16,4 +17,5 @@ export default [
|
||||
EngineeringConfig,
|
||||
MonitorRealTimeEventsConfig,
|
||||
DashboardConfig,
|
||||
SystemRuntimeConfig,
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user