act-plus 1.1.33 → 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,307 +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 ge } from "vue";
2
- import { _ as Ve, u as Fe, P as Ce, a as De } from "./index-76e96bb6.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-76e96bb6.js").then((o) => o.f)), Q = S(() => import("./index-76e96bb6.js").then((o) => o.e)), X = S(() => import("./index-76e96bb6.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 V = 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 g = await Z(F, p);
52
- n.customFiledsComponentes[p] = g;
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
- V.btnLoading = !0;
65
- const { dataItem: n, rowData: h } = u.data;
66
- let p = { ...ge(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), {}), g = 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
- ...g
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
- V.btnLoading = !1;
84
- }).catch((d) => {
85
- console.error(d), V.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"), g = 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
- draggable: "",
99
- overflow: "",
100
- "append-to-body": "",
101
- "destroy-on-close": "",
102
- "close-on-click-modal": !1,
103
- "before-close": re
104
- }, {
105
- footer: _(() => [
106
- H("span", we, [
107
- $(q, {
108
- loading: l(V).btnLoading,
109
- onClick: U
110
- }, {
111
- default: _(() => [
112
- R(T(l(i)("act.cancel")), 1)
113
- ]),
114
- _: 1
115
- }, 8, ["loading"]),
116
- be((r(), c(q, {
117
- type: "primary",
118
- loading: l(V).btnLoading,
119
- onClick: f[1] || (f[1] = (P) => ne(l(N)))
120
- }, {
121
- default: _(() => [
122
- R(T(l(i)("act.save")), 1)
123
- ]),
124
- _: 1
125
- }, 8, ["loading"])), [
126
- [ue]
127
- ])
128
- ])
129
- ]),
130
- default: _(() => {
131
- var P, j;
132
- return [
133
- $(ie, {
134
- ref_key: "formRef",
135
- ref: N,
136
- model: l(a),
137
- "label-suffix": ":",
138
- "label-width": (P = C.data.formConfig) == null ? void 0 : P.formLabelWidth,
139
- "label-position": (j = C.data.formConfig) == null ? void 0 : j.formLabelPosition
140
- }, {
141
- default: _(() => [
142
- $(se, { gutter: 40 }, {
143
- default: _(() => [
144
- (r(!0), K(x, null, z(l(w), (e, B) => (r(), c(v, {
145
- span: ee(e),
146
- key: B
147
- }, {
148
- default: _(() => [
149
- e.customFiledsComponentes.isFiledCustom ? (r(), K(x, { key: 1 }, [
150
- e.customFiledsComponentes[e.customFiledsComponentes.customComponentName] ? (r(), c(_e(e.customFiledsComponentes[e.customFiledsComponentes.customComponentName]), {
151
- key: 0,
152
- fieldCofnigItem: e,
153
- rowData: u.data.rowData,
154
- form: l(a),
155
- "onUpdate:form": f[0] || (f[0] = (t) => he(a) ? a.value = t : a = t)
156
- }, null, 40, ["fieldCofnigItem", "rowData", "form"])) : (r(), K("div", {
157
- class: "no-config",
158
- key: B
159
- }, [
160
- H("span", Ke, "【" + T(e.fieldName) + "】", 1),
161
- R(T(l(i)("act.fieldCustom")), 1)
162
- ]))
163
- ], 64)) : (r(), c(k, {
164
- key: 0,
165
- label: e.fieldName,
166
- prop: e.fieldKey,
167
- rules: [{ required: e.isFormFieldRequired, message: l(i)("act.requiredMessage"), trigger: le(e) }]
168
- }, {
169
- default: _(() => [
170
- e.fieldType === "input" ? (r(), c(n, b({
171
- key: 0,
172
- modelValue: l(a)[e.fieldKey],
173
- "onUpdate:modelValue": (t) => l(a)[e.fieldKey] = t,
174
- placeholder: `${l(i)("act.inputPlaceholder")}${e.fieldName}`,
175
- clearable: "",
176
- ref_for: !0
177
- }, y(e), {
178
- disabled: e.isFormDisabled
179
- }), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : W("", !0),
180
- e.fieldType === "inputNumber" ? (r(), c(l(J), b({
181
- key: 1,
182
- modelValue: l(a)[e.fieldKey],
183
- "onUpdate:modelValue": (t) => l(a)[e.fieldKey] = t,
184
- placeholder: `${l(i)("act.inputPlaceholder")}${e.fieldName}`,
185
- clearable: "",
186
- ref_for: !0
187
- }, y(e), {
188
- disabled: e.isFormDisabled
189
- }), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.fieldType === "textarea" ? (r(), c(n, b({
190
- key: 2,
191
- modelValue: l(a)[e.fieldKey],
192
- "onUpdate:modelValue": (t) => l(a)[e.fieldKey] = t,
193
- placeholder: `${l(i)("act.inputPlaceholder")}${e.fieldName}`,
194
- rows: 4,
195
- ref_for: !0
196
- }, y(e), {
197
- type: "textarea",
198
- disabled: e.isFormDisabled
199
- }), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : ["select", "multipleSelect"].includes(e.fieldType) ? (r(), c(p, b({
200
- key: 3,
201
- modelValue: l(a)[e.fieldKey],
202
- "onUpdate:modelValue": (t) => l(a)[e.fieldKey] = t,
203
- placeholder: `${l(i)("act.selectPlaceholder")}${e.fieldName}`,
204
- clearable: "",
205
- filterable: "",
206
- ref_for: !0
207
- }, y(e), {
208
- multiple: e.fieldType === "multipleSelect",
209
- disabled: e.isFormDisabled
210
- }), {
211
- default: _(() => [
212
- (r(!0), K(x, null, z(e.dataList, (t, fe) => (r(), c(h, {
213
- key: fe,
214
- label: t.key,
215
- value: t.value
216
- }, null, 8, ["label", "value"]))), 128))
217
- ]),
218
- _: 2
219
- }, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "disabled"])) : ["virtualizedSelect", "virtualizedMultipleSelect"].includes(e.fieldType) ? (r(), c(F, b({
220
- key: 4,
221
- modelValue: l(a)[e.fieldKey],
222
- "onUpdate:modelValue": (t) => l(a)[e.fieldKey] = t,
223
- options: e.dataList,
224
- props: { ...l(Ce) },
225
- placeholder: `${l(i)("act.selectPlaceholder")}${e.fieldName}`,
226
- clearable: "",
227
- filterable: "",
228
- ref_for: !0
229
- }, y(e), {
230
- disabled: e.isFormDisabled,
231
- multiple: e.fieldType === "virtualizedMultipleSelect"
232
- }), null, 16, ["modelValue", "onUpdate:modelValue", "options", "props", "placeholder", "disabled", "multiple"])) : e.fieldType === "date" ? (r(), c(g, b({
233
- key: 5,
234
- modelValue: l(a)[e.fieldKey],
235
- "onUpdate:modelValue": (t) => l(a)[e.fieldKey] = t,
236
- type: "date",
237
- placeholder: `${l(i)("act.selectPlaceholder")}${l(i)("act.time")}`,
238
- "value-format": "YYYY-MM-DD HH:mm:ss",
239
- ref_for: !0
240
- }, y(e), {
241
- disabled: e.isFormDisabled
242
- }), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.fieldType === "dateRange" ? (r(), c(g, b({
243
- key: 6,
244
- modelValue: l(a)[e.fieldKey],
245
- "onUpdate:modelValue": (t) => l(a)[e.fieldKey] = t,
246
- type: "daterange",
247
- "start-placeholder": l(i)("act.startTime"),
248
- "end-placeholder": l(i)("act.endTime"),
249
- "value-format": "YYYY-MM-DD HH:mm:ss",
250
- ref_for: !0
251
- }, y(e), {
252
- disabled: e.isFormDisabled
253
- }), null, 16, ["modelValue", "onUpdate:modelValue", "start-placeholder", "end-placeholder", "disabled"])) : e.fieldType === "provinceCascade" ? (r(), c(d, b({
254
- key: 7,
255
- modelValue: l(a)[e.fieldKey],
256
- "onUpdate:modelValue": (t) => l(a)[e.fieldKey] = t,
257
- options: e.dataList,
258
- props: l(De),
259
- clearable: "",
260
- filterable: "",
261
- placeholder: `${l(i)("act.selectPlaceholder")}${e.fieldName}`,
262
- ref_for: !0
263
- }, y(e), {
264
- disabled: e.isFormDisabled
265
- }), null, 16, ["modelValue", "onUpdate:modelValue", "options", "props", "placeholder", "disabled"])) : e.fieldType === "switch" ? (r(), c(s, {
266
- key: 8,
267
- modelValue: l(a)[e.fieldKey],
268
- "onUpdate:modelValue": (t) => l(a)[e.fieldKey] = t,
269
- "active-value": !0,
270
- "inactive-value": !1
271
- }, null, 8, ["modelValue", "onUpdate:modelValue"])) : e.fieldType === "upload" ? (r(), c(l(Q), b({
272
- key: 9,
273
- class: "form-upload",
274
- modelValue: l(a)[e.fieldKey],
275
- "onUpdate:modelValue": (t) => l(a)[e.fieldKey] = t,
276
- request: l(M),
277
- ref_for: !0
278
- }, y(e)), null, 16, ["modelValue", "onUpdate:modelValue", "request"])) : e.fieldType === "editor" ? (r(), c(l(X), b({
279
- key: 10,
280
- modelValue: l(a)[e.fieldKey],
281
- "onUpdate:modelValue": (t) => l(a)[e.fieldKey] = t,
282
- disabled: e.isFormDisabled,
283
- placeholder: `${l(i)("act.inputPlaceholder")}${e.fieldName}`,
284
- ref_for: !0
285
- }, y(e)), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : W("", !0)
286
- ]),
287
- _: 2
288
- }, 1032, ["label", "prop", "rules"]))
289
- ]),
290
- _: 2
291
- }, 1032, ["span"]))), 128))
292
- ]),
293
- _: 1
294
- })
295
- ]),
296
- _: 1
297
- }, 8, ["model", "label-width", "label-position"])
298
- ];
299
- }),
300
- _: 1
301
- }, 8, ["model-value", "title", "width"]);
302
- };
303
- }
304
- }, Re = /* @__PURE__ */ Ve(Ne, [["__scopeId", "data-v-d552e522"]]);
305
- export {
306
- Re as default
307
- };
@@ -1,92 +0,0 @@
1
- import { ref as h, watch as I, resolveComponent as _, openBlock as i, createElementBlock as d, createVNode as u, unref as p, isRef as b, withCtx as m, createElementVNode as g, createBlock as w, createCommentVNode as C, createTextVNode as N, Fragment as B, renderList as E, normalizeClass as S } from "vue";
2
- import { _ as z } from "./index-76e96bb6.js";
3
- import "vue-router";
4
- import "js-base64";
5
- import "element-plus";
6
- import "monaco-editor";
7
- const A = { class: "select-icon-container" }, F = { class: "icon-list" }, L = ["onClick"], P = {
8
- class: "icon-value",
9
- slot: "reference"
10
- }, R = {
11
- __name: "index",
12
- props: {
13
- modelValue: { type: String, default: "" },
14
- icons: { type: Array, default: () => [] }
15
- },
16
- emits: ["update:modelValue"],
17
- setup(x, { emit: y }) {
18
- const v = y, c = x;
19
- let t = h(!1), e = h(-1);
20
- const f = () => e.value == -1 ? "" : c.icons[e.value];
21
- I(
22
- () => c.modelValue,
23
- (l, o) => {
24
- if (!l) {
25
- e.value = -1, v("update:modelValue", "");
26
- return;
27
- }
28
- const s = c.icons.findIndex((a) => a === l);
29
- e.value = s;
30
- },
31
- { deep: !0, immediate: !0 }
32
- );
33
- const k = (l, o) => {
34
- e.value = o, v("update:modelValue", f()), t.value = !1;
35
- };
36
- return (l, o) => {
37
- const s = _("a-svg-icon"), a = _("el-button"), V = _("el-popover");
38
- return i(), d("div", A, [
39
- u(V, {
40
- "popper-class": "select-icon-popover",
41
- placement: "bottom-start",
42
- visible: p(t),
43
- "onUpdate:visible": o[0] || (o[0] = (n) => b(t) ? t.value = n : t = n),
44
- width: 400,
45
- trigger: "click"
46
- }, {
47
- reference: m(() => [
48
- g("div", P, [
49
- p(e) >= 0 ? (i(), w(s, {
50
- key: 0,
51
- name: f(),
52
- width: "24",
53
- height: "24",
54
- color: "#000"
55
- }, null, 8, ["name"])) : C("", !0),
56
- u(a, {
57
- class: "icon-btn",
58
- type: "primary"
59
- }, {
60
- default: m(() => [
61
- N("选择图标")
62
- ]),
63
- _: 1
64
- })
65
- ])
66
- ]),
67
- default: m(() => [
68
- g("ul", F, [
69
- (i(!0), d(B, null, E(c.icons, (n, r) => (i(), d("li", {
70
- class: S(["icon-item", { "icon-item-checked": p(e) == r }]),
71
- key: r,
72
- onClick: (T) => k(n, r)
73
- }, [
74
- u(s, {
75
- class: "icon-svg",
76
- name: n,
77
- width: "24",
78
- height: "24",
79
- color: "#999"
80
- }, null, 8, ["name"])
81
- ], 10, L))), 128))
82
- ])
83
- ]),
84
- _: 1
85
- }, 8, ["visible"])
86
- ]);
87
- };
88
- }
89
- }, J = /* @__PURE__ */ z(R, [["__scopeId", "data-v-3437a309"]]);
90
- export {
91
- J as default
92
- };