@billtaofbj/explosion-diagram 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/explosion-diagram.css +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +500 -423
- package/package.json +33 -26
package/dist/index.es.js
CHANGED
|
@@ -2,28 +2,28 @@ import { Fragment as e, Transition as t, computed as n, createBlock as r, create
|
|
|
2
2
|
import { BrandWatermark as D } from "@billtaofbj/core";
|
|
3
3
|
import { useRoute as O, useRouter as k } from "vue-router";
|
|
4
4
|
import { ElMessage as A, ElMessageBox as j } from "element-plus";
|
|
5
|
-
import { ArrowDown as M, ArrowLeft as
|
|
6
|
-
import
|
|
7
|
-
import * as
|
|
5
|
+
import { ArrowDown as M, ArrowLeft as N, Back as ee, Bell as P, Clock as F, Close as te, Connection as I, Delete as L, Download as R, Files as z, Link as B, Loading as V, Monitor as H, Promotion as U, RefreshLeft as W, RefreshRight as G, Share as K, Upload as q, ZoomIn as ne, ZoomOut as re } from "@element-plus/icons-vue";
|
|
6
|
+
import J from "axios";
|
|
7
|
+
import * as ie from "yjs";
|
|
8
8
|
import { HocuspocusProvider as ae } from "@hocuspocus/provider";
|
|
9
9
|
//#region \0plugin-vue:export-helper
|
|
10
10
|
var Y = (e, t) => {
|
|
11
11
|
let n = e.__vccOpts || e;
|
|
12
12
|
for (let [e, r] of t) n[e] = r;
|
|
13
13
|
return n;
|
|
14
|
-
},
|
|
14
|
+
}, X = { class: "chat-header" }, oe = { class: "chat-header-left" }, se = { class: "chat-title" }, ce = { class: "online-users-list" }, le = { class: "online-user-item" }, Z = { class: "online-user-name" }, ue = { key: 1 }, de = { class: "online-user-name" }, fe = { class: "chat-header-right" }, pe = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "chat-empty"
|
|
17
|
-
}, me = { class: "chat-empty-hint" }, he = { key: 1 },
|
|
17
|
+
}, me = { class: "chat-empty-hint" }, he = { key: 1 }, Q = { class: "message-content" }, ge = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "message-meta"
|
|
20
20
|
}, _e = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "message-mention"
|
|
23
|
-
}, ve = ["innerHTML"], ye = { class: "message-time" },
|
|
23
|
+
}, ve = ["innerHTML"], ye = { class: "message-time" }, be = {
|
|
24
24
|
key: 1,
|
|
25
25
|
class: "chat-message chat-message-ai"
|
|
26
|
-
},
|
|
26
|
+
}, xe = { class: "message-avatar ai" }, Se = { class: "chat-input-area" }, $ = {
|
|
27
27
|
key: 0,
|
|
28
28
|
class: "mention-popup"
|
|
29
29
|
}, Ce = ["onClick", "onMouseenter"], we = { key: 1 }, Te = /*#__PURE__*/ Y({
|
|
@@ -77,26 +77,26 @@ var Y = (e, t) => {
|
|
|
77
77
|
"clear-unread"
|
|
78
78
|
],
|
|
79
79
|
setup(t, { emit: l }) {
|
|
80
|
-
let u = t, m = l, h = v(""), _ = v(null), D = v(null), O = v(!1), k = v([]), A = v(0), j = "", M = -1,
|
|
80
|
+
let u = t, m = l, h = v(""), _ = v(null), D = v(null), O = v(!1), k = v([]), A = v(0), j = "", M = -1, N = {
|
|
81
81
|
id: "ai-assistant",
|
|
82
82
|
name: "AI助手",
|
|
83
83
|
color: "#409EFF",
|
|
84
84
|
isAi: !0
|
|
85
|
-
},
|
|
85
|
+
}, ee = n(() => {
|
|
86
86
|
let e = u.currentUser.id, t = /* @__PURE__ */ new Set();
|
|
87
|
-
return [
|
|
87
|
+
return [N, ...u.collabUsers.filter((n) => {
|
|
88
88
|
let r = n.clientId || n.id || "";
|
|
89
89
|
if (r && r === e) return !1;
|
|
90
90
|
let i = String(r || n.name || "");
|
|
91
91
|
return t.has(i) ? !1 : (t.add(i), !0);
|
|
92
92
|
})];
|
|
93
|
-
}),
|
|
93
|
+
}), F = n(() => ee.value.length + 1), I = (e) => e.role === "ai" ? "chat-message-ai" : u.isCollab && e.user_id && e.user_id !== u.currentUser.id ? "chat-message-other" : "chat-message-user", R = (e) => e.role === "ai" ? { background: "linear-gradient(135deg, #409EFF, #337ECC)" } : { background: e.user_color || "#67C23A" }, z = (e) => (e.user_name || "U").charAt(0), B = (e) => {
|
|
94
94
|
if (!u.isCollab) return;
|
|
95
95
|
let t = typeof e == "string" ? e : e.target?.value || h.value, n = t.length, r = t.lastIndexOf("@", n);
|
|
96
96
|
if (r !== -1 && r < n) {
|
|
97
97
|
let e = t.slice(r + 1, n);
|
|
98
98
|
if (!e.includes(" ") && !e.includes("\n")) {
|
|
99
|
-
j = e, M = r, k.value =
|
|
99
|
+
j = e, M = r, k.value = ee.value.filter((t) => t.name && t.name.toLowerCase().includes(e.toLowerCase())), O.value = k.value.length > 0, A.value = 0;
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -105,16 +105,16 @@ var Y = (e, t) => {
|
|
|
105
105
|
O.value && (A.value = Math.min(A.value + 1, k.value.length - 1));
|
|
106
106
|
}, W = () => {
|
|
107
107
|
O.value && (A.value = Math.max(A.value - 1, 0));
|
|
108
|
-
},
|
|
108
|
+
}, G = (e) => {
|
|
109
109
|
let t = h.value.slice(0, M), n = h.value.slice(M + j.length + 1);
|
|
110
110
|
h.value = `${t}@${e.name} ${n}`, O.value = !1;
|
|
111
|
-
},
|
|
111
|
+
}, K = (e) => {
|
|
112
112
|
if (e) {
|
|
113
113
|
if (e.shiftKey) return;
|
|
114
114
|
if (O.value) {
|
|
115
115
|
let t = k.value[A.value];
|
|
116
116
|
if (t) {
|
|
117
|
-
e.preventDefault(),
|
|
117
|
+
e.preventDefault(), G(t);
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -128,19 +128,19 @@ var Y = (e, t) => {
|
|
|
128
128
|
e && (n = e[1]);
|
|
129
129
|
}
|
|
130
130
|
m("send", t, { mentionedUser: n }), h.value = "", O.value = !1;
|
|
131
|
-
},
|
|
131
|
+
}, q = () => {
|
|
132
132
|
d(() => {
|
|
133
133
|
_.value && (_.value.scrollTop = _.value.scrollHeight);
|
|
134
134
|
});
|
|
135
135
|
};
|
|
136
|
-
return C(() => u.messages.length,
|
|
136
|
+
return C(() => u.messages.length, q), C(() => u.messages, q, { deep: !0 }), (n, l) => {
|
|
137
137
|
let u = b("el-icon"), d = b("el-tag"), v = b("el-popover"), C = b("el-button"), j = b("el-input");
|
|
138
138
|
return t.visible ? (g(), a("div", {
|
|
139
139
|
key: 0,
|
|
140
140
|
class: "ai-chat-panel",
|
|
141
141
|
style: p({ width: t.panelWidth + "px" })
|
|
142
142
|
}, [
|
|
143
|
-
o("div",
|
|
143
|
+
o("div", X, [o("div", oe, [
|
|
144
144
|
c(u, {
|
|
145
145
|
size: 18,
|
|
146
146
|
color: "#409EFF"
|
|
@@ -148,7 +148,7 @@ var Y = (e, t) => {
|
|
|
148
148
|
default: w(() => [c(S(H))]),
|
|
149
149
|
_: 1
|
|
150
150
|
}),
|
|
151
|
-
o("span",
|
|
151
|
+
o("span", se, x(t.isCollab ? "协作聊天" : "AI 助手"), 1),
|
|
152
152
|
t.isCollab ? (g(), r(v, {
|
|
153
153
|
key: 0,
|
|
154
154
|
width: 200,
|
|
@@ -161,7 +161,7 @@ var Y = (e, t) => {
|
|
|
161
161
|
effect: "plain",
|
|
162
162
|
class: "online-tag"
|
|
163
163
|
}, {
|
|
164
|
-
default: w(() => [s(x(
|
|
164
|
+
default: w(() => [s(x(F.value) + "人在线 ", 1)]),
|
|
165
165
|
_: 1
|
|
166
166
|
})]),
|
|
167
167
|
default: w(() => [o("div", ce, [o("div", le, [
|
|
@@ -169,7 +169,7 @@ var Y = (e, t) => {
|
|
|
169
169
|
class: "online-user-avatar",
|
|
170
170
|
style: p({ background: t.currentUser.color || "#409EFF" })
|
|
171
171
|
}, x((t.currentUser.name || "U").charAt(0)), 5),
|
|
172
|
-
o("span",
|
|
172
|
+
o("span", Z, x(t.currentUser.name || "我"), 1),
|
|
173
173
|
c(d, {
|
|
174
174
|
size: "small",
|
|
175
175
|
type: t.isOwner ? "warning" : "success",
|
|
@@ -180,7 +180,7 @@ var Y = (e, t) => {
|
|
|
180
180
|
_: 1
|
|
181
181
|
}, 8, ["type"]),
|
|
182
182
|
l[4] ||= o("span", { class: "self-tag" }, "(我)", -1)
|
|
183
|
-
]), (g(!0), a(e, null, y(
|
|
183
|
+
]), (g(!0), a(e, null, y(ee.value, (e) => (g(), a("div", {
|
|
184
184
|
key: e.id || e.clientId,
|
|
185
185
|
class: "online-user-item"
|
|
186
186
|
}, [
|
|
@@ -193,8 +193,8 @@ var Y = (e, t) => {
|
|
|
193
193
|
}, {
|
|
194
194
|
default: w(() => [c(S(H))]),
|
|
195
195
|
_: 1
|
|
196
|
-
})) : (g(), a("span",
|
|
197
|
-
o("span",
|
|
196
|
+
})) : (g(), a("span", ue, x((e.name || "U").charAt(0)), 1))], 4),
|
|
197
|
+
o("span", de, x(e.name || "未知用户"), 1),
|
|
198
198
|
e.isAi ? (g(), r(d, {
|
|
199
199
|
key: 0,
|
|
200
200
|
size: "small",
|
|
@@ -217,7 +217,7 @@ var Y = (e, t) => {
|
|
|
217
217
|
]))), 128))])]),
|
|
218
218
|
_: 1
|
|
219
219
|
})) : i("", !0)
|
|
220
|
-
]), o("div",
|
|
220
|
+
]), o("div", fe, [
|
|
221
221
|
t.isCollab && t.unreadMention ? (g(), a("div", {
|
|
222
222
|
key: 0,
|
|
223
223
|
class: "mention-bell",
|
|
@@ -227,7 +227,7 @@ var Y = (e, t) => {
|
|
|
227
227
|
size: 18,
|
|
228
228
|
color: "#F56C6C"
|
|
229
229
|
}, {
|
|
230
|
-
default: w(() => [c(S(
|
|
230
|
+
default: w(() => [c(S(P))]),
|
|
231
231
|
_: 1
|
|
232
232
|
})])) : i("", !0),
|
|
233
233
|
c(C, {
|
|
@@ -251,7 +251,7 @@ var Y = (e, t) => {
|
|
|
251
251
|
title: "关闭"
|
|
252
252
|
}, {
|
|
253
253
|
default: w(() => [c(u, null, {
|
|
254
|
-
default: w(() => [c(S(
|
|
254
|
+
default: w(() => [c(S(te))]),
|
|
255
255
|
_: 1
|
|
256
256
|
})]),
|
|
257
257
|
_: 1
|
|
@@ -262,7 +262,7 @@ var Y = (e, t) => {
|
|
|
262
262
|
ref_key: "messagesRef",
|
|
263
263
|
ref: _
|
|
264
264
|
}, [
|
|
265
|
-
t.messages.length === 0 ? (g(), a("div",
|
|
265
|
+
t.messages.length === 0 ? (g(), a("div", pe, [
|
|
266
266
|
c(u, {
|
|
267
267
|
size: 40,
|
|
268
268
|
color: "#c0c4cc"
|
|
@@ -285,8 +285,8 @@ var Y = (e, t) => {
|
|
|
285
285
|
}, {
|
|
286
286
|
default: w(() => [c(S(H))]),
|
|
287
287
|
_: 1
|
|
288
|
-
})) : (g(), a("span", he, x(z(e)), 1))], 4), o("div",
|
|
289
|
-
t.isCollab && e.role === "user" ? (g(), a("div",
|
|
288
|
+
})) : (g(), a("span", he, x(z(e)), 1))], 4), o("div", Q, [
|
|
289
|
+
t.isCollab && e.role === "user" ? (g(), a("div", ge, [o("span", {
|
|
290
290
|
class: "message-sender",
|
|
291
291
|
style: p({ color: e.user_color || "#67C23A" })
|
|
292
292
|
}, x(e.user_name || "用户"), 5), e.mentioned_user ? (g(), a("span", _e, "@" + x(e.mentioned_user), 1)) : i("", !0)])) : i("", !0),
|
|
@@ -296,7 +296,7 @@ var Y = (e, t) => {
|
|
|
296
296
|
}, null, 8, ve),
|
|
297
297
|
o("div", ye, x(e.time), 1)
|
|
298
298
|
])], 2))), 128)),
|
|
299
|
-
t.loading ? (g(), a("div",
|
|
299
|
+
t.loading ? (g(), a("div", be, [o("div", xe, [c(u, { size: 16 }, {
|
|
300
300
|
default: w(() => [c(S(H))]),
|
|
301
301
|
_: 1
|
|
302
302
|
})]), l[7] ||= o("div", { class: "message-content" }, [o("div", { class: "message-text typing-indicator" }, [
|
|
@@ -305,7 +305,7 @@ var Y = (e, t) => {
|
|
|
305
305
|
o("span")
|
|
306
306
|
])], -1)])) : i("", !0)
|
|
307
307
|
], 512),
|
|
308
|
-
o("div",
|
|
308
|
+
o("div", Se, [o("div", {
|
|
309
309
|
class: "chat-input-wrapper",
|
|
310
310
|
ref_key: "inputWrapperRef",
|
|
311
311
|
ref: D
|
|
@@ -320,7 +320,7 @@ var Y = (e, t) => {
|
|
|
320
320
|
},
|
|
321
321
|
placeholder: t.isCollab ? "输入消息... @提及成员" : "输入消息...",
|
|
322
322
|
onKeydown: [
|
|
323
|
-
T(E(
|
|
323
|
+
T(E(K, ["exact"]), ["enter"]),
|
|
324
324
|
T(E(V, ["prevent"]), ["down"]),
|
|
325
325
|
T(E(W, ["prevent"]), ["up"])
|
|
326
326
|
],
|
|
@@ -331,10 +331,10 @@ var Y = (e, t) => {
|
|
|
331
331
|
"placeholder",
|
|
332
332
|
"onKeydown"
|
|
333
333
|
]),
|
|
334
|
-
O.value ? (g(), a("div",
|
|
334
|
+
O.value ? (g(), a("div", $, [(g(!0), a(e, null, y(k.value, (e, t) => (g(), a("div", {
|
|
335
335
|
key: e.id || e.clientId,
|
|
336
336
|
class: f(["mention-item", { active: t === A.value }]),
|
|
337
|
-
onClick: (t) =>
|
|
337
|
+
onClick: (t) => G(e),
|
|
338
338
|
onMouseenter: (e) => A.value = t
|
|
339
339
|
}, [o("div", {
|
|
340
340
|
class: "mention-avatar",
|
|
@@ -351,7 +351,7 @@ var Y = (e, t) => {
|
|
|
351
351
|
type: "primary",
|
|
352
352
|
circle: "",
|
|
353
353
|
disabled: !h.value.trim() || t.loading,
|
|
354
|
-
onClick:
|
|
354
|
+
onClick: K
|
|
355
355
|
}, {
|
|
356
356
|
default: w(() => [c(u, null, {
|
|
357
357
|
default: w(() => [c(S(U))]),
|
|
@@ -422,7 +422,7 @@ function Ee() {
|
|
|
422
422
|
console.warn("[useChat] Failed to push to Y.Array:", e);
|
|
423
423
|
}
|
|
424
424
|
if (r.roomId) try {
|
|
425
|
-
await
|
|
425
|
+
await J.post(u, {
|
|
426
426
|
room_id: r.roomId,
|
|
427
427
|
role: "user",
|
|
428
428
|
content: t,
|
|
@@ -448,7 +448,7 @@ function Ee() {
|
|
|
448
448
|
console.warn("[useChat] Failed to push AI message to Y.Array:", e);
|
|
449
449
|
}
|
|
450
450
|
if (r) try {
|
|
451
|
-
await
|
|
451
|
+
await J.post(u, {
|
|
452
452
|
room_id: r,
|
|
453
453
|
role: "ai",
|
|
454
454
|
content: t,
|
|
@@ -460,7 +460,7 @@ function Ee() {
|
|
|
460
460
|
}
|
|
461
461
|
}, b = async (t) => {
|
|
462
462
|
if (t) try {
|
|
463
|
-
let n = await
|
|
463
|
+
let n = await J.get(u, { params: { room_id: t } });
|
|
464
464
|
if (Array.isArray(n.data)) {
|
|
465
465
|
let t = n.data.map((e) => ({
|
|
466
466
|
_msgId: e._msgId || `hist-${e.id || Date.now()}`,
|
|
@@ -479,7 +479,7 @@ function Ee() {
|
|
|
479
479
|
}
|
|
480
480
|
}, x = async (t) => {
|
|
481
481
|
if (e.value = [], l.clear(), t) try {
|
|
482
|
-
await
|
|
482
|
+
await J.delete(u, { params: { room_id: t } });
|
|
483
483
|
} catch (e) {
|
|
484
484
|
console.warn("[useChat] Failed to clear messages on server:", e);
|
|
485
485
|
}
|
|
@@ -522,7 +522,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
522
522
|
saveVersion: async ({ documentId: e, docType: t, content: n, userId: r, userName: i }) => {
|
|
523
523
|
if (!e || !t || !n) return null;
|
|
524
524
|
try {
|
|
525
|
-
let { data: a } = await
|
|
525
|
+
let { data: a } = await J.post(De, {
|
|
526
526
|
document_id: e,
|
|
527
527
|
doc_type: t,
|
|
528
528
|
content: typeof n == "string" ? n : JSON.stringify(n),
|
|
@@ -538,7 +538,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
538
538
|
if (!n) return [];
|
|
539
539
|
t.value = !0;
|
|
540
540
|
try {
|
|
541
|
-
let { data: t } = await
|
|
541
|
+
let { data: t } = await J.get(De, {
|
|
542
542
|
params: { document_id: n },
|
|
543
543
|
timeout: Oe
|
|
544
544
|
});
|
|
@@ -551,7 +551,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
551
551
|
},
|
|
552
552
|
getVersionContent: async (e) => {
|
|
553
553
|
try {
|
|
554
|
-
let { data: t } = await
|
|
554
|
+
let { data: t } = await J.get(`${De}/${e}`, { timeout: Oe });
|
|
555
555
|
return t;
|
|
556
556
|
} catch (e) {
|
|
557
557
|
return console.warn("[useVersionHistory] Failed to get version content:", e), null;
|
|
@@ -606,7 +606,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
606
606
|
}
|
|
607
607
|
}, M = () => {
|
|
608
608
|
T.value = !1;
|
|
609
|
-
},
|
|
609
|
+
}, N = (e) => {
|
|
610
610
|
if (!e) return "";
|
|
611
611
|
let t = new Date(e), n = (e) => String(e).padStart(2, "0");
|
|
612
612
|
return `${t.getFullYear()}-${n(t.getMonth() + 1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`;
|
|
@@ -637,7 +637,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
637
637
|
size: 48,
|
|
638
638
|
color: "#c0c4cc"
|
|
639
639
|
}, {
|
|
640
|
-
default: w(() => [c(S(
|
|
640
|
+
default: w(() => [c(S(F))]),
|
|
641
641
|
_: 1
|
|
642
642
|
}), n[2] ||= o("p", null, "暂无历史版本", -1)])) : (g(), a("div", Ne, [O.value ? (g(), a("div", Pe, [o("div", Fe, [c(u, {
|
|
643
643
|
type: "success",
|
|
@@ -648,7 +648,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
648
648
|
}), o("span", Ie, "v" + x(O.value.version_number), 1)])])) : i("", !0), c(h, null, {
|
|
649
649
|
default: w(() => [(g(!0), a(e, null, y(S(p), (e) => (g(), r(d, {
|
|
650
650
|
key: e.id,
|
|
651
|
-
timestamp:
|
|
651
|
+
timestamp: N(e.created_at),
|
|
652
652
|
placement: "top",
|
|
653
653
|
type: E.value?.id === e.id ? "primary" : "",
|
|
654
654
|
hollow: E.value?.id !== e.id
|
|
@@ -691,6 +691,14 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
691
691
|
showHistory: {
|
|
692
692
|
type: Boolean,
|
|
693
693
|
default: !1
|
|
694
|
+
},
|
|
695
|
+
showBackButton: {
|
|
696
|
+
type: Boolean,
|
|
697
|
+
default: !0
|
|
698
|
+
},
|
|
699
|
+
titleDisabled: {
|
|
700
|
+
type: Boolean,
|
|
701
|
+
default: !1
|
|
694
702
|
}
|
|
695
703
|
},
|
|
696
704
|
emits: [
|
|
@@ -717,24 +725,26 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
717
725
|
return C(() => n.title, (e) => l.value = e), (n, u) => {
|
|
718
726
|
let d = b("el-icon"), f = b("el-button"), m = b("el-input"), h = b("el-dropdown-item"), _ = b("el-dropdown-menu"), v = b("el-dropdown"), C = b("el-tooltip"), T = b("el-divider");
|
|
719
727
|
return g(), a("div", He, [
|
|
720
|
-
o("div", Ue, [
|
|
728
|
+
o("div", Ue, [t.showBackButton ? (g(), r(f, {
|
|
729
|
+
key: 0,
|
|
721
730
|
onClick: u[0] ||= (e) => n.$emit("back"),
|
|
722
731
|
size: "small",
|
|
723
732
|
circle: ""
|
|
724
733
|
}, {
|
|
725
734
|
default: w(() => [c(d, null, {
|
|
726
|
-
default: w(() => [c(S(
|
|
735
|
+
default: w(() => [c(S(N))]),
|
|
727
736
|
_: 1
|
|
728
737
|
})]),
|
|
729
738
|
_: 1
|
|
730
|
-
}), c(m, {
|
|
739
|
+
})) : i("", !0), c(m, {
|
|
731
740
|
modelValue: l.value,
|
|
732
741
|
"onUpdate:modelValue": u[1] ||= (e) => l.value = e,
|
|
733
742
|
onBlur: u[2] ||= (e) => n.$emit("update:title", l.value),
|
|
743
|
+
disabled: t.titleDisabled,
|
|
734
744
|
placeholder: "输入标题",
|
|
735
745
|
class: "title-input",
|
|
736
746
|
size: "small"
|
|
737
|
-
}, null, 8, ["modelValue"])]),
|
|
747
|
+
}, null, 8, ["modelValue", "disabled"])]),
|
|
738
748
|
o("div", We, [
|
|
739
749
|
c(v, {
|
|
740
750
|
trigger: "click",
|
|
@@ -816,7 +826,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
816
826
|
onClick: u[5] ||= (e) => n.$emit("import-json")
|
|
817
827
|
}, {
|
|
818
828
|
default: w(() => [c(d, null, {
|
|
819
|
-
default: w(() => [c(S(
|
|
829
|
+
default: w(() => [c(S(q))]),
|
|
820
830
|
_: 1
|
|
821
831
|
})]),
|
|
822
832
|
_: 1
|
|
@@ -887,7 +897,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
887
897
|
disabled: !t.canRedo
|
|
888
898
|
}, {
|
|
889
899
|
default: w(() => [c(d, null, {
|
|
890
|
-
default: w(() => [c(S(
|
|
900
|
+
default: w(() => [c(S(G))]),
|
|
891
901
|
_: 1
|
|
892
902
|
})]),
|
|
893
903
|
_: 1
|
|
@@ -899,7 +909,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
899
909
|
onClick: u[11] ||= (e) => n.$emit("zoom-in")
|
|
900
910
|
}, {
|
|
901
911
|
default: w(() => [c(d, null, {
|
|
902
|
-
default: w(() => [c(S(
|
|
912
|
+
default: w(() => [c(S(ne))]),
|
|
903
913
|
_: 1
|
|
904
914
|
})]),
|
|
905
915
|
_: 1
|
|
@@ -910,7 +920,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
910
920
|
onClick: u[12] ||= (e) => n.$emit("zoom-out")
|
|
911
921
|
}, {
|
|
912
922
|
default: w(() => [c(d, null, {
|
|
913
|
-
default: w(() => [c(S(
|
|
923
|
+
default: w(() => [c(S(re))]),
|
|
914
924
|
_: 1
|
|
915
925
|
})]),
|
|
916
926
|
_: 1
|
|
@@ -930,7 +940,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
930
940
|
onClick: u[13] ||= (e) => n.$emit("toggle-collab")
|
|
931
941
|
}, {
|
|
932
942
|
default: w(() => [c(d, null, {
|
|
933
|
-
default: w(() => [c(S(
|
|
943
|
+
default: w(() => [c(S(K))]),
|
|
934
944
|
_: 1
|
|
935
945
|
}), o("span", null, x(t.isConnected ? "协作中" : "协作"), 1)]),
|
|
936
946
|
_: 1
|
|
@@ -1001,7 +1011,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1001
1011
|
onClick: u[17] ||= (e) => n.$emit("history")
|
|
1002
1012
|
}, {
|
|
1003
1013
|
default: w(() => [c(d, null, {
|
|
1004
|
-
default: w(() => [c(S(
|
|
1014
|
+
default: w(() => [c(S(F))]),
|
|
1005
1015
|
_: 1
|
|
1006
1016
|
})]),
|
|
1007
1017
|
_: 1
|
|
@@ -1010,7 +1020,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1010
1020
|
]);
|
|
1011
1021
|
};
|
|
1012
1022
|
}
|
|
1013
|
-
}, [["__scopeId", "data-v-
|
|
1023
|
+
}, [["__scopeId", "data-v-5c549dd2"]]), Ye = ["viewBox"], Xe = ["id"], Ze = [
|
|
1014
1024
|
"x",
|
|
1015
1025
|
"y",
|
|
1016
1026
|
"width",
|
|
@@ -1536,7 +1546,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1536
1546
|
//#endregion
|
|
1537
1547
|
//#region ../../src/composables/useExplosionCollaboration.js
|
|
1538
1548
|
function At(e, { roomPrefix: t, syncKey: n = "_data" } = {}) {
|
|
1539
|
-
let r = new
|
|
1549
|
+
let r = new ie.Doc(), i = v(!1), a = v(!1), o = v(!1), s = v(!1), c = v([]), l = null, u = null, d = null, f = null, p = !1, m = null, g = `ws://${window.location.hostname || "localhost"}:1234`, _ = `${t}-${e}`, y = () => {
|
|
1540
1550
|
b(), m = setInterval(() => {
|
|
1541
1551
|
if (l && l.connection && l.connection.ws && l.connection.ws.readyState === WebSocket.CLOSED) try {
|
|
1542
1552
|
l.connect();
|
|
@@ -1694,54 +1704,89 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1694
1704
|
gap: "8px"
|
|
1695
1705
|
} }, $t = "explosion-diagram", en = /*#__PURE__*/ Y({
|
|
1696
1706
|
__name: "ExplosionDiagramEditor",
|
|
1707
|
+
props: {
|
|
1708
|
+
docId: {
|
|
1709
|
+
type: [Number, String],
|
|
1710
|
+
default: null
|
|
1711
|
+
},
|
|
1712
|
+
apiBase: {
|
|
1713
|
+
type: String,
|
|
1714
|
+
default: "/api"
|
|
1715
|
+
},
|
|
1716
|
+
saveApi: {
|
|
1717
|
+
type: [String, Function],
|
|
1718
|
+
default: null
|
|
1719
|
+
},
|
|
1720
|
+
loadApi: {
|
|
1721
|
+
type: [String, Function],
|
|
1722
|
+
default: null
|
|
1723
|
+
},
|
|
1724
|
+
wsUrl: {
|
|
1725
|
+
type: String,
|
|
1726
|
+
default: ""
|
|
1727
|
+
},
|
|
1728
|
+
user: {
|
|
1729
|
+
type: Object,
|
|
1730
|
+
default: null
|
|
1731
|
+
},
|
|
1732
|
+
uiConfig: {
|
|
1733
|
+
type: Object,
|
|
1734
|
+
default: () => ({})
|
|
1735
|
+
}
|
|
1736
|
+
},
|
|
1697
1737
|
setup(l) {
|
|
1698
|
-
let u =
|
|
1738
|
+
let u = l, d = n(() => ({
|
|
1739
|
+
backButton: "show",
|
|
1740
|
+
titleEditable: !0,
|
|
1741
|
+
authorEditable: !0,
|
|
1742
|
+
...u.uiConfig
|
|
1743
|
+
})), f = n(() => u.docId ?? p.params.id), p = O(), C = k(), T = v(u.docId ?? null), E = v(!1), D = v(!1), { saveVersion: M } = ke(), N = Ee(), P = _({
|
|
1699
1744
|
title: "爆炸图",
|
|
1700
1745
|
components: [],
|
|
1701
1746
|
connections: []
|
|
1702
|
-
}),
|
|
1703
|
-
if (!
|
|
1747
|
+
}), F = v(!1), te = v(!1), I = v(!1), L = null, R = v([]), z = v(-1), B = v(null), V = v([]), H = v(null), U = v(null), W = v(!1), G = v(null), K = v(null), q = v([]), ne = v(null), re = v(null), ie = v(!1), ae = v(null), Y = v([]), X = n(() => q.value.length ? q.value[q.value.length - 1] : null), oe = n(() => {
|
|
1748
|
+
if (!X.value) return P.components;
|
|
1704
1749
|
let e = (t) => {
|
|
1705
1750
|
let n = /* @__PURE__ */ new Set([t]);
|
|
1706
|
-
return
|
|
1751
|
+
return P.components.filter((e) => e.groupId === t).forEach((t) => {
|
|
1707
1752
|
n.add(t.id), t.shape === "group" && e(t.id).forEach((e) => n.add(e));
|
|
1708
1753
|
}), n;
|
|
1709
|
-
}, t = e(
|
|
1710
|
-
return
|
|
1711
|
-
}),
|
|
1712
|
-
if (!
|
|
1713
|
-
let e = new Set(
|
|
1714
|
-
return
|
|
1715
|
-
}),
|
|
1716
|
-
if (!
|
|
1717
|
-
let e =
|
|
1754
|
+
}, t = e(X.value);
|
|
1755
|
+
return P.components.filter((e) => t.has(e.id));
|
|
1756
|
+
}), se = n(() => {
|
|
1757
|
+
if (!X.value) return P.connections;
|
|
1758
|
+
let e = new Set(oe.value.map((e) => e.id));
|
|
1759
|
+
return P.connections.filter((t) => e.has(t.fromId) || e.has(t.toId));
|
|
1760
|
+
}), ce = n(() => {
|
|
1761
|
+
if (!X.value) return "0 0 2000 1500";
|
|
1762
|
+
let e = P.components.find((e) => e.id === X.value);
|
|
1718
1763
|
if (!e) return "0 0 2000 1500";
|
|
1719
|
-
let t =
|
|
1764
|
+
let t = oe.value.filter((e) => e.id !== X.value);
|
|
1720
1765
|
if (!t.length) return `${e.x} ${e.y} ${e.width} ${e.height}`;
|
|
1721
1766
|
let n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
|
|
1722
1767
|
return t.forEach((e) => {
|
|
1723
1768
|
n = Math.min(n, e.x), r = Math.min(r, e.y), i = Math.max(i, e.x + e.width), a = Math.max(a, e.y + e.height);
|
|
1724
1769
|
}), `${n - 40} ${r - 40} ${i - n + 80} ${a - r + 80}`;
|
|
1725
|
-
}),
|
|
1726
|
-
|
|
1727
|
-
components:
|
|
1728
|
-
connections:
|
|
1729
|
-
})),
|
|
1730
|
-
}, ce = () => {
|
|
1731
|
-
M.value && P && P.pushToYjs(D);
|
|
1732
|
-
}, le = () => {
|
|
1733
|
-
if (I.value > 0) {
|
|
1734
|
-
I.value--;
|
|
1735
|
-
let e = JSON.parse(F.value[I.value]);
|
|
1736
|
-
D.components = e.components, D.connections = e.connections, ce();
|
|
1737
|
-
}
|
|
1770
|
+
}), le = (e) => P.components.find((t) => t.id === e), Z = () => {
|
|
1771
|
+
R.value = R.value.slice(0, z.value + 1), R.value.push(JSON.stringify({
|
|
1772
|
+
components: P.components,
|
|
1773
|
+
connections: P.connections
|
|
1774
|
+
})), z.value = R.value.length - 1, ue();
|
|
1738
1775
|
}, ue = () => {
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1776
|
+
F.value && L && L.pushToYjs(P);
|
|
1777
|
+
}, de = () => {
|
|
1778
|
+
if (z.value > 0) {
|
|
1779
|
+
z.value--;
|
|
1780
|
+
let e = JSON.parse(R.value[z.value]);
|
|
1781
|
+
P.components = e.components, P.connections = e.connections, ue();
|
|
1782
|
+
}
|
|
1783
|
+
}, fe = () => {
|
|
1784
|
+
if (z.value < R.value.length - 1) {
|
|
1785
|
+
z.value++;
|
|
1786
|
+
let e = JSON.parse(R.value[z.value]);
|
|
1787
|
+
P.components = e.components, P.connections = e.connections, ue();
|
|
1743
1788
|
}
|
|
1744
|
-
},
|
|
1789
|
+
}, pe = () => {}, me = () => {}, he = 0, Q = () => `comp-${++he}-${Date.now()}`, ge = {
|
|
1745
1790
|
rect: [140, 60],
|
|
1746
1791
|
circle: [80, 80],
|
|
1747
1792
|
diamond: [100, 80],
|
|
@@ -1751,20 +1796,20 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1751
1796
|
polygon: [150, 120],
|
|
1752
1797
|
svg: [120, 120],
|
|
1753
1798
|
group: [200, 150]
|
|
1754
|
-
},
|
|
1799
|
+
}, _e = v(null), ve = v(null), ye = null, be = (e) => {
|
|
1755
1800
|
if (e === "image") {
|
|
1756
|
-
|
|
1801
|
+
ye = "image", _e.value?.click();
|
|
1757
1802
|
return;
|
|
1758
1803
|
}
|
|
1759
1804
|
if (e === "svg") {
|
|
1760
|
-
|
|
1805
|
+
ye = "svg", ve.value?.click();
|
|
1761
1806
|
return;
|
|
1762
1807
|
}
|
|
1763
1808
|
if (e === "polygon") {
|
|
1764
1809
|
let e = {
|
|
1765
|
-
id:
|
|
1810
|
+
id: Q(),
|
|
1766
1811
|
shape: "polygon",
|
|
1767
|
-
label: `${
|
|
1812
|
+
label: `${P.components.length + 1}`,
|
|
1768
1813
|
description: "",
|
|
1769
1814
|
x: 300 + Math.random() * 200,
|
|
1770
1815
|
y: 200 + Math.random() * 200,
|
|
@@ -1776,14 +1821,14 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1776
1821
|
textColor: "#333",
|
|
1777
1822
|
fontSize: 14
|
|
1778
1823
|
};
|
|
1779
|
-
|
|
1824
|
+
X.value && (e.groupId = X.value), P.components.push(e), Z();
|
|
1780
1825
|
return;
|
|
1781
1826
|
}
|
|
1782
1827
|
if (e === "group") {
|
|
1783
1828
|
let e = {
|
|
1784
|
-
id:
|
|
1829
|
+
id: Q(),
|
|
1785
1830
|
shape: "group",
|
|
1786
|
-
label: `${
|
|
1831
|
+
label: `${P.components.length + 1}`,
|
|
1787
1832
|
description: "",
|
|
1788
1833
|
x: 300 + Math.random() * 200,
|
|
1789
1834
|
y: 200 + Math.random() * 200,
|
|
@@ -1795,13 +1840,13 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1795
1840
|
textColor: "#333",
|
|
1796
1841
|
fontSize: 14
|
|
1797
1842
|
};
|
|
1798
|
-
|
|
1843
|
+
X.value && (e.groupId = X.value), P.components.push(e), Z();
|
|
1799
1844
|
return;
|
|
1800
1845
|
}
|
|
1801
|
-
let [t, n] =
|
|
1802
|
-
id:
|
|
1846
|
+
let [t, n] = ge[e] || [120, 60], r = {
|
|
1847
|
+
id: Q(),
|
|
1803
1848
|
shape: e,
|
|
1804
|
-
label: `${
|
|
1849
|
+
label: `${P.components.length + 1}`,
|
|
1805
1850
|
description: "",
|
|
1806
1851
|
x: 300 + Math.random() * 200,
|
|
1807
1852
|
y: 200 + Math.random() * 200,
|
|
@@ -1812,19 +1857,19 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1812
1857
|
textColor: "#333",
|
|
1813
1858
|
fontSize: 14
|
|
1814
1859
|
};
|
|
1815
|
-
|
|
1816
|
-
},
|
|
1860
|
+
X.value && (r.groupId = X.value), P.components.push(r), Z();
|
|
1861
|
+
}, xe = async (e) => {
|
|
1817
1862
|
let t = e.target.files?.[0];
|
|
1818
1863
|
if (!t) return;
|
|
1819
1864
|
let n = new FormData();
|
|
1820
|
-
n.append("file", t),
|
|
1865
|
+
n.append("file", t), ye === "image" && n.append("remove_bg", "true");
|
|
1821
1866
|
try {
|
|
1822
|
-
let e = await
|
|
1823
|
-
if (
|
|
1867
|
+
let e = await J.post(`${u.apiBase}/files/upload/image`, n), r = e.data.url || e.data.file_path;
|
|
1868
|
+
if (ye === "image") {
|
|
1824
1869
|
let e = {
|
|
1825
|
-
id:
|
|
1870
|
+
id: Q(),
|
|
1826
1871
|
shape: "image",
|
|
1827
|
-
label: `${
|
|
1872
|
+
label: `${P.components.length + 1}`,
|
|
1828
1873
|
description: "",
|
|
1829
1874
|
x: 300 + Math.random() * 200,
|
|
1830
1875
|
y: 200 + Math.random() * 200,
|
|
@@ -1836,17 +1881,17 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1836
1881
|
textColor: "#333",
|
|
1837
1882
|
fontSize: 14
|
|
1838
1883
|
};
|
|
1839
|
-
|
|
1840
|
-
} else if (
|
|
1884
|
+
X.value && (e.groupId = X.value), P.components.push(e);
|
|
1885
|
+
} else if (ye === "svg") {
|
|
1841
1886
|
let e = await t.text(), n = new DOMParser().parseFromString(e, "image/svg+xml").querySelector("svg"), r = n?.getAttribute("width") || 100, i = n?.getAttribute("height") || 100, a = n?.getAttribute("viewBox"), o = parseFloat(r), s = parseFloat(i);
|
|
1842
1887
|
if (a) {
|
|
1843
1888
|
let e = a.split(/[\s,]+/).map(Number);
|
|
1844
1889
|
o = e[2] || o, s = e[3] || s;
|
|
1845
1890
|
}
|
|
1846
1891
|
let c = n?.innerHTML || "", l = {
|
|
1847
|
-
id:
|
|
1892
|
+
id: Q(),
|
|
1848
1893
|
shape: "svg",
|
|
1849
|
-
label: `${
|
|
1894
|
+
label: `${P.components.length + 1}`,
|
|
1850
1895
|
description: "",
|
|
1851
1896
|
x: 300 + Math.random() * 200,
|
|
1852
1897
|
y: 200 + Math.random() * 200,
|
|
@@ -1860,29 +1905,29 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1860
1905
|
textColor: "#333",
|
|
1861
1906
|
fontSize: 14
|
|
1862
1907
|
};
|
|
1863
|
-
|
|
1908
|
+
X.value && (l.groupId = X.value), P.components.push(l);
|
|
1864
1909
|
}
|
|
1865
|
-
|
|
1910
|
+
Z();
|
|
1866
1911
|
} catch {
|
|
1867
1912
|
A.error("上传失败");
|
|
1868
1913
|
}
|
|
1869
1914
|
e.target.value = "";
|
|
1870
|
-
},
|
|
1915
|
+
}, Se = (e, t, n) => {
|
|
1871
1916
|
if (n && (n.ctrlKey || n.metaKey)) {
|
|
1872
|
-
|
|
1917
|
+
V.value.includes(e.id) ? V.value = V.value.filter((t) => t !== e.id) : V.value.push(e.id), B.value = V.value[V.value.length - 1] || null, U.value = B.value ? P.components.find((e) => e.id === B.value) : null, H.value = "component";
|
|
1873
1918
|
return;
|
|
1874
1919
|
}
|
|
1875
|
-
|
|
1920
|
+
B.value = e.id, V.value = [e.id], H.value = t, U.value = e, K.value = null;
|
|
1876
1921
|
}, $ = () => {
|
|
1877
|
-
|
|
1878
|
-
},
|
|
1879
|
-
let r =
|
|
1922
|
+
B.value = null, V.value = [], H.value = null, U.value = null, K.value = null;
|
|
1923
|
+
}, Ce = (e, t, n) => {
|
|
1924
|
+
let r = we(n), i = e.x, a = e.y, o = e.width, s = e.height, c = e.shape === "polygon" ? (e.points || "").trim().split(/\s+/).map((e) => e.split(",").map(Number)) : null, l = e.shape === "group", u = l ? P.components.filter((t) => t.groupId === e.id && t.id !== e.id) : [], d = u.map((e) => ({
|
|
1880
1925
|
id: e.id,
|
|
1881
1926
|
x: e.x,
|
|
1882
1927
|
y: e.y,
|
|
1883
1928
|
w: e.width,
|
|
1884
1929
|
h: e.height
|
|
1885
|
-
})), f = new Set(l ? u.map((e) => e.id) : [e.id]), p =
|
|
1930
|
+
})), f = new Set(l ? u.map((e) => e.id) : [e.id]), p = P.connections.filter((e) => f.has(e.fromId) || f.has(e.toId)).map((e) => ({
|
|
1886
1931
|
conn: e,
|
|
1887
1932
|
fromAnchor: e.fromAnchor ? {
|
|
1888
1933
|
x: e.fromAnchor.x,
|
|
@@ -1893,7 +1938,7 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1893
1938
|
y: e.toAnchor.y
|
|
1894
1939
|
} : null
|
|
1895
1940
|
})), m = (n) => {
|
|
1896
|
-
let m =
|
|
1941
|
+
let m = we(n), h = m.x - r.x, g = m.y - r.y, _ = o, v = s, y = i, b = a;
|
|
1897
1942
|
if (t === "se" ? (_ = o + h, v = s + g) : t === "sw" ? (y = i + h, _ = o - h, v = s + g) : t === "ne" ? (_ = o + h, b = a + g, v = s - g) : t === "nw" && (y = i + h, b = a + g, _ = o - h, v = s - g), _ = Math.max(30, _), v = Math.max(20, v), e.x = y, e.y = b, e.width = _, e.height = v, c && o > 0 && s > 0 && (e.points = c.map(([e, t]) => `${Math.round(e * _ / o)},${Math.round(t * v / s)}`).join(" ")), o > 0 && s > 0) {
|
|
1898
1943
|
let e = _ / o, t = v / s;
|
|
1899
1944
|
l && u.forEach((n, r) => {
|
|
@@ -1913,10 +1958,10 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1913
1958
|
});
|
|
1914
1959
|
}
|
|
1915
1960
|
}, h = () => {
|
|
1916
|
-
document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", h),
|
|
1961
|
+
document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", h), Z();
|
|
1917
1962
|
};
|
|
1918
1963
|
document.addEventListener("mousemove", m), document.addEventListener("mouseup", h);
|
|
1919
|
-
},
|
|
1964
|
+
}, we = (e) => {
|
|
1920
1965
|
let t = document.querySelector(".diagram-svg");
|
|
1921
1966
|
if (!t) return {
|
|
1922
1967
|
x: 0,
|
|
@@ -1927,20 +1972,20 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1927
1972
|
x: (e.clientX - n.left) / n.width * r.width + r.x,
|
|
1928
1973
|
y: (e.clientY - n.top) / n.height * r.height + r.y
|
|
1929
1974
|
};
|
|
1930
|
-
},
|
|
1931
|
-
let i =
|
|
1975
|
+
}, De = (e, t, n, r = !1) => {
|
|
1976
|
+
let i = P.components.find((t) => t.id === e);
|
|
1932
1977
|
if (!i) return;
|
|
1933
1978
|
let a = t - i.x, o = n - i.y;
|
|
1934
|
-
i.x = t, i.y = n, i.shape === "group" && i.id &&
|
|
1979
|
+
i.x = t, i.y = n, i.shape === "group" && i.id && P.components.forEach((e) => {
|
|
1935
1980
|
e.groupId === i.id && e.id !== i.id && (e.x += a, e.y += o);
|
|
1936
|
-
}), r &&
|
|
1937
|
-
},
|
|
1981
|
+
}), r && Z();
|
|
1982
|
+
}, Oe = (e) => {
|
|
1938
1983
|
if (e.shape === "group") {
|
|
1939
|
-
|
|
1984
|
+
Pe(e);
|
|
1940
1985
|
return;
|
|
1941
1986
|
}
|
|
1942
1987
|
if (e.shape === "polygon") {
|
|
1943
|
-
|
|
1988
|
+
K.value && K.value.id === e.id ? K.value = null : K.value = e;
|
|
1944
1989
|
return;
|
|
1945
1990
|
}
|
|
1946
1991
|
j.prompt("编辑标签", "组件", {
|
|
@@ -1949,12 +1994,12 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1949
1994
|
}).then(({ value: t }) => {
|
|
1950
1995
|
t !== null && (e.label = t);
|
|
1951
1996
|
}).catch(() => {});
|
|
1952
|
-
},
|
|
1953
|
-
|
|
1954
|
-
},
|
|
1955
|
-
|
|
1997
|
+
}, Ae = () => {
|
|
1998
|
+
B.value && (H.value === "component" ? (P.components = P.components.filter((e) => e.id !== B.value), P.connections = P.connections.filter((e) => e.fromId !== B.value && e.toId !== B.value)) : P.connections = P.connections.filter((e) => e.id !== B.value), $(), Z());
|
|
1999
|
+
}, je = (e, t, n) => {
|
|
2000
|
+
W.value = !0;
|
|
1956
2001
|
let r = e.x + t.x, i = e.y + t.y;
|
|
1957
|
-
|
|
2002
|
+
G.value = {
|
|
1958
2003
|
x1: r,
|
|
1959
2004
|
y1: i,
|
|
1960
2005
|
x2: r,
|
|
@@ -1963,14 +2008,14 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1963
2008
|
let a = n.target.closest("svg"), o = (e) => {
|
|
1964
2009
|
if (!a) return;
|
|
1965
2010
|
let t = a.getBoundingClientRect(), n = a.viewBox.baseVal;
|
|
1966
|
-
|
|
2011
|
+
G.value.x2 = (e.clientX - t.left) / t.width * n.width + n.x, G.value.y2 = (e.clientY - t.top) / t.height * n.height + n.y;
|
|
1967
2012
|
}, s = (n) => {
|
|
1968
|
-
if (document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", s),
|
|
1969
|
-
|
|
2013
|
+
if (document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", s), G.value = null, !a) {
|
|
2014
|
+
W.value = !1;
|
|
1970
2015
|
return;
|
|
1971
2016
|
}
|
|
1972
2017
|
let r = a.getBoundingClientRect(), i = a.viewBox.baseVal, c = (n.clientX - r.left) / r.width * i.width + i.x, l = (n.clientY - r.top) / r.height * i.height + i.y, u = null, d = 30;
|
|
1973
|
-
for (let t of
|
|
2018
|
+
for (let t of P.components) {
|
|
1974
2019
|
if (t.id === e.id) continue;
|
|
1975
2020
|
let n = [
|
|
1976
2021
|
{
|
|
@@ -1996,13 +2041,13 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1996
2041
|
}
|
|
1997
2042
|
}
|
|
1998
2043
|
if (!u) {
|
|
1999
|
-
for (let t of
|
|
2044
|
+
for (let t of P.components) if (t.id !== e.id && c >= t.x && c <= t.x + t.width && l >= t.y && l <= t.y + t.height) {
|
|
2000
2045
|
u = t;
|
|
2001
2046
|
break;
|
|
2002
2047
|
}
|
|
2003
2048
|
}
|
|
2004
|
-
u && (
|
|
2005
|
-
id:
|
|
2049
|
+
u && (P.connections.find((t) => t.fromId === e.id && t.toId === u.id) || (P.connections.push({
|
|
2050
|
+
id: Q(),
|
|
2006
2051
|
fromId: e.id,
|
|
2007
2052
|
toId: u.id,
|
|
2008
2053
|
fromAnchor: {
|
|
@@ -2016,11 +2061,11 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2016
2061
|
label: "",
|
|
2017
2062
|
lineWidth: 2,
|
|
2018
2063
|
dashed: !1
|
|
2019
|
-
}),
|
|
2064
|
+
}), Z())), W.value = !1;
|
|
2020
2065
|
};
|
|
2021
2066
|
document.addEventListener("mousemove", o), document.addEventListener("mouseup", s);
|
|
2022
|
-
},
|
|
2023
|
-
let e =
|
|
2067
|
+
}, Me = () => {
|
|
2068
|
+
let e = P.components.filter((e) => V.value.includes(e.id));
|
|
2024
2069
|
if (e.length < 2) {
|
|
2025
2070
|
A.warning("请至少选择2个零件进行组合");
|
|
2026
2071
|
return;
|
|
@@ -2029,7 +2074,7 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2029
2074
|
e.forEach((e) => {
|
|
2030
2075
|
t = Math.min(t, e.x), n = Math.min(n, e.y), r = Math.max(r, e.x + e.width), i = Math.max(i, e.y + e.height);
|
|
2031
2076
|
});
|
|
2032
|
-
let a =
|
|
2077
|
+
let a = Q();
|
|
2033
2078
|
e.forEach((e) => {
|
|
2034
2079
|
e.groupId = a;
|
|
2035
2080
|
});
|
|
@@ -2048,46 +2093,48 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2048
2093
|
fontSize: 14,
|
|
2049
2094
|
movable: !1
|
|
2050
2095
|
};
|
|
2051
|
-
|
|
2052
|
-
...
|
|
2096
|
+
X.value && (o.groupId = X.value), P.components = [
|
|
2097
|
+
...P.components.filter((e) => !V.value.includes(e.id)),
|
|
2053
2098
|
o,
|
|
2054
2099
|
...e
|
|
2055
|
-
],
|
|
2056
|
-
},
|
|
2057
|
-
let t =
|
|
2100
|
+
], V.value = [], Z();
|
|
2101
|
+
}, Ne = (e) => {
|
|
2102
|
+
let t = P.components.filter((t) => t.groupId === e.id && t.id !== e.id);
|
|
2058
2103
|
if (!t.length) return;
|
|
2059
2104
|
let n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
|
|
2060
2105
|
t.forEach((e) => {
|
|
2061
2106
|
n = Math.min(n, e.x), r = Math.min(r, e.y), i = Math.max(i, e.x + e.width), a = Math.max(a, e.y + e.height);
|
|
2062
|
-
}), e.x = n - 10, e.y = r - 10, e.width = i - n + 20, e.height = a - r + 20,
|
|
2063
|
-
},
|
|
2064
|
-
|
|
2065
|
-
},
|
|
2066
|
-
|
|
2067
|
-
},
|
|
2068
|
-
|
|
2069
|
-
},
|
|
2107
|
+
}), e.x = n - 10, e.y = r - 10, e.width = i - n + 20, e.height = a - r + 20, Z();
|
|
2108
|
+
}, Pe = (e) => {
|
|
2109
|
+
q.value.push(e.id), $();
|
|
2110
|
+
}, Fe = () => {
|
|
2111
|
+
q.value.length && (q.value.pop(), $());
|
|
2112
|
+
}, Ie = (e) => {
|
|
2113
|
+
q.value = q.value.slice(0, e + 1), $();
|
|
2114
|
+
}, Le = async (e) => {
|
|
2070
2115
|
let t = e.target.files?.[0];
|
|
2071
|
-
if (!t || !
|
|
2116
|
+
if (!t || !U.value) return;
|
|
2072
2117
|
let n = new FormData();
|
|
2073
2118
|
n.append("file", t);
|
|
2074
2119
|
try {
|
|
2075
|
-
let e = await
|
|
2076
|
-
|
|
2120
|
+
let e = await J.post(`${u.apiBase}/files/upload/image`, n);
|
|
2121
|
+
U.value.imageUrl = e.data.url || e.data.file_path, Ne(U.value);
|
|
2077
2122
|
} catch {
|
|
2078
2123
|
A.error("上传失败");
|
|
2079
2124
|
}
|
|
2080
2125
|
e.target.value = "";
|
|
2081
|
-
},
|
|
2082
|
-
let e =
|
|
2126
|
+
}, Re = () => {
|
|
2127
|
+
let e = P.components;
|
|
2083
2128
|
if (!e.length) return;
|
|
2084
2129
|
let t = Math.ceil(Math.sqrt(e.length));
|
|
2085
|
-
|
|
2130
|
+
P.components = e.map((e, n) => ({
|
|
2086
2131
|
...e,
|
|
2087
2132
|
x: 100 + n % t * 200,
|
|
2088
2133
|
y: 100 + Math.floor(n / t) * 120
|
|
2089
|
-
})),
|
|
2090
|
-
},
|
|
2134
|
+
})), Z();
|
|
2135
|
+
}, ze = () => {
|
|
2136
|
+
u.docId ?? C.push("/");
|
|
2137
|
+
}, Be = [
|
|
2091
2138
|
"我可以帮您优化爆炸图布局、检查组件标注,或者提供装配顺序建议。请问有什么需要帮助的?",
|
|
2092
2139
|
"这个爆炸图的组件分布很清晰。建议检查连接线是否准确反映了实际装配关系。",
|
|
2093
2140
|
"根据当前的爆炸图结构,我建议为关键组件添加编号说明,便于阅读理解。",
|
|
@@ -2096,183 +2143,197 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2096
2143
|
"这个爆炸图的层次感不错。如果需要,我可以帮您优化组件间距和标注位置。",
|
|
2097
2144
|
"我可以帮您将爆炸图的数据导出为BOM清单格式,方便采购和生产管理。",
|
|
2098
2145
|
"文档中的组件信息很详细。建议补充每个组件的规格参数和供应商信息。"
|
|
2099
|
-
],
|
|
2100
|
-
let n =
|
|
2101
|
-
await
|
|
2146
|
+
], He = async (e, t = {}) => {
|
|
2147
|
+
let n = T.value ? `${$t}-${T.value}` : null;
|
|
2148
|
+
await N.sendMessage(e, {
|
|
2102
2149
|
...t,
|
|
2103
2150
|
roomId: n
|
|
2104
2151
|
});
|
|
2105
|
-
let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a =
|
|
2106
|
-
(!r || i || a.length === 0) && (
|
|
2107
|
-
|
|
2152
|
+
let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a = N.collabUsers.value.filter((e) => e.name !== N.currentUser.value.name);
|
|
2153
|
+
(!r || i || a.length === 0) && (N.loading.value = !0, setTimeout(() => {
|
|
2154
|
+
N.sendAiMessage(Be[Math.floor(Math.random() * Be.length)], n), N.loading.value = !1;
|
|
2108
2155
|
}, 800 + Math.random() * 1200));
|
|
2109
|
-
},
|
|
2110
|
-
let e =
|
|
2111
|
-
|
|
2112
|
-
},
|
|
2113
|
-
if (!
|
|
2156
|
+
}, Ue = () => {
|
|
2157
|
+
let e = T.value ? `${$t}-${T.value}` : null;
|
|
2158
|
+
N.clearMessages(e);
|
|
2159
|
+
}, We = () => {
|
|
2160
|
+
if (!T.value) {
|
|
2114
2161
|
A.warning("请先保存文档");
|
|
2115
2162
|
return;
|
|
2116
2163
|
}
|
|
2117
|
-
|
|
2118
|
-
},
|
|
2164
|
+
D.value = !0;
|
|
2165
|
+
}, Ge = (e) => {
|
|
2119
2166
|
try {
|
|
2120
2167
|
let t = typeof e == "string" ? JSON.parse(e) : e;
|
|
2121
|
-
t.components && (
|
|
2168
|
+
t.components && (P.components = t.components), t.connections && (P.connections = t.connections), $();
|
|
2122
2169
|
} catch (e) {
|
|
2123
2170
|
console.error("Version apply error:", e);
|
|
2124
2171
|
}
|
|
2125
|
-
},
|
|
2126
|
-
if (
|
|
2172
|
+
}, Ke = async () => {
|
|
2173
|
+
if (F.value && L?.collaborationClosed.value && !I.value) {
|
|
2127
2174
|
A.warning("协作已关闭,无法保存");
|
|
2128
2175
|
return;
|
|
2129
2176
|
}
|
|
2130
2177
|
try {
|
|
2131
2178
|
let e = {
|
|
2132
|
-
title:
|
|
2179
|
+
title: P.title,
|
|
2133
2180
|
view_type: "diagram",
|
|
2134
2181
|
config: JSON.stringify({
|
|
2135
|
-
components:
|
|
2136
|
-
connections:
|
|
2182
|
+
components: P.components,
|
|
2183
|
+
connections: P.connections
|
|
2137
2184
|
})
|
|
2138
2185
|
};
|
|
2139
|
-
|
|
2140
|
-
|
|
2186
|
+
if (typeof u.saveApi == "function") {
|
|
2187
|
+
let t = await u.saveApi(e, T.value);
|
|
2188
|
+
t?.id && (T.value = t.id);
|
|
2189
|
+
} else if (typeof u.saveApi == "string") T.value ? await J.put(u.saveApi, e) : T.value = (await J.post(u.saveApi, e)).data.id;
|
|
2190
|
+
else {
|
|
2191
|
+
let t = u.apiBase;
|
|
2192
|
+
T.value ? await J.put(`${t}/explosion-views/${T.value}`, e) : T.value = (await J.post(`${t}/explosion-views/`, e)).data.id;
|
|
2193
|
+
}
|
|
2194
|
+
A.success("保存成功"), M({
|
|
2195
|
+
documentId: T.value,
|
|
2141
2196
|
docType: "diagram",
|
|
2142
2197
|
content: JSON.stringify({
|
|
2143
|
-
components:
|
|
2144
|
-
connections:
|
|
2198
|
+
components: P.components,
|
|
2199
|
+
connections: P.connections
|
|
2145
2200
|
}),
|
|
2146
|
-
userId: String(
|
|
2147
|
-
userName:
|
|
2201
|
+
userId: String(N.currentUser.value?.id || ""),
|
|
2202
|
+
userName: N.currentUser.value?.name || "未知"
|
|
2148
2203
|
});
|
|
2149
2204
|
} catch {
|
|
2150
2205
|
A.error("保存失败");
|
|
2151
2206
|
}
|
|
2152
|
-
},
|
|
2153
|
-
if (
|
|
2154
|
-
let e
|
|
2155
|
-
if (
|
|
2207
|
+
}, qe = async () => {
|
|
2208
|
+
if (f.value) try {
|
|
2209
|
+
let e;
|
|
2210
|
+
if (typeof u.loadApi == "function") e = await u.loadApi(f.value);
|
|
2211
|
+
else if (typeof u.loadApi == "string") e = (await J.get(u.loadApi)).data;
|
|
2212
|
+
else {
|
|
2213
|
+
let t = u.apiBase;
|
|
2214
|
+
e = (await J.get(`${t}/explosion-views/${f.value}`)).data;
|
|
2215
|
+
}
|
|
2216
|
+
if (T.value = e.id, P.title = e.title, e.config) {
|
|
2156
2217
|
let t = JSON.parse(e.config);
|
|
2157
|
-
|
|
2218
|
+
P.components = t.components || [], P.connections = t.connections || [];
|
|
2158
2219
|
}
|
|
2159
|
-
|
|
2220
|
+
Z();
|
|
2160
2221
|
} catch (e) {
|
|
2161
2222
|
console.error("load error", e);
|
|
2162
2223
|
}
|
|
2163
|
-
else
|
|
2164
|
-
},
|
|
2224
|
+
else Z();
|
|
2225
|
+
}, Ye = async (e) => {
|
|
2165
2226
|
try {
|
|
2166
2227
|
let t = document.querySelector(".diagram-svg");
|
|
2167
2228
|
if (!t) return A.error("未找到SVG元素");
|
|
2168
2229
|
let n = new XMLSerializer().serializeToString(t);
|
|
2169
2230
|
if (e === "svg") {
|
|
2170
2231
|
let e = new Blob([n], { type: "image/svg+xml;charset=utf-8" }), t = URL.createObjectURL(e), r = document.createElement("a");
|
|
2171
|
-
r.href = t, r.download = `${
|
|
2232
|
+
r.href = t, r.download = `${P.title || "爆炸图"}.svg`, r.click(), URL.revokeObjectURL(t);
|
|
2172
2233
|
} else if (e === "png") {
|
|
2173
2234
|
let e = document.createElement("canvas"), t = e.getContext("2d"), r = new Image(), i = new Blob([n], { type: "image/svg+xml;charset=utf-8" }), a = URL.createObjectURL(i);
|
|
2174
2235
|
r.onload = () => {
|
|
2175
2236
|
e.width = r.width, e.height = r.height, t.fillStyle = "#fff", t.fillRect(0, 0, e.width, e.height), t.drawImage(r, 0, 0), e.toBlob((e) => {
|
|
2176
2237
|
let t = document.createElement("a");
|
|
2177
|
-
t.href = URL.createObjectURL(e), t.download = `${
|
|
2238
|
+
t.href = URL.createObjectURL(e), t.download = `${P.title || "爆炸图"}.png`, t.click();
|
|
2178
2239
|
}), URL.revokeObjectURL(a);
|
|
2179
2240
|
}, r.src = a;
|
|
2180
2241
|
} else A.info(`导出 ${e} 开发中`);
|
|
2181
2242
|
} catch {
|
|
2182
2243
|
A.error("导出失败");
|
|
2183
2244
|
}
|
|
2184
|
-
},
|
|
2185
|
-
|
|
2186
|
-
e.title && (
|
|
2187
|
-
} }),
|
|
2188
|
-
},
|
|
2189
|
-
if (
|
|
2190
|
-
if (!
|
|
2245
|
+
}, Xe = (e) => {
|
|
2246
|
+
L &&= (L.destroy(), null), L = jt(e, { onRemoteChange: (e) => {
|
|
2247
|
+
e.title && (P.title = e.title), e.components && (P.components = e.components), e.connections && (P.connections = e.connections), $();
|
|
2248
|
+
} }), L._setSyncReady(!1);
|
|
2249
|
+
}, Ze = async () => {
|
|
2250
|
+
if (F.value) return;
|
|
2251
|
+
if (!T.value && (await Ke(), !T.value)) {
|
|
2191
2252
|
A.error("请先保存文档");
|
|
2192
2253
|
return;
|
|
2193
2254
|
}
|
|
2194
|
-
|
|
2255
|
+
Xe(String(T.value)), L.connect();
|
|
2195
2256
|
let e = {
|
|
2196
2257
|
name: `用户${Math.floor(Math.random() * 1e3)}`,
|
|
2197
2258
|
color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
|
|
2198
2259
|
}, t = () => {
|
|
2199
|
-
if (
|
|
2200
|
-
|
|
2201
|
-
let t =
|
|
2202
|
-
t ? (t.title && (
|
|
2203
|
-
ydoc:
|
|
2204
|
-
provider:
|
|
2205
|
-
onlineUsers:
|
|
2206
|
-
}),
|
|
2207
|
-
id:
|
|
2260
|
+
if (L.provider && L.provider.synced) {
|
|
2261
|
+
L._setSyncReady(!0), L.setLocalUser(e);
|
|
2262
|
+
let t = L.pullFromYjs();
|
|
2263
|
+
t ? (t.title && (P.title = t.title), t.components && (P.components = t.components), t.connections && (P.connections = t.connections), $()) : P.components.length > 0 && L.pushToYjs(P), F.value = !0, I.value = !0, te.value = !1, N.setCollabContext({
|
|
2264
|
+
ydoc: L.ydoc,
|
|
2265
|
+
provider: L.provider,
|
|
2266
|
+
onlineUsers: L.onlineUsers
|
|
2267
|
+
}), N.setCurrentUser({
|
|
2268
|
+
id: L.provider.awareness.clientID,
|
|
2208
2269
|
name: e.name,
|
|
2209
2270
|
color: e.color
|
|
2210
2271
|
}), A.success("协作已开启");
|
|
2211
2272
|
} else setTimeout(t, 100);
|
|
2212
2273
|
};
|
|
2213
2274
|
setTimeout(t, 200);
|
|
2214
|
-
},
|
|
2215
|
-
|
|
2216
|
-
},
|
|
2217
|
-
let e =
|
|
2275
|
+
}, Qe = () => {
|
|
2276
|
+
L && (L.closeCollaboration(), F.value = !1, I.value = !1, A.info("协作已关闭"));
|
|
2277
|
+
}, $e = () => {
|
|
2278
|
+
let e = p.params.id;
|
|
2218
2279
|
if (!e) return;
|
|
2219
|
-
|
|
2280
|
+
Xe(e), L.connect();
|
|
2220
2281
|
let t = {
|
|
2221
2282
|
name: `协作人${Math.floor(Math.random() * 1e3)}`,
|
|
2222
2283
|
color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
|
|
2223
2284
|
}, n = () => {
|
|
2224
|
-
if (
|
|
2225
|
-
if (
|
|
2226
|
-
|
|
2285
|
+
if (L.provider && L.provider.synced) {
|
|
2286
|
+
if (L.checkCollaborationClosed()) {
|
|
2287
|
+
L.disconnect(), F.value = !1, A.warning("该协作已关闭,无法加入");
|
|
2227
2288
|
return;
|
|
2228
2289
|
}
|
|
2229
|
-
|
|
2230
|
-
let e =
|
|
2231
|
-
e && (e.title && (
|
|
2232
|
-
ydoc:
|
|
2233
|
-
provider:
|
|
2234
|
-
onlineUsers:
|
|
2235
|
-
}),
|
|
2236
|
-
id:
|
|
2290
|
+
L._setSyncReady(!0), L.setLocalUser(t);
|
|
2291
|
+
let e = L.pullFromYjs();
|
|
2292
|
+
e && (e.title && (P.title = e.title), e.components && (P.components = e.components), e.connections && (P.connections = e.connections), $()), F.value = !0, I.value = !1, N.setCollabContext({
|
|
2293
|
+
ydoc: L.ydoc,
|
|
2294
|
+
provider: L.provider,
|
|
2295
|
+
onlineUsers: L.onlineUsers
|
|
2296
|
+
}), N.setCurrentUser({
|
|
2297
|
+
id: L.provider.awareness.clientID,
|
|
2237
2298
|
name: t.name,
|
|
2238
2299
|
color: t.color
|
|
2239
2300
|
}), A.success("已加入协作");
|
|
2240
2301
|
} else setTimeout(n, 100);
|
|
2241
2302
|
};
|
|
2242
2303
|
setTimeout(n, 200);
|
|
2243
|
-
},
|
|
2244
|
-
|
|
2245
|
-
},
|
|
2246
|
-
if (
|
|
2304
|
+
}, et = () => {
|
|
2305
|
+
F.value ? Qe() : Ze();
|
|
2306
|
+
}, tt = async () => {
|
|
2307
|
+
if (F.value || await Ze(), !T.value && (await Ke(), !T.value)) {
|
|
2247
2308
|
A.warning("请先保存文档后再分享");
|
|
2248
2309
|
return;
|
|
2249
2310
|
}
|
|
2250
|
-
let e = `${window.location.origin}/explosion-diagram/${
|
|
2311
|
+
let e = `${window.location.origin}/explosion-diagram/${T.value}?collab=1`;
|
|
2251
2312
|
try {
|
|
2252
2313
|
await navigator.clipboard.writeText(e), A.success("协作链接已复制到剪贴板");
|
|
2253
2314
|
} catch {
|
|
2254
2315
|
A.info("协作链接: " + e);
|
|
2255
2316
|
}
|
|
2256
|
-
},
|
|
2257
|
-
|
|
2258
|
-
},
|
|
2259
|
-
|
|
2317
|
+
}, nt = () => {
|
|
2318
|
+
Y.value = (U.value?.popupConfig || []).map((e) => ({ ...e })), ie.value = !0;
|
|
2319
|
+
}, rt = () => {
|
|
2320
|
+
Y.value.push({
|
|
2260
2321
|
key: "",
|
|
2261
2322
|
value: ""
|
|
2262
2323
|
});
|
|
2263
|
-
},
|
|
2264
|
-
|
|
2265
|
-
},
|
|
2324
|
+
}, it = () => {
|
|
2325
|
+
U.value.popupConfig = Y.value.filter((e) => e.key.trim()), ie.value = !1, Z();
|
|
2326
|
+
}, at = (e) => {
|
|
2266
2327
|
let t = e.target.files?.[0];
|
|
2267
2328
|
if (!t) return;
|
|
2268
2329
|
let n = new FileReader();
|
|
2269
2330
|
n.onload = () => {
|
|
2270
2331
|
try {
|
|
2271
2332
|
let e = JSON.parse(n.result);
|
|
2272
|
-
Array.isArray(e) ?
|
|
2333
|
+
Array.isArray(e) ? Y.value = e.map((e) => ({
|
|
2273
2334
|
key: String(e.key || ""),
|
|
2274
2335
|
value: String(e.value || "")
|
|
2275
|
-
})) : typeof e == "object" && (
|
|
2336
|
+
})) : typeof e == "object" && (Y.value = Object.entries(e).map(([e, t]) => ({
|
|
2276
2337
|
key: e,
|
|
2277
2338
|
value: String(t)
|
|
2278
2339
|
}))), A.success("导入成功");
|
|
@@ -2280,68 +2341,70 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2280
2341
|
A.error("JSON解析失败");
|
|
2281
2342
|
}
|
|
2282
2343
|
}, n.readAsText(t), e.target.value = "";
|
|
2283
|
-
},
|
|
2344
|
+
}, ot = () => {
|
|
2284
2345
|
let e = JSON.stringify({
|
|
2285
|
-
title:
|
|
2286
|
-
components:
|
|
2287
|
-
connections:
|
|
2346
|
+
title: P.title,
|
|
2347
|
+
components: P.components,
|
|
2348
|
+
connections: P.connections
|
|
2288
2349
|
}, null, 2), t = new Blob([e], { type: "application/json" }), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
2289
|
-
r.href = n, r.download = `${
|
|
2290
|
-
},
|
|
2350
|
+
r.href = n, r.download = `${P.title || "爆炸图"}.json`, r.click(), URL.revokeObjectURL(n), A.success("导出成功");
|
|
2351
|
+
}, st = (e) => {
|
|
2291
2352
|
let t = e.target.files?.[0];
|
|
2292
2353
|
if (!t) return;
|
|
2293
2354
|
let n = new FileReader();
|
|
2294
2355
|
n.onload = () => {
|
|
2295
2356
|
try {
|
|
2296
2357
|
let e = JSON.parse(n.result);
|
|
2297
|
-
e.title && (
|
|
2358
|
+
e.title && (P.title = e.title), e.components && (P.components = e.components), e.connections && (P.connections = e.connections), $(), Z(), A.success("导入成功");
|
|
2298
2359
|
} catch {
|
|
2299
2360
|
A.error("JSON解析失败");
|
|
2300
2361
|
}
|
|
2301
2362
|
}, n.readAsText(t), e.target.value = "";
|
|
2302
2363
|
};
|
|
2303
2364
|
m(async () => {
|
|
2304
|
-
let e = localStorage.getItem("editor-user-name") || `用户${Math.floor(Math.random() * 1e3)}`;
|
|
2305
|
-
localStorage.setItem("editor-user-name", e),
|
|
2306
|
-
id: Date.now(),
|
|
2365
|
+
let e = u.user?.name || localStorage.getItem("editor-user-name") || `用户${Math.floor(Math.random() * 1e3)}`;
|
|
2366
|
+
localStorage.setItem("editor-user-name", e), N.setCurrentUser({
|
|
2367
|
+
id: u.user?.id || Date.now(),
|
|
2307
2368
|
name: e,
|
|
2308
|
-
color: "#409eff"
|
|
2309
|
-
}), await
|
|
2369
|
+
color: u.user?.color || "#409eff"
|
|
2370
|
+
}), await qe(), f.value && p.query.collab === "1" && $e();
|
|
2310
2371
|
});
|
|
2311
|
-
let
|
|
2312
|
-
e.key === "Delete" &&
|
|
2372
|
+
let ct = (e) => {
|
|
2373
|
+
e.key === "Delete" && B.value && Ae(), (e.ctrlKey || e.metaKey) && e.key === "z" && (e.preventDefault(), de()), (e.ctrlKey || e.metaKey) && e.key === "y" && (e.preventDefault(), fe());
|
|
2313
2374
|
};
|
|
2314
|
-
return m(() => document.addEventListener("keydown",
|
|
2315
|
-
document.removeEventListener("keydown",
|
|
2375
|
+
return m(() => document.addEventListener("keydown", ct)), h(() => {
|
|
2376
|
+
document.removeEventListener("keydown", ct), L &&= (L.destroy(), null);
|
|
2316
2377
|
}), (n, l) => {
|
|
2317
|
-
let
|
|
2378
|
+
let u = b("el-breadcrumb-item"), f = b("el-breadcrumb"), m = b("el-icon"), h = b("el-button"), _ = b("el-tooltip"), v = b("el-input"), C = b("el-input-number"), O = b("el-color-picker"), k = b("el-switch"), A = b("el-table-column"), j = b("el-table"), M = b("el-dialog"), te = b("Monitor");
|
|
2318
2379
|
return g(), a("div", Mt, [
|
|
2319
2380
|
c(Je, {
|
|
2320
|
-
title:
|
|
2321
|
-
"onUpdate:title": l[0] ||= (e) =>
|
|
2322
|
-
"can-undo":
|
|
2323
|
-
"can-redo":
|
|
2324
|
-
"connecting-mode":
|
|
2325
|
-
"is-connected":
|
|
2326
|
-
"online-users": S(
|
|
2327
|
-
"is-join-mode": S(
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2381
|
+
title: P.title,
|
|
2382
|
+
"onUpdate:title": l[0] ||= (e) => P.title = e,
|
|
2383
|
+
"can-undo": z.value > 0,
|
|
2384
|
+
"can-redo": z.value < R.value.length - 1,
|
|
2385
|
+
"connecting-mode": W.value,
|
|
2386
|
+
"is-connected": F.value,
|
|
2387
|
+
"online-users": S(L) ? S(L).onlineUsers.value : [],
|
|
2388
|
+
"is-join-mode": S(p).query.collab === "1",
|
|
2389
|
+
"show-back-button": d.value.backButton === "show",
|
|
2390
|
+
"title-disabled": !d.value.titleEditable,
|
|
2391
|
+
onBack: ze,
|
|
2392
|
+
onAddComponent: be,
|
|
2393
|
+
onToggleConnecting: l[1] ||= (e) => W.value = !W.value,
|
|
2394
|
+
onGroupSelected: Me,
|
|
2395
|
+
onAutoLayout: Re,
|
|
2396
|
+
onUndo: de,
|
|
2397
|
+
onRedo: fe,
|
|
2398
|
+
onZoomIn: pe,
|
|
2399
|
+
onZoomOut: me,
|
|
2400
|
+
onExport: Ye,
|
|
2401
|
+
onSave: Ke,
|
|
2402
|
+
onToggleCollab: et,
|
|
2403
|
+
onShareCollab: tt,
|
|
2404
|
+
onExportJson: ot,
|
|
2342
2405
|
onImportJson: l[2] ||= (e) => re.value?.click(),
|
|
2343
|
-
"show-history": !!
|
|
2344
|
-
onHistory:
|
|
2406
|
+
"show-history": !!T.value,
|
|
2407
|
+
onHistory: We
|
|
2345
2408
|
}, null, 8, [
|
|
2346
2409
|
"title",
|
|
2347
2410
|
"can-undo",
|
|
@@ -2350,23 +2413,25 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2350
2413
|
"is-connected",
|
|
2351
2414
|
"online-users",
|
|
2352
2415
|
"is-join-mode",
|
|
2416
|
+
"show-back-button",
|
|
2417
|
+
"title-disabled",
|
|
2353
2418
|
"show-history"
|
|
2354
2419
|
]),
|
|
2355
2420
|
o("input", {
|
|
2356
2421
|
ref_key: "fileInputRef",
|
|
2357
|
-
ref:
|
|
2422
|
+
ref: _e,
|
|
2358
2423
|
type: "file",
|
|
2359
2424
|
accept: "image/*,.svg",
|
|
2360
2425
|
style: { display: "none" },
|
|
2361
|
-
onChange:
|
|
2426
|
+
onChange: xe
|
|
2362
2427
|
}, null, 544),
|
|
2363
2428
|
o("input", {
|
|
2364
2429
|
ref_key: "svgInputRef",
|
|
2365
|
-
ref:
|
|
2430
|
+
ref: ve,
|
|
2366
2431
|
type: "file",
|
|
2367
2432
|
accept: ".svg",
|
|
2368
2433
|
style: { display: "none" },
|
|
2369
|
-
onChange:
|
|
2434
|
+
onChange: xe
|
|
2370
2435
|
}, null, 544),
|
|
2371
2436
|
o("input", {
|
|
2372
2437
|
ref_key: "groupImageInputRef",
|
|
@@ -2374,7 +2439,7 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2374
2439
|
type: "file",
|
|
2375
2440
|
accept: "image/*",
|
|
2376
2441
|
style: { display: "none" },
|
|
2377
|
-
onChange:
|
|
2442
|
+
onChange: Le
|
|
2378
2443
|
}, null, 544),
|
|
2379
2444
|
o("input", {
|
|
2380
2445
|
ref_key: "importJsonInputRef",
|
|
@@ -2382,35 +2447,35 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2382
2447
|
type: "file",
|
|
2383
2448
|
accept: ".json",
|
|
2384
2449
|
style: { display: "none" },
|
|
2385
|
-
onChange:
|
|
2450
|
+
onChange: st
|
|
2386
2451
|
}, null, 544),
|
|
2387
|
-
|
|
2388
|
-
default: w(() => [c(
|
|
2389
|
-
onClick: l[3] ||= (e) =>
|
|
2452
|
+
q.value.length ? (g(), a("div", Nt, [c(f, { separator: "/" }, {
|
|
2453
|
+
default: w(() => [c(u, {
|
|
2454
|
+
onClick: l[3] ||= (e) => Ie(-1),
|
|
2390
2455
|
style: { cursor: "pointer" }
|
|
2391
2456
|
}, {
|
|
2392
2457
|
default: w(() => [...l[27] ||= [s("根目录", -1)]]),
|
|
2393
2458
|
_: 1
|
|
2394
|
-
}), (g(!0), a(e, null, y(
|
|
2459
|
+
}), (g(!0), a(e, null, y(q.value, (e, t) => (g(), r(u, {
|
|
2395
2460
|
key: e,
|
|
2396
|
-
onClick: (e) =>
|
|
2461
|
+
onClick: (e) => Ie(t),
|
|
2397
2462
|
style: { cursor: "pointer" }
|
|
2398
2463
|
}, {
|
|
2399
|
-
default: w(() => [s(x(
|
|
2464
|
+
default: w(() => [s(x(le(e)?.label || "组合"), 1)]),
|
|
2400
2465
|
_: 2
|
|
2401
2466
|
}, 1032, ["onClick"]))), 128))]),
|
|
2402
2467
|
_: 1
|
|
2403
|
-
}), c(
|
|
2468
|
+
}), c(_, {
|
|
2404
2469
|
content: "返回上一层",
|
|
2405
2470
|
placement: "bottom"
|
|
2406
2471
|
}, {
|
|
2407
|
-
default: w(() => [c(
|
|
2472
|
+
default: w(() => [c(h, {
|
|
2408
2473
|
size: "small",
|
|
2409
2474
|
circle: "",
|
|
2410
|
-
onClick:
|
|
2475
|
+
onClick: Fe
|
|
2411
2476
|
}, {
|
|
2412
|
-
default: w(() => [c(
|
|
2413
|
-
default: w(() => [c(S(
|
|
2477
|
+
default: w(() => [c(m, null, {
|
|
2478
|
+
default: w(() => [c(S(ee))]),
|
|
2414
2479
|
_: 1
|
|
2415
2480
|
})]),
|
|
2416
2481
|
_: 1
|
|
@@ -2418,23 +2483,23 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2418
2483
|
_: 1
|
|
2419
2484
|
})])) : i("", !0),
|
|
2420
2485
|
o("div", Pt, [c(kt, {
|
|
2421
|
-
components:
|
|
2422
|
-
connections:
|
|
2423
|
-
"selected-id":
|
|
2424
|
-
"selected-ids":
|
|
2425
|
-
"connecting-mode":
|
|
2426
|
-
"drawing-conn":
|
|
2427
|
-
"editing-polygon":
|
|
2428
|
-
"view-box":
|
|
2429
|
-
"is-expanded": !!
|
|
2430
|
-
"expanded-group-id":
|
|
2431
|
-
onSelect:
|
|
2432
|
-
onEdit:
|
|
2486
|
+
components: oe.value,
|
|
2487
|
+
connections: se.value,
|
|
2488
|
+
"selected-id": B.value,
|
|
2489
|
+
"selected-ids": V.value,
|
|
2490
|
+
"connecting-mode": W.value,
|
|
2491
|
+
"drawing-conn": G.value,
|
|
2492
|
+
"editing-polygon": K.value,
|
|
2493
|
+
"view-box": ce.value,
|
|
2494
|
+
"is-expanded": !!X.value,
|
|
2495
|
+
"expanded-group-id": X.value,
|
|
2496
|
+
onSelect: Se,
|
|
2497
|
+
onEdit: Oe,
|
|
2433
2498
|
onClearSelection: $,
|
|
2434
|
-
onStartConnect:
|
|
2435
|
-
onStartResize:
|
|
2436
|
-
onMoveComponent:
|
|
2437
|
-
onDragPolygonVertex:
|
|
2499
|
+
onStartConnect: je,
|
|
2500
|
+
onStartResize: Ce,
|
|
2501
|
+
onMoveComponent: De,
|
|
2502
|
+
onDragPolygonVertex: Z
|
|
2438
2503
|
}, null, 8, [
|
|
2439
2504
|
"components",
|
|
2440
2505
|
"connections",
|
|
@@ -2447,49 +2512,49 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2447
2512
|
"is-expanded",
|
|
2448
2513
|
"expanded-group-id"
|
|
2449
2514
|
]), c(t, { name: "slide" }, {
|
|
2450
|
-
default: w(() => [
|
|
2451
|
-
o("div", It, [l[28] ||= o("label", null, "标签", -1), c(
|
|
2452
|
-
modelValue:
|
|
2453
|
-
"onUpdate:modelValue": l[4] ||= (e) =>
|
|
2515
|
+
default: w(() => [U.value ? (g(), a("div", Ft, [o("h4", null, x(H.value === "component" ? "组件属性" : "连线属性"), 1), H.value === "component" ? (g(), a(e, { key: 0 }, [
|
|
2516
|
+
o("div", It, [l[28] ||= o("label", null, "标签", -1), c(v, {
|
|
2517
|
+
modelValue: U.value.label,
|
|
2518
|
+
"onUpdate:modelValue": l[4] ||= (e) => U.value.label = e,
|
|
2454
2519
|
size: "small"
|
|
2455
2520
|
}, null, 8, ["modelValue"])]),
|
|
2456
|
-
o("div", Lt, [l[29] ||= o("label", null, "描述", -1), c(
|
|
2457
|
-
modelValue:
|
|
2458
|
-
"onUpdate:modelValue": l[5] ||= (e) =>
|
|
2521
|
+
o("div", Lt, [l[29] ||= o("label", null, "描述", -1), c(v, {
|
|
2522
|
+
modelValue: U.value.description,
|
|
2523
|
+
"onUpdate:modelValue": l[5] ||= (e) => U.value.description = e,
|
|
2459
2524
|
size: "small"
|
|
2460
2525
|
}, null, 8, ["modelValue"])]),
|
|
2461
|
-
|
|
2462
|
-
o("div", Rt, [l[30] ||= o("label", null, "宽度", -1), c(
|
|
2463
|
-
modelValue:
|
|
2464
|
-
"onUpdate:modelValue": l[6] ||= (e) =>
|
|
2526
|
+
U.value.shape === "group" ? (g(), a(e, { key: 0 }, [
|
|
2527
|
+
o("div", Rt, [l[30] ||= o("label", null, "宽度", -1), c(C, {
|
|
2528
|
+
modelValue: U.value.width,
|
|
2529
|
+
"onUpdate:modelValue": l[6] ||= (e) => U.value.width = e,
|
|
2465
2530
|
min: 40,
|
|
2466
2531
|
max: 2e3,
|
|
2467
2532
|
size: "small"
|
|
2468
2533
|
}, null, 8, ["modelValue"])]),
|
|
2469
|
-
o("div", zt, [l[31] ||= o("label", null, "高度", -1), c(
|
|
2470
|
-
modelValue:
|
|
2471
|
-
"onUpdate:modelValue": l[7] ||= (e) =>
|
|
2534
|
+
o("div", zt, [l[31] ||= o("label", null, "高度", -1), c(C, {
|
|
2535
|
+
modelValue: U.value.height,
|
|
2536
|
+
"onUpdate:modelValue": l[7] ||= (e) => U.value.height = e,
|
|
2472
2537
|
min: 30,
|
|
2473
2538
|
max: 1500,
|
|
2474
2539
|
size: "small"
|
|
2475
2540
|
}, null, 8, ["modelValue"])]),
|
|
2476
|
-
o("div", Bt, [l[34] ||= o("label", null, "显示图片", -1),
|
|
2477
|
-
src:
|
|
2541
|
+
o("div", Bt, [l[34] ||= o("label", null, "显示图片", -1), U.value.imageUrl ? (g(), a("div", Vt, [o("img", {
|
|
2542
|
+
src: U.value.imageUrl,
|
|
2478
2543
|
style: {
|
|
2479
2544
|
"max-width": "100%",
|
|
2480
2545
|
"max-height": "80px",
|
|
2481
2546
|
border: "1px solid #e4e7ed",
|
|
2482
2547
|
"border-radius": "4px"
|
|
2483
2548
|
}
|
|
2484
|
-
}, null, 8, Ht), c(
|
|
2549
|
+
}, null, 8, Ht), c(h, {
|
|
2485
2550
|
size: "small",
|
|
2486
2551
|
type: "danger",
|
|
2487
2552
|
text: "",
|
|
2488
|
-
onClick: l[8] ||= (e) =>
|
|
2553
|
+
onClick: l[8] ||= (e) => U.value.imageUrl = ""
|
|
2489
2554
|
}, {
|
|
2490
2555
|
default: w(() => [...l[32] ||= [s("移除", -1)]]),
|
|
2491
2556
|
_: 1
|
|
2492
|
-
})])) : (g(), r(
|
|
2557
|
+
})])) : (g(), r(h, {
|
|
2493
2558
|
key: 1,
|
|
2494
2559
|
size: "small",
|
|
2495
2560
|
onClick: l[9] ||= (e) => ne.value?.click()
|
|
@@ -2497,84 +2562,84 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2497
2562
|
default: w(() => [...l[33] ||= [s("上传图片", -1)]]),
|
|
2498
2563
|
_: 1
|
|
2499
2564
|
}))]),
|
|
2500
|
-
c(
|
|
2565
|
+
c(h, {
|
|
2501
2566
|
size: "small",
|
|
2502
|
-
onClick: l[10] ||= (e) =>
|
|
2567
|
+
onClick: l[10] ||= (e) => Ne(U.value)
|
|
2503
2568
|
}, {
|
|
2504
2569
|
default: w(() => [...l[35] ||= [s("适配子零件", -1)]]),
|
|
2505
2570
|
_: 1
|
|
2506
2571
|
})
|
|
2507
|
-
], 64)) : (g(), a(e, { key: 1 }, [o("div", Ut, [l[36] ||= o("label", null, "宽度", -1), c(
|
|
2508
|
-
modelValue:
|
|
2509
|
-
"onUpdate:modelValue": l[11] ||= (e) =>
|
|
2572
|
+
], 64)) : (g(), a(e, { key: 1 }, [o("div", Ut, [l[36] ||= o("label", null, "宽度", -1), c(C, {
|
|
2573
|
+
modelValue: U.value.width,
|
|
2574
|
+
"onUpdate:modelValue": l[11] ||= (e) => U.value.width = e,
|
|
2510
2575
|
min: 40,
|
|
2511
2576
|
max: 400,
|
|
2512
2577
|
size: "small"
|
|
2513
|
-
}, null, 8, ["modelValue"])]), o("div", Wt, [l[37] ||= o("label", null, "高度", -1), c(
|
|
2514
|
-
modelValue:
|
|
2515
|
-
"onUpdate:modelValue": l[12] ||= (e) =>
|
|
2578
|
+
}, null, 8, ["modelValue"])]), o("div", Wt, [l[37] ||= o("label", null, "高度", -1), c(C, {
|
|
2579
|
+
modelValue: U.value.height,
|
|
2580
|
+
"onUpdate:modelValue": l[12] ||= (e) => U.value.height = e,
|
|
2516
2581
|
min: 30,
|
|
2517
2582
|
max: 300,
|
|
2518
2583
|
size: "small"
|
|
2519
2584
|
}, null, 8, ["modelValue"])])], 64)),
|
|
2520
|
-
o("div", Gt, [l[38] ||= o("label", null, "填充色", -1), c(
|
|
2521
|
-
modelValue:
|
|
2522
|
-
"onUpdate:modelValue": l[13] ||= (e) =>
|
|
2585
|
+
o("div", Gt, [l[38] ||= o("label", null, "填充色", -1), c(O, {
|
|
2586
|
+
modelValue: U.value.fill,
|
|
2587
|
+
"onUpdate:modelValue": l[13] ||= (e) => U.value.fill = e,
|
|
2523
2588
|
size: "small"
|
|
2524
2589
|
}, null, 8, ["modelValue"])]),
|
|
2525
|
-
o("div", Kt, [l[39] ||= o("label", null, "边框色", -1), c(
|
|
2526
|
-
modelValue:
|
|
2527
|
-
"onUpdate:modelValue": l[14] ||= (e) =>
|
|
2590
|
+
o("div", Kt, [l[39] ||= o("label", null, "边框色", -1), c(O, {
|
|
2591
|
+
modelValue: U.value.stroke,
|
|
2592
|
+
"onUpdate:modelValue": l[14] ||= (e) => U.value.stroke = e,
|
|
2528
2593
|
size: "small"
|
|
2529
2594
|
}, null, 8, ["modelValue"])]),
|
|
2530
|
-
o("div", qt, [l[40] ||= o("label", null, "文字色", -1), c(
|
|
2531
|
-
modelValue:
|
|
2532
|
-
"onUpdate:modelValue": l[15] ||= (e) =>
|
|
2595
|
+
o("div", qt, [l[40] ||= o("label", null, "文字色", -1), c(O, {
|
|
2596
|
+
modelValue: U.value.textColor,
|
|
2597
|
+
"onUpdate:modelValue": l[15] ||= (e) => U.value.textColor = e,
|
|
2533
2598
|
size: "small"
|
|
2534
2599
|
}, null, 8, ["modelValue"])]),
|
|
2535
|
-
o("div", Jt, [l[41] ||= o("label", null, "字号", -1), c(
|
|
2536
|
-
modelValue:
|
|
2537
|
-
"onUpdate:modelValue": l[16] ||= (e) =>
|
|
2600
|
+
o("div", Jt, [l[41] ||= o("label", null, "字号", -1), c(C, {
|
|
2601
|
+
modelValue: U.value.fontSize,
|
|
2602
|
+
"onUpdate:modelValue": l[16] ||= (e) => U.value.fontSize = e,
|
|
2538
2603
|
min: 10,
|
|
2539
2604
|
max: 32,
|
|
2540
2605
|
size: "small"
|
|
2541
2606
|
}, null, 8, ["modelValue"])]),
|
|
2542
|
-
c(
|
|
2607
|
+
c(h, {
|
|
2543
2608
|
size: "small",
|
|
2544
|
-
onClick:
|
|
2609
|
+
onClick: nt
|
|
2545
2610
|
}, {
|
|
2546
2611
|
default: w(() => [...l[42] ||= [s("属性弹框设置", -1)]]),
|
|
2547
2612
|
_: 1
|
|
2548
2613
|
}),
|
|
2549
|
-
c(
|
|
2614
|
+
c(h, {
|
|
2550
2615
|
size: "small",
|
|
2551
2616
|
type: "danger",
|
|
2552
|
-
onClick:
|
|
2617
|
+
onClick: Ae
|
|
2553
2618
|
}, {
|
|
2554
2619
|
default: w(() => [...l[43] ||= [s("删除", -1)]]),
|
|
2555
2620
|
_: 1
|
|
2556
2621
|
})
|
|
2557
|
-
], 64)) :
|
|
2558
|
-
o("div", Yt, [l[44] ||= o("label", null, "标签", -1), c(
|
|
2559
|
-
modelValue:
|
|
2560
|
-
"onUpdate:modelValue": l[17] ||= (e) =>
|
|
2622
|
+
], 64)) : H.value === "connection" ? (g(), a(e, { key: 1 }, [
|
|
2623
|
+
o("div", Yt, [l[44] ||= o("label", null, "标签", -1), c(v, {
|
|
2624
|
+
modelValue: U.value.label,
|
|
2625
|
+
"onUpdate:modelValue": l[17] ||= (e) => U.value.label = e,
|
|
2561
2626
|
size: "small"
|
|
2562
2627
|
}, null, 8, ["modelValue"])]),
|
|
2563
|
-
o("div", Xt, [l[45] ||= o("label", null, "线宽", -1), c(
|
|
2564
|
-
modelValue:
|
|
2565
|
-
"onUpdate:modelValue": l[18] ||= (e) =>
|
|
2628
|
+
o("div", Xt, [l[45] ||= o("label", null, "线宽", -1), c(C, {
|
|
2629
|
+
modelValue: U.value.lineWidth,
|
|
2630
|
+
"onUpdate:modelValue": l[18] ||= (e) => U.value.lineWidth = e,
|
|
2566
2631
|
min: 1,
|
|
2567
2632
|
max: 6,
|
|
2568
2633
|
size: "small"
|
|
2569
2634
|
}, null, 8, ["modelValue"])]),
|
|
2570
|
-
o("div", Zt, [l[46] ||= o("label", null, "虚线", -1), c(
|
|
2571
|
-
modelValue:
|
|
2572
|
-
"onUpdate:modelValue": l[19] ||= (e) =>
|
|
2635
|
+
o("div", Zt, [l[46] ||= o("label", null, "虚线", -1), c(k, {
|
|
2636
|
+
modelValue: U.value.dashed,
|
|
2637
|
+
"onUpdate:modelValue": l[19] ||= (e) => U.value.dashed = e
|
|
2573
2638
|
}, null, 8, ["modelValue"])]),
|
|
2574
|
-
c(
|
|
2639
|
+
c(h, {
|
|
2575
2640
|
size: "small",
|
|
2576
2641
|
type: "danger",
|
|
2577
|
-
onClick:
|
|
2642
|
+
onClick: Ae
|
|
2578
2643
|
}, {
|
|
2579
2644
|
default: w(() => [...l[47] ||= [s("删除", -1)]]),
|
|
2580
2645
|
_: 1
|
|
@@ -2582,58 +2647,58 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2582
2647
|
], 64)) : i("", !0)])) : i("", !0)]),
|
|
2583
2648
|
_: 1
|
|
2584
2649
|
})]),
|
|
2585
|
-
c(
|
|
2586
|
-
modelValue:
|
|
2587
|
-
"onUpdate:modelValue": l[22] ||= (e) =>
|
|
2650
|
+
c(M, {
|
|
2651
|
+
modelValue: ie.value,
|
|
2652
|
+
"onUpdate:modelValue": l[22] ||= (e) => ie.value = e,
|
|
2588
2653
|
title: "属性弹框设置",
|
|
2589
2654
|
width: "500",
|
|
2590
2655
|
"append-to-body": ""
|
|
2591
2656
|
}, {
|
|
2592
|
-
footer: w(() => [c(
|
|
2657
|
+
footer: w(() => [c(h, { onClick: l[21] ||= (e) => ie.value = !1 }, {
|
|
2593
2658
|
default: w(() => [...l[51] ||= [s("取消", -1)]]),
|
|
2594
2659
|
_: 1
|
|
2595
|
-
}), c(
|
|
2660
|
+
}), c(h, {
|
|
2596
2661
|
type: "primary",
|
|
2597
|
-
onClick:
|
|
2662
|
+
onClick: it
|
|
2598
2663
|
}, {
|
|
2599
2664
|
default: w(() => [...l[52] ||= [s("保存", -1)]]),
|
|
2600
2665
|
_: 1
|
|
2601
2666
|
})]),
|
|
2602
2667
|
default: w(() => [o("div", Qt, [
|
|
2603
|
-
c(
|
|
2668
|
+
c(h, {
|
|
2604
2669
|
size: "small",
|
|
2605
|
-
onClick:
|
|
2670
|
+
onClick: rt
|
|
2606
2671
|
}, {
|
|
2607
2672
|
default: w(() => [...l[48] ||= [s("+ 添加一行", -1)]]),
|
|
2608
2673
|
_: 1
|
|
2609
2674
|
}),
|
|
2610
|
-
c(
|
|
2675
|
+
c(h, {
|
|
2611
2676
|
size: "small",
|
|
2612
|
-
onClick: l[20] ||= (e) =>
|
|
2677
|
+
onClick: l[20] ||= (e) => ae.value?.click()
|
|
2613
2678
|
}, {
|
|
2614
2679
|
default: w(() => [...l[49] ||= [s("导入JSON", -1)]]),
|
|
2615
2680
|
_: 1
|
|
2616
2681
|
}),
|
|
2617
2682
|
o("input", {
|
|
2618
2683
|
ref_key: "popupConfigImportRef",
|
|
2619
|
-
ref:
|
|
2684
|
+
ref: ae,
|
|
2620
2685
|
type: "file",
|
|
2621
2686
|
accept: ".json",
|
|
2622
2687
|
style: { display: "none" },
|
|
2623
|
-
onChange:
|
|
2688
|
+
onChange: at
|
|
2624
2689
|
}, null, 544)
|
|
2625
|
-
]), c(
|
|
2626
|
-
data:
|
|
2690
|
+
]), c(j, {
|
|
2691
|
+
data: Y.value,
|
|
2627
2692
|
border: "",
|
|
2628
2693
|
size: "small",
|
|
2629
2694
|
"max-height": "300"
|
|
2630
2695
|
}, {
|
|
2631
2696
|
default: w(() => [
|
|
2632
|
-
c(
|
|
2697
|
+
c(A, {
|
|
2633
2698
|
label: "属性名",
|
|
2634
2699
|
"min-width": "120"
|
|
2635
2700
|
}, {
|
|
2636
|
-
default: w(({ row: e }) => [c(
|
|
2701
|
+
default: w(({ row: e }) => [c(v, {
|
|
2637
2702
|
modelValue: e.key,
|
|
2638
2703
|
"onUpdate:modelValue": (t) => e.key = t,
|
|
2639
2704
|
size: "small",
|
|
@@ -2641,11 +2706,11 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2641
2706
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])]),
|
|
2642
2707
|
_: 1
|
|
2643
2708
|
}),
|
|
2644
|
-
c(
|
|
2709
|
+
c(A, {
|
|
2645
2710
|
label: "悬浮内容",
|
|
2646
2711
|
"min-width": "200"
|
|
2647
2712
|
}, {
|
|
2648
|
-
default: w(({ row: e }) => [c(
|
|
2713
|
+
default: w(({ row: e }) => [c(v, {
|
|
2649
2714
|
modelValue: e.value,
|
|
2650
2715
|
"onUpdate:modelValue": (t) => e.value = t,
|
|
2651
2716
|
size: "small",
|
|
@@ -2653,15 +2718,15 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2653
2718
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])]),
|
|
2654
2719
|
_: 1
|
|
2655
2720
|
}),
|
|
2656
|
-
c(
|
|
2721
|
+
c(A, {
|
|
2657
2722
|
width: "60",
|
|
2658
2723
|
label: "操作"
|
|
2659
2724
|
}, {
|
|
2660
|
-
default: w(({ $index: e }) => [c(
|
|
2725
|
+
default: w(({ $index: e }) => [c(h, {
|
|
2661
2726
|
size: "small",
|
|
2662
2727
|
type: "danger",
|
|
2663
2728
|
text: "",
|
|
2664
|
-
onClick: (t) =>
|
|
2729
|
+
onClick: (t) => Y.value.splice(e, 1)
|
|
2665
2730
|
}, {
|
|
2666
2731
|
default: w(() => [...l[50] ||= [s("删除", -1)]]),
|
|
2667
2732
|
_: 1
|
|
@@ -2673,33 +2738,33 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2673
2738
|
}, 8, ["data"])]),
|
|
2674
2739
|
_: 1
|
|
2675
2740
|
}, 8, ["modelValue"]),
|
|
2676
|
-
c(
|
|
2741
|
+
c(h, {
|
|
2677
2742
|
class: "ai-chat-fab",
|
|
2678
|
-
type:
|
|
2743
|
+
type: E.value ? "primary" : "default",
|
|
2679
2744
|
circle: "",
|
|
2680
2745
|
size: "large",
|
|
2681
|
-
onClick: l[23] ||= (e) =>
|
|
2746
|
+
onClick: l[23] ||= (e) => E.value = !E.value,
|
|
2682
2747
|
title: "AI助手"
|
|
2683
2748
|
}, {
|
|
2684
|
-
default: w(() => [c(
|
|
2685
|
-
default: w(() => [c(
|
|
2749
|
+
default: w(() => [c(m, null, {
|
|
2750
|
+
default: w(() => [c(te)]),
|
|
2686
2751
|
_: 1
|
|
2687
2752
|
})]),
|
|
2688
2753
|
_: 1
|
|
2689
2754
|
}, 8, ["type"]),
|
|
2690
2755
|
c(Te, {
|
|
2691
|
-
visible:
|
|
2692
|
-
messages: S(
|
|
2693
|
-
loading: S(
|
|
2694
|
-
"is-collab": S(
|
|
2695
|
-
"collab-users": S(
|
|
2696
|
-
"current-user": S(
|
|
2697
|
-
"is-owner":
|
|
2698
|
-
onSend:
|
|
2699
|
-
onClose: l[24] ||= (e) =>
|
|
2700
|
-
"unread-mention": S(
|
|
2701
|
-
onClearUnread: l[25] ||= (e) => S(
|
|
2702
|
-
onClear:
|
|
2756
|
+
visible: E.value,
|
|
2757
|
+
messages: S(N).messages.value,
|
|
2758
|
+
loading: S(N).loading.value,
|
|
2759
|
+
"is-collab": S(N).isCollabMode.value,
|
|
2760
|
+
"collab-users": S(N).collabUsers.value,
|
|
2761
|
+
"current-user": S(N).currentUser.value,
|
|
2762
|
+
"is-owner": I.value,
|
|
2763
|
+
onSend: He,
|
|
2764
|
+
onClose: l[24] ||= (e) => E.value = !1,
|
|
2765
|
+
"unread-mention": S(N).unreadMention.value,
|
|
2766
|
+
onClearUnread: l[25] ||= (e) => S(N).clearUnreadMention(),
|
|
2767
|
+
onClear: Ue
|
|
2703
2768
|
}, null, 8, [
|
|
2704
2769
|
"visible",
|
|
2705
2770
|
"messages",
|
|
@@ -2711,15 +2776,15 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2711
2776
|
"unread-mention"
|
|
2712
2777
|
]),
|
|
2713
2778
|
c(Ve, {
|
|
2714
|
-
modelValue:
|
|
2715
|
-
"onUpdate:modelValue": l[26] ||= (e) =>
|
|
2716
|
-
"document-id":
|
|
2717
|
-
onApply:
|
|
2779
|
+
modelValue: D.value,
|
|
2780
|
+
"onUpdate:modelValue": l[26] ||= (e) => D.value = e,
|
|
2781
|
+
"document-id": T.value,
|
|
2782
|
+
onApply: Ge
|
|
2718
2783
|
}, null, 8, ["modelValue", "document-id"])
|
|
2719
2784
|
]);
|
|
2720
2785
|
};
|
|
2721
2786
|
}
|
|
2722
|
-
}, [["__scopeId", "data-v-
|
|
2787
|
+
}, [["__scopeId", "data-v-f79e9aab"]]), tn = l({
|
|
2723
2788
|
name: "YourCompanyExplosionDiagram",
|
|
2724
2789
|
props: {
|
|
2725
2790
|
docId: {
|
|
@@ -2730,6 +2795,14 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2730
2795
|
type: String,
|
|
2731
2796
|
default: "/api"
|
|
2732
2797
|
},
|
|
2798
|
+
saveApi: {
|
|
2799
|
+
type: [String, Function],
|
|
2800
|
+
default: null
|
|
2801
|
+
},
|
|
2802
|
+
loadApi: {
|
|
2803
|
+
type: [String, Function],
|
|
2804
|
+
default: null
|
|
2805
|
+
},
|
|
2733
2806
|
wsUrl: {
|
|
2734
2807
|
type: String,
|
|
2735
2808
|
default: ""
|
|
@@ -2745,6 +2818,10 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2745
2818
|
roomId: {
|
|
2746
2819
|
type: String,
|
|
2747
2820
|
default: ""
|
|
2821
|
+
},
|
|
2822
|
+
uiConfig: {
|
|
2823
|
+
type: Object,
|
|
2824
|
+
default: () => ({})
|
|
2748
2825
|
}
|
|
2749
2826
|
},
|
|
2750
2827
|
setup(e, { slots: t }) {
|