act-plus 1.1.44 → 1.1.46

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,283 +0,0 @@
1
- import { defineAsyncComponent as le, inject as R, ref as Q, watch as te, resolveComponent as c, resolveDirective as ae, unref as a, openBlock as n, createElementBlock as b, createVNode as oe, normalizeStyle as re, withCtx as g, Fragment as v, renderList as F, createBlock as u, mergeProps as C, withKeys as A, withModifiers as Y, createCommentVNode as V, resolveDynamicComponent as ne, createElementVNode as se, toDisplayString as x, createTextVNode as L, withDirectives as ue } from "vue";
2
- import { _ as de, u as pe, P as ce, a as ie, b as fe } from "./index-4e6030dd.js";
3
- import "vue-router";
4
- import "js-base64";
5
- import "element-plus";
6
- import "monaco-editor";
7
- const me = {
8
- key: 0,
9
- class: "search-module-container"
10
- }, ye = { class: "no-config-field" }, _e = {
11
- __name: "index",
12
- props: {
13
- data: { type: Object, default: () => ({}) }
14
- },
15
- emits: ["reset", "search"],
16
- setup(I, { emit: B }) {
17
- const H = le(() => import("./index-4e6030dd.js").then((o) => o.t)), { t: d } = pe(), W = R("request"), j = R("loadComponents"), f = R("getFieldUiProps"), M = R("formatDataType"), O = B, m = I, K = Q({});
18
- let y = Q([]), z = Q([]), q = Q(!0);
19
- const G = (o) => m.data.tableConfig.isExpandQuery && q.value ? m.data.tableConfig.tableQueryRowWidth > o + 1 : !0, J = async (o) => {
20
- y.value = await Promise.all(
21
- o.filter((l) => l.useScenes.includes("tableSearch")).map(async (l) => {
22
- const r = (l.formCustomComponentes ?? []).find((p) => p.permissionCode === "tableSearch");
23
- if (l.isQueryFieldCustom = !1, r && r.isFieldCustom) {
24
- const { isFieldCustom: p, customComponentName: k, customComponentUrl: T } = r;
25
- if (l.isQueryFieldCustom = !0, p && !l.customQueryComponent) {
26
- const N = await j(T, k);
27
- l.customQueryComponent = N;
28
- }
29
- }
30
- return l;
31
- })
32
- );
33
- }, X = (o) => {
34
- const l = (o || []).filter((r) => r.permissionCode === 1001).map((r) => ({ ...r, loading: !1 }));
35
- z.value = [...l, { btnName: d("act.reset"), permissionCode: "9999", btnColor: "info", btnIcon: "btn-reset", loading: !1 }];
36
- }, Z = async ({ node: o, resolve: l }, r) => {
37
- const p = f(r), { label: k, value: T, children: N, isLeaf: U } = { ...fe, ...p.treeProps || {} };
38
- if (o[U])
39
- return l([]);
40
- const P = r.postRequestParams.filter((s) => s.submitType === "default").reduce((s, h) => (s[h.submitName] = M(h.paramsType, h.submitValue), s), {}), $ = r.postRequestParams.filter((s) => s.submitType === "dynamic").map((s) => ({
41
- field: s.submitName,
42
- operate: s.submitMatchType,
43
- value: p.loadCode ? o == null ? void 0 : o.data.value : M(s.paramsType, s.submitValue)
44
- }));
45
- let _ = {};
46
- Object.keys(P).length && (_ = { ..._, ...P }), $.length && (_.dynamicFilters = $), p.loadCode && Reflect.has(_, p.loadCode) && (_[p.loadCode] = o == null ? void 0 : o.data.value);
47
- const { data: S } = await W({
48
- url: r.fieldRequestUrl,
49
- method: r.fieldRequestType || "GET",
50
- data: _
51
- }), E = (S || []).map((s) => ({ label: s[k], value: s[T], children: [], isLeaf: s[U] }));
52
- l(E);
53
- };
54
- te(
55
- () => m.data,
56
- (o, l) => {
57
- J(o.fields), X(o.buttons);
58
- },
59
- { immediate: !0 }
60
- );
61
- const i = (o) => {
62
- switch (o.loading = !0, o.permissionCode) {
63
- case "9999":
64
- y.value.forEach((r) => {
65
- r.fieldType.includes("&") ? r.queryValue = [] : r.queryValue = void 0;
66
- }), O("reset", [], () => {
67
- o.loading = !1;
68
- });
69
- break;
70
- default:
71
- const l = y.value.filter((r) => Array.isArray(r.queryValue) ? r.queryValue.length : !!r.queryValue);
72
- O("search", l, () => {
73
- o.loading = !1;
74
- });
75
- break;
76
- }
77
- }, ee = () => {
78
- q.value = !q.value;
79
- };
80
- return (o, l) => {
81
- var h;
82
- const r = c("el-input"), p = c("el-option"), k = c("el-select"), T = c("el-select-v2"), N = c("el-cascader"), U = c("el-tree-select"), P = c("el-date-picker"), $ = c("el-form-item"), _ = c("a-svg-icon"), S = c("el-button"), E = c("el-form"), s = ae("debounce");
83
- return a(y) && a(y).length ? (n(), b("div", me, [
84
- oe(E, {
85
- style: re({ "--table-query-row": m.data.tableConfig.tableQueryRowWidth }),
86
- class: "form-content",
87
- ref: "elForm",
88
- "label-suffix": ":",
89
- "label-position": "right"
90
- }, {
91
- default: g(() => [
92
- (n(!0), b(v, null, F(a(y), (e, w) => (n(), b(v, { key: w }, [
93
- G(w) ? (n(), b(v, { key: 0 }, [
94
- e.isQueryFieldCustom ? (n(), b(v, { key: 1 }, [
95
- e.customQueryComponent ? (n(), u(ne(e.customQueryComponent), {
96
- key: 0,
97
- class: "custom-btn",
98
- ref_for: !0,
99
- ref: (t) => K.value.customQueryComponent = t,
100
- queryItem: e,
101
- data: m.data,
102
- onRefresh: (t) => i(e)
103
- }, null, 40, ["queryItem", "data", "onRefresh"])) : (n(), b("div", {
104
- class: "no-config",
105
- key: w
106
- }, [
107
- se("span", ye, "【" + x(e.fieldName) + "】", 1),
108
- L(x(a(d)("act.fieldCustom")), 1)
109
- ]))
110
- ], 64)) : (n(), u($, {
111
- key: 0,
112
- class: "search-form-item",
113
- "label-width": m.data.tableConfig.tableQueryLabelWidth,
114
- label: e.fieldName
115
- }, {
116
- default: g(() => [
117
- e.fieldType === "input" || e.fieldType === "editor" ? (n(), u(r, C({
118
- key: 0,
119
- modelValue: e.queryValue,
120
- "onUpdate:modelValue": (t) => e.queryValue = t,
121
- placeholder: `${a(d)("act.inputPlaceholder")}${e.fieldName}`,
122
- clearable: "",
123
- ref_for: !0
124
- }, a(f)(e), {
125
- onKeyup: l[0] || (l[0] = A(Y((t) => i({ permissionCode: 1001 }), ["prevent"]), ["enter", "native"]))
126
- }), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder"])) : V("", !0),
127
- e.fieldType === "inputNumber" ? (n(), u(a(H), C({
128
- key: 1,
129
- modelValue: e.queryValue,
130
- "onUpdate:modelValue": (t) => e.queryValue = t,
131
- placeholder: `${a(d)("act.inputPlaceholder")}${e.fieldName}`,
132
- clearable: "",
133
- onKeyup: l[1] || (l[1] = A(Y((t) => i({ permissionCode: 1001 }), ["prevent"]), ["enter", "native"])),
134
- ref_for: !0
135
- }, a(f)(e)), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder"])) : ["select", "switch", "multipleSelect"].includes(e.fieldType) ? (n(), u(k, C({
136
- key: 2,
137
- modelValue: e.queryValue,
138
- "onUpdate:modelValue": (t) => e.queryValue = t,
139
- placeholder: `${a(d)("act.selectPlaceholder")}${e.fieldName}`,
140
- clearable: "",
141
- filterable: "",
142
- ref_for: !0
143
- }, a(f)(e), {
144
- multiple: e.fieldType === "multipleSelect",
145
- "collapse-tags": e.fieldType === "multipleSelect",
146
- "collapse-tags-tooltip": e.fieldType === "multipleSelect",
147
- onChange: l[2] || (l[2] = (t) => i({ permissionCode: 1001 }))
148
- }), {
149
- default: g(() => [
150
- (n(!0), b(v, null, F(e.dataList, (t, D) => (n(), u(p, {
151
- key: D,
152
- label: t.key,
153
- value: t.value
154
- }, null, 8, ["label", "value"]))), 128))
155
- ]),
156
- _: 2
157
- }, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "collapse-tags", "collapse-tags-tooltip"])) : ["virtualizedSelect", "virtualizedMultipleSelect"].includes(e.fieldType) ? (n(), u(T, C({
158
- key: 3,
159
- modelValue: e.queryValue,
160
- "onUpdate:modelValue": (t) => e.queryValue = t,
161
- options: e.dataList,
162
- props: { ...a(ce) },
163
- placeholder: `${a(d)("act.selectPlaceholder")}${e.fieldName}`,
164
- clearable: "",
165
- filterable: "",
166
- ref_for: !0
167
- }, a(f)(e), {
168
- "collapse-tags": e.fieldType === "virtualizedMultipleSelect",
169
- "collapse-tags-tooltip": e.fieldType === "virtualizedMultipleSelect",
170
- multiple: e.fieldType === "virtualizedMultipleSelect",
171
- onChange: l[3] || (l[3] = (t) => i({ permissionCode: 1001 }))
172
- }), null, 16, ["modelValue", "onUpdate:modelValue", "options", "props", "placeholder", "collapse-tags", "collapse-tags-tooltip", "multiple"])) : e.fieldType === "provinceCascade" ? (n(), u(N, C({
173
- key: 4,
174
- modelValue: e.queryValue,
175
- "onUpdate:modelValue": (t) => e.queryValue = t,
176
- options: e.dataList,
177
- props: { ...a(ie) },
178
- clearable: "",
179
- filterable: "",
180
- placeholder: `${a(d)("act.selectPlaceholder")}${e.fieldName}`,
181
- ref_for: !0
182
- }, a(f)(e), {
183
- onChange: l[4] || (l[4] = (t) => i({ permissionCode: 1001 }))
184
- }), null, 16, ["modelValue", "onUpdate:modelValue", "options", "props", "placeholder"])) : e.fieldType === "treeSelect" ? (n(), u(U, C({
185
- key: 5,
186
- modelValue: e.queryValue,
187
- "onUpdate:modelValue": (t) => e.queryValue = t,
188
- placeholder: `请选择${e.fieldName}`,
189
- props: { isLeaf: "isLeaf" },
190
- "render-after-expand": !1,
191
- "collapse-tags": "",
192
- "collapse-tags-tooltip": "",
193
- multiple: "",
194
- "show-checkbox": "",
195
- clearable: "",
196
- filterable: "",
197
- lazy: "",
198
- load: (t, D) => Z({ node: t, resolve: D }, e),
199
- ref_for: !0
200
- }, a(f)(e), {
201
- onChange: l[5] || (l[5] = (t) => i({ permissionCode: 1001 }))
202
- }), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "load"])) : e.fieldType === "date" ? (n(), u(P, C({
203
- key: 6,
204
- modelValue: e.queryValue,
205
- "onUpdate:modelValue": (t) => e.queryValue = t,
206
- type: "date",
207
- placeholder: `${a(d)("act.selectPlaceholder")}${a(d)("act.time")}`,
208
- "value-format": "YYYY-MM-DD HH:mm:ss",
209
- clearable: "",
210
- ref_for: !0
211
- }, a(f)(e), {
212
- onChange: l[6] || (l[6] = (t) => i({ permissionCode: 1001 }))
213
- }), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder"])) : e.fieldType === "dateRange" ? (n(), u(P, C({
214
- key: 7,
215
- modelValue: e.queryValue,
216
- "onUpdate:modelValue": (t) => e.queryValue = t,
217
- type: "daterange",
218
- "start-placeholder": a(d)("act.startTime"),
219
- "end-placeholder": a(d)("act.endTime"),
220
- "value-format": "YYYY-MM-DD HH:mm:ss",
221
- clearable: "",
222
- ref_for: !0
223
- }, a(f)(e), {
224
- onChange: l[7] || (l[7] = (t) => i({ permissionCode: 1001 }))
225
- }), null, 16, ["modelValue", "onUpdate:modelValue", "start-placeholder", "end-placeholder"])) : V("", !0)
226
- ]),
227
- _: 2
228
- }, 1032, ["label-width", "label"]))
229
- ], 64)) : V("", !0)
230
- ], 64))), 128)),
231
- a(y).length ? (n(), u($, {
232
- key: 0,
233
- class: "search-form-btn",
234
- "label-width": "0"
235
- }, {
236
- default: g(() => [
237
- (n(!0), b(v, null, F(a(z), (e, w) => ue((n(), u(S, {
238
- key: w,
239
- type: e.btnColor,
240
- loading: e.loading,
241
- onClick: (t) => i(e)
242
- }, {
243
- default: g(() => [
244
- e.btnIcon ? (n(), u(_, {
245
- key: 0,
246
- class: "mr6",
247
- name: e.btnIcon,
248
- width: "12",
249
- height: "12",
250
- color: "#fff"
251
- }, null, 8, ["name"])) : V("", !0),
252
- L(" " + x(e.btnName), 1)
253
- ]),
254
- _: 2
255
- }, 1032, ["type", "loading", "onClick"])), [
256
- [s]
257
- ])), 128))
258
- ]),
259
- _: 1
260
- })) : V("", !0)
261
- ]),
262
- _: 1
263
- }, 8, ["style"]),
264
- m.data.tableConfig.isExpandQuery && ((h = a(y)) == null ? void 0 : h.length) > m.data.tableConfig.tableQueryRowWidth ? (n(), u(S, {
265
- key: 0,
266
- class: "expand",
267
- text: "",
268
- size: "small",
269
- icon: a(q) ? "ArrowDown" : "ArrowUp",
270
- onClick: ee
271
- }, {
272
- default: g(() => [
273
- L(x(a(q) ? a(d)("act.expand") : a(d)("act.retract")), 1)
274
- ]),
275
- _: 1
276
- }, 8, ["icon"])) : V("", !0)
277
- ])) : V("", !0);
278
- };
279
- }
280
- }, qe = /* @__PURE__ */ de(_e, [["__scopeId", "data-v-48cac85a"]]);
281
- export {
282
- qe as default
283
- };