vue3-curd 1.0.39 → 1.0.40
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/dist/src/components/CURD/types.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/vue3-curd.es.js +1361 -1307
- package/dist/vue3-curd.es.js.map +1 -1
- package/dist/vue3-curd.umd.js +1 -1
- package/dist/vue3-curd.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/vue3-curd.es.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { ElTag as ma, ElImage as He, ElIcon as Pe, ElDialog as Ne, ElTable as
|
|
2
|
-
import { defineComponent as pe, computed as
|
|
3
|
-
import { createTypes as $
|
|
1
|
+
import { ElTag as ma, ElImage as He, ElIcon as Pe, ElDialog as Ne, ElTable as sl, ElTableColumn as cl, ElCheckbox as ya, ElSwitch as ga, ElText as ul, ElTooltip as il, ElButton as De, ElLoadingDirective as dl, ElPagination as pl, ElUpload as Ke, ElLink as fl, ElInput as We, ElForm as ba, ElRow as va, ElCol as ka, ElFormItem as _a, ElInputNumber as hl, ElSelect as wa, ElOption as Va, ElDatePicker as Sa, ElCheckboxGroup as ml, ElRadioGroup as yl, ElRadio as gl, ElTreeSelect as $a, ElColorPicker as bl, ElCard as Da, ElLoading as Ca, ElMessage as Ve, ElMessageBox as we, ElNotification as Ue } from "element-plus/es";
|
|
2
|
+
import { defineComponent as pe, computed as J, createElementBlock as $, openBlock as n, normalizeClass as qe, unref as o, createElementVNode as le, toDisplayString as M, Fragment as O, renderList as Q, createBlock as h, createCommentVNode as X, withCtx as b, createTextVNode as z, ref as L, watch as ke, normalizeStyle as fe, createVNode as F, isRef as Se, getCurrentInstance as he, toRaw as Le, onMounted as Qe, resolveDirective as Ta, withDirectives as de, renderSlot as ze, withModifiers as vl, nextTick as Be, TransitionGroup as kl, useCssVars as _l, resolveComponent as wl, vShow as Vl, reactive as Sl, createSlots as Ye, withKeys as ta, normalizeProps as oa, guardReactiveProps as ra } from "vue";
|
|
3
|
+
import { createTypes as $l } from "vue-types";
|
|
4
4
|
import { PictureFilled as Me, VideoPlay as na, Picture as xe } from "@element-plus/icons-vue";
|
|
5
|
-
import
|
|
6
|
-
import { compressAccurately as
|
|
5
|
+
import Dl from "axios";
|
|
6
|
+
import { compressAccurately as Cl } from "image-conversion";
|
|
7
7
|
import { defineStore as Ea } from "pinia";
|
|
8
8
|
import "@vueup/vue-quill/dist/vue-quill.snow.css";
|
|
9
|
-
import { Quill as
|
|
9
|
+
import { Quill as Tl, QuillEditor as El } from "@vueup/vue-quill";
|
|
10
10
|
import { useI18n as Ua } from "vue-i18n";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const re = $
|
|
11
|
+
import Ul from "dayjs";
|
|
12
|
+
import Al from "file-saver";
|
|
13
|
+
const re = $l({
|
|
14
14
|
func: void 0,
|
|
15
15
|
bool: void 0,
|
|
16
16
|
string: void 0,
|
|
17
17
|
number: void 0,
|
|
18
18
|
object: void 0,
|
|
19
19
|
integer: void 0
|
|
20
|
-
}),
|
|
20
|
+
}), Pl = ["xlink:href", "fill"], xl = /* @__PURE__ */ pe({
|
|
21
21
|
__name: "index",
|
|
22
22
|
props: {
|
|
23
23
|
iconClass: re.string.isRequired,
|
|
@@ -25,23 +25,23 @@ const re = $t({
|
|
|
25
25
|
color: re.string.def("")
|
|
26
26
|
},
|
|
27
27
|
setup(e) {
|
|
28
|
-
const
|
|
29
|
-
return (c,
|
|
28
|
+
const t = e, l = J(() => `#icon-${t.iconClass}`), a = J(() => t.className ? `svg-icon ${t.className}` : "svg-icon");
|
|
29
|
+
return (c, s) => (n(), $("svg", {
|
|
30
30
|
class: qe(o(a)),
|
|
31
31
|
"aria-hidden": "true"
|
|
32
32
|
}, [
|
|
33
|
-
|
|
34
|
-
"xlink:href": o(
|
|
33
|
+
le("use", {
|
|
34
|
+
"xlink:href": o(l),
|
|
35
35
|
fill: e.color
|
|
36
|
-
}, null, 8,
|
|
36
|
+
}, null, 8, Pl)
|
|
37
37
|
], 2));
|
|
38
38
|
}
|
|
39
|
-
}), ye = (e,
|
|
40
|
-
const
|
|
41
|
-
for (const [a, c] of
|
|
42
|
-
|
|
43
|
-
return
|
|
44
|
-
}, Ge = /* @__PURE__ */ ye(
|
|
39
|
+
}), ye = (e, t) => {
|
|
40
|
+
const l = e.__vccOpts || e;
|
|
41
|
+
for (const [a, c] of t)
|
|
42
|
+
l[a] = c;
|
|
43
|
+
return l;
|
|
44
|
+
}, Ge = /* @__PURE__ */ ye(xl, [["__scopeId", "data-v-ed552a8d"]]), Aa = /* @__PURE__ */ pe({
|
|
45
45
|
__name: "index",
|
|
46
46
|
props: {
|
|
47
47
|
options: {
|
|
@@ -59,27 +59,27 @@ const re = $t({
|
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
setup(e) {
|
|
62
|
-
const
|
|
63
|
-
const a =
|
|
62
|
+
const t = e, l = J(() => {
|
|
63
|
+
const a = t.value;
|
|
64
64
|
if (a === "" || a === null || typeof a > "u")
|
|
65
65
|
return "";
|
|
66
|
-
const c = (
|
|
67
|
-
var
|
|
68
|
-
const u = (
|
|
66
|
+
const c = (s) => {
|
|
67
|
+
var y;
|
|
68
|
+
const u = (y = t.options) == null ? void 0 : y.find((f) => f.value == s || f.label == s);
|
|
69
69
|
return (u == null ? void 0 : u.label) ?? "";
|
|
70
70
|
};
|
|
71
71
|
if (Array.isArray(a))
|
|
72
|
-
return a.map((
|
|
72
|
+
return a.map((s) => c(s)).filter(Boolean).join(t.separator);
|
|
73
73
|
if (typeof a == "string") {
|
|
74
|
-
let
|
|
75
|
-
if (a.indexOf(",") > -1 ?
|
|
76
|
-
return
|
|
74
|
+
let s = [];
|
|
75
|
+
if (a.indexOf(",") > -1 ? s = a.split(",") : a.indexOf("、") > -1 && (s = a.split("、")), s.length > 0)
|
|
76
|
+
return s.map((u) => c(u)).filter(Boolean).join(t.separator);
|
|
77
77
|
}
|
|
78
78
|
return c(a) || a;
|
|
79
79
|
});
|
|
80
|
-
return (a, c) => (
|
|
80
|
+
return (a, c) => (n(), $("span", null, M(o(l)), 1));
|
|
81
81
|
}
|
|
82
|
-
}),
|
|
82
|
+
}), Il = /* @__PURE__ */ pe({
|
|
83
83
|
__name: "index",
|
|
84
84
|
props: {
|
|
85
85
|
options: {
|
|
@@ -92,66 +92,66 @@ const re = $t({
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
setup(e) {
|
|
95
|
-
const
|
|
96
|
-
const a =
|
|
95
|
+
const t = e, l = J(() => {
|
|
96
|
+
const a = t.value;
|
|
97
97
|
if (a === "" || a === null || typeof a > "u")
|
|
98
98
|
return "";
|
|
99
99
|
if (Array.isArray(a)) {
|
|
100
100
|
const c = [];
|
|
101
|
-
return
|
|
102
|
-
(a.indexOf(
|
|
101
|
+
return t.options.map((s) => {
|
|
102
|
+
(a.indexOf(s.value) > -1 || a.indexOf(s.label) > -1) && c.push(s);
|
|
103
103
|
}), c;
|
|
104
104
|
} else if (typeof a == "string") {
|
|
105
105
|
let c = [];
|
|
106
106
|
if (a.indexOf(",") > -1 ? c = a.split(",") : a.indexOf("、") > -1 && (c = a.split("、")), c.length > 0) {
|
|
107
|
-
const
|
|
108
|
-
return
|
|
109
|
-
(c.indexOf(u.value) > -1 || c.indexOf(u.label) > -1) &&
|
|
110
|
-
}),
|
|
107
|
+
const s = [];
|
|
108
|
+
return t.options.map((u) => {
|
|
109
|
+
(c.indexOf(u.value) > -1 || c.indexOf(u.label) > -1) && s.push(u);
|
|
110
|
+
}), s;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
return
|
|
113
|
+
return t.options.find((c) => c.value == a || c.label == a) || a;
|
|
114
114
|
});
|
|
115
115
|
return (a, c) => {
|
|
116
|
-
const
|
|
117
|
-
return Array.isArray(o(
|
|
118
|
-
u.label ? (
|
|
116
|
+
const s = ma;
|
|
117
|
+
return Array.isArray(o(l)) ? (n(!0), $(O, { key: 0 }, Q(o(l), (u) => (n(), $(O, null, [
|
|
118
|
+
u.label ? (n(), h(s, {
|
|
119
119
|
"disable-transitions": !0,
|
|
120
120
|
key: u.value,
|
|
121
121
|
type: u.elTagType || "primary"
|
|
122
122
|
}, {
|
|
123
123
|
default: b(() => [
|
|
124
|
-
|
|
124
|
+
z(M(u.label), 1)
|
|
125
125
|
]),
|
|
126
126
|
_: 2
|
|
127
127
|
}, 1032, ["type"])) : X("", !0)
|
|
128
|
-
], 64))), 256)) : (
|
|
129
|
-
o(
|
|
128
|
+
], 64))), 256)) : (n(), $(O, { key: 1 }, [
|
|
129
|
+
o(l).label ? (n(), h(s, {
|
|
130
130
|
"disable-transitions": !0,
|
|
131
|
-
key: o(
|
|
132
|
-
type: o(
|
|
131
|
+
key: o(l).value,
|
|
132
|
+
type: o(l).elTagType || "primary"
|
|
133
133
|
}, {
|
|
134
134
|
default: b(() => [
|
|
135
|
-
|
|
135
|
+
z(M(o(l).label), 1)
|
|
136
136
|
]),
|
|
137
137
|
_: 1
|
|
138
138
|
}, 8, ["type"])) : X("", !0)
|
|
139
139
|
], 64));
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
}), Pa = /* @__PURE__ */ ye(
|
|
142
|
+
}), Pa = /* @__PURE__ */ ye(Il, [["__scopeId", "data-v-9a5060d2"]]);
|
|
143
143
|
let Ae = null, xa = () => ({}), Je = "";
|
|
144
|
-
const
|
|
145
|
-
const e =
|
|
144
|
+
const Ol = () => {
|
|
145
|
+
const e = Dl.create({ baseURL: Je, timeout: 5e4 });
|
|
146
146
|
return e.interceptors.response.use(
|
|
147
|
-
(
|
|
148
|
-
(
|
|
147
|
+
(t) => t.data,
|
|
148
|
+
(t) => Promise.reject(t)
|
|
149
149
|
), e;
|
|
150
|
-
}, _e = () => (Ae || (Ae =
|
|
150
|
+
}, _e = () => (Ae || (Ae = Ol()), Ae), Ll = (e) => {
|
|
151
151
|
Ae = e;
|
|
152
|
-
}, Xe = () => xa(),
|
|
152
|
+
}, Xe = () => xa(), zl = (e) => {
|
|
153
153
|
xa = e;
|
|
154
|
-
}, Ze = () => Je,
|
|
154
|
+
}, Ze = () => Je, Bl = (e) => {
|
|
155
155
|
Je = e || "";
|
|
156
156
|
};
|
|
157
157
|
function ea(e) {
|
|
@@ -166,7 +166,7 @@ function Ia(e) {
|
|
|
166
166
|
method: "delete"
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
|
-
const
|
|
169
|
+
const Yl = { class: "image-slot" }, Ml = { key: 1 }, Rl = /* @__PURE__ */ pe({
|
|
170
170
|
__name: "index",
|
|
171
171
|
props: {
|
|
172
172
|
modelValue: [String, Object, Array, Number],
|
|
@@ -180,37 +180,37 @@ const Yt = { class: "image-slot" }, Mt = { key: 1 }, Rt = /* @__PURE__ */ pe({
|
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
182
|
setup(e) {
|
|
183
|
-
const
|
|
184
|
-
if (!
|
|
185
|
-
const u =
|
|
186
|
-
return u.forEach((
|
|
187
|
-
}),
|
|
188
|
-
const u =
|
|
183
|
+
const t = e, l = L(""), a = J(() => l.value ? l.value.split(",")[0] : void 0), c = J(() => {
|
|
184
|
+
if (!l.value) return;
|
|
185
|
+
const u = l.value.split(","), y = [];
|
|
186
|
+
return u.forEach((f) => y.push(f)), y;
|
|
187
|
+
}), s = J(() => {
|
|
188
|
+
const u = t.width;
|
|
189
189
|
return typeof u == "string" ? u : `${u}px`;
|
|
190
190
|
});
|
|
191
|
-
return
|
|
192
|
-
const u =
|
|
191
|
+
return J(() => {
|
|
192
|
+
const u = t.height;
|
|
193
193
|
return typeof u == "string" ? u : `${u}px`;
|
|
194
|
-
}), ke(() =>
|
|
194
|
+
}), ke(() => t.modelValue, async (u) => {
|
|
195
195
|
if (u) {
|
|
196
|
-
let
|
|
197
|
-
Array.isArray(u) ?
|
|
198
|
-
} else
|
|
199
|
-
}, { immediate: !0, deep: !0 }), (u,
|
|
200
|
-
const
|
|
201
|
-
return
|
|
202
|
-
o(a) ? (
|
|
196
|
+
let y;
|
|
197
|
+
Array.isArray(u) ? y = u : y = (await ea(u)).data, l.value = y.map((f) => f.url).join(",");
|
|
198
|
+
} else l.value = "";
|
|
199
|
+
}, { immediate: !0, deep: !0 }), (u, y) => {
|
|
200
|
+
const f = Pe, _ = He;
|
|
201
|
+
return n(), $("div", null, [
|
|
202
|
+
o(a) ? (n(), h(_, {
|
|
203
203
|
key: 0,
|
|
204
204
|
src: `${o(a)}`,
|
|
205
205
|
fit: "scale-down",
|
|
206
206
|
loading: "lazy",
|
|
207
|
-
style: fe(`width:${o(
|
|
207
|
+
style: fe(`width:${o(s)};height:${o(s)};`),
|
|
208
208
|
"preview-src-list": o(c),
|
|
209
209
|
"preview-teleported": ""
|
|
210
210
|
}, {
|
|
211
211
|
error: b(() => [
|
|
212
|
-
|
|
213
|
-
F(
|
|
212
|
+
le("div", Yl, [
|
|
213
|
+
F(f, null, {
|
|
214
214
|
default: b(() => [
|
|
215
215
|
F(o(Me))
|
|
216
216
|
]),
|
|
@@ -219,12 +219,12 @@ const Yt = { class: "image-slot" }, Mt = { key: 1 }, Rt = /* @__PURE__ */ pe({
|
|
|
219
219
|
])
|
|
220
220
|
]),
|
|
221
221
|
_: 1
|
|
222
|
-
}, 8, ["src", "style", "preview-src-list"])) : (
|
|
223
|
-
|
|
222
|
+
}, 8, ["src", "style", "preview-src-list"])) : (n(), $("div", Ml, [
|
|
223
|
+
le("div", {
|
|
224
224
|
class: "image-slot",
|
|
225
|
-
style: fe(`width:${o(
|
|
225
|
+
style: fe(`width:${o(s)};height:${o(s)};`)
|
|
226
226
|
}, [
|
|
227
|
-
F(
|
|
227
|
+
F(f, null, {
|
|
228
228
|
default: b(() => [
|
|
229
229
|
F(o(Me))
|
|
230
230
|
]),
|
|
@@ -235,7 +235,7 @@ const Yt = { class: "image-slot" }, Mt = { key: 1 }, Rt = /* @__PURE__ */ pe({
|
|
|
235
235
|
]);
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
|
-
}), Oa = /* @__PURE__ */ ye(
|
|
238
|
+
}), Oa = /* @__PURE__ */ ye(Rl, [["__scopeId", "data-v-dc163acb"]]), jl = { class: "image-slot" }, Fl = ["src"], Hl = { class: "video-thumb__mask" }, Nl = ["src"], Kl = /* @__PURE__ */ pe({
|
|
239
239
|
__name: "index",
|
|
240
240
|
props: {
|
|
241
241
|
data: {
|
|
@@ -252,19 +252,19 @@ const Yt = { class: "image-slot" }, Mt = { key: 1 }, Rt = /* @__PURE__ */ pe({
|
|
|
252
252
|
}
|
|
253
253
|
},
|
|
254
254
|
setup(e) {
|
|
255
|
-
const
|
|
256
|
-
() => typeof
|
|
257
|
-
), c =
|
|
258
|
-
() => typeof
|
|
259
|
-
),
|
|
255
|
+
const t = [".mp4", ".webm", ".ogg", ".mov", ".m4v", ".avi", ".mkv", ".flv", ".wmv", ".3gp", ".mpg", ".mpeg"], l = e, a = J(
|
|
256
|
+
() => typeof l.width == "string" ? l.width : `${l.width}px`
|
|
257
|
+
), c = J(
|
|
258
|
+
() => typeof l.height == "string" ? l.height : `${l.height}px`
|
|
259
|
+
), s = J(() => (l.data.fileSuffix || "").toLowerCase()), u = L(!1), y = L(!1), f = () => {
|
|
260
260
|
u.value = !0;
|
|
261
261
|
};
|
|
262
|
-
return ke(() =>
|
|
263
|
-
|
|
264
|
-
}), (
|
|
265
|
-
const
|
|
266
|
-
return
|
|
267
|
-
[".jpg", ".png", ".jpeg"].indexOf(e.data.fileSuffix) > -1 ? (
|
|
262
|
+
return ke(() => l.data.url, () => {
|
|
263
|
+
y.value = !1;
|
|
264
|
+
}), (_, d) => {
|
|
265
|
+
const B = Pe, D = He, R = Ge, P = Ne;
|
|
266
|
+
return n(), $("span", null, [
|
|
267
|
+
[".jpg", ".png", ".jpeg"].indexOf(e.data.fileSuffix) > -1 ? (n(), h(D, {
|
|
268
268
|
key: 0,
|
|
269
269
|
src: e.data.url,
|
|
270
270
|
fit: "cover",
|
|
@@ -273,8 +273,8 @@ const Yt = { class: "image-slot" }, Mt = { key: 1 }, Rt = /* @__PURE__ */ pe({
|
|
|
273
273
|
"preview-teleported": ""
|
|
274
274
|
}, {
|
|
275
275
|
error: b(() => [
|
|
276
|
-
|
|
277
|
-
F(
|
|
276
|
+
le("div", jl, [
|
|
277
|
+
F(B, null, {
|
|
278
278
|
default: b(() => [
|
|
279
279
|
F(o(Me))
|
|
280
280
|
]),
|
|
@@ -283,33 +283,33 @@ const Yt = { class: "image-slot" }, Mt = { key: 1 }, Rt = /* @__PURE__ */ pe({
|
|
|
283
283
|
])
|
|
284
284
|
]),
|
|
285
285
|
_: 1
|
|
286
|
-
}, 8, ["src", "preview-src-list", "style"])) : [".xls", ".xlsx", ".csv"].indexOf(e.data.fileSuffix) > -1 ? (
|
|
286
|
+
}, 8, ["src", "preview-src-list", "style"])) : [".xls", ".xlsx", ".csv"].indexOf(e.data.fileSuffix) > -1 ? (n(), h(R, {
|
|
287
287
|
key: 1,
|
|
288
288
|
"icon-class": "excel",
|
|
289
289
|
style: fe(`width:${o(a)};height:${o(c)};`)
|
|
290
|
-
}, null, 8, ["style"])) : [".doc", ".docx"].indexOf(e.data.fileSuffix) > -1 ? (
|
|
290
|
+
}, null, 8, ["style"])) : [".doc", ".docx"].indexOf(e.data.fileSuffix) > -1 ? (n(), h(R, {
|
|
291
291
|
key: 2,
|
|
292
292
|
"icon-class": "word",
|
|
293
293
|
style: fe(`width:${o(a)};height:${o(c)};`)
|
|
294
|
-
}, null, 8, ["style"])) : [".pdf"].indexOf(e.data.fileSuffix) > -1 ? (
|
|
294
|
+
}, null, 8, ["style"])) : [".pdf"].indexOf(e.data.fileSuffix) > -1 ? (n(), h(R, {
|
|
295
295
|
key: 3,
|
|
296
296
|
"icon-class": "pdf",
|
|
297
297
|
style: fe(`width:${o(a)};height:${o(c)};`)
|
|
298
|
-
}, null, 8, ["style"])) : [".tet"].indexOf(e.data.fileSuffix) > -1 ? (
|
|
298
|
+
}, null, 8, ["style"])) : [".tet"].indexOf(e.data.fileSuffix) > -1 ? (n(), h(R, {
|
|
299
299
|
key: 4,
|
|
300
300
|
"icon-class": "tet",
|
|
301
301
|
style: fe(`width:${o(a)};height:${o(c)};`)
|
|
302
|
-
}, null, 8, ["style"])) : [".zip"].indexOf(e.data.fileSuffix) > -1 ? (
|
|
302
|
+
}, null, 8, ["style"])) : [".zip"].indexOf(e.data.fileSuffix) > -1 ? (n(), h(R, {
|
|
303
303
|
key: 5,
|
|
304
304
|
"icon-class": "zip",
|
|
305
305
|
style: fe(`width:${o(a)};height:${o(c)};`)
|
|
306
|
-
}, null, 8, ["style"])) :
|
|
306
|
+
}, null, 8, ["style"])) : t.indexOf(o(s)) > -1 ? (n(), $("div", {
|
|
307
307
|
key: 6,
|
|
308
308
|
class: "video-thumb",
|
|
309
309
|
style: fe(`width:${o(a)};height:${o(c)};`),
|
|
310
|
-
onClick:
|
|
310
|
+
onClick: f
|
|
311
311
|
}, [
|
|
312
|
-
o(
|
|
312
|
+
o(y) ? (n(), h(B, {
|
|
313
313
|
key: 1,
|
|
314
314
|
class: "video-thumb__error"
|
|
315
315
|
}, {
|
|
@@ -317,63 +317,63 @@ const Yt = { class: "image-slot" }, Mt = { key: 1 }, Rt = /* @__PURE__ */ pe({
|
|
|
317
317
|
F(o(na))
|
|
318
318
|
]),
|
|
319
319
|
_: 1
|
|
320
|
-
})) : (
|
|
320
|
+
})) : (n(), $("video", {
|
|
321
321
|
key: 0,
|
|
322
322
|
src: e.data.url,
|
|
323
323
|
class: "video-thumb__media",
|
|
324
324
|
muted: "",
|
|
325
325
|
preload: "metadata",
|
|
326
|
-
onError:
|
|
327
|
-
}, null, 40,
|
|
328
|
-
|
|
329
|
-
F(
|
|
326
|
+
onError: d[0] || (d[0] = (H) => y.value = !0)
|
|
327
|
+
}, null, 40, Fl)),
|
|
328
|
+
le("span", Hl, [
|
|
329
|
+
F(B, null, {
|
|
330
330
|
default: b(() => [
|
|
331
331
|
F(o(na))
|
|
332
332
|
]),
|
|
333
333
|
_: 1
|
|
334
334
|
})
|
|
335
335
|
])
|
|
336
|
-
], 4)) : (
|
|
336
|
+
], 4)) : (n(), h(R, {
|
|
337
337
|
key: 7,
|
|
338
338
|
"icon-class": "unknown",
|
|
339
339
|
style: fe(`width:${o(a)};height:${o(c)};`)
|
|
340
340
|
}, null, 8, ["style"])),
|
|
341
341
|
F(P, {
|
|
342
342
|
modelValue: o(u),
|
|
343
|
-
"onUpdate:modelValue":
|
|
343
|
+
"onUpdate:modelValue": d[1] || (d[1] = (H) => Se(u) ? u.value = H : null),
|
|
344
344
|
title: "視頻預覽",
|
|
345
345
|
width: "720px",
|
|
346
346
|
"append-to-body": "",
|
|
347
347
|
"destroy-on-close": ""
|
|
348
348
|
}, {
|
|
349
349
|
default: b(() => [
|
|
350
|
-
|
|
350
|
+
le("video", {
|
|
351
351
|
src: e.data.url,
|
|
352
352
|
class: "video-player",
|
|
353
353
|
controls: "",
|
|
354
354
|
autoplay: ""
|
|
355
|
-
}, null, 8,
|
|
355
|
+
}, null, 8, Nl)
|
|
356
356
|
]),
|
|
357
357
|
_: 1
|
|
358
358
|
}, 8, ["modelValue"])
|
|
359
359
|
]);
|
|
360
360
|
};
|
|
361
361
|
}
|
|
362
|
-
}), La = /* @__PURE__ */ ye(
|
|
362
|
+
}), La = /* @__PURE__ */ ye(Kl, [["__scopeId", "data-v-699b2b1a"]]), za = {
|
|
363
363
|
bool: [
|
|
364
364
|
{ label: "是", value: "1" },
|
|
365
365
|
{ label: "否", value: "0" },
|
|
366
366
|
{ label: "是", value: "True" },
|
|
367
367
|
{ label: "否", value: "False" }
|
|
368
368
|
]
|
|
369
|
-
},
|
|
369
|
+
}, Wl = [
|
|
370
370
|
{ prop: "createTime", width: "165px" },
|
|
371
371
|
{ prop: "createBy", width: "100px" },
|
|
372
372
|
{ prop: "orderNum", width: "80px" },
|
|
373
373
|
{ prop: "sort", width: "80px" },
|
|
374
374
|
{ prop: "code", width: "120px" },
|
|
375
375
|
{ prop: "updateTime", width: "165px" }
|
|
376
|
-
],
|
|
376
|
+
], ql = [10, 15, 20, 30, 50, 100], sa = {
|
|
377
377
|
pageSize: 15,
|
|
378
378
|
pageNum: 1,
|
|
379
379
|
total: 0,
|
|
@@ -382,407 +382,425 @@ const Yt = { class: "image-slot" }, Mt = { key: 1 }, Rt = /* @__PURE__ */ pe({
|
|
|
382
382
|
}, Ie = {
|
|
383
383
|
FULL: "total, sizes, prev, pager, next",
|
|
384
384
|
SIMPLE: "total"
|
|
385
|
-
}, ca = 30,
|
|
385
|
+
}, ca = 30, Ql = 28;
|
|
386
386
|
function Re(e) {
|
|
387
387
|
if (!e) return {};
|
|
388
|
-
const
|
|
389
|
-
for (const
|
|
390
|
-
const a = e[
|
|
391
|
-
a !== "" && a !== null && a !== void 0 && (!Array.isArray(a) || a.length > 0) && (l
|
|
388
|
+
const t = {};
|
|
389
|
+
for (const l in e) {
|
|
390
|
+
const a = e[l];
|
|
391
|
+
a !== "" && a !== null && a !== void 0 && (!Array.isArray(a) || a.length > 0) && (t[l] = a);
|
|
392
392
|
}
|
|
393
|
-
return
|
|
393
|
+
return t;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function Gl(e) {
|
|
396
396
|
if (e.width) return String(e.width);
|
|
397
|
-
const
|
|
398
|
-
return
|
|
397
|
+
const t = Wl.find((l) => l.prop === e.prop);
|
|
398
|
+
return t ? t.width : e.prop.includes("time") ? "100px" : e.prop == "imageUrl" || e.prop == "image" ? "80px" : "auto";
|
|
399
399
|
}
|
|
400
|
-
function je(e,
|
|
401
|
-
if (
|
|
402
|
-
return
|
|
400
|
+
function je(e, t) {
|
|
401
|
+
if (t)
|
|
402
|
+
return t.includes(".") ? t.split(".").reduce((l, a) => l == null ? void 0 : l[a], e) : e == null ? void 0 : e[t];
|
|
403
403
|
}
|
|
404
|
-
function Oe(e,
|
|
405
|
-
const a =
|
|
404
|
+
function Oe(e, t, l) {
|
|
405
|
+
const a = l || t.prop;
|
|
406
406
|
if (!a) return "";
|
|
407
407
|
const c = je(e, a);
|
|
408
408
|
if (c != null) {
|
|
409
|
-
const
|
|
410
|
-
let
|
|
411
|
-
if (!
|
|
412
|
-
const
|
|
413
|
-
|
|
409
|
+
const s = l ? t.subPrefix || "" : t.prefix || "", u = l ? t.subSuffix || "" : t.suffix || "";
|
|
410
|
+
let y = `${s}${c}${u}`;
|
|
411
|
+
if (!l && t.suffixProp) {
|
|
412
|
+
const f = je(e, t.suffixProp);
|
|
413
|
+
f != null && f !== "" && (y += f);
|
|
414
414
|
}
|
|
415
|
-
return
|
|
415
|
+
return y;
|
|
416
416
|
}
|
|
417
417
|
return "";
|
|
418
418
|
}
|
|
419
|
-
function
|
|
420
|
-
e.forEach((
|
|
421
|
-
|
|
419
|
+
function Jl(e) {
|
|
420
|
+
e.forEach((t) => {
|
|
421
|
+
t.form || (t.form = { order: 100 }), t.form.order == null && (t.form.order = 100), !t.form.type && t.type && (t.form.type = t.type), !t.form.prop && t.prop && (t.form.prop = t.prop), t.search && !t.search.dictType && t.dictType && (t.search.dictType = t.dictType), !t.form.dictType && t.dictType && (t.form.dictType = t.dictType), !t.form.inactiveValue && t.inactiveValue && (t.form.inactiveValue = t.inactiveValue), !t.form.activeValue && t.activeValue && (t.form.activeValue = t.activeValue), t.form.type === "checkbox" && (t.label = ""), t.search && (t.search.prop = t.search.prop ?? t.prop);
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
e.forEach((
|
|
426
|
-
if (!
|
|
427
|
-
const
|
|
428
|
-
|
|
424
|
+
function Xl(e) {
|
|
425
|
+
e.forEach((t) => {
|
|
426
|
+
if (!t.form) return;
|
|
427
|
+
const l = t.form.rules || [];
|
|
428
|
+
t.form.required && l.push({
|
|
429
429
|
required: !0,
|
|
430
|
-
message: `${
|
|
430
|
+
message: `${t.label}必填`,
|
|
431
431
|
trigger: "blur"
|
|
432
|
-
}),
|
|
432
|
+
}), t.form.rules = l.length > 0 ? l : void 0;
|
|
433
433
|
});
|
|
434
434
|
}
|
|
435
|
-
function Ba(e,
|
|
436
|
-
return [...e].sort((
|
|
437
|
-
const c = (
|
|
438
|
-
const
|
|
439
|
-
let
|
|
440
|
-
for (const
|
|
441
|
-
|
|
442
|
-
return
|
|
443
|
-
},
|
|
444
|
-
return
|
|
435
|
+
function Ba(e, t = "order") {
|
|
436
|
+
return [...e].sort((l, a) => {
|
|
437
|
+
const c = (y, f) => {
|
|
438
|
+
const _ = f.split(".");
|
|
439
|
+
let d = y;
|
|
440
|
+
for (const B of _)
|
|
441
|
+
d = d == null ? void 0 : d[B];
|
|
442
|
+
return d ?? 100;
|
|
443
|
+
}, s = c(l, t), u = c(a, t);
|
|
444
|
+
return s - u;
|
|
445
445
|
});
|
|
446
446
|
}
|
|
447
|
-
function
|
|
448
|
-
return e.filter((a) => !(a.canEdit === !1 ||
|
|
447
|
+
function Zl(e, t, l) {
|
|
448
|
+
return e.filter((a) => !(a.canEdit === !1 || l && a.canUpdate === !1 || !l && a.canCreate === !1));
|
|
449
449
|
}
|
|
450
|
-
function
|
|
451
|
-
if (!
|
|
452
|
-
for (const
|
|
453
|
-
if (
|
|
450
|
+
function et(e, t) {
|
|
451
|
+
if (!t.show) return !0;
|
|
452
|
+
for (const l in t.show)
|
|
453
|
+
if (t.show[l].includes(e[l]))
|
|
454
454
|
return !0;
|
|
455
455
|
return !1;
|
|
456
456
|
}
|
|
457
|
-
function
|
|
458
|
-
if (!
|
|
459
|
-
for (const
|
|
460
|
-
if (
|
|
457
|
+
function at(e, t) {
|
|
458
|
+
if (!t.disable && !t.enable) return !1;
|
|
459
|
+
for (const l in t.disable)
|
|
460
|
+
if (t.disable[l].includes(e[l]))
|
|
461
461
|
return !0;
|
|
462
|
-
for (const
|
|
463
|
-
if (!
|
|
462
|
+
for (const l in t.enable)
|
|
463
|
+
if (!t.enable[l].includes(e[l]))
|
|
464
464
|
return !0;
|
|
465
465
|
return !1;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
468
|
-
if (l) {
|
|
469
|
-
for (const a in l)
|
|
470
|
-
if (l[a].includes(e[a]))
|
|
471
|
-
return !1;
|
|
472
|
-
}
|
|
467
|
+
function lt(e, t, l) {
|
|
473
468
|
if (t) {
|
|
474
469
|
for (const a in t)
|
|
475
|
-
if (
|
|
470
|
+
if (t[a].includes(e[a]))
|
|
471
|
+
return !1;
|
|
472
|
+
}
|
|
473
|
+
if (l) {
|
|
474
|
+
for (const a in l)
|
|
475
|
+
if (!l[a].includes(e[a]))
|
|
476
476
|
return !1;
|
|
477
477
|
}
|
|
478
478
|
return !0;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
|
|
480
|
+
function tt(e, t, l, a) {
|
|
481
|
+
t && t[0] && t[1] && (e[l] = `${t[0]},${t[1]}`, a == null || a.addDateRange(e, t, l));
|
|
482
482
|
}
|
|
483
|
-
function
|
|
484
|
-
const { proxy:
|
|
483
|
+
function ot(e) {
|
|
484
|
+
const { proxy: t } = he(), l = L([]), a = L(!1), c = L([]), s = L({}), u = L(), y = L({
|
|
485
485
|
...sa,
|
|
486
486
|
pageSize: e.initialPageSize ?? sa.pageSize
|
|
487
|
-
}),
|
|
487
|
+
}), f = L(ql), _ = L(Ie.FULL), d = async () => {
|
|
488
488
|
var U;
|
|
489
489
|
if (!e.listApi) {
|
|
490
|
-
e.data ?
|
|
490
|
+
e.data ? l.value = Array.isArray(e.data) ? e.data : ((U = e.data) == null ? void 0 : U.value) || [] : l.value = [];
|
|
491
491
|
return;
|
|
492
492
|
}
|
|
493
493
|
a.value = !0;
|
|
494
494
|
try {
|
|
495
|
-
const
|
|
495
|
+
const w = await B(null), E = await e.listApi(w);
|
|
496
496
|
e.afterQuery && await e.afterQuery(E);
|
|
497
497
|
let x = E.rows || E.data;
|
|
498
|
-
e.treeProps && (x =
|
|
499
|
-
const W = E.total /
|
|
500
|
-
|
|
501
|
-
} catch (
|
|
502
|
-
console.error("Query failed:",
|
|
498
|
+
e.treeProps && (x = t == null ? void 0 : t.handleTree(E.data, e.rowKey)), l.value = x, y.value.total = E.total;
|
|
499
|
+
const W = E.total / y.value.pageSize <= 1;
|
|
500
|
+
_.value = W ? Ie.SIMPLE : Ie.FULL, t == null || t.$forceUpdate();
|
|
501
|
+
} catch (w) {
|
|
502
|
+
console.error("Query failed:", w);
|
|
503
503
|
} finally {
|
|
504
504
|
a.value = !1;
|
|
505
505
|
}
|
|
506
|
-
},
|
|
507
|
-
U && (
|
|
508
|
-
let
|
|
506
|
+
}, B = async (U) => {
|
|
507
|
+
U && (s.value = Re(U));
|
|
508
|
+
let w = e.queryParams || {};
|
|
509
509
|
if (e.beforeQuery) {
|
|
510
510
|
const E = await e.beforeQuery({});
|
|
511
|
-
|
|
512
|
-
...
|
|
513
|
-
...
|
|
514
|
-
...
|
|
511
|
+
w = {
|
|
512
|
+
...y.value,
|
|
513
|
+
...w,
|
|
514
|
+
...s.value,
|
|
515
515
|
...E
|
|
516
516
|
};
|
|
517
517
|
} else
|
|
518
|
-
|
|
519
|
-
...
|
|
520
|
-
...
|
|
521
|
-
...
|
|
518
|
+
w = {
|
|
519
|
+
...y.value,
|
|
520
|
+
...w,
|
|
521
|
+
...s.value
|
|
522
522
|
};
|
|
523
|
-
return
|
|
524
|
-
},
|
|
525
|
-
U && (
|
|
526
|
-
},
|
|
527
|
-
|
|
523
|
+
return w;
|
|
524
|
+
}, D = (U) => {
|
|
525
|
+
U && (s.value = Re(U)), d();
|
|
526
|
+
}, R = (U) => {
|
|
527
|
+
y.value.pageNum = U, d();
|
|
528
528
|
}, P = (U) => {
|
|
529
|
-
|
|
529
|
+
y.value.pageSize = U, d();
|
|
530
530
|
}, H = (U) => {
|
|
531
|
-
U.order && (
|
|
531
|
+
U.order && (y.value.orderByColumn = U.prop, y.value.isAsc = U.order), d();
|
|
532
532
|
}, Z = (U) => {
|
|
533
533
|
c.value = U, e.selectionChange && e.selectionChange(U);
|
|
534
534
|
}, ee = () => {
|
|
535
535
|
const U = e.queryParams || {};
|
|
536
|
-
U.orderByColumn && (
|
|
536
|
+
U.orderByColumn && (y.value.orderByColumn = U.orderByColumn, u.value = {
|
|
537
537
|
prop: U.orderByColumn,
|
|
538
538
|
order: U.isAsc === "asc" ? "ascending" : "descending"
|
|
539
|
-
}), U.isAsc && (
|
|
539
|
+
}), U.isAsc && (y.value.isAsc = U.isAsc);
|
|
540
540
|
};
|
|
541
541
|
return {
|
|
542
|
-
listData:
|
|
542
|
+
listData: l,
|
|
543
543
|
loading: a,
|
|
544
544
|
multipleSelection: c,
|
|
545
|
-
pageOptions:
|
|
546
|
-
listSize:
|
|
547
|
-
pagingLayout:
|
|
545
|
+
pageOptions: y,
|
|
546
|
+
listSize: f,
|
|
547
|
+
pagingLayout: _,
|
|
548
548
|
defaultSort: u,
|
|
549
|
-
executeQuery:
|
|
550
|
-
getQueryParams:
|
|
551
|
-
refreshTable:
|
|
552
|
-
handlePageChange:
|
|
549
|
+
executeQuery: d,
|
|
550
|
+
getQueryParams: B,
|
|
551
|
+
refreshTable: D,
|
|
552
|
+
handlePageChange: R,
|
|
553
553
|
handleSizeChange: P,
|
|
554
554
|
handleSortChange: H,
|
|
555
555
|
handleSelectionChange: Z,
|
|
556
556
|
initData: async () => {
|
|
557
|
-
ee(), await
|
|
557
|
+
ee(), await d();
|
|
558
558
|
}
|
|
559
559
|
};
|
|
560
560
|
}
|
|
561
561
|
function Ya() {
|
|
562
|
-
const { proxy: e } = he(),
|
|
563
|
-
for (const
|
|
564
|
-
if (
|
|
565
|
-
const
|
|
566
|
-
|
|
567
|
-
} else if (
|
|
568
|
-
const
|
|
569
|
-
|
|
562
|
+
const { proxy: e } = he(), t = async (u) => {
|
|
563
|
+
for (const y of u)
|
|
564
|
+
if (y.type === "dictTag" || y.type === "dictText") {
|
|
565
|
+
const f = await (e == null ? void 0 : e.useOneDict(y.dictType));
|
|
566
|
+
y.data = Le(f);
|
|
567
|
+
} else if (y.type === "commonDictTag" || y.type === "commonDictText") {
|
|
568
|
+
const f = await (e == null ? void 0 : e.useOneCommonDict(y.dictType));
|
|
569
|
+
y.data = Le(f);
|
|
570
570
|
}
|
|
571
|
-
},
|
|
572
|
-
if (!
|
|
573
|
-
switch (
|
|
571
|
+
}, l = async (u) => {
|
|
572
|
+
if (!u.search) return;
|
|
573
|
+
switch (u.search.type) {
|
|
574
574
|
case "selectApi":
|
|
575
|
-
|
|
575
|
+
u.search.api ? await a(u) : console.error(`${u.prop}中search对象未设置api参数`);
|
|
576
|
+
break;
|
|
577
|
+
case "selectApiString":
|
|
578
|
+
u.search.api ? await c(u) : console.error(`${u.prop}中search对象未设置api参数`);
|
|
576
579
|
break;
|
|
577
580
|
case "treeSelectApi":
|
|
578
|
-
|
|
581
|
+
u.search.api ? await s(u) : console.error(`${u.prop}中search对象未设置api参数`);
|
|
579
582
|
break;
|
|
580
583
|
case "selectCommonDict":
|
|
581
|
-
|
|
584
|
+
u.search.data = await (e == null ? void 0 : e.useOneCommonDict(u.search.dictType));
|
|
582
585
|
break;
|
|
583
586
|
case "selectDict":
|
|
584
|
-
|
|
587
|
+
u.search.data = await (e == null ? void 0 : e.useOneDict(u.search.dictType));
|
|
585
588
|
break;
|
|
586
589
|
}
|
|
587
|
-
}, a = async (
|
|
588
|
-
var
|
|
589
|
-
if (!((
|
|
590
|
-
const
|
|
590
|
+
}, a = async (u) => {
|
|
591
|
+
var f;
|
|
592
|
+
if (!((f = u.search) != null && f.api)) return;
|
|
593
|
+
const y = {
|
|
594
|
+
pageNum: 1,
|
|
595
|
+
pageSize: 1e3,
|
|
596
|
+
filedName: u.prop,
|
|
597
|
+
...u.search.apiParams || {}
|
|
598
|
+
};
|
|
599
|
+
try {
|
|
600
|
+
const _ = await u.search.api(y);
|
|
601
|
+
u.search.data = _.data || _.rows;
|
|
602
|
+
} catch (_) {
|
|
603
|
+
console.error(`Failed to load API data for ${u.prop}:`, _);
|
|
604
|
+
}
|
|
605
|
+
}, c = async (u) => {
|
|
606
|
+
var f;
|
|
607
|
+
if (!((f = u.search) != null && f.api)) return;
|
|
608
|
+
const y = {
|
|
591
609
|
pageNum: 1,
|
|
592
610
|
pageSize: 1e3,
|
|
593
|
-
filedName:
|
|
594
|
-
...
|
|
611
|
+
filedName: u.prop,
|
|
612
|
+
...u.search.apiParams || {}
|
|
595
613
|
};
|
|
596
614
|
try {
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
} catch (
|
|
600
|
-
console.error(`Failed to load API data for ${
|
|
615
|
+
const _ = await u.search.api(y), d = _.data || _.rows || _;
|
|
616
|
+
u.search.data = Array.isArray(d) ? d.map((B) => String(B)) : [];
|
|
617
|
+
} catch (_) {
|
|
618
|
+
console.error(`Failed to load API string data for ${u.prop}:`, _);
|
|
601
619
|
}
|
|
602
|
-
},
|
|
603
|
-
var
|
|
604
|
-
if ((
|
|
620
|
+
}, s = async (u) => {
|
|
621
|
+
var y;
|
|
622
|
+
if ((y = u.search) != null && y.api)
|
|
605
623
|
try {
|
|
606
|
-
const
|
|
607
|
-
if (
|
|
608
|
-
const
|
|
609
|
-
|
|
624
|
+
const f = await u.search.api({ pageNum: 1, pageSize: 1e3 });
|
|
625
|
+
if (u.search.data = f.data || f.rows || f, u.search.data && Array.isArray(u.search.data)) {
|
|
626
|
+
const d = (u.search.props || { value: "id", label: "label", children: "children" }).value || "id";
|
|
627
|
+
u.search.defaultExpandedKeys = u.search.data.map((B) => B[d]);
|
|
610
628
|
}
|
|
611
|
-
} catch (
|
|
612
|
-
console.error(`Failed to load tree API data for ${
|
|
629
|
+
} catch (f) {
|
|
630
|
+
console.error(`Failed to load tree API data for ${u.prop}:`, f);
|
|
613
631
|
}
|
|
614
632
|
};
|
|
615
633
|
return {
|
|
616
|
-
initColumnDicts:
|
|
617
|
-
initSearchDicts:
|
|
634
|
+
initColumnDicts: t,
|
|
635
|
+
initSearchDicts: l,
|
|
618
636
|
initSelectApi: a
|
|
619
637
|
};
|
|
620
638
|
}
|
|
621
639
|
let aa = () => !0, Ma = () => !0;
|
|
622
|
-
const
|
|
640
|
+
const rt = (e) => {
|
|
623
641
|
e.hasPermi && (aa = e.hasPermi), e.hasRoles && (Ma = e.hasRoles);
|
|
624
642
|
}, Fe = (e) => {
|
|
625
643
|
if (e == null) return !0;
|
|
626
|
-
const
|
|
627
|
-
return
|
|
628
|
-
},
|
|
629
|
-
mounted(e,
|
|
644
|
+
const t = Array.isArray(e) ? e : [e];
|
|
645
|
+
return t.length === 0 ? !0 : aa(t);
|
|
646
|
+
}, nt = {
|
|
647
|
+
mounted(e, t) {
|
|
630
648
|
var a;
|
|
631
|
-
const { value:
|
|
632
|
-
|
|
649
|
+
const { value: l } = t;
|
|
650
|
+
l != null && Array.isArray(l) && l.length > 0 && (aa(l) || (a = e.parentNode) == null || a.removeChild(e));
|
|
633
651
|
}
|
|
634
|
-
},
|
|
635
|
-
mounted(e,
|
|
652
|
+
}, st = {
|
|
653
|
+
mounted(e, t) {
|
|
636
654
|
var a;
|
|
637
|
-
const { value:
|
|
638
|
-
|
|
655
|
+
const { value: l } = t;
|
|
656
|
+
l != null && Array.isArray(l) && l.length > 0 && (Ma(l) || (a = e.parentNode) == null || a.removeChild(e));
|
|
639
657
|
}
|
|
640
|
-
},
|
|
658
|
+
}, ct = {
|
|
641
659
|
key: 3,
|
|
642
660
|
class: "image-style"
|
|
643
|
-
},
|
|
661
|
+
}, ut = {
|
|
644
662
|
key: 8,
|
|
645
663
|
class: "color-cell"
|
|
646
|
-
},
|
|
664
|
+
}, it = {
|
|
647
665
|
key: 19,
|
|
648
666
|
style: { "line-height": "16px" }
|
|
649
|
-
},
|
|
667
|
+
}, dt = { style: { margin: "20px 0px" } }, pt = /* @__PURE__ */ pe({
|
|
650
668
|
__name: "curdTable",
|
|
651
669
|
props: {
|
|
652
670
|
dataSource: {},
|
|
653
671
|
maxHeight: {}
|
|
654
672
|
},
|
|
655
673
|
emits: ["actionEvent", "selectionChange", "rowClick"],
|
|
656
|
-
setup(e, { expose:
|
|
657
|
-
const { proxy: a } = he(), c =
|
|
658
|
-
listData:
|
|
659
|
-
loading:
|
|
660
|
-
multipleSelection:
|
|
661
|
-
pageOptions:
|
|
662
|
-
listSize:
|
|
663
|
-
pagingLayout:
|
|
674
|
+
setup(e, { expose: t, emit: l }) {
|
|
675
|
+
const { proxy: a } = he(), c = l, s = e, u = J(() => s.dataSource.maxHeight ?? s.maxHeight), y = L(), {
|
|
676
|
+
listData: f,
|
|
677
|
+
loading: _,
|
|
678
|
+
multipleSelection: d,
|
|
679
|
+
pageOptions: B,
|
|
680
|
+
listSize: D,
|
|
681
|
+
pagingLayout: R,
|
|
664
682
|
defaultSort: P,
|
|
665
683
|
refreshTable: H,
|
|
666
684
|
handlePageChange: Z,
|
|
667
685
|
handleSizeChange: ee,
|
|
668
|
-
handleSortChange:
|
|
686
|
+
handleSortChange: S,
|
|
669
687
|
handleSelectionChange: U,
|
|
670
|
-
initData:
|
|
688
|
+
initData: w,
|
|
671
689
|
getQueryParams: E
|
|
672
|
-
} =
|
|
690
|
+
} = ot(s.dataSource), { initColumnDicts: x } = Ya(), W = L(za), C = (k) => k == null ? void 0 : k[s.dataSource.rowKey], p = J(() => s.dataSource.actions ? s.dataSource.actions.filter(
|
|
673
691
|
(k) => k.action !== "create" && k.action !== "back" && (!k.position || k.position === "table") && Fe(k.permission)
|
|
674
692
|
) : []), T = (k) => {
|
|
675
693
|
var N;
|
|
676
|
-
return (N =
|
|
677
|
-
}, A =
|
|
678
|
-
const k =
|
|
694
|
+
return (N = s.dataSource.disabledCheckedRowKeys) != null && N.includes(C(k)) ? !1 : lt(k, s.dataSource.selectionDisable, s.dataSource.selectionEnable);
|
|
695
|
+
}, A = J(() => {
|
|
696
|
+
const k = s.dataSource.actionColumnWidth;
|
|
679
697
|
if (k != null && k !== "")
|
|
680
698
|
return typeof k == "number" ? `${k}px` : k;
|
|
681
|
-
let N = p.value.length *
|
|
699
|
+
let N = p.value.length * Ql;
|
|
682
700
|
return N < ca && (N = ca), `${N + 40}px`;
|
|
683
|
-
}), K = (k, N) =>
|
|
701
|
+
}), K = (k, N) => et(k, N), G = (k, N) => at(k, N), se = (k) => Gl(k), V = (k) => Fe(k == null ? void 0 : k.permission), Y = (k) => typeof k.visible == "function" ? !!k.visible(k, s.dataSource) : k.visible !== !1, q = (k) => {
|
|
684
702
|
var ae;
|
|
685
|
-
const N = k.align ||
|
|
703
|
+
const N = k.align || s.dataSource.align;
|
|
686
704
|
return N || (((ae = k.label) == null ? void 0 : ae.indexOf("時間")) > -1 || !1 || k.type == "dictTag" || k.type == "image" || k.type == "switch" || k.type == "imageUrl" ? "center" : "left");
|
|
687
705
|
}, j = (k, N) => {
|
|
688
706
|
const ae = a == null ? void 0 : a.useDict(k.dictType)[k.dictType];
|
|
689
707
|
if (ae != null) {
|
|
690
|
-
const
|
|
708
|
+
const te = N[k.prop], oe = ae.filter((be) => be.value == te);
|
|
691
709
|
return oe.length == 0 ? "" : oe[0].label;
|
|
692
710
|
} else console.error(k.dictType + " 字典不存在");
|
|
693
711
|
}, ne = (k, N) => {
|
|
694
712
|
const ae = W.value[k.dictType];
|
|
695
713
|
if (ae != null) {
|
|
696
|
-
const
|
|
714
|
+
const te = N[k.prop], oe = ae.find((be) => be.value == te);
|
|
697
715
|
return oe == null ? "" : oe.label;
|
|
698
716
|
} else console.error(k.dictType + " 字典不存在");
|
|
699
717
|
}, ue = (k, N) => {
|
|
700
718
|
if (k.data != null) {
|
|
701
|
-
const ae = N[k.prop],
|
|
702
|
-
return
|
|
719
|
+
const ae = N[k.prop], te = k.data.find((oe) => oe.value == ae);
|
|
720
|
+
return te == null ? "" : te.label;
|
|
703
721
|
} else console.error("未配置data屬性");
|
|
704
722
|
}, me = (k, N) => {
|
|
705
723
|
if (k.data != null) {
|
|
706
|
-
const ae = N[k.prop],
|
|
707
|
-
return
|
|
724
|
+
const ae = N[k.prop], te = k.data.find((oe) => oe.value == ae);
|
|
725
|
+
return te == null ? "info" : te.tagType;
|
|
708
726
|
} else console.error("未配置data屬性");
|
|
709
|
-
},
|
|
727
|
+
}, ce = (k, N) => Oe(k, N), ge = (k, N) => k.formatter(N, k, je(N, k.prop)) ?? "", i = (k) => {
|
|
710
728
|
const N = Array.isArray(k) ? k : [];
|
|
711
729
|
U(N), c("selectionChange", N);
|
|
712
|
-
},
|
|
713
|
-
var
|
|
714
|
-
return (oe = (
|
|
715
|
-
},
|
|
730
|
+
}, m = (k, N, ae) => {
|
|
731
|
+
var te, oe;
|
|
732
|
+
return (oe = (te = s.dataSource).rowClick) == null ? void 0 : oe.call(te, k, N, ae);
|
|
733
|
+
}, r = (k, N) => c("actionEvent", k, N), Ce = () => d.value, v = async () => {
|
|
716
734
|
var N, ae;
|
|
717
|
-
if (!
|
|
735
|
+
if (!s.dataSource.showSelection || !((N = s.dataSource.checkedRowKeys) != null && N.length)) return;
|
|
718
736
|
await Be();
|
|
719
|
-
const k =
|
|
737
|
+
const k = y.value;
|
|
720
738
|
if (k != null && k.toggleRowSelection)
|
|
721
|
-
for (const
|
|
722
|
-
const oe =
|
|
739
|
+
for (const te of f.value) {
|
|
740
|
+
const oe = C(te);
|
|
723
741
|
if (oe == null) continue;
|
|
724
742
|
const be = String(oe);
|
|
725
|
-
(ae =
|
|
743
|
+
(ae = s.dataSource.checkedRowKeys) != null && ae.includes(be) && k.toggleRowSelection(te, !0);
|
|
726
744
|
}
|
|
727
745
|
}, Ja = async () => {
|
|
728
746
|
var N, ae;
|
|
729
|
-
if (!
|
|
747
|
+
if (!s.dataSource.showSelection || !((N = s.dataSource.disabledCheckedRowKeys) != null && N.length)) return;
|
|
730
748
|
await Be();
|
|
731
|
-
const k =
|
|
749
|
+
const k = y.value;
|
|
732
750
|
if (k != null && k.toggleRowSelection)
|
|
733
|
-
for (const
|
|
734
|
-
const oe =
|
|
751
|
+
for (const te of f.value) {
|
|
752
|
+
const oe = C(te);
|
|
735
753
|
if (oe == null) continue;
|
|
736
754
|
const be = String(oe);
|
|
737
|
-
(ae =
|
|
755
|
+
(ae = s.dataSource.disabledCheckedRowKeys) != null && ae.includes(be) && k.toggleRowSelection(te, !0);
|
|
738
756
|
}
|
|
739
|
-
},
|
|
740
|
-
await x(
|
|
757
|
+
}, la = async () => {
|
|
758
|
+
await x(s.dataSource.columns), await w(), await Ja(), await v();
|
|
741
759
|
};
|
|
742
|
-
return Qe(() =>
|
|
743
|
-
const ae =
|
|
744
|
-
return
|
|
745
|
-
de((
|
|
760
|
+
return Qe(() => la()), t({ refreshTable: H, getSelection: Ce, initData: la, getQueryParams: E }), (k, N) => {
|
|
761
|
+
const ae = cl, te = Pe, oe = He, be = ya, Xa = ga, $e = ma, Za = Pa, el = Aa, al = Ge, ll = ul, Te = De, tl = il, ol = sl, rl = pl, Ee = Ta("hasPermi"), nl = dl;
|
|
762
|
+
return n(), $("div", null, [
|
|
763
|
+
de((n(), h(ol, {
|
|
746
764
|
ref_key: "curdTableRef",
|
|
747
|
-
ref:
|
|
748
|
-
data: o(
|
|
749
|
-
"row-key":
|
|
765
|
+
ref: y,
|
|
766
|
+
data: o(f),
|
|
767
|
+
"row-key": s.dataSource.rowKey,
|
|
750
768
|
"element-loading-text": k.$t("數據加載中..."),
|
|
751
769
|
stripe: "",
|
|
752
|
-
"tree-props":
|
|
770
|
+
"tree-props": s.dataSource.treeProps,
|
|
753
771
|
"default-sort": o(P),
|
|
754
|
-
onSelectionChange:
|
|
755
|
-
onSortChange: o(
|
|
756
|
-
onRowClick:
|
|
757
|
-
"default-expand-all":
|
|
772
|
+
onSelectionChange: i,
|
|
773
|
+
onSortChange: o(S),
|
|
774
|
+
onRowClick: m,
|
|
775
|
+
"default-expand-all": s.dataSource.treeDefaultExpandAll ?? !1,
|
|
758
776
|
"max-height": o(u),
|
|
759
777
|
"highlight-current-row": ""
|
|
760
778
|
}, {
|
|
761
779
|
empty: b(() => [
|
|
762
|
-
|
|
780
|
+
le("div", dt, M(k.$t("未查詢到數據")), 1)
|
|
763
781
|
]),
|
|
764
782
|
default: b(() => [
|
|
765
|
-
|
|
783
|
+
s.dataSource.showSelection ? (n(), h(ae, {
|
|
766
784
|
key: 0,
|
|
767
785
|
type: "selection",
|
|
768
786
|
width: "60",
|
|
769
787
|
selectable: T,
|
|
770
788
|
align: "center"
|
|
771
789
|
})) : X("", !0),
|
|
772
|
-
|
|
790
|
+
s.dataSource.showIndex ? (n(), h(ae, {
|
|
773
791
|
key: 1,
|
|
774
792
|
type: "index",
|
|
775
793
|
width: "70",
|
|
776
794
|
align: "center",
|
|
777
795
|
label: "序號"
|
|
778
796
|
})) : X("", !0),
|
|
779
|
-
(
|
|
797
|
+
(n(!0), $(O, null, Q(s.dataSource.columns, (g) => (n(), $(O, {
|
|
780
798
|
key: g.prop || g.key
|
|
781
799
|
}, [
|
|
782
|
-
g.width !== 0 &&
|
|
800
|
+
g.width !== 0 && V(g) && Y(g) ? (n(), h(ae, {
|
|
783
801
|
key: 0,
|
|
784
802
|
label: g.label,
|
|
785
|
-
width:
|
|
803
|
+
width: se(g),
|
|
786
804
|
"min-width": g.minWidth,
|
|
787
805
|
prop: g.prop,
|
|
788
806
|
align: q(g),
|
|
@@ -797,17 +815,17 @@ const rl = (e) => {
|
|
|
797
815
|
row: I,
|
|
798
816
|
column: g,
|
|
799
817
|
value: I[g.prop]
|
|
800
|
-
}, void 0, !0) : g.formatter ? (
|
|
801
|
-
|
|
802
|
-
], 64)) : g.type === "image" ? (
|
|
803
|
-
I[g.prop] ? (
|
|
818
|
+
}, void 0, !0) : g.formatter ? (n(), $(O, { key: 1 }, [
|
|
819
|
+
z(M(ge(g, I)), 1)
|
|
820
|
+
], 64)) : g.type === "image" ? (n(), $(O, { key: 2 }, [
|
|
821
|
+
I[g.prop] ? (n(), h(Oa, {
|
|
804
822
|
key: 0,
|
|
805
823
|
modelValue: I[g.prop],
|
|
806
824
|
"onUpdate:modelValue": (ie) => I[g.prop] = ie,
|
|
807
825
|
class: "image-preview",
|
|
808
826
|
width: 24,
|
|
809
827
|
height: 24
|
|
810
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : (
|
|
828
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : (n(), h(te, {
|
|
811
829
|
key: 1,
|
|
812
830
|
class: "image-fallback"
|
|
813
831
|
}, {
|
|
@@ -816,8 +834,8 @@ const rl = (e) => {
|
|
|
816
834
|
]),
|
|
817
835
|
_: 1
|
|
818
836
|
}))
|
|
819
|
-
], 64)) : g.type === "networkImage" || g.type === "imageUrl" ? (
|
|
820
|
-
I[g.prop] ? (
|
|
837
|
+
], 64)) : g.type === "networkImage" || g.type === "imageUrl" ? (n(), $("view", ct, [
|
|
838
|
+
I[g.prop] ? (n(), h(oe, {
|
|
821
839
|
key: 0,
|
|
822
840
|
src: I[g.prop],
|
|
823
841
|
fit: "cover",
|
|
@@ -827,7 +845,7 @@ const rl = (e) => {
|
|
|
827
845
|
"hide-on-click-modal": ""
|
|
828
846
|
}, {
|
|
829
847
|
error: b(() => [
|
|
830
|
-
F(
|
|
848
|
+
F(te, { class: "image-fallback" }, {
|
|
831
849
|
default: b(() => [
|
|
832
850
|
F(o(xe))
|
|
833
851
|
]),
|
|
@@ -835,7 +853,7 @@ const rl = (e) => {
|
|
|
835
853
|
})
|
|
836
854
|
]),
|
|
837
855
|
_: 2
|
|
838
|
-
}, 1032, ["src", "preview-src-list"])) : (
|
|
856
|
+
}, 1032, ["src", "preview-src-list"])) : (n(), h(te, {
|
|
839
857
|
key: 1,
|
|
840
858
|
class: "image-fallback"
|
|
841
859
|
}, {
|
|
@@ -844,17 +862,17 @@ const rl = (e) => {
|
|
|
844
862
|
]),
|
|
845
863
|
_: 1
|
|
846
864
|
}))
|
|
847
|
-
])) : g.type === "date" ? (
|
|
848
|
-
|
|
849
|
-
], 64)) : g.type === "timestamp" ? (
|
|
850
|
-
|
|
851
|
-
], 64)) : g.type === "bool" ? (
|
|
865
|
+
])) : g.type === "date" ? (n(), $(O, { key: 4 }, [
|
|
866
|
+
z(M(k.parseTime(I[g.prop], "{y}-{m}-{d}")), 1)
|
|
867
|
+
], 64)) : g.type === "timestamp" ? (n(), $(O, { key: 5 }, [
|
|
868
|
+
z(M(k.parseTime(I[g.prop])), 1)
|
|
869
|
+
], 64)) : g.type === "bool" ? (n(), h(be, {
|
|
852
870
|
key: 6,
|
|
853
871
|
modelValue: I[g.prop],
|
|
854
872
|
"onUpdate:modelValue": (ie) => I[g.prop] = ie,
|
|
855
|
-
onClick: N[0] || (N[0] =
|
|
873
|
+
onClick: N[0] || (N[0] = vl(() => {
|
|
856
874
|
}, ["stop", "prevent"]))
|
|
857
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : g.type === "switch" ? (
|
|
875
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : g.type === "switch" ? (n(), h(Xa, {
|
|
858
876
|
key: 7,
|
|
859
877
|
modelValue: I[g.prop],
|
|
860
878
|
"onUpdate:modelValue": (ie) => I[g.prop] = ie,
|
|
@@ -862,37 +880,37 @@ const rl = (e) => {
|
|
|
862
880
|
"inactive-value": g.inactiveValue || "1",
|
|
863
881
|
size: "small",
|
|
864
882
|
"before-change": () => !1
|
|
865
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "active-value", "inactive-value"])) : g.type === "color" ? (
|
|
866
|
-
|
|
883
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "active-value", "inactive-value"])) : g.type === "color" ? (n(), $("div", ut, [
|
|
884
|
+
le("div", {
|
|
867
885
|
class: "color-cell-item",
|
|
868
886
|
style: fe({ backgroundColor: I[g.prop] || "#ffffff" })
|
|
869
887
|
}, null, 4)
|
|
870
|
-
])) : g.type === "fromDict" ? (
|
|
871
|
-
|
|
872
|
-
], 64)) : g.type === "fromDataTag" ? (
|
|
888
|
+
])) : g.type === "fromDict" ? (n(), $(O, { key: 9 }, [
|
|
889
|
+
z(M(j(g, I)), 1)
|
|
890
|
+
], 64)) : g.type === "fromDataTag" ? (n(), h($e, {
|
|
873
891
|
key: 10,
|
|
874
892
|
type: me(g, I),
|
|
875
893
|
effect: g.tagEffect ?? "light",
|
|
876
894
|
class: "el-column-tag"
|
|
877
895
|
}, {
|
|
878
896
|
default: b(() => [
|
|
879
|
-
|
|
897
|
+
z(M(ue(g, I)), 1)
|
|
880
898
|
]),
|
|
881
899
|
_: 2
|
|
882
|
-
}, 1032, ["type", "effect"])) : g.type === "localDict" ? (
|
|
900
|
+
}, 1032, ["type", "effect"])) : g.type === "localDict" ? (n(), h($e, {
|
|
883
901
|
key: 11,
|
|
884
902
|
type: g.tagType || "info",
|
|
885
903
|
effect: g.tagEffect || "light",
|
|
886
904
|
class: "el-column-tag"
|
|
887
905
|
}, {
|
|
888
906
|
default: b(() => [
|
|
889
|
-
|
|
907
|
+
z(M(ne(
|
|
890
908
|
g,
|
|
891
909
|
I
|
|
892
910
|
)), 1)
|
|
893
911
|
]),
|
|
894
912
|
_: 2
|
|
895
|
-
}, 1032, ["type", "effect"])) : g.type === "tag" ? (
|
|
913
|
+
}, 1032, ["type", "effect"])) : g.type === "tag" ? (n(), h($e, {
|
|
896
914
|
key: 12,
|
|
897
915
|
type: g.tagType || "info",
|
|
898
916
|
effect: g.tagEffect || "light",
|
|
@@ -900,10 +918,10 @@ const rl = (e) => {
|
|
|
900
918
|
plain: ""
|
|
901
919
|
}, {
|
|
902
920
|
default: b(() => [
|
|
903
|
-
|
|
921
|
+
z(M(I[g.prop]), 1)
|
|
904
922
|
]),
|
|
905
923
|
_: 2
|
|
906
|
-
}, 1032, ["type", "effect"])) : g.type === "tagArrayObj" ? (
|
|
924
|
+
}, 1032, ["type", "effect"])) : g.type === "tagArrayObj" ? (n(!0), $(O, { key: 13 }, Q(I[g.prop], (ie) => (n(), h($e, {
|
|
907
925
|
type: g.tagType || "info",
|
|
908
926
|
effect: g.tagEffect || "light",
|
|
909
927
|
class: "el-column-tag",
|
|
@@ -911,10 +929,10 @@ const rl = (e) => {
|
|
|
911
929
|
plain: ""
|
|
912
930
|
}, {
|
|
913
931
|
default: b(() => [
|
|
914
|
-
|
|
932
|
+
z(M(ie[g.displayField]), 1)
|
|
915
933
|
]),
|
|
916
934
|
_: 2
|
|
917
|
-
}, 1032, ["type", "effect"]))), 128)) : g.type === "tags" ? (
|
|
935
|
+
}, 1032, ["type", "effect"]))), 128)) : g.type === "tags" ? (n(!0), $(O, { key: 14 }, Q(I[g.prop], (ie) => (n(), h($e, {
|
|
918
936
|
type: g.tagType || "info",
|
|
919
937
|
effect: g.tagEffect || "light",
|
|
920
938
|
class: "el-column-tag",
|
|
@@ -922,45 +940,45 @@ const rl = (e) => {
|
|
|
922
940
|
plain: ""
|
|
923
941
|
}, {
|
|
924
942
|
default: b(() => [
|
|
925
|
-
|
|
943
|
+
z(M(ie[g.tagLabel]), 1)
|
|
926
944
|
]),
|
|
927
945
|
_: 2
|
|
928
|
-
}, 1032, ["type", "effect"]))), 128)) : g.type === "dictTag" || g.type === "commonDictTag" ? (
|
|
946
|
+
}, 1032, ["type", "effect"]))), 128)) : g.type === "dictTag" || g.type === "commonDictTag" ? (n(), h(Za, {
|
|
929
947
|
key: 15,
|
|
930
948
|
options: g.data || [],
|
|
931
949
|
value: I[g.prop]
|
|
932
|
-
}, null, 8, ["options", "value"])) : g.type === "dictText" || g.type === "commonDictText" ? (
|
|
950
|
+
}, null, 8, ["options", "value"])) : g.type === "dictText" || g.type === "commonDictText" ? (n(), h(el, {
|
|
933
951
|
key: 16,
|
|
934
952
|
options: g.data || [],
|
|
935
953
|
value: I[g.prop]
|
|
936
|
-
}, null, 8, ["options", "value"])) : g.type === "svg" ? (
|
|
954
|
+
}, null, 8, ["options", "value"])) : g.type === "svg" ? (n(), h(al, {
|
|
937
955
|
key: 17,
|
|
938
956
|
"icon-class": I.icon
|
|
939
|
-
}, null, 8, ["icon-class"])) : g.type === "ossFile" ? (
|
|
957
|
+
}, null, 8, ["icon-class"])) : g.type === "ossFile" ? (n(), h(La, {
|
|
940
958
|
key: 18,
|
|
941
959
|
data: I,
|
|
942
960
|
width: 32,
|
|
943
961
|
height: 32
|
|
944
|
-
}, null, 8, ["data"])) : g.type === "multiLine" ? (
|
|
945
|
-
|
|
946
|
-
g.subProp && o(Oe)(I, g, g.subProp) !== "" ? (
|
|
962
|
+
}, null, 8, ["data"])) : g.type === "multiLine" ? (n(), $("div", it, [
|
|
963
|
+
le("div", null, M(ce(I, g)), 1),
|
|
964
|
+
g.subProp && o(Oe)(I, g, g.subProp) !== "" ? (n(), h(ll, {
|
|
947
965
|
key: 0,
|
|
948
966
|
size: "small",
|
|
949
967
|
type: g.subType || "info"
|
|
950
968
|
}, {
|
|
951
969
|
default: b(() => [
|
|
952
|
-
|
|
970
|
+
z(M(g.subPrefix || "") + M(o(Oe)(I, g, g.subProp)) + M(g.subSuffix || ""), 1)
|
|
953
971
|
]),
|
|
954
972
|
_: 2
|
|
955
973
|
}, 1032, ["type"])) : X("", !0)
|
|
956
|
-
])) : (
|
|
957
|
-
|
|
974
|
+
])) : (n(), $(O, { key: 20 }, [
|
|
975
|
+
z(M(ce(I, g)), 1)
|
|
958
976
|
], 64))
|
|
959
977
|
]),
|
|
960
978
|
_: 2
|
|
961
979
|
}, 1032, ["label", "width", "min-width", "prop", "align", "sortable", "show-overflow-tooltip", "fixed", "class-name"])) : X("", !0)
|
|
962
980
|
], 64))), 128)),
|
|
963
|
-
o(p).length > 0 ? (
|
|
981
|
+
o(p).length > 0 ? (n(), h(ae, {
|
|
964
982
|
key: 2,
|
|
965
983
|
align: "center",
|
|
966
984
|
fixed: "right",
|
|
@@ -968,47 +986,47 @@ const rl = (e) => {
|
|
|
968
986
|
width: o(A)
|
|
969
987
|
}, {
|
|
970
988
|
default: b(({ row: g }) => [
|
|
971
|
-
(
|
|
989
|
+
(n(!0), $(O, null, Q(o(p), (I) => (n(), h(tl, {
|
|
972
990
|
content: I.text,
|
|
973
991
|
placement: "top",
|
|
974
992
|
key: I.action
|
|
975
993
|
}, {
|
|
976
994
|
default: b(() => [
|
|
977
|
-
K(g, I) ? (
|
|
978
|
-
I.action === "update" ? de((
|
|
995
|
+
K(g, I) ? (n(), $(O, { key: 0 }, [
|
|
996
|
+
I.action === "update" ? de((n(), h(Te, {
|
|
979
997
|
key: 0,
|
|
980
998
|
link: "",
|
|
981
999
|
type: "primary",
|
|
982
1000
|
icon: "Edit",
|
|
983
|
-
onClick: (ie) =>
|
|
984
|
-
disabled:
|
|
1001
|
+
onClick: (ie) => r(I, g),
|
|
1002
|
+
disabled: G(g, I)
|
|
985
1003
|
}, null, 8, ["onClick", "disabled"])), [
|
|
986
1004
|
[Ee, I.permission || null]
|
|
987
|
-
]) : I.action === "delete" ? de((
|
|
1005
|
+
]) : I.action === "delete" ? de((n(), h(Te, {
|
|
988
1006
|
key: 1,
|
|
989
1007
|
link: "",
|
|
990
1008
|
type: "danger",
|
|
991
1009
|
icon: "Delete",
|
|
992
|
-
onClick: (ie) =>
|
|
993
|
-
disabled:
|
|
1010
|
+
onClick: (ie) => r(I, g),
|
|
1011
|
+
disabled: G(g, I)
|
|
994
1012
|
}, null, 8, ["onClick", "disabled"])), [
|
|
995
1013
|
[Ee, I.permission || null]
|
|
996
|
-
]) : I.action === "view" || I.action === "viewDetail" ? de((
|
|
1014
|
+
]) : I.action === "view" || I.action === "viewDetail" ? de((n(), h(Te, {
|
|
997
1015
|
key: 2,
|
|
998
1016
|
link: "",
|
|
999
1017
|
type: "primary",
|
|
1000
1018
|
icon: "View",
|
|
1001
|
-
onClick: (ie) =>
|
|
1002
|
-
disabled:
|
|
1019
|
+
onClick: (ie) => r(I, g),
|
|
1020
|
+
disabled: G(g, I)
|
|
1003
1021
|
}, null, 8, ["onClick", "disabled"])), [
|
|
1004
1022
|
[Ee, I.permission || null]
|
|
1005
|
-
]) : de((
|
|
1023
|
+
]) : de((n(), h(Te, {
|
|
1006
1024
|
key: 3,
|
|
1007
1025
|
link: "",
|
|
1008
1026
|
type: "primary",
|
|
1009
1027
|
icon: I.icon,
|
|
1010
|
-
onClick: (ie) =>
|
|
1011
|
-
disabled:
|
|
1028
|
+
onClick: (ie) => r(I, g),
|
|
1029
|
+
disabled: G(g, I)
|
|
1012
1030
|
}, null, 8, ["icon", "onClick", "disabled"])), [
|
|
1013
1031
|
[Ee, I.permission || null]
|
|
1014
1032
|
])
|
|
@@ -1022,28 +1040,28 @@ const rl = (e) => {
|
|
|
1022
1040
|
]),
|
|
1023
1041
|
_: 3
|
|
1024
1042
|
}, 8, ["data", "row-key", "element-loading-text", "tree-props", "default-sort", "onSortChange", "default-expand-all", "max-height"])), [
|
|
1025
|
-
[
|
|
1043
|
+
[nl, o(_)]
|
|
1026
1044
|
]),
|
|
1027
|
-
|
|
1045
|
+
s.dataSource.paging !== !1 ? (n(), h(rl, {
|
|
1028
1046
|
key: 0,
|
|
1029
1047
|
class: "paging",
|
|
1030
1048
|
background: "",
|
|
1031
|
-
layout: o(
|
|
1049
|
+
layout: o(R),
|
|
1032
1050
|
onSizeChange: o(ee),
|
|
1033
1051
|
onCurrentChange: o(Z),
|
|
1034
|
-
"page-size": o(
|
|
1035
|
-
"current-page": o(
|
|
1036
|
-
"onUpdate:currentPage": N[1] || (N[1] = (g) => o(
|
|
1037
|
-
total: o(
|
|
1038
|
-
"page-sizes": o(
|
|
1052
|
+
"page-size": o(B).pageSize,
|
|
1053
|
+
"current-page": o(B).pageNum,
|
|
1054
|
+
"onUpdate:currentPage": N[1] || (N[1] = (g) => o(B).pageNum = g),
|
|
1055
|
+
total: o(B).total,
|
|
1056
|
+
"page-sizes": o(D)
|
|
1039
1057
|
}, null, 8, ["layout", "onSizeChange", "onCurrentChange", "page-size", "current-page", "total", "page-sizes"])) : X("", !0)
|
|
1040
1058
|
]);
|
|
1041
1059
|
};
|
|
1042
1060
|
}
|
|
1043
|
-
}), ua = /* @__PURE__ */ ye(
|
|
1061
|
+
}), ua = /* @__PURE__ */ ye(pt, [["__scopeId", "data-v-06fd2a41"]]), ft = { class: "upload-file" }, ht = {
|
|
1044
1062
|
key: 0,
|
|
1045
1063
|
class: "el-upload__tip"
|
|
1046
|
-
},
|
|
1064
|
+
}, mt = { style: { color: "#f56c6c" } }, yt = { style: { color: "#f56c6c" } }, gt = { class: "el-icon-document" }, bt = { class: "ele-upload-list__item-content-action" }, vt = /* @__PURE__ */ pe({
|
|
1047
1065
|
__name: "index",
|
|
1048
1066
|
props: {
|
|
1049
1067
|
modelValue: [String, Object, Array],
|
|
@@ -1059,91 +1077,91 @@ const rl = (e) => {
|
|
|
1059
1077
|
showFileList: re.bool.def(!0)
|
|
1060
1078
|
},
|
|
1061
1079
|
emits: ["update:modelValue"],
|
|
1062
|
-
setup(e, { emit:
|
|
1063
|
-
const
|
|
1064
|
-
() =>
|
|
1065
|
-
),
|
|
1066
|
-
ke(() =>
|
|
1080
|
+
setup(e, { emit: t }) {
|
|
1081
|
+
const l = e, { proxy: a } = he(), c = t, s = L(0), u = L([]), y = Ze(), f = L(y + "/resource/oss/upload"), _ = L(Xe()), d = L([]), B = J(
|
|
1082
|
+
() => l.showTip && (l.fileType || l.fileSize)
|
|
1083
|
+
), D = L();
|
|
1084
|
+
ke(() => l.modelValue, async (E) => {
|
|
1067
1085
|
if (E) {
|
|
1068
|
-
if (!
|
|
1086
|
+
if (!l.showFileList) return;
|
|
1069
1087
|
let x = 1, W = [];
|
|
1070
|
-
Array.isArray(E) ? W = E : W = (await ea(E)).data.map((p) => ({ name: p.originalName, url: p.url, ossId: p.ossId })),
|
|
1088
|
+
Array.isArray(E) ? W = E : W = (await ea(E)).data.map((p) => ({ name: p.originalName, url: p.url, ossId: p.ossId })), d.value = W.map((C) => (C = { name: C.name, url: C.url, ossId: C.ossId }, C.uid = C.uid || (/* @__PURE__ */ new Date()).getTime() + x++, C));
|
|
1071
1089
|
} else
|
|
1072
|
-
return
|
|
1090
|
+
return d.value = [], [];
|
|
1073
1091
|
}, { deep: !0, immediate: !0 });
|
|
1074
|
-
const
|
|
1075
|
-
if (
|
|
1092
|
+
const R = (E) => {
|
|
1093
|
+
if (l.fileType.length) {
|
|
1076
1094
|
const x = E.name.split("."), W = x[x.length - 1];
|
|
1077
|
-
if (!(
|
|
1078
|
-
return a == null || a.$modal.msgError(`文件格式不正確, 請上傳${
|
|
1095
|
+
if (!(l.fileType.indexOf(W) >= 0))
|
|
1096
|
+
return a == null || a.$modal.msgError(`文件格式不正確, 請上傳${l.fileType.join("/")}格式文件!`), !1;
|
|
1079
1097
|
}
|
|
1080
|
-
return
|
|
1098
|
+
return l.fileSize && !(E.size / 1024 / 1024 < l.fileSize) ? (a == null || a.$modal.msgError(`上傳文件大小不超過 ${l.fileSize} MB!`), !1) : (a == null || a.$modal.loading("正在上傳文件,請稍等..."), s.value++, !0);
|
|
1081
1099
|
}, P = () => {
|
|
1082
|
-
a == null || a.$modal.msgError(`上傳文件數量不能超過 ${
|
|
1100
|
+
a == null || a.$modal.msgError(`上傳文件數量不能超過 ${l.limit} 个!`);
|
|
1083
1101
|
}, H = () => {
|
|
1084
1102
|
a == null || a.$modal.msgError("上傳文件失敗");
|
|
1085
1103
|
}, Z = (E, x) => {
|
|
1086
1104
|
var W;
|
|
1087
|
-
E.code === 200 ? (u.value.push({ name: E.data.fileName, url: E.data.url, ossId: E.data.ossId }),
|
|
1105
|
+
E.code === 200 ? (u.value.push({ name: E.data.fileName, url: E.data.url, ossId: E.data.ossId }), S()) : (s.value--, a == null || a.$modal.closeLoading(), a == null || a.$modal.msgError(E.msg), (W = D.value) == null || W.handleRemove(x), S());
|
|
1088
1106
|
}, ee = (E) => {
|
|
1089
|
-
const x =
|
|
1090
|
-
Ia(x),
|
|
1091
|
-
},
|
|
1092
|
-
|
|
1093
|
-
}, U = (E) => E.lastIndexOf("/") > -1 ? E.slice(E.lastIndexOf("/") + 1) : E,
|
|
1107
|
+
const x = d.value[E].ossId;
|
|
1108
|
+
Ia(x), d.value.splice(E, 1), c("update:modelValue", w(d.value));
|
|
1109
|
+
}, S = () => {
|
|
1110
|
+
s.value > 0 && u.value.length === s.value && (d.value = d.value.filter((E) => E.url !== void 0).concat(u.value), u.value = [], s.value = 0, c("update:modelValue", w(d.value)), a == null || a.$modal.closeLoading());
|
|
1111
|
+
}, U = (E) => E.lastIndexOf("/") > -1 ? E.slice(E.lastIndexOf("/") + 1) : E, w = (E, x) => {
|
|
1094
1112
|
let W = "";
|
|
1095
|
-
return x = x || ",", E.forEach((
|
|
1096
|
-
|
|
1113
|
+
return x = x || ",", E.forEach((C) => {
|
|
1114
|
+
C.ossId && (W += C.ossId + x);
|
|
1097
1115
|
}), W != "" ? W.substring(0, W.length - 1) : "";
|
|
1098
1116
|
};
|
|
1099
1117
|
return (E, x) => {
|
|
1100
|
-
const W = De,
|
|
1101
|
-
return
|
|
1102
|
-
F(
|
|
1118
|
+
const W = De, C = Ke, p = fl;
|
|
1119
|
+
return n(), $("div", ft, [
|
|
1120
|
+
F(C, {
|
|
1103
1121
|
multiple: "",
|
|
1104
|
-
action: o(
|
|
1105
|
-
"before-upload":
|
|
1106
|
-
"file-list": o(
|
|
1122
|
+
action: o(f),
|
|
1123
|
+
"before-upload": R,
|
|
1124
|
+
"file-list": o(d),
|
|
1107
1125
|
limit: e.limit,
|
|
1108
1126
|
"on-error": H,
|
|
1109
1127
|
"on-exceed": P,
|
|
1110
1128
|
"on-success": Z,
|
|
1111
1129
|
"show-file-list": !1,
|
|
1112
|
-
headers: o(
|
|
1130
|
+
headers: o(_),
|
|
1113
1131
|
class: "upload-file-uploader",
|
|
1114
1132
|
ref_key: "fileUploadRef",
|
|
1115
|
-
ref:
|
|
1133
|
+
ref: D
|
|
1116
1134
|
}, {
|
|
1117
1135
|
default: b(() => [
|
|
1118
1136
|
F(W, { type: "primary" }, {
|
|
1119
1137
|
default: b(() => x[0] || (x[0] = [
|
|
1120
|
-
|
|
1138
|
+
z("选取文件")
|
|
1121
1139
|
])),
|
|
1122
1140
|
_: 1
|
|
1123
1141
|
})
|
|
1124
1142
|
]),
|
|
1125
1143
|
_: 1
|
|
1126
1144
|
}, 8, ["action", "file-list", "limit", "headers"]),
|
|
1127
|
-
o(
|
|
1128
|
-
x[3] || (x[3] =
|
|
1129
|
-
e.fileSize ? (
|
|
1130
|
-
x[1] || (x[1] =
|
|
1131
|
-
|
|
1145
|
+
o(B) ? (n(), $("div", ht, [
|
|
1146
|
+
x[3] || (x[3] = z(" 請上傳 ")),
|
|
1147
|
+
e.fileSize ? (n(), $(O, { key: 0 }, [
|
|
1148
|
+
x[1] || (x[1] = z(" 大小不超過 ")),
|
|
1149
|
+
le("b", mt, M(e.fileSize) + "MB", 1)
|
|
1132
1150
|
], 64)) : X("", !0),
|
|
1133
|
-
e.fileType ? (
|
|
1134
|
-
x[2] || (x[2] =
|
|
1135
|
-
|
|
1151
|
+
e.fileType ? (n(), $(O, { key: 1 }, [
|
|
1152
|
+
x[2] || (x[2] = z(" 格式為 ")),
|
|
1153
|
+
le("b", yt, M(e.fileType.join("/")), 1)
|
|
1136
1154
|
], 64)) : X("", !0),
|
|
1137
|
-
x[4] || (x[4] =
|
|
1155
|
+
x[4] || (x[4] = z(" 的文件 "))
|
|
1138
1156
|
])) : X("", !0),
|
|
1139
|
-
e.showFileList ? (
|
|
1157
|
+
e.showFileList ? (n(), h(kl, {
|
|
1140
1158
|
key: 1,
|
|
1141
1159
|
class: "upload-file-list el-upload-list el-upload-list--text",
|
|
1142
1160
|
name: "el-fade-in-linear",
|
|
1143
1161
|
tag: "ul"
|
|
1144
1162
|
}, {
|
|
1145
1163
|
default: b(() => [
|
|
1146
|
-
(
|
|
1164
|
+
(n(!0), $(O, null, Q(o(d), (T, A) => (n(), $("li", {
|
|
1147
1165
|
key: T.uid,
|
|
1148
1166
|
class: "el-upload-list__item ele-upload-list__item-content"
|
|
1149
1167
|
}, [
|
|
@@ -1153,18 +1171,18 @@ const rl = (e) => {
|
|
|
1153
1171
|
target: "_blank"
|
|
1154
1172
|
}, {
|
|
1155
1173
|
default: b(() => [
|
|
1156
|
-
|
|
1174
|
+
le("span", gt, M(U(T.name)), 1)
|
|
1157
1175
|
]),
|
|
1158
1176
|
_: 2
|
|
1159
1177
|
}, 1032, ["href"]),
|
|
1160
|
-
|
|
1178
|
+
le("div", bt, [
|
|
1161
1179
|
F(p, {
|
|
1162
1180
|
underline: !1,
|
|
1163
1181
|
onClick: (K) => ee(A),
|
|
1164
1182
|
type: "danger"
|
|
1165
1183
|
}, {
|
|
1166
1184
|
default: b(() => x[5] || (x[5] = [
|
|
1167
|
-
|
|
1185
|
+
z("删除")
|
|
1168
1186
|
])),
|
|
1169
1187
|
_: 2
|
|
1170
1188
|
}, 1032, ["onClick"])
|
|
@@ -1176,10 +1194,10 @@ const rl = (e) => {
|
|
|
1176
1194
|
]);
|
|
1177
1195
|
};
|
|
1178
1196
|
}
|
|
1179
|
-
}), Ra = /* @__PURE__ */ ye(
|
|
1197
|
+
}), Ra = /* @__PURE__ */ ye(vt, [["__scopeId", "data-v-027e6121"]]), kt = {
|
|
1180
1198
|
key: 0,
|
|
1181
1199
|
class: "el-upload__tip"
|
|
1182
|
-
},
|
|
1200
|
+
}, _t = { style: { color: "#f56c6c" } }, wt = { style: { color: "#f56c6c" } }, Vt = { style: { color: "#f56c6c" } }, St = ["src"], $t = /* @__PURE__ */ pe({
|
|
1183
1201
|
__name: "index",
|
|
1184
1202
|
props: {
|
|
1185
1203
|
modelValue: {
|
|
@@ -1210,76 +1228,76 @@ const rl = (e) => {
|
|
|
1210
1228
|
height: re.string.def("148px")
|
|
1211
1229
|
},
|
|
1212
1230
|
emits: ["update:modelValue"],
|
|
1213
|
-
setup(e, { emit:
|
|
1214
|
-
|
|
1215
|
-
"9d14746a":
|
|
1231
|
+
setup(e, { emit: t }) {
|
|
1232
|
+
_l((C) => ({
|
|
1233
|
+
"9d14746a": l.height
|
|
1216
1234
|
}));
|
|
1217
|
-
const
|
|
1235
|
+
const l = e, { proxy: a } = he(), c = t, s = L(0), u = L([]), y = L(""), f = L(!1), _ = Ze(), d = L(_ + "/resource/oss/upload"), B = L(Xe()), D = L([]), R = J(() => l.isShowTip && (l.fileType || l.fileSize || l.imageSize)), P = L(), H = J(() => l.fileType.map((C) => `.${C}`).join(","));
|
|
1218
1236
|
ke(
|
|
1219
|
-
() =>
|
|
1220
|
-
async (
|
|
1221
|
-
if (
|
|
1237
|
+
() => l.modelValue,
|
|
1238
|
+
async (C) => {
|
|
1239
|
+
if (C) {
|
|
1222
1240
|
let p = [];
|
|
1223
|
-
Array.isArray(
|
|
1241
|
+
Array.isArray(C) ? p = C : p = (await ea(C)).data, D.value = p.map((T) => {
|
|
1224
1242
|
let A;
|
|
1225
1243
|
return typeof T == "string" ? A = { name: T, url: T } : A = { name: T.ossId, url: T.url, ossId: T.ossId }, A;
|
|
1226
1244
|
});
|
|
1227
1245
|
} else
|
|
1228
|
-
return
|
|
1246
|
+
return D.value = [], [];
|
|
1229
1247
|
},
|
|
1230
1248
|
{ deep: !0, immediate: !0 }
|
|
1231
1249
|
);
|
|
1232
|
-
const Z = (
|
|
1250
|
+
const Z = (C) => {
|
|
1233
1251
|
let p = !1;
|
|
1234
|
-
if (
|
|
1252
|
+
if (l.fileType.length) {
|
|
1235
1253
|
let T = "";
|
|
1236
|
-
|
|
1254
|
+
C.name.lastIndexOf(".") > -1 && (T = C.name.slice(C.name.lastIndexOf(".") + 1)), p = l.fileType.some((A) => !!(C.type.indexOf(A) > -1 || T && T.indexOf(A) > -1));
|
|
1237
1255
|
} else
|
|
1238
|
-
p =
|
|
1256
|
+
p = C.type.indexOf("image") > -1;
|
|
1239
1257
|
if (!p)
|
|
1240
|
-
return a == null || a.$modal.msgError(`文件格式不正確, 請上傳${
|
|
1241
|
-
if (
|
|
1258
|
+
return a == null || a.$modal.msgError(`文件格式不正確, 請上傳${l.fileType.join("/")}圖片格式文件!`), !1;
|
|
1259
|
+
if (C.name.includes(","))
|
|
1242
1260
|
return a == null || a.$modal.msgError("文件名不正確,不能包含英文逗號!"), !1;
|
|
1243
|
-
if (
|
|
1244
|
-
return a == null || a.$modal.msgError(`上傳圖片大小不能超過 ${
|
|
1245
|
-
if (
|
|
1246
|
-
return a == null || a.$modal.loading("正在上傳圖片,請稍候..."),
|
|
1247
|
-
a == null || a.$modal.loading("正在上傳圖片,請稍候..."),
|
|
1261
|
+
if (l.fileSize && !(C.size / 1024 / 1024 < l.fileSize))
|
|
1262
|
+
return a == null || a.$modal.msgError(`上傳圖片大小不能超過 ${l.fileSize} MB!`), !1;
|
|
1263
|
+
if (l.compressSupport && C.size / 1024 > l.compressTargetSize)
|
|
1264
|
+
return a == null || a.$modal.loading("正在上傳圖片,請稍候..."), s.value++, Cl(C, l.compressTargetSize);
|
|
1265
|
+
a == null || a.$modal.loading("正在上傳圖片,請稍候..."), s.value++;
|
|
1248
1266
|
}, ee = () => {
|
|
1249
|
-
a == null || a.$modal.msgError(`上傳文件數量不能超過 ${
|
|
1250
|
-
},
|
|
1267
|
+
a == null || a.$modal.msgError(`上傳文件數量不能超過 ${l.limit} 個!`);
|
|
1268
|
+
}, S = (C, p) => {
|
|
1251
1269
|
var T;
|
|
1252
|
-
|
|
1253
|
-
}, U = (
|
|
1254
|
-
const p =
|
|
1255
|
-
if (p > -1 && u.value.length ===
|
|
1256
|
-
const T =
|
|
1257
|
-
return Ia(T),
|
|
1270
|
+
C.code === 200 ? (u.value.push({ name: C.data.fileName, url: C.data.url, ossId: C.data.ossId }), w()) : (s.value--, a == null || a.$modal.closeLoading(), a == null || a.$modal.msgError(C.msg), (T = P.value) == null || T.handleRemove(p), w());
|
|
1271
|
+
}, U = (C) => {
|
|
1272
|
+
const p = D.value.map((T) => T.name).indexOf(C.name);
|
|
1273
|
+
if (p > -1 && u.value.length === s.value) {
|
|
1274
|
+
const T = D.value[p].ossId;
|
|
1275
|
+
return Ia(T), D.value.splice(p, 1), c("update:modelValue", W(D.value)), !1;
|
|
1258
1276
|
}
|
|
1259
1277
|
return !0;
|
|
1260
|
-
},
|
|
1261
|
-
|
|
1278
|
+
}, w = () => {
|
|
1279
|
+
s.value > 0 && u.value.length === s.value && (D.value = D.value.filter((C) => C.url !== void 0).concat(u.value), u.value = [], s.value = 0, c("update:modelValue", W(D.value)), a == null || a.$modal.closeLoading());
|
|
1262
1280
|
}, E = () => {
|
|
1263
1281
|
a == null || a.$modal.msgError("上傳圖片失敗"), a == null || a.$modal.closeLoading();
|
|
1264
|
-
}, x = (
|
|
1265
|
-
|
|
1266
|
-
}, W = (
|
|
1282
|
+
}, x = (C) => {
|
|
1283
|
+
y.value = C.url, f.value = !0;
|
|
1284
|
+
}, W = (C, p) => {
|
|
1267
1285
|
let T = "";
|
|
1268
1286
|
p = p || ",";
|
|
1269
|
-
for (const A in
|
|
1270
|
-
|
|
1287
|
+
for (const A in C)
|
|
1288
|
+
C[A].ossId !== void 0 && C[A].url.indexOf("blob:") !== 0 && (T += C[A].ossId + p);
|
|
1271
1289
|
return T != "" ? T.substring(0, T.length - 1) : "";
|
|
1272
1290
|
};
|
|
1273
|
-
return (
|
|
1274
|
-
const T =
|
|
1275
|
-
return
|
|
1291
|
+
return (C, p) => {
|
|
1292
|
+
const T = wl("plus"), A = Pe, K = Ke, G = Ne;
|
|
1293
|
+
return n(), $("div", null, [
|
|
1276
1294
|
F(K, {
|
|
1277
1295
|
ref_key: "imageUploadRef",
|
|
1278
1296
|
ref: P,
|
|
1279
1297
|
multiple: "",
|
|
1280
|
-
action: o(
|
|
1298
|
+
action: o(d),
|
|
1281
1299
|
"list-type": "picture-card",
|
|
1282
|
-
"on-success":
|
|
1300
|
+
"on-success": S,
|
|
1283
1301
|
"before-upload": Z,
|
|
1284
1302
|
limit: e.limit,
|
|
1285
1303
|
accept: o(H),
|
|
@@ -1287,10 +1305,10 @@ const rl = (e) => {
|
|
|
1287
1305
|
"on-exceed": ee,
|
|
1288
1306
|
"before-remove": U,
|
|
1289
1307
|
"show-file-list": !0,
|
|
1290
|
-
headers: o(
|
|
1291
|
-
"file-list": o(
|
|
1308
|
+
headers: o(B),
|
|
1309
|
+
"file-list": o(D),
|
|
1292
1310
|
"on-preview": x,
|
|
1293
|
-
class: qe({ hide: o(
|
|
1311
|
+
class: qe({ hide: o(D).length >= e.limit })
|
|
1294
1312
|
}, {
|
|
1295
1313
|
default: b(() => [
|
|
1296
1314
|
F(A, { class: "avatar-uploader-icon" }, {
|
|
@@ -1302,166 +1320,166 @@ const rl = (e) => {
|
|
|
1302
1320
|
]),
|
|
1303
1321
|
_: 1
|
|
1304
1322
|
}, 8, ["action", "limit", "accept", "headers", "file-list", "class"]),
|
|
1305
|
-
o(
|
|
1306
|
-
p[4] || (p[4] =
|
|
1307
|
-
e.fileSize ? (
|
|
1308
|
-
p[1] || (p[1] =
|
|
1309
|
-
|
|
1323
|
+
o(R) ? (n(), $("div", kt, [
|
|
1324
|
+
p[4] || (p[4] = z(" 請上傳 ")),
|
|
1325
|
+
e.fileSize ? (n(), $(O, { key: 0 }, [
|
|
1326
|
+
p[1] || (p[1] = z(" 大小不超過 ")),
|
|
1327
|
+
le("b", _t, M(e.fileSize) + "MB", 1)
|
|
1310
1328
|
], 64)) : X("", !0),
|
|
1311
|
-
e.fileType ? (
|
|
1312
|
-
e.fileSize ? (
|
|
1313
|
-
|
|
1329
|
+
e.fileType ? (n(), $(O, { key: 1 }, [
|
|
1330
|
+
e.fileSize ? (n(), $(O, { key: 0 }, [
|
|
1331
|
+
z("、")
|
|
1314
1332
|
], 64)) : X("", !0),
|
|
1315
|
-
p[2] || (p[2] =
|
|
1316
|
-
|
|
1333
|
+
p[2] || (p[2] = z("格式為 ")),
|
|
1334
|
+
le("b", wt, M(e.fileType.join("/")), 1)
|
|
1317
1335
|
], 64)) : X("", !0),
|
|
1318
|
-
e.imageSize ? (
|
|
1319
|
-
e.fileSize || e.fileType ? (
|
|
1320
|
-
|
|
1336
|
+
e.imageSize ? (n(), $(O, { key: 2 }, [
|
|
1337
|
+
e.fileSize || e.fileType ? (n(), $(O, { key: 0 }, [
|
|
1338
|
+
z("。")
|
|
1321
1339
|
], 64)) : X("", !0),
|
|
1322
|
-
p[3] || (p[3] =
|
|
1323
|
-
|
|
1340
|
+
p[3] || (p[3] = z("建議尺寸 ")),
|
|
1341
|
+
le("b", Vt, M(e.imageSize), 1)
|
|
1324
1342
|
], 64)) : X("", !0),
|
|
1325
|
-
p[5] || (p[5] =
|
|
1343
|
+
p[5] || (p[5] = z(" 的文件 "))
|
|
1326
1344
|
])) : X("", !0),
|
|
1327
|
-
F(
|
|
1328
|
-
modelValue: o(
|
|
1329
|
-
"onUpdate:modelValue": p[0] || (p[0] = (
|
|
1345
|
+
F(G, {
|
|
1346
|
+
modelValue: o(f),
|
|
1347
|
+
"onUpdate:modelValue": p[0] || (p[0] = (se) => Se(f) ? f.value = se : null),
|
|
1330
1348
|
title: "預覽",
|
|
1331
1349
|
width: "800px",
|
|
1332
1350
|
"append-to-body": ""
|
|
1333
1351
|
}, {
|
|
1334
1352
|
default: b(() => [
|
|
1335
|
-
|
|
1336
|
-
src: o(
|
|
1353
|
+
le("img", {
|
|
1354
|
+
src: o(y),
|
|
1337
1355
|
style: { display: "block", "max-width": "100%", margin: "0 auto" }
|
|
1338
|
-
}, null, 8,
|
|
1356
|
+
}, null, 8, St)
|
|
1339
1357
|
]),
|
|
1340
1358
|
_: 1
|
|
1341
1359
|
}, 8, ["modelValue"])
|
|
1342
1360
|
]);
|
|
1343
1361
|
};
|
|
1344
1362
|
}
|
|
1345
|
-
}), ja = /* @__PURE__ */ ye($
|
|
1363
|
+
}), ja = /* @__PURE__ */ ye($t, [["__scopeId", "data-v-c17cf859"]]), Dt = (e) => _e()({
|
|
1346
1364
|
url: "/app/translation/getByName",
|
|
1347
1365
|
method: "post",
|
|
1348
1366
|
headers: {
|
|
1349
1367
|
repeatSubmit: !1
|
|
1350
1368
|
},
|
|
1351
1369
|
data: { name: e }
|
|
1352
|
-
}),
|
|
1370
|
+
}), Ct = (e) => _e()({
|
|
1353
1371
|
url: "/app/translation/batchAdd",
|
|
1354
1372
|
method: "post",
|
|
1355
1373
|
data: e
|
|
1356
1374
|
}), ia = Ea("translation", () => {
|
|
1357
|
-
const e =
|
|
1375
|
+
const e = L([]);
|
|
1358
1376
|
return {
|
|
1359
1377
|
translation: e,
|
|
1360
1378
|
getTranslation: (c) => {
|
|
1361
1379
|
if (c == null && c == "")
|
|
1362
1380
|
return null;
|
|
1363
1381
|
try {
|
|
1364
|
-
for (let
|
|
1365
|
-
if (e.value[
|
|
1366
|
-
return e.value[
|
|
1382
|
+
for (let s = 0; s < e.value.length; s++)
|
|
1383
|
+
if (e.value[s].key == c)
|
|
1384
|
+
return e.value[s].value;
|
|
1367
1385
|
} catch {
|
|
1368
1386
|
return null;
|
|
1369
1387
|
}
|
|
1370
1388
|
return null;
|
|
1371
1389
|
},
|
|
1372
|
-
setTranslation: (c,
|
|
1390
|
+
setTranslation: (c, s) => {
|
|
1373
1391
|
c !== null && c !== "" && e.value.push({
|
|
1374
1392
|
key: c,
|
|
1375
|
-
value:
|
|
1393
|
+
value: s
|
|
1376
1394
|
});
|
|
1377
1395
|
},
|
|
1378
1396
|
clearTranslation: () => {
|
|
1379
1397
|
e.value = [];
|
|
1380
1398
|
}
|
|
1381
1399
|
};
|
|
1382
|
-
}),
|
|
1383
|
-
const
|
|
1384
|
-
if (
|
|
1385
|
-
|
|
1400
|
+
}), Tt = async (e) => {
|
|
1401
|
+
const t = L({}), l = ia().getTranslation(e);
|
|
1402
|
+
if (l)
|
|
1403
|
+
t.value[e] = l;
|
|
1386
1404
|
else {
|
|
1387
|
-
const { data: a } = await
|
|
1388
|
-
|
|
1405
|
+
const { data: a } = await Dt(e);
|
|
1406
|
+
t.value[e] = a, ia().setTranslation(e, a);
|
|
1389
1407
|
}
|
|
1390
|
-
return
|
|
1391
|
-
},
|
|
1408
|
+
return t.value;
|
|
1409
|
+
}, Et = { style: { width: "100%" } }, Ut = { style: { "margin-bottom": "2px" } }, Fa = /* @__PURE__ */ pe({
|
|
1392
1410
|
__name: "index",
|
|
1393
1411
|
props: ["modelValue", "placeholder", "disabled", "type", "rows", "showWordLimit", "maxlength"],
|
|
1394
1412
|
emits: ["update:modelValue", "focus"],
|
|
1395
|
-
setup(e, { expose:
|
|
1396
|
-
const a =
|
|
1413
|
+
setup(e, { expose: t, emit: l }) {
|
|
1414
|
+
const a = l, c = e, s = L([{ name: "繁體", id: "zhHk", selected: !0, text: "" }, { name: "簡體", id: "zhCn", selected: !1, text: "" }, { name: "英文", id: "enUs", selected: !1, text: "" }]), u = L(!1), y = L(!1), f = (P, H) => {
|
|
1397
1415
|
P.text = H, P.id == "zhHk" && a("update:modelValue", H);
|
|
1398
|
-
},
|
|
1399
|
-
P.id == "zhHk" && await
|
|
1400
|
-
},
|
|
1416
|
+
}, _ = async (P) => {
|
|
1417
|
+
P.id == "zhHk" && await d();
|
|
1418
|
+
}, d = async () => {
|
|
1401
1419
|
if (u.value) return;
|
|
1402
|
-
const P =
|
|
1420
|
+
const P = s.value[0].text;
|
|
1403
1421
|
if (P != "") {
|
|
1404
1422
|
u.value = !0;
|
|
1405
|
-
const H = await
|
|
1423
|
+
const H = await Tt(P);
|
|
1406
1424
|
if (u.value = !1, H[P] != null) {
|
|
1407
|
-
for (let Z = 0; Z <
|
|
1408
|
-
if (!
|
|
1409
|
-
const ee =
|
|
1425
|
+
for (let Z = 0; Z < s.value.length; Z++)
|
|
1426
|
+
if (!s.value[Z].text) {
|
|
1427
|
+
const ee = s.value[Z];
|
|
1410
1428
|
ee.text = H[P][ee.id];
|
|
1411
1429
|
}
|
|
1412
1430
|
}
|
|
1413
1431
|
}
|
|
1414
|
-
},
|
|
1415
|
-
|
|
1416
|
-
},
|
|
1417
|
-
const P = { name:
|
|
1418
|
-
return
|
|
1419
|
-
},
|
|
1432
|
+
}, B = async (P) => {
|
|
1433
|
+
s.value.map((H) => H.selected = !1), P.selected = !0;
|
|
1434
|
+
}, D = () => {
|
|
1435
|
+
const P = { name: s.value[0].text };
|
|
1436
|
+
return s.value.forEach((H) => P[H.id] = H.text), P;
|
|
1437
|
+
}, R = () => a("focus");
|
|
1420
1438
|
return ke(() => c.modelValue, (P) => {
|
|
1421
1439
|
if (P) {
|
|
1422
|
-
const H =
|
|
1423
|
-
H.text = P,
|
|
1440
|
+
const H = s.value.filter((Z) => Z.selected)[0];
|
|
1441
|
+
H.text = P, y.value || d(), y.value = !0;
|
|
1424
1442
|
}
|
|
1425
1443
|
}, {
|
|
1426
1444
|
immediate: !0,
|
|
1427
1445
|
deep: !0
|
|
1428
|
-
}),
|
|
1446
|
+
}), t({ getTranslate: D }), (P, H) => {
|
|
1429
1447
|
const Z = De, ee = We;
|
|
1430
|
-
return
|
|
1431
|
-
|
|
1432
|
-
(
|
|
1448
|
+
return n(), $("div", Et, [
|
|
1449
|
+
le("div", Ut, [
|
|
1450
|
+
(n(!0), $(O, null, Q(o(s), (S) => (n(), h(Z, {
|
|
1433
1451
|
size: "small",
|
|
1434
|
-
key:
|
|
1435
|
-
type:
|
|
1436
|
-
onClick: (U) =>
|
|
1452
|
+
key: S.id,
|
|
1453
|
+
type: S.selected ? "primary" : "default",
|
|
1454
|
+
onClick: (U) => B(S),
|
|
1437
1455
|
style: { "margin-right": "-8px" }
|
|
1438
1456
|
}, {
|
|
1439
1457
|
default: b(() => [
|
|
1440
|
-
|
|
1458
|
+
z(M(S.name), 1)
|
|
1441
1459
|
]),
|
|
1442
1460
|
_: 2
|
|
1443
1461
|
}, 1032, ["type", "onClick"]))), 128))
|
|
1444
1462
|
]),
|
|
1445
|
-
(
|
|
1446
|
-
key:
|
|
1447
|
-
modelValue:
|
|
1448
|
-
"onUpdate:modelValue": (U) =>
|
|
1463
|
+
(n(!0), $(O, null, Q(o(s), (S) => de((n(), h(ee, {
|
|
1464
|
+
key: S.id,
|
|
1465
|
+
modelValue: S.text,
|
|
1466
|
+
"onUpdate:modelValue": (U) => S.text = U,
|
|
1449
1467
|
type: c.type,
|
|
1450
|
-
placeholder: c.placeholder + "(" +
|
|
1468
|
+
placeholder: c.placeholder + "(" + S.name + ")",
|
|
1451
1469
|
disabled: c.disabled,
|
|
1452
1470
|
rows: c.rows,
|
|
1453
1471
|
"show-word-limit": c.showWordLimit,
|
|
1454
1472
|
maxlength: c.maxlength,
|
|
1455
|
-
onInput: (U) =>
|
|
1456
|
-
onBlur: (U) =>
|
|
1457
|
-
onFocus: H[0] || (H[0] = (U) =>
|
|
1473
|
+
onInput: (U) => f(S, U),
|
|
1474
|
+
onBlur: (U) => _(S),
|
|
1475
|
+
onFocus: H[0] || (H[0] = (U) => R())
|
|
1458
1476
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "disabled", "rows", "show-word-limit", "maxlength", "onInput", "onBlur"])), [
|
|
1459
|
-
[
|
|
1477
|
+
[Vl, S.selected]
|
|
1460
1478
|
])), 128))
|
|
1461
1479
|
]);
|
|
1462
1480
|
};
|
|
1463
1481
|
}
|
|
1464
|
-
}),
|
|
1482
|
+
}), At = { class: "editor" }, Ha = /* @__PURE__ */ pe({
|
|
1465
1483
|
__name: "index",
|
|
1466
1484
|
props: {
|
|
1467
1485
|
/* 编辑器的内容 */
|
|
@@ -1479,10 +1497,10 @@ const rl = (e) => {
|
|
|
1479
1497
|
},
|
|
1480
1498
|
emits: ["update:modelValue"],
|
|
1481
1499
|
setup(e) {
|
|
1482
|
-
const
|
|
1500
|
+
const t = e, { proxy: l } = he(), a = Sl({
|
|
1483
1501
|
headers: Xe(),
|
|
1484
1502
|
url: Ze() + "/resource/oss/upload"
|
|
1485
|
-
}), c =
|
|
1503
|
+
}), c = L(), s = L(), u = L({
|
|
1486
1504
|
theme: "snow",
|
|
1487
1505
|
bounds: document.body,
|
|
1488
1506
|
debug: "warn",
|
|
@@ -1512,78 +1530,78 @@ const rl = (e) => {
|
|
|
1512
1530
|
// 链接、图片、视频
|
|
1513
1531
|
],
|
|
1514
1532
|
handlers: {
|
|
1515
|
-
image: (
|
|
1516
|
-
|
|
1533
|
+
image: (D) => {
|
|
1534
|
+
D ? s.value.click() : Tl.format("image", !0);
|
|
1517
1535
|
}
|
|
1518
1536
|
}
|
|
1519
1537
|
}
|
|
1520
1538
|
},
|
|
1521
1539
|
placeholder: "请输入内容",
|
|
1522
|
-
readOnly:
|
|
1523
|
-
}),
|
|
1524
|
-
const
|
|
1525
|
-
return
|
|
1526
|
-
}),
|
|
1540
|
+
readOnly: t.readOnly
|
|
1541
|
+
}), y = J(() => {
|
|
1542
|
+
const D = {};
|
|
1543
|
+
return t.minHeight && (D.minHeight = `${t.minHeight}px`), t.height && (D.height = `${t.height}px`), D;
|
|
1544
|
+
}), f = L("");
|
|
1527
1545
|
ke(
|
|
1528
|
-
() =>
|
|
1529
|
-
(
|
|
1530
|
-
|
|
1546
|
+
() => t.modelValue,
|
|
1547
|
+
(D) => {
|
|
1548
|
+
D !== f.value && (f.value = D || "<p></p>");
|
|
1531
1549
|
},
|
|
1532
1550
|
{ immediate: !0 }
|
|
1533
1551
|
);
|
|
1534
|
-
const
|
|
1535
|
-
if (
|
|
1536
|
-
const
|
|
1537
|
-
|
|
1552
|
+
const _ = (D) => {
|
|
1553
|
+
if (D.code === 200) {
|
|
1554
|
+
const R = Le(c.value).getQuill(), P = R.selection.savedRange.index;
|
|
1555
|
+
R.insertEmbed(P, "image", D.data.url), R.setSelection(P + 1), l == null || l.$modal.closeLoading();
|
|
1538
1556
|
} else
|
|
1539
|
-
|
|
1540
|
-
},
|
|
1541
|
-
|
|
1557
|
+
l == null || l.$modal.msgError("图片插入失败"), l == null || l.$modal.closeLoading();
|
|
1558
|
+
}, d = (D) => ["image/jpeg", "image/jpg", "image/png", "image/svg"].includes(D.type) ? t.fileSize && !(D.size / 1024 / 1024 < t.fileSize) ? (l == null || l.$modal.msgError(`上传文件大小不能超过 ${t.fileSize} MB!`), !1) : (l == null || l.$modal.loading("正在上传文件,请稍候..."), !0) : (l == null || l.$modal.msgError("图片格式错误!"), !1), B = (D) => {
|
|
1559
|
+
l == null || l.$modal.msgError("上传文件失败");
|
|
1542
1560
|
};
|
|
1543
|
-
return (
|
|
1561
|
+
return (D, R) => {
|
|
1544
1562
|
const P = Ke;
|
|
1545
|
-
return
|
|
1546
|
-
|
|
1547
|
-
e.type === "url" ? (
|
|
1563
|
+
return n(), $(O, null, [
|
|
1564
|
+
le("div", null, [
|
|
1565
|
+
e.type === "url" ? (n(), h(P, {
|
|
1548
1566
|
key: 0,
|
|
1549
1567
|
action: o(a).url,
|
|
1550
|
-
"before-upload":
|
|
1551
|
-
"on-success":
|
|
1552
|
-
"on-error":
|
|
1568
|
+
"before-upload": d,
|
|
1569
|
+
"on-success": _,
|
|
1570
|
+
"on-error": B,
|
|
1553
1571
|
class: "editor-img-uploader",
|
|
1554
1572
|
name: "file",
|
|
1555
1573
|
"show-file-list": !1,
|
|
1556
1574
|
headers: o(a).headers
|
|
1557
1575
|
}, {
|
|
1558
1576
|
default: b(() => [
|
|
1559
|
-
|
|
1577
|
+
le("i", {
|
|
1560
1578
|
ref_key: "uploadRef",
|
|
1561
|
-
ref:
|
|
1579
|
+
ref: s
|
|
1562
1580
|
}, null, 512)
|
|
1563
1581
|
]),
|
|
1564
1582
|
_: 1
|
|
1565
1583
|
}, 8, ["action", "headers"])) : X("", !0)
|
|
1566
1584
|
]),
|
|
1567
|
-
|
|
1568
|
-
F(o(
|
|
1585
|
+
le("div", At, [
|
|
1586
|
+
F(o(El), {
|
|
1569
1587
|
ref_key: "quillEditorRef",
|
|
1570
1588
|
ref: c,
|
|
1571
|
-
content: o(
|
|
1572
|
-
"onUpdate:content":
|
|
1589
|
+
content: o(f),
|
|
1590
|
+
"onUpdate:content": R[0] || (R[0] = (H) => Se(f) ? f.value = H : null),
|
|
1573
1591
|
"content-type": "html",
|
|
1574
1592
|
options: o(u),
|
|
1575
|
-
style: fe(o(
|
|
1576
|
-
onTextChange:
|
|
1593
|
+
style: fe(o(y)),
|
|
1594
|
+
onTextChange: R[1] || (R[1] = (H) => D.$emit("update:modelValue", o(f)))
|
|
1577
1595
|
}, null, 8, ["content", "options", "style"])
|
|
1578
1596
|
])
|
|
1579
1597
|
], 64);
|
|
1580
1598
|
};
|
|
1581
1599
|
}
|
|
1582
1600
|
});
|
|
1583
|
-
function
|
|
1601
|
+
function Pt(e, t) {
|
|
1584
1602
|
if (arguments.length === 0 || !e)
|
|
1585
1603
|
return null;
|
|
1586
|
-
const
|
|
1604
|
+
const l = t || "{y}-{m}-{d} {h}:{i}:{s}";
|
|
1587
1605
|
let a;
|
|
1588
1606
|
typeof e == "object" ? a = e : (typeof e == "string" && /^[0-9]+$/.test(e) ? e = parseInt(e) : typeof e == "string" && (e = e.replace(new RegExp(/-/gm), "/").replace("T", " ").replace(new RegExp(/\.[\d]{3}/gm), "")), typeof e == "number" && e.toString().length === 10 && (e = e * 1e3), a = new Date(e));
|
|
1589
1607
|
const c = {
|
|
@@ -1595,166 +1613,166 @@ function Pl(e, l) {
|
|
|
1595
1613
|
s: a.getSeconds(),
|
|
1596
1614
|
a: a.getDay()
|
|
1597
1615
|
};
|
|
1598
|
-
return
|
|
1599
|
-
let
|
|
1600
|
-
return u === "a" ? ["日", "一", "二", "三", "四", "五", "六"][
|
|
1616
|
+
return l.replace(/{(y|m|d|h|i|s|a)+}/g, (s, u) => {
|
|
1617
|
+
let y = c[u];
|
|
1618
|
+
return u === "a" ? ["日", "一", "二", "三", "四", "五", "六"][y] : (s.length > 0 && y < 10 && (y = "0" + y), y || 0);
|
|
1601
1619
|
});
|
|
1602
1620
|
}
|
|
1603
|
-
const
|
|
1621
|
+
const xt = (e, t, l) => {
|
|
1604
1622
|
const a = e;
|
|
1605
|
-
return a.params = typeof a.params == "object" && a.params !== null && !Array.isArray(a.params) ? a.params : {},
|
|
1606
|
-
},
|
|
1607
|
-
if (
|
|
1623
|
+
return a.params = typeof a.params == "object" && a.params !== null && !Array.isArray(a.params) ? a.params : {}, t = Array.isArray(t) ? t : [], t[0] && t[0].length == 10 && (t[0] = t[0] + " 00:00:00", t[1] = t[1] + " 23:59:59"), typeof l > "u" ? (a.params.beginTime = t[0], a.params.endTime = t[1]) : (l = l.charAt(0).toUpperCase() + l.slice(1), a.params["begin" + l] = t[0], a.params["end" + l] = t[1]), a;
|
|
1624
|
+
}, It = (e, t) => {
|
|
1625
|
+
if (t === void 0)
|
|
1608
1626
|
return "";
|
|
1609
|
-
const
|
|
1627
|
+
const l = [];
|
|
1610
1628
|
return Object.keys(e).some((a) => {
|
|
1611
|
-
if (e[a].value == "" +
|
|
1612
|
-
return
|
|
1613
|
-
}),
|
|
1614
|
-
},
|
|
1615
|
-
if (
|
|
1629
|
+
if (e[a].value == "" + t)
|
|
1630
|
+
return l.push(e[a].label), !0;
|
|
1631
|
+
}), l.length === 0 && l.push(t), l.join("");
|
|
1632
|
+
}, Ot = (e, t, l) => {
|
|
1633
|
+
if (t === void 0 || t.length === 0)
|
|
1616
1634
|
return "";
|
|
1617
|
-
Array.isArray(
|
|
1618
|
-
const a = [], c =
|
|
1619
|
-
return Object.keys(
|
|
1620
|
-
let
|
|
1621
|
-
Object.keys(e).some((
|
|
1622
|
-
e[
|
|
1623
|
-
}),
|
|
1635
|
+
Array.isArray(t) && (t = t.join(","));
|
|
1636
|
+
const a = [], c = l === void 0 ? "," : l, s = t.split(c);
|
|
1637
|
+
return Object.keys(t.split(c)).some((u) => {
|
|
1638
|
+
let y = !1;
|
|
1639
|
+
Object.keys(e).some((f) => {
|
|
1640
|
+
e[f].value == "" + s[u] && (a.push(e[f].label + c), y = !0);
|
|
1641
|
+
}), y || a.push(s[u] + c);
|
|
1624
1642
|
}), a.join("").substring(0, a.join("").length - 1);
|
|
1625
|
-
},
|
|
1643
|
+
}, Lt = (e, t, l, a) => {
|
|
1626
1644
|
const c = {
|
|
1627
|
-
id:
|
|
1628
|
-
parentId:
|
|
1645
|
+
id: t || "id",
|
|
1646
|
+
parentId: l || "parentId",
|
|
1629
1647
|
childrenList: a || "children"
|
|
1630
|
-
},
|
|
1631
|
-
for (const
|
|
1632
|
-
const
|
|
1633
|
-
|
|
1648
|
+
}, s = {}, u = [];
|
|
1649
|
+
for (const y of e) {
|
|
1650
|
+
const f = y[c.id];
|
|
1651
|
+
s[f] = y, y[c.childrenList] || (y[c.childrenList] = []);
|
|
1634
1652
|
}
|
|
1635
|
-
for (const
|
|
1636
|
-
const
|
|
1637
|
-
|
|
1653
|
+
for (const y of e) {
|
|
1654
|
+
const f = y[c.parentId], _ = s[f];
|
|
1655
|
+
_ ? _[c.childrenList].push(y) : u.push(y);
|
|
1638
1656
|
}
|
|
1639
1657
|
return u;
|
|
1640
|
-
},
|
|
1641
|
-
let
|
|
1642
|
-
for (const
|
|
1643
|
-
const a = e[
|
|
1658
|
+
}, zt = (e) => {
|
|
1659
|
+
let t = "";
|
|
1660
|
+
for (const l of Object.keys(e)) {
|
|
1661
|
+
const a = e[l], c = encodeURIComponent(l) + "=";
|
|
1644
1662
|
if (a !== null && a !== "" && typeof a < "u")
|
|
1645
1663
|
if (typeof a == "object") {
|
|
1646
|
-
for (const
|
|
1647
|
-
if (a[
|
|
1648
|
-
const u =
|
|
1649
|
-
|
|
1664
|
+
for (const s of Object.keys(a))
|
|
1665
|
+
if (a[s] !== null && a[s] !== "" && typeof a[s] < "u") {
|
|
1666
|
+
const u = l + "[" + s + "]", y = encodeURIComponent(u) + "=";
|
|
1667
|
+
t += y + encodeURIComponent(a[s]) + "&";
|
|
1650
1668
|
}
|
|
1651
1669
|
} else
|
|
1652
|
-
|
|
1670
|
+
t += c + encodeURIComponent(a) + "&";
|
|
1653
1671
|
}
|
|
1654
|
-
return
|
|
1655
|
-
},
|
|
1672
|
+
return t;
|
|
1673
|
+
}, Bt = (e) => e.type !== "application/json", Na = (e) => {
|
|
1656
1674
|
if (!e && typeof e != "object")
|
|
1657
1675
|
throw new Error("error arguments", "deepClone");
|
|
1658
|
-
const
|
|
1659
|
-
return Object.keys(e).forEach((
|
|
1660
|
-
e[
|
|
1661
|
-
}),
|
|
1676
|
+
const t = e.constructor === Array ? [] : {};
|
|
1677
|
+
return Object.keys(e).forEach((l) => {
|
|
1678
|
+
e[l] && typeof e[l] == "object" ? t[l] = Na(e[l]) : t[l] = e[l];
|
|
1679
|
+
}), t;
|
|
1662
1680
|
};
|
|
1663
|
-
function
|
|
1664
|
-
const { proxy:
|
|
1665
|
-
const
|
|
1666
|
-
if (!
|
|
1667
|
-
switch (
|
|
1681
|
+
function Yt(e, t) {
|
|
1682
|
+
const { proxy: l } = he(), a = L({}), c = async (f) => {
|
|
1683
|
+
const _ = f.form;
|
|
1684
|
+
if (!_) return "";
|
|
1685
|
+
switch (_.type) {
|
|
1668
1686
|
case "checkboxGroup":
|
|
1669
1687
|
case "checkboxDict":
|
|
1670
1688
|
return [];
|
|
1671
1689
|
case "treeSelectApi":
|
|
1672
|
-
if (
|
|
1673
|
-
const
|
|
1674
|
-
if (
|
|
1675
|
-
const
|
|
1676
|
-
|
|
1690
|
+
if (_.api) {
|
|
1691
|
+
const d = await _.api({ pageNum: 1, pageSize: 1e3, ..._.apiParams });
|
|
1692
|
+
if (_.data = d.rows || d.data, _.data && Array.isArray(_.data) && !Array.isArray(_.defaultExpandedKeys) && _.autoExpandFirstLevel !== !1) {
|
|
1693
|
+
const B = _.props || { value: "id" }, D = _.valueKey || B.value || "id";
|
|
1694
|
+
_.defaultExpandedKeys = _.data.map((R) => R[D]);
|
|
1677
1695
|
}
|
|
1678
1696
|
}
|
|
1679
1697
|
return "";
|
|
1680
1698
|
case "radioApi":
|
|
1681
1699
|
case "selectApi":
|
|
1682
|
-
if (
|
|
1683
|
-
const
|
|
1684
|
-
|
|
1700
|
+
if (_.api) {
|
|
1701
|
+
const d = await _.api({ pageNum: 1, pageSize: 1e3, ..._.apiParams });
|
|
1702
|
+
_.data = d.rows || d.data;
|
|
1685
1703
|
}
|
|
1686
1704
|
return "";
|
|
1687
1705
|
case "checkboxCommonDict":
|
|
1688
|
-
return
|
|
1706
|
+
return _.data = await (l == null ? void 0 : l.useOneCommonDict(_.dictType)), [];
|
|
1689
1707
|
case "radioCommonDict":
|
|
1690
1708
|
case "selectCommonDict":
|
|
1691
|
-
return
|
|
1709
|
+
return _.data = await (l == null ? void 0 : l.useOneCommonDict(_.dictType)), "";
|
|
1692
1710
|
case "radioDict":
|
|
1693
1711
|
case "selectDict":
|
|
1694
|
-
return
|
|
1712
|
+
return _.data = await (l == null ? void 0 : l.useOneDict(_.dictType)), "";
|
|
1695
1713
|
case "daterange":
|
|
1696
1714
|
case "timerange":
|
|
1697
1715
|
return [];
|
|
1698
1716
|
default:
|
|
1699
1717
|
return "";
|
|
1700
1718
|
}
|
|
1701
|
-
},
|
|
1702
|
-
var
|
|
1703
|
-
let
|
|
1704
|
-
const
|
|
1705
|
-
for (const
|
|
1706
|
-
const P = ((
|
|
1707
|
-
|
|
1719
|
+
}, s = async (f) => {
|
|
1720
|
+
var D;
|
|
1721
|
+
let _ = {};
|
|
1722
|
+
const d = e.columns, B = f !== void 0 ? f : t;
|
|
1723
|
+
for (const R of d) {
|
|
1724
|
+
const P = ((D = R.form) == null ? void 0 : D.prop) || R.prop;
|
|
1725
|
+
_[P] = await c(R);
|
|
1708
1726
|
}
|
|
1709
|
-
if (
|
|
1710
|
-
const
|
|
1711
|
-
|
|
1727
|
+
if (B && typeof B == "object") {
|
|
1728
|
+
const R = Na(B);
|
|
1729
|
+
_ = { ..._, ...R };
|
|
1712
1730
|
}
|
|
1713
|
-
e.initEditData && e.initEditData(
|
|
1714
|
-
}, u = (
|
|
1715
|
-
e.columns.forEach((
|
|
1716
|
-
var
|
|
1717
|
-
const
|
|
1718
|
-
switch (
|
|
1731
|
+
e.initEditData && e.initEditData(_), e.beforeInitEdit && e.beforeInitEdit(_), u(_), a.value = _;
|
|
1732
|
+
}, u = (f) => {
|
|
1733
|
+
e.columns.forEach((d) => {
|
|
1734
|
+
var R, P, H, Z, ee;
|
|
1735
|
+
const B = (R = d.form) == null ? void 0 : R.type, D = ((P = d.form) == null ? void 0 : P.prop) || d.prop;
|
|
1736
|
+
switch (B) {
|
|
1719
1737
|
case "checkboxCommonDict":
|
|
1720
|
-
Array.isArray(
|
|
1738
|
+
Array.isArray(f[D]) && (f[D] = f[D].map((w) => w[d.form.value] || w));
|
|
1721
1739
|
break;
|
|
1722
1740
|
case "selectDict":
|
|
1723
1741
|
case "radioDict":
|
|
1724
1742
|
case "switch":
|
|
1725
|
-
|
|
1743
|
+
f[D] = f[D] || ((H = d.form) == null ? void 0 : H.defaultValue);
|
|
1726
1744
|
break;
|
|
1727
1745
|
case "daterange":
|
|
1728
1746
|
case "timerange":
|
|
1729
|
-
const
|
|
1730
|
-
|
|
1747
|
+
const S = (Z = d.form) == null ? void 0 : Z.rangeBeginProp, U = (ee = d.form) == null ? void 0 : ee.rangeEndProp;
|
|
1748
|
+
S && U && f[S] && f[U] ? f[D] = [f[S], f[U]] : typeof f[D] == "string" && f[D].includes(",") ? f[D] = f[D].split(",") : (!f[D] || !Array.isArray(f[D])) && (f[D] = f[D] || []);
|
|
1731
1749
|
break;
|
|
1732
1750
|
}
|
|
1733
1751
|
});
|
|
1734
1752
|
};
|
|
1735
1753
|
return {
|
|
1736
1754
|
formData: a,
|
|
1737
|
-
initFormData:
|
|
1738
|
-
prepareSaveData: async (
|
|
1739
|
-
const
|
|
1740
|
-
if (e.columns.forEach((
|
|
1741
|
-
var
|
|
1742
|
-
const
|
|
1743
|
-
if ((
|
|
1744
|
-
const ee =
|
|
1745
|
-
|
|
1755
|
+
initFormData: s,
|
|
1756
|
+
prepareSaveData: async (f) => {
|
|
1757
|
+
const _ = { ...a.value, ...f };
|
|
1758
|
+
if (e.columns.forEach((d) => {
|
|
1759
|
+
var R, P, H, Z;
|
|
1760
|
+
const B = (R = d.form) == null ? void 0 : R.type, D = ((P = d.form) == null ? void 0 : P.prop) || d.prop;
|
|
1761
|
+
if ((B === "daterange" || B === "timerange") && Array.isArray(_[D])) {
|
|
1762
|
+
const ee = _[D], S = (H = d.form) == null ? void 0 : H.rangeBeginProp, U = (Z = d.form) == null ? void 0 : Z.rangeEndProp;
|
|
1763
|
+
S && U && ee.length >= 2 && (_[S] = ee[0], _[U] = ee[1]);
|
|
1746
1764
|
}
|
|
1747
|
-
}), delete
|
|
1748
|
-
const
|
|
1749
|
-
if (
|
|
1750
|
-
|
|
1765
|
+
}), delete _.orderByColumn, delete _.isAsc, e.beforeSave) {
|
|
1766
|
+
const d = await e.beforeSave(_);
|
|
1767
|
+
if (d === !1) return !1;
|
|
1768
|
+
d && typeof d == "object" ? Object.assign(f, d) : Object.assign(f, _);
|
|
1751
1769
|
} else
|
|
1752
|
-
Object.assign(
|
|
1770
|
+
Object.assign(f, _);
|
|
1753
1771
|
return !0;
|
|
1754
1772
|
}
|
|
1755
1773
|
};
|
|
1756
1774
|
}
|
|
1757
|
-
const
|
|
1775
|
+
const Mt = { key: 20 }, Rt = { class: "color-picker-tips" }, jt = /* @__PURE__ */ pe({
|
|
1758
1776
|
__name: "curdEdit",
|
|
1759
1777
|
props: {
|
|
1760
1778
|
dataSource: {},
|
|
@@ -1763,56 +1781,56 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
1763
1781
|
modelValue: { type: Boolean }
|
|
1764
1782
|
},
|
|
1765
1783
|
emits: ["close", "actionEvent"],
|
|
1766
|
-
setup(e, { emit:
|
|
1767
|
-
const { t } = Ua(), { proxy: a } = he(), c = e,
|
|
1784
|
+
setup(e, { emit: t }) {
|
|
1785
|
+
const { t: l } = Ua(), { proxy: a } = he(), c = e, s = L(!1), u = L(), y = t, f = L(), _ = L(za), { formData: d, initFormData: B, prepareSaveData: D } = Yt(
|
|
1768
1786
|
c.dataSource,
|
|
1769
1787
|
c.editData
|
|
1770
|
-
),
|
|
1771
|
-
const E = !!c.editData[c.dataSource.rowKey], x =
|
|
1788
|
+
), R = J(() => {
|
|
1789
|
+
const E = !!c.editData[c.dataSource.rowKey], x = Zl(c.dataSource.columns, E, E);
|
|
1772
1790
|
return Ba(x, "form.order");
|
|
1773
|
-
}), P =
|
|
1774
|
-
if (Array.isArray(
|
|
1775
|
-
return
|
|
1776
|
-
if (
|
|
1791
|
+
}), P = J(() => c.dataSource.formInline || !1), H = (w) => {
|
|
1792
|
+
if (Array.isArray(w.defaultExpandedKeys))
|
|
1793
|
+
return w.defaultExpandedKeys;
|
|
1794
|
+
if (w.autoExpandFirstLevel === !1)
|
|
1777
1795
|
return [];
|
|
1778
|
-
const E =
|
|
1779
|
-
return Array.isArray(E) ? E.map((
|
|
1780
|
-
}, Z = () =>
|
|
1781
|
-
var
|
|
1782
|
-
(
|
|
1783
|
-
var x, W,
|
|
1796
|
+
const E = w.data || [], x = w.props || { value: "id" }, W = w.valueKey || x.value || "id";
|
|
1797
|
+
return Array.isArray(E) ? E.map((C) => C[W]).filter((C) => C !== void 0) : [];
|
|
1798
|
+
}, Z = () => Xl(c.dataSource.columns), ee = () => {
|
|
1799
|
+
var w;
|
|
1800
|
+
(w = f.value) == null || w.validate(async (E) => {
|
|
1801
|
+
var x, W, C, p, T;
|
|
1784
1802
|
if (!E) return !1;
|
|
1785
1803
|
try {
|
|
1786
1804
|
const A = { ...c.dataSource.queryParams || {} };
|
|
1787
|
-
if (await
|
|
1788
|
-
c.editData[c.dataSource.rowKey] ? await ((W = (x = c.dataSource).updateApi) == null ? void 0 : W.call(x, A)) : await ((p = (
|
|
1805
|
+
if (await D(A) === !1) return !1;
|
|
1806
|
+
c.editData[c.dataSource.rowKey] ? await ((W = (x = c.dataSource).updateApi) == null ? void 0 : W.call(x, A)) : await ((p = (C = c.dataSource).addApi) == null ? void 0 : p.call(C, A)), await S(), U(!0), a == null || a.$modal.msgSuccess(l("數據存儲成功")), (T = f.value) == null || T.resetFields();
|
|
1789
1807
|
} catch (A) {
|
|
1790
1808
|
console.error("Save failed:", A);
|
|
1791
1809
|
}
|
|
1792
1810
|
return !1;
|
|
1793
1811
|
});
|
|
1794
|
-
},
|
|
1795
|
-
const
|
|
1796
|
-
if (
|
|
1812
|
+
}, S = async () => {
|
|
1813
|
+
const w = u.value;
|
|
1814
|
+
if (w != null) {
|
|
1797
1815
|
const E = [];
|
|
1798
|
-
for (let x = 0; x <
|
|
1799
|
-
const W =
|
|
1816
|
+
for (let x = 0; x < w.length; x++) {
|
|
1817
|
+
const W = w[x].getTranslate();
|
|
1800
1818
|
E.push(W);
|
|
1801
1819
|
}
|
|
1802
|
-
await
|
|
1820
|
+
await Ct(E);
|
|
1803
1821
|
}
|
|
1804
|
-
}, U = (
|
|
1822
|
+
}, U = (w = !1) => {
|
|
1805
1823
|
var E;
|
|
1806
|
-
(E =
|
|
1824
|
+
(E = f.value) == null || E.resetFields(), y("close", w);
|
|
1807
1825
|
};
|
|
1808
|
-
return ke(() => c.modelValue, (
|
|
1809
|
-
|
|
1810
|
-
}), (
|
|
1811
|
-
const x =
|
|
1812
|
-
return
|
|
1826
|
+
return ke(() => c.modelValue, (w) => {
|
|
1827
|
+
w && (Z(), B(c.editData)), s.value = w;
|
|
1828
|
+
}), (w, E) => {
|
|
1829
|
+
const x = hl, W = Va, C = wa, p = Sa, T = ja, A = Ra, K = We, G = ya, se = ml, V = ga, Y = gl, q = yl, j = $a, ne = bl, ue = _a, me = ka, ce = va, ge = ba, i = De, m = Ne;
|
|
1830
|
+
return n(), h(m, {
|
|
1813
1831
|
title: c.action.title || c.action.text,
|
|
1814
|
-
modelValue: o(
|
|
1815
|
-
"onUpdate:modelValue": E[1] || (E[1] = (
|
|
1832
|
+
modelValue: o(s),
|
|
1833
|
+
"onUpdate:modelValue": E[1] || (E[1] = (r) => Se(s) ? s.value = r : null),
|
|
1816
1834
|
onClose: U,
|
|
1817
1835
|
"destroy-on-close": "",
|
|
1818
1836
|
"append-to-bod": "",
|
|
@@ -1820,21 +1838,21 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
1820
1838
|
class: "curdEditDialog"
|
|
1821
1839
|
}, {
|
|
1822
1840
|
footer: b(() => [
|
|
1823
|
-
|
|
1824
|
-
F(
|
|
1825
|
-
onClick: E[0] || (E[0] = (
|
|
1841
|
+
le("div", null, [
|
|
1842
|
+
F(i, {
|
|
1843
|
+
onClick: E[0] || (E[0] = (r) => U(!1))
|
|
1826
1844
|
}, {
|
|
1827
1845
|
default: b(() => [
|
|
1828
|
-
|
|
1846
|
+
z(M(w.$t("關閉")), 1)
|
|
1829
1847
|
]),
|
|
1830
1848
|
_: 1
|
|
1831
1849
|
}),
|
|
1832
|
-
F(
|
|
1850
|
+
F(i, {
|
|
1833
1851
|
type: "primary",
|
|
1834
1852
|
onClick: ee
|
|
1835
1853
|
}, {
|
|
1836
1854
|
default: b(() => [
|
|
1837
|
-
|
|
1855
|
+
z(M(w.$t("存儲")), 1)
|
|
1838
1856
|
]),
|
|
1839
1857
|
_: 1
|
|
1840
1858
|
})
|
|
@@ -1842,327 +1860,327 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
1842
1860
|
]),
|
|
1843
1861
|
default: b(() => [
|
|
1844
1862
|
F(ge, {
|
|
1845
|
-
model: o(
|
|
1863
|
+
model: o(d),
|
|
1846
1864
|
ref_key: "curdFormRef",
|
|
1847
|
-
ref:
|
|
1865
|
+
ref: f,
|
|
1848
1866
|
"label-width": c.action.labelWidth || c.dataSource.formLabelWidth || "auto",
|
|
1849
1867
|
"label-position": c.action.labelPosition || "right",
|
|
1850
1868
|
class: "p-l-3 p-r-3"
|
|
1851
1869
|
}, {
|
|
1852
1870
|
default: b(() => [
|
|
1853
|
-
F(
|
|
1871
|
+
F(ce, { gutter: 20 }, {
|
|
1854
1872
|
default: b(() => [
|
|
1855
|
-
(
|
|
1856
|
-
span:
|
|
1857
|
-
key:
|
|
1873
|
+
(n(!0), $(O, null, Q(o(R), (r) => (n(), h(me, {
|
|
1874
|
+
span: r.form.inline === !1 ? 24 : o(P) ? 12 : 24,
|
|
1875
|
+
key: r.prop,
|
|
1858
1876
|
class: "el-p"
|
|
1859
1877
|
}, {
|
|
1860
1878
|
default: b(() => {
|
|
1861
1879
|
var Ce;
|
|
1862
1880
|
return [
|
|
1863
1881
|
F(ue, {
|
|
1864
|
-
prop:
|
|
1865
|
-
label: ((Ce =
|
|
1866
|
-
name:
|
|
1867
|
-
rules:
|
|
1868
|
-
required:
|
|
1882
|
+
prop: r.form.prop || r.prop,
|
|
1883
|
+
label: ((Ce = r.form) == null ? void 0 : Ce.labelName) || r.label,
|
|
1884
|
+
name: r.form.prop || r.prop,
|
|
1885
|
+
rules: r.form.rules,
|
|
1886
|
+
required: r.form.required
|
|
1869
1887
|
}, {
|
|
1870
1888
|
default: b(() => [
|
|
1871
|
-
|
|
1889
|
+
r.form.type === "number" ? (n(), h(x, {
|
|
1872
1890
|
key: 0,
|
|
1873
|
-
modelValue: o(
|
|
1874
|
-
"onUpdate:modelValue": (v) => o(
|
|
1891
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
1892
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
1875
1893
|
style: { width: "100%" },
|
|
1876
|
-
min:
|
|
1877
|
-
max:
|
|
1878
|
-
precision:
|
|
1879
|
-
placeholder:
|
|
1880
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "precision", "placeholder"])) :
|
|
1894
|
+
min: r.form.min,
|
|
1895
|
+
max: r.form.max,
|
|
1896
|
+
precision: r.form.precision,
|
|
1897
|
+
placeholder: w.$t("請輸入")
|
|
1898
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "precision", "placeholder"])) : r.form.type === "select" ? (n(), h(C, {
|
|
1881
1899
|
key: 1,
|
|
1882
|
-
multiple:
|
|
1900
|
+
multiple: r.form.multiple,
|
|
1883
1901
|
style: { width: "100%" },
|
|
1884
|
-
modelValue: o(
|
|
1885
|
-
"onUpdate:modelValue": (v) => o(
|
|
1886
|
-
placeholder:
|
|
1887
|
-
filterable:
|
|
1902
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
1903
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
1904
|
+
placeholder: w.$t("請選擇"),
|
|
1905
|
+
filterable: r.form.filterable ?? !0
|
|
1888
1906
|
}, {
|
|
1889
1907
|
default: b(() => [
|
|
1890
|
-
(
|
|
1891
|
-
key: v[
|
|
1892
|
-
label: v[
|
|
1893
|
-
value: v[
|
|
1908
|
+
(n(!0), $(O, null, Q(r.form.data, (v) => (n(), h(W, {
|
|
1909
|
+
key: v[r.form.value] || v.value,
|
|
1910
|
+
label: v[r.form.label] || v.label,
|
|
1911
|
+
value: v[r.form.value] || v.value
|
|
1894
1912
|
}, null, 8, ["label", "value"]))), 128))
|
|
1895
1913
|
]),
|
|
1896
1914
|
_: 2
|
|
1897
|
-
}, 1032, ["multiple", "modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) :
|
|
1915
|
+
}, 1032, ["multiple", "modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) : r.form.type === "selectDict" ? (n(), h(C, {
|
|
1898
1916
|
key: 2,
|
|
1899
|
-
multiple:
|
|
1917
|
+
multiple: r.form.multiple,
|
|
1900
1918
|
style: { width: "100%" },
|
|
1901
|
-
modelValue: o(
|
|
1902
|
-
"onUpdate:modelValue": (v) => o(
|
|
1903
|
-
placeholder:
|
|
1904
|
-
filterable:
|
|
1919
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
1920
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
1921
|
+
placeholder: w.$t("請選擇"),
|
|
1922
|
+
filterable: r.form.filterable ?? !0
|
|
1905
1923
|
}, {
|
|
1906
1924
|
default: b(() => [
|
|
1907
|
-
(
|
|
1908
|
-
key: v[
|
|
1909
|
-
label: v[
|
|
1910
|
-
value: v[
|
|
1925
|
+
(n(!0), $(O, null, Q(r.form.data, (v) => (n(), h(W, {
|
|
1926
|
+
key: v[r.form.value] || v.value,
|
|
1927
|
+
label: v[r.form.label] || v.label,
|
|
1928
|
+
value: v[r.form.value] || v.value
|
|
1911
1929
|
}, null, 8, ["label", "value"]))), 128))
|
|
1912
1930
|
]),
|
|
1913
1931
|
_: 2
|
|
1914
|
-
}, 1032, ["multiple", "modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) :
|
|
1932
|
+
}, 1032, ["multiple", "modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) : r.form.type === "selectCommonDict" ? (n(), h(C, {
|
|
1915
1933
|
key: 3,
|
|
1916
|
-
multiple:
|
|
1934
|
+
multiple: r.form.multiple,
|
|
1917
1935
|
style: { width: "100%" },
|
|
1918
|
-
modelValue: o(
|
|
1919
|
-
"onUpdate:modelValue": (v) => o(
|
|
1920
|
-
placeholder:
|
|
1921
|
-
filterable:
|
|
1936
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
1937
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
1938
|
+
placeholder: w.$t("請選擇"),
|
|
1939
|
+
filterable: r.form.filterable ?? !0
|
|
1922
1940
|
}, {
|
|
1923
1941
|
default: b(() => [
|
|
1924
|
-
(
|
|
1942
|
+
(n(!0), $(O, null, Q(r.form.data, (v) => (n(), h(W, {
|
|
1925
1943
|
key: v.value,
|
|
1926
1944
|
label: v.label,
|
|
1927
1945
|
value: v.value
|
|
1928
1946
|
}, null, 8, ["label", "value"]))), 128))
|
|
1929
1947
|
]),
|
|
1930
1948
|
_: 2
|
|
1931
|
-
}, 1032, ["multiple", "modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) :
|
|
1949
|
+
}, 1032, ["multiple", "modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) : r.form.type === "selectApi" ? (n(), h(C, {
|
|
1932
1950
|
key: 4,
|
|
1933
|
-
multiple:
|
|
1951
|
+
multiple: r.form.multiple,
|
|
1934
1952
|
style: { width: "100%" },
|
|
1935
|
-
modelValue: o(
|
|
1936
|
-
"onUpdate:modelValue": (v) => o(
|
|
1937
|
-
placeholder:
|
|
1938
|
-
filterable:
|
|
1953
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
1954
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
1955
|
+
placeholder: w.$t("請選擇"),
|
|
1956
|
+
filterable: r.form.filterable ?? !0
|
|
1939
1957
|
}, {
|
|
1940
1958
|
default: b(() => [
|
|
1941
|
-
(
|
|
1942
|
-
key: v[
|
|
1943
|
-
label: v[
|
|
1944
|
-
value: v[
|
|
1959
|
+
(n(!0), $(O, null, Q(r.form.data, (v) => (n(), h(W, {
|
|
1960
|
+
key: v[r.form.value],
|
|
1961
|
+
label: v[r.form.label],
|
|
1962
|
+
value: v[r.form.value]
|
|
1945
1963
|
}, null, 8, ["label", "value"]))), 128))
|
|
1946
1964
|
]),
|
|
1947
1965
|
_: 2
|
|
1948
|
-
}, 1032, ["multiple", "modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) :
|
|
1966
|
+
}, 1032, ["multiple", "modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) : r.form.type === "date" ? (n(), h(p, {
|
|
1949
1967
|
key: 5,
|
|
1950
1968
|
format: "YYYY-MM-DD",
|
|
1951
1969
|
"value-format": "YYYY-MM-DD",
|
|
1952
|
-
modelValue: o(
|
|
1953
|
-
"onUpdate:modelValue": (v) => o(
|
|
1970
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
1971
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
1954
1972
|
type: "date",
|
|
1955
|
-
placeholder:
|
|
1973
|
+
placeholder: w.$t("請選擇日期"),
|
|
1956
1974
|
style: { width: "100%" }
|
|
1957
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) :
|
|
1975
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : r.form.type === "datetime" ? (n(), h(p, {
|
|
1958
1976
|
key: 6,
|
|
1959
1977
|
format: "YYYY-MM-DD HH:mm:ss",
|
|
1960
1978
|
"value-format": "YYYY-MM-DD HH:mm:ss",
|
|
1961
|
-
modelValue: o(
|
|
1962
|
-
"onUpdate:modelValue": (v) => o(
|
|
1979
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
1980
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
1963
1981
|
type: "datetime",
|
|
1964
|
-
placeholder:
|
|
1982
|
+
placeholder: w.$t("請選擇日期時間"),
|
|
1965
1983
|
style: { width: "100%" }
|
|
1966
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) :
|
|
1984
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : r.form.type === "daterange" ? (n(), h(p, {
|
|
1967
1985
|
key: 7,
|
|
1968
|
-
modelValue: o(
|
|
1969
|
-
"onUpdate:modelValue": (v) => o(
|
|
1986
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
1987
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
1970
1988
|
type: "daterange",
|
|
1971
1989
|
format: "YYYY-MM-DD",
|
|
1972
1990
|
"value-format": "YYYY-MM-DD",
|
|
1973
|
-
"range-separator":
|
|
1974
|
-
"start-placeholder":
|
|
1975
|
-
"end-placeholder":
|
|
1991
|
+
"range-separator": w.$t("至"),
|
|
1992
|
+
"start-placeholder": w.$t("開始日期"),
|
|
1993
|
+
"end-placeholder": w.$t("結束日期"),
|
|
1976
1994
|
style: { width: "100%" }
|
|
1977
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "range-separator", "start-placeholder", "end-placeholder"])) :
|
|
1995
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "range-separator", "start-placeholder", "end-placeholder"])) : r.form.type === "timerange" ? (n(), h(p, {
|
|
1978
1996
|
key: 8,
|
|
1979
|
-
modelValue: o(
|
|
1980
|
-
"onUpdate:modelValue": (v) => o(
|
|
1997
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
1998
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
1981
1999
|
type: "datetimerange",
|
|
1982
2000
|
format: "YYYY-MM-DD HH:mm",
|
|
1983
2001
|
"value-format": "YYYY-MM-DD HH:mm:ss",
|
|
1984
|
-
"range-separator":
|
|
1985
|
-
"start-placeholder":
|
|
1986
|
-
"end-placeholder":
|
|
2002
|
+
"range-separator": w.$t("至"),
|
|
2003
|
+
"start-placeholder": w.$t("開始時間"),
|
|
2004
|
+
"end-placeholder": w.$t("結束時間"),
|
|
1987
2005
|
style: { width: "100%" }
|
|
1988
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "range-separator", "start-placeholder", "end-placeholder"])) :
|
|
2006
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "range-separator", "start-placeholder", "end-placeholder"])) : r.form.type === "image" ? (n(), h(T, {
|
|
1989
2007
|
key: 9,
|
|
1990
|
-
limit:
|
|
1991
|
-
modelValue: o(
|
|
1992
|
-
"onUpdate:modelValue": (v) => o(
|
|
1993
|
-
}, null, 8, ["limit", "modelValue", "onUpdate:modelValue"])) :
|
|
2008
|
+
limit: r.form.limit || 1,
|
|
2009
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2010
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v
|
|
2011
|
+
}, null, 8, ["limit", "modelValue", "onUpdate:modelValue"])) : r.form.type === "file" ? (n(), h(A, {
|
|
1994
2012
|
key: 10,
|
|
1995
|
-
limit:
|
|
1996
|
-
modelValue: o(
|
|
1997
|
-
"onUpdate:modelValue": (v) => o(
|
|
1998
|
-
fileType:
|
|
1999
|
-
fileSize:
|
|
2000
|
-
}, null, 8, ["limit", "modelValue", "onUpdate:modelValue", "fileType", "fileSize"])) :
|
|
2013
|
+
limit: r.form.limit || 1,
|
|
2014
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2015
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
2016
|
+
fileType: r.form.fileType,
|
|
2017
|
+
fileSize: r.form.fileSize
|
|
2018
|
+
}, null, 8, ["limit", "modelValue", "onUpdate:modelValue", "fileType", "fileSize"])) : r.form.type === "password" ? (n(), h(K, {
|
|
2001
2019
|
key: 11,
|
|
2002
2020
|
"auto-complete": "new-password",
|
|
2003
|
-
modelValue: o(
|
|
2004
|
-
"onUpdate:modelValue": (v) => o(
|
|
2021
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2022
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
2005
2023
|
type: "password",
|
|
2006
|
-
placeholder:
|
|
2007
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) :
|
|
2024
|
+
placeholder: w.$t("請輸入")
|
|
2025
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : r.form.type === "checkboxGroup" ? (n(), h(se, {
|
|
2008
2026
|
key: 12,
|
|
2009
|
-
modelValue: o(
|
|
2010
|
-
"onUpdate:modelValue": (v) => o(
|
|
2027
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2028
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v
|
|
2011
2029
|
}, {
|
|
2012
2030
|
default: b(() => [
|
|
2013
|
-
(
|
|
2014
|
-
key: v[
|
|
2015
|
-
label: v[
|
|
2016
|
-
value: v[
|
|
2031
|
+
(n(!0), $(O, null, Q(r.form.list, (v) => (n(), h(G, {
|
|
2032
|
+
key: v[r.form.value],
|
|
2033
|
+
label: v[r.form.label],
|
|
2034
|
+
value: v[r.form.value]
|
|
2017
2035
|
}, null, 8, ["label", "value"]))), 128))
|
|
2018
2036
|
]),
|
|
2019
2037
|
_: 2
|
|
2020
|
-
}, 1032, ["modelValue", "onUpdate:modelValue"])) :
|
|
2038
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : r.form.type === "checkboxCommonDict" ? (n(), h(se, {
|
|
2021
2039
|
key: 13,
|
|
2022
|
-
modelValue: o(
|
|
2023
|
-
"onUpdate:modelValue": (v) => o(
|
|
2040
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2041
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v
|
|
2024
2042
|
}, {
|
|
2025
2043
|
default: b(() => [
|
|
2026
|
-
(
|
|
2044
|
+
(n(!0), $(O, null, Q(r.form.data, (v) => (n(), h(G, {
|
|
2027
2045
|
label: v.value,
|
|
2028
2046
|
key: v.value,
|
|
2029
2047
|
value: v.value
|
|
2030
2048
|
}, {
|
|
2031
2049
|
default: b(() => [
|
|
2032
|
-
|
|
2050
|
+
z(M(v.label), 1)
|
|
2033
2051
|
]),
|
|
2034
2052
|
_: 2
|
|
2035
2053
|
}, 1032, ["label", "value"]))), 128))
|
|
2036
2054
|
]),
|
|
2037
2055
|
_: 2
|
|
2038
|
-
}, 1032, ["modelValue", "onUpdate:modelValue"])) :
|
|
2056
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : r.form.type === "switch" ? (n(), h(V, {
|
|
2039
2057
|
key: 14,
|
|
2040
|
-
modelValue: o(
|
|
2041
|
-
"onUpdate:modelValue": (v) => o(
|
|
2042
|
-
"active-value":
|
|
2043
|
-
"inactive-value":
|
|
2044
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "active-value", "inactive-value"])) :
|
|
2058
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2059
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
2060
|
+
"active-value": r.form.activeValue || "0",
|
|
2061
|
+
"inactive-value": r.form.inactiveValue || "1"
|
|
2062
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "active-value", "inactive-value"])) : r.form.type === "radioDict" ? (n(), h(q, {
|
|
2045
2063
|
key: 15,
|
|
2046
|
-
modelValue: o(
|
|
2047
|
-
"onUpdate:modelValue": (v) => o(
|
|
2064
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2065
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v
|
|
2048
2066
|
}, {
|
|
2049
2067
|
default: b(() => [
|
|
2050
|
-
(
|
|
2068
|
+
(n(!0), $(O, null, Q(r.form.data, (v) => (n(), h(Y, {
|
|
2051
2069
|
key: v.value,
|
|
2052
2070
|
value: v.value
|
|
2053
2071
|
}, {
|
|
2054
2072
|
default: b(() => [
|
|
2055
|
-
|
|
2073
|
+
z(M(v.label), 1)
|
|
2056
2074
|
]),
|
|
2057
2075
|
_: 2
|
|
2058
2076
|
}, 1032, ["value"]))), 128))
|
|
2059
2077
|
]),
|
|
2060
2078
|
_: 2
|
|
2061
|
-
}, 1032, ["modelValue", "onUpdate:modelValue"])) :
|
|
2079
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : r.form.type === "treeSelectApi" ? (n(), h(j, {
|
|
2062
2080
|
key: 16,
|
|
2063
|
-
modelValue: o(
|
|
2064
|
-
"onUpdate:modelValue": (v) => o(
|
|
2065
|
-
data:
|
|
2066
|
-
props:
|
|
2067
|
-
"value-key":
|
|
2068
|
-
"default-expanded-keys": H(
|
|
2069
|
-
filterable:
|
|
2070
|
-
placeholder:
|
|
2081
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2082
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
2083
|
+
data: r.form.data,
|
|
2084
|
+
props: r.form.props,
|
|
2085
|
+
"value-key": r.form.valueKey,
|
|
2086
|
+
"default-expanded-keys": H(r.form),
|
|
2087
|
+
filterable: r.form.filterable ?? !0,
|
|
2088
|
+
placeholder: w.$t("請選擇"),
|
|
2071
2089
|
"check-strictly": ""
|
|
2072
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "data", "props", "value-key", "default-expanded-keys", "filterable", "placeholder"])) :
|
|
2090
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "data", "props", "value-key", "default-expanded-keys", "filterable", "placeholder"])) : r.form.type === "radioCommonDict" ? (n(), h(q, {
|
|
2073
2091
|
key: 17,
|
|
2074
|
-
modelValue: o(
|
|
2075
|
-
"onUpdate:modelValue": (v) => o(
|
|
2092
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2093
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v
|
|
2076
2094
|
}, {
|
|
2077
2095
|
default: b(() => [
|
|
2078
|
-
(
|
|
2096
|
+
(n(!0), $(O, null, Q(r.form.data, (v) => (n(), h(Y, {
|
|
2079
2097
|
key: v.value,
|
|
2080
2098
|
label: v.value
|
|
2081
2099
|
}, {
|
|
2082
2100
|
default: b(() => [
|
|
2083
|
-
|
|
2101
|
+
z(M(v.label), 1)
|
|
2084
2102
|
]),
|
|
2085
2103
|
_: 2
|
|
2086
2104
|
}, 1032, ["label"]))), 128))
|
|
2087
2105
|
]),
|
|
2088
2106
|
_: 2
|
|
2089
|
-
}, 1032, ["modelValue", "onUpdate:modelValue"])) :
|
|
2107
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : r.form.type === "radioLocalDict" ? (n(), h(q, {
|
|
2090
2108
|
key: 18,
|
|
2091
|
-
modelValue: o(
|
|
2092
|
-
"onUpdate:modelValue": (v) => o(
|
|
2109
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2110
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v
|
|
2093
2111
|
}, {
|
|
2094
2112
|
default: b(() => [
|
|
2095
|
-
(
|
|
2113
|
+
(n(!0), $(O, null, Q(o(_)[r.form.dictType], (v) => (n(), h(Y, {
|
|
2096
2114
|
key: v.value,
|
|
2097
2115
|
label: v.value
|
|
2098
2116
|
}, {
|
|
2099
2117
|
default: b(() => [
|
|
2100
|
-
|
|
2118
|
+
z(M(v.label), 1)
|
|
2101
2119
|
]),
|
|
2102
2120
|
_: 2
|
|
2103
2121
|
}, 1032, ["label"]))), 128))
|
|
2104
2122
|
]),
|
|
2105
2123
|
_: 2
|
|
2106
|
-
}, 1032, ["modelValue", "onUpdate:modelValue"])) :
|
|
2124
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : r.form.type === "checkbox" ? (n(), h(G, {
|
|
2107
2125
|
key: 19,
|
|
2108
|
-
label:
|
|
2109
|
-
modelValue: o(
|
|
2110
|
-
"onUpdate:modelValue": (v) => o(
|
|
2111
|
-
}, null, 8, ["label", "modelValue", "onUpdate:modelValue"])) :
|
|
2126
|
+
label: r.label,
|
|
2127
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2128
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v
|
|
2129
|
+
}, null, 8, ["label", "modelValue", "onUpdate:modelValue"])) : r.form.type === "color" ? (n(), $("div", Mt, [
|
|
2112
2130
|
F(ne, {
|
|
2113
|
-
modelValue: o(
|
|
2114
|
-
"onUpdate:modelValue": (v) => o(
|
|
2131
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2132
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v
|
|
2115
2133
|
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
2116
|
-
|
|
2117
|
-
])) :
|
|
2134
|
+
le("span", Rt, M(w.$t("需点击选择器中的确定按钮")), 1)
|
|
2135
|
+
])) : r.form.type === "inputNumber" ? (n(), h(x, {
|
|
2118
2136
|
key: 21,
|
|
2119
|
-
min:
|
|
2120
|
-
modelValue: o(
|
|
2121
|
-
"onUpdate:modelValue": (v) => o(
|
|
2137
|
+
min: r.form.min || 0,
|
|
2138
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2139
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
2122
2140
|
step: 1,
|
|
2123
2141
|
style: { width: "100%" }
|
|
2124
|
-
}, null, 8, ["min", "modelValue", "onUpdate:modelValue"])) :
|
|
2142
|
+
}, null, 8, ["min", "modelValue", "onUpdate:modelValue"])) : r.form.type === "richtext" ? (n(), h(Ha, {
|
|
2125
2143
|
key: 22,
|
|
2126
|
-
modelValue: o(
|
|
2127
|
-
"onUpdate:modelValue": (v) => o(
|
|
2128
|
-
height:
|
|
2129
|
-
"min-height":
|
|
2130
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "height", "min-height"])) : (
|
|
2131
|
-
|
|
2144
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2145
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
2146
|
+
height: r.form.max || 320,
|
|
2147
|
+
"min-height": r.form.min || 220
|
|
2148
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "height", "min-height"])) : (n(), $(O, { key: 23 }, [
|
|
2149
|
+
r.form.translate === !0 ? (n(), h(Fa, {
|
|
2132
2150
|
ref_for: !0,
|
|
2133
2151
|
ref_key: "translateInputRef",
|
|
2134
2152
|
ref: u,
|
|
2135
|
-
key: o(
|
|
2136
|
-
modelValue: o(
|
|
2137
|
-
"onUpdate:modelValue": (v) => o(
|
|
2138
|
-
disabled:
|
|
2139
|
-
type:
|
|
2140
|
-
placeholder:
|
|
2141
|
-
rows:
|
|
2142
|
-
"show-word-limit":
|
|
2143
|
-
maxlength:
|
|
2144
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "type", "placeholder", "rows", "show-word-limit", "maxlength"])) : (
|
|
2153
|
+
key: o(d)[w.dataSource.rowKey],
|
|
2154
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2155
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
2156
|
+
disabled: r.form.disabled || !1,
|
|
2157
|
+
type: r.form.type,
|
|
2158
|
+
placeholder: w.$t("請輸入"),
|
|
2159
|
+
rows: r.form.rows || 3,
|
|
2160
|
+
"show-word-limit": r.form.showWordLimit || !1,
|
|
2161
|
+
maxlength: r.form.limit || -1
|
|
2162
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "type", "placeholder", "rows", "show-word-limit", "maxlength"])) : (n(), h(K, {
|
|
2145
2163
|
key: 1,
|
|
2146
|
-
modelValue: o(
|
|
2147
|
-
"onUpdate:modelValue": (v) => o(
|
|
2148
|
-
disabled:
|
|
2149
|
-
type:
|
|
2150
|
-
placeholder:
|
|
2151
|
-
rows:
|
|
2152
|
-
"show-word-limit":
|
|
2153
|
-
maxlength:
|
|
2164
|
+
modelValue: o(d)[r.form.prop || r.prop],
|
|
2165
|
+
"onUpdate:modelValue": (v) => o(d)[r.form.prop || r.prop] = v,
|
|
2166
|
+
disabled: r.form.disabled || !1,
|
|
2167
|
+
type: r.form.type,
|
|
2168
|
+
placeholder: w.$t("請輸入"),
|
|
2169
|
+
rows: r.form.rows || 3,
|
|
2170
|
+
"show-word-limit": r.form.showWordLimit || !1,
|
|
2171
|
+
maxlength: r.form.limit || -1
|
|
2154
2172
|
}, Ye({ _: 2 }, [
|
|
2155
|
-
|
|
2173
|
+
r.form.suffix ? {
|
|
2156
2174
|
name: "suffix",
|
|
2157
2175
|
fn: b(() => [
|
|
2158
|
-
|
|
2176
|
+
z(M(r.form.suffix), 1)
|
|
2159
2177
|
]),
|
|
2160
2178
|
key: "0"
|
|
2161
2179
|
} : void 0,
|
|
2162
|
-
|
|
2180
|
+
r.form.prefix ? {
|
|
2163
2181
|
name: "prefix",
|
|
2164
2182
|
fn: b(() => [
|
|
2165
|
-
|
|
2183
|
+
z(M(r.form.prefix), 1)
|
|
2166
2184
|
]),
|
|
2167
2185
|
key: "1"
|
|
2168
2186
|
} : void 0
|
|
@@ -2186,62 +2204,62 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2186
2204
|
}, 8, ["title", "modelValue", "width"]);
|
|
2187
2205
|
};
|
|
2188
2206
|
}
|
|
2189
|
-
}), da = /* @__PURE__ */ ye(
|
|
2207
|
+
}), da = /* @__PURE__ */ ye(jt, [["__scopeId", "data-v-5233886c"]]), Ft = {
|
|
2190
2208
|
key: 1,
|
|
2191
2209
|
class: "curd-search-card",
|
|
2192
2210
|
style: { "margin-bottom": "0px !important" }
|
|
2193
|
-
},
|
|
2211
|
+
}, Ht = {
|
|
2194
2212
|
key: 2,
|
|
2195
2213
|
class: "curd-search-card"
|
|
2196
|
-
},
|
|
2214
|
+
}, Nt = /* @__PURE__ */ pe({
|
|
2197
2215
|
__name: "curdSearch",
|
|
2198
2216
|
props: {
|
|
2199
2217
|
dataSource: {},
|
|
2200
2218
|
selectedCount: { default: 0 }
|
|
2201
2219
|
},
|
|
2202
2220
|
emits: ["actionEvent"],
|
|
2203
|
-
setup(e, { expose:
|
|
2204
|
-
const { t: a } = Ua(), { proxy: c } = he(),
|
|
2221
|
+
setup(e, { expose: t, emit: l }) {
|
|
2222
|
+
const { t: a } = Ua(), { proxy: c } = he(), s = l, u = e, y = J(() => {
|
|
2205
2223
|
const p = u.dataSource.actions;
|
|
2206
2224
|
return p == null ? [] : p.filter((A) => A.position === "top" || A.action === "create" || A.action === "back").map((A) => {
|
|
2207
2225
|
const K = { ...A };
|
|
2208
2226
|
return K.action === "create" ? (K.cssType = "primary", K.icon = "Plus") : K.action === "back" && (K.icon = "Back"), K;
|
|
2209
2227
|
});
|
|
2210
|
-
}),
|
|
2228
|
+
}), f = J(() => y.value.find((p) => p.action === "create") ?? null), _ = J(() => {
|
|
2211
2229
|
var p;
|
|
2212
2230
|
return ((p = u.dataSource.actions) == null ? void 0 : p.find((T) => T.action === "delete")) ?? null;
|
|
2213
|
-
}),
|
|
2214
|
-
|
|
2215
|
-
},
|
|
2231
|
+
}), d = J(() => y.value.filter((p) => p.action !== "create")), B = (p) => {
|
|
2232
|
+
s("actionEvent", p);
|
|
2233
|
+
}, D = J(() => u.dataSource.searchColumnsPerRow ?? 4), R = J(() => Math.floor(24 / D.value)), P = J(() => u.dataSource.showSearchCard ?? !0), H = J(() => {
|
|
2216
2234
|
if (u.dataSource.searchActionColSpan != null)
|
|
2217
2235
|
return u.dataSource.searchActionColSpan;
|
|
2218
|
-
const p = U.value.length %
|
|
2236
|
+
const p = U.value.length % D.value, A = 24 - (p === 0 ? D.value : p) * R.value;
|
|
2219
2237
|
return A <= 0 ? 24 : A;
|
|
2220
|
-
}), Z =
|
|
2221
|
-
|
|
2238
|
+
}), Z = J(() => U.value.length % D.value === 0 ? "15px !important" : "0px !important"), { initSearchDicts: ee } = Ya(), S = L({}), U = L([]), w = () => {
|
|
2239
|
+
s("actionEvent", { action: "filter" });
|
|
2222
2240
|
}, E = async () => {
|
|
2223
2241
|
try {
|
|
2224
2242
|
let p = x();
|
|
2225
2243
|
if (p = { ...u.dataSource.queryParams || {}, ...p }, u.dataSource.beforeExport && await u.dataSource.beforeExport(p) === !1)
|
|
2226
2244
|
return;
|
|
2227
|
-
const T =
|
|
2245
|
+
const T = Ul().format("YYYYMMDDHHmmss");
|
|
2228
2246
|
let A = u.dataSource.exportFileName ? `${u.dataSource.exportFileName}` : "export";
|
|
2229
2247
|
A += `_${T}.xlsx`, c == null || c.download(u.dataSource.exportUrl, p, A);
|
|
2230
2248
|
} catch (p) {
|
|
2231
2249
|
console.error("Export failed:", p), c == null || c.$modal.msgError(a("導出失敗"));
|
|
2232
2250
|
}
|
|
2233
2251
|
}, x = () => {
|
|
2234
|
-
const p = { ...
|
|
2252
|
+
const p = { ...S.value };
|
|
2235
2253
|
return U.value.forEach((T) => {
|
|
2236
2254
|
var A, K;
|
|
2237
2255
|
if (((A = T.search) == null ? void 0 : A.type) === "daterange" || ((K = T.search) == null ? void 0 : K.type) === "timerange") {
|
|
2238
|
-
const
|
|
2239
|
-
|
|
2256
|
+
const G = p[T.search.prop];
|
|
2257
|
+
G && G[0] && G[1] && tt(p, G, T.search.prop, c), delete p[T.search.prop];
|
|
2240
2258
|
}
|
|
2241
2259
|
}), Re(p);
|
|
2242
2260
|
}, W = async () => {
|
|
2243
|
-
await
|
|
2244
|
-
},
|
|
2261
|
+
await C(), s("actionEvent", { action: "filter" }, {});
|
|
2262
|
+
}, C = async () => {
|
|
2245
2263
|
const p = u.dataSource.columns.filter(
|
|
2246
2264
|
(A) => A.search && Fe(A.search.permission ?? A.permission)
|
|
2247
2265
|
);
|
|
@@ -2253,15 +2271,15 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2253
2271
|
for (let A = 0; A < p.length; A++) {
|
|
2254
2272
|
const K = p[A];
|
|
2255
2273
|
if (!K.search) continue;
|
|
2256
|
-
const
|
|
2257
|
-
|
|
2274
|
+
const G = K.search.prop || "", se = K.search.type || "";
|
|
2275
|
+
se === "daterange" || se === "timerange" ? T[G] = K.search.default ? K.search.default.split(",") : [] : ((se === "selectApi" || se === "selectApiString" || se === "treeSelectApi" || se === "selectDict") && await ee(K), T[G] = K.search.default);
|
|
2258
2276
|
}
|
|
2259
|
-
|
|
2277
|
+
S.value = T;
|
|
2260
2278
|
};
|
|
2261
|
-
return Qe(() =>
|
|
2279
|
+
return Qe(() => C()), t({ initData: C, getQueryParams: x }), (p, T) => {
|
|
2262
2280
|
var ge;
|
|
2263
|
-
const A = Sa, K = Va,
|
|
2264
|
-
return o(U).length > 0 && o(P) ? (
|
|
2281
|
+
const A = Sa, K = Va, G = wa, se = $a, V = We, Y = _a, q = ka, j = De, ne = va, ue = ba, me = Da, ce = Ta("hasPermi");
|
|
2282
|
+
return o(U).length > 0 && o(P) ? (n(), h(me, {
|
|
2265
2283
|
key: 0,
|
|
2266
2284
|
class: "curd-search-card",
|
|
2267
2285
|
shadow: "hover",
|
|
@@ -2270,29 +2288,29 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2270
2288
|
}, {
|
|
2271
2289
|
default: b(() => [
|
|
2272
2290
|
F(ue, {
|
|
2273
|
-
model: o(
|
|
2291
|
+
model: o(S),
|
|
2274
2292
|
inline: !0,
|
|
2275
2293
|
"label-width": u.dataSource.searchLabelWidth || 68
|
|
2276
2294
|
}, {
|
|
2277
2295
|
default: b(() => [
|
|
2278
2296
|
F(ne, { gutter: 20 }, {
|
|
2279
2297
|
default: b(() => [
|
|
2280
|
-
(
|
|
2281
|
-
span: o(
|
|
2282
|
-
key:
|
|
2298
|
+
(n(!0), $(O, null, Q(o(U), (i) => (n(), h(q, {
|
|
2299
|
+
span: o(R),
|
|
2300
|
+
key: i.search.prop
|
|
2283
2301
|
}, {
|
|
2284
2302
|
default: b(() => [
|
|
2285
|
-
F(
|
|
2286
|
-
label:
|
|
2287
|
-
name:
|
|
2303
|
+
F(Y, {
|
|
2304
|
+
label: i.search.labelName || i.label,
|
|
2305
|
+
name: i.search.prop,
|
|
2288
2306
|
style: { width: "100%" },
|
|
2289
|
-
"label-width":
|
|
2307
|
+
"label-width": i.search.labelWidth
|
|
2290
2308
|
}, {
|
|
2291
2309
|
default: b(() => [
|
|
2292
|
-
|
|
2310
|
+
i.search.type === "daterange" ? (n(), h(A, {
|
|
2293
2311
|
key: 0,
|
|
2294
|
-
modelValue: o(
|
|
2295
|
-
"onUpdate:modelValue": (
|
|
2312
|
+
modelValue: o(S)[i.search.prop],
|
|
2313
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2296
2314
|
type: "daterange",
|
|
2297
2315
|
format: "YYYY-MM-DD",
|
|
2298
2316
|
"value-format": "YYYY-MM-DD",
|
|
@@ -2301,11 +2319,11 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2301
2319
|
"end-placeholder": p.$t("結束日期"),
|
|
2302
2320
|
style: { width: "100%" },
|
|
2303
2321
|
clearable: "",
|
|
2304
|
-
onChange:
|
|
2305
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "range-separator", "start-placeholder", "end-placeholder"])) :
|
|
2322
|
+
onChange: w
|
|
2323
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "range-separator", "start-placeholder", "end-placeholder"])) : i.search.type === "timerange" ? (n(), h(A, {
|
|
2306
2324
|
key: 1,
|
|
2307
|
-
modelValue: o(
|
|
2308
|
-
"onUpdate:modelValue": (
|
|
2325
|
+
modelValue: o(S)[i.search.prop],
|
|
2326
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2309
2327
|
type: "datetimerange",
|
|
2310
2328
|
format: "YYYY-MM-DD HH:mm",
|
|
2311
2329
|
"value-format": "YYYY-MM-DD HH:mm:ss",
|
|
@@ -2314,108 +2332,126 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2314
2332
|
"end-placeholder": p.$t("結束時間"),
|
|
2315
2333
|
style: { width: "100%" },
|
|
2316
2334
|
clearable: "",
|
|
2317
|
-
onChange:
|
|
2318
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "range-separator", "start-placeholder", "end-placeholder"])) :
|
|
2335
|
+
onChange: w
|
|
2336
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "range-separator", "start-placeholder", "end-placeholder"])) : i.search.type === "selectApi" ? (n(), h(G, {
|
|
2319
2337
|
key: 2,
|
|
2320
|
-
modelValue: o(
|
|
2321
|
-
"onUpdate:modelValue": (
|
|
2338
|
+
modelValue: o(S)[i.search.prop],
|
|
2339
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2322
2340
|
placeholder: p.$t("請選擇"),
|
|
2323
2341
|
style: { width: "100%" },
|
|
2324
2342
|
clearable: "",
|
|
2325
|
-
onChange:
|
|
2326
|
-
filterable:
|
|
2343
|
+
onChange: w,
|
|
2344
|
+
filterable: i.search.filterable ?? !0
|
|
2327
2345
|
}, {
|
|
2328
2346
|
default: b(() => [
|
|
2329
|
-
(
|
|
2330
|
-
key:
|
|
2331
|
-
label:
|
|
2332
|
-
value:
|
|
2347
|
+
(n(!0), $(O, null, Q(i.search.data, (m) => (n(), h(K, {
|
|
2348
|
+
key: m[i.search.value],
|
|
2349
|
+
label: m[i.search.label],
|
|
2350
|
+
value: m[i.search.value]
|
|
2333
2351
|
}, null, 8, ["label", "value"]))), 128))
|
|
2334
2352
|
]),
|
|
2335
2353
|
_: 2
|
|
2336
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) :
|
|
2354
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) : i.search.type === "selectApiString" ? (n(), h(G, {
|
|
2337
2355
|
key: 3,
|
|
2338
|
-
modelValue: o(
|
|
2339
|
-
"onUpdate:modelValue": (
|
|
2356
|
+
modelValue: o(S)[i.search.prop],
|
|
2357
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2340
2358
|
placeholder: p.$t("請選擇"),
|
|
2341
2359
|
style: { width: "100%" },
|
|
2342
2360
|
clearable: "",
|
|
2343
|
-
onChange:
|
|
2344
|
-
filterable:
|
|
2361
|
+
onChange: w,
|
|
2362
|
+
filterable: i.search.filterable ?? !0
|
|
2345
2363
|
}, {
|
|
2346
2364
|
default: b(() => [
|
|
2347
|
-
(
|
|
2348
|
-
key:
|
|
2349
|
-
label:
|
|
2350
|
-
value:
|
|
2365
|
+
(n(!0), $(O, null, Q(i.search.data, (m) => (n(), h(K, {
|
|
2366
|
+
key: m,
|
|
2367
|
+
label: m,
|
|
2368
|
+
value: m
|
|
2351
2369
|
}, null, 8, ["label", "value"]))), 128))
|
|
2352
2370
|
]),
|
|
2353
2371
|
_: 2
|
|
2354
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) :
|
|
2372
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) : i.search.type === "selectData" ? (n(), h(G, {
|
|
2355
2373
|
key: 4,
|
|
2356
|
-
modelValue: o(
|
|
2357
|
-
"onUpdate:modelValue": (
|
|
2374
|
+
modelValue: o(S)[i.search.prop],
|
|
2375
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2358
2376
|
placeholder: p.$t("請選擇"),
|
|
2359
2377
|
style: { width: "100%" },
|
|
2360
2378
|
clearable: "",
|
|
2361
|
-
onChange:
|
|
2362
|
-
filterable:
|
|
2379
|
+
onChange: w,
|
|
2380
|
+
filterable: i.search.filterable ?? !0
|
|
2363
2381
|
}, {
|
|
2364
2382
|
default: b(() => [
|
|
2365
|
-
(
|
|
2366
|
-
key:
|
|
2367
|
-
label:
|
|
2368
|
-
value:
|
|
2383
|
+
(n(!0), $(O, null, Q(i.search.data, (m) => (n(), h(K, {
|
|
2384
|
+
key: m[i.search.value],
|
|
2385
|
+
label: m[i.search.label],
|
|
2386
|
+
value: m[i.search.value]
|
|
2369
2387
|
}, null, 8, ["label", "value"]))), 128))
|
|
2370
2388
|
]),
|
|
2371
2389
|
_: 2
|
|
2372
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) :
|
|
2390
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) : i.search.type === "selectDict" ? (n(), h(G, {
|
|
2373
2391
|
key: 5,
|
|
2374
|
-
modelValue: o(
|
|
2375
|
-
"onUpdate:modelValue": (
|
|
2392
|
+
modelValue: o(S)[i.search.prop],
|
|
2393
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2376
2394
|
placeholder: p.$t("請選擇"),
|
|
2377
2395
|
style: { width: "100%" },
|
|
2378
2396
|
clearable: "",
|
|
2379
|
-
onChange:
|
|
2380
|
-
filterable:
|
|
2397
|
+
onChange: w,
|
|
2398
|
+
filterable: i.search.filterable ?? !0
|
|
2381
2399
|
}, {
|
|
2382
2400
|
default: b(() => [
|
|
2383
|
-
(
|
|
2384
|
-
key:
|
|
2385
|
-
label:
|
|
2386
|
-
value:
|
|
2401
|
+
(n(!0), $(O, null, Q(i.search.data || [], (m) => (n(), h(K, {
|
|
2402
|
+
key: m[i.search.value] || m.value,
|
|
2403
|
+
label: m[i.search.label] || m.label,
|
|
2404
|
+
value: m[i.search.value] || m.value
|
|
2387
2405
|
}, null, 8, ["label", "value"]))), 128))
|
|
2388
2406
|
]),
|
|
2389
2407
|
_: 2
|
|
2390
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) :
|
|
2408
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) : i.search.type === "selectCommonDict" ? (n(), h(G, {
|
|
2391
2409
|
key: 6,
|
|
2392
|
-
modelValue: o(
|
|
2393
|
-
"onUpdate:modelValue": (
|
|
2394
|
-
data: d.search.data,
|
|
2395
|
-
props: d.search.props,
|
|
2396
|
-
"value-key": d.search.valueKey,
|
|
2397
|
-
"default-expanded-keys": d.search.defaultExpandedKeys,
|
|
2410
|
+
modelValue: o(S)[i.search.prop],
|
|
2411
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2398
2412
|
placeholder: p.$t("請選擇"),
|
|
2399
2413
|
style: { width: "100%" },
|
|
2400
|
-
"check-strictly": "",
|
|
2401
2414
|
clearable: "",
|
|
2402
|
-
onChange:
|
|
2403
|
-
|
|
2415
|
+
onChange: w,
|
|
2416
|
+
filterable: i.search.filterable ?? !0
|
|
2417
|
+
}, {
|
|
2418
|
+
default: b(() => [
|
|
2419
|
+
(n(!0), $(O, null, Q(i.search.data || [], (m) => (n(), h(K, {
|
|
2420
|
+
key: m[i.search.value] || m.value,
|
|
2421
|
+
label: m[i.search.label] || m.label,
|
|
2422
|
+
value: m[i.search.value] || m.value
|
|
2423
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
2424
|
+
]),
|
|
2425
|
+
_: 2
|
|
2426
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) : i.search.type === "treeSelectApi" ? (n(), h(se, {
|
|
2404
2427
|
key: 7,
|
|
2428
|
+
modelValue: o(S)[i.search.prop],
|
|
2429
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2430
|
+
data: i.search.data,
|
|
2431
|
+
props: i.search.props,
|
|
2432
|
+
"value-key": i.search.valueKey,
|
|
2433
|
+
"default-expanded-keys": i.search.defaultExpandedKeys,
|
|
2434
|
+
placeholder: p.$t("請選擇"),
|
|
2435
|
+
style: { width: "100%" },
|
|
2436
|
+
"check-strictly": "",
|
|
2437
|
+
clearable: "",
|
|
2438
|
+
onChange: w
|
|
2439
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "data", "props", "value-key", "default-expanded-keys", "placeholder"])) : i.search.type === "number" ? (n(), h(V, {
|
|
2440
|
+
key: 8,
|
|
2405
2441
|
type: "number",
|
|
2406
|
-
modelValue: o(
|
|
2407
|
-
"onUpdate:modelValue": (
|
|
2442
|
+
modelValue: o(S)[i.search.prop],
|
|
2443
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2408
2444
|
placeholder: p.$t("請輸入"),
|
|
2409
2445
|
style: { width: "100%" },
|
|
2410
2446
|
clearable: ""
|
|
2411
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : (
|
|
2412
|
-
key:
|
|
2447
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : (n(), h(V, {
|
|
2448
|
+
key: 9,
|
|
2413
2449
|
type: "text",
|
|
2414
|
-
modelValue: o(
|
|
2415
|
-
"onUpdate:modelValue": (
|
|
2450
|
+
modelValue: o(S)[i.search.prop],
|
|
2451
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2416
2452
|
style: { width: "100%" },
|
|
2417
2453
|
placeholder: p.$t("請輸入"),
|
|
2418
|
-
onKeyup:
|
|
2454
|
+
onKeyup: ta(w, ["enter"]),
|
|
2419
2455
|
clearable: ""
|
|
2420
2456
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"]))
|
|
2421
2457
|
]),
|
|
@@ -2426,15 +2462,15 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2426
2462
|
}, 1032, ["span"]))), 128)),
|
|
2427
2463
|
F(q, { span: o(H) }, {
|
|
2428
2464
|
default: b(() => {
|
|
2429
|
-
var
|
|
2465
|
+
var i;
|
|
2430
2466
|
return [
|
|
2431
2467
|
F(j, {
|
|
2432
|
-
onClick:
|
|
2468
|
+
onClick: w,
|
|
2433
2469
|
icon: "Search",
|
|
2434
2470
|
plain: ""
|
|
2435
2471
|
}, {
|
|
2436
2472
|
default: b(() => [
|
|
2437
|
-
|
|
2473
|
+
z(M(p.$t("查詢")), 1)
|
|
2438
2474
|
]),
|
|
2439
2475
|
_: 1
|
|
2440
2476
|
}),
|
|
@@ -2444,40 +2480,40 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2444
2480
|
plain: ""
|
|
2445
2481
|
}, {
|
|
2446
2482
|
default: b(() => [
|
|
2447
|
-
|
|
2483
|
+
z(M(p.$t("清空")), 1)
|
|
2448
2484
|
]),
|
|
2449
2485
|
_: 1
|
|
2450
2486
|
}),
|
|
2451
|
-
o(
|
|
2487
|
+
o(f) ? de((n(), h(j, {
|
|
2452
2488
|
key: 0,
|
|
2453
|
-
type: o(
|
|
2454
|
-
icon: o(
|
|
2489
|
+
type: o(f).cssType,
|
|
2490
|
+
icon: o(f).icon,
|
|
2455
2491
|
plain: "",
|
|
2456
|
-
onClick: T[0] || (T[0] = (
|
|
2492
|
+
onClick: T[0] || (T[0] = (m) => B(o(f)))
|
|
2457
2493
|
}, {
|
|
2458
2494
|
default: b(() => [
|
|
2459
|
-
|
|
2495
|
+
z(M(p.$t(o(f).text || "新增")), 1)
|
|
2460
2496
|
]),
|
|
2461
2497
|
_: 1
|
|
2462
2498
|
}, 8, ["type", "icon"])), [
|
|
2463
|
-
[
|
|
2499
|
+
[ce, o(f).permission || null]
|
|
2464
2500
|
]) : X("", !0),
|
|
2465
|
-
u.dataSource.showBatchDeleteButton ? de((
|
|
2501
|
+
u.dataSource.showBatchDeleteButton ? de((n(), h(j, {
|
|
2466
2502
|
key: 1,
|
|
2467
2503
|
type: "danger",
|
|
2468
2504
|
icon: "Delete",
|
|
2469
2505
|
plain: "",
|
|
2470
2506
|
disabled: p.selectedCount === 0,
|
|
2471
|
-
onClick: T[1] || (T[1] = (
|
|
2507
|
+
onClick: T[1] || (T[1] = (m) => s("actionEvent", { action: "batchDelete" }))
|
|
2472
2508
|
}, {
|
|
2473
2509
|
default: b(() => [
|
|
2474
|
-
|
|
2510
|
+
z(M(p.$t("批量刪除")), 1)
|
|
2475
2511
|
]),
|
|
2476
2512
|
_: 1
|
|
2477
2513
|
}, 8, ["disabled"])), [
|
|
2478
|
-
[
|
|
2514
|
+
[ce, ((i = o(_)) == null ? void 0 : i.permission) || null]
|
|
2479
2515
|
]) : X("", !0),
|
|
2480
|
-
u.dataSource.exportUrl ? (
|
|
2516
|
+
u.dataSource.exportUrl ? (n(), h(j, {
|
|
2481
2517
|
key: 2,
|
|
2482
2518
|
type: "primary",
|
|
2483
2519
|
icon: "Download",
|
|
@@ -2485,23 +2521,23 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2485
2521
|
onClick: E
|
|
2486
2522
|
}, {
|
|
2487
2523
|
default: b(() => [
|
|
2488
|
-
|
|
2524
|
+
z(M(u.dataSource.exportButtonName || p.$t("導出")), 1)
|
|
2489
2525
|
]),
|
|
2490
2526
|
_: 1
|
|
2491
2527
|
})) : X("", !0),
|
|
2492
|
-
(
|
|
2493
|
-
key:
|
|
2494
|
-
onClick: (
|
|
2495
|
-
type:
|
|
2496
|
-
icon:
|
|
2528
|
+
(n(!0), $(O, null, Q(o(d), (m) => de((n(), h(j, {
|
|
2529
|
+
key: m.text,
|
|
2530
|
+
onClick: (r) => B(m),
|
|
2531
|
+
type: m.cssType,
|
|
2532
|
+
icon: m.icon,
|
|
2497
2533
|
plain: ""
|
|
2498
2534
|
}, {
|
|
2499
2535
|
default: b(() => [
|
|
2500
|
-
|
|
2536
|
+
z(M(p.$t(m.text)), 1)
|
|
2501
2537
|
]),
|
|
2502
2538
|
_: 2
|
|
2503
2539
|
}, 1032, ["onClick", "type", "icon"])), [
|
|
2504
|
-
[
|
|
2540
|
+
[ce, m.permission || null]
|
|
2505
2541
|
])), 128))
|
|
2506
2542
|
];
|
|
2507
2543
|
}),
|
|
@@ -2515,31 +2551,31 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2515
2551
|
}, 8, ["model", "label-width"])
|
|
2516
2552
|
]),
|
|
2517
2553
|
_: 1
|
|
2518
|
-
}, 8, ["body-style"])) : o(U).length > 0 && !o(P) ? (
|
|
2554
|
+
}, 8, ["body-style"])) : o(U).length > 0 && !o(P) ? (n(), $("div", Ft, [
|
|
2519
2555
|
F(ue, {
|
|
2520
|
-
model: o(
|
|
2556
|
+
model: o(S),
|
|
2521
2557
|
inline: !0,
|
|
2522
2558
|
"label-width": u.dataSource.searchLabelWidth || 68
|
|
2523
2559
|
}, {
|
|
2524
2560
|
default: b(() => [
|
|
2525
2561
|
F(ne, { gutter: 20 }, {
|
|
2526
2562
|
default: b(() => [
|
|
2527
|
-
(
|
|
2528
|
-
span: o(
|
|
2529
|
-
key:
|
|
2563
|
+
(n(!0), $(O, null, Q(o(U), (i) => (n(), h(q, {
|
|
2564
|
+
span: o(R),
|
|
2565
|
+
key: i.search.prop
|
|
2530
2566
|
}, {
|
|
2531
2567
|
default: b(() => [
|
|
2532
|
-
F(
|
|
2533
|
-
label:
|
|
2534
|
-
name:
|
|
2568
|
+
F(Y, {
|
|
2569
|
+
label: i.search.labelName || i.label,
|
|
2570
|
+
name: i.search.prop,
|
|
2535
2571
|
style: { width: "100%" },
|
|
2536
|
-
"label-width":
|
|
2572
|
+
"label-width": i.search.labelWidth
|
|
2537
2573
|
}, {
|
|
2538
2574
|
default: b(() => [
|
|
2539
|
-
|
|
2575
|
+
i.search.type === "daterange" ? (n(), h(A, {
|
|
2540
2576
|
key: 0,
|
|
2541
|
-
modelValue: o(
|
|
2542
|
-
"onUpdate:modelValue": (
|
|
2577
|
+
modelValue: o(S)[i.search.prop],
|
|
2578
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2543
2579
|
type: "daterange",
|
|
2544
2580
|
format: "YYYY-MM-DD",
|
|
2545
2581
|
"value-format": "YYYY-MM-DD",
|
|
@@ -2548,11 +2584,11 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2548
2584
|
"end-placeholder": p.$t("結束日期"),
|
|
2549
2585
|
style: { width: "100%" },
|
|
2550
2586
|
clearable: "",
|
|
2551
|
-
onChange:
|
|
2552
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "range-separator", "start-placeholder", "end-placeholder"])) :
|
|
2587
|
+
onChange: w
|
|
2588
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "range-separator", "start-placeholder", "end-placeholder"])) : i.search.type === "timerange" ? (n(), h(A, {
|
|
2553
2589
|
key: 1,
|
|
2554
|
-
modelValue: o(
|
|
2555
|
-
"onUpdate:modelValue": (
|
|
2590
|
+
modelValue: o(S)[i.search.prop],
|
|
2591
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2556
2592
|
type: "datetimerange",
|
|
2557
2593
|
format: "YYYY-MM-DD HH:mm",
|
|
2558
2594
|
"value-format": "YYYY-MM-DD HH:mm:ss",
|
|
@@ -2561,108 +2597,126 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2561
2597
|
"end-placeholder": p.$t("結束時間"),
|
|
2562
2598
|
style: { width: "100%" },
|
|
2563
2599
|
clearable: "",
|
|
2564
|
-
onChange:
|
|
2565
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "range-separator", "start-placeholder", "end-placeholder"])) :
|
|
2600
|
+
onChange: w
|
|
2601
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "range-separator", "start-placeholder", "end-placeholder"])) : i.search.type === "selectApi" ? (n(), h(G, {
|
|
2566
2602
|
key: 2,
|
|
2567
|
-
modelValue: o(
|
|
2568
|
-
"onUpdate:modelValue": (
|
|
2603
|
+
modelValue: o(S)[i.search.prop],
|
|
2604
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2569
2605
|
placeholder: p.$t("請選擇"),
|
|
2570
2606
|
style: { width: "100%" },
|
|
2571
2607
|
clearable: "",
|
|
2572
|
-
onChange:
|
|
2573
|
-
filterable:
|
|
2608
|
+
onChange: w,
|
|
2609
|
+
filterable: i.search.filterable ?? !0
|
|
2574
2610
|
}, {
|
|
2575
2611
|
default: b(() => [
|
|
2576
|
-
(
|
|
2577
|
-
key:
|
|
2578
|
-
label:
|
|
2579
|
-
value:
|
|
2612
|
+
(n(!0), $(O, null, Q(i.search.data, (m) => (n(), h(K, {
|
|
2613
|
+
key: m[i.search.value],
|
|
2614
|
+
label: m[i.search.label],
|
|
2615
|
+
value: m[i.search.value]
|
|
2580
2616
|
}, null, 8, ["label", "value"]))), 128))
|
|
2581
2617
|
]),
|
|
2582
2618
|
_: 2
|
|
2583
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) :
|
|
2619
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) : i.search.type === "selectApiString" ? (n(), h(G, {
|
|
2584
2620
|
key: 3,
|
|
2585
|
-
modelValue: o(
|
|
2586
|
-
"onUpdate:modelValue": (
|
|
2621
|
+
modelValue: o(S)[i.search.prop],
|
|
2622
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2587
2623
|
placeholder: p.$t("請選擇"),
|
|
2588
2624
|
style: { width: "100%" },
|
|
2589
2625
|
clearable: "",
|
|
2590
|
-
onChange:
|
|
2591
|
-
filterable:
|
|
2626
|
+
onChange: w,
|
|
2627
|
+
filterable: i.search.filterable ?? !0
|
|
2592
2628
|
}, {
|
|
2593
2629
|
default: b(() => [
|
|
2594
|
-
(
|
|
2595
|
-
key:
|
|
2596
|
-
label:
|
|
2597
|
-
value:
|
|
2630
|
+
(n(!0), $(O, null, Q(i.search.data, (m) => (n(), h(K, {
|
|
2631
|
+
key: m,
|
|
2632
|
+
label: m,
|
|
2633
|
+
value: m
|
|
2598
2634
|
}, null, 8, ["label", "value"]))), 128))
|
|
2599
2635
|
]),
|
|
2600
2636
|
_: 2
|
|
2601
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) :
|
|
2637
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) : i.search.type === "selectData" ? (n(), h(G, {
|
|
2602
2638
|
key: 4,
|
|
2603
|
-
modelValue: o(
|
|
2604
|
-
"onUpdate:modelValue": (
|
|
2639
|
+
modelValue: o(S)[i.search.prop],
|
|
2640
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2605
2641
|
placeholder: p.$t("請選擇"),
|
|
2606
2642
|
style: { width: "100%" },
|
|
2607
2643
|
clearable: "",
|
|
2608
|
-
onChange:
|
|
2609
|
-
filterable:
|
|
2644
|
+
onChange: w,
|
|
2645
|
+
filterable: i.search.filterable ?? !0
|
|
2610
2646
|
}, {
|
|
2611
2647
|
default: b(() => [
|
|
2612
|
-
(
|
|
2613
|
-
key:
|
|
2614
|
-
label:
|
|
2615
|
-
value:
|
|
2648
|
+
(n(!0), $(O, null, Q(i.search.data, (m) => (n(), h(K, {
|
|
2649
|
+
key: m[i.search.value],
|
|
2650
|
+
label: m[i.search.label],
|
|
2651
|
+
value: m[i.search.value]
|
|
2616
2652
|
}, null, 8, ["label", "value"]))), 128))
|
|
2617
2653
|
]),
|
|
2618
2654
|
_: 2
|
|
2619
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) :
|
|
2655
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) : i.search.type === "selectDict" ? (n(), h(G, {
|
|
2620
2656
|
key: 5,
|
|
2621
|
-
modelValue: o(
|
|
2622
|
-
"onUpdate:modelValue": (
|
|
2657
|
+
modelValue: o(S)[i.search.prop],
|
|
2658
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2623
2659
|
placeholder: p.$t("請選擇"),
|
|
2624
2660
|
style: { width: "100%" },
|
|
2625
2661
|
clearable: "",
|
|
2626
|
-
onChange:
|
|
2627
|
-
filterable:
|
|
2662
|
+
onChange: w,
|
|
2663
|
+
filterable: i.search.filterable ?? !0
|
|
2628
2664
|
}, {
|
|
2629
2665
|
default: b(() => [
|
|
2630
|
-
(
|
|
2631
|
-
key:
|
|
2632
|
-
label:
|
|
2633
|
-
value:
|
|
2666
|
+
(n(!0), $(O, null, Q(i.search.data || [], (m) => (n(), h(K, {
|
|
2667
|
+
key: m[i.search.value] || m.value,
|
|
2668
|
+
label: m[i.search.label] || m.label,
|
|
2669
|
+
value: m[i.search.value] || m.value
|
|
2634
2670
|
}, null, 8, ["label", "value"]))), 128))
|
|
2635
2671
|
]),
|
|
2636
2672
|
_: 2
|
|
2637
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) :
|
|
2673
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) : i.search.type === "selectCommonDict" ? (n(), h(G, {
|
|
2638
2674
|
key: 6,
|
|
2639
|
-
modelValue: o(
|
|
2640
|
-
"onUpdate:modelValue": (
|
|
2641
|
-
data: d.search.data,
|
|
2642
|
-
props: d.search.props,
|
|
2643
|
-
"value-key": d.search.valueKey,
|
|
2644
|
-
"default-expanded-keys": d.search.defaultExpandedKeys,
|
|
2675
|
+
modelValue: o(S)[i.search.prop],
|
|
2676
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2645
2677
|
placeholder: p.$t("請選擇"),
|
|
2646
2678
|
style: { width: "100%" },
|
|
2647
|
-
"check-strictly": "",
|
|
2648
2679
|
clearable: "",
|
|
2649
|
-
onChange:
|
|
2650
|
-
|
|
2680
|
+
onChange: w,
|
|
2681
|
+
filterable: i.search.filterable ?? !0
|
|
2682
|
+
}, {
|
|
2683
|
+
default: b(() => [
|
|
2684
|
+
(n(!0), $(O, null, Q(i.search.data || [], (m) => (n(), h(K, {
|
|
2685
|
+
key: m[i.search.value] || m.value,
|
|
2686
|
+
label: m[i.search.label] || m.label,
|
|
2687
|
+
value: m[i.search.value] || m.value
|
|
2688
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
2689
|
+
]),
|
|
2690
|
+
_: 2
|
|
2691
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable"])) : i.search.type === "treeSelectApi" ? (n(), h(se, {
|
|
2651
2692
|
key: 7,
|
|
2693
|
+
modelValue: o(S)[i.search.prop],
|
|
2694
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2695
|
+
data: i.search.data,
|
|
2696
|
+
props: i.search.props,
|
|
2697
|
+
"value-key": i.search.valueKey,
|
|
2698
|
+
"default-expanded-keys": i.search.defaultExpandedKeys,
|
|
2699
|
+
placeholder: p.$t("請選擇"),
|
|
2700
|
+
style: { width: "100%" },
|
|
2701
|
+
"check-strictly": "",
|
|
2702
|
+
clearable: "",
|
|
2703
|
+
onChange: w
|
|
2704
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "data", "props", "value-key", "default-expanded-keys", "placeholder"])) : i.search.type === "number" ? (n(), h(V, {
|
|
2705
|
+
key: 8,
|
|
2652
2706
|
type: "number",
|
|
2653
|
-
modelValue: o(
|
|
2654
|
-
"onUpdate:modelValue": (
|
|
2707
|
+
modelValue: o(S)[i.search.prop],
|
|
2708
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2655
2709
|
placeholder: p.$t("請輸入"),
|
|
2656
2710
|
style: { width: "100%" },
|
|
2657
2711
|
clearable: ""
|
|
2658
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : (
|
|
2659
|
-
key:
|
|
2712
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : (n(), h(V, {
|
|
2713
|
+
key: 9,
|
|
2660
2714
|
type: "text",
|
|
2661
|
-
modelValue: o(
|
|
2662
|
-
"onUpdate:modelValue": (
|
|
2715
|
+
modelValue: o(S)[i.search.prop],
|
|
2716
|
+
"onUpdate:modelValue": (m) => o(S)[i.search.prop] = m,
|
|
2663
2717
|
style: { width: "100%" },
|
|
2664
2718
|
placeholder: p.$t("請輸入"),
|
|
2665
|
-
onKeyup:
|
|
2719
|
+
onKeyup: ta(w, ["enter"]),
|
|
2666
2720
|
clearable: ""
|
|
2667
2721
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"]))
|
|
2668
2722
|
]),
|
|
@@ -2673,16 +2727,16 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2673
2727
|
}, 1032, ["span"]))), 128)),
|
|
2674
2728
|
F(q, { span: o(H) }, {
|
|
2675
2729
|
default: b(() => {
|
|
2676
|
-
var
|
|
2730
|
+
var i;
|
|
2677
2731
|
return [
|
|
2678
2732
|
F(j, {
|
|
2679
|
-
onClick:
|
|
2733
|
+
onClick: w,
|
|
2680
2734
|
type: "primary",
|
|
2681
2735
|
icon: "Search",
|
|
2682
2736
|
plain: ""
|
|
2683
2737
|
}, {
|
|
2684
2738
|
default: b(() => [
|
|
2685
|
-
|
|
2739
|
+
z(M(p.$t("查詢")), 1)
|
|
2686
2740
|
]),
|
|
2687
2741
|
_: 1
|
|
2688
2742
|
}),
|
|
@@ -2693,40 +2747,40 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2693
2747
|
plain: ""
|
|
2694
2748
|
}, {
|
|
2695
2749
|
default: b(() => [
|
|
2696
|
-
|
|
2750
|
+
z(M(p.$t("清空")), 1)
|
|
2697
2751
|
]),
|
|
2698
2752
|
_: 1
|
|
2699
2753
|
}),
|
|
2700
|
-
o(
|
|
2754
|
+
o(f) ? de((n(), h(j, {
|
|
2701
2755
|
key: 0,
|
|
2702
|
-
type: o(
|
|
2703
|
-
icon: o(
|
|
2756
|
+
type: o(f).cssType,
|
|
2757
|
+
icon: o(f).icon,
|
|
2704
2758
|
plain: "",
|
|
2705
|
-
onClick: T[2] || (T[2] = (
|
|
2759
|
+
onClick: T[2] || (T[2] = (m) => B(o(f)))
|
|
2706
2760
|
}, {
|
|
2707
2761
|
default: b(() => [
|
|
2708
|
-
|
|
2762
|
+
z(M(p.$t(o(f).text || "新增")), 1)
|
|
2709
2763
|
]),
|
|
2710
2764
|
_: 1
|
|
2711
2765
|
}, 8, ["type", "icon"])), [
|
|
2712
|
-
[
|
|
2766
|
+
[ce, o(f).permission || null]
|
|
2713
2767
|
]) : X("", !0),
|
|
2714
|
-
u.dataSource.showBatchDeleteButton ? de((
|
|
2768
|
+
u.dataSource.showBatchDeleteButton ? de((n(), h(j, {
|
|
2715
2769
|
key: 1,
|
|
2716
2770
|
type: "danger",
|
|
2717
2771
|
icon: "Delete",
|
|
2718
2772
|
plain: "",
|
|
2719
2773
|
disabled: p.selectedCount === 0,
|
|
2720
|
-
onClick: T[3] || (T[3] = (
|
|
2774
|
+
onClick: T[3] || (T[3] = (m) => s("actionEvent", { action: "batchDelete" }))
|
|
2721
2775
|
}, {
|
|
2722
2776
|
default: b(() => [
|
|
2723
|
-
|
|
2777
|
+
z(M(p.$t("批量刪除")), 1)
|
|
2724
2778
|
]),
|
|
2725
2779
|
_: 1
|
|
2726
2780
|
}, 8, ["disabled"])), [
|
|
2727
|
-
[
|
|
2781
|
+
[ce, ((i = o(_)) == null ? void 0 : i.permission) || null]
|
|
2728
2782
|
]) : X("", !0),
|
|
2729
|
-
u.dataSource.exportUrl ? (
|
|
2783
|
+
u.dataSource.exportUrl ? (n(), h(j, {
|
|
2730
2784
|
key: 2,
|
|
2731
2785
|
type: "primary",
|
|
2732
2786
|
icon: "Download",
|
|
@@ -2734,23 +2788,23 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2734
2788
|
onClick: E
|
|
2735
2789
|
}, {
|
|
2736
2790
|
default: b(() => [
|
|
2737
|
-
|
|
2791
|
+
z(M(p.$t("導出")), 1)
|
|
2738
2792
|
]),
|
|
2739
2793
|
_: 1
|
|
2740
2794
|
})) : X("", !0),
|
|
2741
|
-
(
|
|
2742
|
-
key:
|
|
2743
|
-
onClick: (
|
|
2744
|
-
type:
|
|
2745
|
-
icon:
|
|
2795
|
+
(n(!0), $(O, null, Q(o(d), (m) => de((n(), h(j, {
|
|
2796
|
+
key: m.text,
|
|
2797
|
+
onClick: (r) => B(m),
|
|
2798
|
+
type: m.cssType,
|
|
2799
|
+
icon: m.icon,
|
|
2746
2800
|
plain: ""
|
|
2747
2801
|
}, {
|
|
2748
2802
|
default: b(() => [
|
|
2749
|
-
|
|
2803
|
+
z(M(p.$t(m.text)), 1)
|
|
2750
2804
|
]),
|
|
2751
2805
|
_: 2
|
|
2752
2806
|
}, 1032, ["onClick", "type", "icon"])), [
|
|
2753
|
-
[
|
|
2807
|
+
[ce, m.permission || null]
|
|
2754
2808
|
])), 128))
|
|
2755
2809
|
];
|
|
2756
2810
|
}),
|
|
@@ -2762,37 +2816,37 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2762
2816
|
]),
|
|
2763
2817
|
_: 1
|
|
2764
2818
|
}, 8, ["model", "label-width"])
|
|
2765
|
-
])) : o(
|
|
2766
|
-
o(
|
|
2819
|
+
])) : o(y).length > 0 ? (n(), $("div", Ht, [
|
|
2820
|
+
o(f) ? de((n(), h(j, {
|
|
2767
2821
|
key: 0,
|
|
2768
|
-
type: o(
|
|
2769
|
-
icon: o(
|
|
2822
|
+
type: o(f).cssType,
|
|
2823
|
+
icon: o(f).icon,
|
|
2770
2824
|
plain: "",
|
|
2771
|
-
onClick: T[4] || (T[4] = (
|
|
2825
|
+
onClick: T[4] || (T[4] = (i) => B(o(f)))
|
|
2772
2826
|
}, {
|
|
2773
2827
|
default: b(() => [
|
|
2774
|
-
|
|
2828
|
+
z(M(o(f).text || p.$t("新增")), 1)
|
|
2775
2829
|
]),
|
|
2776
2830
|
_: 1
|
|
2777
2831
|
}, 8, ["type", "icon"])), [
|
|
2778
|
-
[
|
|
2832
|
+
[ce, o(f).permission || null]
|
|
2779
2833
|
]) : X("", !0),
|
|
2780
|
-
u.dataSource.showBatchDeleteButton ? de((
|
|
2834
|
+
u.dataSource.showBatchDeleteButton ? de((n(), h(j, {
|
|
2781
2835
|
key: 1,
|
|
2782
2836
|
type: "danger",
|
|
2783
2837
|
icon: "Delete",
|
|
2784
2838
|
plain: "",
|
|
2785
2839
|
disabled: p.selectedCount === 0,
|
|
2786
|
-
onClick: T[5] || (T[5] = (
|
|
2840
|
+
onClick: T[5] || (T[5] = (i) => s("actionEvent", { action: "batchDelete" }))
|
|
2787
2841
|
}, {
|
|
2788
2842
|
default: b(() => [
|
|
2789
|
-
|
|
2843
|
+
z(M(p.$t("批量刪除")), 1)
|
|
2790
2844
|
]),
|
|
2791
2845
|
_: 1
|
|
2792
2846
|
}, 8, ["disabled"])), [
|
|
2793
|
-
[
|
|
2847
|
+
[ce, ((ge = o(_)) == null ? void 0 : ge.permission) || null]
|
|
2794
2848
|
]) : X("", !0),
|
|
2795
|
-
u.dataSource.exportUrl ? (
|
|
2849
|
+
u.dataSource.exportUrl ? (n(), h(j, {
|
|
2796
2850
|
key: 2,
|
|
2797
2851
|
type: "primary",
|
|
2798
2852
|
icon: "Download",
|
|
@@ -2800,28 +2854,28 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2800
2854
|
onClick: E
|
|
2801
2855
|
}, {
|
|
2802
2856
|
default: b(() => [
|
|
2803
|
-
|
|
2857
|
+
z(M(u.dataSource.exportButtonName || p.$t("導出")), 1)
|
|
2804
2858
|
]),
|
|
2805
2859
|
_: 1
|
|
2806
2860
|
})) : X("", !0),
|
|
2807
|
-
(
|
|
2808
|
-
key:
|
|
2809
|
-
onClick: (
|
|
2810
|
-
type:
|
|
2811
|
-
icon:
|
|
2861
|
+
(n(!0), $(O, null, Q(o(d), (i) => de((n(), h(j, {
|
|
2862
|
+
key: i.text,
|
|
2863
|
+
onClick: (m) => B(i),
|
|
2864
|
+
type: i.cssType,
|
|
2865
|
+
icon: i.icon,
|
|
2812
2866
|
plain: ""
|
|
2813
2867
|
}, {
|
|
2814
2868
|
default: b(() => [
|
|
2815
|
-
|
|
2869
|
+
z(M(p.$t(i.text)), 1)
|
|
2816
2870
|
]),
|
|
2817
2871
|
_: 2
|
|
2818
2872
|
}, 1032, ["onClick", "type", "icon"])), [
|
|
2819
|
-
[
|
|
2873
|
+
[ce, i.permission || null]
|
|
2820
2874
|
])), 128))
|
|
2821
2875
|
])) : X("", !0);
|
|
2822
2876
|
};
|
|
2823
2877
|
}
|
|
2824
|
-
}),
|
|
2878
|
+
}), Kt = /* @__PURE__ */ ye(Nt, [["__scopeId", "data-v-563bc9d5"]]), Ka = {
|
|
2825
2879
|
// ============ 搜索欄 ============
|
|
2826
2880
|
查詢: "查询",
|
|
2827
2881
|
清空: "清空",
|
|
@@ -2929,30 +2983,30 @@ const Ml = { key: 20 }, Rl = { class: "color-picker-tips" }, jl = /* @__PURE__ *
|
|
|
2929
2983
|
導出失敗: "Export failed"
|
|
2930
2984
|
};
|
|
2931
2985
|
let pa = !1;
|
|
2932
|
-
const
|
|
2986
|
+
const Wt = {
|
|
2933
2987
|
zh_CN: Ka,
|
|
2934
2988
|
zh_HK: Wa,
|
|
2935
2989
|
en_US: qa
|
|
2936
2990
|
};
|
|
2937
|
-
function
|
|
2991
|
+
function qt() {
|
|
2938
2992
|
if (!pa)
|
|
2939
2993
|
try {
|
|
2940
2994
|
const e = he();
|
|
2941
2995
|
if (!e) return;
|
|
2942
|
-
const
|
|
2943
|
-
if (
|
|
2944
|
-
const a =
|
|
2945
|
-
for (const [c,
|
|
2946
|
-
if (a && typeof a.mergeLocaleMessage == "function" && a.mergeLocaleMessage(c,
|
|
2996
|
+
const l = e.appContext.app.config.globalProperties.$i18n;
|
|
2997
|
+
if (l) {
|
|
2998
|
+
const a = l.global || l;
|
|
2999
|
+
for (const [c, s] of Object.entries(Wt))
|
|
3000
|
+
if (a && typeof a.mergeLocaleMessage == "function" && a.mergeLocaleMessage(c, s), a && a.messages) {
|
|
2947
3001
|
const u = a.messages[c] || {};
|
|
2948
|
-
a.messages[c] = { ...
|
|
3002
|
+
a.messages[c] = { ...s, ...u };
|
|
2949
3003
|
}
|
|
2950
3004
|
pa = !0;
|
|
2951
3005
|
}
|
|
2952
3006
|
} catch {
|
|
2953
3007
|
}
|
|
2954
3008
|
}
|
|
2955
|
-
const
|
|
3009
|
+
const Qt = { key: 1 }, Gt = /* @__PURE__ */ pe({
|
|
2956
3010
|
__name: "index",
|
|
2957
3011
|
props: {
|
|
2958
3012
|
dataSource: {},
|
|
@@ -2962,208 +3016,208 @@ const Ql = { key: 1 }, Gl = /* @__PURE__ */ pe({
|
|
|
2962
3016
|
maxHeight: {}
|
|
2963
3017
|
},
|
|
2964
3018
|
emits: ["actionEvent", "beforeQuery"],
|
|
2965
|
-
setup(e, { expose:
|
|
2966
|
-
const { proxy: a } = he(), c =
|
|
2967
|
-
() =>
|
|
2968
|
-
),
|
|
2969
|
-
const
|
|
2970
|
-
return Array.from(new Set(
|
|
2971
|
-
}), P = (
|
|
2972
|
-
|
|
2973
|
-
}, H = (
|
|
2974
|
-
|
|
3019
|
+
setup(e, { expose: t, emit: l }) {
|
|
3020
|
+
const { proxy: a } = he(), c = l, s = e, u = J(
|
|
3021
|
+
() => s.dataSource.maxHeight != null ? void 0 : s.maxHeight
|
|
3022
|
+
), y = L(!1), f = L({}), _ = L({}), d = L(), B = L(), D = L(0), R = J(() => {
|
|
3023
|
+
const V = (s.dataSource.columns || []).map((Y) => Y.slot).filter((Y) => !!Y);
|
|
3024
|
+
return Array.from(new Set(V));
|
|
3025
|
+
}), P = (V) => {
|
|
3026
|
+
D.value = Array.isArray(V) ? V.length : 0;
|
|
3027
|
+
}, H = (V = !1) => {
|
|
3028
|
+
y.value = !1, f.value = {}, V === !0 && Z();
|
|
2975
3029
|
}, Z = () => {
|
|
2976
|
-
var
|
|
2977
|
-
return (
|
|
3030
|
+
var V;
|
|
3031
|
+
return (V = d.value) == null ? void 0 : V.refreshTable();
|
|
2978
3032
|
}, ee = async () => {
|
|
2979
|
-
var
|
|
2980
|
-
return await ((
|
|
2981
|
-
},
|
|
2982
|
-
var
|
|
2983
|
-
return (
|
|
2984
|
-
}, U = async (
|
|
2985
|
-
let q =
|
|
2986
|
-
|
|
2987
|
-
},
|
|
2988
|
-
if (typeof
|
|
2989
|
-
|
|
3033
|
+
var V;
|
|
3034
|
+
return await ((V = d.value) == null ? void 0 : V.initData());
|
|
3035
|
+
}, S = () => {
|
|
3036
|
+
var V;
|
|
3037
|
+
return (V = B.value) == null ? void 0 : V.initData();
|
|
3038
|
+
}, U = async (V, Y) => {
|
|
3039
|
+
let q = Y;
|
|
3040
|
+
s.dataSource.beforeAction && (q = await s.dataSource.beforeAction(V, Y)), w(V, q);
|
|
3041
|
+
}, w = (V, Y) => {
|
|
3042
|
+
if (typeof V.action == "function") {
|
|
3043
|
+
V.action(Y);
|
|
2990
3044
|
return;
|
|
2991
3045
|
}
|
|
2992
3046
|
const j = {
|
|
2993
|
-
update: () => E(
|
|
2994
|
-
delete: () => x(
|
|
3047
|
+
update: () => E(V, Y),
|
|
3048
|
+
delete: () => x(V, Y),
|
|
2995
3049
|
batchDelete: () => W(),
|
|
2996
|
-
create: () =>
|
|
2997
|
-
view: () => T(
|
|
3050
|
+
create: () => C(V, Y),
|
|
3051
|
+
view: () => T(V, Y),
|
|
2998
3052
|
filter: () => A(),
|
|
2999
|
-
back: () =>
|
|
3000
|
-
}[
|
|
3001
|
-
j ? j() : c("actionEvent",
|
|
3002
|
-
}, E = async (
|
|
3003
|
-
|
|
3004
|
-
}, x = async (
|
|
3053
|
+
back: () => se()
|
|
3054
|
+
}[V.action];
|
|
3055
|
+
j ? j() : c("actionEvent", V, Y);
|
|
3056
|
+
}, E = async (V, Y) => {
|
|
3057
|
+
s.dataSource.beforeUpdate && await s.dataSource.beforeUpdate(Y) === !1 || (f.value = Y, _.value = V, y.value = !0);
|
|
3058
|
+
}, x = async (V, Y) => {
|
|
3005
3059
|
var q, j, ne;
|
|
3006
3060
|
try {
|
|
3007
|
-
if (
|
|
3061
|
+
if (s.dataSource.beforeDelete && await s.dataSource.beforeDelete(Y) === !1)
|
|
3008
3062
|
return;
|
|
3009
|
-
const ue =
|
|
3063
|
+
const ue = Y[s.dataSource.rowKey];
|
|
3010
3064
|
if (!ue) {
|
|
3011
3065
|
a == null || a.$modal.msgError(a == null ? void 0 : a.$t("rowKey参数不正确"));
|
|
3012
3066
|
return;
|
|
3013
3067
|
}
|
|
3014
|
-
const me =
|
|
3015
|
-
await (a == null ? void 0 : a.$modal.confirm(me)), await ((j = (q =
|
|
3068
|
+
const me = V.confirm || V.confirmText || (a == null ? void 0 : a.$t("確認刪除此數據嗎?"));
|
|
3069
|
+
await (a == null ? void 0 : a.$modal.confirm(me)), await ((j = (q = s.dataSource).deleteApi) == null ? void 0 : j.call(q, ue)), a == null || a.$modal.msgSuccess(a == null ? void 0 : a.$t("刪除成功")), (ne = d.value) == null || ne.refreshTable();
|
|
3016
3070
|
} catch (ue) {
|
|
3017
3071
|
ue !== "cancel" && console.error("Delete failed:", ue);
|
|
3018
3072
|
}
|
|
3019
3073
|
}, W = async () => {
|
|
3020
3074
|
var q, j, ne, ue, me;
|
|
3021
|
-
if (!
|
|
3075
|
+
if (!s.dataSource.deleteApi) {
|
|
3022
3076
|
a == null || a.$modal.msgError(a == null ? void 0 : a.$t("deleteApi 方法未設置"));
|
|
3023
3077
|
return;
|
|
3024
3078
|
}
|
|
3025
|
-
const
|
|
3026
|
-
if (!
|
|
3079
|
+
const V = ((j = (q = d.value) == null ? void 0 : q.getSelection) == null ? void 0 : j.call(q)) ?? [];
|
|
3080
|
+
if (!V.length) {
|
|
3027
3081
|
a == null || a.$modal.msgWarning(a == null ? void 0 : a.$t("請先勾選要刪除的數據"));
|
|
3028
3082
|
return;
|
|
3029
3083
|
}
|
|
3030
|
-
await (a == null ? void 0 : a.$modal.confirm(a == null ? void 0 : a.$t("確認刪除選中的 {count} 條數據嗎?", { count:
|
|
3031
|
-
const
|
|
3032
|
-
for (const
|
|
3033
|
-
if (
|
|
3084
|
+
await (a == null ? void 0 : a.$modal.confirm(a == null ? void 0 : a.$t("確認刪除選中的 {count} 條數據嗎?", { count: V.length })));
|
|
3085
|
+
const Y = [];
|
|
3086
|
+
for (const ce of V) {
|
|
3087
|
+
if (s.dataSource.beforeDelete && await s.dataSource.beforeDelete(ce) === !1)
|
|
3034
3088
|
continue;
|
|
3035
|
-
const ge =
|
|
3036
|
-
ge != null &&
|
|
3089
|
+
const ge = ce[s.dataSource.rowKey];
|
|
3090
|
+
ge != null && Y.push(ge);
|
|
3037
3091
|
}
|
|
3038
|
-
|
|
3039
|
-
},
|
|
3040
|
-
|
|
3041
|
-
}, p = async (
|
|
3042
|
-
const
|
|
3092
|
+
Y.length && (await ((ue = (ne = s.dataSource).deleteApi) == null ? void 0 : ue.call(ne, Y)), a == null || a.$modal.msgSuccess(a == null ? void 0 : a.$t("刪除成功")), (me = d.value) == null || me.refreshTable());
|
|
3093
|
+
}, C = async (V, Y) => {
|
|
3094
|
+
s.dataSource.beforeCreate && await s.dataSource.beforeCreate(Y || {}) === !1 || (f.value = Y || {}, _.value = V, y.value = !0);
|
|
3095
|
+
}, p = async (V = {}) => {
|
|
3096
|
+
const Y = V && (Object.prototype.hasOwnProperty.call(V, "data") || Object.prototype.hasOwnProperty.call(V, "title") || Object.prototype.hasOwnProperty.call(V, "text") || Object.prototype.hasOwnProperty.call(V, "width") || Object.prototype.hasOwnProperty.call(V, "labelWidth") || Object.prototype.hasOwnProperty.call(V, "labelPosition")), q = Y ? V.data || {} : V || {}, j = {
|
|
3043
3097
|
action: "create",
|
|
3044
|
-
...
|
|
3045
|
-
title:
|
|
3046
|
-
text:
|
|
3047
|
-
width:
|
|
3048
|
-
labelWidth:
|
|
3049
|
-
labelPosition:
|
|
3098
|
+
...Y ? {
|
|
3099
|
+
title: V.title,
|
|
3100
|
+
text: V.text,
|
|
3101
|
+
width: V.width,
|
|
3102
|
+
labelWidth: V.labelWidth,
|
|
3103
|
+
labelPosition: V.labelPosition
|
|
3050
3104
|
} : {}
|
|
3051
3105
|
};
|
|
3052
|
-
await
|
|
3053
|
-
}, T = (
|
|
3054
|
-
let q = (
|
|
3055
|
-
const j =
|
|
3056
|
-
if (j &&
|
|
3106
|
+
await C(j, q);
|
|
3107
|
+
}, T = (V, Y) => {
|
|
3108
|
+
let q = (V.url || "").replace(/\{([^}]+)\}/g, (ne, ue) => Y[ue] ?? "");
|
|
3109
|
+
const j = V.pm;
|
|
3110
|
+
if (j && Y[j]) {
|
|
3057
3111
|
const ne = q.includes("?") ? "&" : "?";
|
|
3058
|
-
q += `${ne}${j}=${
|
|
3112
|
+
q += `${ne}${j}=${Y[j]}`;
|
|
3059
3113
|
}
|
|
3060
3114
|
a == null || a.$router.push(q);
|
|
3061
3115
|
}, A = () => {
|
|
3062
|
-
var
|
|
3063
|
-
const
|
|
3064
|
-
(q =
|
|
3116
|
+
var Y, q;
|
|
3117
|
+
const V = (Y = B.value) == null ? void 0 : Y.getQueryParams();
|
|
3118
|
+
(q = d.value) == null || q.refreshTable(V || {});
|
|
3065
3119
|
}, K = () => {
|
|
3066
|
-
var
|
|
3067
|
-
return (
|
|
3068
|
-
},
|
|
3069
|
-
var
|
|
3070
|
-
return (
|
|
3071
|
-
},
|
|
3120
|
+
var V;
|
|
3121
|
+
return (V = B.value) == null ? void 0 : V.getQueryParams();
|
|
3122
|
+
}, G = () => {
|
|
3123
|
+
var V;
|
|
3124
|
+
return (V = d.value) == null ? void 0 : V.getSelection();
|
|
3125
|
+
}, se = () => a == null ? void 0 : a.$router.back();
|
|
3072
3126
|
return Qe(() => {
|
|
3073
|
-
|
|
3074
|
-
}),
|
|
3127
|
+
qt(), Jl(s.dataSource.columns);
|
|
3128
|
+
}), t({ refreshTable: Z, initSearch: S, initTable: ee, openCreate: p, getQueryParams: K, getSelection: G }), (V, Y) => {
|
|
3075
3129
|
const q = Da;
|
|
3076
|
-
return
|
|
3077
|
-
class: qe({ "p-3":
|
|
3130
|
+
return n(), $("div", {
|
|
3131
|
+
class: qe({ "p-3": V.showPadding })
|
|
3078
3132
|
}, [
|
|
3079
|
-
F(
|
|
3080
|
-
dataSource:
|
|
3081
|
-
selectedCount: o(
|
|
3133
|
+
F(Kt, {
|
|
3134
|
+
dataSource: s.dataSource,
|
|
3135
|
+
selectedCount: o(D),
|
|
3082
3136
|
ref_key: "curdSearchRef",
|
|
3083
|
-
ref:
|
|
3137
|
+
ref: B,
|
|
3084
3138
|
onActionEvent: U
|
|
3085
3139
|
}, null, 8, ["dataSource", "selectedCount"]),
|
|
3086
|
-
|
|
3140
|
+
V.showCard ? (n(), h(q, {
|
|
3087
3141
|
key: 0,
|
|
3088
|
-
"body-style": { paddingBottom:
|
|
3142
|
+
"body-style": { paddingBottom: s.dataSource.paging === !1 ? "20px" : "0px" },
|
|
3089
3143
|
shadow: "hover"
|
|
3090
3144
|
}, {
|
|
3091
3145
|
default: b(() => [
|
|
3092
3146
|
F(ua, {
|
|
3093
3147
|
ref_key: "curdTableRef",
|
|
3094
|
-
ref:
|
|
3148
|
+
ref: d,
|
|
3095
3149
|
onActionEvent: U,
|
|
3096
3150
|
onSelectionChange: P,
|
|
3097
|
-
dataSource:
|
|
3151
|
+
dataSource: s.dataSource,
|
|
3098
3152
|
maxHeight: o(u)
|
|
3099
3153
|
}, Ye({ _: 2 }, [
|
|
3100
|
-
Q(o(
|
|
3154
|
+
Q(o(R), (j) => ({
|
|
3101
3155
|
name: j,
|
|
3102
3156
|
fn: b((ne) => [
|
|
3103
|
-
ze(
|
|
3157
|
+
ze(V.$slots, j, oa(ra(ne)), void 0, !0)
|
|
3104
3158
|
])
|
|
3105
3159
|
}))
|
|
3106
3160
|
]), 1032, ["dataSource", "maxHeight"]),
|
|
3107
3161
|
F(da, {
|
|
3108
3162
|
onClose: H,
|
|
3109
|
-
modelValue: o(
|
|
3110
|
-
"onUpdate:modelValue":
|
|
3111
|
-
dataSource:
|
|
3112
|
-
action: o(
|
|
3113
|
-
editData: o(
|
|
3163
|
+
modelValue: o(y),
|
|
3164
|
+
"onUpdate:modelValue": Y[0] || (Y[0] = (j) => Se(y) ? y.value = j : null),
|
|
3165
|
+
dataSource: s.dataSource,
|
|
3166
|
+
action: o(_),
|
|
3167
|
+
editData: o(f)
|
|
3114
3168
|
}, null, 8, ["modelValue", "dataSource", "action", "editData"])
|
|
3115
3169
|
]),
|
|
3116
3170
|
_: 3
|
|
3117
|
-
}, 8, ["body-style"])) : (
|
|
3171
|
+
}, 8, ["body-style"])) : (n(), $("div", Qt, [
|
|
3118
3172
|
F(ua, {
|
|
3119
3173
|
ref_key: "curdTableRef",
|
|
3120
|
-
ref:
|
|
3174
|
+
ref: d,
|
|
3121
3175
|
onActionEvent: U,
|
|
3122
3176
|
onSelectionChange: P,
|
|
3123
|
-
dataSource:
|
|
3177
|
+
dataSource: s.dataSource,
|
|
3124
3178
|
maxHeight: o(u)
|
|
3125
3179
|
}, Ye({ _: 2 }, [
|
|
3126
|
-
Q(o(
|
|
3180
|
+
Q(o(R), (j) => ({
|
|
3127
3181
|
name: j,
|
|
3128
3182
|
fn: b((ne) => [
|
|
3129
|
-
ze(
|
|
3183
|
+
ze(V.$slots, j, oa(ra(ne)), void 0, !0)
|
|
3130
3184
|
])
|
|
3131
3185
|
}))
|
|
3132
3186
|
]), 1032, ["dataSource", "maxHeight"]),
|
|
3133
3187
|
F(da, {
|
|
3134
3188
|
onClose: H,
|
|
3135
|
-
modelValue: o(
|
|
3136
|
-
"onUpdate:modelValue":
|
|
3137
|
-
dataSource:
|
|
3138
|
-
action: o(
|
|
3139
|
-
editData: o(
|
|
3189
|
+
modelValue: o(y),
|
|
3190
|
+
"onUpdate:modelValue": Y[1] || (Y[1] = (j) => Se(y) ? y.value = j : null),
|
|
3191
|
+
dataSource: s.dataSource,
|
|
3192
|
+
action: o(_),
|
|
3193
|
+
editData: o(f)
|
|
3140
3194
|
}, null, 8, ["modelValue", "dataSource", "action", "editData"])
|
|
3141
3195
|
]))
|
|
3142
3196
|
], 2);
|
|
3143
3197
|
};
|
|
3144
3198
|
}
|
|
3145
|
-
}),
|
|
3199
|
+
}), Jt = /* @__PURE__ */ ye(Gt, [["__scopeId", "data-v-d46e0987"]]), fa = {
|
|
3146
3200
|
401: "认证失败,无法访问系统资源",
|
|
3147
3201
|
403: "当前操作没有权限",
|
|
3148
3202
|
404: "访问资源不存在",
|
|
3149
3203
|
default: "系统未知错误,请反馈给管理员"
|
|
3150
3204
|
};
|
|
3151
|
-
function
|
|
3205
|
+
function Xt(e, t, l) {
|
|
3152
3206
|
const a = Ca.service({
|
|
3153
3207
|
text: "正在下載數據,請稍後",
|
|
3154
3208
|
background: "rgba(0, 0, 0, 0.7)"
|
|
3155
3209
|
});
|
|
3156
|
-
return _e().post(e,
|
|
3157
|
-
transformRequest: [(c) =>
|
|
3210
|
+
return _e().post(e, t, {
|
|
3211
|
+
transformRequest: [(c) => zt(c)],
|
|
3158
3212
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
3159
3213
|
responseType: "blob"
|
|
3160
3214
|
}).then(async (c) => {
|
|
3161
|
-
if (
|
|
3215
|
+
if (Bt(c)) {
|
|
3162
3216
|
const u = new Blob([c]);
|
|
3163
|
-
|
|
3217
|
+
Al.saveAs(u, l);
|
|
3164
3218
|
} else {
|
|
3165
|
-
const u = await new Blob([c]).text(),
|
|
3166
|
-
Ve.error(
|
|
3219
|
+
const u = await new Blob([c]).text(), y = JSON.parse(u), f = fa[y.code] || y.msg || fa.default;
|
|
3220
|
+
Ve.error(f);
|
|
3167
3221
|
}
|
|
3168
3222
|
a.close();
|
|
3169
3223
|
}).catch((c) => {
|
|
@@ -3171,7 +3225,7 @@ function Xl(e, l, t) {
|
|
|
3171
3225
|
});
|
|
3172
3226
|
}
|
|
3173
3227
|
let ha;
|
|
3174
|
-
const
|
|
3228
|
+
const Zt = {
|
|
3175
3229
|
// 消息提示
|
|
3176
3230
|
msg(e) {
|
|
3177
3231
|
Ve.info(e);
|
|
@@ -3229,12 +3283,12 @@ const Zl = {
|
|
|
3229
3283
|
});
|
|
3230
3284
|
},
|
|
3231
3285
|
// 提交内容
|
|
3232
|
-
prompt(e,
|
|
3233
|
-
return we.prompt(e,
|
|
3286
|
+
prompt(e, t, l = "") {
|
|
3287
|
+
return we.prompt(e, t || "系統提示", {
|
|
3234
3288
|
confirmButtonText: "確認",
|
|
3235
3289
|
cancelButtonText: "取消",
|
|
3236
3290
|
type: "warning",
|
|
3237
|
-
inputType:
|
|
3291
|
+
inputType: l,
|
|
3238
3292
|
inputPlaceholder: e
|
|
3239
3293
|
});
|
|
3240
3294
|
},
|
|
@@ -3264,24 +3318,24 @@ function Ga(e) {
|
|
|
3264
3318
|
});
|
|
3265
3319
|
}
|
|
3266
3320
|
const ve = Ea("dict", () => {
|
|
3267
|
-
const e =
|
|
3321
|
+
const e = L(/* @__PURE__ */ new Map());
|
|
3268
3322
|
return {
|
|
3269
3323
|
dict: e,
|
|
3270
|
-
getDict: (
|
|
3271
|
-
setDict: (
|
|
3272
|
-
if (!
|
|
3324
|
+
getDict: (s) => s && e.value.get(s) || null,
|
|
3325
|
+
setDict: (s, u) => {
|
|
3326
|
+
if (!s)
|
|
3273
3327
|
return !1;
|
|
3274
3328
|
try {
|
|
3275
|
-
return e.value.set(
|
|
3276
|
-
} catch (
|
|
3277
|
-
return console.error("Error in setDict:",
|
|
3329
|
+
return e.value.set(s, u), !0;
|
|
3330
|
+
} catch (y) {
|
|
3331
|
+
return console.error("Error in setDict:", y), !1;
|
|
3278
3332
|
}
|
|
3279
3333
|
},
|
|
3280
|
-
removeDict: (
|
|
3281
|
-
if (!
|
|
3334
|
+
removeDict: (s) => {
|
|
3335
|
+
if (!s)
|
|
3282
3336
|
return !1;
|
|
3283
3337
|
try {
|
|
3284
|
-
return e.value.delete(
|
|
3338
|
+
return e.value.delete(s);
|
|
3285
3339
|
} catch (u) {
|
|
3286
3340
|
return console.error("Error in removeDict:", u), !1;
|
|
3287
3341
|
}
|
|
@@ -3291,49 +3345,49 @@ const ve = Ea("dict", () => {
|
|
|
3291
3345
|
}
|
|
3292
3346
|
};
|
|
3293
3347
|
}), eo = (...e) => {
|
|
3294
|
-
const
|
|
3295
|
-
return e.forEach(async (
|
|
3296
|
-
|
|
3297
|
-
const a = ve().getDict(
|
|
3298
|
-
a ?
|
|
3299
|
-
|
|
3300
|
-
(
|
|
3301
|
-
), ve().setDict(
|
|
3348
|
+
const t = L({});
|
|
3349
|
+
return e.forEach(async (l) => {
|
|
3350
|
+
t.value[l] = [];
|
|
3351
|
+
const a = ve().getDict(l);
|
|
3352
|
+
a ? t.value[l] = a : await Qa(l).then((c) => {
|
|
3353
|
+
t.value[l] = c.data.map(
|
|
3354
|
+
(s) => ({ label: s.dictLabel, value: s.dictValue, elTagType: s.listClass, elTagClass: s.cssClass })
|
|
3355
|
+
), ve().setDict(l, t.value[l]);
|
|
3302
3356
|
});
|
|
3303
|
-
}),
|
|
3357
|
+
}), t.value;
|
|
3304
3358
|
}, ao = async (e) => {
|
|
3305
|
-
const
|
|
3306
|
-
if (
|
|
3359
|
+
const t = ve().getDict(e);
|
|
3360
|
+
if (t && t.length > 0) return t;
|
|
3307
3361
|
{
|
|
3308
3362
|
const a = (await Qa(e)).data.map(
|
|
3309
3363
|
(c) => ({ label: c.dictLabel, value: c.dictValue, elTagType: c.listClass, elTagClass: c.cssClass, remark: c.remark })
|
|
3310
3364
|
);
|
|
3311
3365
|
return ve().setDict(e, a), a;
|
|
3312
3366
|
}
|
|
3313
|
-
},
|
|
3314
|
-
const
|
|
3315
|
-
return e.forEach(async (
|
|
3316
|
-
|
|
3317
|
-
const a = ve().getDict(
|
|
3318
|
-
a && a.length > 0 ?
|
|
3319
|
-
|
|
3320
|
-
(
|
|
3321
|
-
), ve().setDict(
|
|
3367
|
+
}, lo = (...e) => {
|
|
3368
|
+
const t = L({});
|
|
3369
|
+
return e.forEach(async (l) => {
|
|
3370
|
+
t.value[l] = [];
|
|
3371
|
+
const a = ve().getDict(l);
|
|
3372
|
+
a && a.length > 0 ? t.value[l] = a : await Ga(l).then((c) => {
|
|
3373
|
+
t.value[l] = c.data.map(
|
|
3374
|
+
(s) => ({ label: s.dictLabel, value: s.dictValue, elTagType: s.listClass, elTagClass: s.cssClass, remark: s.remark })
|
|
3375
|
+
), ve().setDict(l, t.value[l]);
|
|
3322
3376
|
});
|
|
3323
|
-
}),
|
|
3324
|
-
},
|
|
3325
|
-
const
|
|
3326
|
-
if (
|
|
3377
|
+
}), t.value;
|
|
3378
|
+
}, to = async (e) => {
|
|
3379
|
+
const t = ve().getDict(e);
|
|
3380
|
+
if (t && t.length > 0) return t;
|
|
3327
3381
|
{
|
|
3328
3382
|
const a = (await Ga(e)).data.map((c) => ({ label: c.dictLabel, value: c.dictValue, elTagType: c.listClass, elTagClass: c.cssClass }));
|
|
3329
3383
|
return ve().setDict(e, a), a;
|
|
3330
3384
|
}
|
|
3331
3385
|
}, oo = {
|
|
3332
|
-
beforeMount(e, { value:
|
|
3333
|
-
if (
|
|
3334
|
-
e.$copyCallback =
|
|
3386
|
+
beforeMount(e, { value: t, arg: l }) {
|
|
3387
|
+
if (l === "callback")
|
|
3388
|
+
e.$copyCallback = t;
|
|
3335
3389
|
else {
|
|
3336
|
-
e.$copyValue =
|
|
3390
|
+
e.$copyValue = t;
|
|
3337
3391
|
const a = () => {
|
|
3338
3392
|
ro(e.$copyValue), e.$copyCallback && e.$copyCallback(e.$copyValue);
|
|
3339
3393
|
};
|
|
@@ -3341,26 +3395,26 @@ const ve = Ea("dict", () => {
|
|
|
3341
3395
|
}
|
|
3342
3396
|
}
|
|
3343
3397
|
};
|
|
3344
|
-
function ro(e, { target:
|
|
3345
|
-
const
|
|
3346
|
-
|
|
3398
|
+
function ro(e, { target: t = document.body } = {}) {
|
|
3399
|
+
const l = document.createElement("textarea"), a = document.activeElement;
|
|
3400
|
+
l.value = e, l.setAttribute("readonly", ""), l.style.contain = "strict", l.style.position = "absolute", l.style.left = "-9999px", l.style.fontSize = "12pt";
|
|
3347
3401
|
const c = document.getSelection();
|
|
3348
|
-
let
|
|
3349
|
-
c && (
|
|
3402
|
+
let s;
|
|
3403
|
+
c && (s = (c == null ? void 0 : c.rangeCount) > 0 && c.getRangeAt(0)), t.append(l), l.select(), l.selectionStart = 0, l.selectionEnd = e.length;
|
|
3350
3404
|
let u = !1;
|
|
3351
3405
|
try {
|
|
3352
3406
|
u = document.execCommand("copy");
|
|
3353
|
-
} catch (
|
|
3354
|
-
console.error(
|
|
3407
|
+
} catch (y) {
|
|
3408
|
+
console.error(y);
|
|
3355
3409
|
}
|
|
3356
|
-
return
|
|
3410
|
+
return l.remove(), s && (c == null || c.removeAllRanges(), c == null || c.addRange(s)), a && a.focus(), u;
|
|
3357
3411
|
}
|
|
3358
3412
|
const no = {
|
|
3359
3413
|
zh_CN: Ka,
|
|
3360
3414
|
zh_HK: Wa,
|
|
3361
3415
|
en_US: qa
|
|
3362
3416
|
}, so = {
|
|
3363
|
-
Curd:
|
|
3417
|
+
Curd: Jt,
|
|
3364
3418
|
DictTag: Pa,
|
|
3365
3419
|
DictText: Aa,
|
|
3366
3420
|
SvgIcon: Ge,
|
|
@@ -3370,27 +3424,27 @@ const no = {
|
|
|
3370
3424
|
TranslateInput: Fa,
|
|
3371
3425
|
ImageUpload: ja,
|
|
3372
3426
|
FileUpload: Ra
|
|
3373
|
-
}, co = (e,
|
|
3374
|
-
|
|
3427
|
+
}, co = (e, t = {}) => {
|
|
3428
|
+
t.baseUrl != null && Bl(t.baseUrl), t.request && Ll(t.request), t.globalHeaders && zl(t.globalHeaders), (t.hasPermi || t.hasRoles) && rt(t);
|
|
3375
3429
|
try {
|
|
3376
3430
|
const a = e.config.globalProperties.$i18n;
|
|
3377
3431
|
if (a) {
|
|
3378
3432
|
const c = a.global || a;
|
|
3379
|
-
for (const [
|
|
3380
|
-
if (c && typeof c.mergeLocaleMessage == "function" && c.mergeLocaleMessage(
|
|
3381
|
-
const
|
|
3382
|
-
c.messages[
|
|
3433
|
+
for (const [s, u] of Object.entries(no))
|
|
3434
|
+
if (c && typeof c.mergeLocaleMessage == "function" && c.mergeLocaleMessage(s, u), c && c.messages) {
|
|
3435
|
+
const y = c.messages[s] || {};
|
|
3436
|
+
c.messages[s] = { ...u, ...y };
|
|
3383
3437
|
}
|
|
3384
3438
|
}
|
|
3385
3439
|
} catch {
|
|
3386
3440
|
}
|
|
3387
3441
|
for (const [a, c] of Object.entries(so))
|
|
3388
3442
|
e.component(a, c);
|
|
3389
|
-
const
|
|
3390
|
-
|
|
3443
|
+
const l = e.config.globalProperties;
|
|
3444
|
+
l.$modal = Zt, l.download = Xt, l.useDict = eo, l.useOneDict = ao, l.useOneCommonDict = to, l.useCommonDict = lo, l.parseTime = Pt, l.addDateRange = xt, l.handleTree = Lt, l.selectDictLabel = It, l.selectDictLabels = Ot, e.directive("hasPermi", nt), e.directive("hasRoles", st), e.directive("copyText", oo);
|
|
3391
3445
|
}, wo = { install: co };
|
|
3392
3446
|
export {
|
|
3393
|
-
|
|
3447
|
+
Jt as Curd,
|
|
3394
3448
|
Pa as DictTag,
|
|
3395
3449
|
Aa as DictText,
|
|
3396
3450
|
Ha as Editor,
|
|
@@ -3401,16 +3455,16 @@ export {
|
|
|
3401
3455
|
Ge as SvgIcon,
|
|
3402
3456
|
Fa as TranslateInput,
|
|
3403
3457
|
wo as default,
|
|
3404
|
-
|
|
3458
|
+
Xt as download,
|
|
3405
3459
|
Ze as getBaseUrl,
|
|
3406
3460
|
Xe as getGlobalHeaders,
|
|
3407
3461
|
_e as getRequest,
|
|
3408
3462
|
Fe as hasPermission,
|
|
3409
3463
|
co as install,
|
|
3410
3464
|
no as messages,
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3465
|
+
Bl as setBaseUrl,
|
|
3466
|
+
zl as setGlobalHeaders,
|
|
3467
|
+
rt as setPermissionChecker,
|
|
3468
|
+
Ll as setRequest
|
|
3415
3469
|
};
|
|
3416
3470
|
//# sourceMappingURL=vue3-curd.es.js.map
|