szld-libs 0.2.96 → 0.2.98

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.
Files changed (45) hide show
  1. package/dist/szld-components.es.js +67 -59
  2. package/dist/szld-components.umd.js +3 -3
  3. package/es/components/DynamicForm/func.js +10 -8
  4. package/es/components/DynamicForm/useDynamicForm.d.ts +1 -1
  5. package/es/hooks/useRenderAttrSetDetail.d.ts +24 -0
  6. package/es/hooks/useRenderAttrSetDetail.js +186 -0
  7. package/es/index.js +32 -263
  8. package/es/mock/index.d.ts +306 -0
  9. package/es/mock/index.js +387 -0
  10. package/es/mock/vite.svg +1 -0
  11. package/es/services/index.d.ts +6 -0
  12. package/es/services/index.js +85 -0
  13. package/es/services/request.d.ts +6 -0
  14. package/es/services/request.js +140 -0
  15. package/es/services/status.d.ts +1 -0
  16. package/es/services/status.js +44 -0
  17. package/es/services/vite.svg +1 -0
  18. package/es/utils/enum.d.ts +4 -0
  19. package/es/utils/enum.js +10 -0
  20. package/es/utils/method.js +14 -10
  21. package/es/utils/szxkFunc.d.ts +8 -0
  22. package/es/utils/szxkFunc.js +7 -1
  23. package/es/vite-env.d.ts +11 -0
  24. package/lib/components/DynamicForm/func.js +10 -8
  25. package/lib/components/DynamicForm/useDynamicForm.d.ts +1 -1
  26. package/lib/hooks/useRenderAttrSetDetail.d.ts +24 -0
  27. package/lib/hooks/useRenderAttrSetDetail.js +185 -0
  28. package/lib/index.js +29 -260
  29. package/lib/mock/index.d.ts +306 -0
  30. package/lib/mock/index.js +387 -0
  31. package/lib/mock/vite.svg +1 -0
  32. package/lib/services/index.d.ts +6 -0
  33. package/lib/services/index.js +85 -0
  34. package/lib/services/request.d.ts +6 -0
  35. package/lib/services/request.js +140 -0
  36. package/lib/services/status.d.ts +1 -0
  37. package/lib/services/status.js +44 -0
  38. package/lib/services/vite.svg +1 -0
  39. package/lib/utils/enum.d.ts +4 -0
  40. package/lib/utils/enum.js +10 -0
  41. package/lib/utils/method.js +14 -10
  42. package/lib/utils/szxkFunc.d.ts +8 -0
  43. package/lib/utils/szxkFunc.js +6 -0
  44. package/lib/vite-env.d.ts +11 -0
  45. package/package.json +3 -1
@@ -180,14 +180,16 @@ const handleGetSingleAttrListObj = (children) => {
180
180
  }
181
181
  const dealList = (children2) => children2 == null ? void 0 : children2.map((v) => {
182
182
  const obj = {};
183
- v.forEach((x) => {
184
- var _a;
185
- if ((_a = x == null ? void 0 : x.children) == null ? void 0 : _a.length) {
186
- obj[x.attrid] = dealList(x.children);
187
- } else {
188
- obj[x.attrid] = x.attrvalue;
189
- }
190
- });
183
+ if (Array.isArray(v)) {
184
+ v.forEach((x) => {
185
+ var _a;
186
+ if ((_a = x == null ? void 0 : x.children) == null ? void 0 : _a.length) {
187
+ obj[x.attrid] = dealList(x.children);
188
+ } else {
189
+ obj[x.attrid] = x.attrvalue;
190
+ }
191
+ });
192
+ }
191
193
  return obj;
192
194
  });
193
195
  return dealList(children);
@@ -27,7 +27,7 @@ declare function useDynamicForm(props: IDynamicFormProps): {
27
27
  item: IformConfigItem;
28
28
  readonly: boolean;
29
29
  colNum: number;
30
- instructionShowMode?: "flex" | "icon" | undefined;
30
+ instructionShowMode?: "icon" | "flex" | undefined;
31
31
  relatedid?: string | undefined;
32
32
  form: FormInstance;
33
33
  defaultWidth?: number | undefined;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * 宠物详情渲染 Hook
3
+ * @param attrList 属性列表数据
4
+ * @param config 配置信息(用于文件预览地址)
5
+ * @returns 渲染函数
6
+ */
7
+ interface IAttrSetDetailRendererProps {
8
+ labelSpan?: number;
9
+ valueSpan?: number;
10
+ imgWidth?: number;
11
+ imgHeight?: number;
12
+ layoutType?: 'row' | 'flex';
13
+ }
14
+ export default function useAttrSetDetailRenderer({ labelSpan, valueSpan, imgWidth, imgHeight, layoutType, }: IAttrSetDetailRendererProps): {
15
+ renderDetail: ({ attrList, span, type, servicesUniversalHeader, beforeExtraValue, operationColumn, }: {
16
+ attrList: any[];
17
+ span?: number | undefined;
18
+ type?: "form" | "table" | undefined;
19
+ servicesUniversalHeader?: any[] | undefined;
20
+ beforeExtraValue?: string | undefined;
21
+ operationColumn?: any;
22
+ }) => import("react/jsx-runtime").JSX.Element | null;
23
+ };
24
+ export {};
@@ -0,0 +1,186 @@
1
+ import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
2
+ import { App, Row, Col, Flex, Table, Space, Image } from "antd";
3
+ import { Fragment } from "react";
4
+ import { useMemoizedFn } from "ahooks";
5
+ import { handleSetTableRowColor } from "../utils/szxkFunc";
6
+ function useAttrSetDetailRenderer({
7
+ labelSpan = 3,
8
+ valueSpan = 9,
9
+ imgWidth = 93,
10
+ imgHeight = 93,
11
+ layoutType = "row"
12
+ }) {
13
+ const { message } = App.useApp();
14
+ const renderRadioCardAttr = (item, span) => {
15
+ try {
16
+ const attrvalue = JSON.parse((item == null ? void 0 : item.attrvalue) || "{}") || "";
17
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
18
+ layoutType === "flex" && /* @__PURE__ */ jsx(Col, { span, children: /* @__PURE__ */ jsxs(Flex, { children: [
19
+ /* @__PURE__ */ jsxs("span", { style: { flexShrink: 0 }, children: [
20
+ item == null ? void 0 : item.attrname,
21
+ ":"
22
+ ] }),
23
+ /* @__PURE__ */ jsx("span", { style: { wordWrap: "break-word" }, children: attrvalue == null ? void 0 : attrvalue.typename })
24
+ ] }) }),
25
+ layoutType === "row" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
26
+ /* @__PURE__ */ jsx(Col, { span: labelSpan, children: item == null ? void 0 : item.attrname }),
27
+ /* @__PURE__ */ jsx(Col, { span: valueSpan, style: { wordWrap: "break-word" }, children: item == null ? void 0 : item.attrvalue })
28
+ ] })
29
+ ] }, item == null ? void 0 : item.attrid);
30
+ } catch (error) {
31
+ message.error("房型数据格式错误,转json失败");
32
+ return null;
33
+ }
34
+ };
35
+ const renderImageAttr = (item, span) => {
36
+ if (typeof (item == null ? void 0 : item.attrvalue) !== "string")
37
+ return;
38
+ const attrvalues = JSON.parse((item == null ? void 0 : item.attrvalue) || "[]");
39
+ const valueNode = () => /* @__PURE__ */ jsx(Space, { wrap: true, children: attrvalues.map((el, index) => /* @__PURE__ */ jsx(
40
+ "div",
41
+ {
42
+ style: {
43
+ border: "1px solid rgba(0, 0, 0, 0.15)",
44
+ borderRadius: 4
45
+ },
46
+ children: /* @__PURE__ */ jsx(
47
+ Image,
48
+ {
49
+ style: { objectFit: "cover", padding: 5 },
50
+ width: imgWidth,
51
+ height: imgHeight,
52
+ src: el == null ? void 0 : el.FilePath,
53
+ alt: (item == null ? void 0 : item.attrname) || "-"
54
+ }
55
+ )
56
+ },
57
+ index
58
+ )) });
59
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
60
+ layoutType === "flex" && /* @__PURE__ */ jsx(Col, { span, children: /* @__PURE__ */ jsxs(Flex, { children: [
61
+ /* @__PURE__ */ jsxs("span", { style: { flexShrink: 0 }, children: [
62
+ item == null ? void 0 : item.attrname,
63
+ ":"
64
+ ] }),
65
+ valueNode()
66
+ ] }) }),
67
+ layoutType === "row" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
68
+ /* @__PURE__ */ jsx(Col, { span: labelSpan, children: item == null ? void 0 : item.attrname }),
69
+ /* @__PURE__ */ jsx(Col, { span: valueSpan, style: { wordWrap: "break-word" }, children: valueNode() })
70
+ ] })
71
+ ] }, item == null ? void 0 : item.attrid);
72
+ };
73
+ const renderFileAttr = (item, span) => {
74
+ const attrvalues = JSON.parse((item == null ? void 0 : item.attrvalue) || "[]");
75
+ const valueNode = () => /* @__PURE__ */ jsx(Space, { wrap: true, children: attrvalues.map((el, index) => /* @__PURE__ */ jsx("a", { onClick: () => window.open(el == null ? void 0 : el.FilePath), children: (el == null ? void 0 : el.FileName) || "-" }, index)) });
76
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
77
+ layoutType === "flex" && /* @__PURE__ */ jsx(Col, { span, children: /* @__PURE__ */ jsxs(Flex, { children: [
78
+ /* @__PURE__ */ jsxs("span", { style: { flexShrink: 0 }, children: [
79
+ item == null ? void 0 : item.attrname,
80
+ ":"
81
+ ] }),
82
+ valueNode()
83
+ ] }) }),
84
+ layoutType === "row" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
85
+ /* @__PURE__ */ jsx(Col, { span: labelSpan, children: item == null ? void 0 : item.attrname }),
86
+ /* @__PURE__ */ jsx(Col, { span: valueSpan, style: { wordWrap: "break-word" }, children: valueNode() })
87
+ ] })
88
+ ] }, item == null ? void 0 : item.attrid);
89
+ };
90
+ const renderTextAttr = (item, span, beforeExtraValue) => {
91
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
92
+ layoutType === "flex" && /* @__PURE__ */ jsx(Col, { span, children: /* @__PURE__ */ jsxs(Flex, { children: [
93
+ /* @__PURE__ */ jsxs("span", { style: { flexShrink: 0 }, children: [
94
+ item == null ? void 0 : item.attrname,
95
+ ":"
96
+ ] }),
97
+ /* @__PURE__ */ jsxs("span", { style: { wordWrap: "break-word" }, children: [
98
+ beforeExtraValue || "",
99
+ " ",
100
+ (item == null ? void 0 : item.attrvalue) || "-",
101
+ " "
102
+ ] })
103
+ ] }) }),
104
+ layoutType === "row" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
105
+ /* @__PURE__ */ jsx(Col, { span: labelSpan, children: item == null ? void 0 : item.attrname }),
106
+ /* @__PURE__ */ jsxs(Col, { span: valueSpan, style: { wordWrap: "break-word" }, children: [
107
+ beforeExtraValue || "",
108
+ (item == null ? void 0 : item.attrvalue) || "-"
109
+ ] })
110
+ ] })
111
+ ] }, item == null ? void 0 : item.attrid);
112
+ };
113
+ const renderTableDetail = ({
114
+ attrList = [],
115
+ servicesUniversalHeader = [],
116
+ operationColumn
117
+ }) => {
118
+ const columns = servicesUniversalHeader == null ? void 0 : servicesUniversalHeader.map((item) => ({
119
+ title: item == null ? void 0 : item["header-name"],
120
+ dataIndex: item == null ? void 0 : item["header-attribute-id"],
121
+ key: item == null ? void 0 : item["header-attribute-id"],
122
+ width: item == null ? void 0 : item["header-width"]
123
+ }));
124
+ if (operationColumn) {
125
+ columns.push(operationColumn);
126
+ }
127
+ const dataSource = attrList == null ? void 0 : attrList.map((v, i) => ({
128
+ key: i,
129
+ ...handleDealAttrList(v)
130
+ }));
131
+ return /* @__PURE__ */ jsx(Flex, { align: "center", children: /* @__PURE__ */ jsx(
132
+ Table,
133
+ {
134
+ style: { width: "100%" },
135
+ columns,
136
+ scroll: { x: "max-content" },
137
+ size: "small",
138
+ rowKey: "key",
139
+ onRow: handleSetTableRowColor,
140
+ dataSource,
141
+ pagination: false
142
+ }
143
+ ) });
144
+ };
145
+ const handleDealAttrList = (attrList) => {
146
+ return attrList == null ? void 0 : attrList.reduce((pre, cur) => {
147
+ pre[cur == null ? void 0 : cur.attrid] = cur == null ? void 0 : cur.attrvalue;
148
+ return pre;
149
+ }, {});
150
+ };
151
+ const renderDetail = useMemoizedFn(
152
+ ({
153
+ attrList = [],
154
+ span = 24,
155
+ type = "form",
156
+ servicesUniversalHeader = [],
157
+ beforeExtraValue = "",
158
+ operationColumn
159
+ }) => {
160
+ if (!(attrList == null ? void 0 : attrList.length))
161
+ return null;
162
+ if (type === "table") {
163
+ return /* @__PURE__ */ jsx(Fragment, { children: renderTableDetail({ attrList, servicesUniversalHeader, operationColumn }) });
164
+ }
165
+ return /* @__PURE__ */ jsx(Row, { gutter: [10, 8], children: attrList == null ? void 0 : attrList.map((item) => {
166
+ if ((item == null ? void 0 : item.attrtype) !== 0)
167
+ return /* @__PURE__ */ jsx(Fragment, {}, item == null ? void 0 : item.attrid);
168
+ const info = (item == null ? void 0 : item.json) || (item == null ? void 0 : item.info) && JSON.parse(item.info);
169
+ if ((info == null ? void 0 : info.input) === "image") {
170
+ return renderImageAttr(item, span);
171
+ }
172
+ if (["file", "audio", "video"].includes(info == null ? void 0 : info.input)) {
173
+ return renderFileAttr(item, span);
174
+ }
175
+ if ((info == null ? void 0 : info.input) === "radio-card") {
176
+ return renderRadioCardAttr(item, span);
177
+ }
178
+ return renderTextAttr(item, span, beforeExtraValue);
179
+ }) });
180
+ }
181
+ );
182
+ return { renderDetail };
183
+ }
184
+ export {
185
+ useAttrSetDetailRenderer as default
186
+ };
package/es/index.js CHANGED
@@ -1,189 +1,44 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from "react";
2
+ import { useEffect, useRef } from "react";
3
3
  import ReactDOM from "react-dom/client";
4
4
  import { BrowserRouter } from "react-router-dom";
5
- import { App, Form, Table, Upload, Button, Flex, message } from "antd";
6
- import useConfig from "./hooks/useConfig";
7
- import { useRowSelection, useChangePwd, HmacSM3, BackHeader, SearchTable, CreateForm, CustomPagination } from "./main";
8
- let key = "U2FsdGVkX1/dG1NSXNR9hnp3Ech/v6Gh8CDDJxgBm1EPFQel12ySIf84ARXCPwTae7TzwgPvjOyE3S5rAEzl/wAZmId6pbezpFeFcJqxdmIl3FeluYHFxJzQHDETTvrr3G/REvv00kHptOVwg6ecjPH6yk7PNit0sWTBLorROxLxMD8lVDmOA66p7Zp4QnYzqScYJGFbutmfHYXfBRBe1Q2UKummJ798svNY5SIwEwl4spzgyWmhARtuyq4zhysFrj/xODuNDjtwitA6XfX566WcZkj3F+2P+mkYzDYOhXXaomnlybjrZ2hEHfcczQhUfJd89O8PNIuEWo24wjYRgMdKlw5CWSeocFCqV7ZJ/CV/7vNRcaO4awKlFNobLikkwDznxpcX+4UEej+ED+pgfmPQLsKedcfEscStkSAZXaD5pBRTiFU9xGLfDt6seUrEnMBeXkpMIY9j1SZDDK18/G7lSHjDQMZYZP6sfLdBdwY=";
5
+ import { ConfigProvider, App, Form, Button } from "antd";
6
+ import { BackHeader, DynamicForm } from "./main";
7
+ import { attrList } from "./mock";
8
+ import { commonRequestWidthParams, uploadFormAction, commonRequest } from "./services";
9
+ import zhCN from "antd/es/locale/zh_CN";
10
+ import dayjs from "dayjs";
11
+ dayjs.locale("zh-cn");
9
12
  const Demo = () => {
10
- useConfig(key);
11
- const [form] = Form.useForm();
12
- useEffect(() => {
13
- }, []);
14
- const columns = [
15
- {
16
- dataIndex: ["a", 2],
17
- title: "a"
18
- },
19
- Table.EXPAND_COLUMN,
20
- {
21
- dataIndex: "b",
22
- title: "b",
23
- width: 400
24
- },
25
- Table.SELECTION_COLUMN,
26
- {
27
- dataIndex: "c",
28
- title: "c"
29
- }
30
- ];
31
- const [list, setList] = useState(
32
- Array(10).fill(0).map((v, i) => ({ id: i }))
33
- );
34
- const [current, setCurrent] = useState(1);
35
- const data = [{ id: 1 }, { id: 12 }, { id: 21 }];
36
- const { selectedKeys, selectedRows, setSelectedKeys } = useRowSelection({
37
- dataSource: list,
38
- rowKey: "id",
39
- defaultRows: data
40
- });
41
13
  useEffect(() => {
42
- setSelectedKeys([1, 12, 21]);
43
14
  }, []);
44
- const { handleChangePwd } = useChangePwd();
45
- const typeList = [
46
- {
47
- flinfo: "数据",
48
- children: [
49
- {
50
- flinfo: "数据1"
51
- },
52
- {
53
- flinfo: "数据2"
54
- }
55
- ]
56
- },
57
- {
58
- flinfo: "表",
59
- children: [
60
- {
61
- flinfo: "表1"
62
- },
63
- {
64
- flinfo: "表2"
65
- }
66
- ]
67
- }
68
- ];
69
- const imgAccept = ".jpg,.png,.jpeg";
70
- const imgUploadProps = {
71
- maxCount: 1,
72
- action: "uploadAction",
73
- accept: imgAccept,
74
- showUploadList: false,
75
- beforeUpload(file) {
76
- var _a;
77
- const accepts = imgAccept.split(",");
78
- const fileType = (_a = file.name.split(".").pop()) == null ? void 0 : _a.toLocaleLowerCase();
79
- if (!accepts.includes(`.${fileType}`)) {
80
- message.error(`只允许上传${accepts.join("、")}文件`);
81
- return Upload.LIST_IGNORE;
82
- }
83
- return file;
84
- }
85
- };
86
- const normFile = (e) => {
87
- if (Array.isArray(e)) {
88
- return e;
89
- }
90
- return e && e.fileList;
15
+ const formRef = useRef(null);
16
+ const [form] = Form.useForm();
17
+ const onFinish = (values) => {
91
18
  };
92
- const formItems = [
93
- {
94
- dataIndex: "asctypeid",
95
- title: "编号",
96
- valueType: "inputNumber",
97
- valueProps: {
98
- placeholder: "请输入编号",
99
- controls: false,
100
- min: 0
101
- },
102
- formItemProps: {
103
- rules: [
104
- {
105
- required: true,
106
- message: "请输入编号"
107
- }
108
- ]
109
- },
110
- colProps: { span: 11 }
111
- },
112
- {
113
- dataIndex: "asctype",
114
- title: "归类名",
115
- valueProps: {
116
- placeholder: "请输入归类名",
117
- maxLength: 100,
118
- allowClear: true
119
- },
120
- colProps: { span: 11, offset: 2 },
121
- formItemProps: {
122
- rules: [
123
- {
124
- required: true,
125
- message: "请输入归类名"
126
- },
127
- { whitespace: true, message: "输入内容不能只有空格" }
128
- ]
129
- }
130
- },
131
- {
132
- dataIndex: "tabsortList",
133
- title: "分类",
134
- valueType: "cascader",
135
- valueProps: {
136
- placeholder: "请选择分类",
137
- options: typeList,
138
- changeOnSelect: true,
139
- fieldNames: {
140
- label: "flinfo",
141
- value: "flinfo",
142
- children: "children"
143
- }
144
- },
145
- colProps: {
146
- span: 11
147
- }
148
- },
149
- {
150
- dataIndex: "fileList",
151
- title: "营业执照",
152
- valueType: "custom",
153
- valueProps: {
154
- children: /* @__PURE__ */ jsx(Upload, { ...imgUploadProps, children: /* @__PURE__ */ jsx(Button, { children: "上传营业执照" }) }),
155
- fileList: form.getFieldValue("fileList")
156
- },
157
- colProps: {
158
- md: 24,
159
- xl: 10
160
- },
161
- formItemProps: {
162
- valuePropName: "fileList",
163
- getValueFromEvent: normFile,
164
- rules: [{ required: true, message: "请上传营业执照" }]
165
- }
166
- }
167
- ];
168
- const totalText = "共@";
169
- const unitText = "条@";
170
- const jumpText = "跳至@";
171
- const pageText = "页@";
172
- const sm3key = "Aa123456#";
173
- const msg = "username=admin&timestamp=1758782465&modelid=19955BC7B61A43B3A982F0B2053ABC34";
174
- HmacSM3.hmac(sm3key, msg);
175
19
  return /* @__PURE__ */ jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
176
20
  /* @__PURE__ */ jsx(BackHeader, { title: "页头组件", isBack: true }),
177
- /* @__PURE__ */ jsxs(Flex, { gap: 20, align: "center", children: [
178
- "1. 测试修改密码hooks",
21
+ /* @__PURE__ */ jsxs(Form, { form, layout: "vertical", onFinish, children: [
22
+ "测试移动端动态组件",
179
23
  /* @__PURE__ */ jsx(
180
- Button,
181
- {
182
- onClick: () => handleChangePwd((params) => {
183
- }),
184
- children: "修改密码"
185
- }
186
- )
24
+ DynamicForm,
25
+ {
26
+ interfaceTypeChildren: "YLFWLRDetailAttrlist",
27
+ formConfig: attrList,
28
+ form,
29
+ readonly: false,
30
+ relatedid: "",
31
+ colNum: 1,
32
+ defaultWidth: "100%",
33
+ commonRequestWidthParams,
34
+ uploadAction: uploadFormAction,
35
+ commonRequest,
36
+ instructionShowMode: "icon",
37
+ ref: formRef,
38
+ isMobile: true
39
+ }
40
+ ),
41
+ /* @__PURE__ */ jsx(Form.Item, { children: /* @__PURE__ */ jsx(Button, { type: "primary", htmlType: "submit", children: "提交" }) })
187
42
  ] }),
188
43
  /* @__PURE__ */ jsxs("div", { children: [
189
44
  "2. 测试循环滚动组件",
@@ -197,95 +52,9 @@ const Demo = () => {
197
52
  }
198
53
  }
199
54
  )
200
- ] }),
201
- /* @__PURE__ */ jsxs("div", { children: [
202
- /* @__PURE__ */ jsxs(Flex, { gap: 20, align: "center", style: { marginBottom: 10 }, children: [
203
- "3. 测试表格组件",
204
- /* @__PURE__ */ jsx(Button, { onClick: () => setList(columns), children: "test" })
205
- ] }),
206
- /* @__PURE__ */ jsx(
207
- SearchTable,
208
- {
209
- tableProps: {
210
- columns: [
211
- {
212
- dataIndex: "id",
213
- title: "ID"
214
- },
215
- {
216
- dataIndex: "a",
217
- title: "a",
218
- width: 200
219
- },
220
- {
221
- dataIndex: "a2",
222
- title: "a",
223
- width: 200
224
- },
225
- {
226
- dataIndex: "a3",
227
- title: "a",
228
- width: 200
229
- },
230
- {
231
- dataIndex: "a4",
232
- title: "a",
233
- width: 400
234
- }
235
- ],
236
- dataSource: list,
237
- resizeable: true,
238
- rowKey: "id",
239
- pagination: {
240
- total: 25,
241
- current,
242
- pageSize: 10,
243
- onChange(page, pageSize) {
244
- const index = (page - 1) * 10;
245
- const arr = Array(10).fill(0).map((v, i) => ({ id: i + index }));
246
- setList(arr);
247
- setCurrent(page);
248
- }
249
- }
250
- }
251
- }
252
- )
253
- ] }),
254
- /* @__PURE__ */ jsxs("div", { children: [
255
- "4. 测试创建表单组件",
256
- /* @__PURE__ */ jsx(
257
- CreateForm,
258
- {
259
- items: formItems,
260
- formProps: { form, wrapperCol: { span: 24 }, style: { width: "60%", marginTop: 10 } }
261
- }
262
- )
263
- ] }),
264
- /* @__PURE__ */ jsxs("div", { children: [
265
- "5. 测试自定义分页组件",
266
- /* @__PURE__ */ jsx(
267
- CustomPagination,
268
- {
269
- paginationProps: {
270
- total: 25,
271
- current,
272
- pageSize: 10,
273
- onChange(page, pageSize) {
274
- const index = (page - 1) * 10;
275
- const arr = Array(10).fill(0).map((v, i) => ({ id: i + index }));
276
- setList(arr);
277
- setCurrent(page);
278
- }
279
- },
280
- totalText,
281
- unitText,
282
- jumpText,
283
- pageText
284
- }
285
- )
286
55
  ] })
287
56
  ] });
288
57
  };
289
58
  ReactDOM.createRoot(document.getElementById("root")).render(
290
- /* @__PURE__ */ jsx(BrowserRouter, { children: /* @__PURE__ */ jsx(App, { children: /* @__PURE__ */ jsx(Demo, {}) }) })
59
+ /* @__PURE__ */ jsx(ConfigProvider, { locale: zhCN, children: /* @__PURE__ */ jsx(BrowserRouter, { children: /* @__PURE__ */ jsx(App, { children: /* @__PURE__ */ jsx(Demo, {}) }) }) })
291
60
  );