@ledvance/group-ui-biz-bundle 1.0.133 → 1.0.135
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 +1 -1
- package/src/modules/energyConsumption/EnergyConsumptionActions.ts +3 -3
- package/src/modules/energyConsumption/EnergyConsumptionChart.tsx +4 -3
- package/src/modules/energyConsumption/EnergyConsumptionDetail.tsx +7 -4
- package/src/modules/energyConsumption/EnergyConsumptionPage.tsx +9 -2
- package/src/modules/energyConsumption/component/DateSelectedItem.tsx +1 -1
- package/src/modules/energyConsumption/component/NewBarChart.tsx +3 -1
- package/src/modules/switchInching/SwitchInching.tsx +2 -1
- package/src/modules/timeSchedule/Router.ts +15 -6
- package/src/modules/timeSchedule/TimeScheduleActions.ts +5 -2
- package/src/modules/timeSchedule/TimeScheduleAddPage.tsx +71 -0
- package/src/modules/timeSchedule/TimeScheduleDetailPage.tsx +13 -4
- package/src/modules/timeSchedule/TimeSchedulePage.tsx +1 -1
- package/src/navigation/Routers.ts +1 -0
package/package.json
CHANGED
|
@@ -85,7 +85,7 @@ const getDpResultByYear = async (devIdGroup: string[], addEleDpCode: string, dat
|
|
|
85
85
|
key: `${monthFormat(month)} ${year}`,
|
|
86
86
|
value: (Number(mergedData[month]) || 0).toFixed(2),
|
|
87
87
|
headlineText: `${year}${month}`,
|
|
88
|
-
chartTitle: `${monthFormatShort(month)}
|
|
88
|
+
chartTitle: `${monthFormatShort(month)}`
|
|
89
89
|
}
|
|
90
90
|
})
|
|
91
91
|
}
|
|
@@ -119,7 +119,7 @@ const getDpResultByYearMonth = async (deviceIdGroup: string[], addEleDpCode: str
|
|
|
119
119
|
|
|
120
120
|
// 格式化为 'YYYY/MM/DD' 格式
|
|
121
121
|
const formattedDate = `${year}/${month}/${day}`
|
|
122
|
-
const dateStr = `${day}
|
|
122
|
+
const dateStr = `${day}.${month}.${year}`
|
|
123
123
|
const dateObj = dayjs(formattedDate, "YYYY/MM/DD");
|
|
124
124
|
const dayOfWeek = dateObj.day() % 7;
|
|
125
125
|
const key = `${dateStr} (${loopsText[dayOfWeek]})`
|
|
@@ -127,7 +127,7 @@ const getDpResultByYearMonth = async (deviceIdGroup: string[], addEleDpCode: str
|
|
|
127
127
|
key,
|
|
128
128
|
value: Number(mergedData[time] || 0).toFixed(2),
|
|
129
129
|
headlineText: formattedDate,
|
|
130
|
-
chartTitle: `${Number(key?.split('
|
|
130
|
+
chartTitle: `${Number(key?.split('.')[0])} ${loopsText[dayOfWeek]}`
|
|
131
131
|
}
|
|
132
132
|
})
|
|
133
133
|
}
|
|
@@ -25,6 +25,7 @@ const { withTheme } = Utils.ThemeUtils
|
|
|
25
25
|
|
|
26
26
|
export interface EnergyConsumptionChartProps {
|
|
27
27
|
addEleDpCode: string
|
|
28
|
+
backTitle: string
|
|
28
29
|
headlineText: string
|
|
29
30
|
chartData: OverviewItem[],
|
|
30
31
|
over365Days?: boolean
|
|
@@ -37,7 +38,7 @@ export interface EnergyConsumptionChartProps {
|
|
|
37
38
|
|
|
38
39
|
const EnergyConsumptionChart = (props: { theme?: ThemeType }) => {
|
|
39
40
|
const params = useRoute().params as EnergyConsumptionChartProps
|
|
40
|
-
const { price, unit, date, addEleDpCode, deviceIdGroup, over365Days, over7Days } = params;
|
|
41
|
+
const { backTitle, price, unit, date, addEleDpCode, deviceIdGroup, over365Days, over7Days } = params;
|
|
41
42
|
|
|
42
43
|
const styles = StyleSheet.create({
|
|
43
44
|
listEmptyView: {
|
|
@@ -132,7 +133,7 @@ const EnergyConsumptionChart = (props: { theme?: ThemeType }) => {
|
|
|
132
133
|
state.headlineText = `${monthFormat(month)} ${year}`;
|
|
133
134
|
break
|
|
134
135
|
case DateType.Day:
|
|
135
|
-
state.headlineText = `${day}
|
|
136
|
+
state.headlineText = `${day}.${month}.${year} (${loopsText[dayOfWeek]})`;
|
|
136
137
|
break
|
|
137
138
|
}
|
|
138
139
|
}, [state.dateType, state.headlineText]);
|
|
@@ -149,7 +150,7 @@ const EnergyConsumptionChart = (props: { theme?: ThemeType }) => {
|
|
|
149
150
|
|
|
150
151
|
return (
|
|
151
152
|
<Page
|
|
152
|
-
backText={
|
|
153
|
+
backText={backTitle}
|
|
153
154
|
showGreenery={false}
|
|
154
155
|
greeneryIcon={res.energy_consumption_greenery}
|
|
155
156
|
loading={state.loading}
|
|
@@ -27,6 +27,7 @@ const { convertX: cx } = Utils.RatioUtils
|
|
|
27
27
|
const { withTheme } = Utils.ThemeUtils
|
|
28
28
|
|
|
29
29
|
export interface EnergyConsumptionDetailProps {
|
|
30
|
+
backTitle: string
|
|
30
31
|
addEleDpCode: string
|
|
31
32
|
curMonth: OverviewItem
|
|
32
33
|
price: string
|
|
@@ -99,7 +100,7 @@ const EnergyConsumptionDetail = (props: { theme?: ThemeType }) => {
|
|
|
99
100
|
|
|
100
101
|
// 格式化为 'YYYY/MM/DD' 格式
|
|
101
102
|
const formattedDate = `${year}/${month}/${day}`
|
|
102
|
-
const dateStr = `${day}
|
|
103
|
+
const dateStr = `${day}.${month}.${year}`
|
|
103
104
|
const dateObj = dayjs(formattedDate, "YYYY/MM/DD");
|
|
104
105
|
const dayOfWeek = dateObj.day() % 7;
|
|
105
106
|
const key = `${dateStr} (${loopsText[dayOfWeek]})`
|
|
@@ -107,7 +108,7 @@ const EnergyConsumptionDetail = (props: { theme?: ThemeType }) => {
|
|
|
107
108
|
key,
|
|
108
109
|
value: mergedData[time].toFixed(2),
|
|
109
110
|
headlineText: formattedDate,
|
|
110
|
-
chartTitle: `${Number(key?.split('
|
|
111
|
+
chartTitle: `${Number(key?.split('.')[0])} ${loopsText[dayOfWeek]}`
|
|
111
112
|
}
|
|
112
113
|
})
|
|
113
114
|
|
|
@@ -115,7 +116,7 @@ const EnergyConsumptionDetail = (props: { theme?: ThemeType }) => {
|
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
const getHourList = async (item: OverviewItem) => {
|
|
118
|
-
const value = item?.key?.split(' ')[0]?.split('
|
|
119
|
+
const value = item?.key?.split(' ')[0]?.split('.')
|
|
119
120
|
const date = `${value[2]}${value[1]}${value[0]}`
|
|
120
121
|
state.over7Days = overDays(date, 7)
|
|
121
122
|
if (state.over7Days) {
|
|
@@ -213,7 +214,7 @@ const EnergyConsumptionDetail = (props: { theme?: ThemeType }) => {
|
|
|
213
214
|
|
|
214
215
|
return (
|
|
215
216
|
<Page
|
|
216
|
-
backText={
|
|
217
|
+
backText={params.backTitle}
|
|
217
218
|
headlineText={params.curMonth.key}
|
|
218
219
|
headlineIcon={state.overviewList.length ? res.download_icon : undefined}
|
|
219
220
|
onHeadlineIconClick={() => {
|
|
@@ -301,6 +302,7 @@ const EnergyConsumptionDetail = (props: { theme?: ThemeType }) => {
|
|
|
301
302
|
headlineText={I18n.getLang('consumption_data_monthly_overview_field2_headline_text')}
|
|
302
303
|
headlineClick={() => {
|
|
303
304
|
navigation.navigate(ui_biz_routerKey.group_ui_biz_energy_consumption_chart, {
|
|
305
|
+
backTitle: params.backTitle,
|
|
304
306
|
headlineText: params.curMonth.key,
|
|
305
307
|
chartData: state.overviewList,
|
|
306
308
|
over365Days: state.over365Days,
|
|
@@ -316,6 +318,7 @@ const EnergyConsumptionDetail = (props: { theme?: ThemeType }) => {
|
|
|
316
318
|
const res = await getHourList(item)
|
|
317
319
|
state.loading = false
|
|
318
320
|
navigation.navigate(ui_biz_routerKey.group_ui_biz_energy_consumption_chart, {
|
|
321
|
+
backTitle: params.backTitle,
|
|
319
322
|
headlineText: item.key,
|
|
320
323
|
chartData: res,
|
|
321
324
|
over7Days: state.over7Days,
|
|
@@ -187,7 +187,7 @@ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
|
|
|
187
187
|
key: `${monthFormat(month)} ${year}`,
|
|
188
188
|
value: (Number(curMonth[month]) || 0).toFixed(2),
|
|
189
189
|
headlineText: `${year}${month}`,
|
|
190
|
-
chartTitle: `${monthFormatShort(month)}
|
|
190
|
+
chartTitle: `${monthFormatShort(month)}`,
|
|
191
191
|
};
|
|
192
192
|
});
|
|
193
193
|
return monthData;
|
|
@@ -205,6 +205,10 @@ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
|
|
|
205
205
|
state.unit = data.unit;
|
|
206
206
|
};
|
|
207
207
|
|
|
208
|
+
const backTitle = useMemo(() => {
|
|
209
|
+
return params.backText || I18n.getLang('sockets_ce')
|
|
210
|
+
}, [])
|
|
211
|
+
|
|
208
212
|
const styles = StyleSheet.create({
|
|
209
213
|
showTip: {
|
|
210
214
|
marginHorizontal: cx(24),
|
|
@@ -287,7 +291,7 @@ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
|
|
|
287
291
|
return (
|
|
288
292
|
<Page
|
|
289
293
|
style={{ position: 'relative' }}
|
|
290
|
-
backText={
|
|
294
|
+
backText={backTitle}
|
|
291
295
|
headlineText={I18n.getLang(
|
|
292
296
|
state.isSolarMode
|
|
293
297
|
? 'sockets_headline_power'
|
|
@@ -350,6 +354,7 @@ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
|
|
|
350
354
|
style={styles.cardContainer}
|
|
351
355
|
onPress={() => {
|
|
352
356
|
navigation.navigate(ui_biz_routerKey.group_ui_biz_energy_consumption_chart, {
|
|
357
|
+
backTitle,
|
|
353
358
|
headlineText: chartHeadline,
|
|
354
359
|
chartData: state.isSolarMode ? state.solarOverviewList : state.wifiOverviewList,
|
|
355
360
|
price: state.price,
|
|
@@ -485,6 +490,7 @@ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
|
|
|
485
490
|
headlineText={I18n.getLang('consumption_data_field4_headline_text')}
|
|
486
491
|
headlineClick={() => {
|
|
487
492
|
navigation.navigate(ui_biz_routerKey.group_ui_biz_energy_consumption_chart, {
|
|
493
|
+
backTitle,
|
|
488
494
|
headlineText: chartHeadline,
|
|
489
495
|
chartData: state.isSolarMode ? state.solarOverviewList : state.wifiOverviewList,
|
|
490
496
|
price: state.price,
|
|
@@ -496,6 +502,7 @@ const EnergyConsumptionPage = (props: { theme?: ThemeType }) => {
|
|
|
496
502
|
}}
|
|
497
503
|
overviewItemClick={(item) => {
|
|
498
504
|
navigation.navigate(ui_biz_routerKey.group_ui_biz_energy_consumption_detail, {
|
|
505
|
+
backTitle,
|
|
499
506
|
addEleDpCode: params.addEleDpCode,
|
|
500
507
|
curMonth: item,
|
|
501
508
|
price: state.price,
|
|
@@ -101,7 +101,7 @@ export default withTheme(function DateSelectedItem(props: DateSelectedItemProps)
|
|
|
101
101
|
state.date = `${datejs.month() + 1}/${datejs.year()}`;
|
|
102
102
|
break
|
|
103
103
|
case DateType.Day:
|
|
104
|
-
state.date = `${datejs.date()}
|
|
104
|
+
state.date = `${datejs.date()}.${datejs.month() + 1}.${datejs.year()}`;
|
|
105
105
|
}
|
|
106
106
|
state.modalMode = getModalMode(dateType);
|
|
107
107
|
}, [dateType, date]);
|
|
@@ -167,7 +167,7 @@ const SwitchInching = (props: { theme?: ThemeType }) => {
|
|
|
167
167
|
const newSwitchInchingItem = {
|
|
168
168
|
...state.switchInchingItem,
|
|
169
169
|
enable: v,
|
|
170
|
-
time
|
|
170
|
+
time: time < 2 ? 2 : time
|
|
171
171
|
}
|
|
172
172
|
updateState({ switchInchingItem: newSwitchInchingItem })
|
|
173
173
|
await saveInchingConfig(newSwitchInchingItem)
|
|
@@ -192,6 +192,7 @@ const SwitchInching = (props: { theme?: ThemeType }) => {
|
|
|
192
192
|
]}
|
|
193
193
|
setHour={m => updateTime(m, undefined)}
|
|
194
194
|
setMinute={s => updateTime(undefined, s)}
|
|
195
|
+
minMinute={timeRef.current.minute === '00' ? 2 : 0}
|
|
195
196
|
maxHour={61}
|
|
196
197
|
/>
|
|
197
198
|
</View>
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import {NavigationRoute} from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { NavigationRoute } from 'tuya-panel-kit'
|
|
2
|
+
import { ui_biz_routerKey } from '../../navigation/Routers'
|
|
3
|
+
import TimeScheduleAddPage from './TimeScheduleAddPage'
|
|
4
|
+
import TimeScheduleDetailPage from './TimeScheduleDetailPage'
|
|
5
|
+
import TimeSchedulePage from './TimeSchedulePage'
|
|
5
6
|
|
|
6
7
|
const TimeSchedulePageRouters: NavigationRoute[] = [
|
|
7
8
|
{
|
|
8
9
|
name: ui_biz_routerKey.group_ui_biz_time_schedule,
|
|
9
10
|
component: TimeSchedulePage,
|
|
10
|
-
options:{
|
|
11
|
+
options: {
|
|
12
|
+
hideTopbar: true,
|
|
13
|
+
showOfflineView: false,
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: ui_biz_routerKey.group_ui_biz_time_schedule_add,
|
|
18
|
+
component: TimeScheduleAddPage,
|
|
19
|
+
options: {
|
|
11
20
|
hideTopbar: true,
|
|
12
21
|
showOfflineView: false,
|
|
13
22
|
}
|
|
@@ -15,7 +24,7 @@ const TimeSchedulePageRouters: NavigationRoute[] = [
|
|
|
15
24
|
{
|
|
16
25
|
name: ui_biz_routerKey.group_ui_biz_time_schedule_edit,
|
|
17
26
|
component: TimeScheduleDetailPage,
|
|
18
|
-
options:{
|
|
27
|
+
options: {
|
|
19
28
|
hideTopbar: true,
|
|
20
29
|
showOfflineView: false,
|
|
21
30
|
}
|
|
@@ -4,6 +4,7 @@ import {flatMapDeep} from "lodash";
|
|
|
4
4
|
import {ColorList} from '@ledvance/base/src/components/StripAdjustView';
|
|
5
5
|
import {parseJSON} from "@tuya/tuya-panel-lamp-sdk/lib/utils";
|
|
6
6
|
import {AdjustType} from "@ledvance/base/src/utils/interface";
|
|
7
|
+
import { TimeScheduleDetailPageParams } from './TimeScheduleDetailPage'
|
|
7
8
|
|
|
8
9
|
export const defDeviceData = {
|
|
9
10
|
h: 0,
|
|
@@ -45,8 +46,10 @@ export const defMoodStripDeviceData = {
|
|
|
45
46
|
adjustType: AdjustType.COLOUR
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
export const defShutterDeviceData = {
|
|
49
|
-
|
|
49
|
+
export const defShutterDeviceData = (props: TimeScheduleDetailPageParams) => {
|
|
50
|
+
return {
|
|
51
|
+
percentControl: (props.suggestValue !== undefined && !props.suggestValue) ? 0 : 100
|
|
52
|
+
}
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
export const defOsramFanLightDeviceData = {
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import Card from '@ledvance/base/src/components/Card'
|
|
2
|
+
import Page from '@ledvance/base/src/components/Page'
|
|
3
|
+
import Spacer from '@ledvance/base/src/components/Spacer'
|
|
4
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
5
|
+
import { useParams } from '@ledvance/base/src/hooks/Hooks'
|
|
6
|
+
import I18n from '@ledvance/base/src/i18n'
|
|
7
|
+
import { useNavigation } from '@react-navigation/native'
|
|
8
|
+
import { useReactive } from 'ahooks'
|
|
9
|
+
import React, { useCallback } from 'react'
|
|
10
|
+
import { StyleSheet, Text, View } from 'react-native'
|
|
11
|
+
import { Utils } from 'tuya-panel-kit'
|
|
12
|
+
import { ui_biz_routerKey } from '../../navigation/Routers'
|
|
13
|
+
import { TimeScheduleDetailPageParams } from './TimeScheduleDetailPage'
|
|
14
|
+
|
|
15
|
+
const { convertX: cx } = Utils.RatioUtils
|
|
16
|
+
const { withTheme } = Utils.ThemeUtils
|
|
17
|
+
|
|
18
|
+
interface TimeScheduleAddProps {
|
|
19
|
+
theme?: ThemeType
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const TimeScheduleAddPage = (props: TimeScheduleAddProps) => {
|
|
23
|
+
const params = useParams<TimeScheduleDetailPageParams>()
|
|
24
|
+
const navigation = useNavigation()
|
|
25
|
+
const state = useReactive({
|
|
26
|
+
loading: false,
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const nextPage = useCallback((suggestValue?: boolean) => {
|
|
30
|
+
navigation.navigate(ui_biz_routerKey.group_ui_biz_time_schedule_edit, {
|
|
31
|
+
...params,
|
|
32
|
+
suggestValue
|
|
33
|
+
})
|
|
34
|
+
}, [])
|
|
35
|
+
|
|
36
|
+
const styles = StyleSheet.create({
|
|
37
|
+
card: {
|
|
38
|
+
marginHorizontal: cx(24),
|
|
39
|
+
padding: cx(16)
|
|
40
|
+
},
|
|
41
|
+
text: {
|
|
42
|
+
color: props.theme?.global.fontColor,
|
|
43
|
+
fontSize: cx(16),
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Page
|
|
49
|
+
backText={I18n.getLang('motion_detection_add_time_schedule_system_back_text')}
|
|
50
|
+
headlineText={I18n.getLang('motion_detection_add_time_schedule_headline_text')}
|
|
51
|
+
loading={state.loading}
|
|
52
|
+
>
|
|
53
|
+
<View>
|
|
54
|
+
<Spacer/>
|
|
55
|
+
<Card style={styles.card} onPress={() => nextPage()}>
|
|
56
|
+
<Text style={styles.text}>{I18n.getLang('timeschedule_own')}</Text>
|
|
57
|
+
</Card>
|
|
58
|
+
<Spacer/>
|
|
59
|
+
<Card style={styles.card} onPress={() => nextPage(true)}>
|
|
60
|
+
<Text style={styles.text}>{I18n.getLang('timeschedule_on')}</Text>
|
|
61
|
+
</Card>
|
|
62
|
+
<Spacer/>
|
|
63
|
+
<Card style={styles.card} onPress={() => nextPage(false)}>
|
|
64
|
+
<Text style={styles.text}>{I18n.getLang('timeschedule_off')}</Text>
|
|
65
|
+
</Card>
|
|
66
|
+
</View>
|
|
67
|
+
</Page>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default withTheme(TimeScheduleAddPage)
|
|
@@ -18,6 +18,7 @@ import { SwitchButton, TimerPicker, Utils } from 'tuya-panel-kit';
|
|
|
18
18
|
import Spacer from '@ledvance/base/src/components/Spacer';
|
|
19
19
|
import LdvWeekView from '@ledvance/base/src/components/weekSelect';
|
|
20
20
|
import { convertTo12HourFormat, loopText, showDialog } from '@ledvance/base/src/utils/common';
|
|
21
|
+
import { ui_biz_routerKey } from '../../navigation/Routers'
|
|
21
22
|
import {
|
|
22
23
|
ComponentConfig,
|
|
23
24
|
DeviceType,
|
|
@@ -50,11 +51,12 @@ import DiySceneItem from '@ledvance/base/src/components/DiySceneItem';
|
|
|
50
51
|
const { convertX: cx } = Utils.RatioUtils;
|
|
51
52
|
const { withTheme } = Utils.ThemeUtils
|
|
52
53
|
const { toFixedString } = Utils.NumberUtils;
|
|
53
|
-
interface TimeScheduleDetailPageParams extends TimeSchedulePageParams {
|
|
54
|
+
export interface TimeScheduleDetailPageParams extends TimeSchedulePageParams {
|
|
54
55
|
mode: 'add' | 'edit';
|
|
55
56
|
timeSchedule: Timer;
|
|
56
57
|
modDeleteTimeSchedule: (mode: 'add' | 'edit' | 'del', timeSchedule: Timer, ids: string) => Promise<Result<any>>
|
|
57
58
|
refreshFn: () => void;
|
|
59
|
+
suggestValue?: boolean
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
const TimeScheduleDetailPage = (props: { theme?: ThemeType }) => {
|
|
@@ -89,7 +91,7 @@ const TimeScheduleDetailPage = (props: { theme?: ThemeType }) => {
|
|
|
89
91
|
|
|
90
92
|
useEffect(() => {
|
|
91
93
|
const { applyForDisabled, timeSchedule, applyForList, mode } = params;
|
|
92
|
-
const cannotChoose = applyForDisabled || applyForList.length === 1;
|
|
94
|
+
const cannotChoose = applyForDisabled || applyForList.length === 1 || params.suggestValue !== undefined;
|
|
93
95
|
const cloneApplyList =
|
|
94
96
|
mode === 'add'
|
|
95
97
|
? cloneDeep(applyForList)
|
|
@@ -130,6 +132,13 @@ const TimeScheduleDetailPage = (props: { theme?: ThemeType }) => {
|
|
|
130
132
|
state.isManual = isManual;
|
|
131
133
|
state.mood = mood;
|
|
132
134
|
}
|
|
135
|
+
|
|
136
|
+
if (params.suggestValue !== undefined) {
|
|
137
|
+
state.selectedSkill.forEach(it => {
|
|
138
|
+
it.enable = !!params.suggestValue
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
|
|
133
142
|
state.initSelectedSkill = cloneDeep(state.selectedSkill)
|
|
134
143
|
if (!(Array.isArray(moods) && moods.length)) {
|
|
135
144
|
state.timerId = setTimeout(() => {
|
|
@@ -351,7 +360,7 @@ const TimeScheduleDetailPage = (props: { theme?: ThemeType }) => {
|
|
|
351
360
|
state.loading = false;
|
|
352
361
|
if (res.success) {
|
|
353
362
|
params.refreshFn()
|
|
354
|
-
navigation.
|
|
363
|
+
navigation.navigate(ui_biz_routerKey.group_ui_biz_time_schedule)
|
|
355
364
|
}
|
|
356
365
|
}}
|
|
357
366
|
backDialogTitle={I18n.getLang('cancel_dialog_leave_unsaved_titel')}
|
|
@@ -692,7 +701,7 @@ const getDefaultManual = (props: TimeScheduleDetailPageParams): ComponentConfig
|
|
|
692
701
|
[DeviceType.MixLight]: defMixDeviceData,
|
|
693
702
|
[DeviceType.FanLight]: defFanLightDeviceData,
|
|
694
703
|
[DeviceType.MoodStrip]: defMoodStripDeviceData,
|
|
695
|
-
[DeviceType.Shutter]: defShutterDeviceData,
|
|
704
|
+
[DeviceType.Shutter]: defShutterDeviceData(props),
|
|
696
705
|
[DeviceType.OsramFanLight]: defOsramFanLightDeviceData,
|
|
697
706
|
[DeviceType.LightSource]: defDeviceData,
|
|
698
707
|
};
|
|
@@ -93,7 +93,7 @@ const TimeSchedulePage = (props: { theme?: ThemeType }) => {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
const navigateToEdit = useCallback((mode: 'add' | 'edit', timeSchedule?: Timer) => {
|
|
96
|
-
const path = ui_biz_routerKey.group_ui_biz_time_schedule_edit;
|
|
96
|
+
const path = mode === 'add' ? ui_biz_routerKey.group_ui_biz_time_schedule_add : ui_biz_routerKey.group_ui_biz_time_schedule_edit;
|
|
97
97
|
navigation.navigate(path, {
|
|
98
98
|
mode,
|
|
99
99
|
name: path,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const ui_biz_routerKey = {
|
|
2
2
|
'group_ui_biz_timer': 'group_ui_biz_timer',
|
|
3
3
|
'group_ui_biz_time_schedule': 'group_ui_biz_time_schedule',
|
|
4
|
+
'group_ui_biz_time_schedule_add': 'group_ui_biz_time_schedule_add',
|
|
4
5
|
'group_ui_biz_time_schedule_edit': 'group_ui_biz_time_schedule_edit',
|
|
5
6
|
'group_ui_biz_mood': 'group_ui_biz_mood',
|
|
6
7
|
'group_ui_biz_mood_add': 'group_ui_biz_mood_add',
|