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