@kp-ui/lowcode 2.15.0-alpha.17 → 2.15.0-alpha.18
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 +2 -2
- package/src/components/FormRender/index.vue2.js +30 -34
- package/src/components/FormRender/useFormContext.js +106 -105
- package/src/components/form-designer/form-widget/container-widget/useTableWidget.js +38 -37
- package/src/components/form-designer/form-widget/field-widget/hooks/useSelect.js +72 -71
- package/src/components/form-designer/useAppRef.js +29 -27
- package/src/components/form-render/SubmitButtonRender.vue.js +15 -17
- 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 +56 -53
- package/src/components/form-render/container-items/grid-col-widget.vue.js +1 -1
- package/src/components/form-render/container-items/grid-col-widget.vue2.js +19 -17
- package/src/components/form-render/container-items/grid-widget.vue.js +1 -1
- package/src/components/form-render/container-items/grid-widget.vue2.js +18 -16
- package/src/components/form-render/dynamic-dialog.vue.js +56 -52
- package/src/components/public/CustomerModal/CustomerModal.vue2.js +29 -26
- package/stats.html +1 -1
- package/styles/style.css +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./index.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-eab1c859"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as h, computed as w, ref as c, onMounted as J, watch as E, createElementBlock as p, openBlock as t, Fragment as I, createElementVNode as M, createBlock as P, createCommentVNode as g, createVNode as r, unref as e, mergeProps as T } from "vue";
|
|
2
2
|
import { Skeleton as z } from "ant-design-vue";
|
|
3
|
-
import
|
|
3
|
+
import U from "../form-render/dynamic-dialog.vue.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import
|
|
6
|
-
import { useFormContext as
|
|
5
|
+
import b from "./FormContainer.js";
|
|
6
|
+
import { useFormContext as W } from "./useFormContext.js";
|
|
7
7
|
import { useI18n as $ } from "../../utils/i18n.js";
|
|
8
8
|
import { storeToRefs as j } from "pinia";
|
|
9
9
|
import { useLocaleStore as q } from "@kp-ui/i18n";
|
|
10
|
-
import { getLocat as
|
|
11
|
-
import
|
|
12
|
-
import { useComRef as
|
|
13
|
-
const
|
|
10
|
+
import { getLocat as A } from "@kp-ui/tool";
|
|
11
|
+
import G from "./Debugger.vue.js";
|
|
12
|
+
import { useComRef as H } from "tmgc2-share";
|
|
13
|
+
const K = { class: "form-render-wrapper" }, O = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "loading-wrapper"
|
|
16
|
-
},
|
|
16
|
+
}, le = /* @__PURE__ */ h({
|
|
17
17
|
name: "VFormRender",
|
|
18
18
|
componentName: "VFormRender",
|
|
19
19
|
__name: "index",
|
|
@@ -30,58 +30,54 @@ const H = { class: "form-render-wrapper" }, K = {
|
|
|
30
30
|
debug: { type: Boolean }
|
|
31
31
|
},
|
|
32
32
|
emits: ["form-submit", "form-cancel"],
|
|
33
|
-
setup(
|
|
34
|
-
const { initLocale:
|
|
35
|
-
console.log(b());
|
|
36
|
-
const k = h(() => b().debug === "1"), m = d(!1), a = _, i = d(), l = G(v), N = y, o = U({
|
|
33
|
+
setup(v, { expose: C, emit: _ }) {
|
|
34
|
+
const { initLocale: y } = $(), F = q(), { locale: n } = j(F), x = w(() => A().debug === "1"), m = c(!1), a = v, i = c(), l = H(b), k = _, o = W({
|
|
37
35
|
props: a,
|
|
38
36
|
renderForm: i
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}),
|
|
37
|
+
}), N = (d) => {
|
|
38
|
+
k("form-submit", d);
|
|
39
|
+
}, R = () => l.value, { dynamicDialgRef: s, dialogProps: B, emitter: D, isLoading: f, registerToRefList: L, formWidgetId: V } = o;
|
|
40
|
+
return J(() => {
|
|
41
|
+
L(V);
|
|
42
|
+
}), E(
|
|
45
43
|
n,
|
|
46
44
|
() => {
|
|
47
|
-
|
|
45
|
+
y(n.value);
|
|
48
46
|
},
|
|
49
47
|
{
|
|
50
48
|
immediate: !0
|
|
51
49
|
}
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
return C({
|
|
55
|
-
...L,
|
|
50
|
+
), C({
|
|
51
|
+
...D,
|
|
56
52
|
...o,
|
|
57
53
|
dynamicDialgRef: s,
|
|
58
|
-
getNativeForm:
|
|
54
|
+
getNativeForm: R,
|
|
59
55
|
formJson: a.formJson,
|
|
60
56
|
renderForm: i
|
|
61
|
-
}), (
|
|
62
|
-
M("div",
|
|
63
|
-
e(f) ? (t(), p("div",
|
|
57
|
+
}), (d, u) => (t(), p(I, null, [
|
|
58
|
+
M("div", K, [
|
|
59
|
+
e(f) ? (t(), p("div", O, [
|
|
64
60
|
r(e(z), { active: e(f) }, null, 8, ["active"])
|
|
65
61
|
])) : g("", !0),
|
|
66
|
-
r(e(
|
|
62
|
+
r(e(b), {
|
|
67
63
|
ref_key: "formContainer",
|
|
68
64
|
ref: l,
|
|
69
65
|
context: e(o),
|
|
70
|
-
onFormSubmit:
|
|
66
|
+
onFormSubmit: N
|
|
71
67
|
}, null, 8, ["context"]),
|
|
72
|
-
r(
|
|
68
|
+
r(U, T(e(B), {
|
|
73
69
|
ref_key: "dynamicDialgRef",
|
|
74
70
|
ref: s
|
|
75
71
|
}), null, 16)
|
|
76
72
|
]),
|
|
77
|
-
|
|
73
|
+
x.value ? (t(), P(G, {
|
|
78
74
|
key: 0,
|
|
79
75
|
visible: m.value,
|
|
80
|
-
"onUpdate:visible": u[0] || (u[0] = (
|
|
76
|
+
"onUpdate:visible": u[0] || (u[0] = (S) => m.value = S)
|
|
81
77
|
}, null, 8, ["visible"])) : g("", !0)
|
|
82
78
|
], 64));
|
|
83
79
|
}
|
|
84
80
|
});
|
|
85
81
|
export {
|
|
86
|
-
|
|
82
|
+
le as default
|
|
87
83
|
};
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
import { ref as i, provide as
|
|
2
|
-
import { useFormValidation as
|
|
3
|
-
import { useFormDataProcessor as
|
|
4
|
-
import { insertCustomCssToHead as
|
|
5
|
-
import { set as
|
|
6
|
-
import { message as
|
|
7
|
-
import { useI18n as
|
|
8
|
-
import { getUuidKey as
|
|
9
|
-
import { useComRef as
|
|
10
|
-
import
|
|
1
|
+
import { ref as i, provide as l, computed as m, watchEffect as fe, onMounted as ce, nextTick as me } from "vue";
|
|
2
|
+
import { useFormValidation as V } from "./formValidation.js";
|
|
3
|
+
import { useFormDataProcessor as ue } from "./useFormDataProcessor.js";
|
|
4
|
+
import { insertCustomCssToHead as de, insertGlobalFunctionsToHtml as ve, getContainerWidgetByName as H, cloneFormConfigWithoutEventHandler as ge, generateId as Fe } from "../../utils/util.js";
|
|
5
|
+
import { set as pe, cloneDeep as Ce } from "lodash-es";
|
|
6
|
+
import { message as J } from "ant-design-vue";
|
|
7
|
+
import { useI18n as he } from "../../utils/i18n.js";
|
|
8
|
+
import { getUuidKey as De } from "@kp-ui/tool";
|
|
9
|
+
import { useComRef as Re, useRef as we, useExecFunction as xe } from "tmgc2-share";
|
|
10
|
+
import be from "../form-render/dynamic-dialog.vue.js";
|
|
11
11
|
/* empty css */
|
|
12
|
-
import { useEmitter as
|
|
13
|
-
import { useAppRef as
|
|
14
|
-
const
|
|
15
|
-
const { formJson:
|
|
16
|
-
|
|
17
|
-
const
|
|
12
|
+
import { useEmitter as Le } from "../../utils/useEmitter.js";
|
|
13
|
+
import { useAppRef as Me } from "../form-designer/useAppRef.js";
|
|
14
|
+
const Be = ({ renderForm: C, props: a }) => {
|
|
15
|
+
const { formJson: h, formData: T } = a, v = Re(be), { i18nt: D } = he(), [R, j] = we(!1), g = Le(), c = i(), s = i({}), w = i(!1), F = i(/* @__PURE__ */ new Map()), x = i({}), U = i(), p = Symbol("formWidget");
|
|
16
|
+
l("refList", F), l("getFormConfig", () => t.value), l("formData", s), l("getReadMode", () => R.value), l("designState", !1);
|
|
17
|
+
const b = i(), { executeFunction: $, context: L, execHttpFunction: M } = xe(), { getFormRef: y, getWidgetRef: B, registerToRefList: S } = Me(F, p), t = m(() => {
|
|
18
18
|
var e;
|
|
19
19
|
return ((e = c.value) == null ? void 0 : e.formConfig) || {};
|
|
20
20
|
});
|
|
21
|
-
|
|
21
|
+
l("formConfig", t), l("formWidgetId", p);
|
|
22
22
|
const u = m(() => {
|
|
23
23
|
var e;
|
|
24
24
|
return ((e = c.value) == null ? void 0 : e.widgetList) || [];
|
|
25
25
|
}), _ = m(() => {
|
|
26
26
|
var e;
|
|
27
|
-
return ((e =
|
|
27
|
+
return ((e = t.value) == null ? void 0 : e.labelPosition) || "horizontal";
|
|
28
28
|
}), z = (e) => {
|
|
29
|
-
|
|
29
|
+
U.value = e;
|
|
30
30
|
}, A = m(() => {
|
|
31
31
|
var e;
|
|
32
|
-
return (e =
|
|
32
|
+
return (e = t.value) != null && e.labelWidth ? `${t.value.labelWidth}px` : "80px";
|
|
33
33
|
}), G = m(() => {
|
|
34
34
|
var e;
|
|
35
|
-
return ((e =
|
|
36
|
-
}),
|
|
37
|
-
let d =
|
|
38
|
-
|
|
39
|
-
d =
|
|
35
|
+
return ((e = t.value) == null ? void 0 : e.customClass) || "";
|
|
36
|
+
}), W = ue();
|
|
37
|
+
let d = V(C, u.value || []);
|
|
38
|
+
fe(() => {
|
|
39
|
+
d = V(C, u.value || []);
|
|
40
40
|
});
|
|
41
|
-
const
|
|
42
|
-
var
|
|
43
|
-
c.value = e || { widgetList: [], formConfig: {} }, s.value = {}, K(((
|
|
41
|
+
const I = async (e) => {
|
|
42
|
+
var o;
|
|
43
|
+
c.value = e || { widgetList: [], formConfig: {} }, s.value = {}, K(((o = c.value) == null ? void 0 : o.widgetList) || []), await me(), se();
|
|
44
44
|
}, K = (e) => {
|
|
45
45
|
if ((e == null ? void 0 : e.length) > 0) {
|
|
46
|
-
const
|
|
47
|
-
Object.assign(s.value,
|
|
46
|
+
const o = W.buildFormModel(e, T);
|
|
47
|
+
Object.assign(s.value, o);
|
|
48
48
|
}
|
|
49
|
-
},
|
|
50
|
-
e && Object.keys(e).forEach((
|
|
51
|
-
s.value.hasOwnProperty(
|
|
49
|
+
}, O = () => s.value || {}, k = (e) => {
|
|
50
|
+
e && Object.keys(e).forEach((o) => {
|
|
51
|
+
s.value.hasOwnProperty(o) && (s.value[o] = e[o]);
|
|
52
52
|
});
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
}, q = () => {
|
|
56
|
-
d.resetValidation();
|
|
53
|
+
}, q = (e) => {
|
|
54
|
+
w.value = e;
|
|
57
55
|
}, Q = () => {
|
|
56
|
+
d.resetValidation();
|
|
57
|
+
}, X = () => {
|
|
58
58
|
d.clearValidate();
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
},
|
|
59
|
+
}, Y = (e) => {
|
|
60
|
+
b.value = e;
|
|
61
|
+
}, Z = () => {
|
|
62
62
|
if (!a.parentForm)
|
|
63
|
-
return
|
|
63
|
+
return y();
|
|
64
64
|
let e = a.parentForm;
|
|
65
65
|
for (; e.parentForm; )
|
|
66
66
|
e = e.parentForm;
|
|
67
67
|
return e;
|
|
68
|
-
},
|
|
69
|
-
var
|
|
70
|
-
const r =
|
|
71
|
-
if (
|
|
72
|
-
|
|
68
|
+
}, N = (e, o = {}, n = {}) => {
|
|
69
|
+
var P, E;
|
|
70
|
+
const r = Z(), f = H((r == null ? void 0 : r.widgetList) || [], e) || H(u.value || [], e);
|
|
71
|
+
if (f === null) {
|
|
72
|
+
J.error(D("render.hint.refNotFound") + e);
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
if (!e ||
|
|
76
|
-
|
|
75
|
+
if (!e || f.type !== "vf-dialog") {
|
|
76
|
+
J.error(D("render.hint.refNotFound") + e);
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
const
|
|
80
|
-
widgetList:
|
|
81
|
-
formConfig:
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
options:
|
|
85
|
-
formJson:
|
|
86
|
-
formData: { ...
|
|
79
|
+
const ie = {
|
|
80
|
+
widgetList: Ce((f == null ? void 0 : f.widgetList) || []),
|
|
81
|
+
formConfig: ge(((P = r == null ? void 0 : r.formConfig) == null ? void 0 : P.value) || {})
|
|
82
|
+
}, le = De();
|
|
83
|
+
x.value = {
|
|
84
|
+
options: f.options,
|
|
85
|
+
formJson: ie,
|
|
86
|
+
formData: { ...o },
|
|
87
87
|
optionData: r.optionData,
|
|
88
88
|
globalDsv: r.globalDsv,
|
|
89
|
-
parentFormRef:
|
|
89
|
+
parentFormRef: L.value,
|
|
90
90
|
extraData: n,
|
|
91
|
-
wrapperId:
|
|
92
|
-
vfCtx: { ...
|
|
93
|
-
}, (
|
|
94
|
-
},
|
|
91
|
+
wrapperId: le,
|
|
92
|
+
vfCtx: { ...o }
|
|
93
|
+
}, (E = v.value) == null || E.show();
|
|
94
|
+
}, ee = () => a.parentForm, oe = () => {
|
|
95
95
|
var e;
|
|
96
96
|
return (e = v.value) == null ? void 0 : e.getFormRef();
|
|
97
97
|
}, te = () => {
|
|
98
|
-
g.off$("fieldChange"), g.on$("fieldChange", ({ fieldName: e, value:
|
|
99
|
-
|
|
98
|
+
g.off$("fieldChange"), g.on$("fieldChange", ({ fieldName: e, value: o }) => {
|
|
99
|
+
pe(s.value, e, o);
|
|
100
100
|
});
|
|
101
|
-
},
|
|
102
|
-
var
|
|
103
|
-
const e =
|
|
104
|
-
if ((
|
|
105
|
-
const n = await
|
|
101
|
+
}, re = async () => {
|
|
102
|
+
var o;
|
|
103
|
+
const e = t.value.serveList;
|
|
104
|
+
if ((o = e.vformDetail.http) != null && o.url) {
|
|
105
|
+
const n = await M(
|
|
106
106
|
{
|
|
107
107
|
...e.vformDetail
|
|
108
108
|
},
|
|
@@ -112,69 +112,70 @@ const $e = ({ renderForm: p, props: a }) => {
|
|
|
112
112
|
);
|
|
113
113
|
return console.log("res: ", n), n;
|
|
114
114
|
}
|
|
115
|
-
},
|
|
115
|
+
}, ne = async () => {
|
|
116
116
|
var n;
|
|
117
|
-
const e = await
|
|
118
|
-
if ((n =
|
|
119
|
-
const r = await
|
|
117
|
+
const e = await O(), o = t.value.serveList;
|
|
118
|
+
if ((n = o.vformDetail.http) != null && n.url) {
|
|
119
|
+
const r = await M(o.vformUpdate, {
|
|
120
120
|
data: e,
|
|
121
121
|
vfCtx: a.vfCtx
|
|
122
122
|
});
|
|
123
123
|
return console.log("res: ", r), r;
|
|
124
124
|
}
|
|
125
|
-
}, ne = () => {
|
|
126
|
-
var e, t;
|
|
127
|
-
(e = o.value) != null && e.onFormMounted && U({
|
|
128
|
-
functionBody: (t = o.value) == null ? void 0 : t.onFormMounted
|
|
129
|
-
});
|
|
130
125
|
}, se = () => {
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
var e, o;
|
|
127
|
+
(e = t.value) != null && e.onFormMounted && $({
|
|
128
|
+
functionBody: (o = t.value) == null ? void 0 : o.onFormMounted
|
|
129
|
+
});
|
|
130
|
+
}, ae = () => {
|
|
131
|
+
const e = "vfRender" + Fe(), { cssCode: o, functions: n } = t.value;
|
|
132
|
+
o && de(o, e || ""), n && ve(n, e || "");
|
|
133
133
|
};
|
|
134
|
-
return
|
|
135
|
-
|
|
134
|
+
return ce(() => {
|
|
135
|
+
h && I(h), te(), ae();
|
|
136
136
|
}), {
|
|
137
|
+
formWidgetId: p,
|
|
137
138
|
vfCtx: a.vfCtx,
|
|
138
|
-
getParentFormRef:
|
|
139
|
-
getFormRef:
|
|
140
|
-
getWidgetRef:
|
|
141
|
-
registerToRefList:
|
|
142
|
-
dialogOrDrawerRef:
|
|
143
|
-
setDialogOrDrawerRef:
|
|
144
|
-
showDialog:
|
|
145
|
-
setFormData:
|
|
146
|
-
setReadMode:
|
|
147
|
-
setFormJson:
|
|
148
|
-
setLoading:
|
|
149
|
-
onFormDetail:
|
|
150
|
-
onFormUpdate:
|
|
139
|
+
getParentFormRef: ee,
|
|
140
|
+
getFormRef: y,
|
|
141
|
+
getWidgetRef: B,
|
|
142
|
+
registerToRefList: S,
|
|
143
|
+
dialogOrDrawerRef: b,
|
|
144
|
+
setDialogOrDrawerRef: Y,
|
|
145
|
+
showDialog: N,
|
|
146
|
+
setFormData: k,
|
|
147
|
+
setReadMode: j,
|
|
148
|
+
setFormJson: I,
|
|
149
|
+
setLoading: q,
|
|
150
|
+
onFormDetail: re,
|
|
151
|
+
onFormUpdate: ne,
|
|
151
152
|
emitter: g,
|
|
152
|
-
context:
|
|
153
|
-
getFormData:
|
|
154
|
-
getChildFormRef:
|
|
153
|
+
context: L,
|
|
154
|
+
getFormData: O,
|
|
155
|
+
getChildFormRef: oe,
|
|
155
156
|
// 状态
|
|
156
157
|
formJsonObj: c,
|
|
157
158
|
formDataModel: s,
|
|
158
|
-
isLoading:
|
|
159
|
-
readModeFlag:
|
|
159
|
+
isLoading: w,
|
|
160
|
+
readModeFlag: R,
|
|
160
161
|
// 引用
|
|
161
162
|
widgetRefList: F,
|
|
162
163
|
// 处理器
|
|
163
|
-
formDataProcessor:
|
|
164
|
+
formDataProcessor: W,
|
|
164
165
|
formValidator: d,
|
|
165
166
|
// 计算属性
|
|
166
|
-
formConfig:
|
|
167
|
+
formConfig: t,
|
|
167
168
|
widgetList: u,
|
|
168
169
|
labelPosition: _,
|
|
169
170
|
labelWidth: A,
|
|
170
171
|
customClass: G,
|
|
171
172
|
dynamicDialgRef: v,
|
|
172
|
-
dialogProps:
|
|
173
|
+
dialogProps: x,
|
|
173
174
|
setChildFormRef: z,
|
|
174
|
-
resetValidation:
|
|
175
|
-
clearValidate:
|
|
175
|
+
resetValidation: Q,
|
|
176
|
+
clearValidate: X
|
|
176
177
|
};
|
|
177
178
|
};
|
|
178
179
|
export {
|
|
179
|
-
|
|
180
|
+
Be as useFormContext
|
|
180
181
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { inject as E, ref as x, computed as l, h as K } from "vue";
|
|
2
|
-
import { omit as H, cloneDeep as
|
|
2
|
+
import { omit as H, cloneDeep as d, isArray as N } from "lodash-es";
|
|
3
3
|
import q from "../../../public/ActionButtonListRender.vue.js";
|
|
4
4
|
import { useI18n as L } from "../../../../utils/i18n.js";
|
|
5
5
|
import { useExecFunction as j, tranformAntTableColumnToVxetableColumn as _, tranformAntSizzVxetableSize as G } from "tmgc2-share";
|
|
6
6
|
import { useDataHttp as J } from "../../../../hooks/useDataHttp.js";
|
|
7
|
-
function rt({ props: c, fieldModel:
|
|
8
|
-
const C = E("designState", !1),
|
|
7
|
+
function rt({ props: c, fieldModel: a }) {
|
|
8
|
+
const C = E("designState", !1), h = x(), f = x(!1), { widget: n } = c, { i18nt: v } = L(), { executeFunction: u, context: y } = j(), { loadataSource: S, setPagination: b, getPagination: p, pagintion: D } = J({
|
|
9
9
|
props: c
|
|
10
10
|
}), T = l(() => {
|
|
11
|
-
const t = [], e = (n == null ? void 0 : n.options) || {}, { rowSelection: o, showIndex:
|
|
11
|
+
const t = [], e = (n == null ? void 0 : n.options) || {}, { rowSelection: o, showIndex: s, tableColumns: r = [] } = (n == null ? void 0 : n.options) ?? {};
|
|
12
12
|
o != null && o.hasRowSelection && t.push({
|
|
13
13
|
title: o.columnTitle,
|
|
14
14
|
width: o.columnWidth,
|
|
@@ -16,8 +16,8 @@ function rt({ props: c, fieldModel: s }) {
|
|
|
16
16
|
fixed: "left",
|
|
17
17
|
dataIndex: "checkbox",
|
|
18
18
|
type: "checkbox"
|
|
19
|
-
}),
|
|
20
|
-
title:
|
|
19
|
+
}), s && t.push({
|
|
20
|
+
title: v("designer.setting.seq"),
|
|
21
21
|
align: "left",
|
|
22
22
|
width: 90,
|
|
23
23
|
fixed: "left",
|
|
@@ -26,7 +26,7 @@ function rt({ props: c, fieldModel: s }) {
|
|
|
26
26
|
resizable: !0,
|
|
27
27
|
type: "seq"
|
|
28
28
|
});
|
|
29
|
-
const
|
|
29
|
+
const g = r.filter((i) => i.show).map((i) => ({
|
|
30
30
|
...i,
|
|
31
31
|
...R(i)
|
|
32
32
|
})), w = [];
|
|
@@ -42,26 +42,26 @@ function rt({ props: c, fieldModel: s }) {
|
|
|
42
42
|
buttonList: i,
|
|
43
43
|
flex: "center",
|
|
44
44
|
scope: A,
|
|
45
|
-
ctx:
|
|
45
|
+
ctx: y.value
|
|
46
46
|
})
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
const V = [...t, ...
|
|
50
|
+
const V = [...t, ...g, ...w];
|
|
51
51
|
return _(V);
|
|
52
52
|
}), R = (t) => {
|
|
53
53
|
const e = H(t, ["customRender"]), o = t.customRender;
|
|
54
54
|
return t.minWidth = 50, t.maxWidth = 1200, t.isAutoWidth ? (t.width = null, delete t.width) : t.width = isNaN(Number(t.width)) ? t.width : Number(t.width), o ? {
|
|
55
55
|
...e,
|
|
56
56
|
slots: {
|
|
57
|
-
default(
|
|
57
|
+
default(s) {
|
|
58
58
|
return u({
|
|
59
59
|
source: c.field.options.name,
|
|
60
60
|
functionBody: o,
|
|
61
61
|
params: {
|
|
62
|
-
index:
|
|
63
|
-
record:
|
|
64
|
-
...
|
|
62
|
+
index: s.rowIndex,
|
|
63
|
+
record: s.row,
|
|
64
|
+
...s
|
|
65
65
|
},
|
|
66
66
|
errorCallback: (r) => {
|
|
67
67
|
console.error("Custom render error:", r);
|
|
@@ -71,22 +71,22 @@ function rt({ props: c, fieldModel: s }) {
|
|
|
71
71
|
}
|
|
72
72
|
} : t;
|
|
73
73
|
}, k = l(() => n.options.tableWidth), z = l(() => n.options.tableSize), W = () => {
|
|
74
|
-
|
|
74
|
+
m();
|
|
75
75
|
}, B = l(() => n.options.rowKey), P = l(() => {
|
|
76
76
|
const {
|
|
77
77
|
tableSize: t,
|
|
78
78
|
rowKey: e,
|
|
79
79
|
tableHeight: o = 300,
|
|
80
|
-
border:
|
|
80
|
+
border: s = !1,
|
|
81
81
|
lineHeight: r = 50,
|
|
82
|
-
colorRow:
|
|
82
|
+
colorRow: g = !1
|
|
83
83
|
} = n.options;
|
|
84
84
|
return {
|
|
85
85
|
showPagination: n.options.showPagination,
|
|
86
86
|
size: G(t),
|
|
87
87
|
height: o,
|
|
88
|
-
border:
|
|
89
|
-
data:
|
|
88
|
+
border: s ?? !1,
|
|
89
|
+
data: a.value || [],
|
|
90
90
|
columns: T.value,
|
|
91
91
|
sortConfig: {
|
|
92
92
|
trigger: "cell",
|
|
@@ -95,7 +95,7 @@ function rt({ props: c, fieldModel: s }) {
|
|
|
95
95
|
},
|
|
96
96
|
rowConfig: {
|
|
97
97
|
keyField: e,
|
|
98
|
-
isCurrent:
|
|
98
|
+
isCurrent: g,
|
|
99
99
|
isHover: !0
|
|
100
100
|
},
|
|
101
101
|
cellConfig: {
|
|
@@ -103,20 +103,20 @@ function rt({ props: c, fieldModel: s }) {
|
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
}), F = (t) => {
|
|
106
|
-
|
|
107
|
-
},
|
|
106
|
+
h.value = t;
|
|
107
|
+
}, m = async () => {
|
|
108
108
|
var t;
|
|
109
109
|
if (c.field.options.dsEnabled) {
|
|
110
|
-
|
|
110
|
+
f.value = !0;
|
|
111
111
|
try {
|
|
112
|
-
const e = await
|
|
113
|
-
C ? await ((t =
|
|
112
|
+
const e = await S(), o = e.list || [];
|
|
113
|
+
C ? await ((t = h.value) == null ? void 0 : t.loadData(o)) : a.value = d(o || []), b(e);
|
|
114
114
|
} catch (e) {
|
|
115
115
|
console.error(e);
|
|
116
116
|
}
|
|
117
117
|
} else
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
a.value = n.options.dataSource || [];
|
|
119
|
+
f.value = !1;
|
|
120
120
|
}, I = ({ row: t, $event: e }, o) => {
|
|
121
121
|
u({
|
|
122
122
|
functionBody: n.options.customRow[o],
|
|
@@ -137,19 +137,20 @@ function rt({ props: c, fieldModel: s }) {
|
|
|
137
137
|
setValue: (t) => {
|
|
138
138
|
if (!N(t))
|
|
139
139
|
return console.error("表格数据类型错误");
|
|
140
|
+
a.value = d(t);
|
|
140
141
|
},
|
|
141
142
|
insertTableValue: (t) => {
|
|
142
|
-
|
|
143
|
+
a.value || (a.value = []), a.value.push(d(t));
|
|
143
144
|
},
|
|
144
|
-
setPagination:
|
|
145
|
-
getDataSource: () =>
|
|
145
|
+
setPagination: b,
|
|
146
|
+
getDataSource: () => a.value,
|
|
146
147
|
getPagination: p
|
|
147
148
|
},
|
|
148
149
|
onSortChange: W,
|
|
149
150
|
pagintion: D,
|
|
150
|
-
setPagination:
|
|
151
|
+
setPagination: b,
|
|
151
152
|
getPagination: p,
|
|
152
|
-
handleTableChange: (t, e, o,
|
|
153
|
+
handleTableChange: (t, e, o, s) => {
|
|
153
154
|
const r = n.options.onTableChange;
|
|
154
155
|
r && u({
|
|
155
156
|
functionBody: r,
|
|
@@ -157,26 +158,26 @@ function rt({ props: c, fieldModel: s }) {
|
|
|
157
158
|
pagination: t,
|
|
158
159
|
filters: e,
|
|
159
160
|
sorter: o,
|
|
160
|
-
currentDataSource:
|
|
161
|
+
currentDataSource: s
|
|
161
162
|
},
|
|
162
163
|
keys: ["pagination", "filters", "sorter", "currentDataSource"]
|
|
163
164
|
});
|
|
164
165
|
},
|
|
165
166
|
setTableData: (t) => {
|
|
166
|
-
|
|
167
|
+
a.value = d(t);
|
|
167
168
|
},
|
|
168
169
|
loadDataTableDataSource: () => {
|
|
169
|
-
|
|
170
|
+
m();
|
|
170
171
|
},
|
|
171
172
|
showPagination: l(() => !!c.field.options.showPagination),
|
|
172
173
|
onRunEvent: I,
|
|
173
|
-
isLoading:
|
|
174
|
-
initTableSoureData:
|
|
174
|
+
isLoading: f,
|
|
175
|
+
initTableSoureData: m,
|
|
175
176
|
setTableRef: F,
|
|
176
177
|
tableSize: z,
|
|
177
178
|
tableWidth: k,
|
|
178
179
|
tableProps: P,
|
|
179
|
-
tableRef:
|
|
180
|
+
tableRef: h
|
|
180
181
|
};
|
|
181
182
|
}
|
|
182
183
|
export {
|