vue3-curd 1.0.20 → 1.0.21
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 -0
- package/dist/style.css +1 -1
- package/dist/vue3-curd.es.js +522 -520
- 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
|
|
2
|
-
import { defineComponent as pe, computed as J, createElementBlock as T, openBlock as s, normalizeClass as
|
|
3
|
-
import { createTypes as
|
|
1
|
+
import { ElTag as ua, ElImage as Ye, ElIcon as Me, ElTable as Za, ElTableColumn as et, ElCheckbox as ia, ElSwitch as da, ElTooltip as at, ElButton as De, ElLoadingDirective as tt, ElPagination as lt, ElUpload as Re, ElLink as ot, ElDialog as pa, ElInput as je, ElForm as fa, ElRow as ha, ElCol as ma, ElFormItem as ya, ElInputNumber as rt, ElSelect as ga, ElOption as ba, ElDatePicker as va, ElCheckboxGroup as nt, ElRadioGroup as st, ElRadio as ct, ElTreeSelect as ka, ElColorPicker as ut, ElCard as _a, ElLoading as wa, ElMessage as we, ElMessageBox as _e, ElNotification as Ee } from "element-plus/es";
|
|
2
|
+
import { defineComponent as pe, computed as J, createElementBlock as T, openBlock as s, normalizeClass as He, unref as r, createElementVNode as re, toDisplayString as M, Fragment as z, renderList as Q, createBlock as h, createCommentVNode as Z, withCtx as b, createTextVNode as L, ref as I, watch as Ve, normalizeStyle as fe, createVNode as K, getCurrentInstance as he, toRaw as Oe, onMounted as Fe, resolveDirective as Va, withDirectives as de, renderSlot as Pe, withModifiers as it, nextTick as Ie, TransitionGroup as dt, useCssVars as pt, resolveComponent as ft, isRef as $e, vShow as ht, reactive as mt, createSlots as xe, withKeys as Xe, normalizeProps as Ze, guardReactiveProps as ea } from "vue";
|
|
3
|
+
import { createTypes as yt } from "vue-types";
|
|
4
4
|
import { PictureFilled as Le } from "@element-plus/icons-vue";
|
|
5
|
-
import
|
|
6
|
-
import { compressAccurately as
|
|
7
|
-
import { defineStore as
|
|
5
|
+
import gt from "axios";
|
|
6
|
+
import { compressAccurately as bt } from "image-conversion";
|
|
7
|
+
import { defineStore as Sa } from "pinia";
|
|
8
8
|
import "@vueup/vue-quill/dist/vue-quill.snow.css";
|
|
9
|
-
import { Quill as
|
|
10
|
-
import { useI18n as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const oe =
|
|
9
|
+
import { Quill as vt, QuillEditor as kt } from "@vueup/vue-quill";
|
|
10
|
+
import { useI18n as $a } from "vue-i18n";
|
|
11
|
+
import _t from "dayjs";
|
|
12
|
+
import wt from "file-saver";
|
|
13
|
+
const oe = yt({
|
|
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
|
+
}), Vt = ["xlink:href", "fill"], St = /* @__PURE__ */ pe({
|
|
21
21
|
__name: "index",
|
|
22
22
|
props: {
|
|
23
23
|
iconClass: oe.string.isRequired,
|
|
@@ -25,23 +25,23 @@ const oe = ma({
|
|
|
25
25
|
color: oe.string.def("")
|
|
26
26
|
},
|
|
27
27
|
setup(e) {
|
|
28
|
-
const l = e,
|
|
28
|
+
const l = e, t = J(() => `#icon-${l.iconClass}`), a = J(() => l.className ? `svg-icon ${l.className}` : "svg-icon");
|
|
29
29
|
return (c, o) => (s(), T("svg", {
|
|
30
|
-
class:
|
|
30
|
+
class: He(r(a)),
|
|
31
31
|
"aria-hidden": "true"
|
|
32
32
|
}, [
|
|
33
33
|
re("use", {
|
|
34
|
-
"xlink:href": r(
|
|
34
|
+
"xlink:href": r(t),
|
|
35
35
|
fill: e.color
|
|
36
|
-
}, null, 8,
|
|
36
|
+
}, null, 8, Vt)
|
|
37
37
|
], 2));
|
|
38
38
|
}
|
|
39
39
|
}), be = (e, l) => {
|
|
40
|
-
const
|
|
41
|
-
for (const [
|
|
42
|
-
a
|
|
43
|
-
return
|
|
44
|
-
},
|
|
40
|
+
const t = e.__vccOpts || e;
|
|
41
|
+
for (const [a, c] of l)
|
|
42
|
+
t[a] = c;
|
|
43
|
+
return t;
|
|
44
|
+
}, Ne = /* @__PURE__ */ be(St, [["__scopeId", "data-v-ed552a8d"]]), Da = /* @__PURE__ */ pe({
|
|
45
45
|
__name: "index",
|
|
46
46
|
props: {
|
|
47
47
|
options: {
|
|
@@ -59,27 +59,27 @@ const oe = ma({
|
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
setup(e) {
|
|
62
|
-
const l = e,
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
62
|
+
const l = e, t = J(() => {
|
|
63
|
+
const a = l.value;
|
|
64
|
+
if (a === "" || a === null || typeof a > "u")
|
|
65
65
|
return "";
|
|
66
66
|
const c = (o) => {
|
|
67
67
|
var y;
|
|
68
68
|
const i = (y = l.options) == null ? void 0 : y.find((f) => f.value == o || f.label == o);
|
|
69
69
|
return (i == null ? void 0 : i.label) ?? "";
|
|
70
70
|
};
|
|
71
|
-
if (Array.isArray(
|
|
72
|
-
return
|
|
73
|
-
if (typeof
|
|
71
|
+
if (Array.isArray(a))
|
|
72
|
+
return a.map((o) => c(o)).filter(Boolean).join(l.separator);
|
|
73
|
+
if (typeof a == "string") {
|
|
74
74
|
let o = [];
|
|
75
|
-
if (
|
|
75
|
+
if (a.indexOf(",") > -1 ? o = a.split(",") : a.indexOf("、") > -1 && (o = a.split("、")), o.length > 0)
|
|
76
76
|
return o.map((i) => c(i)).filter(Boolean).join(l.separator);
|
|
77
77
|
}
|
|
78
|
-
return c(
|
|
78
|
+
return c(a) || a;
|
|
79
79
|
});
|
|
80
|
-
return (
|
|
80
|
+
return (a, c) => (s(), T("span", null, M(r(t)), 1));
|
|
81
81
|
}
|
|
82
|
-
}),
|
|
82
|
+
}), $t = /* @__PURE__ */ pe({
|
|
83
83
|
__name: "index",
|
|
84
84
|
props: {
|
|
85
85
|
options: {
|
|
@@ -92,29 +92,29 @@ const oe = ma({
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
setup(e) {
|
|
95
|
-
const l = e,
|
|
96
|
-
const
|
|
97
|
-
if (
|
|
95
|
+
const l = e, t = J(() => {
|
|
96
|
+
const a = l.value;
|
|
97
|
+
if (a === "" || a === null || typeof a > "u")
|
|
98
98
|
return "";
|
|
99
|
-
if (Array.isArray(
|
|
99
|
+
if (Array.isArray(a)) {
|
|
100
100
|
const c = [];
|
|
101
101
|
return l.options.map((o) => {
|
|
102
|
-
(
|
|
102
|
+
(a.indexOf(o.value) > -1 || a.indexOf(o.label) > -1) && c.push(o);
|
|
103
103
|
}), c;
|
|
104
|
-
} else if (typeof
|
|
104
|
+
} else if (typeof a == "string") {
|
|
105
105
|
let c = [];
|
|
106
|
-
if (
|
|
106
|
+
if (a.indexOf(",") > -1 ? c = a.split(",") : a.indexOf("、") > -1 && (c = a.split("、")), c.length > 0) {
|
|
107
107
|
const o = [];
|
|
108
108
|
return l.options.map((i) => {
|
|
109
109
|
(c.indexOf(i.value) > -1 || c.indexOf(i.label) > -1) && o.push(i);
|
|
110
110
|
}), o;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
return l.options.find((c) => c.value ==
|
|
113
|
+
return l.options.find((c) => c.value == a || c.label == a) || a;
|
|
114
114
|
});
|
|
115
|
-
return (
|
|
116
|
-
const o =
|
|
117
|
-
return Array.isArray(r(
|
|
115
|
+
return (a, c) => {
|
|
116
|
+
const o = ua;
|
|
117
|
+
return Array.isArray(r(t)) ? (s(!0), T(z, { key: 0 }, Q(r(t), (i) => (s(), T(z, null, [
|
|
118
118
|
i.label ? (s(), h(o, {
|
|
119
119
|
"disable-transitions": !0,
|
|
120
120
|
key: i.value,
|
|
@@ -126,47 +126,47 @@ const oe = ma({
|
|
|
126
126
|
_: 2
|
|
127
127
|
}, 1032, ["type"])) : Z("", !0)
|
|
128
128
|
], 64))), 256)) : (s(), T(z, { key: 1 }, [
|
|
129
|
-
r(
|
|
129
|
+
r(t).label ? (s(), h(o, {
|
|
130
130
|
"disable-transitions": !0,
|
|
131
|
-
key: r(
|
|
132
|
-
type: r(
|
|
131
|
+
key: r(t).value,
|
|
132
|
+
type: r(t).elTagType || "primary"
|
|
133
133
|
}, {
|
|
134
134
|
default: b(() => [
|
|
135
|
-
L(M(r(
|
|
135
|
+
L(M(r(t).label), 1)
|
|
136
136
|
]),
|
|
137
137
|
_: 1
|
|
138
138
|
}, 8, ["type"])) : Z("", !0)
|
|
139
139
|
], 64));
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
}),
|
|
143
|
-
let Ue = null,
|
|
144
|
-
const
|
|
145
|
-
const e =
|
|
142
|
+
}), Ca = /* @__PURE__ */ be($t, [["__scopeId", "data-v-9a5060d2"]]);
|
|
143
|
+
let Ue = null, Ta = () => ({}), Ke = "";
|
|
144
|
+
const Dt = () => {
|
|
145
|
+
const e = gt.create({ baseURL: Ke, timeout: 5e4 });
|
|
146
146
|
return e.interceptors.response.use(
|
|
147
147
|
(l) => l.data,
|
|
148
148
|
(l) => Promise.reject(l)
|
|
149
149
|
), e;
|
|
150
|
-
}, ke = () => (Ue || (Ue =
|
|
150
|
+
}, ke = () => (Ue || (Ue = Dt()), Ue), Ct = (e) => {
|
|
151
151
|
Ue = e;
|
|
152
|
-
},
|
|
153
|
-
|
|
154
|
-
},
|
|
155
|
-
|
|
152
|
+
}, We = () => Ta(), Tt = (e) => {
|
|
153
|
+
Ta = e;
|
|
154
|
+
}, qe = () => Ke, Et = (e) => {
|
|
155
|
+
Ke = e || "";
|
|
156
156
|
};
|
|
157
|
-
function
|
|
157
|
+
function Qe(e) {
|
|
158
158
|
return ke()({
|
|
159
159
|
url: "/resource/oss/listByIds/" + e,
|
|
160
160
|
method: "get"
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Ea(e) {
|
|
164
164
|
return ke()({
|
|
165
165
|
url: "/resource/oss/" + e,
|
|
166
166
|
method: "delete"
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
|
-
const
|
|
169
|
+
const Ut = { class: "image-slot" }, At = { key: 1 }, Ot = /* @__PURE__ */ pe({
|
|
170
170
|
__name: "index",
|
|
171
171
|
props: {
|
|
172
172
|
modelValue: [String, Object, Array, Number],
|
|
@@ -180,9 +180,9 @@ const Ea = { class: "image-slot" }, Ua = { key: 1 }, Aa = /* @__PURE__ */ pe({
|
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
182
|
setup(e) {
|
|
183
|
-
const l = e,
|
|
184
|
-
if (!
|
|
185
|
-
const i =
|
|
183
|
+
const l = e, t = I(""), a = J(() => t.value ? t.value.split(",")[0] : void 0), c = J(() => {
|
|
184
|
+
if (!t.value) return;
|
|
185
|
+
const i = t.value.split(","), y = [];
|
|
186
186
|
return i.forEach((f) => y.push(f)), y;
|
|
187
187
|
}), o = J(() => {
|
|
188
188
|
const i = l.width;
|
|
@@ -194,14 +194,14 @@ const Ea = { class: "image-slot" }, Ua = { key: 1 }, Aa = /* @__PURE__ */ pe({
|
|
|
194
194
|
}), Ve(() => l.modelValue, async (i) => {
|
|
195
195
|
if (i) {
|
|
196
196
|
let y;
|
|
197
|
-
Array.isArray(i) ? y = i : y = (await
|
|
198
|
-
} else
|
|
197
|
+
Array.isArray(i) ? y = i : y = (await Qe(i)).data, t.value = y.map((f) => f.url).join(",");
|
|
198
|
+
} else t.value = "";
|
|
199
199
|
}, { immediate: !0, deep: !0 }), (i, y) => {
|
|
200
|
-
const f =
|
|
200
|
+
const f = Me, V = Ye;
|
|
201
201
|
return s(), T("div", null, [
|
|
202
|
-
r(
|
|
202
|
+
r(a) ? (s(), h(V, {
|
|
203
203
|
key: 0,
|
|
204
|
-
src: `${r(
|
|
204
|
+
src: `${r(a)}`,
|
|
205
205
|
fit: "scale-down",
|
|
206
206
|
loading: "lazy",
|
|
207
207
|
style: fe(`width:${r(o)};height:${r(o)};`),
|
|
@@ -209,7 +209,7 @@ const Ea = { class: "image-slot" }, Ua = { key: 1 }, Aa = /* @__PURE__ */ pe({
|
|
|
209
209
|
"preview-teleported": ""
|
|
210
210
|
}, {
|
|
211
211
|
error: b(() => [
|
|
212
|
-
re("div",
|
|
212
|
+
re("div", Ut, [
|
|
213
213
|
K(f, null, {
|
|
214
214
|
default: b(() => [
|
|
215
215
|
K(r(Le))
|
|
@@ -219,7 +219,7 @@ const Ea = { class: "image-slot" }, Ua = { key: 1 }, Aa = /* @__PURE__ */ pe({
|
|
|
219
219
|
])
|
|
220
220
|
]),
|
|
221
221
|
_: 1
|
|
222
|
-
}, 8, ["src", "style", "preview-src-list"])) : (s(), T("div",
|
|
222
|
+
}, 8, ["src", "style", "preview-src-list"])) : (s(), T("div", At, [
|
|
223
223
|
re("div", {
|
|
224
224
|
class: "image-slot",
|
|
225
225
|
style: fe(`width:${r(o)};height:${r(o)};`)
|
|
@@ -235,7 +235,7 @@ const Ea = { class: "image-slot" }, Ua = { key: 1 }, Aa = /* @__PURE__ */ pe({
|
|
|
235
235
|
]);
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
|
-
}),
|
|
238
|
+
}), Ua = /* @__PURE__ */ be(Ot, [["__scopeId", "data-v-dc163acb"]]), Pt = { class: "image-slot" }, It = /* @__PURE__ */ pe({
|
|
239
239
|
__name: "index",
|
|
240
240
|
props: {
|
|
241
241
|
data: {
|
|
@@ -252,24 +252,24 @@ const Ea = { class: "image-slot" }, Ua = { key: 1 }, Aa = /* @__PURE__ */ pe({
|
|
|
252
252
|
}
|
|
253
253
|
},
|
|
254
254
|
setup(e) {
|
|
255
|
-
const l = e,
|
|
255
|
+
const l = e, t = J(
|
|
256
256
|
() => typeof l.width == "string" ? l.width : `${l.width}px`
|
|
257
|
-
),
|
|
257
|
+
), a = J(
|
|
258
258
|
() => typeof l.height == "string" ? l.height : `${l.height}px`
|
|
259
259
|
);
|
|
260
260
|
return (c, o) => {
|
|
261
|
-
const i =
|
|
261
|
+
const i = Me, y = Ye, f = Ne;
|
|
262
262
|
return s(), T("span", null, [
|
|
263
263
|
[".jpg", ".png", ".jpeg"].indexOf(e.data.fileSuffix) > -1 ? (s(), h(y, {
|
|
264
264
|
key: 0,
|
|
265
265
|
src: e.data.url,
|
|
266
266
|
fit: "cover",
|
|
267
267
|
"preview-src-list": [e.data.url],
|
|
268
|
-
style: fe(`width:${r(
|
|
268
|
+
style: fe(`width:${r(t)};height:${r(a)};`),
|
|
269
269
|
"preview-teleported": ""
|
|
270
270
|
}, {
|
|
271
271
|
error: b(() => [
|
|
272
|
-
re("div",
|
|
272
|
+
re("div", Pt, [
|
|
273
273
|
K(i, null, {
|
|
274
274
|
default: b(() => [
|
|
275
275
|
K(r(Le))
|
|
@@ -282,46 +282,46 @@ const Ea = { class: "image-slot" }, Ua = { key: 1 }, Aa = /* @__PURE__ */ pe({
|
|
|
282
282
|
}, 8, ["src", "preview-src-list", "style"])) : [".xls", ".xlsx", ".csv"].indexOf(e.data.fileSuffix) > -1 ? (s(), h(f, {
|
|
283
283
|
key: 1,
|
|
284
284
|
"icon-class": "excel",
|
|
285
|
-
style: fe(`width:${r(
|
|
285
|
+
style: fe(`width:${r(t)};height:${r(a)};`)
|
|
286
286
|
}, null, 8, ["style"])) : [".doc", ".docx"].indexOf(e.data.fileSuffix) > -1 ? (s(), h(f, {
|
|
287
287
|
key: 2,
|
|
288
288
|
"icon-class": "word",
|
|
289
|
-
style: fe(`width:${r(
|
|
289
|
+
style: fe(`width:${r(t)};height:${r(a)};`)
|
|
290
290
|
}, null, 8, ["style"])) : [".pdf"].indexOf(e.data.fileSuffix) > -1 ? (s(), h(f, {
|
|
291
291
|
key: 3,
|
|
292
292
|
"icon-class": "pdf",
|
|
293
|
-
style: fe(`width:${r(
|
|
293
|
+
style: fe(`width:${r(t)};height:${r(a)};`)
|
|
294
294
|
}, null, 8, ["style"])) : [".tet"].indexOf(e.data.fileSuffix) > -1 ? (s(), h(f, {
|
|
295
295
|
key: 4,
|
|
296
296
|
"icon-class": "tet",
|
|
297
|
-
style: fe(`width:${r(
|
|
297
|
+
style: fe(`width:${r(t)};height:${r(a)};`)
|
|
298
298
|
}, null, 8, ["style"])) : [".zip"].indexOf(e.data.fileSuffix) > -1 ? (s(), h(f, {
|
|
299
299
|
key: 5,
|
|
300
300
|
"icon-class": "zip",
|
|
301
|
-
style: fe(`width:${r(
|
|
301
|
+
style: fe(`width:${r(t)};height:${r(a)};`)
|
|
302
302
|
}, null, 8, ["style"])) : (s(), h(f, {
|
|
303
303
|
key: 6,
|
|
304
304
|
"icon-class": "unknown",
|
|
305
|
-
style: fe(`width:${r(
|
|
305
|
+
style: fe(`width:${r(t)};height:${r(a)};`)
|
|
306
306
|
}, null, 8, ["style"]))
|
|
307
307
|
]);
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
|
-
}),
|
|
310
|
+
}), Aa = /* @__PURE__ */ be(It, [["__scopeId", "data-v-a3763021"]]), Oa = {
|
|
311
311
|
bool: [
|
|
312
312
|
{ label: "是", value: "1" },
|
|
313
313
|
{ label: "否", value: "0" },
|
|
314
314
|
{ label: "是", value: "True" },
|
|
315
315
|
{ label: "否", value: "False" }
|
|
316
316
|
]
|
|
317
|
-
},
|
|
317
|
+
}, xt = [
|
|
318
318
|
{ prop: "createTime", width: "165px" },
|
|
319
319
|
{ prop: "createBy", width: "100px" },
|
|
320
320
|
{ prop: "orderNum", width: "80px" },
|
|
321
321
|
{ prop: "sort", width: "80px" },
|
|
322
322
|
{ prop: "code", width: "120px" },
|
|
323
323
|
{ prop: "updateTime", width: "165px" }
|
|
324
|
-
],
|
|
324
|
+
], Lt = [10, 15, 20, 30, 50, 100], aa = {
|
|
325
325
|
pageSize: 15,
|
|
326
326
|
pageNum: 1,
|
|
327
327
|
total: 0,
|
|
@@ -330,103 +330,103 @@ const Ea = { class: "image-slot" }, Ua = { key: 1 }, Aa = /* @__PURE__ */ pe({
|
|
|
330
330
|
}, Ae = {
|
|
331
331
|
FULL: "total, sizes, prev, pager, next",
|
|
332
332
|
SIMPLE: "total"
|
|
333
|
-
},
|
|
333
|
+
}, ta = 30, zt = 28;
|
|
334
334
|
function ze(e) {
|
|
335
335
|
if (!e) return {};
|
|
336
336
|
const l = {};
|
|
337
|
-
for (const
|
|
338
|
-
const
|
|
339
|
-
|
|
337
|
+
for (const t in e) {
|
|
338
|
+
const a = e[t];
|
|
339
|
+
a !== "" && a !== null && a !== void 0 && (!Array.isArray(a) || a.length > 0) && (l[t] = a);
|
|
340
340
|
}
|
|
341
341
|
return l;
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function Bt(e) {
|
|
344
344
|
if (e.width) return String(e.width);
|
|
345
|
-
const l =
|
|
345
|
+
const l = xt.find((t) => t.prop === e.prop);
|
|
346
346
|
return l ? l.width : e.prop.includes("time") ? "100px" : "auto";
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function Yt(e, l) {
|
|
349
349
|
if (!l.prop) return "";
|
|
350
|
-
let
|
|
351
|
-
if (l.prop.includes(".") ?
|
|
352
|
-
const
|
|
353
|
-
return `${
|
|
350
|
+
let t;
|
|
351
|
+
if (l.prop.includes(".") ? t = l.prop.split(".").reduce((c, o) => c == null ? void 0 : c[o], e) : t = e[l.prop], t != null) {
|
|
352
|
+
const a = l.prefix || "", c = l.suffix || "";
|
|
353
|
+
return `${a}${t}${c}`;
|
|
354
354
|
}
|
|
355
355
|
return "";
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function Mt(e) {
|
|
358
358
|
e.forEach((l) => {
|
|
359
359
|
l.form || (l.form = { order: 100 }), l.form.order == null && (l.form.order = 100), !l.form.type && l.type && (l.form.type = l.type), !l.form.prop && l.prop && (l.form.prop = l.prop), l.search && !l.search.dictType && l.dictType && (l.search.dictType = l.dictType), !l.form.dictType && l.dictType && (l.form.dictType = l.dictType), !l.form.inactiveValue && l.inactiveValue && (l.form.inactiveValue = l.inactiveValue), !l.form.activeValue && l.activeValue && (l.form.activeValue = l.activeValue), l.form.type === "checkbox" && (l.label = ""), l.search && (l.search.prop = l.search.prop ?? l.prop);
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Rt(e) {
|
|
363
363
|
e.forEach((l) => {
|
|
364
364
|
if (!l.form) return;
|
|
365
|
-
const
|
|
366
|
-
l.form.required &&
|
|
365
|
+
const t = l.form.rules || [];
|
|
366
|
+
l.form.required && t.push({
|
|
367
367
|
required: !0,
|
|
368
368
|
message: `${l.label}必填`,
|
|
369
369
|
trigger: "blur"
|
|
370
|
-
}), l.form.rules =
|
|
370
|
+
}), l.form.rules = t.length > 0 ? t : void 0;
|
|
371
371
|
});
|
|
372
372
|
}
|
|
373
|
-
function
|
|
374
|
-
return [...e].sort((
|
|
373
|
+
function Pa(e, l = "order") {
|
|
374
|
+
return [...e].sort((t, a) => {
|
|
375
375
|
const c = (y, f) => {
|
|
376
|
-
const
|
|
376
|
+
const V = f.split(".");
|
|
377
377
|
let p = y;
|
|
378
|
-
for (const R of
|
|
378
|
+
for (const R of V)
|
|
379
379
|
p = p == null ? void 0 : p[R];
|
|
380
380
|
return p ?? 100;
|
|
381
|
-
}, o = c(
|
|
381
|
+
}, o = c(t, l), i = c(a, l);
|
|
382
382
|
return o - i;
|
|
383
383
|
});
|
|
384
384
|
}
|
|
385
|
-
function
|
|
386
|
-
return e.filter((
|
|
385
|
+
function jt(e, l, t) {
|
|
386
|
+
return e.filter((a) => !(a.canEdit === !1 || t && a.canUpdate === !1 || !t && a.canCreate === !1));
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function Ht(e, l) {
|
|
389
389
|
if (!l.show) return !0;
|
|
390
|
-
for (const
|
|
391
|
-
if (l.show[
|
|
390
|
+
for (const t in l.show)
|
|
391
|
+
if (l.show[t].includes(e[t]))
|
|
392
392
|
return !0;
|
|
393
393
|
return !1;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function Ft(e, l) {
|
|
396
396
|
if (!l.disable && !l.enable) return !1;
|
|
397
|
-
for (const
|
|
398
|
-
if (l.disable[
|
|
397
|
+
for (const t in l.disable)
|
|
398
|
+
if (l.disable[t].includes(e[t]))
|
|
399
399
|
return !0;
|
|
400
|
-
for (const
|
|
401
|
-
if (!l.enable[
|
|
400
|
+
for (const t in l.enable)
|
|
401
|
+
if (!l.enable[t].includes(e[t]))
|
|
402
402
|
return !0;
|
|
403
403
|
return !1;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
406
|
-
l && l[0] && l[1] && (e[
|
|
405
|
+
function Nt(e, l, t, a) {
|
|
406
|
+
l && l[0] && l[1] && (e[t] = `${l[0]},${l[1]}`, a == null || a.addDateRange(e, l, t));
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
const { proxy: l } = he(),
|
|
410
|
-
...
|
|
411
|
-
pageSize: e.initialPageSize ??
|
|
412
|
-
}), f = I(
|
|
408
|
+
function Kt(e) {
|
|
409
|
+
const { proxy: l } = he(), t = I([]), a = I(!1), c = I([]), o = I({}), i = I(), y = I({
|
|
410
|
+
...aa,
|
|
411
|
+
pageSize: e.initialPageSize ?? aa.pageSize
|
|
412
|
+
}), f = I(Lt), V = I(Ae.FULL), p = async () => {
|
|
413
413
|
var U;
|
|
414
414
|
if (!e.listApi) {
|
|
415
|
-
e.data ?
|
|
415
|
+
e.data ? t.value = Array.isArray(e.data) ? e.data : ((U = e.data) == null ? void 0 : U.value) || [] : t.value = [];
|
|
416
416
|
return;
|
|
417
417
|
}
|
|
418
|
-
|
|
418
|
+
a.value = !0;
|
|
419
419
|
try {
|
|
420
420
|
const k = await R(null), E = await e.listApi(k);
|
|
421
421
|
e.afterQuery && await e.afterQuery(E);
|
|
422
422
|
let O = E.rows || E.data;
|
|
423
|
-
e.treeProps && (O = l == null ? void 0 : l.handleTree(E.data, e.rowKey)),
|
|
423
|
+
e.treeProps && (O = l == null ? void 0 : l.handleTree(E.data, e.rowKey)), t.value = O, y.value.total = E.total;
|
|
424
424
|
const W = E.total / y.value.pageSize <= 1;
|
|
425
|
-
|
|
425
|
+
V.value = W ? Ae.SIMPLE : Ae.FULL, l == null || l.$forceUpdate();
|
|
426
426
|
} catch (k) {
|
|
427
427
|
console.error("Query failed:", k);
|
|
428
428
|
} finally {
|
|
429
|
-
|
|
429
|
+
a.value = !1;
|
|
430
430
|
}
|
|
431
431
|
}, R = async (U) => {
|
|
432
432
|
U && (o.value = ze(U));
|
|
@@ -464,12 +464,12 @@ function Na(e) {
|
|
|
464
464
|
}), U.isAsc && (y.value.isAsc = U.isAsc);
|
|
465
465
|
};
|
|
466
466
|
return {
|
|
467
|
-
listData:
|
|
468
|
-
loading:
|
|
467
|
+
listData: t,
|
|
468
|
+
loading: a,
|
|
469
469
|
multipleSelection: c,
|
|
470
470
|
pageOptions: y,
|
|
471
471
|
listSize: f,
|
|
472
|
-
pagingLayout:
|
|
472
|
+
pagingLayout: V,
|
|
473
473
|
defaultSort: i,
|
|
474
474
|
executeQuery: p,
|
|
475
475
|
getQueryParams: R,
|
|
@@ -483,7 +483,7 @@ function Na(e) {
|
|
|
483
483
|
}
|
|
484
484
|
};
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function Ia() {
|
|
487
487
|
const { proxy: e } = he(), l = async (o) => {
|
|
488
488
|
for (const i of o)
|
|
489
489
|
if (i.type === "dictTag" || i.type === "dictText") {
|
|
@@ -493,11 +493,11 @@ function Pt() {
|
|
|
493
493
|
const y = await (e == null ? void 0 : e.useOneCommonDict(i.dictType));
|
|
494
494
|
i.data = Oe(y);
|
|
495
495
|
}
|
|
496
|
-
},
|
|
496
|
+
}, t = async (o) => {
|
|
497
497
|
if (!o.search) return;
|
|
498
498
|
switch (o.search.type) {
|
|
499
499
|
case "selectApi":
|
|
500
|
-
o.search.api ? await
|
|
500
|
+
o.search.api ? await a(o) : console.error(`${o.prop}中search对象未设置api参数`);
|
|
501
501
|
break;
|
|
502
502
|
case "treeSelectApi":
|
|
503
503
|
o.search.api ? await c(o) : console.error(`${o.prop}中search对象未设置api参数`);
|
|
@@ -509,7 +509,7 @@ function Pt() {
|
|
|
509
509
|
o.search.data = await (e == null ? void 0 : e.useOneDict(o.search.dictType));
|
|
510
510
|
break;
|
|
511
511
|
}
|
|
512
|
-
},
|
|
512
|
+
}, a = async (o) => {
|
|
513
513
|
var y;
|
|
514
514
|
if (!((y = o.search) != null && y.api)) return;
|
|
515
515
|
const i = {
|
|
@@ -530,8 +530,8 @@ function Pt() {
|
|
|
530
530
|
try {
|
|
531
531
|
const y = await o.search.api({ pageNum: 1, pageSize: 1e3 });
|
|
532
532
|
if (o.search.data = y.data || y.rows || y, o.search.data && Array.isArray(o.search.data)) {
|
|
533
|
-
const
|
|
534
|
-
o.search.defaultExpandedKeys = o.search.data.map((p) => p[
|
|
533
|
+
const V = (o.search.props || { value: "id", label: "label", children: "children" }).value || "id";
|
|
534
|
+
o.search.defaultExpandedKeys = o.search.data.map((p) => p[V]);
|
|
535
535
|
}
|
|
536
536
|
} catch (y) {
|
|
537
537
|
console.error(`Failed to load tree API data for ${o.prop}:`, y);
|
|
@@ -539,49 +539,49 @@ function Pt() {
|
|
|
539
539
|
};
|
|
540
540
|
return {
|
|
541
541
|
initColumnDicts: l,
|
|
542
|
-
initSearchDicts:
|
|
543
|
-
initSelectApi:
|
|
542
|
+
initSearchDicts: t,
|
|
543
|
+
initSelectApi: a
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
|
-
let
|
|
547
|
-
const
|
|
548
|
-
e.hasPermi && (
|
|
549
|
-
},
|
|
546
|
+
let Ge = () => !0, xa = () => !0;
|
|
547
|
+
const Wt = (e) => {
|
|
548
|
+
e.hasPermi && (Ge = e.hasPermi), e.hasRoles && (xa = e.hasRoles);
|
|
549
|
+
}, Be = (e) => {
|
|
550
550
|
if (e == null) return !0;
|
|
551
551
|
const l = Array.isArray(e) ? e : [e];
|
|
552
|
-
return l.length === 0 ? !0 :
|
|
553
|
-
},
|
|
552
|
+
return l.length === 0 ? !0 : Ge(l);
|
|
553
|
+
}, qt = {
|
|
554
554
|
mounted(e, l) {
|
|
555
|
-
var
|
|
556
|
-
const { value:
|
|
557
|
-
|
|
555
|
+
var a;
|
|
556
|
+
const { value: t } = l;
|
|
557
|
+
t != null && Array.isArray(t) && t.length > 0 && (Ge(t) || (a = e.parentNode) == null || a.removeChild(e));
|
|
558
558
|
}
|
|
559
|
-
},
|
|
559
|
+
}, Qt = {
|
|
560
560
|
mounted(e, l) {
|
|
561
|
-
var
|
|
562
|
-
const { value:
|
|
563
|
-
|
|
561
|
+
var a;
|
|
562
|
+
const { value: t } = l;
|
|
563
|
+
t != null && Array.isArray(t) && t.length > 0 && (xa(t) || (a = e.parentNode) == null || a.removeChild(e));
|
|
564
564
|
}
|
|
565
|
-
},
|
|
565
|
+
}, Gt = {
|
|
566
566
|
key: 2,
|
|
567
567
|
class: "image-style"
|
|
568
|
-
},
|
|
568
|
+
}, Jt = {
|
|
569
569
|
key: 3,
|
|
570
570
|
class: "image-style"
|
|
571
|
-
},
|
|
571
|
+
}, Xt = {
|
|
572
572
|
key: 8,
|
|
573
573
|
class: "color-cell"
|
|
574
|
-
},
|
|
574
|
+
}, Zt = { style: { margin: "20px 0px" } }, el = /* @__PURE__ */ pe({
|
|
575
575
|
__name: "curdTable",
|
|
576
576
|
props: {
|
|
577
577
|
dataSource: {},
|
|
578
578
|
maxHeight: {}
|
|
579
579
|
},
|
|
580
580
|
emits: ["actionEvent", "selectionChange", "rowClick"],
|
|
581
|
-
setup(e, { expose: l, emit:
|
|
582
|
-
const { proxy:
|
|
581
|
+
setup(e, { expose: l, emit: t }) {
|
|
582
|
+
const { proxy: a } = he(), c = t, o = e, i = J(() => o.dataSource.maxHeight ?? o.maxHeight), y = I(), {
|
|
583
583
|
listData: f,
|
|
584
|
-
loading:
|
|
584
|
+
loading: V,
|
|
585
585
|
multipleSelection: p,
|
|
586
586
|
pageOptions: R,
|
|
587
587
|
listSize: D,
|
|
@@ -594,85 +594,85 @@ const Ka = (e) => {
|
|
|
594
594
|
handleSelectionChange: U,
|
|
595
595
|
initData: k,
|
|
596
596
|
getQueryParams: E
|
|
597
|
-
} =
|
|
598
|
-
(
|
|
599
|
-
) : []), C = (
|
|
597
|
+
} = Kt(o.dataSource), { initColumnDicts: O } = Ia(), W = I(Oa), S = (w) => w == null ? void 0 : w[o.dataSource.rowKey], d = J(() => o.dataSource.actions ? o.dataSource.actions.filter(
|
|
598
|
+
(w) => w.action !== "create" && w.action !== "back" && (!w.position || w.position === "table") && Be(w.permission)
|
|
599
|
+
) : []), C = (w) => {
|
|
600
600
|
var N;
|
|
601
|
-
return !((N = o.dataSource.disabledCheckedRowKeys) != null && N.includes(S(
|
|
601
|
+
return !((N = o.dataSource.disabledCheckedRowKeys) != null && N.includes(S(w)));
|
|
602
602
|
}, A = J(() => {
|
|
603
|
-
const
|
|
604
|
-
if (
|
|
605
|
-
return typeof
|
|
606
|
-
let N = d.value.length *
|
|
607
|
-
return N <
|
|
608
|
-
}), F = (
|
|
609
|
-
var
|
|
610
|
-
const N =
|
|
611
|
-
return N || (((
|
|
612
|
-
}, q = (
|
|
613
|
-
const
|
|
614
|
-
if (
|
|
615
|
-
const le = N[
|
|
616
|
-
return
|
|
617
|
-
} else console.error(
|
|
618
|
-
}, Y = (
|
|
619
|
-
const
|
|
620
|
-
if (
|
|
621
|
-
const le = N[
|
|
622
|
-
return
|
|
623
|
-
} else console.error(
|
|
624
|
-
}, ne = (
|
|
625
|
-
if (
|
|
626
|
-
const
|
|
603
|
+
const w = o.dataSource.actionColumnWidth;
|
|
604
|
+
if (w != null && w !== "")
|
|
605
|
+
return typeof w == "number" ? `${w}px` : w;
|
|
606
|
+
let N = d.value.length * zt;
|
|
607
|
+
return N < ta && (N = ta), `${N + 40}px`;
|
|
608
|
+
}), F = (w, N) => Ht(w, N), G = (w, N) => Ft(w, N), se = (w) => Bt(w), _ = (w) => Be(w == null ? void 0 : w.permission), x = (w) => {
|
|
609
|
+
var ae;
|
|
610
|
+
const N = w.align || o.dataSource.align;
|
|
611
|
+
return N || (((ae = w.label) == null ? void 0 : ae.indexOf("時間")) > -1 || !1 || w.type == "dictTag" || w.type == "image" || w.type == "switch" ? "center" : "left");
|
|
612
|
+
}, q = (w, N) => {
|
|
613
|
+
const ae = a == null ? void 0 : a.useDict(w.dictType)[w.dictType];
|
|
614
|
+
if (ae != null) {
|
|
615
|
+
const le = N[w.prop], te = ae.filter((ge) => ge.value == le);
|
|
616
|
+
return te.length == 0 ? "" : te[0].label;
|
|
617
|
+
} else console.error(w.dictType + " 字典不存在");
|
|
618
|
+
}, Y = (w, N) => {
|
|
619
|
+
const ae = W.value[w.dictType];
|
|
620
|
+
if (ae != null) {
|
|
621
|
+
const le = N[w.prop], te = ae.find((ge) => ge.value == le);
|
|
622
|
+
return te == null ? "" : te.label;
|
|
623
|
+
} else console.error(w.dictType + " 字典不存在");
|
|
624
|
+
}, ne = (w, N) => {
|
|
625
|
+
if (w.data != null) {
|
|
626
|
+
const ae = N[w.prop], le = w.data.find((te) => te.value == ae);
|
|
627
627
|
return le == null ? "" : le.label;
|
|
628
628
|
} else console.error("未配置data屬性");
|
|
629
|
-
}, ue = (
|
|
630
|
-
if (
|
|
631
|
-
const
|
|
629
|
+
}, ue = (w, N) => {
|
|
630
|
+
if (w.data != null) {
|
|
631
|
+
const ae = N[w.prop], le = w.data.find((te) => te.value == ae);
|
|
632
632
|
return le == null ? "info" : le.tagType;
|
|
633
633
|
} else console.error("未配置data屬性");
|
|
634
|
-
}, me = (
|
|
635
|
-
const N = Array.isArray(
|
|
634
|
+
}, me = (w, N) => Yt(w, N), ce = (w) => {
|
|
635
|
+
const N = Array.isArray(w) ? w : [];
|
|
636
636
|
U(N), c("selectionChange", N);
|
|
637
|
-
}, ye = (
|
|
638
|
-
var le,
|
|
639
|
-
return (
|
|
640
|
-
}, u = (
|
|
641
|
-
var N,
|
|
637
|
+
}, ye = (w, N, ae) => {
|
|
638
|
+
var le, te;
|
|
639
|
+
return (te = (le = o.dataSource).rowClick) == null ? void 0 : te.call(le, w, N, ae);
|
|
640
|
+
}, u = (w, N) => c("actionEvent", w, N), m = () => p.value, n = async () => {
|
|
641
|
+
var N, ae;
|
|
642
642
|
if (!o.dataSource.showSelection || !((N = o.dataSource.checkedRowKeys) != null && N.length)) return;
|
|
643
643
|
await Ie();
|
|
644
|
-
const
|
|
645
|
-
if (
|
|
644
|
+
const w = y.value;
|
|
645
|
+
if (w != null && w.toggleRowSelection)
|
|
646
646
|
for (const le of f.value) {
|
|
647
|
-
const
|
|
648
|
-
if (
|
|
649
|
-
const ge = String(
|
|
650
|
-
(
|
|
647
|
+
const te = S(le);
|
|
648
|
+
if (te == null) continue;
|
|
649
|
+
const ge = String(te);
|
|
650
|
+
(ae = o.dataSource.checkedRowKeys) != null && ae.includes(ge) && w.toggleRowSelection(le, !0);
|
|
651
651
|
}
|
|
652
652
|
}, g = async () => {
|
|
653
|
-
var N,
|
|
653
|
+
var N, ae;
|
|
654
654
|
if (!o.dataSource.showSelection || !((N = o.dataSource.disabledCheckedRowKeys) != null && N.length)) return;
|
|
655
655
|
await Ie();
|
|
656
|
-
const
|
|
657
|
-
if (
|
|
656
|
+
const w = y.value;
|
|
657
|
+
if (w != null && w.toggleRowSelection)
|
|
658
658
|
for (const le of f.value) {
|
|
659
|
-
const
|
|
660
|
-
if (
|
|
661
|
-
const ge = String(
|
|
662
|
-
(
|
|
659
|
+
const te = S(le);
|
|
660
|
+
if (te == null) continue;
|
|
661
|
+
const ge = String(te);
|
|
662
|
+
(ae = o.dataSource.disabledCheckedRowKeys) != null && ae.includes(ge) && w.toggleRowSelection(le, !0);
|
|
663
663
|
}
|
|
664
|
-
},
|
|
664
|
+
}, Je = async () => {
|
|
665
665
|
await O(o.dataSource.columns), await k(), await g(), await n();
|
|
666
666
|
};
|
|
667
|
-
return
|
|
668
|
-
const
|
|
667
|
+
return Fe(() => Je()), l({ refreshTable: H, getSelection: m, initData: Je, getQueryParams: E }), (w, N) => {
|
|
668
|
+
const ae = et, le = Ye, te = ia, ge = da, Se = ua, Ka = Ca, Wa = Da, qa = Ne, Ce = De, Qa = at, Ga = Za, Ja = lt, Te = Va("hasPermi"), Xa = tt;
|
|
669
669
|
return s(), T("div", null, [
|
|
670
|
-
de((s(), h(
|
|
670
|
+
de((s(), h(Ga, {
|
|
671
671
|
ref_key: "curdTableRef",
|
|
672
672
|
ref: y,
|
|
673
673
|
data: r(f),
|
|
674
674
|
"row-key": o.dataSource.rowKey,
|
|
675
|
-
"element-loading-text":
|
|
675
|
+
"element-loading-text": w.$t("數據加載中..."),
|
|
676
676
|
stripe: "",
|
|
677
677
|
"tree-props": o.dataSource.treeProps,
|
|
678
678
|
"default-sort": r(P),
|
|
@@ -684,17 +684,17 @@ const Ka = (e) => {
|
|
|
684
684
|
"highlight-current-row": ""
|
|
685
685
|
}, {
|
|
686
686
|
empty: b(() => [
|
|
687
|
-
re("div",
|
|
687
|
+
re("div", Zt, M(w.$t("未查詢到數據")), 1)
|
|
688
688
|
]),
|
|
689
689
|
default: b(() => [
|
|
690
|
-
o.dataSource.showSelection ? (s(), h(
|
|
690
|
+
o.dataSource.showSelection ? (s(), h(ae, {
|
|
691
691
|
key: 0,
|
|
692
692
|
type: "selection",
|
|
693
693
|
width: "60",
|
|
694
694
|
selectable: C,
|
|
695
695
|
align: "center"
|
|
696
696
|
})) : Z("", !0),
|
|
697
|
-
o.dataSource.showIndex ? (s(), h(
|
|
697
|
+
o.dataSource.showIndex ? (s(), h(ae, {
|
|
698
698
|
key: 1,
|
|
699
699
|
type: "index",
|
|
700
700
|
width: "70",
|
|
@@ -704,7 +704,7 @@ const Ka = (e) => {
|
|
|
704
704
|
(s(!0), T(z, null, Q(o.dataSource.columns, (v) => (s(), T(z, {
|
|
705
705
|
key: v.prop || v.key
|
|
706
706
|
}, [
|
|
707
|
-
v.width !== 0 && _(v) ? (s(), h(
|
|
707
|
+
v.width !== 0 && _(v) ? (s(), h(ae, {
|
|
708
708
|
key: 0,
|
|
709
709
|
label: v.label,
|
|
710
710
|
width: se(v),
|
|
@@ -716,39 +716,39 @@ const Ka = (e) => {
|
|
|
716
716
|
fixed: v.fixed
|
|
717
717
|
}, {
|
|
718
718
|
default: b(({ row: B }) => [
|
|
719
|
-
v.slot ? Pe(
|
|
719
|
+
v.slot ? Pe(w.$slots, v.slot, {
|
|
720
720
|
key: 0,
|
|
721
721
|
row: B,
|
|
722
722
|
column: v,
|
|
723
723
|
value: B[v.prop]
|
|
724
|
-
}, void 0, !0) : v.type === "image" && B[v.prop] ? (s(), h(
|
|
724
|
+
}, void 0, !0) : v.type === "image" && B[v.prop] ? (s(), h(Ua, {
|
|
725
725
|
key: 1,
|
|
726
726
|
modelValue: B[v.prop],
|
|
727
727
|
"onUpdate:modelValue": (ie) => B[v.prop] = ie,
|
|
728
728
|
class: "image-preview",
|
|
729
729
|
width: 24,
|
|
730
730
|
height: 24
|
|
731
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : v.type === "networkImage" ? (s(), T("view",
|
|
731
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : v.type === "networkImage" ? (s(), T("view", Gt, [
|
|
732
732
|
K(le, {
|
|
733
733
|
src: B[v.prop],
|
|
734
734
|
fit: "cover",
|
|
735
735
|
style: { height: "24px" }
|
|
736
736
|
}, null, 8, ["src"])
|
|
737
|
-
])) : v.type === "imageUrl" ? (s(), T("view",
|
|
737
|
+
])) : v.type === "imageUrl" ? (s(), T("view", Jt, [
|
|
738
738
|
K(le, {
|
|
739
739
|
src: B[v.prop],
|
|
740
740
|
fit: "cover",
|
|
741
741
|
style: { height: "24px" }
|
|
742
742
|
}, null, 8, ["src"])
|
|
743
743
|
])) : v.type === "date" ? (s(), T(z, { key: 4 }, [
|
|
744
|
-
L(M(
|
|
744
|
+
L(M(w.parseTime(B[v.prop], "{y}-{m}-{d}")), 1)
|
|
745
745
|
], 64)) : v.type === "timestamp" ? (s(), T(z, { key: 5 }, [
|
|
746
|
-
L(M(
|
|
747
|
-
], 64)) : v.type === "bool" ? (s(), h(
|
|
746
|
+
L(M(w.parseTime(B[v.prop])), 1)
|
|
747
|
+
], 64)) : v.type === "bool" ? (s(), h(te, {
|
|
748
748
|
key: 6,
|
|
749
749
|
modelValue: B[v.prop],
|
|
750
750
|
"onUpdate:modelValue": (ie) => B[v.prop] = ie,
|
|
751
|
-
onClick: N[0] || (N[0] =
|
|
751
|
+
onClick: N[0] || (N[0] = it(() => {
|
|
752
752
|
}, ["stop", "prevent"]))
|
|
753
753
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : v.type === "switch" ? (s(), h(ge, {
|
|
754
754
|
key: 7,
|
|
@@ -758,7 +758,7 @@ const Ka = (e) => {
|
|
|
758
758
|
"inactive-value": v.inactiveValue || "1",
|
|
759
759
|
size: "small",
|
|
760
760
|
"before-change": () => !1
|
|
761
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "active-value", "inactive-value"])) : v.type === "color" ? (s(), T("div",
|
|
761
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "active-value", "inactive-value"])) : v.type === "color" ? (s(), T("div", Xt, [
|
|
762
762
|
re("div", {
|
|
763
763
|
class: "color-cell-item",
|
|
764
764
|
style: fe({ backgroundColor: B[v.prop] || "#ffffff" })
|
|
@@ -821,18 +821,18 @@ const Ka = (e) => {
|
|
|
821
821
|
L(M(ie[v.tagLabel]), 1)
|
|
822
822
|
]),
|
|
823
823
|
_: 2
|
|
824
|
-
}, 1032, ["type", "effect"]))), 128)) : v.type === "dictTag" || v.type === "commonDictTag" ? (s(), h(
|
|
824
|
+
}, 1032, ["type", "effect"]))), 128)) : v.type === "dictTag" || v.type === "commonDictTag" ? (s(), h(Ka, {
|
|
825
825
|
key: 15,
|
|
826
826
|
options: v.data || [],
|
|
827
827
|
value: B[v.prop]
|
|
828
|
-
}, null, 8, ["options", "value"])) : v.type === "dictText" || v.type === "commonDictText" ? (s(), h(
|
|
828
|
+
}, null, 8, ["options", "value"])) : v.type === "dictText" || v.type === "commonDictText" ? (s(), h(Wa, {
|
|
829
829
|
key: 16,
|
|
830
830
|
options: v.data || [],
|
|
831
831
|
value: B[v.prop]
|
|
832
|
-
}, null, 8, ["options", "value"])) : v.type === "svg" ? (s(), h(
|
|
832
|
+
}, null, 8, ["options", "value"])) : v.type === "svg" ? (s(), h(qa, {
|
|
833
833
|
key: 17,
|
|
834
834
|
"icon-class": B.icon
|
|
835
|
-
}, null, 8, ["icon-class"])) : v.type === "ossFile" ? (s(), h(
|
|
835
|
+
}, null, 8, ["icon-class"])) : v.type === "ossFile" ? (s(), h(Aa, {
|
|
836
836
|
key: 18,
|
|
837
837
|
data: B,
|
|
838
838
|
width: 32,
|
|
@@ -844,15 +844,15 @@ const Ka = (e) => {
|
|
|
844
844
|
_: 2
|
|
845
845
|
}, 1032, ["label", "width", "min-width", "prop", "align", "sortable", "show-overflow-tooltip", "fixed"])) : Z("", !0)
|
|
846
846
|
], 64))), 128)),
|
|
847
|
-
r(d).length > 0 ? (s(), h(
|
|
847
|
+
r(d).length > 0 ? (s(), h(ae, {
|
|
848
848
|
key: 2,
|
|
849
849
|
align: "center",
|
|
850
850
|
fixed: "right",
|
|
851
|
-
label:
|
|
851
|
+
label: w.$t("操作"),
|
|
852
852
|
width: r(A)
|
|
853
853
|
}, {
|
|
854
854
|
default: b(({ row: v }) => [
|
|
855
|
-
(s(!0), T(z, null, Q(r(d), (B) => (s(), h(
|
|
855
|
+
(s(!0), T(z, null, Q(r(d), (B) => (s(), h(Qa, {
|
|
856
856
|
content: B.text,
|
|
857
857
|
placement: "top",
|
|
858
858
|
key: B.action
|
|
@@ -906,9 +906,9 @@ const Ka = (e) => {
|
|
|
906
906
|
]),
|
|
907
907
|
_: 3
|
|
908
908
|
}, 8, ["data", "row-key", "element-loading-text", "tree-props", "default-sort", "onSortChange", "default-expand-all", "max-height"])), [
|
|
909
|
-
[
|
|
909
|
+
[Xa, r(V)]
|
|
910
910
|
]),
|
|
911
|
-
o.dataSource.paging !== !1 ? (s(), h(
|
|
911
|
+
o.dataSource.paging !== !1 ? (s(), h(Ja, {
|
|
912
912
|
key: 0,
|
|
913
913
|
class: "paging",
|
|
914
914
|
background: "",
|
|
@@ -924,7 +924,7 @@ const Ka = (e) => {
|
|
|
924
924
|
]);
|
|
925
925
|
};
|
|
926
926
|
}
|
|
927
|
-
}),
|
|
927
|
+
}), la = /* @__PURE__ */ be(el, [["__scopeId", "data-v-c59f4080"]]), al = { class: "upload-file" }, tl = {
|
|
928
928
|
key: 0,
|
|
929
929
|
class: "el-upload__tip"
|
|
930
930
|
}, ll = { style: { color: "#f56c6c" } }, ol = { style: { color: "#f56c6c" } }, rl = { class: "el-icon-document" }, nl = { class: "ele-upload-list__item-content-action" }, sl = /* @__PURE__ */ pe({
|
|
@@ -944,36 +944,36 @@ const Ka = (e) => {
|
|
|
944
944
|
},
|
|
945
945
|
emits: ["update:modelValue"],
|
|
946
946
|
setup(e, { emit: l }) {
|
|
947
|
-
const
|
|
948
|
-
() =>
|
|
947
|
+
const t = e, { proxy: a } = he(), c = l, o = I(0), i = I([]), y = qe(), f = I(y + "/resource/oss/upload"), V = I(We()), p = I([]), R = J(
|
|
948
|
+
() => t.showTip && (t.fileType || t.fileSize)
|
|
949
949
|
), D = I();
|
|
950
|
-
Ve(() =>
|
|
950
|
+
Ve(() => t.modelValue, async (E) => {
|
|
951
951
|
if (E) {
|
|
952
|
-
if (!
|
|
952
|
+
if (!t.showFileList) return;
|
|
953
953
|
let O = 1, W = [];
|
|
954
|
-
Array.isArray(E) ? W = E : W = (await
|
|
954
|
+
Array.isArray(E) ? W = E : W = (await Qe(E)).data.map((d) => ({ name: d.originalName, url: d.url, ossId: d.ossId })), p.value = W.map((S) => (S = { name: S.name, url: S.url, ossId: S.ossId }, S.uid = S.uid || (/* @__PURE__ */ new Date()).getTime() + O++, S));
|
|
955
955
|
} else
|
|
956
956
|
return p.value = [], [];
|
|
957
957
|
}, { deep: !0, immediate: !0 });
|
|
958
958
|
const j = (E) => {
|
|
959
|
-
if (
|
|
959
|
+
if (t.fileType.length) {
|
|
960
960
|
const O = E.name.split("."), W = O[O.length - 1];
|
|
961
|
-
if (!(
|
|
962
|
-
return
|
|
961
|
+
if (!(t.fileType.indexOf(W) >= 0))
|
|
962
|
+
return a == null || a.$modal.msgError(`文件格式不正確, 請上傳${t.fileType.join("/")}格式文件!`), !1;
|
|
963
963
|
}
|
|
964
|
-
return
|
|
964
|
+
return t.fileSize && !(E.size / 1024 / 1024 < t.fileSize) ? (a == null || a.$modal.msgError(`上傳文件大小不超過 ${t.fileSize} MB!`), !1) : (a == null || a.$modal.loading("正在上傳文件,請稍等..."), o.value++, !0);
|
|
965
965
|
}, P = () => {
|
|
966
|
-
|
|
966
|
+
a == null || a.$modal.msgError(`上傳文件數量不能超過 ${t.limit} 个!`);
|
|
967
967
|
}, H = () => {
|
|
968
|
-
|
|
968
|
+
a == null || a.$modal.msgError("上傳文件失敗");
|
|
969
969
|
}, X = (E, O) => {
|
|
970
970
|
var W;
|
|
971
|
-
E.code === 200 ? (i.value.push({ name: E.data.fileName, url: E.data.url, ossId: E.data.ossId }), $()) : (o.value--,
|
|
971
|
+
E.code === 200 ? (i.value.push({ name: E.data.fileName, url: E.data.url, ossId: E.data.ossId }), $()) : (o.value--, a == null || a.$modal.closeLoading(), a == null || a.$modal.msgError(E.msg), (W = D.value) == null || W.handleRemove(O), $());
|
|
972
972
|
}, ee = (E) => {
|
|
973
973
|
const O = p.value[E].ossId;
|
|
974
|
-
|
|
974
|
+
Ea(O), p.value.splice(E, 1), c("update:modelValue", k(p.value));
|
|
975
975
|
}, $ = () => {
|
|
976
|
-
o.value > 0 && i.value.length === o.value && (p.value = p.value.filter((E) => E.url !== void 0).concat(i.value), i.value = [], o.value = 0, c("update:modelValue", k(p.value)),
|
|
976
|
+
o.value > 0 && i.value.length === o.value && (p.value = p.value.filter((E) => E.url !== void 0).concat(i.value), i.value = [], o.value = 0, c("update:modelValue", k(p.value)), a == null || a.$modal.closeLoading());
|
|
977
977
|
}, U = (E) => E.lastIndexOf("/") > -1 ? E.slice(E.lastIndexOf("/") + 1) : E, k = (E, O) => {
|
|
978
978
|
let W = "";
|
|
979
979
|
return O = O || ",", E.forEach((S) => {
|
|
@@ -981,8 +981,8 @@ const Ka = (e) => {
|
|
|
981
981
|
}), W != "" ? W.substring(0, W.length - 1) : "";
|
|
982
982
|
};
|
|
983
983
|
return (E, O) => {
|
|
984
|
-
const W = De, S =
|
|
985
|
-
return s(), T("div",
|
|
984
|
+
const W = De, S = Re, d = ot;
|
|
985
|
+
return s(), T("div", al, [
|
|
986
986
|
K(S, {
|
|
987
987
|
multiple: "",
|
|
988
988
|
action: r(f),
|
|
@@ -993,7 +993,7 @@ const Ka = (e) => {
|
|
|
993
993
|
"on-exceed": P,
|
|
994
994
|
"on-success": X,
|
|
995
995
|
"show-file-list": !1,
|
|
996
|
-
headers: r(
|
|
996
|
+
headers: r(V),
|
|
997
997
|
class: "upload-file-uploader",
|
|
998
998
|
ref_key: "fileUploadRef",
|
|
999
999
|
ref: D
|
|
@@ -1008,7 +1008,7 @@ const Ka = (e) => {
|
|
|
1008
1008
|
]),
|
|
1009
1009
|
_: 1
|
|
1010
1010
|
}, 8, ["action", "file-list", "limit", "headers"]),
|
|
1011
|
-
r(R) ? (s(), T("div",
|
|
1011
|
+
r(R) ? (s(), T("div", tl, [
|
|
1012
1012
|
O[3] || (O[3] = L(" 請上傳 ")),
|
|
1013
1013
|
e.fileSize ? (s(), T(z, { key: 0 }, [
|
|
1014
1014
|
O[1] || (O[1] = L(" 大小不超過 ")),
|
|
@@ -1020,7 +1020,7 @@ const Ka = (e) => {
|
|
|
1020
1020
|
], 64)) : Z("", !0),
|
|
1021
1021
|
O[4] || (O[4] = L(" 的文件 "))
|
|
1022
1022
|
])) : Z("", !0),
|
|
1023
|
-
e.showFileList ? (s(), h(
|
|
1023
|
+
e.showFileList ? (s(), h(dt, {
|
|
1024
1024
|
key: 1,
|
|
1025
1025
|
class: "upload-file-list el-upload-list el-upload-list--text",
|
|
1026
1026
|
name: "el-fade-in-linear",
|
|
@@ -1060,7 +1060,7 @@ const Ka = (e) => {
|
|
|
1060
1060
|
]);
|
|
1061
1061
|
};
|
|
1062
1062
|
}
|
|
1063
|
-
}),
|
|
1063
|
+
}), La = /* @__PURE__ */ be(sl, [["__scopeId", "data-v-027e6121"]]), cl = {
|
|
1064
1064
|
key: 0,
|
|
1065
1065
|
class: "el-upload__tip"
|
|
1066
1066
|
}, ul = { style: { color: "#f56c6c" } }, il = { style: { color: "#f56c6c" } }, dl = { style: { color: "#f56c6c" } }, pl = ["src"], fl = /* @__PURE__ */ pe({
|
|
@@ -1095,16 +1095,16 @@ const Ka = (e) => {
|
|
|
1095
1095
|
},
|
|
1096
1096
|
emits: ["update:modelValue"],
|
|
1097
1097
|
setup(e, { emit: l }) {
|
|
1098
|
-
|
|
1099
|
-
"9d14746a":
|
|
1098
|
+
pt((S) => ({
|
|
1099
|
+
"9d14746a": t.height
|
|
1100
1100
|
}));
|
|
1101
|
-
const
|
|
1101
|
+
const t = e, { proxy: a } = he(), c = l, o = I(0), i = I([]), y = I(""), f = I(!1), V = qe(), p = I(V + "/resource/oss/upload"), R = I(We()), D = I([]), j = J(() => t.isShowTip && (t.fileType || t.fileSize || t.imageSize)), P = I(), H = J(() => t.fileType.map((S) => `.${S}`).join(","));
|
|
1102
1102
|
Ve(
|
|
1103
|
-
() =>
|
|
1103
|
+
() => t.modelValue,
|
|
1104
1104
|
async (S) => {
|
|
1105
1105
|
if (S) {
|
|
1106
1106
|
let d = [];
|
|
1107
|
-
Array.isArray(S) ? d = S : d = (await
|
|
1107
|
+
Array.isArray(S) ? d = S : d = (await Qe(S)).data, D.value = d.map((C) => {
|
|
1108
1108
|
let A;
|
|
1109
1109
|
return typeof C == "string" ? A = { name: C, url: C } : A = { name: C.ossId, url: C.url, ossId: C.ossId }, A;
|
|
1110
1110
|
});
|
|
@@ -1115,36 +1115,36 @@ const Ka = (e) => {
|
|
|
1115
1115
|
);
|
|
1116
1116
|
const X = (S) => {
|
|
1117
1117
|
let d = !1;
|
|
1118
|
-
if (
|
|
1118
|
+
if (t.fileType.length) {
|
|
1119
1119
|
let C = "";
|
|
1120
|
-
S.name.lastIndexOf(".") > -1 && (C = S.name.slice(S.name.lastIndexOf(".") + 1)), d =
|
|
1120
|
+
S.name.lastIndexOf(".") > -1 && (C = S.name.slice(S.name.lastIndexOf(".") + 1)), d = t.fileType.some((A) => !!(S.type.indexOf(A) > -1 || C && C.indexOf(A) > -1));
|
|
1121
1121
|
} else
|
|
1122
1122
|
d = S.type.indexOf("image") > -1;
|
|
1123
1123
|
if (!d)
|
|
1124
|
-
return
|
|
1124
|
+
return a == null || a.$modal.msgError(`文件格式不正確, 請上傳${t.fileType.join("/")}圖片格式文件!`), !1;
|
|
1125
1125
|
if (S.name.includes(","))
|
|
1126
|
-
return
|
|
1127
|
-
if (
|
|
1128
|
-
return
|
|
1129
|
-
if (
|
|
1130
|
-
return
|
|
1131
|
-
|
|
1126
|
+
return a == null || a.$modal.msgError("文件名不正確,不能包含英文逗號!"), !1;
|
|
1127
|
+
if (t.fileSize && !(S.size / 1024 / 1024 < t.fileSize))
|
|
1128
|
+
return a == null || a.$modal.msgError(`上傳圖片大小不能超過 ${t.fileSize} MB!`), !1;
|
|
1129
|
+
if (t.compressSupport && S.size / 1024 > t.compressTargetSize)
|
|
1130
|
+
return a == null || a.$modal.loading("正在上傳圖片,請稍候..."), o.value++, bt(S, t.compressTargetSize);
|
|
1131
|
+
a == null || a.$modal.loading("正在上傳圖片,請稍候..."), o.value++;
|
|
1132
1132
|
}, ee = () => {
|
|
1133
|
-
|
|
1133
|
+
a == null || a.$modal.msgError(`上傳文件數量不能超過 ${t.limit} 個!`);
|
|
1134
1134
|
}, $ = (S, d) => {
|
|
1135
1135
|
var C;
|
|
1136
|
-
S.code === 200 ? (i.value.push({ name: S.data.fileName, url: S.data.url, ossId: S.data.ossId }), k()) : (o.value--,
|
|
1136
|
+
S.code === 200 ? (i.value.push({ name: S.data.fileName, url: S.data.url, ossId: S.data.ossId }), k()) : (o.value--, a == null || a.$modal.closeLoading(), a == null || a.$modal.msgError(S.msg), (C = P.value) == null || C.handleRemove(d), k());
|
|
1137
1137
|
}, U = (S) => {
|
|
1138
1138
|
const d = D.value.map((C) => C.name).indexOf(S.name);
|
|
1139
1139
|
if (d > -1 && i.value.length === o.value) {
|
|
1140
1140
|
const C = D.value[d].ossId;
|
|
1141
|
-
return
|
|
1141
|
+
return Ea(C), D.value.splice(d, 1), c("update:modelValue", W(D.value)), !1;
|
|
1142
1142
|
}
|
|
1143
1143
|
return !0;
|
|
1144
1144
|
}, k = () => {
|
|
1145
|
-
o.value > 0 && i.value.length === o.value && (D.value = D.value.filter((S) => S.url !== void 0).concat(i.value), i.value = [], o.value = 0, c("update:modelValue", W(D.value)),
|
|
1145
|
+
o.value > 0 && i.value.length === o.value && (D.value = D.value.filter((S) => S.url !== void 0).concat(i.value), i.value = [], o.value = 0, c("update:modelValue", W(D.value)), a == null || a.$modal.closeLoading());
|
|
1146
1146
|
}, E = () => {
|
|
1147
|
-
|
|
1147
|
+
a == null || a.$modal.msgError("上傳圖片失敗"), a == null || a.$modal.closeLoading();
|
|
1148
1148
|
}, O = (S) => {
|
|
1149
1149
|
y.value = S.url, f.value = !0;
|
|
1150
1150
|
}, W = (S, d) => {
|
|
@@ -1155,7 +1155,7 @@ const Ka = (e) => {
|
|
|
1155
1155
|
return C != "" ? C.substring(0, C.length - 1) : "";
|
|
1156
1156
|
};
|
|
1157
1157
|
return (S, d) => {
|
|
1158
|
-
const C =
|
|
1158
|
+
const C = ft("plus"), A = Me, F = Re, G = pa;
|
|
1159
1159
|
return s(), T("div", null, [
|
|
1160
1160
|
K(F, {
|
|
1161
1161
|
ref_key: "imageUploadRef",
|
|
@@ -1174,7 +1174,7 @@ const Ka = (e) => {
|
|
|
1174
1174
|
headers: r(R),
|
|
1175
1175
|
"file-list": r(D),
|
|
1176
1176
|
"on-preview": O,
|
|
1177
|
-
class:
|
|
1177
|
+
class: He({ hide: r(D).length >= e.limit })
|
|
1178
1178
|
}, {
|
|
1179
1179
|
default: b(() => [
|
|
1180
1180
|
K(A, { class: "avatar-uploader-icon" }, {
|
|
@@ -1226,7 +1226,7 @@ const Ka = (e) => {
|
|
|
1226
1226
|
]);
|
|
1227
1227
|
};
|
|
1228
1228
|
}
|
|
1229
|
-
}),
|
|
1229
|
+
}), za = /* @__PURE__ */ be(fl, [["__scopeId", "data-v-c17cf859"]]), hl = (e) => ke()({
|
|
1230
1230
|
url: "/app/translation/getByName",
|
|
1231
1231
|
method: "post",
|
|
1232
1232
|
headers: {
|
|
@@ -1237,7 +1237,7 @@ const Ka = (e) => {
|
|
|
1237
1237
|
url: "/app/translation/batchAdd",
|
|
1238
1238
|
method: "post",
|
|
1239
1239
|
data: e
|
|
1240
|
-
}),
|
|
1240
|
+
}), oa = Sa("translation", () => {
|
|
1241
1241
|
const e = I([]);
|
|
1242
1242
|
return {
|
|
1243
1243
|
translation: e,
|
|
@@ -1264,22 +1264,22 @@ const Ka = (e) => {
|
|
|
1264
1264
|
}
|
|
1265
1265
|
};
|
|
1266
1266
|
}), yl = async (e) => {
|
|
1267
|
-
const l = I({}),
|
|
1268
|
-
if (
|
|
1269
|
-
l.value[e] =
|
|
1267
|
+
const l = I({}), t = oa().getTranslation(e);
|
|
1268
|
+
if (t)
|
|
1269
|
+
l.value[e] = t;
|
|
1270
1270
|
else {
|
|
1271
|
-
const { data:
|
|
1272
|
-
l.value[e] =
|
|
1271
|
+
const { data: a } = await hl(e);
|
|
1272
|
+
l.value[e] = a, oa().setTranslation(e, a);
|
|
1273
1273
|
}
|
|
1274
1274
|
return l.value;
|
|
1275
|
-
}, gl = { style: { width: "100%" } }, bl = { style: { "margin-bottom": "2px" } },
|
|
1275
|
+
}, gl = { style: { width: "100%" } }, bl = { style: { "margin-bottom": "2px" } }, Ba = /* @__PURE__ */ pe({
|
|
1276
1276
|
__name: "index",
|
|
1277
1277
|
props: ["modelValue", "placeholder", "disabled", "type", "rows", "showWordLimit", "maxlength"],
|
|
1278
1278
|
emits: ["update:modelValue", "focus"],
|
|
1279
|
-
setup(e, { expose: l, emit:
|
|
1280
|
-
const
|
|
1281
|
-
P.text = H, P.id == "zhHk" &&
|
|
1282
|
-
},
|
|
1279
|
+
setup(e, { expose: l, emit: t }) {
|
|
1280
|
+
const a = t, c = e, o = I([{ name: "繁體", id: "zhHk", selected: !0, text: "" }, { name: "簡體", id: "zhCn", selected: !1, text: "" }, { name: "英文", id: "enUs", selected: !1, text: "" }]), i = I(!1), y = I(!1), f = (P, H) => {
|
|
1281
|
+
P.text = H, P.id == "zhHk" && a("update:modelValue", H);
|
|
1282
|
+
}, V = async (P) => {
|
|
1283
1283
|
P.id == "zhHk" && await p();
|
|
1284
1284
|
}, p = async () => {
|
|
1285
1285
|
if (i.value) return;
|
|
@@ -1300,7 +1300,7 @@ const Ka = (e) => {
|
|
|
1300
1300
|
}, D = () => {
|
|
1301
1301
|
const P = { name: o.value[0].text };
|
|
1302
1302
|
return o.value.forEach((H) => P[H.id] = H.text), P;
|
|
1303
|
-
}, j = () =>
|
|
1303
|
+
}, j = () => a("focus");
|
|
1304
1304
|
return Ve(() => c.modelValue, (P) => {
|
|
1305
1305
|
if (P) {
|
|
1306
1306
|
const H = o.value.filter((X) => X.selected)[0];
|
|
@@ -1310,7 +1310,7 @@ const Ka = (e) => {
|
|
|
1310
1310
|
immediate: !0,
|
|
1311
1311
|
deep: !0
|
|
1312
1312
|
}), l({ getTranslate: D }), (P, H) => {
|
|
1313
|
-
const X = De, ee =
|
|
1313
|
+
const X = De, ee = je;
|
|
1314
1314
|
return s(), T("div", gl, [
|
|
1315
1315
|
re("div", bl, [
|
|
1316
1316
|
(s(!0), T(z, null, Q(r(o), ($) => (s(), h(X, {
|
|
@@ -1337,15 +1337,15 @@ const Ka = (e) => {
|
|
|
1337
1337
|
"show-word-limit": c.showWordLimit,
|
|
1338
1338
|
maxlength: c.maxlength,
|
|
1339
1339
|
onInput: (U) => f($, U),
|
|
1340
|
-
onBlur: (U) =>
|
|
1340
|
+
onBlur: (U) => V($),
|
|
1341
1341
|
onFocus: H[0] || (H[0] = (U) => j())
|
|
1342
1342
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "disabled", "rows", "show-word-limit", "maxlength", "onInput", "onBlur"])), [
|
|
1343
|
-
[
|
|
1343
|
+
[ht, $.selected]
|
|
1344
1344
|
])), 128))
|
|
1345
1345
|
]);
|
|
1346
1346
|
};
|
|
1347
1347
|
}
|
|
1348
|
-
}), vl = { class: "editor" },
|
|
1348
|
+
}), vl = { class: "editor" }, Ya = /* @__PURE__ */ pe({
|
|
1349
1349
|
__name: "index",
|
|
1350
1350
|
props: {
|
|
1351
1351
|
/* 编辑器的内容 */
|
|
@@ -1363,9 +1363,9 @@ const Ka = (e) => {
|
|
|
1363
1363
|
},
|
|
1364
1364
|
emits: ["update:modelValue"],
|
|
1365
1365
|
setup(e) {
|
|
1366
|
-
const l = e, { proxy:
|
|
1367
|
-
headers:
|
|
1368
|
-
url:
|
|
1366
|
+
const l = e, { proxy: t } = he(), a = mt({
|
|
1367
|
+
headers: We(),
|
|
1368
|
+
url: qe() + "/resource/oss/upload"
|
|
1369
1369
|
}), c = I(), o = I(), i = I({
|
|
1370
1370
|
theme: "snow",
|
|
1371
1371
|
bounds: document.body,
|
|
@@ -1397,7 +1397,7 @@ const Ka = (e) => {
|
|
|
1397
1397
|
],
|
|
1398
1398
|
handlers: {
|
|
1399
1399
|
image: (D) => {
|
|
1400
|
-
D ? o.value.click() :
|
|
1400
|
+
D ? o.value.click() : vt.format("image", !0);
|
|
1401
1401
|
}
|
|
1402
1402
|
}
|
|
1403
1403
|
}
|
|
@@ -1415,29 +1415,29 @@ const Ka = (e) => {
|
|
|
1415
1415
|
},
|
|
1416
1416
|
{ immediate: !0 }
|
|
1417
1417
|
);
|
|
1418
|
-
const
|
|
1418
|
+
const V = (D) => {
|
|
1419
1419
|
if (D.code === 200) {
|
|
1420
1420
|
const j = Oe(c.value).getQuill(), P = j.selection.savedRange.index;
|
|
1421
|
-
j.insertEmbed(P, "image", D.data.url), j.setSelection(P + 1),
|
|
1421
|
+
j.insertEmbed(P, "image", D.data.url), j.setSelection(P + 1), t == null || t.$modal.closeLoading();
|
|
1422
1422
|
} else
|
|
1423
|
-
|
|
1424
|
-
}, p = (D) => ["image/jpeg", "image/jpg", "image/png", "image/svg"].includes(D.type) ? l.fileSize && !(D.size / 1024 / 1024 < l.fileSize) ? (
|
|
1425
|
-
|
|
1423
|
+
t == null || t.$modal.msgError("图片插入失败"), t == null || t.$modal.closeLoading();
|
|
1424
|
+
}, p = (D) => ["image/jpeg", "image/jpg", "image/png", "image/svg"].includes(D.type) ? l.fileSize && !(D.size / 1024 / 1024 < l.fileSize) ? (t == null || t.$modal.msgError(`上传文件大小不能超过 ${l.fileSize} MB!`), !1) : (t == null || t.$modal.loading("正在上传文件,请稍候..."), !0) : (t == null || t.$modal.msgError("图片格式错误!"), !1), R = (D) => {
|
|
1425
|
+
t == null || t.$modal.msgError("上传文件失败");
|
|
1426
1426
|
};
|
|
1427
1427
|
return (D, j) => {
|
|
1428
|
-
const P =
|
|
1428
|
+
const P = Re;
|
|
1429
1429
|
return s(), T(z, null, [
|
|
1430
1430
|
re("div", null, [
|
|
1431
1431
|
e.type === "url" ? (s(), h(P, {
|
|
1432
1432
|
key: 0,
|
|
1433
|
-
action: r(
|
|
1433
|
+
action: r(a).url,
|
|
1434
1434
|
"before-upload": p,
|
|
1435
|
-
"on-success":
|
|
1435
|
+
"on-success": V,
|
|
1436
1436
|
"on-error": R,
|
|
1437
1437
|
class: "editor-img-uploader",
|
|
1438
1438
|
name: "file",
|
|
1439
1439
|
"show-file-list": !1,
|
|
1440
|
-
headers: r(
|
|
1440
|
+
headers: r(a).headers
|
|
1441
1441
|
}, {
|
|
1442
1442
|
default: b(() => [
|
|
1443
1443
|
re("i", {
|
|
@@ -1449,7 +1449,7 @@ const Ka = (e) => {
|
|
|
1449
1449
|
}, 8, ["action", "headers"])) : Z("", !0)
|
|
1450
1450
|
]),
|
|
1451
1451
|
re("div", vl, [
|
|
1452
|
-
K(r(
|
|
1452
|
+
K(r(kt), {
|
|
1453
1453
|
ref_key: "quillEditorRef",
|
|
1454
1454
|
ref: c,
|
|
1455
1455
|
content: r(f),
|
|
@@ -1467,115 +1467,115 @@ const Ka = (e) => {
|
|
|
1467
1467
|
function kl(e, l) {
|
|
1468
1468
|
if (arguments.length === 0 || !e)
|
|
1469
1469
|
return null;
|
|
1470
|
-
const
|
|
1471
|
-
let
|
|
1472
|
-
typeof e == "object" ?
|
|
1470
|
+
const t = l || "{y}-{m}-{d} {h}:{i}:{s}";
|
|
1471
|
+
let a;
|
|
1472
|
+
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));
|
|
1473
1473
|
const c = {
|
|
1474
|
-
y:
|
|
1475
|
-
m:
|
|
1476
|
-
d:
|
|
1477
|
-
h:
|
|
1478
|
-
i:
|
|
1479
|
-
s:
|
|
1480
|
-
a:
|
|
1474
|
+
y: a.getFullYear(),
|
|
1475
|
+
m: a.getMonth() + 1,
|
|
1476
|
+
d: a.getDate(),
|
|
1477
|
+
h: a.getHours(),
|
|
1478
|
+
i: a.getMinutes(),
|
|
1479
|
+
s: a.getSeconds(),
|
|
1480
|
+
a: a.getDay()
|
|
1481
1481
|
};
|
|
1482
|
-
return
|
|
1482
|
+
return t.replace(/{(y|m|d|h|i|s|a)+}/g, (o, i) => {
|
|
1483
1483
|
let y = c[i];
|
|
1484
1484
|
return i === "a" ? ["日", "一", "二", "三", "四", "五", "六"][y] : (o.length > 0 && y < 10 && (y = "0" + y), y || 0);
|
|
1485
1485
|
});
|
|
1486
1486
|
}
|
|
1487
|
-
const _l = (e, l,
|
|
1488
|
-
const
|
|
1489
|
-
return
|
|
1487
|
+
const _l = (e, l, t) => {
|
|
1488
|
+
const a = e;
|
|
1489
|
+
return a.params = typeof a.params == "object" && a.params !== null && !Array.isArray(a.params) ? a.params : {}, l = Array.isArray(l) ? l : [], l[0] && l[0].length == 10 && (l[0] = l[0] + " 00:00:00", l[1] = l[1] + " 23:59:59"), typeof t > "u" ? (a.params.beginTime = l[0], a.params.endTime = l[1]) : (t = t.charAt(0).toUpperCase() + t.slice(1), a.params["begin" + t] = l[0], a.params["end" + t] = l[1]), a;
|
|
1490
1490
|
}, wl = (e, l) => {
|
|
1491
1491
|
if (l === void 0)
|
|
1492
1492
|
return "";
|
|
1493
|
-
const
|
|
1494
|
-
return Object.keys(e).some((
|
|
1495
|
-
if (e[
|
|
1496
|
-
return
|
|
1497
|
-
}),
|
|
1498
|
-
}, Vl = (e, l,
|
|
1493
|
+
const t = [];
|
|
1494
|
+
return Object.keys(e).some((a) => {
|
|
1495
|
+
if (e[a].value == "" + l)
|
|
1496
|
+
return t.push(e[a].label), !0;
|
|
1497
|
+
}), t.length === 0 && t.push(l), t.join("");
|
|
1498
|
+
}, Vl = (e, l, t) => {
|
|
1499
1499
|
if (l === void 0 || l.length === 0)
|
|
1500
1500
|
return "";
|
|
1501
1501
|
Array.isArray(l) && (l = l.join(","));
|
|
1502
|
-
const
|
|
1502
|
+
const a = [], c = t === void 0 ? "," : t, o = l.split(c);
|
|
1503
1503
|
return Object.keys(l.split(c)).some((i) => {
|
|
1504
1504
|
let y = !1;
|
|
1505
1505
|
Object.keys(e).some((f) => {
|
|
1506
|
-
e[f].value == "" + o[i] && (
|
|
1507
|
-
}), y ||
|
|
1508
|
-
}),
|
|
1509
|
-
}, Sl = (e, l,
|
|
1506
|
+
e[f].value == "" + o[i] && (a.push(e[f].label + c), y = !0);
|
|
1507
|
+
}), y || a.push(o[i] + c);
|
|
1508
|
+
}), a.join("").substring(0, a.join("").length - 1);
|
|
1509
|
+
}, Sl = (e, l, t, a) => {
|
|
1510
1510
|
const c = {
|
|
1511
1511
|
id: l || "id",
|
|
1512
|
-
parentId:
|
|
1513
|
-
childrenList:
|
|
1512
|
+
parentId: t || "parentId",
|
|
1513
|
+
childrenList: a || "children"
|
|
1514
1514
|
}, o = {}, i = [];
|
|
1515
1515
|
for (const y of e) {
|
|
1516
1516
|
const f = y[c.id];
|
|
1517
1517
|
o[f] = y, y[c.childrenList] || (y[c.childrenList] = []);
|
|
1518
1518
|
}
|
|
1519
1519
|
for (const y of e) {
|
|
1520
|
-
const f = y[c.parentId],
|
|
1521
|
-
|
|
1520
|
+
const f = y[c.parentId], V = o[f];
|
|
1521
|
+
V ? V[c.childrenList].push(y) : i.push(y);
|
|
1522
1522
|
}
|
|
1523
1523
|
return i;
|
|
1524
1524
|
}, $l = (e) => {
|
|
1525
1525
|
let l = "";
|
|
1526
|
-
for (const
|
|
1527
|
-
const
|
|
1528
|
-
if (
|
|
1529
|
-
if (typeof
|
|
1530
|
-
for (const o of Object.keys(
|
|
1531
|
-
if (
|
|
1532
|
-
const i =
|
|
1533
|
-
l += y + encodeURIComponent(
|
|
1526
|
+
for (const t of Object.keys(e)) {
|
|
1527
|
+
const a = e[t], c = encodeURIComponent(t) + "=";
|
|
1528
|
+
if (a !== null && a !== "" && typeof a < "u")
|
|
1529
|
+
if (typeof a == "object") {
|
|
1530
|
+
for (const o of Object.keys(a))
|
|
1531
|
+
if (a[o] !== null && a[o] !== "" && typeof a[o] < "u") {
|
|
1532
|
+
const i = t + "[" + o + "]", y = encodeURIComponent(i) + "=";
|
|
1533
|
+
l += y + encodeURIComponent(a[o]) + "&";
|
|
1534
1534
|
}
|
|
1535
1535
|
} else
|
|
1536
|
-
l += c + encodeURIComponent(
|
|
1536
|
+
l += c + encodeURIComponent(a) + "&";
|
|
1537
1537
|
}
|
|
1538
1538
|
return l;
|
|
1539
|
-
}, Dl = (e) => e.type !== "application/json",
|
|
1539
|
+
}, Dl = (e) => e.type !== "application/json", Ma = (e) => {
|
|
1540
1540
|
if (!e && typeof e != "object")
|
|
1541
1541
|
throw new Error("error arguments", "deepClone");
|
|
1542
1542
|
const l = e.constructor === Array ? [] : {};
|
|
1543
|
-
return Object.keys(e).forEach((
|
|
1544
|
-
e[
|
|
1543
|
+
return Object.keys(e).forEach((t) => {
|
|
1544
|
+
e[t] && typeof e[t] == "object" ? l[t] = Ma(e[t]) : l[t] = e[t];
|
|
1545
1545
|
}), l;
|
|
1546
1546
|
};
|
|
1547
1547
|
function Cl(e, l) {
|
|
1548
|
-
const { proxy:
|
|
1549
|
-
const
|
|
1550
|
-
if (!
|
|
1551
|
-
switch (
|
|
1548
|
+
const { proxy: t } = he(), a = I({}), c = async (f) => {
|
|
1549
|
+
const V = f.form;
|
|
1550
|
+
if (!V) return "";
|
|
1551
|
+
switch (V.type) {
|
|
1552
1552
|
case "checkboxGroup":
|
|
1553
1553
|
case "checkboxDict":
|
|
1554
1554
|
return [];
|
|
1555
1555
|
case "treeSelectApi":
|
|
1556
|
-
if (
|
|
1557
|
-
const p = await
|
|
1558
|
-
if (
|
|
1559
|
-
const R =
|
|
1560
|
-
|
|
1556
|
+
if (V.api) {
|
|
1557
|
+
const p = await V.api({ pageNum: 1, pageSize: 1e3, ...V.apiParams });
|
|
1558
|
+
if (V.data = p.rows || p.data, V.data && Array.isArray(V.data) && !Array.isArray(V.defaultExpandedKeys) && V.autoExpandFirstLevel !== !1) {
|
|
1559
|
+
const R = V.props || { value: "id" }, D = V.valueKey || R.value || "id";
|
|
1560
|
+
V.defaultExpandedKeys = V.data.map((j) => j[D]);
|
|
1561
1561
|
}
|
|
1562
1562
|
}
|
|
1563
1563
|
return "";
|
|
1564
1564
|
case "radioApi":
|
|
1565
1565
|
case "selectApi":
|
|
1566
|
-
if (
|
|
1567
|
-
const p = await
|
|
1568
|
-
|
|
1566
|
+
if (V.api) {
|
|
1567
|
+
const p = await V.api({ pageNum: 1, pageSize: 1e3, ...V.apiParams });
|
|
1568
|
+
V.data = p.rows || p.data;
|
|
1569
1569
|
}
|
|
1570
1570
|
return "";
|
|
1571
1571
|
case "checkboxCommonDict":
|
|
1572
|
-
return
|
|
1572
|
+
return V.data = await (t == null ? void 0 : t.useOneCommonDict(V.dictType)), [];
|
|
1573
1573
|
case "radioCommonDict":
|
|
1574
1574
|
case "selectCommonDict":
|
|
1575
|
-
return
|
|
1575
|
+
return V.data = await (t == null ? void 0 : t.useOneCommonDict(V.dictType)), "";
|
|
1576
1576
|
case "radioDict":
|
|
1577
1577
|
case "selectDict":
|
|
1578
|
-
return
|
|
1578
|
+
return V.data = await (t == null ? void 0 : t.useOneDict(V.dictType)), "";
|
|
1579
1579
|
case "daterange":
|
|
1580
1580
|
case "timerange":
|
|
1581
1581
|
return [];
|
|
@@ -1584,17 +1584,17 @@ function Cl(e, l) {
|
|
|
1584
1584
|
}
|
|
1585
1585
|
}, o = async (f) => {
|
|
1586
1586
|
var D;
|
|
1587
|
-
let
|
|
1587
|
+
let V = {};
|
|
1588
1588
|
const p = e.columns, R = f !== void 0 ? f : l;
|
|
1589
1589
|
for (const j of p) {
|
|
1590
1590
|
const P = ((D = j.form) == null ? void 0 : D.prop) || j.prop;
|
|
1591
|
-
|
|
1591
|
+
V[P] = await c(j);
|
|
1592
1592
|
}
|
|
1593
1593
|
if (R && typeof R == "object") {
|
|
1594
|
-
const j =
|
|
1595
|
-
|
|
1594
|
+
const j = Ma(R);
|
|
1595
|
+
V = { ...V, ...j };
|
|
1596
1596
|
}
|
|
1597
|
-
e.initEditData && e.initEditData(
|
|
1597
|
+
e.initEditData && e.initEditData(V), e.beforeInitEdit && e.beforeInitEdit(V), i(V), a.value = V;
|
|
1598
1598
|
}, i = (f) => {
|
|
1599
1599
|
e.columns.forEach((p) => {
|
|
1600
1600
|
var j, P, H, X, ee;
|
|
@@ -1617,23 +1617,23 @@ function Cl(e, l) {
|
|
|
1617
1617
|
});
|
|
1618
1618
|
};
|
|
1619
1619
|
return {
|
|
1620
|
-
formData:
|
|
1620
|
+
formData: a,
|
|
1621
1621
|
initFormData: o,
|
|
1622
1622
|
prepareSaveData: async (f) => {
|
|
1623
|
-
const
|
|
1623
|
+
const V = { ...a.value, ...f };
|
|
1624
1624
|
if (e.columns.forEach((p) => {
|
|
1625
1625
|
var j, P, H, X;
|
|
1626
1626
|
const R = (j = p.form) == null ? void 0 : j.type, D = ((P = p.form) == null ? void 0 : P.prop) || p.prop;
|
|
1627
|
-
if ((R === "daterange" || R === "timerange") && Array.isArray(
|
|
1628
|
-
const ee =
|
|
1629
|
-
$ && U && ee.length >= 2 && (
|
|
1627
|
+
if ((R === "daterange" || R === "timerange") && Array.isArray(V[D])) {
|
|
1628
|
+
const ee = V[D], $ = (H = p.form) == null ? void 0 : H.rangeBeginProp, U = (X = p.form) == null ? void 0 : X.rangeEndProp;
|
|
1629
|
+
$ && U && ee.length >= 2 && (V[$] = ee[0], V[U] = ee[1]);
|
|
1630
1630
|
}
|
|
1631
|
-
}), delete
|
|
1632
|
-
const p = await e.beforeSave(
|
|
1631
|
+
}), delete V.orderByColumn, delete V.isAsc, e.beforeSave) {
|
|
1632
|
+
const p = await e.beforeSave(V);
|
|
1633
1633
|
if (p === !1) return !1;
|
|
1634
|
-
p && typeof p == "object" ? Object.assign(f, p) : Object.assign(f,
|
|
1634
|
+
p && typeof p == "object" ? Object.assign(f, p) : Object.assign(f, V);
|
|
1635
1635
|
} else
|
|
1636
|
-
Object.assign(f,
|
|
1636
|
+
Object.assign(f, V);
|
|
1637
1637
|
return !0;
|
|
1638
1638
|
}
|
|
1639
1639
|
};
|
|
@@ -1648,12 +1648,12 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
1648
1648
|
},
|
|
1649
1649
|
emits: ["close", "actionEvent"],
|
|
1650
1650
|
setup(e, { emit: l }) {
|
|
1651
|
-
const { t
|
|
1651
|
+
const { t } = $a(), { proxy: a } = he(), c = e, o = I(!1), i = I(), y = l, f = I(), V = I(Oa), { formData: p, initFormData: R, prepareSaveData: D } = Cl(
|
|
1652
1652
|
c.dataSource,
|
|
1653
1653
|
c.editData
|
|
1654
1654
|
), j = J(() => {
|
|
1655
|
-
const E = !!c.editData[c.dataSource.rowKey], O =
|
|
1656
|
-
return
|
|
1655
|
+
const E = !!c.editData[c.dataSource.rowKey], O = jt(c.dataSource.columns, E, E);
|
|
1656
|
+
return Pa(O, "form.order");
|
|
1657
1657
|
}), P = J(() => c.dataSource.formInline || !1), H = (k) => {
|
|
1658
1658
|
if (Array.isArray(k.defaultExpandedKeys))
|
|
1659
1659
|
return k.defaultExpandedKeys;
|
|
@@ -1661,7 +1661,7 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
1661
1661
|
return [];
|
|
1662
1662
|
const E = k.data || [], O = k.props || { value: "id" }, W = k.valueKey || O.value || "id";
|
|
1663
1663
|
return Array.isArray(E) ? E.map((S) => S[W]).filter((S) => S !== void 0) : [];
|
|
1664
|
-
}, X = () =>
|
|
1664
|
+
}, X = () => Rt(c.dataSource.columns), ee = () => {
|
|
1665
1665
|
var k;
|
|
1666
1666
|
(k = f.value) == null || k.validate(async (E) => {
|
|
1667
1667
|
var O, W, S, d, C;
|
|
@@ -1669,7 +1669,7 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
1669
1669
|
try {
|
|
1670
1670
|
const A = { ...c.dataSource.queryParams || {} };
|
|
1671
1671
|
if (await D(A) === !1) return !1;
|
|
1672
|
-
c.editData[c.dataSource.rowKey] ? await ((W = (O = c.dataSource).updateApi) == null ? void 0 : W.call(O, A)) : await ((d = (S = c.dataSource).addApi) == null ? void 0 : d.call(S, A)), await $(), U(!0),
|
|
1672
|
+
c.editData[c.dataSource.rowKey] ? await ((W = (O = c.dataSource).updateApi) == null ? void 0 : W.call(O, A)) : await ((d = (S = c.dataSource).addApi) == null ? void 0 : d.call(S, A)), await $(), U(!0), a == null || a.$modal.msgSuccess(t("數據存儲成功")), (C = f.value) == null || C.resetFields();
|
|
1673
1673
|
} catch (A) {
|
|
1674
1674
|
console.error("Save failed:", A);
|
|
1675
1675
|
}
|
|
@@ -1692,7 +1692,7 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
1692
1692
|
return Ve(() => c.modelValue, (k) => {
|
|
1693
1693
|
k && (X(), R(c.editData)), o.value = k;
|
|
1694
1694
|
}), (k, E) => {
|
|
1695
|
-
const O =
|
|
1695
|
+
const O = rt, W = ba, S = ga, d = va, C = za, A = La, F = je, G = ia, se = nt, _ = da, x = ct, q = st, Y = ka, ne = ut, ue = ya, me = ma, ce = ha, ye = fa, u = De, m = pa;
|
|
1696
1696
|
return s(), h(m, {
|
|
1697
1697
|
title: c.action.title || c.action.text,
|
|
1698
1698
|
modelValue: r(o),
|
|
@@ -1973,7 +1973,7 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
1973
1973
|
"onUpdate:modelValue": (g) => r(p)[n.form.prop || n.prop] = g
|
|
1974
1974
|
}, {
|
|
1975
1975
|
default: b(() => [
|
|
1976
|
-
(s(!0), T(z, null, Q(r(
|
|
1976
|
+
(s(!0), T(z, null, Q(r(V)[n.form.dictType], (g) => (s(), h(x, {
|
|
1977
1977
|
key: g.value,
|
|
1978
1978
|
label: g.value
|
|
1979
1979
|
}, {
|
|
@@ -2001,14 +2001,14 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2001
2001
|
modelValue: r(p)[n.form.prop || n.prop],
|
|
2002
2002
|
"onUpdate:modelValue": (g) => r(p)[n.form.prop || n.prop] = g,
|
|
2003
2003
|
step: 1
|
|
2004
|
-
}, null, 8, ["min", "modelValue", "onUpdate:modelValue"])) : n.form.type === "richtext" ? (s(), h(
|
|
2004
|
+
}, null, 8, ["min", "modelValue", "onUpdate:modelValue"])) : n.form.type === "richtext" ? (s(), h(Ya, {
|
|
2005
2005
|
key: 22,
|
|
2006
2006
|
modelValue: r(p)[n.form.prop || n.prop],
|
|
2007
2007
|
"onUpdate:modelValue": (g) => r(p)[n.form.prop || n.prop] = g,
|
|
2008
2008
|
height: n.form.max || 320,
|
|
2009
2009
|
"min-height": n.form.min || 220
|
|
2010
2010
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "height", "min-height"])) : (s(), T(z, { key: 23 }, [
|
|
2011
|
-
n.form.translate === !0 ? (s(), h(
|
|
2011
|
+
n.form.translate === !0 ? (s(), h(Ba, {
|
|
2012
2012
|
ref_for: !0,
|
|
2013
2013
|
ref_key: "translateInputRef",
|
|
2014
2014
|
ref: i,
|
|
@@ -2065,7 +2065,7 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2065
2065
|
}, 8, ["title", "modelValue", "width"]);
|
|
2066
2066
|
};
|
|
2067
2067
|
}
|
|
2068
|
-
}),
|
|
2068
|
+
}), ra = /* @__PURE__ */ be(Ul, [["__scopeId", "data-v-03727126"]]), Al = {
|
|
2069
2069
|
key: 1,
|
|
2070
2070
|
class: "curd-search-card",
|
|
2071
2071
|
style: { "margin-bottom": "0px !important" }
|
|
@@ -2079,14 +2079,14 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2079
2079
|
selectedCount: { default: 0 }
|
|
2080
2080
|
},
|
|
2081
2081
|
emits: ["actionEvent"],
|
|
2082
|
-
setup(e, { expose: l, emit:
|
|
2083
|
-
const { t } =
|
|
2082
|
+
setup(e, { expose: l, emit: t }) {
|
|
2083
|
+
const { t: a } = $a(), { proxy: c } = he(), o = t, i = e, y = J(() => {
|
|
2084
2084
|
const d = i.dataSource.actions;
|
|
2085
2085
|
return d == null ? [] : d.filter((A) => A.position === "top" || A.action === "create" || A.action === "back").map((A) => {
|
|
2086
2086
|
const F = { ...A };
|
|
2087
2087
|
return F.action === "create" ? (F.cssType = "primary", F.icon = "Plus") : F.action === "back" && (F.icon = "ArrowLeft"), F;
|
|
2088
2088
|
});
|
|
2089
|
-
}), f = J(() => y.value.find((d) => d.action === "create") ?? null),
|
|
2089
|
+
}), f = J(() => y.value.find((d) => d.action === "create") ?? null), V = J(() => {
|
|
2090
2090
|
var d;
|
|
2091
2091
|
return ((d = i.dataSource.actions) == null ? void 0 : d.find((C) => C.action === "delete")) ?? null;
|
|
2092
2092
|
}), p = J(() => y.value.filter((d) => d.action !== "create")), R = (d) => {
|
|
@@ -2096,18 +2096,18 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2096
2096
|
return i.dataSource.searchActionColSpan;
|
|
2097
2097
|
const d = U.value.length % D.value, A = 24 - (d === 0 ? D.value : d) * j.value;
|
|
2098
2098
|
return A <= 0 ? 24 : A;
|
|
2099
|
-
}), X = J(() => U.value.length % D.value === 0 ? "15px !important" : "0px !important"), { initSearchDicts: ee } =
|
|
2099
|
+
}), X = J(() => U.value.length % D.value === 0 ? "15px !important" : "0px !important"), { initSearchDicts: ee } = Ia(), $ = I({}), U = I([]), k = () => {
|
|
2100
2100
|
o("actionEvent", { action: "filter" });
|
|
2101
2101
|
}, E = async () => {
|
|
2102
2102
|
try {
|
|
2103
2103
|
let d = O();
|
|
2104
2104
|
if (d = { ...i.dataSource.queryParams || {}, ...d }, i.dataSource.beforeExport && await i.dataSource.beforeExport(d) === !1)
|
|
2105
2105
|
return;
|
|
2106
|
-
const C =
|
|
2106
|
+
const C = _t().format("YYYYMMDDHHmmss");
|
|
2107
2107
|
let A = i.dataSource.exportFileName ? `${i.dataSource.exportFileName}` : "export";
|
|
2108
2108
|
A += `_${C}.xlsx`, c == null || c.download(i.dataSource.exportUrl, d, A);
|
|
2109
2109
|
} catch (d) {
|
|
2110
|
-
console.error("Export failed:", d), c == null || c.$modal.msgError(
|
|
2110
|
+
console.error("Export failed:", d), c == null || c.$modal.msgError(a("導出失敗"));
|
|
2111
2111
|
}
|
|
2112
2112
|
}, O = () => {
|
|
2113
2113
|
const d = { ...$.value };
|
|
@@ -2115,14 +2115,16 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2115
2115
|
var A, F;
|
|
2116
2116
|
if (((A = C.search) == null ? void 0 : A.type) === "daterange" || ((F = C.search) == null ? void 0 : F.type) === "timerange") {
|
|
2117
2117
|
const G = d[C.search.prop];
|
|
2118
|
-
G && G[0] && G[1] &&
|
|
2118
|
+
G && G[0] && G[1] && Nt(d, G, C.search.prop, c), delete d[C.search.prop];
|
|
2119
2119
|
}
|
|
2120
2120
|
}), ze(d);
|
|
2121
2121
|
}, W = async () => {
|
|
2122
2122
|
await S(), o("actionEvent", { action: "filter" }, {});
|
|
2123
2123
|
}, S = async () => {
|
|
2124
|
-
const d = i.dataSource.columns.filter(
|
|
2125
|
-
|
|
2124
|
+
const d = i.dataSource.columns.filter(
|
|
2125
|
+
(A) => A.search && Be(A.search.permission ?? A.permission)
|
|
2126
|
+
);
|
|
2127
|
+
U.value = Pa(
|
|
2126
2128
|
d.map((A, F) => (A.search.order || (A.search.order = F + 100), A)),
|
|
2127
2129
|
"search.order"
|
|
2128
2130
|
), await Ie();
|
|
@@ -2135,9 +2137,9 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2135
2137
|
}
|
|
2136
2138
|
$.value = C;
|
|
2137
2139
|
};
|
|
2138
|
-
return
|
|
2140
|
+
return Fe(() => S()), l({ initData: S, getQueryParams: O }), (d, C) => {
|
|
2139
2141
|
var ye;
|
|
2140
|
-
const A =
|
|
2142
|
+
const A = va, F = ba, G = ga, se = ka, _ = je, x = ya, q = ma, Y = De, ne = ha, ue = fa, me = _a, ce = Va("hasPermi");
|
|
2141
2143
|
return r(U).length > 0 && r(P) ? (s(), h(me, {
|
|
2142
2144
|
key: 0,
|
|
2143
2145
|
class: "curd-search-card",
|
|
@@ -2292,7 +2294,7 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2292
2294
|
"onUpdate:modelValue": (m) => r($)[u.search.prop] = m,
|
|
2293
2295
|
style: { width: "100%" },
|
|
2294
2296
|
placeholder: d.$t("請輸入"),
|
|
2295
|
-
onKeyup:
|
|
2297
|
+
onKeyup: Xe(k, ["enter"]),
|
|
2296
2298
|
clearable: ""
|
|
2297
2299
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"]))
|
|
2298
2300
|
]),
|
|
@@ -2350,7 +2352,7 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2350
2352
|
]),
|
|
2351
2353
|
_: 1
|
|
2352
2354
|
}, 8, ["disabled"])), [
|
|
2353
|
-
[ce, ((u = r(
|
|
2355
|
+
[ce, ((u = r(V)) == null ? void 0 : u.permission) || null]
|
|
2354
2356
|
]) : Z("", !0),
|
|
2355
2357
|
i.dataSource.exportUrl ? (s(), h(Y, {
|
|
2356
2358
|
key: 2,
|
|
@@ -2537,7 +2539,7 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2537
2539
|
"onUpdate:modelValue": (m) => r($)[u.search.prop] = m,
|
|
2538
2540
|
style: { width: "100%" },
|
|
2539
2541
|
placeholder: d.$t("請輸入"),
|
|
2540
|
-
onKeyup:
|
|
2542
|
+
onKeyup: Xe(k, ["enter"]),
|
|
2541
2543
|
clearable: ""
|
|
2542
2544
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"]))
|
|
2543
2545
|
]),
|
|
@@ -2595,7 +2597,7 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2595
2597
|
]),
|
|
2596
2598
|
_: 1
|
|
2597
2599
|
}, 8, ["disabled"])), [
|
|
2598
|
-
[ce, ((u = r(
|
|
2600
|
+
[ce, ((u = r(V)) == null ? void 0 : u.permission) || null]
|
|
2599
2601
|
]) : Z("", !0),
|
|
2600
2602
|
i.dataSource.exportUrl ? (s(), h(Y, {
|
|
2601
2603
|
key: 2,
|
|
@@ -2661,7 +2663,7 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2661
2663
|
]),
|
|
2662
2664
|
_: 1
|
|
2663
2665
|
}, 8, ["disabled"])), [
|
|
2664
|
-
[ce, ((ye = r(
|
|
2666
|
+
[ce, ((ye = r(V)) == null ? void 0 : ye.permission) || null]
|
|
2665
2667
|
]) : Z("", !0),
|
|
2666
2668
|
i.dataSource.exportUrl ? (s(), h(Y, {
|
|
2667
2669
|
key: 2,
|
|
@@ -2692,7 +2694,7 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2692
2694
|
])) : Z("", !0);
|
|
2693
2695
|
};
|
|
2694
2696
|
}
|
|
2695
|
-
}), Il = /* @__PURE__ */ be(Pl, [["__scopeId", "data-v-
|
|
2697
|
+
}), Il = /* @__PURE__ */ be(Pl, [["__scopeId", "data-v-fbfbd6fe"]]), Ra = {
|
|
2696
2698
|
// ============ 搜索欄 ============
|
|
2697
2699
|
查詢: "查询",
|
|
2698
2700
|
清空: "清空",
|
|
@@ -2725,7 +2727,7 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2725
2727
|
請先勾選要刪除的數據: "请先勾选要删除的数据",
|
|
2726
2728
|
數據存儲成功: "数据存储成功",
|
|
2727
2729
|
導出失敗: "导出失败"
|
|
2728
|
-
},
|
|
2730
|
+
}, ja = {
|
|
2729
2731
|
// ============ 搜索欄 ============
|
|
2730
2732
|
查詢: "查詢",
|
|
2731
2733
|
清空: "清空",
|
|
@@ -2758,7 +2760,7 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2758
2760
|
請先勾選要刪除的數據: "請先勾選要刪除的數據",
|
|
2759
2761
|
數據存儲成功: "數據存儲成功",
|
|
2760
2762
|
導出失敗: "導出失敗"
|
|
2761
|
-
},
|
|
2763
|
+
}, Ha = {
|
|
2762
2764
|
// ============ Search bar ============
|
|
2763
2765
|
查詢: "Search",
|
|
2764
2766
|
清空: "Clear",
|
|
@@ -2792,26 +2794,26 @@ const Tl = { key: 20 }, El = { class: "color-picker-tips" }, Ul = /* @__PURE__ *
|
|
|
2792
2794
|
數據存儲成功: "Data saved successfully",
|
|
2793
2795
|
導出失敗: "Export failed"
|
|
2794
2796
|
};
|
|
2795
|
-
let
|
|
2797
|
+
let na = !1;
|
|
2796
2798
|
const xl = {
|
|
2797
|
-
zh_CN:
|
|
2798
|
-
zh_HK:
|
|
2799
|
-
en_US:
|
|
2799
|
+
zh_CN: Ra,
|
|
2800
|
+
zh_HK: ja,
|
|
2801
|
+
en_US: Ha
|
|
2800
2802
|
};
|
|
2801
2803
|
function Ll() {
|
|
2802
|
-
if (!
|
|
2804
|
+
if (!na)
|
|
2803
2805
|
try {
|
|
2804
2806
|
const e = he();
|
|
2805
2807
|
if (!e) return;
|
|
2806
|
-
const
|
|
2807
|
-
if (
|
|
2808
|
-
const
|
|
2808
|
+
const t = e.appContext.app.config.globalProperties.$i18n;
|
|
2809
|
+
if (t) {
|
|
2810
|
+
const a = t.global || t;
|
|
2809
2811
|
for (const [c, o] of Object.entries(xl))
|
|
2810
|
-
if (
|
|
2811
|
-
const i =
|
|
2812
|
-
|
|
2812
|
+
if (a && typeof a.mergeLocaleMessage == "function" && a.mergeLocaleMessage(c, o), a && a.messages) {
|
|
2813
|
+
const i = a.messages[c] || {};
|
|
2814
|
+
a.messages[c] = { ...o, ...i };
|
|
2813
2815
|
}
|
|
2814
|
-
|
|
2816
|
+
na = !0;
|
|
2815
2817
|
}
|
|
2816
2818
|
} catch {
|
|
2817
2819
|
}
|
|
@@ -2826,10 +2828,10 @@ const zl = { key: 1 }, Bl = /* @__PURE__ */ pe({
|
|
|
2826
2828
|
maxHeight: {}
|
|
2827
2829
|
},
|
|
2828
2830
|
emits: ["actionEvent", "beforeQuery"],
|
|
2829
|
-
setup(e, { expose: l, emit:
|
|
2830
|
-
const { proxy:
|
|
2831
|
+
setup(e, { expose: l, emit: t }) {
|
|
2832
|
+
const { proxy: a } = he(), c = t, o = e, i = J(
|
|
2831
2833
|
() => o.dataSource.maxHeight != null ? void 0 : o.maxHeight
|
|
2832
|
-
), y = I(!1), f = I({}),
|
|
2834
|
+
), y = I(!1), f = I({}), V = I({}), p = I(), R = I(), D = I(0), j = J(() => {
|
|
2833
2835
|
const _ = (o.dataSource.columns || []).map((x) => x.slot).filter((x) => !!x);
|
|
2834
2836
|
return Array.from(new Set(_));
|
|
2835
2837
|
}), P = (_) => {
|
|
@@ -2864,7 +2866,7 @@ const zl = { key: 1 }, Bl = /* @__PURE__ */ pe({
|
|
|
2864
2866
|
}[_.action];
|
|
2865
2867
|
Y ? Y() : c("actionEvent", _, x);
|
|
2866
2868
|
}, E = async (_, x) => {
|
|
2867
|
-
o.dataSource.beforeUpdate && await o.dataSource.beforeUpdate(x) === !1 || (f.value = x,
|
|
2869
|
+
o.dataSource.beforeUpdate && await o.dataSource.beforeUpdate(x) === !1 || (f.value = x, V.value = _, y.value = !0);
|
|
2868
2870
|
}, O = async (_, x) => {
|
|
2869
2871
|
var q, Y, ne;
|
|
2870
2872
|
try {
|
|
@@ -2872,26 +2874,26 @@ const zl = { key: 1 }, Bl = /* @__PURE__ */ pe({
|
|
|
2872
2874
|
return;
|
|
2873
2875
|
const ue = x[o.dataSource.rowKey];
|
|
2874
2876
|
if (!ue) {
|
|
2875
|
-
|
|
2877
|
+
a == null || a.$modal.msgError(a == null ? void 0 : a.$t("rowKey参数不正确"));
|
|
2876
2878
|
return;
|
|
2877
2879
|
}
|
|
2878
|
-
const me = _.confirm || _.confirmText || (
|
|
2879
|
-
await (
|
|
2880
|
+
const me = _.confirm || _.confirmText || (a == null ? void 0 : a.$t("確認刪除此數據嗎?"));
|
|
2881
|
+
await (a == null ? void 0 : a.$modal.confirm(me)), await ((Y = (q = o.dataSource).deleteApi) == null ? void 0 : Y.call(q, ue)), a == null || a.$modal.msgSuccess(a == null ? void 0 : a.$t("刪除成功")), (ne = p.value) == null || ne.refreshTable();
|
|
2880
2882
|
} catch (ue) {
|
|
2881
2883
|
ue !== "cancel" && console.error("Delete failed:", ue);
|
|
2882
2884
|
}
|
|
2883
2885
|
}, W = async () => {
|
|
2884
2886
|
var q, Y, ne, ue, me;
|
|
2885
2887
|
if (!o.dataSource.deleteApi) {
|
|
2886
|
-
|
|
2888
|
+
a == null || a.$modal.msgError(a == null ? void 0 : a.$t("deleteApi 方法未設置"));
|
|
2887
2889
|
return;
|
|
2888
2890
|
}
|
|
2889
2891
|
const _ = ((Y = (q = p.value) == null ? void 0 : q.getSelection) == null ? void 0 : Y.call(q)) ?? [];
|
|
2890
2892
|
if (!_.length) {
|
|
2891
|
-
|
|
2893
|
+
a == null || a.$modal.msgWarning(a == null ? void 0 : a.$t("請先勾選要刪除的數據"));
|
|
2892
2894
|
return;
|
|
2893
2895
|
}
|
|
2894
|
-
await (
|
|
2896
|
+
await (a == null ? void 0 : a.$modal.confirm(a == null ? void 0 : a.$t("確認刪除選中的 {count} 條數據嗎?", { count: _.length })));
|
|
2895
2897
|
const x = [];
|
|
2896
2898
|
for (const ce of _) {
|
|
2897
2899
|
if (o.dataSource.beforeDelete && await o.dataSource.beforeDelete(ce) === !1)
|
|
@@ -2899,9 +2901,9 @@ const zl = { key: 1 }, Bl = /* @__PURE__ */ pe({
|
|
|
2899
2901
|
const ye = ce[o.dataSource.rowKey];
|
|
2900
2902
|
ye != null && x.push(ye);
|
|
2901
2903
|
}
|
|
2902
|
-
x.length && (await ((ue = (ne = o.dataSource).deleteApi) == null ? void 0 : ue.call(ne, x)),
|
|
2904
|
+
x.length && (await ((ue = (ne = o.dataSource).deleteApi) == null ? void 0 : ue.call(ne, x)), a == null || a.$modal.msgSuccess(a == null ? void 0 : a.$t("刪除成功")), (me = p.value) == null || me.refreshTable());
|
|
2903
2905
|
}, S = async (_, x) => {
|
|
2904
|
-
o.dataSource.beforeCreate && await o.dataSource.beforeCreate(x || {}) === !1 || (f.value = x || {},
|
|
2906
|
+
o.dataSource.beforeCreate && await o.dataSource.beforeCreate(x || {}) === !1 || (f.value = x || {}, V.value = _, y.value = !0);
|
|
2905
2907
|
}, d = async (_ = {}) => {
|
|
2906
2908
|
const x = _ && (Object.prototype.hasOwnProperty.call(_, "data") || Object.prototype.hasOwnProperty.call(_, "title") || Object.prototype.hasOwnProperty.call(_, "text") || Object.prototype.hasOwnProperty.call(_, "width") || Object.prototype.hasOwnProperty.call(_, "labelWidth") || Object.prototype.hasOwnProperty.call(_, "labelPosition")), q = x ? _.data || {} : _ || {}, Y = {
|
|
2907
2909
|
action: "create",
|
|
@@ -2921,7 +2923,7 @@ const zl = { key: 1 }, Bl = /* @__PURE__ */ pe({
|
|
|
2921
2923
|
const ne = q.includes("?") ? "&" : "?";
|
|
2922
2924
|
q += `${ne}${Y}=${x[Y]}`;
|
|
2923
2925
|
}
|
|
2924
|
-
|
|
2926
|
+
a == null || a.$router.push(q);
|
|
2925
2927
|
}, A = () => {
|
|
2926
2928
|
var x, q;
|
|
2927
2929
|
const _ = (x = R.value) == null ? void 0 : x.getQueryParams();
|
|
@@ -2932,13 +2934,13 @@ const zl = { key: 1 }, Bl = /* @__PURE__ */ pe({
|
|
|
2932
2934
|
}, G = () => {
|
|
2933
2935
|
var _;
|
|
2934
2936
|
return (_ = p.value) == null ? void 0 : _.getSelection();
|
|
2935
|
-
}, se = () =>
|
|
2936
|
-
return
|
|
2937
|
-
Ll(),
|
|
2937
|
+
}, se = () => a == null ? void 0 : a.$router.back();
|
|
2938
|
+
return Fe(() => {
|
|
2939
|
+
Ll(), Mt(o.dataSource.columns);
|
|
2938
2940
|
}), l({ refreshTable: X, initSearch: $, initTable: ee, openCreate: d, getQueryParams: F, getSelection: G }), (_, x) => {
|
|
2939
|
-
const q =
|
|
2941
|
+
const q = _a;
|
|
2940
2942
|
return s(), T("div", {
|
|
2941
|
-
class:
|
|
2943
|
+
class: He({ "p-3": _.showPadding })
|
|
2942
2944
|
}, [
|
|
2943
2945
|
K(Il, {
|
|
2944
2946
|
dataSource: o.dataSource,
|
|
@@ -2953,7 +2955,7 @@ const zl = { key: 1 }, Bl = /* @__PURE__ */ pe({
|
|
|
2953
2955
|
shadow: "hover"
|
|
2954
2956
|
}, {
|
|
2955
2957
|
default: b(() => [
|
|
2956
|
-
K(
|
|
2958
|
+
K(la, {
|
|
2957
2959
|
ref_key: "curdTableRef",
|
|
2958
2960
|
ref: p,
|
|
2959
2961
|
onActionEvent: U,
|
|
@@ -2964,22 +2966,22 @@ const zl = { key: 1 }, Bl = /* @__PURE__ */ pe({
|
|
|
2964
2966
|
Q(r(j), (Y) => ({
|
|
2965
2967
|
name: Y,
|
|
2966
2968
|
fn: b((ne) => [
|
|
2967
|
-
Pe(_.$slots, Y,
|
|
2969
|
+
Pe(_.$slots, Y, Ze(ea(ne)))
|
|
2968
2970
|
])
|
|
2969
2971
|
}))
|
|
2970
2972
|
]), 1032, ["dataSource", "maxHeight"]),
|
|
2971
|
-
K(
|
|
2973
|
+
K(ra, {
|
|
2972
2974
|
onClose: H,
|
|
2973
2975
|
modelValue: r(y),
|
|
2974
2976
|
"onUpdate:modelValue": x[0] || (x[0] = (Y) => $e(y) ? y.value = Y : null),
|
|
2975
2977
|
dataSource: o.dataSource,
|
|
2976
|
-
action: r(
|
|
2978
|
+
action: r(V),
|
|
2977
2979
|
editData: r(f)
|
|
2978
2980
|
}, null, 8, ["modelValue", "dataSource", "action", "editData"])
|
|
2979
2981
|
]),
|
|
2980
2982
|
_: 3
|
|
2981
2983
|
}, 8, ["body-style"])) : (s(), T("div", zl, [
|
|
2982
|
-
K(
|
|
2984
|
+
K(la, {
|
|
2983
2985
|
ref_key: "curdTableRef",
|
|
2984
2986
|
ref: p,
|
|
2985
2987
|
onActionEvent: U,
|
|
@@ -2990,30 +2992,30 @@ const zl = { key: 1 }, Bl = /* @__PURE__ */ pe({
|
|
|
2990
2992
|
Q(r(j), (Y) => ({
|
|
2991
2993
|
name: Y,
|
|
2992
2994
|
fn: b((ne) => [
|
|
2993
|
-
Pe(_.$slots, Y,
|
|
2995
|
+
Pe(_.$slots, Y, Ze(ea(ne)))
|
|
2994
2996
|
])
|
|
2995
2997
|
}))
|
|
2996
2998
|
]), 1032, ["dataSource", "maxHeight"]),
|
|
2997
|
-
K(
|
|
2999
|
+
K(ra, {
|
|
2998
3000
|
onClose: H,
|
|
2999
3001
|
modelValue: r(y),
|
|
3000
3002
|
"onUpdate:modelValue": x[1] || (x[1] = (Y) => $e(y) ? y.value = Y : null),
|
|
3001
3003
|
dataSource: o.dataSource,
|
|
3002
|
-
action: r(
|
|
3004
|
+
action: r(V),
|
|
3003
3005
|
editData: r(f)
|
|
3004
3006
|
}, null, 8, ["modelValue", "dataSource", "action", "editData"])
|
|
3005
3007
|
]))
|
|
3006
3008
|
], 2);
|
|
3007
3009
|
};
|
|
3008
3010
|
}
|
|
3009
|
-
}),
|
|
3011
|
+
}), sa = {
|
|
3010
3012
|
401: "认证失败,无法访问系统资源",
|
|
3011
3013
|
403: "当前操作没有权限",
|
|
3012
3014
|
404: "访问资源不存在",
|
|
3013
3015
|
default: "系统未知错误,请反馈给管理员"
|
|
3014
3016
|
};
|
|
3015
|
-
function Yl(e, l,
|
|
3016
|
-
const
|
|
3017
|
+
function Yl(e, l, t) {
|
|
3018
|
+
const a = wa.service({
|
|
3017
3019
|
text: "正在下載數據,請稍後",
|
|
3018
3020
|
background: "rgba(0, 0, 0, 0.7)"
|
|
3019
3021
|
});
|
|
@@ -3024,17 +3026,17 @@ function Yl(e, l, a) {
|
|
|
3024
3026
|
}).then(async (c) => {
|
|
3025
3027
|
if (Dl(c)) {
|
|
3026
3028
|
const i = new Blob([c]);
|
|
3027
|
-
|
|
3029
|
+
wt.saveAs(i, t);
|
|
3028
3030
|
} else {
|
|
3029
|
-
const i = await new Blob([c]).text(), y = JSON.parse(i), f =
|
|
3031
|
+
const i = await new Blob([c]).text(), y = JSON.parse(i), f = sa[y.code] || y.msg || sa.default;
|
|
3030
3032
|
we.error(f);
|
|
3031
3033
|
}
|
|
3032
|
-
|
|
3034
|
+
a.close();
|
|
3033
3035
|
}).catch((c) => {
|
|
3034
|
-
console.error(c), we.error("下载文件出现错误,请联系管理员!"),
|
|
3036
|
+
console.error(c), we.error("下载文件出现错误,请联系管理员!"), a.close();
|
|
3035
3037
|
});
|
|
3036
3038
|
}
|
|
3037
|
-
let
|
|
3039
|
+
let ca;
|
|
3038
3040
|
const Ml = {
|
|
3039
3041
|
// 消息提示
|
|
3040
3042
|
msg(e) {
|
|
@@ -3093,18 +3095,18 @@ const Ml = {
|
|
|
3093
3095
|
});
|
|
3094
3096
|
},
|
|
3095
3097
|
// 提交内容
|
|
3096
|
-
prompt(e, l,
|
|
3098
|
+
prompt(e, l, t = "") {
|
|
3097
3099
|
return _e.prompt(e, l || "系統提示", {
|
|
3098
3100
|
confirmButtonText: "確認",
|
|
3099
3101
|
cancelButtonText: "取消",
|
|
3100
3102
|
type: "warning",
|
|
3101
|
-
inputType:
|
|
3103
|
+
inputType: t,
|
|
3102
3104
|
inputPlaceholder: e
|
|
3103
3105
|
});
|
|
3104
3106
|
},
|
|
3105
3107
|
// 打开遮罩层
|
|
3106
3108
|
loading(e) {
|
|
3107
|
-
|
|
3109
|
+
ca = wa.service({
|
|
3108
3110
|
lock: !0,
|
|
3109
3111
|
text: e,
|
|
3110
3112
|
background: "rgba(0, 0, 0, 0.7)"
|
|
@@ -3112,22 +3114,22 @@ const Ml = {
|
|
|
3112
3114
|
},
|
|
3113
3115
|
// 关闭遮罩层
|
|
3114
3116
|
closeLoading() {
|
|
3115
|
-
|
|
3117
|
+
ca.close();
|
|
3116
3118
|
}
|
|
3117
3119
|
};
|
|
3118
|
-
function
|
|
3120
|
+
function Fa(e) {
|
|
3119
3121
|
return ke()({
|
|
3120
3122
|
url: "/system/dict/data/type/" + e,
|
|
3121
3123
|
method: "get"
|
|
3122
3124
|
});
|
|
3123
3125
|
}
|
|
3124
|
-
function
|
|
3126
|
+
function Na(e) {
|
|
3125
3127
|
return ke()({
|
|
3126
3128
|
url: "/system/common/dict/data/type/" + e,
|
|
3127
3129
|
method: "get"
|
|
3128
3130
|
});
|
|
3129
3131
|
}
|
|
3130
|
-
const ve =
|
|
3132
|
+
const ve = Sa("dict", () => {
|
|
3131
3133
|
const e = I(/* @__PURE__ */ new Map());
|
|
3132
3134
|
return {
|
|
3133
3135
|
dict: e,
|
|
@@ -3156,90 +3158,90 @@ const ve = Vt("dict", () => {
|
|
|
3156
3158
|
};
|
|
3157
3159
|
}), Rl = (...e) => {
|
|
3158
3160
|
const l = I({});
|
|
3159
|
-
return e.forEach(async (
|
|
3160
|
-
l.value[
|
|
3161
|
-
const
|
|
3162
|
-
|
|
3163
|
-
l.value[
|
|
3161
|
+
return e.forEach(async (t) => {
|
|
3162
|
+
l.value[t] = [];
|
|
3163
|
+
const a = ve().getDict(t);
|
|
3164
|
+
a ? l.value[t] = a : await Fa(t).then((c) => {
|
|
3165
|
+
l.value[t] = c.data.map(
|
|
3164
3166
|
(o) => ({ label: o.dictLabel, value: o.dictValue, elTagType: o.listClass, elTagClass: o.cssClass })
|
|
3165
|
-
), ve().setDict(
|
|
3167
|
+
), ve().setDict(t, l.value[t]);
|
|
3166
3168
|
});
|
|
3167
3169
|
}), l.value;
|
|
3168
3170
|
}, jl = async (e) => {
|
|
3169
3171
|
const l = ve().getDict(e);
|
|
3170
3172
|
if (l && l.length > 0) return l;
|
|
3171
3173
|
{
|
|
3172
|
-
const
|
|
3174
|
+
const a = (await Fa(e)).data.map(
|
|
3173
3175
|
(c) => ({ label: c.dictLabel, value: c.dictValue, elTagType: c.listClass, elTagClass: c.cssClass, remark: c.remark })
|
|
3174
3176
|
);
|
|
3175
|
-
return ve().setDict(e,
|
|
3177
|
+
return ve().setDict(e, a), a;
|
|
3176
3178
|
}
|
|
3177
3179
|
}, Hl = (...e) => {
|
|
3178
3180
|
const l = I({});
|
|
3179
|
-
return e.forEach(async (
|
|
3180
|
-
l.value[
|
|
3181
|
-
const
|
|
3182
|
-
|
|
3183
|
-
l.value[
|
|
3181
|
+
return e.forEach(async (t) => {
|
|
3182
|
+
l.value[t] = [];
|
|
3183
|
+
const a = ve().getDict(t);
|
|
3184
|
+
a && a.length > 0 ? l.value[t] = a : await Na(t).then((c) => {
|
|
3185
|
+
l.value[t] = c.data.map(
|
|
3184
3186
|
(o) => ({ label: o.dictLabel, value: o.dictValue, elTagType: o.listClass, elTagClass: o.cssClass, remark: o.remark })
|
|
3185
|
-
), ve().setDict(
|
|
3187
|
+
), ve().setDict(t, l.value[t]);
|
|
3186
3188
|
});
|
|
3187
3189
|
}), l.value;
|
|
3188
3190
|
}, Fl = async (e) => {
|
|
3189
3191
|
const l = ve().getDict(e);
|
|
3190
3192
|
if (l && l.length > 0) return l;
|
|
3191
3193
|
{
|
|
3192
|
-
const
|
|
3193
|
-
return ve().setDict(e,
|
|
3194
|
+
const a = (await Na(e)).data.map((c) => ({ label: c.dictLabel, value: c.dictValue, elTagType: c.listClass, elTagClass: c.cssClass }));
|
|
3195
|
+
return ve().setDict(e, a), a;
|
|
3194
3196
|
}
|
|
3195
3197
|
}, Nl = {
|
|
3196
|
-
beforeMount(e, { value: l, arg:
|
|
3197
|
-
if (
|
|
3198
|
+
beforeMount(e, { value: l, arg: t }) {
|
|
3199
|
+
if (t === "callback")
|
|
3198
3200
|
e.$copyCallback = l;
|
|
3199
3201
|
else {
|
|
3200
3202
|
e.$copyValue = l;
|
|
3201
|
-
const
|
|
3203
|
+
const a = () => {
|
|
3202
3204
|
Kl(e.$copyValue), e.$copyCallback && e.$copyCallback(e.$copyValue);
|
|
3203
3205
|
};
|
|
3204
|
-
e.addEventListener("click",
|
|
3206
|
+
e.addEventListener("click", a), e.$destroyCopy = () => e.removeEventListener("click", a);
|
|
3205
3207
|
}
|
|
3206
3208
|
}
|
|
3207
3209
|
};
|
|
3208
3210
|
function Kl(e, { target: l = document.body } = {}) {
|
|
3209
|
-
const
|
|
3210
|
-
|
|
3211
|
+
const t = document.createElement("textarea"), a = document.activeElement;
|
|
3212
|
+
t.value = e, t.setAttribute("readonly", ""), t.style.contain = "strict", t.style.position = "absolute", t.style.left = "-9999px", t.style.fontSize = "12pt";
|
|
3211
3213
|
const c = document.getSelection();
|
|
3212
3214
|
let o;
|
|
3213
|
-
c && (o = (c == null ? void 0 : c.rangeCount) > 0 && c.getRangeAt(0)), l.append(
|
|
3215
|
+
c && (o = (c == null ? void 0 : c.rangeCount) > 0 && c.getRangeAt(0)), l.append(t), t.select(), t.selectionStart = 0, t.selectionEnd = e.length;
|
|
3214
3216
|
let i = !1;
|
|
3215
3217
|
try {
|
|
3216
3218
|
i = document.execCommand("copy");
|
|
3217
3219
|
} catch (y) {
|
|
3218
3220
|
console.error(y);
|
|
3219
3221
|
}
|
|
3220
|
-
return
|
|
3222
|
+
return t.remove(), o && (c == null || c.removeAllRanges(), c == null || c.addRange(o)), a && a.focus(), i;
|
|
3221
3223
|
}
|
|
3222
3224
|
const Wl = {
|
|
3223
|
-
zh_CN:
|
|
3224
|
-
zh_HK:
|
|
3225
|
-
en_US:
|
|
3225
|
+
zh_CN: Ra,
|
|
3226
|
+
zh_HK: ja,
|
|
3227
|
+
en_US: Ha
|
|
3226
3228
|
}, ql = {
|
|
3227
3229
|
Curd: Bl,
|
|
3228
|
-
DictTag:
|
|
3229
|
-
DictText:
|
|
3230
|
-
SvgIcon:
|
|
3231
|
-
OssImagePreview:
|
|
3232
|
-
OssFile:
|
|
3233
|
-
Editor:
|
|
3234
|
-
TranslateInput:
|
|
3235
|
-
ImageUpload:
|
|
3236
|
-
FileUpload:
|
|
3230
|
+
DictTag: Ca,
|
|
3231
|
+
DictText: Da,
|
|
3232
|
+
SvgIcon: Ne,
|
|
3233
|
+
OssImagePreview: Ua,
|
|
3234
|
+
OssFile: Aa,
|
|
3235
|
+
Editor: Ya,
|
|
3236
|
+
TranslateInput: Ba,
|
|
3237
|
+
ImageUpload: za,
|
|
3238
|
+
FileUpload: La
|
|
3237
3239
|
}, Ql = (e, l = {}) => {
|
|
3238
|
-
l.baseUrl != null &&
|
|
3240
|
+
l.baseUrl != null && Et(l.baseUrl), l.request && Ct(l.request), l.globalHeaders && Tt(l.globalHeaders), (l.hasPermi || l.hasRoles) && Wt(l);
|
|
3239
3241
|
try {
|
|
3240
|
-
const
|
|
3241
|
-
if (
|
|
3242
|
-
const c =
|
|
3242
|
+
const a = e.config.globalProperties.$i18n;
|
|
3243
|
+
if (a) {
|
|
3244
|
+
const c = a.global || a;
|
|
3243
3245
|
for (const [o, i] of Object.entries(Wl))
|
|
3244
3246
|
if (c && typeof c.mergeLocaleMessage == "function" && c.mergeLocaleMessage(o, i), c && c.messages) {
|
|
3245
3247
|
const y = c.messages[o] || {};
|
|
@@ -3248,33 +3250,33 @@ const Wl = {
|
|
|
3248
3250
|
}
|
|
3249
3251
|
} catch {
|
|
3250
3252
|
}
|
|
3251
|
-
for (const [
|
|
3252
|
-
e.component(
|
|
3253
|
-
const
|
|
3254
|
-
|
|
3253
|
+
for (const [a, c] of Object.entries(ql))
|
|
3254
|
+
e.component(a, c);
|
|
3255
|
+
const t = e.config.globalProperties;
|
|
3256
|
+
t.$modal = Ml, t.download = Yl, t.useDict = Rl, t.useOneDict = jl, t.useOneCommonDict = Fl, t.useCommonDict = Hl, t.parseTime = kl, t.addDateRange = _l, t.handleTree = Sl, t.selectDictLabel = wl, t.selectDictLabels = Vl, e.directive("hasPermi", qt), e.directive("hasRoles", Qt), e.directive("copyText", Nl);
|
|
3255
3257
|
}, co = { install: Ql };
|
|
3256
3258
|
export {
|
|
3257
3259
|
Bl as Curd,
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3260
|
+
Ca as DictTag,
|
|
3261
|
+
Da as DictText,
|
|
3262
|
+
Ya as Editor,
|
|
3263
|
+
La as FileUpload,
|
|
3264
|
+
za as ImageUpload,
|
|
3265
|
+
Aa as OssFile,
|
|
3266
|
+
Ua as OssImagePreview,
|
|
3267
|
+
Ne as SvgIcon,
|
|
3268
|
+
Ba as TranslateInput,
|
|
3267
3269
|
co as default,
|
|
3268
3270
|
Yl as download,
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
+
qe as getBaseUrl,
|
|
3272
|
+
We as getGlobalHeaders,
|
|
3271
3273
|
ke as getRequest,
|
|
3272
|
-
|
|
3274
|
+
Be as hasPermission,
|
|
3273
3275
|
Ql as install,
|
|
3274
3276
|
Wl as messages,
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3277
|
+
Et as setBaseUrl,
|
|
3278
|
+
Tt as setGlobalHeaders,
|
|
3279
|
+
Wt as setPermissionChecker,
|
|
3280
|
+
Ct as setRequest
|
|
3279
3281
|
};
|
|
3280
3282
|
//# sourceMappingURL=vue3-curd.es.js.map
|