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