@esvndev/es-react-config-setting 1.0.42 → 1.0.43

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/dist/index.js CHANGED
@@ -11571,7 +11571,7 @@ const SettingApp = (props) => {
11571
11571
  if (data.status) {
11572
11572
  setDataSettingGroup(data.data);
11573
11573
  setTimeout(() => {
11574
- switchSettingTab(data.data[0]);
11574
+ loadSettingConfigByGroup(data.data[0]);
11575
11575
  }, 500);
11576
11576
  }
11577
11577
  else {
@@ -11580,12 +11580,8 @@ const SettingApp = (props) => {
11580
11580
  });
11581
11581
  }
11582
11582
  }, [isOpen]);
11583
- //Sự kiện chọn nhóm cài đặt
11584
- const switchSettingTab = (data) => {
11585
- const updated = dataSettingGroup.map((item) => ({
11586
- ...item,
11587
- active: item.id === data.id
11588
- }));
11583
+ //Lấy danh sách cài đặt theo nhóm đã chọn
11584
+ const loadSettingConfigByGroup = (data) => {
11589
11585
  GetSettingConfigByGroup({ GroupId: data.id }, (rs) => {
11590
11586
  if (rs.status) {
11591
11587
  setSettingData(rs.data);
@@ -11594,6 +11590,14 @@ const SettingApp = (props) => {
11594
11590
  setSettingData([]);
11595
11591
  }
11596
11592
  });
11593
+ };
11594
+ //Sự kiện chọn nhóm cài đặt
11595
+ const switchSettingTab = (data) => {
11596
+ const updated = dataSettingGroup.map((item) => ({
11597
+ ...item,
11598
+ active: item.id === data.id
11599
+ }));
11600
+ loadSettingConfigByGroup(data);
11597
11601
  setDataSettingGroup(updated);
11598
11602
  };
11599
11603
  //Hàm sử dụng tạo theo loại giá trị