@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
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/ui-biz-bundle",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.1.169",
7
+ "version": "1.1.170",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -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 = ''
@@ -389,6 +389,7 @@ export const useSetSegmentPrice = (params: SetSegmentedPricesParams, theme?: The
389
389
  bottom: 0,
390
390
  left: 0,
391
391
  width: cx(40),
392
+ minHeight: cx(320),
392
393
  },
393
394
  segmentItem: {
394
395
  position: 'relative',
@@ -78,16 +78,25 @@ const PowerLineChart = (props: PowerLineChartProps) => {
78
78
  triggerOn: 'mousemove|click',
79
79
  trigger: 'axis',
80
80
  position: ['30%', '50%'],
81
- formatter: function (params) {
82
- if (!params || !params.length) return ''
83
- var item = params[0]
84
- var date = new Date(item.value[0])
85
- function pad(num) {
86
- return num < 10 ? '0' + num : num
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: {