|
@@ -18,6 +18,7 @@ import { CanvasRenderer } from 'echarts/renderers';
|
|
|
|
|
|
import SvgIcon from '@/components/SvgIcon.vue';
|
|
import SvgIcon from '@/components/SvgIcon.vue';
|
|
import { useRequest } from '@/hooks/request';
|
|
import { useRequest } from '@/hooks/request';
|
|
|
|
+import { t } from '@/i18n';
|
|
import { getPointTimeSeries } from '@/api';
|
|
import { getPointTimeSeries } from '@/api';
|
|
|
|
|
|
import SetTempHumidityModal from './SetTempHumidityModal.vue';
|
|
import SetTempHumidityModal from './SetTempHumidityModal.vue';
|
|
@@ -68,12 +69,12 @@ const chartStyle = ref<ChartStyle>({
|
|
const degreeData = ref([
|
|
const degreeData = ref([
|
|
{
|
|
{
|
|
value: '1',
|
|
value: '1',
|
|
- label: '温度',
|
|
|
|
|
|
+ label: t('envMonitor.temperature'),
|
|
icon: 'temperature',
|
|
icon: 'temperature',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
value: '2',
|
|
value: '2',
|
|
- label: '湿度',
|
|
|
|
|
|
+ label: t('envMonitor.humidity'),
|
|
icon: 'humidity',
|
|
icon: 'humidity',
|
|
},
|
|
},
|
|
]);
|
|
]);
|
|
@@ -174,12 +175,16 @@ const getCurvedData = (data: HistoricalDataSequence[], value: string) => {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+const temperatureHumidity = () => {
|
|
|
|
+ return degreeValue.value === '1' ? t('envMonitor.temperature') : t('envMonitor.humidity');
|
|
|
|
+};
|
|
|
|
+
|
|
const option = computed(() => {
|
|
const option = computed(() => {
|
|
if (!curvedDataList.value) return {};
|
|
if (!curvedDataList.value) return {};
|
|
return {
|
|
return {
|
|
color: ['#1F8FFB', '#32BAC0'],
|
|
color: ['#1F8FFB', '#32BAC0'],
|
|
title: {
|
|
title: {
|
|
- subtext: '单位: ' + (degreeValue.value === '1' ? '°C' : '%'),
|
|
|
|
|
|
+ subtext: t('setupProtocol.protocolParamFields.unit') + ': ' + (degreeValue.value === '1' ? ' °C' : ' %'),
|
|
padding: [0, 0, 0, 30], // 标题内边距
|
|
padding: [0, 0, 0, 30], // 标题内边距
|
|
subtextStyle: {
|
|
subtextStyle: {
|
|
color: '#999', // 设置副标题颜色
|
|
color: '#999', // 设置副标题颜色
|
|
@@ -204,9 +209,10 @@ const option = computed(() => {
|
|
data: [
|
|
data: [
|
|
{
|
|
{
|
|
name:
|
|
name:
|
|
- '室内' +
|
|
|
|
- (degreeValue.value === '1' ? '温度' : '湿度') +
|
|
|
|
- '设定值:' +
|
|
|
|
|
|
+ t('envMonitor.indoor') +
|
|
|
|
+ temperatureHumidity() +
|
|
|
|
+ t('envMonitor.setValue') +
|
|
|
|
+ ':' +
|
|
(degreeValue.value === '1' ? curvedDataList.value.tempPreset : curvedDataList.value.humidityPreset) +
|
|
(degreeValue.value === '1' ? curvedDataList.value.tempPreset : curvedDataList.value.humidityPreset) +
|
|
'℃',
|
|
'℃',
|
|
icon: 'path://M128 501.333v64H0v-64zm213.333 0v64h-128v-64zm213.334 0v64h-128v-64zm234.666 0v64h-128v-64zm234.667 0v64H896v-64z',
|
|
icon: 'path://M128 501.333v64H0v-64zm213.333 0v64h-128v-64zm213.334 0v64h-128v-64zm234.666 0v64h-128v-64zm234.667 0v64H896v-64z',
|
|
@@ -217,9 +223,10 @@ const option = computed(() => {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name:
|
|
name:
|
|
- '室内' +
|
|
|
|
- (degreeValue.value === '1' ? '温度' : '湿度') +
|
|
|
|
- '上限值:' +
|
|
|
|
|
|
+ t('envMonitor.indoor') +
|
|
|
|
+ temperatureHumidity() +
|
|
|
|
+ t('envMonitor.upperLimitValue') +
|
|
|
|
+ ':' +
|
|
(degreeValue.value === '1' ? curvedDataList.value.tempUpper : curvedDataList.value.humidityUpper) +
|
|
(degreeValue.value === '1' ? curvedDataList.value.tempUpper : curvedDataList.value.humidityUpper) +
|
|
'℃',
|
|
'℃',
|
|
icon: 'path://M128 501.333v64H0v-64zm213.333 0v64h-128v-64zm213.334 0v64h-128v-64zm234.666 0v64h-128v-64zm234.667 0v64H896v-64z',
|
|
icon: 'path://M128 501.333v64H0v-64zm213.333 0v64h-128v-64zm213.334 0v64h-128v-64zm234.666 0v64h-128v-64zm234.667 0v64H896v-64z',
|
|
@@ -228,13 +235,13 @@ const option = computed(() => {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: '室内' + (degreeValue.value === '1' ? '温度' : '湿度'),
|
|
|
|
|
|
+ name: t('envMonitor.indoor') + temperatureHumidity(),
|
|
itemStyle: {
|
|
itemStyle: {
|
|
color: '#1F8FFB',
|
|
color: '#1F8FFB',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: '送风' + (degreeValue.value === '1' ? '温度' : '湿度'),
|
|
|
|
|
|
+ name: t('envMonitor.supplyAir') + temperatureHumidity(),
|
|
itemStyle: {
|
|
itemStyle: {
|
|
color: '#32BAC0',
|
|
color: '#32BAC0',
|
|
},
|
|
},
|
|
@@ -290,9 +297,10 @@ const option = computed(() => {
|
|
// 室内温度设定值虚线
|
|
// 室内温度设定值虚线
|
|
{
|
|
{
|
|
name:
|
|
name:
|
|
- '室内' +
|
|
|
|
- (degreeValue.value === '1' ? '温度' : '湿度') +
|
|
|
|
- '设定值:' +
|
|
|
|
|
|
+ t('envMonitor.indoor') +
|
|
|
|
+ temperatureHumidity() +
|
|
|
|
+ t('envMonitor.setValue') +
|
|
|
|
+ ':' +
|
|
(degreeValue.value === '1' ? curvedDataList.value.tempPreset : curvedDataList.value.humidityPreset) +
|
|
(degreeValue.value === '1' ? curvedDataList.value.tempPreset : curvedDataList.value.humidityPreset) +
|
|
'℃',
|
|
'℃',
|
|
type: 'line',
|
|
type: 'line',
|
|
@@ -318,9 +326,10 @@ const option = computed(() => {
|
|
// 室内温度上限值虚线
|
|
// 室内温度上限值虚线
|
|
{
|
|
{
|
|
name:
|
|
name:
|
|
- '室内' +
|
|
|
|
- (degreeValue.value === '1' ? '温度' : '湿度') +
|
|
|
|
- '上限值:' +
|
|
|
|
|
|
+ t('envMonitor.indoor') +
|
|
|
|
+ temperatureHumidity() +
|
|
|
|
+ t('envMonitor.upperLimitValue') +
|
|
|
|
+ ':' +
|
|
(degreeValue.value === '1' ? curvedDataList.value.tempUpper : curvedDataList.value.humidityUpper) +
|
|
(degreeValue.value === '1' ? curvedDataList.value.tempUpper : curvedDataList.value.humidityUpper) +
|
|
'℃',
|
|
'℃',
|
|
type: 'line',
|
|
type: 'line',
|
|
@@ -343,7 +352,7 @@ const option = computed(() => {
|
|
},
|
|
},
|
|
// 室内温度折线
|
|
// 室内温度折线
|
|
{
|
|
{
|
|
- name: '室内' + (degreeValue.value === '1' ? '温度' : '湿度'),
|
|
|
|
|
|
+ name: t('envMonitor.indoor') + temperatureHumidity(),
|
|
type: 'line',
|
|
type: 'line',
|
|
data:
|
|
data:
|
|
degreeValue.value === '1'
|
|
degreeValue.value === '1'
|
|
@@ -368,7 +377,7 @@ const option = computed(() => {
|
|
},
|
|
},
|
|
// 送风温度折线
|
|
// 送风温度折线
|
|
{
|
|
{
|
|
- name: '送风' + (degreeValue.value === '1' ? '温度' : '湿度'),
|
|
|
|
|
|
+ name: t('envMonitor.supplyAir') + temperatureHumidity(),
|
|
type: 'line',
|
|
type: 'line',
|
|
data:
|
|
data:
|
|
degreeValue.value === '1'
|
|
degreeValue.value === '1'
|
|
@@ -441,32 +450,43 @@ onMounted(() => {
|
|
@setClick="setClick"
|
|
@setClick="setClick"
|
|
/>
|
|
/>
|
|
<AFlex v-else>
|
|
<AFlex v-else>
|
|
- <ASelect v-model:value="dateShortcut" placeholder="请选择" class="date-shortcut" @change="handleShortcutChange">
|
|
|
|
- <ASelectOption :value="0">最近1天</ASelectOption>
|
|
|
|
- <ASelectOption :value="1">最近7天</ASelectOption>
|
|
|
|
- <ASelectOption :value="2">最近30天</ASelectOption>
|
|
|
|
- <ASelectOption :value="3">自定义</ASelectOption>
|
|
|
|
|
|
+ <ASelect
|
|
|
|
+ v-model:value="dateShortcut"
|
|
|
|
+ :placeholder="$t('common.plzSelect')"
|
|
|
|
+ class="date-shortcut"
|
|
|
|
+ @change="handleShortcutChange"
|
|
|
|
+ >
|
|
|
|
+ <ASelectOption :value="0">{{ $t('common.recentlyOneDay') }}</ASelectOption>
|
|
|
|
+ <ASelectOption :value="1">{{ $t('common.recentlySevenDays') }}</ASelectOption>
|
|
|
|
+ <ASelectOption :value="2">{{ $t('common.recentlyThirtyDays') }}</ASelectOption>
|
|
|
|
+ <ASelectOption :value="3">{{ $t('common.custom') }}</ASelectOption>
|
|
</ASelect>
|
|
</ASelect>
|
|
<ARangePicker
|
|
<ARangePicker
|
|
v-model:value="historicalDataValue"
|
|
v-model:value="historicalDataValue"
|
|
:disabled-date="disabledDate"
|
|
:disabled-date="disabledDate"
|
|
:allow-clear="false"
|
|
:allow-clear="false"
|
|
- separator="至"
|
|
|
|
|
|
+ :separator="$t('common.to')"
|
|
@openChange="addCustomizedTime"
|
|
@openChange="addCustomizedTime"
|
|
/>
|
|
/>
|
|
</AFlex>
|
|
</AFlex>
|
|
</AFlex>
|
|
</AFlex>
|
|
<AFlex v-if="setShow" class="date-selection-div">
|
|
<AFlex v-if="setShow" class="date-selection-div">
|
|
- <ASelect v-model:value="dateShortcut" placeholder="请选择" class="date-shortcut" @change="handleShortcutChange">
|
|
|
|
- <ASelectOption :value="0">最近1天</ASelectOption>
|
|
|
|
- <ASelectOption :value="1">最近7天</ASelectOption>
|
|
|
|
- <ASelectOption :value="2">最近30天</ASelectOption>
|
|
|
|
- <ASelectOption :value="3">自定义</ASelectOption>
|
|
|
|
|
|
+ <ASelect
|
|
|
|
+ v-model:value="dateShortcut"
|
|
|
|
+ :placeholder="$t('common.plzSelect')"
|
|
|
|
+ class="date-shortcut"
|
|
|
|
+ @change="handleShortcutChange"
|
|
|
|
+ >
|
|
|
|
+ <ASelectOption :value="0">{{ $t('common.recentlyOneDay') }}</ASelectOption>
|
|
|
|
+ <ASelectOption :value="1">{{ $t('common.recentlySevenDays') }}</ASelectOption>
|
|
|
|
+ <ASelectOption :value="2">{{ $t('common.recentlyThirtyDays') }}</ASelectOption>
|
|
|
|
+ <ASelectOption :value="3">{{ $t('common.custom') }}</ASelectOption>
|
|
</ASelect>
|
|
</ASelect>
|
|
<ARangePicker
|
|
<ARangePicker
|
|
v-model:value="historicalDataValue"
|
|
v-model:value="historicalDataValue"
|
|
:disabled-date="disabledDate"
|
|
:disabled-date="disabledDate"
|
|
:allow-clear="false"
|
|
:allow-clear="false"
|
|
|
|
+ :separator="$t('common.to')"
|
|
@openChange="addCustomizedTime"
|
|
@openChange="addCustomizedTime"
|
|
/>
|
|
/>
|
|
</AFlex>
|
|
</AFlex>
|