@ledvance/ui-biz-bundle 1.1.169 → 1.1.170
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -303,6 +303,11 @@ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
|
|
|
303
303
|
|
|
304
304
|
const updateEnergyData = (data: EnergyData) => {
|
|
305
305
|
updatePrice(devId, data).then()
|
|
306
|
+
state.network_fixed_data = {
|
|
307
|
+
unit: data.unit,
|
|
308
|
+
energyType: 'fixed',
|
|
309
|
+
[isGeneration ? 'generatePrice' : 'price']: data.price,
|
|
310
|
+
}
|
|
306
311
|
state.price = data.price || '0'
|
|
307
312
|
state.unit = data.unit
|
|
308
313
|
state.energyType = 'fixed'
|
|
@@ -709,7 +714,7 @@ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
|
|
|
709
714
|
title={state.popupType === 'co2' ? I18n.getLang('consumption_data_field3_co2_topic_text') : state.popupType === 'history' ? I18n.getLang('group_energytotal') : ''}
|
|
710
715
|
cancelText={['co2', 'history'].includes(state.popupType) ? '' : I18n.getLang("auto_scan_system_cancel")}
|
|
711
716
|
confirmText={I18n.getLang(['co2', 'history'].includes(state.popupType) ? 'home_screen_home_dialog_yes_con' : 'auto_scan_system_wifi_confirm')}
|
|
712
|
-
energyData={{ price: state.price, unit: state.unit }}
|
|
717
|
+
energyData={{ price: state.popupType === 'money' ? (state.network_fixed_data?.price ?? '0'): state.price , unit: state.unit }}
|
|
713
718
|
energyHistory={state.energyGeneration.history}
|
|
714
719
|
onConfirm={(energyData) => {
|
|
715
720
|
state.popupType = ''
|
|
@@ -78,16 +78,25 @@ const PowerLineChart = (props: PowerLineChartProps) => {
|
|
|
78
78
|
triggerOn: 'mousemove|click',
|
|
79
79
|
trigger: 'axis',
|
|
80
80
|
position: ['30%', '50%'],
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
axisPointer: {
|
|
82
|
+
label: {
|
|
83
|
+
backgroundColor: '#6a7985',
|
|
84
|
+
// 这个 formatter 只负责格式化时间
|
|
85
|
+
formatter: (params: { value: number }) => {
|
|
86
|
+
const date = new Date(params.value);
|
|
87
|
+
|
|
88
|
+
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
89
|
+
const day = date.getDate().toString().padStart(2, '0');
|
|
90
|
+
const year = date.getFullYear();
|
|
91
|
+
|
|
92
|
+
const hours = date.getHours().toString().padStart(2, '0');
|
|
93
|
+
const minutes = date.getMinutes().toString().padStart(2, '0');
|
|
94
|
+
const seconds = date.getSeconds().toString().padStart(2, '0');
|
|
95
|
+
|
|
96
|
+
// 返回你指定的 DD/MM/YYYY HH:mm:SS 格式
|
|
97
|
+
return day + '/' + month + '/' + year + ' ' + hours + ':' + minutes + ':' + seconds;
|
|
98
|
+
}
|
|
87
99
|
}
|
|
88
|
-
var time = pad(date.getMonth() + 1) + '/' + pad(date.getDate()) + '/' + date.getFullYear() + ' ' +
|
|
89
|
-
pad(date.getHours()) + ':' + pad(date.getMinutes()) + ':' + pad(date.getSeconds())
|
|
90
|
-
return (time + '<br/>' + item.marker + item.seriesName + ': ' + item.value[1])
|
|
91
100
|
}
|
|
92
101
|
},
|
|
93
102
|
grid: {
|