@ledvance/ui-biz-bundle 1.1.144 → 1.1.145
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/navigation/Routers.ts +1 -0
- package/src/newModules/biorhythm/BiorhythmActions.ts +1 -1
- package/src/newModules/energyConsumption/EnergyConsumptionActions.ts +3 -3
- package/src/newModules/energyConsumption/EnergyConsumptionChart.tsx +4 -3
- package/src/newModules/energyConsumption/EnergyConsumptionDetail.tsx +7 -4
- package/src/newModules/energyConsumption/EnergyConsumptionPage.tsx +10 -3
- package/src/newModules/energyConsumption/component/DateSelectedItem.tsx +1 -1
- package/src/newModules/energyConsumption/component/NewBarChart.tsx +3 -1
- package/src/newModules/energyConsumption/component/PowerLineChart.tsx +1 -0
- package/src/newModules/timeSchedule/Router.ts +13 -4
- package/src/newModules/timeSchedule/TimeScheduleAddPage.tsx +71 -0
- package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +44 -36
- package/src/newModules/timeSchedule/TimeSchedulePage.tsx +1 -1
package/package.json
CHANGED
|
@@ -30,6 +30,7 @@ export const ui_biz_routerKey = {
|
|
|
30
30
|
'ui_biz_flag_page': 'ui_biz_flag_page',
|
|
31
31
|
'ui_biz_flag_page_edit': 'ui_biz_flag_page_edit',
|
|
32
32
|
'ui_biz_time_schedule_new': 'ui_biz_time_schedule_new',
|
|
33
|
+
'ui_biz_time_schedule_add_new': 'ui_biz_time_schedule_add_new',
|
|
33
34
|
'ui_biz_time_schedule_edit_new': 'ui_biz_time_schedule_edit_new',
|
|
34
35
|
'ui_biz_fixed_time_new': 'ui_biz_fixed_time_new',
|
|
35
36
|
'ui_biz_fixed_time_edit_new': 'ui_biz_fixed_time_edit_new',
|
|
@@ -359,7 +359,7 @@ function obj2Dp(obj: BiorhythmBean): string {
|
|
|
359
359
|
function vo2Dto(biorhythmBean: BiorhythmBean): RemoteBiorhythmBean {
|
|
360
360
|
return {
|
|
361
361
|
enable: biorhythmBean.enable,
|
|
362
|
-
repeatPeriod: biorhythmBean.weeks,
|
|
362
|
+
repeatPeriod: biorhythmBean.weeks.slice(0, 7),
|
|
363
363
|
gradientWay: BiorhythmGradientTypeMap[biorhythmBean.gradient],
|
|
364
364
|
rhythmPlan: biorhythmBean.planList.map(plan => {
|
|
365
365
|
const hour = Math.trunc(plan.time / 60).toString().padStart(2, '0')
|
|
@@ -75,7 +75,7 @@ const getDpResultByYear = async (devId: string, addEleDpCode: string, dateStr: s
|
|
|
75
75
|
key: `${monthFormat(month)} ${year}`,
|
|
76
76
|
value: (Number(curMonth[month]) || 0).toFixed(2),
|
|
77
77
|
headlineText: `${year}${month}`,
|
|
78
|
-
chartTitle: `${monthFormatShort(month)}
|
|
78
|
+
chartTitle: `${monthFormatShort(month)}`
|
|
79
79
|
}
|
|
80
80
|
})
|
|
81
81
|
}
|
|
@@ -99,7 +99,7 @@ const getDpResultByYearMonth = async (devId: string, addEleDpCode: string, dateS
|
|
|
99
99
|
|
|
100
100
|
// 格式化为 'YYYY/MM/DD' 格式
|
|
101
101
|
const formattedDate = `${year}/${month}/${day}`
|
|
102
|
-
const dateStr = `${day}
|
|
102
|
+
const dateStr = `${day}.${month}.${year}`
|
|
103
103
|
const dateObj = dayjs(formattedDate, 'YYYY/MM/DD')
|
|
104
104
|
const dayOfWeek = dateObj.day() % 7
|
|
105
105
|
const key = `${dateStr} (${loopsText[dayOfWeek]})`
|
|
@@ -107,7 +107,7 @@ const getDpResultByYearMonth = async (devId: string, addEleDpCode: string, dateS
|
|
|
107
107
|
key,
|
|
108
108
|
value: Number(dayList[time] || 0).toFixed(2),
|
|
109
109
|
headlineText: formattedDate,
|
|
110
|
-
chartTitle: `${Number(key?.split('
|
|
110
|
+
chartTitle: `${Number(key?.split('.')[0])} ${loopsText[dayOfWeek]}`
|
|
111
111
|
}
|
|
112
112
|
})
|
|
113
113
|
}
|
|
@@ -31,6 +31,7 @@ const { withTheme } = Utils.ThemeUtils
|
|
|
31
31
|
export interface EnergyConsumptionChartProps {
|
|
32
32
|
addEleDpCode: string
|
|
33
33
|
powerDpCode: string
|
|
34
|
+
backTitle: string
|
|
34
35
|
headlineText: string
|
|
35
36
|
chartData: OverviewItem[],
|
|
36
37
|
over365Days?: boolean
|
|
@@ -45,7 +46,7 @@ const EnergyConsumptionChart = (props: { theme?: ThemeType }) => {
|
|
|
45
46
|
const isFocused = useIsFocused()
|
|
46
47
|
|
|
47
48
|
const params = useRoute().params as EnergyConsumptionChartProps
|
|
48
|
-
const { price, unit, date, addEleDpCode, powerDpCode, over365Days, over7Days } = params
|
|
49
|
+
const { backTitle, price, unit, date, addEleDpCode, powerDpCode, over365Days, over7Days } = params
|
|
49
50
|
|
|
50
51
|
useInterval(() => {
|
|
51
52
|
if (isFocused) {
|
|
@@ -179,7 +180,7 @@ const EnergyConsumptionChart = (props: { theme?: ThemeType }) => {
|
|
|
179
180
|
state.headlineText = `${monthFormat(month)} ${year}`
|
|
180
181
|
break
|
|
181
182
|
case DateType.Day:
|
|
182
|
-
state.headlineText = `${day}
|
|
183
|
+
state.headlineText = `${day}.${month}.${year} (${loopsText[dayOfWeek]})`
|
|
183
184
|
break
|
|
184
185
|
}
|
|
185
186
|
}, [state.dateType, state.headlineText])
|
|
@@ -214,7 +215,7 @@ const EnergyConsumptionChart = (props: { theme?: ThemeType }) => {
|
|
|
214
215
|
|
|
215
216
|
return (
|
|
216
217
|
<Page
|
|
217
|
-
backText={
|
|
218
|
+
backText={backTitle}
|
|
218
219
|
showGreenery={false}
|
|
219
220
|
loading={state.loading}
|
|
220
221
|
greeneryIcon={res.energy_consumption_greenery}
|
|
@@ -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
|
powerDpCode: string
|
|
32
33
|
curMonth: OverviewItem
|
|
@@ -87,7 +88,7 @@ const EnergyConsumptionDetail = (props: {theme?: ThemeType}) => {
|
|
|
87
88
|
|
|
88
89
|
// 格式化为 'YYYY/MM/DD' 格式
|
|
89
90
|
const formattedDate = `${year}/${month}/${day}`
|
|
90
|
-
const dateStr = `${day}
|
|
91
|
+
const dateStr = `${day}.${month}.${year}`
|
|
91
92
|
const dateObj = dayjs(formattedDate, "YYYY/MM/DD");
|
|
92
93
|
const dayOfWeek = dateObj.day() % 7;
|
|
93
94
|
const key = `${dateStr} (${loopsText[dayOfWeek]})`
|
|
@@ -95,7 +96,7 @@ const EnergyConsumptionDetail = (props: {theme?: ThemeType}) => {
|
|
|
95
96
|
key,
|
|
96
97
|
value: Number(dayList[time] || 0).toFixed(2),
|
|
97
98
|
headlineText: formattedDate,
|
|
98
|
-
chartTitle: `${Number(key?.split('
|
|
99
|
+
chartTitle: `${Number(key?.split('.')[0])} ${loopsText[dayOfWeek]}`
|
|
99
100
|
}
|
|
100
101
|
})
|
|
101
102
|
|
|
@@ -104,7 +105,7 @@ const EnergyConsumptionDetail = (props: {theme?: ThemeType}) => {
|
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
const getHourList = async (item: OverviewItem) => {
|
|
107
|
-
const value = item?.key?.split(' ')[0]?.split('
|
|
108
|
+
const value = item?.key?.split(' ')[0]?.split('.')
|
|
108
109
|
const date = `${value[2]}${value[1]}${value[0]}`
|
|
109
110
|
state.over7Days = overDays(date, 7)
|
|
110
111
|
if (state.over7Days) {
|
|
@@ -189,7 +190,7 @@ const EnergyConsumptionDetail = (props: {theme?: ThemeType}) => {
|
|
|
189
190
|
|
|
190
191
|
return (
|
|
191
192
|
<Page
|
|
192
|
-
backText={
|
|
193
|
+
backText={params.backTitle}
|
|
193
194
|
headlineText={params.curMonth.key}
|
|
194
195
|
headlineIcon={state.overviewList.length ? res.download_icon : undefined}
|
|
195
196
|
onHeadlineIconClick={() => {
|
|
@@ -277,6 +278,7 @@ const EnergyConsumptionDetail = (props: {theme?: ThemeType}) => {
|
|
|
277
278
|
headlineText={I18n.getLang('consumption_data_monthly_overview_field2_headline_text')}
|
|
278
279
|
headlineClick={() => {
|
|
279
280
|
navigation.navigate(ui_biz_routerKey.ui_biz_energy_consumption_chart, {
|
|
281
|
+
backTitle: params.backTitle,
|
|
280
282
|
headlineText: params.curMonth.key,
|
|
281
283
|
chartData: state.overviewList,
|
|
282
284
|
over365Days: state.over365Days,
|
|
@@ -292,6 +294,7 @@ const EnergyConsumptionDetail = (props: {theme?: ThemeType}) => {
|
|
|
292
294
|
const res = await getHourList(item)
|
|
293
295
|
state.loading = false
|
|
294
296
|
navigation.navigate(ui_biz_routerKey.ui_biz_energy_consumption_chart, {
|
|
297
|
+
backTitle: params.backTitle,
|
|
295
298
|
headlineText: item.key,
|
|
296
299
|
chartData: res,
|
|
297
300
|
over7Days: state.over7Days,
|
|
@@ -188,7 +188,7 @@ const EnergyConsumptionPage = (props: {theme?: ThemeType}) => {
|
|
|
188
188
|
key: `${monthFormat(month)} ${year}`,
|
|
189
189
|
value: (Number(curMonth[month]) || 0).toFixed(2),
|
|
190
190
|
headlineText: `${year}${month}`,
|
|
191
|
-
chartTitle: `${monthFormatShort(month)}
|
|
191
|
+
chartTitle: `${monthFormatShort(month)}`
|
|
192
192
|
}
|
|
193
193
|
})
|
|
194
194
|
return monthData
|
|
@@ -222,6 +222,10 @@ const EnergyConsumptionPage = (props: {theme?: ThemeType}) => {
|
|
|
222
222
|
return titleMapping[value ? 0 : 1]
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
const backTitle = useMemo(() => {
|
|
226
|
+
return I18n.getLang(isGeneration ? 'sockets_headline_power' : 'consumption_data_annual_bar_chart_system_back_text')
|
|
227
|
+
}, [isGeneration])
|
|
228
|
+
|
|
225
229
|
const styles = StyleSheet.create({
|
|
226
230
|
showTip: {
|
|
227
231
|
marginHorizontal: cx(24)
|
|
@@ -318,8 +322,8 @@ const EnergyConsumptionPage = (props: {theme?: ThemeType}) => {
|
|
|
318
322
|
return (
|
|
319
323
|
<Page
|
|
320
324
|
style={{ position: 'relative' }}
|
|
321
|
-
backText={
|
|
322
|
-
headlineText={
|
|
325
|
+
backText={backTitle}
|
|
326
|
+
headlineText={backTitle}
|
|
323
327
|
headlineIcon={state.overviewList.length ? res.download_icon : undefined}
|
|
324
328
|
onHeadlineIconClick={() => {
|
|
325
329
|
const values = state.overviewList.map(item => [item.key, item.value, (Number(state.price) * Number(item.value)).toFixed(2)])
|
|
@@ -358,6 +362,7 @@ const EnergyConsumptionPage = (props: {theme?: ThemeType}) => {
|
|
|
358
362
|
return
|
|
359
363
|
}
|
|
360
364
|
navigation.navigate(ui_biz_routerKey.ui_biz_energy_consumption_chart, {
|
|
365
|
+
backTitle,
|
|
361
366
|
headlineText: chartHeadline,
|
|
362
367
|
chartData: state.overviewList,
|
|
363
368
|
price: state.price,
|
|
@@ -504,6 +509,7 @@ const EnergyConsumptionPage = (props: {theme?: ThemeType}) => {
|
|
|
504
509
|
headlineText={I18n.getLang('consumption_data_field4_headline_text')}
|
|
505
510
|
headlineClick={() => {
|
|
506
511
|
navigation.navigate(ui_biz_routerKey.ui_biz_energy_consumption_chart, {
|
|
512
|
+
backTitle,
|
|
507
513
|
headlineText: chartHeadline,
|
|
508
514
|
chartData: state.overviewList,
|
|
509
515
|
price: state.price,
|
|
@@ -515,6 +521,7 @@ const EnergyConsumptionPage = (props: {theme?: ThemeType}) => {
|
|
|
515
521
|
}}
|
|
516
522
|
overviewItemClick={(item) => {
|
|
517
523
|
navigation.navigate(ui_biz_routerKey.ui_biz_energy_consumption_detail, {
|
|
524
|
+
backTitle,
|
|
518
525
|
addEleDpCode: params.addEleDpCode,
|
|
519
526
|
powerDpCode: params.powerDpCode,
|
|
520
527
|
curMonth: item,
|
|
@@ -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]);
|
|
@@ -1,7 +1,8 @@
|
|
|
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 NewTimeScheduleAddPage from './TimeScheduleAddPage'
|
|
4
|
+
import NewTimeScheduleEditPage from './TimeScheduleDetailPage'
|
|
5
|
+
import NewTimeSchedulePage from './TimeSchedulePage'
|
|
5
6
|
|
|
6
7
|
const NewTimeSchedulePageRouters: NavigationRoute[] = [
|
|
7
8
|
{
|
|
@@ -12,6 +13,14 @@ const NewTimeSchedulePageRouters: NavigationRoute[] = [
|
|
|
12
13
|
showOfflineView: false,
|
|
13
14
|
},
|
|
14
15
|
},
|
|
16
|
+
{
|
|
17
|
+
name: ui_biz_routerKey.ui_biz_time_schedule_add_new,
|
|
18
|
+
component: NewTimeScheduleAddPage,
|
|
19
|
+
options: {
|
|
20
|
+
hideTopbar: true,
|
|
21
|
+
showOfflineView: false,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
15
24
|
{
|
|
16
25
|
name: ui_biz_routerKey.ui_biz_time_schedule_edit_new,
|
|
17
26
|
component: NewTimeScheduleEditPage,
|
|
@@ -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.ui_biz_time_schedule_edit_new, {
|
|
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)
|
|
@@ -1,52 +1,54 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import Page from '@ledvance/base/src/components/Page'
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
1
|
+
import DeleteButton from '@ledvance/base/src/components/DeleteButton'
|
|
2
|
+
import DiySceneItem from '@ledvance/base/src/components/DiySceneItem'
|
|
3
|
+
import InfoText from '@ledvance/base/src/components/InfoText'
|
|
4
|
+
import Page from '@ledvance/base/src/components/Page'
|
|
5
|
+
import SegmentControl from '@ledvance/base/src/components/segmentControl'
|
|
6
|
+
import Spacer from '@ledvance/base/src/components/Spacer'
|
|
7
|
+
import Summary from '@ledvance/base/src/components/Summary'
|
|
8
|
+
import Tag from '@ledvance/base/src/components/Tag'
|
|
9
|
+
import TextField from '@ledvance/base/src/components/TextField'
|
|
10
|
+
import LdvWeekView from '@ledvance/base/src/components/weekSelect'
|
|
11
|
+
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
12
|
+
import { useParams } from '@ledvance/base/src/hooks/Hooks'
|
|
13
|
+
import I18n from '@ledvance/base/src/i18n'
|
|
14
|
+
import { useDeviceId, useMoods, useSystemTimeFormate, } from '@ledvance/base/src/models/modules/NativePropsSlice'
|
|
15
|
+
import { Result } from '@ledvance/base/src/models/modules/Result'
|
|
16
|
+
import res from '@ledvance/base/src/res'
|
|
17
|
+
import { convertTo12HourFormat, loopText, showDialog } from '@ledvance/base/src/utils/common'
|
|
18
|
+
import { ApplyForItem, DiySceneInfo } from '@ledvance/base/src/utils/interface'
|
|
19
|
+
import { ui_biz_routerKey } from '../../navigation/Routers'
|
|
20
|
+
import { useNavigation } from '@react-navigation/core'
|
|
21
|
+
import { useReactive } from 'ahooks'
|
|
22
|
+
import { cloneDeep, isEqual } from 'lodash'
|
|
23
|
+
import React, { useCallback, useEffect, useMemo } from 'react'
|
|
24
|
+
import { FlatList, Image, ScrollView, StyleSheet, Text, TouchableOpacity, View, } from 'react-native'
|
|
25
|
+
import { SwitchButton, TimerPicker, Utils } from 'tuya-panel-kit'
|
|
26
|
+
import { MoodInfo, MoodUIInfo } from '../mood/Interface'
|
|
27
|
+
import { getRemoteMoodList } from '../mood/MoodActions'
|
|
28
|
+
import MoodItem from '../mood/MoodItem'
|
|
29
|
+
import ManualSettings from './components/ManuaSettings'
|
|
30
|
+
import { ComponentConfig, DeviceType, Timer, TimerActions, TimeScheduleDetailState, } from './Interface'
|
|
23
31
|
import {
|
|
24
32
|
defDeviceData,
|
|
25
33
|
defFanLightDeviceData,
|
|
26
34
|
defMixDeviceData,
|
|
27
35
|
defMoodStripDeviceData,
|
|
28
|
-
|
|
36
|
+
defOsramFanLightDeviceData,
|
|
29
37
|
defShutterDeviceData,
|
|
30
|
-
|
|
31
|
-
} from './TimeScheduleActions'
|
|
32
|
-
import
|
|
33
|
-
import {getRemoteMoodList} from '../mood/MoodActions';
|
|
34
|
-
import {MoodInfo, MoodUIInfo} from '../mood/Interface';
|
|
35
|
-
import Summary from '@ledvance/base/src/components/Summary'
|
|
36
|
-
import ThemeType from '@ledvance/base/src/config/themeType'
|
|
37
|
-
import Tag from "@ledvance/base/src/components/Tag";
|
|
38
|
-
import DiySceneItem from '@ledvance/base/src/components/DiySceneItem';
|
|
39
|
-
import {ApplyForItem, DiySceneInfo} from "@ledvance/base/src/utils/interface";
|
|
38
|
+
defStripDeviceData
|
|
39
|
+
} from './TimeScheduleActions'
|
|
40
|
+
import { TimeSchedulePageParams } from './TimeSchedulePage'
|
|
40
41
|
|
|
41
42
|
const { convertX: cx } = Utils.RatioUtils;
|
|
42
43
|
const { toFixedString } = Utils.NumberUtils;
|
|
43
44
|
const { withTheme } = Utils.ThemeUtils
|
|
44
45
|
|
|
45
|
-
interface TimeScheduleDetailPageParams extends TimeSchedulePageParams {
|
|
46
|
+
export interface TimeScheduleDetailPageParams extends TimeSchedulePageParams {
|
|
46
47
|
mode: 'add' | 'update';
|
|
47
48
|
timeSchedule: Timer;
|
|
48
49
|
modDeleteTimeSchedule: (mode: TimerActions, timeSchedule: Timer) => Promise<Result<any>>;
|
|
49
50
|
refreshFn: () => void;
|
|
51
|
+
suggestValue?: boolean
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
const TimeScheduleDetailPage = (props: { theme?: ThemeType }) => {
|
|
@@ -81,7 +83,7 @@ const TimeScheduleDetailPage = (props: { theme?: ThemeType }) => {
|
|
|
81
83
|
|
|
82
84
|
useEffect(() => {
|
|
83
85
|
const { applyForDisabled, timeSchedule, applyForList, mode } = params;
|
|
84
|
-
const cannotChoose = applyForDisabled || applyForList.length === 1;
|
|
86
|
+
const cannotChoose = applyForDisabled || applyForList.length === 1 || params.suggestValue !== undefined;
|
|
85
87
|
const cloneApplyList =
|
|
86
88
|
mode === 'add'
|
|
87
89
|
? cloneDeep(applyForList)
|
|
@@ -123,6 +125,12 @@ const TimeScheduleDetailPage = (props: { theme?: ThemeType }) => {
|
|
|
123
125
|
state.mood = mood;
|
|
124
126
|
}
|
|
125
127
|
|
|
128
|
+
if (params.suggestValue !== undefined) {
|
|
129
|
+
state.selectedSkill.forEach(it => {
|
|
130
|
+
it.enable = !!params.suggestValue
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
|
|
126
134
|
state.initSelectedSkill = cloneDeep(state.selectedSkill)
|
|
127
135
|
|
|
128
136
|
if (!(Array.isArray(moods) && moods.length)) {
|
|
@@ -360,7 +368,7 @@ const TimeScheduleDetailPage = (props: { theme?: ThemeType }) => {
|
|
|
360
368
|
});
|
|
361
369
|
state.loading = false;
|
|
362
370
|
if (res.success) {
|
|
363
|
-
navigation.
|
|
371
|
+
navigation.navigate(ui_biz_routerKey.ui_biz_time_schedule_new)
|
|
364
372
|
}
|
|
365
373
|
}}
|
|
366
374
|
backDialogTitle={I18n.getLang('cancel_dialog_leave_unsaved_titel')}
|
|
@@ -118,7 +118,7 @@ const TimeSchedulePage = (props: { theme?: ThemeType }) => {
|
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
const navigateToEdit = useCallback((mode: 'add' | 'update', timeSchedule?: Timer) => {
|
|
121
|
-
const path = ui_biz_routerKey.ui_biz_time_schedule_edit_new;
|
|
121
|
+
const path = mode === 'add' ? ui_biz_routerKey.ui_biz_time_schedule_add_new : ui_biz_routerKey.ui_biz_time_schedule_edit_new;
|
|
122
122
|
navigation.navigate(path, {
|
|
123
123
|
mode,
|
|
124
124
|
name: path,
|