act-plus 1.1.56 → 1.1.58
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/act-plus.js +2 -4
- package/act-plus.umd.cjs +61 -146
- package/lib/dialogAddField-8dac5d06.js +939 -0
- package/lib/dialogConfigBtn-02cbe1c8.js +808 -0
- package/lib/dialogSiteComponentsParams-2ed0ff35.js +71 -0
- package/lib/index-160e64fa.js +407 -0
- package/lib/index-210e9bd6.js +147 -0
- package/lib/index-2cbc7b22.js +289 -0
- package/lib/index-76d79944.js +293 -0
- package/lib/index-7a420913.js +378 -0
- package/lib/index-98567fac.js +65 -0
- package/lib/index-a685fc26.js +106 -0
- package/lib/index-b8e2d056.js +20475 -0
- package/lib/index-c7522ec4.js +5929 -0
- package/lib/index-d1c6a777.js +103 -0
- package/lib/index-e2f2023d.js +35 -0
- package/package.json +1 -1
- package/style.css +1 -0
- package/lib/dialogAddField-6b06ab7c.js.gz +0 -0
- package/lib/dialogConfigBtn-d1568216.js.gz +0 -0
- package/lib/dialogSiteComponentsParams-3dcdc659.js.gz +0 -0
- package/lib/index-101b5643.js.gz +0 -0
- package/lib/index-208cc48a.js.gz +0 -0
- package/lib/index-2212d587.js.gz +0 -0
- package/lib/index-4e254a44.js.gz +0 -0
- package/lib/index-59fb9e5c.js.gz +0 -0
- package/lib/index-6933655a.js.gz +0 -0
- package/lib/index-93d2f191.js.gz +0 -0
- package/style.css.gz +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineAsyncComponent as _, ref as C, watch as y, resolveComponent as u, openBlock as k, createBlock as w, withCtx as a, createElementVNode as x, createVNode as s, createTextVNode as m, unref as p, isRef as S } from "vue";
|
|
2
|
+
const B = { class: "dialog-footer" }, A = {
|
|
3
|
+
__name: "dialogSiteComponentsParams",
|
|
4
|
+
props: {
|
|
5
|
+
visible: { type: Boolean, default: !1 },
|
|
6
|
+
title: { type: String, default: "" },
|
|
7
|
+
modelValue: { type: String, default: "" }
|
|
8
|
+
},
|
|
9
|
+
emits: ["update:visible", "refresh", "update:modelValue"],
|
|
10
|
+
setup(f, { emit: c }) {
|
|
11
|
+
const v = _(() => import("./index-b8e2d056.js")), n = c, o = f;
|
|
12
|
+
let t = C();
|
|
13
|
+
y(
|
|
14
|
+
() => o.visible,
|
|
15
|
+
async (l, e) => {
|
|
16
|
+
l && (t.value = o.modelValue);
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
const b = (l) => {
|
|
20
|
+
d(), l();
|
|
21
|
+
}, d = () => {
|
|
22
|
+
t.value = "", n("update:visible", !1);
|
|
23
|
+
}, V = () => {
|
|
24
|
+
n("update:modelValue", t.value), n("update:visible", !1);
|
|
25
|
+
};
|
|
26
|
+
return (l, e) => {
|
|
27
|
+
const r = u("el-button"), g = u("el-dialog");
|
|
28
|
+
return k(), w(g, {
|
|
29
|
+
"model-value": o.visible,
|
|
30
|
+
title: o.title,
|
|
31
|
+
top: "5vh",
|
|
32
|
+
width: "800",
|
|
33
|
+
draggable: "",
|
|
34
|
+
overflow: "",
|
|
35
|
+
"close-on-click-modal": !1,
|
|
36
|
+
"before-close": b
|
|
37
|
+
}, {
|
|
38
|
+
footer: a(() => [
|
|
39
|
+
x("span", B, [
|
|
40
|
+
s(r, { onClick: d }, {
|
|
41
|
+
default: a(() => e[2] || (e[2] = [
|
|
42
|
+
m("取消")
|
|
43
|
+
])),
|
|
44
|
+
_: 1
|
|
45
|
+
}),
|
|
46
|
+
s(r, {
|
|
47
|
+
type: "primary",
|
|
48
|
+
onClick: e[1] || (e[1] = (i) => V())
|
|
49
|
+
}, {
|
|
50
|
+
default: a(() => e[3] || (e[3] = [
|
|
51
|
+
m("保存")
|
|
52
|
+
])),
|
|
53
|
+
_: 1
|
|
54
|
+
})
|
|
55
|
+
])
|
|
56
|
+
]),
|
|
57
|
+
default: a(() => [
|
|
58
|
+
s(p(v), {
|
|
59
|
+
modelValue: p(t),
|
|
60
|
+
"onUpdate:modelValue": e[0] || (e[0] = (i) => S(t) ? t.value = i : t = i),
|
|
61
|
+
height: 600
|
|
62
|
+
}, null, 8, ["modelValue"])
|
|
63
|
+
]),
|
|
64
|
+
_: 1
|
|
65
|
+
}, 8, ["model-value", "title"]);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
A as default
|
|
71
|
+
};
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { defineAsyncComponent as O, inject as K, ref as N, watch as Te, resolveComponent as _, resolveDirective as le, openBlock as u, createBlock as y, withCtx as D, createElementVNode as ae, createVNode as te, createTextVNode as J, toDisplayString as A, unref as r, withDirectives as oe, createElementBlock as k, Fragment as q, renderList as Q, mergeProps as F, createCommentVNode as se, resolveDynamicComponent as De, toRaw as Ke } from "vue";
|
|
2
|
+
import { _ as we, u as Ne, P as Pe, a as Ue, b as ke } from "./index-c7522ec4.js";
|
|
3
|
+
import { ElNotification as Se } from "element-plus";
|
|
4
|
+
import "vue-router";
|
|
5
|
+
const Le = { class: "no-config-field" }, Re = { class: "dialog-footer" }, $e = {
|
|
6
|
+
__name: "index",
|
|
7
|
+
props: {
|
|
8
|
+
visible: { type: Boolean, default: !1 },
|
|
9
|
+
title: { type: String, default: "" },
|
|
10
|
+
data: { type: Object, default: () => ({}) }
|
|
11
|
+
},
|
|
12
|
+
emits: ["update:visible", "refresh"],
|
|
13
|
+
setup(P, { emit: ie }) {
|
|
14
|
+
const re = O(() => import("./index-e2f2023d.js")), de = O(() => import("./index-d1c6a777.js")), ne = O(() => import("./index-76d79944.js")), ue = O(() => import("./index-7a420913.js")), { t: b } = Ne(), M = K("request"), ce = K("loadComponents"), w = K("formatDataType"), x = K("globalProps"), fe = K("stringToBoolean"), h = K("getFieldUiProps"), pe = K("disposeRequestData"), X = ie, f = P, S = N(!1), L = N(!1), E = N(null), R = N([]), t = N({}), j = N({}), me = (l) => l.formColumnCol == null ? 24 : l.formColumnCol ? l.formColumnCol : 24 / l.formRow, ye = (l) => ["input", "textarea"].includes(l.fieldType) ? "blur" : (["select", "multipleSelect", "datetimerange", "treeSelect", "provinceCascade"].includes(l.fieldType), "change"), be = async ({ node: l, resolve: p }, a) => {
|
|
15
|
+
const i = h(a), { label: m, value: n, children: g, isLeaf: o } = { ...ke, ...i.treeProps || {} };
|
|
16
|
+
if (l[o])
|
|
17
|
+
return p([]);
|
|
18
|
+
const d = a.postRequestParams.filter((c) => c.submitType === "default").reduce((c, V) => (c[V.submitName] = w(V.paramsType, V.submitValue), c), {}), C = a.postRequestParams.filter((c) => c.submitType === "match").reduce((c, V) => (c[V.submitName] = w(V.paramsType, x.matchData[V.submitValue][V.submitName]), c), {}), T = a.postRequestParams.filter((c) => c.submitType === "dynamic").map((c) => {
|
|
19
|
+
let V = {
|
|
20
|
+
field: c.submitName,
|
|
21
|
+
operate: c.submitMatchType,
|
|
22
|
+
value: w(c.paramsType, c.submitValue)
|
|
23
|
+
};
|
|
24
|
+
return i.loadCode === c.submitName && (l != null && l.data.value) && (V.value = l == null ? void 0 : l.data.value), V;
|
|
25
|
+
});
|
|
26
|
+
let v = {};
|
|
27
|
+
Object.keys(d).length && (v = { ...v, ...d }), Object.keys(C).length && (v = { ...v, ...C }), T.length && (v.dynamicFilters = T), i.loadCode && Reflect.has(v, i.loadCode) && (v[i.loadCode] = l == null ? void 0 : l.data.value), console.log(v);
|
|
28
|
+
const { data: H } = await M({
|
|
29
|
+
url: a.fieldRequestUrl,
|
|
30
|
+
method: a.fieldRequestType || "GET",
|
|
31
|
+
data: v
|
|
32
|
+
}), W = (H || []).map((c) => ({ label: c[m], value: c[n], children: [], isLeaf: c[o] }));
|
|
33
|
+
p(W);
|
|
34
|
+
}, Y = (l) => {
|
|
35
|
+
if (!["input", "textarea"].includes(l)) {
|
|
36
|
+
if (["multipleSelect", "dateRange"].includes(l))
|
|
37
|
+
return [];
|
|
38
|
+
if (["switch"].includes(l))
|
|
39
|
+
return !1;
|
|
40
|
+
}
|
|
41
|
+
}, $ = (l, p) => {
|
|
42
|
+
if (typeof l == "string" && ["string"].includes(p))
|
|
43
|
+
return l.toString();
|
|
44
|
+
if (["string"].includes(p))
|
|
45
|
+
return l.sort((a, i) => a.sort - i.sort).join(";");
|
|
46
|
+
if (["number"].includes(p))
|
|
47
|
+
return Number(l);
|
|
48
|
+
if (["array"].includes(p))
|
|
49
|
+
return l.sort((a, i) => a.sort - i.sort);
|
|
50
|
+
}, z = (l, p = !1) => {
|
|
51
|
+
if (["multipleSelect"].includes(l.fieldType))
|
|
52
|
+
return f.data.rowData[l.fieldKey] ? f.data.rowData[l.fieldKey].split(";").map((i) => p ? { value: i } : i) : [];
|
|
53
|
+
if (["virtualizedMultipleSelect"].includes(l.fieldType))
|
|
54
|
+
return f.data.rowData[l.fieldKey] ? f.data.rowData[l.fieldKey].split(";") : [];
|
|
55
|
+
if (["dateRange", "provinceCascade"].includes(l.fieldType)) {
|
|
56
|
+
const i = l.fieldKey.split("&");
|
|
57
|
+
return f.data.rowData[l.fieldKey] = i.map((m) => f.data.rowData[m]), f.data.rowData[l.fieldKey];
|
|
58
|
+
}
|
|
59
|
+
let a = f.data.rowData[l.fieldKey];
|
|
60
|
+
if (["select"].includes(l.fieldType)) {
|
|
61
|
+
const i = h(l);
|
|
62
|
+
l.dataList && l.dataList.length && typeof l.dataList[0][i["value-key"] ? i["value-key"] : "value"] == "string" && a !== null && (a = p ? { value: a.toString() } : a.toString());
|
|
63
|
+
}
|
|
64
|
+
if (["virtualizedSelect"].includes(l.fieldType)) {
|
|
65
|
+
const i = h(l);
|
|
66
|
+
l.dataList && l.dataList.length && typeof l.dataList[0][i["value-key"] ? i["value-key"] : "value"] == "string" && a !== null && (a = a.toString());
|
|
67
|
+
}
|
|
68
|
+
return (a === "true" || a === "false") && (a = fe(a)), a;
|
|
69
|
+
}, he = (l) => M({ url: f.data.dataItem.requestUrl, method: "post", data: l });
|
|
70
|
+
Te(
|
|
71
|
+
() => f.visible,
|
|
72
|
+
async (l, p) => {
|
|
73
|
+
var a, i;
|
|
74
|
+
if (l)
|
|
75
|
+
try {
|
|
76
|
+
S.value = !0;
|
|
77
|
+
const m = await pe(f.data.formList, f.data.rowData, !1, !0);
|
|
78
|
+
console.log("formList", (a = f.data) == null ? void 0 : a.formList), R.value = await Promise.all(
|
|
79
|
+
(((i = f.data) == null ? void 0 : i.formList) ?? []).sort((n, g) => n.sort - g.sort).map(async (n) => {
|
|
80
|
+
const g = m.find((T) => n.fieldName == T.fieldName && n.fieldKey == T.fieldKey);
|
|
81
|
+
g && (n.dataList = (g == null ? void 0 : g.dataList) ?? []), ["select", "multipleSelect"].includes(n.fieldType) && (t.value[`${n.fieldKey}ActImplicit`] = Object.keys(f.data.rowData).length && n.isFormSetValue ? z(n, !0) : Y(n.fieldType)), t.value[n.fieldKey] = Object.keys(f.data.rowData).length && n.isFormSetValue ? z(n) : Y(n.fieldType);
|
|
82
|
+
const { isFieldCustom: o, customComponentName: d, customComponentUrl: C } = n.customFiledsComponentes;
|
|
83
|
+
if (o && !n.customFiledsComponentes[d]) {
|
|
84
|
+
const T = await ce(C, d);
|
|
85
|
+
n.customFiledsComponentes[d] = T;
|
|
86
|
+
}
|
|
87
|
+
return n;
|
|
88
|
+
})
|
|
89
|
+
), S.value = !1;
|
|
90
|
+
} catch (m) {
|
|
91
|
+
console.error(m), S.value = !1;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
const ge = (l) => {
|
|
96
|
+
B(), l();
|
|
97
|
+
}, B = () => {
|
|
98
|
+
R.value = [], E.value.resetFields(), X("update:visible", !1);
|
|
99
|
+
}, _e = (l, p) => {
|
|
100
|
+
const a = h(p), { fieldKey: i, fieldType: m } = p;
|
|
101
|
+
if (m === "multipleSelect") {
|
|
102
|
+
const n = l.filter((o) => typeof o == "string"), g = l.filter((o) => typeof o != "string").map((o) => o.value);
|
|
103
|
+
t.value[a.createFieldKey] = n.length ? $(n, "string") : void 0, t.value[i] = g.length ? $(g, "string") : void 0;
|
|
104
|
+
} else
|
|
105
|
+
typeof l == "string" ? (t.value[a.createFieldKey] = l, t.value[i] = void 0) : (t.value[i] = l.value, delete t.value[a.createFieldKey]);
|
|
106
|
+
}, ve = (l) => {
|
|
107
|
+
l && l.validate((p) => {
|
|
108
|
+
if (p) {
|
|
109
|
+
const { dataItem: a, rowData: i } = f.data;
|
|
110
|
+
let m = { ...Ke(t.value) };
|
|
111
|
+
Object.keys(m).forEach((o) => {
|
|
112
|
+
if (o.includes("ActImplicit")) {
|
|
113
|
+
delete m[o];
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const d = R.value.find((C) => C.fieldKey === o);
|
|
117
|
+
o.includes("&") ? o.split("&").forEach((T, v) => {
|
|
118
|
+
m[T] = m[o] ? $(m[o][v], d.fieldSubmitType) : m[o];
|
|
119
|
+
}) : Array.isArray(m[o]) && d.fieldSubmitType == "string" && (m[o] = $(m[o], "string"));
|
|
120
|
+
});
|
|
121
|
+
const n = a.submitFields.filter((o) => o.matchType == "default").reduce((o, d) => (d.submitFieldType === "string" && (o[d.submitFieldName] = d.matchFieldName.toString()), o), {}), g = a.submitFields.filter((o) => o.matchType == "match").reduce((o, d) => (Reflect.has(d, "submitFieldMatchOrigin") && d.submitFieldMatchOrigin === "selections" ? o[d.submitFieldName] = f.data.selections.map((C) => w(d.submitFieldType, C[d.matchFieldName])) : Reflect.has(d, "submitFieldMatchOrigin") && d.submitFieldMatchOrigin != "rowData" ? Reflect.has(x.matchData, d.submitFieldMatchOrigin) && (o[d.submitFieldName] = w(d.submitFieldType, x.matchData[d.submitFieldMatchOrigin][d.matchFieldName])) : o[d.submitFieldName] = w(d.submitFieldType, i[d.matchFieldName]), o), {});
|
|
122
|
+
he({
|
|
123
|
+
...m,
|
|
124
|
+
...n,
|
|
125
|
+
...g
|
|
126
|
+
}).then((o) => {
|
|
127
|
+
try {
|
|
128
|
+
Se({ title: b("act.tip"), message: b("act.saveSuccessfully"), type: "success", duration: 2500 }), B(), X("refresh", a);
|
|
129
|
+
} catch (d) {
|
|
130
|
+
console.error(d);
|
|
131
|
+
}
|
|
132
|
+
L.value = !1;
|
|
133
|
+
}).catch((o) => {
|
|
134
|
+
console.error(o), L.value = !1;
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}, Ve = (l) => {
|
|
139
|
+
const p = Object.keys(j.value).map((a) => {
|
|
140
|
+
var i;
|
|
141
|
+
return (i = j.value[a]) == null ? void 0 : i.updateFormData(t.value);
|
|
142
|
+
}).filter((a) => a);
|
|
143
|
+
Promise.all([l.validate(), ...p]).then((a) => {
|
|
144
|
+
a.every((i) => i) && ve(l);
|
|
145
|
+
}).catch((a) => (console.error(a), a));
|
|
146
|
+
};
|
|
147
|
+
return (l, p) => {
|
|
148
|
+
var Z;
|
|
149
|
+
const a = _("el-input"), i = _("el-option"), m = _("el-select"), n = _("el-select-v2"), g = _("el-tree-select"), o = _("el-date-picker"), d = _("el-cascader"), C = _("el-switch"), T = _("el-form-item"), v = _("el-col"), H = _("el-row"), W = _("el-form"), c = _("el-button"), V = _("el-dialog"), Fe = le("loading"), Ce = le("debounce");
|
|
150
|
+
return u(), y(V, {
|
|
151
|
+
"model-value": f.visible,
|
|
152
|
+
title: f.title,
|
|
153
|
+
top: "5vh",
|
|
154
|
+
width: (Z = P.data.formConfig) == null ? void 0 : Z.dialogWidth,
|
|
155
|
+
draggable: "",
|
|
156
|
+
overflow: "",
|
|
157
|
+
"append-to-body": "",
|
|
158
|
+
"destroy-on-close": "",
|
|
159
|
+
"close-on-click-modal": !1,
|
|
160
|
+
"before-close": ge
|
|
161
|
+
}, {
|
|
162
|
+
footer: D(() => [
|
|
163
|
+
ae("span", Re, [
|
|
164
|
+
te(c, {
|
|
165
|
+
loading: L.value,
|
|
166
|
+
onClick: B
|
|
167
|
+
}, {
|
|
168
|
+
default: D(() => [
|
|
169
|
+
J(A(r(b)("act.cancel")), 1)
|
|
170
|
+
]),
|
|
171
|
+
_: 1
|
|
172
|
+
}, 8, ["loading"]),
|
|
173
|
+
oe((u(), y(c, {
|
|
174
|
+
type: "primary",
|
|
175
|
+
loading: L.value,
|
|
176
|
+
onClick: p[1] || (p[1] = (G) => Ve(E.value))
|
|
177
|
+
}, {
|
|
178
|
+
default: D(() => [
|
|
179
|
+
J(A(r(b)("act.save")), 1)
|
|
180
|
+
]),
|
|
181
|
+
_: 1
|
|
182
|
+
}, 8, ["loading"])), [
|
|
183
|
+
[Ce]
|
|
184
|
+
])
|
|
185
|
+
])
|
|
186
|
+
]),
|
|
187
|
+
default: D(() => {
|
|
188
|
+
var G, I;
|
|
189
|
+
return [
|
|
190
|
+
oe((u(), y(W, {
|
|
191
|
+
class: "a-form",
|
|
192
|
+
ref_key: "formRef",
|
|
193
|
+
ref: E,
|
|
194
|
+
model: t.value,
|
|
195
|
+
"label-suffix": ":",
|
|
196
|
+
"label-width": (G = P.data.formConfig) == null ? void 0 : G.formLabelWidth,
|
|
197
|
+
"label-position": (I = P.data.formConfig) == null ? void 0 : I.formLabelPosition
|
|
198
|
+
}, {
|
|
199
|
+
default: D(() => [
|
|
200
|
+
te(H, { gutter: 40 }, {
|
|
201
|
+
default: D(() => [
|
|
202
|
+
(u(!0), k(q, null, Q(R.value, (e, ee) => (u(), y(v, {
|
|
203
|
+
span: me(e),
|
|
204
|
+
key: ee
|
|
205
|
+
}, {
|
|
206
|
+
default: D(() => [
|
|
207
|
+
e.customFiledsComponentes.isFieldCustom ? (u(), k(q, { key: 1 }, [
|
|
208
|
+
e.customFiledsComponentes[e.customFiledsComponentes.customComponentName] ? (u(), y(De(e.customFiledsComponentes[e.customFiledsComponentes.customComponentName]), {
|
|
209
|
+
key: 0,
|
|
210
|
+
ref_for: !0,
|
|
211
|
+
ref: (s) => j.value[e.customFiledsComponentes.customComponentName] = s,
|
|
212
|
+
formConfig: P.data.formConfig,
|
|
213
|
+
item: e,
|
|
214
|
+
rowData: f.data.rowData,
|
|
215
|
+
visible: f.visible,
|
|
216
|
+
form: t.value,
|
|
217
|
+
"onUpdate:form": p[0] || (p[0] = (s) => t.value = s)
|
|
218
|
+
}, null, 40, ["formConfig", "item", "rowData", "visible", "form"])) : (u(), k("div", {
|
|
219
|
+
class: "no-config",
|
|
220
|
+
key: ee
|
|
221
|
+
}, [
|
|
222
|
+
ae("span", Le, "【" + A(e.fieldName) + "】", 1),
|
|
223
|
+
J(A(r(b)("act.fieldCustom")), 1)
|
|
224
|
+
]))
|
|
225
|
+
], 64)) : (u(), y(T, {
|
|
226
|
+
key: 0,
|
|
227
|
+
label: e.fieldName,
|
|
228
|
+
prop: ["select", "multipleSelect"].includes(e.fieldType) ? `${e.fieldKey}ActImplicit` : e.fieldKey,
|
|
229
|
+
rules: [{ required: e.isFormFieldRequired, message: r(b)("act.requiredMessage"), trigger: ye(e) }]
|
|
230
|
+
}, {
|
|
231
|
+
default: D(() => [
|
|
232
|
+
e.fieldType === "input" ? (u(), y(a, F({
|
|
233
|
+
key: 0,
|
|
234
|
+
modelValue: t.value[e.fieldKey],
|
|
235
|
+
"onUpdate:modelValue": (s) => t.value[e.fieldKey] = s,
|
|
236
|
+
placeholder: `${r(b)("act.inputPlaceholder")}${e.fieldName}`,
|
|
237
|
+
clearable: "",
|
|
238
|
+
ref_for: !0
|
|
239
|
+
}, r(h)(e), {
|
|
240
|
+
disabled: e.isFormDisabled
|
|
241
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : se("", !0),
|
|
242
|
+
e.fieldType === "inputNumber" ? (u(), y(r(re), F({
|
|
243
|
+
key: 1,
|
|
244
|
+
modelValue: t.value[e.fieldKey],
|
|
245
|
+
"onUpdate:modelValue": (s) => t.value[e.fieldKey] = s,
|
|
246
|
+
placeholder: `${r(b)("act.inputPlaceholder")}${e.fieldName}`,
|
|
247
|
+
clearable: "",
|
|
248
|
+
ref_for: !0
|
|
249
|
+
}, r(h)(e), {
|
|
250
|
+
disabled: e.isFormDisabled
|
|
251
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.fieldType === "textarea" ? (u(), y(a, F({
|
|
252
|
+
key: 2,
|
|
253
|
+
modelValue: t.value[e.fieldKey],
|
|
254
|
+
"onUpdate:modelValue": (s) => t.value[e.fieldKey] = s,
|
|
255
|
+
placeholder: `${r(b)("act.inputPlaceholder")}${e.fieldName}`,
|
|
256
|
+
rows: 4,
|
|
257
|
+
ref_for: !0
|
|
258
|
+
}, r(h)(e), {
|
|
259
|
+
type: "textarea",
|
|
260
|
+
disabled: e.isFormDisabled
|
|
261
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.fieldType === "selectIcon" ? (u(), y(r(de), F({
|
|
262
|
+
key: 3,
|
|
263
|
+
modelValue: t.value[e.fieldKey],
|
|
264
|
+
"onUpdate:modelValue": (s) => t.value[e.fieldKey] = s,
|
|
265
|
+
icons: e.dataList,
|
|
266
|
+
placeholder: `${r(b)("act.selectPlaceholder")}${e.fieldName}`,
|
|
267
|
+
ref_for: !0
|
|
268
|
+
}, r(h)(e), {
|
|
269
|
+
disabled: e.isFormDisabled
|
|
270
|
+
}), {
|
|
271
|
+
default: D(() => [
|
|
272
|
+
(u(!0), k(q, null, Q(e.dataList, (s, U) => (u(), y(i, {
|
|
273
|
+
key: U,
|
|
274
|
+
label: s.key,
|
|
275
|
+
value: s.value
|
|
276
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
277
|
+
]),
|
|
278
|
+
_: 2
|
|
279
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "icons", "placeholder", "disabled"])) : ["select", "multipleSelect"].includes(e.fieldType) ? (u(), y(m, F({
|
|
280
|
+
key: 4,
|
|
281
|
+
modelValue: t.value[`${e.fieldKey}ActImplicit`],
|
|
282
|
+
"onUpdate:modelValue": (s) => t.value[`${e.fieldKey}ActImplicit`] = s,
|
|
283
|
+
placeholder: `${r(b)("act.selectPlaceholder")}${e.fieldName}`,
|
|
284
|
+
clearable: "",
|
|
285
|
+
filterable: "",
|
|
286
|
+
"value-key": "value",
|
|
287
|
+
ref_for: !0
|
|
288
|
+
}, r(h)(e), {
|
|
289
|
+
multiple: e.fieldType === "multipleSelect",
|
|
290
|
+
disabled: e.isFormDisabled,
|
|
291
|
+
onChange: (s) => _e(s, e)
|
|
292
|
+
}), {
|
|
293
|
+
default: D(() => [
|
|
294
|
+
(u(!0), k(q, null, Q(e.dataList, (s, U) => (u(), y(i, {
|
|
295
|
+
key: U,
|
|
296
|
+
label: s.key,
|
|
297
|
+
value: s
|
|
298
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
299
|
+
]),
|
|
300
|
+
_: 2
|
|
301
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "disabled", "onChange"])) : ["virtualizedSelect", "virtualizedMultipleSelect"].includes(e.fieldType) ? (u(), y(n, F({
|
|
302
|
+
key: 5,
|
|
303
|
+
modelValue: t.value[e.fieldKey],
|
|
304
|
+
"onUpdate:modelValue": (s) => t.value[e.fieldKey] = s,
|
|
305
|
+
options: e.dataList,
|
|
306
|
+
props: { ...r(Pe) },
|
|
307
|
+
placeholder: `${r(b)("act.selectPlaceholder")}${e.fieldName}`,
|
|
308
|
+
clearable: "",
|
|
309
|
+
filterable: "",
|
|
310
|
+
ref_for: !0
|
|
311
|
+
}, r(h)(e), {
|
|
312
|
+
disabled: e.isFormDisabled,
|
|
313
|
+
multiple: e.fieldType === "virtualizedMultipleSelect"
|
|
314
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "options", "props", "placeholder", "disabled", "multiple"])) : e.fieldType === "treeSelect" ? (u(), y(g, F({
|
|
315
|
+
key: 6,
|
|
316
|
+
modelValue: t.value[e.fieldKey],
|
|
317
|
+
"onUpdate:modelValue": (s) => t.value[e.fieldKey] = s,
|
|
318
|
+
placeholder: `请选择${e.fieldName}`,
|
|
319
|
+
props: { isLeaf: "isLeaf" },
|
|
320
|
+
"render-after-expand": !1,
|
|
321
|
+
"collapse-tags": "",
|
|
322
|
+
"collapse-tags-tooltip": "",
|
|
323
|
+
multiple: "",
|
|
324
|
+
"show-checkbox": "",
|
|
325
|
+
clearable: "",
|
|
326
|
+
filterable: "",
|
|
327
|
+
lazy: "",
|
|
328
|
+
load: (s, U) => be({ node: s, resolve: U }, e),
|
|
329
|
+
ref_for: !0
|
|
330
|
+
}, r(h)(e)), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "load"])) : e.fieldType === "date" ? (u(), y(o, F({
|
|
331
|
+
key: 7,
|
|
332
|
+
modelValue: t.value[e.fieldKey],
|
|
333
|
+
"onUpdate:modelValue": (s) => t.value[e.fieldKey] = s,
|
|
334
|
+
type: "date",
|
|
335
|
+
placeholder: `${r(b)("act.selectPlaceholder")}${r(b)("act.time")}`,
|
|
336
|
+
"value-format": "YYYY-MM-DD HH:mm:ss",
|
|
337
|
+
ref_for: !0
|
|
338
|
+
}, r(h)(e), {
|
|
339
|
+
disabled: e.isFormDisabled
|
|
340
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.fieldType === "dateRange" ? (u(), y(o, F({
|
|
341
|
+
key: 8,
|
|
342
|
+
modelValue: t.value[e.fieldKey],
|
|
343
|
+
"onUpdate:modelValue": (s) => t.value[e.fieldKey] = s,
|
|
344
|
+
type: "daterange",
|
|
345
|
+
"start-placeholder": r(b)("act.startTime"),
|
|
346
|
+
"end-placeholder": r(b)("act.endTime"),
|
|
347
|
+
"value-format": "YYYY-MM-DD HH:mm:ss",
|
|
348
|
+
ref_for: !0
|
|
349
|
+
}, r(h)(e), {
|
|
350
|
+
disabled: e.isFormDisabled
|
|
351
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "start-placeholder", "end-placeholder", "disabled"])) : e.fieldType === "provinceCascade" ? (u(), y(d, F({
|
|
352
|
+
key: 9,
|
|
353
|
+
modelValue: t.value[e.fieldKey],
|
|
354
|
+
"onUpdate:modelValue": (s) => t.value[e.fieldKey] = s,
|
|
355
|
+
options: e.dataList,
|
|
356
|
+
props: r(Ue),
|
|
357
|
+
clearable: "",
|
|
358
|
+
filterable: "",
|
|
359
|
+
placeholder: `${r(b)("act.selectPlaceholder")}${e.fieldName}`,
|
|
360
|
+
ref_for: !0
|
|
361
|
+
}, r(h)(e), {
|
|
362
|
+
disabled: e.isFormDisabled
|
|
363
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "options", "props", "placeholder", "disabled"])) : e.fieldType === "switch" ? (u(), y(C, {
|
|
364
|
+
key: 10,
|
|
365
|
+
modelValue: t.value[e.fieldKey],
|
|
366
|
+
"onUpdate:modelValue": (s) => t.value[e.fieldKey] = s,
|
|
367
|
+
"active-value": !0,
|
|
368
|
+
"inactive-value": !1
|
|
369
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : e.fieldType === "upload" ? (u(), y(r(ne), F({
|
|
370
|
+
key: 11,
|
|
371
|
+
class: "form-upload",
|
|
372
|
+
modelValue: t.value[e.fieldKey],
|
|
373
|
+
"onUpdate:modelValue": (s) => t.value[e.fieldKey] = s,
|
|
374
|
+
request: r(M),
|
|
375
|
+
ref_for: !0
|
|
376
|
+
}, r(h)(e)), null, 16, ["modelValue", "onUpdate:modelValue", "request"])) : e.fieldType === "editor" ? (u(), y(r(ue), F({
|
|
377
|
+
key: 12,
|
|
378
|
+
modelValue: t.value[e.fieldKey],
|
|
379
|
+
"onUpdate:modelValue": (s) => t.value[e.fieldKey] = s,
|
|
380
|
+
disabled: e.isFormDisabled,
|
|
381
|
+
placeholder: `${r(b)("act.inputPlaceholder")}${e.fieldName}`,
|
|
382
|
+
ref_for: !0
|
|
383
|
+
}, r(h)(e)), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : se("", !0)
|
|
384
|
+
]),
|
|
385
|
+
_: 2
|
|
386
|
+
}, 1032, ["label", "prop", "rules"]))
|
|
387
|
+
]),
|
|
388
|
+
_: 2
|
|
389
|
+
}, 1032, ["span"]))), 128))
|
|
390
|
+
]),
|
|
391
|
+
_: 1
|
|
392
|
+
})
|
|
393
|
+
]),
|
|
394
|
+
_: 1
|
|
395
|
+
}, 8, ["model", "label-width", "label-position"])), [
|
|
396
|
+
[Fe, S.value]
|
|
397
|
+
])
|
|
398
|
+
];
|
|
399
|
+
}),
|
|
400
|
+
_: 1
|
|
401
|
+
}, 8, ["model-value", "title", "width"]);
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
}, xe = /* @__PURE__ */ we($e, [["__scopeId", "data-v-c6e7e23b"]]);
|
|
405
|
+
export {
|
|
406
|
+
xe as default
|
|
407
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { ref as N, watch as O, resolveComponent as u, resolveDirective as T, openBlock as l, createElementBlock as d, withDirectives as j, createBlock as i, mergeProps as D, withCtx as c, createTextVNode as K, toDisplayString as W, unref as f, Fragment as s, renderList as A, renderSlot as y, createCommentVNode as E, nextTick as w } from "vue";
|
|
2
|
+
import { _ as H, u as U } from "./index-c7522ec4.js";
|
|
3
|
+
import "vue-router";
|
|
4
|
+
import "element-plus";
|
|
5
|
+
const V = { class: "act-table" }, $ = {
|
|
6
|
+
__name: "index",
|
|
7
|
+
props: {
|
|
8
|
+
loading: { type: Boolean, default: !1 },
|
|
9
|
+
maxHeight: { type: Number, default: 600 },
|
|
10
|
+
total: { type: Number, default: 0 },
|
|
11
|
+
tableQuery: { type: Object, default: () => ({ pageIndex: 1, pageSize: 10 }) },
|
|
12
|
+
selection: { type: Array, default: () => [] },
|
|
13
|
+
headers: { type: Array, default: () => [] },
|
|
14
|
+
data: { type: Array, default: () => [] },
|
|
15
|
+
showSerialNumber: { type: Boolean, default: !0 },
|
|
16
|
+
showPagination: { type: Boolean, default: !0 },
|
|
17
|
+
rowKey: { type: String, default: "id" },
|
|
18
|
+
treeProps: { type: Object, default: () => ({ children: "children", hasChildren: "hasChildren" }) },
|
|
19
|
+
tableConfig: { type: Object, default: () => ({}) }
|
|
20
|
+
},
|
|
21
|
+
emits: ["update:tableQuery", "update:selection", "refresh", "onRowClick"],
|
|
22
|
+
setup(g, { expose: b, emit: x }) {
|
|
23
|
+
const { t: h } = U(), r = x, t = g;
|
|
24
|
+
let p = N(null);
|
|
25
|
+
const _ = (o) => t.showPagination ? o + 1 + (t.tableQuery.pageIndex - 1) * t.tableQuery.pageSize : o + 1, k = (o) => {
|
|
26
|
+
w(() => {
|
|
27
|
+
t.data.forEach((a) => {
|
|
28
|
+
o.includes(a[t.rowKey]) && p.value.toggleRowSelection(a, !0);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}, C = (o) => p.value.getSelectionRows();
|
|
32
|
+
O(
|
|
33
|
+
() => t.selection,
|
|
34
|
+
(o, a) => {
|
|
35
|
+
o && o.length && k(o);
|
|
36
|
+
},
|
|
37
|
+
{ deep: !0, immediate: !0 }
|
|
38
|
+
);
|
|
39
|
+
const S = (o) => {
|
|
40
|
+
r("update:selection", o);
|
|
41
|
+
}, m = (o, a) => {
|
|
42
|
+
o && w(() => {
|
|
43
|
+
t.data.forEach((n) => {
|
|
44
|
+
o.includes(n[a || t.rowKey]) && p.value.toggleRowSelection(n, !0);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}, v = (o) => {
|
|
48
|
+
r("update:tableQuery", { ...t.tableQuery, pageSize: o }), r("refresh", []);
|
|
49
|
+
}, z = (o) => {
|
|
50
|
+
r("update:tableQuery", { ...t.tableQuery, pageIndex: o }), r("refresh", []);
|
|
51
|
+
}, Q = (o, a, n) => {
|
|
52
|
+
r("onRowClick", o, a, n);
|
|
53
|
+
};
|
|
54
|
+
return b({ getSelectionRows: C, updateSelection: m }), (o, a) => {
|
|
55
|
+
const n = u("el-table-column"), R = u("el-table"), I = u("el-pagination"), P = T("loading");
|
|
56
|
+
return l(), d("div", V, [
|
|
57
|
+
j((l(), i(R, D({
|
|
58
|
+
style: { width: "100%" },
|
|
59
|
+
ref_key: "tableRef",
|
|
60
|
+
ref: p,
|
|
61
|
+
data: t.data,
|
|
62
|
+
stripe: "",
|
|
63
|
+
border: "",
|
|
64
|
+
"highlight-current-row": "",
|
|
65
|
+
"max-height": t.maxHeight,
|
|
66
|
+
"row-key": t.rowKey,
|
|
67
|
+
"default-expand-all": "",
|
|
68
|
+
"tree-props": g.treeProps
|
|
69
|
+
}, t.tableConfig, {
|
|
70
|
+
onSelectionChange: S,
|
|
71
|
+
onRowClick: Q
|
|
72
|
+
}), {
|
|
73
|
+
empty: c(() => [
|
|
74
|
+
K(W(t.data.length || t.data.length == 0 ? f(h)("act.noData") : ""), 1)
|
|
75
|
+
]),
|
|
76
|
+
default: c(() => [
|
|
77
|
+
(l(!0), d(s, null, A(t.headers, (e) => (l(), d(s, { key: e }, [
|
|
78
|
+
e.isCustomTableHeader ? y(o.$slots, e.prop, { key: 0 }, void 0, !0) : (l(), d(s, { key: 1 }, [
|
|
79
|
+
e.render ? (l(), i(n, {
|
|
80
|
+
key: 0,
|
|
81
|
+
label: e.label,
|
|
82
|
+
align: e.align,
|
|
83
|
+
width: e.width,
|
|
84
|
+
minWidth: e.minWidth,
|
|
85
|
+
sortable: e.sort,
|
|
86
|
+
"show-overflow-tooltip": e.prop == "operate" ? !1 : e.showOverflowTooltip,
|
|
87
|
+
fixed: e.fixed
|
|
88
|
+
}, {
|
|
89
|
+
default: c((B) => [
|
|
90
|
+
y(o.$slots, e.prop, { scope: B }, void 0, !0)
|
|
91
|
+
]),
|
|
92
|
+
_: 2
|
|
93
|
+
}, 1032, ["label", "align", "width", "minWidth", "sortable", "show-overflow-tooltip", "fixed"])) : (l(), d(s, { key: 1 }, [
|
|
94
|
+
e.prop == "checkbox" ? (l(), i(n, {
|
|
95
|
+
key: 0,
|
|
96
|
+
type: "selection",
|
|
97
|
+
align: "center",
|
|
98
|
+
width: e.width,
|
|
99
|
+
fixed: ""
|
|
100
|
+
}, null, 8, ["width"])) : e.prop == "serialNumber" ? (l(), i(n, {
|
|
101
|
+
key: 1,
|
|
102
|
+
index: _,
|
|
103
|
+
type: "index",
|
|
104
|
+
align: "center",
|
|
105
|
+
width: e.width,
|
|
106
|
+
label: f(h)("act.sort"),
|
|
107
|
+
fixed: ""
|
|
108
|
+
}, null, 8, ["width", "label"])) : (l(), i(n, {
|
|
109
|
+
key: 2,
|
|
110
|
+
prop: e.prop,
|
|
111
|
+
label: e.label,
|
|
112
|
+
align: e.align,
|
|
113
|
+
sortable: e.sort,
|
|
114
|
+
"show-overflow-tooltip": e.showOverflowTooltip,
|
|
115
|
+
width: e.width,
|
|
116
|
+
"min-width": e.minWidth,
|
|
117
|
+
fixed: e.fixed
|
|
118
|
+
}, null, 8, ["prop", "label", "align", "sortable", "show-overflow-tooltip", "width", "min-width", "fixed"]))
|
|
119
|
+
], 64))
|
|
120
|
+
], 64))
|
|
121
|
+
], 64))), 128))
|
|
122
|
+
]),
|
|
123
|
+
_: 3
|
|
124
|
+
}, 16, ["data", "max-height", "row-key", "tree-props"])), [
|
|
125
|
+
[P, t.loading]
|
|
126
|
+
]),
|
|
127
|
+
t.showPagination ? (l(), i(I, {
|
|
128
|
+
key: 0,
|
|
129
|
+
class: "table-pagination",
|
|
130
|
+
"current-page": t.tableQuery.pageIndex,
|
|
131
|
+
"onUpdate:currentPage": a[0] || (a[0] = (e) => t.tableQuery.pageIndex = e),
|
|
132
|
+
"page-size": t.tableQuery.pageSize,
|
|
133
|
+
"onUpdate:pageSize": a[1] || (a[1] = (e) => t.tableQuery.pageSize = e),
|
|
134
|
+
"page-sizes": [10, 20, 50, 75, 100, 200, 500],
|
|
135
|
+
background: "",
|
|
136
|
+
layout: "total, sizes, prev, pager, next, jumper",
|
|
137
|
+
total: t.total,
|
|
138
|
+
onSizeChange: v,
|
|
139
|
+
onCurrentChange: z
|
|
140
|
+
}, null, 8, ["current-page", "page-size", "total"])) : E("", !0)
|
|
141
|
+
]);
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
}, G = /* @__PURE__ */ H($, [["__scopeId", "data-v-651542d6"]]);
|
|
145
|
+
export {
|
|
146
|
+
G as default
|
|
147
|
+
};
|