@ledvance/ui-biz-bundle 1.1.124 → 1.1.125

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.124",
7
+ "version": "1.1.125",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -82,11 +82,17 @@ const SwitchHistoryPage = (props: { theme?: ThemeType }) => {
82
82
  }, [state.onRefresh, state.filterTags])
83
83
 
84
84
  const downFile = () => {
85
- const headers = [I18n.getLang('date'), 'Time', 'Status', I18n.getLang('manual_search_button_socket')]
85
+ const headers = [I18n.getLang('date'), 'Time', 'Status']
86
+ if (!!tags) {
87
+ headers.push(I18n.getLang('manual_search_button_socket'))
88
+ }
86
89
  const values = state.data.reduce((acc, item) => {
87
90
  const actions = item.actions.map(action => {
88
- const name = tags ? tags[action.dpId] : action.dpId
89
- return [action.date, action.time, action.action, name]
91
+ const data = [action.date, action.time, action.action];
92
+ if (!!tags) {
93
+ data.push(tags[action.dpId])
94
+ }
95
+ return data
90
96
  });
91
97
  return acc.concat(actions);
92
98
  }, [] as string[][]);
@@ -139,7 +139,7 @@ const getDpResultByDate = async (devId: string, addEleDpCode: string, date: stri
139
139
 
140
140
  export const exportEnergyCsv = (values: any[][], unit: string) => {
141
141
  const headers = [I18n.getLang('date'), `${I18n.getLang('consumption_data_annual_bar_chart_system_back_text')} (kWh)`, `Price(${unit})`]
142
- const functionName = `${I18n.getLang('consumption_data_annual_bar_chart_system_back_text')}`
142
+ const functionName = 'EnergyConsumption'
143
143
  exportCsvFile(headers, values, functionName)
144
144
  }
145
145