@ledvance/group-ui-biz-bundle 1.0.55 → 1.0.57
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/mood_new/MoodActions.ts +25 -1
- package/src/modules/mood_new/MoodPage.tsx +10 -10
- package/src/modules/mood_new/StaticMoodEditorPage.tsx +2 -1
- package/src/modules/randomTimeForPlug/Router.ts +2 -2
- package/src/modules/timeSchedule/Interface.ts +25 -2
- package/src/modules/timeSchedule/TimeScheduleActions.ts +8 -0
- package/src/modules/timeSchedule/TimeScheduleDetailPage.tsx +38 -14
- package/src/modules/timeSchedule/TimeSchedulePage.tsx +2 -2
- package/src/modules/timeSchedule/components/ManuaSettings.tsx +52 -3
package/package.json
CHANGED
|
@@ -37,6 +37,8 @@ export interface SceneDataConfigType {
|
|
|
37
37
|
colour_switch: boolean
|
|
38
38
|
white_switch: boolean
|
|
39
39
|
switch: boolean
|
|
40
|
+
switch_fan: boolean
|
|
41
|
+
fan_switch: boolean
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
export function useSwitchLed(params: MoodPageParams): boolean {
|
|
@@ -68,7 +70,19 @@ export function useMoodScene(params: MoodPageParams): [SceneDataType, (value: Sc
|
|
|
68
70
|
if (mainDp && params.mainDp) {
|
|
69
71
|
dps[params.mainDp] = mainDp
|
|
70
72
|
dps[params.mainSwitch] = true
|
|
71
|
-
dps[params.mainWorkMode] = WorkMode.Scene
|
|
73
|
+
dps[params.mainWorkMode] = WorkMode.Scene
|
|
74
|
+
if (params.isUVCFan){
|
|
75
|
+
dps[getGlobalParamsDp('fan_switch')] = mainLamp.fanEnable
|
|
76
|
+
// if (mainLamp.fanEnable){
|
|
77
|
+
// dps[getGlobalParamsDp('fan_speed')] = mainLamp.fanSpeed
|
|
78
|
+
// }
|
|
79
|
+
}
|
|
80
|
+
if (params.isFanLight && !params.isUVCFan){
|
|
81
|
+
dps[getGlobalParamsDp('switch_fan')] = mainLamp.fanEnable
|
|
82
|
+
// if (mainLamp.fanEnable){
|
|
83
|
+
// dps[getGlobalParamsDp('fan_speed')] = mainLamp.fanSpeed
|
|
84
|
+
// }
|
|
85
|
+
}
|
|
72
86
|
}
|
|
73
87
|
}
|
|
74
88
|
if (secondaryLamp.nodes.length && params.isCeilingLight) {
|
|
@@ -98,6 +112,16 @@ export function useMoodScene(params: MoodPageParams): [SceneDataType, (value: Sc
|
|
|
98
112
|
} else {
|
|
99
113
|
config.switch_led = true
|
|
100
114
|
}
|
|
115
|
+
if (params.isUVCFan || params.isFanLight){
|
|
116
|
+
if (mainLamp.fanEnable){
|
|
117
|
+
if(params.isUVCFan){
|
|
118
|
+
config.fan_switch = true
|
|
119
|
+
}
|
|
120
|
+
if (params.isFanLight && !params.isUVCFan){
|
|
121
|
+
config.switch_fan = true
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
101
125
|
}
|
|
102
126
|
if (secondaryLamp?.nodes?.length) {
|
|
103
127
|
if (params.isCeilingLight) {
|
|
@@ -52,20 +52,20 @@ const MoodPage = () => {
|
|
|
52
52
|
flag: Symbol(),
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
const moodIds = useMemo(() =>{
|
|
55
|
+
const moodIds = useMemo(() => {
|
|
56
56
|
const mainIds = map(state.originMoods, 'id').filter(v => v !== undefined)
|
|
57
57
|
const secondaryIds = map(state.originMoods.map(m => m.secondaryLamp) || [], 'id')
|
|
58
|
-
return filter([...mainIds, ...
|
|
58
|
+
return filter([...mainIds, ...secondaryIds], v => v !== undefined) as number[]
|
|
59
59
|
}, [JSON.stringify(state.originMoods)])
|
|
60
60
|
|
|
61
61
|
useEffect(() => {
|
|
62
62
|
state.timerId = setTimeout(() => {
|
|
63
|
-
state.loading = true
|
|
63
|
+
state.loading = true
|
|
64
64
|
getRemoteMoodList(
|
|
65
65
|
uaGroupInfo.tyGroupId.toString(),
|
|
66
66
|
params
|
|
67
67
|
).then(res => {
|
|
68
|
-
state.loading = false
|
|
68
|
+
state.loading = false
|
|
69
69
|
if (res.success && Array.isArray(res.data)) {
|
|
70
70
|
state.originMoods = cloneDeep(res.data);
|
|
71
71
|
console.log(state.originMoods, '< --- originMoods')
|
|
@@ -188,14 +188,14 @@ const MoodPage = () => {
|
|
|
188
188
|
}
|
|
189
189
|
const mood = mode === 'del' ? (newScene.length === 0 ? undefined : newScene[0]) : checkedMood;
|
|
190
190
|
const res = await saveMoodList(uaGroupInfo.tyGroupId.toString(), newScene, params);
|
|
191
|
-
console.log(res, '< --- save res')
|
|
192
191
|
if (res.success) {
|
|
193
192
|
state.originMoods = cloneDeep(newScene);
|
|
194
193
|
setMoods(cloneDeep(newScene));
|
|
195
|
-
if (
|
|
196
|
-
(moodInfo.scene?.mainLamp.id !== checkedMood.mainLamp.id || moodInfo.scene?.secondaryLamp.id !== checkedMood.secondaryLamp.id) :
|
|
197
|
-
moodInfo.scene?.id !== checkedMood.id)
|
|
198
|
-
(params.isCeilingLight ? (workMode !== WorkMode.Scene && rgbicWorkMode !== WorkMode.Scene) : workMode !== WorkMode.Scene) ||
|
|
194
|
+
if (mode === 'del' && ((params.isCeilingLight ?
|
|
195
|
+
(moodInfo.scene?.mainLamp.id !== checkedMood.mainLamp.id || moodInfo.scene?.secondaryLamp.id !== checkedMood.secondaryLamp.id) :
|
|
196
|
+
moodInfo.scene?.id !== checkedMood.id) ||
|
|
197
|
+
(params.isCeilingLight ? (workMode !== WorkMode.Scene && rgbicWorkMode !== WorkMode.Scene) : workMode !== WorkMode.Scene) ||
|
|
198
|
+
!switchLed)) {
|
|
199
199
|
return {
|
|
200
200
|
success: true
|
|
201
201
|
}
|
|
@@ -243,7 +243,7 @@ const MoodPage = () => {
|
|
|
243
243
|
},
|
|
244
244
|
[moodInfo]
|
|
245
245
|
);
|
|
246
|
-
|
|
246
|
+
|
|
247
247
|
const nameRepeat = useCallback((mood: MoodUIInfo) => {
|
|
248
248
|
return !!state.originMoods.filter(m => !(params.isCeilingLight ? (m.mainLamp.id === mood.mainLamp.id && m.secondaryLamp.id === mood.secondaryLamp.id) : (m.id === mood.id))).find(m => m.name === mood.name)
|
|
249
249
|
}, [state.originMoods, params.isCeilingLight])
|
|
@@ -47,11 +47,12 @@ const StaticMoodEditorPage = () => {
|
|
|
47
47
|
const params = cloneDeep(routeParams);
|
|
48
48
|
const moduleParams = params.moduleParams;
|
|
49
49
|
const isMix = !!(moduleParams.isCeilingLight || moduleParams.isMixLight);
|
|
50
|
+
console.log(params.currentMood, '< -- currentMood')
|
|
50
51
|
const state = useReactive<StaticMoodEditorPageState>({
|
|
51
52
|
headline: '',
|
|
52
53
|
mood: params.currentMood,
|
|
53
54
|
mainNode: params.currentMood.mainLamp.nodes[0],
|
|
54
|
-
secondaryNode: params.currentMood?.secondaryLamp?.nodes[0],
|
|
55
|
+
secondaryNode: params.currentMood?.secondaryLamp?.nodes?.[0],
|
|
55
56
|
loading: false,
|
|
56
57
|
});
|
|
57
58
|
|
|
@@ -5,7 +5,7 @@ import {ui_biz_routerKey} from "../../navigation/Routers";
|
|
|
5
5
|
|
|
6
6
|
const RandomTimeForPlugRouters: NavigationRoute[] = [
|
|
7
7
|
{
|
|
8
|
-
name: ui_biz_routerKey.
|
|
8
|
+
name: ui_biz_routerKey.group_ui_biz_random_time_plug,
|
|
9
9
|
component: RandomTimeForPlugPage,
|
|
10
10
|
options:{
|
|
11
11
|
hideTopbar: true,
|
|
@@ -13,7 +13,7 @@ const RandomTimeForPlugRouters: NavigationRoute[] = [
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
name: ui_biz_routerKey.
|
|
16
|
+
name: ui_biz_routerKey.group_ui_biz_random_time_plug_detail,
|
|
17
17
|
component: RandomTimeForPlugDetailPage,
|
|
18
18
|
options:{
|
|
19
19
|
hideTopbar: true,
|
|
@@ -41,7 +41,8 @@ export enum UVCFanMode {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
import
|
|
44
|
+
import I18n from "@ledvance/base/src/i18n";
|
|
45
|
+
import { MoodInfo, MoodUIInfo } from "../mood_new/Interface";
|
|
45
46
|
|
|
46
47
|
export interface Timer {
|
|
47
48
|
status: number;
|
|
@@ -80,6 +81,8 @@ interface judgmentSupport {
|
|
|
80
81
|
isStripLight?: boolean;
|
|
81
82
|
isStringLight?: boolean;
|
|
82
83
|
isMixLight?: boolean;
|
|
84
|
+
isFanLight?: boolean;
|
|
85
|
+
isUVCFan?: boolean;
|
|
83
86
|
}
|
|
84
87
|
|
|
85
88
|
export interface ManualSettingProps extends judgmentSupport {
|
|
@@ -94,7 +97,8 @@ export enum DeviceType {
|
|
|
94
97
|
LightSource = 'lightSource',
|
|
95
98
|
MixLight = 'mixLight',
|
|
96
99
|
StripLight = 'stripLight',
|
|
97
|
-
CeilingLight = 'ceilingLight'
|
|
100
|
+
CeilingLight = 'ceilingLight',
|
|
101
|
+
FanLight = 'fanLight'
|
|
98
102
|
}
|
|
99
103
|
// export type DeviceType = 'LightSource' | 'CeilingLight' | 'StringLight' | 'StripLight' | 'MixLight';
|
|
100
104
|
|
|
@@ -122,16 +126,25 @@ export interface StripLightData extends DeviceData {
|
|
|
122
126
|
export interface CeilingLightData extends DeviceData, StripLightData, MixLightData {
|
|
123
127
|
}
|
|
124
128
|
|
|
129
|
+
export interface FanLightData extends DeviceData {
|
|
130
|
+
fanSpeed: number
|
|
131
|
+
direction: 'forward' | 'reverse'
|
|
132
|
+
mode: 'nature' | 'normal'
|
|
133
|
+
disinfect: boolean
|
|
134
|
+
}
|
|
135
|
+
|
|
125
136
|
export type ComponentConfig =
|
|
126
137
|
| { type: DeviceType.LightSource; deviceData: DeviceData }
|
|
127
138
|
| { type: DeviceType.MixLight; deviceData: MixLightData }
|
|
128
139
|
| { type: DeviceType.StripLight; deviceData: StripLightData }
|
|
129
140
|
| { type: DeviceType.CeilingLight; deviceData: CeilingLightData }
|
|
141
|
+
| { type: DeviceType.FanLight; deviceData: FanLightData }
|
|
130
142
|
|
|
131
143
|
export interface TimeScheduleDetailState {
|
|
132
144
|
timeSchedule: Timer;
|
|
133
145
|
dps: Record<string, any>;
|
|
134
146
|
isManual: boolean;
|
|
147
|
+
initSelectedSkill: ApplyForItem[],
|
|
135
148
|
selectedSkill: ApplyForItem[];
|
|
136
149
|
unSelectedSkill: ApplyForItem[];
|
|
137
150
|
loading: boolean;
|
|
@@ -148,3 +161,13 @@ export interface DeviceStateType {
|
|
|
148
161
|
mood?: MoodInfo
|
|
149
162
|
isManual: boolean
|
|
150
163
|
}
|
|
164
|
+
|
|
165
|
+
export const directOptions = [
|
|
166
|
+
{label: I18n.getLang('ceiling_fan_tile_uvc_fan_direction_opt_1'), value: 'forward'},
|
|
167
|
+
{label: I18n.getLang('ceiling_fan_tile_uvc_fan_direction_opt_2'), value: 'reverse'}
|
|
168
|
+
]
|
|
169
|
+
|
|
170
|
+
export const modeOptions = [
|
|
171
|
+
{label: I18n.getLang('ceiling_fan_tile_uvc_fan_mode_opt_1'), value: 'normal'},
|
|
172
|
+
{label: I18n.getLang('ceiling_fan_tile_uvc_fan_mode_opt_2'), value: 'nature'},
|
|
173
|
+
]
|
|
@@ -32,6 +32,14 @@ export const defCeilingLihtDeviceData = {
|
|
|
32
32
|
activeKey: 1
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
export const defFanLightDeviceData = {
|
|
36
|
+
...defDeviceData,
|
|
37
|
+
fanSpeed: 1,
|
|
38
|
+
direction: 'forward',
|
|
39
|
+
mode: 'normal',
|
|
40
|
+
disinfect: false
|
|
41
|
+
}
|
|
42
|
+
|
|
35
43
|
export const addTimeSchedule = async (props: IAddSingleTime) => {
|
|
36
44
|
try {
|
|
37
45
|
const res = await commonApi.timerApi.addSingleTimer({
|
|
@@ -37,11 +37,12 @@ import DeleteButton from '@ledvance/base/src/components/DeleteButton';
|
|
|
37
37
|
import SegmentControl from '@ledvance/base/src/components/segmentControl';
|
|
38
38
|
import { useParams } from '@ledvance/base/src/hooks/Hooks';
|
|
39
39
|
import ManualSettings from './components/ManuaSettings';
|
|
40
|
-
import { defCeilingLihtDeviceData, defDeviceData, defMixDeviceData, defStripDeviceData } from './TimeScheduleActions';
|
|
40
|
+
import { defCeilingLihtDeviceData, defDeviceData, defMixDeviceData, defStripDeviceData, defFanLightDeviceData } from './TimeScheduleActions';
|
|
41
41
|
import MoodItem from '../mood_new/MoodItem';
|
|
42
42
|
import Summary from './components/Summary'
|
|
43
43
|
import { getRemoteMoodList } from '../mood_new/MoodActions'
|
|
44
44
|
import { MoodUIInfo } from '../mood_new/Interface';
|
|
45
|
+
import InfoText from '@ledvance/base/src/components/InfoText';
|
|
45
46
|
|
|
46
47
|
const { convertX: cx } = Utils.RatioUtils;
|
|
47
48
|
const { toFixedString } = Utils.NumberUtils;
|
|
@@ -62,6 +63,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
62
63
|
timeSchedule: props.mode === 'add' ? newTimeSchedule() : cloneDeep(props.timeSchedule),
|
|
63
64
|
dps: props.mode === 'add' ? {} : props.timeSchedule.dps,
|
|
64
65
|
isManual: true, // manual ,mood
|
|
66
|
+
initSelectedSkill: [] as ApplyForItem[],
|
|
65
67
|
selectedSkill: [] as ApplyForItem[],
|
|
66
68
|
unSelectedSkill: [] as ApplyForItem[],
|
|
67
69
|
loading: false,
|
|
@@ -106,10 +108,10 @@ const TimeScheduleDetailPage = () => {
|
|
|
106
108
|
state.unSelectedSkill = [];
|
|
107
109
|
} else {
|
|
108
110
|
const selectedList = cloneApplyList.filter(item =>
|
|
109
|
-
Object.keys(timeSchedule
|
|
111
|
+
Object.keys(timeSchedule?.dps || {}).includes(item.dp)
|
|
110
112
|
);
|
|
111
113
|
const unSelectedList = cloneApplyList.filter(
|
|
112
|
-
item => !Object.keys(timeSchedule
|
|
114
|
+
item => !Object.keys(timeSchedule?.dps || {}).includes(item.dp)
|
|
113
115
|
);
|
|
114
116
|
state.selectedSkill = mode === 'add' ? [] : selectedList;
|
|
115
117
|
state.unSelectedSkill = mode === 'add' ? cloneApplyList : unSelectedList;
|
|
@@ -119,7 +121,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
119
121
|
state.isManual = isManual;
|
|
120
122
|
state.mood = mood;
|
|
121
123
|
}
|
|
122
|
-
|
|
124
|
+
state.initSelectedSkill = cloneDeep(state.selectedSkill)
|
|
123
125
|
if (!(Array.isArray(moods) && moods.length)) {
|
|
124
126
|
state.timerId = setTimeout(() => {
|
|
125
127
|
getRemoteMoodList(uaGroupInfo.tyGroupId.toString(), props).then(res => {
|
|
@@ -169,6 +171,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
169
171
|
: props.manualDataDp2Obj(props.timeSchedule.dps).deviceData;
|
|
170
172
|
const before = {
|
|
171
173
|
...schedule,
|
|
174
|
+
selectedSkill: state.initSelectedSkill,
|
|
172
175
|
dps: manual,
|
|
173
176
|
isManual:
|
|
174
177
|
props.mode === 'add' ? true : props.manualDataDp2Obj(props.timeSchedule.dps).isManual,
|
|
@@ -178,26 +181,32 @@ const TimeScheduleDetailPage = () => {
|
|
|
178
181
|
before.mood = (before.isManual || props.mode === 'add') ? undefined : props.manualDataDp2Obj(props.timeSchedule.dps)?.mood
|
|
179
182
|
const now = {
|
|
180
183
|
...state.timeSchedule,
|
|
184
|
+
selectedSkill: state.selectedSkill,
|
|
181
185
|
dps: state.manualData,
|
|
182
186
|
isManual: state.isManual,
|
|
183
187
|
mood: state.isManual ? undefined : state.mood,
|
|
184
188
|
id: 1,
|
|
185
189
|
};
|
|
186
190
|
return isEqual(before, now);
|
|
187
|
-
}, [JSON.stringify(state.timeSchedule), state.manualData, state.isManual, state.mood]);
|
|
191
|
+
}, [JSON.stringify(state.timeSchedule), JSON.stringify(state.initSelectedSkill), JSON.stringify(state.selectedSkill), state.manualData, state.isManual, state.mood]);
|
|
192
|
+
|
|
193
|
+
const showMoodFanSelectText = useMemo(() =>{
|
|
194
|
+
return (props.isUVCFan || props.isFanLight) && !state.isManual && state.selectedSkill.length < 2
|
|
195
|
+
}, [props.isUVCFan, props.isFanLight, state.selectedSkill.length, state.isManual])
|
|
188
196
|
|
|
189
197
|
const allowSubmit = useMemo(() => {
|
|
190
198
|
return (
|
|
191
199
|
(state.timeSchedule.aliasName.length && state.timeSchedule.aliasName.length < 33) &&
|
|
192
200
|
state.selectedSkill.length &&
|
|
193
201
|
(state.isManual ? state.isManual : !!state.mood) &&
|
|
194
|
-
!isModify
|
|
202
|
+
!isModify &&
|
|
203
|
+
!showMoodFanSelectText
|
|
195
204
|
);
|
|
196
|
-
}, [state.timeSchedule.aliasName, state.selectedSkill, isModify, state.isManual, state.mood]);
|
|
205
|
+
}, [state.timeSchedule.aliasName, state.selectedSkill, isModify, state.isManual, state.mood, showMoodFanSelectText]);
|
|
197
206
|
|
|
198
207
|
const showSelectedIcon = useMemo(() => {
|
|
199
|
-
return
|
|
200
|
-
}, [
|
|
208
|
+
return props.applyForList.length !== 1 && !props.applyForDisabled;
|
|
209
|
+
}, [props.applyForList.length, props.applyForDisabled]);
|
|
201
210
|
|
|
202
211
|
const getMoodItemEnable = useCallback((item: MoodUIInfo ) =>{
|
|
203
212
|
return props.isCeilingLight ? ((item.mainLamp.id === state.mood?.mainLamp?.id) && (item.secondaryLamp.id === state.mood?.secondaryLamp?.id)) : item.id === state.mood?.id
|
|
@@ -286,8 +295,8 @@ const TimeScheduleDetailPage = () => {
|
|
|
286
295
|
{I18n.getLang('timeschedule_add_schedule_subheadline_text')}
|
|
287
296
|
</Text>
|
|
288
297
|
<Spacer height={cx(10)} />
|
|
289
|
-
<View style={styles.applyContent}>
|
|
290
|
-
{
|
|
298
|
+
<View style={[styles.applyContent, {paddingTop: state.selectedSkill.length ? cx(10) : 0}]}>
|
|
299
|
+
{state.selectedSkill.length === 0 ? (
|
|
291
300
|
<Text>{I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}</Text>
|
|
292
301
|
) : (
|
|
293
302
|
state.selectedSkill.map(skill => (
|
|
@@ -352,6 +361,18 @@ const TimeScheduleDetailPage = () => {
|
|
|
352
361
|
</>
|
|
353
362
|
)}
|
|
354
363
|
<Spacer height={cx(10)} />
|
|
364
|
+
{(!state.selectedSkill.length && !showMoodFanSelectText) && <InfoText
|
|
365
|
+
style={{marginHorizontal: cx(24)}}
|
|
366
|
+
icon={res.ic_warning_amber}
|
|
367
|
+
contentColor="#FF9500"
|
|
368
|
+
text={I18n.getLang('timeschedule_add_schedule_no_device_warning_text')}
|
|
369
|
+
/>}
|
|
370
|
+
{showMoodFanSelectText && <InfoText
|
|
371
|
+
style={{marginHorizontal: cx(24)}}
|
|
372
|
+
icon={res.ic_warning_amber}
|
|
373
|
+
contentColor="#FF9500"
|
|
374
|
+
text={I18n.getLang('timeschedule_add_schedule_devicestate_sec_warning_text')}
|
|
375
|
+
/>}
|
|
355
376
|
{state.isManual ? (
|
|
356
377
|
<ManualSettings
|
|
357
378
|
dps={state.dps}
|
|
@@ -373,7 +394,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
373
394
|
}}
|
|
374
395
|
/>
|
|
375
396
|
) : (
|
|
376
|
-
<FlatList
|
|
397
|
+
!showMoodFanSelectText ? <FlatList
|
|
377
398
|
data={state.moods}
|
|
378
399
|
renderItem={({ item }) => {
|
|
379
400
|
return (
|
|
@@ -391,7 +412,7 @@ const TimeScheduleDetailPage = () => {
|
|
|
391
412
|
ItemSeparatorComponent={() => <Spacer />}
|
|
392
413
|
ListFooterComponent={() => <Spacer />}
|
|
393
414
|
keyExtractor={item => `${item.name}`}
|
|
394
|
-
/>
|
|
415
|
+
/> : <View></View>
|
|
395
416
|
)}
|
|
396
417
|
<Spacer />
|
|
397
418
|
|
|
@@ -529,6 +550,8 @@ const getDefaultManual = (props: TimeScheduleDetailPageParams): ComponentConfig
|
|
|
529
550
|
? DeviceType.MixLight
|
|
530
551
|
: props.isCeilingLight
|
|
531
552
|
? DeviceType.CeilingLight
|
|
553
|
+
: props.isFanLight ?
|
|
554
|
+
DeviceType.FanLight
|
|
532
555
|
: DeviceType.LightSource;
|
|
533
556
|
const deviceData =
|
|
534
557
|
deviceType === DeviceType.StripLight
|
|
@@ -537,6 +560,8 @@ const getDefaultManual = (props: TimeScheduleDetailPageParams): ComponentConfig
|
|
|
537
560
|
? defMixDeviceData
|
|
538
561
|
: deviceType === DeviceType.CeilingLight
|
|
539
562
|
? defCeilingLihtDeviceData
|
|
563
|
+
: deviceType === DeviceType.FanLight
|
|
564
|
+
? defFanLightDeviceData
|
|
540
565
|
: defDeviceData;
|
|
541
566
|
// @ts-ignore
|
|
542
567
|
return {
|
|
@@ -565,7 +590,6 @@ const styles = StyleSheet.create({
|
|
|
565
590
|
flex: 1,
|
|
566
591
|
justifyContent: 'center',
|
|
567
592
|
paddingHorizontal: cx(10),
|
|
568
|
-
paddingTop: cx(10),
|
|
569
593
|
},
|
|
570
594
|
applyItem: {
|
|
571
595
|
paddingLeft: cx(5),
|
|
@@ -33,8 +33,8 @@ export interface TimeSchedulePageParams {
|
|
|
33
33
|
isMatterLight?: boolean;
|
|
34
34
|
isCeilingLight?: boolean;
|
|
35
35
|
isMixLight?: boolean;
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
isFanLight?: boolean
|
|
37
|
+
isUVCFan?: boolean;
|
|
38
38
|
applyForList: ApplyForItem[];
|
|
39
39
|
applyForDisabled: boolean; // 是否可以选择apply for
|
|
40
40
|
manualDataDp2Obj: (dps: Record<string, any>) => DeviceStateType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { memo, useMemo } from 'react';
|
|
2
|
-
import { CeilingLightData, DeviceType, ManualSettingProps, StripLightData } from '../Interface';
|
|
2
|
+
import { CeilingLightData, DeviceType, ManualSettingProps, StripLightData, directOptions, modeOptions } 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';
|
|
@@ -14,6 +14,7 @@ import Spacer from '@ledvance/base/src/components/Spacer';
|
|
|
14
14
|
import { useGroupDevices } from '@ledvance/base/src/models/modules/NativePropsSlice';
|
|
15
15
|
import ApplyForDeviceList from '@ledvance/base/src/components/ApplyForDeviceList';
|
|
16
16
|
import { cloneDeep } from 'lodash';
|
|
17
|
+
import { FanAdjustViewContent } from '@ledvance/base/src/components/FanAdjustView';
|
|
17
18
|
const { convertX: cx } = Utils.RatioUtils;
|
|
18
19
|
|
|
19
20
|
function ManualSettings(props: ManualSettingProps) {
|
|
@@ -50,7 +51,7 @@ function ManualSettings(props: ManualSettingProps) {
|
|
|
50
51
|
),
|
|
51
52
|
},
|
|
52
53
|
];
|
|
53
|
-
if(props.isCeilingLight){
|
|
54
|
+
if (props.isCeilingLight) {
|
|
54
55
|
return tabs.filter(tab => tab.key !== 0)
|
|
55
56
|
}
|
|
56
57
|
if (!isSupportWhite) {
|
|
@@ -87,7 +88,7 @@ function ManualSettings(props: ManualSettingProps) {
|
|
|
87
88
|
state.applyFlag = Symbol()
|
|
88
89
|
}}
|
|
89
90
|
/>
|
|
90
|
-
{item.enable && item.type !== 'socket' && (
|
|
91
|
+
{item.enable && (item.type !== 'socket' && item.type !== 'fan') && (
|
|
91
92
|
<LampAdjustView
|
|
92
93
|
isSupportColor={props.isSupportColor}
|
|
93
94
|
isSupportBrightness={props.isSupportBrightness}
|
|
@@ -131,6 +132,54 @@ function ManualSettings(props: ManualSettingProps) {
|
|
|
131
132
|
}}
|
|
132
133
|
/>
|
|
133
134
|
)}
|
|
135
|
+
|
|
136
|
+
{item.enable && item.type === 'fan' && (
|
|
137
|
+
<FanAdjustViewContent
|
|
138
|
+
hideEnable={true}
|
|
139
|
+
fanEnable={item.enable}
|
|
140
|
+
maxFanSpeed={props.isUVCFan ? 20 : 3}
|
|
141
|
+
isSupportDirection={props.isUVCFan}
|
|
142
|
+
isSupportDisinfect={props.isUVCFan}
|
|
143
|
+
isSupportMode={props.isUVCFan}
|
|
144
|
+
directValue={''}
|
|
145
|
+
disinfect={true}
|
|
146
|
+
modeValue={''}
|
|
147
|
+
directOptions={directOptions}
|
|
148
|
+
modeOptions={modeOptions}
|
|
149
|
+
directChange={(direction: any) => {
|
|
150
|
+
state.deviceData = {
|
|
151
|
+
...state.deviceData,
|
|
152
|
+
direction
|
|
153
|
+
}
|
|
154
|
+
state.manualFlag = Symbol()
|
|
155
|
+
}}
|
|
156
|
+
modeChange={(mode: any) => {
|
|
157
|
+
state.deviceData = {
|
|
158
|
+
...state.deviceData,
|
|
159
|
+
mode
|
|
160
|
+
}
|
|
161
|
+
state.manualFlag = Symbol()
|
|
162
|
+
}}
|
|
163
|
+
disinfectChange={(disinfect: any) => {
|
|
164
|
+
state.deviceData = {
|
|
165
|
+
...state.deviceData,
|
|
166
|
+
disinfect
|
|
167
|
+
}
|
|
168
|
+
state.manualFlag = Symbol()
|
|
169
|
+
}}
|
|
170
|
+
// @ts-ignore
|
|
171
|
+
fanSpeed={deviceData.fanSpeed}
|
|
172
|
+
onFanSwitch={() => {}}
|
|
173
|
+
onFanSpeedChangeComplete={(fanSpeed) => {
|
|
174
|
+
state.deviceData = {
|
|
175
|
+
...state.deviceData,
|
|
176
|
+
fanSpeed
|
|
177
|
+
}
|
|
178
|
+
state.manualFlag = Symbol()
|
|
179
|
+
}}
|
|
180
|
+
/>
|
|
181
|
+
)}
|
|
182
|
+
|
|
134
183
|
<ApplyForDeviceList
|
|
135
184
|
devices={cloneDeep(groupDevices)}
|
|
136
185
|
/>
|