@billtaofbj/explosion-diagram 1.1.0 → 1.2.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 +512 -394
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2,19 +2,19 @@ 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 N, Back as ee, Bell as
|
|
6
|
-
import
|
|
7
|
-
import * as
|
|
8
|
-
import { HocuspocusProvider as
|
|
5
|
+
import { ArrowDown as M, ArrowLeft as N, Back as ee, Bell as te, Clock as P, Close as F, Connection as ne, Delete as re, Download as I, Files as L, Link as R, Loading as z, Monitor as B, Promotion as V, RefreshLeft as H, RefreshRight as U, Share as W, Upload as G, ZoomIn as K, ZoomOut as ie } from "@element-plus/icons-vue";
|
|
6
|
+
import q from "axios";
|
|
7
|
+
import * as ae from "yjs";
|
|
8
|
+
import { HocuspocusProvider as oe } from "@hocuspocus/provider";
|
|
9
9
|
//#region \0plugin-vue:export-helper
|
|
10
|
-
var
|
|
10
|
+
var J = (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
|
+
}, Y = { class: "chat-header" }, X = { class: "chat-header-left" }, se = { class: "chat-title" }, ce = { class: "online-users-list" }, le = { class: "online-user-item" }, ue = { class: "online-user-name" }, Z = { 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 }, ge = { class: "message-content" }, Q = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "message-meta"
|
|
20
20
|
}, _e = {
|
|
@@ -23,10 +23,10 @@ var Y = (e, t) => {
|
|
|
23
23
|
}, ve = ["innerHTML"], ye = { class: "message-time" }, be = {
|
|
24
24
|
key: 1,
|
|
25
25
|
class: "chat-message chat-message-ai"
|
|
26
|
-
}, xe = { class: "message-avatar ai" }, Se = { class: "chat-input-area" },
|
|
26
|
+
}, xe = { class: "message-avatar ai" }, Se = { class: "chat-input-area" }, Ce = {
|
|
27
27
|
key: 0,
|
|
28
28
|
class: "mention-popup"
|
|
29
|
-
},
|
|
29
|
+
}, $ = ["onClick", "onMouseenter"], we = { key: 1 }, Te = /*#__PURE__*/ J({
|
|
30
30
|
__name: "AiChatPanel",
|
|
31
31
|
props: {
|
|
32
32
|
visible: {
|
|
@@ -90,7 +90,7 @@ var Y = (e, t) => {
|
|
|
90
90
|
let i = String(r || n.name || "");
|
|
91
91
|
return t.has(i) ? !1 : (t.add(i), !0);
|
|
92
92
|
})];
|
|
93
|
-
}),
|
|
93
|
+
}), P = n(() => ee.value.length + 1), ne = (e) => e.role === "ai" ? "chat-message-ai" : u.isCollab && e.user_id && e.user_id !== u.currentUser.id ? "chat-message-other" : "chat-message-user", I = (e) => e.role === "ai" ? { background: "linear-gradient(135deg, #409EFF, #337ECC)" } : { background: e.user_color || "#67C23A" }, L = (e) => (e.user_name || "U").charAt(0), R = (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) {
|
|
@@ -101,20 +101,20 @@ var Y = (e, t) => {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
O.value = !1;
|
|
104
|
-
},
|
|
104
|
+
}, z = () => {
|
|
105
105
|
O.value && (A.value = Math.min(A.value + 1, k.value.length - 1));
|
|
106
|
-
},
|
|
106
|
+
}, H = () => {
|
|
107
107
|
O.value && (A.value = Math.max(A.value - 1, 0));
|
|
108
|
-
},
|
|
108
|
+
}, U = (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
|
+
}, W = (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(), U(t);
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -128,24 +128,24 @@ 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
|
+
}, G = () => {
|
|
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, G), C(() => u.messages, G, { 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", Y, [o("div", X, [
|
|
144
144
|
c(u, {
|
|
145
145
|
size: 18,
|
|
146
146
|
color: "#409EFF"
|
|
147
147
|
}, {
|
|
148
|
-
default: w(() => [c(S(
|
|
148
|
+
default: w(() => [c(S(B))]),
|
|
149
149
|
_: 1
|
|
150
150
|
}),
|
|
151
151
|
o("span", se, x(t.isCollab ? "协作聊天" : "AI 助手"), 1),
|
|
@@ -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(P.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", ue, x(t.currentUser.name || "我"), 1),
|
|
173
173
|
c(d, {
|
|
174
174
|
size: "small",
|
|
175
175
|
type: t.isOwner ? "warning" : "success",
|
|
@@ -191,9 +191,9 @@ var Y = (e, t) => {
|
|
|
191
191
|
key: 0,
|
|
192
192
|
size: 14
|
|
193
193
|
}, {
|
|
194
|
-
default: w(() => [c(S(
|
|
194
|
+
default: w(() => [c(S(B))]),
|
|
195
195
|
_: 1
|
|
196
|
-
})) : (g(), a("span",
|
|
196
|
+
})) : (g(), a("span", Z, x((e.name || "U").charAt(0)), 1))], 4),
|
|
197
197
|
o("span", de, x(e.name || "未知用户"), 1),
|
|
198
198
|
e.isAi ? (g(), r(d, {
|
|
199
199
|
key: 0,
|
|
@@ -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(te))]),
|
|
231
231
|
_: 1
|
|
232
232
|
})])) : i("", !0),
|
|
233
233
|
c(C, {
|
|
@@ -238,7 +238,7 @@ var Y = (e, t) => {
|
|
|
238
238
|
title: "清空对话"
|
|
239
239
|
}, {
|
|
240
240
|
default: w(() => [c(u, null, {
|
|
241
|
-
default: w(() => [c(S(
|
|
241
|
+
default: w(() => [c(S(re))]),
|
|
242
242
|
_: 1
|
|
243
243
|
})]),
|
|
244
244
|
_: 1
|
|
@@ -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(F))]),
|
|
255
255
|
_: 1
|
|
256
256
|
})]),
|
|
257
257
|
_: 1
|
|
@@ -267,7 +267,7 @@ var Y = (e, t) => {
|
|
|
267
267
|
size: 40,
|
|
268
268
|
color: "#c0c4cc"
|
|
269
269
|
}, {
|
|
270
|
-
default: w(() => [c(S(
|
|
270
|
+
default: w(() => [c(S(B))]),
|
|
271
271
|
_: 1
|
|
272
272
|
}),
|
|
273
273
|
o("p", null, x(t.isCollab ? "协作聊天室" : "你好!我是 AI 助手"), 1),
|
|
@@ -275,18 +275,18 @@ var Y = (e, t) => {
|
|
|
275
275
|
])) : i("", !0),
|
|
276
276
|
(g(!0), a(e, null, y(t.messages, (e) => (g(), a("div", {
|
|
277
277
|
key: e._msgId || e.time + e.content,
|
|
278
|
-
class: f(["chat-message",
|
|
278
|
+
class: f(["chat-message", ne(e)])
|
|
279
279
|
}, [o("div", {
|
|
280
280
|
class: "message-avatar",
|
|
281
|
-
style: p(
|
|
281
|
+
style: p(I(e))
|
|
282
282
|
}, [e.role === "ai" ? (g(), r(u, {
|
|
283
283
|
key: 0,
|
|
284
284
|
size: 16
|
|
285
285
|
}, {
|
|
286
|
-
default: w(() => [c(S(
|
|
286
|
+
default: w(() => [c(S(B))]),
|
|
287
287
|
_: 1
|
|
288
|
-
})) : (g(), a("span", he, x(
|
|
289
|
-
t.isCollab && e.role === "user" ? (g(), a("div",
|
|
288
|
+
})) : (g(), a("span", he, x(L(e)), 1))], 4), o("div", ge, [
|
|
289
|
+
t.isCollab && e.role === "user" ? (g(), a("div", Q, [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),
|
|
@@ -297,7 +297,7 @@ var Y = (e, t) => {
|
|
|
297
297
|
o("div", ye, x(e.time), 1)
|
|
298
298
|
])], 2))), 128)),
|
|
299
299
|
t.loading ? (g(), a("div", be, [o("div", xe, [c(u, { size: 16 }, {
|
|
300
|
-
default: w(() => [c(S(
|
|
300
|
+
default: w(() => [c(S(B))]),
|
|
301
301
|
_: 1
|
|
302
302
|
})]), l[7] ||= o("div", { class: "message-content" }, [o("div", { class: "message-text typing-indicator" }, [
|
|
303
303
|
o("span"),
|
|
@@ -320,21 +320,21 @@ var Y = (e, t) => {
|
|
|
320
320
|
},
|
|
321
321
|
placeholder: t.isCollab ? "输入消息... @提及成员" : "输入消息...",
|
|
322
322
|
onKeydown: [
|
|
323
|
-
T(E(
|
|
324
|
-
T(E(
|
|
325
|
-
T(E(
|
|
323
|
+
T(E(W, ["exact"]), ["enter"]),
|
|
324
|
+
T(E(z, ["prevent"]), ["down"]),
|
|
325
|
+
T(E(H, ["prevent"]), ["up"])
|
|
326
326
|
],
|
|
327
|
-
onInput:
|
|
327
|
+
onInput: R,
|
|
328
328
|
resize: "none"
|
|
329
329
|
}, null, 8, [
|
|
330
330
|
"modelValue",
|
|
331
331
|
"placeholder",
|
|
332
332
|
"onKeydown"
|
|
333
333
|
]),
|
|
334
|
-
O.value ? (g(), a("div",
|
|
334
|
+
O.value ? (g(), a("div", Ce, [(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) => U(e),
|
|
338
338
|
onMouseenter: (e) => A.value = t
|
|
339
339
|
}, [o("div", {
|
|
340
340
|
class: "mention-avatar",
|
|
@@ -343,18 +343,18 @@ var Y = (e, t) => {
|
|
|
343
343
|
key: 0,
|
|
344
344
|
size: 12
|
|
345
345
|
}, {
|
|
346
|
-
default: w(() => [c(S(
|
|
346
|
+
default: w(() => [c(S(B))]),
|
|
347
347
|
_: 1
|
|
348
|
-
})) : (g(), a("span", we, x((e.name || "U").charAt(0)), 1))], 4), o("span", null, x(e.name), 1)], 42,
|
|
348
|
+
})) : (g(), a("span", we, x((e.name || "U").charAt(0)), 1))], 4), o("span", null, x(e.name), 1)], 42, $))), 128))])) : i("", !0),
|
|
349
349
|
c(C, {
|
|
350
350
|
class: "send-btn",
|
|
351
351
|
type: "primary",
|
|
352
352
|
circle: "",
|
|
353
353
|
disabled: !h.value.trim() || t.loading,
|
|
354
|
-
onClick:
|
|
354
|
+
onClick: W
|
|
355
355
|
}, {
|
|
356
356
|
default: w(() => [c(u, null, {
|
|
357
|
-
default: w(() => [c(S(
|
|
357
|
+
default: w(() => [c(S(V))]),
|
|
358
358
|
_: 1
|
|
359
359
|
})]),
|
|
360
360
|
_: 1
|
|
@@ -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 q.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 q.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 q.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 q.delete(u, { params: { room_id: t } });
|
|
483
483
|
} catch (e) {
|
|
484
484
|
console.warn("[useChat] Failed to clear messages on server:", e);
|
|
485
485
|
}
|
|
@@ -513,8 +513,119 @@ function Ee() {
|
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
515
|
//#endregion
|
|
516
|
+
//#region ../../src/composables/useAiApi.js
|
|
517
|
+
var De = [
|
|
518
|
+
"我可以帮您优化流程图布局、检查节点逻辑,或者提供流程设计建议。请问有什么需要帮助的?",
|
|
519
|
+
"这个流程图的节点连接看起来很清晰。建议检查一下是否有遗漏的分支或异常处理路径。",
|
|
520
|
+
"根据当前的流程结构,我建议在关键决策节点后添加明确的条件标注,使流程更易理解。",
|
|
521
|
+
"流程图中的泳道划分很合理。如果需要,我可以帮您分析各角色的职责分配是否均衡。",
|
|
522
|
+
"我可以帮您检查流程中是否存在循环依赖或死锁风险。需要我逐条分析吗?",
|
|
523
|
+
"建议在流程开始和结束节点使用统一的样式,这样可以让读者更快识别流程的起止点。",
|
|
524
|
+
"这个执行图的逻辑链路比较长,建议在中间添加一些检查点节点,便于流程监控和调试。",
|
|
525
|
+
"我可以帮您生成流程图的文字说明文档,方便团队成员理解流程细节。"
|
|
526
|
+
];
|
|
527
|
+
function Oe() {
|
|
528
|
+
return De[Math.floor(Math.random() * De.length)];
|
|
529
|
+
}
|
|
530
|
+
async function ke(e, t, n) {
|
|
531
|
+
let r = { "Content-Type": "application/json" };
|
|
532
|
+
e.apiKey && (r.Authorization = `Bearer ${e.apiKey}`);
|
|
533
|
+
let i = await fetch(e.url, {
|
|
534
|
+
method: "POST",
|
|
535
|
+
headers: r,
|
|
536
|
+
body: JSON.stringify({
|
|
537
|
+
model: e.model || "gpt-4o-mini",
|
|
538
|
+
messages: t,
|
|
539
|
+
temperature: e.temperature ?? .7,
|
|
540
|
+
max_tokens: e.maxTokens ?? 4096
|
|
541
|
+
}),
|
|
542
|
+
signal: n
|
|
543
|
+
});
|
|
544
|
+
if (!i.ok) {
|
|
545
|
+
let e = await i.text().catch(() => "");
|
|
546
|
+
throw Error(`AI API error ${i.status}: ${e}`);
|
|
547
|
+
}
|
|
548
|
+
return (await i.json()).choices?.[0]?.message?.content || "";
|
|
549
|
+
}
|
|
550
|
+
function Ae(e) {
|
|
551
|
+
let t = v(!1), n = null, r = () => {
|
|
552
|
+
let t = typeof e == "function" ? e() : e;
|
|
553
|
+
return !!(t && t.url);
|
|
554
|
+
}, i = () => typeof e == "function" ? e() : e || {};
|
|
555
|
+
return {
|
|
556
|
+
loading: t,
|
|
557
|
+
isAvailable: r,
|
|
558
|
+
chat: async (e, r = []) => {
|
|
559
|
+
let a = i();
|
|
560
|
+
if (!a.url) return Oe();
|
|
561
|
+
t.value = !0, n && n.abort(), n = new AbortController();
|
|
562
|
+
try {
|
|
563
|
+
return await ke(a, [
|
|
564
|
+
{
|
|
565
|
+
role: "system",
|
|
566
|
+
content: a.chatPrompt || "你是一个有帮助的AI助手,擅长文档编辑和流程设计。请简洁回答用户问题。"
|
|
567
|
+
},
|
|
568
|
+
...r.map((e) => ({
|
|
569
|
+
role: e.role === "ai" ? "assistant" : "user",
|
|
570
|
+
content: e.content
|
|
571
|
+
})),
|
|
572
|
+
{
|
|
573
|
+
role: "user",
|
|
574
|
+
content: e
|
|
575
|
+
}
|
|
576
|
+
], n.signal);
|
|
577
|
+
} catch (e) {
|
|
578
|
+
return e.name === "AbortError" ? "" : (console.warn("[useAiApi] Chat error, falling back to mock:", e), Oe());
|
|
579
|
+
} finally {
|
|
580
|
+
t.value = !1;
|
|
581
|
+
}
|
|
582
|
+
},
|
|
583
|
+
generate: async (e, r) => {
|
|
584
|
+
let a = i();
|
|
585
|
+
if (!a.url) return {
|
|
586
|
+
success: !1,
|
|
587
|
+
message: "AI生成功能开发中,敬请期待..."
|
|
588
|
+
};
|
|
589
|
+
t.value = !0, n && n.abort(), n = new AbortController();
|
|
590
|
+
try {
|
|
591
|
+
let t = await ke(a, [{
|
|
592
|
+
role: "system",
|
|
593
|
+
content: a.generatePrompt || `你是一个专业的${r || "流程图"}生成助手。根据用户的描述,生成对应的JSON数据结构。只返回JSON,不要包含其他文字或markdown代码块标记。`
|
|
594
|
+
}, {
|
|
595
|
+
role: "user",
|
|
596
|
+
content: e
|
|
597
|
+
}], n.signal), i = null;
|
|
598
|
+
try {
|
|
599
|
+
let e = t.replace(/^```(?:json)?\s*/i, "").replace(/\s*```$/i, "").trim();
|
|
600
|
+
i = JSON.parse(e);
|
|
601
|
+
} catch {
|
|
602
|
+
i = null;
|
|
603
|
+
}
|
|
604
|
+
return {
|
|
605
|
+
success: !0,
|
|
606
|
+
content: t,
|
|
607
|
+
parsed: i
|
|
608
|
+
};
|
|
609
|
+
} catch (e) {
|
|
610
|
+
return e.name === "AbortError" ? {
|
|
611
|
+
success: !1,
|
|
612
|
+
message: "已取消"
|
|
613
|
+
} : (console.warn("[useAiApi] Generate error:", e), {
|
|
614
|
+
success: !1,
|
|
615
|
+
message: `AI生成失败: ${e.message}`
|
|
616
|
+
});
|
|
617
|
+
} finally {
|
|
618
|
+
t.value = !1;
|
|
619
|
+
}
|
|
620
|
+
},
|
|
621
|
+
abort: () => {
|
|
622
|
+
n &&= (n.abort(), null);
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
//#endregion
|
|
516
627
|
//#region ../../src/composables/useVersionHistory.js
|
|
517
|
-
var
|
|
628
|
+
var je = "/api/document-versions", Me = 5e3, Ne = () => {
|
|
518
629
|
let e = v([]), t = v(!1);
|
|
519
630
|
return {
|
|
520
631
|
versions: e,
|
|
@@ -522,13 +633,13 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
522
633
|
saveVersion: async ({ documentId: e, docType: t, content: n, userId: r, userName: i }) => {
|
|
523
634
|
if (!e || !t || !n) return null;
|
|
524
635
|
try {
|
|
525
|
-
let { data: a } = await
|
|
636
|
+
let { data: a } = await q.post(je, {
|
|
526
637
|
document_id: e,
|
|
527
638
|
doc_type: t,
|
|
528
639
|
content: typeof n == "string" ? n : JSON.stringify(n),
|
|
529
640
|
user_id: r || null,
|
|
530
641
|
user_name: i || null
|
|
531
|
-
}, { timeout:
|
|
642
|
+
}, { timeout: Me });
|
|
532
643
|
return a;
|
|
533
644
|
} catch (e) {
|
|
534
645
|
return console.warn("[useVersionHistory] Failed to save version:", e), null;
|
|
@@ -538,9 +649,9 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
538
649
|
if (!n) return [];
|
|
539
650
|
t.value = !0;
|
|
540
651
|
try {
|
|
541
|
-
let { data: t } = await
|
|
652
|
+
let { data: t } = await q.get(je, {
|
|
542
653
|
params: { document_id: n },
|
|
543
|
-
timeout:
|
|
654
|
+
timeout: Me
|
|
544
655
|
});
|
|
545
656
|
return e.value = t, t;
|
|
546
657
|
} catch (t) {
|
|
@@ -551,26 +662,26 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
551
662
|
},
|
|
552
663
|
getVersionContent: async (e) => {
|
|
553
664
|
try {
|
|
554
|
-
let { data: t } = await
|
|
665
|
+
let { data: t } = await q.get(`${je}/${e}`, { timeout: Me });
|
|
555
666
|
return t;
|
|
556
667
|
} catch (e) {
|
|
557
668
|
return console.warn("[useVersionHistory] Failed to get version content:", e), null;
|
|
558
669
|
}
|
|
559
670
|
}
|
|
560
671
|
};
|
|
561
|
-
},
|
|
672
|
+
}, Pe = { class: "version-history-panel" }, Fe = {
|
|
562
673
|
key: 0,
|
|
563
674
|
class: "loading-state"
|
|
564
|
-
},
|
|
675
|
+
}, Ie = {
|
|
565
676
|
key: 1,
|
|
566
677
|
class: "empty-state"
|
|
567
|
-
},
|
|
678
|
+
}, Le = {
|
|
568
679
|
key: 2,
|
|
569
680
|
class: "version-list"
|
|
570
|
-
},
|
|
681
|
+
}, Re = {
|
|
571
682
|
key: 0,
|
|
572
683
|
class: "current-version"
|
|
573
|
-
},
|
|
684
|
+
}, ze = { class: "current-version-header" }, Be = { class: "version-number" }, Ve = ["onClick"], He = { class: "version-number" }, Ue = { class: "version-user" }, We = { class: "panel-footer" }, Ge = /*#__PURE__*/ J({
|
|
574
685
|
__name: "VersionHistoryPanel",
|
|
575
686
|
props: {
|
|
576
687
|
modelValue: {
|
|
@@ -584,7 +695,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
584
695
|
},
|
|
585
696
|
emits: ["update:modelValue", "apply"],
|
|
586
697
|
setup(t, { expose: n, emit: l }) {
|
|
587
|
-
let u = t, d = l, { versions: p, loading: m, loadVersions: h, getVersionContent: _ } =
|
|
698
|
+
let u = t, d = l, { versions: p, loading: m, loadVersions: h, getVersionContent: _ } = Ne(), T = v(!1), E = v(null), D = v(!1), O = v(null);
|
|
588
699
|
C(() => u.modelValue, (e) => {
|
|
589
700
|
T.value = e, e && u.documentId && (E.value = null, h(u.documentId).then((e) => {
|
|
590
701
|
e && e.length > 0 && (O.value = e[0]);
|
|
@@ -621,7 +732,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
621
732
|
size: "420px",
|
|
622
733
|
"before-close": M
|
|
623
734
|
}, {
|
|
624
|
-
footer: w(() => [o("div",
|
|
735
|
+
footer: w(() => [o("div", We, [c(_, {
|
|
625
736
|
type: "primary",
|
|
626
737
|
disabled: !E.value,
|
|
627
738
|
loading: D.value,
|
|
@@ -630,22 +741,22 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
630
741
|
default: w(() => [...n[4] ||= [s(" 切换到此版本 ", -1)]]),
|
|
631
742
|
_: 1
|
|
632
743
|
}, 8, ["disabled", "loading"])])]),
|
|
633
|
-
default: w(() => [o("div",
|
|
634
|
-
default: w(() => [c(S(
|
|
744
|
+
default: w(() => [o("div", Pe, [S(m) ? (g(), a("div", Fe, [c(l, { class: "is-loading" }, {
|
|
745
|
+
default: w(() => [c(S(z))]),
|
|
635
746
|
_: 1
|
|
636
|
-
}), n[1] ||= o("span", null, "加载中...", -1)])) : S(p).length === 0 ? (g(), a("div",
|
|
747
|
+
}), n[1] ||= o("span", null, "加载中...", -1)])) : S(p).length === 0 ? (g(), a("div", Ie, [c(l, {
|
|
637
748
|
size: 48,
|
|
638
749
|
color: "#c0c4cc"
|
|
639
750
|
}, {
|
|
640
|
-
default: w(() => [c(S(
|
|
751
|
+
default: w(() => [c(S(P))]),
|
|
641
752
|
_: 1
|
|
642
|
-
}), n[2] ||= o("p", null, "暂无历史版本", -1)])) : (g(), a("div",
|
|
753
|
+
}), n[2] ||= o("p", null, "暂无历史版本", -1)])) : (g(), a("div", Le, [O.value ? (g(), a("div", Re, [o("div", ze, [c(u, {
|
|
643
754
|
type: "success",
|
|
644
755
|
size: "small"
|
|
645
756
|
}, {
|
|
646
757
|
default: w(() => [...n[3] ||= [s("当前版本", -1)]]),
|
|
647
758
|
_: 1
|
|
648
|
-
}), o("span",
|
|
759
|
+
}), o("span", Be, "v" + x(O.value.version_number), 1)])])) : i("", !0), c(h, null, {
|
|
649
760
|
default: w(() => [(g(!0), a(e, null, y(S(p), (e) => (g(), r(d, {
|
|
650
761
|
key: e.id,
|
|
651
762
|
timestamp: N(e.created_at),
|
|
@@ -656,7 +767,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
656
767
|
default: w(() => [o("div", {
|
|
657
768
|
class: f(["version-item", { active: E.value?.id === e.id }]),
|
|
658
769
|
onClick: (t) => k(e)
|
|
659
|
-
}, [o("span",
|
|
770
|
+
}, [o("span", He, "版本号:v" + x(e.version_number), 1), o("span", Ue, "提交人:" + x(e.user_name || "未知用户"), 1)], 10, Ve)]),
|
|
660
771
|
_: 2
|
|
661
772
|
}, 1032, [
|
|
662
773
|
"timestamp",
|
|
@@ -669,10 +780,10 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
669
780
|
}, 8, ["modelValue"]);
|
|
670
781
|
};
|
|
671
782
|
}
|
|
672
|
-
}, [["__scopeId", "data-v-87924b7c"]]),
|
|
783
|
+
}, [["__scopeId", "data-v-87924b7c"]]), Ke = { class: "toolbar" }, qe = { class: "toolbar-left" }, Je = { class: "toolbar-center" }, Ye = { class: "toolbar-right" }, Xe = {
|
|
673
784
|
key: 0,
|
|
674
785
|
class: "collab-users"
|
|
675
|
-
},
|
|
786
|
+
}, Ze = ["title"], Qe = /*#__PURE__*/ J({
|
|
676
787
|
__name: "Toolbar",
|
|
677
788
|
props: {
|
|
678
789
|
title: {
|
|
@@ -724,8 +835,8 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
724
835
|
let n = t, l = v(n.title);
|
|
725
836
|
return C(() => n.title, (e) => l.value = e), (n, u) => {
|
|
726
837
|
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");
|
|
727
|
-
return g(), a("div",
|
|
728
|
-
o("div",
|
|
838
|
+
return g(), a("div", Ke, [
|
|
839
|
+
o("div", qe, [t.showBackButton ? (g(), r(f, {
|
|
729
840
|
key: 0,
|
|
730
841
|
onClick: u[0] ||= (e) => n.$emit("back"),
|
|
731
842
|
size: "small",
|
|
@@ -745,7 +856,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
745
856
|
class: "title-input",
|
|
746
857
|
size: "small"
|
|
747
858
|
}, null, 8, ["modelValue", "disabled"])]),
|
|
748
|
-
o("div",
|
|
859
|
+
o("div", Je, [
|
|
749
860
|
c(v, {
|
|
750
861
|
trigger: "click",
|
|
751
862
|
onCommand: u[3] ||= (e) => n.$emit("add-component", e)
|
|
@@ -809,7 +920,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
809
920
|
onClick: u[4] ||= (e) => n.$emit("export-json")
|
|
810
921
|
}, {
|
|
811
922
|
default: w(() => [c(d, null, {
|
|
812
|
-
default: w(() => [c(S(
|
|
923
|
+
default: w(() => [c(S(I))]),
|
|
813
924
|
_: 1
|
|
814
925
|
})]),
|
|
815
926
|
_: 1
|
|
@@ -826,7 +937,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
826
937
|
onClick: u[5] ||= (e) => n.$emit("import-json")
|
|
827
938
|
}, {
|
|
828
939
|
default: w(() => [c(d, null, {
|
|
829
|
-
default: w(() => [c(S(
|
|
940
|
+
default: w(() => [c(S(G))]),
|
|
830
941
|
_: 1
|
|
831
942
|
})]),
|
|
832
943
|
_: 1
|
|
@@ -844,7 +955,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
844
955
|
title: "将选中零件组合为一个"
|
|
845
956
|
}, {
|
|
846
957
|
default: w(() => [c(d, null, {
|
|
847
|
-
default: w(() => [c(S(
|
|
958
|
+
default: w(() => [c(S(L))]),
|
|
848
959
|
_: 1
|
|
849
960
|
})]),
|
|
850
961
|
_: 1
|
|
@@ -863,7 +974,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
863
974
|
onClick: u[7] ||= (e) => n.$emit("toggle-connecting")
|
|
864
975
|
}, {
|
|
865
976
|
default: w(() => [c(d, null, {
|
|
866
|
-
default: w(() => [c(S(
|
|
977
|
+
default: w(() => [c(S(ne))]),
|
|
867
978
|
_: 1
|
|
868
979
|
})]),
|
|
869
980
|
_: 1
|
|
@@ -885,7 +996,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
885
996
|
disabled: !t.canUndo
|
|
886
997
|
}, {
|
|
887
998
|
default: w(() => [c(d, null, {
|
|
888
|
-
default: w(() => [c(S(
|
|
999
|
+
default: w(() => [c(S(H))]),
|
|
889
1000
|
_: 1
|
|
890
1001
|
})]),
|
|
891
1002
|
_: 1
|
|
@@ -897,7 +1008,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
897
1008
|
disabled: !t.canRedo
|
|
898
1009
|
}, {
|
|
899
1010
|
default: w(() => [c(d, null, {
|
|
900
|
-
default: w(() => [c(S(
|
|
1011
|
+
default: w(() => [c(S(U))]),
|
|
901
1012
|
_: 1
|
|
902
1013
|
})]),
|
|
903
1014
|
_: 1
|
|
@@ -909,7 +1020,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
909
1020
|
onClick: u[11] ||= (e) => n.$emit("zoom-in")
|
|
910
1021
|
}, {
|
|
911
1022
|
default: w(() => [c(d, null, {
|
|
912
|
-
default: w(() => [c(S(
|
|
1023
|
+
default: w(() => [c(S(K))]),
|
|
913
1024
|
_: 1
|
|
914
1025
|
})]),
|
|
915
1026
|
_: 1
|
|
@@ -920,19 +1031,19 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
920
1031
|
onClick: u[12] ||= (e) => n.$emit("zoom-out")
|
|
921
1032
|
}, {
|
|
922
1033
|
default: w(() => [c(d, null, {
|
|
923
|
-
default: w(() => [c(S(
|
|
1034
|
+
default: w(() => [c(S(ie))]),
|
|
924
1035
|
_: 1
|
|
925
1036
|
})]),
|
|
926
1037
|
_: 1
|
|
927
1038
|
})
|
|
928
1039
|
]),
|
|
929
|
-
o("div",
|
|
930
|
-
t.onlineUsers.length > 0 ? (g(), a("div",
|
|
1040
|
+
o("div", Ye, [
|
|
1041
|
+
t.onlineUsers.length > 0 ? (g(), a("div", Xe, [(g(!0), a(e, null, y(t.onlineUsers.slice(0, 5), (e) => (g(), a("div", {
|
|
931
1042
|
key: e.clientId,
|
|
932
1043
|
class: "collab-avatar",
|
|
933
1044
|
style: p({ background: e.color }),
|
|
934
1045
|
title: e.name
|
|
935
|
-
}, x(e.name?.charAt(0)), 13,
|
|
1046
|
+
}, x(e.name?.charAt(0)), 13, Ze))), 128))])) : i("", !0),
|
|
936
1047
|
t.isJoinMode ? i("", !0) : (g(), r(f, {
|
|
937
1048
|
key: 1,
|
|
938
1049
|
size: "small",
|
|
@@ -940,7 +1051,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
940
1051
|
onClick: u[13] ||= (e) => n.$emit("toggle-collab")
|
|
941
1052
|
}, {
|
|
942
1053
|
default: w(() => [c(d, null, {
|
|
943
|
-
default: w(() => [c(S(
|
|
1054
|
+
default: w(() => [c(S(W))]),
|
|
944
1055
|
_: 1
|
|
945
1056
|
}), o("span", null, x(t.isConnected ? "协作中" : "协作"), 1)]),
|
|
946
1057
|
_: 1
|
|
@@ -953,7 +1064,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
953
1064
|
title: "分享链接"
|
|
954
1065
|
}, {
|
|
955
1066
|
default: w(() => [c(d, null, {
|
|
956
|
-
default: w(() => [c(S(
|
|
1067
|
+
default: w(() => [c(S(R))]),
|
|
957
1068
|
_: 1
|
|
958
1069
|
})]),
|
|
959
1070
|
_: 1
|
|
@@ -998,7 +1109,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
998
1109
|
onClick: u[16] ||= (e) => n.$emit("save")
|
|
999
1110
|
}, {
|
|
1000
1111
|
default: w(() => [c(d, null, {
|
|
1001
|
-
default: w(() => [c(S(
|
|
1112
|
+
default: w(() => [c(S(I))]),
|
|
1002
1113
|
_: 1
|
|
1003
1114
|
})]),
|
|
1004
1115
|
_: 1
|
|
@@ -1011,7 +1122,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1011
1122
|
onClick: u[17] ||= (e) => n.$emit("history")
|
|
1012
1123
|
}, {
|
|
1013
1124
|
default: w(() => [c(d, null, {
|
|
1014
|
-
default: w(() => [c(S(
|
|
1125
|
+
default: w(() => [c(S(P))]),
|
|
1015
1126
|
_: 1
|
|
1016
1127
|
})]),
|
|
1017
1128
|
_: 1
|
|
@@ -1020,38 +1131,38 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1020
1131
|
]);
|
|
1021
1132
|
};
|
|
1022
1133
|
}
|
|
1023
|
-
}, [["__scopeId", "data-v-5c549dd2"]]),
|
|
1134
|
+
}, [["__scopeId", "data-v-5c549dd2"]]), $e = ["viewBox"], et = ["id"], tt = [
|
|
1024
1135
|
"x",
|
|
1025
1136
|
"y",
|
|
1026
1137
|
"width",
|
|
1027
1138
|
"height"
|
|
1028
|
-
],
|
|
1139
|
+
], nt = [
|
|
1029
1140
|
"transform",
|
|
1030
1141
|
"onMousedown",
|
|
1031
1142
|
"onDblclick",
|
|
1032
1143
|
"onMouseenter"
|
|
1033
|
-
],
|
|
1144
|
+
], rt = [
|
|
1034
1145
|
"href",
|
|
1035
1146
|
"width",
|
|
1036
1147
|
"height"
|
|
1037
|
-
],
|
|
1148
|
+
], it = ["innerHTML", "transform"], at = [
|
|
1038
1149
|
"points",
|
|
1039
1150
|
"fill",
|
|
1040
1151
|
"stroke",
|
|
1041
1152
|
"stroke-width"
|
|
1042
|
-
],
|
|
1153
|
+
], ot = [
|
|
1043
1154
|
"width",
|
|
1044
1155
|
"height",
|
|
1045
1156
|
"fill",
|
|
1046
1157
|
"stroke",
|
|
1047
1158
|
"stroke-width"
|
|
1048
|
-
],
|
|
1159
|
+
], st = [
|
|
1049
1160
|
"width",
|
|
1050
1161
|
"height",
|
|
1051
1162
|
"fill",
|
|
1052
1163
|
"stroke",
|
|
1053
1164
|
"stroke-width"
|
|
1054
|
-
],
|
|
1165
|
+
], ct = [
|
|
1055
1166
|
"cx",
|
|
1056
1167
|
"cy",
|
|
1057
1168
|
"rx",
|
|
@@ -1059,67 +1170,67 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1059
1170
|
"fill",
|
|
1060
1171
|
"stroke",
|
|
1061
1172
|
"stroke-width"
|
|
1062
|
-
],
|
|
1173
|
+
], lt = [
|
|
1063
1174
|
"points",
|
|
1064
1175
|
"fill",
|
|
1065
1176
|
"stroke",
|
|
1066
1177
|
"stroke-width"
|
|
1067
|
-
],
|
|
1178
|
+
], ut = [
|
|
1068
1179
|
"points",
|
|
1069
1180
|
"fill",
|
|
1070
1181
|
"stroke",
|
|
1071
1182
|
"stroke-width"
|
|
1072
|
-
],
|
|
1183
|
+
], dt = [
|
|
1073
1184
|
"width",
|
|
1074
1185
|
"height",
|
|
1075
1186
|
"stroke",
|
|
1076
1187
|
"stroke-width"
|
|
1077
|
-
],
|
|
1188
|
+
], ft = [
|
|
1078
1189
|
"x",
|
|
1079
1190
|
"y",
|
|
1080
1191
|
"fill",
|
|
1081
1192
|
"font-size"
|
|
1082
|
-
],
|
|
1193
|
+
], pt = ["x", "y"], mt = [
|
|
1083
1194
|
"x",
|
|
1084
1195
|
"y",
|
|
1085
1196
|
"fill",
|
|
1086
1197
|
"font-size"
|
|
1087
|
-
],
|
|
1198
|
+
], ht = [
|
|
1088
1199
|
"x",
|
|
1089
1200
|
"y",
|
|
1090
1201
|
"fill",
|
|
1091
1202
|
"font-size"
|
|
1092
|
-
],
|
|
1203
|
+
], gt = ["x", "y"], _t = { key: 12 }, vt = [
|
|
1093
1204
|
"x",
|
|
1094
1205
|
"y",
|
|
1095
1206
|
"onMousedown"
|
|
1096
|
-
],
|
|
1207
|
+
], yt = ["y", "onMousedown"], bt = ["x", "onMousedown"], xt = ["onMousedown"], St = { key: 13 }, Ct = [
|
|
1097
1208
|
"cx",
|
|
1098
1209
|
"cy",
|
|
1099
1210
|
"onMousedown"
|
|
1100
|
-
],
|
|
1211
|
+
], wt = ["x", "y"], Tt = [
|
|
1101
1212
|
"d",
|
|
1102
1213
|
"stroke",
|
|
1103
1214
|
"stroke-width",
|
|
1104
1215
|
"stroke-dasharray",
|
|
1105
1216
|
"onMousedown"
|
|
1106
|
-
],
|
|
1217
|
+
], Et = ["x", "y"], Dt = [
|
|
1107
1218
|
"x1",
|
|
1108
1219
|
"y1",
|
|
1109
1220
|
"x2",
|
|
1110
1221
|
"y2"
|
|
1111
|
-
],
|
|
1222
|
+
], Ot = { key: 1 }, kt = [
|
|
1112
1223
|
"cx",
|
|
1113
1224
|
"cy",
|
|
1114
1225
|
"onMousedown"
|
|
1115
|
-
],
|
|
1226
|
+
], At = [
|
|
1116
1227
|
"href",
|
|
1117
1228
|
"x",
|
|
1118
1229
|
"y",
|
|
1119
1230
|
"width",
|
|
1120
1231
|
"height",
|
|
1121
1232
|
"clip-path"
|
|
1122
|
-
],
|
|
1233
|
+
], jt = { class: "popup-tooltip-key" }, Mt = { class: "popup-tooltip-val" }, Nt = /*#__PURE__*/ J({
|
|
1123
1234
|
__name: "DiagramCanvas",
|
|
1124
1235
|
props: {
|
|
1125
1236
|
components: {
|
|
@@ -1286,7 +1397,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1286
1397
|
width: e.width,
|
|
1287
1398
|
height: e.height,
|
|
1288
1399
|
rx: "4"
|
|
1289
|
-
}, null, 8,
|
|
1400
|
+
}, null, 8, tt)], 8, et))), 128))]),
|
|
1290
1401
|
(g(!0), a(e, null, y(m.value, (s) => (g(), a("g", {
|
|
1291
1402
|
key: s.id,
|
|
1292
1403
|
transform: `translate(${s.x}, ${s.y})`,
|
|
@@ -1303,19 +1414,19 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1303
1414
|
height: s.height,
|
|
1304
1415
|
preserveAspectRatio: "xMidYMid meet",
|
|
1305
1416
|
style: p({ pointerEvents: b(s) ? "none" : "all" })
|
|
1306
|
-
}, null, 12,
|
|
1417
|
+
}, null, 12, rt)) : s.shape === "svg" ? (g(), a("g", {
|
|
1307
1418
|
key: 1,
|
|
1308
1419
|
innerHTML: s.svgContent || "",
|
|
1309
1420
|
transform: `scale(${s.width / (s.svgWidth || 100)}, ${s.height / (s.svgHeight || 100)})`,
|
|
1310
1421
|
style: p({ pointerEvents: b(s) ? "none" : "all" })
|
|
1311
|
-
}, null, 12,
|
|
1422
|
+
}, null, 12, it)) : s.shape === "polygon" ? (g(), a("polygon", {
|
|
1312
1423
|
key: 2,
|
|
1313
1424
|
points: s.points || "",
|
|
1314
1425
|
fill: s.fill || "#fff",
|
|
1315
1426
|
stroke: t.selectedIds.includes(s.id) ? "#409EFF" : s.stroke || "#ccc",
|
|
1316
1427
|
"stroke-width": t.selectedIds.includes(s.id) ? 2 : 1,
|
|
1317
1428
|
style: p({ pointerEvents: b(s) ? "none" : "all" })
|
|
1318
|
-
}, null, 12,
|
|
1429
|
+
}, null, 12, at)) : s.shape === "group" && s.id !== t.expandedGroupId ? (g(), a("rect", {
|
|
1319
1430
|
key: 3,
|
|
1320
1431
|
width: s.width,
|
|
1321
1432
|
height: s.height,
|
|
@@ -1324,7 +1435,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1324
1435
|
"stroke-dasharray": "6,3",
|
|
1325
1436
|
"stroke-width": t.selectedIds.includes(s.id) ? 2 : 1,
|
|
1326
1437
|
style: { "pointer-events": "all" }
|
|
1327
|
-
}, null, 8,
|
|
1438
|
+
}, null, 8, ot)) : s.shape === "rect" ? (g(), a("rect", {
|
|
1328
1439
|
key: 4,
|
|
1329
1440
|
width: s.width,
|
|
1330
1441
|
height: s.height,
|
|
@@ -1333,7 +1444,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1333
1444
|
stroke: t.selectedIds.includes(s.id) ? "#409EFF" : s.stroke || "#ccc",
|
|
1334
1445
|
"stroke-width": t.selectedIds.includes(s.id) ? 2 : 1,
|
|
1335
1446
|
style: p({ pointerEvents: b(s) ? "none" : "all" })
|
|
1336
|
-
}, null, 12,
|
|
1447
|
+
}, null, 12, st)) : s.shape === "circle" ? (g(), a("ellipse", {
|
|
1337
1448
|
key: 5,
|
|
1338
1449
|
cx: s.width / 2,
|
|
1339
1450
|
cy: s.height / 2,
|
|
@@ -1343,21 +1454,21 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1343
1454
|
stroke: t.selectedIds.includes(s.id) ? "#409EFF" : s.stroke || "#ccc",
|
|
1344
1455
|
"stroke-width": t.selectedIds.includes(s.id) ? 2 : 1,
|
|
1345
1456
|
style: p({ pointerEvents: b(s) ? "none" : "all" })
|
|
1346
|
-
}, null, 12,
|
|
1457
|
+
}, null, 12, ct)) : s.shape === "diamond" ? (g(), a("polygon", {
|
|
1347
1458
|
key: 6,
|
|
1348
1459
|
points: `${s.width / 2},0 ${s.width},${s.height / 2} ${s.width / 2},${s.height} 0,${s.height / 2}`,
|
|
1349
1460
|
fill: s.fill || "#fff",
|
|
1350
1461
|
stroke: t.selectedIds.includes(s.id) ? "#409EFF" : s.stroke || "#ccc",
|
|
1351
1462
|
"stroke-width": t.selectedIds.includes(s.id) ? 2 : 1,
|
|
1352
1463
|
style: p({ pointerEvents: b(s) ? "none" : "all" })
|
|
1353
|
-
}, null, 12,
|
|
1464
|
+
}, null, 12, lt)) : s.shape === "triangle" ? (g(), a("polygon", {
|
|
1354
1465
|
key: 7,
|
|
1355
1466
|
points: `${s.width / 2},0 ${s.width},${s.height} 0,${s.height}`,
|
|
1356
1467
|
fill: s.fill || "#fff",
|
|
1357
1468
|
stroke: t.selectedIds.includes(s.id) ? "#409EFF" : s.stroke || "#ccc",
|
|
1358
1469
|
"stroke-width": t.selectedIds.includes(s.id) ? 2 : 1,
|
|
1359
1470
|
style: p({ pointerEvents: b(s) ? "none" : "all" })
|
|
1360
|
-
}, null, 12,
|
|
1471
|
+
}, null, 12, ut)) : (g(), a("rect", {
|
|
1361
1472
|
key: 8,
|
|
1362
1473
|
width: s.width,
|
|
1363
1474
|
height: s.height,
|
|
@@ -1365,7 +1476,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1365
1476
|
stroke: t.selectedIds.includes(s.id) ? "#409EFF" : "#ccc",
|
|
1366
1477
|
"stroke-width": t.selectedIds.includes(s.id) ? 2 : 1,
|
|
1367
1478
|
style: p({ pointerEvents: b(s) ? "none" : "all" })
|
|
1368
|
-
}, null, 12,
|
|
1479
|
+
}, null, 12, dt)),
|
|
1369
1480
|
s.shape === "image" ? (g(), a(e, { key: 9 }, [o("text", {
|
|
1370
1481
|
x: s.width / 2,
|
|
1371
1482
|
y: s.height + 10,
|
|
@@ -1374,7 +1485,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1374
1485
|
fill: s.textColor || "#333",
|
|
1375
1486
|
"font-size": s.fontSize || 14,
|
|
1376
1487
|
style: { "pointer-events": "none" }
|
|
1377
|
-
}, x(s.label), 9,
|
|
1488
|
+
}, x(s.label), 9, ft), s.description ? (g(), a("text", {
|
|
1378
1489
|
key: 0,
|
|
1379
1490
|
x: s.width / 2,
|
|
1380
1491
|
y: s.height + 10 + (s.fontSize || 14) + 2,
|
|
@@ -1383,7 +1494,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1383
1494
|
fill: "#999",
|
|
1384
1495
|
"font-size": "11",
|
|
1385
1496
|
style: { "pointer-events": "none" }
|
|
1386
|
-
}, x(s.description), 9,
|
|
1497
|
+
}, x(s.description), 9, pt)) : i("", !0)], 64)) : s.shape === "group" && s.id !== t.expandedGroupId ? (g(), a("text", {
|
|
1387
1498
|
key: 10,
|
|
1388
1499
|
x: s.width / 2,
|
|
1389
1500
|
y: s.height + 10,
|
|
@@ -1392,7 +1503,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1392
1503
|
fill: s.textColor || "#333",
|
|
1393
1504
|
"font-size": s.fontSize || 14,
|
|
1394
1505
|
style: { "pointer-events": "none" }
|
|
1395
|
-
}, x(s.label), 9,
|
|
1506
|
+
}, x(s.label), 9, mt)) : s.shape === "group" ? i("", !0) : (g(), a(e, { key: 11 }, [o("text", {
|
|
1396
1507
|
x: s.width / 2,
|
|
1397
1508
|
y: s.height / 2 - (s.description ? 6 : 0),
|
|
1398
1509
|
"text-anchor": "middle",
|
|
@@ -1400,7 +1511,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1400
1511
|
fill: s.textColor || "#333",
|
|
1401
1512
|
"font-size": s.fontSize || 14,
|
|
1402
1513
|
style: { "pointer-events": "none" }
|
|
1403
|
-
}, x(s.label), 9,
|
|
1514
|
+
}, x(s.label), 9, ht), s.description ? (g(), a("text", {
|
|
1404
1515
|
key: 0,
|
|
1405
1516
|
x: s.width / 2,
|
|
1406
1517
|
y: s.height / 2 + 12,
|
|
@@ -1409,8 +1520,8 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1409
1520
|
fill: "#999",
|
|
1410
1521
|
"font-size": "11",
|
|
1411
1522
|
style: { "pointer-events": "none" }
|
|
1412
|
-
}, x(s.description), 9,
|
|
1413
|
-
t.selectedIds.includes(s.id) && !b(s) ? (g(), a("g",
|
|
1523
|
+
}, x(s.description), 9, gt)) : i("", !0)], 64)),
|
|
1524
|
+
t.selectedIds.includes(s.id) && !b(s) ? (g(), a("g", _t, [
|
|
1414
1525
|
o("rect", {
|
|
1415
1526
|
x: s.width - 5,
|
|
1416
1527
|
y: s.height - 5,
|
|
@@ -1421,7 +1532,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1421
1532
|
"stroke-width": "1",
|
|
1422
1533
|
style: { cursor: "nwse-resize" },
|
|
1423
1534
|
onMousedown: E((e) => n.$emit("start-resize", s, "se", e), ["stop"])
|
|
1424
|
-
}, null, 40,
|
|
1535
|
+
}, null, 40, vt),
|
|
1425
1536
|
o("rect", {
|
|
1426
1537
|
x: -5,
|
|
1427
1538
|
y: s.height - 5,
|
|
@@ -1432,7 +1543,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1432
1543
|
"stroke-width": "1",
|
|
1433
1544
|
style: { cursor: "nesw-resize" },
|
|
1434
1545
|
onMousedown: E((e) => n.$emit("start-resize", s, "sw", e), ["stop"])
|
|
1435
|
-
}, null, 40,
|
|
1546
|
+
}, null, 40, yt),
|
|
1436
1547
|
o("rect", {
|
|
1437
1548
|
x: s.width - 5,
|
|
1438
1549
|
y: -5,
|
|
@@ -1443,7 +1554,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1443
1554
|
"stroke-width": "1",
|
|
1444
1555
|
style: { cursor: "nesw-resize" },
|
|
1445
1556
|
onMousedown: E((e) => n.$emit("start-resize", s, "ne", e), ["stop"])
|
|
1446
|
-
}, null, 40,
|
|
1557
|
+
}, null, 40, bt),
|
|
1447
1558
|
o("rect", {
|
|
1448
1559
|
x: -5,
|
|
1449
1560
|
y: -5,
|
|
@@ -1454,9 +1565,9 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1454
1565
|
"stroke-width": "1",
|
|
1455
1566
|
style: { cursor: "nwse-resize" },
|
|
1456
1567
|
onMousedown: E((e) => n.$emit("start-resize", s, "nw", e), ["stop"])
|
|
1457
|
-
}, null, 40,
|
|
1568
|
+
}, null, 40, xt)
|
|
1458
1569
|
])) : i("", !0),
|
|
1459
|
-
(t.selectedIds.includes(s.id) || t.connectingMode) && !b(s) && !(t.editingPolygon && t.editingPolygon.id === s.id) ? (g(), a("g",
|
|
1570
|
+
(t.selectedIds.includes(s.id) || t.connectingMode) && !b(s) && !(t.editingPolygon && t.editingPolygon.id === s.id) ? (g(), a("g", St, [(g(!0), a(e, null, y(w(s), (e, t) => (g(), a("circle", {
|
|
1460
1571
|
key: t,
|
|
1461
1572
|
cx: e.x,
|
|
1462
1573
|
cy: e.y,
|
|
@@ -1466,7 +1577,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1466
1577
|
"stroke-width": "1",
|
|
1467
1578
|
style: { cursor: "crosshair" },
|
|
1468
1579
|
onMousedown: E((t) => n.$emit("start-connect", s, e, t), ["stop"])
|
|
1469
|
-
}, null, 40,
|
|
1580
|
+
}, null, 40, Ct))), 128))])) : i("", !0),
|
|
1470
1581
|
t.editingPolygon && t.editingPolygon.id === s.id ? (g(), a("text", {
|
|
1471
1582
|
key: 14,
|
|
1472
1583
|
x: s.width / 2,
|
|
@@ -1475,8 +1586,8 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1475
1586
|
fill: "#409EFF",
|
|
1476
1587
|
"font-size": "11",
|
|
1477
1588
|
style: { "pointer-events": "none" }
|
|
1478
|
-
}, "双击退出编辑", 8,
|
|
1479
|
-
], 44,
|
|
1589
|
+
}, "双击退出编辑", 8, wt)) : i("", !0)
|
|
1590
|
+
], 44, nt))), 128)),
|
|
1480
1591
|
(g(!0), a(e, null, y(t.connections, (e) => (g(), a("g", {
|
|
1481
1592
|
key: e.id,
|
|
1482
1593
|
style: p(S(e) ? "pointer-events:none;opacity:0.5;" : "")
|
|
@@ -1490,14 +1601,14 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1490
1601
|
"pointer-events": "stroke",
|
|
1491
1602
|
style: { cursor: "pointer" },
|
|
1492
1603
|
onMousedown: E((t) => n.$emit("select", e, "connection", t), ["stop"])
|
|
1493
|
-
}, null, 40,
|
|
1604
|
+
}, null, 40, Tt), e.label ? (g(), a("text", {
|
|
1494
1605
|
key: 0,
|
|
1495
1606
|
x: D(e).x,
|
|
1496
1607
|
y: D(e).y - 6,
|
|
1497
1608
|
"text-anchor": "middle",
|
|
1498
1609
|
fill: "#666",
|
|
1499
1610
|
"font-size": "12"
|
|
1500
|
-
}, x(e.label), 9,
|
|
1611
|
+
}, x(e.label), 9, Et)) : i("", !0)], 4))), 128)),
|
|
1501
1612
|
t.drawingConn ? (g(), a("line", {
|
|
1502
1613
|
key: 0,
|
|
1503
1614
|
x1: t.drawingConn.x1,
|
|
@@ -1507,8 +1618,8 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1507
1618
|
stroke: "#409EFF",
|
|
1508
1619
|
"stroke-width": "2",
|
|
1509
1620
|
"stroke-dasharray": "4,4"
|
|
1510
|
-
}, null, 8,
|
|
1511
|
-
t.editingPolygon ? (g(), a("g",
|
|
1621
|
+
}, null, 8, Dt)) : i("", !0),
|
|
1622
|
+
t.editingPolygon ? (g(), a("g", Ot, [(g(!0), a(e, null, y(C.value, (e, n) => (g(), a("circle", {
|
|
1512
1623
|
key: "pv-" + n,
|
|
1513
1624
|
cx: t.editingPolygon.x + e.x,
|
|
1514
1625
|
cy: t.editingPolygon.y + e.y,
|
|
@@ -1518,7 +1629,7 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1518
1629
|
"stroke-width": "1.5",
|
|
1519
1630
|
style: { cursor: "move" },
|
|
1520
1631
|
onMousedown: E((e) => j(t.editingPolygon, n, e), ["stop"])
|
|
1521
|
-
}, null, 40,
|
|
1632
|
+
}, null, 40, kt))), 128))])) : i("", !0),
|
|
1522
1633
|
(g(!0), a(e, null, y(m.value, (e) => (g(), a("g", { key: "img-" + e.id }, [e.shape === "group" && e.imageUrl && e.id !== t.expandedGroupId ? (g(), a("image", {
|
|
1523
1634
|
key: 0,
|
|
1524
1635
|
href: e.imageUrl,
|
|
@@ -1529,8 +1640,8 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1529
1640
|
preserveAspectRatio: "xMidYMid slice",
|
|
1530
1641
|
"clip-path": `url(#clip-${e.id})`,
|
|
1531
1642
|
style: { "pointer-events": "none" }
|
|
1532
|
-
}, null, 8,
|
|
1533
|
-
], 40,
|
|
1643
|
+
}, null, 8, At)) : i("", !0)]))), 128))
|
|
1644
|
+
], 40, $e)), d.value && d.value.popupConfig && d.value.popupConfig.length ? (g(), a("div", {
|
|
1534
1645
|
key: 0,
|
|
1535
1646
|
class: "popup-tooltip",
|
|
1536
1647
|
style: p({
|
|
@@ -1540,13 +1651,13 @@ var De = "/api/document-versions", Oe = 5e3, ke = () => {
|
|
|
1540
1651
|
}, [(g(!0), a(e, null, y(d.value.popupConfig, (e, t) => (g(), a("div", {
|
|
1541
1652
|
key: t,
|
|
1542
1653
|
class: "popup-tooltip-row"
|
|
1543
|
-
}, [o("span",
|
|
1654
|
+
}, [o("span", jt, x(e.key) + ":", 1), o("span", Mt, x(e.value), 1)]))), 128))], 4)) : i("", !0)], 512));
|
|
1544
1655
|
}
|
|
1545
1656
|
}, [["__scopeId", "data-v-f89f4797"]]);
|
|
1546
1657
|
//#endregion
|
|
1547
1658
|
//#region ../../src/composables/useExplosionCollaboration.js
|
|
1548
|
-
function
|
|
1549
|
-
let r = new
|
|
1659
|
+
function Pt(e, { roomPrefix: t, syncKey: n = "_data" } = {}) {
|
|
1660
|
+
let r = new ae.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 = () => {
|
|
1550
1661
|
b(), m = setInterval(() => {
|
|
1551
1662
|
if (l && l.connection && l.connection.ws && l.connection.ws.readyState === WebSocket.CLOSED) try {
|
|
1552
1663
|
l.connect();
|
|
@@ -1557,7 +1668,7 @@ function At(e, { roomPrefix: t, syncKey: n = "_data" } = {}) {
|
|
|
1557
1668
|
}, b = () => {
|
|
1558
1669
|
m &&= (clearInterval(m), null);
|
|
1559
1670
|
};
|
|
1560
|
-
l = new
|
|
1671
|
+
l = new oe({
|
|
1561
1672
|
url: g,
|
|
1562
1673
|
name: _,
|
|
1563
1674
|
document: r,
|
|
@@ -1660,8 +1771,8 @@ function At(e, { roomPrefix: t, syncKey: n = "_data" } = {}) {
|
|
|
1660
1771
|
}
|
|
1661
1772
|
//#endregion
|
|
1662
1773
|
//#region ../../src/composables/useExplosionDiagramCollaboration.js
|
|
1663
|
-
var
|
|
1664
|
-
let n =
|
|
1774
|
+
var Ft = (e, { onRemoteChange: t } = {}) => {
|
|
1775
|
+
let n = Pt(e, {
|
|
1665
1776
|
roomPrefix: "explosion-diagram",
|
|
1666
1777
|
syncKey: "_data"
|
|
1667
1778
|
});
|
|
@@ -1689,20 +1800,20 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1689
1800
|
pushToYjs: r,
|
|
1690
1801
|
pullFromYjs: i
|
|
1691
1802
|
};
|
|
1692
|
-
},
|
|
1803
|
+
}, It = { class: "explosion-diagram-editor" }, Lt = {
|
|
1693
1804
|
key: 0,
|
|
1694
1805
|
class: "group-breadcrumb"
|
|
1695
|
-
},
|
|
1806
|
+
}, Rt = { class: "editor-body" }, zt = {
|
|
1696
1807
|
key: 0,
|
|
1697
1808
|
class: "props-panel"
|
|
1698
|
-
},
|
|
1809
|
+
}, Bt = { class: "prop-row" }, Vt = { class: "prop-row" }, Ht = { class: "prop-row" }, Ut = { class: "prop-row" }, Wt = { class: "prop-row" }, Gt = {
|
|
1699
1810
|
key: 0,
|
|
1700
1811
|
class: "group-image-preview"
|
|
1701
|
-
},
|
|
1812
|
+
}, Kt = ["src"], qt = { class: "prop-row" }, Jt = { class: "prop-row" }, Yt = { class: "prop-row" }, Xt = { class: "prop-row" }, Zt = { class: "prop-row" }, Qt = { class: "prop-row" }, $t = { class: "prop-row" }, en = { class: "prop-row" }, tn = { class: "prop-row" }, nn = { style: {
|
|
1702
1813
|
"margin-bottom": "8px",
|
|
1703
1814
|
display: "flex",
|
|
1704
1815
|
gap: "8px"
|
|
1705
|
-
} },
|
|
1816
|
+
} }, rn = "explosion-diagram", an = /*#__PURE__*/ J({
|
|
1706
1817
|
__name: "ExplosionDiagramEditor",
|
|
1707
1818
|
props: {
|
|
1708
1819
|
docId: {
|
|
@@ -1732,6 +1843,10 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1732
1843
|
uiConfig: {
|
|
1733
1844
|
type: Object,
|
|
1734
1845
|
default: () => ({})
|
|
1846
|
+
},
|
|
1847
|
+
aiApi: {
|
|
1848
|
+
type: [String, Object],
|
|
1849
|
+
default: null
|
|
1735
1850
|
}
|
|
1736
1851
|
},
|
|
1737
1852
|
setup(l) {
|
|
@@ -1740,11 +1855,11 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1740
1855
|
titleEditable: !0,
|
|
1741
1856
|
authorEditable: !0,
|
|
1742
1857
|
...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 } =
|
|
1858
|
+
})), f = n(() => u.docId ?? p.params.id), p = O(), C = k(), T = v(u.docId ?? null), E = v(!1), D = v(!1), { saveVersion: M } = Ne(), N = Ee(), te = Ae(() => u.aiApi), P = _({
|
|
1744
1859
|
title: "爆炸图",
|
|
1745
1860
|
components: [],
|
|
1746
1861
|
connections: []
|
|
1747
|
-
}), F = v(!1),
|
|
1862
|
+
}), F = v(!1), ne = v(!1), re = v(!1), I = null, L = v([]), R = v(-1), z = v(null), B = v([]), V = v(null), H = v(null), U = v(!1), W = v(null), G = v(null), K = v([]), ie = v(null), ae = v(null), oe = v(!1), J = v(null), Y = v([]), X = n(() => K.value.length ? K.value[K.value.length - 1] : null), se = n(() => {
|
|
1748
1863
|
if (!X.value) return P.components;
|
|
1749
1864
|
let e = (t) => {
|
|
1750
1865
|
let n = /* @__PURE__ */ new Set([t]);
|
|
@@ -1753,40 +1868,40 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1753
1868
|
}), n;
|
|
1754
1869
|
}, t = e(X.value);
|
|
1755
1870
|
return P.components.filter((e) => t.has(e.id));
|
|
1756
|
-
}),
|
|
1871
|
+
}), ce = n(() => {
|
|
1757
1872
|
if (!X.value) return P.connections;
|
|
1758
|
-
let e = new Set(
|
|
1873
|
+
let e = new Set(se.value.map((e) => e.id));
|
|
1759
1874
|
return P.connections.filter((t) => e.has(t.fromId) || e.has(t.toId));
|
|
1760
|
-
}),
|
|
1875
|
+
}), le = n(() => {
|
|
1761
1876
|
if (!X.value) return "0 0 2000 1500";
|
|
1762
1877
|
let e = P.components.find((e) => e.id === X.value);
|
|
1763
1878
|
if (!e) return "0 0 2000 1500";
|
|
1764
|
-
let t =
|
|
1879
|
+
let t = se.value.filter((e) => e.id !== X.value);
|
|
1765
1880
|
if (!t.length) return `${e.x} ${e.y} ${e.width} ${e.height}`;
|
|
1766
1881
|
let n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
|
|
1767
1882
|
return t.forEach((e) => {
|
|
1768
1883
|
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);
|
|
1769
1884
|
}), `${n - 40} ${r - 40} ${i - n + 80} ${a - r + 80}`;
|
|
1770
|
-
}),
|
|
1771
|
-
|
|
1885
|
+
}), ue = (e) => P.components.find((t) => t.id === e), Z = () => {
|
|
1886
|
+
L.value = L.value.slice(0, R.value + 1), L.value.push(JSON.stringify({
|
|
1772
1887
|
components: P.components,
|
|
1773
1888
|
connections: P.connections
|
|
1774
|
-
})),
|
|
1775
|
-
}, ue = () => {
|
|
1776
|
-
F.value && L && L.pushToYjs(P);
|
|
1889
|
+
})), R.value = L.value.length - 1, de();
|
|
1777
1890
|
}, de = () => {
|
|
1778
|
-
|
|
1779
|
-
z.value--;
|
|
1780
|
-
let e = JSON.parse(R.value[z.value]);
|
|
1781
|
-
P.components = e.components, P.connections = e.connections, ue();
|
|
1782
|
-
}
|
|
1891
|
+
F.value && I && I.pushToYjs(P);
|
|
1783
1892
|
}, fe = () => {
|
|
1784
|
-
if (
|
|
1785
|
-
|
|
1786
|
-
let e = JSON.parse(
|
|
1787
|
-
P.components = e.components, P.connections = e.connections,
|
|
1893
|
+
if (R.value > 0) {
|
|
1894
|
+
R.value--;
|
|
1895
|
+
let e = JSON.parse(L.value[R.value]);
|
|
1896
|
+
P.components = e.components, P.connections = e.connections, de();
|
|
1897
|
+
}
|
|
1898
|
+
}, pe = () => {
|
|
1899
|
+
if (R.value < L.value.length - 1) {
|
|
1900
|
+
R.value++;
|
|
1901
|
+
let e = JSON.parse(L.value[R.value]);
|
|
1902
|
+
P.components = e.components, P.connections = e.connections, de();
|
|
1788
1903
|
}
|
|
1789
|
-
},
|
|
1904
|
+
}, me = () => {}, he = () => {}, ge = 0, Q = () => `comp-${++ge}-${Date.now()}`, _e = {
|
|
1790
1905
|
rect: [140, 60],
|
|
1791
1906
|
circle: [80, 80],
|
|
1792
1907
|
diamond: [100, 80],
|
|
@@ -1796,13 +1911,13 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1796
1911
|
polygon: [150, 120],
|
|
1797
1912
|
svg: [120, 120],
|
|
1798
1913
|
group: [200, 150]
|
|
1799
|
-
},
|
|
1914
|
+
}, ve = v(null), ye = v(null), be = null, xe = (e) => {
|
|
1800
1915
|
if (e === "image") {
|
|
1801
|
-
|
|
1916
|
+
be = "image", ve.value?.click();
|
|
1802
1917
|
return;
|
|
1803
1918
|
}
|
|
1804
1919
|
if (e === "svg") {
|
|
1805
|
-
|
|
1920
|
+
be = "svg", ye.value?.click();
|
|
1806
1921
|
return;
|
|
1807
1922
|
}
|
|
1808
1923
|
if (e === "polygon") {
|
|
@@ -1843,7 +1958,7 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1843
1958
|
X.value && (e.groupId = X.value), P.components.push(e), Z();
|
|
1844
1959
|
return;
|
|
1845
1960
|
}
|
|
1846
|
-
let [t, n] =
|
|
1961
|
+
let [t, n] = _e[e] || [120, 60], r = {
|
|
1847
1962
|
id: Q(),
|
|
1848
1963
|
shape: e,
|
|
1849
1964
|
label: `${P.components.length + 1}`,
|
|
@@ -1858,14 +1973,14 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1858
1973
|
fontSize: 14
|
|
1859
1974
|
};
|
|
1860
1975
|
X.value && (r.groupId = X.value), P.components.push(r), Z();
|
|
1861
|
-
},
|
|
1976
|
+
}, Se = async (e) => {
|
|
1862
1977
|
let t = e.target.files?.[0];
|
|
1863
1978
|
if (!t) return;
|
|
1864
1979
|
let n = new FormData();
|
|
1865
|
-
n.append("file", t),
|
|
1980
|
+
n.append("file", t), be === "image" && n.append("remove_bg", "true");
|
|
1866
1981
|
try {
|
|
1867
|
-
let e = await
|
|
1868
|
-
if (
|
|
1982
|
+
let e = await q.post(`${u.apiBase}/files/upload/image`, n), r = e.data.url || e.data.file_path;
|
|
1983
|
+
if (be === "image") {
|
|
1869
1984
|
let e = {
|
|
1870
1985
|
id: Q(),
|
|
1871
1986
|
shape: "image",
|
|
@@ -1882,7 +1997,7 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1882
1997
|
fontSize: 14
|
|
1883
1998
|
};
|
|
1884
1999
|
X.value && (e.groupId = X.value), P.components.push(e);
|
|
1885
|
-
} else if (
|
|
2000
|
+
} else if (be === "svg") {
|
|
1886
2001
|
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);
|
|
1887
2002
|
if (a) {
|
|
1888
2003
|
let e = a.split(/[\s,]+/).map(Number);
|
|
@@ -1912,16 +2027,16 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1912
2027
|
A.error("上传失败");
|
|
1913
2028
|
}
|
|
1914
2029
|
e.target.value = "";
|
|
1915
|
-
},
|
|
2030
|
+
}, Ce = (e, t, n) => {
|
|
1916
2031
|
if (n && (n.ctrlKey || n.metaKey)) {
|
|
1917
|
-
|
|
2032
|
+
B.value.includes(e.id) ? B.value = B.value.filter((t) => t !== e.id) : B.value.push(e.id), z.value = B.value[B.value.length - 1] || null, H.value = z.value ? P.components.find((e) => e.id === z.value) : null, V.value = "component";
|
|
1918
2033
|
return;
|
|
1919
2034
|
}
|
|
1920
|
-
|
|
2035
|
+
z.value = e.id, B.value = [e.id], V.value = t, H.value = e, G.value = null;
|
|
1921
2036
|
}, $ = () => {
|
|
1922
|
-
|
|
1923
|
-
},
|
|
1924
|
-
let r =
|
|
2037
|
+
z.value = null, B.value = [], V.value = null, H.value = null, G.value = null;
|
|
2038
|
+
}, we = (e, t, n) => {
|
|
2039
|
+
let r = De(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) => ({
|
|
1925
2040
|
id: e.id,
|
|
1926
2041
|
x: e.x,
|
|
1927
2042
|
y: e.y,
|
|
@@ -1938,7 +2053,7 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1938
2053
|
y: e.toAnchor.y
|
|
1939
2054
|
} : null
|
|
1940
2055
|
})), m = (n) => {
|
|
1941
|
-
let m =
|
|
2056
|
+
let m = De(n), h = m.x - r.x, g = m.y - r.y, _ = o, v = s, y = i, b = a;
|
|
1942
2057
|
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) {
|
|
1943
2058
|
let e = _ / o, t = v / s;
|
|
1944
2059
|
l && u.forEach((n, r) => {
|
|
@@ -1961,7 +2076,7 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1961
2076
|
document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", h), Z();
|
|
1962
2077
|
};
|
|
1963
2078
|
document.addEventListener("mousemove", m), document.addEventListener("mouseup", h);
|
|
1964
|
-
},
|
|
2079
|
+
}, De = (e) => {
|
|
1965
2080
|
let t = document.querySelector(".diagram-svg");
|
|
1966
2081
|
if (!t) return {
|
|
1967
2082
|
x: 0,
|
|
@@ -1972,20 +2087,20 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1972
2087
|
x: (e.clientX - n.left) / n.width * r.width + r.x,
|
|
1973
2088
|
y: (e.clientY - n.top) / n.height * r.height + r.y
|
|
1974
2089
|
};
|
|
1975
|
-
},
|
|
2090
|
+
}, Oe = (e, t, n, r = !1) => {
|
|
1976
2091
|
let i = P.components.find((t) => t.id === e);
|
|
1977
2092
|
if (!i) return;
|
|
1978
2093
|
let a = t - i.x, o = n - i.y;
|
|
1979
2094
|
i.x = t, i.y = n, i.shape === "group" && i.id && P.components.forEach((e) => {
|
|
1980
2095
|
e.groupId === i.id && e.id !== i.id && (e.x += a, e.y += o);
|
|
1981
2096
|
}), r && Z();
|
|
1982
|
-
},
|
|
2097
|
+
}, ke = (e) => {
|
|
1983
2098
|
if (e.shape === "group") {
|
|
1984
|
-
|
|
2099
|
+
Ie(e);
|
|
1985
2100
|
return;
|
|
1986
2101
|
}
|
|
1987
2102
|
if (e.shape === "polygon") {
|
|
1988
|
-
|
|
2103
|
+
G.value && G.value.id === e.id ? G.value = null : G.value = e;
|
|
1989
2104
|
return;
|
|
1990
2105
|
}
|
|
1991
2106
|
j.prompt("编辑标签", "组件", {
|
|
@@ -1994,12 +2109,12 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
1994
2109
|
}).then(({ value: t }) => {
|
|
1995
2110
|
t !== null && (e.label = t);
|
|
1996
2111
|
}).catch(() => {});
|
|
1997
|
-
},
|
|
1998
|
-
|
|
1999
|
-
},
|
|
2000
|
-
|
|
2112
|
+
}, je = () => {
|
|
2113
|
+
z.value && (V.value === "component" ? (P.components = P.components.filter((e) => e.id !== z.value), P.connections = P.connections.filter((e) => e.fromId !== z.value && e.toId !== z.value)) : P.connections = P.connections.filter((e) => e.id !== z.value), $(), Z());
|
|
2114
|
+
}, Me = (e, t, n) => {
|
|
2115
|
+
U.value = !0;
|
|
2001
2116
|
let r = e.x + t.x, i = e.y + t.y;
|
|
2002
|
-
|
|
2117
|
+
W.value = {
|
|
2003
2118
|
x1: r,
|
|
2004
2119
|
y1: i,
|
|
2005
2120
|
x2: r,
|
|
@@ -2008,10 +2123,10 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2008
2123
|
let a = n.target.closest("svg"), o = (e) => {
|
|
2009
2124
|
if (!a) return;
|
|
2010
2125
|
let t = a.getBoundingClientRect(), n = a.viewBox.baseVal;
|
|
2011
|
-
|
|
2126
|
+
W.value.x2 = (e.clientX - t.left) / t.width * n.width + n.x, W.value.y2 = (e.clientY - t.top) / t.height * n.height + n.y;
|
|
2012
2127
|
}, s = (n) => {
|
|
2013
|
-
if (document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", s),
|
|
2014
|
-
|
|
2128
|
+
if (document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", s), W.value = null, !a) {
|
|
2129
|
+
U.value = !1;
|
|
2015
2130
|
return;
|
|
2016
2131
|
}
|
|
2017
2132
|
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;
|
|
@@ -2061,11 +2176,11 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2061
2176
|
label: "",
|
|
2062
2177
|
lineWidth: 2,
|
|
2063
2178
|
dashed: !1
|
|
2064
|
-
}), Z())),
|
|
2179
|
+
}), Z())), U.value = !1;
|
|
2065
2180
|
};
|
|
2066
2181
|
document.addEventListener("mousemove", o), document.addEventListener("mouseup", s);
|
|
2067
|
-
},
|
|
2068
|
-
let e = P.components.filter((e) =>
|
|
2182
|
+
}, Pe = () => {
|
|
2183
|
+
let e = P.components.filter((e) => B.value.includes(e.id));
|
|
2069
2184
|
if (e.length < 2) {
|
|
2070
2185
|
A.warning("请至少选择2个零件进行组合");
|
|
2071
2186
|
return;
|
|
@@ -2094,36 +2209,36 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2094
2209
|
movable: !1
|
|
2095
2210
|
};
|
|
2096
2211
|
X.value && (o.groupId = X.value), P.components = [
|
|
2097
|
-
...P.components.filter((e) => !
|
|
2212
|
+
...P.components.filter((e) => !B.value.includes(e.id)),
|
|
2098
2213
|
o,
|
|
2099
2214
|
...e
|
|
2100
|
-
],
|
|
2101
|
-
},
|
|
2215
|
+
], B.value = [], Z();
|
|
2216
|
+
}, Fe = (e) => {
|
|
2102
2217
|
let t = P.components.filter((t) => t.groupId === e.id && t.id !== e.id);
|
|
2103
2218
|
if (!t.length) return;
|
|
2104
2219
|
let n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
|
|
2105
2220
|
t.forEach((e) => {
|
|
2106
2221
|
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);
|
|
2107
2222
|
}), 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
2223
|
}, Ie = (e) => {
|
|
2113
|
-
|
|
2114
|
-
}, Le =
|
|
2224
|
+
K.value.push(e.id), $();
|
|
2225
|
+
}, Le = () => {
|
|
2226
|
+
K.value.length && (K.value.pop(), $());
|
|
2227
|
+
}, Re = (e) => {
|
|
2228
|
+
K.value = K.value.slice(0, e + 1), $();
|
|
2229
|
+
}, ze = async (e) => {
|
|
2115
2230
|
let t = e.target.files?.[0];
|
|
2116
|
-
if (!t || !
|
|
2231
|
+
if (!t || !H.value) return;
|
|
2117
2232
|
let n = new FormData();
|
|
2118
2233
|
n.append("file", t);
|
|
2119
2234
|
try {
|
|
2120
|
-
let e = await
|
|
2121
|
-
|
|
2235
|
+
let e = await q.post(`${u.apiBase}/files/upload/image`, n);
|
|
2236
|
+
H.value.imageUrl = e.data.url || e.data.file_path, Fe(H.value);
|
|
2122
2237
|
} catch {
|
|
2123
2238
|
A.error("上传失败");
|
|
2124
2239
|
}
|
|
2125
2240
|
e.target.value = "";
|
|
2126
|
-
},
|
|
2241
|
+
}, Be = () => {
|
|
2127
2242
|
let e = P.components;
|
|
2128
2243
|
if (!e.length) return;
|
|
2129
2244
|
let t = Math.ceil(Math.sqrt(e.length));
|
|
@@ -2132,29 +2247,28 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2132
2247
|
x: 100 + n % t * 200,
|
|
2133
2248
|
y: 100 + Math.floor(n / t) * 120
|
|
2134
2249
|
})), Z();
|
|
2135
|
-
},
|
|
2250
|
+
}, Ve = () => {
|
|
2136
2251
|
u.docId ?? C.push("/");
|
|
2137
|
-
},
|
|
2138
|
-
|
|
2139
|
-
"这个爆炸图的组件分布很清晰。建议检查连接线是否准确反映了实际装配关系。",
|
|
2140
|
-
"根据当前的爆炸图结构,我建议为关键组件添加编号说明,便于阅读理解。",
|
|
2141
|
-
"我可以帮您检查爆炸图中是否有遗漏的零部件或多余的标注。需要我逐个分析吗?",
|
|
2142
|
-
"建议在爆炸图中添加装配方向指示箭头,这样可以让装配流程更加直观。",
|
|
2143
|
-
"这个爆炸图的层次感不错。如果需要,我可以帮您优化组件间距和标注位置。",
|
|
2144
|
-
"我可以帮您将爆炸图的数据导出为BOM清单格式,方便采购和生产管理。",
|
|
2145
|
-
"文档中的组件信息很详细。建议补充每个组件的规格参数和供应商信息。"
|
|
2146
|
-
], He = async (e, t = {}) => {
|
|
2147
|
-
let n = T.value ? `${$t}-${T.value}` : null;
|
|
2252
|
+
}, He = async (e, t = {}) => {
|
|
2253
|
+
let n = T.value ? `${rn}-${T.value}` : null;
|
|
2148
2254
|
await N.sendMessage(e, {
|
|
2149
2255
|
...t,
|
|
2150
2256
|
roomId: n
|
|
2151
2257
|
});
|
|
2152
2258
|
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)
|
|
2154
|
-
N.
|
|
2155
|
-
|
|
2259
|
+
if (!r || i || a.length === 0) {
|
|
2260
|
+
N.loading.value = !0;
|
|
2261
|
+
try {
|
|
2262
|
+
let t = await te.chat(e, N.messages.value);
|
|
2263
|
+
N.sendAiMessage(t, n);
|
|
2264
|
+
} catch (e) {
|
|
2265
|
+
N.sendAiMessage("AI 请求失败: " + (e.message || "未知错误"), n);
|
|
2266
|
+
} finally {
|
|
2267
|
+
N.loading.value = !1;
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2156
2270
|
}, Ue = () => {
|
|
2157
|
-
let e = T.value ? `${
|
|
2271
|
+
let e = T.value ? `${rn}-${T.value}` : null;
|
|
2158
2272
|
N.clearMessages(e);
|
|
2159
2273
|
}, We = () => {
|
|
2160
2274
|
if (!T.value) {
|
|
@@ -2162,15 +2276,15 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2162
2276
|
return;
|
|
2163
2277
|
}
|
|
2164
2278
|
D.value = !0;
|
|
2165
|
-
},
|
|
2279
|
+
}, Ke = (e) => {
|
|
2166
2280
|
try {
|
|
2167
2281
|
let t = typeof e == "string" ? JSON.parse(e) : e;
|
|
2168
2282
|
t.components && (P.components = t.components), t.connections && (P.connections = t.connections), $();
|
|
2169
2283
|
} catch (e) {
|
|
2170
2284
|
console.error("Version apply error:", e);
|
|
2171
2285
|
}
|
|
2172
|
-
},
|
|
2173
|
-
if (F.value &&
|
|
2286
|
+
}, qe = async () => {
|
|
2287
|
+
if (F.value && I?.collaborationClosed.value && !re.value) {
|
|
2174
2288
|
A.warning("协作已关闭,无法保存");
|
|
2175
2289
|
return;
|
|
2176
2290
|
}
|
|
@@ -2186,10 +2300,10 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2186
2300
|
if (typeof u.saveApi == "function") {
|
|
2187
2301
|
let t = await u.saveApi(e, T.value);
|
|
2188
2302
|
t?.id && (T.value = t.id);
|
|
2189
|
-
} else if (typeof u.saveApi == "string") T.value ? await
|
|
2303
|
+
} else if (typeof u.saveApi == "string") T.value ? await q.put(u.saveApi, e) : T.value = (await q.post(u.saveApi, e)).data.id;
|
|
2190
2304
|
else {
|
|
2191
2305
|
let t = u.apiBase;
|
|
2192
|
-
T.value ? await
|
|
2306
|
+
T.value ? await q.put(`${t}/explosion-views/${T.value}`, e) : T.value = (await q.post(`${t}/explosion-views/`, e)).data.id;
|
|
2193
2307
|
}
|
|
2194
2308
|
A.success("保存成功"), M({
|
|
2195
2309
|
documentId: T.value,
|
|
@@ -2204,14 +2318,14 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2204
2318
|
} catch {
|
|
2205
2319
|
A.error("保存失败");
|
|
2206
2320
|
}
|
|
2207
|
-
},
|
|
2321
|
+
}, Je = async () => {
|
|
2208
2322
|
if (f.value) try {
|
|
2209
2323
|
let e;
|
|
2210
2324
|
if (typeof u.loadApi == "function") e = await u.loadApi(f.value);
|
|
2211
|
-
else if (typeof u.loadApi == "string") e = (await
|
|
2325
|
+
else if (typeof u.loadApi == "string") e = (await q.get(u.loadApi)).data;
|
|
2212
2326
|
else {
|
|
2213
2327
|
let t = u.apiBase;
|
|
2214
|
-
e = (await
|
|
2328
|
+
e = (await q.get(`${t}/explosion-views/${f.value}`)).data;
|
|
2215
2329
|
}
|
|
2216
2330
|
if (T.value = e.id, P.title = e.title, e.config) {
|
|
2217
2331
|
let t = JSON.parse(e.config);
|
|
@@ -2243,68 +2357,68 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2243
2357
|
A.error("导出失败");
|
|
2244
2358
|
}
|
|
2245
2359
|
}, Xe = (e) => {
|
|
2246
|
-
|
|
2360
|
+
I &&= (I.destroy(), null), I = Ft(e, { onRemoteChange: (e) => {
|
|
2247
2361
|
e.title && (P.title = e.title), e.components && (P.components = e.components), e.connections && (P.connections = e.connections), $();
|
|
2248
|
-
} }),
|
|
2362
|
+
} }), I._setSyncReady(!1);
|
|
2249
2363
|
}, Ze = async () => {
|
|
2250
2364
|
if (F.value) return;
|
|
2251
|
-
if (!T.value && (await
|
|
2365
|
+
if (!T.value && (await qe(), !T.value)) {
|
|
2252
2366
|
A.error("请先保存文档");
|
|
2253
2367
|
return;
|
|
2254
2368
|
}
|
|
2255
|
-
Xe(String(T.value)),
|
|
2369
|
+
Xe(String(T.value)), I.connect();
|
|
2256
2370
|
let e = {
|
|
2257
2371
|
name: `用户${Math.floor(Math.random() * 1e3)}`,
|
|
2258
2372
|
color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
|
|
2259
2373
|
}, t = () => {
|
|
2260
|
-
if (
|
|
2261
|
-
|
|
2262
|
-
let t =
|
|
2263
|
-
t ? (t.title && (P.title = t.title), t.components && (P.components = t.components), t.connections && (P.connections = t.connections), $()) : P.components.length > 0 &&
|
|
2264
|
-
ydoc:
|
|
2265
|
-
provider:
|
|
2266
|
-
onlineUsers:
|
|
2374
|
+
if (I.provider && I.provider.synced) {
|
|
2375
|
+
I._setSyncReady(!0), I.setLocalUser(e);
|
|
2376
|
+
let t = I.pullFromYjs();
|
|
2377
|
+
t ? (t.title && (P.title = t.title), t.components && (P.components = t.components), t.connections && (P.connections = t.connections), $()) : P.components.length > 0 && I.pushToYjs(P), F.value = !0, re.value = !0, ne.value = !1, N.setCollabContext({
|
|
2378
|
+
ydoc: I.ydoc,
|
|
2379
|
+
provider: I.provider,
|
|
2380
|
+
onlineUsers: I.onlineUsers
|
|
2267
2381
|
}), N.setCurrentUser({
|
|
2268
|
-
id:
|
|
2382
|
+
id: I.provider.awareness.clientID,
|
|
2269
2383
|
name: e.name,
|
|
2270
2384
|
color: e.color
|
|
2271
2385
|
}), A.success("协作已开启");
|
|
2272
2386
|
} else setTimeout(t, 100);
|
|
2273
2387
|
};
|
|
2274
2388
|
setTimeout(t, 200);
|
|
2275
|
-
}, Qe = () => {
|
|
2276
|
-
L && (L.closeCollaboration(), F.value = !1, I.value = !1, A.info("协作已关闭"));
|
|
2277
2389
|
}, $e = () => {
|
|
2390
|
+
I && (I.closeCollaboration(), F.value = !1, re.value = !1, A.info("协作已关闭"));
|
|
2391
|
+
}, et = () => {
|
|
2278
2392
|
let e = p.params.id;
|
|
2279
2393
|
if (!e) return;
|
|
2280
|
-
Xe(e),
|
|
2394
|
+
Xe(e), I.connect();
|
|
2281
2395
|
let t = {
|
|
2282
2396
|
name: `协作人${Math.floor(Math.random() * 1e3)}`,
|
|
2283
2397
|
color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
|
|
2284
2398
|
}, n = () => {
|
|
2285
|
-
if (
|
|
2286
|
-
if (
|
|
2287
|
-
|
|
2399
|
+
if (I.provider && I.provider.synced) {
|
|
2400
|
+
if (I.checkCollaborationClosed()) {
|
|
2401
|
+
I.disconnect(), F.value = !1, A.warning("该协作已关闭,无法加入");
|
|
2288
2402
|
return;
|
|
2289
2403
|
}
|
|
2290
|
-
|
|
2291
|
-
let e =
|
|
2292
|
-
e && (e.title && (P.title = e.title), e.components && (P.components = e.components), e.connections && (P.connections = e.connections), $()), F.value = !0,
|
|
2293
|
-
ydoc:
|
|
2294
|
-
provider:
|
|
2295
|
-
onlineUsers:
|
|
2404
|
+
I._setSyncReady(!0), I.setLocalUser(t);
|
|
2405
|
+
let e = I.pullFromYjs();
|
|
2406
|
+
e && (e.title && (P.title = e.title), e.components && (P.components = e.components), e.connections && (P.connections = e.connections), $()), F.value = !0, re.value = !1, N.setCollabContext({
|
|
2407
|
+
ydoc: I.ydoc,
|
|
2408
|
+
provider: I.provider,
|
|
2409
|
+
onlineUsers: I.onlineUsers
|
|
2296
2410
|
}), N.setCurrentUser({
|
|
2297
|
-
id:
|
|
2411
|
+
id: I.provider.awareness.clientID,
|
|
2298
2412
|
name: t.name,
|
|
2299
2413
|
color: t.color
|
|
2300
2414
|
}), A.success("已加入协作");
|
|
2301
2415
|
} else setTimeout(n, 100);
|
|
2302
2416
|
};
|
|
2303
2417
|
setTimeout(n, 200);
|
|
2304
|
-
},
|
|
2305
|
-
F.value ?
|
|
2306
|
-
},
|
|
2307
|
-
if (F.value || await Ze(), !T.value && (await
|
|
2418
|
+
}, tt = () => {
|
|
2419
|
+
F.value ? $e() : Ze();
|
|
2420
|
+
}, nt = async () => {
|
|
2421
|
+
if (F.value || await Ze(), !T.value && (await qe(), !T.value)) {
|
|
2308
2422
|
A.warning("请先保存文档后再分享");
|
|
2309
2423
|
return;
|
|
2310
2424
|
}
|
|
@@ -2314,16 +2428,16 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2314
2428
|
} catch {
|
|
2315
2429
|
A.info("协作链接: " + e);
|
|
2316
2430
|
}
|
|
2317
|
-
}, nt = () => {
|
|
2318
|
-
Y.value = (U.value?.popupConfig || []).map((e) => ({ ...e })), ie.value = !0;
|
|
2319
2431
|
}, rt = () => {
|
|
2432
|
+
Y.value = (H.value?.popupConfig || []).map((e) => ({ ...e })), oe.value = !0;
|
|
2433
|
+
}, it = () => {
|
|
2320
2434
|
Y.value.push({
|
|
2321
2435
|
key: "",
|
|
2322
2436
|
value: ""
|
|
2323
2437
|
});
|
|
2324
|
-
},
|
|
2325
|
-
|
|
2326
|
-
},
|
|
2438
|
+
}, at = () => {
|
|
2439
|
+
H.value.popupConfig = Y.value.filter((e) => e.key.trim()), oe.value = !1, Z();
|
|
2440
|
+
}, ot = (e) => {
|
|
2327
2441
|
let t = e.target.files?.[0];
|
|
2328
2442
|
if (!t) return;
|
|
2329
2443
|
let n = new FileReader();
|
|
@@ -2341,14 +2455,14 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2341
2455
|
A.error("JSON解析失败");
|
|
2342
2456
|
}
|
|
2343
2457
|
}, n.readAsText(t), e.target.value = "";
|
|
2344
|
-
},
|
|
2458
|
+
}, st = () => {
|
|
2345
2459
|
let e = JSON.stringify({
|
|
2346
2460
|
title: P.title,
|
|
2347
2461
|
components: P.components,
|
|
2348
2462
|
connections: P.connections
|
|
2349
2463
|
}, null, 2), t = new Blob([e], { type: "application/json" }), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
2350
2464
|
r.href = n, r.download = `${P.title || "爆炸图"}.json`, r.click(), URL.revokeObjectURL(n), A.success("导出成功");
|
|
2351
|
-
},
|
|
2465
|
+
}, ct = (e) => {
|
|
2352
2466
|
let t = e.target.files?.[0];
|
|
2353
2467
|
if (!t) return;
|
|
2354
2468
|
let n = new FileReader();
|
|
@@ -2367,42 +2481,42 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2367
2481
|
id: u.user?.id || Date.now(),
|
|
2368
2482
|
name: e,
|
|
2369
2483
|
color: u.user?.color || "#409eff"
|
|
2370
|
-
}), await
|
|
2484
|
+
}), await Je(), f.value && p.query.collab === "1" && et();
|
|
2371
2485
|
});
|
|
2372
|
-
let
|
|
2373
|
-
e.key === "Delete" &&
|
|
2486
|
+
let lt = (e) => {
|
|
2487
|
+
e.key === "Delete" && z.value && je(), (e.ctrlKey || e.metaKey) && e.key === "z" && (e.preventDefault(), fe()), (e.ctrlKey || e.metaKey) && e.key === "y" && (e.preventDefault(), pe());
|
|
2374
2488
|
};
|
|
2375
|
-
return m(() => document.addEventListener("keydown",
|
|
2376
|
-
document.removeEventListener("keydown",
|
|
2489
|
+
return m(() => document.addEventListener("keydown", lt)), h(() => {
|
|
2490
|
+
document.removeEventListener("keydown", lt), I &&= (I.destroy(), null);
|
|
2377
2491
|
}), (n, l) => {
|
|
2378
2492
|
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");
|
|
2379
|
-
return g(), a("div",
|
|
2380
|
-
c(
|
|
2493
|
+
return g(), a("div", It, [
|
|
2494
|
+
c(Qe, {
|
|
2381
2495
|
title: P.title,
|
|
2382
2496
|
"onUpdate:title": l[0] ||= (e) => P.title = e,
|
|
2383
|
-
"can-undo":
|
|
2384
|
-
"can-redo":
|
|
2385
|
-
"connecting-mode":
|
|
2497
|
+
"can-undo": R.value > 0,
|
|
2498
|
+
"can-redo": R.value < L.value.length - 1,
|
|
2499
|
+
"connecting-mode": U.value,
|
|
2386
2500
|
"is-connected": F.value,
|
|
2387
|
-
"online-users": S(
|
|
2501
|
+
"online-users": S(I) ? S(I).onlineUsers.value : [],
|
|
2388
2502
|
"is-join-mode": S(p).query.collab === "1",
|
|
2389
2503
|
"show-back-button": d.value.backButton === "show",
|
|
2390
2504
|
"title-disabled": !d.value.titleEditable,
|
|
2391
|
-
onBack:
|
|
2392
|
-
onAddComponent:
|
|
2393
|
-
onToggleConnecting: l[1] ||= (e) =>
|
|
2394
|
-
onGroupSelected:
|
|
2395
|
-
onAutoLayout:
|
|
2396
|
-
onUndo:
|
|
2397
|
-
onRedo:
|
|
2398
|
-
onZoomIn:
|
|
2399
|
-
onZoomOut:
|
|
2505
|
+
onBack: Ve,
|
|
2506
|
+
onAddComponent: xe,
|
|
2507
|
+
onToggleConnecting: l[1] ||= (e) => U.value = !U.value,
|
|
2508
|
+
onGroupSelected: Pe,
|
|
2509
|
+
onAutoLayout: Be,
|
|
2510
|
+
onUndo: fe,
|
|
2511
|
+
onRedo: pe,
|
|
2512
|
+
onZoomIn: me,
|
|
2513
|
+
onZoomOut: he,
|
|
2400
2514
|
onExport: Ye,
|
|
2401
|
-
onSave:
|
|
2402
|
-
onToggleCollab:
|
|
2403
|
-
onShareCollab:
|
|
2404
|
-
onExportJson:
|
|
2405
|
-
onImportJson: l[2] ||= (e) =>
|
|
2515
|
+
onSave: qe,
|
|
2516
|
+
onToggleCollab: tt,
|
|
2517
|
+
onShareCollab: nt,
|
|
2518
|
+
onExportJson: st,
|
|
2519
|
+
onImportJson: l[2] ||= (e) => ae.value?.click(),
|
|
2406
2520
|
"show-history": !!T.value,
|
|
2407
2521
|
onHistory: We
|
|
2408
2522
|
}, null, 8, [
|
|
@@ -2419,49 +2533,49 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2419
2533
|
]),
|
|
2420
2534
|
o("input", {
|
|
2421
2535
|
ref_key: "fileInputRef",
|
|
2422
|
-
ref:
|
|
2536
|
+
ref: ve,
|
|
2423
2537
|
type: "file",
|
|
2424
2538
|
accept: "image/*,.svg",
|
|
2425
2539
|
style: { display: "none" },
|
|
2426
|
-
onChange:
|
|
2540
|
+
onChange: Se
|
|
2427
2541
|
}, null, 544),
|
|
2428
2542
|
o("input", {
|
|
2429
2543
|
ref_key: "svgInputRef",
|
|
2430
|
-
ref:
|
|
2544
|
+
ref: ye,
|
|
2431
2545
|
type: "file",
|
|
2432
2546
|
accept: ".svg",
|
|
2433
2547
|
style: { display: "none" },
|
|
2434
|
-
onChange:
|
|
2548
|
+
onChange: Se
|
|
2435
2549
|
}, null, 544),
|
|
2436
2550
|
o("input", {
|
|
2437
2551
|
ref_key: "groupImageInputRef",
|
|
2438
|
-
ref:
|
|
2552
|
+
ref: ie,
|
|
2439
2553
|
type: "file",
|
|
2440
2554
|
accept: "image/*",
|
|
2441
2555
|
style: { display: "none" },
|
|
2442
|
-
onChange:
|
|
2556
|
+
onChange: ze
|
|
2443
2557
|
}, null, 544),
|
|
2444
2558
|
o("input", {
|
|
2445
2559
|
ref_key: "importJsonInputRef",
|
|
2446
|
-
ref:
|
|
2560
|
+
ref: ae,
|
|
2447
2561
|
type: "file",
|
|
2448
2562
|
accept: ".json",
|
|
2449
2563
|
style: { display: "none" },
|
|
2450
|
-
onChange:
|
|
2564
|
+
onChange: ct
|
|
2451
2565
|
}, null, 544),
|
|
2452
|
-
|
|
2566
|
+
K.value.length ? (g(), a("div", Lt, [c(f, { separator: "/" }, {
|
|
2453
2567
|
default: w(() => [c(u, {
|
|
2454
|
-
onClick: l[3] ||= (e) =>
|
|
2568
|
+
onClick: l[3] ||= (e) => Re(-1),
|
|
2455
2569
|
style: { cursor: "pointer" }
|
|
2456
2570
|
}, {
|
|
2457
2571
|
default: w(() => [...l[27] ||= [s("根目录", -1)]]),
|
|
2458
2572
|
_: 1
|
|
2459
|
-
}), (g(!0), a(e, null, y(
|
|
2573
|
+
}), (g(!0), a(e, null, y(K.value, (e, t) => (g(), r(u, {
|
|
2460
2574
|
key: e,
|
|
2461
|
-
onClick: (e) =>
|
|
2575
|
+
onClick: (e) => Re(t),
|
|
2462
2576
|
style: { cursor: "pointer" }
|
|
2463
2577
|
}, {
|
|
2464
|
-
default: w(() => [s(x(
|
|
2578
|
+
default: w(() => [s(x(ue(e)?.label || "组合"), 1)]),
|
|
2465
2579
|
_: 2
|
|
2466
2580
|
}, 1032, ["onClick"]))), 128))]),
|
|
2467
2581
|
_: 1
|
|
@@ -2472,7 +2586,7 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2472
2586
|
default: w(() => [c(h, {
|
|
2473
2587
|
size: "small",
|
|
2474
2588
|
circle: "",
|
|
2475
|
-
onClick:
|
|
2589
|
+
onClick: Le
|
|
2476
2590
|
}, {
|
|
2477
2591
|
default: w(() => [c(m, null, {
|
|
2478
2592
|
default: w(() => [c(S(ee))]),
|
|
@@ -2482,23 +2596,23 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2482
2596
|
})]),
|
|
2483
2597
|
_: 1
|
|
2484
2598
|
})])) : i("", !0),
|
|
2485
|
-
o("div",
|
|
2486
|
-
components:
|
|
2487
|
-
connections:
|
|
2488
|
-
"selected-id":
|
|
2489
|
-
"selected-ids":
|
|
2490
|
-
"connecting-mode":
|
|
2491
|
-
"drawing-conn":
|
|
2492
|
-
"editing-polygon":
|
|
2493
|
-
"view-box":
|
|
2599
|
+
o("div", Rt, [c(Nt, {
|
|
2600
|
+
components: se.value,
|
|
2601
|
+
connections: ce.value,
|
|
2602
|
+
"selected-id": z.value,
|
|
2603
|
+
"selected-ids": B.value,
|
|
2604
|
+
"connecting-mode": U.value,
|
|
2605
|
+
"drawing-conn": W.value,
|
|
2606
|
+
"editing-polygon": G.value,
|
|
2607
|
+
"view-box": le.value,
|
|
2494
2608
|
"is-expanded": !!X.value,
|
|
2495
2609
|
"expanded-group-id": X.value,
|
|
2496
|
-
onSelect:
|
|
2497
|
-
onEdit:
|
|
2610
|
+
onSelect: Ce,
|
|
2611
|
+
onEdit: ke,
|
|
2498
2612
|
onClearSelection: $,
|
|
2499
|
-
onStartConnect:
|
|
2500
|
-
onStartResize:
|
|
2501
|
-
onMoveComponent:
|
|
2613
|
+
onStartConnect: Me,
|
|
2614
|
+
onStartResize: we,
|
|
2615
|
+
onMoveComponent: Oe,
|
|
2502
2616
|
onDragPolygonVertex: Z
|
|
2503
2617
|
}, null, 8, [
|
|
2504
2618
|
"components",
|
|
@@ -2512,101 +2626,101 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2512
2626
|
"is-expanded",
|
|
2513
2627
|
"expanded-group-id"
|
|
2514
2628
|
]), c(t, { name: "slide" }, {
|
|
2515
|
-
default: w(() => [
|
|
2516
|
-
o("div",
|
|
2517
|
-
modelValue:
|
|
2518
|
-
"onUpdate:modelValue": l[4] ||= (e) =>
|
|
2629
|
+
default: w(() => [H.value ? (g(), a("div", zt, [o("h4", null, x(V.value === "component" ? "组件属性" : "连线属性"), 1), V.value === "component" ? (g(), a(e, { key: 0 }, [
|
|
2630
|
+
o("div", Bt, [l[28] ||= o("label", null, "标签", -1), c(v, {
|
|
2631
|
+
modelValue: H.value.label,
|
|
2632
|
+
"onUpdate:modelValue": l[4] ||= (e) => H.value.label = e,
|
|
2519
2633
|
size: "small"
|
|
2520
2634
|
}, null, 8, ["modelValue"])]),
|
|
2521
|
-
o("div",
|
|
2522
|
-
modelValue:
|
|
2523
|
-
"onUpdate:modelValue": l[5] ||= (e) =>
|
|
2635
|
+
o("div", Vt, [l[29] ||= o("label", null, "描述", -1), c(v, {
|
|
2636
|
+
modelValue: H.value.description,
|
|
2637
|
+
"onUpdate:modelValue": l[5] ||= (e) => H.value.description = e,
|
|
2524
2638
|
size: "small"
|
|
2525
2639
|
}, null, 8, ["modelValue"])]),
|
|
2526
|
-
|
|
2527
|
-
o("div",
|
|
2528
|
-
modelValue:
|
|
2529
|
-
"onUpdate:modelValue": l[6] ||= (e) =>
|
|
2640
|
+
H.value.shape === "group" ? (g(), a(e, { key: 0 }, [
|
|
2641
|
+
o("div", Ht, [l[30] ||= o("label", null, "宽度", -1), c(C, {
|
|
2642
|
+
modelValue: H.value.width,
|
|
2643
|
+
"onUpdate:modelValue": l[6] ||= (e) => H.value.width = e,
|
|
2530
2644
|
min: 40,
|
|
2531
2645
|
max: 2e3,
|
|
2532
2646
|
size: "small"
|
|
2533
2647
|
}, null, 8, ["modelValue"])]),
|
|
2534
|
-
o("div",
|
|
2535
|
-
modelValue:
|
|
2536
|
-
"onUpdate:modelValue": l[7] ||= (e) =>
|
|
2648
|
+
o("div", Ut, [l[31] ||= o("label", null, "高度", -1), c(C, {
|
|
2649
|
+
modelValue: H.value.height,
|
|
2650
|
+
"onUpdate:modelValue": l[7] ||= (e) => H.value.height = e,
|
|
2537
2651
|
min: 30,
|
|
2538
2652
|
max: 1500,
|
|
2539
2653
|
size: "small"
|
|
2540
2654
|
}, null, 8, ["modelValue"])]),
|
|
2541
|
-
o("div",
|
|
2542
|
-
src:
|
|
2655
|
+
o("div", Wt, [l[34] ||= o("label", null, "显示图片", -1), H.value.imageUrl ? (g(), a("div", Gt, [o("img", {
|
|
2656
|
+
src: H.value.imageUrl,
|
|
2543
2657
|
style: {
|
|
2544
2658
|
"max-width": "100%",
|
|
2545
2659
|
"max-height": "80px",
|
|
2546
2660
|
border: "1px solid #e4e7ed",
|
|
2547
2661
|
"border-radius": "4px"
|
|
2548
2662
|
}
|
|
2549
|
-
}, null, 8,
|
|
2663
|
+
}, null, 8, Kt), c(h, {
|
|
2550
2664
|
size: "small",
|
|
2551
2665
|
type: "danger",
|
|
2552
2666
|
text: "",
|
|
2553
|
-
onClick: l[8] ||= (e) =>
|
|
2667
|
+
onClick: l[8] ||= (e) => H.value.imageUrl = ""
|
|
2554
2668
|
}, {
|
|
2555
2669
|
default: w(() => [...l[32] ||= [s("移除", -1)]]),
|
|
2556
2670
|
_: 1
|
|
2557
2671
|
})])) : (g(), r(h, {
|
|
2558
2672
|
key: 1,
|
|
2559
2673
|
size: "small",
|
|
2560
|
-
onClick: l[9] ||= (e) =>
|
|
2674
|
+
onClick: l[9] ||= (e) => ie.value?.click()
|
|
2561
2675
|
}, {
|
|
2562
2676
|
default: w(() => [...l[33] ||= [s("上传图片", -1)]]),
|
|
2563
2677
|
_: 1
|
|
2564
2678
|
}))]),
|
|
2565
2679
|
c(h, {
|
|
2566
2680
|
size: "small",
|
|
2567
|
-
onClick: l[10] ||= (e) =>
|
|
2681
|
+
onClick: l[10] ||= (e) => Fe(H.value)
|
|
2568
2682
|
}, {
|
|
2569
2683
|
default: w(() => [...l[35] ||= [s("适配子零件", -1)]]),
|
|
2570
2684
|
_: 1
|
|
2571
2685
|
})
|
|
2572
|
-
], 64)) : (g(), a(e, { key: 1 }, [o("div",
|
|
2573
|
-
modelValue:
|
|
2574
|
-
"onUpdate:modelValue": l[11] ||= (e) =>
|
|
2686
|
+
], 64)) : (g(), a(e, { key: 1 }, [o("div", qt, [l[36] ||= o("label", null, "宽度", -1), c(C, {
|
|
2687
|
+
modelValue: H.value.width,
|
|
2688
|
+
"onUpdate:modelValue": l[11] ||= (e) => H.value.width = e,
|
|
2575
2689
|
min: 40,
|
|
2576
2690
|
max: 400,
|
|
2577
2691
|
size: "small"
|
|
2578
|
-
}, null, 8, ["modelValue"])]), o("div",
|
|
2579
|
-
modelValue:
|
|
2580
|
-
"onUpdate:modelValue": l[12] ||= (e) =>
|
|
2692
|
+
}, null, 8, ["modelValue"])]), o("div", Jt, [l[37] ||= o("label", null, "高度", -1), c(C, {
|
|
2693
|
+
modelValue: H.value.height,
|
|
2694
|
+
"onUpdate:modelValue": l[12] ||= (e) => H.value.height = e,
|
|
2581
2695
|
min: 30,
|
|
2582
2696
|
max: 300,
|
|
2583
2697
|
size: "small"
|
|
2584
2698
|
}, null, 8, ["modelValue"])])], 64)),
|
|
2585
|
-
o("div",
|
|
2586
|
-
modelValue:
|
|
2587
|
-
"onUpdate:modelValue": l[13] ||= (e) =>
|
|
2699
|
+
o("div", Yt, [l[38] ||= o("label", null, "填充色", -1), c(O, {
|
|
2700
|
+
modelValue: H.value.fill,
|
|
2701
|
+
"onUpdate:modelValue": l[13] ||= (e) => H.value.fill = e,
|
|
2588
2702
|
size: "small"
|
|
2589
2703
|
}, null, 8, ["modelValue"])]),
|
|
2590
|
-
o("div",
|
|
2591
|
-
modelValue:
|
|
2592
|
-
"onUpdate:modelValue": l[14] ||= (e) =>
|
|
2704
|
+
o("div", Xt, [l[39] ||= o("label", null, "边框色", -1), c(O, {
|
|
2705
|
+
modelValue: H.value.stroke,
|
|
2706
|
+
"onUpdate:modelValue": l[14] ||= (e) => H.value.stroke = e,
|
|
2593
2707
|
size: "small"
|
|
2594
2708
|
}, null, 8, ["modelValue"])]),
|
|
2595
|
-
o("div",
|
|
2596
|
-
modelValue:
|
|
2597
|
-
"onUpdate:modelValue": l[15] ||= (e) =>
|
|
2709
|
+
o("div", Zt, [l[40] ||= o("label", null, "文字色", -1), c(O, {
|
|
2710
|
+
modelValue: H.value.textColor,
|
|
2711
|
+
"onUpdate:modelValue": l[15] ||= (e) => H.value.textColor = e,
|
|
2598
2712
|
size: "small"
|
|
2599
2713
|
}, null, 8, ["modelValue"])]),
|
|
2600
|
-
o("div",
|
|
2601
|
-
modelValue:
|
|
2602
|
-
"onUpdate:modelValue": l[16] ||= (e) =>
|
|
2714
|
+
o("div", Qt, [l[41] ||= o("label", null, "字号", -1), c(C, {
|
|
2715
|
+
modelValue: H.value.fontSize,
|
|
2716
|
+
"onUpdate:modelValue": l[16] ||= (e) => H.value.fontSize = e,
|
|
2603
2717
|
min: 10,
|
|
2604
2718
|
max: 32,
|
|
2605
2719
|
size: "small"
|
|
2606
2720
|
}, null, 8, ["modelValue"])]),
|
|
2607
2721
|
c(h, {
|
|
2608
2722
|
size: "small",
|
|
2609
|
-
onClick:
|
|
2723
|
+
onClick: rt
|
|
2610
2724
|
}, {
|
|
2611
2725
|
default: w(() => [...l[42] ||= [s("属性弹框设置", -1)]]),
|
|
2612
2726
|
_: 1
|
|
@@ -2614,32 +2728,32 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2614
2728
|
c(h, {
|
|
2615
2729
|
size: "small",
|
|
2616
2730
|
type: "danger",
|
|
2617
|
-
onClick:
|
|
2731
|
+
onClick: je
|
|
2618
2732
|
}, {
|
|
2619
2733
|
default: w(() => [...l[43] ||= [s("删除", -1)]]),
|
|
2620
2734
|
_: 1
|
|
2621
2735
|
})
|
|
2622
|
-
], 64)) :
|
|
2623
|
-
o("div",
|
|
2624
|
-
modelValue:
|
|
2625
|
-
"onUpdate:modelValue": l[17] ||= (e) =>
|
|
2736
|
+
], 64)) : V.value === "connection" ? (g(), a(e, { key: 1 }, [
|
|
2737
|
+
o("div", $t, [l[44] ||= o("label", null, "标签", -1), c(v, {
|
|
2738
|
+
modelValue: H.value.label,
|
|
2739
|
+
"onUpdate:modelValue": l[17] ||= (e) => H.value.label = e,
|
|
2626
2740
|
size: "small"
|
|
2627
2741
|
}, null, 8, ["modelValue"])]),
|
|
2628
|
-
o("div",
|
|
2629
|
-
modelValue:
|
|
2630
|
-
"onUpdate:modelValue": l[18] ||= (e) =>
|
|
2742
|
+
o("div", en, [l[45] ||= o("label", null, "线宽", -1), c(C, {
|
|
2743
|
+
modelValue: H.value.lineWidth,
|
|
2744
|
+
"onUpdate:modelValue": l[18] ||= (e) => H.value.lineWidth = e,
|
|
2631
2745
|
min: 1,
|
|
2632
2746
|
max: 6,
|
|
2633
2747
|
size: "small"
|
|
2634
2748
|
}, null, 8, ["modelValue"])]),
|
|
2635
|
-
o("div",
|
|
2636
|
-
modelValue:
|
|
2637
|
-
"onUpdate:modelValue": l[19] ||= (e) =>
|
|
2749
|
+
o("div", tn, [l[46] ||= o("label", null, "虚线", -1), c(k, {
|
|
2750
|
+
modelValue: H.value.dashed,
|
|
2751
|
+
"onUpdate:modelValue": l[19] ||= (e) => H.value.dashed = e
|
|
2638
2752
|
}, null, 8, ["modelValue"])]),
|
|
2639
2753
|
c(h, {
|
|
2640
2754
|
size: "small",
|
|
2641
2755
|
type: "danger",
|
|
2642
|
-
onClick:
|
|
2756
|
+
onClick: je
|
|
2643
2757
|
}, {
|
|
2644
2758
|
default: w(() => [...l[47] ||= [s("删除", -1)]]),
|
|
2645
2759
|
_: 1
|
|
@@ -2648,44 +2762,44 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2648
2762
|
_: 1
|
|
2649
2763
|
})]),
|
|
2650
2764
|
c(M, {
|
|
2651
|
-
modelValue:
|
|
2652
|
-
"onUpdate:modelValue": l[22] ||= (e) =>
|
|
2765
|
+
modelValue: oe.value,
|
|
2766
|
+
"onUpdate:modelValue": l[22] ||= (e) => oe.value = e,
|
|
2653
2767
|
title: "属性弹框设置",
|
|
2654
2768
|
width: "500",
|
|
2655
2769
|
"append-to-body": ""
|
|
2656
2770
|
}, {
|
|
2657
|
-
footer: w(() => [c(h, { onClick: l[21] ||= (e) =>
|
|
2771
|
+
footer: w(() => [c(h, { onClick: l[21] ||= (e) => oe.value = !1 }, {
|
|
2658
2772
|
default: w(() => [...l[51] ||= [s("取消", -1)]]),
|
|
2659
2773
|
_: 1
|
|
2660
2774
|
}), c(h, {
|
|
2661
2775
|
type: "primary",
|
|
2662
|
-
onClick:
|
|
2776
|
+
onClick: at
|
|
2663
2777
|
}, {
|
|
2664
2778
|
default: w(() => [...l[52] ||= [s("保存", -1)]]),
|
|
2665
2779
|
_: 1
|
|
2666
2780
|
})]),
|
|
2667
|
-
default: w(() => [o("div",
|
|
2781
|
+
default: w(() => [o("div", nn, [
|
|
2668
2782
|
c(h, {
|
|
2669
2783
|
size: "small",
|
|
2670
|
-
onClick:
|
|
2784
|
+
onClick: it
|
|
2671
2785
|
}, {
|
|
2672
2786
|
default: w(() => [...l[48] ||= [s("+ 添加一行", -1)]]),
|
|
2673
2787
|
_: 1
|
|
2674
2788
|
}),
|
|
2675
2789
|
c(h, {
|
|
2676
2790
|
size: "small",
|
|
2677
|
-
onClick: l[20] ||= (e) =>
|
|
2791
|
+
onClick: l[20] ||= (e) => J.value?.click()
|
|
2678
2792
|
}, {
|
|
2679
2793
|
default: w(() => [...l[49] ||= [s("导入JSON", -1)]]),
|
|
2680
2794
|
_: 1
|
|
2681
2795
|
}),
|
|
2682
2796
|
o("input", {
|
|
2683
2797
|
ref_key: "popupConfigImportRef",
|
|
2684
|
-
ref:
|
|
2798
|
+
ref: J,
|
|
2685
2799
|
type: "file",
|
|
2686
2800
|
accept: ".json",
|
|
2687
2801
|
style: { display: "none" },
|
|
2688
|
-
onChange:
|
|
2802
|
+
onChange: ot
|
|
2689
2803
|
}, null, 544)
|
|
2690
2804
|
]), c(j, {
|
|
2691
2805
|
data: Y.value,
|
|
@@ -2759,7 +2873,7 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2759
2873
|
"is-collab": S(N).isCollabMode.value,
|
|
2760
2874
|
"collab-users": S(N).collabUsers.value,
|
|
2761
2875
|
"current-user": S(N).currentUser.value,
|
|
2762
|
-
"is-owner":
|
|
2876
|
+
"is-owner": re.value,
|
|
2763
2877
|
onSend: He,
|
|
2764
2878
|
onClose: l[24] ||= (e) => E.value = !1,
|
|
2765
2879
|
"unread-mention": S(N).unreadMention.value,
|
|
@@ -2775,16 +2889,16 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2775
2889
|
"is-owner",
|
|
2776
2890
|
"unread-mention"
|
|
2777
2891
|
]),
|
|
2778
|
-
c(
|
|
2892
|
+
c(Ge, {
|
|
2779
2893
|
modelValue: D.value,
|
|
2780
2894
|
"onUpdate:modelValue": l[26] ||= (e) => D.value = e,
|
|
2781
2895
|
"document-id": T.value,
|
|
2782
|
-
onApply:
|
|
2896
|
+
onApply: Ke
|
|
2783
2897
|
}, null, 8, ["modelValue", "document-id"])
|
|
2784
2898
|
]);
|
|
2785
2899
|
};
|
|
2786
2900
|
}
|
|
2787
|
-
}, [["__scopeId", "data-v-
|
|
2901
|
+
}, [["__scopeId", "data-v-f876f109"]]), on = l({
|
|
2788
2902
|
name: "YourCompanyExplosionDiagram",
|
|
2789
2903
|
props: {
|
|
2790
2904
|
docId: {
|
|
@@ -2822,14 +2936,18 @@ var jt = (e, { onRemoteChange: t } = {}) => {
|
|
|
2822
2936
|
uiConfig: {
|
|
2823
2937
|
type: Object,
|
|
2824
2938
|
default: () => ({})
|
|
2939
|
+
},
|
|
2940
|
+
aiApi: {
|
|
2941
|
+
type: [String, Object],
|
|
2942
|
+
default: null
|
|
2825
2943
|
}
|
|
2826
2944
|
},
|
|
2827
2945
|
setup(e, { slots: t }) {
|
|
2828
2946
|
return () => u("div", {
|
|
2829
2947
|
class: "yourcompany-explosion-diagram-wrapper",
|
|
2830
2948
|
style: "position:relative"
|
|
2831
|
-
}, [u(
|
|
2949
|
+
}, [u(an, { ...e }), u(D)]);
|
|
2832
2950
|
}
|
|
2833
2951
|
});
|
|
2834
2952
|
//#endregion
|
|
2835
|
-
export {
|
|
2953
|
+
export { on as default };
|