ss-component-new 1.2.26 → 1.2.27

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.
@@ -0,0 +1,649 @@
1
+ import { createElementBlock as F, openBlock as O, createElementVNode as f, renderSlot as k, defineComponent as q, ref as U, resolveComponent as M, createVNode as b, withCtx as d, reactive as se, watch as W, unref as Q, toDisplayString as B, createTextVNode as x } from "vue";
2
+ import { _ as V } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ import { a as ne, E, u as de, p as ue, s as pe, b as fe, g as X } from "./index-7pDDKkwc.js";
4
+ import { d as ye, r as ge, g as me, c as be, b as ve, e as he, f as Ae, h as _e } from "./index.vue_vue_type_style_index_1_lang-WD8HOZyf.js";
5
+ import { useRouter as we } from "vue-router";
6
+ import { v as Ce } from "./index-DodooTli.js";
7
+ const Ie = {}, Se = { class: "left-wrap" }, ke = { class: "left-bg" };
8
+ function Ke(I, T) {
9
+ return O(), F("div", Se, [
10
+ f("div", ke, [
11
+ k(I.$slots, "img", {}, void 0, !0)
12
+ ])
13
+ ]);
14
+ }
15
+ const Ee = /* @__PURE__ */ V(Ie, [["render", Ke], ["__scopeId", "data-v-9b7ee6c9"]]), Te = { class: "right-wrap" }, Ne = { class: "tab-content" }, Le = { class: "tab-tips" }, Be = { class: "tab-content" }, Ue = { class: "tab-tips" }, Me = { class: "tab-content" }, Re = { class: "tab-tips" }, Pe = /* @__PURE__ */ q({
16
+ __name: "index",
17
+ props: {
18
+ tabList: {
19
+ type: Array,
20
+ default: []
21
+ },
22
+ loading: {
23
+ type: Boolean,
24
+ default: !1
25
+ }
26
+ },
27
+ emits: ["clickLogin", "handleTabChange"],
28
+ setup(I, { emit: T }) {
29
+ const _ = U("account"), l = T, m = () => {
30
+ l("clickLogin", _.value);
31
+ }, w = (c) => {
32
+ l("handleTabChange", c);
33
+ };
34
+ return (c, v) => {
35
+ const u = M("el-button"), h = M("el-tab-pane"), r = M("el-tabs");
36
+ return O(), F("div", Te, [
37
+ b(r, {
38
+ modelValue: _.value,
39
+ "onUpdate:modelValue": v[0] || (v[0] = (p) => _.value = p),
40
+ class: "right-tabs",
41
+ onTabChange: w
42
+ }, {
43
+ default: d(() => [
44
+ b(h, { name: "account" }, {
45
+ label: d(() => [
46
+ k(c.$slots, "tabLabel1", {}, void 0, !0)
47
+ ]),
48
+ default: d(() => [
49
+ f("div", Ne, [
50
+ k(c.$slots, "tabContent1", {}, void 0, !0)
51
+ ]),
52
+ f("div", {
53
+ class: "tab-button special",
54
+ onClick: m
55
+ }, [
56
+ b(u, { loading: I.loading }, {
57
+ default: d(() => [
58
+ k(c.$slots, "tabButton1", {}, void 0, !0)
59
+ ]),
60
+ _: 3
61
+ }, 8, ["loading"])
62
+ ]),
63
+ f("div", Le, [
64
+ k(c.$slots, "tabTips1", {}, void 0, !0)
65
+ ])
66
+ ]),
67
+ _: 3
68
+ }),
69
+ b(h, { name: "face" }, {
70
+ label: d(() => [
71
+ k(c.$slots, "tabLabel2", {}, void 0, !0)
72
+ ]),
73
+ default: d(() => [
74
+ f("div", Be, [
75
+ k(c.$slots, "tabContent2", {}, void 0, !0)
76
+ ]),
77
+ f("div", Ue, [
78
+ k(c.$slots, "tabTips2", {}, void 0, !0)
79
+ ])
80
+ ]),
81
+ _: 3
82
+ }),
83
+ b(h, { name: "card" }, {
84
+ label: d(() => [
85
+ k(c.$slots, "tabLabel3", {}, void 0, !0)
86
+ ]),
87
+ default: d(() => [
88
+ f("div", Me, [
89
+ k(c.$slots, "tabContent3", {}, void 0, !0)
90
+ ]),
91
+ f("div", {
92
+ class: "tab-button special",
93
+ onClick: m
94
+ }, [
95
+ b(u, { loading: I.loading }, {
96
+ default: d(() => [
97
+ k(c.$slots, "tabButton3", {}, void 0, !0)
98
+ ]),
99
+ _: 3
100
+ }, 8, ["loading"])
101
+ ]),
102
+ f("div", Re, [
103
+ k(c.$slots, "tabTips3", {}, void 0, !0)
104
+ ])
105
+ ]),
106
+ _: 3
107
+ })
108
+ ]),
109
+ _: 3
110
+ }, 8, ["modelValue"])
111
+ ]);
112
+ };
113
+ }
114
+ }), xe = /* @__PURE__ */ V(Pe, [["__scopeId", "data-v-079a0fee"]]), De = { class: "account-wrap" }, Qe = /* @__PURE__ */ q({
115
+ __name: "index",
116
+ props: {
117
+ activeTabName: {
118
+ type: String,
119
+ default: ""
120
+ },
121
+ isClickLogin: {
122
+ type: Boolean,
123
+ default: !1
124
+ }
125
+ },
126
+ emits: ["handleLoginFormChange"],
127
+ setup(I, { emit: T }) {
128
+ const _ = I, l = se({
129
+ account: "",
130
+ password: ""
131
+ }), m = se({
132
+ account: [
133
+ { required: !0, message: "请输入账号", trigger: "blur" }
134
+ ],
135
+ password: [
136
+ { required: !0, message: "请输入密码", trigger: "blur" }
137
+ ]
138
+ }), w = U(null), c = T;
139
+ return W(() => _.isClickLogin, (v) => {
140
+ var u;
141
+ v && (_ == null ? void 0 : _.activeTabName) === "account" && ((u = w.value) == null || u.validate((h) => {
142
+ var r;
143
+ for (let p in l)
144
+ l.hasOwnProperty(p) && (l[p] = (r = l[p]) == null ? void 0 : r.trim());
145
+ c("handleLoginFormChange", h, h ? l : null);
146
+ }));
147
+ }, {
148
+ immediate: !0
149
+ }), W(() => _.activeTabName, (v) => {
150
+ var u;
151
+ v === "account" && ((u = w.value) == null || u.resetFields());
152
+ }), (v, u) => {
153
+ const h = M("svg-icon"), r = M("el-input"), p = M("el-form-item"), K = M("el-form");
154
+ return O(), F("div", De, [
155
+ b(K, {
156
+ model: l,
157
+ rules: m,
158
+ ref_key: "formRef",
159
+ ref: w
160
+ }, {
161
+ default: d(() => [
162
+ b(p, {
163
+ label: "",
164
+ prop: "account"
165
+ }, {
166
+ default: d(() => [
167
+ b(r, {
168
+ class: "account-input",
169
+ modelValue: l.account,
170
+ "onUpdate:modelValue": u[0] || (u[0] = (S) => l.account = S),
171
+ placeholder: "请输入账号",
172
+ clearable: ""
173
+ }, {
174
+ prefix: d(() => [
175
+ b(h, {
176
+ name: "account",
177
+ style: { width: "15px", height: "15px" }
178
+ })
179
+ ]),
180
+ _: 1
181
+ }, 8, ["modelValue"])
182
+ ]),
183
+ _: 1
184
+ }),
185
+ b(p, {
186
+ label: "",
187
+ prop: "password"
188
+ }, {
189
+ default: d(() => [
190
+ b(r, {
191
+ class: "account-input",
192
+ modelValue: l.password,
193
+ "onUpdate:modelValue": u[1] || (u[1] = (S) => l.password = S),
194
+ type: "password",
195
+ placeholder: "请输入密码",
196
+ "show-password": "",
197
+ clearable: ""
198
+ }, {
199
+ prefix: d(() => [
200
+ b(h, {
201
+ name: "password",
202
+ style: { width: "15px", height: "15px" }
203
+ })
204
+ ]),
205
+ _: 1
206
+ }, 8, ["modelValue"])
207
+ ]),
208
+ _: 1
209
+ })
210
+ ]),
211
+ _: 1
212
+ }, 8, ["model", "rules"])
213
+ ]);
214
+ };
215
+ }
216
+ }), Fe = /* @__PURE__ */ V(Qe, [["__scopeId", "data-v-48037c0f"]]);
217
+ function Oe(I) {
218
+ return ne({
219
+ url: "http://192.168.124.108:20013/api/face/face-verify",
220
+ method: "post",
221
+ data: I
222
+ });
223
+ }
224
+ const Ve = { class: "account-wrap" }, Je = { class: "video-wrap" }, $e = /* @__PURE__ */ q({
225
+ __name: "index",
226
+ props: {
227
+ systemKey: { default: "" },
228
+ activeTabName: { default: "" },
229
+ isClickLogin: { type: Boolean, default: !1 }
230
+ },
231
+ emits: ["handleLoginFormChange"],
232
+ setup(I, { emit: T }) {
233
+ const _ = I, l = T, m = U(null), w = U(null);
234
+ let c = !1;
235
+ const v = async (r) => {
236
+ if (!r)
237
+ return;
238
+ const p = new FormData();
239
+ p.set("file", r), _.systemKey && p.set("systemKey", _.systemKey), console.log("Face Recognition", _.systemKey);
240
+ const K = await Oe(p), { data: S } = K || {}, { match: N, account: R, password: D } = S;
241
+ if (!N) {
242
+ E.error("识别失败,请重新识别!");
243
+ return;
244
+ }
245
+ l("handleLoginFormChange", !0, {
246
+ account: R,
247
+ password: D
248
+ });
249
+ }, u = () => {
250
+ if (!w.value || !m.value)
251
+ return;
252
+ const r = w.value, p = r.getContext("2d"), K = m.value;
253
+ r.width = 200, r.height = 200;
254
+ const S = K.videoWidth || 640, N = K.videoHeight || 480, R = Math.min(200 / S, 200 / N), D = S * R, G = N * R, j = (200 - D) / 2, H = (200 - G) / 2;
255
+ p == null || p.drawImage(K, 0, 0, S, N, j, H, D, G), r.toBlob((Z) => {
256
+ if (Z) {
257
+ const z = new File([Z], "face.png", { type: "image/png" });
258
+ v(z);
259
+ }
260
+ }, "image/png");
261
+ }, h = async () => {
262
+ if (!m.value || c)
263
+ return;
264
+ const r = m.value;
265
+ try {
266
+ const p = await navigator.mediaDevices.getUserMedia({
267
+ video: { facingMode: "user" },
268
+ // 前置;后置用 'environment'
269
+ audio: !1
270
+ });
271
+ if (r) {
272
+ const K = r;
273
+ K.srcObject = p, c = !0;
274
+ }
275
+ } catch (p) {
276
+ E.warning("摄像头失败: " + p.message);
277
+ }
278
+ };
279
+ return W(() => _.activeTabName, (r) => {
280
+ r === "face" && !c && h();
281
+ }), (r, p) => (O(), F("div", Ve, [
282
+ f("div", Je, [
283
+ f("video", {
284
+ class: "face-video",
285
+ ref_key: "videoRef",
286
+ ref: m,
287
+ id: "v",
288
+ autoplay: "",
289
+ playsinline: ""
290
+ }, null, 512)
291
+ ]),
292
+ f("button", {
293
+ class: "face-screenshot",
294
+ onClick: u
295
+ }, "人脸识别"),
296
+ f("canvas", {
297
+ ref_key: "canvasRef",
298
+ ref: w,
299
+ id: "canvas"
300
+ }, null, 512)
301
+ ]));
302
+ }
303
+ }), Xe = /* @__PURE__ */ V($e, [["__scopeId", "data-v-0c1a330a"]]), qe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAAAAXNSR0IArs4c6QAAAd9JREFUWEftl71OAkEQx/97QC8XEj+iiTGexo/OnvgE0ChPIIXHQwgP4amxsYZGnkCtpbAxxiyJFEqCJie1yK7ZixhUuNtZYkLUa2/+M7+ZnbnbYTB87P3bIpi1BWCt34UEzpkUF35huWjimpmIlCbp8TMGbA7RX/uus27i2xjI9rgMC+i7jpFvI5EC+XEg2+NlSKTBMKmTuS5QlB2ApgRqz66TVXGDCmmIPhh7RxGl0bXrT15pWNLjVQZkdBuwF0i3qaPAv8StMNvjDwBmdIGQwJyfd+51xn7i4GbekvE7bd8SLQUUOi3fnElR0v3GvEPvaQOpHiIDKe9SlIQlTtq7K41BwexjPosXsQNmkWCCpjYCoqRMtP0HiirY76uQBWQRS1xalhCvnW4aQDmqCmHvR6rQsB/oKIMyClDOd53KoGxTHs8IoGpSKWOgeCI29ZhfaA0EOmpMi26n+beBAIzXkanjGLemDlpkrMbepGmjNMZTFuXY9D0dSF09wE7bhaWrsKD2IV+FgNrNtilwVKCK7zo5SgDqJY0EFJPMeSos1ilAKa++ISBruhoSUNi3Z1hA2+PqyLR/uPRLvm6qJnbqkk9dg0ziEDQV8qJIcE42DRbFnkp3lSZHiRZ8WqXfAFwe+He0YFLSAAAAAElFTkSuQmCC", Ge = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAx1JREFUWEfFV01oE1EQnnmpYJRGL/6gYsGLVCoUzMGLNrO1B4sYKooXQT0JWtSK4KEHEVERPCjUHgqCQlFED4raUmP3bS0UhRQKnrTorQdFBBOkBZP97AuJbNo0+2KF7GlJ3sz3zcw3M2+Z6vxwnfHJmkAqlVrT0NCwB8BepdQuAOuJaEMxgK/M/M33/UlmfpvL5cY7Ojp+2gQXSiCdTq/IZrNniOg0gM1WTplniKi/sbHxbjwe/13NpioBrXUcwB0iarUBrnBmipnPiUh6KfslCXiet9/3/af/CFxmppQ6nEgkhiv5qkhAa90N4Ob/AC/5YOZLItK30OciAlrrAwAe24Iz8yul1A0imgPQ5ft+75LpZj4qIi+D/5cRMILLZDJejTXvcRxnwDgdGxtrzufzS9abiKZisVgiKMwyAlrr8wCu2UZvzjHzgIj0mHet9fH59uyvqnrmXhG5/bc0pZehoaFYNBpN27ZaoLY/mPk1EeUAmDnRFEJgZnZ2Nt7Z2ZkpBFA6rLXeB+B5LdEXM/ARwPZa7Jg5KSJvygi4rnuFiC7aOlJKPSCiR4lEYrw4L0aIaKWl/S3HcS6XEfA8b9T3/d2WDoxORhzHmQxk0JSv2cZeKfVunnj7whJ8ALDNwkFBpMy8Q0SOBQhMA9hkYW9sv4jIzoUEvgFYbeHAEOgFcKK9vf1JUf0tAN5b2BaOMPMvETHLrEyEtgQKTmKx2NpSP7uue4GIri6XgG0JTARDInIkkP5hs6ZrILC4BLWIkJlPicigAZyYmIjOzc19twU35yqKsJY2zGazG5PJZNY4c103SUQPayFARIvb0HYQMfOoiBwMpL8PwEkiMkPMkAl9Kg4i21HMzGdF5F4JxfO8TwA+Axg33RGGzsyVR3GxnUKXETM3iUih5lrrFiK6T0TdRPQCwCoLApWXkTG0WceRSKS1ra1tugSUSqWa5397RkRbwsBD13ExqqoXEqXUYD6fvx6JRLYCOEREXQDWWYCb9q1+IQkIq35XsoC46ncpDWSiftfyEom6fpgEhVW3TzMbdS/nTOi34XKc29j+AXyzojCfNKqJAAAAAElFTkSuQmCC", Ze = { class: "card-wrap" }, Ye = { class: "card-icon card" }, We = { class: "card-input" }, je = { class: "card-icon info" }, He = /* @__PURE__ */ q({
304
+ __name: "index",
305
+ props: {
306
+ activeTabName: {
307
+ type: String,
308
+ default: ""
309
+ }
310
+ },
311
+ emits: ["handleCardInput"],
312
+ setup(I, { emit: T }) {
313
+ const _ = I, l = U(""), m = T, w = (c) => {
314
+ m("handleCardInput", c == null ? void 0 : c.trim());
315
+ };
316
+ return W(() => _.activeTabName, (c) => {
317
+ c && (l.value = "");
318
+ }), (c, v) => {
319
+ const u = M("el-image"), h = M("el-input");
320
+ return O(), F("div", Ze, [
321
+ f("div", Ye, [
322
+ b(u, {
323
+ src: Q(qe),
324
+ fit: "contain"
325
+ }, null, 8, ["src"])
326
+ ]),
327
+ f("div", We, [
328
+ b(h, {
329
+ modelValue: l.value,
330
+ "onUpdate:modelValue": v[0] || (v[0] = (r) => l.value = r),
331
+ onChange: w,
332
+ clearable: ""
333
+ }, null, 8, ["modelValue"])
334
+ ]),
335
+ f("div", je, [
336
+ b(u, {
337
+ src: Q(Ge),
338
+ fit: "contain"
339
+ }, null, 8, ["src"])
340
+ ])
341
+ ]);
342
+ };
343
+ }
344
+ }), ze = /* @__PURE__ */ V(He, [["__scopeId", "data-v-f5ac8fa1"]]);
345
+ function ea() {
346
+ return ne({
347
+ url: "/api/sysAuth/login",
348
+ method: "post",
349
+ data: {
350
+ account: "superadmin",
351
+ password: "1c8e7623312244c1feb677732278fb8b2af6af1a5335fdaebbdb2720137b372b7871292d11165b83b2967b9c39fa37027d63d37a2f36d764257b566dcfa99f334faa8995301601aec549adf39aef8d89c8788da03a9164937a5f73af20a15ea60d47c7cf01cf",
352
+ tenantId: -1,
353
+ code: "",
354
+ codeId: 0
355
+ }
356
+ });
357
+ }
358
+ const aa = { class: "login-wrap" }, ta = { class: "login-body" }, sa = { class: "login-body-item left" }, na = { class: "title" }, oa = { class: "login-body-item right" }, ca = /* @__PURE__ */ q({
359
+ __name: "index",
360
+ props: {
361
+ oldSystemKey: {}
362
+ },
363
+ emits: ["change"],
364
+ setup(I, { emit: T }) {
365
+ const _ = we(), l = de(ue), { systemKey: m, systemInfo: w, loginUserInfo: c } = pe(l), v = U({
366
+ // sysCTitle: 'INSOFWORKS',
367
+ sysCTitle: "",
368
+ sysETitle: "",
369
+ // sysETitle: 'Dynamic Test Information System',
370
+ loginTitle: "账户密码登录",
371
+ tabs: [
372
+ {
373
+ name: "密码登录",
374
+ btnLabel: "登录",
375
+ tips: "温馨提示:建议使用谷歌、Microsoft Edge,版本79.0.1072.62及以上浏览器,360浏览器请使用极速模式"
376
+ },
377
+ {
378
+ name: "人脸识别",
379
+ btnLabel: "人脸识别",
380
+ tips: "温馨提示:建议使用谷歌、Microsoft Edge,版本79.0.1072.62及以上浏览器,360浏览器请使用极速模式"
381
+ },
382
+ {
383
+ name: "刷卡登录",
384
+ btnLabel: "登录",
385
+ tips: "温馨提示:建议使用谷歌、Microsoft Edge,版本79.0.1072.62及以上浏览器,360浏览器请使用极速模式"
386
+ }
387
+ ]
388
+ }), u = U("account"), h = U(!1), r = U(!1), p = () => {
389
+ h.value = !0;
390
+ }, K = (a) => {
391
+ h.value = !1, ae(a);
392
+ }, S = (a, t) => {
393
+ h.value = !1, a && ae(t);
394
+ }, N = (a) => me(a), R = (a) => {
395
+ let t;
396
+ const s = be(a), n = ve(s), y = he(n), A = Ae(y, "parentPath");
397
+ return t = _e(A), t;
398
+ }, D = (a, t) => {
399
+ var n, y, A;
400
+ const s = (t == null ? void 0 : t.userRoles) ?? (t == null ? void 0 : t.角色名称);
401
+ try {
402
+ if (t.layer && ((n = t == null ? void 0 : t.layer) == null ? void 0 : n.toUpperCase()) === "SUPERADMIN")
403
+ return "superAdmin";
404
+ if (Array.isArray(s)) {
405
+ if ((s == null ? void 0 : s.length) === 1) {
406
+ const o = a == null ? void 0 : a.find((e) => (e == null ? void 0 : e.roleName) === (s == null ? void 0 : s[0]) || e.角色名称 === (s == null ? void 0 : s[0])), C = N(o), i = R(o == null ? void 0 : o[C]);
407
+ return o && i && Array.isArray(i) ? o ? i == null ? void 0 : i.flatMap((e) => e.checkedButtons) : [] : [];
408
+ }
409
+ if ((s == null ? void 0 : s.length) > 1) {
410
+ let o = a == null ? void 0 : a.filter((e) => s == null ? void 0 : s.includes(e.roleName || (e == null ? void 0 : e.角色名称)));
411
+ const C = N(o == null ? void 0 : o[0]), i = (A = (y = o == null ? void 0 : o.map((e) => Array.isArray(e == null ? void 0 : e[C]) ? e == null ? void 0 : e[C] : [])) == null ? void 0 : y.flat()) == null ? void 0 : A.flatMap((e) => e.checkedButtons);
412
+ return (i == null ? void 0 : i.length) === 0 ? E.error("该用户没有权限,请联系管理员") : new Set(i);
413
+ }
414
+ }
415
+ if (typeof s == "string") {
416
+ const o = a == null ? void 0 : a.find((e) => (e == null ? void 0 : e.roleName) === s || (e == null ? void 0 : e.角色名称) === s), C = N(o), i = R(o == null ? void 0 : o[C]);
417
+ return o && i && Array.isArray(i) ? o ? i == null ? void 0 : i.flatMap((e) => e.checkedButtons) : [] : [];
418
+ }
419
+ } catch (o) {
420
+ throw new Error(o);
421
+ }
422
+ }, G = async (a) => {
423
+ var t, s;
424
+ try {
425
+ let n = [];
426
+ const y = await X({
427
+ key: {
428
+ // systemKey: user?.systemKey,
429
+ systemKey: m.value ? m.value : a == null ? void 0 : a.systemKey,
430
+ // pageKey: '/系统管理/角色管理',
431
+ pageKey: "系统管理/角色管理",
432
+ type: "data"
433
+ }
434
+ });
435
+ if (y.data.code === 200) {
436
+ const A = (s = (t = y.data) == null ? void 0 : t.result) == null ? void 0 : s.map((o) => o.value.tableData);
437
+ n = D(A, a);
438
+ }
439
+ if (n)
440
+ return Array.isArray(n) ? Array.from(n) : n;
441
+ throw E.error("获取用户权限失败,请联系管理员"), new Error("获取用户权限失败,请联系管理员");
442
+ } catch (n) {
443
+ throw E.error("获取用户权限失败,请联系管理员"), new Error(n);
444
+ }
445
+ }, j = async (a) => {
446
+ var t, s, n, y, A, o, C;
447
+ try {
448
+ let i = [], e, P, J;
449
+ m.value ? J = {
450
+ // pageKey: '/系统管理/用户管理',
451
+ pageKey: "系统管理/用户管理",
452
+ type: "data",
453
+ // 通过electron传递的值获取模型key,解决多账号导入同一模型,账号名重复权限失败问题
454
+ systemKey: m.value
455
+ } : J = {
456
+ // pageKey: '/系统管理/用户管理',
457
+ pageKey: "系统管理/用户管理",
458
+ type: "data"
459
+ };
460
+ const te = await X({
461
+ key: J
462
+ });
463
+ let Y;
464
+ if (!sessionStorage.getItem("systemKey") || sessionStorage.getItem("systemKey") === "" ? Y = await X({
465
+ key: {
466
+ layer: "superAdmin"
467
+ // systemKey:sessionStorage.getItem('tenantKey')
468
+ }
469
+ }) : Y = await X({
470
+ key: {
471
+ layer: "superAdmin",
472
+ systemKey: sessionStorage.getItem("systemKey")
473
+ }
474
+ }), te.data.code === 200 && Y.data.code === 200) {
475
+ const ie = (s = (t = Y.data) == null ? void 0 : t.result) == null ? void 0 : s.map((g) => {
476
+ var L, $;
477
+ return {
478
+ ...g.value.tableData,
479
+ layer: (L = g.key) == null ? void 0 : L.layer,
480
+ systemKey: ($ = g == null ? void 0 : g.key) == null ? void 0 : $.systemKey,
481
+ id: g.id
482
+ };
483
+ }), le = (y = (n = te.data) == null ? void 0 : n.result) == null ? void 0 : y.map((g) => {
484
+ var L, $;
485
+ return {
486
+ ...g.value.tableData,
487
+ layer: (L = g.key) == null ? void 0 : L.layer,
488
+ systemKey: ($ = g == null ? void 0 : g.key) == null ? void 0 : $.systemKey,
489
+ id: g.id
490
+ };
491
+ }), ee = [...ie, ...le];
492
+ if (e = ee == null ? void 0 : ee.find((g) => (g == null ? void 0 : g.account) === (a == null ? void 0 : a.account) || (g == null ? void 0 : g.账号) === (a == null ? void 0 : a.account)), e) {
493
+ if (((A = e.layer) == null ? void 0 : A.toUpperCase()) !== "SUPERADMIN" && (!(e != null && e.状态) || (e == null ? void 0 : e.状态) === "禁用" || (e == null ? void 0 : e.status) === "禁用")) {
494
+ E.error("该用户已被禁用,请联系管理员"), r.value = !1;
495
+ return;
496
+ }
497
+ i = await G(e);
498
+ const { privateKey: g } = await l.getModelSecretAsync(e);
499
+ let L;
500
+ if (e.password ? L = ((o = e.layer) == null ? void 0 : o.toUpperCase()) === "SUPERADMIN" ? e.password : ye(e.password, g) : L = ((C = e.layer) == null ? void 0 : C.toUpperCase()) === "SUPERADMIN" ? e.password : ge, (a == null ? void 0 : a.password) === L)
501
+ P = e;
502
+ else
503
+ throw P = null, E.error("输入的密码错误,请重新输入"), r.value = !1, new Error("输入的密码错误,请重新输入");
504
+ } else
505
+ return E.error("该用户不存在,请重新输入");
506
+ }
507
+ return P && i ? {
508
+ matchedUser: P,
509
+ userAuthority: i
510
+ } : void 0;
511
+ } catch (i) {
512
+ throw new Error(i);
513
+ }
514
+ }, H = async (a) => {
515
+ var s, n, y;
516
+ const t = await j(a);
517
+ if (t != null && t.matchedUser) {
518
+ l.setLoginUserInfo(t.matchedUser), sessionStorage.setItem("authority", JSON.stringify(t.userAuthority));
519
+ const A = ((n = (s = t.matchedUser) == null ? void 0 : s.layer) == null ? void 0 : n.toUpperCase()) === "SUPERADMIN";
520
+ return sessionStorage.setItem("isSuperAdmin", JSON.stringify(A)), sessionStorage.setItem("systemKey", m.value ? m.value : (y = t.matchedUser) == null ? void 0 : y.systemKey), await Z(t.matchedUser), !0;
521
+ } else
522
+ throw r.value = !1, new Error("该用户数据处理失败,请联系管理员");
523
+ }, Z = async (a) => {
524
+ var s, n, y, A, o, C, i, e, P;
525
+ const t = await X({
526
+ key: {
527
+ // pageKey: '/user',
528
+ layer: "superAdmin",
529
+ systemKey: m.value ? m.value : a == null ? void 0 : a.systemKey
530
+ // systemKey: user?.systemKey
531
+ }
532
+ });
533
+ if (t.data.code === 200 && (s = t.data) != null && s.result && Array.isArray((n = t.data) == null ? void 0 : n.result) && ((A = (y = t.data) == null ? void 0 : y.result) == null ? void 0 : A.length) > 0) {
534
+ const J = (P = (e = (i = (C = (o = t.data) == null ? void 0 : o.result) == null ? void 0 : C[0]) == null ? void 0 : i.value) == null ? void 0 : e.tableData) == null ? void 0 : P.account;
535
+ l.setSuperAdminInfo({
536
+ account: J
537
+ });
538
+ }
539
+ }, z = async () => {
540
+ var a, t, s;
541
+ try {
542
+ const n = await ea();
543
+ return ((a = n == null ? void 0 : n.data) == null ? void 0 : a.code) === 200 ? (sessionStorage.setItem("loginToken", (s = (t = n.data) == null ? void 0 : t.result) == null ? void 0 : s.accessToken), !0) : !1;
544
+ } catch (n) {
545
+ E.error(n);
546
+ }
547
+ }, oe = async () => {
548
+ var a, t, s;
549
+ try {
550
+ const n = await fe.post("http://139.196.154.85:20024/api/sysAuth/login", {
551
+ account: "superadmin",
552
+ password: "9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",
553
+ codeId: 0,
554
+ code: ""
555
+ });
556
+ return ((a = n == null ? void 0 : n.data) == null ? void 0 : a.code) === 200 ? (sessionStorage.setItem("magicToken", (s = (t = n.data) == null ? void 0 : t.result) == null ? void 0 : s.accessToken), !0) : !1;
557
+ } catch (n) {
558
+ E.error(n);
559
+ }
560
+ }, ae = async (a) => {
561
+ var y, A, o, C;
562
+ r.value = !0;
563
+ let t = [H(a), z(), oe()];
564
+ const s = await Promise.all(t);
565
+ (s == null ? void 0 : s.every((i) => i)) && (await Ce(), _.push("/"), l.setLogRecordAsync({
566
+ type: "登录",
567
+ data: {
568
+ account: ((y = c.value) == null ? void 0 : y.account) ?? ((A = c.value) == null ? void 0 : A.账号),
569
+ userName: ((o = c.value) == null ? void 0 : o.姓名) || ((C = c.value) == null ? void 0 : C.userName) || "未知"
570
+ }
571
+ }, "/login", "login"));
572
+ }, ce = (a) => {
573
+ u.value = a, h.value = !1, r.value = !1;
574
+ }, re = (a) => /^[\u4e00-\u9fa5\s,。!?《》“”【】]+$/.test(a);
575
+ return (a, t) => (O(), F("div", aa, [
576
+ f("div", ta, [
577
+ f("div", sa, [
578
+ b(Ee, { class: "login-left-bg" }, {
579
+ img: d(() => {
580
+ var s, n, y, A;
581
+ return [
582
+ f("div", na, [
583
+ f("div", null, B(((s = Q(w)) == null ? void 0 : s.EnglishName) || "INSOFWORKS"), 1),
584
+ f("div", null, B((n = Q(w)) != null && n.chineseName && re((y = Q(w)) == null ? void 0 : y.chineseName) ? (A = Q(w)) == null ? void 0 : A.chineseName : "工业软件集成开发平台"), 1)
585
+ ]),
586
+ t[0] || (t[0] = f("div", { class: "divide-line" }, null, -1))
587
+ ];
588
+ }),
589
+ _: 1
590
+ })
591
+ ]),
592
+ f("div", oa, [
593
+ b(xe, {
594
+ loading: r.value,
595
+ onClickLogin: p,
596
+ onHandleTabChange: ce
597
+ }, {
598
+ title: d(() => [
599
+ x(B(v.value.loginTitle), 1)
600
+ ]),
601
+ tabLabel1: d(() => [
602
+ x(B(v.value.tabs[0].name), 1)
603
+ ]),
604
+ tabContent1: d(() => [
605
+ b(Fe, {
606
+ activeTabName: u.value,
607
+ isClickLogin: h.value,
608
+ onHandleLoginFormChange: S
609
+ }, null, 8, ["activeTabName", "isClickLogin"])
610
+ ]),
611
+ tabButton1: d(() => [
612
+ x(B(v.value.tabs[0].btnLabel), 1)
613
+ ]),
614
+ tabLabel2: d(() => [
615
+ x(B(v.value.tabs[1].name), 1)
616
+ ]),
617
+ tabContent2: d(() => [
618
+ b(Xe, {
619
+ systemKey: a.oldSystemKey,
620
+ activeTabName: u.value,
621
+ isClickLogin: h.value,
622
+ onHandleLoginFormChange: S
623
+ }, null, 8, ["systemKey", "activeTabName", "isClickLogin"])
624
+ ]),
625
+ tabButton2: d(() => [
626
+ x(B(v.value.tabs[1].btnLabel), 1)
627
+ ]),
628
+ tabLabel3: d(() => [
629
+ x(B(v.value.tabs[2].name), 1)
630
+ ]),
631
+ tabContent3: d(() => [
632
+ b(ze, {
633
+ activeTabName: u.value,
634
+ onHandleCardInput: K
635
+ }, null, 8, ["activeTabName"])
636
+ ]),
637
+ tabButton3: d(() => [
638
+ x(B(v.value.tabs[2].btnLabel), 1)
639
+ ]),
640
+ _: 1
641
+ }, 8, ["loading"])
642
+ ])
643
+ ])
644
+ ]));
645
+ }
646
+ }), fa = /* @__PURE__ */ V(ca, [["__scopeId", "data-v-2579cbdb"]]);
647
+ export {
648
+ fa as default
649
+ };