mirror of
https://gitee.com/dromara/go-view.git
synced 2025-06-30 00:29:16 +08:00
fix: 综合PUE通用1新增手动输入模式
This commit is contained in:
parent
d5336bb909
commit
117fa5d72f
@ -16,21 +16,29 @@ export const customData = {
|
|||||||
title: '综合PUE',
|
title: '综合PUE',
|
||||||
enable: false,
|
enable: false,
|
||||||
demonstration: false,
|
demonstration: false,
|
||||||
|
manual: false,
|
||||||
id: null,
|
id: null,
|
||||||
circle: {
|
circle: {
|
||||||
title: '昨日PUE',
|
title: '昨日PUE',
|
||||||
|
value: 0,
|
||||||
},
|
},
|
||||||
center: {
|
center: {
|
||||||
title1: '实时PUE',
|
title1: '实时PUE',
|
||||||
|
value1: 0,
|
||||||
title2: '上周PUE',
|
title2: '上周PUE',
|
||||||
|
value2: 0,
|
||||||
title3: '上月PUE',
|
title3: '上月PUE',
|
||||||
|
value3: 0,
|
||||||
},
|
},
|
||||||
right: {
|
right: {
|
||||||
title1: '总功率(kWh)',
|
title1: '总功率(kWh)',
|
||||||
|
value1: 0,
|
||||||
calculation1: '',
|
calculation1: '',
|
||||||
title2: 'IT功率(kW)',
|
title2: 'IT功率(kW)',
|
||||||
|
value2: 0,
|
||||||
calculation2: '',
|
calculation2: '',
|
||||||
title3: '其他功率(kW)',
|
title3: '其他功率(kW)',
|
||||||
|
value3: 0,
|
||||||
},
|
},
|
||||||
showInterval: true,
|
showInterval: true,
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,29 @@
|
|||||||
<n-switch v-model:value="props.customData.enable" size="small"/>
|
<n-switch v-model:value="props.customData.enable" size="small"/>
|
||||||
</n-space>
|
</n-space>
|
||||||
</setting-item-box>
|
</setting-item-box>
|
||||||
<setting-item-box name="开启演示模式">
|
<setting-item-box name="模式" alone>
|
||||||
<n-space >
|
<n-space >
|
||||||
<n-switch v-model:value="props.customData.demonstration" size="small"/>
|
<n-radio
|
||||||
|
:checked="checkedValue === 'normal'"
|
||||||
|
value="normal"
|
||||||
|
name="mode"
|
||||||
|
@change="handleChange"
|
||||||
|
>普通模式</n-radio>
|
||||||
|
<n-radio
|
||||||
|
:checked="checkedValue === 'demonstration'"
|
||||||
|
value="demonstration"
|
||||||
|
name="mode"
|
||||||
|
@change="handleChange"
|
||||||
|
>演示模式</n-radio>
|
||||||
|
<n-radio
|
||||||
|
:checked="checkedValue === 'manual'"
|
||||||
|
value="manual"
|
||||||
|
name="mode"
|
||||||
|
@change="handleChange"
|
||||||
|
>手动模式</n-radio>
|
||||||
</n-space>
|
</n-space>
|
||||||
</setting-item-box>
|
</setting-item-box>
|
||||||
|
<template v-if="checkedValue === 'normal'">
|
||||||
<setting-item-box name="报表ID" alone>
|
<setting-item-box name="报表ID" alone>
|
||||||
<setting-item name="控制左边和中间的ID">
|
<setting-item name="控制左边和中间的ID">
|
||||||
<n-input v-model:value="props.customData.id" size="small" placeholder="请输入"/>
|
<n-input v-model:value="props.customData.id" size="small" placeholder="请输入"/>
|
||||||
@ -51,11 +69,63 @@
|
|||||||
</setting-item>
|
</setting-item>
|
||||||
</setting-item-box>
|
</setting-item-box>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else-if="checkedValue === 'manual'">
|
||||||
|
<setting-item-box name="仪表盘">
|
||||||
|
<setting-item :name="props.customData.circle.title">
|
||||||
|
<n-input-number v-model:value="props.customData.circle.value" step="0.001" size="small" placeholder="请输入"/>
|
||||||
|
</setting-item>
|
||||||
|
</setting-item-box>
|
||||||
|
<setting-item-box name="中间">
|
||||||
|
<setting-item :name="props.customData.center.title1">
|
||||||
|
<n-input-number v-model:value="props.customData.center.value1" step="0.001" size="small" placeholder="请输入"/>
|
||||||
|
</setting-item>
|
||||||
|
<setting-item :name="props.customData.center.title2">
|
||||||
|
<n-input-number v-model:value="props.customData.center.value2" step="0.001" size="small" placeholder="请输入"/>
|
||||||
|
</setting-item>
|
||||||
|
<setting-item :name="props.customData.center.title3">
|
||||||
|
<n-input-number v-model:value="props.customData.center.value3" step="0.001" size="small" placeholder="请输入"/>
|
||||||
|
</setting-item>
|
||||||
|
</setting-item-box>
|
||||||
|
<setting-item-box name="右边">
|
||||||
|
<setting-item :name="props.customData.right.title1">
|
||||||
|
<n-input-number v-model:value="props.customData.right.value1" step="0.001" size="small" placeholder="请输入"/>
|
||||||
|
</setting-item>
|
||||||
|
<setting-item :name="props.customData.right.title2">
|
||||||
|
<n-input-number v-model:value="props.customData.right.value2" step="0.001" size="small" placeholder="请输入"/>
|
||||||
|
</setting-item>
|
||||||
|
<setting-item :name="props.customData.right.title3">
|
||||||
|
<n-input-number v-model:value="props.customData.right.value3" step="0.001" size="small" placeholder="请输入"/>
|
||||||
|
</setting-item>
|
||||||
|
</setting-item-box>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { watch, ref } from 'vue'
|
||||||
import { SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
|
import { SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
|
||||||
|
|
||||||
const props = defineProps(['customData', 'request'])
|
const props = defineProps(['customData', 'request'])
|
||||||
|
|
||||||
|
const checkedValue = ref('normal')
|
||||||
|
|
||||||
|
if(props.customData.demonstration) checkedValue.value = 'demonstration'
|
||||||
|
if(props.customData.manual) checkedValue.value = 'manual'
|
||||||
|
|
||||||
|
const handleChange = (e: Event) => {
|
||||||
|
checkedValue.value = (e.target as HTMLInputElement).value
|
||||||
|
if(checkedValue.value === 'normal') {
|
||||||
|
props.customData.demonstration = false
|
||||||
|
props.customData.manual = false
|
||||||
|
}
|
||||||
|
else if(checkedValue.value === 'demonstration') {
|
||||||
|
props.customData.demonstration = true
|
||||||
|
props.customData.manual = false
|
||||||
|
}
|
||||||
|
else if(checkedValue.value === 'manual') {
|
||||||
|
props.customData.demonstration = false
|
||||||
|
props.customData.manual = true
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
@ -504,11 +504,31 @@ const resetData = () => {
|
|||||||
option3.value.title[0].text = toTwoDecimalPlaces(g * 100 / e) + ''
|
option3.value.title[0].text = toTwoDecimalPlaces(g * 100 / e) + ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const resetData1 = () => {
|
||||||
|
let a = customData.value.circle.value
|
||||||
|
let b = customData.value.center.value1
|
||||||
|
let c = customData.value.center.value2
|
||||||
|
let d = customData.value.center.value3
|
||||||
|
let e = customData.value.right.value1
|
||||||
|
let f = customData.value.right.value2
|
||||||
|
let g = customData.value.right.value3
|
||||||
|
|
||||||
|
dataArr.value = [a, b, c, d, e, f, g]
|
||||||
|
option2.value.series[0].data[0].value = toTwoDecimalPlaces(f * 100 / e)
|
||||||
|
option2.value.title[0].text = toTwoDecimalPlaces(f * 100 / e) + ''
|
||||||
|
option3.value.series[0].data[0].value = toTwoDecimalPlaces(g * 100/ e)
|
||||||
|
option3.value.title[0].text = toTwoDecimalPlaces(g * 100 / e) + ''
|
||||||
|
}
|
||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
if(customData.value.demonstration) {
|
if(customData.value.demonstration) {
|
||||||
resetData()
|
resetData()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if(customData.value.manual) {
|
||||||
|
resetData1()
|
||||||
|
return
|
||||||
|
}
|
||||||
if(!customData.value.enable) {
|
if(!customData.value.enable) {
|
||||||
dataArr.value = [1, 0, 0, 0, 0, 0, 0]
|
dataArr.value = [1, 0, 0, 0, 0, 0, 0]
|
||||||
option2.value.series[0].data[0].value = 0
|
option2.value.series[0].data[0].value = 0
|
||||||
@ -530,6 +550,21 @@ watch(() => customData.value.demonstration, () => {
|
|||||||
getData()
|
getData()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch([
|
||||||
|
() => customData.value.manual,
|
||||||
|
() => customData.value.circle.value,
|
||||||
|
() => customData.value.center.value1,
|
||||||
|
() => customData.value.center.value2,
|
||||||
|
() => customData.value.center.value3,
|
||||||
|
() => customData.value.right.value1,
|
||||||
|
() => customData.value.right.value2,
|
||||||
|
() => customData.value.right.value3,
|
||||||
|
], () => {
|
||||||
|
getData()
|
||||||
|
}, {
|
||||||
|
deep: true
|
||||||
|
})
|
||||||
|
|
||||||
let timer: unknown
|
let timer: unknown
|
||||||
watch(() => [props.chartConfig.request.requestInterval, props.chartConfig.request.requestIntervalUnit].join('&&'), v => {
|
watch(() => [props.chartConfig.request.requestInterval, props.chartConfig.request.requestIntervalUnit].join('&&'), v => {
|
||||||
if(!isPreview()) return
|
if(!isPreview()) return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user