@ledvance/ui-biz-bundle 1.1.78 → 1.1.79
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 +0 -4
- package/src/newModules/timeSchedule/TimeScheduleActions.ts +8 -0
- package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +11 -8
- package/src/newModules/timeSchedule/TimeSchedulePage.tsx +1 -1
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,6 @@ 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: CeilingLightData }
|
|
110
106
|
| { type: DeviceType.FanLight; deviceData: FanLightData }
|
|
111
107
|
| { type: DeviceType.PowerStrip; deviceData: DeviceData}
|
|
112
108
|
|
|
@@ -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';
|
|
@@ -631,14 +631,17 @@ const getDefaultManual = (props: TimeScheduleDetailPageParams): ComponentConfig
|
|
|
631
631
|
: props.isCeilingLight
|
|
632
632
|
? DeviceType.CeilingLight
|
|
633
633
|
: DeviceType.LightSource
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
634
|
+
const deviceData =
|
|
635
|
+
(deviceType === DeviceType.StripLight || deviceType === DeviceType.CeilingLight)
|
|
636
|
+
? defStripDeviceData
|
|
637
|
+
: deviceType === DeviceType.MixLight
|
|
638
|
+
? defMixDeviceData
|
|
639
|
+
: deviceType === DeviceType.FanLight
|
|
640
|
+
? defFanLightDeviceData
|
|
641
|
+
: defDeviceData;
|
|
642
|
+
|
|
641
643
|
return {
|
|
644
|
+
// @ts-ignore
|
|
642
645
|
type: deviceType,
|
|
643
646
|
deviceData: {
|
|
644
647
|
...deviceData,
|
|
@@ -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
|
}
|