szld-libs 0.4.49 → 0.4.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.
Files changed (70) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/szld-components.es.js +20249 -19514
  3. package/dist/szld-components.umd.js +229 -113
  4. package/es/components/DynamicForm/func.d.ts +2 -2
  5. package/es/components/DynamicForm/func.js +12 -7
  6. package/es/components/DynamicForm/index.d.ts +1 -0
  7. package/es/components/DynamicForm/index.js +41 -7
  8. package/es/components/DynamicForm/myCascader/index.d.ts +2 -1
  9. package/es/components/DynamicForm/myCascader/index.js +9 -11
  10. package/es/components/DynamicForm/myRadio/index.d.ts +5 -1
  11. package/es/components/DynamicForm/myRadio/index.js +63 -17
  12. package/es/components/DynamicForm/myRichText/index.d.ts +3 -1
  13. package/es/components/DynamicForm/myRichText/index.js +20 -30
  14. package/es/components/DynamicForm/mySelect/index.js +1 -1
  15. package/es/components/DynamicForm/selectModelBackfillFormItem/index.js +1 -1
  16. package/es/components/DynamicForm/useDynamicForm.d.ts +1 -0
  17. package/es/components/DynamicForm/useDynamicForm.js +23 -19
  18. package/es/components/DynamicFormMobile/func.js +4 -0
  19. package/es/components/DynamicFormMobile/myRichText/enmu.d.ts +5 -0
  20. package/es/components/DynamicFormMobile/myRichText/enmu.js +68 -0
  21. package/es/components/DynamicFormMobile/myRichText/index.d.ts +11 -0
  22. package/es/components/DynamicFormMobile/myRichText/index.js +291 -0
  23. package/es/components/DynamicFormMobile/myRichText/vite.svg +1 -0
  24. package/es/components/DynamicFormMobile/mySelect/index.css +9 -1
  25. package/es/components/DynamicFormMobile/mySelect/index.d.ts +1 -1
  26. package/es/components/DynamicFormMobile/mySelect/index.js +55 -24
  27. package/es/components/DynamicFormMobile/myUpload/index.d.ts +1 -1
  28. package/es/components/DynamicFormMobile/selectModel/index.d.ts +1 -1
  29. package/es/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +1 -1
  30. package/es/components/DynamicFormMobile/useDynamicForm.d.ts +2 -2
  31. package/es/components/DynamicFormMobile/useDynamicForm.js +19 -4
  32. package/es/index.js +1 -1
  33. package/es/utils/szxkFunc.d.ts +11 -0
  34. package/es/utils/szxkFunc.js +25 -0
  35. package/lib/components/DynamicForm/func.d.ts +2 -2
  36. package/lib/components/DynamicForm/func.js +12 -7
  37. package/lib/components/DynamicForm/index.d.ts +1 -0
  38. package/lib/components/DynamicForm/index.js +38 -4
  39. package/lib/components/DynamicForm/myCascader/index.d.ts +2 -1
  40. package/lib/components/DynamicForm/myCascader/index.js +9 -11
  41. package/lib/components/DynamicForm/myRadio/index.d.ts +5 -1
  42. package/lib/components/DynamicForm/myRadio/index.js +61 -15
  43. package/lib/components/DynamicForm/myRichText/index.d.ts +3 -1
  44. package/lib/components/DynamicForm/myRichText/index.js +19 -29
  45. package/lib/components/DynamicForm/mySelect/index.js +1 -1
  46. package/lib/components/DynamicForm/selectModelBackfillFormItem/index.js +1 -1
  47. package/lib/components/DynamicForm/useDynamicForm.d.ts +1 -0
  48. package/lib/components/DynamicForm/useDynamicForm.js +19 -15
  49. package/lib/components/DynamicFormMobile/func.js +4 -0
  50. package/lib/components/DynamicFormMobile/myRichText/enmu.d.ts +5 -0
  51. package/lib/components/DynamicFormMobile/myRichText/enmu.js +68 -0
  52. package/lib/components/DynamicFormMobile/myRichText/index.d.ts +11 -0
  53. package/lib/components/DynamicFormMobile/myRichText/index.js +290 -0
  54. package/lib/components/DynamicFormMobile/myRichText/vite.svg +1 -0
  55. package/lib/components/DynamicFormMobile/mySelect/index.css +9 -1
  56. package/lib/components/DynamicFormMobile/mySelect/index.d.ts +1 -1
  57. package/lib/components/DynamicFormMobile/mySelect/index.js +55 -24
  58. package/lib/components/DynamicFormMobile/myUpload/index.d.ts +1 -1
  59. package/lib/components/DynamicFormMobile/selectModel/index.d.ts +1 -1
  60. package/lib/components/DynamicFormMobile/selectModelBackfillFormItem/index.d.ts +1 -1
  61. package/lib/components/DynamicFormMobile/useDynamicForm.d.ts +2 -2
  62. package/lib/components/DynamicFormMobile/useDynamicForm.js +19 -4
  63. package/lib/index.js +1 -1
  64. package/lib/utils/szxkFunc.d.ts +11 -0
  65. package/lib/utils/szxkFunc.js +25 -0
  66. package/package.json +2 -1
  67. package/es/utils/enum.d.ts +0 -4
  68. package/es/utils/enum.js +0 -10
  69. package/lib/utils/enum.d.ts +0 -4
  70. package/lib/utils/enum.js +0 -10
@@ -3,12 +3,13 @@ const jsxRuntime = require("react/jsx-runtime");
3
3
  const antd = require("antd");
4
4
  const react = require("react");
5
5
  const func = require("../func");
6
+ const szxkFunc = require("szld-libs/es/utils/szxkFunc");
6
7
  const MyRadio = (props) => {
7
8
  const {
8
9
  item,
9
10
  onChange,
10
11
  readonly = false,
11
- options,
12
+ params,
12
13
  radioAlign = "horizontal",
13
14
  commonRequestWidthParams,
14
15
  commonRequest,
@@ -16,34 +17,79 @@ const MyRadio = (props) => {
16
17
  interfaceTypeDict,
17
18
  interfaceTypeSysDict,
18
19
  actionUrlKey,
19
- actionUrlExtraParams
20
+ actionUrlExtraParams,
21
+ getTitle,
22
+ attrid,
23
+ langId,
24
+ langData
20
25
  } = props;
26
+ const [loading, setLoading] = react.useState(false);
21
27
  const [list, setList] = react.useState([]);
28
+ const [instanceList, setInstanceList] = react.useState([]);
22
29
  react.useEffect(() => {
23
30
  handleLoadOptions();
24
31
  }, [item.inputType, item.classify, item.data, item.options]);
25
32
  const handleLoadOptions = async () => {
26
- const list2 = await func.handleSelectOptions({
27
- commonRequestWidthParams,
28
- commonRequest,
29
- interfaceTypeDict,
30
- interfaceTypeSysDict,
31
- actionUrlKey,
32
- actionUrlExtraParams,
33
- item
34
- });
35
- setList(list2);
33
+ try {
34
+ setLoading(true);
35
+ if (item.inputType === "instance-url" && (item == null ? void 0 : item["instance-source-number"]) && attrid) {
36
+ const keyField = item == null ? void 0 : item["key-field"];
37
+ if (!keyField) {
38
+ antd.message.warning(langId ? func.getTitle(langData, "010") : "请配置key-field");
39
+ return;
40
+ }
41
+ const params2 = {
42
+ "source-number": item == null ? void 0 : item["instance-source-number"]
43
+ };
44
+ let list3 = await szxkFunc.handleGetList(params2, commonRequestWidthParams);
45
+ const controlPanelConfig = await szxkFunc.handleGetControlPanelConfig(item == null ? void 0 : item["instance-source-number"], commonRequest);
46
+ if (controlPanelConfig) {
47
+ const nonUniversalHeader = (controlPanelConfig == null ? void 0 : controlPanelConfig["non-universal-header"]) || [];
48
+ const labelConfig = (nonUniversalHeader == null ? void 0 : nonUniversalHeader["label"]) || [];
49
+ const valueConfig = (keyField == null ? void 0 : keyField[attrid]) || {};
50
+ const options = list3 == null ? void 0 : list3.map((v) => {
51
+ const label = labelConfig == null ? void 0 : labelConfig.map((x) => v == null ? void 0 : v[x]).join("-");
52
+ const { list: list4, delimiter } = valueConfig;
53
+ const value2 = list4 == null ? void 0 : list4.map((x) => v == null ? void 0 : v[x]).join(delimiter || "-");
54
+ if (!label) {
55
+ return null;
56
+ }
57
+ return {
58
+ label: getTitle == null ? void 0 : getTitle((item == null ? void 0 : item["lang-page-id"]) || "5000000", label || label),
59
+ value: value2
60
+ };
61
+ });
62
+ setList(options);
63
+ setInstanceList(list3);
64
+ }
65
+ setLoading(false);
66
+ return;
67
+ }
68
+ const list2 = await func.handleSelectOptions({
69
+ commonRequestWidthParams,
70
+ commonRequest,
71
+ interfaceTypeDict,
72
+ interfaceTypeSysDict,
73
+ actionUrlKey,
74
+ actionUrlExtraParams,
75
+ item
76
+ });
77
+ setList(list2);
78
+ setLoading(false);
79
+ } catch (error) {
80
+ setLoading(false);
81
+ }
36
82
  };
37
- return /* @__PURE__ */ jsxRuntime.jsx(
83
+ return /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: loading, children: /* @__PURE__ */ jsxRuntime.jsx(
38
84
  antd.Radio.Group,
39
85
  {
40
- ...options,
86
+ ...params,
41
87
  options: list,
42
88
  onChange,
43
89
  disabled: readonly,
44
90
  value,
45
91
  style: radioAlign === "vertical" ? { display: "flex", flexDirection: "column", gap: "8px", width: "100%" } : { width: "100%" }
46
92
  }
47
- );
93
+ ) });
48
94
  };
49
95
  module.exports = MyRadio;
@@ -4,7 +4,9 @@ interface IMyRichTextProps {
4
4
  readonly: boolean;
5
5
  style: React.CSSProperties;
6
6
  value: string;
7
+ langId?: string;
7
8
  onChange: (val: string) => void;
9
+ langData?: any;
8
10
  }
9
- declare const MyRichText: ({ item, readonly, style, value, onChange }: IMyRichTextProps) => import("react").JSX.Element | null;
11
+ declare const MyRichText: ({ item, readonly, style, value, langId, langData, onChange }: IMyRichTextProps) => import("react").JSX.Element | null;
10
12
  export default MyRichText;
@@ -6,11 +6,12 @@ const extensionTextStyle = require("@tiptap/extension-text-style");
6
6
  const TextAlign = require("@tiptap/extension-text-align");
7
7
  const Highlight = require("@tiptap/extension-highlight");
8
8
  const FontSize = require("@tiptap/extension-font-size");
9
+ const func = require("../func");
9
10
  const StarterKit = require("@tiptap/starter-kit");
10
11
  const Color = require("@tiptap/extension-color");
11
12
  const react = require("react");
12
13
  const icons = require("@ant-design/icons");
13
- const MyRichText = ({ item, readonly, style, value, onChange }) => {
14
+ const MyRichText = ({ item, readonly, style, value, langId, langData, onChange }) => {
14
15
  const [color, setColor] = react.useState("#1677ff");
15
16
  react.useEffect(() => {
16
17
  const styleSheet = document.createElement("style");
@@ -67,7 +68,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
67
68
  }
68
69
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { ...style, border: "1px solid #d9d9d9", borderRadius: 6, overflow: "hidden" }, children: [
69
70
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: { borderBottom: "1px solid #d9d9d9", padding: 8, background: "#fafafa" }, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { wrap: true, children: [
70
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "加粗", children: /* @__PURE__ */ jsxRuntime.jsx(
71
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "011") : "加粗", children: /* @__PURE__ */ jsxRuntime.jsx(
71
72
  antd.Button,
72
73
  {
73
74
  type: "text",
@@ -77,7 +78,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
77
78
  className: editor.isActive("bold") ? "ant-btn-primary" : ""
78
79
  }
79
80
  ) }),
80
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "斜体", children: /* @__PURE__ */ jsxRuntime.jsx(
81
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "012") : "斜体", children: /* @__PURE__ */ jsxRuntime.jsx(
81
82
  antd.Button,
82
83
  {
83
84
  type: "text",
@@ -87,7 +88,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
87
88
  className: editor.isActive("italic") ? "ant-btn-primary" : ""
88
89
  }
89
90
  ) }),
90
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "下划线", children: /* @__PURE__ */ jsxRuntime.jsx(
91
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "013") : "下划线", children: /* @__PURE__ */ jsxRuntime.jsx(
91
92
  antd.Button,
92
93
  {
93
94
  type: "text",
@@ -97,7 +98,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
97
98
  className: editor.isActive("underline") ? "ant-btn-primary" : ""
98
99
  }
99
100
  ) }),
100
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "删除线", children: /* @__PURE__ */ jsxRuntime.jsx(
101
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "014") : "删除线", children: /* @__PURE__ */ jsxRuntime.jsx(
101
102
  antd.Button,
102
103
  {
103
104
  type: "text",
@@ -107,7 +108,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
107
108
  className: editor.isActive("strike") ? "ant-btn-primary" : ""
108
109
  }
109
110
  ) }),
110
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "清除格式", children: /* @__PURE__ */ jsxRuntime.jsx(
111
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "015") : "清除格式", children: /* @__PURE__ */ jsxRuntime.jsx(
111
112
  antd.Button,
112
113
  {
113
114
  type: "text",
@@ -116,7 +117,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
116
117
  disabled: readonly
117
118
  }
118
119
  ) }),
119
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "文字颜色", children: /* @__PURE__ */ jsxRuntime.jsx(
120
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "016") : "文字颜色", children: /* @__PURE__ */ jsxRuntime.jsx(
120
121
  antd.ColorPicker,
121
122
  {
122
123
  value: color,
@@ -128,7 +129,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
128
129
  }
129
130
  }
130
131
  ) }),
131
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "字体大小", children: /* @__PURE__ */ jsxRuntime.jsx(
132
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "017") : "字体大小", children: /* @__PURE__ */ jsxRuntime.jsx(
132
133
  antd.Select,
133
134
  {
134
135
  defaultValue: "16px",
@@ -150,7 +151,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
150
151
  suffixIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.FontSizeOutlined, {})
151
152
  }
152
153
  ) }),
153
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "左对齐", children: /* @__PURE__ */ jsxRuntime.jsx(
154
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "018") : "左对齐", children: /* @__PURE__ */ jsxRuntime.jsx(
154
155
  antd.Button,
155
156
  {
156
157
  type: "text",
@@ -160,7 +161,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
160
161
  className: editor.isActive({ textAlign: "left" }) ? "ant-btn-primary" : ""
161
162
  }
162
163
  ) }),
163
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "居中对齐", children: /* @__PURE__ */ jsxRuntime.jsx(
164
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "019") : "居中对齐", children: /* @__PURE__ */ jsxRuntime.jsx(
164
165
  antd.Button,
165
166
  {
166
167
  type: "text",
@@ -170,7 +171,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
170
171
  className: editor.isActive({ textAlign: "center" }) ? "ant-btn-primary" : ""
171
172
  }
172
173
  ) }),
173
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "右对齐", children: /* @__PURE__ */ jsxRuntime.jsx(
174
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "020") : "右对齐", children: /* @__PURE__ */ jsxRuntime.jsx(
174
175
  antd.Button,
175
176
  {
176
177
  type: "text",
@@ -180,7 +181,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
180
181
  className: editor.isActive({ textAlign: "right" }) ? "ant-btn-primary" : ""
181
182
  }
182
183
  ) }),
183
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "两端对齐", children: /* @__PURE__ */ jsxRuntime.jsx(
184
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "021") : "两端对齐", children: /* @__PURE__ */ jsxRuntime.jsx(
184
185
  antd.Button,
185
186
  {
186
187
  type: "text",
@@ -191,7 +192,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
191
192
  }
192
193
  ) }),
193
194
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: { width: 1, height: 20, background: "#d9d9d9", margin: "0 8px" } }),
194
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "无序列表", children: /* @__PURE__ */ jsxRuntime.jsx(
195
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "022") : "无序列表", children: /* @__PURE__ */ jsxRuntime.jsx(
195
196
  antd.Button,
196
197
  {
197
198
  type: "text",
@@ -201,7 +202,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
201
202
  className: editor.isActive("bulletList") ? "ant-btn-primary" : ""
202
203
  }
203
204
  ) }),
204
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "有序列表", children: /* @__PURE__ */ jsxRuntime.jsx(
205
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "023") : "有序列表", children: /* @__PURE__ */ jsxRuntime.jsx(
205
206
  antd.Button,
206
207
  {
207
208
  type: "text",
@@ -212,25 +213,14 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
212
213
  }
213
214
  ) }),
214
215
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: { width: 1, height: 20, background: "#d9d9d9", margin: "0 8px" } }),
215
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "高亮", children: /* @__PURE__ */ jsxRuntime.jsx(
216
- antd.Button,
217
- {
218
- type: "text",
219
- icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ToolOutlined, {}),
220
- onClick: () => editor.chain().focus().toggleHighlight().run(),
221
- disabled: readonly,
222
- className: editor.isActive("highlight") ? "ant-btn-primary" : ""
223
- }
224
- ) }),
225
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { width: 1, height: 20, background: "#d9d9d9", margin: "0 8px" } }),
226
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "链接", children: /* @__PURE__ */ jsxRuntime.jsx(
216
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "024") : "链接", children: /* @__PURE__ */ jsxRuntime.jsx(
227
217
  antd.Button,
228
218
  {
229
219
  type: "text",
230
220
  icon: /* @__PURE__ */ jsxRuntime.jsx(icons.LinkOutlined, {}),
231
221
  onClick: () => {
232
222
  const previousUrl = editor.getAttributes("link").href;
233
- const url = window.prompt("请输入链接地址", previousUrl);
223
+ const url = window.prompt(langId ? func.getTitle(langData, "025") : " 请输入链接地址", previousUrl);
234
224
  if (url === null) {
235
225
  return;
236
226
  }
@@ -244,7 +234,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
244
234
  }
245
235
  ) }),
246
236
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: { width: 1, height: 20, background: "#d9d9d9", margin: "0 8px" } }),
247
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "撤销", children: /* @__PURE__ */ jsxRuntime.jsx(
237
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "026") : "撤销", children: /* @__PURE__ */ jsxRuntime.jsx(
248
238
  antd.Button,
249
239
  {
250
240
  type: "text",
@@ -253,7 +243,7 @@ const MyRichText = ({ item, readonly, style, value, onChange }) => {
253
243
  disabled: readonly || !editor.can().undo()
254
244
  }
255
245
  ) }),
256
- /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: "前进", children: /* @__PURE__ */ jsxRuntime.jsx(
246
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { placement: "topLeft", title: langId ? func.getTitle(langData, "027") : "前进", children: /* @__PURE__ */ jsxRuntime.jsx(
257
247
  antd.Button,
258
248
  {
259
249
  type: "text",
@@ -55,7 +55,7 @@ const MySelect = ({
55
55
  return null;
56
56
  }
57
57
  return {
58
- label: getTitle == null ? void 0 : getTitle("5000000", label),
58
+ label: getTitle == null ? void 0 : getTitle((item == null ? void 0 : item["lang-page-id"]) || "5000000", label || label),
59
59
  value: value2
60
60
  };
61
61
  });
@@ -117,7 +117,7 @@ function SelectModel(props) {
117
117
  universalHeader,
118
118
  attributeSetId,
119
119
  getTitle,
120
- otherLangPageId: "5000000"
120
+ otherLangPageId: (item == null ? void 0 : item["lang-page-id"]) || "5000000"
121
121
  }) || [];
122
122
  setColumns([...list]);
123
123
  }
@@ -19,6 +19,7 @@ interface IDynamicFormProps {
19
19
  formShowType?: 'form' | 'table';
20
20
  langId?: string;
21
21
  getTitle?: (pageID: string, dataID: string) => string;
22
+ langData?: Record<string, any>[];
22
23
  }
23
24
  type NestedFormListFieldData = FormListFieldData & {
24
25
  parentName?: (string | number)[];
@@ -35,17 +35,12 @@ function useDynamicForm(props) {
35
35
  formShowType = "form",
36
36
  // 新增:表单展示类型,默认form
37
37
  langId,
38
- // 新增:语言id,默认10001
39
- getTitle
38
+ // 新增:语言id
39
+ getTitle,
40
+ langData
41
+ // 新增:组件库固定文字语言匹配数据
40
42
  } = props;
41
- const formConfigRef = react.useRef([]);
42
43
  const { message } = antd.App.useApp();
43
- react.useEffect(() => {
44
- if (!formConfig) {
45
- return;
46
- }
47
- formConfigRef.current = formConfig;
48
- }, [formConfig]);
49
44
  const handleNormFile = react.useCallback((e) => {
50
45
  if (Array.isArray(e)) {
51
46
  return e;
@@ -251,7 +246,9 @@ function useDynamicForm(props) {
251
246
  if (fields.length > 1) {
252
247
  remove(field.name);
253
248
  } else {
254
- message.warning("至少需要保留一个!");
249
+ message.warning(
250
+ langId && func.getTitle(langData, "006") || "至少保留一个表单"
251
+ );
255
252
  }
256
253
  }
257
254
  }
@@ -278,7 +275,7 @@ function useDynamicForm(props) {
278
275
  }),
279
276
  !isEdit && /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { style: { width: 200 }, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Button, { type: "dashed", onClick: () => add(), block: true, children: [
280
277
  "+ ",
281
- langId === "10001" ? "新增" : "Add"
278
+ func.getTitle(langData, "004") || "新增"
282
279
  ] }) })
283
280
  ] })
284
281
  }
@@ -332,7 +329,7 @@ function useDynamicForm(props) {
332
329
  if (itemWithJson.attrtype === 0) {
333
330
  const initialValue = func.handleSetFormItemInitialValue(itemWithJson);
334
331
  const message2 = (_c = itemWithJson.json) == null ? void 0 : _c["default-prompt"];
335
- const placeholder = func.handleGetPlaceholder(itemWithJson, langId);
332
+ const placeholder = func.handleGetPlaceholder(itemWithJson, langId, langData);
336
333
  const { combinations = [] } = itemWithJson.json || {};
337
334
  if (combinations == null ? void 0 : combinations.length) {
338
335
  return /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: hidden ? 0 : 24 / colNum, children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -499,7 +496,7 @@ function useDynamicForm(props) {
499
496
  const formatValue = func.handleSetFormItemInitialValue(item);
500
497
  const message2 = ((_b = item.json) == null ? void 0 : _b["default-prompt"]) || "";
501
498
  const disableDateGoover = ((_c = item.json) == null ? void 0 : _c["disable-date-goover"]) || false;
502
- const placeholder = func.handleGetPlaceholder(item, langId);
499
+ const placeholder = func.handleGetPlaceholder(item, langId, langData);
503
500
  const params = item.json.length && {
504
501
  maxLength: item.json.length
505
502
  } || {};
@@ -697,13 +694,17 @@ function useDynamicForm(props) {
697
694
  commonRequestWidthParams,
698
695
  item: item.json,
699
696
  readonly: readonly || ((_r = item.json) == null ? void 0 : _r.readonly),
700
- options: params,
697
+ params,
701
698
  handleUrlOptions: method.handleUrlOptions,
702
699
  value: formatValue,
703
700
  interfaceTypeDict,
704
701
  interfaceTypeSysDict,
705
702
  actionUrlKey,
706
703
  actionUrlExtraParams,
704
+ getTitle,
705
+ attrid,
706
+ langId,
707
+ langData,
707
708
  onChange: (e) => {
708
709
  form.setFieldValue(item.attrid, e.target.value);
709
710
  }
@@ -761,7 +762,8 @@ function useDynamicForm(props) {
761
762
  interfaceTypeSysDict,
762
763
  actionUrlKey,
763
764
  actionUrlExtraParams,
764
- langId
765
+ langId,
766
+ langData
765
767
  }
766
768
  );
767
769
  case "radio-card":
@@ -785,6 +787,8 @@ function useDynamicForm(props) {
785
787
  readonly: readonly || ((_v = item.json) == null ? void 0 : _v.readonly),
786
788
  style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth },
787
789
  value: item.attrvalue,
790
+ langId,
791
+ langData,
788
792
  onChange: (value) => {
789
793
  form.setFieldValue(item.attrid, value);
790
794
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const dayjs = require("dayjs");
4
4
  const antd = require("antd");
5
+ const method = require("../../utils/method");
5
6
  const handleGetPlaceholder = (itemWithJson, langId) => {
6
7
  const { input = "" } = (itemWithJson == null ? void 0 : itemWithJson.json) || {};
7
8
  let placeholderCn = "请输入", placeholderEn = "Please input";
@@ -85,6 +86,9 @@ const handleSetFormItemInitialValue = (itemWithJson) => {
85
86
  if (inputType === "time-picker" && !initialValue && ((_g = itemWithJson.json) == null ? void 0 : _g["auto-generate"]) && ((_h = itemWithJson.json) == null ? void 0 : _h["auto-generate-type"]) === "currenttimestamp") {
86
87
  initialValue = dayjs().unix().toString();
87
88
  }
89
+ if (inputType === "rich-text" && initialValue) {
90
+ initialValue = method.base64ToString(initialValue);
91
+ }
88
92
  if (itemWithJson.attrtype === 1) {
89
93
  initialValue = handleGetSingleAttrListObj(itemWithJson.children || []);
90
94
  }
@@ -0,0 +1,5 @@
1
+ export declare const fontSizes: {
2
+ value: string;
3
+ label: string;
4
+ }[];
5
+ export declare const colors: string[];
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const fontSizes = [
4
+ { value: "12px", label: "12px" },
5
+ { value: "14px", label: "14px" },
6
+ { value: "16px", label: "16px" },
7
+ { value: "18px", label: "18px" },
8
+ { value: "20px", label: "20px" },
9
+ { value: "24px", label: "24px" },
10
+ { value: "28px", label: "28px" },
11
+ { value: "32px", label: "32px" },
12
+ { value: "36px", label: "36px" }
13
+ ];
14
+ const colors = [
15
+ "#000000",
16
+ "#ffffff",
17
+ "#333333",
18
+ "#666666",
19
+ "#999999",
20
+ "#cccccc",
21
+ "#ff0000",
22
+ "#cc0000",
23
+ "#ff3333",
24
+ "#ff6666",
25
+ "#ff9999",
26
+ "#ffcccc",
27
+ "#ff6600",
28
+ "#cc5200",
29
+ "#ff8533",
30
+ "#ffad66",
31
+ "#ffd4a3",
32
+ "#ffff00",
33
+ "#cccc00",
34
+ "#ffff33",
35
+ "#ffff66",
36
+ "#ffff99",
37
+ "#00cc00",
38
+ "#009900",
39
+ "#33ff33",
40
+ "#66ff66",
41
+ "#99ff99",
42
+ "#00cccc",
43
+ "#009999",
44
+ "#33ffff",
45
+ "#66ffff",
46
+ "#99ffff",
47
+ "#0066ff",
48
+ "#004dcc",
49
+ "#3385ff",
50
+ "#66a3ff",
51
+ "#99c1ff",
52
+ "#9900ff",
53
+ "#7300cc",
54
+ "#b333ff",
55
+ "#cc66ff",
56
+ "#e0a3ff",
57
+ "#ff0099",
58
+ "#cc007a",
59
+ "#ff33aa",
60
+ "#ff66bb",
61
+ "#ff99cc",
62
+ "#996633",
63
+ "#734d29",
64
+ "#b3804d",
65
+ "#cc9966"
66
+ ];
67
+ exports.colors = colors;
68
+ exports.fontSizes = fontSizes;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ interface IMyRichTextProps {
3
+ item: any;
4
+ readonly: boolean;
5
+ style: React.CSSProperties;
6
+ value: string;
7
+ onChange: (val: string) => void;
8
+ langId?: string;
9
+ }
10
+ declare const MyRichText: ({ item, readonly, style, value, langId, onChange }: IMyRichTextProps) => import("react").JSX.Element | null;
11
+ export default MyRichText;