@kp-ui/lowcode 2.14.0-beta.12 → 2.14.0-beta.13

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.
@@ -1,19 +1,19 @@
1
- import { defineComponent as J, ref as U, computed as K, resolveComponent as _, createElementBlock as W, openBlock as h, Fragment as Q, createVNode as g, unref as o, withCtx as r, createTextVNode as v, toDisplayString as C, createElementVNode as N, createBlock as m, createCommentVNode as f, normalizeClass as X } from "vue";
2
- import { useI18n as Y } from "../../../../../utils/i18n.js";
3
- import Z from "../../../../code-editor/code-modal-editor.vue.js";
1
+ import { defineComponent as X, ref as z, computed as Y, resolveComponent as _, createElementBlock as N, openBlock as c, Fragment as Z, createVNode as m, unref as u, withCtx as r, createTextVNode as v, toDisplayString as C, createElementVNode as B, createBlock as p, createCommentVNode as g, normalizeClass as ee, nextTick as te } from "vue";
2
+ import { useI18n as le } from "../../../../../utils/i18n.js";
3
+ import ne from "../../../../code-editor/code-modal-editor.vue.js";
4
4
  import { cloneDeep as E } from "lodash-es";
5
- import { TpfModal as ee } from "tmgc2-share";
6
- import { message as te } from "ant-design-vue";
7
- const le = {
5
+ import { TpfModal as ie } from "tmgc2-share";
6
+ import { message as M } from "ant-design-vue";
7
+ const ae = {
8
8
  class: "table-wrap"
9
- }, ie = {
9
+ }, de = {
10
10
  key: 2,
11
11
  style: {
12
12
  "text-align": "center"
13
13
  }
14
- }, ne = {
14
+ }, se = {
15
15
  class: "add-btn"
16
- }, ce = /* @__PURE__ */ J({
16
+ }, fe = /* @__PURE__ */ X({
17
17
  name: "tableColumns-editor",
18
18
  inheritAttrs: !1,
19
19
  __name: "data-table-tableColumns-editor",
@@ -22,12 +22,12 @@ const le = {
22
22
  selectedWidget: {},
23
23
  optionModel: {}
24
24
  },
25
- setup(M, {
26
- expose: $
25
+ setup($, {
26
+ expose: V
27
27
  }) {
28
28
  const {
29
- i18nt: l
30
- } = Y(), I = M, A = U(null), y = U(!1), u = U([]), R = U(null), B = [{
29
+ i18nt: t
30
+ } = le(), I = $, A = z(null), w = z(!1), s = z([]), R = z(null), T = z(!0), O = [{
31
31
  value: "left",
32
32
  label: "left"
33
33
  }, {
@@ -36,194 +36,200 @@ const le = {
36
36
  }, {
37
37
  value: "right",
38
38
  label: "right"
39
- }], V = K(() => [{
39
+ }], L = Y(() => [{
40
40
  title: "序号",
41
41
  dataIndex: "index",
42
- width: 120,
42
+ width: 150,
43
43
  fixed: "left",
44
44
  rowDrag: !0,
45
45
  resizable: !0,
46
- // customRender: ({ index }: { index: number }) => index + 1
47
46
  customRender: ({
48
- record: n,
49
- index: t
47
+ record: i,
48
+ index: l
50
49
  }) => {
51
- const e = (p, c, b = []) => {
52
- for (let k = 0; k < c.length; k++) {
53
- const w = c[k];
54
- if (w.columnId === p.columnId)
50
+ const e = (f, h, b = []) => {
51
+ for (let k = 0; k < h.length; k++) {
52
+ const y = h[k];
53
+ if (y.columnId === f.columnId)
55
54
  return [...b, k + 1].join(".");
56
- if (w.children) {
57
- const z = e(p, w.children, [...b, k + 1]);
58
- if (z) return z;
55
+ if (y.children) {
56
+ const U = e(f, y.children, [...b, k + 1]);
57
+ if (U) return U;
59
58
  }
60
59
  }
61
60
  return "";
62
61
  };
63
- return e(n, u.value);
62
+ return e(i, s.value);
64
63
  }
65
64
  }, {
66
- title: l("designer.setting.columnName"),
65
+ title: t("designer.setting.columnName"),
67
66
  dataIndex: "dataIndex",
68
67
  resizable: !0,
69
68
  width: 150
70
69
  }, {
71
- title: l("designer.setting.columnLabel"),
70
+ title: t("designer.setting.columnLabel"),
72
71
  dataIndex: "title",
73
72
  align: "center",
74
73
  resizable: !0,
75
74
  width: 100
76
75
  }, {
77
- title: l("designer.setting.columnWidth"),
76
+ title: t("designer.setting.columnWidth"),
78
77
  dataIndex: "width",
79
78
  resizable: !0,
80
79
  width: 120
81
80
  }, {
82
- title: l("designer.setting.visibleColumn"),
81
+ title: t("designer.setting.visibleColumn"),
83
82
  dataIndex: "show",
84
83
  resizable: !0,
85
84
  width: 90
86
85
  }, {
87
- title: l("designer.setting.sortableColumn"),
86
+ title: t("designer.setting.sortableColumn"),
88
87
  dataIndex: "sorter",
89
88
  resizable: !0,
90
89
  width: 90
91
90
  }, {
92
- title: l("designer.setting.resizableColumn"),
91
+ title: t("designer.setting.resizableColumn"),
93
92
  dataIndex: "resizable",
94
93
  resizable: !0,
95
94
  width: 120
96
95
  }, {
97
- title: l("designer.setting.ellipsisColumn"),
96
+ title: t("designer.setting.ellipsisColumn"),
98
97
  dataIndex: "ellipsis",
99
98
  resizable: !0,
100
99
  width: 150
101
100
  }, {
102
- title: l("designer.setting.fixedColumn"),
101
+ title: t("designer.setting.fixedColumn"),
103
102
  dataIndex: "fixed",
104
103
  resizable: !0,
105
104
  width: 100
106
105
  }, {
107
- title: l("designer.setting.alignTypeOfColumn"),
106
+ title: t("designer.setting.alignTypeOfColumn"),
108
107
  dataIndex: "align",
109
108
  resizable: !0,
110
109
  width: 100
111
110
  }, {
112
- title: l("designer.setting.customRender"),
111
+ title: t("designer.setting.customRender"),
113
112
  dataIndex: "customRender",
114
113
  width: 120,
115
114
  resizable: !0,
116
115
  fixed: "right"
117
116
  }, {
118
- title: l("designer.setting.actionColumn"),
117
+ title: t("designer.setting.actionColumn"),
119
118
  dataIndex: "action",
120
119
  width: 160,
121
120
  fixed: "right"
122
- }]), O = (n, t) => {
121
+ }]), F = (i, l) => {
123
122
  var e;
124
- R.value = n, (e = A.value) == null || e.open(t.customRender || "");
125
- }, F = (n) => {
126
- R.value !== null && (u.value[R.value].customRender = n);
127
- }, H = () => {
128
- const n = {
129
- isAutoWidth: !1,
130
- columnId: (/* @__PURE__ */ new Date()).getTime(),
131
- show: !0,
132
- width: 150,
133
- sorter: !1,
134
- customRender: "",
135
- fixed: "",
136
- align: "left",
137
- title: "标题名",
138
- dataIndex: "",
139
- resizable: !0,
140
- showSorterTooltip: !1
123
+ R.value = i, (e = A.value) == null || e.open(l.customRender || "");
124
+ }, H = (i) => {
125
+ R.value !== null && (s.value[R.value].customRender = i);
126
+ }, P = {
127
+ isAutoWidth: !1,
128
+ columnId: "",
129
+ show: !0,
130
+ width: 150,
131
+ sorter: !1,
132
+ customRender: "",
133
+ fixed: "",
134
+ align: "left",
135
+ title: "标题名",
136
+ dataIndex: "",
137
+ resizable: !0,
138
+ showSorterTooltip: !1,
139
+ children: []
140
+ }, j = () => {
141
+ const i = {
142
+ ...P,
143
+ columnId: (/* @__PURE__ */ new Date()).getTime()
141
144
  };
142
- u.value.push(n), I.designer.emitHistoryChange();
143
- }, d = (n) => {
144
- let t = u.value;
145
- for (let e = 0; e < n.length; e++) {
146
- const p = n[e];
147
- if (Array.isArray(t))
148
- t = t[p];
145
+ s.value.push(i), I.designer.emitHistoryChange();
146
+ }, d = (i) => {
147
+ let l = s.value;
148
+ for (let e = 0; e < i.length; e++) {
149
+ const f = i[e];
150
+ if (Array.isArray(l))
151
+ l = l[f];
149
152
  else
150
- return t;
151
- e !== n.length - 1 && (t = t.children || []);
153
+ return l;
154
+ e !== i.length - 1 && (l = l.children || []);
152
155
  }
153
- return t;
154
- }, T = (n, t, e) => {
155
- for (let p = 0; p < n.length; p++) {
156
- const c = n[p];
157
- if (c.columnId === t.columnId) {
158
- c.children || (c.children = []), c.children.push(e);
156
+ return l;
157
+ }, D = (i, l, e) => {
158
+ for (let f = 0; f < i.length; f++) {
159
+ const h = i[f];
160
+ if (h.columnId === l.columnId) {
161
+ h.children || (h.children = []), h.children.push(e);
159
162
  return;
160
163
  }
161
- c.children && T(c.children, t, e);
164
+ h.children && D(h.children, l, e);
162
165
  }
163
- }, S = (n, t) => n.filter((e) => {
164
- if (e.columnId === t)
166
+ }, S = (i, l) => i.filter((e) => {
167
+ if (e.columnId === l)
165
168
  return !1;
166
169
  if (e.children && Array.isArray(e.children) && e.children.length > 0) {
167
- const p = S(e.children, t);
168
- e.children = p;
170
+ const f = S(e.children, l);
171
+ e.children = f;
169
172
  }
170
173
  return !0;
171
- }), L = (n, t) => {
172
- if (u.value.length === 1)
173
- return te.warning(l("designer.setting.onlyOneColumnCannotBeDeleted")), !1;
174
- u.value = S(u.value, n.columnId);
175
- }, P = (n, t) => {
174
+ }), q = (i, l) => {
175
+ if (s.value.length === 1 && !s.value[0].children)
176
+ return M.warning(t("designer.setting.onlyOneColumnCannotBeDeleted")), !1;
177
+ if (s.value.length === 1 && s.value[0].children.length === 0)
178
+ return M.warning(t("designer.setting.onlyOneColumnCannotBeDeleted")), !1;
179
+ s.value = S(s.value, i.columnId);
180
+ }, G = async (i, l) => {
176
181
  const e = {
177
- ...u.value[t],
178
- children: null,
182
+ ...s.value[l],
183
+ children: void 0,
179
184
  columnId: (/* @__PURE__ */ new Date()).getTime()
180
185
  };
181
- T(u.value, n, e);
182
- }, j = () => {
183
- I.optionModel.tableColumns = E(u.value), y.value = !1;
184
- }, D = () => {
185
- y.value = !0, u.value = E(I.optionModel.tableColumns);
186
+ T.value = !1, D(s.value, i, e), await te(), T.value = !0;
187
+ }, J = () => {
188
+ I.optionModel.tableColumns = E(s.value), w.value = !1;
189
+ }, W = () => {
190
+ w.value = !0, s.value = E(I.optionModel.tableColumns);
186
191
  };
187
- return $({
188
- openSetting: D
189
- }), (n, t) => {
190
- const e = _("a-button"), p = _("a-form-item"), c = _("a-input"), b = _("a-switch"), k = _("a-select-option"), w = _("a-select"), z = _("a-space"), q = _("s-table");
191
- return h(), W(Q, null, [g(p, {
192
- label: o(l)("designer.setting.tableColEdit")
192
+ return V({
193
+ openSetting: W
194
+ }), (i, l) => {
195
+ const e = _("a-button"), f = _("a-form-item"), h = _("a-input"), b = _("a-switch"), k = _("a-select-option"), y = _("a-select"), U = _("a-space"), K = _("s-table");
196
+ return c(), N(Z, null, [m(f, {
197
+ label: u(t)("designer.setting.tableColEdit")
193
198
  }, {
194
- default: r(() => [g(e, {
199
+ default: r(() => [m(e, {
195
200
  type: "primary",
196
201
  shape: "round",
197
- onClick: D
202
+ onClick: W
198
203
  }, {
199
- default: r(() => [v(C(o(l)("designer.setting.editAction")), 1)]),
204
+ default: r(() => [v(C(u(t)("designer.setting.editAction")), 1)]),
200
205
  _: 1
201
206
  })]),
202
207
  _: 1
203
- }, 8, ["label"]), g(o(ee), {
204
- title: o(l)("designer.setting.tableColEdit"),
205
- visible: y.value,
206
- "onUpdate:visible": t[2] || (t[2] = (s) => y.value = s),
208
+ }, 8, ["label"]), m(u(ie), {
209
+ title: u(t)("designer.setting.tableColEdit"),
210
+ visible: w.value,
211
+ "onUpdate:visible": l[2] || (l[2] = (o) => w.value = o),
207
212
  width: "1200px"
208
213
  }, {
209
- footerRight: r(() => [g(e, {
214
+ footerRight: r(() => [m(e, {
210
215
  size: "default",
211
- onClick: t[1] || (t[1] = (s) => y.value = !1)
216
+ onClick: l[1] || (l[1] = (o) => w.value = !1)
212
217
  }, {
213
- default: r(() => [v(C(o(l)("designer.hint.cancel")), 1)]),
218
+ default: r(() => [v(C(u(t)("designer.hint.cancel")), 1)]),
214
219
  _: 1
215
- }), g(e, {
220
+ }), m(e, {
216
221
  size: "default",
217
222
  type: "primary",
218
- onClick: j
223
+ onClick: J
219
224
  }, {
220
- default: r(() => [v(C(o(l)("designer.hint.confirm")), 1)]),
225
+ default: r(() => [v(C(u(t)("designer.hint.confirm")), 1)]),
221
226
  _: 1
222
227
  })]),
223
- default: r(() => [N("div", le, [g(q, {
228
+ default: r(() => [B("div", ae, [T.value ? (c(), p(K, {
229
+ key: 0,
224
230
  class: "tpf-surely-table",
225
231
  "aria-hidden": "false",
226
- dataSource: u.value,
232
+ dataSource: s.value,
227
233
  style: {
228
234
  width: "100%"
229
235
  },
@@ -240,130 +246,130 @@ const le = {
240
246
  },
241
247
  pagination: !1,
242
248
  resizable: "",
243
- "row-key": (s) => s.columnId,
244
- columns: V.value
249
+ "row-key": (o) => o.columnId,
250
+ columns: L.value
245
251
  }, {
246
252
  bodyCell: r(({
247
- column: s,
253
+ column: o,
248
254
  record: x,
249
- index: G,
255
+ index: Q,
250
256
  recordIndexs: a
251
- }) => [s.dataIndex === "dataIndex" ? (h(), m(c, {
257
+ }) => [o.dataIndex === "dataIndex" ? (c(), p(h, {
252
258
  key: 0,
253
259
  value: d(a).dataIndex,
254
- "onUpdate:value": (i) => d(a).dataIndex = i
255
- }, null, 8, ["value", "onUpdate:value"])) : f("", !0), s.dataIndex === "title" ? (h(), m(c, {
260
+ "onUpdate:value": (n) => d(a).dataIndex = n
261
+ }, null, 8, ["value", "onUpdate:value"])) : g("", !0), o.dataIndex === "title" ? (c(), p(h, {
256
262
  key: 1,
257
263
  value: d(a).title,
258
- "onUpdate:value": (i) => d(a).title = i
259
- }, null, 8, ["value", "onUpdate:value"])) : f("", !0), s.dataIndex === "width" ? (h(), W("div", ie, [g(b, {
260
- "checked-children": o(l)("designer.setting.autoWidth"),
261
- checked: u.value[a[0]].isAutoWidth,
262
- "onUpdate:checked": (i) => u.value[a[0]].isAutoWidth = i
263
- }, null, 8, ["checked-children", "checked", "onUpdate:checked"]), x.isAutoWidth ? f("", !0) : (h(), m(c, {
264
+ "onUpdate:value": (n) => d(a).title = n
265
+ }, null, 8, ["value", "onUpdate:value"])) : g("", !0), o.dataIndex === "width" ? (c(), N("div", de, [m(b, {
266
+ "checked-children": u(t)("designer.setting.autoWidth"),
267
+ checked: s.value[a[0]].isAutoWidth,
268
+ "onUpdate:checked": (n) => s.value[a[0]].isAutoWidth = n
269
+ }, null, 8, ["checked-children", "checked", "onUpdate:checked"]), x.isAutoWidth ? g("", !0) : (c(), p(h, {
264
270
  key: 0,
265
271
  value: d(a).width,
266
- "onUpdate:value": (i) => d(a).width = i
267
- }, null, 8, ["value", "onUpdate:value"]))])) : f("", !0), s.dataIndex === "show" ? (h(), m(b, {
272
+ "onUpdate:value": (n) => d(a).width = n
273
+ }, null, 8, ["value", "onUpdate:value"]))])) : g("", !0), o.dataIndex === "show" ? (c(), p(b, {
268
274
  key: 3,
269
275
  checked: d(a).show,
270
- "onUpdate:checked": (i) => d(a).show = i
271
- }, null, 8, ["checked", "onUpdate:checked"])) : f("", !0), s.dataIndex === "sorter" ? (h(), m(b, {
276
+ "onUpdate:checked": (n) => d(a).show = n
277
+ }, null, 8, ["checked", "onUpdate:checked"])) : g("", !0), o.dataIndex === "sorter" ? (c(), p(b, {
272
278
  key: 4,
273
279
  checked: d(a).sorter,
274
- "onUpdate:checked": (i) => d(a).sorter = i
275
- }, null, 8, ["checked", "onUpdate:checked"])) : f("", !0), s.dataIndex === "resizable" ? (h(), m(b, {
280
+ "onUpdate:checked": (n) => d(a).sorter = n
281
+ }, null, 8, ["checked", "onUpdate:checked"])) : g("", !0), o.dataIndex === "resizable" ? (c(), p(b, {
276
282
  key: 5,
277
283
  checked: d(a).resizable,
278
- "onUpdate:checked": (i) => d(a).resizable = i
279
- }, null, 8, ["checked", "onUpdate:checked"])) : f("", !0), s.dataIndex === "ellipsis" ? (h(), m(b, {
284
+ "onUpdate:checked": (n) => d(a).resizable = n
285
+ }, null, 8, ["checked", "onUpdate:checked"])) : g("", !0), o.dataIndex === "ellipsis" ? (c(), p(b, {
280
286
  key: 6,
281
287
  checked: d(a).ellipsis,
282
- "onUpdate:checked": (i) => d(a).ellipsis = i
283
- }, null, 8, ["checked", "onUpdate:checked"])) : f("", !0), s.dataIndex === "fixed" ? (h(), m(w, {
288
+ "onUpdate:checked": (n) => d(a).ellipsis = n
289
+ }, null, 8, ["checked", "onUpdate:checked"])) : g("", !0), o.dataIndex === "fixed" ? (c(), p(y, {
284
290
  key: 7,
285
291
  value: d(a).fixed,
286
- "onUpdate:value": (i) => d(a).fixed = i,
292
+ "onUpdate:value": (n) => d(a).fixed = n,
287
293
  allowClear: "",
288
294
  style: {
289
295
  width: "100%"
290
296
  }
291
297
  }, {
292
- default: r(() => [g(k, {
298
+ default: r(() => [m(k, {
293
299
  value: "left"
294
300
  }, {
295
- default: r(() => [v(C(o(l)("designer.setting.fixedLeft")), 1)]),
301
+ default: r(() => [v(C(u(t)("designer.setting.fixedLeft")), 1)]),
296
302
  _: 1
297
- }), g(k, {
303
+ }), m(k, {
298
304
  value: "right"
299
305
  }, {
300
- default: r(() => [v(C(o(l)("designer.setting.fixedRight")), 1)]),
306
+ default: r(() => [v(C(u(t)("designer.setting.fixedRight")), 1)]),
301
307
  _: 1
302
308
  })]),
303
309
  _: 2
304
- }, 1032, ["value", "onUpdate:value"])) : f("", !0), s.dataIndex === "align" ? (h(), m(w, {
310
+ }, 1032, ["value", "onUpdate:value"])) : g("", !0), o.dataIndex === "align" ? (c(), p(y, {
305
311
  key: 8,
306
312
  style: {
307
313
  width: "100%"
308
314
  },
309
315
  value: d(a).align,
310
- "onUpdate:value": (i) => d(a).align = i,
311
- options: B
312
- }, null, 8, ["value", "onUpdate:value"])) : f("", !0), s.dataIndex === "customRender" ? (h(), m(e, {
316
+ "onUpdate:value": (n) => d(a).align = n,
317
+ options: O
318
+ }, null, 8, ["value", "onUpdate:value"])) : g("", !0), o.dataIndex === "customRender" ? (c(), p(e, {
313
319
  key: 9,
314
- onClick: (i) => O(a[0], x),
315
- class: X([{
320
+ onClick: (n) => F(a[0], x),
321
+ class: ee([{
316
322
  "button-text-highlight": !!x.customRender
317
323
  }]),
318
324
  size: "small",
319
325
  shape: "round"
320
326
  }, {
321
- default: r(() => [v(C(o(l)("designer.setting.edit")), 1)]),
327
+ default: r(() => [v(C(u(t)("designer.setting.edit")), 1)]),
322
328
  _: 2
323
- }, 1032, ["onClick", "class"])) : f("", !0), s.dataIndex === "action" ? (h(), m(z, {
329
+ }, 1032, ["onClick", "class"])) : g("", !0), o.dataIndex === "action" ? (c(), p(U, {
324
330
  key: 10
325
331
  }, {
326
- default: r(() => [g(e, {
327
- title: o(l)("designer.setting.addSubsets"),
332
+ default: r(() => [m(e, {
333
+ title: u(t)("designer.setting.addSubsets"),
328
334
  size: "small",
329
- onClick: (i) => P(x, G),
335
+ onClick: (n) => G(x, Q),
330
336
  type: "text"
331
337
  }, {
332
- default: r(() => t[3] || (t[3] = [v(" 增加子集 ")])),
338
+ default: r(() => l[3] || (l[3] = [v(" 增加子集 ")])),
333
339
  _: 2,
334
340
  __: [3]
335
- }, 1032, ["title", "onClick"]), g(e, {
336
- title: o(l)("designer.setting.deleteTableColumn"),
341
+ }, 1032, ["title", "onClick"]), m(e, {
342
+ title: u(t)("designer.setting.deleteTableColumn"),
337
343
  size: "small",
338
- onClick: (i) => L(x),
344
+ onClick: (n) => q(x),
339
345
  type: "text"
340
346
  }, {
341
- default: r(() => [v(C(o(l)("designer.setting.delete")), 1)]),
347
+ default: r(() => [v(C(u(t)("designer.setting.delete")), 1)]),
342
348
  _: 2
343
349
  }, 1032, ["title", "onClick"])]),
344
350
  _: 2
345
- }, 1024)) : f("", !0)]),
351
+ }, 1024)) : g("", !0)]),
346
352
  _: 1
347
- }, 8, ["dataSource", "row-key", "columns"]), N("div", ne, [g(e, {
348
- title: o(l)("designer.setting.addTableColumn"),
353
+ }, 8, ["dataSource", "row-key", "columns"])) : g("", !0), B("div", se, [m(e, {
354
+ title: u(t)("designer.setting.addTableColumn"),
349
355
  type: "primary",
350
356
  size: "medium",
351
- onClick: t[0] || (t[0] = (s) => H())
357
+ onClick: l[0] || (l[0] = (o) => j())
352
358
  }, {
353
- default: r(() => [v(C(o(l)("designer.setting.addTableColumn")), 1)]),
359
+ default: r(() => [v(C(u(t)("designer.setting.addTableColumn")), 1)]),
354
360
  _: 1
355
361
  }, 8, ["title"])])])]),
356
362
  _: 1
357
- }, 8, ["title", "visible"]), g(Z, {
358
- onSave: F,
363
+ }, 8, ["title", "visible"]), m(ne, {
364
+ onSave: H,
359
365
  ref_key: "CodeModalEditorRef",
360
366
  ref: A,
361
- title: o(l)("designer.setting.renderFunction"),
367
+ title: u(t)("designer.setting.renderFunction"),
362
368
  "fn-params": "scope"
363
369
  }, null, 8, ["title"])], 64);
364
370
  };
365
371
  }
366
372
  });
367
373
  export {
368
- ce as default
374
+ fe as default
369
375
  };
@@ -1,9 +1,9 @@
1
- import d from "../../../../../utils/i18n.js";
2
- import { resolveComponent as n, createBlock as m, openBlock as l, withCtx as p, createVNode as c } from "vue";
3
- import f from "../../../../../../_virtual/_plugin-vue_export-helper.js";
4
- const u = {
1
+ import m from "../../../../../utils/i18n.js";
2
+ import { resolveComponent as n, createBlock as l, openBlock as p, withCtx as f, createVNode as c } from "vue";
3
+ import C from "../../../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const h = {
5
5
  name: "formCode-editor",
6
- mixins: [d],
6
+ mixins: [m],
7
7
  props: {
8
8
  designer: Object,
9
9
  selectedWidget: Object,
@@ -18,8 +18,11 @@ const u = {
18
18
  this.getOps();
19
19
  },
20
20
  methods: {
21
+ handleChangeFormCode(o) {
22
+ this.optionModel.formCode = o, this.optionModel.formId = this.ops.find((e) => e.formCode === o).formId;
23
+ },
21
24
  async getOps() {
22
- const t = {
25
+ const o = {
23
26
  pageCode: "FormDefinitionManagement",
24
27
  conditions: [],
25
28
  requiredFields: ["formCode", "terminalTypeName", "entityCode"],
@@ -27,28 +30,29 @@ const u = {
27
30
  pageSize: null,
28
31
  sorts: []
29
32
  };
30
- this.ops = await this.$http.post("/api/tmgc2-query/dataQuery/execute", t).then((e) => e.data.object.list || []).then((e) => e.map((o) => ({ formCode: o.formCode })));
33
+ this.ops = await this.$http.post("/api/tmgc2-query/dataQuery/execute", o).then((e) => e.data.object.list || []).then((e) => e.map((t) => ({ formCode: t.formCode })));
31
34
  }
32
35
  }
33
36
  };
34
- function C(t, e, o, _, r, g) {
35
- const i = n("a-select"), a = n("a-form-item");
36
- return l(), m(a, {
37
- label: t.i18nt("designer.setting.formCode")
37
+ function u(o, e, t, g, r, a) {
38
+ const d = n("a-select"), i = n("a-form-item");
39
+ return p(), l(i, {
40
+ label: o.i18nt("designer.setting.formCode")
38
41
  }, {
39
- default: p(() => [
40
- c(i, {
41
- value: o.optionModel.formCode,
42
- "onUpdate:value": e[0] || (e[0] = (s) => o.optionModel.formCode = s),
42
+ default: f(() => [
43
+ c(d, {
44
+ value: t.optionModel.formCode,
45
+ "onUpdate:value": e[0] || (e[0] = (s) => t.optionModel.formCode = s),
43
46
  allowClear: "",
44
47
  options: r.ops,
45
- fieldNames: { label: "formCode", value: "formCode" }
46
- }, null, 8, ["value", "options"])
48
+ fieldNames: { label: "formCode", value: "formCode" },
49
+ onChange: a.handleChangeFormCode
50
+ }, null, 8, ["value", "options", "onChange"])
47
51
  ]),
48
52
  _: 1
49
53
  }, 8, ["label"]);
50
54
  }
51
- const x = /* @__PURE__ */ f(u, [["render", C]]);
55
+ const v = /* @__PURE__ */ C(h, [["render", u]]);
52
56
  export {
53
- x as default
57
+ v as default
54
58
  };
@@ -0,0 +1,50 @@
1
+ import { defineComponent as d, createBlock as g, openBlock as m, unref as o, withCtx as p, createElementVNode as i, createVNode as u, createTextVNode as f, toDisplayString as h } from "vue";
2
+ import { SvgIcon as k } from "tmgc2-share";
3
+ import { useI18n as C } from "../../../utils/i18n.js";
4
+ import _ from "../../../lib/vuedraggable/src/vuedraggable.js";
5
+ const y = ["title", "onDblclick"], x = /* @__PURE__ */ d({
6
+ name: "PanelItemDrag",
7
+ __name: "PanelItemDrag",
8
+ props: {
9
+ designer: {},
10
+ items: {}
11
+ },
12
+ setup(s) {
13
+ const { i18n2t: l } = C(), n = s, r = (e) => n.designer.copyNewContainerWidget(e), a = (e) => n.designer.checkWidgetMove(e), c = (e) => {
14
+ n.designer.addWidget(e);
15
+ };
16
+ return (e, v) => (m(), g(o(_), {
17
+ tag: "ul",
18
+ list: e.items,
19
+ "item-key": "key",
20
+ group: { name: "dragGroup", pull: "clone", put: !1 },
21
+ clone: r,
22
+ "ghost-class": "ghost",
23
+ sort: !1,
24
+ move: a
25
+ }, {
26
+ item: p(({ element: t }) => [
27
+ i("li", {
28
+ class: "container-widget-item",
29
+ title: t.displayName,
30
+ onDblclick: (b) => c(t)
31
+ }, [
32
+ i("span", null, [
33
+ u(o(k), {
34
+ "icon-class": "icon-" + t.icon,
35
+ class: "color-svg-icon"
36
+ }, null, 8, ["icon-class"]),
37
+ f(" " + h(o(l)(
38
+ `designer.widgetLabel.${t.type}`,
39
+ `extension.widgetLabel.${t.type}`
40
+ )), 1)
41
+ ])
42
+ ], 40, y)
43
+ ]),
44
+ _: 1
45
+ }, 8, ["list"]));
46
+ }
47
+ });
48
+ export {
49
+ x as default
50
+ };