aibox-custom-component-packages 0.0.21 → 0.0.23

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 (122) hide show
  1. package/es/AiboxTabs.mjs +71 -0
  2. package/es/DocSyncSelect.mjs +1 -1
  3. package/es/ExampleComponent.mjs +35 -0
  4. package/es/SourcePublish.mjs +1 -1
  5. package/es/assets/AiboxTabs.css +1 -0
  6. package/es/assets/BackBar.css +1 -0
  7. package/es/assets/DocSyncSelect.css +1 -1
  8. package/es/assets/ExampleComponent.css +1 -0
  9. package/es/assets/SourcePublish.css +1 -1
  10. package/es/assets/index.css +1 -0
  11. package/es/assets/index2.css +1 -0
  12. package/es/assets/index3.css +1 -0
  13. package/es/assets/index4.css +1 -0
  14. package/es/chunks/AiboxTable.CF4T_OCu.js +645 -0
  15. package/es/chunks/BackBar.Bc2NIuzk.js +645 -0
  16. package/es/chunks/{DocSyncSelect.DlJXL1lq.js → DocSyncSelect.dhZh4w45.js} +3 -3
  17. package/es/chunks/{SourcePublish.BjY8OTLS.js → SourcePublish.CjzqOFwj.js} +23 -10
  18. package/es/chunks/_plugin-vue_export-helper.CHgC5LLL.js +9 -0
  19. package/es/chunks/config.8htFF04x.js +325 -0
  20. package/es/chunks/config.BU21Gda2.js +49 -0
  21. package/es/chunks/config.DPkdwjwD.js +49 -0
  22. package/es/chunks/config.gNZ_rT87.js +325 -0
  23. package/es/chunks/enums.CfSBDD6u.js +83 -0
  24. package/es/chunks/enums.WrpwbF4w.js +14 -0
  25. package/es/chunks/field-types.CPnMOjle.js +13 -0
  26. package/es/chunks/files.cduUqjHX.js +16 -0
  27. package/es/chunks/i18n.DmqkiK-h.js +444 -0
  28. package/es/chunks/i18n.k9Q_HVMs.js +443 -0
  29. package/es/chunks/index.BDd6hHiU.js +172 -0
  30. package/es/chunks/index.CF_YHLP5.js +257 -0
  31. package/es/chunks/index.DM3o2YX3.js +398 -0
  32. package/es/chunks/index.Dx-mCS4E.js +1298 -0
  33. package/es/chunks/index.bCzIhWFw.js +7 -0
  34. package/es/chunks/index.ml5i7aB5.js +257 -0
  35. package/es/chunks/layout.CygCXa6s.js +26 -0
  36. package/es/chunks/publish.D6friivo.js +50 -0
  37. package/es/chunks/publish.DlD0o09n.js +50 -0
  38. package/es/chunks/request.24c3shPx.js +5 -0
  39. package/es/chunks/usePreview.BHvXwaNi.js +157 -0
  40. package/es/index.mjs +2 -2
  41. package/lib/AiboxTabs.js +1 -0
  42. package/lib/DocSyncSelect.js +1 -1
  43. package/lib/ExampleComponent.js +1 -0
  44. package/lib/SourcePublish.js +1 -1
  45. package/lib/assets/AiboxTabs.css +1 -0
  46. package/lib/assets/BackBar.css +1 -0
  47. package/lib/assets/DocSyncSelect.css +1 -1
  48. package/lib/assets/ExampleComponent.css +1 -0
  49. package/lib/assets/SourcePublish.css +1 -1
  50. package/lib/assets/index.css +1 -0
  51. package/lib/assets/index2.css +1 -0
  52. package/lib/assets/index3.css +1 -0
  53. package/lib/assets/index4.css +1 -0
  54. package/lib/chunks/AiboxTable.CJOPGJtU.js +1 -0
  55. package/lib/chunks/BackBar.CZsNxoX1.js +1 -0
  56. package/lib/chunks/{DocSyncSelect.1gaXRzps.js → DocSyncSelect.kDNcepY-.js} +2 -2
  57. package/lib/chunks/SourcePublish.eOSEULjP.js +1 -0
  58. package/lib/chunks/_plugin-vue_export-helper.BHFhmbuH.js +1 -0
  59. package/lib/chunks/config.1oaIKLGn.js +1 -0
  60. package/lib/chunks/config.B0XKkp1w.js +1 -0
  61. package/lib/chunks/config.BCAuBVxV.js +1 -0
  62. package/lib/chunks/config.BF7MO0O5.js +1 -0
  63. package/lib/chunks/enums.Dmq4PdUc.js +1 -0
  64. package/lib/chunks/enums.DpU2er5r.js +1 -0
  65. package/lib/chunks/field-types.Ch_2yDfg.js +1 -0
  66. package/lib/chunks/files.B3-8UC0v.js +1 -0
  67. package/lib/chunks/i18n.CL5L6nx6.js +1 -0
  68. package/lib/chunks/i18n.DgOp_D7R.js +1 -0
  69. package/lib/chunks/index.4hFddClT.js +6 -0
  70. package/lib/chunks/index.BNivYbtq.js +1 -0
  71. package/lib/chunks/index.B_keI1Aq.js +1 -0
  72. package/lib/chunks/index.Bk-RwmaH.js +1 -0
  73. package/lib/chunks/index.CJFk1R2u.js +59 -0
  74. package/lib/chunks/index.CkihWzK6.js +1 -0
  75. package/lib/chunks/layout.DbBSbLgm.js +1 -0
  76. package/lib/chunks/publish.3TrK3fZf.js +1 -0
  77. package/lib/chunks/publish.Bw1acrSu.js +1 -0
  78. package/lib/chunks/request.D8T4MgGX.js +1 -0
  79. package/lib/chunks/usePreview.BojIDW7Z.js +1 -0
  80. package/lib/index.js +1 -1
  81. package/package.json +5 -5
  82. package/es/chunks/AddOrEditSupplierDialog.BCiXcUBu.js +0 -721
  83. package/es/chunks/AiboxTable.B_Yli5E8.js +0 -635
  84. package/es/chunks/ApplicationTypeTag.BbJwXyVa.js +0 -47
  85. package/es/chunks/AuthSection.CLi8HcIx.js +0 -201
  86. package/es/chunks/AvailableRangePreview.BgeL_bMq.js +0 -194
  87. package/es/chunks/AvailableRangeSetting.CGJxgfPT.js +0 -229
  88. package/es/chunks/CodeView.CWbewuHs.js +0 -148
  89. package/es/chunks/CommonTagsList.CJdBie2N.js +0 -156
  90. package/es/chunks/CreateMcpForm.C0HqvD-g.js +0 -308
  91. package/es/chunks/FileUploader.BSIhrd9M.js +0 -216
  92. package/es/chunks/McpFormDialog.CDH31D2Q.js +0 -297
  93. package/es/chunks/McpParamsSet.Bx3aRL9j.js +0 -501
  94. package/es/chunks/MdEditor.Bb9S_hso.js +0 -163
  95. package/es/chunks/ParameterTable.CoRz_932.js +0 -2010
  96. package/es/chunks/PublishRecord.C8h1tu3w.js +0 -133
  97. package/es/chunks/SourcePublish.CebmryAz.js +0 -966
  98. package/es/chunks/SourcePublish.Dk7O9GzI.js +0 -968
  99. package/es/chunks/config.CIQoQGOb.js +0 -35
  100. package/es/chunks/config.lm2B-n0s.js +0 -270
  101. package/es/chunks/i18n.CIhVBbR3.js +0 -418
  102. package/lib/chunks/AddOrEditSupplierDialog.XtPxc5yr.js +0 -1
  103. package/lib/chunks/AiboxTable.DFyqwoGc.js +0 -1
  104. package/lib/chunks/ApplicationTypeTag.CZReMt-9.js +0 -1
  105. package/lib/chunks/AuthSection.CP9c-YTW.js +0 -1
  106. package/lib/chunks/AvailableRangePreview.DvREyHNH.js +0 -1
  107. package/lib/chunks/AvailableRangeSetting.DDHTOLJA.js +0 -1
  108. package/lib/chunks/CodeView.DeBxLqyC.js +0 -1
  109. package/lib/chunks/CommonTagsList.QEP4G-Em.js +0 -1
  110. package/lib/chunks/CreateMcpForm.B2o0Ghjg.js +0 -1
  111. package/lib/chunks/FileUploader.6IW_QL-h.js +0 -1
  112. package/lib/chunks/McpFormDialog.FwXnBBd2.js +0 -6
  113. package/lib/chunks/McpParamsSet.BYrxVvDL.js +0 -1
  114. package/lib/chunks/MdEditor.Cp24y4DJ.js +0 -1
  115. package/lib/chunks/ParameterTable.CeufAEXh.js +0 -1
  116. package/lib/chunks/PublishRecord.BVndvj7F.js +0 -5
  117. package/lib/chunks/SourcePublish.Bz8MaRPm.js +0 -1
  118. package/lib/chunks/SourcePublish.I7ORXPok.js +0 -1
  119. package/lib/chunks/SourcePublish.OeB6i-Iu.js +0 -1
  120. package/lib/chunks/config.B9Di8LtU.js +0 -1
  121. package/lib/chunks/config.CZl1kYtI.js +0 -1
  122. package/lib/chunks/i18n.BGe5gOau.js +0 -1
@@ -1,2010 +0,0 @@
1
- import { t as e } from "./withinstall.dLh4K-0g.js";
2
- import { l as n, m as r } from "./i18n.CIhVBbR3.js";
3
- import { t as i } from "./_plugin-vue_export-helper.Ct3qlEzt.js";
4
- import { n as a, t as o } from "./DialogContainer.DL7aTMDS.js";
5
- import { a as s, i as c, r as l, t as u } from "./FileUploader.BSIhrd9M.js";
6
- import { t as d } from "./AutoShowTooltip.C_DI9t2Z.js";
7
- import { AiboxTable as f } from "../Table.mjs";
8
- import { Fragment as p, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createSlots as y, createTextVNode as b, createVNode as x, inject as S, mergeModels as C, nextTick as w, normalizeClass as T, onMounted as E, openBlock as D, provide as O, ref as k, renderList as A, resolveComponent as j, toDisplayString as M, unref as N, useModel as P, watch as F, withCtx as I } from "vue";
9
- import { ElButton as L, ElCheckbox as ee, ElDatePicker as te, ElIcon as R, ElInput as z, ElMessage as ne, ElOption as B, ElSelect as V, ElTag as H, ElTooltip as U } from "element-plus";
10
- import { Error as re, IconAdd as W, IconAdd2 as G, IconDelete2 as K, IconScene as ie, IconTip as ae, IconUpload2 as oe, IconZuoCopy as se, IconZuoCopyCopy as q } from "color-message-aibox-vue";
11
- import '../assets/ParameterTable.css';//#region components/ParameterTable/components/OptionValue.vue
12
- var ce = { class: "action-header" }, le = { class: "dialog-footer" }, ue = /* @__PURE__ */ i({
13
- __name: "OptionValue",
14
- emits: ["createOption"],
15
- setup(e, { expose: n, emit: i }) {
16
- let { t: s } = r(), { dialogRef: c, showDialog: l, hideDialog: u } = a(), d = k(1), p = k([{
17
- label: "",
18
- value: ""
19
- }]), m = k([
20
- {
21
- label: s("COMMON_OPTIONVALUE.LABEL_INDEX"),
22
- slot: "serialNumber"
23
- },
24
- {
25
- label: s("COMMON_OPTIONVALUE.LABEL_API_VALUE"),
26
- slot: "value",
27
- minWidth: 150
28
- },
29
- {
30
- label: s("COMMON_OPTIONVALUE.LABEL_OPTION_DISPLAY_VALUE"),
31
- slot: "label",
32
- minWidth: 200,
33
- headerSlot: "nowValue"
34
- },
35
- {
36
- label: s("COMMON_OPTIONVALUE.LABEL_OPERATION"),
37
- slot: "action",
38
- fixed: "right",
39
- minWidth: 100,
40
- headerSlot: "actionHeader"
41
- }
42
- ]), _ = k({}), y = () => {
43
- p.value.push({
44
- label: "",
45
- value: ""
46
- }), d.value = p.value.length;
47
- }, S = (e) => {
48
- console.log("option数据", e), _.value = e, e["extend-widget-item"] && e["extend-widget-item"] != "" ? p.value = JSON.parse(e["extend-widget-item"]) : p.value = [{
49
- label: "",
50
- value: ""
51
- }], l();
52
- }, C = () => {
53
- u();
54
- }, w = (e) => {
55
- p.value.splice(e, 1);
56
- }, T = i, O = () => {
57
- let e = p.value.filter((e) => e.label.trim() !== "" || e.value.trim() !== "");
58
- for (let n of e) if (n.label.trim() === "" || n.value.trim() === "") {
59
- ElMessage.error(s("COMMON_OPTIONVALUE.LABEL_OPTION_VALUE_REQUIRED"));
60
- return;
61
- }
62
- if (e.length === 0) {
63
- ElMessage.error(s("COMMON_OPTIONVALUE.LABEL_OPTION_VALUE_REQUIRED_TIP"));
64
- return;
65
- }
66
- T("createOption", {
67
- uiid: _.value.uiid,
68
- data: JSON.stringify(e)
69
- }), u();
70
- };
71
- return n({
72
- showOption: S,
73
- hideOption: C
74
- }), E(() => {}), (e, n) => {
75
- let r = j("IconQuery"), i = j("Error");
76
- return D(), h(N(o), {
77
- title: N(s)("COMMON_OPTIONVALUE.LABEL_OPTION_VALUE_SETTING"),
78
- width: "820px",
79
- ref_key: "dialogRef",
80
- ref: c
81
- }, {
82
- footer: I(() => [v("div", le, [x(N(L), { onClick: N(u) }, {
83
- default: I(() => [b(M(N(s)("COMMON_BUTTON.CANCEL_TEXT")), 1)]),
84
- _: 1
85
- }, 8, ["onClick"]), x(N(L), {
86
- type: "primary",
87
- onClick: O
88
- }, {
89
- default: I(() => [b(M(N(s)("COMMON_BUTTON.CONFIRM_AFFIRM")), 1)]),
90
- _: 1
91
- })])]),
92
- default: I(() => [x(N(f), {
93
- columns: m.value,
94
- data: p.value,
95
- hasPage: !1,
96
- total: d.value
97
- }, {
98
- nowValue: I(() => [b(M(N(s)("COMMON_OPTIONVALUE.LABEL_OPTION_VALUE")) + " ", 1), x(N(U), {
99
- placement: "top",
100
- "max-width": 50
101
- }, {
102
- content: I(() => [
103
- b(M(N(s)("COMMON_OPTIONVALUE.LABEL_OPTION_VALUE_TIP")), 1),
104
- n[0] ||= v("br", null, null, -1),
105
- b(" " + M(N(s)("COMMON_OPTIONVALUE.LABEL_OPTION_VALUE_EXAMPLE")), 1),
106
- n[1] ||= v("br", null, null, -1),
107
- b(" " + M(N(s)("COMMON_OPTIONVALUE.LABEL_OPTION_EXAMPLE")), 1),
108
- n[2] ||= v("br", null, null, -1),
109
- b(" " + M(N(s)("COMMON_OPTIONVALUE.LABEL_OPTION_EXAMPLE_2")), 1),
110
- n[3] ||= v("br", null, null, -1)
111
- ]),
112
- default: I(() => [x(N(R), { style: {
113
- "margin-left": "5px",
114
- cursor: "pointer"
115
- } }, {
116
- default: I(() => [x(r)]),
117
- _: 1
118
- })]),
119
- _: 1
120
- })]),
121
- actionHeader: I(() => [v("div", ce, [v("span", null, M(N(s)("COMMON_OPTIONVALUE.LABEL_OPERATION")), 1), x(N(L), {
122
- type: "primary",
123
- size: "small",
124
- onClick: y,
125
- icon: "IconAdd"
126
- }, {
127
- default: I(() => [b(M(N(s)("COMMON_BUTTON.ADD_NEW_TEXT")), 1)]),
128
- _: 1
129
- })])]),
130
- serialNumber: I((e) => [b(M(e.index + 1), 1)]),
131
- label: I((e) => [x(N(z), {
132
- modelValue: e.row.label,
133
- "onUpdate:modelValue": (n) => e.row.label = n,
134
- style: { width: "100%" },
135
- placeholder: N(s)("COMMON_DATA.PLACEHOLDER_INPUT")
136
- }, null, 8, [
137
- "modelValue",
138
- "onUpdate:modelValue",
139
- "placeholder"
140
- ])]),
141
- value: I((e) => [x(N(z), {
142
- modelValue: e.row.value,
143
- "onUpdate:modelValue": (n) => e.row.value = n,
144
- style: { width: "100%" },
145
- placeholder: N(s)("COMMON_DATA.PLACEHOLDER_INPUT")
146
- }, null, 8, [
147
- "modelValue",
148
- "onUpdate:modelValue",
149
- "placeholder"
150
- ])]),
151
- action: I((e) => [p.value.length > 1 ? (D(), h(N(R), {
152
- key: 0,
153
- style: {
154
- cursor: "pointer",
155
- color: "red"
156
- },
157
- onClick: (n) => w(e.index)
158
- }, {
159
- default: I(() => [x(i)]),
160
- _: 1
161
- }, 8, ["onClick"])) : g("", !0)]),
162
- _: 1
163
- }, 8, [
164
- "columns",
165
- "data",
166
- "total"
167
- ])]),
168
- _: 1
169
- }, 8, ["title"]);
170
- };
171
- }
172
- }, [["__scopeId", "data-v-2681e3ba"]]);
173
- //#endregion
174
- //#region components/ParameterTable/composables/useModeStrategy.js
175
- function de(e) {
176
- let n = m(() => e.isPluginMode), r = m(() => e.isDataType), i = m(() => e.justString), a = m(() => e.forceRequired), o = m(() => e.showMoreColumns), s = m(() => e.setType && e.setType.length === 1), c = m(() => n.value && r.value), l = m(() => n.value && i.value), u = m(() => !n.value && r.value), d = m(() => !n.value && i.value), f = m(() => {
177
- let i = n.value, a = r.value;
178
- return e.customFieldName || (i && a || i ? {
179
- name: "name",
180
- type: "type",
181
- value: "debugValue"
182
- } : {
183
- name: "dataName",
184
- type: "dataType",
185
- value: "debugValue"
186
- });
187
- });
188
- return {
189
- isPluginMode: n,
190
- isDataType: r,
191
- isJustString: i,
192
- isForceRequired: a,
193
- showMoreColumns: o,
194
- isSingleType: s,
195
- isPluginDataTypeMode: c,
196
- isPluginJustStringMode: l,
197
- isNormalDataTypeMode: u,
198
- isNormalJustStringMode: d,
199
- getFieldName: (e) => f.value[e] || e
200
- };
201
- }
202
- //#endregion
203
- //#region components/ParameterTable/composables/useParameterTableContext.js
204
- var fe = Symbol("ParameterTableContext");
205
- function pe(e) {
206
- let { props: n, tableData: i, emit: a, getSnowFlakeId: o, typeList: s, isSingleType: c, validationErrors: l, focusFields: u, tableRef: d } = e, { t: f } = r(), p = de(n), h = p.getFieldName, g = {
207
- props: n,
208
- tableData: i,
209
- emit: a,
210
- getSnowFlakeId: o,
211
- typeList: s,
212
- isSingleType: c,
213
- validationErrors: l,
214
- focusFields: u,
215
- tableRef: d,
216
- modeStrategy: p,
217
- getFieldName: h,
218
- getFieldValue: (e, n) => e[h(n)],
219
- setFieldValue: (e, n, r) => {
220
- let i = h(n);
221
- e[i] = r;
222
- },
223
- isPluginMode: p.isPluginMode,
224
- isDataType: p.isDataType,
225
- isJustString: p.isJustString,
226
- isForceRequired: p.isForceRequired,
227
- showMoreColumns: p.showMoreColumns,
228
- isPluginDataTypeMode: p.isPluginDataTypeMode,
229
- isPluginJustStringMode: p.isPluginJustStringMode,
230
- isNormalDataTypeMode: p.isNormalDataTypeMode,
231
- isNormalJustStringMode: p.isNormalJustStringMode,
232
- disabled: m(() => n.disabled),
233
- forceRequired: m(() => n.forceRequired),
234
- location: m(() => n.location),
235
- setType: m(() => n.setType),
236
- disabledFields: m(() => n.disabledFields),
237
- inputItemNamesArr: m(() => n.inputItemNamesArr),
238
- triggerTableUpdate: () => {
239
- i.value = [...i.value];
240
- },
241
- isFieldDisabled: (e) => {
242
- let r = n.disabledFields;
243
- return !r || !Array.isArray(r) ? !1 : r.includes(e);
244
- },
245
- canAddRow: () => {
246
- if (n.disabled) return !1;
247
- let e = n.disabledFields;
248
- return !e || !Array.isArray(e) ? !0 : !e.includes("add");
249
- },
250
- canDeleteRow: () => {
251
- if (n.disabled) return !1;
252
- let e = n.disabledFields;
253
- return !e || !Array.isArray(e) ? !0 : !e.includes("delete");
254
- }
255
- };
256
- return O(fe, g), g;
257
- }
258
- function J() {
259
- let e = S(fe);
260
- if (!e) throw Error(t("COMMON_PARAMETERTABLE.ERROR_USE_PARAMETER_TABLE_CONTEXT") + t("COMMON_PARAMETERTABLE.ERROR_USE_PARAMETER_TEXT"));
261
- return e;
262
- }
263
- //#endregion
264
- //#region components/ParameterTable/components/ParameterFormatSelector.vue
265
- var me = { class: "parameter-format-selector" }, he = /* @__PURE__ */ i({
266
- __name: "ParameterFormatSelector",
267
- props: {
268
- modelValue: {
269
- type: String,
270
- default: ""
271
- },
272
- disabled: {
273
- type: Boolean,
274
- default: !1
275
- },
276
- rowData: {
277
- type: Object,
278
- required: !0
279
- }
280
- },
281
- emits: [
282
- "update:modelValue",
283
- "change",
284
- "optionCreated"
285
- ],
286
- setup(e, { emit: n }) {
287
- let { t: i } = r(), a = e, o = n, { getFieldName: s } = J(), c = [
288
- {
289
- label: i("COMMON_DATA.PLACEHOLDER_SINGLE_LINE_TEXT"),
290
- value: "input",
291
- supportTypes: [
292
- "string",
293
- "integer",
294
- "number",
295
- "boolean"
296
- ]
297
- },
298
- {
299
- label: i("COMMON_DATA.PLACEHOLDER_MULTI_LINE_TEXT"),
300
- value: "multi-input",
301
- supportTypes: [
302
- "string",
303
- "integer",
304
- "number",
305
- "boolean"
306
- ]
307
- },
308
- {
309
- label: i("COMMON_DATA.PLACEHOLDER_CHECKBOX"),
310
- value: "checkbox",
311
- supportTypes: ["string"]
312
- },
313
- {
314
- label: i("COMMON_DATA.PLACEHOLDER_RADIO_BUTTON"),
315
- value: "radio-button",
316
- supportTypes: [
317
- "string",
318
- "integer",
319
- "number",
320
- "boolean"
321
- ]
322
- },
323
- {
324
- label: i("COMMON_DATA.PLACEHOLDER_TIME_DATETIME"),
325
- value: "datetime",
326
- supportTypes: ["string"]
327
- },
328
- {
329
- label: i("COMMON_DATA.PLACEHOLDER_IMAGE"),
330
- value: "image",
331
- supportTypes: ["file"]
332
- },
333
- {
334
- label: i("COMMON_DATA.PLACEHOLDER_FILE"),
335
- value: "file",
336
- supportTypes: ["file"]
337
- }
338
- ], l = k(a.modelValue), u = k(null), d = m(() => {
339
- let e = a.rowData[s("type")];
340
- return e ? c.filter((n) => n.supportTypes.includes(e)) : c;
341
- }), f = m(() => l.value === "checkbox" || l.value === "radio-button");
342
- F(() => a.modelValue, (e) => {
343
- l.value = e;
344
- }), F(() => a.rowData[s("type")], (e) => {
345
- if (e && l.value) {
346
- let n = c.find((e) => e.value === l.value);
347
- n && !n.supportTypes.includes(e) && (l.value = "input", o("update:modelValue", "input"), o("change", "input", a.rowData));
348
- }
349
- });
350
- let v = () => {
351
- o("update:modelValue", l.value), o("change", l.value, a.rowData);
352
- }, y = () => {
353
- u.value && u.value.showOption(a.rowData);
354
- }, b = (e) => {
355
- o("optionCreated", e);
356
- };
357
- return (n, r) => {
358
- let a = j("IconEdit2");
359
- return D(), _("div", me, [
360
- x(N(V), {
361
- modelValue: l.value,
362
- "onUpdate:modelValue": r[0] ||= (e) => l.value = e,
363
- disabled: e.disabled,
364
- placeholder: N(i)("COMMON_DATA.PLACEHOLDER_SELECT"),
365
- style: { width: "100%" },
366
- onChange: v
367
- }, {
368
- default: I(() => [(D(!0), _(p, null, A(d.value, (e) => (D(), h(N(B), {
369
- key: e.value,
370
- label: e.label,
371
- value: e.value
372
- }, null, 8, ["label", "value"]))), 128))]),
373
- _: 1
374
- }, 8, [
375
- "modelValue",
376
- "disabled",
377
- "placeholder"
378
- ]),
379
- f.value ? (D(), h(N(R), {
380
- key: 0,
381
- class: "edit-icon",
382
- onClick: y
383
- }, {
384
- default: I(() => [x(a)]),
385
- _: 1
386
- })) : g("", !0),
387
- x(ue, {
388
- ref_key: "optionValueDialog",
389
- ref: u,
390
- onCreateOption: b
391
- }, null, 512)
392
- ]);
393
- };
394
- }
395
- }, [["__scopeId", "data-v-acb7ffce"]]), Y = [
396
- {
397
- label: "String",
398
- value: "string",
399
- example: ""
400
- },
401
- {
402
- label: "Number",
403
- value: "number",
404
- example: 0
405
- },
406
- {
407
- label: "Integer",
408
- value: "integer",
409
- example: 0
410
- },
411
- {
412
- label: "Boolean",
413
- value: "boolean",
414
- example: !1
415
- },
416
- {
417
- label: "File",
418
- value: "file",
419
- example: ""
420
- },
421
- {
422
- label: "Object",
423
- value: "object",
424
- example: {}
425
- },
426
- {
427
- label: "Array<String>",
428
- value: "arrayString",
429
- example: []
430
- },
431
- {
432
- label: "Array<Number>",
433
- value: "arrayNumber",
434
- example: []
435
- },
436
- {
437
- label: "Array<Integer>",
438
- value: "arrayInteger",
439
- example: []
440
- },
441
- {
442
- label: "Array<Boolean>",
443
- value: "arrayBoolean",
444
- example: []
445
- },
446
- {
447
- label: "Array<File>",
448
- value: "arrayFile",
449
- example: []
450
- },
451
- {
452
- label: "Array<Object>",
453
- value: "arrayObject",
454
- example: []
455
- }
456
- ], X = (() => {
457
- let e = {};
458
- return Y.forEach((n) => {
459
- e[n.value] = n.label;
460
- }), e;
461
- })(), ge = [
462
- "arrayString",
463
- "arrayFile",
464
- "arrayInteger",
465
- "arrayNumber",
466
- "arrayObject",
467
- "arrayBoolean",
468
- "arrayImage"
469
- ], _e = ["GET", "HEAD"], ve = [
470
- {
471
- value: "POST",
472
- label: "POST"
473
- },
474
- {
475
- value: "GET",
476
- label: "GET"
477
- },
478
- {
479
- value: "PUT",
480
- label: "PUT"
481
- },
482
- {
483
- value: "DELETE",
484
- label: "DELETE"
485
- },
486
- {
487
- value: "PATCH",
488
- label: "PATCH"
489
- },
490
- {
491
- value: "HEAD",
492
- label: "HEAD"
493
- }
494
- ], Z = (e) => ge.includes(e) || e === "array", Q = (e, n) => {
495
- let { nameField: r, typeField: i, valueField: a } = n;
496
- if (!e.children || e.children.length === 0) return;
497
- let o = e[i];
498
- if (Z(o)) {
499
- let r = [];
500
- return e.children.forEach((e) => {
501
- if (e.children && e.children.length > 0) r.push(Q(e, n));
502
- else {
503
- let o = e[a], s = o !== void 0 && o !== "" ? o : "", c = e[i];
504
- c === "number" || c === "integer" ? s = s === "" ? 0 : Number(s) : c === "boolean" ? s = s === "" ? !1 : !!s : c === "object" && (s = Q(e, n) || {}), r.push(s);
505
- }
506
- }), r;
507
- }
508
- if (o === "object") {
509
- let o = {};
510
- return e.children.forEach((e) => {
511
- let s = e[r];
512
- if (!(!s || s === "[Array Item]")) if (e.children && e.children.length > 0) o[s] = Q(e, n);
513
- else {
514
- let r = e[a], c = r !== void 0 && r !== "" ? r : "", l = e[i];
515
- l === "number" || l === "integer" ? c = c === "" ? 0 : Number(c) : l === "boolean" ? c = c === "" ? !1 : !!c : l === "object" ? c = Q(e, n) || {} : Z(l) && (c = Q(e, n) || []), o[s] = c;
516
- }
517
- }), o;
518
- }
519
- }, ye = { class: "value-cell" }, be = {
520
- key: 2,
521
- class: "filename-box"
522
- }, $ = {
523
- key: 4,
524
- class: "filename-box"
525
- }, xe = {
526
- key: 1,
527
- class: "filename-box"
528
- }, Se = {
529
- key: 1,
530
- class: "error-message"
531
- }, Ce = /* @__PURE__ */ i({
532
- __name: "ValueCell",
533
- props: /* @__PURE__ */ C({ row: {
534
- type: Object,
535
- required: !0
536
- } }, {
537
- value: {
538
- type: [
539
- String,
540
- Number,
541
- Boolean,
542
- Object,
543
- Array
544
- ],
545
- default: ""
546
- },
547
- valueModifiers: {},
548
- type: {
549
- type: String,
550
- default: "string"
551
- },
552
- typeModifiers: {}
553
- }),
554
- emits: ["update:value", "update:type"],
555
- setup(e) {
556
- let { t: n } = r(), i = e, a = P(e, "value"), o = P(e, "type"), { isFieldDisabled: f, props: y, emit: S, getFieldName: C, validationErrors: w } = J(), E = m(() => y.isPluginMode), O = m(() => y.disabled), k = m(() => {
557
- if (!E.value || !i.row.required) return null;
558
- let e = i.row.uiid, n = C("value");
559
- return w.value[e]?.[n];
560
- }), j = m(() => !!k.value), F = m(() => O.value || i.row.disabled || f("value")), ee = m(() => i.row.extendWidgetType === "file" || o.value === "file"), ne = m(() => i.row[C("type")] === "image" || i.row[C("type")] === "file"), H = m(() => {
561
- let e = i.row["extend-widget-item"];
562
- if (!e) return [];
563
- if (Array.isArray(e)) return e;
564
- try {
565
- return typeof e == "string" ? JSON.parse(e) : [];
566
- } catch {
567
- return [];
568
- }
569
- }), U = () => {
570
- if (E.value && i.row.required) {
571
- let e = i.row.uiid, r = C("value"), a = i.row[r];
572
- a == null || a === "" || Array.isArray(a) && a.length === 0 || typeof a == "string" && !a.trim() ? w.value[e] = {
573
- ...w.value[e],
574
- [r]: n("COMMON_DATA.REQUIRED_NULL")
575
- } : w.value[e]?.[r] && (delete w.value[e][r], Object.keys(w.value[e]).length === 0 && delete w.value[e]);
576
- }
577
- }, W = () => {
578
- U(), S("debugger-data-change");
579
- }, G = (e) => {
580
- a.value = e, W();
581
- }, K = () => {
582
- a.value = "", W();
583
- };
584
- return (r, i) => (D(), _("div", ye, [!N(Z)(o.value) && o.value !== "object" && o.value !== "arrayObject" ? (D(), _(p, { key: 0 }, [E.value ? (D(), _(p, { key: 0 }, [e.row.extendWidgetType === "datetime" ? (D(), h(N(te), {
585
- key: 0,
586
- modelValue: a.value,
587
- "onUpdate:modelValue": i[0] ||= (e) => a.value = e,
588
- type: "datetime",
589
- disabled: F.value,
590
- style: { width: "100%" },
591
- placeholder: N(n)("COMMON_DATA.PLACEHOLDER_DATETIME"),
592
- format: "YYYY-MM-DD HH:mm:ss",
593
- "value-format": "YYYY-MM-DD HH:mm:ss",
594
- class: T({ "error-input": j.value }),
595
- onChange: W
596
- }, null, 8, [
597
- "modelValue",
598
- "disabled",
599
- "placeholder",
600
- "class"
601
- ])) : e.row.extendWidgetType === "image" && !a.value ? (D(), h(N(u), {
602
- key: 1,
603
- uploadType: N(s).自定义,
604
- acceptType: N(l)("image"),
605
- multiple: !1,
606
- limitSize: 1,
607
- limitCount: 1,
608
- warnTips: N(c)("image"),
609
- onOnSuccess: G
610
- }, {
611
- "upload-box": I(() => [x(N(L), {
612
- icon: N(oe),
613
- type: "primary"
614
- }, {
615
- default: I(() => [b(M(N(n)("COMMON_BUTTON.UPLOAD_IMAGE_TEXT")), 1)]),
616
- _: 1
617
- }, 8, ["icon"])]),
618
- _: 1
619
- }, 8, [
620
- "uploadType",
621
- "acceptType",
622
- "warnTips"
623
- ])) : e.row.extendWidgetType === "image" && a.value ? (D(), _("div", be, [v("div", null, [x(N(d), { content: a.value }, {
624
- default: I(() => [b(M(a.value.effectiveUrl), 1)]),
625
- _: 1
626
- }, 8, ["content"])]), x(N(R), {
627
- class: "filename-icon",
628
- onClick: K
629
- }, {
630
- default: I(() => [x(N(re))]),
631
- _: 1
632
- })])) : ee.value && !a.value ? (D(), h(N(u), {
633
- key: 3,
634
- uploadType: N(s).自定义,
635
- acceptType: N(l)("file"),
636
- multiple: !1,
637
- limitSize: 1,
638
- limitCount: 1,
639
- warnTips: N(c)("file"),
640
- onOnSuccess: G
641
- }, {
642
- "upload-box": I(() => [x(N(L), {
643
- icon: N(oe),
644
- type: "primary"
645
- }, {
646
- default: I(() => [b(M(N(n)("COMMON_BUTTON.UPLOAD_FILE_TEXT")), 1)]),
647
- _: 1
648
- }, 8, ["icon"])]),
649
- _: 1
650
- }, 8, [
651
- "uploadType",
652
- "acceptType",
653
- "warnTips"
654
- ])) : ee.value && a.value ? (D(), _("div", $, [v("div", null, [x(N(d), { content: a.value }, {
655
- default: I(() => [b(M(a.value.effectiveUrl), 1)]),
656
- _: 1
657
- }, 8, ["content"])]), x(N(R), {
658
- class: "filename-icon",
659
- onClick: K
660
- }, {
661
- default: I(() => [x(N(re))]),
662
- _: 1
663
- })])) : e.row.extendWidgetType === "checkbox" || e.row.extendWidgetType === "radio-button" ? (D(), h(N(V), {
664
- key: 5,
665
- modelValue: a.value,
666
- "onUpdate:modelValue": i[1] ||= (e) => a.value = e,
667
- multiple: e.row.extendWidgetType === "checkbox",
668
- style: { width: "100%" },
669
- disabled: F.value,
670
- placeholder: N(n)("COMMON_DATA.PLACEHOLDER_SELECT"),
671
- class: T({ "error-select": j.value }),
672
- onChange: W
673
- }, {
674
- default: I(() => [(D(!0), _(p, null, A(H.value, (e) => (D(), h(N(B), {
675
- key: e.value,
676
- label: e.label,
677
- value: e.value
678
- }, null, 8, ["label", "value"]))), 128))]),
679
- _: 1
680
- }, 8, [
681
- "modelValue",
682
- "multiple",
683
- "disabled",
684
- "placeholder",
685
- "class"
686
- ])) : e.row.extendWidgetType === "multi-input" ? (D(), h(N(z), {
687
- key: 6,
688
- modelValue: a.value,
689
- "onUpdate:modelValue": i[2] ||= (e) => a.value = e,
690
- type: "textarea",
691
- rows: 3,
692
- onBlur: W,
693
- disabled: F.value,
694
- style: { width: "100%" },
695
- placeholder: N(n)("COMMON_DATA.PLACEHOLDER_INPUT"),
696
- class: T({ "error-input": j.value })
697
- }, null, 8, [
698
- "modelValue",
699
- "disabled",
700
- "placeholder",
701
- "class"
702
- ])) : e.row[N(C)("type")] === "boolean" ? (D(), h(N(V), {
703
- key: 7,
704
- modelValue: a.value,
705
- "onUpdate:modelValue": i[3] ||= (e) => a.value = e,
706
- onChange: W,
707
- disabled: F.value,
708
- style: { width: "100%" },
709
- placeholder: N(n)("COMMON_DATA.PLACEHOLDER_SELECT")
710
- }, {
711
- default: I(() => [x(N(B), {
712
- value: !0,
713
- label: "true"
714
- }), x(N(B), {
715
- value: !1,
716
- label: "false"
717
- })]),
718
- _: 1
719
- }, 8, [
720
- "modelValue",
721
- "disabled",
722
- "placeholder"
723
- ])) : e.row[N(C)("type")] === "number" || e.row[N(C)("type")] === "integer" ? (D(), h(N(z), {
724
- key: 8,
725
- modelValue: a.value,
726
- "onUpdate:modelValue": i[4] ||= (e) => a.value = e,
727
- modelModifiers: { number: !0 },
728
- type: "number",
729
- class: "number-input-no-spinner",
730
- onBlur: W,
731
- disabled: F.value,
732
- style: { width: "100%" },
733
- placeholder: N(n)("COMMON_DATA.PLACEHOLDER_NUMBER")
734
- }, null, 8, [
735
- "modelValue",
736
- "disabled",
737
- "placeholder"
738
- ])) : (D(), h(N(z), {
739
- key: 9,
740
- modelValue: a.value,
741
- "onUpdate:modelValue": i[5] ||= (e) => a.value = e,
742
- onBlur: W,
743
- disabled: F.value,
744
- style: { width: "100%" },
745
- placeholder: N(n)("COMMON_DATA.PLACEHOLDER_INPUT"),
746
- class: T({ "error-input": j.value })
747
- }, null, 8, [
748
- "modelValue",
749
- "disabled",
750
- "placeholder",
751
- "class"
752
- ]))], 64)) : (D(), _(p, { key: 1 }, [!a.value && ne.value ? (D(), h(N(u), {
753
- key: 0,
754
- uploadType: N(s).自定义,
755
- acceptType: N(l)(e.row[N(C)("type")]),
756
- multiple: !1,
757
- limitSize: 1,
758
- limitCount: 1,
759
- warnTips: N(c)(e.row[N(C)("type")]),
760
- onOnSuccess: G
761
- }, {
762
- "upload-box": I(() => [x(N(L), {
763
- icon: N(oe),
764
- type: "primary"
765
- }, {
766
- default: I(() => [b(M(N(n)("COMMON_BUTTON.UPLOADING_TEXT")), 1)]),
767
- _: 1
768
- }, 8, ["icon"])]),
769
- _: 1
770
- }, 8, [
771
- "uploadType",
772
- "acceptType",
773
- "warnTips"
774
- ])) : a.value && ne.value ? (D(), _("div", xe, [v("div", null, [x(N(d), { content: a.value }, {
775
- default: I(() => [b(M(a.value.effectiveUrl), 1)]),
776
- _: 1
777
- }, 8, ["content"])]), x(N(R), {
778
- class: "filename-icon",
779
- onClick: K
780
- }, {
781
- default: I(() => [x(N(re))]),
782
- _: 1
783
- })])) : e.row[N(C)("type")] === "boolean" ? (D(), h(N(V), {
784
- key: 2,
785
- modelValue: a.value,
786
- "onUpdate:modelValue": i[6] ||= (e) => a.value = e,
787
- onChange: W,
788
- disabled: F.value,
789
- style: { width: "100%" },
790
- placeholder: N(n)("COMMON_DATA.PLACEHOLDER_SELECT"),
791
- class: T({ "error-select": j.value })
792
- }, {
793
- default: I(() => [x(N(B), {
794
- value: !0,
795
- label: "true"
796
- }), x(N(B), {
797
- value: !1,
798
- label: "false"
799
- })]),
800
- _: 1
801
- }, 8, [
802
- "modelValue",
803
- "disabled",
804
- "placeholder",
805
- "class"
806
- ])) : e.row[N(C)("type")] === "number" || e.row[N(C)("type")] === "integer" ? (D(), h(N(z), {
807
- key: 3,
808
- modelValue: a.value,
809
- "onUpdate:modelValue": i[7] ||= (e) => a.value = e,
810
- modelModifiers: { number: !0 },
811
- type: "number",
812
- class: T(["number-input-no-spinner", { "error-input": j.value }]),
813
- onBlur: W,
814
- disabled: F.value,
815
- style: { width: "100%" },
816
- placeholder: N(n)("COMMON_DATA.PLACEHOLDER_NUMBER")
817
- }, null, 8, [
818
- "modelValue",
819
- "class",
820
- "disabled",
821
- "placeholder"
822
- ])) : (D(), h(N(z), {
823
- key: 4,
824
- modelValue: a.value,
825
- "onUpdate:modelValue": i[8] ||= (e) => a.value = e,
826
- onBlur: W,
827
- disabled: F.value,
828
- style: { width: "100%" },
829
- placeholder: N(n)("COMMON_DATA.PLACEHOLDER_INPUT"),
830
- class: T({ "error-input": j.value })
831
- }, null, 8, [
832
- "modelValue",
833
- "disabled",
834
- "placeholder",
835
- "class"
836
- ]))], 64))], 64)) : g("", !0), k.value ? (D(), _("div", Se, M(k.value), 1)) : g("", !0)]));
837
- }
838
- }, [["__scopeId", "data-v-36fe7764"]]), we = { class: "name-input-container" }, Te = {
839
- key: 0,
840
- class: "array-item-display"
841
- }, Ee = {
842
- key: 2,
843
- class: "error-message"
844
- }, De = /* @__PURE__ */ i({
845
- __name: "NameCell",
846
- props: /* @__PURE__ */ C({
847
- row: {
848
- type: Object,
849
- required: !0
850
- },
851
- arrayItemIndex: {
852
- type: Number,
853
- default: 1
854
- }
855
- }, {
856
- name: {
857
- type: String,
858
- default: ""
859
- },
860
- nameModifiers: {}
861
- }),
862
- emits: /* @__PURE__ */ C(["focus", "blur"], ["update:name"]),
863
- setup(e, { emit: n }) {
864
- let r = e, i = P(e, "name"), { getFieldName: a, getFieldValue: o, isFieldDisabled: s, props: c, validationErrors: l, focusFields: u } = J(), d = n, f = a("name"), p = m(() => o(r.row, "name") === "[Array Item]" && (!c.isDataType || c.isPluginMode)), v = m(() => c.disabled || r.row.disabled || s("name")), y = m(() => r.arrayItemIndex), S = m(() => l.value[r.row.uiid]?.[f]), C = m(() => u.value[r.row.uiid]?.[f]), w = m(() => S.value && !C.value), E = () => {
865
- u.value[r.row.uiid] || (u.value[r.row.uiid] = {}), u.value[r.row.uiid][f] = !0, d("focus", r.row.uiid, f);
866
- }, O = () => {
867
- u.value[r.row.uiid] && (u.value[r.row.uiid][f] = !1), d("blur", r.row, f);
868
- };
869
- return (e, n) => (D(), _("div", we, [p.value ? (D(), _("div", Te, [x(N(H), {
870
- type: "info",
871
- size: "small",
872
- class: "array-tag"
873
- }, {
874
- default: I(() => [x(N(R), null, {
875
- default: I(() => [x(N(ie))]),
876
- _: 1
877
- }), b(" " + M(e.t("COMMON_PLUGIN_TOOL.LABEL_PARAM_ARRAY_ITEM")) + " " + M(y.value), 1)]),
878
- _: 1
879
- })])) : (D(), h(N(z), {
880
- key: 1,
881
- modelValue: i.value,
882
- "onUpdate:modelValue": n[0] ||= (e) => i.value = e,
883
- disabled: v.value,
884
- onFocus: E,
885
- onBlur: O,
886
- style: { width: "100%" },
887
- placeholder: e.t("COMMON_PLUGIN_TOOL.LABEL_PARAM_NAME_PLACEHOLDER"),
888
- class: T({ "error-input": w.value })
889
- }, null, 8, [
890
- "modelValue",
891
- "disabled",
892
- "placeholder",
893
- "class"
894
- ])), w.value ? (D(), _("div", Ee, M(S.value), 1)) : g("", !0)]));
895
- }
896
- }, [["__scopeId", "data-v-526e0290"]]), Oe = { class: "type-select-container" }, ke = { key: 1 }, Ae = {
897
- key: 2,
898
- class: "error-message"
899
- }, je = /* @__PURE__ */ i({
900
- __name: "TypeCell",
901
- props: /* @__PURE__ */ C({ row: {
902
- type: Object,
903
- required: !0
904
- } }, {
905
- type: {
906
- type: String,
907
- default: "string"
908
- },
909
- typeModifiers: {}
910
- }),
911
- emits: /* @__PURE__ */ C(["change"], ["update:type"]),
912
- setup(e, { emit: n }) {
913
- let r = e, i = P(e, "type"), a = n, { getFieldName: o, getFieldValue: s, isFieldDisabled: c, props: l, validationErrors: u, focusFields: d, typeList: f, isSingleType: v } = J(), y = o("type");
914
- o("name");
915
- let b = m(() => !(l.justString || s(r.row, "name") === "[Array Item]" && !l.isDataType || v.value)), x = m(() => l.disabled || r.row.disabled || c("type") || r.row["extend-widget-type"] === "input" || r.row["extend-widget-type"] === "multi-input"), S = m(() => {
916
- let e = s(r.row, "name"), n = r.row[y];
917
- return e === "[Array Item]" ? X[n] || "String" : v.value && f.value.length > 0 ? f.value[0].label : l.isDataType && X[n] || "String";
918
- }), C = m(() => u.value[r.row.uiid]?.[y]), w = m(() => d.value[r.row.uiid]?.[y]), E = m(() => C.value && !w.value), O = () => {
919
- a("change", r.row);
920
- };
921
- return (n, r) => (D(), _("div", Oe, [b.value ? (D(), h(N(V), {
922
- key: 0,
923
- modelValue: i.value,
924
- "onUpdate:modelValue": r[0] ||= (e) => i.value = e,
925
- "data-uiid": e.row.uiid,
926
- disabled: x.value,
927
- placeholder: "Select",
928
- style: { width: "100%" },
929
- class: T({ "error-select": E.value }),
930
- onChange: O
931
- }, {
932
- default: I(() => [(D(!0), _(p, null, A(N(f), (e) => (D(), h(N(B), {
933
- key: e.value,
934
- label: e.label,
935
- value: e.value
936
- }, null, 8, ["label", "value"]))), 128))]),
937
- _: 1
938
- }, 8, [
939
- "modelValue",
940
- "data-uiid",
941
- "disabled",
942
- "class"
943
- ])) : (D(), _("span", ke, M(S.value), 1)), E.value ? (D(), _("div", Ae, M(C.value), 1)) : g("", !0)]));
944
- }
945
- }, [["__scopeId", "data-v-210bfeea"]]), Me = {
946
- key: 0,
947
- class: "action-buttons"
948
- }, Ne = /* @__PURE__ */ i({
949
- __name: "ActionCell",
950
- props: {
951
- row: {
952
- type: Object,
953
- required: !0
954
- },
955
- scope: {
956
- type: Object,
957
- required: !0
958
- }
959
- },
960
- emits: [
961
- "add-child",
962
- "move-up",
963
- "move-down",
964
- "delete"
965
- ],
966
- setup(e, { emit: n }) {
967
- let { t: i } = r(), a = e, o = n, { getFieldName: s, getFieldValue: c, canAddRow: l, canDeleteRow: u, props: d } = J(), f = m(() => d.disabled), v = m(() => a.row[s("type")]), y = m(() => c(a.row, "name")), b = m(() => d.isDataType ? v.value === "object" || v.value === "arrayObject" : Z(v.value) || v.value === "object"), S = m(() => d.isDataType ? v.value === "object" || v.value === "arrayObject" ? i("COMMON_ACTIONCELL.LABEL_ADD_OBJECT_PROPERTY") : i("COMMON_ACTIONCELL.LABEL_ADD_CHILD") : Z(v.value) ? v.value === "arrayObject" ? i("COMMON_ACTIONCELL.LABEL_ADD_OBJECT_TO_ARRAY") : i("COMMON_ACTIONCELL.LABEL_ADD_ARRAY_ITEM") : v.value === "object" ? i("COMMON_ACTIONCELL.LABEL_ADD_PROPERTY") : i("COMMON_ACTIONCELL.LABEL_ADD_CHILD")), C = m(() => b.value && l()), w = m(() => y.value === "[Array Item]" && !d.isDataType), T = m(() => d.isDataType && y.value !== "[Array Item]"), E = m(() => a.scope._canMoveUp || !1), O = m(() => a.scope._canMoveDown || !1), k = m(() => f.value || a.row.disabled ? !1 : a.scope._showDelete && u()), A = () => {
968
- o("add-child", a.scope);
969
- }, j = () => {
970
- o("move-up", a.row, "up");
971
- }, M = () => {
972
- o("move-down", a.row, "down");
973
- }, P = () => {
974
- o("delete", a.scope);
975
- };
976
- return (e, n) => f.value ? g("", !0) : (D(), _("div", Me, [
977
- C.value ? (D(), h(N(R), {
978
- key: 0,
979
- class: "table-form__add",
980
- onClick: A,
981
- title: S.value
982
- }, {
983
- default: I(() => [x(N(G))]),
984
- _: 1
985
- }, 8, ["title"])) : g("", !0),
986
- w.value ? (D(), _(p, { key: 1 }, [E.value ? (D(), h(N(R), {
987
- key: 0,
988
- class: "table-form__action array-action",
989
- onClick: j,
990
- title: N(i)("COMMON_ACTIONCELL.LABEL_MOVE_UP")
991
- }, {
992
- default: I(() => [x(N(q))]),
993
- _: 1
994
- }, 8, ["title"])) : g("", !0), O.value ? (D(), h(N(R), {
995
- key: 1,
996
- class: "table-form__action array-action",
997
- onClick: M,
998
- title: N(i)("COMMON_ACTIONCELL.LABEL_MOVE_DOWN")
999
- }, {
1000
- default: I(() => [x(N(se))]),
1001
- _: 1
1002
- }, 8, ["title"])) : g("", !0)], 64)) : g("", !0),
1003
- T.value ? (D(), _(p, { key: 2 }, [E.value ? (D(), h(N(R), {
1004
- key: 0,
1005
- class: "table-form__action array-action",
1006
- onClick: j,
1007
- title: N(i)("COMMON_ACTIONCELL.LABEL_MOVE_UP")
1008
- }, {
1009
- default: I(() => [x(N(q))]),
1010
- _: 1
1011
- }, 8, ["title"])) : g("", !0), O.value ? (D(), h(N(R), {
1012
- key: 1,
1013
- class: "table-form__action array-action",
1014
- onClick: M,
1015
- title: N(i)("COMMON_ACTIONCELL.LABEL_MOVE_DOWN")
1016
- }, {
1017
- default: I(() => [x(N(se))]),
1018
- _: 1
1019
- }, 8, ["title"])) : g("", !0)], 64)) : g("", !0),
1020
- k.value ? (D(), h(N(R), {
1021
- key: 3,
1022
- class: "table-form__action",
1023
- onClick: P,
1024
- title: N(i)("COMMON_ACTIONCELL.LABEL_DELETE")
1025
- }, {
1026
- default: I(() => [x(N(K))]),
1027
- _: 1
1028
- }, 8, ["title"])) : g("", !0)
1029
- ]));
1030
- }
1031
- }, [["__scopeId", "data-v-d76e5a0b"]]), Pe = {
1032
- name: {
1033
- get label() {
1034
- return n("COMMON_PARAMETERTABLE.ARGUMENT_PARAM_NAME");
1035
- },
1036
- slot: "name",
1037
- minWidth: 350,
1038
- headerSlot: "keyHeader",
1039
- required: !0
1040
- },
1041
- type: {
1042
- get label() {
1043
- return n("COMMON_PARAMETERTABLE.ARGUMENT_PARAM_TYPE");
1044
- },
1045
- slot: "type",
1046
- minWidth: 150,
1047
- headerSlot: "typeHeader",
1048
- required: !0
1049
- },
1050
- typeNarrow: {
1051
- get label() {
1052
- return n("COMMON_PARAMETERTABLE.ARGUMENT_PARAM_TYPE");
1053
- },
1054
- slot: "type",
1055
- minWidth: 100,
1056
- headerSlot: "typeHeader"
1057
- },
1058
- descriptionRequired: {
1059
- get label() {
1060
- return n("COMMON_PARAMETERTABLE.ARGUMENT_PARAM_DESC");
1061
- },
1062
- slot: "description",
1063
- minWidth: 250,
1064
- headerSlot: "descHeader",
1065
- required: !0
1066
- },
1067
- description: {
1068
- get label() {
1069
- return n("COMMON_PARAMETERTABLE.ARGUMENT_PARAM_DESC");
1070
- },
1071
- slot: "description",
1072
- minWidth: 150,
1073
- headerSlot: "descHeader",
1074
- required: !1
1075
- },
1076
- descriptionNarrow: {
1077
- get label() {
1078
- return n("COMMON_PARAMETERTABLE.ARGUMENT_PARAM_DESC");
1079
- },
1080
- slot: "description",
1081
- minWidth: 150
1082
- },
1083
- required: {
1084
- get label() {
1085
- return n("COMMON_PARAMETERTABLE.ARGUMENT_PARAM_REQUIRED");
1086
- },
1087
- slot: "required",
1088
- minWidth: 100
1089
- },
1090
- showName: {
1091
- get label() {
1092
- return n("COMMON_PARAMETERTABLE.ARGUMENT_PARAM_SHOW_NAME");
1093
- },
1094
- slot: "showName",
1095
- minWidth: 200,
1096
- headerSlot: "showNameHeader"
1097
- },
1098
- default: {
1099
- get label() {
1100
- return n("COMMON_PARAMETERTABLE.ARGUMENT_PARAM_DEFAULT_VALUE");
1101
- },
1102
- slot: "default",
1103
- minWidth: 180
1104
- },
1105
- isShow: {
1106
- get label() {
1107
- return n("COMMON_PARAMETERTABLE.ARGUMENT_PARAM_IS_SHOW");
1108
- },
1109
- slot: "isShow",
1110
- minWidth: 150,
1111
- headerSlot: "isShowHeader"
1112
- },
1113
- test: {
1114
- get label() {
1115
- return n("COMMON_PARAMETERTABLE.ARGUMENT_PARAM_TEST_VALUE");
1116
- },
1117
- slot: "test",
1118
- minWidth: 180
1119
- },
1120
- mock: {
1121
- get label() {
1122
- return n("COMMON_PARAMETERTABLE.ARGUMENT_PARAM_MOCK_VALUE");
1123
- },
1124
- slot: "test",
1125
- minWidth: 100
1126
- },
1127
- mockWide: {
1128
- get label() {
1129
- return n("COMMON_PARAMETERTABLE.ARGUMENT_PARAM_MOCK_VALUE");
1130
- },
1131
- slot: "test",
1132
- minWidth: 180
1133
- },
1134
- action: {
1135
- get label() {
1136
- return n("COMMON_PARAMETERTABLE.LABEL_OPERATION");
1137
- },
1138
- slot: "action",
1139
- fixed: "right",
1140
- width: 140,
1141
- headerSlot: "actionHeader"
1142
- }
1143
- }, Fe = {
1144
- plugin: [
1145
- "name",
1146
- "type",
1147
- "descriptionRequired",
1148
- "required",
1149
- "test",
1150
- "action"
1151
- ],
1152
- pluginMore: [
1153
- "name",
1154
- "type",
1155
- "descriptionRequired",
1156
- "required",
1157
- "showName",
1158
- "default",
1159
- "isShow",
1160
- "test",
1161
- "action"
1162
- ],
1163
- pluginDataType: [
1164
- "name",
1165
- "type",
1166
- "description",
1167
- "action"
1168
- ],
1169
- pluginJustString: [
1170
- "name",
1171
- "descriptionRequired",
1172
- "required",
1173
- "test",
1174
- "action"
1175
- ],
1176
- pluginJustStringMore: [
1177
- "name",
1178
- "descriptionRequired",
1179
- "required",
1180
- "showName",
1181
- "default",
1182
- "isShow",
1183
- "test",
1184
- "action"
1185
- ],
1186
- normal: [
1187
- "name",
1188
- "typeNarrow",
1189
- "mock",
1190
- "action"
1191
- ],
1192
- normalDataType: [
1193
- "name",
1194
- "typeNarrow",
1195
- "descriptionNarrow",
1196
- "action"
1197
- ],
1198
- normalJustString: [
1199
- "name",
1200
- "mockWide",
1201
- "action"
1202
- ]
1203
- };
1204
- function Ie(e) {
1205
- return e.map((e) => {
1206
- let n = Pe[e];
1207
- if (!n) return console.warn(`列配置 "${e}" 不存在`), null;
1208
- let r = Object.create(Object.getPrototypeOf(n));
1209
- return Object.defineProperties(r, Object.getOwnPropertyDescriptors(n)), r;
1210
- }).filter(Boolean);
1211
- }
1212
- function Le(e) {
1213
- return e.isPluginMode && e.isDataType ? "pluginDataType" : e.justString ? e.isPluginMode ? e.showMoreColumns ? "pluginJustStringMore" : "pluginJustString" : "normalJustString" : e.isPluginMode ? e.showMoreColumns ? "pluginMore" : "plugin" : e.isDataType ? "normalDataType" : "normal";
1214
- }
1215
- function Re(e) {
1216
- return { columns: m(() => {
1217
- let n = Le(e), r = Fe[n];
1218
- return r ? Ie(r) : (console.warn(`列预设 "${n}" 不存在,使用默认配置`), Ie(Fe.normal));
1219
- }) };
1220
- }
1221
- //#endregion
1222
- //#region components/ParameterTable/composables/useParameterValidation.js
1223
- function ze(e, n = null) {
1224
- let { t: i } = r(), { getFieldName: a, tableData: o, validationErrors: s, focusFields: c, isDataType: l, inputItemNamesArr: u } = e, d = (e, n, r = null) => {
1225
- for (let i of e) {
1226
- if (i.uiid === n) return r;
1227
- if (i.children) {
1228
- let e = d(i.children, n, i);
1229
- if (e) return e;
1230
- }
1231
- }
1232
- return null;
1233
- }, f = (e, n) => {
1234
- for (let r of e) {
1235
- if (r.uiid === n) return e;
1236
- if (r.children && r.children.length > 0) {
1237
- let e = f(r.children, n);
1238
- if (e) return e;
1239
- }
1240
- }
1241
- return null;
1242
- }, p = (e, n, r = null, c = {}) => {
1243
- let { checkEmpty: l = !1 } = c, p = /^[a-zA-Z][a-zA-Z0-9_-]*$/, m = r || a("name");
1244
- if (l && !e) return s.value[n] = {
1245
- ...s.value[n],
1246
- [m]: i("COMMON_PARAMETERTABLE.ERROR_PARAM_NAME_REQUIRED")
1247
- }, !1;
1248
- if (!e || !p.test(e)) return s.value[n] = {
1249
- ...s.value[n],
1250
- [m]: i("COMMON_PARAMETERTABLE.ERROR_PARAM_NAME_INVALID")
1251
- }, !1;
1252
- let h = f(o.value, n);
1253
- return h && h.find((r) => r[m] === e && r.uiid !== n && r[m] !== "[Array Item]") || !d(o.value, n) && u.value && u.value.length > 0 && u.value.filter((n) => (n[m] || n.dataName || n.name) === e).find((e) => e.uiid !== n) ? (s.value[n] = { [m]: i("COMMON_PARAMETERTABLE.ERROR_PARAM_NAME_DUPLICATE") }, !1) : (s.value[n] && (delete s.value[n][m], Object.keys(s.value[n]).length === 0 && delete s.value[n]), !0);
1254
- }, m = (e, n, r = null, o = {}) => {
1255
- let { checkEmpty: c = !1, checkTypesMap: l = !1 } = o, u = r || a("type");
1256
- return c && !e ? (s.value[n] = {
1257
- ...s.value[n],
1258
- [u]: i("COMMON_PARAMETERTABLE.ERROR_PARAM_TYPE_REQUIRED")
1259
- }, !1) : e === "array" ? (s.value[n] = {
1260
- ...s.value[n],
1261
- [u]: i("COMMON_PARAMETERTABLE.ERROR_ARRAY_TYPE_REQUIRED")
1262
- }, !1) : l && e && !X[e] ? (s.value[n] = {
1263
- ...s.value[n],
1264
- [u]: i("COMMON_PARAMETERTABLE.ERROR_PARAM_TYPE_INVALID")
1265
- }, !1) : (s.value[n] && (delete s.value[n][u], Object.keys(s.value[n]).length === 0 && delete s.value[n]), !0);
1266
- }, h = (e) => {
1267
- if (!Array.isArray(e)) return;
1268
- let n = a("type");
1269
- e.forEach((e) => {
1270
- let r = e[n];
1271
- r === "array" && m(r, e.uiid, n), e.children && Array.isArray(e.children) && e.children.length > 0 && h(e.children);
1272
- });
1273
- };
1274
- return {
1275
- validateDataName: p,
1276
- validateDataType: m,
1277
- validateAllDataTypes: h,
1278
- validateAllRows: (e = !1) => {
1279
- let r = !1, c = a("name"), u = a("type"), d = a("value"), f = [];
1280
- n && n.value && n.value.forEach((e) => {
1281
- e.required && e.slot && f.push(e.slot);
1282
- });
1283
- let h = (n) => {
1284
- Array.isArray(n) && n.forEach((n) => {
1285
- let a = n.uiid, o = n[c], g = n[u], _ = o === "[Array Item]";
1286
- if (_ || f.forEach((e) => {
1287
- let o = e;
1288
- e === "name" ? o = c : e === "type" && (o = u);
1289
- let l = n[o];
1290
- if (!l || typeof l == "string" && !l.trim()) {
1291
- let e = i("COMMON_PARAMETERTABLE.ERROR_PARAM_REQUIRED");
1292
- o === c ? e = i("COMMON_PARAMETERTABLE.ERROR_PARAM_NAME_REQUIRED") : o === u ? e = i("COMMON_PARAMETERTABLE.ERROR_PARAM_TYPE_REQUIRED") : o === "description" && (e = i("COMMON_PARAMETERTABLE.ERROR_PARAM_DESC_REQUIRED")), s.value[a] = {
1293
- ...s.value[a],
1294
- [o]: e
1295
- }, r = !0;
1296
- }
1297
- }), _ || p(o, a, c, { checkEmpty: !0 }) || (r = !0), _ || m(g, a, u, {
1298
- checkEmpty: !0,
1299
- checkTypesMap: l.value
1300
- }) || (r = !0), e && !_ && n.required) {
1301
- let e = n[d];
1302
- (!e || typeof e == "string" && !e.trim()) && (s.value[a] = {
1303
- ...s.value[a],
1304
- [d]: i("COMMON_PARAMETERTABLE.ERROR_PARAM_TEST_VALUE_REQUIRED")
1305
- }, r = !0);
1306
- }
1307
- if ((g === "object" || g === "arrayObject") && n.children && Array.isArray(n.children) && n.children.length > 0) {
1308
- let e = [];
1309
- n.children.forEach((n) => {
1310
- let a = n[c];
1311
- a && a !== "[Array Item]" && e.includes(a) ? (s.value[n.uiid] = {
1312
- ...s.value[n.uiid],
1313
- [c]: i("COMMON_PARAMETERTABLE.ERROR_PARAM_NAME_DUPLICATE")
1314
- }, r = !0) : a && a !== "[Array Item]" && e.push(a);
1315
- }), h(n.children);
1316
- }
1317
- });
1318
- };
1319
- return h(o.value), !r;
1320
- },
1321
- handleFocus: (e, n) => {
1322
- c.value[e] || (c.value[e] = {}), c.value[e][n] = !0;
1323
- },
1324
- handleBlur: (e, n, r, i) => {
1325
- let a = e.uiid;
1326
- c.value[a] && (c.value[a][n] = !1);
1327
- let o = e[n];
1328
- p(o, a, n), r("data-name-validate"), i();
1329
- },
1330
- findParentNode: d,
1331
- getSiblings: f,
1332
- validateDescription: (e, n) => {
1333
- let r = e.uiid;
1334
- n && !e.description ? s.value[r] = {
1335
- ...s.value[r],
1336
- description: i("COMMON_PARAMETERTABLE.ERROR_PARAM_DESC_REQUIRED")
1337
- } : s.value[r]?.description && delete s.value[r].description;
1338
- }
1339
- };
1340
- }
1341
- //#endregion
1342
- //#region components/ParameterTable/composables/useTableOperations.js
1343
- function Be(e, n, r, i, a, o) {
1344
- let { tableData: s, getFieldName: c, emit: l, validationErrors: u, tableRef: d, props: f, isJustString: p, disabled: m } = e, h = k(1), g = () => {
1345
- s.value = [...s.value];
1346
- }, _ = () => {
1347
- let e = n(), r = c("name"), i = c("type");
1348
- p.value && (e[i] = "string"), s.value = [...s.value, e], h.value = s.value.length, w(() => {
1349
- E(), s.value.forEach((e) => {
1350
- let n = e[r];
1351
- n && (a(n, e.uiid, r), l("data-name-validate"));
1352
- }), o();
1353
- });
1354
- }, v = (e) => {
1355
- y(s.value, e.row.uiid), u.value[e.row.uiid] && delete u.value[e.row.uiid], g(), h.value = s.value.length, o(), l("data-name-validate");
1356
- }, y = (e, n) => {
1357
- for (let r = 0; r < e.length; r++) {
1358
- if (e[r].uiid === n) return e.splice(r, 1), !0;
1359
- if (e[r].children && e[r].children.length > 0 && y(e[r].children, n)) return !0;
1360
- }
1361
- return !1;
1362
- }, b = (e) => {
1363
- let n = c("type"), i = (e.row.deep || 1) + 1, a = r(e.row[n], i);
1364
- e.row.children ? e.row.children.push(a) : e.row.children = [a], g(), w(() => {
1365
- E();
1366
- });
1367
- }, x = (e) => {
1368
- let n = i(s.value, e.uiid);
1369
- return n && n.children ? n.children.findIndex((n) => n.uiid === e.uiid) > 0 : !1;
1370
- }, S = (e) => {
1371
- let n = i(s.value, e.uiid);
1372
- return n && n.children ? n.children.findIndex((n) => n.uiid === e.uiid) < n.children.length - 1 : !1;
1373
- }, C = (e, n) => {
1374
- let r = i(s.value, e.uiid);
1375
- if (!r || !r.children) return;
1376
- let a = r.children.findIndex((n) => n.uiid === e.uiid);
1377
- if (a === -1) return;
1378
- let o = n === "up" ? a - 1 : a + 1;
1379
- if (o >= 0 && o < r.children.length) {
1380
- let e = r.children.splice(a, 1)[0];
1381
- r.children.splice(o, 0, e), g();
1382
- }
1383
- }, T = (e) => !(m.value || e.disabled);
1384
- function E() {
1385
- w(() => {
1386
- setTimeout(() => {
1387
- if (!d.value) return;
1388
- let e = null;
1389
- if (d.value.$el) for (let n of [
1390
- ".el-table__body-wrapper",
1391
- ".el-scrollbar__wrap",
1392
- ".aibox-table__body",
1393
- ".el-table__body",
1394
- ".table-body-wrapper",
1395
- ".el-scrollbar__view",
1396
- "[class*=\"body-wrapper\"]",
1397
- "[class*=\"scrollbar\"]",
1398
- "[class*=\"table__body\"]"
1399
- ]) {
1400
- let r = d.value.$el.querySelectorAll(n);
1401
- for (let n of r) if (n.scrollHeight > n.clientHeight) {
1402
- e = n;
1403
- break;
1404
- }
1405
- if (e) break;
1406
- }
1407
- if (!e && d.value.$el) {
1408
- let n = (e) => {
1409
- if (e.scrollHeight > e.clientHeight && e.scrollHeight > 0) return e;
1410
- for (let r of e.children || []) {
1411
- let e = n(r);
1412
- if (e) return e;
1413
- }
1414
- return null;
1415
- };
1416
- e = n(d.value.$el);
1417
- }
1418
- if (!e && d.value.$el && d.value.$el.scrollHeight > d.value.$el.clientHeight && (e = d.value.$el), e) try {
1419
- e.scrollTo({
1420
- top: e.scrollHeight,
1421
- behavior: "smooth"
1422
- });
1423
- } catch {
1424
- e.scrollTop = e.scrollHeight;
1425
- }
1426
- }, 50);
1427
- }), l("scroll-to-bottom");
1428
- }
1429
- return {
1430
- total: h,
1431
- addNewRow: _,
1432
- deleteLists: v,
1433
- addLists: b,
1434
- moveArrayItem: C,
1435
- canMoveUp: x,
1436
- canMoveDown: S,
1437
- showDeleteButton: T,
1438
- triggerTableUpdate: g
1439
- };
1440
- }
1441
- //#endregion
1442
- //#region components/ParameterTable/composables/useParameterTransform.js
1443
- function Ve(e) {
1444
- let { getFieldName: n, getSnowFlakeId: r, props: i, typeList: a, isSingleType: o, isPluginMode: s, isDataType: c, isJustString: l, forceRequired: u, location: d } = e, f = (e = 1) => {
1445
- let i = o.value ? a.value[0].value : "string", l = n("name"), f = n("type"), p = n("value"), m = {
1446
- uiid: r(),
1447
- [l]: "",
1448
- [f]: i,
1449
- [p]: "",
1450
- description: ""
1451
- };
1452
- if (s.value) {
1453
- let n = {
1454
- required: !!u.value,
1455
- extendName: "",
1456
- extendWidgetType: "",
1457
- extendDisplay: !0,
1458
- defaultValue: ""
1459
- };
1460
- return c.value ? {
1461
- ...m,
1462
- ...n,
1463
- deep: e
1464
- } : {
1465
- ...m,
1466
- ...n
1467
- };
1468
- } else return {
1469
- source: null,
1470
- dataValue: "",
1471
- ...m,
1472
- featAttr: {
1473
- location: d.value,
1474
- debugValue: "",
1475
- description: ""
1476
- }
1477
- };
1478
- }, p = (e, a = 1) => {
1479
- let o = n("name"), d = n("type"), f = {
1480
- debugValue: "",
1481
- description: "",
1482
- uiid: r(),
1483
- disabled: !1
1484
- }, p = s.value ? {
1485
- required: !!u.value,
1486
- extendName: "",
1487
- extendWidgetType: "",
1488
- extendDisplay: !0,
1489
- defaultValue: ""
1490
- } : {};
1491
- s.value && c.value && (p.deep = a);
1492
- let m = (e) => {
1493
- switch (e) {
1494
- case "arrayString": return "string";
1495
- case "arrayInteger": return "integer";
1496
- case "arrayNumber": return "number";
1497
- case "arrayBoolean": return "boolean";
1498
- case "arrayImage": return "image";
1499
- case "arrayFile": return "file";
1500
- case "arrayObject": return "object";
1501
- default: return i.justString, "string";
1502
- }
1503
- };
1504
- if (e === "object") return {
1505
- ...f,
1506
- ...p,
1507
- [o]: "",
1508
- [d]: (l.value, "string")
1509
- };
1510
- if (e === "arrayObject") return c.value ? {
1511
- ...f,
1512
- ...p,
1513
- [o]: "",
1514
- [d]: "string",
1515
- hasChildren: !1
1516
- } : {
1517
- ...f,
1518
- ...p,
1519
- [o]: "[Array Item]",
1520
- [d]: "object",
1521
- hasChildren: !1
1522
- };
1523
- {
1524
- let n = m(e);
1525
- return {
1526
- ...f,
1527
- ...p,
1528
- [o]: "[Array Item]",
1529
- [d]: n,
1530
- hasChildren: !1
1531
- };
1532
- }
1533
- }, m = (e) => Q(e, {
1534
- nameField: n("name"),
1535
- typeField: n("type"),
1536
- valueField: n("value")
1537
- }), h = (e) => {
1538
- let r = n("type"), i = n("value");
1539
- e.forEach((e) => {
1540
- if (e.children && e.children.length > 0) {
1541
- h(e.children);
1542
- let n = e[r];
1543
- if (Z(n) || n === "object") {
1544
- let n = m(e);
1545
- n !== void 0 && (e[i] = n);
1546
- }
1547
- }
1548
- });
1549
- };
1550
- return {
1551
- createEmptyInputParam: f,
1552
- createArrayItem: p,
1553
- convertChildrenToDebugValue: m,
1554
- updateParentDebugValues: h,
1555
- debuggerChangeValue: (e, n) => {
1556
- h(e.value), n("debugger-data-change");
1557
- },
1558
- changeType: (e, r, i, a, o) => {
1559
- let s = n("type"), c = n("value"), l = e[s];
1560
- r(l, e.uiid, s), e.children && Array.isArray(e.children) && e.children.length > 0 && i(e.children);
1561
- let u = Y.find((e) => e.value === l);
1562
- e[c] = u ? u.example : "", e.children && delete e.children, a(), o();
1563
- },
1564
- isArrayType: Z
1565
- };
1566
- }
1567
- //#endregion
1568
- //#region components/ParameterTable/composables/usePluginModeFeatures.js
1569
- function He(e, n, i) {
1570
- let { t: a } = r(), { getFieldName: o, tableData: s } = e, c = (e) => {
1571
- e.required && (e.extendDisplay = !0), n(), i();
1572
- }, l = (e, r) => {
1573
- let a = o("type");
1574
- r["extend-widget-item"] && delete r["extend-widget-item"], (e === "checkbox" || e === "radio-button") && (r[a] = "string", r.children && delete r.children), n(), i();
1575
- }, u = (e, n, r, i) => {
1576
- for (let a of e) {
1577
- if (a.uiid === n) return a[r] = i, !0;
1578
- if (a.children && a.children.length > 0 && u(a.children, n, r, i)) return !0;
1579
- }
1580
- return !1;
1581
- };
1582
- return {
1583
- handleRequiredChange: c,
1584
- handleFormatChange: l,
1585
- handleOptionCreated: (e) => {
1586
- u(s.value, e.uiid, "extend-widget-item", e.data), n(), i();
1587
- },
1588
- parseWidgetItems: (e) => {
1589
- if (!e) return [];
1590
- if (Array.isArray(e)) return e;
1591
- try {
1592
- return typeof e == "string" ? JSON.parse(e) : [];
1593
- } catch {
1594
- return [];
1595
- }
1596
- },
1597
- clearFiles: (e) => {
1598
- let r = o("value");
1599
- e[r] = "", n();
1600
- },
1601
- uploadSuccess: (e, r, i) => {
1602
- ne.success(a("COMMON_PARAMETERTABLE.LABEL_UPLOAD_SUCCESS")), r[i] = e, n();
1603
- }
1604
- };
1605
- }
1606
- //#endregion
1607
- //#region components/ParameterTable/ParameterTable.vue
1608
- var Ue = {
1609
- key: 0,
1610
- style: {
1611
- color: "red",
1612
- "margin-right": "2px"
1613
- }
1614
- }, We = {
1615
- key: 0,
1616
- style: {
1617
- color: "red",
1618
- "margin-right": "2px"
1619
- }
1620
- }, Ge = {
1621
- key: 0,
1622
- style: {
1623
- color: "red",
1624
- "margin-right": "2px"
1625
- }
1626
- }, Ke = { class: "table-header" }, qe = { class: "header-text" }, Je = { class: "tool-tip-column" }, Ye = { class: "table-header" }, Xe = { class: "header-text" }, Ze = { class: "tool-tip-column" }, Qe = { class: "table-header" }, $e = { class: "header-text" }, et = { class: "tool-tip-column" }, tt = { class: "action-header" }, nt = {
1627
- key: 0,
1628
- class: "error-message"
1629
- }, rt = { class: "table-form__isshow" }, it = { class: "table-form__isshow" }, at = e(/* @__PURE__ */ i({
1630
- __name: "ParameterTable",
1631
- props: /* @__PURE__ */ C({
1632
- justString: {
1633
- type: Boolean,
1634
- default: !1
1635
- },
1636
- loadingTable: {
1637
- type: Boolean,
1638
- default: !1
1639
- },
1640
- maxHeight: {
1641
- type: Number,
1642
- default: 300
1643
- },
1644
- location: {
1645
- type: String,
1646
- default: "params"
1647
- },
1648
- setType: {
1649
- type: Array,
1650
- default: () => []
1651
- },
1652
- isDataType: {
1653
- type: Boolean,
1654
- default: !1
1655
- },
1656
- inputItemNamesArr: {
1657
- type: Array,
1658
- default: () => []
1659
- },
1660
- disabled: {
1661
- type: Boolean,
1662
- default: !1
1663
- },
1664
- isPluginMode: {
1665
- type: Boolean,
1666
- default: !1
1667
- },
1668
- showMoreColumns: {
1669
- type: Boolean,
1670
- default: !1
1671
- },
1672
- forceRequired: {
1673
- type: Boolean,
1674
- default: !1
1675
- },
1676
- disabledFields: {
1677
- type: Array,
1678
- default: () => []
1679
- },
1680
- customFieldName: {
1681
- type: Object,
1682
- default: null
1683
- },
1684
- getSnowFlakeId: {
1685
- type: Function,
1686
- default: () => () => Date.now()
1687
- }
1688
- }, {
1689
- tableData: { default: () => [] },
1690
- tableDataModifiers: {}
1691
- }),
1692
- emits: /* @__PURE__ */ C([
1693
- "debugger-data-change",
1694
- "show-option",
1695
- "scroll-to-bottom",
1696
- "data-name-validate",
1697
- "name-or-type-change-value"
1698
- ], ["update:tableData"]),
1699
- setup(e, { expose: n, emit: i }) {
1700
- let a = e, o = P(e, "tableData"), s = i, { t: c } = r(), l = m(() => a.setType && a.setType.length ? Y.filter((e) => a.setType.includes(e.value)) : Y), u = m(() => a.setType && a.setType.length === 1), d = k(null), p = k({}), S = k({}), C = pe({
1701
- props: a,
1702
- tableData: o,
1703
- emit: s,
1704
- getSnowFlakeId: a.getSnowFlakeId,
1705
- typeList: l,
1706
- isSingleType: u,
1707
- validationErrors: p,
1708
- focusFields: S,
1709
- tableRef: d
1710
- }), { canAddRow: E, canDeleteRow: O, isFieldDisabled: A, getFieldName: j } = C, { columns: te } = Re(a), { createEmptyInputParam: ne, createArrayItem: B, isArrayType: V } = Ve(C), { validateDataName: H, validateDataType: re, validateDescription: G, validateAllDataTypes: K, validateAllRows: ie, handleFocus: oe, findParentNode: se } = ze(C, te), q = () => {
1711
- s("name-or-type-change-value");
1712
- }, { total: ce, addNewRow: le, deleteLists: ue, addLists: de, moveArrayItem: fe, canMoveUp: J, canMoveDown: me, showDeleteButton: X, triggerTableUpdate: ge } = Be(C, ne, B, se, H, q), { handleRequiredChange: _e, handleFormatChange: ve, handleOptionCreated: Z } = He(C, ge, q), Q = m(() => E() || O() ? te.value : te.value.filter((e) => e.slot !== "action")), ye = (e) => e.uiid, be = (e) => {
1713
- let n = se(o.value, e.uiid);
1714
- return n && n.children ? n.children.findIndex((n) => n.uiid === e.uiid) + 1 : 1;
1715
- }, $ = (e) => Q.value && Q.value.find((n) => n.slot === e)?.required || !1, xe = (e) => {
1716
- G(e, !!e[j("name")] || $("description"));
1717
- }, Se = (e, n) => {
1718
- let r = e.uiid;
1719
- S.value[r] && (S.value[r][n] = !1);
1720
- let i = e[n];
1721
- H(i, r, n), s("data-name-validate"), q();
1722
- }, we = (e) => {
1723
- let n = j("type"), r = j("value"), i = e[n];
1724
- re(i, e.uiid, n), e.children && Array.isArray(e.children) && e.children.length > 0 && K(e.children);
1725
- let a = Y.find((e) => e.value === i);
1726
- e[r] = a ? a.example : "", e.children && delete e.children, e.hasChildren = !1, ge(), q();
1727
- }, Te = (e) => {
1728
- Array.isArray(e) && e.forEach((e) => {
1729
- let n = j("name"), r = e[j("type")], i = e[n], a = e.children && e.children.length > 0;
1730
- i === "[Array Item]" ? (r === "object" || r === "arrayObject") && a ? (e.hasChildren = !0, Te(e.children)) : e.hasChildren = !1 : (V(r) || r === "object") && a ? (e.hasChildren = !0, Te(e.children)) : e.hasChildren = !1;
1731
- });
1732
- };
1733
- return F(() => o.value, (e) => {
1734
- ce.value = e.length, K(e), Te(e);
1735
- }, {
1736
- immediate: !0,
1737
- deep: !0
1738
- }), F(() => a.justString, (e) => {
1739
- if (e) {
1740
- let e = j("type"), n = (r) => {
1741
- r.forEach((r) => {
1742
- r[e] = "string", r.children && n(r.children);
1743
- });
1744
- };
1745
- n(o.value);
1746
- }
1747
- }, { immediate: !0 }), F(() => a.setType, (e) => {
1748
- if (e && e.length === 1) {
1749
- let e = l.value[0];
1750
- if (e) {
1751
- let n = j("name"), r = j("type"), i = (a) => {
1752
- a.forEach((a) => {
1753
- a[n] !== "[Array Item]" && (a[r] = e.value), a.children && i(a.children);
1754
- });
1755
- };
1756
- i(o.value);
1757
- }
1758
- }
1759
- }, { immediate: !0 }), F(() => a.inputItemNamesArr, () => {
1760
- Object.keys(p.value).length > 0 && w(() => {
1761
- ie();
1762
- });
1763
- }, { deep: !0 }), n({
1764
- validationErrors: p,
1765
- validateAllRows: ie
1766
- }), (n, r) => (D(), h(N(f), {
1767
- ref_key: "tableRef",
1768
- ref: d,
1769
- columns: Q.value,
1770
- data: o.value,
1771
- onRowKey: ye,
1772
- hasPage: !1,
1773
- total: N(ce),
1774
- "on-row-key": (e) => e.uiid,
1775
- pages: {
1776
- page: 1,
1777
- size: 999
1778
- },
1779
- isLoading: e.loadingTable,
1780
- "max-height": e.maxHeight,
1781
- isSecondaryHeader: ""
1782
- }, y({
1783
- keyHeader: I(() => [$("name") ? (D(), _("span", Ue, "*")) : g("", !0), b(M(N(c)("COMMON_PLUGIN_TOOL.LABEL_PARAM_NAME")), 1)]),
1784
- typeHeader: I(() => [$("type") ? (D(), _("span", We, "*")) : g("", !0), b(M(N(c)("COMMON_PLUGIN_TOOL.LABEL_PARAM_TYPE")), 1)]),
1785
- descHeader: I(() => [$("description") ? (D(), _("span", Ge, "*")) : g("", !0), b(M(N(c)("COMMON_PLUGIN_TOOL.LABEL_PARAM_DESC")), 1)]),
1786
- showNameHeader: I(() => [v("div", Ke, [v("div", qe, M(N(c)("COMMON_PLUGIN_TOOL.LABEL_PARAM_SHOW_NAME")), 1), x(N(U), { placement: "top" }, {
1787
- content: I(() => [b(M(N(c)("COMMON_PLUGIN_TOOL.LABEL_PARAM_SHOW_NAME_TIP")), 1)]),
1788
- default: I(() => [v("span", Je, [x(N(R), {
1789
- class: "tool-tip-column__icon",
1790
- size: "14px",
1791
- color: "#999"
1792
- }, {
1793
- default: I(() => [x(N(ae))]),
1794
- _: 1
1795
- })])]),
1796
- _: 1
1797
- })])]),
1798
- formatHeader: I(() => [v("div", Ye, [v("div", Xe, M(N(c)("COMMON_PLUGIN_TOOL.LABEL_PARAM_FORMAT")), 1), x(N(U), { placement: "top" }, {
1799
- content: I(() => [b(M(N(c)("COMMON_PLUGIN_TOOL.LABEL_PARAM_FORMAT_TIP")), 1)]),
1800
- default: I(() => [v("div", Ze, [x(N(R), {
1801
- class: "tool-tip-column__icon",
1802
- size: "14px",
1803
- color: "#999"
1804
- }, {
1805
- default: I(() => [x(N(ae))]),
1806
- _: 1
1807
- })])]),
1808
- _: 1
1809
- })])]),
1810
- isShowHeader: I(() => [v("div", Qe, [v("div", $e, M(N(c)("COMMON_PLUGIN_TOOL.LABEL_PARAM_VISIBLE")), 1), x(N(U), {
1811
- placement: "top",
1812
- "popper-style": { width: "350px" }
1813
- }, {
1814
- content: I(() => [
1815
- b(M(N(c)("COMMON_PLUGIN_TOOL.LABEL_PARAM_VISIBLE_TIP")), 1),
1816
- r[2] ||= v("br", null, null, -1),
1817
- b("- " + M(N(c)("COMMON_PLUGIN_TOOL.LABEL_PARAM_VISIBLE_INVISIBLE")), 1),
1818
- r[3] ||= v("br", null, null, -1),
1819
- b("- " + M(N(c)("COMMON_PLUGIN_TOOL.LABEL_PARAM_VISIBLE_INVISIBLE_DEFAULT")), 1)
1820
- ]),
1821
- default: I(() => [v("div", et, [x(N(R), {
1822
- class: "tool-tip-column__icon",
1823
- size: "14px",
1824
- color: "#999"
1825
- }, {
1826
- default: I(() => [x(N(ae))]),
1827
- _: 1
1828
- })])]),
1829
- _: 1
1830
- })])]),
1831
- actionHeader: I(() => [v("div", tt, [v("span", null, M(N(c)("COMMON_BUTTON.OPERATION_TEXT")), 1), N(E)() ? (D(), h(N(L), {
1832
- key: 0,
1833
- type: "primary",
1834
- size: "small",
1835
- onClick: N(le),
1836
- icon: N(W)
1837
- }, {
1838
- default: I(() => [b(M(N(c)("COMMON_BUTTON.ADD_NEW_TEXT")), 1)]),
1839
- _: 1
1840
- }, 8, ["onClick", "icon"])) : g("", !0)])]),
1841
- name: I((e) => [x(De, {
1842
- name: e.row[N(j)("name")],
1843
- "onUpdate:name": (n) => e.row[N(j)("name")] = n,
1844
- row: e.row,
1845
- "array-item-index": be(e.row),
1846
- onFocus: N(oe),
1847
- onBlur: Se
1848
- }, null, 8, [
1849
- "name",
1850
- "onUpdate:name",
1851
- "row",
1852
- "array-item-index",
1853
- "onFocus"
1854
- ])]),
1855
- type: I((e) => [x(je, {
1856
- type: e.row[N(j)("type")],
1857
- "onUpdate:type": (n) => e.row[N(j)("type")] = n,
1858
- row: e.row,
1859
- onChange: we
1860
- }, null, 8, [
1861
- "type",
1862
- "onUpdate:type",
1863
- "row"
1864
- ])]),
1865
- description: I((e) => [x(N(z), {
1866
- modelValue: e.row.description,
1867
- "onUpdate:modelValue": (n) => e.row.description = n,
1868
- disabled: a.disabled || e.row.disabled || N(A)("description"),
1869
- style: { width: "100%" },
1870
- placeholder: N(c)("COMMON_PLUGIN_TOOL.LABEL_PARAM_DESC_PLACEHOLDER"),
1871
- class: T({ "error-input": p.value[e.row.uiid]?.description }),
1872
- onChange: (n) => N(G)(e.row, $("description")),
1873
- onBlur: (n) => xe(e.row)
1874
- }, null, 8, [
1875
- "modelValue",
1876
- "onUpdate:modelValue",
1877
- "disabled",
1878
- "placeholder",
1879
- "class",
1880
- "onChange",
1881
- "onBlur"
1882
- ]), p.value[e.row.uiid]?.description ? (D(), _("div", nt, M(p.value[e.row.uiid]?.description), 1)) : g("", !0)]),
1883
- test: I((e) => [x(Ce, {
1884
- value: e.row[N(j)("value")],
1885
- "onUpdate:value": (n) => e.row[N(j)("value")] = n,
1886
- type: e.row[N(j)("type")],
1887
- "onUpdate:type": (n) => e.row[N(j)("type")] = n,
1888
- row: e.row
1889
- }, null, 8, [
1890
- "value",
1891
- "onUpdate:value",
1892
- "type",
1893
- "onUpdate:type",
1894
- "row"
1895
- ])]),
1896
- action: I((e) => [x(Ne, {
1897
- row: e.row,
1898
- scope: {
1899
- ...e,
1900
- _canMoveUp: N(J)(e.row),
1901
- _canMoveDown: N(me)(e.row),
1902
- _showDelete: N(X)(e.row)
1903
- },
1904
- onAddChild: N(de),
1905
- onMoveUp: r[0] ||= (e, n) => N(fe)(e, n),
1906
- onMoveDown: r[1] ||= (e, n) => N(fe)(e, n),
1907
- onDelete: N(ue)
1908
- }, null, 8, [
1909
- "row",
1910
- "scope",
1911
- "onAddChild",
1912
- "onDelete"
1913
- ])]),
1914
- _: 2
1915
- }, [
1916
- a.isPluginMode ? {
1917
- name: "required",
1918
- fn: I((e) => [v("div", rt, [x(N(ee), {
1919
- modelValue: e.row.required,
1920
- "onUpdate:modelValue": (n) => e.row.required = n,
1921
- disabled: a.disabled || e.row.disabled || a.forceRequired || N(A)("required"),
1922
- label: "",
1923
- onChange: (n) => N(_e)(e.row)
1924
- }, null, 8, [
1925
- "modelValue",
1926
- "onUpdate:modelValue",
1927
- "disabled",
1928
- "onChange"
1929
- ])])]),
1930
- key: "0"
1931
- } : void 0,
1932
- a.isPluginMode ? {
1933
- name: "showName",
1934
- fn: I((e) => [x(N(z), {
1935
- modelValue: e.row.extendName,
1936
- "onUpdate:modelValue": (n) => e.row.extendName = n,
1937
- disabled: a.disabled || e.row.disabled || N(A)("extendName"),
1938
- style: { width: "100%" },
1939
- placeholder: N(c)("COMMON_PLUGIN_TOOL.LABEL_PARAM_SHOW_NAME_PLACEHOLDER")
1940
- }, null, 8, [
1941
- "modelValue",
1942
- "onUpdate:modelValue",
1943
- "disabled",
1944
- "placeholder"
1945
- ])]),
1946
- key: "1"
1947
- } : void 0,
1948
- a.isPluginMode ? {
1949
- name: "format",
1950
- fn: I((e) => [x(he, {
1951
- modelValue: e.row.extendWidgetType,
1952
- "onUpdate:modelValue": (n) => e.row.extendWidgetType = n,
1953
- disabled: a.disabled || e.row.disabled || N(A)("extendWidgetType"),
1954
- "row-data": e.row,
1955
- onChange: N(ve),
1956
- onOptionCreated: N(Z)
1957
- }, null, 8, [
1958
- "modelValue",
1959
- "onUpdate:modelValue",
1960
- "disabled",
1961
- "row-data",
1962
- "onChange",
1963
- "onOptionCreated"
1964
- ])]),
1965
- key: "2"
1966
- } : void 0,
1967
- a.isPluginMode ? {
1968
- name: "default",
1969
- fn: I((e) => [x(N(z), {
1970
- modelValue: e.row.defaultValue,
1971
- "onUpdate:modelValue": (n) => e.row.defaultValue = n,
1972
- disabled: a.disabled || e.row.disabled || N(A)("defaultValue"),
1973
- style: { width: "100%" },
1974
- placeholder: N(c)("COMMON_PLUGIN_TOOL.LABEL_PARAM_DEFAULT_VALUE_PLACEHOLDER")
1975
- }, null, 8, [
1976
- "modelValue",
1977
- "onUpdate:modelValue",
1978
- "disabled",
1979
- "placeholder"
1980
- ])]),
1981
- key: "3"
1982
- } : void 0,
1983
- a.isPluginMode ? {
1984
- name: "isShow",
1985
- fn: I((e) => [v("div", it, [x(N(ee), {
1986
- modelValue: e.row.extendDisplay,
1987
- "onUpdate:modelValue": (n) => e.row.extendDisplay = n,
1988
- disabled: a.disabled || e.row.disabled || e.row.required || N(A)("extendDisplay"),
1989
- checked: e.row.required,
1990
- label: ""
1991
- }, null, 8, [
1992
- "modelValue",
1993
- "onUpdate:modelValue",
1994
- "disabled",
1995
- "checked"
1996
- ])])]),
1997
- key: "4"
1998
- } : void 0
1999
- ]), 1032, [
2000
- "columns",
2001
- "data",
2002
- "total",
2003
- "on-row-key",
2004
- "isLoading",
2005
- "max-height"
2006
- ]));
2007
- }
2008
- }, [["__scopeId", "data-v-f39799d3"]]));
2009
- //#endregion
2010
- export { ve as a, Y as c, ge as i, Q as n, _e as o, Z as r, X as s, at as t };