szld-libs 0.3.49 → 0.3.51

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/es/index.js CHANGED
@@ -4,10 +4,10 @@ import { handleAttrList } from "./utils/method";
4
4
  import { BackHeader, DynamicForm } from "./main";
5
5
  import { BrowserRouter } from "react-router-dom";
6
6
  import { ConfigProvider, App, Form, Button } from "antd";
7
- import { useRef, useState } from "react";
7
+ import { useRef, useState, useEffect } from "react";
8
8
  import ReactDOM from "react-dom/client";
9
9
  import zhCN from "antd/es/locale/zh_CN";
10
- import { attrList, langConfig } from "./mock";
10
+ import { langConfig, attrList } from "./mock";
11
11
  import dayjs from "dayjs";
12
12
  const index = "";
13
13
  const tableDetail = "";
@@ -15,19 +15,22 @@ dayjs.locale("zh-cn");
15
15
  const Demo = () => {
16
16
  const formRef = useRef(null);
17
17
  const [form] = Form.useForm();
18
- const [list, setList] = useState(handleAttrList(attrList));
18
+ const [list, setList] = useState([]);
19
+ const [langList, setLangList] = useState([]);
20
+ const [langId, setLangId] = useState("");
19
21
  const onValuesChange = async (values, allValues) => {
20
- const keys = Object.keys(values);
21
- if (keys.includes("6A5984BD547449088172BD33F2A965E8")) {
22
- list.forEach((item) => {
23
- if (item.attrid === "4E507938BE7448E5883CFCD9C962707D") {
24
- item.json.data = ["1", "2", "3"];
25
- item.info = JSON.stringify(item == null ? void 0 : item.json);
26
- }
27
- });
28
- setList([...list]);
29
- }
30
22
  };
23
+ useEffect(() => {
24
+ setTimeout(() => {
25
+ setLangList(langConfig);
26
+ }, 2e3);
27
+ setTimeout(() => {
28
+ setLangId("10001");
29
+ }, 300);
30
+ setTimeout(() => {
31
+ setList(handleAttrList(attrList));
32
+ }, 4e3);
33
+ }, []);
31
34
  return /* @__PURE__ */ jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
32
35
  /* @__PURE__ */ jsx(BackHeader, { title: "页头组件", isBack: true }),
33
36
  /* @__PURE__ */ jsx("div", { style: {}, children: /* @__PURE__ */ jsxs(Form, { form, onValuesChange, children: [
@@ -45,8 +48,8 @@ const Demo = () => {
45
48
  commonRequest,
46
49
  instructionShowMode: "icon",
47
50
  ref: formRef,
48
- langId: "10001",
49
- langConfig
51
+ langId,
52
+ langConfig: langList
50
53
  }
51
54
  ),
52
55
  /* @__PURE__ */ jsx(Form.Item, { name: "submit", style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsx(Button, { type: "primary", htmlType: "submit", children: "提交" }) })
@@ -24,7 +24,7 @@ const MyCheckbox = (props) => {
24
24
  const [val, setVal] = react.useState(value || []);
25
25
  react.useEffect(() => {
26
26
  handleLoadOptions();
27
- }, [item.inputType, item.classify, item.data, item.options]);
27
+ }, [item.inputType, item.classify, item.data, item.options, langConfig]);
28
28
  const handleLoadOptions = async () => {
29
29
  const list2 = await func.handleSelectOptions({
30
30
  commonRequestWidthParams,
@@ -22,7 +22,7 @@ const MyRadio = (props) => {
22
22
  const [list, setList] = react.useState([]);
23
23
  react.useEffect(() => {
24
24
  handleLoadOptions();
25
- }, [item.inputType, item.classify, item.data, item.options]);
25
+ }, [item.inputType, item.classify, item.data, item.options, langConfig]);
26
26
  const handleLoadOptions = async () => {
27
27
  const list2 = await func.handleSelectOptions({
28
28
  commonRequestWidthParams,
@@ -22,7 +22,7 @@ const MySelect = ({
22
22
  const [loading, setLoading] = react.useState(false);
23
23
  react.useEffect(() => {
24
24
  handleLoadOptions();
25
- }, [item.inputType, item.classify, item.data, item.options]);
25
+ }, [item.inputType, item.classify, item.data, item.options, langConfig]);
26
26
  const handleLoadOptions = async () => {
27
27
  setLoading(true);
28
28
  const list = await func.handleSelectOptions({