@ledvance/group-ui-biz-bundle 1.0.106 → 1.0.107
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 +6 -36
- package/src/modules/music/MusicActions.ts +4 -4
- package/src/modules/time_schedule/Interface.ts +0 -90
- package/src/modules/time_schedule/ScheduleCard.tsx +0 -128
- package/src/modules/time_schedule/TimeScheduleActions.ts +0 -102
- package/src/modules/time_schedule/TimeScheduleDetailPage.tsx +0 -910
- package/src/modules/time_schedule/TimeSchedulePage.tsx +0 -256
package/package.json
CHANGED
|
@@ -4,68 +4,38 @@
|
|
|
4
4
|
"name": "@ledvance/group-ui-biz-bundle",
|
|
5
5
|
"pid": [],
|
|
6
6
|
"uiid": "",
|
|
7
|
-
"version": "1.0.
|
|
7
|
+
"version": "1.0.107",
|
|
8
8
|
"scripts": {},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@ledvance/base": "^1.x",
|
|
11
11
|
"@ledvance/react-native-echarts-pro": "^1.x",
|
|
12
|
-
"@reduxjs/toolkit": "^1.8.6",
|
|
13
12
|
"@tuya/tuya-panel-api": "^1.12.0",
|
|
14
13
|
"@tuya/tuya-panel-lamp-sdk": "^1.14.1",
|
|
15
14
|
"ahooks": "^2.x",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"events": "^1.1.1",
|
|
19
|
-
"lodash": "^4.17.19",
|
|
20
|
-
"moment": "^2.20.1",
|
|
15
|
+
"dayjs": "^1.11.13",
|
|
16
|
+
"lodash": "^4.17.21",
|
|
21
17
|
"prop-types": "^15.6.1",
|
|
22
18
|
"react": "16.8.3",
|
|
23
|
-
"react-addons-shallow-compare": "^15.6.2",
|
|
24
19
|
"react-native": "0.59.10",
|
|
25
|
-
"react-native-render-html": "^6.3.4",
|
|
26
20
|
"react-native-svg": "5.5.1",
|
|
27
|
-
"react-redux": "^7.2.1",
|
|
28
|
-
"redux": "^4.0.0",
|
|
29
|
-
"redux-actions": "^2.6.1",
|
|
30
|
-
"redux-logger": "^3.0.6",
|
|
31
|
-
"redux-observable": "^1.0.0",
|
|
32
|
-
"redux-thunk": "^2.3.0",
|
|
33
|
-
"rxjs": "^6.3.1",
|
|
34
|
-
"rxjs-compat": "^6.3.1",
|
|
35
|
-
"style-equal": "^1.0.0",
|
|
36
21
|
"tuya-panel-kit": "^4.9.4"
|
|
37
22
|
},
|
|
38
23
|
"devDependencies": {
|
|
39
24
|
"@babel/plugin-proposal-decorators": "^7.12.1",
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@types/
|
|
43
|
-
"@types/react": "^16.0.4",
|
|
44
|
-
"@types/react-native": "^0.60.0",
|
|
45
|
-
"@types/react-redux": "^7.1.2",
|
|
46
|
-
"@types/redux": "^3.6.0",
|
|
47
|
-
"@types/redux-actions": "^2.6.1",
|
|
48
|
-
"@types/redux-logger": "^3.0.7",
|
|
25
|
+
"@types/lodash": "^4.17.13",
|
|
26
|
+
"@types/react": "17.0.83",
|
|
27
|
+
"@types/react-native": "^0.65",
|
|
49
28
|
"@types/tuya-panel-kit": "^4.7.3",
|
|
50
|
-
"babel-jest": "^22.1.0",
|
|
51
29
|
"babel-plugin-import": "^1.11.0",
|
|
52
30
|
"babel-plugin-module-resolver": "^4.0.0",
|
|
53
31
|
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
|
54
32
|
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
55
|
-
"commitizen": "^4.2.2",
|
|
56
|
-
"commitlint-config-cz": "^0.13.2",
|
|
57
|
-
"cz-customizable": "^6.3.0",
|
|
58
|
-
"eslint-config-airbnb": "^18.2.1",
|
|
59
33
|
"eslint-config-tuya": "^1.0.0",
|
|
60
34
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
61
35
|
"eslint-import-resolver-react-native": "^0.2.0",
|
|
62
36
|
"eslint-plugin-react-native": "^3.10.0",
|
|
63
|
-
"husky": "^4.3.0",
|
|
64
|
-
"jest": "^22.1.1",
|
|
65
37
|
"metro-react-native-babel-preset": "^0.63.0",
|
|
66
38
|
"react-native-typescript-transformer": "^1.2.13",
|
|
67
|
-
"react-test-renderer": "^16.2.0",
|
|
68
|
-
"standard-version": "^9.0.0",
|
|
69
39
|
"typescript": "^4.1.2"
|
|
70
40
|
},
|
|
71
41
|
"jest": {
|
|
@@ -2,7 +2,7 @@ import { useFeatureHook } from '@ledvance/base/src/models/modules/NativePropsSli
|
|
|
2
2
|
import { Formatter } from '@tuya/tuya-panel-lamp-sdk'
|
|
3
3
|
import { DreamLightMicMusicUIState, defMusicData, dreamMusicData } from './MusicDataBean'
|
|
4
4
|
import { WorkMode } from '@ledvance/base/src/utils/interface'
|
|
5
|
-
import { MusicPageParams } from '
|
|
5
|
+
import { MusicPageParams } from './MusicPage'
|
|
6
6
|
const DreamMusicFormatter = new Formatter.DreamLightMicMusicFormatter()
|
|
7
7
|
|
|
8
8
|
interface MusicConfig {
|
|
@@ -13,7 +13,7 @@ interface MusicConfig {
|
|
|
13
13
|
phoneMusicData: any[]
|
|
14
14
|
musicType: number
|
|
15
15
|
musicSwitch: boolean
|
|
16
|
-
phoneDpData: string
|
|
16
|
+
phoneDpData: string
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const defMusicConfig: MusicConfig = {
|
|
@@ -29,7 +29,7 @@ const defMusicConfig: MusicConfig = {
|
|
|
29
29
|
|
|
30
30
|
interface LightConfig {
|
|
31
31
|
musicConfig?: MusicConfig
|
|
32
|
-
musicData: string
|
|
32
|
+
musicData: string
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export const useDreamMusicData = (musicOption: MusicPageParams) => {
|
|
@@ -48,7 +48,7 @@ export const useDreamMusicData = (musicOption: MusicPageParams) => {
|
|
|
48
48
|
dps[musicOption.workModeDp] = WorkMode.Music
|
|
49
49
|
dps[musicOption.switchLedDp] = true
|
|
50
50
|
if (musicOption.colourLedDp && musicOption.isCeilingLight){
|
|
51
|
-
dps[musicOption.colourLedDp] = true
|
|
51
|
+
dps[musicOption.colourLedDp] = true
|
|
52
52
|
}
|
|
53
53
|
}else{
|
|
54
54
|
dps[musicOption.workModeDp] = v.lastWorkMode
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
export interface Timer {
|
|
2
|
-
status: number;
|
|
3
|
-
loops: string;
|
|
4
|
-
time: string;
|
|
5
|
-
id: number;
|
|
6
|
-
isAppPush: boolean;
|
|
7
|
-
dps: string;
|
|
8
|
-
groupOrder?: number;
|
|
9
|
-
groupId?: string;
|
|
10
|
-
aliasName: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface IAddSingleTime {
|
|
14
|
-
bizId: string;
|
|
15
|
-
bizType?: string;
|
|
16
|
-
actions: any;
|
|
17
|
-
loops?: string;
|
|
18
|
-
category?: string;
|
|
19
|
-
status?: number;
|
|
20
|
-
isAppPush?: boolean;
|
|
21
|
-
aliasName?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface IQueryTimerTasks {
|
|
25
|
-
bizId: string;
|
|
26
|
-
bizType?: string;
|
|
27
|
-
category?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export type Timers = Array<{
|
|
31
|
-
/**
|
|
32
|
-
* 初始化状态,0:关闭;1:开启。
|
|
33
|
-
*/
|
|
34
|
-
status: number;
|
|
35
|
-
/**
|
|
36
|
-
* 在0000000基础上,把所选择日期对应位置的 0 改成 1,第一位表示周日。
|
|
37
|
-
*/
|
|
38
|
-
loops: string;
|
|
39
|
-
/**
|
|
40
|
-
* 定时时间。
|
|
41
|
-
*/
|
|
42
|
-
time: string;
|
|
43
|
-
/**
|
|
44
|
-
* 定时任务主键。
|
|
45
|
-
*/
|
|
46
|
-
id: number;
|
|
47
|
-
/**
|
|
48
|
-
* 是否发送执行通知。
|
|
49
|
-
*/
|
|
50
|
-
isAppPush: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* DP 值。
|
|
53
|
-
*/
|
|
54
|
-
dps: string;
|
|
55
|
-
/**
|
|
56
|
-
* 分组定时排序。
|
|
57
|
-
*/
|
|
58
|
-
groupOrder: number;
|
|
59
|
-
/**
|
|
60
|
-
* 分组定时 ID。
|
|
61
|
-
*/
|
|
62
|
-
groupId: string;
|
|
63
|
-
/**
|
|
64
|
-
* 分组定时定时备注。
|
|
65
|
-
*/
|
|
66
|
-
aliasName: string;
|
|
67
|
-
}>;
|
|
68
|
-
|
|
69
|
-
export interface IModifySingleTimer {
|
|
70
|
-
bizId: string;
|
|
71
|
-
bizType?: string;
|
|
72
|
-
id: string | number;
|
|
73
|
-
actions: any;
|
|
74
|
-
loops?: string;
|
|
75
|
-
status?: number;
|
|
76
|
-
isAppPush?: boolean;
|
|
77
|
-
aliasName?: string;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface IModDeleteTaskByIds {
|
|
81
|
-
bizId: string;
|
|
82
|
-
bizType?: string;
|
|
83
|
-
ids: string;
|
|
84
|
-
status?: number;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export enum UVCFanMode {
|
|
88
|
-
Nature = 'nature',
|
|
89
|
-
Normal = 'normal'
|
|
90
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ViewStyle, View, Text, StyleSheet } from "react-native";
|
|
3
|
-
import Card from "@ledvance/base/src/components/Card";
|
|
4
|
-
import { SwitchButton, Utils } from 'tuya-panel-kit';
|
|
5
|
-
import { convertTo12HourFormat, loopText, showDialog } from '@ledvance/base/src/utils/common';
|
|
6
|
-
import { Timer } from "./Interface";
|
|
7
|
-
import { useSystemTimeFormate } from "@ledvance/base/src/models/modules/NativePropsSlice";
|
|
8
|
-
import I18n from "@ledvance/base/src/i18n";
|
|
9
|
-
const { convertX: cx } = Utils.RatioUtils;
|
|
10
|
-
|
|
11
|
-
interface ScheduleCardProps {
|
|
12
|
-
item: Timer
|
|
13
|
-
style?: ViewStyle
|
|
14
|
-
onEnableChange: (enable: boolean) => void
|
|
15
|
-
onPress: (item: any) => void
|
|
16
|
-
onLongPress: (item: any) => void
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const ScheduleCard = (props: ScheduleCardProps) => {
|
|
20
|
-
const { item, style, onEnableChange, onPress } = props;
|
|
21
|
-
const is24HourClock = useSystemTimeFormate()
|
|
22
|
-
return (
|
|
23
|
-
<Card
|
|
24
|
-
style={styles.card}
|
|
25
|
-
containerStyle={[styles.container, style]}
|
|
26
|
-
onPress={() => {
|
|
27
|
-
onPress(item);
|
|
28
|
-
}}
|
|
29
|
-
onLongPress={() => {
|
|
30
|
-
onPress(item);
|
|
31
|
-
// onLongPress(item);
|
|
32
|
-
}}>
|
|
33
|
-
<View style={styles.infoContainer}>
|
|
34
|
-
<Text style={styles.time}>{is24HourClock ? item.time : convertTo12HourFormat(item.time)}</Text>
|
|
35
|
-
<Text style={styles.loop}>
|
|
36
|
-
{loopText(item.loops.split('').map(loop => parseInt(loop)), item.time)}
|
|
37
|
-
</Text>
|
|
38
|
-
<Text style={styles.name}>{item.aliasName}</Text>
|
|
39
|
-
{/* {showTags() && <View style={styles.typeContainer}>
|
|
40
|
-
{renderTag()}
|
|
41
|
-
</View>} */}
|
|
42
|
-
</View>
|
|
43
|
-
<View style={styles.switchContainer}>
|
|
44
|
-
<SwitchButton
|
|
45
|
-
value={!!item.status}
|
|
46
|
-
thumbStyle={{ elevation: 0 }}
|
|
47
|
-
onValueChange={() => {
|
|
48
|
-
if (!item.status) {
|
|
49
|
-
showDialog({
|
|
50
|
-
method: 'confirm',
|
|
51
|
-
title: I18n.getLang('conflict_dialog_active_item_timeschedule_titel'),
|
|
52
|
-
subTitle: I18n.getLang('group_conflict_feature'),
|
|
53
|
-
confirmText: I18n.getLang('registration_dialog_button_yes'),
|
|
54
|
-
cancelText: I18n.getLang('registration_dialog_button_no'),
|
|
55
|
-
onConfirm: (_, {close}) => {
|
|
56
|
-
onEnableChange(!item.status);
|
|
57
|
-
close()
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
} else {
|
|
61
|
-
onEnableChange(!item.status);
|
|
62
|
-
}
|
|
63
|
-
}}
|
|
64
|
-
/>
|
|
65
|
-
</View>
|
|
66
|
-
</Card>
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const styles = StyleSheet.create({
|
|
72
|
-
card: {
|
|
73
|
-
marginHorizontal: cx(24),
|
|
74
|
-
borderRadius: cx(8),
|
|
75
|
-
},
|
|
76
|
-
container: {
|
|
77
|
-
flexDirection: 'row',
|
|
78
|
-
justifyContent: 'space-between',
|
|
79
|
-
},
|
|
80
|
-
infoContainer: {
|
|
81
|
-
flex: 1,
|
|
82
|
-
marginTop: cx(16),
|
|
83
|
-
marginBottom: cx(16),
|
|
84
|
-
flexDirection: 'column',
|
|
85
|
-
marginLeft: cx(16),
|
|
86
|
-
},
|
|
87
|
-
time: {
|
|
88
|
-
marginBottom: cx(5),
|
|
89
|
-
fontSize: 16,
|
|
90
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
91
|
-
fontWeight: 'bold',
|
|
92
|
-
},
|
|
93
|
-
loop: {
|
|
94
|
-
color: '#000',
|
|
95
|
-
fontSize: cx(14),
|
|
96
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
97
|
-
marginTop: cx(8),
|
|
98
|
-
},
|
|
99
|
-
name: {
|
|
100
|
-
color: '#000',
|
|
101
|
-
fontSize: cx(14),
|
|
102
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
103
|
-
marginTop: cx(8),
|
|
104
|
-
},
|
|
105
|
-
switchContainer: {
|
|
106
|
-
marginRight: cx(16),
|
|
107
|
-
// backgroundColor: 'red',
|
|
108
|
-
marginTop: cx(16),
|
|
109
|
-
},
|
|
110
|
-
switch: {},
|
|
111
|
-
typeContainer: {
|
|
112
|
-
flexDirection: 'row',
|
|
113
|
-
marginTop: cx(8),
|
|
114
|
-
},
|
|
115
|
-
typeWrap: {
|
|
116
|
-
backgroundColor: '#E6E7E8',
|
|
117
|
-
marginRight: cx(10),
|
|
118
|
-
borderRadius: cx(10),
|
|
119
|
-
},
|
|
120
|
-
typeText: {
|
|
121
|
-
fontSize: cx(12),
|
|
122
|
-
color: '#000',
|
|
123
|
-
paddingHorizontal: cx(8),
|
|
124
|
-
paddingVertical: cx(2)
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
export default ScheduleCard
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { commonApi } from "@tuya/tuya-panel-api"
|
|
2
|
-
import { IAddSingleTime, IQueryTimerTasks, IModifySingleTimer, IModDeleteTaskByIds, UVCFanMode } from "./Interface"
|
|
3
|
-
import { flatMapDeep } from "lodash";
|
|
4
|
-
import I18n from "@ledvance/base/src/i18n";
|
|
5
|
-
|
|
6
|
-
export const addTimeSchedule = async (props: IAddSingleTime) => {
|
|
7
|
-
try {
|
|
8
|
-
const res = await commonApi.timerApi.addSingleTimer({
|
|
9
|
-
...props,
|
|
10
|
-
bizType: '1'
|
|
11
|
-
})
|
|
12
|
-
if (typeof res === 'number') {
|
|
13
|
-
return {
|
|
14
|
-
success: true
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return {
|
|
18
|
-
success: false
|
|
19
|
-
}
|
|
20
|
-
} catch (err) {
|
|
21
|
-
return {
|
|
22
|
-
success: false
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const getTimeSchedule = async (props: IQueryTimerTasks) => {
|
|
28
|
-
try {
|
|
29
|
-
const res = await commonApi.timerApi.queryTimerTasks({
|
|
30
|
-
...props,
|
|
31
|
-
bizType: '1',
|
|
32
|
-
category: 'category'
|
|
33
|
-
})
|
|
34
|
-
if (res.timers && res.timers.length) {
|
|
35
|
-
return {
|
|
36
|
-
success: true,
|
|
37
|
-
data: flatMapDeep(res.timers)
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
success: false
|
|
42
|
-
}
|
|
43
|
-
} catch (err) {
|
|
44
|
-
return {
|
|
45
|
-
success: false
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export const modifyTimeSchedule = async (props: IModifySingleTimer) => {
|
|
51
|
-
try {
|
|
52
|
-
const status = await commonApi.timerApi.modifySingleTimer({
|
|
53
|
-
...props,
|
|
54
|
-
bizType: '1',
|
|
55
|
-
})
|
|
56
|
-
return {
|
|
57
|
-
success: status
|
|
58
|
-
}
|
|
59
|
-
} catch (err) {
|
|
60
|
-
return {
|
|
61
|
-
success: false
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export const modDelTimeSchedule = async (props: IModDeleteTaskByIds) => {
|
|
67
|
-
try {
|
|
68
|
-
const status = await commonApi.timerApi.modDeleteTaskByIds({
|
|
69
|
-
...props,
|
|
70
|
-
bizType: '1',
|
|
71
|
-
status: props.status ?? 2
|
|
72
|
-
})
|
|
73
|
-
return {
|
|
74
|
-
success: status
|
|
75
|
-
}
|
|
76
|
-
} catch (err) {
|
|
77
|
-
return {
|
|
78
|
-
success: false
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export const fanModeOption = [
|
|
84
|
-
{
|
|
85
|
-
label: I18n.getLang('ceiling_fan_mode_info_option_1_headline'),
|
|
86
|
-
value: UVCFanMode.Normal,
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
label: I18n.getLang('ceiling_fan_mode_info_option_2_headline'),
|
|
90
|
-
value: UVCFanMode.Nature,
|
|
91
|
-
},
|
|
92
|
-
]
|
|
93
|
-
|
|
94
|
-
export const actionOption = {
|
|
95
|
-
switchLed: I18n.getLang('light_sources_tile_tw_lighting_headline'),
|
|
96
|
-
switchSocket: I18n.getLang('feature_summary_action_component_5'),
|
|
97
|
-
switchSocket1: I18n.getLang('feature_summary_action_component_6'),
|
|
98
|
-
switchSocket2: I18n.getLang('feature_summary_action_component_7'),
|
|
99
|
-
switchSocket3: I18n.getLang('feature_summary_action_component_8'),
|
|
100
|
-
switchSocket4: I18n.getLang('feature_summary_action_component_9'),
|
|
101
|
-
switchFan: I18n.getLang('add_new_dynamic_mood_ceiling_fan_field_headline'),
|
|
102
|
-
}
|