@ledvance/ui-biz-bundle 1.1.59 → 1.1.62
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/biorhythm/BiorhythmPage.tsx +2 -0
- package/src/modules/flags/FlagActions.ts +1 -0
- package/src/modules/flags/FlagEditPage.tsx +22 -14
- package/src/modules/flags/FlagPage.tsx +9 -19
- package/src/modules/mood/DynamicMoodEditorPage.tsx +12 -14
- package/src/modules/mood/FantasyMoodEditPage.tsx +12 -14
- package/src/modules/mood/StaticMoodEditorPage.tsx +12 -13
- package/src/modules/timer/TimerPage.tsx +58 -56
- package/src/newModules/biorhythm/BiorhythmActions.ts +374 -0
- package/src/newModules/biorhythm/BiorhythmBean.ts +230 -0
- package/src/newModules/biorhythm/BiorhythmEditPage.tsx +267 -0
- package/src/newModules/biorhythm/BiorhythmPage.tsx +638 -0
- package/src/newModules/biorhythm/IconSelect.tsx +85 -0
- package/src/newModules/biorhythm/Router.ts +34 -0
- package/src/newModules/biorhythm/circular/ItemIcon.d.ts +22 -0
- package/src/newModules/biorhythm/circular/ItemIcon.tsx +173 -0
- package/src/newModules/biorhythm/circular/Progress.d.ts +24 -0
- package/src/newModules/biorhythm/circular/Progress.tsx +372 -0
- package/src/newModules/biorhythm/circular/TimeCircular.d.ts +11 -0
- package/src/newModules/biorhythm/circular/TimeCircular.tsx +64 -0
- package/src/newModules/biorhythm/circular/biorhythm_plantimer.png +0 -0
- package/src/newModules/biorhythm/circular/rhythm_icon.png +0 -0
- package/src/newModules/biorhythm/iconListData.ts +30 -0
- package/src/newModules/biorhythm/pIdList.ts +36 -0
- package/src/newModules/biorhythm/res/BiologicalRes.d.ts +43 -0
- package/src/newModules/biorhythm/res/BiologicalRes.ts +42 -0
- package/src/newModules/biorhythm/res/Biological_Rhythm.png +0 -0
- package/src/newModules/biorhythm/res/Biological_Rhythm_12.png +0 -0
- package/src/newModules/biorhythm/res/Biological_Rhythm_new.png +0 -0
- package/src/newModules/biorhythm/res/Biological_Rhythm_new_12.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedAccountGroups@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavAdd@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedArrowsNavArrowForwardIos@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedBuildingsHome@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedEditorFavoriteBorder@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBed@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherBusinessCenter@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherChair@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherCoffee@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherDirectionsCar@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherFitnessCenter@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherHeadphones@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMenuBook@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherMusicNote@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherNotificationsNone@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherPottedPlant@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherRestaurant@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSentimentSatisfied@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherSportsEsports@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedOtherTv@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedTimeAccessAlarm@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherBedtime@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherPartlyCloudyDay@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherStarOutline@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbSunny@3x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@2x.png +0 -0
- package/src/newModules/biorhythm/res/iconsMaterialOutlinedWheatherWbTwilight@3x.png +0 -0
- package/src/newModules/energyConsumption/EnergyConsumptionDetail.tsx +84 -83
- package/src/newModules/energyConsumption/EnergyConsumptionPage.tsx +133 -132
- package/src/newModules/energyConsumption/component/EnergyModal.tsx +119 -117
- package/src/newModules/energyConsumption/component/Overview.tsx +38 -36
- package/src/newModules/mood/AddMoodPage.tsx +37 -21
- package/src/newModules/mood/DynamicMoodEditorPage.tsx +7 -2
- package/src/newModules/mood/MixDynamicMoodEditor.tsx +8 -2
- package/src/newModules/mood/StaticMoodEditorPage.tsx +9 -2
- package/src/newModules/timeSchedule/Interface.ts +1 -0
- package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +203 -202
- package/src/newModules/timeSchedule/TimeSchedulePage.tsx +35 -34
- package/src/newModules/timeSchedule/components/ManuaSettings.tsx +11 -10
- package/src/newModules/timeSchedule/components/ScheduleCard.tsx +63 -60
|
@@ -37,16 +37,16 @@ import { Result } from '@ledvance/base/src/models/modules/Result';
|
|
|
37
37
|
import DeleteButton from '@ledvance/base/src/components/DeleteButton';
|
|
38
38
|
import InfoText from '@ledvance/base/src/components/InfoText';
|
|
39
39
|
import SegmentControl from '@ledvance/base/src/components/segmentControl';
|
|
40
|
-
// import { SceneMode } from "../mood/SceneInfo";
|
|
41
40
|
import { useParams } from '@ledvance/base/src/hooks/Hooks';
|
|
42
41
|
import ManualSettings from './components/ManuaSettings';
|
|
43
42
|
import { defDeviceData, defMixDeviceData, defStripDeviceData } from './TimeScheduleActions';
|
|
44
43
|
import MoodItem from '../mood/MoodItem';
|
|
45
44
|
import { getRemoteMoodList } from '../mood/MoodActions';
|
|
46
|
-
// import LoadingView from "@ledvance/base/src/components/LoadingView";
|
|
47
45
|
|
|
48
46
|
const { convertX: cx } = Utils.RatioUtils;
|
|
49
47
|
const { toFixedString } = Utils.NumberUtils;
|
|
48
|
+
const { withTheme } = Utils.ThemeUtils
|
|
49
|
+
|
|
50
50
|
interface TimeScheduleDetailPageParams extends TimeSchedulePageParams {
|
|
51
51
|
mode: 'add' | 'update';
|
|
52
52
|
timeSchedule: Timer;
|
|
@@ -54,15 +54,15 @@ interface TimeScheduleDetailPageParams extends TimeSchedulePageParams {
|
|
|
54
54
|
refreshFn: () => void;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
const TimeScheduleDetailPage = () => {
|
|
57
|
+
const TimeScheduleDetailPage = (props: {theme?: any}) => {
|
|
58
58
|
const is24HourClock = useSystemTimeFormate();
|
|
59
|
-
const
|
|
59
|
+
const params = useParams<TimeScheduleDetailPageParams>();
|
|
60
60
|
const navigation = useNavigation();
|
|
61
61
|
const devId = useDeviceId();
|
|
62
62
|
const [moods, setMoods] = useMoods();
|
|
63
63
|
const state = useReactive<TimeScheduleDetailState>({
|
|
64
|
-
timeSchedule:
|
|
65
|
-
dps:
|
|
64
|
+
timeSchedule: params.mode === 'add' ? newTimeSchedule() : cloneDeep(params.timeSchedule),
|
|
65
|
+
dps: params.mode === 'add' ? {} : params.timeSchedule.dps,
|
|
66
66
|
isManual: true, // manual ,mood
|
|
67
67
|
initSelectedSkill: [] as ApplyForItem[],
|
|
68
68
|
selectedSkill: [] as ApplyForItem[],
|
|
@@ -70,9 +70,9 @@ const TimeScheduleDetailPage = () => {
|
|
|
70
70
|
loading: false,
|
|
71
71
|
moodLoading: false,
|
|
72
72
|
manualData:
|
|
73
|
-
|
|
74
|
-
? getDefaultManual(
|
|
75
|
-
:
|
|
73
|
+
params.mode === 'add'
|
|
74
|
+
? getDefaultManual(params)
|
|
75
|
+
: params.manualDataDp2Obj(params.timeSchedule.dps).deviceData,
|
|
76
76
|
mood: undefined,
|
|
77
77
|
moods: cloneDeep(moods),
|
|
78
78
|
timerId: undefined,
|
|
@@ -80,29 +80,29 @@ const TimeScheduleDetailPage = () => {
|
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
useEffect(() => {
|
|
83
|
-
const { applyForDisabled, timeSchedule, applyForList, mode } =
|
|
83
|
+
const { applyForDisabled, timeSchedule, applyForList, mode } = params;
|
|
84
84
|
const cannotChoose = applyForDisabled || applyForList.length === 1;
|
|
85
85
|
const cloneApplyList =
|
|
86
86
|
mode === 'add'
|
|
87
87
|
? cloneDeep(applyForList)
|
|
88
88
|
: cloneDeep(applyForList).map(item => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
89
|
+
if (params.isMixLight && state.manualData.type === DeviceType.MixLight) {
|
|
90
|
+
return {
|
|
91
|
+
...item,
|
|
92
|
+
enable:
|
|
93
|
+
item.type === 'mainLight'
|
|
94
|
+
? state.manualData.deviceData.whiteLightSwitch
|
|
95
|
+
: state.manualData.deviceData.colorLightSwitch,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
if (timeSchedule?.dps?.hasOwnProperty(item.dp)) {
|
|
99
|
+
return {
|
|
100
|
+
...item,
|
|
101
|
+
enable: timeSchedule?.dps[item.dp],
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return item;
|
|
105
|
+
});
|
|
106
106
|
|
|
107
107
|
if (cannotChoose) {
|
|
108
108
|
state.selectedSkill = cloneApplyList;
|
|
@@ -117,8 +117,8 @@ const TimeScheduleDetailPage = () => {
|
|
|
117
117
|
state.selectedSkill = mode === 'add' ? [] : selectedList;
|
|
118
118
|
state.unSelectedSkill = mode === 'add' ? cloneApplyList : unSelectedList;
|
|
119
119
|
}
|
|
120
|
-
if (
|
|
121
|
-
const { isManual, mood } =
|
|
120
|
+
if (params.mode === 'update' && params.manualDataDp2Obj) {
|
|
121
|
+
const { isManual, mood } = params.manualDataDp2Obj(params.timeSchedule.dps);
|
|
122
122
|
state.isManual = isManual;
|
|
123
123
|
state.mood = mood;
|
|
124
124
|
}
|
|
@@ -127,7 +127,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
127
127
|
|
|
128
128
|
if (!(Array.isArray(moods) && moods.length)) {
|
|
129
129
|
state.timerId = setTimeout(() => {
|
|
130
|
-
getRemoteMoodList(devId,
|
|
130
|
+
getRemoteMoodList(devId, params, params.featureId).then(res => {
|
|
131
131
|
if (res.success && Array.isArray(res.data)) {
|
|
132
132
|
state.moods = cloneDeep(res.data);
|
|
133
133
|
setMoods(cloneDeep(res.data));
|
|
@@ -147,9 +147,9 @@ const TimeScheduleDetailPage = () => {
|
|
|
147
147
|
if (state.moods?.length) {
|
|
148
148
|
state.moodName =
|
|
149
149
|
state.moods.find(m =>
|
|
150
|
-
|
|
150
|
+
params.isCeilingLight
|
|
151
151
|
? m.mainLamp.id === state.mood?.mainLamp.id &&
|
|
152
|
-
|
|
152
|
+
m.secondaryLamp.id === state.mood?.secondaryLamp.id
|
|
153
153
|
: m.id === state.mood?.id
|
|
154
154
|
)?.name || '';
|
|
155
155
|
}
|
|
@@ -167,18 +167,18 @@ const TimeScheduleDetailPage = () => {
|
|
|
167
167
|
}, []);
|
|
168
168
|
|
|
169
169
|
const isModify = useMemo(() => {
|
|
170
|
-
if (
|
|
170
|
+
if (params.mode === 'add') {
|
|
171
171
|
return true
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
const schedule =
|
|
175
|
-
const manual =
|
|
174
|
+
const schedule = params.timeSchedule;
|
|
175
|
+
const manual = params.manualDataDp2Obj(params.timeSchedule?.dps).deviceData;
|
|
176
176
|
const before = {
|
|
177
177
|
...schedule,
|
|
178
178
|
selectedSkill: state.initSelectedSkill,
|
|
179
179
|
dps: manual,
|
|
180
|
-
isManual:
|
|
181
|
-
mood:
|
|
180
|
+
isManual: params.manualDataDp2Obj(params.timeSchedule.dps).isManual,
|
|
181
|
+
mood: params.manualDataDp2Obj(params.timeSchedule?.dps).mood,
|
|
182
182
|
id: 1,
|
|
183
183
|
};
|
|
184
184
|
|
|
@@ -203,14 +203,87 @@ const TimeScheduleDetailPage = () => {
|
|
|
203
203
|
}, [state.timeSchedule.name, state.selectedSkill, isModify, state.isManual, state.mood]);
|
|
204
204
|
|
|
205
205
|
const showSelectedIcon = useMemo(() => {
|
|
206
|
-
return state.selectedSkill.length !== 1 && !
|
|
207
|
-
}, [state.selectedSkill.length,
|
|
206
|
+
return state.selectedSkill.length !== 1 && !params.applyForDisabled;
|
|
207
|
+
}, [state.selectedSkill.length, params.applyForDisabled]);
|
|
208
|
+
|
|
209
|
+
const styles = StyleSheet.create({
|
|
210
|
+
cardContainer: {
|
|
211
|
+
marginHorizontal: cx(24),
|
|
212
|
+
},
|
|
213
|
+
itemTitle: {
|
|
214
|
+
color: props.theme.global.fontColor,
|
|
215
|
+
fontSize: cx(16),
|
|
216
|
+
fontWeight: 'bold',
|
|
217
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
218
|
+
},
|
|
219
|
+
applyContent: {
|
|
220
|
+
backgroundColor: props.theme.card.background,
|
|
221
|
+
borderRadius: 4,
|
|
222
|
+
minHeight: cx(55),
|
|
223
|
+
flex: 1,
|
|
224
|
+
justifyContent: 'center',
|
|
225
|
+
paddingHorizontal: cx(10),
|
|
226
|
+
paddingTop: cx(10),
|
|
227
|
+
},
|
|
228
|
+
applyItem: {
|
|
229
|
+
paddingLeft: cx(5),
|
|
230
|
+
flexDirection: 'row',
|
|
231
|
+
justifyContent: 'space-between',
|
|
232
|
+
alignItems: 'center',
|
|
233
|
+
backgroundColor: props.theme.global.background,
|
|
234
|
+
height: cx(35),
|
|
235
|
+
},
|
|
236
|
+
moodScrollView: {
|
|
237
|
+
maxHeight: cx(500),
|
|
238
|
+
},
|
|
239
|
+
summaryContainer: {
|
|
240
|
+
flexDirection: 'row',
|
|
241
|
+
justifyContent: 'flex-start',
|
|
242
|
+
marginBottom: cx(10),
|
|
243
|
+
marginHorizontal: cx(24),
|
|
244
|
+
},
|
|
245
|
+
summaryImg: {
|
|
246
|
+
height: cx(12),
|
|
247
|
+
width: cx(12),
|
|
248
|
+
tintColor: props.theme.global.fontColor,
|
|
249
|
+
},
|
|
250
|
+
summaryLeft: {
|
|
251
|
+
flexDirection: 'row',
|
|
252
|
+
alignItems: 'center',
|
|
253
|
+
minWidth: cx(90),
|
|
254
|
+
},
|
|
255
|
+
leftTitle: {
|
|
256
|
+
fontSize: cx(14),
|
|
257
|
+
color: props.theme.global.fontColor,
|
|
258
|
+
marginTop: 0,
|
|
259
|
+
},
|
|
260
|
+
summaryRight: {
|
|
261
|
+
flexDirection: 'column',
|
|
262
|
+
marginLeft: cx(21),
|
|
263
|
+
backgroundColor: props.theme.card.background,
|
|
264
|
+
borderRadius: cx(16),
|
|
265
|
+
alignItems: 'center'
|
|
266
|
+
},
|
|
267
|
+
rightItem: {
|
|
268
|
+
paddingHorizontal: cx(12),
|
|
269
|
+
color: props.theme.global.fontColor,
|
|
270
|
+
},
|
|
271
|
+
switchButton: {
|
|
272
|
+
flexDirection: 'row',
|
|
273
|
+
alignItems: 'center',
|
|
274
|
+
justifyContent: 'space-between',
|
|
275
|
+
marginBottom: cx(10),
|
|
276
|
+
},
|
|
277
|
+
text: {
|
|
278
|
+
color: props.theme.global.fontColor,
|
|
279
|
+
},
|
|
280
|
+
});
|
|
208
281
|
|
|
209
282
|
return (
|
|
210
283
|
<Page
|
|
211
284
|
backText={I18n.getLang('motion_detection_add_time_schedule_system_back_text')}
|
|
212
285
|
headlineText={I18n.getLang(
|
|
213
|
-
|
|
286
|
+
params.mode === 'add'
|
|
214
287
|
? 'motion_detection_add_time_schedule_headline_text'
|
|
215
288
|
: 'edit_timeschedule_headline_text'
|
|
216
289
|
)}
|
|
@@ -218,10 +291,10 @@ const TimeScheduleDetailPage = () => {
|
|
|
218
291
|
rightButtonIconClick={async () => {
|
|
219
292
|
if (!allowSubmit || state.loading) return;
|
|
220
293
|
state.loading = true;
|
|
221
|
-
const res = await
|
|
294
|
+
const res = await params.modDeleteTimeSchedule(params.mode, {
|
|
222
295
|
...state.timeSchedule,
|
|
223
296
|
enable: true,
|
|
224
|
-
dps:
|
|
297
|
+
dps: params.manualDataObj2Dp(
|
|
225
298
|
{
|
|
226
299
|
deviceData: state.manualData,
|
|
227
300
|
isManual: state.isManual,
|
|
@@ -257,7 +330,8 @@ const TimeScheduleDetailPage = () => {
|
|
|
257
330
|
{/* pick */}
|
|
258
331
|
<TimerPicker
|
|
259
332
|
itemTextColor="#aeadb5"
|
|
260
|
-
style={{ paddingVertical: cx(0), marginVertical: cx(0) }}
|
|
333
|
+
style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
|
|
334
|
+
pickerFontColor={props.theme.global.fontColor}
|
|
261
335
|
is12Hours={!is24HourClock}
|
|
262
336
|
singlePicker={true}
|
|
263
337
|
amText={I18n.getLang('manage_user_calendar_label_am')}
|
|
@@ -280,7 +354,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
280
354
|
}}
|
|
281
355
|
/>
|
|
282
356
|
<Spacer />
|
|
283
|
-
<Text style={styles.cardContainer}>{loopText(state.timeSchedule.loops.split(''))}</Text>
|
|
357
|
+
<Text style={{...styles.cardContainer, color: props.theme.global.fontColor}}>{loopText(state.timeSchedule.loops.split(''))}</Text>
|
|
284
358
|
<Spacer height={cx(30)} />
|
|
285
359
|
|
|
286
360
|
{/* Apply for */}
|
|
@@ -290,7 +364,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
290
364
|
</Text>
|
|
291
365
|
<Spacer height={cx(10)} />
|
|
292
366
|
<View style={styles.applyContent}>
|
|
293
|
-
{
|
|
367
|
+
{params.applyForList.length === 0 ? (
|
|
294
368
|
<Text>{I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}</Text>
|
|
295
369
|
) : (
|
|
296
370
|
state.selectedSkill.map(skill => (
|
|
@@ -298,7 +372,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
298
372
|
style={[styles.applyItem, { marginBottom: cx(10), borderRadius: 4 }]}
|
|
299
373
|
key={skill.dp}
|
|
300
374
|
>
|
|
301
|
-
<Text style={{ color:
|
|
375
|
+
<Text style={{ color: props.theme.global.fontColor }}>{skill.key}</Text>
|
|
302
376
|
{showSelectedIcon && (
|
|
303
377
|
<TouchableOpacity
|
|
304
378
|
onPress={() => {
|
|
@@ -327,7 +401,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
327
401
|
state.unSelectedSkill = state.unSelectedSkill.filter(s => item.dp !== s.dp);
|
|
328
402
|
}}
|
|
329
403
|
>
|
|
330
|
-
<Text style={{ color:
|
|
404
|
+
<Text style={{ color: props.theme.global.fontColor }}>{item.key}</Text>
|
|
331
405
|
<Image
|
|
332
406
|
style={{ width: cx(16), height: cx(16) }}
|
|
333
407
|
source={res.device_panel_timer_add}
|
|
@@ -343,7 +417,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
343
417
|
{I18n.getLang('timeschedule_add_schedule_subheadline2_text')}
|
|
344
418
|
</Text>
|
|
345
419
|
<Spacer height={cx(10)} />
|
|
346
|
-
{
|
|
420
|
+
{params.isSupportMood && (
|
|
347
421
|
<>
|
|
348
422
|
<SegmentControl
|
|
349
423
|
title1={I18n.getLang('timeschedule_add_schedule_switch_tab_manual_text')}
|
|
@@ -359,10 +433,10 @@ const TimeScheduleDetailPage = () => {
|
|
|
359
433
|
<ManualSettings
|
|
360
434
|
dps={state.dps}
|
|
361
435
|
applyForList={state.selectedSkill}
|
|
362
|
-
isSupportColor={
|
|
363
|
-
isSupportBrightness={
|
|
364
|
-
isSupportTemperature={
|
|
365
|
-
isStripLight={
|
|
436
|
+
isSupportColor={params.isSupportColor}
|
|
437
|
+
isSupportBrightness={params.isSupportBrightness}
|
|
438
|
+
isSupportTemperature={params.isSupportTemperature}
|
|
439
|
+
isStripLight={params.isStripLight}
|
|
366
440
|
manualData={state.manualData}
|
|
367
441
|
onManualChange={manual => {
|
|
368
442
|
// @ts-ignore
|
|
@@ -377,24 +451,24 @@ const TimeScheduleDetailPage = () => {
|
|
|
377
451
|
/>
|
|
378
452
|
) : (
|
|
379
453
|
<FlatList
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
454
|
+
data={state.moods}
|
|
455
|
+
renderItem={({ item }) => {
|
|
456
|
+
return (
|
|
457
|
+
<MoodItem
|
|
458
|
+
enable={state.mood?.id === item.id}
|
|
459
|
+
mood={item}
|
|
460
|
+
isMix={!!(params.isMixLight || params.isCeilingLight)}
|
|
461
|
+
onSwitch={_ => {
|
|
462
|
+
state.mood = item;
|
|
463
|
+
}}
|
|
464
|
+
/>
|
|
465
|
+
);
|
|
466
|
+
}}
|
|
467
|
+
ListHeaderComponent={() => <Spacer height={cx(10)} />}
|
|
468
|
+
ItemSeparatorComponent={() => <Spacer />}
|
|
469
|
+
ListFooterComponent={() => <Spacer />}
|
|
470
|
+
keyExtractor={item => `${item.name}`}
|
|
471
|
+
/>
|
|
398
472
|
// <ScrollView style={styles.moodScrollView} nestedScrollEnabled={true}>
|
|
399
473
|
|
|
400
474
|
// </ScrollView>
|
|
@@ -462,67 +536,67 @@ const TimeScheduleDetailPage = () => {
|
|
|
462
536
|
<View style={{ marginLeft: cx(16), flex: 1 }}>
|
|
463
537
|
{state.isManual
|
|
464
538
|
? !!state.selectedSkill.length && (
|
|
539
|
+
<>
|
|
540
|
+
{!!state.selectedSkill.filter(skill => skill.enable).length && (
|
|
465
541
|
<>
|
|
466
|
-
{
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
))}
|
|
485
|
-
</View>
|
|
486
|
-
</>
|
|
487
|
-
)}
|
|
488
|
-
|
|
489
|
-
{!!state.selectedSkill.filter(skill => !skill.enable).length && (
|
|
490
|
-
<>
|
|
491
|
-
<Text style={{ marginLeft: cx(5) }}>
|
|
492
|
-
{I18n.getLang('feature_summary_action_txt_2')}
|
|
493
|
-
</Text>
|
|
494
|
-
<View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
|
|
495
|
-
{state.selectedSkill
|
|
496
|
-
.filter(skill => !skill.enable)
|
|
497
|
-
.map(item => (
|
|
498
|
-
<View
|
|
499
|
-
style={[
|
|
500
|
-
styles.summaryRight,
|
|
501
|
-
{ marginLeft: cx(5), marginBottom: cx(5) },
|
|
502
|
-
]}
|
|
503
|
-
key={item.dp}
|
|
504
|
-
>
|
|
505
|
-
<Text style={[styles.rightItem]}>{item.key}</Text>
|
|
506
|
-
</View>
|
|
507
|
-
))}
|
|
508
|
-
</View>
|
|
509
|
-
</>
|
|
510
|
-
)}
|
|
542
|
+
<Text style={{ marginLeft: cx(5), color: props.theme.global.fontColor }}>
|
|
543
|
+
{I18n.getLang('feature_summary_action_txt_1')}
|
|
544
|
+
</Text>
|
|
545
|
+
<View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
|
|
546
|
+
{state.selectedSkill
|
|
547
|
+
.filter(skill => skill.enable)
|
|
548
|
+
.map(item => (
|
|
549
|
+
<View
|
|
550
|
+
style={[
|
|
551
|
+
styles.summaryRight,
|
|
552
|
+
{ marginLeft: cx(5), marginBottom: cx(5) },
|
|
553
|
+
]}
|
|
554
|
+
key={item.dp}
|
|
555
|
+
>
|
|
556
|
+
<Text style={[styles.rightItem]}>{item.key}</Text>
|
|
557
|
+
</View>
|
|
558
|
+
))}
|
|
559
|
+
</View>
|
|
511
560
|
</>
|
|
512
|
-
)
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
561
|
+
)}
|
|
562
|
+
|
|
563
|
+
{!!state.selectedSkill.filter(skill => !skill.enable).length && (
|
|
564
|
+
<>
|
|
565
|
+
<Text style={{ marginLeft: cx(5), color: props.theme.global.fontColor }}>
|
|
566
|
+
{I18n.getLang('feature_summary_action_txt_2')}
|
|
567
|
+
</Text>
|
|
568
|
+
<View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
|
|
569
|
+
{state.selectedSkill
|
|
570
|
+
.filter(skill => !skill.enable)
|
|
571
|
+
.map(item => (
|
|
572
|
+
<View
|
|
573
|
+
style={[
|
|
574
|
+
styles.summaryRight,
|
|
575
|
+
{ marginLeft: cx(5), marginBottom: cx(5) },
|
|
576
|
+
]}
|
|
577
|
+
key={item.dp}
|
|
578
|
+
>
|
|
579
|
+
<Text style={[styles.rightItem]}>{item.key}</Text>
|
|
580
|
+
</View>
|
|
581
|
+
))}
|
|
517
582
|
</View>
|
|
518
|
-
|
|
583
|
+
</>
|
|
519
584
|
)}
|
|
585
|
+
</>
|
|
586
|
+
)
|
|
587
|
+
: !!state.moodName && (
|
|
588
|
+
<View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
|
|
589
|
+
<View style={[styles.summaryRight, { marginLeft: cx(5) }]}>
|
|
590
|
+
<Text style={styles.rightItem}>{state.moodName}</Text>
|
|
591
|
+
</View>
|
|
592
|
+
</View>
|
|
593
|
+
)}
|
|
520
594
|
</View>
|
|
521
595
|
</View>
|
|
522
596
|
<Spacer height={cx(30)} />
|
|
523
597
|
|
|
524
598
|
{/* delete */}
|
|
525
|
-
{
|
|
599
|
+
{params.mode === 'update' && (
|
|
526
600
|
<View style={{ marginHorizontal: cx(24) }}>
|
|
527
601
|
<DeleteButton
|
|
528
602
|
text={I18n.getLang('edit_timeschedule_bttn_text')}
|
|
@@ -534,7 +608,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
534
608
|
onConfirm: async (_, { close }) => {
|
|
535
609
|
state.loading = true;
|
|
536
610
|
close();
|
|
537
|
-
const res = await
|
|
611
|
+
const res = await params.modDeleteTimeSchedule('delete', state.timeSchedule);
|
|
538
612
|
state.loading = false;
|
|
539
613
|
if (res.success) {
|
|
540
614
|
navigation.goBack();
|
|
@@ -568,95 +642,22 @@ const getDefaultManual = (props: TimeScheduleDetailPageParams): ComponentConfig
|
|
|
568
642
|
props.isStripLight || props.isCeilingLight
|
|
569
643
|
? DeviceType.StripLight
|
|
570
644
|
: props.isMixLight
|
|
571
|
-
|
|
572
|
-
|
|
645
|
+
? DeviceType.MixLight
|
|
646
|
+
: DeviceType.LightSource;
|
|
573
647
|
const deviceData =
|
|
574
648
|
deviceType === DeviceType.StripLight
|
|
575
649
|
? defStripDeviceData
|
|
576
650
|
: deviceType === DeviceType.MixLight
|
|
577
|
-
|
|
578
|
-
|
|
651
|
+
? defMixDeviceData
|
|
652
|
+
: defDeviceData;
|
|
579
653
|
// @ts-ignore
|
|
580
654
|
return {
|
|
581
655
|
type: deviceType,
|
|
582
656
|
deviceData: {
|
|
583
657
|
...deviceData,
|
|
584
|
-
isColorMode: props.isSupportColor
|
|
658
|
+
isColorMode: props.isSupportColor,
|
|
585
659
|
},
|
|
586
660
|
};
|
|
587
661
|
};
|
|
588
662
|
|
|
589
|
-
|
|
590
|
-
cardContainer: {
|
|
591
|
-
marginHorizontal: cx(24),
|
|
592
|
-
},
|
|
593
|
-
itemTitle: {
|
|
594
|
-
color: '#000',
|
|
595
|
-
fontSize: cx(16),
|
|
596
|
-
fontWeight: 'bold',
|
|
597
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
598
|
-
},
|
|
599
|
-
applyContent: {
|
|
600
|
-
backgroundColor: '#f6f6f6',
|
|
601
|
-
borderRadius: 4,
|
|
602
|
-
minHeight: cx(55),
|
|
603
|
-
flex: 1,
|
|
604
|
-
justifyContent: 'center',
|
|
605
|
-
paddingHorizontal: cx(10),
|
|
606
|
-
paddingTop: cx(10),
|
|
607
|
-
},
|
|
608
|
-
applyItem: {
|
|
609
|
-
paddingLeft: cx(5),
|
|
610
|
-
flexDirection: 'row',
|
|
611
|
-
justifyContent: 'space-between',
|
|
612
|
-
alignItems: 'center',
|
|
613
|
-
backgroundColor: '#fff',
|
|
614
|
-
height: cx(35),
|
|
615
|
-
},
|
|
616
|
-
moodScrollView: {
|
|
617
|
-
maxHeight: cx(500),
|
|
618
|
-
},
|
|
619
|
-
summaryContainer: {
|
|
620
|
-
flexDirection: 'row',
|
|
621
|
-
justifyContent: 'flex-start',
|
|
622
|
-
marginBottom: cx(10),
|
|
623
|
-
marginHorizontal: cx(24),
|
|
624
|
-
},
|
|
625
|
-
summaryImg: {
|
|
626
|
-
height: cx(12),
|
|
627
|
-
width: cx(12),
|
|
628
|
-
tintColor: '#000',
|
|
629
|
-
},
|
|
630
|
-
summaryLeft: {
|
|
631
|
-
flexDirection: 'row',
|
|
632
|
-
alignItems: 'center',
|
|
633
|
-
minWidth: cx(90),
|
|
634
|
-
},
|
|
635
|
-
leftTitle: {
|
|
636
|
-
fontSize: cx(14),
|
|
637
|
-
color: '#000',
|
|
638
|
-
marginTop: 0,
|
|
639
|
-
},
|
|
640
|
-
summaryRight: {
|
|
641
|
-
flexDirection: 'column',
|
|
642
|
-
marginLeft: cx(21),
|
|
643
|
-
backgroundColor: '#cbcbcb',
|
|
644
|
-
borderRadius: cx(16),
|
|
645
|
-
alignItems: 'center'
|
|
646
|
-
},
|
|
647
|
-
rightItem: {
|
|
648
|
-
paddingHorizontal: cx(12),
|
|
649
|
-
color: '#000',
|
|
650
|
-
},
|
|
651
|
-
switchButton: {
|
|
652
|
-
flexDirection: 'row',
|
|
653
|
-
alignItems: 'center',
|
|
654
|
-
justifyContent: 'space-between',
|
|
655
|
-
marginBottom: cx(10),
|
|
656
|
-
},
|
|
657
|
-
text: {
|
|
658
|
-
color: '#000',
|
|
659
|
-
},
|
|
660
|
-
});
|
|
661
|
-
|
|
662
|
-
export default TimeScheduleDetailPage;
|
|
663
|
+
export default withTheme(TimeScheduleDetailPage)
|