@kp-ui/lowcode 2.15.0-alpha.14 → 2.15.0-alpha.16
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.
- package/package.json +1 -1
- package/src/components/FormRender/index.vue.js +5 -79
- package/src/components/FormRender/index.vue2.js +85 -2
- package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue.js +3 -3
- package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue2.js +36 -30
- package/src/components/form-designer/form-widget/container-widget/useTableWidget.js +58 -54
- package/src/components/form-designer/form-widget/field-widget/hooks/useSelect.js +16 -16
- package/src/components/form-designer/form-widget/field-widget/useField.js +117 -108
- package/src/components/form-designer/index.vue.js +60 -62
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +3 -3
- package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +49 -47
- package/src/components/form-designer/toolbar-panel/PreviewDialog.vue.js +1 -1
- package/src/components/form-designer/widget-panel/advanced/data-table.js +7 -19
- package/src/components/form-render/container-items/data-table-widget.vue.js +1 -1
- package/src/components/form-render/container-items/data-table-widget.vue2.js +57 -49
- package/src/components/form-render/dynamic-dialog.vue.js +91 -94
- package/src/components/public/CustomerModal/CustomerModal.vue2.js +16 -16
- package/src/hooks/useDataHttp.js +15 -12
- package/src/lang/zh-CN.js +4 -3
- package/stats.html +1 -1
- package/styles/style.css +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as N, mergeModels as V, ref as b, useModel as W, createVNode as i, resolveComponent as n, computed as E, createElementBlock as B, openBlock as O, Fragment as j, unref as s, withCtx as r, createTextVNode as m, toDisplayString as p, createElementVNode as F, nextTick as k, isVNode as L } from "vue";
|
|
2
2
|
import { useI18n as $ } from "../../../../../utils/i18n.js";
|
|
3
3
|
import q from "../../../../code-editor/code-modal-editor.vue.js";
|
|
4
4
|
import { cloneDeep as K } from "lodash-es";
|
|
@@ -8,14 +8,14 @@ import { useDesigner as Q } from "../../../form-widget/useFormDesigner.js";
|
|
|
8
8
|
const X = {
|
|
9
9
|
class: "add-btn t-flex t-justify-center t-mt-[10px]"
|
|
10
10
|
};
|
|
11
|
-
function
|
|
11
|
+
function f(u) {
|
|
12
12
|
return typeof u == "function" || Object.prototype.toString.call(u) === "[object Object]" && !L(u);
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const oe = /* @__PURE__ */ N({
|
|
15
15
|
name: "tableColumns-editor",
|
|
16
16
|
inheritAttrs: !1,
|
|
17
17
|
__name: "data-table-tableColumns-editor",
|
|
18
|
-
props: /* @__PURE__ */
|
|
18
|
+
props: /* @__PURE__ */ V({
|
|
19
19
|
selectedWidget: {}
|
|
20
20
|
}, {
|
|
21
21
|
optionModel: {
|
|
@@ -27,12 +27,12 @@ const se = /* @__PURE__ */ V({
|
|
|
27
27
|
}),
|
|
28
28
|
emits: ["update:optionModel"],
|
|
29
29
|
setup(u, {
|
|
30
|
-
expose:
|
|
30
|
+
expose: _
|
|
31
31
|
}) {
|
|
32
32
|
Q();
|
|
33
33
|
const {
|
|
34
34
|
i18nt: l
|
|
35
|
-
} = $(), v = b(null), c = b(!1), h = b(), C =
|
|
35
|
+
} = $(), v = b(null), c = b(!1), h = b(), C = W(u, "optionModel"), y = [{
|
|
36
36
|
value: "left",
|
|
37
37
|
label: "left"
|
|
38
38
|
}, {
|
|
@@ -162,26 +162,28 @@ const se = /* @__PURE__ */ V({
|
|
|
162
162
|
}, {
|
|
163
163
|
field: "fixed",
|
|
164
164
|
title: l("designer.setting.fixedColumn"),
|
|
165
|
-
width:
|
|
165
|
+
width: 120,
|
|
166
166
|
slots: {
|
|
167
167
|
default({
|
|
168
168
|
row: e
|
|
169
169
|
}) {
|
|
170
|
-
let t,
|
|
171
|
-
return i(n("a-
|
|
170
|
+
let t, o, a;
|
|
171
|
+
return i(n("a-radio-group"), {
|
|
172
172
|
value: e.fixed,
|
|
173
|
-
"onUpdate:value": (d) => e.fixed = d
|
|
174
|
-
allowClear: !0,
|
|
175
|
-
style: "width: 100%"
|
|
173
|
+
"onUpdate:value": (d) => e.fixed = d
|
|
176
174
|
}, {
|
|
177
|
-
default: () => [i(n("a-
|
|
175
|
+
default: () => [i(n("a-radio-button"), {
|
|
178
176
|
value: "left"
|
|
179
|
-
},
|
|
177
|
+
}, f(t = l("designer.setting.fixedLeft")) ? t : {
|
|
180
178
|
default: () => [t]
|
|
181
|
-
}), i(n("a-
|
|
179
|
+
}), i(n("a-radio-button"), {
|
|
180
|
+
value: null
|
|
181
|
+
}, f(o = l("designer.setting.fixedNull")) ? o : {
|
|
182
|
+
default: () => [o]
|
|
183
|
+
}), i(n("a-radio-button"), {
|
|
182
184
|
value: "right"
|
|
183
|
-
},
|
|
184
|
-
default: () => [
|
|
185
|
+
}, f(a = l("designer.setting.fixedRight")) ? a : {
|
|
186
|
+
default: () => [a]
|
|
185
187
|
})]
|
|
186
188
|
});
|
|
187
189
|
}
|
|
@@ -197,7 +199,7 @@ const se = /* @__PURE__ */ V({
|
|
|
197
199
|
return i(n("a-select"), {
|
|
198
200
|
value: e.align,
|
|
199
201
|
"onUpdate:value": (t) => e.align = t,
|
|
200
|
-
options:
|
|
202
|
+
options: y,
|
|
201
203
|
style: "width: 100%"
|
|
202
204
|
}, null);
|
|
203
205
|
}
|
|
@@ -213,7 +215,7 @@ const se = /* @__PURE__ */ V({
|
|
|
213
215
|
row: e,
|
|
214
216
|
rowIndex: t
|
|
215
217
|
}) {
|
|
216
|
-
let
|
|
218
|
+
let o;
|
|
217
219
|
return i(n("a-button"), {
|
|
218
220
|
class: [{
|
|
219
221
|
"button-text-highlight": !!e.customRender
|
|
@@ -221,8 +223,8 @@ const se = /* @__PURE__ */ V({
|
|
|
221
223
|
onClick: () => M(e),
|
|
222
224
|
size: "small",
|
|
223
225
|
shape: "round"
|
|
224
|
-
},
|
|
225
|
-
default: () => [
|
|
226
|
+
}, f(o = l("designer.setting.edit")) ? o : {
|
|
227
|
+
default: () => [o]
|
|
226
228
|
});
|
|
227
229
|
}
|
|
228
230
|
}
|
|
@@ -241,12 +243,12 @@ const se = /* @__PURE__ */ V({
|
|
|
241
243
|
type: "link",
|
|
242
244
|
onClick: () => S(e),
|
|
243
245
|
size: "small"
|
|
244
|
-
},
|
|
246
|
+
}, f(t = l("designer.setting.delete")) ? t : {
|
|
245
247
|
default: () => [t]
|
|
246
248
|
});
|
|
247
249
|
}
|
|
248
250
|
}
|
|
249
|
-
}], T =
|
|
251
|
+
}], T = E(() => ({
|
|
250
252
|
columnConfig: {
|
|
251
253
|
resizable: !0
|
|
252
254
|
},
|
|
@@ -275,7 +277,7 @@ const se = /* @__PURE__ */ V({
|
|
|
275
277
|
}, U = (e) => {
|
|
276
278
|
h.value && (h.value.customRender = e);
|
|
277
279
|
}, D = async () => {
|
|
278
|
-
var t,
|
|
280
|
+
var t, o, a, d;
|
|
279
281
|
const e = {
|
|
280
282
|
isAutoWidth: !0,
|
|
281
283
|
columnId: (/* @__PURE__ */ new Date()).getTime(),
|
|
@@ -291,7 +293,7 @@ const se = /* @__PURE__ */ V({
|
|
|
291
293
|
ellipsis: !1,
|
|
292
294
|
showSorterTooltip: !1
|
|
293
295
|
};
|
|
294
|
-
await ((t = g.value) == null ? void 0 : t.insertAt(e, -1)), await k(), console.log((
|
|
296
|
+
await ((t = g.value) == null ? void 0 : t.insertAt(e, -1)), await k(), console.log((o = g.value) == null ? void 0 : o.getRowById(e.columnId)), (d = g.value) == null || d.scrollToRow((a = g.value) == null ? void 0 : a.getRowById(e.columnId));
|
|
295
297
|
}, S = (e) => {
|
|
296
298
|
var t;
|
|
297
299
|
if (w().length === 1)
|
|
@@ -304,52 +306,52 @@ const se = /* @__PURE__ */ V({
|
|
|
304
306
|
I(K(C.value.tableColumns));
|
|
305
307
|
}, 100);
|
|
306
308
|
};
|
|
307
|
-
return
|
|
309
|
+
return _({
|
|
308
310
|
openSetting: x
|
|
309
311
|
}), (e, t) => {
|
|
310
|
-
const
|
|
311
|
-
return O(), B(j, null, [i(
|
|
312
|
-
label:
|
|
312
|
+
const o = n("a-button"), a = n("a-form-item");
|
|
313
|
+
return O(), B(j, null, [i(a, {
|
|
314
|
+
label: s(l)("designer.setting.tableColEdit")
|
|
313
315
|
}, {
|
|
314
|
-
default:
|
|
316
|
+
default: r(() => [i(o, {
|
|
315
317
|
type: "primary",
|
|
316
318
|
shape: "round",
|
|
317
319
|
onClick: x
|
|
318
320
|
}, {
|
|
319
|
-
default:
|
|
321
|
+
default: r(() => [m(p(s(l)("designer.setting.editAction")), 1)]),
|
|
320
322
|
_: 1
|
|
321
323
|
})]),
|
|
322
324
|
_: 1
|
|
323
|
-
}, 8, ["label"]), i(
|
|
324
|
-
title:
|
|
325
|
+
}, 8, ["label"]), i(s(G), {
|
|
326
|
+
title: s(l)("designer.setting.tableColEdit"),
|
|
325
327
|
visible: c.value,
|
|
326
|
-
"onUpdate:visible": t[2] || (t[2] = (
|
|
328
|
+
"onUpdate:visible": t[2] || (t[2] = (d) => c.value = d),
|
|
327
329
|
width: "1280px",
|
|
328
330
|
height: "70vh"
|
|
329
331
|
}, {
|
|
330
|
-
footerRight:
|
|
332
|
+
footerRight: r(() => [i(o, {
|
|
331
333
|
size: "default",
|
|
332
|
-
onClick: t[1] || (t[1] = (
|
|
334
|
+
onClick: t[1] || (t[1] = (d) => c.value = !1)
|
|
333
335
|
}, {
|
|
334
|
-
default:
|
|
336
|
+
default: r(() => [m(p(s(l)("designer.hint.cancel")), 1)]),
|
|
335
337
|
_: 1
|
|
336
|
-
}), i(
|
|
338
|
+
}), i(o, {
|
|
337
339
|
size: "default",
|
|
338
340
|
type: "primary",
|
|
339
341
|
onClick: A
|
|
340
342
|
}, {
|
|
341
|
-
default:
|
|
343
|
+
default: r(() => [m(p(s(l)("designer.hint.confirm")), 1)]),
|
|
342
344
|
_: 1
|
|
343
345
|
})]),
|
|
344
|
-
default:
|
|
345
|
-
onRegister:
|
|
346
|
-
}, null, 8, ["onRegister"]), F("div", X, [i(
|
|
347
|
-
title:
|
|
346
|
+
default: r(() => [i(s(H), {
|
|
347
|
+
onRegister: s(z)
|
|
348
|
+
}, null, 8, ["onRegister"]), F("div", X, [i(o, {
|
|
349
|
+
title: s(l)("designer.setting.addTableColumn"),
|
|
348
350
|
type: "primary",
|
|
349
351
|
size: "medium",
|
|
350
|
-
onClick: t[0] || (t[0] = (
|
|
352
|
+
onClick: t[0] || (t[0] = (d) => D())
|
|
351
353
|
}, {
|
|
352
|
-
default:
|
|
354
|
+
default: r(() => [m(p(s(l)("designer.setting.addTableColumn")), 1)]),
|
|
353
355
|
_: 1
|
|
354
356
|
}, 8, ["title"])])]),
|
|
355
357
|
_: 1
|
|
@@ -357,12 +359,12 @@ const se = /* @__PURE__ */ V({
|
|
|
357
359
|
onSave: U,
|
|
358
360
|
ref_key: "CodeModalEditorRef",
|
|
359
361
|
ref: v,
|
|
360
|
-
title:
|
|
362
|
+
title: s(l)("designer.setting.renderFunction"),
|
|
361
363
|
"fn-params": "scope"
|
|
362
364
|
}, null, 8, ["title"])], 64);
|
|
363
365
|
};
|
|
364
366
|
}
|
|
365
367
|
});
|
|
366
368
|
export {
|
|
367
|
-
|
|
369
|
+
oe as default
|
|
368
370
|
};
|
|
@@ -16,7 +16,7 @@ const z = { class: "form-render-wrapper" }, te = /* @__PURE__ */ L({
|
|
|
16
16
|
}),
|
|
17
17
|
emits: ["update:visible"],
|
|
18
18
|
setup(b) {
|
|
19
|
-
const y = T(() => import("../../FormRender/index.
|
|
19
|
+
const y = T(() => import("../../FormRender/index.vue.js"));
|
|
20
20
|
V("designState", !1);
|
|
21
21
|
const { formConfig: _, designer: d } = q(), w = B({ type: "add", ...c() }), { i18nt: l } = I(), f = E(b, "visible"), F = () => {
|
|
22
22
|
var e;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getUuidKey as
|
|
2
|
-
const l = (
|
|
3
|
-
key:
|
|
1
|
+
import { getUuidKey as a } from "@kp-ui/tool";
|
|
2
|
+
const l = (t = {}) => ({
|
|
3
|
+
key: a(),
|
|
4
4
|
type: "data-table",
|
|
5
5
|
category: "container",
|
|
6
6
|
icon: "data-table",
|
|
@@ -57,23 +57,11 @@ const l = (a = {}) => ({
|
|
|
57
57
|
},
|
|
58
58
|
dataReqHandlerCode: "",
|
|
59
59
|
dataHandlerCode: "",
|
|
60
|
-
rowKey: "
|
|
60
|
+
rowKey: "_id",
|
|
61
61
|
childrenKey: "children",
|
|
62
|
-
dataSource: [
|
|
63
|
-
{
|
|
64
|
-
date: "2016-05-02",
|
|
65
|
-
date2: "2016-05-02 23:12:12",
|
|
66
|
-
date3: "2016-05-02 9:11:12",
|
|
67
|
-
name: "小二",
|
|
68
|
-
add: "上海市普陀区金沙江路 1518 弄",
|
|
69
|
-
age: 100
|
|
70
|
-
}
|
|
71
|
-
],
|
|
62
|
+
dataSource: [],
|
|
72
63
|
onCreated: "",
|
|
73
64
|
onMounted: "",
|
|
74
|
-
// onHideOperationButton: '',
|
|
75
|
-
// onDisableOperationButton: '',
|
|
76
|
-
// onOperationButtonClick: '',
|
|
77
65
|
customRow: {
|
|
78
66
|
onClick: "",
|
|
79
67
|
onDblclick: "",
|
|
@@ -97,7 +85,7 @@ const l = (a = {}) => ({
|
|
|
97
85
|
hasRowSelection: !1,
|
|
98
86
|
preserveSelectedRowKeys: !1,
|
|
99
87
|
fixed: !0,
|
|
100
|
-
onChange: "console.log(
|
|
88
|
+
onChange: "console.log(selectedRowKeys, selectedRows)",
|
|
101
89
|
columnWidth: 32,
|
|
102
90
|
getCheckboxProps: (e) => ({
|
|
103
91
|
disabled: e.name === "Disabled User",
|
|
@@ -105,7 +93,7 @@ const l = (a = {}) => ({
|
|
|
105
93
|
name: e.name
|
|
106
94
|
})
|
|
107
95
|
},
|
|
108
|
-
...
|
|
96
|
+
...t
|
|
109
97
|
}
|
|
110
98
|
});
|
|
111
99
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./data-table-widget.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import a from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ a(t, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ a(t, [["__scopeId", "data-v-d5ee76ba"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { ComponentNameEnum as
|
|
4
|
-
import { useVxeTable as
|
|
5
|
-
import { useField as
|
|
6
|
-
import { useTableWidget as
|
|
7
|
-
const
|
|
8
|
-
name:
|
|
9
|
-
componentName:
|
|
1
|
+
import { defineComponent as M, watchEffect as s, onMounted as N, createBlock as P, createCommentVNode as S, unref as e, openBlock as W, mergeProps as y, withCtx as F, createElementVNode as V, normalizeStyle as I, createVNode as L } from "vue";
|
|
2
|
+
import z from "./container-wrapper.vue.js";
|
|
3
|
+
import { ComponentNameEnum as B, ContainerTypeEnum as H } from "../../../constants/WidgetTypeEnum.js";
|
|
4
|
+
import { useVxeTable as O, Table as j } from "tmgc2-share";
|
|
5
|
+
import { useField as q } from "../../form-designer/form-widget/field-widget/useField.js";
|
|
6
|
+
import { useTableWidget as A } from "../../form-designer/form-widget/container-widget/useTableWidget.js";
|
|
7
|
+
const Y = /* @__PURE__ */ M({
|
|
8
|
+
name: H.DataTable,
|
|
9
|
+
componentName: B.FieldWidget,
|
|
10
10
|
__name: "data-table-widget",
|
|
11
11
|
props: {
|
|
12
12
|
widget: {},
|
|
@@ -17,59 +17,67 @@ const X = /* @__PURE__ */ v({
|
|
|
17
17
|
subFormRowIndex: {},
|
|
18
18
|
subFormRowId: {}
|
|
19
19
|
},
|
|
20
|
-
setup(
|
|
21
|
-
const t =
|
|
22
|
-
isLoading:
|
|
23
|
-
tableProps:
|
|
24
|
-
tableWidth:
|
|
25
|
-
pagintion:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
setup(d, { expose: c }) {
|
|
21
|
+
const t = d, { fieldModel: p, handleHidden: m, defineExposed: u, customClass: f } = q(t), {
|
|
22
|
+
isLoading: g,
|
|
23
|
+
tableProps: b,
|
|
24
|
+
tableWidth: C,
|
|
25
|
+
pagintion: l,
|
|
26
|
+
setPagination: i,
|
|
27
|
+
setTableRef: h,
|
|
28
|
+
initTableSoureData: w,
|
|
29
|
+
handleTableChange: x,
|
|
30
|
+
loadDataTableDataSource: r,
|
|
30
31
|
onRunEvent: a,
|
|
31
|
-
onSortChange:
|
|
32
|
-
onCheckboxChange:
|
|
33
|
-
tableDefinExpoed:
|
|
34
|
-
} =
|
|
32
|
+
onSortChange: T,
|
|
33
|
+
onCheckboxChange: v,
|
|
34
|
+
tableDefinExpoed: E
|
|
35
|
+
} = A({
|
|
35
36
|
props: t,
|
|
36
|
-
fieldModel:
|
|
37
|
-
})
|
|
38
|
-
|
|
37
|
+
fieldModel: p
|
|
38
|
+
});
|
|
39
|
+
s(() => {
|
|
40
|
+
t.field.options.showPagination || i({
|
|
41
|
+
total: 0
|
|
42
|
+
});
|
|
43
|
+
}), l.value.onChange = (o, _) => {
|
|
44
|
+
r();
|
|
45
|
+
};
|
|
46
|
+
const { tableRef: n, register: R, selectedRowInfo: k, sorts: D } = O({
|
|
47
|
+
props: b,
|
|
39
48
|
events: {
|
|
40
49
|
cellDblclick: (o) => a(o, "onDblclick"),
|
|
41
50
|
cellMouseenter: (o) => a(o, "onMouseenter"),
|
|
42
51
|
cellMouseleave: (o) => a(o, "onMouseleave")
|
|
43
52
|
},
|
|
44
53
|
callbacks: {
|
|
45
|
-
onCheckboxChange:
|
|
46
|
-
onSortChange:
|
|
54
|
+
onCheckboxChange: v,
|
|
55
|
+
onSortChange: T
|
|
47
56
|
}
|
|
48
57
|
});
|
|
49
|
-
return
|
|
50
|
-
n.value &&
|
|
51
|
-
}),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
loadDataTableDataSource: h,
|
|
58
|
+
return s(() => {
|
|
59
|
+
n.value && h(n.value);
|
|
60
|
+
}), N(() => {
|
|
61
|
+
w();
|
|
62
|
+
}), c({
|
|
63
|
+
...u,
|
|
64
|
+
...E,
|
|
65
|
+
setPagination: i,
|
|
66
|
+
sorts: D,
|
|
67
|
+
selectedRowInfo: k,
|
|
68
|
+
loadDataTableDataSource: r,
|
|
61
69
|
fieldEditor: n
|
|
62
|
-
}), (o,
|
|
70
|
+
}), (o, _) => e(m) ? S("", !0) : (W(), P(z, y({ key: 0 }, t, { customClass: e(f) }), {
|
|
63
71
|
default: F(() => [
|
|
64
|
-
|
|
72
|
+
V("div", {
|
|
65
73
|
class: "talbe-wrapper",
|
|
66
|
-
style:
|
|
74
|
+
style: I({ width: e(C) })
|
|
67
75
|
}, [
|
|
68
|
-
|
|
69
|
-
onRegister: e(
|
|
70
|
-
onChange: e(
|
|
71
|
-
loading: e(
|
|
72
|
-
pagination: e(
|
|
76
|
+
L(e(j), {
|
|
77
|
+
onRegister: e(R),
|
|
78
|
+
onChange: e(x),
|
|
79
|
+
loading: e(g),
|
|
80
|
+
pagination: e(l)
|
|
73
81
|
}, null, 8, ["onRegister", "onChange", "loading", "pagination"])
|
|
74
82
|
], 4)
|
|
75
83
|
]),
|
|
@@ -78,5 +86,5 @@ const X = /* @__PURE__ */ v({
|
|
|
78
86
|
}
|
|
79
87
|
});
|
|
80
88
|
export {
|
|
81
|
-
|
|
89
|
+
Y as default
|
|
82
90
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useExecFunction as
|
|
3
|
-
import
|
|
4
|
-
import { useLowcode as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as M, computed as f, ref as u, onBeforeUnmount as S, createBlock as V, openBlock as N, unref as i, mergeProps as H, withCtx as y, createElementVNode as J, createVNode as x, nextTick as L } from "vue";
|
|
2
|
+
import { useExecFunction as P, TpfModal as U } from "tmgc2-share";
|
|
3
|
+
import A from "./SubmitButtonRender.vue.js";
|
|
4
|
+
import { useLowcode as I } from "../../hooks/useLowcode.js";
|
|
5
|
+
import $ from "../FormRender/index.vue.js";
|
|
6
|
+
const q = { class: "dialog-content" }, ne = /* @__PURE__ */ M({
|
|
7
7
|
name: "dynamic-dialog",
|
|
8
8
|
__name: "dynamic-dialog",
|
|
9
9
|
props: {
|
|
@@ -45,119 +45,116 @@ const K = { class: "dialog-content" }, le = /* @__PURE__ */ H({
|
|
|
45
45
|
default: null
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
setup(n, { expose:
|
|
49
|
-
const e = n,
|
|
48
|
+
setup(n, { expose: C }) {
|
|
49
|
+
const e = n, D = f(() => e.options.height || "500px"), c = u(null), p = u(!1), l = u(!1), { context: r, asyncExecuteFunction: m, executeFunction: R } = P(), { vfdRef: s, formConfig: z, isLoading: v, getComponentJson: F, goBack: G } = I({
|
|
50
50
|
formCode: e.options.formCode,
|
|
51
51
|
...e.vfCtx
|
|
52
|
-
}),
|
|
52
|
+
}), O = f(() => ({
|
|
53
53
|
...e.parentFormRef,
|
|
54
54
|
parentDom: r.value,
|
|
55
|
-
getParentFormRef:
|
|
56
|
-
})),
|
|
57
|
-
|
|
55
|
+
getParentFormRef: E
|
|
56
|
+
})), h = f(() => e.options.cancelButtonHidden && e.options.okButtonHidden ? { footer: null } : {});
|
|
57
|
+
S(() => {
|
|
58
58
|
var t, o;
|
|
59
59
|
console.log(e.parentFormRef), (o = (t = e.parentFormRef) == null ? void 0 : t.setChildFormRef) == null || o.call(t, null);
|
|
60
60
|
});
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
},
|
|
61
|
+
const B = (t) => {
|
|
62
|
+
v.value = t;
|
|
63
|
+
}, k = (t) => {
|
|
64
64
|
e.options.title = t;
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
var t, o,
|
|
70
|
-
(t = e.options) != null && t.readMode && ((o =
|
|
65
|
+
}, w = () => {
|
|
66
|
+
l.value = !0;
|
|
67
|
+
}, T = () => {
|
|
68
|
+
l.value = !0, L(async () => {
|
|
69
|
+
var t, o, a;
|
|
70
|
+
(t = e.options) != null && t.readMode && ((o = s.value) == null || o.setReadMode(!0)), await F([], e.options.formCode), (a = s.value) == null || a.setDialogOrDrawerRef(r.value), e.parentFormRef && e.parentFormRef.setChildFormRef(s.value), g();
|
|
71
71
|
});
|
|
72
|
-
},
|
|
72
|
+
}, j = async () => {
|
|
73
73
|
if (e.options.onDialogBeforeClose)
|
|
74
|
-
return await
|
|
74
|
+
return await m({
|
|
75
75
|
functionBody: e.options.onDialogBeforeClose
|
|
76
76
|
});
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
d() && (
|
|
80
|
-
}, d = async () => e.options.onDialogBeforeClose ?
|
|
77
|
+
l.value = !1;
|
|
78
|
+
}, b = () => {
|
|
79
|
+
d() && (l.value = !1);
|
|
80
|
+
}, d = async () => e.options.onDialogBeforeClose ? R({
|
|
81
81
|
functionBody: e.options.onDialogBeforeClose
|
|
82
|
-
}) : !0,
|
|
82
|
+
}) : !0, g = async () => {
|
|
83
83
|
if (e.options.onDialogOpened)
|
|
84
|
-
return await
|
|
84
|
+
return await m({
|
|
85
85
|
functionBody: e.options.onDialogOpened
|
|
86
86
|
});
|
|
87
|
-
},
|
|
88
|
-
return
|
|
87
|
+
}, E = () => e.parentFormRef;
|
|
88
|
+
return C({
|
|
89
|
+
getFormRef: () => s.value,
|
|
89
90
|
setDisabled: (t) => {
|
|
90
|
-
|
|
91
|
+
p.value = t;
|
|
91
92
|
},
|
|
92
93
|
setleftText: (t) => {
|
|
93
|
-
|
|
94
|
+
c.value = t;
|
|
94
95
|
},
|
|
95
|
-
setLoading:
|
|
96
|
-
setTitle:
|
|
97
|
-
beforeOpen:
|
|
98
|
-
show:
|
|
99
|
-
close:
|
|
96
|
+
setLoading: B,
|
|
97
|
+
setTitle: k,
|
|
98
|
+
beforeOpen: w,
|
|
99
|
+
show: T,
|
|
100
|
+
close: j,
|
|
100
101
|
handleBeforeClose: d,
|
|
101
|
-
handleCloseEvent:
|
|
102
|
-
handleOpenedEvent:
|
|
102
|
+
handleCloseEvent: b,
|
|
103
|
+
handleOpenedEvent: g,
|
|
103
104
|
updateTable: () => {
|
|
104
|
-
var t, o,
|
|
105
|
-
(
|
|
105
|
+
var t, o, a;
|
|
106
|
+
(a = (o = (t = e.vfCtx) == null ? void 0 : t.parent) == null ? void 0 : o.exposed) != null && a.updateTable && e.vfCtx.parent.exposed.updateTable();
|
|
106
107
|
},
|
|
107
108
|
getExtraData: () => e.extraData
|
|
108
|
-
}), (t, o) => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
vfCtx
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
]),
|
|
156
|
-
_: 1
|
|
157
|
-
}, 16, ["title", "bodyStyle", "visible", "width", "mask", "maskClosable", "keyboard", "left-num"]);
|
|
158
|
-
};
|
|
109
|
+
}), (t, o) => (N(), V(i(U), H({
|
|
110
|
+
class: "tpf-model design-model",
|
|
111
|
+
destroyOnClose: !0,
|
|
112
|
+
title: n.options.title,
|
|
113
|
+
bodyStyle: {
|
|
114
|
+
height: D.value,
|
|
115
|
+
overflow: "auto",
|
|
116
|
+
...JSON.parse(n.options.bodyStyle || "{}")
|
|
117
|
+
},
|
|
118
|
+
centered: !0,
|
|
119
|
+
visible: l.value,
|
|
120
|
+
"onUpdate:visible": o[1] || (o[1] = (a) => l.value = a),
|
|
121
|
+
width: n.options.width,
|
|
122
|
+
mask: n.options.showModal,
|
|
123
|
+
maskClosable: n.options.closeOnClickModal,
|
|
124
|
+
keyboard: n.options.closeOnPressEscape,
|
|
125
|
+
onCancel: b,
|
|
126
|
+
"left-num": c.value
|
|
127
|
+
}, h.value), {
|
|
128
|
+
footerRight: y(() => [
|
|
129
|
+
x(A, {
|
|
130
|
+
disabled: p.value,
|
|
131
|
+
"dialog-visible": l.value,
|
|
132
|
+
"onUpdate:dialogVisible": o[0] || (o[0] = (a) => l.value = a),
|
|
133
|
+
handleBeforeClose: d,
|
|
134
|
+
options: n.options,
|
|
135
|
+
ctx: i(s)
|
|
136
|
+
}, null, 8, ["disabled", "dialog-visible", "options", "ctx"])
|
|
137
|
+
]),
|
|
138
|
+
default: y(() => [
|
|
139
|
+
J("div", q, [
|
|
140
|
+
x($, {
|
|
141
|
+
ref_key: "vfdRef",
|
|
142
|
+
ref: s,
|
|
143
|
+
loading: i(v),
|
|
144
|
+
vfCtx: {
|
|
145
|
+
...n.vfCtx,
|
|
146
|
+
instance: i(r)
|
|
147
|
+
},
|
|
148
|
+
"parent-form": O.value,
|
|
149
|
+
"disabled-mode": n.options.disabledMode,
|
|
150
|
+
"dynamic-creation": !0
|
|
151
|
+
}, null, 8, ["loading", "vfCtx", "parent-form", "disabled-mode"])
|
|
152
|
+
])
|
|
153
|
+
]),
|
|
154
|
+
_: 1
|
|
155
|
+
}, 16, ["title", "bodyStyle", "visible", "width", "mask", "maskClosable", "keyboard", "left-num"]));
|
|
159
156
|
}
|
|
160
157
|
});
|
|
161
158
|
export {
|
|
162
|
-
|
|
159
|
+
ne as default
|
|
163
160
|
};
|