ss-component-new 1.3.536 → 1.3.537

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.
Files changed (55) hide show
  1. package/dist/App-Bs9l6gBz.js +207 -0
  2. package/dist/{MTLLoader-C39kpgdW.js → MTLLoader-CJpSdxp4.js} +1 -1
  3. package/dist/{OrbitControls-gxPdDfJE.js → OrbitControls-Dn5RI8yb.js} +1 -1
  4. package/dist/{URDFLoader-_Fx0i2TU.js → URDFLoader-CBCUFT9t.js} +2 -2
  5. package/dist/{animationData-CluZJZuh.js → animationData-CePYKY0n.js} +3 -3
  6. package/dist/{array-DARt-gVo.js → array-De_ksRNY.js} +3 -3
  7. package/dist/clone-CXsLtSvf.js +8 -0
  8. package/dist/header-B1G-mIVr.js +651 -0
  9. package/dist/{iconfont-SlSF8dh4.js → iconfont-CZ40-aPC.js} +2 -2
  10. package/dist/{index-BRKwy6o2.js → index-B-C5TdFW.js} +16 -16
  11. package/dist/{index-Ds-fktuI.js → index-BZECuG4k.js} +1 -1
  12. package/dist/{index-Bvi1OCN_.js → index-BZjBZlTS.js} +2 -2
  13. package/dist/{index-f21uPKZB.js → index-BnWsptYg.js} +17 -17
  14. package/dist/{index-C9mSwlYV.js → index-BrqL9KU9.js} +2 -2
  15. package/dist/{index-DG1Hjdk1.js → index-C0zUtuoD.js} +26 -25
  16. package/dist/{index-DmaDbz-y.js → index-C2FVe2U6.js} +26 -26
  17. package/dist/{index-B8muY-6u.js → index-CGWCPa7J.js} +8 -8
  18. package/dist/{index-CqUR7JfB.js → index-CH17Cg3K.js} +13 -13
  19. package/dist/{index-B3osj0rP.js → index-CHI_k9PI.js} +1 -1
  20. package/dist/{index-Bz95RBov.js → index-CTtYLr1S.js} +20045 -20685
  21. package/dist/{index-DkZ4ok8-.js → index-CisHksIK.js} +4 -4
  22. package/dist/{index-BLlYLkpo.js → index-CkW_ja7U.js} +2 -2
  23. package/dist/{index-DB1HWx1W.js → index-Cn16Hic7.js} +1 -1
  24. package/dist/{index-BnROjScB.js → index-CzLHT5lM.js} +32 -32
  25. package/dist/{index-KxgyPOIl.js → index-D94Xd2N1.js} +3 -3
  26. package/dist/{index-CVIPXYtg.js → index-DEI7Vflb.js} +1 -1
  27. package/dist/index-DISV4b3h.js +1048 -0
  28. package/dist/{index-DsF_t_aA.js → index-DQ3EYkwb.js} +2 -2
  29. package/dist/{index-DcNXwXrV.js → index-DdlbvI4c.js} +14 -14
  30. package/dist/{index-CThJS2hV.js → index-Ddn47YOo.js} +1 -1
  31. package/dist/{index-DqXvOyIs.js → index-DeGxq_J_.js} +197 -192
  32. package/dist/{index-B-SRrjLA.js → index-DfKuu864.js} +4 -4
  33. package/dist/{index-CocPelja.js → index-DwJLblIq.js} +4 -4
  34. package/dist/{index-D22V7PRs.js → index-DxOcC8k8.js} +1 -1
  35. package/dist/{index-CgxkYjtB.js → index-EP4_0PDS.js} +8 -8
  36. package/dist/{index-Fy4MrrOF.js → index-eNJ1M05y.js} +25 -25
  37. package/dist/{index.vue_vue_type_style_index_0_scoped_07c75c98_lang-CSiO4SIG.js → index.vue_vue_type_style_index_0_scoped_07c75c98_lang-nutx4ggn.js} +3 -3
  38. package/dist/{main-COK-Dgax.js → main---mNjhuu.js} +4 -4
  39. package/dist/{menuIndex-VozC7XXB.js → menuIndex-CUwbp3jl.js} +1 -1
  40. package/dist/ss-component.css +1 -1
  41. package/dist/ss-component.js +11 -11
  42. package/dist/ss-component2.js +12 -12
  43. package/dist/{threeModel-CLD0WbH4.js → threeModel-om3lolpg.js} +4 -4
  44. package/dist/{threePreview-DPTGt5fZ.js → threePreview-BKq8-BNs.js} +4 -4
  45. package/dist/{threeSceneView-D9Wvyxa8.js → threeSceneView-B9HE-6FF.js} +14 -13
  46. package/dist/{threeSceneViewForCPMPIP-DgDWnH17.js → threeSceneViewForCPMPIP-B3iqjUVV.js} +8 -8
  47. package/dist/{threeTrackPathView-CHwHb3Z5.js → threeTrackPathView-Cua5p2_z.js} +4 -4
  48. package/dist/{threeViewerHost-Blk3sWCI.js → threeViewerHost-BgkLy3Px.js} +12 -12
  49. package/dist/{urdfTree-_2vCDAO7.js → urdfTree-CEVNcjbP.js} +1 -1
  50. package/dist/{workpieceTreePanel-BaMbkaOM.js → workpieceTreePanel-5Z2rOZ9E.js} +4 -4
  51. package/package.json +1 -1
  52. package/dist/clone-ez7vwxnP.js +0 -8
  53. package/dist/index-BscI3lbU.js +0 -55
  54. package/dist/index-CQD9tf3F.js +0 -197
  55. package/dist/index-RLUSh93k.js +0 -1000
@@ -0,0 +1,1048 @@
1
+ import { createElementBlock as R, openBlock as $, createElementVNode as r, renderSlot as M, defineComponent as W, ref as C, resolveComponent as w, createVNode as a, withCtx as o, unref as j, reactive as ne, computed as G, onMounted as _e, createBlock as Y, resolveDirective as we, createCommentVNode as le, withDirectives as Te, normalizeClass as re, toDisplayString as x, Transition as ke, watch as te, Fragment as Ue, createTextVNode as P, onBeforeUnmount as Ve } from "vue";
2
+ import { _ as K } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ import { e as J, p as B, s as ae, l as Le, h as $e, i as qe, j as Ae, u as De, a as Ie, k as Ne, m as Fe, v as Re } from "./index-DeGxq_J_.js";
4
+ import { _ as Z } from "./index.vue_vue_type_script_setup_true_lang-DRzriV-s.js";
5
+ import { c as Se, a as xe, f as Me, b as ce, E as ie } from "./request-B1c8BUkR.js";
6
+ import "./JSEncrypt-B36c1iN5.js";
7
+ import { u as Ee } from "./index-CH17Cg3K.js";
8
+ import { useRouter as Oe } from "vue-router";
9
+ const Be = {}, Pe = { class: "left-wrap" }, je = { class: "left-bg" };
10
+ function Ke(v, g) {
11
+ return $(), R("div", Pe, [
12
+ r("div", je, [
13
+ M(v.$slots, "img", {}, void 0, !0)
14
+ ])
15
+ ]);
16
+ }
17
+ const He = /* @__PURE__ */ K(Be, [["render", Ke], ["__scopeId", "data-v-9b7ee6c9"]]), ee = {
18
+ ACCOUNT: "account",
19
+ FACE: "face"
20
+ }, ze = { class: "right-wrap" }, Qe = { class: "tab-content" }, We = { class: "tab-tips" }, Je = { class: "tab-content" }, Xe = { class: "tab-tips" }, Ge = /* @__PURE__ */ W({
21
+ __name: "index",
22
+ props: {
23
+ tabList: {
24
+ type: Array,
25
+ default: []
26
+ },
27
+ loading: {
28
+ type: Boolean,
29
+ default: !1
30
+ }
31
+ },
32
+ emits: ["clickLogin", "handleTabChange"],
33
+ setup(v, { emit: g }) {
34
+ const n = C(ee.ACCOUNT), s = g, b = () => {
35
+ s("clickLogin", n.value);
36
+ }, e = (_) => {
37
+ s("handleTabChange", _);
38
+ };
39
+ return (_, y) => {
40
+ const f = w("el-button"), U = w("el-tab-pane"), V = w("el-tabs");
41
+ return $(), R("div", ze, [
42
+ a(V, {
43
+ modelValue: n.value,
44
+ "onUpdate:modelValue": y[0] || (y[0] = (T) => n.value = T),
45
+ class: "right-tabs",
46
+ onTabChange: e
47
+ }, {
48
+ default: o(() => [
49
+ a(U, {
50
+ name: j(ee).ACCOUNT
51
+ }, {
52
+ label: o(() => [
53
+ M(_.$slots, "tabLabel1", {}, void 0, !0)
54
+ ]),
55
+ default: o(() => [
56
+ r("div", Qe, [
57
+ M(_.$slots, "tabContent1", {}, void 0, !0)
58
+ ]),
59
+ r("div", {
60
+ class: "tab-button special",
61
+ onClick: b
62
+ }, [
63
+ a(f, { loading: v.loading }, {
64
+ default: o(() => [
65
+ M(_.$slots, "tabButton1", {}, void 0, !0)
66
+ ]),
67
+ _: 3
68
+ }, 8, ["loading"])
69
+ ]),
70
+ r("div", We, [
71
+ M(_.$slots, "tabTips1", {}, void 0, !0)
72
+ ])
73
+ ]),
74
+ _: 3
75
+ }, 8, ["name"]),
76
+ a(U, {
77
+ name: j(ee).FACE
78
+ }, {
79
+ label: o(() => [
80
+ M(_.$slots, "tabLabel2", {}, void 0, !0)
81
+ ]),
82
+ default: o(() => [
83
+ r("div", Je, [
84
+ M(_.$slots, "tabContent2", {}, void 0, !0)
85
+ ]),
86
+ r("div", Xe, [
87
+ M(_.$slots, "tabTips2", {}, void 0, !0)
88
+ ])
89
+ ]),
90
+ _: 3
91
+ }, 8, ["name"])
92
+ ]),
93
+ _: 3
94
+ }, 8, ["modelValue"])
95
+ ]);
96
+ };
97
+ }
98
+ }), Ye = /* @__PURE__ */ K(Ge, [["__scopeId", "data-v-8b1962f0"]]), Ze = /^[a-z][a-z0-9+.-]*:\/\//i, de = (v) => Ze.test(v);
99
+ function et(v) {
100
+ de(v) || (v = `http://${v}`);
101
+ try {
102
+ const g = new URL(v);
103
+ return {
104
+ host: g.hostname,
105
+ // 域名:example.com
106
+ port: g.port || null
107
+ // 端口:8080(默认端口返回空字符串,转为 null)
108
+ };
109
+ } catch {
110
+ return {
111
+ host: null,
112
+ port: null
113
+ };
114
+ }
115
+ }
116
+ const tt = () => ({ initUrlInfo: () => ({
117
+ host: null,
118
+ port: null
119
+ }), hasProtocol: de, generateUrl: (n) => {
120
+ const { host: s, port: b } = n;
121
+ if (!s)
122
+ return null;
123
+ let e = `${s}`;
124
+ return de(s) || (e = `http://${e}`), b && (e = `${e}:${b}`), e;
125
+ } }), at = { class: "body-wrapper" }, ot = { class: "api-form-wrapper" }, st = { class: "edit-footer" }, lt = { class: "footer-right" }, nt = /* @__PURE__ */ W({
126
+ __name: "index",
127
+ emits: ["updateApiUrl"],
128
+ setup(v, { expose: g, emit: n }) {
129
+ const s = n, b = J(B), { systemUrl: e } = ae(b), { initUrlInfo: _, generateUrl: y } = tt(), f = C(_()), U = C(), V = ne({
130
+ host: [
131
+ { required: !0, message: "请输入职位名称", trigger: "blur" }
132
+ ]
133
+ }), T = G(() => e.value || "http://222.92.178.198:63002"), c = () => {
134
+ f.value = et(T.value);
135
+ };
136
+ _e(() => {
137
+ c();
138
+ });
139
+ const t = C(!1), i = () => {
140
+ c(), t.value = !0;
141
+ }, d = () => {
142
+ t.value = !1;
143
+ }, p = () => {
144
+ d();
145
+ }, L = async () => {
146
+ var u;
147
+ await ((u = U.value) == null ? void 0 : u.validate());
148
+ const k = y(f.value);
149
+ s("updateApiUrl", k), p();
150
+ };
151
+ return g({
152
+ openDialog: i,
153
+ handleClose: p
154
+ }), (k, u) => {
155
+ const A = w("el-input"), I = w("el-form-item"), E = w("el-col"), m = w("el-row"), q = w("el-form"), S = w("el-dialog");
156
+ return $(), Y(S, {
157
+ class: "api-form-dialog",
158
+ modelValue: t.value,
159
+ "onUpdate:modelValue": u[2] || (u[2] = (N) => t.value = N),
160
+ "before-close": p,
161
+ "destroy-on-close": "",
162
+ "show-close": !1
163
+ }, {
164
+ header: o(() => u[3] || (u[3] = [])),
165
+ default: o(() => [
166
+ r("div", at, [
167
+ r("div", ot, [
168
+ a(q, {
169
+ class: "api-edit-form",
170
+ ref_key: "apiFormRef",
171
+ ref: U,
172
+ model: f.value,
173
+ rules: V
174
+ }, {
175
+ default: o(() => [
176
+ a(m, { gutter: 20 }, {
177
+ default: o(() => [
178
+ a(E, { span: 12 }, {
179
+ default: o(() => [
180
+ a(I, {
181
+ prop: "host",
182
+ label: "主机名",
183
+ "label-position": "top"
184
+ }, {
185
+ default: o(() => [
186
+ a(A, {
187
+ modelValue: f.value.host,
188
+ "onUpdate:modelValue": u[0] || (u[0] = (N) => f.value.host = N),
189
+ "aria-label": "主机名",
190
+ placeholder: "主机名"
191
+ }, null, 8, ["modelValue"])
192
+ ]),
193
+ _: 1
194
+ })
195
+ ]),
196
+ _: 1
197
+ }),
198
+ a(E, { span: 12 }, {
199
+ default: o(() => [
200
+ a(I, {
201
+ prop: "port",
202
+ label: "端口",
203
+ "label-position": "top"
204
+ }, {
205
+ default: o(() => [
206
+ a(A, {
207
+ modelValue: f.value.port,
208
+ "onUpdate:modelValue": u[1] || (u[1] = (N) => f.value.port = N),
209
+ "aria-label": "端口",
210
+ placeholder: "端口"
211
+ }, null, 8, ["modelValue"])
212
+ ]),
213
+ _: 1
214
+ })
215
+ ]),
216
+ _: 1
217
+ })
218
+ ]),
219
+ _: 1
220
+ })
221
+ ]),
222
+ _: 1
223
+ }, 8, ["model", "rules"])
224
+ ])
225
+ ])
226
+ ]),
227
+ footer: o(() => [
228
+ r("div", st, [
229
+ u[4] || (u[4] = r("div", { class: "footer-left" }, null, -1)),
230
+ r("div", lt, [
231
+ a(Z, {
232
+ class: "cancel",
233
+ emptyColor: !0,
234
+ onClickTrigger: p,
235
+ modelValue: "取消",
236
+ buttonType: "info"
237
+ }),
238
+ a(Z, {
239
+ class: "confirm",
240
+ emptyColor: !0,
241
+ onClickTrigger: L,
242
+ modelValue: "确定",
243
+ buttonType: "primary"
244
+ })
245
+ ])
246
+ ])
247
+ ]),
248
+ _: 1
249
+ }, 8, ["modelValue"]);
250
+ };
251
+ }
252
+ }), it = /* @__PURE__ */ K(nt, [["__scopeId", "data-v-20c1098b"]]), rt = { class: "dialog-header" }, ct = { class: "dialog-subtitle" }, ut = {
253
+ key: 0,
254
+ class: "restart-panel"
255
+ }, dt = { class: "restart-title" }, pt = { class: "restart-subtitle" }, mt = {
256
+ key: 1,
257
+ class: "dialog-body"
258
+ }, ft = { class: "db-type-selector" }, gt = { key: "sqlite" }, _t = { key: "pgsql" }, vt = {
259
+ key: 0,
260
+ class: "dialog-footer"
261
+ }, bt = 6e4, me = 2e3, yt = /* @__PURE__ */ W({
262
+ __name: "index",
263
+ setup(v, { expose: g }) {
264
+ const n = J(B), { systemUrl: s } = ae(n), b = G(() => s.value || "http://222.92.178.198:63002"), e = ne({
265
+ databaseType: "sqlite",
266
+ sqliteDir: "sqlite-data",
267
+ user: "",
268
+ host: "",
269
+ database: "",
270
+ password: "",
271
+ port: "5432"
272
+ }), _ = G(() => e.databaseType === "sqlite" ? {
273
+ sqliteDir: [{ required: !0, message: "请输入数据库目录", trigger: "blur" }]
274
+ } : {
275
+ host: [{ required: !0, message: "请输入主机地址", trigger: "blur" }],
276
+ port: [{ required: !0, message: "请输入端口号", trigger: "blur" }],
277
+ database: [{ required: !0, message: "请输入数据库名", trigger: "blur" }],
278
+ user: [{ required: !0, message: "请输入用户名", trigger: "blur" }]
279
+ }), y = C(null), f = C(!1), U = C(!1), V = C(!1), T = C(!1), c = C(0), t = C("running"), i = C(1);
280
+ let d = null;
281
+ const p = G(() => t.value === "success" ? "重启成功!" : t.value === "timeout" ? "连接超时" : "正在应用配置并等待服务重新启动中..."), L = G(() => t.value === "success" ? "服务已恢复,配置已生效" : t.value === "timeout" ? "超过最大等待时间,请手动检查服务状态" : "请稍后" + ".".repeat(i.value));
282
+ let k = null, u = null;
283
+ const A = () => {
284
+ d && (clearInterval(d), d = null);
285
+ }, I = () => {
286
+ k && (clearInterval(k), k = null), u && (clearInterval(u), u = null), A();
287
+ }, E = () => {
288
+ c.value = 0;
289
+ let h = 0;
290
+ k = setInterval(() => {
291
+ h += 100;
292
+ const l = 90 * (1 - Math.exp(-h / 8e3));
293
+ c.value = Math.min(parseFloat(l.toFixed(1)), 90);
294
+ }, 100);
295
+ }, m = () => {
296
+ i.value = 1, d = setInterval(() => {
297
+ i.value = i.value >= 3 ? 1 : i.value + 1;
298
+ }, 500);
299
+ }, q = () => {
300
+ A();
301
+ const h = setInterval(() => {
302
+ c.value = Math.min(c.value + 3, 100), c.value >= 100 && (clearInterval(h), t.value = "success");
303
+ }, 30);
304
+ }, S = () => {
305
+ let h = 0;
306
+ u = setInterval(async () => {
307
+ if (h += me, h >= bt) {
308
+ I(), t.value = "timeout";
309
+ return;
310
+ }
311
+ try {
312
+ const { data: l } = await ce.get(b.value + "/platform/config/db", { timeout: 3e3 });
313
+ (l == null ? void 0 : l.code) === 200 && (I(), q());
314
+ } catch {
315
+ }
316
+ }, me);
317
+ }, N = async () => {
318
+ try {
319
+ U.value = !0;
320
+ const { data: h } = await ce.get(b.value + "/platform/config/db");
321
+ if ((h == null ? void 0 : h.code) === 200 && (h != null && h.data)) {
322
+ const l = h.data;
323
+ e.databaseType = l.databaseType === "pgsql" ? "pgsql" : "sqlite", e.sqliteDir = l.sqliteDir || "sqlite-data", e.user = l.user || "", e.host = l.host || "", e.database = l.database || "", e.password = l.password || "", e.port = String(l.port || 5432);
324
+ }
325
+ } catch {
326
+ } finally {
327
+ U.value = !1;
328
+ }
329
+ }, oe = () => {
330
+ T.value = !1, t.value = "running", c.value = 0, i.value = 1, f.value = !0, N();
331
+ }, X = () => {
332
+ I(), f.value = !1;
333
+ }, H = () => X(), ve = (h) => {
334
+ T.value || h();
335
+ }, be = async () => {
336
+ var h, l, z;
337
+ await ((h = y.value) == null ? void 0 : h.validate());
338
+ try {
339
+ V.value = !0;
340
+ const F = { databaseType: e.databaseType };
341
+ e.databaseType === "sqlite" ? F.sqliteDir = e.sqliteDir.trim() : (F.user = e.user.trim(), F.host = e.host.trim(), F.database = e.database.trim(), F.password = e.password, F.port = Number(e.port)), await ce.post(b.value + "/platform/config/db", F), T.value = !0, t.value = "running", E(), m(), setTimeout(S, 1e3);
342
+ } catch (F) {
343
+ const O = ((z = (l = F == null ? void 0 : F.response) == null ? void 0 : l.data) == null ? void 0 : z.message) || "保存失败,请重试";
344
+ ie.error(O);
345
+ } finally {
346
+ V.value = !1;
347
+ }
348
+ };
349
+ return g({ openDialog: oe, handleClose: H }), (h, l) => {
350
+ const z = w("el-icon"), F = w("el-progress"), O = w("el-input"), Q = w("el-form-item"), se = w("el-col"), pe = w("el-row"), ye = w("el-form"), he = w("el-dialog"), Ce = we("loading");
351
+ return $(), Y(he, {
352
+ class: "db-config-dialog",
353
+ modelValue: f.value,
354
+ "onUpdate:modelValue": l[8] || (l[8] = (D) => f.value = D),
355
+ "before-close": ve,
356
+ "close-on-click-modal": !T.value,
357
+ "close-on-press-escape": !T.value,
358
+ "destroy-on-close": "",
359
+ "show-close": !1,
360
+ width: "480px"
361
+ }, {
362
+ header: o(() => [
363
+ r("div", rt, [
364
+ l[9] || (l[9] = r("span", { class: "dialog-title" }, "数据库配置", -1)),
365
+ r("span", ct, x(T.value ? "" : "修改后服务将自动重启"), 1)
366
+ ])
367
+ ]),
368
+ default: o(() => [
369
+ T.value ? ($(), R("div", ut, [
370
+ t.value !== "running" ? ($(), R("div", {
371
+ key: 0,
372
+ class: re(["restart-icon-wrap", { success: t.value === "success", error: t.value === "timeout" }])
373
+ }, [
374
+ t.value === "success" ? ($(), Y(z, {
375
+ key: 0,
376
+ class: "restart-icon"
377
+ }, {
378
+ default: o(() => [
379
+ a(j(Se))
380
+ ]),
381
+ _: 1
382
+ })) : ($(), Y(z, {
383
+ key: 1,
384
+ class: "restart-icon"
385
+ }, {
386
+ default: o(() => [
387
+ a(j(xe))
388
+ ]),
389
+ _: 1
390
+ }))
391
+ ], 2)) : le("", !0),
392
+ r("div", dt, x(p.value), 1),
393
+ r("div", pt, x(L.value), 1),
394
+ a(F, {
395
+ class: "restart-progress",
396
+ percentage: Math.round(c.value),
397
+ status: t.value === "success" ? "success" : t.value === "timeout" ? "exception" : "",
398
+ "stroke-width": 10
399
+ }, null, 8, ["percentage", "status"]),
400
+ t.value === "success" || t.value === "timeout" ? ($(), Y(Z, {
401
+ key: 1,
402
+ class: "restart-close-btn",
403
+ emptyColor: !0,
404
+ onClickTrigger: X,
405
+ modelValue: t.value === "success" ? "确定" : "关闭",
406
+ buttonType: t.value === "success" ? "primary" : "info"
407
+ }, null, 8, ["modelValue", "buttonType"])) : le("", !0)
408
+ ])) : Te(($(), R("div", mt, [
409
+ r("div", ft, [
410
+ r("div", {
411
+ class: re(["db-type-card", { active: e.databaseType === "sqlite" }]),
412
+ onClick: l[0] || (l[0] = (D) => e.databaseType = "sqlite")
413
+ }, l[10] || (l[10] = [
414
+ r("span", { class: "db-label" }, "SQLite", -1),
415
+ r("span", { class: "db-desc" }, "本地文件数据库", -1)
416
+ ]), 2),
417
+ r("div", {
418
+ class: re(["db-type-card", { active: e.databaseType === "pgsql" }]),
419
+ onClick: l[1] || (l[1] = (D) => e.databaseType = "pgsql")
420
+ }, l[11] || (l[11] = [
421
+ r("span", { class: "db-label" }, "PostgreSQL", -1),
422
+ r("span", { class: "db-desc" }, "远程关系型数据库", -1)
423
+ ]), 2)
424
+ ]),
425
+ a(ye, {
426
+ ref_key: "formRef",
427
+ ref: y,
428
+ model: e,
429
+ rules: _.value,
430
+ "label-position": "top",
431
+ class: "config-form"
432
+ }, {
433
+ default: o(() => [
434
+ a(ke, {
435
+ name: "fade-slide",
436
+ mode: "out-in"
437
+ }, {
438
+ default: o(() => [
439
+ e.databaseType === "sqlite" ? ($(), R("div", gt, [
440
+ a(Q, {
441
+ label: "数据库目录",
442
+ prop: "sqliteDir"
443
+ }, {
444
+ default: o(() => [
445
+ a(O, {
446
+ modelValue: e.sqliteDir,
447
+ "onUpdate:modelValue": l[2] || (l[2] = (D) => e.sqliteDir = D),
448
+ placeholder: "例如:sqlite-data",
449
+ clearable: ""
450
+ }, {
451
+ prefix: o(() => [
452
+ a(z, null, {
453
+ default: o(() => [
454
+ a(j(Me))
455
+ ]),
456
+ _: 1
457
+ })
458
+ ]),
459
+ _: 1
460
+ }, 8, ["modelValue"]),
461
+ l[12] || (l[12] = r("div", { class: "field-hint" }, "相对于后端 exe 所在目录的路径", -1))
462
+ ]),
463
+ _: 1,
464
+ __: [12]
465
+ })
466
+ ])) : ($(), R("div", _t, [
467
+ a(pe, { gutter: 16 }, {
468
+ default: o(() => [
469
+ a(se, { span: 16 }, {
470
+ default: o(() => [
471
+ a(Q, {
472
+ label: "主机地址",
473
+ prop: "host"
474
+ }, {
475
+ default: o(() => [
476
+ a(O, {
477
+ modelValue: e.host,
478
+ "onUpdate:modelValue": l[3] || (l[3] = (D) => e.host = D),
479
+ placeholder: "127.0.0.1",
480
+ clearable: ""
481
+ }, null, 8, ["modelValue"])
482
+ ]),
483
+ _: 1
484
+ })
485
+ ]),
486
+ _: 1
487
+ }),
488
+ a(se, { span: 8 }, {
489
+ default: o(() => [
490
+ a(Q, {
491
+ label: "端口",
492
+ prop: "port"
493
+ }, {
494
+ default: o(() => [
495
+ a(O, {
496
+ modelValue: e.port,
497
+ "onUpdate:modelValue": l[4] || (l[4] = (D) => e.port = D),
498
+ placeholder: "5432",
499
+ clearable: ""
500
+ }, null, 8, ["modelValue"])
501
+ ]),
502
+ _: 1
503
+ })
504
+ ]),
505
+ _: 1
506
+ })
507
+ ]),
508
+ _: 1
509
+ }),
510
+ a(Q, {
511
+ label: "数据库名",
512
+ prop: "database"
513
+ }, {
514
+ default: o(() => [
515
+ a(O, {
516
+ modelValue: e.database,
517
+ "onUpdate:modelValue": l[5] || (l[5] = (D) => e.database = D),
518
+ placeholder: "new_insofworks_admin",
519
+ clearable: ""
520
+ }, null, 8, ["modelValue"])
521
+ ]),
522
+ _: 1
523
+ }),
524
+ a(pe, { gutter: 16 }, {
525
+ default: o(() => [
526
+ a(se, { span: 12 }, {
527
+ default: o(() => [
528
+ a(Q, {
529
+ label: "用户名",
530
+ prop: "user"
531
+ }, {
532
+ default: o(() => [
533
+ a(O, {
534
+ modelValue: e.user,
535
+ "onUpdate:modelValue": l[6] || (l[6] = (D) => e.user = D),
536
+ placeholder: "postgres",
537
+ clearable: ""
538
+ }, null, 8, ["modelValue"])
539
+ ]),
540
+ _: 1
541
+ })
542
+ ]),
543
+ _: 1
544
+ }),
545
+ a(se, { span: 12 }, {
546
+ default: o(() => [
547
+ a(Q, {
548
+ label: "密码",
549
+ prop: "password"
550
+ }, {
551
+ default: o(() => [
552
+ a(O, {
553
+ modelValue: e.password,
554
+ "onUpdate:modelValue": l[7] || (l[7] = (D) => e.password = D),
555
+ type: "password",
556
+ "show-password": "",
557
+ clearable: ""
558
+ }, null, 8, ["modelValue"])
559
+ ]),
560
+ _: 1
561
+ })
562
+ ]),
563
+ _: 1
564
+ })
565
+ ]),
566
+ _: 1
567
+ })
568
+ ]))
569
+ ]),
570
+ _: 1
571
+ })
572
+ ]),
573
+ _: 1
574
+ }, 8, ["model", "rules"])
575
+ ])), [
576
+ [Ce, U.value]
577
+ ])
578
+ ]),
579
+ footer: o(() => [
580
+ T.value ? le("", !0) : ($(), R("div", vt, [
581
+ a(Z, {
582
+ emptyColor: !0,
583
+ onClickTrigger: H,
584
+ modelValue: "取消",
585
+ buttonType: "info"
586
+ }),
587
+ a(Z, {
588
+ emptyColor: !0,
589
+ loading: V.value,
590
+ onClickTrigger: be,
591
+ modelValue: "保存并重启",
592
+ buttonType: "primary"
593
+ }, null, 8, ["loading"])
594
+ ]))
595
+ ]),
596
+ _: 1
597
+ }, 8, ["modelValue", "close-on-click-modal", "close-on-press-escape"]);
598
+ };
599
+ }
600
+ }), ht = /* @__PURE__ */ K(yt, [["__scopeId", "data-v-01b4eb9b"]]), Ct = { class: "account-wrap" }, wt = { class: "extra-operate" }, Tt = /* @__PURE__ */ W({
601
+ __name: "index",
602
+ props: {
603
+ activeTabName: {
604
+ type: String,
605
+ default: ""
606
+ },
607
+ isClickLogin: {
608
+ type: Boolean,
609
+ default: !1
610
+ }
611
+ },
612
+ emits: ["handleLoginFormChange", "updateApiUrl"],
613
+ setup(v, { emit: g }) {
614
+ const n = v, s = ne({
615
+ account: "",
616
+ password: ""
617
+ }), b = ne({
618
+ account: [
619
+ { required: !0, message: "请输入账号", trigger: "blur" }
620
+ ],
621
+ password: [
622
+ { required: !0, message: "请输入密码", trigger: "blur" }
623
+ ]
624
+ }), e = C(null), _ = g;
625
+ te(() => n.isClickLogin, (c) => {
626
+ var t;
627
+ c && (n == null ? void 0 : n.activeTabName) === "account" && ((t = e.value) == null || t.validate((i) => {
628
+ var d;
629
+ for (let p in s)
630
+ s.hasOwnProperty(p) && (s[p] = (d = s[p]) == null ? void 0 : d.trim());
631
+ _("handleLoginFormChange", i, i ? s : null);
632
+ }));
633
+ }, {
634
+ immediate: !0
635
+ }), te(() => n.activeTabName, (c) => {
636
+ var t;
637
+ c === "account" && ((t = e.value) == null || t.resetFields());
638
+ });
639
+ const y = C(), f = () => {
640
+ var c, t;
641
+ (t = (c = y.value) == null ? void 0 : c.openDialog) == null || t.call(c);
642
+ }, U = (c) => {
643
+ _("updateApiUrl", c);
644
+ }, V = C(), T = () => {
645
+ var c, t;
646
+ (t = (c = V.value) == null ? void 0 : c.openDialog) == null || t.call(c);
647
+ };
648
+ return (c, t) => {
649
+ const i = w("svg-icon"), d = w("el-input"), p = w("el-form-item"), L = w("el-form"), k = w("el-link");
650
+ return $(), R(Ue, null, [
651
+ r("div", Ct, [
652
+ a(L, {
653
+ model: s,
654
+ rules: b,
655
+ ref_key: "formRef",
656
+ ref: e
657
+ }, {
658
+ default: o(() => [
659
+ a(p, {
660
+ label: "",
661
+ prop: "account"
662
+ }, {
663
+ default: o(() => [
664
+ a(d, {
665
+ class: "account-input",
666
+ modelValue: s.account,
667
+ "onUpdate:modelValue": t[0] || (t[0] = (u) => s.account = u),
668
+ placeholder: "请输入账号",
669
+ clearable: ""
670
+ }, {
671
+ prefix: o(() => [
672
+ a(i, {
673
+ name: "account",
674
+ style: { width: "15px", height: "15px" }
675
+ })
676
+ ]),
677
+ _: 1
678
+ }, 8, ["modelValue"])
679
+ ]),
680
+ _: 1
681
+ }),
682
+ a(p, {
683
+ label: "",
684
+ prop: "password"
685
+ }, {
686
+ default: o(() => [
687
+ a(d, {
688
+ class: "account-input",
689
+ modelValue: s.password,
690
+ "onUpdate:modelValue": t[1] || (t[1] = (u) => s.password = u),
691
+ type: "password",
692
+ placeholder: "请输入密码",
693
+ "show-password": "",
694
+ clearable: ""
695
+ }, {
696
+ prefix: o(() => [
697
+ a(i, {
698
+ name: "password",
699
+ style: { width: "15px", height: "15px" }
700
+ })
701
+ ]),
702
+ _: 1
703
+ }, 8, ["modelValue"])
704
+ ]),
705
+ _: 1
706
+ })
707
+ ]),
708
+ _: 1
709
+ }, 8, ["model", "rules"]),
710
+ r("div", wt, [
711
+ a(k, {
712
+ class: "api-button",
713
+ type: "primary",
714
+ onClick: f
715
+ }, {
716
+ default: o(() => t[2] || (t[2] = [
717
+ P("接口地址")
718
+ ])),
719
+ _: 1,
720
+ __: [2]
721
+ }),
722
+ a(k, {
723
+ class: "db-button",
724
+ type: "primary",
725
+ onClick: T
726
+ }, {
727
+ default: o(() => t[3] || (t[3] = [
728
+ P("数据库配置")
729
+ ])),
730
+ _: 1,
731
+ __: [3]
732
+ })
733
+ ])
734
+ ]),
735
+ a(it, {
736
+ ref_key: "apiFormDialogRef",
737
+ ref: y,
738
+ onUpdateApiUrl: U
739
+ }, null, 512),
740
+ a(ht, {
741
+ ref_key: "dbConfigDialogRef",
742
+ ref: V
743
+ }, null, 512)
744
+ ], 64);
745
+ };
746
+ }
747
+ }), kt = /* @__PURE__ */ K(Tt, [["__scopeId", "data-v-101a522a"]]), Ut = { class: "account-wrap" }, Vt = { class: "video-wrap" }, Lt = /* @__PURE__ */ W({
748
+ __name: "index",
749
+ props: {
750
+ systemKey: { default: "" },
751
+ activeTabName: { default: "" },
752
+ isClickLogin: { type: Boolean, default: !1 }
753
+ },
754
+ emits: ["handleLoginFormChange"],
755
+ setup(v, { emit: g }) {
756
+ const n = v, s = g;
757
+ J(B);
758
+ const { initVerify: b } = Ee(), e = C(null), _ = C(null);
759
+ let y = !1, f = null;
760
+ const U = async (i) => {
761
+ if (!i)
762
+ return;
763
+ const d = await b(i), { data: p } = d || {}, { account: L, password: k } = (p == null ? void 0 : p.data) || {}, u = p == null ? void 0 : p.msg;
764
+ if (!L) {
765
+ ie.warning(u || "识别失败,请重新识别!");
766
+ return;
767
+ }
768
+ s("handleLoginFormChange", !0, {
769
+ account: L,
770
+ password: k
771
+ });
772
+ }, V = () => {
773
+ if (!_.value || !e.value)
774
+ return;
775
+ const i = _.value, d = i.getContext("2d"), p = e.value;
776
+ i.width = 200, i.height = 200;
777
+ const L = p.videoWidth || 640, k = p.videoHeight || 480, u = Math.min(200 / L, 200 / k), A = L * u, I = k * u, E = (200 - A) / 2, m = (200 - I) / 2;
778
+ d == null || d.drawImage(p, 0, 0, L, k, E, m, A, I), i.toBlob((q) => {
779
+ if (q) {
780
+ const S = new File([q], "face.png", { type: "image/png" });
781
+ U(S);
782
+ }
783
+ }, "image/png");
784
+ }, T = async () => {
785
+ if (!e.value || y)
786
+ return;
787
+ const i = e.value;
788
+ try {
789
+ if (f = await navigator.mediaDevices.getUserMedia({
790
+ video: { facingMode: "user" },
791
+ // 前置;后置用 'environment'
792
+ audio: !1
793
+ }), i) {
794
+ const d = i;
795
+ d.srcObject = f, y = !0;
796
+ }
797
+ } catch {
798
+ ie.warning("摄像头启动失败");
799
+ }
800
+ };
801
+ function c(i) {
802
+ if (i && (i.getTracks().forEach((d) => d.stop()), e.value)) {
803
+ const d = e.value;
804
+ d.srcObject = null;
805
+ }
806
+ }
807
+ const t = () => {
808
+ c(f), y = !1;
809
+ };
810
+ return te(() => n.activeTabName, (i) => {
811
+ if (i !== ee.FACE) {
812
+ t();
813
+ return;
814
+ }
815
+ if (i === ee.FACE && !y) {
816
+ T();
817
+ return;
818
+ }
819
+ }), Ve(() => {
820
+ t();
821
+ }), (i, d) => ($(), R("div", Ut, [
822
+ r("div", Vt, [
823
+ r("video", {
824
+ class: "face-video",
825
+ ref_key: "videoRef",
826
+ ref: e,
827
+ id: "v",
828
+ autoplay: "",
829
+ playsinline: ""
830
+ }, null, 512)
831
+ ]),
832
+ M(i.$slots, "default", {}, () => [
833
+ r("button", {
834
+ class: "face-screenshot",
835
+ onClick: V
836
+ }, "人脸识别")
837
+ ], !0),
838
+ r("canvas", {
839
+ ref_key: "canvasRef",
840
+ ref: _,
841
+ id: "canvas"
842
+ }, null, 512)
843
+ ]));
844
+ }
845
+ }), $t = /* @__PURE__ */ K(Lt, [["__scopeId", "data-v-b64bc91c"]]), fe = J(B), { isDefaultModel: qt } = qe(), At = async (v, g) => {
846
+ var b, e, _, y, f, U, V, T, c, t, i, d, p, L;
847
+ let n = Object.values(v), s = await Le({
848
+ userName: (b = n == null ? void 0 : n[0]) == null ? void 0 : b.trim(),
849
+ password: (e = n == null ? void 0 : n[1]) == null ? void 0 : e.trim()
850
+ });
851
+ if (((_ = s == null ? void 0 : s.data) == null ? void 0 : _.status) === 200 && ((f = (y = s == null ? void 0 : s.data) == null ? void 0 : y.result) == null ? void 0 : f.length) <= 0 && (s = await $e({
852
+ userName: (U = n == null ? void 0 : n[0]) == null ? void 0 : U.trim(),
853
+ password: (V = n == null ? void 0 : n[1]) == null ? void 0 : V.trim(),
854
+ path: "系统管理/用户管理",
855
+ platId: g
856
+ })), ((T = s == null ? void 0 : s.data) == null ? void 0 : T.status) === 200 && ((t = (c = s == null ? void 0 : s.data) == null ? void 0 : c.result) == null ? void 0 : t.length) > 0) {
857
+ const u = ((d = (i = s == null ? void 0 : s.data) == null ? void 0 : i.result) == null ? void 0 : d.find((I) => qt(I))) || ((L = (p = s == null ? void 0 : s.data) == null ? void 0 : p.result) == null ? void 0 : L[0]);
858
+ sessionStorage.setItem("systemKey", g && g !== "" ? g : u == null ? void 0 : u.plat_id);
859
+ let A = u;
860
+ return A.plat_id = A.plat_id ?? g, fe.setLoginUserInfo(A), fe.setSystemKey(g && g !== "" ? g : u == null ? void 0 : u.plat_id), !0;
861
+ } else
862
+ return ie.error("输入的密码错误,请重新输入"), !1;
863
+ }, Dt = J(B), { systemInfo: ge, loginUserInfo: ue } = ae(Dt), It = async () => (sessionStorage.setItem("loginToken", "111"), !0), Nt = async () => (sessionStorage.setItem("magicToken", "123456"), !0), Ft = async (v) => {
864
+ var e, _, y;
865
+ let g = [At(v, (e = ge.value) == null ? void 0 : e.plat_id), It(), Nt()];
866
+ const n = await Promise.all(g), s = n == null ? void 0 : n.every((f) => f);
867
+ let b = [
868
+ {
869
+ id: "1",
870
+ request_method: "Post",
871
+ request_url: "/platform/getdata",
872
+ request_param: JSON.stringify({
873
+ userName: "hjj",
874
+ password: "1"
875
+ }),
876
+ request_result: "{}",
877
+ is_delete: !1,
878
+ request_table: "admin_user",
879
+ request_type: "login"
880
+ }
881
+ ];
882
+ try {
883
+ const f = ((_ = ue == null ? void 0 : ue.value) == null ? void 0 : _.plat_id) || ((y = ge.value) == null ? void 0 : y.plat_id);
884
+ return await Ae({
885
+ platId: parseInt(f),
886
+ changeContents: [{
887
+ tableName: "log",
888
+ tableContents: b
889
+ }]
890
+ }), s;
891
+ } catch {
892
+ return s;
893
+ }
894
+ }, Rt = { class: "login-wrap" }, St = { class: "login-body" }, xt = { class: "login-body-item left" }, Mt = { class: "title" }, Et = { class: "first-level" }, Ot = {
895
+ key: 0,
896
+ class: "logo"
897
+ }, Bt = ["src"], Pt = { class: "english-name" }, jt = { class: "login-body-item right" }, Kt = /* @__PURE__ */ W({
898
+ __name: "index",
899
+ props: {
900
+ oldSystemKey: {},
901
+ loginContent: {}
902
+ },
903
+ emits: ["change", "projectLogin", "updateApiUrl", "systemContent"],
904
+ setup(v, { emit: g }) {
905
+ const n = v, s = Oe(), b = g, e = De(B), _ = Ie(B), { refreshLogin: y } = ae(_), f = J(B), { systemInfo: U, loginUserInfo: V } = ae(f), T = async (m) => {
906
+ const q = await Fe({
907
+ url: m
908
+ });
909
+ return URL.createObjectURL(q == null ? void 0 : q.data);
910
+ }, c = C("");
911
+ te(() => {
912
+ var m;
913
+ return (m = U.value) == null ? void 0 : m.logo;
914
+ }, async (m) => {
915
+ m ? c.value = await T(m) : c.value = Ne;
916
+ }, { immediate: !0 });
917
+ const t = C({
918
+ // sysCTitle: 'INSOFWORKS',
919
+ sysCTitle: "",
920
+ sysETitle: "",
921
+ // sysETitle: 'Dynamic Test Information System',
922
+ loginTitle: "账户密码登录",
923
+ tabs: [
924
+ {
925
+ name: "密码登录",
926
+ btnLabel: "登录",
927
+ tips: "温馨提示:建议使用谷歌、Microsoft Edge,版本79.0.1072.62及以上浏览器,360浏览器请使用极速模式"
928
+ },
929
+ {
930
+ name: "人脸识别",
931
+ btnLabel: "人脸识别",
932
+ tips: "温馨提示:建议使用谷歌、Microsoft Edge,版本79.0.1072.62及以上浏览器,360浏览器请使用极速模式"
933
+ },
934
+ {
935
+ name: "刷卡登录",
936
+ btnLabel: "登录",
937
+ tips: "温馨提示:建议使用谷歌、Microsoft Edge,版本79.0.1072.62及以上浏览器,360浏览器请使用极速模式"
938
+ }
939
+ ]
940
+ }), i = C("account"), d = C(!1), p = C(!1), L = () => {
941
+ d.value = !0;
942
+ }, k = (m, q) => {
943
+ d.value = !1, m && A(q);
944
+ }, u = async () => (sessionStorage.setItem("loginToken", "111"), !0);
945
+ _e(async () => {
946
+ await u();
947
+ });
948
+ const A = async (m) => {
949
+ var S, N, oe, X;
950
+ if (p.value = !0, await Ft(m)) {
951
+ b("projectLogin", m);
952
+ let H = await Re();
953
+ b("systemContent", H == null ? void 0 : H.allMenuContents), s.push("/"), f.setLogRecordAsync({
954
+ type: "登录",
955
+ data: {
956
+ account: ((S = V.value) == null ? void 0 : S.account) ?? ((N = V.value) == null ? void 0 : N.账号),
957
+ userName: ((oe = V.value) == null ? void 0 : oe.姓名) || ((X = V.value) == null ? void 0 : X.userName) || "未知"
958
+ }
959
+ }, "/login", "login"), e.setHasClickEditComp(!1);
960
+ } else
961
+ p.value = !1;
962
+ p.value = !1;
963
+ };
964
+ te(
965
+ () => n == null ? void 0 : n.loginContent,
966
+ () => {
967
+ let m = n == null ? void 0 : n.loginContent;
968
+ m != null && m.account && (m != null && m.password) && !y.value && A(m);
969
+ },
970
+ { deep: !0, immediate: !0 }
971
+ );
972
+ const I = (m) => {
973
+ i.value = m, d.value = !1, p.value = !1;
974
+ }, E = (m) => {
975
+ b("updateApiUrl", m);
976
+ };
977
+ return (m, q) => ($(), R("div", Rt, [
978
+ r("div", St, [
979
+ r("div", xt, [
980
+ a(He, { class: "login-left-bg" }, {
981
+ img: o(() => {
982
+ var S, N;
983
+ return [
984
+ r("div", Mt, [
985
+ r("div", Et, [
986
+ c.value ? ($(), R("div", Ot, [
987
+ r("img", {
988
+ src: c.value,
989
+ alt: ""
990
+ }, null, 8, Bt)
991
+ ])) : le("", !0),
992
+ r("div", Pt, x(((S = j(U)) == null ? void 0 : S.EnglishName) || "Insofworks"), 1)
993
+ ]),
994
+ r("div", null, x(((N = j(U)) == null ? void 0 : N.chineseName) || "工业软件建模与开发系统"), 1)
995
+ ]),
996
+ q[0] || (q[0] = r("div", { class: "divide-line" }, null, -1))
997
+ ];
998
+ }),
999
+ _: 1
1000
+ })
1001
+ ]),
1002
+ r("div", jt, [
1003
+ a(Ye, {
1004
+ loading: p.value,
1005
+ onClickLogin: L,
1006
+ onHandleTabChange: I
1007
+ }, {
1008
+ title: o(() => [
1009
+ P(x(t.value.loginTitle), 1)
1010
+ ]),
1011
+ tabLabel1: o(() => [
1012
+ P(x(t.value.tabs[0].name), 1)
1013
+ ]),
1014
+ tabContent1: o(() => [
1015
+ a(kt, {
1016
+ activeTabName: i.value,
1017
+ isClickLogin: d.value,
1018
+ onHandleLoginFormChange: k,
1019
+ onUpdateApiUrl: E
1020
+ }, null, 8, ["activeTabName", "isClickLogin"])
1021
+ ]),
1022
+ tabButton1: o(() => [
1023
+ P(x(t.value.tabs[0].btnLabel), 1)
1024
+ ]),
1025
+ tabLabel2: o(() => [
1026
+ P(x(t.value.tabs[1].name), 1)
1027
+ ]),
1028
+ tabContent2: o(() => [
1029
+ a($t, {
1030
+ systemKey: m.oldSystemKey,
1031
+ activeTabName: i.value,
1032
+ isClickLogin: d.value,
1033
+ onHandleLoginFormChange: k
1034
+ }, null, 8, ["systemKey", "activeTabName", "isClickLogin"])
1035
+ ]),
1036
+ tabButton2: o(() => [
1037
+ P(x(t.value.tabs[1].btnLabel), 1)
1038
+ ]),
1039
+ _: 1
1040
+ }, 8, ["loading"])
1041
+ ])
1042
+ ])
1043
+ ]));
1044
+ }
1045
+ }), Zt = /* @__PURE__ */ K(Kt, [["__scopeId", "data-v-43bcd58d"]]);
1046
+ export {
1047
+ Zt as default
1048
+ };