jgy-public-component 0.0.16 → 0.0.18
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/index.js +547 -523
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/router/types.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +73 -73
- package/dist/components/JImportExcel copy/index.d.ts +0 -2
- package/dist/components/JImportExcel copy/types.d.ts +0 -12
- package/dist/router/guards copy.d.ts +0 -6
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElMessage as
|
|
3
|
-
import { Delete as
|
|
4
|
-
import
|
|
5
|
-
import { Icon as
|
|
6
|
-
import * as
|
|
7
|
-
import
|
|
8
|
-
const $e = ["disabled"],
|
|
1
|
+
import { defineComponent as N, openBlock as u, createElementBlock as E, normalizeClass as q, createCommentVNode as R, renderSlot as K, ref as M, watch as ue, resolveComponent as C, createVNode as f, unref as x, withCtx as r, createElementVNode as j, withModifiers as G, createBlock as _, Fragment as Z, toDisplayString as F, mergeProps as he, computed as ce, onMounted as ve, onBeforeUnmount as ge, normalizeStyle as de, createTextVNode as T, useModel as ye, renderList as te, mergeModels as le } from "vue";
|
|
2
|
+
import { ElMessage as I } from "element-plus";
|
|
3
|
+
import { Delete as Q, Plus as Y, Loading as se, ZoomIn as be, Search as _e, Refresh as we, ArrowDown as ke } from "@element-plus/icons-vue";
|
|
4
|
+
import Ce from "vuedraggable";
|
|
5
|
+
import { Icon as je } from "@iconify/vue";
|
|
6
|
+
import * as U from "xlsx";
|
|
7
|
+
import ee from "nprogress";
|
|
8
|
+
const $e = ["disabled"], xe = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "j-button__loading-icon"
|
|
11
|
-
},
|
|
11
|
+
}, Re = {
|
|
12
12
|
key: 1,
|
|
13
13
|
class: "j-button__text"
|
|
14
|
-
}, Ie = /* @__PURE__ */
|
|
14
|
+
}, Ie = /* @__PURE__ */ N({
|
|
15
15
|
__name: "JButton",
|
|
16
16
|
props: {
|
|
17
17
|
type: { default: "default" },
|
|
@@ -22,13 +22,13 @@ const $e = ["disabled"], je = {
|
|
|
22
22
|
loading: { type: Boolean, default: !1 }
|
|
23
23
|
},
|
|
24
24
|
emits: ["click"],
|
|
25
|
-
setup(e, { emit:
|
|
26
|
-
const t = e,
|
|
27
|
-
function
|
|
28
|
-
!t.disabled && !t.loading &&
|
|
25
|
+
setup(e, { emit: l }) {
|
|
26
|
+
const t = e, a = l;
|
|
27
|
+
function n(s) {
|
|
28
|
+
!t.disabled && !t.loading && a("click", s);
|
|
29
29
|
}
|
|
30
|
-
return (
|
|
31
|
-
class:
|
|
30
|
+
return (s, i) => (u(), E("button", {
|
|
31
|
+
class: q(["j-button", [
|
|
32
32
|
`j-button--${e.type}`,
|
|
33
33
|
`j-button--${e.size}`,
|
|
34
34
|
{
|
|
@@ -39,29 +39,29 @@ const $e = ["disabled"], je = {
|
|
|
39
39
|
}
|
|
40
40
|
]]),
|
|
41
41
|
disabled: e.disabled || e.loading,
|
|
42
|
-
onClick:
|
|
42
|
+
onClick: n
|
|
43
43
|
}, [
|
|
44
|
-
e.loading ? (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
])) :
|
|
44
|
+
e.loading ? (u(), E("span", xe)) : R("", !0),
|
|
45
|
+
s.$slots.default ? (u(), E("span", Re, [
|
|
46
|
+
K(s.$slots, "default", {}, void 0, !0)
|
|
47
|
+
])) : R("", !0)
|
|
48
48
|
], 10, $e));
|
|
49
49
|
}
|
|
50
|
-
}), W = (e,
|
|
50
|
+
}), W = (e, l) => {
|
|
51
51
|
const t = e.__vccOpts || e;
|
|
52
|
-
for (const [
|
|
53
|
-
t[
|
|
52
|
+
for (const [a, n] of l)
|
|
53
|
+
t[a] = n;
|
|
54
54
|
return t;
|
|
55
|
-
},
|
|
55
|
+
}, Se = /* @__PURE__ */ W(Ie, [["__scopeId", "data-v-22864824"]]), Be = { class: "j-upload-img-container" }, Ee = {
|
|
56
56
|
key: 0,
|
|
57
57
|
class: "images-wrapper"
|
|
58
|
-
},
|
|
58
|
+
}, Ae = { class: "image-item" }, Ve = ["onClick"], Me = {
|
|
59
59
|
key: 0,
|
|
60
60
|
class: "image-item single-image-item"
|
|
61
|
-
},
|
|
61
|
+
}, Fe = { class: "image-actions" }, De = {
|
|
62
62
|
key: 2,
|
|
63
63
|
class: "upload-tip"
|
|
64
|
-
}, Je = { key: 0 },
|
|
64
|
+
}, Je = { key: 0 }, Oe = /* @__PURE__ */ N({
|
|
65
65
|
name: "JUploadImg",
|
|
66
66
|
__name: "JUploadImg",
|
|
67
67
|
props: {
|
|
@@ -76,188 +76,188 @@ const $e = ["disabled"], je = {
|
|
|
76
76
|
uploadFn: { type: Function, default: void 0 }
|
|
77
77
|
},
|
|
78
78
|
emits: ["update:modelValue", "success", "error"],
|
|
79
|
-
setup(e, { emit:
|
|
80
|
-
const t = e,
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
|
|
79
|
+
setup(e, { emit: l }) {
|
|
80
|
+
const t = e, a = l, n = M(""), s = M(!1), i = t.showTip, c = () => {
|
|
81
|
+
s.value = !0;
|
|
82
|
+
}, v = () => {
|
|
83
|
+
n.value = "", a("update:modelValue", ""), I.success("删除成功");
|
|
84
|
+
}, h = M([]), b = M(!1), z = (g) => {
|
|
85
|
+
h.value = g.map((d, o) => ({
|
|
86
86
|
uid: Date.now() + o,
|
|
87
|
-
url:
|
|
87
|
+
url: d
|
|
88
88
|
}));
|
|
89
89
|
};
|
|
90
|
-
ue(() => t.modelValue, (
|
|
91
|
-
t.multiple ? Array.isArray(
|
|
90
|
+
ue(() => t.modelValue, (g) => {
|
|
91
|
+
t.multiple ? Array.isArray(g) && g.length > 0 ? z(g) : h.value = [] : typeof g == "string" ? n.value = g : n.value = "";
|
|
92
92
|
}, { immediate: !0 });
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
}, k = (
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
const
|
|
99
|
-
if (!
|
|
100
|
-
|
|
93
|
+
const D = () => {
|
|
94
|
+
O();
|
|
95
|
+
}, k = (g) => {
|
|
96
|
+
h.value.splice(g, 1), O(), I.success("删除成功");
|
|
97
|
+
}, p = async (g) => {
|
|
98
|
+
const d = g.raw;
|
|
99
|
+
if (!d) {
|
|
100
|
+
I.error("文件不存在,请重试");
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
|
-
if (
|
|
104
|
-
|
|
103
|
+
if (d.size > t.maxSize * 1024 * 1024) {
|
|
104
|
+
I.error(`图片大小不能超过 ${t.maxSize}MB`);
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
if (!t.uploadFn) {
|
|
108
|
-
|
|
108
|
+
I.error("未配置上传函数 (uploadFn)");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
111
|
try {
|
|
112
|
-
|
|
113
|
-
const o = await t.uploadFn(
|
|
114
|
-
t.multiple ? (
|
|
112
|
+
b.value = !0;
|
|
113
|
+
const o = await t.uploadFn(d);
|
|
114
|
+
t.multiple ? (h.value.push({ uid: Date.now(), url: o }), O()) : (n.value = o, a("update:modelValue", o)), a("success", o), I.success("上传成功");
|
|
115
115
|
} catch (o) {
|
|
116
|
-
console.error("上传出错:", o),
|
|
116
|
+
console.error("上传出错:", o), I.error("上传失败,请重试"), a("error", o);
|
|
117
117
|
} finally {
|
|
118
|
-
|
|
118
|
+
b.value = !1;
|
|
119
119
|
}
|
|
120
|
-
},
|
|
121
|
-
const
|
|
122
|
-
|
|
120
|
+
}, O = () => {
|
|
121
|
+
const g = h.value.map((d) => d.url);
|
|
122
|
+
a("update:modelValue", g);
|
|
123
123
|
};
|
|
124
|
-
return (
|
|
125
|
-
const o =
|
|
126
|
-
return
|
|
127
|
-
e.multiple ? (
|
|
128
|
-
|
|
129
|
-
modelValue:
|
|
130
|
-
"onUpdate:modelValue":
|
|
124
|
+
return (g, d) => {
|
|
125
|
+
const o = C("el-image"), w = C("el-icon"), $ = C("el-upload"), m = C("el-image-viewer");
|
|
126
|
+
return u(), E("div", Be, [
|
|
127
|
+
e.multiple ? (u(), E("div", Ee, [
|
|
128
|
+
f(x(Ce), {
|
|
129
|
+
modelValue: h.value,
|
|
130
|
+
"onUpdate:modelValue": d[0] || (d[0] = (A) => h.value = A),
|
|
131
131
|
class: "images-list",
|
|
132
132
|
"item-key": "uid",
|
|
133
133
|
animation: 200,
|
|
134
134
|
disabled: e.disabled,
|
|
135
|
-
onEnd:
|
|
135
|
+
onEnd: D
|
|
136
136
|
}, {
|
|
137
|
-
item:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
src:
|
|
141
|
-
"preview-src-list":
|
|
142
|
-
"initial-index":
|
|
137
|
+
item: r(({ element: A, index: y }) => [
|
|
138
|
+
j("div", Ae, [
|
|
139
|
+
f(o, {
|
|
140
|
+
src: A.url,
|
|
141
|
+
"preview-src-list": h.value.map((S) => S.url),
|
|
142
|
+
"initial-index": y,
|
|
143
143
|
fit: "cover",
|
|
144
144
|
class: "image-preview",
|
|
145
145
|
"preview-teleported": !0,
|
|
146
146
|
"hide-on-click-modal": !0
|
|
147
147
|
}, null, 8, ["src", "preview-src-list", "initial-index"]),
|
|
148
|
-
e.disabled ?
|
|
148
|
+
e.disabled ? R("", !0) : (u(), E("div", {
|
|
149
149
|
key: 0,
|
|
150
150
|
class: "delete-btn",
|
|
151
|
-
onClick:
|
|
151
|
+
onClick: G((S) => k(y), ["stop"])
|
|
152
152
|
}, [
|
|
153
|
-
|
|
154
|
-
default:
|
|
155
|
-
|
|
153
|
+
f(w, { class: "icon-delete" }, {
|
|
154
|
+
default: r(() => [
|
|
155
|
+
f(x(Q))
|
|
156
156
|
]),
|
|
157
157
|
_: 1
|
|
158
158
|
})
|
|
159
|
-
], 8,
|
|
159
|
+
], 8, Ve))
|
|
160
160
|
])
|
|
161
161
|
]),
|
|
162
162
|
_: 1
|
|
163
163
|
}, 8, ["modelValue", "disabled"]),
|
|
164
|
-
!e.disabled && (!e.limit ||
|
|
164
|
+
!e.disabled && (!e.limit || h.value.length < e.limit) ? (u(), _($, {
|
|
165
165
|
key: 0,
|
|
166
166
|
class: "image-uploader",
|
|
167
167
|
"auto-upload": !1,
|
|
168
168
|
"show-file-list": !1,
|
|
169
|
-
"on-change":
|
|
170
|
-
disabled:
|
|
169
|
+
"on-change": p,
|
|
170
|
+
disabled: b.value,
|
|
171
171
|
"list-type": "picture-card",
|
|
172
172
|
accept: e.accept
|
|
173
173
|
}, {
|
|
174
|
-
default:
|
|
175
|
-
|
|
174
|
+
default: r(() => [
|
|
175
|
+
b.value ? (u(), _(w, {
|
|
176
176
|
key: 1,
|
|
177
177
|
class: "uploader-icon is-loading"
|
|
178
178
|
}, {
|
|
179
|
-
default:
|
|
180
|
-
|
|
179
|
+
default: r(() => [
|
|
180
|
+
f(x(se))
|
|
181
181
|
]),
|
|
182
182
|
_: 1
|
|
183
|
-
})) : (
|
|
183
|
+
})) : (u(), _(w, {
|
|
184
184
|
key: 0,
|
|
185
185
|
class: "uploader-icon"
|
|
186
186
|
}, {
|
|
187
|
-
default:
|
|
188
|
-
|
|
187
|
+
default: r(() => [
|
|
188
|
+
f(x(Y))
|
|
189
189
|
]),
|
|
190
190
|
_: 1
|
|
191
191
|
}))
|
|
192
192
|
]),
|
|
193
193
|
_: 1
|
|
194
|
-
}, 8, ["disabled", "accept"])) :
|
|
195
|
-
])) : (
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
src:
|
|
194
|
+
}, 8, ["disabled", "accept"])) : R("", !0)
|
|
195
|
+
])) : (u(), E(Z, { key: 1 }, [
|
|
196
|
+
n.value ? (u(), E("div", Me, [
|
|
197
|
+
f(o, {
|
|
198
|
+
src: n.value,
|
|
199
199
|
fit: "cover",
|
|
200
200
|
class: "image-preview"
|
|
201
201
|
}, null, 8, ["src"]),
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
j("div", Fe, [
|
|
203
|
+
f(w, {
|
|
204
204
|
class: "action-icon",
|
|
205
|
-
onClick:
|
|
205
|
+
onClick: G(c, ["stop"])
|
|
206
206
|
}, {
|
|
207
|
-
default:
|
|
208
|
-
|
|
207
|
+
default: r(() => [
|
|
208
|
+
f(x(be))
|
|
209
209
|
]),
|
|
210
210
|
_: 1
|
|
211
211
|
}),
|
|
212
|
-
e.disabled ?
|
|
212
|
+
e.disabled ? R("", !0) : (u(), _(w, {
|
|
213
213
|
key: 0,
|
|
214
214
|
class: "action-icon",
|
|
215
|
-
onClick:
|
|
215
|
+
onClick: G(v, ["stop"])
|
|
216
216
|
}, {
|
|
217
|
-
default:
|
|
218
|
-
|
|
217
|
+
default: r(() => [
|
|
218
|
+
f(x(Q))
|
|
219
219
|
]),
|
|
220
220
|
_: 1
|
|
221
221
|
}))
|
|
222
222
|
])
|
|
223
|
-
])) : (
|
|
223
|
+
])) : (u(), _($, {
|
|
224
224
|
key: 1,
|
|
225
225
|
class: "image-uploader",
|
|
226
226
|
"auto-upload": !1,
|
|
227
227
|
"show-file-list": !1,
|
|
228
|
-
"on-change":
|
|
229
|
-
disabled: e.disabled ||
|
|
228
|
+
"on-change": p,
|
|
229
|
+
disabled: e.disabled || b.value,
|
|
230
230
|
accept: e.accept,
|
|
231
231
|
"list-type": "picture-card"
|
|
232
232
|
}, {
|
|
233
|
-
default:
|
|
234
|
-
|
|
235
|
-
default:
|
|
236
|
-
|
|
233
|
+
default: r(() => [
|
|
234
|
+
f(w, { class: "uploader-icon" }, {
|
|
235
|
+
default: r(() => [
|
|
236
|
+
b.value ? (u(), _(x(se), {
|
|
237
237
|
key: 1,
|
|
238
238
|
class: "is-loading"
|
|
239
|
-
})) : (
|
|
239
|
+
})) : (u(), _(x(Y), { key: 0 }))
|
|
240
240
|
]),
|
|
241
241
|
_: 1
|
|
242
242
|
})
|
|
243
243
|
]),
|
|
244
244
|
_: 1
|
|
245
245
|
}, 8, ["disabled", "accept"])),
|
|
246
|
-
|
|
246
|
+
s.value ? (u(), _(m, {
|
|
247
247
|
key: 2,
|
|
248
|
-
"url-list": [
|
|
248
|
+
"url-list": [n.value],
|
|
249
249
|
teleported: !0,
|
|
250
|
-
onClose:
|
|
251
|
-
}, null, 8, ["url-list"])) :
|
|
250
|
+
onClose: d[1] || (d[1] = (A) => s.value = !1)
|
|
251
|
+
}, null, 8, ["url-list"])) : R("", !0)
|
|
252
252
|
], 64)),
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
e.multiple && e.limit ? (
|
|
256
|
-
])) :
|
|
253
|
+
x(i) ? (u(), E("div", De, [
|
|
254
|
+
j("span", null, F(e.tip), 1),
|
|
255
|
+
e.multiple && e.limit ? (u(), E("span", Je, " (最多 " + F(e.limit) + " 张)", 1)) : R("", !0)
|
|
256
|
+
])) : R("", !0)
|
|
257
257
|
]);
|
|
258
258
|
};
|
|
259
259
|
}
|
|
260
|
-
}), Te = /* @__PURE__ */ W(
|
|
260
|
+
}), Te = /* @__PURE__ */ W(Oe, [["__scopeId", "data-v-94fad0af"]]), X = /* @__PURE__ */ N({
|
|
261
261
|
name: "JIconRender",
|
|
262
262
|
__name: "JIconRender",
|
|
263
263
|
props: {
|
|
@@ -265,14 +265,14 @@ const $e = ["disabled"], je = {
|
|
|
265
265
|
size: { default: 24 }
|
|
266
266
|
},
|
|
267
267
|
setup(e) {
|
|
268
|
-
return (
|
|
268
|
+
return (l, t) => e.icon ? (u(), _(x(je), he({
|
|
269
269
|
key: 0,
|
|
270
270
|
icon: e.icon,
|
|
271
271
|
width: e.size,
|
|
272
272
|
height: e.size
|
|
273
|
-
},
|
|
273
|
+
}, l.$attrs), null, 16, ["icon", "width", "height"])) : R("", !0);
|
|
274
274
|
}
|
|
275
|
-
}), ze = { class: "action-left" },
|
|
275
|
+
}), ze = { class: "action-left" }, He = /* @__PURE__ */ N({
|
|
276
276
|
name: "JSearchHeader",
|
|
277
277
|
__name: "JSearchHeader",
|
|
278
278
|
props: {
|
|
@@ -285,145 +285,145 @@ const $e = ["disabled"], je = {
|
|
|
285
285
|
showReset: { type: Boolean, default: !0 }
|
|
286
286
|
},
|
|
287
287
|
emits: ["search", "reset", "add", "batchDelete"],
|
|
288
|
-
setup(e, { emit:
|
|
289
|
-
const t = e,
|
|
290
|
-
if (!
|
|
291
|
-
const k = Array.from(
|
|
292
|
-
|
|
293
|
-
const
|
|
294
|
-
if (
|
|
295
|
-
const
|
|
296
|
-
|
|
288
|
+
setup(e, { emit: l }) {
|
|
289
|
+
const t = e, a = l, n = M(), s = M(!1), i = M(!1), c = M(0), v = M(0), h = ce(() => c.value > t.defaultVisible), b = () => {
|
|
290
|
+
if (!n.value) return;
|
|
291
|
+
const k = Array.from(n.value.children);
|
|
292
|
+
c.value = k.length;
|
|
293
|
+
const p = k[t.defaultVisible - 1];
|
|
294
|
+
if (p && n.value) {
|
|
295
|
+
const O = n.value.getBoundingClientRect(), g = p.getBoundingClientRect();
|
|
296
|
+
v.value = g.bottom - O.top;
|
|
297
297
|
}
|
|
298
298
|
}, z = () => {
|
|
299
|
-
const k =
|
|
299
|
+
const k = n.value;
|
|
300
300
|
if (k)
|
|
301
|
-
if (
|
|
302
|
-
|
|
301
|
+
if (s.value)
|
|
302
|
+
b(), s.value = !1, k.style.maxHeight = k.scrollHeight + "px", k.offsetHeight, k.style.maxHeight = v.value + "px";
|
|
303
303
|
else {
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
k.style.maxHeight = "none", k.removeEventListener("transitionend",
|
|
304
|
+
s.value = !0, k.style.maxHeight = k.scrollHeight + "px";
|
|
305
|
+
const p = () => {
|
|
306
|
+
k.style.maxHeight = "none", k.removeEventListener("transitionend", p);
|
|
307
307
|
};
|
|
308
|
-
k.addEventListener("transitionend",
|
|
308
|
+
k.addEventListener("transitionend", p);
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
|
-
let
|
|
312
|
-
return
|
|
313
|
-
|
|
311
|
+
let D = null;
|
|
312
|
+
return ve(() => {
|
|
313
|
+
b(), h.value && n.value && (n.value.style.maxHeight = v.value + "px"), requestAnimationFrame(() => {
|
|
314
314
|
requestAnimationFrame(() => {
|
|
315
|
-
|
|
315
|
+
i.value = !0;
|
|
316
316
|
});
|
|
317
|
-
}),
|
|
318
|
-
|
|
319
|
-
}),
|
|
320
|
-
}),
|
|
321
|
-
|
|
322
|
-
}), (k,
|
|
323
|
-
const
|
|
324
|
-
return
|
|
317
|
+
}), n.value && (D = new MutationObserver(() => {
|
|
318
|
+
b(), h.value && !s.value && n.value && (n.value.style.maxHeight = v.value + "px");
|
|
319
|
+
}), D.observe(n.value, { childList: !0 }));
|
|
320
|
+
}), ge(() => {
|
|
321
|
+
D == null || D.disconnect();
|
|
322
|
+
}), (k, p) => {
|
|
323
|
+
const O = C("el-form"), g = C("el-button"), d = C("el-icon"), o = C("el-card");
|
|
324
|
+
return u(), _(o, {
|
|
325
325
|
shadow: "never",
|
|
326
326
|
class: "j-search-header-card"
|
|
327
327
|
}, {
|
|
328
|
-
default:
|
|
329
|
-
|
|
328
|
+
default: r(() => [
|
|
329
|
+
f(O, {
|
|
330
330
|
inline: "",
|
|
331
331
|
class: "search-form"
|
|
332
332
|
}, {
|
|
333
|
-
default:
|
|
334
|
-
|
|
333
|
+
default: r(() => [
|
|
334
|
+
j("div", {
|
|
335
335
|
ref_key: "formItemsRef",
|
|
336
|
-
ref:
|
|
337
|
-
class:
|
|
336
|
+
ref: n,
|
|
337
|
+
class: q(["form-items-wrapper", { "is-animated": i.value }])
|
|
338
338
|
}, [
|
|
339
|
-
|
|
339
|
+
K(k.$slots, "default", {}, void 0, !0)
|
|
340
340
|
], 2)
|
|
341
341
|
]),
|
|
342
342
|
_: 3
|
|
343
343
|
}),
|
|
344
|
-
|
|
344
|
+
j("div", {
|
|
345
345
|
class: "action-bar",
|
|
346
|
-
style: de({ marginTop:
|
|
346
|
+
style: de({ marginTop: s.value ? "0px" : "10px" })
|
|
347
347
|
}, [
|
|
348
|
-
|
|
349
|
-
e.showAdd ? (
|
|
348
|
+
j("div", ze, [
|
|
349
|
+
e.showAdd ? (u(), _(g, {
|
|
350
350
|
key: 0,
|
|
351
351
|
type: "primary",
|
|
352
|
-
icon:
|
|
353
|
-
onClick:
|
|
352
|
+
icon: x(Y),
|
|
353
|
+
onClick: p[0] || (p[0] = (w) => a("add"))
|
|
354
354
|
}, {
|
|
355
|
-
default:
|
|
356
|
-
T(
|
|
355
|
+
default: r(() => [
|
|
356
|
+
T(F(e.addText), 1)
|
|
357
357
|
]),
|
|
358
358
|
_: 1
|
|
359
|
-
}, 8, ["icon"])) :
|
|
360
|
-
e.showBatchDelete ? (
|
|
359
|
+
}, 8, ["icon"])) : R("", !0),
|
|
360
|
+
e.showBatchDelete ? (u(), _(g, {
|
|
361
361
|
key: 1,
|
|
362
362
|
type: "danger",
|
|
363
|
-
icon:
|
|
363
|
+
icon: x(Q),
|
|
364
364
|
disabled: e.selectedCount === 0,
|
|
365
|
-
onClick:
|
|
365
|
+
onClick: p[1] || (p[1] = (w) => a("batchDelete"))
|
|
366
366
|
}, {
|
|
367
|
-
default:
|
|
368
|
-
T(" 批量删除" +
|
|
367
|
+
default: r(() => [
|
|
368
|
+
T(" 批量删除" + F(e.selectedCount ? `(${e.selectedCount})` : ""), 1)
|
|
369
369
|
]),
|
|
370
370
|
_: 1
|
|
371
|
-
}, 8, ["icon", "disabled"])) :
|
|
372
|
-
e.showSearch ? (
|
|
371
|
+
}, 8, ["icon", "disabled"])) : R("", !0),
|
|
372
|
+
e.showSearch ? (u(), _(g, {
|
|
373
373
|
key: 2,
|
|
374
374
|
type: "primary",
|
|
375
|
-
icon:
|
|
376
|
-
onClick:
|
|
375
|
+
icon: x(_e),
|
|
376
|
+
onClick: p[2] || (p[2] = (w) => a("search"))
|
|
377
377
|
}, {
|
|
378
|
-
default:
|
|
378
|
+
default: r(() => [...p[4] || (p[4] = [
|
|
379
379
|
T("搜索", -1)
|
|
380
380
|
])]),
|
|
381
381
|
_: 1
|
|
382
|
-
}, 8, ["icon"])) :
|
|
383
|
-
e.showReset ? (
|
|
382
|
+
}, 8, ["icon"])) : R("", !0),
|
|
383
|
+
e.showReset ? (u(), _(g, {
|
|
384
384
|
key: 3,
|
|
385
|
-
icon:
|
|
386
|
-
onClick:
|
|
385
|
+
icon: x(we),
|
|
386
|
+
onClick: p[3] || (p[3] = (w) => a("reset"))
|
|
387
387
|
}, {
|
|
388
|
-
default:
|
|
388
|
+
default: r(() => [...p[5] || (p[5] = [
|
|
389
389
|
T("重置", -1)
|
|
390
390
|
])]),
|
|
391
391
|
_: 1
|
|
392
|
-
}, 8, ["icon"])) :
|
|
393
|
-
|
|
392
|
+
}, 8, ["icon"])) : R("", !0),
|
|
393
|
+
K(k.$slots, "actions", {}, void 0, !0)
|
|
394
394
|
]),
|
|
395
|
-
|
|
395
|
+
h.value ? (u(), _(g, {
|
|
396
396
|
key: 0,
|
|
397
397
|
link: "",
|
|
398
398
|
type: "primary",
|
|
399
399
|
onClick: z
|
|
400
400
|
}, {
|
|
401
|
-
default:
|
|
402
|
-
T(
|
|
403
|
-
|
|
404
|
-
class:
|
|
401
|
+
default: r(() => [
|
|
402
|
+
T(F(s.value ? "收起" : "展开") + " ", 1),
|
|
403
|
+
f(d, {
|
|
404
|
+
class: q(["toggle-icon", { "is-expanded": s.value }])
|
|
405
405
|
}, {
|
|
406
|
-
default:
|
|
407
|
-
|
|
406
|
+
default: r(() => [
|
|
407
|
+
f(x(ke))
|
|
408
408
|
]),
|
|
409
409
|
_: 1
|
|
410
410
|
}, 8, ["class"])
|
|
411
411
|
]),
|
|
412
412
|
_: 1
|
|
413
|
-
})) :
|
|
413
|
+
})) : R("", !0)
|
|
414
414
|
], 4)
|
|
415
415
|
]),
|
|
416
416
|
_: 3
|
|
417
417
|
});
|
|
418
418
|
};
|
|
419
419
|
}
|
|
420
|
-
}),
|
|
420
|
+
}), Le = /* @__PURE__ */ W(He, [["__scopeId", "data-v-d3f83c3f"]]), Ne = { class: "j-import-upload-row" }, Pe = { class: "j-import-stat-num" }, Ue = { class: "j-import-stat-num" }, qe = { class: "j-import-stat-num" }, We = {
|
|
421
421
|
key: 0,
|
|
422
422
|
class: "j-import-status-fail"
|
|
423
|
-
},
|
|
423
|
+
}, Ke = { key: 1 }, Xe = /* @__PURE__ */ N({
|
|
424
424
|
name: "JImportExcel",
|
|
425
425
|
__name: "JImportExcel",
|
|
426
|
-
props: /* @__PURE__ */
|
|
426
|
+
props: /* @__PURE__ */ le({
|
|
427
427
|
getFieldListApi: {},
|
|
428
428
|
importApi: {},
|
|
429
429
|
excludeFields: { default: () => ["id", "ctime", "mtime"] },
|
|
@@ -432,120 +432,117 @@ const $e = ["disabled"], je = {
|
|
|
432
432
|
modelValue: { type: Boolean, default: !1 },
|
|
433
433
|
modelModifiers: {}
|
|
434
434
|
}),
|
|
435
|
-
emits: /* @__PURE__ */
|
|
436
|
-
setup(e, { emit:
|
|
437
|
-
const t = e,
|
|
435
|
+
emits: /* @__PURE__ */ le(["success"], ["update:modelValue"]),
|
|
436
|
+
setup(e, { emit: l }) {
|
|
437
|
+
const t = e, a = l, n = ye(e, "modelValue"), s = M(!1), i = M({}), c = M([]), v = M({ total: 0, success: 0, fail: 0 }), h = {
|
|
438
438
|
0: "待创建",
|
|
439
439
|
1: "创建成功",
|
|
440
440
|
2: "创建中",
|
|
441
441
|
[-1]: "创建失败"
|
|
442
|
-
},
|
|
442
|
+
}, b = ce(() => Object.entries(i.value).filter(([d]) => !t.excludeFields.includes(d)).map(([d, o]) => ({ id: d, label: o, prop: d }))), z = async () => {
|
|
443
443
|
try {
|
|
444
|
-
const
|
|
445
|
-
|
|
444
|
+
const d = await t.getFieldListApi();
|
|
445
|
+
i.value = d.data.tableFieldsInfo ?? {};
|
|
446
446
|
} catch {
|
|
447
|
-
|
|
447
|
+
I.error("获取字段列表失败");
|
|
448
448
|
}
|
|
449
|
-
},
|
|
450
|
-
const o =
|
|
449
|
+
}, D = (d) => {
|
|
450
|
+
const o = d.raw;
|
|
451
451
|
if (!o) return;
|
|
452
452
|
if (![
|
|
453
453
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
454
454
|
"application/vnd.ms-excel"
|
|
455
455
|
].includes(o.type) && !o.name.match(/\.xlsx?$/i)) {
|
|
456
|
-
|
|
456
|
+
I.warning("请上传 .xlsx 或 .xls 格式文件");
|
|
457
457
|
return;
|
|
458
458
|
}
|
|
459
|
-
const
|
|
460
|
-
|
|
459
|
+
const $ = new FileReader();
|
|
460
|
+
$.onload = (m) => {
|
|
461
461
|
try {
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}).slice(1).filter((H) => H.some((R) => R !== ""));
|
|
466
|
-
if (!O.length) {
|
|
467
|
-
x.warning("文件内容为空");
|
|
462
|
+
const A = U.read(m.target.result, { type: "binary" }), y = A.SheetNames[0], S = A.Sheets[y], V = U.utils.sheet_to_json(S);
|
|
463
|
+
if (!V.length) {
|
|
464
|
+
I.warning("文件内容为空");
|
|
468
465
|
return;
|
|
469
466
|
}
|
|
470
|
-
const L =
|
|
471
|
-
const
|
|
472
|
-
return
|
|
473
|
-
|
|
474
|
-
}),
|
|
467
|
+
const H = b.value.map((L) => L.prop), J = V.map((L) => {
|
|
468
|
+
const B = Object.values(L), P = { _status: 0, _error: "" };
|
|
469
|
+
return H.forEach((ae, pe) => {
|
|
470
|
+
P[ae] = B[pe];
|
|
471
|
+
}), P;
|
|
475
472
|
});
|
|
476
|
-
|
|
473
|
+
c.value = J, v.value = { total: J.length, success: 0, fail: 0 };
|
|
477
474
|
} catch {
|
|
478
|
-
|
|
475
|
+
I.error("解析文件失败,请检查文件格式");
|
|
479
476
|
}
|
|
480
|
-
},
|
|
481
|
-
}, k = (
|
|
482
|
-
|
|
483
|
-
},
|
|
484
|
-
const
|
|
485
|
-
if (!
|
|
486
|
-
|
|
477
|
+
}, $.readAsBinaryString(o);
|
|
478
|
+
}, k = (d) => {
|
|
479
|
+
c.value.splice(d, 1), v.value.total = c.value.length;
|
|
480
|
+
}, p = async () => {
|
|
481
|
+
const d = c.value.filter((o) => o._status === 0).map(({ _status: o, _error: w, ...$ }) => $);
|
|
482
|
+
if (!d.length) {
|
|
483
|
+
I.warning("没有可导入的数据");
|
|
487
484
|
return;
|
|
488
485
|
}
|
|
489
|
-
|
|
486
|
+
s.value = !0;
|
|
490
487
|
try {
|
|
491
|
-
const o = await t.importApi(
|
|
492
|
-
o.code === 1 ? (
|
|
493
|
-
|
|
494
|
-
}),
|
|
488
|
+
const o = await t.importApi(d);
|
|
489
|
+
o.code === 1 ? (c.value.forEach((w) => {
|
|
490
|
+
w._status === 0 && (w._status = 1);
|
|
491
|
+
}), v.value.success = c.value.filter((w) => w._status === 1).length, I.success("导入成功"), a("success")) : I.error(o.msg || "导入失败");
|
|
495
492
|
} catch {
|
|
496
|
-
|
|
493
|
+
I.error("导入失败,请重试");
|
|
497
494
|
} finally {
|
|
498
|
-
|
|
495
|
+
s.value = !1;
|
|
499
496
|
}
|
|
500
|
-
},
|
|
497
|
+
}, O = () => {
|
|
501
498
|
try {
|
|
502
|
-
const
|
|
503
|
-
o.forEach((
|
|
504
|
-
const
|
|
505
|
-
|
|
499
|
+
const d = U.utils.book_new(), o = b.value.map((m) => m.label), w = {};
|
|
500
|
+
o.forEach((m) => w[m] = "");
|
|
501
|
+
const $ = U.utils.json_to_sheet([w]);
|
|
502
|
+
U.utils.book_append_sheet(d, $, "模板"), U.writeFile(d, "导入模板.xlsx");
|
|
506
503
|
} catch {
|
|
507
|
-
|
|
504
|
+
I.error("模板下载失败");
|
|
508
505
|
}
|
|
509
|
-
},
|
|
510
|
-
|
|
506
|
+
}, g = () => {
|
|
507
|
+
s.value || (n.value = !1, c.value = [], v.value = { total: 0, success: 0, fail: 0 });
|
|
511
508
|
};
|
|
512
|
-
return (
|
|
513
|
-
const
|
|
514
|
-
return
|
|
515
|
-
modelValue:
|
|
516
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
509
|
+
return (d, o) => {
|
|
510
|
+
const w = C("el-divider"), $ = C("el-button"), m = C("el-upload"), A = C("el-link"), y = C("el-card"), S = C("el-col"), V = C("el-row"), H = C("el-table-column"), J = C("el-table"), L = C("el-dialog");
|
|
511
|
+
return u(), _(L, {
|
|
512
|
+
modelValue: n.value,
|
|
513
|
+
"onUpdate:modelValue": o[0] || (o[0] = (B) => n.value = B),
|
|
517
514
|
title: t.title,
|
|
518
515
|
width: "900px",
|
|
519
516
|
"close-on-click-modal": !1,
|
|
520
517
|
onOpen: z,
|
|
521
|
-
onClose:
|
|
518
|
+
onClose: g
|
|
522
519
|
}, {
|
|
523
|
-
footer:
|
|
524
|
-
|
|
525
|
-
default:
|
|
520
|
+
footer: r(() => [
|
|
521
|
+
f($, { onClick: g }, {
|
|
522
|
+
default: r(() => [...o[9] || (o[9] = [
|
|
526
523
|
T("关闭", -1)
|
|
527
524
|
])]),
|
|
528
525
|
_: 1
|
|
529
526
|
})
|
|
530
527
|
]),
|
|
531
|
-
default:
|
|
532
|
-
|
|
528
|
+
default: r(() => [
|
|
529
|
+
f(y, {
|
|
533
530
|
shadow: "never",
|
|
534
531
|
class: "j-import-upload-card"
|
|
535
532
|
}, {
|
|
536
|
-
default:
|
|
537
|
-
o[3] || (o[3] =
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
m
|
|
533
|
+
default: r(() => [
|
|
534
|
+
o[3] || (o[3] = j("div", { class: "j-import-upload-card-title" }, "导入 EXCEL", -1)),
|
|
535
|
+
f(w, { style: { margin: "10px 0" } }),
|
|
536
|
+
j("div", Ne, [
|
|
537
|
+
f(m, {
|
|
541
538
|
accept: ".xlsx,.xls",
|
|
542
539
|
"auto-upload": !1,
|
|
543
540
|
"show-file-list": !1,
|
|
544
|
-
"on-change":
|
|
541
|
+
"on-change": D
|
|
545
542
|
}, {
|
|
546
|
-
default:
|
|
547
|
-
|
|
548
|
-
default:
|
|
543
|
+
default: r(() => [
|
|
544
|
+
f($, { size: "small" }, {
|
|
545
|
+
default: r(() => [...o[1] || (o[1] = [
|
|
549
546
|
T("点击上传", -1)
|
|
550
547
|
])]),
|
|
551
548
|
_: 1
|
|
@@ -553,58 +550,58 @@ const $e = ["disabled"], je = {
|
|
|
553
550
|
]),
|
|
554
551
|
_: 1
|
|
555
552
|
}),
|
|
556
|
-
|
|
553
|
+
b.value.length ? (u(), _(A, {
|
|
557
554
|
key: 0,
|
|
558
555
|
type: "primary",
|
|
559
556
|
class: "j-import-no-wrap",
|
|
560
|
-
onClick:
|
|
557
|
+
onClick: O
|
|
561
558
|
}, {
|
|
562
|
-
default:
|
|
559
|
+
default: r(() => [...o[2] || (o[2] = [
|
|
563
560
|
T(" 下载导入模板.xlsx ", -1)
|
|
564
561
|
])]),
|
|
565
562
|
_: 1
|
|
566
|
-
})) :
|
|
563
|
+
})) : R("", !0)
|
|
567
564
|
])
|
|
568
565
|
]),
|
|
569
566
|
_: 1
|
|
570
567
|
}),
|
|
571
|
-
|
|
568
|
+
f(V, {
|
|
572
569
|
class: "j-import-stats-row",
|
|
573
570
|
gutter: 20,
|
|
574
571
|
align: "middle"
|
|
575
572
|
}, {
|
|
576
|
-
default:
|
|
577
|
-
|
|
578
|
-
default:
|
|
579
|
-
|
|
580
|
-
default:
|
|
581
|
-
|
|
573
|
+
default: r(() => [
|
|
574
|
+
f(S, { span: 18 }, {
|
|
575
|
+
default: r(() => [
|
|
576
|
+
f(V, { class: "j-import-stats-cols" }, {
|
|
577
|
+
default: r(() => [
|
|
578
|
+
f(S, {
|
|
582
579
|
span: 4,
|
|
583
580
|
class: "j-import-stat-item"
|
|
584
581
|
}, {
|
|
585
|
-
default:
|
|
586
|
-
|
|
587
|
-
o[4] || (o[4] =
|
|
582
|
+
default: r(() => [
|
|
583
|
+
j("div", Pe, F(v.value.total), 1),
|
|
584
|
+
o[4] || (o[4] = j("div", { class: "j-import-stat-label" }, "导入数量", -1))
|
|
588
585
|
]),
|
|
589
586
|
_: 1
|
|
590
587
|
}),
|
|
591
|
-
|
|
588
|
+
f(S, {
|
|
592
589
|
span: 4,
|
|
593
590
|
class: "j-import-stat-item"
|
|
594
591
|
}, {
|
|
595
|
-
default:
|
|
596
|
-
|
|
597
|
-
o[5] || (o[5] =
|
|
592
|
+
default: r(() => [
|
|
593
|
+
j("div", Ue, F(v.value.fail), 1),
|
|
594
|
+
o[5] || (o[5] = j("div", { class: "j-import-stat-label" }, "失败数量", -1))
|
|
598
595
|
]),
|
|
599
596
|
_: 1
|
|
600
597
|
}),
|
|
601
|
-
|
|
598
|
+
f(S, {
|
|
602
599
|
span: 4,
|
|
603
600
|
class: "j-import-stat-item"
|
|
604
601
|
}, {
|
|
605
|
-
default:
|
|
606
|
-
|
|
607
|
-
o[6] || (o[6] =
|
|
602
|
+
default: r(() => [
|
|
603
|
+
j("div", qe, F(v.value.success), 1),
|
|
604
|
+
o[6] || (o[6] = j("div", { class: "j-import-stat-label" }, "成功数量", -1))
|
|
608
605
|
]),
|
|
609
606
|
_: 1
|
|
610
607
|
})
|
|
@@ -614,19 +611,19 @@ const $e = ["disabled"], je = {
|
|
|
614
611
|
]),
|
|
615
612
|
_: 1
|
|
616
613
|
}),
|
|
617
|
-
|
|
614
|
+
f(S, {
|
|
618
615
|
span: 6,
|
|
619
616
|
class: "j-import-confirm-col"
|
|
620
617
|
}, {
|
|
621
|
-
default:
|
|
622
|
-
|
|
618
|
+
default: r(() => [
|
|
619
|
+
f($, {
|
|
623
620
|
type: "primary",
|
|
624
621
|
size: "small",
|
|
625
|
-
loading:
|
|
626
|
-
disabled: !
|
|
627
|
-
onClick:
|
|
622
|
+
loading: s.value,
|
|
623
|
+
disabled: !c.value.length,
|
|
624
|
+
onClick: p
|
|
628
625
|
}, {
|
|
629
|
-
default:
|
|
626
|
+
default: r(() => [...o[7] || (o[7] = [
|
|
630
627
|
T(" 确认导入 ", -1)
|
|
631
628
|
])]),
|
|
632
629
|
_: 1
|
|
@@ -637,49 +634,49 @@ const $e = ["disabled"], je = {
|
|
|
637
634
|
]),
|
|
638
635
|
_: 1
|
|
639
636
|
}),
|
|
640
|
-
|
|
641
|
-
data:
|
|
637
|
+
f(J, {
|
|
638
|
+
data: c.value,
|
|
642
639
|
border: "",
|
|
643
640
|
size: "small",
|
|
644
641
|
"max-height": "360",
|
|
645
642
|
class: "j-import-data-table"
|
|
646
643
|
}, {
|
|
647
|
-
default:
|
|
648
|
-
(
|
|
649
|
-
key:
|
|
650
|
-
prop:
|
|
651
|
-
label:
|
|
644
|
+
default: r(() => [
|
|
645
|
+
(u(!0), E(Z, null, te(b.value, (B) => (u(), _(H, {
|
|
646
|
+
key: B.prop,
|
|
647
|
+
prop: B.prop,
|
|
648
|
+
label: B.label,
|
|
652
649
|
"min-width": 120,
|
|
653
650
|
"show-overflow-tooltip": ""
|
|
654
651
|
}, null, 8, ["prop", "label"]))), 128)),
|
|
655
|
-
|
|
652
|
+
f(H, {
|
|
656
653
|
label: "状态",
|
|
657
654
|
width: "110",
|
|
658
655
|
align: "center",
|
|
659
656
|
fixed: "right"
|
|
660
657
|
}, {
|
|
661
|
-
default:
|
|
662
|
-
|
|
658
|
+
default: r(({ row: B }) => [
|
|
659
|
+
B._status === -1 ? (u(), E("span", We, F(B._error || "创建失败"), 1)) : (u(), E("span", Ke, F(h[B._status]), 1))
|
|
663
660
|
]),
|
|
664
661
|
_: 1
|
|
665
662
|
}),
|
|
666
|
-
|
|
663
|
+
f(H, {
|
|
667
664
|
label: "操作",
|
|
668
665
|
width: "80",
|
|
669
666
|
align: "center",
|
|
670
667
|
fixed: "right"
|
|
671
668
|
}, {
|
|
672
|
-
default:
|
|
673
|
-
|
|
669
|
+
default: r(({ $index: B, row: P }) => [
|
|
670
|
+
P._status === 0 ? (u(), _($, {
|
|
674
671
|
key: 0,
|
|
675
672
|
size: "small",
|
|
676
|
-
onClick: (
|
|
673
|
+
onClick: (ae) => k(B)
|
|
677
674
|
}, {
|
|
678
|
-
default:
|
|
675
|
+
default: r(() => [...o[8] || (o[8] = [
|
|
679
676
|
T(" 删除 ", -1)
|
|
680
677
|
])]),
|
|
681
678
|
_: 1
|
|
682
|
-
}, 8, ["onClick"])) :
|
|
679
|
+
}, 8, ["onClick"])) : R("", !0)
|
|
683
680
|
]),
|
|
684
681
|
_: 1
|
|
685
682
|
})
|
|
@@ -691,7 +688,7 @@ const $e = ["disabled"], je = {
|
|
|
691
688
|
}, 8, ["modelValue", "title"]);
|
|
692
689
|
};
|
|
693
690
|
}
|
|
694
|
-
}),
|
|
691
|
+
}), Ze = /* @__PURE__ */ W(Xe, [["__scopeId", "data-v-bd8f8139"]]), Ge = { class: "j-sidebar__menu-item-title" }, Qe = /* @__PURE__ */ N({
|
|
695
692
|
name: "JSideMenuItem",
|
|
696
693
|
__name: "JSideMenuItem",
|
|
697
694
|
props: {
|
|
@@ -700,54 +697,54 @@ const $e = ["disabled"], je = {
|
|
|
700
697
|
depth: { default: 0 }
|
|
701
698
|
},
|
|
702
699
|
emits: ["menu-click"],
|
|
703
|
-
setup(e, { emit:
|
|
704
|
-
const t = e,
|
|
705
|
-
|
|
700
|
+
setup(e, { emit: l }) {
|
|
701
|
+
const t = e, a = l, n = () => {
|
|
702
|
+
a("menu-click", t.menuItem);
|
|
706
703
|
};
|
|
707
|
-
return (
|
|
708
|
-
const
|
|
709
|
-
return e.menuItem.children && e.menuItem.children.length > 0 ? (
|
|
704
|
+
return (s, i) => {
|
|
705
|
+
const c = C("JSideMenuItem", !0), v = C("el-sub-menu"), h = C("el-menu-item");
|
|
706
|
+
return e.menuItem.children && e.menuItem.children.length > 0 ? (u(), _(v, {
|
|
710
707
|
key: 0,
|
|
711
708
|
index: e.menuItem.path,
|
|
712
|
-
class:
|
|
709
|
+
class: q([`j-sidebar__depth-${e.depth}`])
|
|
713
710
|
}, {
|
|
714
|
-
title:
|
|
715
|
-
e.menuItem.icon && e.depth === 0 ? (
|
|
711
|
+
title: r(() => [
|
|
712
|
+
e.menuItem.icon && e.depth === 0 ? (u(), _(x(X), {
|
|
716
713
|
key: 0,
|
|
717
714
|
icon: e.menuItem.icon
|
|
718
|
-
}, null, 8, ["icon"])) :
|
|
719
|
-
|
|
715
|
+
}, null, 8, ["icon"])) : R("", !0),
|
|
716
|
+
j("span", Ge, F(e.menuItem.title || e.menuItem.name), 1)
|
|
720
717
|
]),
|
|
721
|
-
default:
|
|
722
|
-
(
|
|
723
|
-
key:
|
|
724
|
-
"menu-item":
|
|
718
|
+
default: r(() => [
|
|
719
|
+
(u(!0), E(Z, null, te(e.menuItem.children, (b) => (u(), _(c, {
|
|
720
|
+
key: b.path,
|
|
721
|
+
"menu-item": b,
|
|
725
722
|
"is-collapse": e.isCollapse,
|
|
726
723
|
depth: e.depth + 1,
|
|
727
|
-
onMenuClick:
|
|
724
|
+
onMenuClick: i[0] || (i[0] = (z) => a("menu-click", z))
|
|
728
725
|
}, null, 8, ["menu-item", "is-collapse", "depth"]))), 128))
|
|
729
726
|
]),
|
|
730
727
|
_: 1
|
|
731
|
-
}, 8, ["index", "class"])) : (
|
|
728
|
+
}, 8, ["index", "class"])) : (u(), _(h, {
|
|
732
729
|
key: 1,
|
|
733
730
|
index: e.menuItem.path,
|
|
734
|
-
class:
|
|
735
|
-
onClick:
|
|
731
|
+
class: q([`j-sidebar__depth-${e.depth}`]),
|
|
732
|
+
onClick: n
|
|
736
733
|
}, {
|
|
737
|
-
title:
|
|
738
|
-
|
|
734
|
+
title: r(() => [
|
|
735
|
+
j("span", null, F(e.menuItem.title || e.menuItem.name), 1)
|
|
739
736
|
]),
|
|
740
|
-
default:
|
|
741
|
-
e.menuItem.icon && e.depth === 0 ? (
|
|
737
|
+
default: r(() => [
|
|
738
|
+
e.menuItem.icon && e.depth === 0 ? (u(), _(x(X), {
|
|
742
739
|
key: 0,
|
|
743
740
|
icon: e.menuItem.icon
|
|
744
|
-
}, null, 8, ["icon"])) :
|
|
741
|
+
}, null, 8, ["icon"])) : R("", !0)
|
|
745
742
|
]),
|
|
746
743
|
_: 1
|
|
747
744
|
}, 8, ["index", "class"]));
|
|
748
745
|
};
|
|
749
746
|
}
|
|
750
|
-
}), me = /* @__PURE__ */ W(
|
|
747
|
+
}), me = /* @__PURE__ */ W(Qe, [["__scopeId", "data-v-3787a646"]]), Ye = { class: "j-sidebar__logo" }, et = { class: "j-sidebar__title" }, tt = { class: "j-sidebar__menu-wrapper" }, nt = { class: "j-sidebar__footer" }, at = /* @__PURE__ */ N({
|
|
751
748
|
name: "JSidebar",
|
|
752
749
|
__name: "JSidebar",
|
|
753
750
|
props: {
|
|
@@ -761,58 +758,58 @@ const $e = ["disabled"], je = {
|
|
|
761
758
|
router: { type: Boolean, default: !0 }
|
|
762
759
|
},
|
|
763
760
|
emits: ["update:collapsed", "menu-click"],
|
|
764
|
-
setup(e, { emit:
|
|
765
|
-
const t = e,
|
|
766
|
-
ue(() => t.collapsed, (
|
|
767
|
-
|
|
761
|
+
setup(e, { emit: l }) {
|
|
762
|
+
const t = e, a = l, n = M(t.collapsed);
|
|
763
|
+
ue(() => t.collapsed, (i) => {
|
|
764
|
+
n.value = i;
|
|
768
765
|
});
|
|
769
|
-
const
|
|
770
|
-
|
|
766
|
+
const s = () => {
|
|
767
|
+
n.value = !n.value, a("update:collapsed", n.value);
|
|
771
768
|
};
|
|
772
|
-
return (
|
|
773
|
-
const
|
|
774
|
-
return
|
|
775
|
-
class:
|
|
776
|
-
style: de({ width:
|
|
769
|
+
return (i, c) => {
|
|
770
|
+
const v = C("el-menu");
|
|
771
|
+
return u(), E("div", {
|
|
772
|
+
class: q(["j-sidebar", n.value ? "j-sidebar--collapsed" : "j-sidebar--expanded"]),
|
|
773
|
+
style: de({ width: n.value ? `${e.collapsedWidth}px` : `${e.expandedWidth}px` })
|
|
777
774
|
}, [
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
var
|
|
775
|
+
j("div", Ye, [
|
|
776
|
+
K(i.$slots, "logo", { collapsed: n.value }, () => {
|
|
777
|
+
var h;
|
|
781
778
|
return [
|
|
782
|
-
|
|
779
|
+
j("h2", et, F(n.value ? e.collapsedTitle || ((h = e.title) == null ? void 0 : h.charAt(0)) || "" : e.title), 1)
|
|
783
780
|
];
|
|
784
781
|
}, !0)
|
|
785
782
|
]),
|
|
786
|
-
|
|
787
|
-
|
|
783
|
+
j("div", tt, [
|
|
784
|
+
f(v, {
|
|
788
785
|
"default-active": e.activeMenu,
|
|
789
786
|
class: "j-sidebar__menu",
|
|
790
787
|
router: e.router,
|
|
791
|
-
collapse:
|
|
788
|
+
collapse: n.value,
|
|
792
789
|
"collapse-transition": !1
|
|
793
790
|
}, {
|
|
794
|
-
default:
|
|
795
|
-
(
|
|
796
|
-
key:
|
|
797
|
-
"menu-item":
|
|
798
|
-
"is-collapse":
|
|
799
|
-
onMenuClick:
|
|
791
|
+
default: r(() => [
|
|
792
|
+
(u(!0), E(Z, null, te(e.menus, (h) => (u(), _(me, {
|
|
793
|
+
key: h.path,
|
|
794
|
+
"menu-item": h,
|
|
795
|
+
"is-collapse": n.value,
|
|
796
|
+
onMenuClick: c[0] || (c[0] = (b) => a("menu-click", b))
|
|
800
797
|
}, null, 8, ["menu-item", "is-collapse"]))), 128))
|
|
801
798
|
]),
|
|
802
799
|
_: 1
|
|
803
800
|
}, 8, ["default-active", "router", "collapse"])
|
|
804
801
|
]),
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
collapsed:
|
|
808
|
-
toggle:
|
|
802
|
+
j("div", nt, [
|
|
803
|
+
K(i.$slots, "footer", {
|
|
804
|
+
collapsed: n.value,
|
|
805
|
+
toggle: s
|
|
809
806
|
}, () => [
|
|
810
|
-
|
|
807
|
+
j("button", {
|
|
811
808
|
class: "j-sidebar__collapse-btn",
|
|
812
|
-
onClick:
|
|
809
|
+
onClick: s
|
|
813
810
|
}, [
|
|
814
|
-
|
|
815
|
-
icon:
|
|
811
|
+
f(x(X), {
|
|
812
|
+
icon: n.value ? "mdi:chevron-right" : "mdi:chevron-left"
|
|
816
813
|
}, null, 8, ["icon"])
|
|
817
814
|
])
|
|
818
815
|
], !0)
|
|
@@ -820,36 +817,36 @@ const $e = ["disabled"], je = {
|
|
|
820
817
|
], 6);
|
|
821
818
|
};
|
|
822
819
|
}
|
|
823
|
-
}),
|
|
824
|
-
function ne(e,
|
|
825
|
-
return Array.isArray(e) ? e.map((t) => ne(t,
|
|
820
|
+
}), lt = /* @__PURE__ */ W(at, [["__scopeId", "data-v-2e746199"]]);
|
|
821
|
+
function ne(e, l) {
|
|
822
|
+
return Array.isArray(e) ? e.map((t) => ne(t, l)) : e !== null && typeof e == "object" && !(e instanceof Date) ? l(e) : e;
|
|
826
823
|
}
|
|
827
|
-
function
|
|
824
|
+
function st(e, l = []) {
|
|
828
825
|
return Object.fromEntries(
|
|
829
|
-
Object.entries(e).map(([t,
|
|
830
|
-
const
|
|
831
|
-
return
|
|
826
|
+
Object.entries(e).map(([t, a]) => {
|
|
827
|
+
const n = ne(a, (i) => st(i, l));
|
|
828
|
+
return l.includes(t) ? [t, n] : [t.replace(/([A-Z])/g, "_$1").toLowerCase(), n];
|
|
832
829
|
})
|
|
833
830
|
);
|
|
834
831
|
}
|
|
835
|
-
function
|
|
832
|
+
function ot(e, l = []) {
|
|
836
833
|
return Object.fromEntries(
|
|
837
|
-
Object.entries(e).map(([t,
|
|
838
|
-
const
|
|
839
|
-
return
|
|
834
|
+
Object.entries(e).map(([t, a]) => {
|
|
835
|
+
const n = ne(a, (i) => ot(i, l));
|
|
836
|
+
return l.includes(t) ? [t, n] : [t.replace(/_([a-z])/g, (i, c) => c.toUpperCase()), n];
|
|
840
837
|
})
|
|
841
838
|
);
|
|
842
839
|
}
|
|
843
|
-
function
|
|
840
|
+
function _t(e, l) {
|
|
844
841
|
const t = {};
|
|
845
|
-
for (const
|
|
846
|
-
|
|
842
|
+
for (const a of l)
|
|
843
|
+
a in e && (t[a] = e[a]);
|
|
847
844
|
return t;
|
|
848
845
|
}
|
|
849
|
-
function
|
|
846
|
+
function wt(e, l) {
|
|
850
847
|
const t = { ...e };
|
|
851
|
-
for (const
|
|
852
|
-
delete t[
|
|
848
|
+
for (const a of l)
|
|
849
|
+
delete t[a];
|
|
853
850
|
return t;
|
|
854
851
|
}
|
|
855
852
|
function oe(e) {
|
|
@@ -857,217 +854,244 @@ function oe(e) {
|
|
|
857
854
|
if (e instanceof Date) return new Date(e.getTime());
|
|
858
855
|
if (e instanceof RegExp) return new RegExp(e.source, e.flags);
|
|
859
856
|
if (Array.isArray(e)) return e.map((t) => oe(t));
|
|
860
|
-
const
|
|
857
|
+
const l = {};
|
|
861
858
|
for (const t of Object.keys(e))
|
|
862
|
-
|
|
863
|
-
return
|
|
859
|
+
l[t] = oe(e[t]);
|
|
860
|
+
return l;
|
|
864
861
|
}
|
|
865
|
-
function
|
|
862
|
+
function it(e, l = !1) {
|
|
866
863
|
const t = {};
|
|
867
|
-
for (const [
|
|
868
|
-
if (!(
|
|
869
|
-
if (
|
|
870
|
-
const
|
|
871
|
-
Object.keys(
|
|
864
|
+
for (const [a, n] of Object.entries(e))
|
|
865
|
+
if (!(n == null || n === ""))
|
|
866
|
+
if (l && typeof n == "object" && !Array.isArray(n) && !(n instanceof Date)) {
|
|
867
|
+
const s = it(n, !0);
|
|
868
|
+
Object.keys(s).length > 0 && (t[a] = s);
|
|
872
869
|
} else
|
|
873
|
-
t[
|
|
870
|
+
t[a] = n;
|
|
874
871
|
return t;
|
|
875
872
|
}
|
|
876
|
-
function
|
|
877
|
-
const
|
|
878
|
-
for (const [
|
|
879
|
-
const
|
|
880
|
-
|
|
873
|
+
function rt(e, l = "", t = ".") {
|
|
874
|
+
const a = {};
|
|
875
|
+
for (const [n, s] of Object.entries(e)) {
|
|
876
|
+
const i = l ? `${l}${t}${n}` : n;
|
|
877
|
+
s !== null && typeof s == "object" && !Array.isArray(s) && !(s instanceof Date) ? Object.assign(a, rt(s, i, t)) : a[i] = s;
|
|
881
878
|
}
|
|
882
|
-
return
|
|
879
|
+
return a;
|
|
883
880
|
}
|
|
884
|
-
function kt(e,
|
|
881
|
+
function kt(e, l = ".") {
|
|
885
882
|
const t = {};
|
|
886
|
-
for (const [
|
|
887
|
-
const
|
|
888
|
-
let
|
|
889
|
-
for (let
|
|
890
|
-
const
|
|
891
|
-
|
|
883
|
+
for (const [a, n] of Object.entries(e)) {
|
|
884
|
+
const s = a.split(l);
|
|
885
|
+
let i = t;
|
|
886
|
+
for (let c = 0; c < s.length - 1; c++) {
|
|
887
|
+
const v = s[c];
|
|
888
|
+
v in i || (i[v] = {}), i = i[v];
|
|
892
889
|
}
|
|
893
|
-
|
|
890
|
+
i[s[s.length - 1]] = n;
|
|
894
891
|
}
|
|
895
892
|
return t;
|
|
896
893
|
}
|
|
897
|
-
function
|
|
898
|
-
return Object.entries(e).map(([
|
|
899
|
-
id:
|
|
894
|
+
function Ct(e) {
|
|
895
|
+
return Object.entries(e).map(([l, t]) => ({
|
|
896
|
+
id: l,
|
|
900
897
|
label: t,
|
|
901
|
-
prop:
|
|
898
|
+
prop: l
|
|
902
899
|
}));
|
|
903
900
|
}
|
|
904
|
-
function
|
|
901
|
+
function ut(e, l) {
|
|
905
902
|
if (!e) return null;
|
|
906
903
|
let t = e.replace(/^@\//, "");
|
|
907
904
|
t.startsWith("views/") || (t = `views/${t}`), t.endsWith(".vue") || (t = `${t}.vue`);
|
|
908
|
-
const
|
|
909
|
-
return
|
|
905
|
+
const a = `/src/${t}`;
|
|
906
|
+
return l[a] ?? l["/src/views/common/NotFound.vue"] ?? null;
|
|
910
907
|
}
|
|
911
|
-
function
|
|
912
|
-
const
|
|
913
|
-
return e.forEach((
|
|
914
|
-
const
|
|
915
|
-
if (!
|
|
916
|
-
t.push(
|
|
908
|
+
function ct(e) {
|
|
909
|
+
const l = /* @__PURE__ */ new Map(), t = [];
|
|
910
|
+
return e.forEach((a) => l.set(a.name, { ...a, children: [] })), e.forEach((a) => {
|
|
911
|
+
const n = l.get(a.name);
|
|
912
|
+
if (!a.parent_name)
|
|
913
|
+
t.push(n);
|
|
917
914
|
else {
|
|
918
|
-
const
|
|
919
|
-
|
|
915
|
+
const s = l.get(a.parent_name);
|
|
916
|
+
s ? (s.children ?? (s.children = []), s.children.push(n)) : t.push(n);
|
|
920
917
|
}
|
|
921
918
|
}), t;
|
|
922
919
|
}
|
|
923
|
-
function fe(e,
|
|
924
|
-
return e.filter((
|
|
925
|
-
var
|
|
926
|
-
const
|
|
927
|
-
path:
|
|
928
|
-
name:
|
|
920
|
+
function fe(e, l, t) {
|
|
921
|
+
return e.filter((a) => !t || !a.project || a.project === t).map((a) => {
|
|
922
|
+
var i;
|
|
923
|
+
const n = {
|
|
924
|
+
path: a.path,
|
|
925
|
+
name: a.name,
|
|
929
926
|
meta: {
|
|
930
|
-
requiresAuth:
|
|
931
|
-
title:
|
|
932
|
-
permissions:
|
|
933
|
-
params:
|
|
927
|
+
requiresAuth: a.requiresAuth === 1,
|
|
928
|
+
title: a.title,
|
|
929
|
+
permissions: a.permissions ? a.permissions.split(",").map((c) => c.trim()).filter(Boolean) : [],
|
|
930
|
+
params: a.params ? a.params.split("&").map((c) => c.trim()).filter(Boolean) : []
|
|
934
931
|
}
|
|
935
|
-
},
|
|
936
|
-
return
|
|
932
|
+
}, s = ut(a.component, l);
|
|
933
|
+
return s && (n.component = s), a.redirect && (n.redirect = a.redirect), (i = a.children) != null && i.length && (n.children = fe(a.children, l, t)), n;
|
|
937
934
|
});
|
|
938
935
|
}
|
|
939
|
-
function
|
|
940
|
-
const
|
|
941
|
-
|
|
942
|
-
)
|
|
943
|
-
|
|
936
|
+
function jt(e, l, t, a) {
|
|
937
|
+
const n = /* @__PURE__ */ new Map();
|
|
938
|
+
e.forEach((i) => n.set(i.name, i));
|
|
939
|
+
const s = (i) => {
|
|
940
|
+
let c = i.parent_name;
|
|
941
|
+
const v = /* @__PURE__ */ new Set();
|
|
942
|
+
for (; c; ) {
|
|
943
|
+
if (c === t) return !0;
|
|
944
|
+
if (v.has(c)) return !1;
|
|
945
|
+
v.add(c);
|
|
946
|
+
const h = n.get(c);
|
|
947
|
+
if (!h) return !1;
|
|
948
|
+
c = h.parent_name;
|
|
949
|
+
}
|
|
950
|
+
return !1;
|
|
951
|
+
};
|
|
952
|
+
return e.filter(
|
|
953
|
+
(i) => i.name !== t && i.is_show === 1 && i.component && l.includes(i.code) && s(i) && (!a || !i.project || i.project === a)
|
|
954
|
+
).sort((i, c) => i.sorts - c.sorts)[0];
|
|
944
955
|
}
|
|
945
|
-
|
|
956
|
+
ee.configure({ showSpinner: !1 });
|
|
946
957
|
const ie = (...e) => {
|
|
947
958
|
}, re = (...e) => {
|
|
948
|
-
},
|
|
959
|
+
}, dt = (...e) => {
|
|
949
960
|
console.error("[Router]", ...e);
|
|
950
961
|
};
|
|
951
|
-
function $t(e,
|
|
962
|
+
function $t(e, l) {
|
|
952
963
|
const {
|
|
953
964
|
getRouteStore: t,
|
|
954
|
-
getPermissionStore:
|
|
955
|
-
getUserStore:
|
|
956
|
-
isAuthenticated:
|
|
957
|
-
viewModules:
|
|
958
|
-
homeComponent:
|
|
959
|
-
notFoundComponent:
|
|
960
|
-
projectName:
|
|
961
|
-
layoutRouteName:
|
|
965
|
+
getPermissionStore: a,
|
|
966
|
+
getUserStore: n,
|
|
967
|
+
isAuthenticated: s,
|
|
968
|
+
viewModules: i,
|
|
969
|
+
homeComponent: c,
|
|
970
|
+
notFoundComponent: v,
|
|
971
|
+
projectName: h,
|
|
972
|
+
layoutRouteName: b = "Layout",
|
|
962
973
|
publicPaths: z = ["/login", "/register"],
|
|
963
|
-
loginRouteName:
|
|
974
|
+
loginRouteName: D = "login",
|
|
964
975
|
forbiddenRouteName: k = "Forbidden",
|
|
965
|
-
homeRouteName:
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
}), e.addRoute({
|
|
976
|
+
homeRouteName: p = "Home",
|
|
977
|
+
homeRoutePath: O = "home",
|
|
978
|
+
homeTitle: g = "首页",
|
|
979
|
+
noPermissionMessage: d = "暂无权限"
|
|
980
|
+
} = l;
|
|
981
|
+
let o = !1;
|
|
982
|
+
function w(m) {
|
|
983
|
+
const y = ct(m).find((V) => V.name === b), S = y != null && y.children ? fe(y.children, i, h) : [];
|
|
984
|
+
S.forEach((V) => {
|
|
985
|
+
V.name && e.hasRoute(V.name) || (e.addRoute(b, V), ie(`Add route: ${String(V.name)} -> ${V.path}`));
|
|
986
|
+
}), e.hasRoute(p) || e.addRoute(b, {
|
|
987
|
+
path: O,
|
|
988
|
+
name: p,
|
|
989
|
+
component: c,
|
|
990
|
+
meta: { title: g }
|
|
991
|
+
}), e.hasRoute("NotFound") || e.addRoute({
|
|
982
992
|
path: "/:pathMatch(.*)*",
|
|
983
993
|
name: "NotFound",
|
|
984
|
-
component:
|
|
985
|
-
}), ie(
|
|
994
|
+
component: v
|
|
995
|
+
}), ie(`Dynamic routes added: ${S.length}`);
|
|
986
996
|
}
|
|
987
|
-
|
|
988
|
-
if (
|
|
997
|
+
function $(m, A) {
|
|
998
|
+
if (m === p) {
|
|
999
|
+
A();
|
|
1000
|
+
return;
|
|
1001
|
+
}
|
|
1002
|
+
e.hasRoute(p) ? A({ name: p, replace: !0 }) : A();
|
|
1003
|
+
}
|
|
1004
|
+
return e.beforeEach(async (m, A, y) => {
|
|
1005
|
+
if (ee.start(), s() && !o)
|
|
989
1006
|
try {
|
|
990
|
-
const J = t(),
|
|
991
|
-
if (await J.initRoutes(), await
|
|
992
|
-
|
|
993
|
-
p({ name: h, replace: !0 });
|
|
994
|
-
return;
|
|
995
|
-
}
|
|
996
|
-
if (u.name === g) {
|
|
997
|
-
p({ ...u, replace: !0 });
|
|
998
|
-
return;
|
|
999
|
-
}
|
|
1000
|
-
const L = J.backendRoutes.find((H) => H.name === u.name);
|
|
1001
|
-
if (L && !O.routePermissions.includes(L.code)) {
|
|
1002
|
-
re("无权限访问:", u.path), p({ name: k, replace: !0 });
|
|
1003
|
-
return;
|
|
1004
|
-
}
|
|
1005
|
-
p({ ...u, replace: !0 });
|
|
1007
|
+
const J = t(), L = a();
|
|
1008
|
+
if (await J.initRoutes(), await L.loadUserPermissions(), w(J.backendRoutes), o = !0, m.path === "/" || m.path === "") {
|
|
1009
|
+
$(m.name, y);
|
|
1006
1010
|
return;
|
|
1007
1011
|
}
|
|
1012
|
+
if (m.name === b) {
|
|
1013
|
+
$(m.name, y);
|
|
1014
|
+
return;
|
|
1015
|
+
}
|
|
1016
|
+
const B = J.backendRoutes.find((P) => P.name === m.name);
|
|
1017
|
+
if (B && !L.routePermissions.includes(B.code)) {
|
|
1018
|
+
re("No route permission:", m.path), y({ name: k, replace: !0 });
|
|
1019
|
+
return;
|
|
1020
|
+
}
|
|
1021
|
+
y({
|
|
1022
|
+
path: m.path,
|
|
1023
|
+
query: m.query,
|
|
1024
|
+
hash: m.hash,
|
|
1025
|
+
replace: !0
|
|
1026
|
+
});
|
|
1027
|
+
return;
|
|
1008
1028
|
} catch (J) {
|
|
1009
|
-
|
|
1029
|
+
dt("Failed to load route permissions:", J), o = !1, await n().logout(), y({ name: D, replace: !0 });
|
|
1010
1030
|
return;
|
|
1011
1031
|
}
|
|
1012
|
-
if (z.includes(
|
|
1013
|
-
|
|
1032
|
+
if (z.includes(m.path)) {
|
|
1033
|
+
s() ? y({ path: "/", replace: !0 }) : y();
|
|
1034
|
+
return;
|
|
1035
|
+
}
|
|
1036
|
+
if (!s()) {
|
|
1037
|
+
y({ name: D, replace: !0 });
|
|
1014
1038
|
return;
|
|
1015
1039
|
}
|
|
1016
|
-
|
|
1017
|
-
|
|
1040
|
+
const S = a(), V = t();
|
|
1041
|
+
if (m.name === p) {
|
|
1042
|
+
y();
|
|
1018
1043
|
return;
|
|
1019
1044
|
}
|
|
1020
|
-
if (
|
|
1021
|
-
|
|
1045
|
+
if (S.routePermissions.length === 0) {
|
|
1046
|
+
m.path !== "/" ? (I.warning(d), y({ path: "/", replace: !0 })) : $(m.name, y);
|
|
1022
1047
|
return;
|
|
1023
1048
|
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
u.path !== "/" ? (x.warning(v), p({ path: "/", replace: !0 })) : p();
|
|
1049
|
+
if (m.path === "/") {
|
|
1050
|
+
$(m.name, y);
|
|
1027
1051
|
return;
|
|
1028
1052
|
}
|
|
1029
|
-
if (
|
|
1030
|
-
|
|
1053
|
+
if (m.name === b) {
|
|
1054
|
+
$(m.name, y);
|
|
1031
1055
|
return;
|
|
1032
1056
|
}
|
|
1033
|
-
const
|
|
1034
|
-
if (
|
|
1035
|
-
re("
|
|
1057
|
+
const H = V.backendRoutes.find((J) => J.name === m.name);
|
|
1058
|
+
if (H && !S.routePermissions.includes(H.code)) {
|
|
1059
|
+
re("No route permission:", m.path), y({ name: k, replace: !0 });
|
|
1036
1060
|
return;
|
|
1037
1061
|
}
|
|
1038
|
-
|
|
1039
|
-
}), e.afterEach(() =>
|
|
1062
|
+
y();
|
|
1063
|
+
}), e.afterEach(() => ee.done()), {
|
|
1040
1064
|
resetRouterState: () => {
|
|
1041
|
-
|
|
1065
|
+
o = !1;
|
|
1042
1066
|
}
|
|
1043
1067
|
};
|
|
1044
1068
|
}
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1047
|
-
e.component(
|
|
1069
|
+
const mt = [Se, Te, X, Le, Ze, lt, me], ft = (e) => {
|
|
1070
|
+
mt.forEach((l) => {
|
|
1071
|
+
e.component(l.name ?? l.__name ?? "", l);
|
|
1048
1072
|
});
|
|
1049
|
-
},
|
|
1073
|
+
}, xt = { install: ft };
|
|
1050
1074
|
export {
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1075
|
+
Se as JButton,
|
|
1076
|
+
X as JIconRender,
|
|
1077
|
+
Ze as JImportExcel,
|
|
1078
|
+
Le as JSearchHeader,
|
|
1055
1079
|
me as JSideMenuItem,
|
|
1056
|
-
|
|
1080
|
+
lt as JSidebar,
|
|
1057
1081
|
Te as JUploadImg,
|
|
1058
|
-
|
|
1082
|
+
ct as buildRouteTree,
|
|
1059
1083
|
$t as createRouterGuard,
|
|
1060
1084
|
oe as deepClone,
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1085
|
+
xt as default,
|
|
1086
|
+
it as filterEmpty,
|
|
1087
|
+
jt as findFirstAllowedRoute,
|
|
1088
|
+
rt as flatten,
|
|
1089
|
+
ut as getComponentImport,
|
|
1090
|
+
wt as omit,
|
|
1091
|
+
_t as pick,
|
|
1092
|
+
ot as toCamelCase,
|
|
1093
|
+
st as toSnakeCase,
|
|
1094
|
+
Ct as toTableColumns,
|
|
1071
1095
|
fe as transformBackendRoutes,
|
|
1072
1096
|
kt as unflatten
|
|
1073
1097
|
};
|