@ledvance/ui-biz-bundle 1.1.78 → 1.1.80
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/newModules/mood/AddMoodPage.tsx +2 -2
- package/src/newModules/mood/MoodPage.tsx +2 -1
- package/src/newModules/timeSchedule/Interface.ts +1 -4
- package/src/newModules/timeSchedule/TimeScheduleActions.ts +8 -0
- package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +12 -9
- package/src/newModules/timeSchedule/TimeSchedulePage.tsx +1 -1
- package/src/newModules/timeSchedule/components/ManuaSettings.tsx +5 -5
package/package.json
CHANGED
|
@@ -66,7 +66,7 @@ const AddMoodPage = () => {
|
|
|
66
66
|
? ui_biz_routerKey.ui_biz_dynamic_mix_mood_edit
|
|
67
67
|
: ui_biz_routerKey.ui_biz_dynamic_mood_edit;
|
|
68
68
|
const currentMood = moodItem.mainLamp
|
|
69
|
-
? { ...moodItem, id: mainId, mainLamp: { ...moodItem.mainLamp, id: mainId }, secondaryLamp: { ...moodItem.secondaryLamp, id: secondaryId } }
|
|
69
|
+
? { ...moodItem, id: mainId, mainLamp: { ...moodItem.mainLamp, id: mainId }, secondaryLamp: { ...moodItem.secondaryLamp, id: moodItem.secondaryLamp?.nodes?.length ? secondaryId : -1 } }
|
|
70
70
|
: newMood(mainId, secondaryId, moduleParams.isSupportColor, routeParams.isStatic, moduleParams);
|
|
71
71
|
navigation.navigate(url, {
|
|
72
72
|
...routeParams,
|
|
@@ -182,7 +182,7 @@ function newMood(
|
|
|
182
182
|
nodes: isStatic ? [node] : [node, { ...node }],
|
|
183
183
|
},
|
|
184
184
|
secondaryLamp: {
|
|
185
|
-
id: secondaryId,
|
|
185
|
+
id: isStatic ? -1 : secondaryId,
|
|
186
186
|
enable: true,
|
|
187
187
|
mode: MoodJumpGradientMode.StripJump,
|
|
188
188
|
speed: 75,
|
|
@@ -55,7 +55,8 @@ const MoodPage = () => {
|
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
const moodIds = useMemo(() => {
|
|
58
|
-
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
const mainIds = map(params.isCeilingLight ? (state.originMoods.map(m => m.mainLamp) || []) : state.originMoods, 'id').filter(v => v !== undefined)
|
|
59
60
|
const secondaryIds = map(state.originMoods.map(m => m.secondaryLamp) || [], 'id')
|
|
60
61
|
return filter([...mainIds, ...secondaryIds], v => v !== undefined) as number[]
|
|
61
62
|
}, [JSON.stringify(state.originMoods)])
|
|
@@ -92,9 +92,6 @@ export interface StripLightData extends DeviceData {
|
|
|
92
92
|
colorDiskActiveKey: number
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
export interface CeilingLightData extends DeviceData, StripLightData, MixLightData {
|
|
96
|
-
}
|
|
97
|
-
|
|
98
95
|
export interface FanLightData extends DeviceData {
|
|
99
96
|
fanSpeed: number
|
|
100
97
|
direction: 'forward' | 'reverse'
|
|
@@ -106,7 +103,7 @@ export type ComponentConfig =
|
|
|
106
103
|
| { type: DeviceType.LightSource; deviceData: DeviceData }
|
|
107
104
|
| { type: DeviceType.MixLight; deviceData: MixLightData }
|
|
108
105
|
| { type: DeviceType.StripLight; deviceData: StripLightData }
|
|
109
|
-
| { type: DeviceType.CeilingLight; deviceData:
|
|
106
|
+
| { type: DeviceType.CeilingLight; deviceData: StripLightData }
|
|
110
107
|
| { type: DeviceType.FanLight; deviceData: FanLightData }
|
|
111
108
|
| { type: DeviceType.PowerStrip; deviceData: DeviceData}
|
|
112
109
|
|
|
@@ -24,6 +24,14 @@ export const defStripDeviceData = {
|
|
|
24
24
|
colorDiskActiveKey: 0
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
export const defFanLightDeviceData = {
|
|
28
|
+
...defDeviceData,
|
|
29
|
+
fanSpeed: 1,
|
|
30
|
+
direction: 'forward',
|
|
31
|
+
mode: 'normal',
|
|
32
|
+
disinfect: false
|
|
33
|
+
}
|
|
34
|
+
|
|
27
35
|
export const getTimeSchedule = async (deviceId: string): Promise<Timer[]> => {
|
|
28
36
|
const res = await NativeApi.getAllTaskTimer(deviceId);
|
|
29
37
|
if (res.success && Array.isArray(res.data)) {
|
|
@@ -39,7 +39,7 @@ import InfoText from '@ledvance/base/src/components/InfoText';
|
|
|
39
39
|
import SegmentControl from '@ledvance/base/src/components/segmentControl';
|
|
40
40
|
import { useParams } from '@ledvance/base/src/hooks/Hooks';
|
|
41
41
|
import ManualSettings from './components/ManuaSettings';
|
|
42
|
-
import { defDeviceData, defMixDeviceData, defStripDeviceData } from './TimeScheduleActions';
|
|
42
|
+
import { defDeviceData, defFanLightDeviceData, defMixDeviceData, defStripDeviceData } from './TimeScheduleActions';
|
|
43
43
|
import MoodItem from '../mood/MoodItem';
|
|
44
44
|
import { getRemoteMoodList } from '../mood/MoodActions';
|
|
45
45
|
import { MoodUIInfo } from '../mood/Interface';
|
|
@@ -458,6 +458,7 @@ const TimeScheduleDetailPage = (props: { theme?: any }) => {
|
|
|
458
458
|
isSupportTemperature={params.isSupportTemperature}
|
|
459
459
|
isStripLight={params.isStripLight}
|
|
460
460
|
isCeilingLight={params.isCeilingLight}
|
|
461
|
+
isUVCFan={params.isUVCFan}
|
|
461
462
|
manualData={state.manualData}
|
|
462
463
|
onManualChange={manual => {
|
|
463
464
|
state.manualData = {
|
|
@@ -631,15 +632,17 @@ const getDefaultManual = (props: TimeScheduleDetailPageParams): ComponentConfig
|
|
|
631
632
|
: props.isCeilingLight
|
|
632
633
|
? DeviceType.CeilingLight
|
|
633
634
|
: DeviceType.LightSource
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
635
|
+
const deviceData =
|
|
636
|
+
(deviceType === DeviceType.StripLight || deviceType === DeviceType.CeilingLight)
|
|
637
|
+
? defStripDeviceData
|
|
638
|
+
: deviceType === DeviceType.MixLight
|
|
639
|
+
? defMixDeviceData
|
|
640
|
+
: deviceType === DeviceType.FanLight
|
|
641
|
+
? defFanLightDeviceData
|
|
642
|
+
: defDeviceData;
|
|
643
|
+
|
|
641
644
|
return {
|
|
642
|
-
type: deviceType,
|
|
645
|
+
type: deviceType as any,
|
|
643
646
|
deviceData: {
|
|
644
647
|
...deviceData,
|
|
645
648
|
isColorMode: props.isSupportColor,
|
|
@@ -41,7 +41,7 @@ export interface TimeSchedulePageParams {
|
|
|
41
41
|
isPowerStrip?: boolean
|
|
42
42
|
featureId?: string
|
|
43
43
|
applyForList: ApplyForItem[];
|
|
44
|
-
applyForDisabled
|
|
44
|
+
applyForDisabled?: boolean; // 是否可以选择apply for
|
|
45
45
|
manualDataDp2Obj: (dps: Record<string, any>) => DeviceStateType;
|
|
46
46
|
manualDataObj2Dp: (deviceState: DeviceStateType, applyForList: ApplyForItem[]) => Record<string, any>;
|
|
47
47
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { memo, useMemo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DeviceType, directOptions, FanLightData, ManualSettingProps, modeOptions, StripLightData } from '../Interface';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
import Card from '@ledvance/base/src/components/Card';
|
|
5
5
|
import LampAdjustView from '@ledvance/base/src/components/LampAdjustView';
|
|
@@ -142,9 +142,9 @@ function ManualSettings(props: ManualSettingProps) {
|
|
|
142
142
|
isSupportDirection={props.isUVCFan}
|
|
143
143
|
isSupportDisinfect={props.isUVCFan}
|
|
144
144
|
isSupportMode={props.isUVCFan}
|
|
145
|
-
directValue={
|
|
146
|
-
disinfect={
|
|
147
|
-
modeValue={
|
|
145
|
+
directValue={(state.deviceData as FanLightData).direction}
|
|
146
|
+
disinfect={(state.deviceData as FanLightData).disinfect}
|
|
147
|
+
modeValue={(state.deviceData as FanLightData).mode}
|
|
148
148
|
directOptions={directOptions}
|
|
149
149
|
modeOptions={modeOptions}
|
|
150
150
|
directChange={(direction: any) => {
|
|
@@ -316,7 +316,7 @@ function ManualSettings(props: ManualSettingProps) {
|
|
|
316
316
|
}, [state.deviceData, state.applyForList, props.theme.type]);
|
|
317
317
|
|
|
318
318
|
const ceilingLightCard = useMemo(() => {
|
|
319
|
-
const deviceData = state.deviceData as
|
|
319
|
+
const deviceData = state.deviceData as StripLightData
|
|
320
320
|
return (
|
|
321
321
|
<View>
|
|
322
322
|
{state.applyForList.map((item, idx) => (
|