szld-libs 0.3.60 → 0.3.61

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.
@@ -432,7 +432,7 @@ function useDynamicForm(props) {
432
432
  defaultWidth = 358,
433
433
  customWidth = {}
434
434
  }) => {
435
- var _a, _b, _c, _d, _e, _f;
435
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
436
436
  const mode = item.json.input || "text";
437
437
  const format = ((_a = item.json) == null ? void 0 : _a.format) || "";
438
438
  const attrid = item.attrid;
@@ -465,7 +465,7 @@ function useDynamicForm(props) {
465
465
  {
466
466
  placeholder: message2 || placeholder,
467
467
  ...params,
468
- disabled: readonly,
468
+ disabled: readonly || ((_g = item.json) == null ? void 0 : _g.readonly),
469
469
  allowClear: true,
470
470
  style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
471
471
  }
@@ -476,7 +476,7 @@ function useDynamicForm(props) {
476
476
  {
477
477
  placeholder: message2 || placeholder,
478
478
  ...params,
479
- disabled: readonly,
479
+ disabled: readonly || ((_h = item.json) == null ? void 0 : _h.readonly),
480
480
  allowClear: true,
481
481
  style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
482
482
  }
@@ -489,7 +489,7 @@ function useDynamicForm(props) {
489
489
  placeholder: message2 || placeholder,
490
490
  rows: 5,
491
491
  ...params,
492
- disabled: readonly,
492
+ disabled: readonly || ((_i = item.json) == null ? void 0 : _i.readonly),
493
493
  style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
494
494
  }
495
495
  );
@@ -500,7 +500,7 @@ function useDynamicForm(props) {
500
500
  controls: false,
501
501
  placeholder: message2 || placeholder,
502
502
  ...params,
503
- disabled: readonly,
503
+ disabled: readonly || ((_j = item.json) == null ? void 0 : _j.readonly),
504
504
  style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
505
505
  }
506
506
  );
@@ -510,7 +510,7 @@ function useDynamicForm(props) {
510
510
  MySelect,
511
511
  {
512
512
  item: item.json,
513
- readonly,
513
+ readonly: readonly || ((_k = item.json) == null ? void 0 : _k.readonly),
514
514
  style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth },
515
515
  commonRequestWidthParams,
516
516
  commonRequest,
@@ -539,7 +539,7 @@ function useDynamicForm(props) {
539
539
  onSure: async (value) => {
540
540
  form.setFieldValue(item.attrid, value);
541
541
  },
542
- disabled: readonly,
542
+ disabled: readonly || ((_l = item.json) == null ? void 0 : _l.readonly),
543
543
  langId,
544
544
  CustomModalComponent
545
545
  }
@@ -559,7 +559,7 @@ function useDynamicForm(props) {
559
559
  onSure: async (value) => {
560
560
  form.setFieldsValue(value);
561
561
  },
562
- disabled: readonly,
562
+ disabled: readonly || ((_m = item.json) == null ? void 0 : _m.readonly),
563
563
  CustomModalComponent,
564
564
  langId
565
565
  }
@@ -591,7 +591,7 @@ function useDynamicForm(props) {
591
591
  showTime: mode === "time-picker",
592
592
  format: format ? format : void 0,
593
593
  picker: pickerObj[mode] || "date",
594
- disabled: readonly,
594
+ disabled: readonly || ((_n = item.json) == null ? void 0 : _n.readonly),
595
595
  disabledDate: disabledDateFunc,
596
596
  placement: "bottomLeft",
597
597
  style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
@@ -603,12 +603,19 @@ function useDynamicForm(props) {
603
603
  antd.DatePicker.RangePicker,
604
604
  {
605
605
  disabledDate: disableDateGoover ? func.disabledDate : void 0,
606
- disabled: readonly,
606
+ disabled: readonly || ((_o = item.json) == null ? void 0 : _o.readonly),
607
607
  style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
608
608
  }
609
609
  );
610
610
  case "multiple-date-picker":
611
- return /* @__PURE__ */ jsxRuntime.jsx(antd.DatePicker, { multiple: true, disabled: readonly, style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth } });
611
+ return /* @__PURE__ */ jsxRuntime.jsx(
612
+ antd.DatePicker,
613
+ {
614
+ multiple: true,
615
+ disabled: readonly || ((_p = item.json) == null ? void 0 : _p.readonly) || false,
616
+ style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
617
+ }
618
+ );
612
619
  case "radio":
613
620
  return /* @__PURE__ */ jsxRuntime.jsx(
614
621
  MyRadio,
@@ -617,7 +624,7 @@ function useDynamicForm(props) {
617
624
  commonRequest,
618
625
  commonRequestWidthParams,
619
626
  item: item.json,
620
- readonly,
627
+ readonly: readonly || ((_q = item.json) == null ? void 0 : _q.readonly),
621
628
  options: params,
622
629
  handleUrlOptions: method.handleUrlOptions,
623
630
  value: formatValue,
@@ -638,7 +645,7 @@ function useDynamicForm(props) {
638
645
  commonRequest,
639
646
  commonRequestWidthParams,
640
647
  item: item.json,
641
- readonly,
648
+ readonly: readonly || ((_r = item.json) == null ? void 0 : _r.readonly),
642
649
  options: params,
643
650
  value: formatValue,
644
651
  handleUrlOptions: method.handleUrlOptions,
@@ -663,7 +670,7 @@ function useDynamicForm(props) {
663
670
  uploadType: mode,
664
671
  langId,
665
672
  list: formatValue,
666
- readonly,
673
+ readonly: readonly || ((_s = item.json) == null ? void 0 : _s.readonly),
667
674
  relatedid,
668
675
  relatedidKey,
669
676
  onRemove: (file) => handleOnRemove(file)
@@ -690,7 +697,7 @@ function useDynamicForm(props) {
690
697
  RadioCard,
691
698
  {
692
699
  item: item.json,
693
- readonly,
700
+ readonly: readonly || ((_t = item.json) == null ? void 0 : _t.readonly),
694
701
  onChange: (value) => {
695
702
  form.setFieldValue(item.attrid, value);
696
703
  },
@@ -705,7 +712,7 @@ function useDynamicForm(props) {
705
712
  placeholder: message2 || placeholder,
706
713
  ...params,
707
714
  showCount: true,
708
- disabled: readonly,
715
+ disabled: readonly || ((_u = item.json) == null ? void 0 : _u.readonly),
709
716
  style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
710
717
  }
711
718
  );
@@ -1,7 +1,7 @@
1
1
  import { AxiosResponse } from 'axios';
2
2
  import { ReactNode } from 'react';
3
3
  declare function useUniversalTable(): {
4
- handleUniversalHeaderToColumns: ({ universalHeader, extraBtn, operationColumnConfig, attributeSetId, getTitle, downloadText, isDefaultWidth, otherLangPageId, }: {
4
+ handleUniversalHeaderToColumns: ({ universalHeader, extraBtn, operationColumnConfig, attributeSetId, getTitle, downloadText, isDefaultWidth, otherLangPageId, objDefaultLangPageId, }: {
5
5
  universalHeader: any[];
6
6
  extraBtn?: ((record: any, content: string, item: any) => ReactNode) | undefined;
7
7
  operationColumnConfig?: any;
@@ -10,6 +10,7 @@ declare function useUniversalTable(): {
10
10
  downloadText?: string | undefined;
11
11
  isDefaultWidth?: boolean | undefined;
12
12
  otherLangPageId?: string | undefined;
13
+ objDefaultLangPageId?: string | undefined;
13
14
  }) => any[] | import("antd/es/message/interface").MessageType;
14
15
  handleSelListToFormItems: ({ selListData, handleSearch, handleReset, detail, styles, attributeSetId, commonRequest, commonRequestWidthParams, getTitle, searchText, resetText, }: {
15
16
  selListData: any[];
@@ -53,5 +54,6 @@ declare function useUniversalTable(): {
53
54
  tabItems?: any[] | undefined;
54
55
  currentActive?: string | number | undefined;
55
56
  }) => void;
57
+ isArrayString: (str: string) => boolean;
56
58
  };
57
59
  export default useUniversalTable;
@@ -200,7 +200,8 @@ function useUniversalTable() {
200
200
  getTitle,
201
201
  downloadText = "下载",
202
202
  isDefaultWidth = true,
203
- otherLangPageId
203
+ otherLangPageId,
204
+ objDefaultLangPageId = "5000000"
204
205
  }) => {
205
206
  if (!(universalHeader == null ? void 0 : universalHeader.length))
206
207
  return message.error("请配置 universalHeader表头数据");
@@ -229,6 +230,23 @@ function useUniversalTable() {
229
230
  return /* @__PURE__ */ jsxRuntime.jsx(antd.Space, {});
230
231
  }
231
232
  if ((item == null ? void 0 : item["show-lang-data-id"]) && otherLangPageId) {
233
+ if (text && text && typeof text === "string" && (text == null ? void 0 : text.includes("delimiter"))) {
234
+ const isObj = isArrayString(text);
235
+ if (isObj) {
236
+ const { list: list2, delimiter = "," } = JSON.parse(text) || {};
237
+ const newList = list2 == null ? void 0 : list2.map((item2) => {
238
+ if (!item2)
239
+ return "-";
240
+ const arr = (item2 == null ? void 0 : item2.split("|")) || [];
241
+ const pageId = (arr == null ? void 0 : arr.length) > 1 ? arr[0] : objDefaultLangPageId;
242
+ const str = (arr == null ? void 0 : arr.length) > 1 ? arr[1] : arr[0];
243
+ return (getTitle == null ? void 0 : getTitle(pageId, str)) || "-";
244
+ });
245
+ return (newList == null ? void 0 : newList.join(delimiter)) || "-";
246
+ } else {
247
+ return text || "-";
248
+ }
249
+ }
232
250
  return /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { title: text, children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { cursor: "pointer" }, children: (getTitle == null ? void 0 : getTitle(otherLangPageId, text)) || "-" }) });
233
251
  }
234
252
  return text || "-";
@@ -422,12 +440,23 @@ function useUniversalTable() {
422
440
  };
423
441
  return recursionTransform(data);
424
442
  };
443
+ const isArrayString = (str) => {
444
+ if (typeof str !== "string")
445
+ return false;
446
+ try {
447
+ const parsed = JSON.parse(str);
448
+ return Array.isArray(parsed);
449
+ } catch (e) {
450
+ return false;
451
+ }
452
+ };
425
453
  return {
426
454
  handleUniversalHeaderToColumns,
427
455
  handleSelListToFormItems,
428
456
  handleUniversalDelete,
429
457
  handleUniversalSearch,
430
- handleUniversalReset
458
+ handleUniversalReset,
459
+ isArrayString
431
460
  };
432
461
  }
433
462
  module.exports = useUniversalTable;
package/lib/mock/index.js CHANGED
@@ -4,273 +4,25 @@ const baseAttrList = [];
4
4
  const attrList = [
5
5
  {
6
6
  xh: 1,
7
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
7
+ asid: "2F79EF19DBD846D2AD5309E85A436689",
8
8
  astype: 0,
9
- tname: "gg_table",
10
- attrid: "BB5FFD9EC1034781BC3E89FEFD78879C",
11
- attrname: "姓名",
9
+ tname: "fjffrt_table2",
10
+ attrid: "47081ED51BB4407C92070CB7CAA8D056",
11
+ attrname: "Dates",
12
12
  attrtype: 0,
13
- info: '{"input":"text","dataType":"string","length":20,"must":true,"regexp":"/^[A-Za-z]+$/","regexp-message":"请输入英文字母"}',
13
+ info: '{"input":"range-picker","dataType":"date","input-width":370,"must":true,"readonly":true}',
14
14
  info_base64: 0,
15
- createtime: "2026-01-05 21:25:49",
15
+ createtime: "2026-02-11 15:18:12",
16
16
  attrvalue: "",
17
17
  serialnum: 1,
18
- children: []
19
- },
20
- {
21
- xh: 2,
22
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
23
- astype: 0,
24
- tname: "gg_table",
25
- attrid: "799FBD4386A04D8198FC7F33B120F68E",
26
- attrname: "品种",
27
- attrtype: 0,
28
- info: '{"input":"text","dataType":"string","length":20}',
29
- info_base64: 0,
30
- createtime: "2026-01-05 21:26:01",
31
- attrvalue: "",
32
- serialnum: 2,
33
- children: []
34
- },
35
- {
36
- xh: 3,
37
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
38
- astype: 0,
39
- tname: "gg_table",
40
- attrid: "B1B10494F9A949CCBD26567A597E8DAE",
41
- attrname: "重量",
42
- attrtype: 0,
43
- info: '{"input":"text","dataType":"string","length":3,"combination":true,"combination-id":1,"combination-name":"5000008-1","combination-width-ratio":0.7,"must":true}',
44
- info_base64: 0,
45
- createtime: "2026-01-05 21:26:13",
46
- attrvalue: "",
47
- serialnum: 3,
48
- children: []
49
- },
50
- {
51
- xh: 4,
52
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
53
- astype: 0,
54
- tname: "gg_table",
55
- attrid: "A3CB9307DED6493382C78E065F3C6A99",
56
- attrname: "单位",
57
- attrtype: 0,
58
- info: '{"input":"select","dataType":"string","length":5,"inputType":"local","data":["5000008-1","5000008-2"],"default":"5000008-1","combination":true,"combination-id":1,"combination-name":"5000008-1","combination-width-ratio":0.3,"must":true}',
59
- info_base64: 0,
60
- createtime: "2026-01-05 21:27:16",
61
- attrvalue: "",
62
- serialnum: 4,
63
- children: []
64
- },
65
- {
66
- xh: 5,
67
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
68
- astype: 0,
69
- tname: "gg_table",
70
- attrid: "F0999F269D3C4425A59A883442055C5C",
71
- attrname: "性别",
72
- attrtype: 0,
73
- info: '{"input":"radio","dataType":"string","length":100,"inputType":"local","data":["5000011-3-1","5000011-3-2"]}',
74
- info_base64: 0,
75
- createtime: "2026-01-05 21:28:11",
76
- attrvalue: "",
77
- serialnum: 5,
78
- children: []
79
- },
80
- {
81
- xh: 6,
82
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
83
- astype: 0,
84
- tname: "gg_table",
85
- attrid: "4986EE62B15E4C0197A1E073E098CCAF",
86
- attrname: "是否绝育",
87
- attrtype: 0,
88
- info: '{"input":"radio","dataType":"string","length":100,"inputType":"local","data":["5000011-1-2","5000011-1-1"],"must":true}',
89
- info_base64: 0,
90
- createtime: "2026-01-05 21:28:34",
91
- attrvalue: "",
92
- serialnum: 6,
93
- children: []
94
- },
95
- {
96
- xh: 7,
97
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
98
- astype: 0,
99
- tname: "gg_table",
100
- attrid: "8561D992C88645EE9EA184800BBE0E1D",
101
- attrname: "是否对其他狗有攻击性",
102
- attrtype: 0,
103
- info: '{"input":"radio","dataType":"string","length":100,"inputType":"local","data":["5000011-2-2","5000011-2-1","5000011-2-3","5000011-2-4"],"must":true}',
104
- info_base64: 0,
105
- createtime: "2026-01-05 21:29:07",
106
- attrvalue: "",
107
- serialnum: 7,
108
- children: []
109
- },
110
- {
111
- xh: 8,
112
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
113
- astype: 0,
114
- tname: "gg_table",
115
- attrid: "93366648DF5146E98AE3D58DE5D6BD73",
116
- attrname: "是否对人有攻击性",
117
- attrtype: 0,
118
- info: '{"input":"radio","dataType":"string","length":100,"inputType":"local","data":["5000011-2-2","5000011-2-1","5000011-2-3","5000011-2-4"],"must":true}',
119
- info_base64: 0,
120
- createtime: "2026-01-05 21:29:24",
121
- attrvalue: "",
122
- serialnum: 8,
123
- children: []
124
- },
125
- {
126
- xh: 9,
127
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
128
- astype: 0,
129
- tname: "gg_table",
130
- attrid: "6A63A6508C0E44D38AB68CB27EC332E8",
131
- attrname: "狗狗照片",
132
- attrtype: 0,
133
- info: '{"input":"image","upload-accept":".png,.jpg,.jpeg","upload-max-count":"5","upload-size":"5","dataType":"string","length":4000}',
134
- info_base64: 0,
135
- createtime: "2026-01-05 21:29:46",
136
- attrvalue: "",
137
- serialnum: 9,
138
- children: []
139
- },
140
- {
141
- xh: 10,
142
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
143
- astype: 0,
144
- tname: "gg_table",
145
- attrid: "6730DFF94989425F9ED90A4A77EE3C5B",
146
- attrname: "疫苗证明",
147
- attrtype: 0,
148
- info: '{"input":"file","upload-accept":".png,jpeg,jpg,.pdf,.doc,.docx,.xls,.xlsx,.txt,.zip,.rar,.7z","upload-max-count":"5","upload-size":"10","dataType":"string","length":4000}',
149
- info_base64: 0,
150
- createtime: "2026-01-05 21:30:05",
151
- attrvalue: "",
152
- serialnum: 10,
153
- children: []
154
- },
155
- {
156
- xh: 11,
157
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
158
- astype: 0,
159
- tname: "gg_table",
160
- attrid: "23A6082D509340BCA10ED419A95F9B7D",
161
- attrname: "生日",
162
- attrtype: 0,
163
- info: '{"input":"date-picker","dataType":"date","instruction":"如不确定出生日期可选择大概日期","instruction-color":"#999999","must":true}',
164
- info_base64: 0,
165
- createtime: "2026-01-05 21:30:21",
166
- attrvalue: "",
167
- serialnum: 11,
168
- children: []
169
- },
170
- {
171
- xh: 12,
172
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
173
- astype: 0,
174
- tname: "gg_table",
175
- attrid: "7A870062F2C94795ABA9923F300BE99A",
176
- attrname: "备注",
177
- attrtype: 0,
178
- info: '{"input":"textarea","dataType":"string","length":500}',
179
- info_base64: 0,
180
- createtime: "2026-01-05 21:30:40",
181
- attrvalue: "",
182
- serialnum: 12,
183
- children: []
184
- },
185
- {
186
- xh: 13,
187
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
188
- astype: 0,
189
- tname: "gg_table",
190
- attrid: "5A1C6C69500B42708F71B1A4CF4009C5",
191
- attrname: "确认状态",
192
- attrtype: 0,
193
- info: '{"input":"select","dataType":"string","length":10,"inputType":"local","data":["未确认","已确认"],"default":"已确认"}',
194
- info_base64: 0,
195
- createtime: "2026-01-05 21:30:54",
196
- attrvalue: "",
197
- serialnum: 13,
198
- children: []
199
- },
200
- {
201
- xh: 14,
202
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
203
- astype: 0,
204
- tname: "gg_table",
205
- attrid: "B5EA8BEBDABE4B508CD72F5921FD1C0F",
206
- attrname: "关联账号",
207
- attrtype: 0,
208
- info: '{"input":"text","dataType":"string","length":100}',
209
- info_base64: 0,
210
- createtime: "2026-01-05 21:31:07",
211
- attrvalue: "",
212
- serialnum: 14,
213
- children: []
214
- },
215
- {
216
- xh: 15,
217
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
218
- astype: 0,
219
- tname: "gg_table",
220
- attrid: "8BC4EEE820374EAA90B42756F6B1E4A5",
221
- attrname: "主人姓",
222
- attrtype: 0,
223
- info: '{"input":"text","dataType":"string","length":100}',
224
- info_base64: 0,
225
- createtime: "2026-01-05 21:36:38",
226
- attrvalue: "",
227
- serialnum: 15,
228
- children: []
229
- },
230
- {
231
- xh: 16,
232
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
233
- astype: 0,
234
- tname: "gg_table",
235
- attrid: "66A7EA71D61A4D0E86C8C44C7F788DD9",
236
- attrname: "主人名",
237
- attrtype: 0,
238
- info: '{"input":"text","dataType":"string","length":100}',
239
- info_base64: 0,
240
- createtime: "2026-01-16 15:02:21",
241
- attrvalue: "",
242
- serialnum: 15,
243
- children: []
244
- },
245
- {
246
- xh: 17,
247
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
248
- astype: 0,
249
- tname: "gg_table",
250
- attrid: "069E5167BD4E4BAF86B57EE19826DF0C",
251
- attrname: "关联账号对应id",
252
- attrtype: 0,
253
- info: '{"input":"text","dataType":"string","length":32}',
254
- info_base64: 0,
255
- createtime: "2026-01-06 12:17:44",
256
- attrvalue: "",
257
- serialnum: 16,
258
- children: []
259
- },
260
- {
261
- xh: 18,
262
- asid: "2EA2AABF953F4A3483ED854A0034BF92",
263
- astype: 0,
264
- tname: "gg_table",
265
- attrid: "69008E895864440A9972137E5AC1C983",
266
- attrname: "创建时间",
267
- attrtype: 0,
268
- info: '{"input":"date-picker","dataType":"date","auto-generate":true,"auto-generate-type":"currenttime"}',
269
- info_base64: 0,
270
- createtime: "2026-01-05 22:08:40",
271
- attrvalue: "",
272
- serialnum: 17,
273
- children: []
18
+ children: [],
19
+ json: {
20
+ input: "range-picker",
21
+ dataType: "date",
22
+ "input-width": 370,
23
+ must: true,
24
+ readonly: true
25
+ }
274
26
  }
275
27
  ];
276
28
  const langConfig = [
@@ -39,6 +39,9 @@ export declare const handleGetList: (params: {
39
39
  }) => Promise<any>;
40
40
  /**
41
41
  * 调用通用支持代码接口
42
+ * @param params 请求参数
43
+ * @param commonRequestWidthParams 通用请求函数
44
+ * @param requestParams 接口参数PageName Controlname
42
45
  */
43
46
  export declare const handleCallSupportCode: ({ params, commonRequestWidthParams, requestParams, }: {
44
47
  params: Record<string, any>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.3.60",
4
+ "version": "0.3.61",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",