mirror of
https://gitee.com/dromara/go-view.git
synced 2025-06-29 16:29:14 +08:00
fix: 综合PUE通用1新增手动输入模式
This commit is contained in:
parent
d5336bb909
commit
117fa5d72f
@ -16,21 +16,29 @@ export const customData = {
|
||||
title: '综合PUE',
|
||||
enable: false,
|
||||
demonstration: false,
|
||||
manual: false,
|
||||
id: null,
|
||||
circle: {
|
||||
title: '昨日PUE',
|
||||
value: 0,
|
||||
},
|
||||
center: {
|
||||
title1: '实时PUE',
|
||||
value1: 0,
|
||||
title2: '上周PUE',
|
||||
value2: 0,
|
||||
title3: '上月PUE',
|
||||
value3: 0,
|
||||
},
|
||||
right: {
|
||||
title1: '总功率(kWh)',
|
||||
value1: 0,
|
||||
calculation1: '',
|
||||
title2: 'IT功率(kW)',
|
||||
value2: 0,
|
||||
calculation2: '',
|
||||
title3: '其他功率(kW)',
|
||||
value3: 0,
|
||||
},
|
||||
showInterval: true,
|
||||
}
|
||||
|
@ -7,55 +7,125 @@
|
||||
<n-switch v-model:value="props.customData.enable" size="small"/>
|
||||
</n-space>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="开启演示模式">
|
||||
<n-space>
|
||||
<n-switch v-model:value="props.customData.demonstration" size="small"/>
|
||||
<setting-item-box name="模式" alone>
|
||||
<n-space >
|
||||
<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>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="报表ID" alone>
|
||||
<setting-item name="控制左边和中间的ID">
|
||||
<n-input v-model:value="props.customData.id" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="仪表盘">
|
||||
<setting-item name="标题">
|
||||
<n-input v-model:value="props.customData.circle.title" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="中间">
|
||||
<setting-item name="标题1">
|
||||
<n-input v-model:value="props.customData.center.title1" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
<setting-item name="标题2">
|
||||
<n-input v-model:value="props.customData.center.title2" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
<setting-item name="标题3">
|
||||
<n-input v-model:value="props.customData.center.title3" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="右边">
|
||||
<setting-item name="标题1">
|
||||
<n-input v-model:value="props.customData.right.title1" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
<setting-item name="测点计算公式1">
|
||||
<n-input v-model:value="props.customData.right.calculation1" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
<setting-item name="标题2">
|
||||
<n-input v-model:value="props.customData.right.title2" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
<setting-item name="测点计算公式2">
|
||||
<n-input v-model:value="props.customData.right.calculation2" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
<setting-item name="标题3">
|
||||
<n-input v-model:value="props.customData.right.title3" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
<template v-if="checkedValue === 'normal'">
|
||||
<setting-item-box name="报表ID" alone>
|
||||
<setting-item name="控制左边和中间的ID">
|
||||
<n-input v-model:value="props.customData.id" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="仪表盘">
|
||||
<setting-item name="标题">
|
||||
<n-input v-model:value="props.customData.circle.title" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="中间">
|
||||
<setting-item name="标题1">
|
||||
<n-input v-model:value="props.customData.center.title1" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
<setting-item name="标题2">
|
||||
<n-input v-model:value="props.customData.center.title2" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
<setting-item name="标题3">
|
||||
<n-input v-model:value="props.customData.center.title3" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="右边">
|
||||
<setting-item name="标题1">
|
||||
<n-input v-model:value="props.customData.right.title1" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
<setting-item name="测点计算公式1">
|
||||
<n-input v-model:value="props.customData.right.calculation1" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
<setting-item name="标题2">
|
||||
<n-input v-model:value="props.customData.right.title2" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
<setting-item name="测点计算公式2">
|
||||
<n-input v-model:value="props.customData.right.calculation2" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
<setting-item name="标题3">
|
||||
<n-input v-model:value="props.customData.right.title3" size="small" placeholder="请输入"/>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
</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>
|
||||
import { watch, ref } from 'vue'
|
||||
import { SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
|
||||
|
||||
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>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -504,11 +504,31 @@ const resetData = () => {
|
||||
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 () => {
|
||||
if(customData.value.demonstration) {
|
||||
resetData()
|
||||
return
|
||||
}
|
||||
if(customData.value.manual) {
|
||||
resetData1()
|
||||
return
|
||||
}
|
||||
if(!customData.value.enable) {
|
||||
dataArr.value = [1, 0, 0, 0, 0, 0, 0]
|
||||
option2.value.series[0].data[0].value = 0
|
||||
@ -530,6 +550,21 @@ watch(() => customData.value.demonstration, () => {
|
||||
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
|
||||
watch(() => [props.chartConfig.request.requestInterval, props.chartConfig.request.requestIntervalUnit].join('&&'), v => {
|
||||
if(!isPreview()) return
|
||||
|
Loading…
x
Reference in New Issue
Block a user