act-plus 1.1.33 → 1.1.35
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 +1 -1
- package/act-plus.umd.cjs +62 -62
- package/lib/{configBtns-ed29fe0b.js → configBtns-b466947f.js} +45 -42
- package/lib/{configFileds-699ace4a.js → configFileds-f0231b08.js} +3 -3
- package/lib/{configForm-2212ebfa.js → configForm-e3af844f.js} +1 -1
- package/lib/{configTable-90bfcea3.js → configTable-3ed8b3cd.js} +2 -2
- package/lib/{dialogAddField-83ad1dc8.js → dialogAddField-17e1aa96.js} +181 -147
- package/lib/{dialogConfigBtn-b63efb63.js → dialogConfigBtn-666a5a33.js} +50 -49
- package/lib/{dialogSiteComponentsParams-9ce01f01.js → dialogSiteComponentsParams-9831d8a6.js} +1 -1
- package/lib/{enum-ab7125f9.js → enum-95788c42.js} +14 -13
- package/lib/{index-279c9602.js → index-49f864eb.js} +1 -1
- package/lib/{index-c98ba0e6.js → index-71efc775.js} +24 -20
- package/lib/index-75b07771.js +326 -0
- package/lib/{index-76e96bb6.js → index-adf3ff12.js} +12994 -12990
- package/lib/index-b0157be1.js +105 -0
- package/lib/{index-71a7d469.js → index-b7ef2e32.js} +76 -76
- package/package.json +1 -1
- package/style.css +1 -1
- package/lib/index-753a8734.js +0 -307
- package/lib/index-bd619054.js +0 -92
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import { defineAsyncComponent as K, inject as g, reactive as ye, ref as R, watch as be, resolveComponent as m, resolveDirective as _e, openBlock as d, createBlock as i, withCtx as h, createElementVNode as W, createVNode as x, unref as l, createTextVNode as A, toDisplayString as N, withDirectives as he, createElementBlock as D, Fragment as U, renderList as M, mergeProps as b, createCommentVNode as G, resolveDynamicComponent as Ve, isRef as ge, toRaw as Fe } from "vue";
|
|
2
|
+
import { _ as Ce, u as De, P as Te, a as Ke } from "./index-adf3ff12.js";
|
|
3
|
+
import { ElNotification as Ne } from "element-plus";
|
|
4
|
+
import "vue-router";
|
|
5
|
+
import "js-base64";
|
|
6
|
+
import "monaco-editor";
|
|
7
|
+
const Ue = { class: "no-config-field" }, we = { class: "dialog-footer" }, ke = {
|
|
8
|
+
__name: "index",
|
|
9
|
+
props: {
|
|
10
|
+
visible: { type: Boolean, default: !1 },
|
|
11
|
+
title: { type: String, default: "" },
|
|
12
|
+
data: { type: Object, default: () => ({}) }
|
|
13
|
+
},
|
|
14
|
+
emits: ["update:visible", "refresh"],
|
|
15
|
+
setup(T, { emit: J }) {
|
|
16
|
+
const Q = K(() => import("./index-adf3ff12.js").then((o) => o.f)), X = K(() => import("./index-b0157be1.js")), Z = K(() => import("./index-adf3ff12.js").then((o) => o.e)), I = K(() => import("./index-adf3ff12.js").then((o) => o.d)), { t: c } = De(), E = g("request"), ee = g("loadComponents"), O = g("formatDataType"), q = g("globalProps"), le = g("stringToBoolean"), y = g("getFieldUiProps"), Y = J, f = T;
|
|
17
|
+
let F = ye((() => ({
|
|
18
|
+
btnLoading: !1
|
|
19
|
+
}))()), w = R([]), t = R({}), k = R(null), oe = {};
|
|
20
|
+
const ae = (o) => o.formColumnCol == null || o.customFiledsComponentes[o.customFiledsComponentes.customComponentName] ? 24 : o.formColumnCol ? o.formColumnCol : 24 / o.formRow, te = (o) => {
|
|
21
|
+
if (["input", "textarea"].includes(o.fieldType))
|
|
22
|
+
return "blur";
|
|
23
|
+
if (["select", "multipleSelect", "datetimerange", "treeSelect", "provinceCascade"].includes(o.fieldType))
|
|
24
|
+
return "change";
|
|
25
|
+
}, de = (o) => {
|
|
26
|
+
if (!["input", "textarea"].includes(o) && ["multipleSelect", "dateRange"].includes(o))
|
|
27
|
+
return [];
|
|
28
|
+
}, re = (o, u) => {
|
|
29
|
+
if (["string"].includes(u))
|
|
30
|
+
return o.join(";");
|
|
31
|
+
if (["number"].includes(u))
|
|
32
|
+
return Number(o);
|
|
33
|
+
if (["array"].includes(u))
|
|
34
|
+
return o;
|
|
35
|
+
}, se = (o) => {
|
|
36
|
+
if (["multipleSelect"].includes(o.fieldType))
|
|
37
|
+
return f.data.rowData[o.fieldKey] ? f.data.rowData[o.fieldKey].split(";") : [];
|
|
38
|
+
if (["dateRange"].includes(o.fieldType)) {
|
|
39
|
+
const s = o.fieldKey.split("&");
|
|
40
|
+
return f.data.rowData[o.fieldKey] = s.map((_) => f.data.rowData[_]), f.data.rowData[o.fieldKey];
|
|
41
|
+
}
|
|
42
|
+
const u = f.data.rowData[o.fieldKey];
|
|
43
|
+
return u === "true" || u === "false" ? le(u) : u;
|
|
44
|
+
}, ne = (o) => E({ url: f.data.dataItem.requestUrl, method: "post", data: o });
|
|
45
|
+
be(
|
|
46
|
+
() => f.visible,
|
|
47
|
+
async (o, u) => {
|
|
48
|
+
o && (f.data.formList.sort((s, _) => s.sort - _.sort).forEach(async (s) => {
|
|
49
|
+
oe[s.fieldKey] = { submitFieldType: s.fieldSubmitType, isFormSetValue: s.isFormSetValue }, t.value[s.fieldKey] = Object.keys(f.data.rowData).length && s.isFormSetValue ? se(s) : de(s.fieldType);
|
|
50
|
+
const { isFiledCustom: _, customComponentName: p, customComponentUrl: C } = s.customFiledsComponentes;
|
|
51
|
+
if (_ && !s.customFiledsComponentes[p]) {
|
|
52
|
+
const V = await ee(C, p);
|
|
53
|
+
s.customFiledsComponentes[p] = V;
|
|
54
|
+
}
|
|
55
|
+
}), w.value = f.data.formList || []);
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
const ie = (o) => {
|
|
59
|
+
v(), o();
|
|
60
|
+
}, v = () => {
|
|
61
|
+
w.value = [], k.value.resetFields(), Y("update:visible", !1);
|
|
62
|
+
}, ce = (o) => {
|
|
63
|
+
o && o.validate((u) => {
|
|
64
|
+
if (u) {
|
|
65
|
+
F.btnLoading = !0;
|
|
66
|
+
const { dataItem: s, rowData: _ } = f.data;
|
|
67
|
+
let p = { ...Fe(t.value) };
|
|
68
|
+
Object.keys(p).forEach((r) => {
|
|
69
|
+
r.includes("&") ? p[r].split("&").forEach((P, S) => {
|
|
70
|
+
p[P] = p[r][S];
|
|
71
|
+
}) : Array.isArray(p[r]) && (p[r] = re(p[r], "string"));
|
|
72
|
+
});
|
|
73
|
+
const C = s.submitFields.filter((r) => r.matchType == "default").reduce((r, n) => (n.submitFieldType === "string" && (r[n.submitFieldName] = n.matchFieldName.toString()), r), {}), V = s.submitFields.filter((r) => r.matchType == "match").reduce((r, n) => (Reflect.has(n, "submitFieldMatchOrigin") && n.submitFieldMatchOrigin != "rowData" ? Reflect.has(q.matchData, n.submitFieldMatchOrigin) && (r[n.submitFieldName] = O(n.submitFieldType, q.matchData[n.submitFieldMatchOrigin][n.matchFieldName])) : r[n.submitFieldName] = O(n.submitFieldType, _[n.matchFieldName]), r), {});
|
|
74
|
+
ne({
|
|
75
|
+
...p,
|
|
76
|
+
...C,
|
|
77
|
+
...V
|
|
78
|
+
}).then((r) => {
|
|
79
|
+
try {
|
|
80
|
+
Ne({ title: c("act.tip"), message: c("act.saveSuccessfully"), type: "success", duration: 2500 }), v(), Y("refresh");
|
|
81
|
+
} catch (n) {
|
|
82
|
+
console.error(n);
|
|
83
|
+
}
|
|
84
|
+
F.btnLoading = !1;
|
|
85
|
+
}).catch((r) => {
|
|
86
|
+
console.error(r), F.btnLoading = !1;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
return (o, u) => {
|
|
92
|
+
var j;
|
|
93
|
+
const s = m("el-input"), _ = m("el-option"), p = m("el-select"), C = m("el-select-v2"), V = m("el-date-picker"), r = m("el-cascader"), n = m("el-switch"), P = m("el-form-item"), S = m("el-col"), ue = m("el-row"), fe = m("el-form"), B = m("el-button"), pe = m("el-dialog"), me = _e("debounce");
|
|
94
|
+
return d(), i(pe, {
|
|
95
|
+
"model-value": f.visible,
|
|
96
|
+
title: f.title,
|
|
97
|
+
top: "5vh",
|
|
98
|
+
width: (j = T.data.formConfig) == null ? void 0 : j.dialogWidth,
|
|
99
|
+
draggable: "",
|
|
100
|
+
overflow: "",
|
|
101
|
+
"append-to-body": "",
|
|
102
|
+
"destroy-on-close": "",
|
|
103
|
+
"close-on-click-modal": !1,
|
|
104
|
+
"before-close": ie
|
|
105
|
+
}, {
|
|
106
|
+
footer: h(() => [
|
|
107
|
+
W("span", we, [
|
|
108
|
+
x(B, {
|
|
109
|
+
loading: l(F).btnLoading,
|
|
110
|
+
onClick: v
|
|
111
|
+
}, {
|
|
112
|
+
default: h(() => [
|
|
113
|
+
A(N(l(c)("act.cancel")), 1)
|
|
114
|
+
]),
|
|
115
|
+
_: 1
|
|
116
|
+
}, 8, ["loading"]),
|
|
117
|
+
he((d(), i(B, {
|
|
118
|
+
type: "primary",
|
|
119
|
+
loading: l(F).btnLoading,
|
|
120
|
+
onClick: u[1] || (u[1] = (L) => ce(l(k)))
|
|
121
|
+
}, {
|
|
122
|
+
default: h(() => [
|
|
123
|
+
A(N(l(c)("act.save")), 1)
|
|
124
|
+
]),
|
|
125
|
+
_: 1
|
|
126
|
+
}, 8, ["loading"])), [
|
|
127
|
+
[me]
|
|
128
|
+
])
|
|
129
|
+
])
|
|
130
|
+
]),
|
|
131
|
+
default: h(() => {
|
|
132
|
+
var L, H;
|
|
133
|
+
return [
|
|
134
|
+
x(fe, {
|
|
135
|
+
ref_key: "formRef",
|
|
136
|
+
ref: k,
|
|
137
|
+
model: l(t),
|
|
138
|
+
"label-suffix": ":",
|
|
139
|
+
"label-width": (L = T.data.formConfig) == null ? void 0 : L.formLabelWidth,
|
|
140
|
+
"label-position": (H = T.data.formConfig) == null ? void 0 : H.formLabelPosition
|
|
141
|
+
}, {
|
|
142
|
+
default: h(() => [
|
|
143
|
+
x(ue, { gutter: 40 }, {
|
|
144
|
+
default: h(() => [
|
|
145
|
+
(d(!0), D(U, null, M(l(w), (e, z) => (d(), i(S, {
|
|
146
|
+
span: ae(e),
|
|
147
|
+
key: z
|
|
148
|
+
}, {
|
|
149
|
+
default: h(() => [
|
|
150
|
+
e.customFiledsComponentes.isFiledCustom ? (d(), D(U, { key: 1 }, [
|
|
151
|
+
e.customFiledsComponentes[e.customFiledsComponentes.customComponentName] ? (d(), i(Ve(e.customFiledsComponentes[e.customFiledsComponentes.customComponentName]), {
|
|
152
|
+
key: 0,
|
|
153
|
+
fieldCofnigItem: e,
|
|
154
|
+
rowData: f.data.rowData,
|
|
155
|
+
form: l(t),
|
|
156
|
+
"onUpdate:form": u[0] || (u[0] = (a) => ge(t) ? t.value = a : t = a)
|
|
157
|
+
}, null, 40, ["fieldCofnigItem", "rowData", "form"])) : (d(), D("div", {
|
|
158
|
+
class: "no-config",
|
|
159
|
+
key: z
|
|
160
|
+
}, [
|
|
161
|
+
W("span", Ue, "【" + N(e.fieldName) + "】", 1),
|
|
162
|
+
A(N(l(c)("act.fieldCustom")), 1)
|
|
163
|
+
]))
|
|
164
|
+
], 64)) : (d(), i(P, {
|
|
165
|
+
key: 0,
|
|
166
|
+
label: e.fieldName,
|
|
167
|
+
prop: e.fieldKey,
|
|
168
|
+
rules: [{ required: e.isFormFieldRequired, message: l(c)("act.requiredMessage"), trigger: te(e) }]
|
|
169
|
+
}, {
|
|
170
|
+
default: h(() => [
|
|
171
|
+
e.fieldType === "input" ? (d(), i(s, b({
|
|
172
|
+
key: 0,
|
|
173
|
+
modelValue: l(t)[e.fieldKey],
|
|
174
|
+
"onUpdate:modelValue": (a) => l(t)[e.fieldKey] = a,
|
|
175
|
+
placeholder: `${l(c)("act.inputPlaceholder")}${e.fieldName}`,
|
|
176
|
+
clearable: "",
|
|
177
|
+
ref_for: !0
|
|
178
|
+
}, l(y)(e), {
|
|
179
|
+
disabled: e.isFormDisabled
|
|
180
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : G("", !0),
|
|
181
|
+
e.fieldType === "inputNumber" ? (d(), i(l(Q), b({
|
|
182
|
+
key: 1,
|
|
183
|
+
modelValue: l(t)[e.fieldKey],
|
|
184
|
+
"onUpdate:modelValue": (a) => l(t)[e.fieldKey] = a,
|
|
185
|
+
placeholder: `${l(c)("act.inputPlaceholder")}${e.fieldName}`,
|
|
186
|
+
clearable: "",
|
|
187
|
+
ref_for: !0
|
|
188
|
+
}, l(y)(e), {
|
|
189
|
+
disabled: e.isFormDisabled
|
|
190
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.fieldType === "textarea" ? (d(), i(s, b({
|
|
191
|
+
key: 2,
|
|
192
|
+
modelValue: l(t)[e.fieldKey],
|
|
193
|
+
"onUpdate:modelValue": (a) => l(t)[e.fieldKey] = a,
|
|
194
|
+
placeholder: `${l(c)("act.inputPlaceholder")}${e.fieldName}`,
|
|
195
|
+
rows: 4,
|
|
196
|
+
ref_for: !0
|
|
197
|
+
}, l(y)(e), {
|
|
198
|
+
type: "textarea",
|
|
199
|
+
disabled: e.isFormDisabled
|
|
200
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.fieldType === "selectIcon" ? (d(), i(l(X), b({
|
|
201
|
+
key: 3,
|
|
202
|
+
modelValue: l(t)[e.fieldKey],
|
|
203
|
+
"onUpdate:modelValue": (a) => l(t)[e.fieldKey] = a,
|
|
204
|
+
icons: e.dataList,
|
|
205
|
+
placeholder: `${l(c)("act.selectPlaceholder")}${e.fieldName}`,
|
|
206
|
+
ref_for: !0
|
|
207
|
+
}, l(y)(e), {
|
|
208
|
+
disabled: e.isFormDisabled
|
|
209
|
+
}), {
|
|
210
|
+
default: h(() => [
|
|
211
|
+
(d(!0), D(U, null, M(e.dataList, (a, $) => (d(), i(_, {
|
|
212
|
+
key: $,
|
|
213
|
+
label: a.key,
|
|
214
|
+
value: a.value
|
|
215
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
216
|
+
]),
|
|
217
|
+
_: 2
|
|
218
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "icons", "placeholder", "disabled"])) : ["select", "multipleSelect"].includes(e.fieldType) ? (d(), i(p, b({
|
|
219
|
+
key: 4,
|
|
220
|
+
modelValue: l(t)[e.fieldKey],
|
|
221
|
+
"onUpdate:modelValue": (a) => l(t)[e.fieldKey] = a,
|
|
222
|
+
placeholder: `${l(c)("act.selectPlaceholder")}${e.fieldName}`,
|
|
223
|
+
clearable: "",
|
|
224
|
+
filterable: "",
|
|
225
|
+
ref_for: !0
|
|
226
|
+
}, l(y)(e), {
|
|
227
|
+
multiple: e.fieldType === "multipleSelect",
|
|
228
|
+
disabled: e.isFormDisabled
|
|
229
|
+
}), {
|
|
230
|
+
default: h(() => [
|
|
231
|
+
(d(!0), D(U, null, M(e.dataList, (a, $) => (d(), i(_, {
|
|
232
|
+
key: $,
|
|
233
|
+
label: a.key,
|
|
234
|
+
value: a.value
|
|
235
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
236
|
+
]),
|
|
237
|
+
_: 2
|
|
238
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "disabled"])) : ["virtualizedSelect", "virtualizedMultipleSelect"].includes(e.fieldType) ? (d(), i(C, b({
|
|
239
|
+
key: 5,
|
|
240
|
+
modelValue: l(t)[e.fieldKey],
|
|
241
|
+
"onUpdate:modelValue": (a) => l(t)[e.fieldKey] = a,
|
|
242
|
+
options: e.dataList,
|
|
243
|
+
props: { ...l(Te) },
|
|
244
|
+
placeholder: `${l(c)("act.selectPlaceholder")}${e.fieldName}`,
|
|
245
|
+
clearable: "",
|
|
246
|
+
filterable: "",
|
|
247
|
+
ref_for: !0
|
|
248
|
+
}, l(y)(e), {
|
|
249
|
+
disabled: e.isFormDisabled,
|
|
250
|
+
multiple: e.fieldType === "virtualizedMultipleSelect"
|
|
251
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "options", "props", "placeholder", "disabled", "multiple"])) : e.fieldType === "date" ? (d(), i(V, b({
|
|
252
|
+
key: 6,
|
|
253
|
+
modelValue: l(t)[e.fieldKey],
|
|
254
|
+
"onUpdate:modelValue": (a) => l(t)[e.fieldKey] = a,
|
|
255
|
+
type: "date",
|
|
256
|
+
placeholder: `${l(c)("act.selectPlaceholder")}${l(c)("act.time")}`,
|
|
257
|
+
"value-format": "YYYY-MM-DD HH:mm:ss",
|
|
258
|
+
ref_for: !0
|
|
259
|
+
}, l(y)(e), {
|
|
260
|
+
disabled: e.isFormDisabled
|
|
261
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.fieldType === "dateRange" ? (d(), i(V, b({
|
|
262
|
+
key: 7,
|
|
263
|
+
modelValue: l(t)[e.fieldKey],
|
|
264
|
+
"onUpdate:modelValue": (a) => l(t)[e.fieldKey] = a,
|
|
265
|
+
type: "daterange",
|
|
266
|
+
"start-placeholder": l(c)("act.startTime"),
|
|
267
|
+
"end-placeholder": l(c)("act.endTime"),
|
|
268
|
+
"value-format": "YYYY-MM-DD HH:mm:ss",
|
|
269
|
+
ref_for: !0
|
|
270
|
+
}, l(y)(e), {
|
|
271
|
+
disabled: e.isFormDisabled
|
|
272
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "start-placeholder", "end-placeholder", "disabled"])) : e.fieldType === "provinceCascade" ? (d(), i(r, b({
|
|
273
|
+
key: 8,
|
|
274
|
+
modelValue: l(t)[e.fieldKey],
|
|
275
|
+
"onUpdate:modelValue": (a) => l(t)[e.fieldKey] = a,
|
|
276
|
+
options: e.dataList,
|
|
277
|
+
props: l(Ke),
|
|
278
|
+
clearable: "",
|
|
279
|
+
filterable: "",
|
|
280
|
+
placeholder: `${l(c)("act.selectPlaceholder")}${e.fieldName}`,
|
|
281
|
+
ref_for: !0
|
|
282
|
+
}, l(y)(e), {
|
|
283
|
+
disabled: e.isFormDisabled
|
|
284
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "options", "props", "placeholder", "disabled"])) : e.fieldType === "switch" ? (d(), i(n, {
|
|
285
|
+
key: 9,
|
|
286
|
+
modelValue: l(t)[e.fieldKey],
|
|
287
|
+
"onUpdate:modelValue": (a) => l(t)[e.fieldKey] = a,
|
|
288
|
+
"active-value": !0,
|
|
289
|
+
"inactive-value": !1
|
|
290
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : e.fieldType === "upload" ? (d(), i(l(Z), b({
|
|
291
|
+
key: 10,
|
|
292
|
+
class: "form-upload",
|
|
293
|
+
modelValue: l(t)[e.fieldKey],
|
|
294
|
+
"onUpdate:modelValue": (a) => l(t)[e.fieldKey] = a,
|
|
295
|
+
request: l(E),
|
|
296
|
+
ref_for: !0
|
|
297
|
+
}, l(y)(e)), null, 16, ["modelValue", "onUpdate:modelValue", "request"])) : e.fieldType === "editor" ? (d(), i(l(I), b({
|
|
298
|
+
key: 11,
|
|
299
|
+
modelValue: l(t)[e.fieldKey],
|
|
300
|
+
"onUpdate:modelValue": (a) => l(t)[e.fieldKey] = a,
|
|
301
|
+
disabled: e.isFormDisabled,
|
|
302
|
+
placeholder: `${l(c)("act.inputPlaceholder")}${e.fieldName}`,
|
|
303
|
+
ref_for: !0
|
|
304
|
+
}, l(y)(e)), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : G("", !0)
|
|
305
|
+
]),
|
|
306
|
+
_: 2
|
|
307
|
+
}, 1032, ["label", "prop", "rules"]))
|
|
308
|
+
]),
|
|
309
|
+
_: 2
|
|
310
|
+
}, 1032, ["span"]))), 128))
|
|
311
|
+
]),
|
|
312
|
+
_: 1
|
|
313
|
+
})
|
|
314
|
+
]),
|
|
315
|
+
_: 1
|
|
316
|
+
}, 8, ["model", "label-width", "label-position"])
|
|
317
|
+
];
|
|
318
|
+
}),
|
|
319
|
+
_: 1
|
|
320
|
+
}, 8, ["model-value", "title", "width"]);
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
}, Ae = /* @__PURE__ */ Ce(ke, [["__scopeId", "data-v-112876c8"]]);
|
|
324
|
+
export {
|
|
325
|
+
Ae as default
|
|
326
|
+
};
|