dlzn-ui 1.80.0 → 1.82.0
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/assets/form-BoTdcg8R.css +2 -0
- package/assets/upload-CWjniRuv.css +1 -0
- package/chunks/{button-BgwgIEU8.mjs → button-Cb2lySJu.mjs} +1 -1
- package/chunks/{checkbox-group-C5yBbQ8-.mjs → checkbox-group-Byz5ySpG.mjs} +1 -1
- package/chunks/{form-BXPhm59W.mjs → form-BkPeeuHB.mjs} +9 -9
- package/chunks/{radio-group-a_ljkAoW.mjs → radio-group-5VlH8ezG.mjs} +1 -1
- package/chunks/{select-rZD93RO4.mjs → select-DhJtE0H-.mjs} +1 -1
- package/chunks/{tree-0bIqDJPq.mjs → tree-Bn-WY5dz.mjs} +1 -1
- package/chunks/{tree-select-BByQlCU-.mjs → tree-select-CTE4lSRz.mjs} +1 -1
- package/chunks/{tree-Y7LMh-WX.mjs → tree-szMrY26E.mjs} +1 -1
- package/chunks/{upload-B89N6BVO.mjs → upload-CvqlmOVo.mjs} +4 -4
- package/chunks/user-DsSzsUIW.mjs +562 -0
- package/components/button/index.mjs +1 -1
- package/components/button/src/button.mjs +1 -1
- package/components/checkbox-group/index.mjs +1 -1
- package/components/checkbox-group/src/checkbox-group.mjs +1 -1
- package/components/form/index.mjs +1 -1
- package/components/form/src/form.d.ts +2 -3
- package/components/form/src/form.mjs +1 -1
- package/components/image-viewer/src/image-viewer.vue.d.ts +2 -2
- package/components/index.mjs +9 -9
- package/components/input/src/input.vue.d.ts +1 -1
- package/components/radio-group/index.mjs +1 -1
- package/components/radio-group/src/radio-group.mjs +1 -1
- package/components/select/index.mjs +1 -1
- package/components/select/src/select.mjs +1 -1
- package/components/select/src/select.vue.d.ts +1 -1
- package/components/textarea/src/textarea.vue.d.ts +1 -1
- package/components/tree/index.mjs +2 -2
- package/components/tree/src/tree.mjs +1 -1
- package/components/tree/src/tree.vue.d.ts +1 -1
- package/components/tree-select/index.mjs +1 -1
- package/components/tree-select/src/tree-select.mjs +1 -1
- package/components/upload/index.mjs +1 -1
- package/components/upload/src/upload.mjs +1 -1
- package/hooks/useDic/index.mjs +2 -2
- package/hooks/useSysUser/index.mjs +2 -2
- package/index.d.ts +9 -3
- package/index.mjs +9 -9
- package/layout/NotFound.mjs +28 -0
- package/layout/NotFound.vue.d.ts +4 -0
- package/layout/profile/ResetPwd.mjs +2 -0
- package/layout/profile/ResetPwd.vue.d.ts +10 -0
- package/package.json +9 -1
- package/plugins/autoImport/$alova/index.mjs +2 -0
- package/plugins/others/directive.d.ts +0 -1
- package/plugins/others/directive.mjs +18 -16
- package/store/modules/common.mjs +1 -1
- package/store/modules/login.mjs +1 -1
- package/store/modules/router.mjs +2 -2
- package/store/modules/user.mjs +1 -1
- package/assets/form-ClgamZql.css +0 -2
- package/assets/upload-Cp3eA2SI.css +0 -1
- package/chunks/user-DDXohI-o.mjs +0 -465
- package/plugins/alova/index.mjs +0 -2
- /package/plugins/{alova → autoImport/$alova}/index.d.ts +0 -0
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
import { n as e } from "./useAppContext-D47amIp5.mjs";
|
|
2
|
+
import t from "../plugins/autoImport/$loading/index.mjs";
|
|
3
|
+
import { passwordReg as n, passwordRegMessage as r } from "../constants/others.mjs";
|
|
4
|
+
import i from "../plugins/autoImport/$msg/index.mjs";
|
|
5
|
+
import a, { getTopRoute as o } from "../router/index.mjs";
|
|
6
|
+
import { isFalsy as s } from "../utils/boolean.mjs";
|
|
7
|
+
import { stringDisplay as c } from "../utils/string.mjs";
|
|
8
|
+
import { saveAs as l } from "../utils/tool.mjs";
|
|
9
|
+
import { useClearList as u } from "../hooks/useList/index.mjs";
|
|
10
|
+
import d from "../store/modules/excludeKPname.mjs";
|
|
11
|
+
import f from "../store/modules/recentRouters.mjs";
|
|
12
|
+
import p from "../plugins/autoImport/$confirm/index.mjs";
|
|
13
|
+
import { computed as m, createBlock as h, createTextVNode as g, createVNode as _, defineComponent as ee, h as te, markRaw as ne, nextTick as re, openBlock as ie, ref as v, resolveComponent as ae, useTemplateRef as oe, watch as y, withCtx as b } from "vue";
|
|
14
|
+
import { cloneDeep as x, isPlainObject as se } from "lodash-es";
|
|
15
|
+
import { defineStore as S } from "pinia";
|
|
16
|
+
import { useRoute as C, useRouter as w } from "vue-router";
|
|
17
|
+
import { createAlova as ce } from "alova";
|
|
18
|
+
import le from "alova/fetch";
|
|
19
|
+
import ue from "alova/vue";
|
|
20
|
+
import T from "path-browserify";
|
|
21
|
+
import E from "virtual:dlzn-ui/app-params";
|
|
22
|
+
//#region ../../packages/dlzn-ui/store/modules/common.ts
|
|
23
|
+
function de() {
|
|
24
|
+
return Y.Get("common/appInfo", { meta: {
|
|
25
|
+
useFailMsg: !1,
|
|
26
|
+
useLoading: !1,
|
|
27
|
+
useSysFailMsg: !1,
|
|
28
|
+
useToken: !1
|
|
29
|
+
} });
|
|
30
|
+
}
|
|
31
|
+
var D = S("common", () => {
|
|
32
|
+
let e = v(!0), t = v(250), n = v({
|
|
33
|
+
appName: VITE_APP_NAME,
|
|
34
|
+
version: ""
|
|
35
|
+
});
|
|
36
|
+
y(() => n.value.appName, (e) => {
|
|
37
|
+
e && (document.title = e);
|
|
38
|
+
});
|
|
39
|
+
function r() {
|
|
40
|
+
de().then((e) => {
|
|
41
|
+
n.value = e;
|
|
42
|
+
}).catch((e) => {
|
|
43
|
+
console.log(`${VITE_APP_NAME} 获取应用信息失败`, e);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
let i = v(!0), a = null;
|
|
47
|
+
function o() {
|
|
48
|
+
a !== null && (clearTimeout(a), a = null), i.value = !1, a = setTimeout(() => {
|
|
49
|
+
i.value = !0;
|
|
50
|
+
}, 9e5);
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
appInfo: n,
|
|
54
|
+
drawerOpen: e,
|
|
55
|
+
drawerSize: t,
|
|
56
|
+
getAppInfo: r,
|
|
57
|
+
isRequestSleep: i,
|
|
58
|
+
requestActive: o
|
|
59
|
+
};
|
|
60
|
+
}, { persist: { pick: ["drawerOpen", "drawerSize"] } }), O = /* @__PURE__ */ new Map();
|
|
61
|
+
function fe(e) {
|
|
62
|
+
let t = Y.Get(`system/dict/data/types/${e.join(",")}`, { meta: { useLoading: !1 } }).then((e) => e.map((e) => ({
|
|
63
|
+
cssClass: e.cssClass,
|
|
64
|
+
dictType: e.dictType,
|
|
65
|
+
label: e.dictLabel,
|
|
66
|
+
remark: e.remark,
|
|
67
|
+
value: e.dictValue
|
|
68
|
+
})));
|
|
69
|
+
e.forEach((e) => {
|
|
70
|
+
O.set(e, t.then((t) => t.filter((t) => t.dictType === e)));
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
var k = [];
|
|
74
|
+
function A(e) {
|
|
75
|
+
return k.includes(e) || k.push(e), new Promise((t) => {
|
|
76
|
+
setTimeout(() => {
|
|
77
|
+
let n = k.filter((e) => !O.has(e));
|
|
78
|
+
n.length > 0 && fe(n), k.length = 0, O.get(e).then((e) => {
|
|
79
|
+
t(e);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
var j = /* @__PURE__ */ new Map();
|
|
85
|
+
function M() {
|
|
86
|
+
k.length = 0, O.clear(), j.clear();
|
|
87
|
+
}
|
|
88
|
+
function pe(e, t) {
|
|
89
|
+
let n = N(e);
|
|
90
|
+
return m(() => {
|
|
91
|
+
if (t === void 0) return n.value.map((e) => e.label);
|
|
92
|
+
if (Array.isArray(t)) return n.value.length === 0 ? [] : t.map((e) => n.value.find((t) => String(t.value) === String(e))?.label ?? c(e));
|
|
93
|
+
if (n.value.length === 0) return "";
|
|
94
|
+
if (typeof t == "string") {
|
|
95
|
+
let e = t.split(",").filter(Boolean);
|
|
96
|
+
if (e.length > 0) return e.map((e) => n.value.find((t) => String(t.value) === e)?.label ?? e).join(",");
|
|
97
|
+
}
|
|
98
|
+
return n.value.find((e) => String(e.value) === String(t))?.label ?? c(t);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function N(e, t) {
|
|
102
|
+
let n;
|
|
103
|
+
return j.has(e) ? n = j.get(e) : (n = v([]), j.set(e, n), A(e).then((e) => {
|
|
104
|
+
n.value = e;
|
|
105
|
+
})), m(() => n.value.filter((e) => t === void 0 || t.includes(e.value)));
|
|
106
|
+
}
|
|
107
|
+
function me(e) {
|
|
108
|
+
O.delete(e), j.has(e) && A(e).then((t) => {
|
|
109
|
+
j.get(e).value = t;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region ../../packages/dlzn-ui/hooks/useSysUser/index.ts
|
|
114
|
+
var P = /* @__PURE__ */ new Map();
|
|
115
|
+
function he(e) {
|
|
116
|
+
let t = Y.Post("system/user/listByIds", { userIds: e }, { meta: { useLoading: !1 } }).then((e) => e.map((e) => ({
|
|
117
|
+
...e,
|
|
118
|
+
label: e.userName,
|
|
119
|
+
value: e.userId
|
|
120
|
+
})));
|
|
121
|
+
e.forEach((e) => {
|
|
122
|
+
P.set(e, t.then((t) => t.find((t) => t.value === e)));
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
var F = [];
|
|
126
|
+
function I(e) {
|
|
127
|
+
return F.includes(e) || F.push(e), new Promise((t) => {
|
|
128
|
+
setTimeout(() => {
|
|
129
|
+
let n = F.filter((e) => !P.has(e));
|
|
130
|
+
n.length > 0 && he(n), F.length = 0, P.get(e).then((e) => {
|
|
131
|
+
t(e);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
var L = /* @__PURE__ */ new Map();
|
|
137
|
+
function R() {
|
|
138
|
+
F.length = 0, P.clear(), L.clear();
|
|
139
|
+
}
|
|
140
|
+
function ge(e) {
|
|
141
|
+
P.delete(e), L.has(e) && I(e).then((t) => {
|
|
142
|
+
L.get(e).value = t;
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function _e(e) {
|
|
146
|
+
let t;
|
|
147
|
+
return L.has(e) ? t = L.get(e) : (t = v(null), L.set(e, t), I(e).then((e) => {
|
|
148
|
+
t.value = e;
|
|
149
|
+
})), t;
|
|
150
|
+
}
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region ../../packages/dlzn-ui/store/modules/router.ts
|
|
153
|
+
function z() {
|
|
154
|
+
return Y.Get("getRouters", { meta: {
|
|
155
|
+
useFailMsg: "获取用户路由失败",
|
|
156
|
+
useLoading: "正在获取用户路由..."
|
|
157
|
+
} });
|
|
158
|
+
}
|
|
159
|
+
function ve(e) {
|
|
160
|
+
return e.children !== void 0 || e.component !== void 0;
|
|
161
|
+
}
|
|
162
|
+
function ye(e) {
|
|
163
|
+
let t = [];
|
|
164
|
+
return e.forEach((e) => {
|
|
165
|
+
e.path === "/" ? t.push({
|
|
166
|
+
...e.children[0],
|
|
167
|
+
hidden: e.hidden
|
|
168
|
+
}) : t.push(e);
|
|
169
|
+
}), t;
|
|
170
|
+
}
|
|
171
|
+
function be(e) {
|
|
172
|
+
let t = (e, n) => {
|
|
173
|
+
let r = [];
|
|
174
|
+
return e.forEach((e) => {
|
|
175
|
+
let i = {
|
|
176
|
+
meta: {
|
|
177
|
+
fullScreen: e.meta?.fullScreen ?? (typeof e.component == "string" && e.component.split("___")[1] === "0"),
|
|
178
|
+
hidden: e.hidden ?? e.meta?.hidden ?? !1,
|
|
179
|
+
icon: e.meta?.icon === "#" ? "" : e.meta?.icon ?? "",
|
|
180
|
+
noCache: e.meta?.noCache ?? !1,
|
|
181
|
+
parentName: n?.name ?? "",
|
|
182
|
+
title: e.meta?.title ?? ""
|
|
183
|
+
},
|
|
184
|
+
name: e.name,
|
|
185
|
+
path: e.path.startsWith("/") && n !== null ? e.path.slice(1) : e.path
|
|
186
|
+
};
|
|
187
|
+
if (e.children !== void 0) {
|
|
188
|
+
let n = t(e.children, i);
|
|
189
|
+
if (n.length > 0) {
|
|
190
|
+
i.children = n;
|
|
191
|
+
let e = n.find((e) => !e.meta.hidden);
|
|
192
|
+
e !== void 0 && (i.redirect = { name: e.name });
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
e.component !== void 0 && !["Layout", "ParentView"].includes(e.component) && (i.component = Se(e)), ve(i) && r.push(i);
|
|
196
|
+
}), r;
|
|
197
|
+
}, n = o();
|
|
198
|
+
return n.children.push(...e), t([n], null);
|
|
199
|
+
}
|
|
200
|
+
function xe(e) {
|
|
201
|
+
let t = (e) => {
|
|
202
|
+
let n = [...e], r = n.length;
|
|
203
|
+
for (let e = r - 1; e >= 0; e--) {
|
|
204
|
+
let r = n[e];
|
|
205
|
+
r.children !== void 0 && (r.redirect === void 0 ? (r.children.forEach((r) => {
|
|
206
|
+
n.splice(e + 1, 0, ...t([r]));
|
|
207
|
+
}), delete r.children) : r.children = t(r.children));
|
|
208
|
+
}
|
|
209
|
+
return n;
|
|
210
|
+
};
|
|
211
|
+
return t(e);
|
|
212
|
+
}
|
|
213
|
+
var B = E.viewsEntryLazyImport, V = [];
|
|
214
|
+
function H(e) {
|
|
215
|
+
return `/src/views/${e.split("___")[0]}.vue`;
|
|
216
|
+
}
|
|
217
|
+
function Se(e) {
|
|
218
|
+
if (typeof e.component == "function" || typeof e.component == "string") {
|
|
219
|
+
let t = e.component, n = typeof t == "string" ? B[H(t)] : t;
|
|
220
|
+
if (n === void 0) {
|
|
221
|
+
let e = `路由组件${H(t)}不存在`;
|
|
222
|
+
return console.error(e), () => import("../layout/NotFound.mjs");
|
|
223
|
+
}
|
|
224
|
+
return typeof t == "string" && V.push(H(t)), () => n().then((t) => ({
|
|
225
|
+
...t.default,
|
|
226
|
+
name: e.name
|
|
227
|
+
}));
|
|
228
|
+
}
|
|
229
|
+
return e.component;
|
|
230
|
+
}
|
|
231
|
+
var U = S("router", () => {
|
|
232
|
+
let e = v([]), t = w(), n = $();
|
|
233
|
+
async function r() {
|
|
234
|
+
let r = await z();
|
|
235
|
+
V.length = 0, e.value = ne(xe(be(ye(r)))), n.isAdmin && Object.keys(B).forEach((e) => {
|
|
236
|
+
if (!V.includes(e)) {
|
|
237
|
+
let t = `${e} 页面对应的路由不存在`;
|
|
238
|
+
console.error(t);
|
|
239
|
+
}
|
|
240
|
+
}), t.hasRoute("Index") && t.removeRoute("Index"), e.value.forEach((e) => {
|
|
241
|
+
t.addRoute(e);
|
|
242
|
+
}), f().init();
|
|
243
|
+
}
|
|
244
|
+
function i() {
|
|
245
|
+
e.value.forEach((e) => {
|
|
246
|
+
t.removeRoute(e.name);
|
|
247
|
+
}), e.value = [];
|
|
248
|
+
}
|
|
249
|
+
return {
|
|
250
|
+
clear: i,
|
|
251
|
+
getRouters: r,
|
|
252
|
+
routersRaw: e
|
|
253
|
+
};
|
|
254
|
+
});
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region ../../packages/dlzn-ui/store/modules/login.ts
|
|
257
|
+
function Ce(e) {
|
|
258
|
+
return Y.Post("login", e, { meta: {
|
|
259
|
+
useLoading: "登录中...",
|
|
260
|
+
useToken: !1
|
|
261
|
+
} });
|
|
262
|
+
}
|
|
263
|
+
function we() {
|
|
264
|
+
return Y.Post("logout", void 0, { meta: {
|
|
265
|
+
useLoading: "退出登录中...",
|
|
266
|
+
useSuccessMsg: !0
|
|
267
|
+
} });
|
|
268
|
+
}
|
|
269
|
+
var W = S("login", () => {
|
|
270
|
+
let e = v(""), t = C(), n = w();
|
|
271
|
+
async function r(t) {
|
|
272
|
+
let n = await Ce(t);
|
|
273
|
+
e.value = n.token, await $().getUserInfo();
|
|
274
|
+
}
|
|
275
|
+
function i() {
|
|
276
|
+
e.value = "", d().clear(), U().clear(), $().clear(), M(), R(), u();
|
|
277
|
+
}
|
|
278
|
+
y(() => t.name, () => {
|
|
279
|
+
t.name === "Login" && i();
|
|
280
|
+
});
|
|
281
|
+
async function a() {
|
|
282
|
+
await we(), await n.push({ name: "Login" }), i();
|
|
283
|
+
}
|
|
284
|
+
return {
|
|
285
|
+
login: r,
|
|
286
|
+
logout: a,
|
|
287
|
+
token: e
|
|
288
|
+
};
|
|
289
|
+
}, { persist: { pick: ["token"] } }), G = 15e3, K = "网络错误,请稍后再试";
|
|
290
|
+
function q(e, t = !0) {
|
|
291
|
+
let n = {};
|
|
292
|
+
return Object.keys(e).forEach((r) => {
|
|
293
|
+
(!t || (Array.isArray(e[r]) ? e[r].length > 0 : !s(e[r]))) && (n[r] = e[r]);
|
|
294
|
+
}), n;
|
|
295
|
+
}
|
|
296
|
+
function J(e, t = !0) {
|
|
297
|
+
return new URLSearchParams(q(e, t)).toString();
|
|
298
|
+
}
|
|
299
|
+
var Y = ce({
|
|
300
|
+
baseURL: VITE_BASE_URL,
|
|
301
|
+
beforeRequest(e) {
|
|
302
|
+
e.config.credentials = e.config.credentials ?? "omit";
|
|
303
|
+
let [n, ...r] = VITE_API_PREFIX_ARRAY;
|
|
304
|
+
!e.url.startsWith("http") && !r.some((t) => T.join("/", e.url).startsWith(T.join("/", t, "/"))) && (e.url = T.join(n, e.url)), e.meta = {
|
|
305
|
+
use600Alert: !0,
|
|
306
|
+
useDataResult: !0,
|
|
307
|
+
useDownload: !1,
|
|
308
|
+
useEmptyData: !1,
|
|
309
|
+
useEmptyParams: !0,
|
|
310
|
+
useFailMsg: !0,
|
|
311
|
+
useFormData: !1,
|
|
312
|
+
useInPolling: !1,
|
|
313
|
+
useLoading: !0,
|
|
314
|
+
useResponseBlob: !1,
|
|
315
|
+
useResponseText: !1,
|
|
316
|
+
useSuccessMsg: !1,
|
|
317
|
+
useSysFailMsg: !0,
|
|
318
|
+
useToken: !0,
|
|
319
|
+
...e.meta ?? {}
|
|
320
|
+
};
|
|
321
|
+
let i = W(), { useEmptyData: a, useEmptyParams: o, useFormData: c, useInPolling: l, useLoading: u, useResponseBlob: d, useToken: f } = e.meta;
|
|
322
|
+
l || D().requestActive(), f && (i.token ? e.config.headers.Authorization = i.token : e.abort()), u !== !1 && t.show(u === !0 ? void 0 : u);
|
|
323
|
+
let p = e.config.params;
|
|
324
|
+
if (typeof p != "string" && (e.config.params = J(p, o)), a && se(e.data)) {
|
|
325
|
+
let t = {}, n = e.data;
|
|
326
|
+
Object.keys(n).forEach((e) => {
|
|
327
|
+
s(n[e]) || (t[e] = n[e]);
|
|
328
|
+
}), e.data = t;
|
|
329
|
+
}
|
|
330
|
+
if (c) {
|
|
331
|
+
let t = new FormData();
|
|
332
|
+
Object.keys(e.data).forEach((n) => {
|
|
333
|
+
t.append(n, e.data[n]);
|
|
334
|
+
}), e.data = t;
|
|
335
|
+
}
|
|
336
|
+
e.config.timeout === G && (c || e.data instanceof FormData || d) && (e.config.timeout = 0);
|
|
337
|
+
},
|
|
338
|
+
cacheFor: null,
|
|
339
|
+
requestAdapter: le(),
|
|
340
|
+
responded: {
|
|
341
|
+
onComplete: (e) => {
|
|
342
|
+
e.meta.useLoading !== !1 && t.hide();
|
|
343
|
+
},
|
|
344
|
+
onError: async (e, t) => {
|
|
345
|
+
let { useSysFailMsg: n } = t.meta;
|
|
346
|
+
if (e instanceof Error) {
|
|
347
|
+
let { message: t } = e;
|
|
348
|
+
if (t.toLowerCase().includes("abort")) return Promise.reject(e);
|
|
349
|
+
if (t.toLowerCase().includes("timeout")) return n && i.error("请求超时"), Promise.reject(e);
|
|
350
|
+
}
|
|
351
|
+
return n && i.error(K), Promise.reject(e);
|
|
352
|
+
},
|
|
353
|
+
onSuccess: async (t, n) => {
|
|
354
|
+
if (typeof t == "string") return t;
|
|
355
|
+
let { useDataResult: r, useDownload: o, useFailMsg: s, useResponseBlob: c, useResponseText: u, useSuccessMsg: d, useSysFailMsg: f, useToken: p } = n.meta, { headers: m, ok: h, status: g } = t;
|
|
356
|
+
if (h === !1) {
|
|
357
|
+
if (f) {
|
|
358
|
+
let e = {
|
|
359
|
+
403: "当前操作没有权限",
|
|
360
|
+
404: "访问资源不存在",
|
|
361
|
+
500: "服务不可用,请稍后再试或联系管理员!"
|
|
362
|
+
}[g] ?? K;
|
|
363
|
+
i.error(e);
|
|
364
|
+
}
|
|
365
|
+
return Promise.reject(t);
|
|
366
|
+
}
|
|
367
|
+
if (c && !m.get("content-type")?.includes("application/json")) {
|
|
368
|
+
let n;
|
|
369
|
+
try {
|
|
370
|
+
n = await t.blob();
|
|
371
|
+
} catch (t) {
|
|
372
|
+
return e.error("返回的 response 不能被blob() 方法所解析"), Promise.reject(t);
|
|
373
|
+
}
|
|
374
|
+
if (o !== !1) {
|
|
375
|
+
if (typeof o == "string") l(n, o);
|
|
376
|
+
else {
|
|
377
|
+
let r = new URLSearchParams((t.headers.get("content-disposition") ?? "").replace(/;\s*/g, "&")).get("filename");
|
|
378
|
+
r ? l(n, r) : e.error("返回的 response header 没有文件名");
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return n;
|
|
382
|
+
}
|
|
383
|
+
if (u && !m.get("content-type")?.includes("application/json")) {
|
|
384
|
+
let n;
|
|
385
|
+
try {
|
|
386
|
+
n = await t.text();
|
|
387
|
+
} catch (t) {
|
|
388
|
+
return e.error("返回的 response text() 方法所解析"), Promise.reject(t);
|
|
389
|
+
}
|
|
390
|
+
return n;
|
|
391
|
+
}
|
|
392
|
+
let _;
|
|
393
|
+
try {
|
|
394
|
+
_ = await t.json();
|
|
395
|
+
} catch (t) {
|
|
396
|
+
return e.error("返回的 response 不能被json() 方法所解析"), Promise.reject(t);
|
|
397
|
+
}
|
|
398
|
+
if (_?.code !== void 0) {
|
|
399
|
+
let { code: e, data: t, msg: n } = _;
|
|
400
|
+
if (e >= 400) {
|
|
401
|
+
if (e === 600) {
|
|
402
|
+
if (!c) return _;
|
|
403
|
+
} else e === 401 && p ? a.push({ name: "Login" }) : s !== !1 && i.error(s === !0 ? n : s);
|
|
404
|
+
return Promise.reject(_);
|
|
405
|
+
}
|
|
406
|
+
{
|
|
407
|
+
let a = E.alovaResCodeSuccessCb?.({
|
|
408
|
+
code: e,
|
|
409
|
+
data: t,
|
|
410
|
+
msg: n
|
|
411
|
+
});
|
|
412
|
+
return a === void 0 ? (d && i(n), r ? t === void 0 ? _ : t : _) : a;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return _;
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
shareRequest: !1,
|
|
419
|
+
statesHook: ue,
|
|
420
|
+
timeout: G
|
|
421
|
+
}), X = /* @__PURE__ */ ee({
|
|
422
|
+
__name: "ResetPwd",
|
|
423
|
+
props: { showFooter: {
|
|
424
|
+
type: Boolean,
|
|
425
|
+
default: !0
|
|
426
|
+
} },
|
|
427
|
+
setup(e, { expose: t }) {
|
|
428
|
+
let i = C(), a = [
|
|
429
|
+
{
|
|
430
|
+
_label: "旧密码",
|
|
431
|
+
_required: !0,
|
|
432
|
+
component: "TInput",
|
|
433
|
+
model: "oldPassword",
|
|
434
|
+
type: "password"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
_label: "新密码",
|
|
438
|
+
_required: !0,
|
|
439
|
+
_rules: [{
|
|
440
|
+
message: r,
|
|
441
|
+
pattern: n
|
|
442
|
+
}],
|
|
443
|
+
component: "TInput",
|
|
444
|
+
model: "newPassword",
|
|
445
|
+
type: "password"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
__others: ({ formData: e }) => ({ _rules: [{ validator: (t) => t === e.newPassword || {
|
|
449
|
+
message: "两次输入的密码不一致",
|
|
450
|
+
result: !1
|
|
451
|
+
} }] }),
|
|
452
|
+
_label: "确认密码",
|
|
453
|
+
_required: !0,
|
|
454
|
+
component: "TInput",
|
|
455
|
+
model: "confirmPassword",
|
|
456
|
+
type: "password"
|
|
457
|
+
},
|
|
458
|
+
...e.showFooter ? [{ slot: "footer" }] : []
|
|
459
|
+
], o = oe("form");
|
|
460
|
+
function s() {
|
|
461
|
+
f().close(i.name);
|
|
462
|
+
}
|
|
463
|
+
async function c() {
|
|
464
|
+
let e = await o.value.validate();
|
|
465
|
+
await Y.Put("system/user/profile/updatePwd", void 0, {
|
|
466
|
+
meta: {
|
|
467
|
+
useLoading: "保存中...",
|
|
468
|
+
useSuccessMsg: !0
|
|
469
|
+
},
|
|
470
|
+
params: {
|
|
471
|
+
newPassword: e.newPassword,
|
|
472
|
+
oldPassword: e.oldPassword
|
|
473
|
+
}
|
|
474
|
+
}), W().logout();
|
|
475
|
+
}
|
|
476
|
+
return t({ handleSubmit: c }), (e, t) => {
|
|
477
|
+
let n = ae("TButton"), r = ae("TForm");
|
|
478
|
+
return ie(), h(r, {
|
|
479
|
+
ref: "form",
|
|
480
|
+
items: a,
|
|
481
|
+
"label-align": "right",
|
|
482
|
+
layout: "vertical"
|
|
483
|
+
}, {
|
|
484
|
+
footer: b(() => [_(n, { onClick: c }, {
|
|
485
|
+
default: b(() => [...t[0] ||= [g("保存", -1)]]),
|
|
486
|
+
_: 1
|
|
487
|
+
}), _(n, {
|
|
488
|
+
class: "ml-4!",
|
|
489
|
+
theme: "default",
|
|
490
|
+
onClick: s
|
|
491
|
+
}, {
|
|
492
|
+
default: b(() => [...t[1] ||= [g("关闭", -1)]]),
|
|
493
|
+
_: 1
|
|
494
|
+
})]),
|
|
495
|
+
_: 1
|
|
496
|
+
}, 512);
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region ../../packages/dlzn-ui/store/modules/user.ts
|
|
502
|
+
function Z() {
|
|
503
|
+
return Y.Get("getInfo", { meta: {
|
|
504
|
+
useFailMsg: "获取用户信息失败",
|
|
505
|
+
useLoading: "正在获取用户信息..."
|
|
506
|
+
} });
|
|
507
|
+
}
|
|
508
|
+
var Q = {
|
|
509
|
+
admin: !1,
|
|
510
|
+
dept: { deptName: "" },
|
|
511
|
+
needChangePwd: 0,
|
|
512
|
+
nickName: "",
|
|
513
|
+
userId: "",
|
|
514
|
+
userName: ""
|
|
515
|
+
}, $ = S("user", () => {
|
|
516
|
+
let e = v(x(Q)), t = v([]), n = v([]);
|
|
517
|
+
function r() {
|
|
518
|
+
e.value = x(Q), t.value = [], n.value = [];
|
|
519
|
+
}
|
|
520
|
+
let i = m(() => e.value.admin), a = v("");
|
|
521
|
+
async function o(r = !0) {
|
|
522
|
+
let i = await Z();
|
|
523
|
+
e.value = i.user, a.value !== e.value.userId && f().clear(), a.value = e.value.userId, t.value = i.permissions, n.value = i.roles, r && await U().getRouters();
|
|
524
|
+
}
|
|
525
|
+
y(() => e.value.needChangePwd, (e) => {
|
|
526
|
+
e === 1 && VITE_FORCE_PWD_CHANGE && re(() => {
|
|
527
|
+
let e = v(null);
|
|
528
|
+
p({
|
|
529
|
+
body: () => te(X, {
|
|
530
|
+
labelAlign: "top",
|
|
531
|
+
ref: e,
|
|
532
|
+
showFooter: !1
|
|
533
|
+
}),
|
|
534
|
+
cancelBtn: null,
|
|
535
|
+
closeBtn: !1,
|
|
536
|
+
closeWhenCloseAll: !1,
|
|
537
|
+
header: "请修改密码",
|
|
538
|
+
onConfirmCallback: async () => {
|
|
539
|
+
await e.value.handleSubmit();
|
|
540
|
+
},
|
|
541
|
+
width: 430
|
|
542
|
+
});
|
|
543
|
+
});
|
|
544
|
+
}, { immediate: !0 });
|
|
545
|
+
function s(e) {
|
|
546
|
+
if (e === void 0) return !0;
|
|
547
|
+
let n = Array.isArray(e) ? e : [e];
|
|
548
|
+
return t.value.some((e) => e === "*:*:*" || n.includes(e));
|
|
549
|
+
}
|
|
550
|
+
return {
|
|
551
|
+
checkPermissions: s,
|
|
552
|
+
clear: r,
|
|
553
|
+
getUserInfo: o,
|
|
554
|
+
isAdmin: i,
|
|
555
|
+
lastUserId: a,
|
|
556
|
+
permissions: t,
|
|
557
|
+
roles: n,
|
|
558
|
+
userInfo: e
|
|
559
|
+
};
|
|
560
|
+
}, { persist: { pick: ["lastUserId"] } });
|
|
561
|
+
//#endregion
|
|
562
|
+
export { D as _, q as a, z as c, ge as d, _e as f, me as g, N as h, Y as i, U as l, pe as m, $ as n, J as o, M as p, X as r, W as s, Z as t, R as u };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../../chunks/button-
|
|
1
|
+
import { n as e, t } from "../../chunks/button-Cb2lySJu.mjs";
|
|
2
2
|
export { t as TButton, e as buttonPropsInit };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../../chunks/button-
|
|
1
|
+
import { t as e } from "../../../chunks/button-Cb2lySJu.mjs";
|
|
2
2
|
export { e as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/checkbox-group-
|
|
1
|
+
import { t as e } from "../../chunks/checkbox-group-Byz5ySpG.mjs";
|
|
2
2
|
export { e as TCheckboxGroup };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../../chunks/checkbox-group-
|
|
1
|
+
import { t as e } from "../../../chunks/checkbox-group-Byz5ySpG.mjs";
|
|
2
2
|
export { e as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../../chunks/form-
|
|
1
|
+
import { n as e, t } from "../../chunks/form-BkPeeuHB.mjs";
|
|
2
2
|
export { t as TForm, e as formPropsInit };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FormInstanceFunctions as _FormInstanceFunctions, FormItemProps as _FormItemProps, FormProps as _FormProps } from 'tdesign-vue-next';
|
|
2
|
-
import { default as appParams } from 'virtual:dlzn-ui/app-params';
|
|
3
2
|
import { ClassValue, ComponentPublicInstance, Ref, StyleValue } from 'vue';
|
|
4
3
|
import { CheckboxProps } from '../../checkbox';
|
|
5
4
|
import { CheckboxGroupProps } from '../../checkbox-group';
|
|
@@ -15,7 +14,7 @@ import { TextareaProps } from '../../textarea';
|
|
|
15
14
|
import { TreeProps } from '../../tree';
|
|
16
15
|
import { TreeSelectProps } from '../../tree-select';
|
|
17
16
|
import { UploadProps } from '../../upload';
|
|
18
|
-
|
|
17
|
+
import { CustomerFormItemComponentPropsMap } from '../../../index';
|
|
19
18
|
export declare const formPropsInit: {
|
|
20
19
|
readonly autoLabelWidth: true;
|
|
21
20
|
readonly colon: true;
|
|
@@ -119,7 +118,7 @@ type ComponentItemWithOthers = {
|
|
|
119
118
|
type ComponentItemXOR = {
|
|
120
119
|
[K in keyof ComponentPropsMap]: ComponentConfig<K>;
|
|
121
120
|
}[keyof ComponentPropsMap];
|
|
122
|
-
interface ComponentPropsMap extends
|
|
121
|
+
interface ComponentPropsMap extends CustomerFormItemComponentPropsMap {
|
|
123
122
|
TCheckbox: Omit<CheckboxProps, 'modelValue'>;
|
|
124
123
|
TCheckboxGroup: Omit<CheckboxGroupProps, 'modelValue'>;
|
|
125
124
|
TInput: Omit<InputProps, 'modelValue'>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../../chunks/form-
|
|
1
|
+
import { t as e } from "../../../chunks/form-BkPeeuHB.mjs";
|
|
2
2
|
export { e as default };
|
|
@@ -3,10 +3,10 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOp
|
|
|
3
3
|
import { TNode } from 'tdesign-vue-next';
|
|
4
4
|
declare const __VLS_export: DefineComponent<ImageViewerProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ImageViewerProps> & Readonly<{}>, {
|
|
5
5
|
visible: boolean;
|
|
6
|
-
showOverlay: boolean;
|
|
7
6
|
closeBtn: boolean | TNode;
|
|
8
|
-
|
|
7
|
+
showOverlay: boolean;
|
|
9
8
|
draggable: boolean;
|
|
9
|
+
closeOnEscKeydown: boolean;
|
|
10
10
|
closeOnOverlay: boolean;
|
|
11
11
|
navigationArrow: boolean | TNode;
|
|
12
12
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
package/components/index.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { n as e, t } from "../chunks/button-
|
|
1
|
+
import { n as e, t } from "../chunks/button-Cb2lySJu.mjs";
|
|
2
2
|
import { t as n } from "../chunks/icon-COjp1yrx.mjs";
|
|
3
3
|
import { t as r } from "../chunks/popconfirm-DxWa7vWm.mjs";
|
|
4
4
|
import { n as i, t as a } from "../chunks/card-BfHb58zl.mjs";
|
|
5
5
|
import { t as o } from "../chunks/checkbox-CLlUEbkk.mjs";
|
|
6
|
-
import { t as s } from "../chunks/checkbox-group-
|
|
7
|
-
import { n as c, t as l } from "../chunks/form-
|
|
6
|
+
import { t as s } from "../chunks/checkbox-group-Byz5ySpG.mjs";
|
|
7
|
+
import { n as c, t as l } from "../chunks/form-BkPeeuHB.mjs";
|
|
8
8
|
import { n as u, t as d } from "../chunks/input-number-Bt1mbd1D.mjs";
|
|
9
9
|
import { n as f, t as p } from "../chunks/input-B8jjJrK5.mjs";
|
|
10
|
-
import { t as m } from "../chunks/radio-group-
|
|
10
|
+
import { t as m } from "../chunks/radio-group-5VlH8ezG.mjs";
|
|
11
11
|
import { t as h } from "../chunks/range-input-8ddDrOBB.mjs";
|
|
12
|
-
import { n as g, t as _ } from "../chunks/select-
|
|
12
|
+
import { n as g, t as _ } from "../chunks/select-DhJtE0H-.mjs";
|
|
13
13
|
import { n as v, t as y } from "../chunks/slider-C63Gzbld.mjs";
|
|
14
14
|
import { n as b, t as x } from "../chunks/switch-CqV3-avv.mjs";
|
|
15
15
|
import { n as S, t as C } from "../chunks/tag-input-iNXrRXk2.mjs";
|
|
16
16
|
import { t as w } from "../chunks/textarea-xkwOhNut.mjs";
|
|
17
|
-
import { t as T } from "../chunks/tree-
|
|
18
|
-
import { t as E } from "../chunks/tree-select-
|
|
19
|
-
import { t as D } from "../chunks/tree-
|
|
20
|
-
import { n as O, t as k } from "../chunks/upload-
|
|
17
|
+
import { t as T } from "../chunks/tree-Bn-WY5dz.mjs";
|
|
18
|
+
import { t as E } from "../chunks/tree-select-CTE4lSRz.mjs";
|
|
19
|
+
import { t as D } from "../chunks/tree-szMrY26E.mjs";
|
|
20
|
+
import { n as O, t as k } from "../chunks/upload-CvqlmOVo.mjs";
|
|
21
21
|
import { n as A, t as j } from "../chunks/image-BEsiUWeF.mjs";
|
|
22
22
|
import { n as M, t as N } from "../chunks/image-viewer-BZux9RvX.mjs";
|
|
23
23
|
import { n as P, t as F } from "../chunks/link-Byr_BYPx.mjs";
|
|
@@ -7,10 +7,10 @@ declare const __VLS_export: DefineComponent<InputProps, {}, {}, {}, {}, Componen
|
|
|
7
7
|
"onUpdate:modelValue"?: ((value: InputValue) => any) | undefined;
|
|
8
8
|
}>, {
|
|
9
9
|
disabled: boolean;
|
|
10
|
-
placeholder: string;
|
|
11
10
|
readonly: boolean;
|
|
12
11
|
autocomplete: string;
|
|
13
12
|
clearable: boolean;
|
|
13
|
+
placeholder: string;
|
|
14
14
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
15
15
|
declare const _default: typeof __VLS_export;
|
|
16
16
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/radio-group-
|
|
1
|
+
import { t as e } from "../../chunks/radio-group-5VlH8ezG.mjs";
|
|
2
2
|
export { e as TRadioGroup };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../../chunks/radio-group-
|
|
1
|
+
import { t as e } from "../../../chunks/radio-group-5VlH8ezG.mjs";
|
|
2
2
|
export { e as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../../chunks/select-
|
|
1
|
+
import { n as e, t } from "../../chunks/select-DhJtE0H-.mjs";
|
|
2
2
|
export { t as TSelect, e as selectPropsInit };
|