act-plus 1.1.32 → 1.1.34

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