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
package/lib/index.js CHANGED
@@ -4,187 +4,42 @@ const react = require("react");
4
4
  const ReactDOM = require("react-dom/client");
5
5
  const reactRouterDom = require("react-router-dom");
6
6
  const antd = require("antd");
7
- const useConfig = require("./hooks/useConfig");
8
7
  const main = require("./main");
9
- let key = "U2FsdGVkX1/dG1NSXNR9hnp3Ech/v6Gh8CDDJxgBm1EPFQel12ySIf84ARXCPwTae7TzwgPvjOyE3S5rAEzl/wAZmId6pbezpFeFcJqxdmIl3FeluYHFxJzQHDETTvrr3G/REvv00kHptOVwg6ecjPH6yk7PNit0sWTBLorROxLxMD8lVDmOA66p7Zp4QnYzqScYJGFbutmfHYXfBRBe1Q2UKummJ798svNY5SIwEwl4spzgyWmhARtuyq4zhysFrj/xODuNDjtwitA6XfX566WcZkj3F+2P+mkYzDYOhXXaomnlybjrZ2hEHfcczQhUfJd89O8PNIuEWo24wjYRgMdKlw5CWSeocFCqV7ZJ/CV/7vNRcaO4awKlFNobLikkwDznxpcX+4UEej+ED+pgfmPQLsKedcfEscStkSAZXaD5pBRTiFU9xGLfDt6seUrEnMBeXkpMIY9j1SZDDK18/G7lSHjDQMZYZP6sfLdBdwY=";
8
+ const mock = require("./mock");
9
+ const services = require("./services");
10
+ const zhCN = require("antd/es/locale/zh_CN");
11
+ const dayjs = require("dayjs");
12
+ dayjs.locale("zh-cn");
10
13
  const Demo = () => {
11
- useConfig(key);
12
- const [form] = antd.Form.useForm();
13
- react.useEffect(() => {
14
- }, []);
15
- const columns = [
16
- {
17
- dataIndex: ["a", 2],
18
- title: "a"
19
- },
20
- antd.Table.EXPAND_COLUMN,
21
- {
22
- dataIndex: "b",
23
- title: "b",
24
- width: 400
25
- },
26
- antd.Table.SELECTION_COLUMN,
27
- {
28
- dataIndex: "c",
29
- title: "c"
30
- }
31
- ];
32
- const [list, setList] = react.useState(
33
- Array(10).fill(0).map((v, i) => ({ id: i }))
34
- );
35
- const [current, setCurrent] = react.useState(1);
36
- const data = [{ id: 1 }, { id: 12 }, { id: 21 }];
37
- const { selectedKeys, selectedRows, setSelectedKeys } = main.useRowSelection({
38
- dataSource: list,
39
- rowKey: "id",
40
- defaultRows: data
41
- });
42
14
  react.useEffect(() => {
43
- setSelectedKeys([1, 12, 21]);
44
15
  }, []);
45
- const { handleChangePwd } = main.useChangePwd();
46
- const typeList = [
47
- {
48
- flinfo: "数据",
49
- children: [
50
- {
51
- flinfo: "数据1"
52
- },
53
- {
54
- flinfo: "数据2"
55
- }
56
- ]
57
- },
58
- {
59
- flinfo: "表",
60
- children: [
61
- {
62
- flinfo: "表1"
63
- },
64
- {
65
- flinfo: "表2"
66
- }
67
- ]
68
- }
69
- ];
70
- const imgAccept = ".jpg,.png,.jpeg";
71
- const imgUploadProps = {
72
- maxCount: 1,
73
- action: "uploadAction",
74
- accept: imgAccept,
75
- showUploadList: false,
76
- beforeUpload(file) {
77
- var _a;
78
- const accepts = imgAccept.split(",");
79
- const fileType = (_a = file.name.split(".").pop()) == null ? void 0 : _a.toLocaleLowerCase();
80
- if (!accepts.includes(`.${fileType}`)) {
81
- antd.message.error(`只允许上传${accepts.join("、")}文件`);
82
- return antd.Upload.LIST_IGNORE;
83
- }
84
- return file;
85
- }
86
- };
87
- const normFile = (e) => {
88
- if (Array.isArray(e)) {
89
- return e;
90
- }
91
- return e && e.fileList;
16
+ const formRef = react.useRef(null);
17
+ const [form] = antd.Form.useForm();
18
+ const onFinish = (values) => {
92
19
  };
93
- const formItems = [
94
- {
95
- dataIndex: "asctypeid",
96
- title: "编号",
97
- valueType: "inputNumber",
98
- valueProps: {
99
- placeholder: "请输入编号",
100
- controls: false,
101
- min: 0
102
- },
103
- formItemProps: {
104
- rules: [
105
- {
106
- required: true,
107
- message: "请输入编号"
108
- }
109
- ]
110
- },
111
- colProps: { span: 11 }
112
- },
113
- {
114
- dataIndex: "asctype",
115
- title: "归类名",
116
- valueProps: {
117
- placeholder: "请输入归类名",
118
- maxLength: 100,
119
- allowClear: true
120
- },
121
- colProps: { span: 11, offset: 2 },
122
- formItemProps: {
123
- rules: [
124
- {
125
- required: true,
126
- message: "请输入归类名"
127
- },
128
- { whitespace: true, message: "输入内容不能只有空格" }
129
- ]
130
- }
131
- },
132
- {
133
- dataIndex: "tabsortList",
134
- title: "分类",
135
- valueType: "cascader",
136
- valueProps: {
137
- placeholder: "请选择分类",
138
- options: typeList,
139
- changeOnSelect: true,
140
- fieldNames: {
141
- label: "flinfo",
142
- value: "flinfo",
143
- children: "children"
144
- }
145
- },
146
- colProps: {
147
- span: 11
148
- }
149
- },
150
- {
151
- dataIndex: "fileList",
152
- title: "营业执照",
153
- valueType: "custom",
154
- valueProps: {
155
- children: /* @__PURE__ */ jsxRuntime.jsx(antd.Upload, { ...imgUploadProps, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { children: "上传营业执照" }) }),
156
- fileList: form.getFieldValue("fileList")
157
- },
158
- colProps: {
159
- md: 24,
160
- xl: 10
161
- },
162
- formItemProps: {
163
- valuePropName: "fileList",
164
- getValueFromEvent: normFile,
165
- rules: [{ required: true, message: "请上传营业执照" }]
166
- }
167
- }
168
- ];
169
- const totalText = "共@";
170
- const unitText = "条@";
171
- const jumpText = "跳至@";
172
- const pageText = "页@";
173
- const sm3key = "Aa123456#";
174
- const msg = "username=admin&timestamp=1758782465&modelid=19955BC7B61A43B3A982F0B2053ABC34";
175
- main.HmacSM3.hmac(sm3key, msg);
176
20
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column", gap: 20 }, children: [
177
21
  /* @__PURE__ */ jsxRuntime.jsx(main.BackHeader, { title: "页头组件", isBack: true }),
178
- /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 20, align: "center", children: [
179
- "1. 测试修改密码hooks",
22
+ /* @__PURE__ */ jsxRuntime.jsxs(antd.Form, { form, layout: "vertical", onFinish, children: [
23
+ "测试移动端动态组件",
180
24
  /* @__PURE__ */ jsxRuntime.jsx(
181
- antd.Button,
182
- {
183
- onClick: () => handleChangePwd((params) => {
184
- }),
185
- children: "修改密码"
186
- }
187
- )
25
+ main.DynamicForm,
26
+ {
27
+ interfaceTypeChildren: "YLFWLRDetailAttrlist",
28
+ formConfig: mock.attrList,
29
+ form,
30
+ readonly: false,
31
+ relatedid: "",
32
+ colNum: 1,
33
+ defaultWidth: "100%",
34
+ commonRequestWidthParams: services.commonRequestWidthParams,
35
+ uploadAction: services.uploadFormAction,
36
+ commonRequest: services.commonRequest,
37
+ instructionShowMode: "icon",
38
+ ref: formRef,
39
+ isMobile: true
40
+ }
41
+ ),
42
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "primary", htmlType: "submit", children: "提交" }) })
188
43
  ] }),
189
44
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
190
45
  "2. 测试循环滚动组件",
@@ -198,95 +53,9 @@ const Demo = () => {
198
53
  }
199
54
  }
200
55
  )
201
- ] }),
202
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
203
- /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 20, align: "center", style: { marginBottom: 10 }, children: [
204
- "3. 测试表格组件",
205
- /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: () => setList(columns), children: "test" })
206
- ] }),
207
- /* @__PURE__ */ jsxRuntime.jsx(
208
- main.SearchTable,
209
- {
210
- tableProps: {
211
- columns: [
212
- {
213
- dataIndex: "id",
214
- title: "ID"
215
- },
216
- {
217
- dataIndex: "a",
218
- title: "a",
219
- width: 200
220
- },
221
- {
222
- dataIndex: "a2",
223
- title: "a",
224
- width: 200
225
- },
226
- {
227
- dataIndex: "a3",
228
- title: "a",
229
- width: 200
230
- },
231
- {
232
- dataIndex: "a4",
233
- title: "a",
234
- width: 400
235
- }
236
- ],
237
- dataSource: list,
238
- resizeable: true,
239
- rowKey: "id",
240
- pagination: {
241
- total: 25,
242
- current,
243
- pageSize: 10,
244
- onChange(page, pageSize) {
245
- const index = (page - 1) * 10;
246
- const arr = Array(10).fill(0).map((v, i) => ({ id: i + index }));
247
- setList(arr);
248
- setCurrent(page);
249
- }
250
- }
251
- }
252
- }
253
- )
254
- ] }),
255
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
256
- "4. 测试创建表单组件",
257
- /* @__PURE__ */ jsxRuntime.jsx(
258
- main.CreateForm,
259
- {
260
- items: formItems,
261
- formProps: { form, wrapperCol: { span: 24 }, style: { width: "60%", marginTop: 10 } }
262
- }
263
- )
264
- ] }),
265
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
266
- "5. 测试自定义分页组件",
267
- /* @__PURE__ */ jsxRuntime.jsx(
268
- main.CustomPagination,
269
- {
270
- paginationProps: {
271
- total: 25,
272
- current,
273
- pageSize: 10,
274
- onChange(page, pageSize) {
275
- const index = (page - 1) * 10;
276
- const arr = Array(10).fill(0).map((v, i) => ({ id: i + index }));
277
- setList(arr);
278
- setCurrent(page);
279
- }
280
- },
281
- totalText,
282
- unitText,
283
- jumpText,
284
- pageText
285
- }
286
- )
287
56
  ] })
288
57
  ] });
289
58
  };
290
59
  ReactDOM.createRoot(document.getElementById("root")).render(
291
- /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.BrowserRouter, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.App, { children: /* @__PURE__ */ jsxRuntime.jsx(Demo, {}) }) })
60
+ /* @__PURE__ */ jsxRuntime.jsx(antd.ConfigProvider, { locale: zhCN, children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.BrowserRouter, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.App, { children: /* @__PURE__ */ jsxRuntime.jsx(Demo, {}) }) }) })
292
61
  );
@@ -0,0 +1,306 @@
1
+ export declare const baseAttrList: ({
2
+ xh: number;
3
+ asid: string;
4
+ astype: number;
5
+ tname: string;
6
+ attrid: string;
7
+ attrname: string;
8
+ attrtype: number;
9
+ info: string;
10
+ info_base64: number;
11
+ createtime: string;
12
+ attrvalue: string;
13
+ serialnum: number;
14
+ children: never[];
15
+ json: {
16
+ input: string;
17
+ dataType: string;
18
+ length: number;
19
+ 'range-picker-save'?: undefined;
20
+ 'disable-date-goover'?: undefined;
21
+ };
22
+ } | {
23
+ xh: number;
24
+ asid: string;
25
+ astype: number;
26
+ tname: string;
27
+ attrid: string;
28
+ attrname: string;
29
+ attrtype: number;
30
+ info: string;
31
+ info_base64: number;
32
+ createtime: string;
33
+ attrvalue: string;
34
+ serialnum: number;
35
+ children: never[];
36
+ json: {
37
+ input: string;
38
+ dataType: string;
39
+ length?: undefined;
40
+ 'range-picker-save'?: undefined;
41
+ 'disable-date-goover'?: undefined;
42
+ };
43
+ } | {
44
+ xh: number;
45
+ asid: string;
46
+ astype: number;
47
+ tname: string;
48
+ attrid: string;
49
+ attrname: string;
50
+ attrtype: number;
51
+ info: string;
52
+ info_base64: number;
53
+ createtime: string;
54
+ attrvalue: string;
55
+ serialnum: number;
56
+ children: never[];
57
+ json: {
58
+ input: string;
59
+ 'range-picker-save': string;
60
+ dataType: string;
61
+ length: number;
62
+ 'disable-date-goover': boolean;
63
+ };
64
+ })[];
65
+ export declare const attrList: any;
66
+ export declare const testList: ({
67
+ xh: number;
68
+ asid: string;
69
+ astype: number;
70
+ tname: string;
71
+ attrid: string;
72
+ attrname: string;
73
+ attrtype: number;
74
+ info: string;
75
+ info_base64: number;
76
+ createtime: string;
77
+ attrvalue: string;
78
+ serialnum: number;
79
+ children: never[];
80
+ json: {
81
+ input: string;
82
+ dataType: string;
83
+ length: number;
84
+ 'auto-generate': boolean;
85
+ 'auto-generate-type': string;
86
+ must?: undefined;
87
+ 'upload-accept'?: undefined;
88
+ 'upload-max-count'?: undefined;
89
+ 'upload-size'?: undefined;
90
+ instruction?: undefined;
91
+ 'instruction-color'?: undefined;
92
+ default?: undefined;
93
+ propertiesID?: undefined;
94
+ };
95
+ } | {
96
+ xh: number;
97
+ asid: string;
98
+ astype: number;
99
+ tname: string;
100
+ attrid: string;
101
+ attrname: string;
102
+ attrtype: number;
103
+ info: string;
104
+ info_base64: number;
105
+ createtime: string;
106
+ attrvalue: string;
107
+ serialnum: number;
108
+ children: never[];
109
+ json: {
110
+ input: string;
111
+ dataType: string;
112
+ length: number;
113
+ must: boolean;
114
+ 'auto-generate'?: undefined;
115
+ 'auto-generate-type'?: undefined;
116
+ 'upload-accept'?: undefined;
117
+ 'upload-max-count'?: undefined;
118
+ 'upload-size'?: undefined;
119
+ instruction?: undefined;
120
+ 'instruction-color'?: undefined;
121
+ default?: undefined;
122
+ propertiesID?: undefined;
123
+ };
124
+ } | {
125
+ xh: number;
126
+ asid: string;
127
+ astype: number;
128
+ tname: string;
129
+ attrid: string;
130
+ attrname: string;
131
+ attrtype: number;
132
+ info: string;
133
+ info_base64: number;
134
+ createtime: string;
135
+ attrvalue: string;
136
+ serialnum: number;
137
+ children: never[];
138
+ json: {
139
+ input: string;
140
+ dataType: string;
141
+ length: number;
142
+ 'auto-generate'?: undefined;
143
+ 'auto-generate-type'?: undefined;
144
+ must?: undefined;
145
+ 'upload-accept'?: undefined;
146
+ 'upload-max-count'?: undefined;
147
+ 'upload-size'?: undefined;
148
+ instruction?: undefined;
149
+ 'instruction-color'?: undefined;
150
+ default?: undefined;
151
+ propertiesID?: undefined;
152
+ };
153
+ } | {
154
+ xh: number;
155
+ asid: string;
156
+ astype: number;
157
+ tname: string;
158
+ attrid: string;
159
+ attrname: string;
160
+ attrtype: number;
161
+ info: string;
162
+ info_base64: number;
163
+ createtime: string;
164
+ attrvalue: string;
165
+ serialnum: number;
166
+ children: never[];
167
+ json: {
168
+ input: string;
169
+ 'upload-accept': string;
170
+ 'upload-max-count': string;
171
+ 'upload-size': string;
172
+ dataType: string;
173
+ length: number;
174
+ instruction: string;
175
+ 'instruction-color': string;
176
+ 'auto-generate'?: undefined;
177
+ 'auto-generate-type'?: undefined;
178
+ must?: undefined;
179
+ default?: undefined;
180
+ propertiesID?: undefined;
181
+ };
182
+ } | {
183
+ xh: number;
184
+ asid: string;
185
+ astype: number;
186
+ tname: string;
187
+ attrid: string;
188
+ attrname: string;
189
+ attrtype: number;
190
+ info: string;
191
+ info_base64: number;
192
+ createtime: string;
193
+ attrvalue: string;
194
+ serialnum: number;
195
+ children: never[];
196
+ json: {
197
+ input: string;
198
+ dataType: string;
199
+ default: string;
200
+ length?: undefined;
201
+ 'auto-generate'?: undefined;
202
+ 'auto-generate-type'?: undefined;
203
+ must?: undefined;
204
+ 'upload-accept'?: undefined;
205
+ 'upload-max-count'?: undefined;
206
+ 'upload-size'?: undefined;
207
+ instruction?: undefined;
208
+ 'instruction-color'?: undefined;
209
+ propertiesID?: undefined;
210
+ };
211
+ } | {
212
+ xh: number;
213
+ asid: string;
214
+ astype: number;
215
+ tname: string;
216
+ attrid: string;
217
+ attrname: string;
218
+ attrtype: number;
219
+ info: string;
220
+ info_base64: number;
221
+ createtime: string;
222
+ attrvalue: string;
223
+ serialnum: number;
224
+ children: ({
225
+ xh: number;
226
+ asid: string;
227
+ astype: number;
228
+ tname: string;
229
+ attrid: string;
230
+ attrname: string;
231
+ attrtype: number;
232
+ info: string;
233
+ info_base64: number;
234
+ createtime: string;
235
+ attrvalue: string;
236
+ serialnum: number;
237
+ children: never[];
238
+ json: {
239
+ input: string;
240
+ dataType: string;
241
+ length: number;
242
+ 'auto-generate': boolean;
243
+ 'auto-generate-type': string;
244
+ must?: undefined;
245
+ };
246
+ } | {
247
+ xh: number;
248
+ asid: string;
249
+ astype: number;
250
+ tname: string;
251
+ attrid: string;
252
+ attrname: string;
253
+ attrtype: number;
254
+ info: string;
255
+ info_base64: number;
256
+ createtime: string;
257
+ attrvalue: string;
258
+ serialnum: number;
259
+ children: never[];
260
+ json: {
261
+ input: string;
262
+ dataType: string;
263
+ length: number;
264
+ must: boolean;
265
+ 'auto-generate'?: undefined;
266
+ 'auto-generate-type'?: undefined;
267
+ };
268
+ } | {
269
+ xh: number;
270
+ asid: string;
271
+ astype: number;
272
+ tname: string;
273
+ attrid: string;
274
+ attrname: string;
275
+ attrtype: number;
276
+ info: string;
277
+ info_base64: number;
278
+ createtime: string;
279
+ attrvalue: string;
280
+ serialnum: number;
281
+ children: never[];
282
+ json: {
283
+ input: string;
284
+ dataType: string;
285
+ length: number;
286
+ 'auto-generate'?: undefined;
287
+ 'auto-generate-type'?: undefined;
288
+ must?: undefined;
289
+ };
290
+ })[][];
291
+ json: {
292
+ propertiesID: string;
293
+ input?: undefined;
294
+ dataType?: undefined;
295
+ length?: undefined;
296
+ 'auto-generate'?: undefined;
297
+ 'auto-generate-type'?: undefined;
298
+ must?: undefined;
299
+ 'upload-accept'?: undefined;
300
+ 'upload-max-count'?: undefined;
301
+ 'upload-size'?: undefined;
302
+ instruction?: undefined;
303
+ 'instruction-color'?: undefined;
304
+ default?: undefined;
305
+ };
306
+ })[];