Prechádzať zdrojové kódy

酒店后台API重构之后的一些改动

liukai 1 mesiac pred
rodič
commit
df32f36ba9

+ 4 - 2
packages/cpt_auth/lib/modules/select_country/select_country_controller.dart

@@ -4,6 +4,7 @@ import 'package:plugin_basic/constants/app_constant.dart';
 import 'package:plugin_basic/service/app_config_service.dart';
 import 'package:plugin_basic/service/http_provider_injection.dart';
 import 'package:plugin_platform/engine/sp/sp_util.dart';
+import 'package:shared/utils/log_utils.dart';
 
 class SelectCountryController extends GetxController {
   //设置下一步
@@ -11,18 +12,19 @@ class SelectCountryController extends GetxController {
     int country = ConfigService.to.selectCountry.value;
     SPUtil.putInt(AppConstant.storageSelectedCountry, country);
 
+
     String baseUrl;
     if (country == 1) {
       //新加坡
       baseUrl = ApiConstants.sgBaseUrl;
-    }
-    if (country == 2) {
+    } else if (country == 2) {
       //韩国
       baseUrl = ApiConstants.koreaBaseUrl;
     } else {
       baseUrl = ApiConstants.baseUrl;
     }
 
+    Log.d("当前选择的国家:$country 当前要切换的域名为:$baseUrl");
     HttpProviderInjection.switchBaseUrl(baseUrl);
 
     Get.back();

+ 29 - 29
packages/cpt_auth/lib/modules/select_country/select_country_page.dart

@@ -155,35 +155,35 @@ class SelectCountryPage extends BaseStatelessPage<SelectCountryController> {
                       }),
 
                       //韩国的选项
-                      Container(
-                        width: double.infinity,
-                        margin: const EdgeInsets.only(top: 13.5, left: 20, right: 20),
-                        padding: const EdgeInsets.symmetric(vertical: 13, horizontal: 17),
-                        decoration: BoxDecoration(
-                          color: const Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
-                          borderRadius: BorderRadius.circular(5.0), // 设置圆角
-                        ),
-                        child: Row(
-                          children: [
-                            const MyAssetImage(Assets.cptAuthKoreaIcon, width: 50, height: 33),
-                            MyTextView(
-                              "Korea".tr,
-                              marginLeft: 17,
-                              textColor: ColorConstants.white,
-                              isFontMedium: true,
-                              fontSize: 18,
-                            ).expanded(),
-                            Obx(() {
-                              return Visibility(
-                                visible: ConfigService.to.selectCountry.value == 2,
-                                child: const MyAssetImage(Assets.cptAuthCheckedIcon, width: 22, height: 22),
-                              );
-                            }),
-                          ],
-                        ),
-                      ).onTap(() {
-                        ConfigService.to.selectCountry.value = 2;
-                      }),
+                      // Container(
+                      //   width: double.infinity,
+                      //   margin: const EdgeInsets.only(top: 13.5, left: 20, right: 20),
+                      //   padding: const EdgeInsets.symmetric(vertical: 13, horizontal: 17),
+                      //   decoration: BoxDecoration(
+                      //     color: const Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
+                      //     borderRadius: BorderRadius.circular(5.0), // 设置圆角
+                      //   ),
+                      //   child: Row(
+                      //     children: [
+                      //       const MyAssetImage(Assets.cptAuthKoreaIcon, width: 50, height: 33),
+                      //       MyTextView(
+                      //         "Korea".tr,
+                      //         marginLeft: 17,
+                      //         textColor: ColorConstants.white,
+                      //         isFontMedium: true,
+                      //         fontSize: 18,
+                      //       ).expanded(),
+                      //       Obx(() {
+                      //         return Visibility(
+                      //           visible: ConfigService.to.selectCountry.value == 2,
+                      //           child: const MyAssetImage(Assets.cptAuthCheckedIcon, width: 22, height: 22),
+                      //         );
+                      //       }),
+                      //     ],
+                      //   ),
+                      // ).onTap(() {
+                      //   ConfigService.to.selectCountry.value = 2;
+                      // }),
 
                       //Next按钮
                       Stack(

+ 1 - 0
packages/cpt_job_sg/lib/modules/job_applied/job_applied_controller.dart

@@ -330,6 +330,7 @@ class JobAppliedController extends GetxController with DioCancelableMixin {
   void _requestBatchModify(DateTime? start, DateTime? end, String? hour, String? status, String separatedIds) async {
     //执行请求
     var result = await _jobRepository.batchEditJobApplied(
+      state.jobId,
       separatedIds,
       start == null ? "" : DateTimeUtils.formatDate(start, format: "HH:mm:ss"),
       end == null ? "" : DateTimeUtils.formatDate(end, format: "HH:mm:ss"),

+ 9 - 3
packages/cpt_labour/lib/modules/labour_template_add/labour_template_add_controller.dart

@@ -40,17 +40,23 @@ class LabourTemplateAddController extends GetxController with DioCancelableMixin
       noteController.text = state.indexEntity?.note ?? "";
 
       //默认赋值
-      state.optionLanguageList.value = state.indexEntity?.languageList.map((e) => e.txt!).toList() ?? [];
+      state.optionLanguageList = state.indexEntity?.languageList.map((e) => e.txt!).toList() ?? [];
       Log.d("当前语言的选项为:${state.optionLanguageList}");
 
       state.selectedAgeList = state.indexEntity?.ageList.where((e) => e.checked == "checked").map((e) => e.value!).toList() ?? [];
       Log.d("当前选中的年龄:${state.selectedAgeList}");
       state.selectedLanguageList = state.indexEntity?.languageList.where((e) => e.checked == "checked").map((e) => e.value!).toList() ?? [];
       Log.d("当前选中的语言:${state.selectedLanguageList}");
-      state.gender = state.indexEntity?.sexList.firstWhere((e) => e.checked == "checked").value;
+
+      if (state.indexEntity?.sexList != null) {
+        state.gender = state.indexEntity!.sexList.firstWhere((e) => e.checked == "checked", orElse: () => JobTemplateEditIndexSexList(),).value;
+      } else {
+        state.gender = null;
+      }
       Log.d("当前选中的性别:${state.gender}");
 
-      update();
+      //刷新
+      update(["language","all"]);
 
     } else {
       ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);

+ 240 - 230
packages/cpt_labour/lib/modules/labour_template_add/labour_template_add_page.dart

@@ -1,6 +1,8 @@
 import 'package:cs_resources/constants/color_constants.dart';
 import 'package:flutter/material.dart';
 import 'package:get/get.dart';
+import 'package:plugin_basic/base/base_state.dart';
+import 'package:plugin_basic/base/base_stateful_page.dart';
 import 'package:shared/utils/screen_util.dart';
 import 'package:shared/utils/util.dart';
 import 'package:widgets/ext/ex_widget.dart';
@@ -16,7 +18,6 @@ import 'package:widgets/widget_export.dart';
 
 import 'labour_template_add_controller.dart';
 
-import 'package:plugin_basic/base/base_stateless_page.dart';
 import 'package:plugin_basic/utils/ext_get_nav.dart';
 import 'package:router/path/router_path.dart';
 
@@ -25,7 +26,7 @@ import 'labour_template_add_state.dart';
 /*
  * 模板的添加与编辑
  */
-class LabourTemplateAddPage extends BaseStatelessPage<LabourTemplateAddController> {
+class LabourTemplateAddPage extends BaseStatefulPage<LabourTemplateAddController> {
   LabourTemplateAddPage({Key? key}) : super(key: key);
 
   //启动当前页面
@@ -36,282 +37,291 @@ class LabourTemplateAddPage extends BaseStatelessPage<LabourTemplateAddControlle
     return Get.start(RouterPath.labourTemplateAdd, arguments: {'templateId': templateId, 'cb': cb});
   }
 
+  @override
+  LabourTemplateAddController createRawController() {
+    return LabourTemplateAddController();
+  }
+
+  @override
+  State<LabourTemplateAddPage> createState() => _LabourTemplateAddState();
+}
+
+class _LabourTemplateAddState extends BaseState<LabourTemplateAddPage, LabourTemplateAddController> {
   late LabourTemplateAddState state;
 
   @override
   void initState() {
+    super.initState();
     state = controller.state;
     state.templateId = Get.arguments['templateId'];
     state.cb = Get.arguments['cb'] as void Function(dynamic)?;
   }
 
   @override
-  LabourTemplateAddController createRawController() {
-    return LabourTemplateAddController();
-  }
+  Widget build(BuildContext context) {
+    return autoCtlGetBuilder(
+        id: "all",
+        builder: (controller) {
+          return Scaffold(
+            extendBodyBehindAppBar: true,
+            appBar: MyAppBar.appBar(context, Utils.isEmpty(state.templateId) ? "Create Template".tr : "Edit Template".tr),
+            body: SafeArea(
+              bottom: true,
+              top: false,
+              child: Container(
+                width: double.infinity,
+                height: double.infinity,
+                padding: EdgeInsets.only(top: kToolbarHeight + ScreenUtil.getStatusBarH(context) + 1),
+                decoration: const BoxDecoration(
+                  gradient: LinearGradient(
+                    colors: [
+                      Color(0xFF091D44),
+                      Color(0xFF245A8A),
+                      Color(0xFF7F7CEC),
+                    ],
+                    begin: Alignment.topCenter,
+                    end: Alignment.bottomCenter,
+                  ),
+                ),
+                child: Scrollbar(
+                  child: ScrollConfiguration(
+                    behavior: NoShadowScrollBehavior(),
+                    child: SingleChildScrollView(
+                      scrollDirection: Axis.vertical,
+                      physics: const BouncingScrollPhysics(),
+                      child: Column(
+                        crossAxisAlignment: CrossAxisAlignment.start,
+                        children: [
+                          //模板名称
+                          FormRequireText(text: "Template Name".tr).marginOnly(left: 15, top: 19),
 
-  @override
-  Widget buildWidget(BuildContext context) {
-    return autoCtlGetBuilder(builder: (controller) {
-      return Scaffold(
-        extendBodyBehindAppBar: true,
-        appBar: MyAppBar.appBar(context, Utils.isEmpty(state.templateId) ? "Create Template".tr : "Edit Template".tr),
-        body: SafeArea(
-          bottom: true,
-          top: false,
-          child: Container(
-            width: double.infinity,
-            height: double.infinity,
-            padding: EdgeInsets.only(top: kToolbarHeight + ScreenUtil.getStatusBarH(context) + 1),
-            decoration: const BoxDecoration(
-              gradient: LinearGradient(
-                colors: [
-                  Color(0xFF091D44),
-                  Color(0xFF245A8A),
-                  Color(0xFF7F7CEC),
-                ],
-                begin: Alignment.topCenter,
-                end: Alignment.bottomCenter,
-              ),
-            ),
-            child: Scrollbar(
-              child: ScrollConfiguration(
-                behavior: NoShadowScrollBehavior(),
-                child: SingleChildScrollView(
-                  scrollDirection: Axis.vertical,
-                  physics: const BouncingScrollPhysics(),
-                  child: Obx(() {
+                          CustomTextField(
+                            formKey: "template_name",
+                            formData: state.formData,
+                            height: 46,
+                            fontSize: 14,
+                            onSubmit: (key, value) {
+                              state.formData[key]!['focusNode'].unfocus();
+                              FocusScope.of(context).requestFocus(state.formData['desc']!['focusNode']);
+                            },
+                            marginTop: 10,
+                          ),
 
-                    return Column(
-                      crossAxisAlignment: CrossAxisAlignment.start,
-                      children: [
-                        //模板名称
-                        FormRequireText(text: "Template Name".tr).marginOnly(left: 15, top: 19),
+                          //年龄
+                          Visibility(
+                            visible: state.indexEntity?.ageList.isNotEmpty == true,
+                            child: MyTextView(
+                              "Age".tr,
+                              textColor: Colors.white,
+                              fontSize: 14,
+                              isFontRegular: true,
+                              marginLeft: 15,
+                              marginTop: 15,
+                            ),
+                          ),
 
-                        CustomTextField(
-                          formKey: "template_name",
-                          formData: state.formData,
-                          height: 46,
-                          fontSize: 14,
-                          onSubmit: (key, value) {
-                            state.formData[key]!['focusNode'].unfocus();
-                            FocusScope.of(context).requestFocus(state.formData['desc']!['focusNode']);
-                          },
-                          marginTop: 10,
-                        ),
+                          // 年龄的多选
+                          Visibility(
+                            visible: state.indexEntity?.ageList.isNotEmpty == true,
+                            child: CustomCheckBox(
+                              options: state.indexEntity?.ageList.map((e) => e.txt!).toList() ?? [],
+                              onOptionsSelected: (selected) {
+                                // 转换选中的索引为对应的 value
+                                state.selectedAgeList = selected
+                                    .map((index) {
+                                      return state.indexEntity?.ageList[index].value; // 获取对应的 value
+                                    })
+                                    .whereType<String>()
+                                    .toList();
+                              },
+                              selectedOptions: state.indexEntity?.ageList.where((e) => e.checked == "checked").map((e) => e.txt!).toList() ?? [],
+                            ).marginOnly(left: 15, right: 15, top: 10),
+                          ),
+
+                          //性别
+                          Visibility(
+                            visible: state.indexEntity?.sexList.isNotEmpty == true,
+                            child: MyTextView(
+                              "Gender".tr,
+                              textColor: Colors.white,
+                              fontSize: 14,
+                              isFontRegular: true,
+                              marginLeft: 15,
+                              marginTop: 15,
+                            ),
+                          ),
 
-                        //年龄
-                        Visibility(
-                          visible: state.indexEntity?.ageList.isNotEmpty == true,
-                          child: MyTextView(
-                            "Age".tr,
+                          //性别单选
+                          Visibility(
+                            visible: state.indexEntity?.sexList.isNotEmpty == true,
+                            child: CustomRadioCheck(
+                              options: state.indexEntity?.sexList.map((e) => e.txt!).toList() ?? [],
+                              onOptionSelected: (index, text) {
+                                state.gender = state.indexEntity!.sexList[index].value;
+                              },
+                              selectedPosition: state.indexEntity?.sexList.indexWhere((e) => e.checked == "checked") ?? -1,
+                            ).marginOnly(left: 15, right: 15, top: 10),
+                          ),
+
+                          //语言
+                          MyTextView(
+                            "Language".tr,
                             textColor: Colors.white,
                             fontSize: 14,
                             isFontRegular: true,
                             marginLeft: 15,
                             marginTop: 15,
                           ),
-                        ),
 
-                        // 年龄的多选
-                        Visibility(
-                          visible: state.indexEntity?.ageList.isNotEmpty == true,
-                          child: CustomCheckBox(
-                            options: state.indexEntity?.ageList.map((e) => e.txt!).toList() ?? [],
-                            onOptionsSelected: (selected) {
-                              // 转换选中的索引为对应的 value
-                              state.selectedAgeList = selected
-                                  .map((index) {
-                                    return state.indexEntity?.ageList[index].value; // 获取对应的 value
-                                  })
-                                  .whereType<String>()
-                                  .toList();
+                          // 语言的多选
+                          GetBuilder<LabourTemplateAddController>(
+                            builder: (controller) {
+                              return CustomCheckBox(
+                                options: state.optionLanguageList,
+                                onOptionsSelected: (selected) {
+                                  // 转换选中的索引为对应的 value
+                                  state.selectedLanguageList = selected
+                                      .map((index) {
+                                        return state.indexEntity?.languageList[index].value; // 获取对应的 value
+                                      })
+                                      .whereType<String>()
+                                      .toList();
+                                },
+                                selectedOptions: state.indexEntity?.languageList.where((e) => e.checked == "checked").map((e) => e.txt!).toList() ?? [],
+                              );
                             },
-                            selectedOptions: state.indexEntity?.ageList.where((e) => e.checked == "checked").map((e) => e.txt!).toList() ?? [],
+                            id: "language",
+                            init: controller,
                           ).marginOnly(left: 15, right: 15, top: 10),
-                        ),
 
-                        //性别
-                        Visibility(
-                          visible: state.indexEntity?.sexList.isNotEmpty == true,
-                          child: MyTextView(
-                            "Gender".tr,
+                          //模板详情
+                          MyTextView(
+                            "Description".tr,
                             textColor: Colors.white,
                             fontSize: 14,
                             isFontRegular: true,
                             marginLeft: 15,
                             marginTop: 15,
                           ),
-                        ),
-
-                        //性别单选
-                        Visibility(
-                          visible: state.indexEntity?.sexList.isNotEmpty == true,
-                          child: CustomRadioCheck(
-                            options: state.indexEntity?.sexList.map((e) => e.txt!).toList() ?? [],
-                            onOptionSelected: (index, text) {
-                              state.gender = state.indexEntity!.sexList[index].value;
-                            },
-                            selectedPosition: state.indexEntity?.sexList.indexWhere((e) => e.checked == "checked") ?? -1,
-                          ).marginOnly(left: 15, right: 15, top: 10),
-                        ),
-
-                        //语言
-                        MyTextView(
-                          "Language".tr,
-                          textColor: Colors.white,
-                          fontSize: 14,
-                          isFontRegular: true,
-                          marginLeft: 15,
-                          marginTop: 15,
-                        ),
-
-                        // 语言的多选 (使用 Obx 刷新)
-                        CustomCheckBox(
-                          options: state.optionLanguageList.value,
-                          onOptionsSelected: (selected) {
-                            // 转换选中的索引为对应的 value
-                            state.selectedLanguageList = selected
-                                .map((index) {
-                                  return state.indexEntity?.languageList[index].value; // 获取对应的 value
-                                })
-                                .whereType<String>()
-                                .toList();
-                          },
-                          selectedOptions: state.indexEntity?.languageList.where((e) => e.checked == "checked").map((e) => e.txt!).toList() ?? [],
-                        ).marginOnly(left: 15, right: 15, top: 10),
 
-                        //模板详情
-                        MyTextView(
-                          "Description".tr,
-                          textColor: Colors.white,
-                          fontSize: 14,
-                          isFontRegular: true,
-                          marginLeft: 15,
-                          marginTop: 15,
-                        ),
-
-                        IgnoreKeyboardDismiss(
-                          child: Container(
-                            height: 130,
-                            margin: const EdgeInsets.only(left: 15, right: 15, top: 10),
-                            padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15),
-                            decoration: BoxDecoration(
-                              color: const Color(0xFF4DCFF6).withOpacity(0.2),
-                              borderRadius: const BorderRadius.all(Radius.circular(5)),
-                            ),
-                            child: TextField(
-                              cursorColor: ColorConstants.white,
-                              cursorWidth: 1.5,
-                              autofocus: false,
-                              enabled: true,
-                              focusNode: state.formData["desc"]!['focusNode'],
-                              controller: state.formData["desc"]!['controller'],
-                              // 装饰
-                              decoration: InputDecoration(
-                                isDense: true,
-                                isCollapsed: true,
-                                border: InputBorder.none,
-                                hintText: state.formData["desc"]!['hintText'],
-                                hintStyle: const TextStyle(
-                                  color: ColorConstants.textGrayAECAE5,
+                          IgnoreKeyboardDismiss(
+                            child: Container(
+                              height: 130,
+                              margin: const EdgeInsets.only(left: 15, right: 15, top: 10),
+                              padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15),
+                              decoration: BoxDecoration(
+                                color: const Color(0xFF4DCFF6).withOpacity(0.2),
+                                borderRadius: const BorderRadius.all(Radius.circular(5)),
+                              ),
+                              child: TextField(
+                                cursorColor: ColorConstants.white,
+                                cursorWidth: 1.5,
+                                autofocus: false,
+                                enabled: true,
+                                focusNode: state.formData["desc"]!['focusNode'],
+                                controller: state.formData["desc"]!['controller'],
+                                // 装饰
+                                decoration: InputDecoration(
+                                  isDense: true,
+                                  isCollapsed: true,
+                                  border: InputBorder.none,
+                                  hintText: state.formData["desc"]!['hintText'],
+                                  hintStyle: const TextStyle(
+                                    color: ColorConstants.textGrayAECAE5,
+                                    fontSize: 15.0,
+                                    fontWeight: FontWeight.w400,
+                                  ),
+                                ),
+                                style: const TextStyle(
+                                  color: ColorConstants.white,
                                   fontSize: 15.0,
                                   fontWeight: FontWeight.w400,
                                 ),
+                                // 键盘动作右下角图标
+                                textInputAction: TextInputAction.next,
+                                onSubmitted: (value) {
+                                  state.formData['desc']!['focusNode'].unfocus();
+                                  FocusScope.of(context).requestFocus(state.formData['note']!['focusNode']);
+                                },
                               ),
-                              style: const TextStyle(
-                                color: ColorConstants.white,
-                                fontSize: 15.0,
-                                fontWeight: FontWeight.w400,
-                              ),
-                              // 键盘动作右下角图标
-                              textInputAction: TextInputAction.next,
-                              onSubmitted: (value) {
-                                state.formData[key]!['focusNode'].unfocus();
-                                FocusScope.of(context).requestFocus(state.formData['contact']!['focusNode']);
-                              },
                             ),
                           ),
-                        ),
 
-                        //备注
-                        MyTextView(
-                          "Note".tr,
-                          textColor: Colors.white,
-                          fontSize: 14,
-                          isFontRegular: true,
-                          marginLeft: 15,
-                          marginTop: 18,
-                        ),
+                          //备注
+                          MyTextView(
+                            "Note".tr,
+                            textColor: Colors.white,
+                            fontSize: 14,
+                            isFontRegular: true,
+                            marginLeft: 15,
+                            marginTop: 18,
+                          ),
 
-                        IgnoreKeyboardDismiss(
-                          child: Container(
-                            height: 130,
-                            margin: const EdgeInsets.only(left: 15, right: 15, top: 10),
-                            padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15),
-                            decoration: BoxDecoration(
-                              color: const Color(0xFF4DCFF6).withOpacity(0.2),
-                              borderRadius: const BorderRadius.all(Radius.circular(5)),
-                            ),
-                            child: TextField(
-                              cursorColor: ColorConstants.white,
-                              cursorWidth: 1.5,
-                              autofocus: false,
-                              enabled: true,
-                              focusNode: state.formData["note"]!['focusNode'],
-                              controller: state.formData["note"]!['controller'],
-                              // 装饰
-                              decoration: InputDecoration(
-                                isDense: true,
-                                isCollapsed: true,
-                                border: InputBorder.none,
-                                hintText: state.formData["note"]!['hintText'],
-                                hintStyle: const TextStyle(
-                                  color: ColorConstants.textGrayAECAE5,
+                          IgnoreKeyboardDismiss(
+                            child: Container(
+                              height: 130,
+                              margin: const EdgeInsets.only(left: 15, right: 15, top: 10),
+                              padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15),
+                              decoration: BoxDecoration(
+                                color: const Color(0xFF4DCFF6).withOpacity(0.2),
+                                borderRadius: const BorderRadius.all(Radius.circular(5)),
+                              ),
+                              child: TextField(
+                                cursorColor: ColorConstants.white,
+                                cursorWidth: 1.5,
+                                autofocus: false,
+                                enabled: true,
+                                focusNode: state.formData["note"]!['focusNode'],
+                                controller: state.formData["note"]!['controller'],
+                                // 装饰
+                                decoration: InputDecoration(
+                                  isDense: true,
+                                  isCollapsed: true,
+                                  border: InputBorder.none,
+                                  hintText: state.formData["note"]!['hintText'],
+                                  hintStyle: const TextStyle(
+                                    color: ColorConstants.textGrayAECAE5,
+                                    fontSize: 14.0,
+                                    fontWeight: FontWeight.w400,
+                                  ),
+                                ),
+                                style: const TextStyle(
+                                  color: ColorConstants.white,
                                   fontSize: 14.0,
                                   fontWeight: FontWeight.w400,
                                 ),
+                                // 键盘动作右下角图标
+                                textInputAction: TextInputAction.next,
+                                onSubmitted: (value) {
+                                  state.formData['note']!['focusNode'].unfocus();
+                                },
                               ),
-                              style: const TextStyle(
-                                color: ColorConstants.white,
-                                fontSize: 14.0,
-                                fontWeight: FontWeight.w400,
-                              ),
-                              // 键盘动作右下角图标
-                              textInputAction: TextInputAction.next,
-                              onSubmitted: (value) {
-                                state.formData[key]!['focusNode'].unfocus();
-                                FocusScope.of(context).requestFocus(state.formData['contact']!['focusNode']);
-                              },
                             ),
                           ),
-                        ),
-
-                        //提交按钮
-                        MyButton(
-                          type: ClickType.throttle,
-                          milliseconds: 500,
-                          onPressed: () {
-                            FocusScope.of(context).unfocus();
-                            controller.doSubmit();
-                          },
-                          text: "Submit".tr,
-                          textColor: ColorConstants.white,
-                          fontSize: 16,
-                          radius: 20,
-                          backgroundColor: ColorConstants.textYellowFFBB1B,
-                          fontWeight: FontWeight.w500,
-                        ).marginSymmetric(vertical: 25, horizontal: 15),
-                      ],
-                    );
-                  }),
 
+                          //提交按钮
+                          MyButton(
+                            type: ClickType.throttle,
+                            milliseconds: 500,
+                            onPressed: () {
+                              FocusScope.of(context).unfocus();
+                              controller.doSubmit();
+                            },
+                            text: "Submit".tr,
+                            textColor: ColorConstants.white,
+                            fontSize: 16,
+                            radius: 20,
+                            backgroundColor: ColorConstants.textYellowFFBB1B,
+                            fontWeight: FontWeight.w500,
+                          ).marginSymmetric(vertical: 25, horizontal: 15),
+                        ],
+                      ),
+                    ),
+                  ),
                 ),
               ),
             ),
-          ),
-        ),
-      );
-    });
+          );
+        });
   }
 }

+ 1 - 1
packages/cpt_labour/lib/modules/labour_template_add/labour_template_add_state.dart

@@ -41,5 +41,5 @@ class LabourTemplateAddState {
   List<String> selectedLanguageList = [];   //选中的 language 的 id
   String? gender;
 
-  RxList<String> optionLanguageList = <String>[].obs;  // language 的选项字符串
+  List<String> optionLanguageList =[];  // language 的选项字符串
 }

+ 5 - 4
packages/cs_domain/lib/repository/job_sg_repository.dart

@@ -207,6 +207,7 @@ class JobSGRepository extends GetxService {
 
   /// 批量修改员工信息或考勤
   Future<HttpResult> batchEditJobApplied(
+    String? jobId,
     String? appliedIds,
     String? startTime,
     String? endTime,
@@ -217,6 +218,7 @@ class JobSGRepository extends GetxService {
     //参数
     Map<String, String> params = {};
     params['applied_ids'] = appliedIds ?? "";
+    params['job_id'] = jobId ?? "";
 
     if (!Utils.isEmpty(startTime)) {
       params['start_time'] = startTime ?? "";
@@ -605,9 +607,9 @@ class JobSGRepository extends GetxService {
 
   /// 根据ID获取主列表的Item数据,用于刷新Item
   Future<HttpResult<ReviseListSGEntity>> fetchReviseListByIds(
-      String? reviseId, {
-        CancelToken? cancelToken,
-      }) async {
+    String? reviseId, {
+    CancelToken? cancelToken,
+  }) async {
     //参数
     Map<String, String> params = {};
     params["cur_page"] = "1";
@@ -834,5 +836,4 @@ class JobSGRepository extends GetxService {
     }
     return result.convert();
   }
-
 }

+ 1 - 2
packages/cs_plugin_basic/lib/service/http_provider_injection.dart

@@ -16,7 +16,7 @@ class HttpProviderInjection {
     if (country == 1) {
       //新加坡
       baseUrl = ApiConstants.sgBaseUrl;
-    }if (country == 2) {
+    } else if (country == 2) {
       //韩国
       baseUrl = ApiConstants.koreaBaseUrl;
     } else {
@@ -38,6 +38,5 @@ class HttpProviderInjection {
     //找到单例对象 HttpProvider,切换域名
     HttpProvider httpProvider = Get.find();
     httpProvider.switchBaseUrl(baseUrl);
-
   }
 }

+ 258 - 0
packages/cs_resources/lib/local/language/ko_KR.dart

@@ -0,0 +1,258 @@
+const Map<String, String> ko_KR = {
+  'YY Employer': 'YY Employer',
+  'Please enter your password': 'Please enter your password',
+  'The login code cannot be empty!': 'The login code cannot be empty!',
+  'The password cannot be empty!': 'The password cannot be empty!',
+  'The new password cannot be empty!': 'The new password cannot be empty!',
+  'Log in': 'Log in',
+  'Password': 'Password',
+  'Email': 'Email',
+  'Name/Mobile': 'Name/Mobile',
+  'Check In': 'Check In',
+  'Check Out': 'Check Out',
+  'Job Date': 'Job Date',
+  'Start Time:': 'Start Time:',
+  'End Time:': 'End Time:',
+  'Start Time': 'Start Time',
+  'End Time': 'End Time',
+  'Name:': 'Name:',
+  'Reset': 'Reset',
+  'Start Date': 'Start Date',
+  'End Date': 'End Date',
+  'Cancel': 'Cancel',
+  'Confirm': 'Confirm',
+  'Sign Here': 'Sign Here',
+  'Clean': 'Clean',
+  'Vietnam': 'Vietnam',
+  'Sign in/Sign out': 'Sign in/Sign out',
+  'Admin': 'Admin',
+  'Don’t have an account?': 'Don’t have an account?',
+  'Sign up': 'Sign up',
+  'Confirm Password': 'Confirm Password',
+  'Please enter your email': 'Please enter your email',
+  'Please enter confirm password': 'Please enter confirm password',
+  'Submit': 'Submit',
+  'The email cannot be empty!': 'The email cannot be empty!',
+  'The confirm password cannot be empty!': 'The confirm password cannot be empty!',
+  'Please confirm your confirmed password!': 'Please confirm your confirmed password!',
+  'Reset Password': 'Reset Password',
+  'New Password': 'New Password',
+  'Please enter your new password': 'Please enter your new password',
+  'Labour Request': 'Labour Request',
+  'Job List': 'Job List',
+  'Sign in Sign out': 'Sign in Sign out',
+  'Devices': 'Devices',
+  'Labour Request Review': 'Labour Request Review',
+  'Attendance Review': 'Attendance Review',
+  'Default Job Title': 'Default Job Title',
+  'Report': 'Report',
+  'Confirmation': 'Confirmation',
+  'Notice': 'Notice',
+  'Are you sure you need to exit the system?': 'Are you sure you need to exit the system?',
+  'Are you sure you want to deactivate your account? You will not be able to login into the app once you proceed with the request.':
+      'Are you sure you want to deactivate your account? You will not be able to login into the app once you proceed with the request.',
+  'Welcome': 'Welcome',
+  'Switch Projects': 'Switch Projects',
+  'Account Deactivation': 'Account Deactivation',
+  'Logout': 'Logout',
+  'Old Password': 'Old Password',
+  'Settings': 'Settings',
+  'Title': 'Title',
+  'Create New Job Request': 'Create New Job Request',
+  'Outlet': 'Outlet',
+  'Status': 'Status',
+  'Filter': 'Filter',
+  'Edit': 'Edit',
+  'Recall': 'Recall',
+  'Detail': 'Detail',
+  'Outlet:': 'Outlet:',
+  'DateTime:': 'DateTime:',
+  'No. of Staff:': 'No. of Staff:',
+  'Status:': 'Status:',
+  'Publish Status:': 'Publish Status:',
+  'Created At:': 'Created At:',
+  'Published': 'Published',
+  'Unpublished': 'Unpublished',
+  'Choose Outlet': 'Choose Outlet',
+  'Choose Status': 'Choose Status',
+  'Choose Job Title': 'Choose Job Title',
+  'Job Title': 'Job Title',
+  'Job Start Time': 'Job Start Time',
+  'Job End Time': 'Job End Time',
+  'No. of Staff': 'No. of Staff',
+  'Enter No. of Staff': 'Enter No. of Staff',
+  'Choose Start Date': 'Choose Start Date',
+  'Choose End Date': 'Choose End Date',
+  'Add Labour Requisition': 'Add Labour Requisition',
+  'Edit Labour Requisition': 'Edit Labour Requisition',
+  'Labour Requisition': 'Labour Requisition',
+  'Message': 'Message',
+  'Are you sure you want to recall?': 'Are you sure you want to recall?',
+  'Workflow': 'Workflow',
+  'Remark:': 'Remark:',
+  'Audit Time:': 'Audit Time:',
+  'Operator:': 'Operator:',
+  'Designation:': 'Designation:',
+  'Type:': 'Type:',
+  'Node:': 'Node:',
+  'Approved': 'Approved',
+  'Pending': 'Pending',
+  'Rejected': 'Rejected',
+  'Completed': 'Completed',
+  'Active': 'Active',
+  'Cancelled': 'Cancelled',
+  'Revised': 'Revised',
+  'Job Detail': 'Job Detail',
+  'Add Staff': 'Add Staff',
+  'Remarks': 'Remarks',
+  'Applied At:': 'Applied At:',
+  'Total Rooms:': 'Total Rooms:',
+  'Total Hours:': 'Total Hours:',
+  '+/- Hours:': '+/- Hours:',
+  'Security Out:': 'Security Out:',
+  'Work Out:': 'Work Out:',
+  'Work In:': 'Work In:',
+  'Security In:': 'Security In:',
+  'Staff Name:': 'Staff Name:',
+  'Staff Name': 'Staff Name',
+  'Work Out': 'Work Out',
+  'Work In': 'Work In',
+  'Security In': 'Security In',
+  'Security Out': 'Security Out',
+  '+/- Hours': '+/- Hours',
+  'Total Rooms': 'Total Rooms',
+  'Operation Approve': 'Operation Approve',
+  'Batch Modify': 'Batch Modify',
+  'Please select the applied record': 'Please select the applied record',
+  'Are you sure you want to setting approved?': 'Are you sure you want to setting approved?',
+  'Attitude': 'Attitude',
+  'Performance': 'Performance',
+  'Experience': 'Experience',
+  'Grooming': 'Grooming',
+  'Enter...': 'Enter...',
+  'Please Enter Remark': 'Please Enter Remark',
+  'Choose Staff': 'Choose Staff',
+  'Reason': 'Reason',
+  'None': 'None',
+  'Forgot to clock in/out': 'Forgot to clock in/out',
+  'Technical issue': 'Technical issue',
+  'Others': 'Others',
+  'Staff Detail': 'Staff Detail',
+  'Staff Name/ID/Phone': 'Staff Name/ID/Phone',
+  'Select Country': 'Select Country',
+  'Browse jobs available in your selected country.': 'Browse jobs available in your selected country.',
+  'Next': 'Next',
+  'Singapore': 'Singapore',
+  'Revise List': 'Revise List',
+  'Device List': 'Device List',
+  'Device MAC:': 'Device MAC:',
+  'Device Alias:': 'Device Alias:',
+  'Location:': 'Location:',
+  'Alive State:': 'Alive State:',
+  'Offline': 'Offline',
+  'Online': 'Online',
+  'Sort': 'Sort',
+  'Template': 'Template',
+  'Updated At': 'Updated At',
+  'Add New': 'Add New',
+  'Template Setting': 'Template Setting',
+  'Enter Job Title': 'Enter Job Title',
+  'Template Name': 'Template Name',
+  'Contact': 'Contact',
+  'Note': 'Note',
+  'Delete': 'Delete',
+  'Are you sure you want to delete this job title?': 'Are you sure you want to delete this job title?',
+  'Are you sure you want to delete this job template?': 'Are you sure you want to delete this job template?',
+  'Age': 'Age',
+  'Gender': 'Gender',
+  'Preferred Language': 'Preferred Language',
+  'Food Hygiene Cert': 'Food Hygiene Cert',
+  'Yes': 'Yes',
+  'No': 'No',
+  'Description': 'Description',
+  'Contact No': 'Contact No',
+  'Create Template': 'Create Template',
+  'Edit Template': 'Edit Template',
+  'Both': 'Both',
+  'Male': 'Male',
+  'Female': 'Female',
+  'English': 'English',
+  'Chinese': 'Chinese',
+  'Malay': 'Malay',
+  'Tamil': 'Tamil',
+  'Hindi': 'Hindi',
+  'Select Job Title': 'Select Job Title',
+  'Select Job Start Time': 'Select Job Start Time',
+  'Select Job End Time': 'Select Job End Time',
+  'Enter No. of Staff of The Corresponding Gender': 'Enter No. of Staff of The Corresponding Gender',
+  'Select Date': 'Select Date',
+  'Date': 'Date',
+  'Job Time': 'Job Time',
+  'Repeat': 'Repeat',
+  'Repeat Start Time': 'Repeat Start Time',
+  'Repeat End Time': 'Repeat End Time',
+  'Gender Unlimited': 'Gender Unlimited',
+  'Gender Limited': 'Gender Limited',
+  'Needs Num': 'Needs Num',
+  'Request Type': 'Request Type',
+  'Remark': 'Remark',
+  'Are you sure you want to cancel this job?': 'Are you sure you want to cancel this job?',
+  'Are you sure you want to delete this job?': 'Are you sure you want to delete this job?',
+  'Are you sure you want to confirm this job?': 'Are you sure you want to confirm this job?',
+  'Create New Job': 'Create New Job',
+  'Search': 'Search',
+  'Send E-Attendance': 'Send E-Attendance',
+  'Nric': 'Nric',
+  'Name / Nric': 'Name / Nric',
+  'Add Staff - Choose Staff': 'Add Staff - Choose Staff',
+  'Are you sure you want to send the e-attendance to agency?': 'Are you sure you want to send the e-attendance to agency?',
+  'Work Clock In': 'Work Clock In',
+  'Work Clock Out': 'Work Clock Out',
+  'Security Clock In': 'Security Clock In',
+  'Security Clock Out': 'Security Clock Out',
+  'Applied': 'Applied',
+  'No Show': 'No Show',
+  'Modify': 'Modify',
+  'Subtract Hours': 'Subtract Hours',
+  'Hourly Rate': 'Hourly Rate',
+  'Reviews': 'Reviews',
+  'Mobile': 'Mobile',
+  'Staff Reviews': 'Staff Reviews',
+  'Revise Hours': 'Revise Hours',
+  'Are you sure you want to recall this revise?': 'Are you sure you want to recall this revise?',
+  'Are you sure you want to delete this revise?': 'Are you sure you want to delete this revise?',
+  'Logs': 'Logs',
+  'Date Time': 'Date Time',
+  'Action': 'Action',
+  'Content': 'Content',
+  'Revise': 'Revise',
+  'Add Revise': 'Add Revise',
+  'Edit Revise': 'Edit Revise',
+  'Incomplete': 'Incomplete',
+  'Completed + Incomplete': 'Completed + Incomplete',
+  'YY Casual Labour Report': 'YY Casual Labour Report',
+  'TotalAmt': 'TotalAmt',
+  'Hours': 'Hours',
+  'Monthly Staff Request Report': 'Monthly Staff Request Report',
+  'Finance Report': 'Finance Report',
+  'Created By': 'Created By',
+  'Language': 'Language',
+  'Korea': 'Korea',
+
+  //插件的国际化
+  'Pull to refresh': 'Pull to refresh',
+  'Release ready': 'Release ready',
+  'Refreshing...': 'Refreshing...',
+  'Succeeded': 'Succeeded',
+  'No more': 'No more',
+  'Failed': 'Failed',
+  'Last updated at %T': 'Last updated at %T',
+  'Pull to load': 'Pull to load',
+  'Network Load Error': 'Network Load Error',
+  'Loading...': 'Loading...',
+  'Data loading failed! Please refresh and try again': 'Data loading failed! Please refresh and try again',
+  'There is currently no content available': 'There is currently no content available',
+  'Click again and exit the app': 'Click again and exit the app',
+  'The login credential have expired, please log in again.': 'The login credentials have expired, please log in again.',
+  'Successful': 'Successful',
+};

+ 2 - 0
packages/cs_resources/lib/local/language/translation_service.dart

@@ -3,6 +3,7 @@ import 'package:get/get.dart';
 import 'en_US.dart';
 import 'vi_VN.dart';
 import 'zh_CN.dart';
+import 'ko_KR.dart';
 
 class TranslationService extends Translations {
   static Locale? get locale => Get.deviceLocale;
@@ -13,5 +14,6 @@ class TranslationService extends Translations {
         'en_US': en_US,
         'zh_CN': zh_CN,
         'vi_VN': vi_VN,
+        'ko_KR': ko_KR,
       };
 }

+ 17 - 1
packages/cs_widgets/lib/shatter/custom_check_box.dart

@@ -41,11 +41,27 @@ class _CustomCheckBoxState extends State<CustomCheckBox> {
   @override
   void didUpdateWidget(CustomCheckBox oldWidget) {
     super.didUpdateWidget(oldWidget);
-    if (oldWidget.selectedOptions != widget.selectedOptions) {
+    Log.d("oldWidget - selectedOptions :${oldWidget.selectedOptions}  newWidget - selectedOptions:${widget.selectedOptions} ");
+
+    // 使用ListEquality来比较两个列表的内容
+    if (!_listEquals(oldWidget.selectedOptions, widget.selectedOptions)) {
       _initializeSelectedOptions();
     }
   }
 
+  bool _listEquals(List<String> list1, List<String> list2) {
+    if (list1.length != list2.length) {
+      return false;
+    }
+    for (int i = 0; i < list1.length; i++) {
+      if (list1[i] != list2[i]) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+
   @override
   Widget build(BuildContext context) {
     return Wrap(