@billtaofbj/explosion-image 1.0.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/index.es.js CHANGED
@@ -2,31 +2,31 @@ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r
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, Bell as P, Brush as F, Clock as I, Close as L, Connection as R, Delete as z, Download as B, InfoFilled as V, Link as H, Loading as ee, Location as U, Minus as W, Monitor as G, MoreFilled as K, Plus as te, Promotion as ne, Right as re, SemiSelect as q, Share as ie, TrendCharts as J, Upload as ae, UploadFilled as oe } from "@element-plus/icons-vue";
5
+ import { ArrowDown as M, ArrowLeft as ee, Bell as N, Brush as P, Clock as F, Close as I, Connection as L, Delete as te, Download as R, InfoFilled as z, Link as B, Loading as V, Location as H, Minus as U, Monitor as W, MoreFilled as ne, Plus as G, Promotion as K, Right as re, SemiSelect as q, Share as ie, TrendCharts as ae, Upload as oe, UploadFilled as J } from "@element-plus/icons-vue";
6
6
  import Y from "axios";
7
- import * as X from "yjs";
8
- import { HocuspocusProvider as se } from "@hocuspocus/provider";
7
+ import * as se from "yjs";
8
+ import { HocuspocusProvider as ce } from "@hocuspocus/provider";
9
9
  //#region \0plugin-vue:export-helper
10
- var Z = (e, t) => {
10
+ var X = (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
- }, ce = { class: "chat-header" }, le = { class: "chat-header-left" }, ue = { class: "chat-title" }, Q = { class: "online-users-list" }, de = { class: "online-user-item" }, fe = { class: "online-user-name" }, pe = { key: 1 }, me = { class: "online-user-name" }, he = { class: "chat-header-right" }, ge = {
14
+ }, le = { class: "chat-header" }, Z = { class: "chat-header-left" }, ue = { class: "chat-title" }, Q = { class: "online-users-list" }, de = { class: "online-user-item" }, fe = { class: "online-user-name" }, pe = { key: 1 }, me = { class: "online-user-name" }, he = { class: "chat-header-right" }, ge = {
15
15
  key: 0,
16
16
  class: "chat-empty"
17
17
  }, _e = { class: "chat-empty-hint" }, ve = { key: 1 }, ye = { class: "message-content" }, be = {
18
18
  key: 0,
19
19
  class: "message-meta"
20
- }, $ = {
20
+ }, xe = {
21
21
  key: 0,
22
22
  class: "message-mention"
23
- }, xe = ["innerHTML"], Se = { class: "message-time" }, Ce = {
23
+ }, Se = ["innerHTML"], Ce = { class: "message-time" }, $ = {
24
24
  key: 1,
25
25
  class: "chat-message chat-message-ai"
26
26
  }, we = { class: "message-avatar ai" }, Te = { class: "chat-input-area" }, Ee = {
27
27
  key: 0,
28
28
  class: "mention-popup"
29
- }, De = ["onClick", "onMouseenter"], Oe = { key: 1 }, ke = /*#__PURE__*/ Z({
29
+ }, De = ["onClick", "onMouseenter"], Oe = { key: 1 }, ke = /*#__PURE__*/ X({
30
30
  __name: "AiChatPanel",
31
31
  props: {
32
32
  visible: {
@@ -77,44 +77,44 @@ var Z = (e, t) => {
77
77
  "clear-unread"
78
78
  ],
79
79
  setup(c, { emit: l }) {
80
- let p = c, m = l, g = _(""), b = _(null), D = _(null), O = _(!1), k = _([]), A = _(0), j = "", M = -1, N = {
80
+ let p = c, m = l, g = _(""), b = _(null), D = _(null), O = _(!1), k = _([]), A = _(0), j = "", M = -1, ee = {
81
81
  id: "ai-assistant",
82
82
  name: "AI助手",
83
83
  color: "#409EFF",
84
84
  isAi: !0
85
- }, F = t(() => {
85
+ }, P = t(() => {
86
86
  let e = p.currentUser.id, t = /* @__PURE__ */ new Set();
87
- return [N, ...p.collabUsers.filter((n) => {
87
+ return [ee, ...p.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
- }), I = t(() => F.value.length + 1), R = (e) => e.role === "ai" ? "chat-message-ai" : p.isCollab && e.user_id && e.user_id !== p.currentUser.id ? "chat-message-other" : "chat-message-user", B = (e) => e.role === "ai" ? { background: "linear-gradient(135deg, #409EFF, #337ECC)" } : { background: e.user_color || "#67C23A" }, V = (e) => (e.user_name || "U").charAt(0), H = (e) => {
93
+ }), F = t(() => P.value.length + 1), L = (e) => e.role === "ai" ? "chat-message-ai" : p.isCollab && e.user_id && e.user_id !== p.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 (!p.isCollab) return;
95
95
  let t = typeof e == "string" ? e : e.target?.value || g.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 = F.value.filter((t) => t.name && t.name.toLowerCase().includes(e.toLowerCase())), O.value = k.value.length > 0, A.value = 0;
99
+ j = e, M = r, k.value = P.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
  }
103
103
  O.value = !1;
104
- }, ee = () => {
104
+ }, V = () => {
105
105
  O.value && (A.value = Math.min(A.value + 1, k.value.length - 1));
106
- }, U = () => {
106
+ }, H = () => {
107
107
  O.value && (A.value = Math.max(A.value - 1, 0));
108
- }, W = (e) => {
108
+ }, U = (e) => {
109
109
  let t = g.value.slice(0, M), n = g.value.slice(M + j.length + 1);
110
110
  g.value = `${t}@${e.name} ${n}`, O.value = !1;
111
- }, K = (e) => {
111
+ }, ne = (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(), W(t);
117
+ e.preventDefault(), U(t);
118
118
  return;
119
119
  }
120
120
  }
@@ -128,24 +128,24 @@ var Z = (e, t) => {
128
128
  e && (n = e[1]);
129
129
  }
130
130
  m("send", t, { mentionedUser: n }), g.value = "", O.value = !1;
131
- }, te = () => {
131
+ }, G = () => {
132
132
  u(() => {
133
133
  b.value && (b.value.scrollTop = b.value.scrollHeight);
134
134
  });
135
135
  };
136
- return C(() => p.messages.length, te), C(() => p.messages, te, { deep: !0 }), (t, l) => {
136
+ return C(() => p.messages.length, G), C(() => p.messages, G, { deep: !0 }), (t, l) => {
137
137
  let u = y("el-icon"), p = y("el-tag"), _ = y("el-popover"), C = y("el-button"), j = y("el-input");
138
138
  return c.visible ? (h(), i("div", {
139
139
  key: 0,
140
140
  class: "ai-chat-panel",
141
141
  style: f({ width: c.panelWidth + "px" })
142
142
  }, [
143
- a("div", ce, [a("div", le, [
143
+ a("div", le, [a("div", Z, [
144
144
  s(u, {
145
145
  size: 18,
146
146
  color: "#409EFF"
147
147
  }, {
148
- default: w(() => [s(S(G))]),
148
+ default: w(() => [s(S(W))]),
149
149
  _: 1
150
150
  }),
151
151
  a("span", ue, x(c.isCollab ? "协作聊天" : "AI 助手"), 1),
@@ -161,7 +161,7 @@ var Z = (e, t) => {
161
161
  effect: "plain",
162
162
  class: "online-tag"
163
163
  }, {
164
- default: w(() => [o(x(I.value) + "人在线 ", 1)]),
164
+ default: w(() => [o(x(F.value) + "人在线 ", 1)]),
165
165
  _: 1
166
166
  })]),
167
167
  default: w(() => [a("div", Q, [a("div", de, [
@@ -180,7 +180,7 @@ var Z = (e, t) => {
180
180
  _: 1
181
181
  }, 8, ["type"]),
182
182
  l[4] ||= a("span", { class: "self-tag" }, "(我)", -1)
183
- ]), (h(!0), i(e, null, v(F.value, (e) => (h(), i("div", {
183
+ ]), (h(!0), i(e, null, v(P.value, (e) => (h(), i("div", {
184
184
  key: e.id || e.clientId,
185
185
  class: "online-user-item"
186
186
  }, [
@@ -191,7 +191,7 @@ var Z = (e, t) => {
191
191
  key: 0,
192
192
  size: 14
193
193
  }, {
194
- default: w(() => [s(S(G))]),
194
+ default: w(() => [s(S(W))]),
195
195
  _: 1
196
196
  })) : (h(), i("span", pe, x((e.name || "U").charAt(0)), 1))], 4),
197
197
  a("span", me, x(e.name || "未知用户"), 1),
@@ -227,7 +227,7 @@ var Z = (e, t) => {
227
227
  size: 18,
228
228
  color: "#F56C6C"
229
229
  }, {
230
- default: w(() => [s(S(P))]),
230
+ default: w(() => [s(S(N))]),
231
231
  _: 1
232
232
  })])) : r("", !0),
233
233
  s(C, {
@@ -238,7 +238,7 @@ var Z = (e, t) => {
238
238
  title: "清空对话"
239
239
  }, {
240
240
  default: w(() => [s(u, null, {
241
- default: w(() => [s(S(z))]),
241
+ default: w(() => [s(S(te))]),
242
242
  _: 1
243
243
  })]),
244
244
  _: 1
@@ -251,7 +251,7 @@ var Z = (e, t) => {
251
251
  title: "关闭"
252
252
  }, {
253
253
  default: w(() => [s(u, null, {
254
- default: w(() => [s(S(L))]),
254
+ default: w(() => [s(S(I))]),
255
255
  _: 1
256
256
  })]),
257
257
  _: 1
@@ -267,7 +267,7 @@ var Z = (e, t) => {
267
267
  size: 40,
268
268
  color: "#c0c4cc"
269
269
  }, {
270
- default: w(() => [s(S(G))]),
270
+ default: w(() => [s(S(W))]),
271
271
  _: 1
272
272
  }),
273
273
  a("p", null, x(c.isCollab ? "协作聊天室" : "你好!我是 AI 助手"), 1),
@@ -275,29 +275,29 @@ var Z = (e, t) => {
275
275
  ])) : r("", !0),
276
276
  (h(!0), i(e, null, v(c.messages, (e) => (h(), i("div", {
277
277
  key: e._msgId || e.time + e.content,
278
- class: d(["chat-message", R(e)])
278
+ class: d(["chat-message", L(e)])
279
279
  }, [a("div", {
280
280
  class: "message-avatar",
281
- style: f(B(e))
281
+ style: f(R(e))
282
282
  }, [e.role === "ai" ? (h(), n(u, {
283
283
  key: 0,
284
284
  size: 16
285
285
  }, {
286
- default: w(() => [s(S(G))]),
286
+ default: w(() => [s(S(W))]),
287
287
  _: 1
288
- })) : (h(), i("span", ve, x(V(e)), 1))], 4), a("div", ye, [
288
+ })) : (h(), i("span", ve, x(z(e)), 1))], 4), a("div", ye, [
289
289
  c.isCollab && e.role === "user" ? (h(), i("div", be, [a("span", {
290
290
  class: "message-sender",
291
291
  style: f({ color: e.user_color || "#67C23A" })
292
- }, x(e.user_name || "用户"), 5), e.mentioned_user ? (h(), i("span", $, "@" + x(e.mentioned_user), 1)) : r("", !0)])) : r("", !0),
292
+ }, x(e.user_name || "用户"), 5), e.mentioned_user ? (h(), i("span", xe, "@" + x(e.mentioned_user), 1)) : r("", !0)])) : r("", !0),
293
293
  a("div", {
294
294
  class: "message-text",
295
295
  innerHTML: e.content
296
- }, null, 8, xe),
297
- a("div", Se, x(e.time), 1)
296
+ }, null, 8, Se),
297
+ a("div", Ce, x(e.time), 1)
298
298
  ])], 2))), 128)),
299
- c.loading ? (h(), i("div", Ce, [a("div", we, [s(u, { size: 16 }, {
300
- default: w(() => [s(S(G))]),
299
+ c.loading ? (h(), i("div", $, [a("div", we, [s(u, { size: 16 }, {
300
+ default: w(() => [s(S(W))]),
301
301
  _: 1
302
302
  })]), l[7] ||= a("div", { class: "message-content" }, [a("div", { class: "message-text typing-indicator" }, [
303
303
  a("span"),
@@ -320,11 +320,11 @@ var Z = (e, t) => {
320
320
  },
321
321
  placeholder: c.isCollab ? "输入消息... @提及成员" : "输入消息...",
322
322
  onKeydown: [
323
- T(E(K, ["exact"]), ["enter"]),
324
- T(E(ee, ["prevent"]), ["down"]),
325
- T(E(U, ["prevent"]), ["up"])
323
+ T(E(ne, ["exact"]), ["enter"]),
324
+ T(E(V, ["prevent"]), ["down"]),
325
+ T(E(H, ["prevent"]), ["up"])
326
326
  ],
327
- onInput: H,
327
+ onInput: B,
328
328
  resize: "none"
329
329
  }, null, 8, [
330
330
  "modelValue",
@@ -334,7 +334,7 @@ var Z = (e, t) => {
334
334
  O.value ? (h(), i("div", Ee, [(h(!0), i(e, null, v(k.value, (e, t) => (h(), i("div", {
335
335
  key: e.id || e.clientId,
336
336
  class: d(["mention-item", { active: t === A.value }]),
337
- onClick: (t) => W(e),
337
+ onClick: (t) => U(e),
338
338
  onMouseenter: (e) => A.value = t
339
339
  }, [a("div", {
340
340
  class: "mention-avatar",
@@ -343,7 +343,7 @@ var Z = (e, t) => {
343
343
  key: 0,
344
344
  size: 12
345
345
  }, {
346
- default: w(() => [s(S(G))]),
346
+ default: w(() => [s(S(W))]),
347
347
  _: 1
348
348
  })) : (h(), i("span", Oe, x((e.name || "U").charAt(0)), 1))], 4), a("span", null, x(e.name), 1)], 42, De))), 128))])) : r("", !0),
349
349
  s(C, {
@@ -351,10 +351,10 @@ var Z = (e, t) => {
351
351
  type: "primary",
352
352
  circle: "",
353
353
  disabled: !g.value.trim() || c.loading,
354
- onClick: K
354
+ onClick: ne
355
355
  }, {
356
356
  default: w(() => [s(u, null, {
357
- default: w(() => [s(S(ne))]),
357
+ default: w(() => [s(S(K))]),
358
358
  _: 1
359
359
  })]),
360
360
  _: 1
@@ -513,8 +513,119 @@ function Ae() {
513
513
  };
514
514
  }
515
515
  //#endregion
516
+ //#region ../../src/composables/useAiApi.js
517
+ var je = [
518
+ "我可以帮您优化流程图布局、检查节点逻辑,或者提供流程设计建议。请问有什么需要帮助的?",
519
+ "这个流程图的节点连接看起来很清晰。建议检查一下是否有遗漏的分支或异常处理路径。",
520
+ "根据当前的流程结构,我建议在关键决策节点后添加明确的条件标注,使流程更易理解。",
521
+ "流程图中的泳道划分很合理。如果需要,我可以帮您分析各角色的职责分配是否均衡。",
522
+ "我可以帮您检查流程中是否存在循环依赖或死锁风险。需要我逐条分析吗?",
523
+ "建议在流程开始和结束节点使用统一的样式,这样可以让读者更快识别流程的起止点。",
524
+ "这个执行图的逻辑链路比较长,建议在中间添加一些检查点节点,便于流程监控和调试。",
525
+ "我可以帮您生成流程图的文字说明文档,方便团队成员理解流程细节。"
526
+ ];
527
+ function Me() {
528
+ return je[Math.floor(Math.random() * je.length)];
529
+ }
530
+ async function Ne(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 Pe(e) {
551
+ let t = _(!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 Me();
561
+ t.value = !0, n && n.abort(), n = new AbortController();
562
+ try {
563
+ return await Ne(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), Me());
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 Ne(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 je = "/api/document-versions", Me = 5e3, Ne = () => {
628
+ var Fe = "/api/document-versions", Ie = 5e3, Le = () => {
518
629
  let e = _([]), t = _(!1);
519
630
  return {
520
631
  versions: e,
@@ -522,13 +633,13 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
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 Y.post(je, {
636
+ let { data: a } = await Y.post(Fe, {
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: Me });
642
+ }, { timeout: Ie });
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 je = "/api/document-versions", Me = 5e3, Ne = () => {
538
649
  if (!n) return [];
539
650
  t.value = !0;
540
651
  try {
541
- let { data: t } = await Y.get(je, {
652
+ let { data: t } = await Y.get(Fe, {
542
653
  params: { document_id: n },
543
- timeout: Me
654
+ timeout: Ie
544
655
  });
545
656
  return e.value = t, t;
546
657
  } catch (t) {
@@ -551,26 +662,26 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
551
662
  },
552
663
  getVersionContent: async (e) => {
553
664
  try {
554
- let { data: t } = await Y.get(`${je}/${e}`, { timeout: Me });
665
+ let { data: t } = await Y.get(`${Fe}/${e}`, { timeout: Ie });
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
- }, Pe = { class: "version-history-panel" }, Fe = {
672
+ }, Re = { class: "version-history-panel" }, ze = {
562
673
  key: 0,
563
674
  class: "loading-state"
564
- }, Ie = {
675
+ }, Be = {
565
676
  key: 1,
566
677
  class: "empty-state"
567
- }, Le = {
678
+ }, Ve = {
568
679
  key: 2,
569
680
  class: "version-list"
570
- }, Re = {
681
+ }, He = {
571
682
  key: 0,
572
683
  class: "current-version"
573
- }, 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__*/ Z({
684
+ }, Ue = { class: "current-version-header" }, We = { class: "version-number" }, Ge = ["onClick"], Ke = { class: "version-number" }, qe = { class: "version-user" }, Je = { class: "panel-footer" }, Ye = /*#__PURE__*/ X({
574
685
  __name: "VersionHistoryPanel",
575
686
  props: {
576
687
  modelValue: {
@@ -584,7 +695,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
584
695
  },
585
696
  emits: ["update:modelValue", "apply"],
586
697
  setup(t, { expose: c, emit: l }) {
587
- let u = t, f = l, { versions: p, loading: m, loadVersions: g, getVersionContent: b } = Ne(), T = _(!1), E = _(null), D = _(!1), O = _(null);
698
+ let u = t, f = l, { versions: p, loading: m, loadVersions: g, getVersionContent: b } = Le(), T = _(!1), E = _(null), D = _(!1), O = _(null);
588
699
  C(() => u.modelValue, (e) => {
589
700
  T.value = e, e && u.documentId && (E.value = null, g(u.documentId).then((e) => {
590
701
  e && e.length > 0 && (O.value = e[0]);
@@ -606,7 +717,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
606
717
  }
607
718
  }, M = () => {
608
719
  T.value = !1;
609
- }, N = (e) => {
720
+ }, ee = (e) => {
610
721
  if (!e) return "";
611
722
  let t = new Date(e), n = (e) => String(e).padStart(2, "0");
612
723
  return `${t.getFullYear()}-${n(t.getMonth() + 1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`;
@@ -621,7 +732,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
621
732
  size: "420px",
622
733
  "before-close": M
623
734
  }, {
624
- footer: w(() => [a("div", We, [s(_, {
735
+ footer: w(() => [a("div", Je, [s(_, {
625
736
  type: "primary",
626
737
  disabled: !E.value,
627
738
  loading: D.value,
@@ -630,25 +741,25 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
630
741
  default: w(() => [...c[4] ||= [o(" 切换到此版本 ", -1)]]),
631
742
  _: 1
632
743
  }, 8, ["disabled", "loading"])])]),
633
- default: w(() => [a("div", Pe, [S(m) ? (h(), i("div", Fe, [s(l, { class: "is-loading" }, {
634
- default: w(() => [s(S(ee))]),
744
+ default: w(() => [a("div", Re, [S(m) ? (h(), i("div", ze, [s(l, { class: "is-loading" }, {
745
+ default: w(() => [s(S(V))]),
635
746
  _: 1
636
- }), c[1] ||= a("span", null, "加载中...", -1)])) : S(p).length === 0 ? (h(), i("div", Ie, [s(l, {
747
+ }), c[1] ||= a("span", null, "加载中...", -1)])) : S(p).length === 0 ? (h(), i("div", Be, [s(l, {
637
748
  size: 48,
638
749
  color: "#c0c4cc"
639
750
  }, {
640
- default: w(() => [s(S(I))]),
751
+ default: w(() => [s(S(F))]),
641
752
  _: 1
642
- }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (h(), i("div", Le, [O.value ? (h(), i("div", Re, [a("div", ze, [s(u, {
753
+ }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (h(), i("div", Ve, [O.value ? (h(), i("div", He, [a("div", Ue, [s(u, {
643
754
  type: "success",
644
755
  size: "small"
645
756
  }, {
646
757
  default: w(() => [...c[3] ||= [o("当前版本", -1)]]),
647
758
  _: 1
648
- }), a("span", Be, "v" + x(O.value.version_number), 1)])])) : r("", !0), s(g, null, {
759
+ }), a("span", We, "v" + x(O.value.version_number), 1)])])) : r("", !0), s(g, null, {
649
760
  default: w(() => [(h(!0), i(e, null, v(S(p), (e) => (h(), n(f, {
650
761
  key: e.id,
651
- timestamp: N(e.created_at),
762
+ timestamp: ee(e.created_at),
652
763
  placement: "top",
653
764
  type: E.value?.id === e.id ? "primary" : "",
654
765
  hollow: E.value?.id !== e.id
@@ -656,7 +767,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
656
767
  default: w(() => [a("div", {
657
768
  class: d(["version-item", { active: E.value?.id === e.id }]),
658
769
  onClick: (t) => k(e)
659
- }, [a("span", He, "版本号:v" + x(e.version_number), 1), a("span", Ue, "提交人:" + x(e.user_name || "未知用户"), 1)], 10, Ve)]),
770
+ }, [a("span", Ke, "版本号:v" + x(e.version_number), 1), a("span", qe, "提交人:" + x(e.user_name || "未知用户"), 1)], 10, Ge)]),
660
771
  _: 2
661
772
  }, 1032, [
662
773
  "timestamp",
@@ -669,13 +780,13 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
669
780
  }, 8, ["modelValue"]);
670
781
  };
671
782
  }
672
- }, [["__scopeId", "data-v-87924b7c"]]), Ke = { class: "toolbar" }, qe = { class: "toolbar-left" }, Je = { class: "toolbar-center" }, Ye = { class: "group-popover" }, Xe = { class: "group-popover-header" }, Ze = { class: "group-list" }, Qe = ["onClick"], $e = { class: "group-name" }, et = { class: "group-item-actions" }, tt = {
783
+ }, [["__scopeId", "data-v-87924b7c"]]), Xe = { class: "toolbar" }, Ze = { class: "toolbar-left" }, Qe = { class: "toolbar-center" }, $e = { class: "group-popover" }, et = { class: "group-popover-header" }, tt = { class: "group-list" }, nt = ["onClick"], rt = { class: "group-name" }, it = { class: "group-item-actions" }, at = {
673
784
  key: 1,
674
785
  class: "group-empty"
675
- }, nt = { class: "toolbar-right" }, rt = {
786
+ }, ot = { class: "toolbar-right" }, st = {
676
787
  key: 0,
677
788
  class: "collab-users"
678
- }, it = ["title"], at = /*#__PURE__*/ Z({
789
+ }, ct = ["title"], lt = /*#__PURE__*/ X({
679
790
  __name: "Toolbar",
680
791
  props: {
681
792
  title: {
@@ -707,6 +818,14 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
707
818
  showHistory: {
708
819
  type: Boolean,
709
820
  default: !1
821
+ },
822
+ showBackButton: {
823
+ type: Boolean,
824
+ default: !0
825
+ },
826
+ titleDisabled: {
827
+ type: Boolean,
828
+ default: !1
710
829
  }
711
830
  },
712
831
  emits: [
@@ -734,7 +853,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
734
853
  },
735
854
  polyline: {
736
855
  label: "折线",
737
- icon: R
856
+ icon: L
738
857
  },
739
858
  "right-angle": {
740
859
  label: "直角折线",
@@ -742,19 +861,19 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
742
861
  },
743
862
  curve: {
744
863
  label: "曲线",
745
- icon: J
864
+ icon: ae
746
865
  },
747
866
  wave: {
748
867
  label: "波浪线",
749
- icon: J
868
+ icon: ae
750
869
  },
751
870
  dashed: {
752
871
  label: "虚线",
753
- icon: W
872
+ icon: U
754
873
  },
755
874
  dotted: {
756
875
  label: "点线",
757
- icon: K
876
+ icon: ne
758
877
  },
759
878
  dashdot: {
760
879
  label: "点划线",
@@ -762,27 +881,29 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
762
881
  }
763
882
  }, m = t(() => p[l.lineStyle]?.label || "引线"), g = t(() => p[l.lineStyle]?.icon || q);
764
883
  return (t, l) => {
765
- let p = y("el-icon"), _ = y("el-button"), C = y("el-input"), T = y("el-tooltip"), D = y("el-divider"), O = y("el-dropdown-item"), k = y("el-dropdown-menu"), A = y("el-dropdown"), j = y("el-badge"), P = y("el-tag"), V = y("el-popover");
766
- return h(), i("div", Ke, [
767
- a("div", qe, [s(_, {
884
+ let p = y("el-icon"), _ = y("el-button"), C = y("el-input"), T = y("el-tooltip"), D = y("el-divider"), O = y("el-dropdown-item"), k = y("el-dropdown-menu"), A = y("el-dropdown"), j = y("el-badge"), N = y("el-tag"), z = y("el-popover");
885
+ return h(), i("div", Xe, [
886
+ a("div", Ze, [c.showBackButton ? (h(), n(_, {
887
+ key: 0,
768
888
  onClick: l[0] ||= (e) => t.$emit("back"),
769
889
  size: "small",
770
890
  circle: ""
771
891
  }, {
772
892
  default: w(() => [s(p, null, {
773
- default: w(() => [s(S(N))]),
893
+ default: w(() => [s(S(ee))]),
774
894
  _: 1
775
895
  })]),
776
896
  _: 1
777
- }), s(C, {
897
+ })) : r("", !0), s(C, {
778
898
  modelValue: u.value,
779
899
  "onUpdate:modelValue": l[1] ||= (e) => u.value = e,
780
900
  onBlur: l[2] ||= (e) => t.$emit("update:title", u.value),
901
+ disabled: c.titleDisabled,
781
902
  placeholder: "输入标题",
782
903
  class: "title-input",
783
904
  size: "small"
784
- }, null, 8, ["modelValue"])]),
785
- a("div", Je, [
905
+ }, null, 8, ["modelValue", "disabled"])]),
906
+ a("div", Qe, [
786
907
  s(T, {
787
908
  content: "添加标注",
788
909
  placement: "bottom"
@@ -793,7 +914,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
793
914
  onClick: l[3] ||= (e) => t.$emit("add-annotation")
794
915
  }, {
795
916
  default: w(() => [s(p, null, {
796
- default: w(() => [s(S(U))]),
917
+ default: w(() => [s(S(H))]),
797
918
  _: 1
798
919
  })]),
799
920
  _: 1
@@ -822,7 +943,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
822
943
  class: d({ "is-active": c.lineStyle === "polyline" })
823
944
  }, {
824
945
  default: w(() => [s(p, null, {
825
- default: w(() => [s(S(R))]),
946
+ default: w(() => [s(S(L))]),
826
947
  _: 1
827
948
  }), l[15] ||= o("折线 ", -1)]),
828
949
  _: 1
@@ -842,7 +963,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
842
963
  class: d({ "is-active": c.lineStyle === "curve" })
843
964
  }, {
844
965
  default: w(() => [s(p, null, {
845
- default: w(() => [s(S(J))]),
966
+ default: w(() => [s(S(ae))]),
846
967
  _: 1
847
968
  }), l[17] ||= o("曲线 ", -1)]),
848
969
  _: 1
@@ -852,7 +973,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
852
973
  class: d({ "is-active": c.lineStyle === "wave" })
853
974
  }, {
854
975
  default: w(() => [s(p, null, {
855
- default: w(() => [s(S(J))]),
976
+ default: w(() => [s(S(ae))]),
856
977
  _: 1
857
978
  }), l[18] ||= o("波浪线 ", -1)]),
858
979
  _: 1
@@ -863,7 +984,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
863
984
  class: d({ "is-active": c.lineStyle === "dashed" })
864
985
  }, {
865
986
  default: w(() => [s(p, null, {
866
- default: w(() => [s(S(W))]),
987
+ default: w(() => [s(S(U))]),
867
988
  _: 1
868
989
  }), l[19] ||= o("虚线 ", -1)]),
869
990
  _: 1
@@ -873,7 +994,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
873
994
  class: d({ "is-active": c.lineStyle === "dotted" })
874
995
  }, {
875
996
  default: w(() => [s(p, null, {
876
- default: w(() => [s(S(K))]),
997
+ default: w(() => [s(S(ne))]),
877
998
  _: 1
878
999
  }), l[20] ||= o("点线 ", -1)]),
879
1000
  _: 1
@@ -908,7 +1029,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
908
1029
  _: 1
909
1030
  }),
910
1031
  s(D, { direction: "vertical" }),
911
- s(V, {
1032
+ s(z, {
912
1033
  placement: "bottom",
913
1034
  width: 280,
914
1035
  trigger: "click"
@@ -929,15 +1050,15 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
929
1050
  ]),
930
1051
  _: 1
931
1052
  })]),
932
- default: w(() => [a("div", Ye, [
933
- a("div", Xe, [s(_, {
1053
+ default: w(() => [a("div", $e, [
1054
+ a("div", et, [s(_, {
934
1055
  size: "small",
935
1056
  onClick: l[5] ||= (e) => t.$emit("add-group", "new"),
936
1057
  type: "primary",
937
1058
  plain: ""
938
1059
  }, {
939
1060
  default: w(() => [s(p, null, {
940
- default: w(() => [s(S(te))]),
1061
+ default: w(() => [s(S(G))]),
941
1062
  _: 1
942
1063
  }), l[23] ||= o("新建分组 ", -1)]),
943
1064
  _: 1
@@ -947,7 +1068,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
947
1068
  onClick: l[6] ||= (e) => t.$emit("clear-group-filter")
948
1069
  }, {
949
1070
  default: w(() => [s(p, null, {
950
- default: w(() => [s(S(L))]),
1071
+ default: w(() => [s(S(I))]),
951
1072
  _: 1
952
1073
  }), l[24] ||= o("显示全部 ", -1)]),
953
1074
  _: 1
@@ -956,20 +1077,20 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
956
1077
  key: 0,
957
1078
  style: { margin: "8px 0" }
958
1079
  })) : r("", !0),
959
- a("div", Ze, [(h(!0), i(e, null, v(c.groups, (e) => (h(), i("div", {
1080
+ a("div", tt, [(h(!0), i(e, null, v(c.groups, (e) => (h(), i("div", {
960
1081
  key: e.id,
961
1082
  class: d(["group-item", { active: c.activeGroupId === e.id }])
962
1083
  }, [a("div", {
963
1084
  class: "group-item-main",
964
1085
  onClick: (n) => t.$emit("group-action", "filter", e.id)
965
- }, [a("span", $e, x(e.name), 1), c.activeGroupId === e.id ? (h(), n(P, {
1086
+ }, [a("span", rt, x(e.name), 1), c.activeGroupId === e.id ? (h(), n(N, {
966
1087
  key: 0,
967
1088
  size: "small",
968
1089
  type: "primary"
969
1090
  }, {
970
1091
  default: w(() => [...l[25] ||= [o("筛选", -1)]]),
971
1092
  _: 1
972
- })) : r("", !0)], 8, Qe), a("div", et, [
1093
+ })) : r("", !0)], 8, nt), a("div", it, [
973
1094
  s(T, {
974
1095
  content: "展开/折叠",
975
1096
  placement: "top"
@@ -997,7 +1118,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
997
1118
  onClick: E((n) => t.$emit("group-action", "color", e.id), ["stop"])
998
1119
  }, {
999
1120
  default: w(() => [s(p, null, {
1000
- default: w(() => [s(S(F))]),
1121
+ default: w(() => [s(S(P))]),
1001
1122
  _: 1
1002
1123
  })]),
1003
1124
  _: 1
@@ -1015,7 +1136,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1015
1136
  onClick: E((n) => t.$emit("group-action", "delete", e.id), ["stop"])
1016
1137
  }, {
1017
1138
  default: w(() => [s(p, null, {
1018
- default: w(() => [s(S(z))]),
1139
+ default: w(() => [s(S(te))]),
1019
1140
  _: 1
1020
1141
  })]),
1021
1142
  _: 1
@@ -1023,18 +1144,18 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1023
1144
  _: 2
1024
1145
  }, 1024)
1025
1146
  ])], 2))), 128))]),
1026
- c.groups.length ? r("", !0) : (h(), i("div", tt, "暂无分组"))
1147
+ c.groups.length ? r("", !0) : (h(), i("div", at, "暂无分组"))
1027
1148
  ])]),
1028
1149
  _: 1
1029
1150
  })
1030
1151
  ]),
1031
- a("div", nt, [
1032
- c.onlineUsers.length > 0 ? (h(), i("div", rt, [(h(!0), i(e, null, v(c.onlineUsers.slice(0, 5), (e) => (h(), i("div", {
1152
+ a("div", ot, [
1153
+ c.onlineUsers.length > 0 ? (h(), i("div", st, [(h(!0), i(e, null, v(c.onlineUsers.slice(0, 5), (e) => (h(), i("div", {
1033
1154
  key: e.clientId,
1034
1155
  class: "collab-avatar",
1035
1156
  style: f({ background: e.color }),
1036
1157
  title: e.name
1037
- }, x(e.name?.charAt(0)), 13, it))), 128))])) : r("", !0),
1158
+ }, x(e.name?.charAt(0)), 13, ct))), 128))])) : r("", !0),
1038
1159
  c.isJoinMode ? r("", !0) : (h(), n(_, {
1039
1160
  key: 1,
1040
1161
  size: "small",
@@ -1055,7 +1176,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1055
1176
  title: "分享链接"
1056
1177
  }, {
1057
1178
  default: w(() => [s(p, null, {
1058
- default: w(() => [s(S(H))]),
1179
+ default: w(() => [s(S(B))]),
1059
1180
  _: 1
1060
1181
  })]),
1061
1182
  _: 1
@@ -1119,7 +1240,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1119
1240
  onClick: l[10] ||= (e) => t.$refs.jsonInput.click()
1120
1241
  }, {
1121
1242
  default: w(() => [s(p, null, {
1122
- default: w(() => [s(S(ae))]),
1243
+ default: w(() => [s(S(oe))]),
1123
1244
  _: 1
1124
1245
  })]),
1125
1246
  _: 1
@@ -1138,7 +1259,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1138
1259
  onClick: l[12] ||= (e) => t.$emit("save")
1139
1260
  }, {
1140
1261
  default: w(() => [s(p, null, {
1141
- default: w(() => [s(S(B))]),
1262
+ default: w(() => [s(S(R))]),
1142
1263
  _: 1
1143
1264
  })]),
1144
1265
  _: 1
@@ -1151,7 +1272,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1151
1272
  onClick: l[13] ||= (e) => t.$emit("history")
1152
1273
  }, {
1153
1274
  default: w(() => [s(p, null, {
1154
- default: w(() => [s(S(I))]),
1275
+ default: w(() => [s(S(F))]),
1155
1276
  _: 1
1156
1277
  })]),
1157
1278
  _: 1
@@ -1160,7 +1281,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1160
1281
  ]);
1161
1282
  };
1162
1283
  }
1163
- }, [["__scopeId", "data-v-081fbd64"]]), ot = ["src"], st = ["onMousedown"], ct = {
1284
+ }, [["__scopeId", "data-v-1c493741"]]), ut = ["src"], dt = ["onMousedown"], ft = {
1164
1285
  class: "leader-line-svg",
1165
1286
  style: {
1166
1287
  left: 0,
@@ -1168,13 +1289,13 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1168
1289
  width: "100%",
1169
1290
  height: "100%"
1170
1291
  }
1171
- }, lt = ["id", "fill"], ut = [
1292
+ }, pt = ["id", "fill"], mt = [
1172
1293
  "d",
1173
1294
  "stroke",
1174
1295
  "stroke-width",
1175
1296
  "stroke-dasharray",
1176
1297
  "marker-start"
1177
- ], dt = ["onMousedown"], ft = ["onBlur"], pt = ["onMousedown"], mt = ["onMousedown"], ht = ["onMousedown"], gt = /*#__PURE__*/ Z({
1298
+ ], ht = ["onMousedown"], gt = ["onBlur"], _t = ["onMousedown"], vt = ["onMousedown"], yt = ["onMousedown"], bt = /*#__PURE__*/ X({
1178
1299
  __name: "AnnotationCanvas",
1179
1300
  props: {
1180
1301
  imageUrl: String,
@@ -1240,50 +1361,50 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1240
1361
  r.background = `rgba(${parseInt(n.slice(1, 3), 16)}, ${parseInt(n.slice(3, 5), 16)}, ${parseInt(n.slice(5, 7), 16)}, ${t})`;
1241
1362
  }
1242
1363
  return r;
1243
- }, N = (e) => ({ background: e.numberColor || e.color || "#e74c3c" }), P = (e) => {
1364
+ }, ee = (e) => ({ background: e.numberColor || e.color || "#e74c3c" }), N = (e) => {
1244
1365
  let t = {
1245
1366
  fontFamily: e.fontFamily || "inherit",
1246
1367
  fontSize: e.fontSize ? e.fontSize + "px" : "inherit"
1247
1368
  };
1248
1369
  return e.textColor && (t.color = e.textColor), e.fontWeight === "bold" ? t.fontWeight = "bold" : e.fontWeight === "bolder" && (t.fontWeight = "bolder"), e.fontStyle === "italic" && (t.fontStyle = "italic"), e.fontStyle === "oblique" && (t.fontStyle = "oblique"), e.textDecoration === "underline" ? t.textDecoration = "underline" : e.textDecoration === "line-through" ? t.textDecoration = "line-through" : e.textDecoration === "underline line-through" && (t.textDecoration = "underline line-through"), t;
1249
- }, F = (e) => ({
1370
+ }, P = (e) => ({
1250
1371
  left: e.x + "%",
1251
1372
  top: e.y + "%"
1252
- }), I = (e) => {
1373
+ }), F = (e) => {
1253
1374
  let t = {
1254
1375
  left: e.x + "%",
1255
1376
  top: e.y + "%",
1256
1377
  background: e.color || "#e74c3c"
1257
1378
  };
1258
1379
  return e.pointStyle === "square" ? t.borderRadius = "2px" : e.pointStyle === "diamond" ? (t.borderRadius = "2px", t.transform = "translate(-50%, -50%) rotate(45deg)") : e.pointStyle === "arrow" && (t.background = "transparent", t.border = "none", t.width = "0", t.height = "0", t.boxShadow = "none"), t;
1259
- }, L = null, R = null, z = (e, t) => {
1260
- l("select", e), R = "label", C.value = e.id, b.value = !0, L = {
1380
+ }, I = null, L = null, te = (e, t) => {
1381
+ l("select", e), L = "label", C.value = e.id, b.value = !0, I = {
1261
1382
  ann: e,
1262
1383
  startX: t.clientX,
1263
1384
  startY: t.clientY,
1264
1385
  origLabelX: e.labelX || 0,
1265
1386
  origLabelY: e.labelY || 0
1266
- }, document.addEventListener("mousemove", V), document.addEventListener("mouseup", H);
1267
- }, B = (e, t) => {
1268
- l("select", e), R = "dot", C.value = e.id, b.value = !0, L = {
1387
+ }, document.addEventListener("mousemove", z), document.addEventListener("mouseup", B);
1388
+ }, R = (e, t) => {
1389
+ l("select", e), L = "dot", C.value = e.id, b.value = !0, I = {
1269
1390
  ann: e,
1270
1391
  startX: t.clientX,
1271
1392
  startY: t.clientY,
1272
1393
  origX: e.x,
1273
1394
  origY: e.y
1274
- }, document.addEventListener("mousemove", V), document.addEventListener("mouseup", H);
1275
- }, V = (e) => {
1276
- if (!L) return;
1277
- let t = e.clientX - L.startX, n = e.clientY - L.startY;
1278
- if (R === "label") L.ann.labelX = L.origLabelX + t, L.ann.labelY = L.origLabelY + n;
1279
- else if (R === "dot") {
1395
+ }, document.addEventListener("mousemove", z), document.addEventListener("mouseup", B);
1396
+ }, z = (e) => {
1397
+ if (!I) return;
1398
+ let t = e.clientX - I.startX, n = e.clientY - I.startY;
1399
+ if (L === "label") I.ann.labelX = I.origLabelX + t, I.ann.labelY = I.origLabelY + n;
1400
+ else if (L === "dot") {
1280
1401
  let e = u.value;
1281
1402
  if (!e) return;
1282
- let r = e.querySelector(".image-wrapper").getBoundingClientRect(), i = Math.max(0, Math.min(100, L.origX + t / r.width * 100)), a = Math.max(0, Math.min(100, L.origY + n / r.height * 100));
1283
- L.ann.x = Math.round(i * 10) / 10, L.ann.y = Math.round(a * 10) / 10;
1403
+ let r = e.querySelector(".image-wrapper").getBoundingClientRect(), i = Math.max(0, Math.min(100, I.origX + t / r.width * 100)), a = Math.max(0, Math.min(100, I.origY + n / r.height * 100));
1404
+ I.ann.x = Math.round(i * 10) / 10, I.ann.y = Math.round(a * 10) / 10;
1284
1405
  }
1285
- }, H = () => {
1286
- b.value = !1, C.value = null, L = null, R = null, l("change"), document.removeEventListener("mousemove", V), document.removeEventListener("mouseup", H);
1406
+ }, B = () => {
1407
+ b.value = !1, C.value = null, I = null, L = null, l("change"), document.removeEventListener("mousemove", z), document.removeEventListener("mouseup", B);
1287
1408
  };
1288
1409
  return r({ recalculateSize: k }), (t, r) => {
1289
1410
  let o = y("el-icon");
@@ -1305,7 +1426,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1305
1426
  ref: p,
1306
1427
  class: "annotation-image",
1307
1428
  draggable: "false"
1308
- }, null, 40, ot), (h(!0), i(e, null, v(T.value, (e) => (h(), i("div", {
1429
+ }, null, 40, ut), (h(!0), i(e, null, v(T.value, (e) => (h(), i("div", {
1309
1430
  key: e.id,
1310
1431
  class: d(["annotation-group", {
1311
1432
  selected: n.selectedId === e.id,
@@ -1313,7 +1434,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1313
1434
  }]),
1314
1435
  onMousedown: E((n) => t.$emit("select", e), ["stop"])
1315
1436
  }, [
1316
- (h(), i("svg", ct, [a("defs", null, [a("marker", {
1437
+ (h(), i("svg", ft, [a("defs", null, [a("marker", {
1317
1438
  id: "arrow-start-" + e.id,
1318
1439
  markerWidth: "10",
1319
1440
  markerHeight: "7",
@@ -1321,58 +1442,58 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1321
1442
  refY: "3.5",
1322
1443
  orient: "auto",
1323
1444
  fill: e.lineColor || (n.selectedId === e.id ? "#409EFF" : e.color || "#e74c3c")
1324
- }, [...r[2] ||= [a("polygon", { points: "10 0, 0 3.5, 10 7" }, null, -1)]], 8, lt)]), a("path", {
1445
+ }, [...r[2] ||= [a("polygon", { points: "10 0, 0 3.5, 10 7" }, null, -1)]], 8, pt)]), a("path", {
1325
1446
  d: j(e),
1326
1447
  fill: "none",
1327
1448
  stroke: e.lineColor || (n.selectedId === e.id ? "#409EFF" : e.color || "#e74c3c"),
1328
1449
  "stroke-width": e.strokeWidth || 1.5,
1329
1450
  "stroke-dasharray": D.value,
1330
1451
  "marker-start": e.pointStyle === "arrow" ? `url(#arrow-start-${e.id})` : ""
1331
- }, null, 8, ut)])),
1452
+ }, null, 8, mt)])),
1332
1453
  a("div", {
1333
1454
  class: d(["annotation-label", { dragging: b.value && C.value === e.id }]),
1334
1455
  style: f(M(e)),
1335
- onMousedown: E((t) => z(e, t), ["stop"])
1456
+ onMousedown: E((t) => te(e, t), ["stop"])
1336
1457
  }, [a("span", {
1337
1458
  class: "annotation-number",
1338
- style: f(N(e))
1459
+ style: f(ee(e))
1339
1460
  }, x(e.number), 5), a("span", {
1340
1461
  class: "annotation-text",
1341
- style: f(P(e)),
1462
+ style: f(N(e)),
1342
1463
  contenteditable: "",
1343
1464
  onBlur: (t) => {
1344
1465
  e.text = t.target.textContent, l("change");
1345
1466
  },
1346
1467
  onMousedown: r[0] ||= E(() => {}, ["stop"])
1347
- }, x(e.text), 45, ft)], 46, dt),
1468
+ }, x(e.text), 45, gt)], 46, ht),
1348
1469
  e.pointStyle === "flag" ? (h(), i("div", {
1349
1470
  key: 0,
1350
1471
  class: "annotation-flag",
1351
- style: f(F(e)),
1352
- onMousedown: E((t) => B(e, t), ["stop"])
1472
+ style: f(P(e)),
1473
+ onMousedown: E((t) => R(e, t), ["stop"])
1353
1474
  }, [a("div", {
1354
1475
  class: "flag-pole",
1355
1476
  style: f({ background: e.color || "#e74c3c" })
1356
1477
  }, null, 4), a("div", {
1357
1478
  class: "flag-cloth",
1358
1479
  style: f({ background: e.color || "#e74c3c" })
1359
- }, null, 4)], 44, pt)) : e.pointStyle === "arrow" ? (h(), i("div", {
1480
+ }, null, 4)], 44, _t)) : e.pointStyle === "arrow" ? (h(), i("div", {
1360
1481
  key: 2,
1361
1482
  class: d(["annotation-dot arrow-point", { dragging: b.value && C.value === e.id }]),
1362
- style: f(I(e)),
1363
- onMousedown: E((t) => B(e, t), ["stop"])
1364
- }, null, 46, ht)) : (h(), i("div", {
1483
+ style: f(F(e)),
1484
+ onMousedown: E((t) => R(e, t), ["stop"])
1485
+ }, null, 46, yt)) : (h(), i("div", {
1365
1486
  key: 1,
1366
1487
  class: d(["annotation-dot", [e.pointStyle || "circle", { dragging: b.value && C.value === e.id }]]),
1367
- style: f(I(e)),
1368
- onMousedown: E((t) => B(e, t), ["stop"])
1369
- }, null, 46, mt))
1370
- ], 42, st))), 128))], 4)) : (h(), i("div", {
1488
+ style: f(F(e)),
1489
+ onMousedown: E((t) => R(e, t), ["stop"])
1490
+ }, null, 46, vt))
1491
+ ], 42, dt))), 128))], 4)) : (h(), i("div", {
1371
1492
  key: 1,
1372
1493
  class: "upload-placeholder",
1373
1494
  onClick: r[1] ||= (e) => t.$emit("upload-image")
1374
1495
  }, [s(o, { size: "48" }, {
1375
- default: w(() => [s(S(oe))]),
1496
+ default: w(() => [s(S(J))]),
1376
1497
  _: 1
1377
1498
  }), r[3] ||= a("p", null, "点击上传图片", -1)]))], 2);
1378
1499
  };
@@ -1380,8 +1501,8 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1380
1501
  }, [["__scopeId", "data-v-d9ef76f4"]]);
1381
1502
  //#endregion
1382
1503
  //#region ../../src/composables/useExplosionCollaboration.js
1383
- function _t(e, { roomPrefix: t, syncKey: n = "_data" } = {}) {
1384
- let r = new X.Doc(), i = _(!1), a = _(!1), o = _(!1), s = _(!1), c = _([]), l = null, u = null, d = null, f = null, p = !1, h = null, g = `ws://${window.location.hostname || "localhost"}:1234`, v = `${t}-${e}`, y = () => {
1504
+ function xt(e, { roomPrefix: t, syncKey: n = "_data" } = {}) {
1505
+ let r = new se.Doc(), i = _(!1), a = _(!1), o = _(!1), s = _(!1), c = _([]), l = null, u = null, d = null, f = null, p = !1, h = null, g = `ws://${window.location.hostname || "localhost"}:1234`, v = `${t}-${e}`, y = () => {
1385
1506
  b(), h = setInterval(() => {
1386
1507
  if (l && l.connection && l.connection.ws && l.connection.ws.readyState === WebSocket.CLOSED) try {
1387
1508
  l.connect();
@@ -1392,7 +1513,7 @@ function _t(e, { roomPrefix: t, syncKey: n = "_data" } = {}) {
1392
1513
  }, b = () => {
1393
1514
  h &&= (clearInterval(h), null);
1394
1515
  };
1395
- l = new se({
1516
+ l = new ce({
1396
1517
  url: g,
1397
1518
  name: v,
1398
1519
  document: r,
@@ -1495,8 +1616,8 @@ function _t(e, { roomPrefix: t, syncKey: n = "_data" } = {}) {
1495
1616
  }
1496
1617
  //#endregion
1497
1618
  //#region ../../src/composables/useExplosionImageCollaboration.js
1498
- var vt = (e, { onRemoteChange: t } = {}) => {
1499
- let n = _t(e, {
1619
+ var St = (e, { onRemoteChange: t } = {}) => {
1620
+ let n = xt(e, {
1500
1621
  roomPrefix: "explosion-image",
1501
1622
  syncKey: "_data"
1502
1623
  });
@@ -1525,39 +1646,78 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1525
1646
  pushToYjs: r,
1526
1647
  pullFromYjs: i
1527
1648
  };
1528
- }, yt = { class: "explosion-image-editor" }, bt = { class: "editor-body" }, xt = { class: "canvas-area" }, St = { class: "props-panel" }, Ct = { class: "prop-row" }, wt = { class: "prop-row" }, Tt = { class: "prop-row" }, Et = { class: "prop-row" }, Dt = { class: "prop-row" }, Ot = { class: "prop-row" }, kt = { class: "prop-row" }, At = { class: "prop-row" }, jt = { class: "prop-row" }, Mt = { class: "prop-row" }, Nt = { class: "prop-row" }, Pt = { class: "prop-row" }, Ft = { class: "font-style-btns" }, It = { class: "prop-row" }, Lt = { class: "font-style-btns" }, Rt = { class: "prop-row" }, zt = { class: "prop-row" }, Bt = { class: "prop-row" }, Vt = { class: "prop-row" }, Ht = {
1649
+ }, Ct = { class: "explosion-image-editor" }, wt = { class: "editor-body" }, Tt = { class: "canvas-area" }, Et = { class: "props-panel" }, Dt = { class: "prop-row" }, Ot = { class: "prop-row" }, kt = { class: "prop-row" }, At = { class: "prop-row" }, jt = { class: "prop-row" }, Mt = { class: "prop-row" }, Nt = { class: "prop-row" }, Pt = { class: "prop-row" }, Ft = { class: "prop-row" }, It = { class: "prop-row" }, Lt = { class: "prop-row" }, Rt = { class: "prop-row" }, zt = { class: "font-style-btns" }, Bt = { class: "prop-row" }, Vt = { class: "font-style-btns" }, Ht = { class: "prop-row" }, Ut = { class: "prop-row" }, Wt = { class: "prop-row" }, Gt = { class: "prop-row" }, Kt = {
1529
1650
  key: 0,
1530
1651
  class: "prop-row filter-info"
1531
- }, Ut = {
1652
+ }, qt = {
1532
1653
  key: 1,
1533
1654
  class: "no-selection"
1534
- }, Wt = { class: "color-dialog-body" }, Gt = "explosion-image", Kt = /*#__PURE__*/ Z({
1655
+ }, Jt = { class: "color-dialog-body" }, Yt = "explosion-image", Xt = /*#__PURE__*/ X({
1535
1656
  __name: "ExplosionImageEditor",
1657
+ props: {
1658
+ docId: {
1659
+ type: [Number, String],
1660
+ default: null
1661
+ },
1662
+ apiBase: {
1663
+ type: String,
1664
+ default: "/api"
1665
+ },
1666
+ saveApi: {
1667
+ type: [String, Function],
1668
+ default: null
1669
+ },
1670
+ loadApi: {
1671
+ type: [String, Function],
1672
+ default: null
1673
+ },
1674
+ wsUrl: {
1675
+ type: String,
1676
+ default: ""
1677
+ },
1678
+ user: {
1679
+ type: Object,
1680
+ default: null
1681
+ },
1682
+ uiConfig: {
1683
+ type: Object,
1684
+ default: () => ({})
1685
+ },
1686
+ aiApi: {
1687
+ type: [String, Object],
1688
+ default: null
1689
+ }
1690
+ },
1536
1691
  setup(c) {
1537
- let l = O(), u = k(), d = _(null), f = _(null), b = _(!1), T = _(!1), { saveVersion: E } = Ne(), D = Ae(), M = g({
1692
+ let l = c, u = t(() => ({
1693
+ backButton: "show",
1694
+ titleEditable: !0,
1695
+ authorEditable: !0,
1696
+ ...l.uiConfig
1697
+ })), d = t(() => l.docId ?? f.params.id), f = O(), b = k(), T = _(l.docId ?? null), E = _(null), D = _(!1), M = _(!1), { saveVersion: ee } = Le(), N = Ae(), P = Pe(() => l.aiApi), F = g({
1538
1698
  title: "图片标注",
1539
1699
  imageUrl: "",
1540
1700
  annotations: [],
1541
1701
  groups: []
1542
- }), N = _(!1), P = _(!1), F = _(!1), I = null, R = _("straight"), z = _(null), B = _(null), H = _(null), ee = 0, U = _(null), W = _([]), G = t(() => U.value ? M.annotations.filter((e) => e.groupId === U.value) : M.annotations), K = () => f.value?.click(), te = async (e) => {
1702
+ }), L = _(!1), te = _(!1), R = _(!1), B = null, V = _("straight"), H = _(null), U = _(null), W = _(null), ne = 0, G = _(null), K = _([]), re = t(() => G.value ? F.annotations.filter((e) => e.groupId === G.value) : F.annotations), q = () => E.value?.click(), ie = async (e) => {
1543
1703
  let t = e.target.files?.[0];
1544
1704
  if (!t) return;
1545
1705
  let n = new FormData();
1546
1706
  n.append("file", t);
1547
1707
  try {
1548
- let e = await Y.post("/api/files/upload/image", n);
1549
- M.imageUrl = e.data.url || e.data.file_path, $();
1708
+ let e = await Y.post(`${l.apiBase}/files/upload/image`, n);
1709
+ F.imageUrl = e.data.url || e.data.file_path, $();
1550
1710
  } catch {
1551
1711
  A.error("上传失败");
1552
1712
  }
1553
- }, ne = () => {
1554
- if (!M.imageUrl) {
1713
+ }, ae = () => {
1714
+ if (!F.imageUrl) {
1555
1715
  A.warning("请先上传图片");
1556
1716
  return;
1557
1717
  }
1558
- let e = M.annotations.reduce((e, t) => Math.max(e, t.number), 0);
1559
- M.annotations.push({
1560
- id: `ann-${++ee}-${Date.now()}`,
1718
+ let e = F.annotations.reduce((e, t) => Math.max(e, t.number), 0);
1719
+ F.annotations.push({
1720
+ id: `ann-${++ne}-${Date.now()}`,
1561
1721
  number: e + 1,
1562
1722
  text: "",
1563
1723
  x: 50,
@@ -1579,113 +1739,128 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1579
1739
  textDecoration: "",
1580
1740
  groupId: ""
1581
1741
  }), $();
1582
- }, re = (e) => {
1583
- z.value = e.id, B.value = e;
1584
- }, q = (e, t) => {
1585
- B.value && (B.value[e] === t ? B.value[e] = "" : B.value[e] = t);
1586
- }, ie = () => {
1587
- B.value && (B.value.fontFamily = "", B.value.fontSize = 13, B.value.fontWeight = "", B.value.fontStyle = "", B.value.textDecoration = "");
1588
- }, J = () => {
1589
- M.annotations = M.annotations.filter((e) => e.id !== z.value), z.value = null, B.value = null, $();
1590
- }, ae = (e) => {
1742
+ }, oe = (e) => {
1743
+ H.value = e.id, U.value = e;
1744
+ }, J = (e, t) => {
1745
+ U.value && (U.value[e] === t ? U.value[e] = "" : U.value[e] = t);
1746
+ }, se = () => {
1747
+ U.value && (U.value.fontFamily = "", U.value.fontSize = 13, U.value.fontWeight = "", U.value.fontStyle = "", U.value.textDecoration = "");
1748
+ }, ce = () => {
1749
+ F.annotations = F.annotations.filter((e) => e.id !== H.value), H.value = null, U.value = null, $();
1750
+ }, X = (e) => {
1591
1751
  e === "new" && j.prompt("分组名称", "新建分组", { inputPlaceholder: "名称" }).then(({ value: e }) => {
1592
- e && (M.groups.push({
1752
+ e && (F.groups.push({
1593
1753
  id: `grp-${Date.now()}`,
1594
1754
  name: e
1595
1755
  }), $());
1596
1756
  }).catch(() => {});
1597
- }, oe = (e, t) => {
1598
- e === "filter" ? U.value = U.value === t ? null : t : e === "collapse" ? le(t) : e === "color" ? (se.value = t, X.value = !0) : e === "delete" && j.confirm("确定删除该分组?分组内的标注将保留,但分组关系将被移除。", "删除分组", { type: "warning" }).then(() => {
1599
- M.annotations.forEach((e) => {
1757
+ }, le = (e, t) => {
1758
+ e === "filter" ? G.value = G.value === t ? null : t : e === "collapse" ? fe(t) : e === "color" ? (ue.value = t, Z.value = !0) : e === "delete" && j.confirm("确定删除该分组?分组内的标注将保留,但分组关系将被移除。", "删除分组", { type: "warning" }).then(() => {
1759
+ F.annotations.forEach((e) => {
1600
1760
  e.groupId === t && (e.groupId = "");
1601
- }), M.groups = M.groups.filter((e) => e.id !== t), U.value === t && (U.value = null), A.success("分组已删除"), $();
1761
+ }), F.groups = F.groups.filter((e) => e.id !== t), G.value === t && (G.value = null), A.success("分组已删除"), $();
1602
1762
  }).catch(() => {});
1603
- }, X = _(!1), se = _(null), Z = _("#e74c3c"), ce = () => {
1604
- M.annotations.forEach((e) => {
1605
- e.groupId === se.value && (e.color = Z.value, e.numberColor = Z.value, e.lineColor = Z.value, e.textColor = Z.value);
1606
- }), X.value = !1, A.success("颜色已更新"), $();
1607
- }, le = (e) => {
1608
- let t = W.value.indexOf(e);
1609
- t === -1 ? W.value.push(e) : W.value.splice(t, 1);
1610
- }, ue = () => {
1611
- U.value = null, W.value = [];
1612
- }, Q = async () => {
1613
- if (N.value && I?.collaborationClosed.value && !F.value) {
1763
+ }, Z = _(!1), ue = _(null), Q = _("#e74c3c"), de = () => {
1764
+ F.annotations.forEach((e) => {
1765
+ e.groupId === ue.value && (e.color = Q.value, e.numberColor = Q.value, e.lineColor = Q.value, e.textColor = Q.value);
1766
+ }), Z.value = !1, A.success("颜色已更新"), $();
1767
+ }, fe = (e) => {
1768
+ let t = K.value.indexOf(e);
1769
+ t === -1 ? K.value.push(e) : K.value.splice(t, 1);
1770
+ }, pe = () => {
1771
+ G.value = null, K.value = [];
1772
+ }, me = async () => {
1773
+ if (L.value && B?.collaborationClosed.value && !R.value) {
1614
1774
  A.warning("协作已关闭,无法保存");
1615
1775
  return;
1616
1776
  }
1617
1777
  try {
1618
1778
  let e = {
1619
- title: M.title,
1779
+ title: F.title,
1620
1780
  view_type: "image",
1621
1781
  config: JSON.stringify({
1622
- imageUrl: M.imageUrl,
1623
- annotations: M.annotations,
1624
- groups: M.groups,
1625
- lineStyle: R.value
1782
+ imageUrl: F.imageUrl,
1783
+ annotations: F.annotations,
1784
+ groups: F.groups,
1785
+ lineStyle: V.value
1626
1786
  })
1627
1787
  };
1628
- d.value ? await Y.put(`/api/explosion-views/${d.value}`, e) : d.value = (await Y.post("/api/explosion-views/", e)).data.id, A.success("保存成功"), E({
1629
- documentId: d.value,
1788
+ if (typeof l.saveApi == "function") {
1789
+ let t = await l.saveApi(e, T.value);
1790
+ t?.id && (T.value = t.id);
1791
+ } else if (typeof l.saveApi == "string") T.value ? await Y.put(l.saveApi, e) : T.value = (await Y.post(l.saveApi, e)).data.id;
1792
+ else {
1793
+ let t = l.apiBase;
1794
+ T.value ? await Y.put(`${t}/explosion-views/${T.value}`, e) : T.value = (await Y.post(`${t}/explosion-views/`, e)).data.id;
1795
+ }
1796
+ A.success("保存成功"), ee({
1797
+ documentId: T.value,
1630
1798
  docType: "image",
1631
1799
  content: JSON.stringify({
1632
- imageUrl: M.imageUrl,
1633
- annotations: M.annotations,
1634
- groups: M.groups,
1635
- lineStyle: R.value
1800
+ imageUrl: F.imageUrl,
1801
+ annotations: F.annotations,
1802
+ groups: F.groups,
1803
+ lineStyle: V.value
1636
1804
  }),
1637
- userId: String(D.currentUser.value?.id || ""),
1638
- userName: D.currentUser.value?.name || "未知"
1805
+ userId: String(N.currentUser.value?.id || ""),
1806
+ userName: N.currentUser.value?.name || "未知"
1639
1807
  });
1640
1808
  } catch {
1641
1809
  A.error("保存失败");
1642
1810
  }
1643
- }, de = async () => {
1644
- if (l.params.id) try {
1645
- let e = (await Y.get(`/api/explosion-views/${l.params.id}`)).data;
1646
- if (d.value = e.id, M.title = e.title, e.config) {
1811
+ }, he = async () => {
1812
+ if (d.value) try {
1813
+ let e;
1814
+ if (typeof l.loadApi == "function") e = await l.loadApi(d.value);
1815
+ else if (typeof l.loadApi == "string") e = (await Y.get(l.loadApi)).data;
1816
+ else {
1817
+ let t = l.apiBase;
1818
+ e = (await Y.get(`${t}/explosion-views/${d.value}`)).data;
1819
+ }
1820
+ if (T.value = e.id, F.title = e.title, e.config) {
1647
1821
  let t = JSON.parse(e.config);
1648
- M.imageUrl = t.imageUrl || "", M.annotations = t.annotations || [], M.groups = t.groups || [], R.value = t.lineStyle || "straight";
1822
+ F.imageUrl = t.imageUrl || "", F.annotations = t.annotations || [], F.groups = t.groups || [], V.value = t.lineStyle || "straight";
1649
1823
  }
1650
1824
  } catch (e) {
1651
1825
  console.error(e);
1652
1826
  }
1653
- }, fe = () => u.push("/"), pe = [
1654
- "我可以帮您优化图片标注、检查注释内容,或者提供标注建议。请问有什么需要帮助的?",
1655
- "这张图片的标注很详细。建议检查标注线条是否清晰,避免与其他标注重叠。",
1656
- "根据当前的标注内容,我建议为关键部件添加更详细的文字说明。",
1657
- "我可以帮您检查标注中是否有遗漏的区域或重复的编号。需要我逐个分析吗?",
1658
- "建议使用不同颜色的标注来区分不同类别的部件,提高可读性。",
1659
- "图片标注的分组功能可以帮助您管理复杂的标注。建议按功能模块进行分组。",
1660
- "我可以帮您将标注信息整理成表格,方便后续查阅和修改。",
1661
- "标注的连线样式建议统一,直线适合简单标注,折线适合复杂场景。"
1662
- ], me = async (e, t = {}) => {
1663
- let n = d.value ? `${Gt}-${d.value}` : null;
1664
- await D.sendMessage(e, {
1827
+ }, ge = () => {
1828
+ l.docId ?? b.push("/");
1829
+ }, _e = async (e, t = {}) => {
1830
+ let n = T.value ? `${Yt}-${T.value}` : null;
1831
+ await N.sendMessage(e, {
1665
1832
  ...t,
1666
1833
  roomId: n
1667
1834
  });
1668
- let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a = D.collabUsers.value.filter((e) => e.name !== D.currentUser.value.name);
1669
- (!r || i || a.length === 0) && (D.loading.value = !0, setTimeout(() => {
1670
- D.sendAiMessage(pe[Math.floor(Math.random() * pe.length)], n), D.loading.value = !1;
1671
- }, 800 + Math.random() * 1200));
1672
- }, he = () => {
1673
- let e = d.value ? `${Gt}-${d.value}` : null;
1674
- D.clearMessages(e);
1675
- }, ge = () => {
1676
- if (!d.value) {
1835
+ let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a = N.collabUsers.value.filter((e) => e.name !== N.currentUser.value.name);
1836
+ if (!r || i || a.length === 0) {
1837
+ N.loading.value = !0;
1838
+ try {
1839
+ let t = await P.chat(e, N.messages.value);
1840
+ N.sendAiMessage(t, n);
1841
+ } catch (e) {
1842
+ N.sendAiMessage("AI 请求失败: " + (e.message || "未知错误"), n);
1843
+ } finally {
1844
+ N.loading.value = !1;
1845
+ }
1846
+ }
1847
+ }, ve = () => {
1848
+ let e = T.value ? `${Yt}-${T.value}` : null;
1849
+ N.clearMessages(e);
1850
+ }, ye = () => {
1851
+ if (!T.value) {
1677
1852
  A.warning("请先保存文档");
1678
1853
  return;
1679
1854
  }
1680
- T.value = !0;
1681
- }, _e = (e) => {
1855
+ M.value = !0;
1856
+ }, be = (e) => {
1682
1857
  try {
1683
1858
  let t = typeof e == "string" ? JSON.parse(e) : e;
1684
- t.imageUrl && (M.imageUrl = t.imageUrl), t.annotations && (M.annotations = t.annotations), t.groups && (M.groups = t.groups), t.lineStyle && (R.value = t.lineStyle), z.value = null, B.value = null;
1859
+ t.imageUrl && (F.imageUrl = t.imageUrl), t.annotations && (F.annotations = t.annotations), t.groups && (F.groups = t.groups), t.lineStyle && (V.value = t.lineStyle), H.value = null, U.value = null;
1685
1860
  } catch (e) {
1686
1861
  console.error("Version apply error:", e);
1687
1862
  }
1688
- }, ve = (e) => {
1863
+ }, xe = (e) => {
1689
1864
  if (e === "png" || e === "png-filtered") {
1690
1865
  let t = document.querySelector(".annotation-image");
1691
1866
  if (!t) return A.error("未找到图片");
@@ -1693,11 +1868,11 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1693
1868
  n.width = t.naturalWidth, n.height = t.naturalHeight;
1694
1869
  let r = n.getContext("2d");
1695
1870
  r.drawImage(t, 0, 0);
1696
- let i = n.width / t.clientWidth, a = n.height / t.clientHeight, o = Math.max(i, a), s = e === "png-filtered" ? G.value : M.annotations, c = [
1871
+ let i = n.width / t.clientWidth, a = n.height / t.clientHeight, o = Math.max(i, a), s = e === "png-filtered" ? re.value : F.annotations, c = [
1697
1872
  "dashed",
1698
1873
  "dotted",
1699
1874
  "dashdot"
1700
- ].includes(R.value) ? "straight" : R.value, l = s.map((e) => {
1875
+ ].includes(V.value) ? "straight" : V.value, l = s.map((e) => {
1701
1876
  let t = e.x / 100 * n.width, r = e.y / 100 * n.height;
1702
1877
  return {
1703
1878
  ann: e,
@@ -1752,20 +1927,20 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1752
1927
  }
1753
1928
  }), n.toBlob((e) => {
1754
1929
  let t = document.createElement("a");
1755
- t.href = URL.createObjectURL(e), t.download = `${M.title || "图片标注"}.png`, t.click();
1930
+ t.href = URL.createObjectURL(e), t.download = `${F.title || "图片标注"}.png`, t.click();
1756
1931
  });
1757
- } else e === "json" ? ye() : A.info(`导出 ${e} 开发中`);
1758
- }, ye = () => {
1932
+ } else e === "json" ? Se() : A.info(`导出 ${e} 开发中`);
1933
+ }, Se = () => {
1759
1934
  let e = {
1760
- title: M.title,
1761
- imageUrl: M.imageUrl,
1762
- annotations: M.annotations,
1763
- groups: M.groups,
1764
- lineStyle: R.value,
1935
+ title: F.title,
1936
+ imageUrl: F.imageUrl,
1937
+ annotations: F.annotations,
1938
+ groups: F.groups,
1939
+ lineStyle: V.value,
1765
1940
  exportTime: (/* @__PURE__ */ new Date()).toISOString()
1766
1941
  }, t = new Blob([JSON.stringify(e, null, 2)], { type: "application/json" }), n = document.createElement("a");
1767
- n.href = URL.createObjectURL(t), n.download = `${M.title || "爆炸图"}.json`, n.click(), A.success("JSON已导出");
1768
- }, be = (e) => {
1942
+ n.href = URL.createObjectURL(t), n.download = `${F.title || "爆炸图"}.json`, n.click(), A.success("JSON已导出");
1943
+ }, Ce = (e) => {
1769
1944
  let t = e.target.files[0];
1770
1945
  if (!t) return;
1771
1946
  let n = new FileReader();
@@ -1776,84 +1951,84 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1776
1951
  A.error("JSON格式无效:缺少图片或标注数据");
1777
1952
  return;
1778
1953
  }
1779
- M.title = t.title || "图片标注", M.imageUrl = t.imageUrl || "", M.annotations = t.annotations || [], M.groups = t.groups || [], R.value = t.lineStyle || "straight", z.value = null, B.value = null, $(), A.success("导入成功");
1954
+ F.title = t.title || "图片标注", F.imageUrl = t.imageUrl || "", F.annotations = t.annotations || [], F.groups = t.groups || [], V.value = t.lineStyle || "straight", H.value = null, U.value = null, $(), A.success("导入成功");
1780
1955
  } catch {
1781
1956
  A.error("JSON解析失败,请检查文件格式");
1782
1957
  }
1783
1958
  }, n.readAsText(t), e.target.value = "";
1784
1959
  }, $ = () => {
1785
- N.value && I && I.pushToYjs(M);
1960
+ L.value && B && B.pushToYjs(F);
1786
1961
  };
1787
- C(B, () => {
1962
+ C(U, () => {
1788
1963
  $();
1789
1964
  }, { deep: !0 });
1790
- let xe = (e) => {
1791
- I &&= (I.destroy(), null), I = vt(e, { onRemoteChange: (e) => {
1792
- e.title && (M.title = e.title), e.imageUrl && (M.imageUrl = e.imageUrl), e.annotations && (M.annotations = e.annotations), e.groups && (M.groups = e.groups);
1793
- } }), I._setSyncReady(!1);
1794
- }, Se = async () => {
1795
- if (N.value) return;
1796
- if (!d.value && (await Q(), !d.value)) {
1965
+ let we = (e) => {
1966
+ B &&= (B.destroy(), null), B = St(e, { onRemoteChange: (e) => {
1967
+ e.title && (F.title = e.title), e.imageUrl && (F.imageUrl = e.imageUrl), e.annotations && (F.annotations = e.annotations), e.groups && (F.groups = e.groups);
1968
+ } }), B._setSyncReady(!1);
1969
+ }, Te = async () => {
1970
+ if (L.value) return;
1971
+ if (!T.value && (await me(), !T.value)) {
1797
1972
  A.error("请先保存文档");
1798
1973
  return;
1799
1974
  }
1800
- xe(String(d.value)), I.connect();
1975
+ we(String(T.value)), B.connect();
1801
1976
  let e = {
1802
1977
  name: `用户${Math.floor(Math.random() * 1e3)}`,
1803
1978
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
1804
1979
  }, t = () => {
1805
- if (I.provider && I.provider.synced) {
1806
- I._setSyncReady(!0), I.setLocalUser(e);
1807
- let t = I.pullFromYjs();
1808
- t ? (t.title && (M.title = t.title), t.imageUrl && (M.imageUrl = t.imageUrl), t.annotations && (M.annotations = t.annotations), t.groups && (M.groups = t.groups)) : (M.annotations.length > 0 || M.imageUrl) && I.pushToYjs(M), N.value = !0, F.value = !0, P.value = !1, D.setCollabContext({
1809
- ydoc: I.ydoc,
1810
- provider: I.provider,
1811
- onlineUsers: I.onlineUsers
1812
- }), D.setCurrentUser({
1813
- id: I.provider.awareness.clientID,
1980
+ if (B.provider && B.provider.synced) {
1981
+ B._setSyncReady(!0), B.setLocalUser(e);
1982
+ let t = B.pullFromYjs();
1983
+ t ? (t.title && (F.title = t.title), t.imageUrl && (F.imageUrl = t.imageUrl), t.annotations && (F.annotations = t.annotations), t.groups && (F.groups = t.groups)) : (F.annotations.length > 0 || F.imageUrl) && B.pushToYjs(F), L.value = !0, R.value = !0, te.value = !1, N.setCollabContext({
1984
+ ydoc: B.ydoc,
1985
+ provider: B.provider,
1986
+ onlineUsers: B.onlineUsers
1987
+ }), N.setCurrentUser({
1988
+ id: B.provider.awareness.clientID,
1814
1989
  name: e.name,
1815
1990
  color: e.color
1816
1991
  }), A.success("协作已开启");
1817
1992
  } else setTimeout(t, 100);
1818
1993
  };
1819
1994
  setTimeout(t, 200);
1820
- }, Ce = () => {
1821
- I && (I.closeCollaboration(), N.value = !1, F.value = !1, A.info("协作已关闭"));
1822
- }, we = () => {
1823
- let e = l.params.id;
1995
+ }, Ee = () => {
1996
+ B && (B.closeCollaboration(), L.value = !1, R.value = !1, A.info("协作已关闭"));
1997
+ }, De = () => {
1998
+ let e = f.params.id;
1824
1999
  if (!e) return;
1825
- xe(e), I.connect();
2000
+ we(e), B.connect();
1826
2001
  let t = {
1827
2002
  name: `协作人${Math.floor(Math.random() * 1e3)}`,
1828
2003
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
1829
2004
  }, n = () => {
1830
- if (I.provider && I.provider.synced) {
1831
- if (I.checkCollaborationClosed()) {
1832
- I.disconnect(), N.value = !1, A.warning("该协作已关闭,无法加入");
2005
+ if (B.provider && B.provider.synced) {
2006
+ if (B.checkCollaborationClosed()) {
2007
+ B.disconnect(), L.value = !1, A.warning("该协作已关闭,无法加入");
1833
2008
  return;
1834
2009
  }
1835
- I._setSyncReady(!0), I.setLocalUser(t);
1836
- let e = I.pullFromYjs();
1837
- e && (e.title && (M.title = e.title), e.imageUrl && (M.imageUrl = e.imageUrl), e.annotations && (M.annotations = e.annotations), e.groups && (M.groups = e.groups)), N.value = !0, F.value = !1, D.setCollabContext({
1838
- ydoc: I.ydoc,
1839
- provider: I.provider,
1840
- onlineUsers: I.onlineUsers
1841
- }), D.setCurrentUser({
1842
- id: I.provider.awareness.clientID,
2010
+ B._setSyncReady(!0), B.setLocalUser(t);
2011
+ let e = B.pullFromYjs();
2012
+ e && (e.title && (F.title = e.title), e.imageUrl && (F.imageUrl = e.imageUrl), e.annotations && (F.annotations = e.annotations), e.groups && (F.groups = e.groups)), L.value = !0, R.value = !1, N.setCollabContext({
2013
+ ydoc: B.ydoc,
2014
+ provider: B.provider,
2015
+ onlineUsers: B.onlineUsers
2016
+ }), N.setCurrentUser({
2017
+ id: B.provider.awareness.clientID,
1843
2018
  name: t.name,
1844
2019
  color: t.color
1845
2020
  }), A.success("已加入协作");
1846
2021
  } else setTimeout(n, 100);
1847
2022
  };
1848
2023
  setTimeout(n, 200);
1849
- }, Te = () => {
1850
- N.value ? Ce() : Se();
1851
- }, Ee = async () => {
1852
- if (N.value || await Se(), !d.value && (await Q(), !d.value)) {
2024
+ }, Oe = () => {
2025
+ L.value ? Ee() : Te();
2026
+ }, je = async () => {
2027
+ if (L.value || await Te(), !T.value && (await me(), !T.value)) {
1853
2028
  A.warning("请先保存文档后再分享");
1854
2029
  return;
1855
2030
  }
1856
- let e = `${window.location.origin}/explosion-image/${d.value}?collab=1`;
2031
+ let e = `${window.location.origin}/explosion-image/${T.value}?collab=1`;
1857
2032
  try {
1858
2033
  await navigator.clipboard.writeText(e), A.success("协作链接已复制到剪贴板");
1859
2034
  } catch {
@@ -1861,44 +2036,46 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1861
2036
  }
1862
2037
  };
1863
2038
  p(async () => {
1864
- let e = localStorage.getItem("editor-user-name") || `用户${Math.floor(Math.random() * 1e3)}`;
1865
- localStorage.setItem("editor-user-name", e), D.setCurrentUser({
1866
- id: Date.now(),
2039
+ let e = l.user?.name || localStorage.getItem("editor-user-name") || `用户${Math.floor(Math.random() * 1e3)}`;
2040
+ localStorage.setItem("editor-user-name", e), N.setCurrentUser({
2041
+ id: l.user?.id || Date.now(),
1867
2042
  name: e,
1868
- color: "#409eff"
1869
- }), await de(), l.params.id && l.query.collab === "1" && we();
2043
+ color: l.user?.color || "#409eff"
2044
+ }), await he(), d.value && f.query.collab === "1" && De();
1870
2045
  });
1871
- let De = (e) => {
1872
- e.key === "Delete" && z.value && J();
2046
+ let Me = (e) => {
2047
+ e.key === "Delete" && H.value && ce();
1873
2048
  };
1874
- return p(() => document.addEventListener("keydown", De)), m(() => {
1875
- document.removeEventListener("keydown", De), I &&= (I.destroy(), null);
2049
+ return p(() => document.addEventListener("keydown", Me)), m(() => {
2050
+ document.removeEventListener("keydown", Me), B &&= (B.destroy(), null);
1876
2051
  }), (t, c) => {
1877
- let u = y("el-input-number"), p = y("el-input"), m = y("el-color-picker"), g = y("el-option"), _ = y("el-select"), C = y("el-slider"), E = y("el-button"), O = y("el-icon"), k = y("el-tag"), A = y("el-dialog"), j = y("Monitor");
1878
- return h(), i("div", yt, [
1879
- s(at, {
1880
- title: M.title,
1881
- "onUpdate:title": c[0] ||= (e) => M.title = e,
1882
- "line-style": R.value,
1883
- groups: M.groups,
1884
- "active-group-id": U.value,
1885
- "collapsed-groups": W.value,
1886
- "is-connected": N.value,
1887
- "online-users": S(I) ? S(I).onlineUsers.value : [],
1888
- "is-join-mode": S(l).query.collab === "1",
1889
- onBack: fe,
1890
- onAddAnnotation: ne,
1891
- onSetLineStyle: c[1] ||= (e) => R.value = e,
1892
- onAddGroup: ae,
1893
- onGroupAction: oe,
1894
- onClearGroupFilter: ue,
1895
- onExport: ve,
1896
- onImportJson: be,
1897
- onSave: Q,
1898
- onToggleCollab: Te,
1899
- onShareCollab: Ee,
1900
- "show-history": !!d.value,
1901
- onHistory: ge
2052
+ let l = y("el-input-number"), d = y("el-input"), p = y("el-color-picker"), m = y("el-option"), g = y("el-select"), _ = y("el-slider"), b = y("el-button"), C = y("el-icon"), O = y("el-tag"), k = y("el-dialog"), A = y("Monitor");
2053
+ return h(), i("div", Ct, [
2054
+ s(lt, {
2055
+ title: F.title,
2056
+ "onUpdate:title": c[0] ||= (e) => F.title = e,
2057
+ "line-style": V.value,
2058
+ groups: F.groups,
2059
+ "active-group-id": G.value,
2060
+ "collapsed-groups": K.value,
2061
+ "is-connected": L.value,
2062
+ "online-users": S(B) ? S(B).onlineUsers.value : [],
2063
+ "is-join-mode": S(f).query.collab === "1",
2064
+ "show-back-button": u.value.backButton === "show",
2065
+ "title-disabled": !u.value.titleEditable,
2066
+ onBack: ge,
2067
+ onAddAnnotation: ae,
2068
+ onSetLineStyle: c[1] ||= (e) => V.value = e,
2069
+ onAddGroup: X,
2070
+ onGroupAction: le,
2071
+ onClearGroupFilter: pe,
2072
+ onExport: xe,
2073
+ onImportJson: Ce,
2074
+ onSave: me,
2075
+ onToggleCollab: Oe,
2076
+ onShareCollab: je,
2077
+ "show-history": !!T.value,
2078
+ onHistory: ye
1902
2079
  }, null, 8, [
1903
2080
  "title",
1904
2081
  "line-style",
@@ -1908,18 +2085,20 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1908
2085
  "is-connected",
1909
2086
  "online-users",
1910
2087
  "is-join-mode",
2088
+ "show-back-button",
2089
+ "title-disabled",
1911
2090
  "show-history"
1912
2091
  ]),
1913
- a("div", bt, [a("div", xt, [s(gt, {
2092
+ a("div", wt, [a("div", Tt, [s(bt, {
1914
2093
  ref_key: "annotationCanvasRef",
1915
- ref: H,
1916
- "image-url": M.imageUrl,
1917
- annotations: G.value,
1918
- "collapsed-groups": W.value,
1919
- "selected-id": z.value,
1920
- "line-style": R.value,
1921
- onSelect: re,
1922
- onUploadImage: K,
2094
+ ref: W,
2095
+ "image-url": F.imageUrl,
2096
+ annotations: re.value,
2097
+ "collapsed-groups": K.value,
2098
+ "selected-id": H.value,
2099
+ "line-style": V.value,
2100
+ onSelect: oe,
2101
+ onUploadImage: q,
1923
2102
  onChange: $
1924
2103
  }, null, 8, [
1925
2104
  "image-url",
@@ -1929,317 +2108,317 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1929
2108
  "line-style"
1930
2109
  ]), a("input", {
1931
2110
  ref_key: "fileInputRef",
1932
- ref: f,
2111
+ ref: E,
1933
2112
  type: "file",
1934
2113
  accept: "image/*",
1935
2114
  style: { display: "none" },
1936
- onChange: te
1937
- }, null, 544)]), a("div", St, [c[58] ||= a("h4", null, "标注属性", -1), B.value ? (h(), i(e, { key: 0 }, [
1938
- a("div", Ct, [c[31] ||= a("label", null, "编号", -1), s(u, {
1939
- modelValue: B.value.number,
1940
- "onUpdate:modelValue": c[2] ||= (e) => B.value.number = e,
2115
+ onChange: ie
2116
+ }, null, 544)]), a("div", Et, [c[58] ||= a("h4", null, "标注属性", -1), U.value ? (h(), i(e, { key: 0 }, [
2117
+ a("div", Dt, [c[31] ||= a("label", null, "编号", -1), s(l, {
2118
+ modelValue: U.value.number,
2119
+ "onUpdate:modelValue": c[2] ||= (e) => U.value.number = e,
1941
2120
  min: 1,
1942
2121
  size: "small"
1943
2122
  }, null, 8, ["modelValue"])]),
1944
- a("div", wt, [c[32] ||= a("label", null, "文字", -1), s(p, {
1945
- modelValue: B.value.text,
1946
- "onUpdate:modelValue": c[3] ||= (e) => B.value.text = e,
2123
+ a("div", Ot, [c[32] ||= a("label", null, "文字", -1), s(d, {
2124
+ modelValue: U.value.text,
2125
+ "onUpdate:modelValue": c[3] ||= (e) => U.value.text = e,
1947
2126
  size: "small"
1948
2127
  }, null, 8, ["modelValue"])]),
1949
- a("div", Tt, [c[33] ||= a("label", null, "引线颜色", -1), s(m, {
1950
- modelValue: B.value.lineColor,
1951
- "onUpdate:modelValue": c[4] ||= (e) => B.value.lineColor = e,
2128
+ a("div", kt, [c[33] ||= a("label", null, "引线颜色", -1), s(p, {
2129
+ modelValue: U.value.lineColor,
2130
+ "onUpdate:modelValue": c[4] ||= (e) => U.value.lineColor = e,
1952
2131
  size: "small",
1953
2132
  "show-alpha": ""
1954
2133
  }, null, 8, ["modelValue"])]),
1955
- a("div", Et, [c[34] ||= a("label", null, "标注点样式", -1), s(_, {
1956
- modelValue: B.value.pointStyle,
1957
- "onUpdate:modelValue": c[5] ||= (e) => B.value.pointStyle = e,
2134
+ a("div", At, [c[34] ||= a("label", null, "标注点样式", -1), s(g, {
2135
+ modelValue: U.value.pointStyle,
2136
+ "onUpdate:modelValue": c[5] ||= (e) => U.value.pointStyle = e,
1958
2137
  size: "small"
1959
2138
  }, {
1960
2139
  default: w(() => [
1961
- s(g, {
2140
+ s(m, {
1962
2141
  label: "圆形",
1963
2142
  value: "circle"
1964
2143
  }),
1965
- s(g, {
2144
+ s(m, {
1966
2145
  label: "方形",
1967
2146
  value: "square"
1968
2147
  }),
1969
- s(g, {
2148
+ s(m, {
1970
2149
  label: "菱形",
1971
2150
  value: "diamond"
1972
2151
  }),
1973
- s(g, {
2152
+ s(m, {
1974
2153
  label: "箭头",
1975
2154
  value: "arrow"
1976
2155
  }),
1977
- s(g, {
2156
+ s(m, {
1978
2157
  label: "红旗",
1979
2158
  value: "flag"
1980
2159
  })
1981
2160
  ]),
1982
2161
  _: 1
1983
2162
  }, 8, ["modelValue"])]),
1984
- a("div", Dt, [c[35] ||= a("label", null, "标注点颜色", -1), s(m, {
1985
- modelValue: B.value.color,
1986
- "onUpdate:modelValue": c[6] ||= (e) => B.value.color = e,
2163
+ a("div", jt, [c[35] ||= a("label", null, "标注点颜色", -1), s(p, {
2164
+ modelValue: U.value.color,
2165
+ "onUpdate:modelValue": c[6] ||= (e) => U.value.color = e,
1987
2166
  size: "small"
1988
2167
  }, null, 8, ["modelValue"])]),
1989
- a("div", Ot, [c[36] ||= a("label", null, "编号颜色", -1), s(m, {
1990
- modelValue: B.value.numberColor,
1991
- "onUpdate:modelValue": c[7] ||= (e) => B.value.numberColor = e,
2168
+ a("div", Mt, [c[36] ||= a("label", null, "编号颜色", -1), s(p, {
2169
+ modelValue: U.value.numberColor,
2170
+ "onUpdate:modelValue": c[7] ||= (e) => U.value.numberColor = e,
1992
2171
  size: "small"
1993
2172
  }, null, 8, ["modelValue"])]),
1994
- a("div", kt, [c[37] ||= a("label", null, "文字颜色", -1), s(m, {
1995
- modelValue: B.value.textColor,
1996
- "onUpdate:modelValue": c[8] ||= (e) => B.value.textColor = e,
2173
+ a("div", Nt, [c[37] ||= a("label", null, "文字颜色", -1), s(p, {
2174
+ modelValue: U.value.textColor,
2175
+ "onUpdate:modelValue": c[8] ||= (e) => U.value.textColor = e,
1997
2176
  size: "small"
1998
2177
  }, null, 8, ["modelValue"])]),
1999
- a("div", At, [c[38] ||= a("label", null, "文字背景色", -1), s(m, {
2000
- modelValue: B.value.labelBgColor,
2001
- "onUpdate:modelValue": c[9] ||= (e) => B.value.labelBgColor = e,
2178
+ a("div", Pt, [c[38] ||= a("label", null, "文字背景色", -1), s(p, {
2179
+ modelValue: U.value.labelBgColor,
2180
+ "onUpdate:modelValue": c[9] ||= (e) => U.value.labelBgColor = e,
2002
2181
  size: "small",
2003
2182
  "show-alpha": ""
2004
2183
  }, null, 8, ["modelValue"])]),
2005
- a("div", jt, [c[39] ||= a("label", null, "背景透明度", -1), s(C, {
2006
- modelValue: B.value.labelBgOpacity,
2007
- "onUpdate:modelValue": c[10] ||= (e) => B.value.labelBgOpacity = e,
2184
+ a("div", Ft, [c[39] ||= a("label", null, "背景透明度", -1), s(_, {
2185
+ modelValue: U.value.labelBgOpacity,
2186
+ "onUpdate:modelValue": c[10] ||= (e) => U.value.labelBgOpacity = e,
2008
2187
  min: 0,
2009
2188
  max: 100,
2010
2189
  step: 5,
2011
2190
  "show-input": "",
2012
2191
  "input-size": "small"
2013
2192
  }, null, 8, ["modelValue"])]),
2014
- a("div", Mt, [c[40] ||= a("label", null, "字体", -1), s(_, {
2015
- modelValue: B.value.fontFamily,
2016
- "onUpdate:modelValue": c[11] ||= (e) => B.value.fontFamily = e,
2193
+ a("div", It, [c[40] ||= a("label", null, "字体", -1), s(g, {
2194
+ modelValue: U.value.fontFamily,
2195
+ "onUpdate:modelValue": c[11] ||= (e) => U.value.fontFamily = e,
2017
2196
  size: "small",
2018
2197
  clearable: ""
2019
2198
  }, {
2020
2199
  default: w(() => [
2021
- s(g, {
2200
+ s(m, {
2022
2201
  label: "默认",
2023
2202
  value: ""
2024
2203
  }),
2025
- s(g, {
2204
+ s(m, {
2026
2205
  label: "宋体",
2027
2206
  value: "SimSun"
2028
2207
  }),
2029
- s(g, {
2208
+ s(m, {
2030
2209
  label: "黑体",
2031
2210
  value: "SimHei"
2032
2211
  }),
2033
- s(g, {
2212
+ s(m, {
2034
2213
  label: "微软雅黑",
2035
2214
  value: "Microsoft YaHei"
2036
2215
  }),
2037
- s(g, {
2216
+ s(m, {
2038
2217
  label: "楷体",
2039
2218
  value: "KaiTi"
2040
2219
  }),
2041
- s(g, {
2220
+ s(m, {
2042
2221
  label: "Arial",
2043
2222
  value: "Arial"
2044
2223
  }),
2045
- s(g, {
2224
+ s(m, {
2046
2225
  label: "Times New Roman",
2047
2226
  value: "Times New Roman"
2048
2227
  })
2049
2228
  ]),
2050
2229
  _: 1
2051
2230
  }, 8, ["modelValue"])]),
2052
- a("div", Nt, [c[41] ||= a("label", null, "字号", -1), s(u, {
2053
- modelValue: B.value.fontSize,
2054
- "onUpdate:modelValue": c[12] ||= (e) => B.value.fontSize = e,
2231
+ a("div", Lt, [c[41] ||= a("label", null, "字号", -1), s(l, {
2232
+ modelValue: U.value.fontSize,
2233
+ "onUpdate:modelValue": c[12] ||= (e) => U.value.fontSize = e,
2055
2234
  min: 10,
2056
2235
  max: 32,
2057
2236
  size: "small"
2058
2237
  }, null, 8, ["modelValue"])]),
2059
- a("div", Pt, [c[46] ||= a("label", null, "字体样式", -1), a("div", Ft, [
2060
- s(E, {
2061
- type: B.value.fontWeight === "bold" ? "primary" : "",
2238
+ a("div", Rt, [c[46] ||= a("label", null, "字体样式", -1), a("div", zt, [
2239
+ s(b, {
2240
+ type: U.value.fontWeight === "bold" ? "primary" : "",
2062
2241
  size: "small",
2063
- onClick: c[13] ||= (e) => q("fontWeight", "bold")
2242
+ onClick: c[13] ||= (e) => J("fontWeight", "bold")
2064
2243
  }, {
2065
2244
  default: w(() => [...c[42] ||= [a("b", null, "B", -1)]]),
2066
2245
  _: 1
2067
2246
  }, 8, ["type"]),
2068
- s(E, {
2069
- type: B.value.fontWeight === "bolder" ? "primary" : "",
2247
+ s(b, {
2248
+ type: U.value.fontWeight === "bolder" ? "primary" : "",
2070
2249
  size: "small",
2071
- onClick: c[14] ||= (e) => q("fontWeight", "bolder")
2250
+ onClick: c[14] ||= (e) => J("fontWeight", "bolder")
2072
2251
  }, {
2073
2252
  default: w(() => [...c[43] ||= [a("b", { style: { "font-size": "14px" } }, "B", -1)]]),
2074
2253
  _: 1
2075
2254
  }, 8, ["type"]),
2076
- s(E, {
2077
- type: B.value.fontStyle === "italic" ? "primary" : "",
2255
+ s(b, {
2256
+ type: U.value.fontStyle === "italic" ? "primary" : "",
2078
2257
  size: "small",
2079
- onClick: c[15] ||= (e) => q("fontStyle", "italic")
2258
+ onClick: c[15] ||= (e) => J("fontStyle", "italic")
2080
2259
  }, {
2081
2260
  default: w(() => [...c[44] ||= [a("i", null, "I", -1)]]),
2082
2261
  _: 1
2083
2262
  }, 8, ["type"]),
2084
- s(E, {
2085
- type: B.value.fontStyle === "oblique" ? "primary" : "",
2263
+ s(b, {
2264
+ type: U.value.fontStyle === "oblique" ? "primary" : "",
2086
2265
  size: "small",
2087
- onClick: c[16] ||= (e) => q("fontStyle", "oblique")
2266
+ onClick: c[16] ||= (e) => J("fontStyle", "oblique")
2088
2267
  }, {
2089
2268
  default: w(() => [...c[45] ||= [a("i", { style: { "font-style": "oblique" } }, "I", -1)]]),
2090
2269
  _: 1
2091
2270
  }, 8, ["type"])
2092
2271
  ])]),
2093
- a("div", It, [c[51] ||= a("label", null, "装饰", -1), a("div", Lt, [
2094
- s(E, {
2095
- type: B.value.textDecoration === "underline" ? "primary" : "",
2272
+ a("div", Bt, [c[51] ||= a("label", null, "装饰", -1), a("div", Vt, [
2273
+ s(b, {
2274
+ type: U.value.textDecoration === "underline" ? "primary" : "",
2096
2275
  size: "small",
2097
- onClick: c[17] ||= (e) => q("textDecoration", "underline")
2276
+ onClick: c[17] ||= (e) => J("textDecoration", "underline")
2098
2277
  }, {
2099
2278
  default: w(() => [...c[47] ||= [a("u", null, "U", -1)]]),
2100
2279
  _: 1
2101
2280
  }, 8, ["type"]),
2102
- s(E, {
2103
- type: B.value.textDecoration === "line-through" ? "primary" : "",
2281
+ s(b, {
2282
+ type: U.value.textDecoration === "line-through" ? "primary" : "",
2104
2283
  size: "small",
2105
- onClick: c[18] ||= (e) => q("textDecoration", "line-through")
2284
+ onClick: c[18] ||= (e) => J("textDecoration", "line-through")
2106
2285
  }, {
2107
2286
  default: w(() => [...c[48] ||= [a("s", null, "S", -1)]]),
2108
2287
  _: 1
2109
2288
  }, 8, ["type"]),
2110
- s(E, {
2111
- type: B.value.textDecoration === "underline line-through" ? "primary" : "",
2289
+ s(b, {
2290
+ type: U.value.textDecoration === "underline line-through" ? "primary" : "",
2112
2291
  size: "small",
2113
- onClick: c[19] ||= (e) => q("textDecoration", "underline line-through")
2292
+ onClick: c[19] ||= (e) => J("textDecoration", "underline line-through")
2114
2293
  }, {
2115
2294
  default: w(() => [...c[49] ||= [a("u", null, [a("s", null, "U")], -1)]]),
2116
2295
  _: 1
2117
2296
  }, 8, ["type"]),
2118
- s(E, {
2297
+ s(b, {
2119
2298
  size: "small",
2120
- onClick: ie
2299
+ onClick: se
2121
2300
  }, {
2122
2301
  default: w(() => [...c[50] ||= [o("清除", -1)]]),
2123
2302
  _: 1
2124
2303
  })
2125
2304
  ])]),
2126
- a("div", Rt, [c[52] ||= a("label", null, "X% (点)", -1), s(C, {
2127
- modelValue: B.value.x,
2128
- "onUpdate:modelValue": c[20] ||= (e) => B.value.x = e,
2305
+ a("div", Ht, [c[52] ||= a("label", null, "X% (点)", -1), s(_, {
2306
+ modelValue: U.value.x,
2307
+ "onUpdate:modelValue": c[20] ||= (e) => U.value.x = e,
2129
2308
  min: 0,
2130
2309
  max: 100,
2131
2310
  step: .5,
2132
2311
  "show-input": "",
2133
2312
  "input-size": "small"
2134
2313
  }, null, 8, ["modelValue"])]),
2135
- a("div", zt, [c[53] ||= a("label", null, "Y% (点)", -1), s(C, {
2136
- modelValue: B.value.y,
2137
- "onUpdate:modelValue": c[21] ||= (e) => B.value.y = e,
2314
+ a("div", Ut, [c[53] ||= a("label", null, "Y% (点)", -1), s(_, {
2315
+ modelValue: U.value.y,
2316
+ "onUpdate:modelValue": c[21] ||= (e) => U.value.y = e,
2138
2317
  min: 0,
2139
2318
  max: 100,
2140
2319
  step: .5,
2141
2320
  "show-input": "",
2142
2321
  "input-size": "small"
2143
2322
  }, null, 8, ["modelValue"])]),
2144
- a("div", Bt, [c[54] ||= a("label", null, "线宽", -1), s(u, {
2145
- modelValue: B.value.strokeWidth,
2146
- "onUpdate:modelValue": c[22] ||= (e) => B.value.strokeWidth = e,
2323
+ a("div", Wt, [c[54] ||= a("label", null, "线宽", -1), s(l, {
2324
+ modelValue: U.value.strokeWidth,
2325
+ "onUpdate:modelValue": c[22] ||= (e) => U.value.strokeWidth = e,
2147
2326
  min: 1,
2148
2327
  max: 5,
2149
2328
  size: "small"
2150
2329
  }, null, 8, ["modelValue"])]),
2151
- a("div", Vt, [c[55] ||= a("label", null, "分组", -1), s(_, {
2152
- modelValue: B.value.groupId,
2153
- "onUpdate:modelValue": c[23] ||= (e) => B.value.groupId = e,
2330
+ a("div", Gt, [c[55] ||= a("label", null, "分组", -1), s(g, {
2331
+ modelValue: U.value.groupId,
2332
+ "onUpdate:modelValue": c[23] ||= (e) => U.value.groupId = e,
2154
2333
  size: "small",
2155
2334
  clearable: ""
2156
2335
  }, {
2157
- default: w(() => [(h(!0), i(e, null, v(M.groups, (e) => (h(), n(g, {
2336
+ default: w(() => [(h(!0), i(e, null, v(F.groups, (e) => (h(), n(m, {
2158
2337
  key: e.id,
2159
2338
  label: e.name,
2160
2339
  value: e.id
2161
2340
  }, null, 8, ["label", "value"]))), 128))]),
2162
2341
  _: 1
2163
2342
  }, 8, ["modelValue"])]),
2164
- U.value ? (h(), i("div", Ht, [s(k, {
2343
+ G.value ? (h(), i("div", Kt, [s(O, {
2165
2344
  size: "small",
2166
2345
  type: "info"
2167
2346
  }, {
2168
- default: w(() => [o(" 当前筛选: " + x(M.groups.find((e) => e.id === U.value)?.name || "未知分组") + " ", 1), s(O, {
2347
+ default: w(() => [o(" 当前筛选: " + x(F.groups.find((e) => e.id === G.value)?.name || "未知分组") + " ", 1), s(C, {
2169
2348
  class: "el-tag__close",
2170
- onClick: ue
2349
+ onClick: pe
2171
2350
  }, {
2172
- default: w(() => [s(S(L))]),
2351
+ default: w(() => [s(S(I))]),
2173
2352
  _: 1
2174
2353
  })]),
2175
2354
  _: 1
2176
2355
  })])) : r("", !0),
2177
- s(E, {
2356
+ s(b, {
2178
2357
  size: "small",
2179
2358
  type: "danger",
2180
- onClick: J
2359
+ onClick: ce
2181
2360
  }, {
2182
2361
  default: w(() => [...c[56] ||= [o("删除", -1)]]),
2183
2362
  _: 1
2184
2363
  })
2185
- ], 64)) : (h(), i("div", Ut, [s(O, {
2364
+ ], 64)) : (h(), i("div", qt, [s(C, {
2186
2365
  size: "48",
2187
2366
  color: "#ccc"
2188
2367
  }, {
2189
- default: w(() => [s(S(V))]),
2368
+ default: w(() => [s(S(z))]),
2190
2369
  _: 1
2191
2370
  }), c[57] ||= a("p", null, "点击标注进行编辑", -1)]))])]),
2192
- s(A, {
2193
- modelValue: X.value,
2194
- "onUpdate:modelValue": c[26] ||= (e) => X.value = e,
2371
+ s(k, {
2372
+ modelValue: Z.value,
2373
+ "onUpdate:modelValue": c[26] ||= (e) => Z.value = e,
2195
2374
  title: "批量修改颜色",
2196
2375
  width: "320px",
2197
2376
  "show-close": !0
2198
2377
  }, {
2199
- footer: w(() => [s(E, { onClick: c[25] ||= (e) => X.value = !1 }, {
2378
+ footer: w(() => [s(b, { onClick: c[25] ||= (e) => Z.value = !1 }, {
2200
2379
  default: w(() => [...c[60] ||= [o("取消", -1)]]),
2201
2380
  _: 1
2202
- }), s(E, {
2381
+ }), s(b, {
2203
2382
  type: "primary",
2204
- onClick: ce
2383
+ onClick: de
2205
2384
  }, {
2206
2385
  default: w(() => [...c[61] ||= [o("确定", -1)]]),
2207
2386
  _: 1
2208
2387
  })]),
2209
- default: w(() => [a("div", Wt, [c[59] ||= a("span", null, "选择颜色:", -1), s(m, {
2210
- modelValue: Z.value,
2211
- "onUpdate:modelValue": c[24] ||= (e) => Z.value = e,
2388
+ default: w(() => [a("div", Jt, [c[59] ||= a("span", null, "选择颜色:", -1), s(p, {
2389
+ modelValue: Q.value,
2390
+ "onUpdate:modelValue": c[24] ||= (e) => Q.value = e,
2212
2391
  "show-alpha": ""
2213
2392
  }, null, 8, ["modelValue"])])]),
2214
2393
  _: 1
2215
2394
  }, 8, ["modelValue"]),
2216
- s(E, {
2395
+ s(b, {
2217
2396
  class: "ai-chat-fab",
2218
- type: b.value ? "primary" : "default",
2397
+ type: D.value ? "primary" : "default",
2219
2398
  circle: "",
2220
2399
  size: "large",
2221
- onClick: c[27] ||= (e) => b.value = !b.value,
2400
+ onClick: c[27] ||= (e) => D.value = !D.value,
2222
2401
  title: "AI助手"
2223
2402
  }, {
2224
- default: w(() => [s(O, null, {
2225
- default: w(() => [s(j)]),
2403
+ default: w(() => [s(C, null, {
2404
+ default: w(() => [s(A)]),
2226
2405
  _: 1
2227
2406
  })]),
2228
2407
  _: 1
2229
2408
  }, 8, ["type"]),
2230
2409
  s(ke, {
2231
- visible: b.value,
2232
- messages: S(D).messages.value,
2233
- loading: S(D).loading.value,
2234
- "is-collab": S(D).isCollabMode.value,
2235
- "collab-users": S(D).collabUsers.value,
2236
- "current-user": S(D).currentUser.value,
2237
- "is-owner": F.value,
2238
- onSend: me,
2239
- onClose: c[28] ||= (e) => b.value = !1,
2240
- "unread-mention": S(D).unreadMention.value,
2241
- onClearUnread: c[29] ||= (e) => S(D).clearUnreadMention(),
2242
- onClear: he
2410
+ visible: D.value,
2411
+ messages: S(N).messages.value,
2412
+ loading: S(N).loading.value,
2413
+ "is-collab": S(N).isCollabMode.value,
2414
+ "collab-users": S(N).collabUsers.value,
2415
+ "current-user": S(N).currentUser.value,
2416
+ "is-owner": R.value,
2417
+ onSend: _e,
2418
+ onClose: c[28] ||= (e) => D.value = !1,
2419
+ "unread-mention": S(N).unreadMention.value,
2420
+ onClearUnread: c[29] ||= (e) => S(N).clearUnreadMention(),
2421
+ onClear: ve
2243
2422
  }, null, 8, [
2244
2423
  "visible",
2245
2424
  "messages",
@@ -2250,16 +2429,16 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2250
2429
  "is-owner",
2251
2430
  "unread-mention"
2252
2431
  ]),
2253
- s(Ge, {
2254
- modelValue: T.value,
2255
- "onUpdate:modelValue": c[30] ||= (e) => T.value = e,
2256
- "document-id": d.value,
2257
- onApply: _e
2432
+ s(Ye, {
2433
+ modelValue: M.value,
2434
+ "onUpdate:modelValue": c[30] ||= (e) => M.value = e,
2435
+ "document-id": T.value,
2436
+ onApply: be
2258
2437
  }, null, 8, ["modelValue", "document-id"])
2259
2438
  ]);
2260
2439
  };
2261
2440
  }
2262
- }, [["__scopeId", "data-v-8aef20c7"]]), qt = c({
2441
+ }, [["__scopeId", "data-v-e25c1b61"]]), Zt = c({
2263
2442
  name: "YourCompanyExplosionImage",
2264
2443
  props: {
2265
2444
  docId: {
@@ -2270,6 +2449,14 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2270
2449
  type: String,
2271
2450
  default: "/api"
2272
2451
  },
2452
+ saveApi: {
2453
+ type: [String, Function],
2454
+ default: null
2455
+ },
2456
+ loadApi: {
2457
+ type: [String, Function],
2458
+ default: null
2459
+ },
2273
2460
  wsUrl: {
2274
2461
  type: String,
2275
2462
  default: ""
@@ -2285,14 +2472,22 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2285
2472
  roomId: {
2286
2473
  type: String,
2287
2474
  default: ""
2475
+ },
2476
+ uiConfig: {
2477
+ type: Object,
2478
+ default: () => ({})
2479
+ },
2480
+ aiApi: {
2481
+ type: [String, Object],
2482
+ default: null
2288
2483
  }
2289
2484
  },
2290
2485
  setup(e, { slots: t }) {
2291
2486
  return () => l("div", {
2292
2487
  class: "yourcompany-explosion-image-wrapper",
2293
2488
  style: "position:relative"
2294
- }, [l(Kt, { ...e }), l(D)]);
2489
+ }, [l(Xt, { ...e }), l(D)]);
2295
2490
  }
2296
2491
  });
2297
2492
  //#endregion
2298
- export { qt as default };
2493
+ export { Zt as default };