szld-libs 0.2.98 → 0.3.1

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 (106) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/szld-components.es.js +32089 -20004
  3. package/dist/szld-components.umd.js +72 -60
  4. package/es/components/DynamicForm/index.d.ts +2 -0
  5. package/es/components/DynamicForm/index.js +3 -2
  6. package/es/components/DynamicForm/selectModel/index.js +1 -1
  7. package/es/components/DynamicForm/selectModelBackfillFormItem/index.d.ts +27 -0
  8. package/es/components/DynamicForm/selectModelBackfillFormItem/index.js +242 -0
  9. package/es/components/DynamicForm/selectModelBackfillFormItem/vite.svg +1 -0
  10. package/es/components/DynamicForm/useDynamicForm.js +22 -1
  11. package/es/components/DynamicFormMobile/func.d.ts +35 -0
  12. package/es/components/DynamicFormMobile/func.js +204 -0
  13. package/es/components/DynamicFormMobile/index.d.ts +116 -0
  14. package/es/components/DynamicFormMobile/index.js +134 -0
  15. package/es/components/DynamicFormMobile/myCascader/index.d.ts +17 -0
  16. package/es/components/DynamicFormMobile/myCascader/index.js +196 -0
  17. package/es/components/DynamicFormMobile/myCascader/vite.svg +1 -0
  18. package/es/components/DynamicFormMobile/myCheckbox/index.d.ts +19 -0
  19. package/es/components/DynamicFormMobile/myCheckbox/index.js +109 -0
  20. package/es/components/DynamicFormMobile/myCheckbox/vite.svg +1 -0
  21. package/es/components/DynamicFormMobile/myRadio/index.d.ts +20 -0
  22. package/es/components/DynamicFormMobile/myRadio/index.js +107 -0
  23. package/es/components/DynamicFormMobile/myRadio/vite.svg +1 -0
  24. package/es/components/DynamicFormMobile/mySelect/index.css +31 -0
  25. package/es/components/DynamicFormMobile/mySelect/index.d.ts +16 -0
  26. package/es/components/DynamicFormMobile/mySelect/index.js +147 -0
  27. package/es/components/DynamicFormMobile/mySelect/vite.svg +1 -0
  28. package/es/components/DynamicFormMobile/myUpload/index.css +3 -0
  29. package/es/components/DynamicFormMobile/myUpload/index.d.ts +16 -0
  30. package/es/components/DynamicFormMobile/myUpload/index.js +103 -0
  31. package/es/components/DynamicFormMobile/myUpload/vite.svg +1 -0
  32. package/es/components/DynamicFormMobile/radioCard/index.d.ts +12 -0
  33. package/es/components/DynamicFormMobile/radioCard/index.js +142 -0
  34. package/es/components/DynamicFormMobile/radioCard/vite.svg +1 -0
  35. package/es/components/DynamicFormMobile/selectModel/index.d.ts +22 -0
  36. package/es/components/DynamicFormMobile/selectModel/index.js +235 -0
  37. package/es/components/DynamicFormMobile/selectModel/vite.svg +1 -0
  38. package/es/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +27 -0
  39. package/es/components/DynamicFormMobile/selectModelBackfillFormItem/index.js +242 -0
  40. package/es/components/DynamicFormMobile/selectModelBackfillFormItem/vite.svg +1 -0
  41. package/es/components/DynamicFormMobile/useDynamicForm.d.ts +43 -0
  42. package/es/components/DynamicFormMobile/useDynamicForm.js +772 -0
  43. package/es/components/DynamicFormMobile/vite.svg +1 -0
  44. package/es/index.css +1 -0
  45. package/es/index.d.ts +1 -1
  46. package/es/index.js +36 -30
  47. package/es/main.d.ts +2 -1
  48. package/es/main.js +22 -20
  49. package/es/mock/index.d.ts +1 -305
  50. package/es/mock/index.js +20 -364
  51. package/es/services/index.js +3 -5
  52. package/es/services/request.js +2 -2
  53. package/es/utils/method.d.ts +4 -1
  54. package/es/utils/method.js +25 -8
  55. package/lib/components/DynamicForm/index.d.ts +2 -0
  56. package/lib/components/DynamicForm/index.js +3 -2
  57. package/lib/components/DynamicForm/selectModel/index.js +1 -1
  58. package/lib/components/DynamicForm/selectModelBackfillFormItem/index.d.ts +27 -0
  59. package/lib/components/DynamicForm/selectModelBackfillFormItem/index.js +242 -0
  60. package/lib/components/DynamicForm/selectModelBackfillFormItem/vite.svg +1 -0
  61. package/lib/components/DynamicForm/useDynamicForm.js +22 -1
  62. package/lib/components/DynamicFormMobile/func.d.ts +35 -0
  63. package/lib/components/DynamicFormMobile/func.js +204 -0
  64. package/lib/components/DynamicFormMobile/index.d.ts +116 -0
  65. package/lib/components/DynamicFormMobile/index.js +133 -0
  66. package/lib/components/DynamicFormMobile/myCascader/index.d.ts +17 -0
  67. package/lib/components/DynamicFormMobile/myCascader/index.js +195 -0
  68. package/lib/components/DynamicFormMobile/myCascader/vite.svg +1 -0
  69. package/lib/components/DynamicFormMobile/myCheckbox/index.d.ts +19 -0
  70. package/lib/components/DynamicFormMobile/myCheckbox/index.js +108 -0
  71. package/lib/components/DynamicFormMobile/myCheckbox/vite.svg +1 -0
  72. package/lib/components/DynamicFormMobile/myRadio/index.d.ts +20 -0
  73. package/lib/components/DynamicFormMobile/myRadio/index.js +106 -0
  74. package/lib/components/DynamicFormMobile/myRadio/vite.svg +1 -0
  75. package/lib/components/DynamicFormMobile/mySelect/index.css +31 -0
  76. package/lib/components/DynamicFormMobile/mySelect/index.d.ts +16 -0
  77. package/lib/components/DynamicFormMobile/mySelect/index.js +146 -0
  78. package/lib/components/DynamicFormMobile/mySelect/vite.svg +1 -0
  79. package/lib/components/DynamicFormMobile/myUpload/index.css +3 -0
  80. package/lib/components/DynamicFormMobile/myUpload/index.d.ts +16 -0
  81. package/lib/components/DynamicFormMobile/myUpload/index.js +102 -0
  82. package/lib/components/DynamicFormMobile/myUpload/vite.svg +1 -0
  83. package/lib/components/DynamicFormMobile/radioCard/index.d.ts +12 -0
  84. package/lib/components/DynamicFormMobile/radioCard/index.js +141 -0
  85. package/lib/components/DynamicFormMobile/radioCard/vite.svg +1 -0
  86. package/lib/components/DynamicFormMobile/selectModel/index.d.ts +22 -0
  87. package/lib/components/DynamicFormMobile/selectModel/index.js +235 -0
  88. package/lib/components/DynamicFormMobile/selectModel/vite.svg +1 -0
  89. package/lib/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +27 -0
  90. package/lib/components/DynamicFormMobile/selectModelBackfillFormItem/index.js +242 -0
  91. package/lib/components/DynamicFormMobile/selectModelBackfillFormItem/vite.svg +1 -0
  92. package/lib/components/DynamicFormMobile/useDynamicForm.d.ts +43 -0
  93. package/lib/components/DynamicFormMobile/useDynamicForm.js +771 -0
  94. package/lib/components/DynamicFormMobile/vite.svg +1 -0
  95. package/lib/index.css +1 -0
  96. package/lib/index.d.ts +1 -1
  97. package/lib/index.js +36 -30
  98. package/lib/main.d.ts +2 -1
  99. package/lib/main.js +2 -0
  100. package/lib/mock/index.d.ts +1 -305
  101. package/lib/mock/index.js +19 -363
  102. package/lib/services/index.js +3 -5
  103. package/lib/services/request.js +2 -2
  104. package/lib/utils/method.d.ts +4 -1
  105. package/lib/utils/method.js +25 -8
  106. package/package.json +1 -1
@@ -0,0 +1,107 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { App, Radio } from "antd";
3
+ import { useState, useEffect } from "react";
4
+ const MyRadio = (props) => {
5
+ const {
6
+ item,
7
+ onChange,
8
+ readonly = false,
9
+ options,
10
+ radioAlign = "horizontal",
11
+ commonRequestWidthParams,
12
+ commonRequest,
13
+ handleUrlOptions,
14
+ value,
15
+ interfaceTypeDict,
16
+ interfaceTypeSysDict,
17
+ actionUrlKey,
18
+ actionUrlExtraParams
19
+ } = props;
20
+ const { message } = App.useApp();
21
+ const [list, setList] = useState([]);
22
+ useEffect(() => {
23
+ if ((item == null ? void 0 : item.inputType) === "local") {
24
+ const arr = (item == null ? void 0 : item.data) || [];
25
+ setList(arr.map((v) => ({ value: v, label: v })));
26
+ } else if ((item == null ? void 0 : item.inputType) === "dictionary") {
27
+ getList(item.classify, interfaceTypeDict);
28
+ } else if ((item == null ? void 0 : item.inputType) === "system-dictionary") {
29
+ getList(item.classify, interfaceTypeSysDict);
30
+ } else if ((item == null ? void 0 : item.inputType) === "url") {
31
+ getUrlList();
32
+ }
33
+ }, [item == null ? void 0 : item.inputType]);
34
+ const getList = async (id, interfaceType) => {
35
+ var _a;
36
+ if (!id) {
37
+ return;
38
+ }
39
+ const res = await commonRequest(interfaceType, { asctypeid: id });
40
+ if ((res == null ? void 0 : res.ReturnValue) === 1) {
41
+ const arr = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || [];
42
+ setList(
43
+ arr.map((v) => {
44
+ const value2 = v.dicid + "-" + v.info;
45
+ return { value: value2, label: value2 };
46
+ })
47
+ );
48
+ }
49
+ };
50
+ const getUrlList = async () => {
51
+ var _a, _b;
52
+ try {
53
+ const keyFieldList = ((_a = item == null ? void 0 : item["key-field"]) == null ? void 0 : _a.list) || [];
54
+ const delimiter = ((_b = item == null ? void 0 : item["key-field"]) == null ? void 0 : _b.delimiter) || "";
55
+ if (!keyFieldList.length) {
56
+ message.error("请配置key-field");
57
+ return;
58
+ }
59
+ if (!commonRequestWidthParams)
60
+ return;
61
+ const response = await commonRequestWidthParams(
62
+ {
63
+ PageName: "dns_relay",
64
+ Controlname: "CallActionUrl",
65
+ InterfaceType: ""
66
+ },
67
+ {
68
+ [actionUrlKey]: item == null ? void 0 : item["action-url"],
69
+ ...actionUrlExtraParams
70
+ }
71
+ );
72
+ if (response == null ? void 0 : response.data) {
73
+ const data = response == null ? void 0 : response.data;
74
+ const list2 = data == null ? void 0 : data.list;
75
+ let urlData = [];
76
+ if (Array.isArray(data)) {
77
+ urlData = data;
78
+ }
79
+ if (Array.isArray(list2)) {
80
+ urlData = list2;
81
+ }
82
+ const urlOptions = urlData.map((val) => ({
83
+ label: handleUrlOptions(val, delimiter, keyFieldList),
84
+ value: handleUrlOptions(val, delimiter, keyFieldList)
85
+ }));
86
+ setList([...urlOptions]);
87
+ }
88
+ } catch (error) {
89
+ message.error("加载选项失败");
90
+ } finally {
91
+ }
92
+ };
93
+ return /* @__PURE__ */ jsx(
94
+ Radio.Group,
95
+ {
96
+ ...options,
97
+ options: list,
98
+ onChange,
99
+ disabled: readonly,
100
+ value,
101
+ style: radioAlign === "vertical" ? { display: "flex", flexDirection: "column", gap: "8px", width: "100%" } : { width: "100%" }
102
+ }
103
+ );
104
+ };
105
+ export {
106
+ MyRadio as default
107
+ };
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,31 @@
1
+ .index-module_checkbox-group_4684b {
2
+ padding: 16px;
3
+ display: flex;
4
+ flex-direction: column;
5
+ font-size: 14px;
6
+ overflow: hidden;
7
+ position: relative;
8
+ }
9
+ .index-module_checkbox-group_4684b .index-module_checkbox-group-header_192bd {
10
+ font-size: 14px;
11
+ margin-bottom: 20px;
12
+ flex-shrink: 0;
13
+ position: absolute;
14
+ padding: 16px;
15
+ background-color: #fff;
16
+ top: 0;
17
+ left: 0;
18
+ right: 0;
19
+ }
20
+ .index-module_checkbox-group_4684b .index-module_checkbox-group-content_f81a1 {
21
+ overflow-y: auto;
22
+ margin-top: 34px;
23
+ }
24
+ .index-module_checkbox-group_4684b .index-module_checkbox-group-content_f81a1 .index-module_checkbox-item_1b36c {
25
+ font-size: 14px;
26
+ margin-bottom: 12px;
27
+ }
28
+ .index-module_checkbox-group_4684b .index-module_checkbox-group-cancel_c5cfb {
29
+ font-size: 14px;
30
+ color: #999;
31
+ }
@@ -0,0 +1,16 @@
1
+ import { Ijson } from '../index.d';
2
+ import { AxiosResponse } from 'axios';
3
+ declare const MySelect: ({ item, readonly, style, commonRequestWidthParams, commonRequest, value, onChange, interfaceTypeDict, interfaceTypeSysDict, actionUrlKey, actionUrlExtraParams, }: {
4
+ item: Ijson;
5
+ readonly?: boolean | undefined;
6
+ style?: any;
7
+ commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
8
+ commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
9
+ value: string | number | (string | number)[];
10
+ onChange: (val: string | number | (string | number)) => void;
11
+ interfaceTypeDict: string;
12
+ interfaceTypeSysDict: string;
13
+ actionUrlKey: string;
14
+ actionUrlExtraParams: object;
15
+ }) => import("react/jsx-runtime").JSX.Element;
16
+ export default MySelect;
@@ -0,0 +1,147 @@
1
+ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
+ import { Field, Popup, Checkbox, Picker } from "react-vant";
3
+ import { handleSelectOptions } from "../func";
4
+ import { useState, useEffect } from "react";
5
+ import { Flex } from "antd";
6
+ const checkboxGroup = "index-module_checkbox-group_4684b";
7
+ const checkboxGroupHeader = "index-module_checkbox-group-header_192bd";
8
+ const checkboxGroupContent = "index-module_checkbox-group-content_f81a1";
9
+ const checkboxItem = "index-module_checkbox-item_1b36c";
10
+ const checkboxGroupCancel = "index-module_checkbox-group-cancel_c5cfb";
11
+ const styles = {
12
+ "checkbox-group": "index-module_checkbox-group_4684b",
13
+ checkboxGroup,
14
+ "checkbox-group-header": "index-module_checkbox-group-header_192bd",
15
+ checkboxGroupHeader,
16
+ "checkbox-group-content": "index-module_checkbox-group-content_f81a1",
17
+ checkboxGroupContent,
18
+ "checkbox-item": "index-module_checkbox-item_1b36c",
19
+ checkboxItem,
20
+ "checkbox-group-cancel": "index-module_checkbox-group-cancel_c5cfb",
21
+ checkboxGroupCancel
22
+ };
23
+ const MySelect = ({
24
+ item,
25
+ readonly,
26
+ style,
27
+ commonRequestWidthParams,
28
+ commonRequest,
29
+ value,
30
+ onChange,
31
+ interfaceTypeDict,
32
+ interfaceTypeSysDict,
33
+ actionUrlKey,
34
+ actionUrlExtraParams
35
+ }) => {
36
+ const [options, setOptions] = useState([]);
37
+ useEffect(() => {
38
+ if (item.input === "mult-select" && value && Array.isArray(value)) {
39
+ setSelectedValues(value || []);
40
+ setConfirmValues(value || []);
41
+ }
42
+ }, [value]);
43
+ useEffect(() => {
44
+ handleLoadOptions();
45
+ }, [item.inputType, item.classify, item.data, item.options]);
46
+ const handleLoadOptions = async () => {
47
+ const list = await handleSelectOptions({
48
+ commonRequestWidthParams,
49
+ commonRequest,
50
+ interfaceTypeDict,
51
+ interfaceTypeSysDict,
52
+ actionUrlKey,
53
+ actionUrlExtraParams,
54
+ item
55
+ });
56
+ setOptions(list);
57
+ };
58
+ const [showPopup, setShowPopup] = useState(false);
59
+ const [selectedValues, setSelectedValues] = useState([]);
60
+ const [confirmValues, setConfirmValues] = useState([]);
61
+ return /* @__PURE__ */ jsx(Fragment, { children: item.input === "mult-select" ? /* @__PURE__ */ jsxs("div", { style: { width: "100%", ...style }, children: [
62
+ /* @__PURE__ */ jsx(
63
+ Field,
64
+ {
65
+ style: { padding: 0 },
66
+ isLink: true,
67
+ readOnly: true,
68
+ value: (confirmValues == null ? void 0 : confirmValues.length) ? confirmValues == null ? void 0 : confirmValues.join(",") : "",
69
+ onClick: () => {
70
+ if (readonly)
71
+ return;
72
+ setSelectedValues([...confirmValues]);
73
+ setShowPopup(true);
74
+ },
75
+ placeholder: (item == null ? void 0 : item["default-prompt"]) || "请选择"
76
+ }
77
+ ),
78
+ /* @__PURE__ */ jsx(
79
+ Popup,
80
+ {
81
+ visible: showPopup,
82
+ round: true,
83
+ position: "bottom",
84
+ style: { height: "60vh" },
85
+ onClose: () => setShowPopup(false),
86
+ children: /* @__PURE__ */ jsxs("div", { className: styles["checkbox-group"], children: [
87
+ /* @__PURE__ */ jsxs(Flex, { justify: "space-between", className: styles["checkbox-group-header"], children: [
88
+ /* @__PURE__ */ jsx("a", { className: styles["checkbox-group-cancel"], onClick: () => setShowPopup(false), children: "取消" }),
89
+ /* @__PURE__ */ jsx(
90
+ "a",
91
+ {
92
+ onClick: () => {
93
+ setShowPopup(false);
94
+ setConfirmValues([...selectedValues]);
95
+ onChange((selectedValues == null ? void 0 : selectedValues.length) ? selectedValues == null ? void 0 : selectedValues.join(",") : "");
96
+ },
97
+ children: "确定"
98
+ }
99
+ )
100
+ ] }),
101
+ /* @__PURE__ */ jsx(
102
+ "div",
103
+ {
104
+ style: {
105
+ height: " calc(60vh - 70px)"
106
+ },
107
+ className: styles["checkbox-group-content"],
108
+ children: /* @__PURE__ */ jsx(Checkbox.Group, { iconSize: "18", onChange: (v) => setSelectedValues(v), value: selectedValues, children: options.map((item2) => /* @__PURE__ */ jsx(Checkbox, { shape: "square", className: styles["checkbox-item"], name: item2.value, children: item2.label }, item2.value)) })
109
+ }
110
+ )
111
+ ] })
112
+ }
113
+ )
114
+ ] }) : /* @__PURE__ */ jsx(
115
+ Picker,
116
+ {
117
+ popup: true,
118
+ columns: options,
119
+ placeholder: "",
120
+ columnsFieldNames: {
121
+ text: "value"
122
+ },
123
+ onConfirm: onChange,
124
+ children: (val, _, actions) => {
125
+ return /* @__PURE__ */ jsx(
126
+ Field,
127
+ {
128
+ style: { padding: 0, ...style },
129
+ isLink: true,
130
+ readOnly: true,
131
+ clickable: true,
132
+ placeholder: (item == null ? void 0 : item["default-prompt"]) || "请选择",
133
+ value: Array.isArray(val) ? val.join(",") : val || value,
134
+ onClick: () => {
135
+ if (readonly)
136
+ return;
137
+ actions.open();
138
+ }
139
+ }
140
+ );
141
+ }
142
+ }
143
+ ) });
144
+ };
145
+ export {
146
+ MySelect as default
147
+ };
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,3 @@
1
+ .myUpload-module_customUpload_5ec38 a {
2
+ color: #252525 !important;
3
+ }
@@ -0,0 +1,16 @@
1
+ import { UploadFile } from 'antd/es/upload/interface';
2
+ import { Ijson } from '../index.d';
3
+ interface IMYUpload {
4
+ action?: string;
5
+ onChange?: (checkedValue: any[]) => void;
6
+ onRemove?: (file: UploadFile) => void;
7
+ item: Ijson;
8
+ relatedid?: string;
9
+ readonly?: boolean;
10
+ list?: UploadFile[];
11
+ uploadText?: string;
12
+ uploadType?: string;
13
+ relatedidKey: string;
14
+ }
15
+ declare const MyUpload: (props: IMYUpload) => import("react/jsx-runtime").JSX.Element;
16
+ export default MyUpload;
@@ -0,0 +1,103 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { PlusOutlined, UploadOutlined } from "@ant-design/icons";
3
+ import { App, Upload, Image, Button } from "antd";
4
+ import { useState, useEffect } from "react";
5
+ const customUpload = "myUpload-module_customUpload_5ec38";
6
+ const styles = {
7
+ customUpload
8
+ };
9
+ const getBase64 = (file) => new Promise((resolve, reject) => {
10
+ const reader = new FileReader();
11
+ reader.readAsDataURL(file);
12
+ reader.onload = () => resolve(reader.result);
13
+ reader.onerror = (error) => reject(error);
14
+ });
15
+ const MyUpload = (props) => {
16
+ const {
17
+ action,
18
+ item,
19
+ onChange,
20
+ readonly = false,
21
+ relatedid,
22
+ uploadText = "上传文件",
23
+ onRemove,
24
+ list = [],
25
+ uploadType,
26
+ relatedidKey
27
+ } = props;
28
+ const { message } = App.useApp();
29
+ const accept = (item == null ? void 0 : item["upload-accept"]) || "*";
30
+ const input = item == null ? void 0 : item["input"];
31
+ const size = item == null ? void 0 : item["upload-size"];
32
+ const maxCount = (item == null ? void 0 : item["upload-max-count"]) || 1;
33
+ const [listType, setListType] = useState(input === "image" ? "picture-card" : "text");
34
+ const [fileList, setFileList] = useState([]);
35
+ const [previewOpen, setPreviewOpen] = useState(false);
36
+ const [previewImage, setPreviewImage] = useState("");
37
+ useEffect(() => {
38
+ if (list && list.length) {
39
+ setFileList(list);
40
+ }
41
+ }, [list]);
42
+ const handlePreview = async (file) => {
43
+ if (uploadType !== "image")
44
+ return;
45
+ if (!file.url && !file.preview) {
46
+ file.preview = await getBase64(file.originFileObj);
47
+ }
48
+ setPreviewImage(file.url || file.preview);
49
+ setPreviewOpen(true);
50
+ };
51
+ const handleChange = ({ fileList: newFileList }) => {
52
+ setFileList(newFileList);
53
+ onChange && onChange(newFileList);
54
+ };
55
+ const handleBeforeUpload = (file) => {
56
+ if (!size)
57
+ return true;
58
+ const isLt = file.size / 1024 / 1024 < Number(size);
59
+ if (!isLt) {
60
+ message.error(`请上传不超过${size}MB的文件`);
61
+ }
62
+ return isLt;
63
+ };
64
+ const uploadButton = input === "image" ? /* @__PURE__ */ jsxs("button", { style: { border: 0, background: "none" }, type: "button", children: [
65
+ /* @__PURE__ */ jsx(PlusOutlined, {}),
66
+ /* @__PURE__ */ jsx("div", { style: { marginTop: 8 }, children: "Upload" })
67
+ ] }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Button, { icon: /* @__PURE__ */ jsx(UploadOutlined, {}), children: uploadText }) });
68
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
69
+ /* @__PURE__ */ jsx(
70
+ Upload,
71
+ {
72
+ action,
73
+ beforeUpload: handleBeforeUpload,
74
+ listType,
75
+ accept,
76
+ fileList,
77
+ onPreview: handlePreview,
78
+ data: { [relatedidKey]: relatedid },
79
+ maxCount,
80
+ onChange: handleChange,
81
+ onRemove,
82
+ disabled: readonly,
83
+ className: styles.customUpload,
84
+ children: fileList.length >= maxCount ? null : uploadButton
85
+ }
86
+ ),
87
+ previewImage && /* @__PURE__ */ jsx(
88
+ Image,
89
+ {
90
+ wrapperStyle: { display: "none" },
91
+ preview: {
92
+ visible: previewOpen,
93
+ onVisibleChange: (visible) => setPreviewOpen(visible),
94
+ afterOpenChange: (visible) => !visible && setPreviewImage("")
95
+ },
96
+ src: previewImage
97
+ }
98
+ )
99
+ ] });
100
+ };
101
+ export {
102
+ MyUpload as default
103
+ };
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { AxiosResponse } from 'axios';
3
+ interface RadioCardProps {
4
+ item: any;
5
+ readonly?: boolean;
6
+ value?: string;
7
+ onChange?: (value: any) => void;
8
+ style?: React.CSSProperties;
9
+ commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
10
+ }
11
+ declare const RadioCard: ({ item, readonly, value, onChange, style, commonRequestWidthParams }: RadioCardProps) => import("react/jsx-runtime").JSX.Element;
12
+ export default RadioCard;
@@ -0,0 +1,142 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { CheckOutlined } from "@ant-design/icons";
3
+ import { useState, useEffect } from "react";
4
+ import { Space } from "antd";
5
+ const RadioCard = ({ item, readonly, value, onChange, style, commonRequestWidthParams }) => {
6
+ const [cardData, setCardData] = useState([]);
7
+ const [loading, setLoading] = useState(false);
8
+ useEffect(() => {
9
+ const loadCardData = async () => {
10
+ var _a;
11
+ if (item.inputType === "url" && item["action-url"]) {
12
+ setLoading(true);
13
+ try {
14
+ const response = await commonRequestWidthParams(
15
+ {
16
+ PageName: "dns_relay",
17
+ Controlname: "CallActionUrl",
18
+ InterfaceType: ""
19
+ },
20
+ {
21
+ "action-url": item == null ? void 0 : item["action-url"]
22
+ }
23
+ );
24
+ if (((_a = response == null ? void 0 : response.data) == null ? void 0 : _a.list) && Array.isArray(response.data.list)) {
25
+ setCardData(response.data.list);
26
+ } else if ((response == null ? void 0 : response.data) && Array.isArray(response.data)) {
27
+ setCardData(response.data);
28
+ } else if (Array.isArray(response == null ? void 0 : response.list)) {
29
+ setCardData(response.list);
30
+ } else if ((response == null ? void 0 : response.ReturnValue) === 1 && (response == null ? void 0 : response.data)) {
31
+ if (Array.isArray(response.data)) {
32
+ setCardData(response.data);
33
+ } else {
34
+ setCardData([response.data]);
35
+ }
36
+ }
37
+ } catch (error) {
38
+ } finally {
39
+ setLoading(false);
40
+ }
41
+ } else if (item.data && Array.isArray(item.data)) {
42
+ setCardData(item.data);
43
+ }
44
+ };
45
+ loadCardData();
46
+ }, [item.inputType, item["action-url"], item.data]);
47
+ const buildValue = (record) => {
48
+ return JSON.stringify(record);
49
+ };
50
+ const isSelected = (record) => {
51
+ const recordValue = buildValue(record);
52
+ return value === recordValue;
53
+ };
54
+ const handleCardClick = (record) => {
55
+ if (readonly)
56
+ return;
57
+ const recordValue = buildValue(record);
58
+ onChange && onChange(recordValue);
59
+ };
60
+ const imageWidth = item["card-image-width"] || 200;
61
+ const imageHeight = item["card-image-height"] || 100;
62
+ const imageField = item["card-image-field"];
63
+ const infoField = item["card-info-field"];
64
+ return /* @__PURE__ */ jsx("div", { style: { ...style }, children: loading ? /* @__PURE__ */ jsx("div", { style: { textAlign: "center", padding: "20px" }, children: "加载中..." }) : /* @__PURE__ */ jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "0px" }, children: cardData.map((record, index) => {
65
+ const selected = isSelected(record);
66
+ return /* @__PURE__ */ jsxs(
67
+ "div",
68
+ {
69
+ onClick: () => handleCardClick(record),
70
+ style: {
71
+ flex: "1 1 auto",
72
+ width: `${imageWidth}px`,
73
+ padding: "12px",
74
+ cursor: readonly ? "not-allowed" : "pointer",
75
+ opacity: readonly ? 0.6 : 1,
76
+ transition: "all 0.3s"
77
+ },
78
+ children: [
79
+ record[imageField] && /* @__PURE__ */ jsx(
80
+ "img",
81
+ {
82
+ src: record.picurl,
83
+ alt: record[infoField] || "",
84
+ style: {
85
+ width: `${imageWidth}px`,
86
+ height: `${imageHeight}px`,
87
+ objectFit: "cover",
88
+ borderRadius: "4px",
89
+ marginBottom: "8px"
90
+ },
91
+ onError: (e) => {
92
+ e.currentTarget.style.display = "none";
93
+ }
94
+ }
95
+ ),
96
+ /* @__PURE__ */ jsx(
97
+ "div",
98
+ {
99
+ style: {
100
+ fontSize: "14px",
101
+ color: "#333333"
102
+ },
103
+ children: /* @__PURE__ */ jsxs(Space, { size: 6, children: [
104
+ /* @__PURE__ */ jsx(
105
+ "div",
106
+ {
107
+ style: {
108
+ width: "16px",
109
+ height: "16px",
110
+ borderRadius: "50%",
111
+ border: selected ? "none" : "1px solid #d9d9d9",
112
+ backgroundColor: selected ? "var(--color-primary)" : "transparent",
113
+ display: "flex",
114
+ alignItems: "center",
115
+ justifyContent: "center",
116
+ flexShrink: 0,
117
+ cursor: readonly ? "not-allowed" : "pointer"
118
+ },
119
+ children: selected && /* @__PURE__ */ jsx(
120
+ CheckOutlined,
121
+ {
122
+ style: {
123
+ fontSize: "12px",
124
+ color: "#fff"
125
+ }
126
+ }
127
+ )
128
+ }
129
+ ),
130
+ record[infoField] || ""
131
+ ] })
132
+ }
133
+ )
134
+ ]
135
+ },
136
+ index
137
+ );
138
+ }) }) });
139
+ };
140
+ export {
141
+ RadioCard as default
142
+ };
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { AxiosResponse } from 'axios';
3
+ import { Ijson } from '../index.d';
4
+ interface SelectModelProps {
5
+ item: Ijson;
6
+ onSure: (value: string) => void;
7
+ value: string;
8
+ disabled: boolean;
9
+ style?: React.CSSProperties;
10
+ commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
11
+ commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
12
+ CustomModalComponent?: React.FC<ICustomModal>;
13
+ }
14
+ declare function SelectModel(props: SelectModelProps): import("react/jsx-runtime").JSX.Element;
15
+ /**
16
+ *
17
+ * @param selectedRows 选中的行数据
18
+ * @param attributeEnrollFormat 配置信息
19
+ * @returns 构建后的字符串
20
+ */
21
+ export declare function buildValueFromSelectedRows(selectedRows: any[], attributeEnrollFormat: Ijson): Promise<string>;
22
+ export default SelectModel;