@ledvance/group-ui-biz-bundle 1.0.12 → 1.0.13
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
CHANGED
|
@@ -2,9 +2,10 @@ import React from "react";
|
|
|
2
2
|
import { ViewStyle, View, Text, StyleSheet } from "react-native";
|
|
3
3
|
import Card from "@ledvance/base/src/components/Card";
|
|
4
4
|
import { SwitchButton, Utils } from 'tuya-panel-kit';
|
|
5
|
-
import { convertTo12HourFormat, loopText } from '@ledvance/base/src/utils/common';
|
|
5
|
+
import { convertTo12HourFormat, loopText, showDialog } from '@ledvance/base/src/utils/common';
|
|
6
6
|
import { Timer } from "./Interface";
|
|
7
7
|
import { useSystemTimeFormate } from "@ledvance/base/src/models/modules/NativePropsSlice";
|
|
8
|
+
import I18n from "@ledvance/base/src/i18n";
|
|
8
9
|
const { convertX: cx } = Utils.RatioUtils;
|
|
9
10
|
|
|
10
11
|
interface ScheduleCardProps {
|
|
@@ -44,7 +45,21 @@ const ScheduleCard = (props: ScheduleCardProps) => {
|
|
|
44
45
|
value={!!item.status}
|
|
45
46
|
thumbStyle={{ elevation: 0 }}
|
|
46
47
|
onValueChange={() => {
|
|
47
|
-
|
|
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
|
+
}
|
|
48
63
|
}}
|
|
49
64
|
/>
|
|
50
65
|
</View>
|
|
@@ -110,4 +125,4 @@ const styles = StyleSheet.create({
|
|
|
110
125
|
}
|
|
111
126
|
});
|
|
112
127
|
|
|
113
|
-
export default ScheduleCard
|
|
128
|
+
export default ScheduleCard
|
|
@@ -420,18 +420,28 @@ const TimeScheduleDetailPage = () => {
|
|
|
420
420
|
rightButtonIcon={allowSubmit ? res.ic_check : res.ic_uncheck}
|
|
421
421
|
rightButtonIconClick={async () => {
|
|
422
422
|
if (!allowSubmit || state.loading) return
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
423
|
+
showDialog({
|
|
424
|
+
method: 'confirm',
|
|
425
|
+
title: I18n.getLang('conflict_dialog_active_item_timeschedule_titel'),
|
|
426
|
+
subTitle: I18n.getLang('group_conflict_feature'),
|
|
427
|
+
confirmText: I18n.getLang('registration_dialog_button_yes'),
|
|
428
|
+
cancelText: I18n.getLang('registration_dialog_button_no'),
|
|
429
|
+
onConfirm: async (_, { close }) => {
|
|
430
|
+
state.loading = true
|
|
431
|
+
const res = await props.modDeleteTimeSchedule(props.mode, {
|
|
432
|
+
...state.timeSchedule,
|
|
433
|
+
status: 1,
|
|
434
|
+
dps: getActions()
|
|
435
|
+
}, '')
|
|
436
|
+
console.log(res, '< ---- resss')
|
|
437
|
+
state.loading = false
|
|
438
|
+
if (res.success) {
|
|
439
|
+
close()
|
|
440
|
+
props.refreshFn()
|
|
441
|
+
navigation.goBack()
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
})
|
|
435
445
|
}}
|
|
436
446
|
backDialogTitle={I18n.getLang('cancel_dialog_leave_unsaved_titel')}
|
|
437
447
|
backDialogContent={I18n.getLang('cancel_dialog_leave_unsaved_timeschedule_note')}
|