@billtaofbj/explosion-image 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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 R, Download as z, InfoFilled as B, Link as V, Loading as H, Location as U, Minus as te, Monitor as W, MoreFilled as G, Plus as K, Promotion as ne, Right as re, SemiSelect as q, Share as ie, TrendCharts as ae, Upload as J, UploadFilled as oe } 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
+ }, Z = { class: "chat-header" }, le = { class: "chat-header-left" }, Q = { class: "chat-title" }, ue = { 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", z = (e) => e.role === "ai" ? { background: "linear-gradient(135deg, #409EFF, #337ECC)" } : { background: e.user_color || "#67C23A" }, B = (e) => (e.user_name || "U").charAt(0), V = (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
+ }, H = () => {
105
105
  O.value && (A.value = Math.min(A.value + 1, k.value.length - 1));
106
106
  }, U = () => {
107
107
  O.value && (A.value = Math.max(A.value - 1, 0));
108
- }, W = (e) => {
108
+ }, te = (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
+ }, G = (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(), te(t);
118
118
  return;
119
119
  }
120
120
  }
@@ -128,27 +128,27 @@ 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
+ }, K = () => {
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, K), C(() => p.messages, K, { 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", Z, [a("div", le, [
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
- a("span", ue, x(c.isCollab ? "协作聊天" : "AI 助手"), 1),
151
+ a("span", Q, x(c.isCollab ? "协作聊天" : "AI 助手"), 1),
152
152
  c.isCollab ? (h(), n(_, {
153
153
  key: 0,
154
154
  width: 200,
@@ -161,10 +161,10 @@ 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
- default: w(() => [a("div", Q, [a("div", de, [
167
+ default: w(() => [a("div", ue, [a("div", de, [
168
168
  a("div", {
169
169
  class: "online-user-avatar",
170
170
  style: f({ background: c.currentUser.color || "#409EFF" })
@@ -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(R))]),
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(z(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(B(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"]),
323
+ T(E(G, ["exact"]), ["enter"]),
324
+ T(E(H, ["prevent"]), ["down"]),
325
325
  T(E(U, ["prevent"]), ["up"])
326
326
  ],
327
- onInput: H,
327
+ onInput: V,
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) => te(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,7 +351,7 @@ var Z = (e, t) => {
351
351
  type: "primary",
352
352
  circle: "",
353
353
  disabled: !g.value.trim() || c.loading,
354
- onClick: K
354
+ onClick: G
355
355
  }, {
356
356
  default: w(() => [s(u, null, {
357
357
  default: w(() => [s(S(ne))]),
@@ -570,7 +570,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
570
570
  }, Re = {
571
571
  key: 0,
572
572
  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({
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__*/ X({
574
574
  __name: "VersionHistoryPanel",
575
575
  props: {
576
576
  modelValue: {
@@ -606,7 +606,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
606
606
  }
607
607
  }, M = () => {
608
608
  T.value = !1;
609
- }, N = (e) => {
609
+ }, ee = (e) => {
610
610
  if (!e) return "";
611
611
  let t = new Date(e), n = (e) => String(e).padStart(2, "0");
612
612
  return `${t.getFullYear()}-${n(t.getMonth() + 1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`;
@@ -631,13 +631,13 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
631
631
  _: 1
632
632
  }, 8, ["disabled", "loading"])])]),
633
633
  default: w(() => [a("div", Pe, [S(m) ? (h(), i("div", Fe, [s(l, { class: "is-loading" }, {
634
- default: w(() => [s(S(ee))]),
634
+ default: w(() => [s(S(H))]),
635
635
  _: 1
636
636
  }), c[1] ||= a("span", null, "加载中...", -1)])) : S(p).length === 0 ? (h(), i("div", Ie, [s(l, {
637
637
  size: 48,
638
638
  color: "#c0c4cc"
639
639
  }, {
640
- default: w(() => [s(S(I))]),
640
+ default: w(() => [s(S(F))]),
641
641
  _: 1
642
642
  }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (h(), i("div", Le, [O.value ? (h(), i("div", Re, [a("div", ze, [s(u, {
643
643
  type: "success",
@@ -648,7 +648,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
648
648
  }), a("span", Be, "v" + x(O.value.version_number), 1)])])) : r("", !0), s(g, null, {
649
649
  default: w(() => [(h(!0), i(e, null, v(S(p), (e) => (h(), n(f, {
650
650
  key: e.id,
651
- timestamp: N(e.created_at),
651
+ timestamp: ee(e.created_at),
652
652
  placement: "top",
653
653
  type: E.value?.id === e.id ? "primary" : "",
654
654
  hollow: E.value?.id !== e.id
@@ -675,7 +675,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
675
675
  }, nt = { class: "toolbar-right" }, rt = {
676
676
  key: 0,
677
677
  class: "collab-users"
678
- }, it = ["title"], at = /*#__PURE__*/ Z({
678
+ }, it = ["title"], at = /*#__PURE__*/ X({
679
679
  __name: "Toolbar",
680
680
  props: {
681
681
  title: {
@@ -707,6 +707,14 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
707
707
  showHistory: {
708
708
  type: Boolean,
709
709
  default: !1
710
+ },
711
+ showBackButton: {
712
+ type: Boolean,
713
+ default: !0
714
+ },
715
+ titleDisabled: {
716
+ type: Boolean,
717
+ default: !1
710
718
  }
711
719
  },
712
720
  emits: [
@@ -734,7 +742,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
734
742
  },
735
743
  polyline: {
736
744
  label: "折线",
737
- icon: R
745
+ icon: L
738
746
  },
739
747
  "right-angle": {
740
748
  label: "直角折线",
@@ -742,19 +750,19 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
742
750
  },
743
751
  curve: {
744
752
  label: "曲线",
745
- icon: J
753
+ icon: ae
746
754
  },
747
755
  wave: {
748
756
  label: "波浪线",
749
- icon: J
757
+ icon: ae
750
758
  },
751
759
  dashed: {
752
760
  label: "虚线",
753
- icon: W
761
+ icon: te
754
762
  },
755
763
  dotted: {
756
764
  label: "点线",
757
- icon: K
765
+ icon: G
758
766
  },
759
767
  dashdot: {
760
768
  label: "点划线",
@@ -762,26 +770,28 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
762
770
  }
763
771
  }, m = t(() => p[l.lineStyle]?.label || "引线"), g = t(() => p[l.lineStyle]?.icon || q);
764
772
  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");
773
+ 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"), B = y("el-popover");
766
774
  return h(), i("div", Ke, [
767
- a("div", qe, [s(_, {
775
+ a("div", qe, [c.showBackButton ? (h(), n(_, {
776
+ key: 0,
768
777
  onClick: l[0] ||= (e) => t.$emit("back"),
769
778
  size: "small",
770
779
  circle: ""
771
780
  }, {
772
781
  default: w(() => [s(p, null, {
773
- default: w(() => [s(S(N))]),
782
+ default: w(() => [s(S(ee))]),
774
783
  _: 1
775
784
  })]),
776
785
  _: 1
777
- }), s(C, {
786
+ })) : r("", !0), s(C, {
778
787
  modelValue: u.value,
779
788
  "onUpdate:modelValue": l[1] ||= (e) => u.value = e,
780
789
  onBlur: l[2] ||= (e) => t.$emit("update:title", u.value),
790
+ disabled: c.titleDisabled,
781
791
  placeholder: "输入标题",
782
792
  class: "title-input",
783
793
  size: "small"
784
- }, null, 8, ["modelValue"])]),
794
+ }, null, 8, ["modelValue", "disabled"])]),
785
795
  a("div", Je, [
786
796
  s(T, {
787
797
  content: "添加标注",
@@ -822,7 +832,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
822
832
  class: d({ "is-active": c.lineStyle === "polyline" })
823
833
  }, {
824
834
  default: w(() => [s(p, null, {
825
- default: w(() => [s(S(R))]),
835
+ default: w(() => [s(S(L))]),
826
836
  _: 1
827
837
  }), l[15] ||= o("折线 ", -1)]),
828
838
  _: 1
@@ -842,7 +852,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
842
852
  class: d({ "is-active": c.lineStyle === "curve" })
843
853
  }, {
844
854
  default: w(() => [s(p, null, {
845
- default: w(() => [s(S(J))]),
855
+ default: w(() => [s(S(ae))]),
846
856
  _: 1
847
857
  }), l[17] ||= o("曲线 ", -1)]),
848
858
  _: 1
@@ -852,7 +862,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
852
862
  class: d({ "is-active": c.lineStyle === "wave" })
853
863
  }, {
854
864
  default: w(() => [s(p, null, {
855
- default: w(() => [s(S(J))]),
865
+ default: w(() => [s(S(ae))]),
856
866
  _: 1
857
867
  }), l[18] ||= o("波浪线 ", -1)]),
858
868
  _: 1
@@ -863,7 +873,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
863
873
  class: d({ "is-active": c.lineStyle === "dashed" })
864
874
  }, {
865
875
  default: w(() => [s(p, null, {
866
- default: w(() => [s(S(W))]),
876
+ default: w(() => [s(S(te))]),
867
877
  _: 1
868
878
  }), l[19] ||= o("虚线 ", -1)]),
869
879
  _: 1
@@ -873,7 +883,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
873
883
  class: d({ "is-active": c.lineStyle === "dotted" })
874
884
  }, {
875
885
  default: w(() => [s(p, null, {
876
- default: w(() => [s(S(K))]),
886
+ default: w(() => [s(S(G))]),
877
887
  _: 1
878
888
  }), l[20] ||= o("点线 ", -1)]),
879
889
  _: 1
@@ -908,7 +918,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
908
918
  _: 1
909
919
  }),
910
920
  s(D, { direction: "vertical" }),
911
- s(V, {
921
+ s(B, {
912
922
  placement: "bottom",
913
923
  width: 280,
914
924
  trigger: "click"
@@ -937,7 +947,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
937
947
  plain: ""
938
948
  }, {
939
949
  default: w(() => [s(p, null, {
940
- default: w(() => [s(S(te))]),
950
+ default: w(() => [s(S(K))]),
941
951
  _: 1
942
952
  }), l[23] ||= o("新建分组 ", -1)]),
943
953
  _: 1
@@ -947,7 +957,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
947
957
  onClick: l[6] ||= (e) => t.$emit("clear-group-filter")
948
958
  }, {
949
959
  default: w(() => [s(p, null, {
950
- default: w(() => [s(S(L))]),
960
+ default: w(() => [s(S(I))]),
951
961
  _: 1
952
962
  }), l[24] ||= o("显示全部 ", -1)]),
953
963
  _: 1
@@ -962,7 +972,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
962
972
  }, [a("div", {
963
973
  class: "group-item-main",
964
974
  onClick: (n) => t.$emit("group-action", "filter", e.id)
965
- }, [a("span", $e, x(e.name), 1), c.activeGroupId === e.id ? (h(), n(P, {
975
+ }, [a("span", $e, x(e.name), 1), c.activeGroupId === e.id ? (h(), n(N, {
966
976
  key: 0,
967
977
  size: "small",
968
978
  type: "primary"
@@ -997,7 +1007,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
997
1007
  onClick: E((n) => t.$emit("group-action", "color", e.id), ["stop"])
998
1008
  }, {
999
1009
  default: w(() => [s(p, null, {
1000
- default: w(() => [s(S(F))]),
1010
+ default: w(() => [s(S(P))]),
1001
1011
  _: 1
1002
1012
  })]),
1003
1013
  _: 1
@@ -1015,7 +1025,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1015
1025
  onClick: E((n) => t.$emit("group-action", "delete", e.id), ["stop"])
1016
1026
  }, {
1017
1027
  default: w(() => [s(p, null, {
1018
- default: w(() => [s(S(z))]),
1028
+ default: w(() => [s(S(R))]),
1019
1029
  _: 1
1020
1030
  })]),
1021
1031
  _: 1
@@ -1055,7 +1065,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1055
1065
  title: "分享链接"
1056
1066
  }, {
1057
1067
  default: w(() => [s(p, null, {
1058
- default: w(() => [s(S(H))]),
1068
+ default: w(() => [s(S(V))]),
1059
1069
  _: 1
1060
1070
  })]),
1061
1071
  _: 1
@@ -1119,7 +1129,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1119
1129
  onClick: l[10] ||= (e) => t.$refs.jsonInput.click()
1120
1130
  }, {
1121
1131
  default: w(() => [s(p, null, {
1122
- default: w(() => [s(S(ae))]),
1132
+ default: w(() => [s(S(J))]),
1123
1133
  _: 1
1124
1134
  })]),
1125
1135
  _: 1
@@ -1138,7 +1148,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1138
1148
  onClick: l[12] ||= (e) => t.$emit("save")
1139
1149
  }, {
1140
1150
  default: w(() => [s(p, null, {
1141
- default: w(() => [s(S(B))]),
1151
+ default: w(() => [s(S(z))]),
1142
1152
  _: 1
1143
1153
  })]),
1144
1154
  _: 1
@@ -1151,7 +1161,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1151
1161
  onClick: l[13] ||= (e) => t.$emit("history")
1152
1162
  }, {
1153
1163
  default: w(() => [s(p, null, {
1154
- default: w(() => [s(S(I))]),
1164
+ default: w(() => [s(S(F))]),
1155
1165
  _: 1
1156
1166
  })]),
1157
1167
  _: 1
@@ -1160,7 +1170,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1160
1170
  ]);
1161
1171
  };
1162
1172
  }
1163
- }, [["__scopeId", "data-v-081fbd64"]]), ot = ["src"], st = ["onMousedown"], ct = {
1173
+ }, [["__scopeId", "data-v-1c493741"]]), ot = ["src"], st = ["onMousedown"], ct = {
1164
1174
  class: "leader-line-svg",
1165
1175
  style: {
1166
1176
  left: 0,
@@ -1174,7 +1184,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1174
1184
  "stroke-width",
1175
1185
  "stroke-dasharray",
1176
1186
  "marker-start"
1177
- ], dt = ["onMousedown"], ft = ["onBlur"], pt = ["onMousedown"], mt = ["onMousedown"], ht = ["onMousedown"], gt = /*#__PURE__*/ Z({
1187
+ ], dt = ["onMousedown"], ft = ["onBlur"], pt = ["onMousedown"], mt = ["onMousedown"], ht = ["onMousedown"], gt = /*#__PURE__*/ X({
1178
1188
  __name: "AnnotationCanvas",
1179
1189
  props: {
1180
1190
  imageUrl: String,
@@ -1240,50 +1250,50 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1240
1250
  r.background = `rgba(${parseInt(n.slice(1, 3), 16)}, ${parseInt(n.slice(3, 5), 16)}, ${parseInt(n.slice(5, 7), 16)}, ${t})`;
1241
1251
  }
1242
1252
  return r;
1243
- }, N = (e) => ({ background: e.numberColor || e.color || "#e74c3c" }), P = (e) => {
1253
+ }, ee = (e) => ({ background: e.numberColor || e.color || "#e74c3c" }), N = (e) => {
1244
1254
  let t = {
1245
1255
  fontFamily: e.fontFamily || "inherit",
1246
1256
  fontSize: e.fontSize ? e.fontSize + "px" : "inherit"
1247
1257
  };
1248
1258
  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) => ({
1259
+ }, P = (e) => ({
1250
1260
  left: e.x + "%",
1251
1261
  top: e.y + "%"
1252
- }), I = (e) => {
1262
+ }), F = (e) => {
1253
1263
  let t = {
1254
1264
  left: e.x + "%",
1255
1265
  top: e.y + "%",
1256
1266
  background: e.color || "#e74c3c"
1257
1267
  };
1258
1268
  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 = {
1269
+ }, I = null, L = null, R = (e, t) => {
1270
+ l("select", e), L = "label", C.value = e.id, b.value = !0, I = {
1261
1271
  ann: e,
1262
1272
  startX: t.clientX,
1263
1273
  startY: t.clientY,
1264
1274
  origLabelX: e.labelX || 0,
1265
1275
  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 = {
1276
+ }, document.addEventListener("mousemove", B), document.addEventListener("mouseup", V);
1277
+ }, z = (e, t) => {
1278
+ l("select", e), L = "dot", C.value = e.id, b.value = !0, I = {
1269
1279
  ann: e,
1270
1280
  startX: t.clientX,
1271
1281
  startY: t.clientY,
1272
1282
  origX: e.x,
1273
1283
  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") {
1284
+ }, document.addEventListener("mousemove", B), document.addEventListener("mouseup", V);
1285
+ }, B = (e) => {
1286
+ if (!I) return;
1287
+ let t = e.clientX - I.startX, n = e.clientY - I.startY;
1288
+ if (L === "label") I.ann.labelX = I.origLabelX + t, I.ann.labelY = I.origLabelY + n;
1289
+ else if (L === "dot") {
1280
1290
  let e = u.value;
1281
1291
  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;
1292
+ 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));
1293
+ I.ann.x = Math.round(i * 10) / 10, I.ann.y = Math.round(a * 10) / 10;
1284
1294
  }
1285
- }, H = () => {
1286
- b.value = !1, C.value = null, L = null, R = null, l("change"), document.removeEventListener("mousemove", V), document.removeEventListener("mouseup", H);
1295
+ }, V = () => {
1296
+ b.value = !1, C.value = null, I = null, L = null, l("change"), document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", V);
1287
1297
  };
1288
1298
  return r({ recalculateSize: k }), (t, r) => {
1289
1299
  let o = y("el-icon");
@@ -1332,13 +1342,13 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1332
1342
  a("div", {
1333
1343
  class: d(["annotation-label", { dragging: b.value && C.value === e.id }]),
1334
1344
  style: f(M(e)),
1335
- onMousedown: E((t) => z(e, t), ["stop"])
1345
+ onMousedown: E((t) => R(e, t), ["stop"])
1336
1346
  }, [a("span", {
1337
1347
  class: "annotation-number",
1338
- style: f(N(e))
1348
+ style: f(ee(e))
1339
1349
  }, x(e.number), 5), a("span", {
1340
1350
  class: "annotation-text",
1341
- style: f(P(e)),
1351
+ style: f(N(e)),
1342
1352
  contenteditable: "",
1343
1353
  onBlur: (t) => {
1344
1354
  e.text = t.target.textContent, l("change");
@@ -1348,8 +1358,8 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1348
1358
  e.pointStyle === "flag" ? (h(), i("div", {
1349
1359
  key: 0,
1350
1360
  class: "annotation-flag",
1351
- style: f(F(e)),
1352
- onMousedown: E((t) => B(e, t), ["stop"])
1361
+ style: f(P(e)),
1362
+ onMousedown: E((t) => z(e, t), ["stop"])
1353
1363
  }, [a("div", {
1354
1364
  class: "flag-pole",
1355
1365
  style: f({ background: e.color || "#e74c3c" })
@@ -1359,13 +1369,13 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1359
1369
  }, null, 4)], 44, pt)) : e.pointStyle === "arrow" ? (h(), i("div", {
1360
1370
  key: 2,
1361
1371
  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"])
1372
+ style: f(F(e)),
1373
+ onMousedown: E((t) => z(e, t), ["stop"])
1364
1374
  }, null, 46, ht)) : (h(), i("div", {
1365
1375
  key: 1,
1366
1376
  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"])
1377
+ style: f(F(e)),
1378
+ onMousedown: E((t) => z(e, t), ["stop"])
1369
1379
  }, null, 46, mt))
1370
1380
  ], 42, st))), 128))], 4)) : (h(), i("div", {
1371
1381
  key: 1,
@@ -1381,7 +1391,7 @@ var je = "/api/document-versions", Me = 5e3, Ne = () => {
1381
1391
  //#endregion
1382
1392
  //#region ../../src/composables/useExplosionCollaboration.js
1383
1393
  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 = () => {
1394
+ 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
1395
  b(), h = setInterval(() => {
1386
1396
  if (l && l.connection && l.connection.ws && l.connection.ws.readyState === WebSocket.CLOSED) try {
1387
1397
  l.connect();
@@ -1392,7 +1402,7 @@ function _t(e, { roomPrefix: t, syncKey: n = "_data" } = {}) {
1392
1402
  }, b = () => {
1393
1403
  h &&= (clearInterval(h), null);
1394
1404
  };
1395
- l = new se({
1405
+ l = new ce({
1396
1406
  url: g,
1397
1407
  name: v,
1398
1408
  document: r,
@@ -1531,33 +1541,68 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1531
1541
  }, Ut = {
1532
1542
  key: 1,
1533
1543
  class: "no-selection"
1534
- }, Wt = { class: "color-dialog-body" }, Gt = "explosion-image", Kt = /*#__PURE__*/ Z({
1544
+ }, Wt = { class: "color-dialog-body" }, Gt = "explosion-image", Kt = /*#__PURE__*/ X({
1535
1545
  __name: "ExplosionImageEditor",
1546
+ props: {
1547
+ docId: {
1548
+ type: [Number, String],
1549
+ default: null
1550
+ },
1551
+ apiBase: {
1552
+ type: String,
1553
+ default: "/api"
1554
+ },
1555
+ saveApi: {
1556
+ type: [String, Function],
1557
+ default: null
1558
+ },
1559
+ loadApi: {
1560
+ type: [String, Function],
1561
+ default: null
1562
+ },
1563
+ wsUrl: {
1564
+ type: String,
1565
+ default: ""
1566
+ },
1567
+ user: {
1568
+ type: Object,
1569
+ default: null
1570
+ },
1571
+ uiConfig: {
1572
+ type: Object,
1573
+ default: () => ({})
1574
+ }
1575
+ },
1536
1576
  setup(c) {
1537
- let l = O(), u = k(), d = _(null), f = _(null), b = _(!1), T = _(!1), { saveVersion: E } = Ne(), D = Ae(), M = g({
1577
+ let l = c, u = t(() => ({
1578
+ backButton: "show",
1579
+ titleEditable: !0,
1580
+ authorEditable: !0,
1581
+ ...l.uiConfig
1582
+ })), d = t(() => l.docId ?? f.params.id), f = O(), b = k(), T = _(l.docId ?? null), E = _(null), D = _(!1), M = _(!1), { saveVersion: ee } = Ne(), N = Ae(), P = g({
1538
1583
  title: "图片标注",
1539
1584
  imageUrl: "",
1540
1585
  annotations: [],
1541
1586
  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) => {
1587
+ }), F = _(!1), L = _(!1), R = _(!1), z = null, V = _("straight"), H = _(null), U = _(null), te = _(null), W = 0, G = _(null), K = _([]), ne = t(() => G.value ? P.annotations.filter((e) => e.groupId === G.value) : P.annotations), re = () => E.value?.click(), q = async (e) => {
1543
1588
  let t = e.target.files?.[0];
1544
1589
  if (!t) return;
1545
1590
  let n = new FormData();
1546
1591
  n.append("file", t);
1547
1592
  try {
1548
- let e = await Y.post("/api/files/upload/image", n);
1549
- M.imageUrl = e.data.url || e.data.file_path, $();
1593
+ let e = await Y.post(`${l.apiBase}/files/upload/image`, n);
1594
+ P.imageUrl = e.data.url || e.data.file_path, $();
1550
1595
  } catch {
1551
1596
  A.error("上传失败");
1552
1597
  }
1553
- }, ne = () => {
1554
- if (!M.imageUrl) {
1598
+ }, ie = () => {
1599
+ if (!P.imageUrl) {
1555
1600
  A.warning("请先上传图片");
1556
1601
  return;
1557
1602
  }
1558
- let e = M.annotations.reduce((e, t) => Math.max(e, t.number), 0);
1559
- M.annotations.push({
1560
- id: `ann-${++ee}-${Date.now()}`,
1603
+ let e = P.annotations.reduce((e, t) => Math.max(e, t.number), 0);
1604
+ P.annotations.push({
1605
+ id: `ann-${++W}-${Date.now()}`,
1561
1606
  number: e + 1,
1562
1607
  text: "",
1563
1608
  x: 50,
@@ -1579,78 +1624,94 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1579
1624
  textDecoration: "",
1580
1625
  groupId: ""
1581
1626
  }), $();
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
1627
  }, ae = (e) => {
1628
+ H.value = e.id, U.value = e;
1629
+ }, J = (e, t) => {
1630
+ U.value && (U.value[e] === t ? U.value[e] = "" : U.value[e] = t);
1631
+ }, oe = () => {
1632
+ U.value && (U.value.fontFamily = "", U.value.fontSize = 13, U.value.fontWeight = "", U.value.fontStyle = "", U.value.textDecoration = "");
1633
+ }, se = () => {
1634
+ P.annotations = P.annotations.filter((e) => e.id !== H.value), H.value = null, U.value = null, $();
1635
+ }, ce = (e) => {
1591
1636
  e === "new" && j.prompt("分组名称", "新建分组", { inputPlaceholder: "名称" }).then(({ value: e }) => {
1592
- e && (M.groups.push({
1637
+ e && (P.groups.push({
1593
1638
  id: `grp-${Date.now()}`,
1594
1639
  name: e
1595
1640
  }), $());
1596
1641
  }).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) => {
1642
+ }, X = (e, t) => {
1643
+ e === "filter" ? G.value = G.value === t ? null : t : e === "collapse" ? de(t) : e === "color" ? (le.value = t, Z.value = !0) : e === "delete" && j.confirm("确定删除该分组?分组内的标注将保留,但分组关系将被移除。", "删除分组", { type: "warning" }).then(() => {
1644
+ P.annotations.forEach((e) => {
1600
1645
  e.groupId === t && (e.groupId = "");
1601
- }), M.groups = M.groups.filter((e) => e.id !== t), U.value === t && (U.value = null), A.success("分组已删除"), $();
1646
+ }), P.groups = P.groups.filter((e) => e.id !== t), G.value === t && (G.value = null), A.success("分组已删除"), $();
1602
1647
  }).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) {
1648
+ }, Z = _(!1), le = _(null), Q = _("#e74c3c"), ue = () => {
1649
+ P.annotations.forEach((e) => {
1650
+ e.groupId === le.value && (e.color = Q.value, e.numberColor = Q.value, e.lineColor = Q.value, e.textColor = Q.value);
1651
+ }), Z.value = !1, A.success("颜色已更新"), $();
1652
+ }, de = (e) => {
1653
+ let t = K.value.indexOf(e);
1654
+ t === -1 ? K.value.push(e) : K.value.splice(t, 1);
1655
+ }, fe = () => {
1656
+ G.value = null, K.value = [];
1657
+ }, pe = async () => {
1658
+ if (F.value && z?.collaborationClosed.value && !R.value) {
1614
1659
  A.warning("协作已关闭,无法保存");
1615
1660
  return;
1616
1661
  }
1617
1662
  try {
1618
1663
  let e = {
1619
- title: M.title,
1664
+ title: P.title,
1620
1665
  view_type: "image",
1621
1666
  config: JSON.stringify({
1622
- imageUrl: M.imageUrl,
1623
- annotations: M.annotations,
1624
- groups: M.groups,
1625
- lineStyle: R.value
1667
+ imageUrl: P.imageUrl,
1668
+ annotations: P.annotations,
1669
+ groups: P.groups,
1670
+ lineStyle: V.value
1626
1671
  })
1627
1672
  };
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,
1673
+ if (typeof l.saveApi == "function") {
1674
+ let t = await l.saveApi(e, T.value);
1675
+ t?.id && (T.value = t.id);
1676
+ } else if (typeof l.saveApi == "string") T.value ? await Y.put(l.saveApi, e) : T.value = (await Y.post(l.saveApi, e)).data.id;
1677
+ else {
1678
+ let t = l.apiBase;
1679
+ T.value ? await Y.put(`${t}/explosion-views/${T.value}`, e) : T.value = (await Y.post(`${t}/explosion-views/`, e)).data.id;
1680
+ }
1681
+ A.success("保存成功"), ee({
1682
+ documentId: T.value,
1630
1683
  docType: "image",
1631
1684
  content: JSON.stringify({
1632
- imageUrl: M.imageUrl,
1633
- annotations: M.annotations,
1634
- groups: M.groups,
1635
- lineStyle: R.value
1685
+ imageUrl: P.imageUrl,
1686
+ annotations: P.annotations,
1687
+ groups: P.groups,
1688
+ lineStyle: V.value
1636
1689
  }),
1637
- userId: String(D.currentUser.value?.id || ""),
1638
- userName: D.currentUser.value?.name || "未知"
1690
+ userId: String(N.currentUser.value?.id || ""),
1691
+ userName: N.currentUser.value?.name || "未知"
1639
1692
  });
1640
1693
  } catch {
1641
1694
  A.error("保存失败");
1642
1695
  }
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) {
1696
+ }, me = async () => {
1697
+ if (d.value) try {
1698
+ let e;
1699
+ if (typeof l.loadApi == "function") e = await l.loadApi(d.value);
1700
+ else if (typeof l.loadApi == "string") e = (await Y.get(l.loadApi)).data;
1701
+ else {
1702
+ let t = l.apiBase;
1703
+ e = (await Y.get(`${t}/explosion-views/${d.value}`)).data;
1704
+ }
1705
+ if (T.value = e.id, P.title = e.title, e.config) {
1647
1706
  let t = JSON.parse(e.config);
1648
- M.imageUrl = t.imageUrl || "", M.annotations = t.annotations || [], M.groups = t.groups || [], R.value = t.lineStyle || "straight";
1707
+ P.imageUrl = t.imageUrl || "", P.annotations = t.annotations || [], P.groups = t.groups || [], V.value = t.lineStyle || "straight";
1649
1708
  }
1650
1709
  } catch (e) {
1651
1710
  console.error(e);
1652
1711
  }
1653
- }, fe = () => u.push("/"), pe = [
1712
+ }, he = () => {
1713
+ l.docId ?? b.push("/");
1714
+ }, ge = [
1654
1715
  "我可以帮您优化图片标注、检查注释内容,或者提供标注建议。请问有什么需要帮助的?",
1655
1716
  "这张图片的标注很详细。建议检查标注线条是否清晰,避免与其他标注重叠。",
1656
1717
  "根据当前的标注内容,我建议为关键部件添加更详细的文字说明。",
@@ -1659,33 +1720,33 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1659
1720
  "图片标注的分组功能可以帮助您管理复杂的标注。建议按功能模块进行分组。",
1660
1721
  "我可以帮您将标注信息整理成表格,方便后续查阅和修改。",
1661
1722
  "标注的连线样式建议统一,直线适合简单标注,折线适合复杂场景。"
1662
- ], me = async (e, t = {}) => {
1663
- let n = d.value ? `${Gt}-${d.value}` : null;
1664
- await D.sendMessage(e, {
1723
+ ], _e = async (e, t = {}) => {
1724
+ let n = T.value ? `${Gt}-${T.value}` : null;
1725
+ await N.sendMessage(e, {
1665
1726
  ...t,
1666
1727
  roomId: n
1667
1728
  });
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;
1729
+ let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a = N.collabUsers.value.filter((e) => e.name !== N.currentUser.value.name);
1730
+ (!r || i || a.length === 0) && (N.loading.value = !0, setTimeout(() => {
1731
+ N.sendAiMessage(ge[Math.floor(Math.random() * ge.length)], n), N.loading.value = !1;
1671
1732
  }, 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) {
1733
+ }, ve = () => {
1734
+ let e = T.value ? `${Gt}-${T.value}` : null;
1735
+ N.clearMessages(e);
1736
+ }, ye = () => {
1737
+ if (!T.value) {
1677
1738
  A.warning("请先保存文档");
1678
1739
  return;
1679
1740
  }
1680
- T.value = !0;
1681
- }, _e = (e) => {
1741
+ M.value = !0;
1742
+ }, be = (e) => {
1682
1743
  try {
1683
1744
  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;
1745
+ t.imageUrl && (P.imageUrl = t.imageUrl), t.annotations && (P.annotations = t.annotations), t.groups && (P.groups = t.groups), t.lineStyle && (V.value = t.lineStyle), H.value = null, U.value = null;
1685
1746
  } catch (e) {
1686
1747
  console.error("Version apply error:", e);
1687
1748
  }
1688
- }, ve = (e) => {
1749
+ }, xe = (e) => {
1689
1750
  if (e === "png" || e === "png-filtered") {
1690
1751
  let t = document.querySelector(".annotation-image");
1691
1752
  if (!t) return A.error("未找到图片");
@@ -1693,11 +1754,11 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1693
1754
  n.width = t.naturalWidth, n.height = t.naturalHeight;
1694
1755
  let r = n.getContext("2d");
1695
1756
  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 = [
1757
+ let i = n.width / t.clientWidth, a = n.height / t.clientHeight, o = Math.max(i, a), s = e === "png-filtered" ? ne.value : P.annotations, c = [
1697
1758
  "dashed",
1698
1759
  "dotted",
1699
1760
  "dashdot"
1700
- ].includes(R.value) ? "straight" : R.value, l = s.map((e) => {
1761
+ ].includes(V.value) ? "straight" : V.value, l = s.map((e) => {
1701
1762
  let t = e.x / 100 * n.width, r = e.y / 100 * n.height;
1702
1763
  return {
1703
1764
  ann: e,
@@ -1752,20 +1813,20 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1752
1813
  }
1753
1814
  }), n.toBlob((e) => {
1754
1815
  let t = document.createElement("a");
1755
- t.href = URL.createObjectURL(e), t.download = `${M.title || "图片标注"}.png`, t.click();
1816
+ t.href = URL.createObjectURL(e), t.download = `${P.title || "图片标注"}.png`, t.click();
1756
1817
  });
1757
- } else e === "json" ? ye() : A.info(`导出 ${e} 开发中`);
1758
- }, ye = () => {
1818
+ } else e === "json" ? Se() : A.info(`导出 ${e} 开发中`);
1819
+ }, Se = () => {
1759
1820
  let e = {
1760
- title: M.title,
1761
- imageUrl: M.imageUrl,
1762
- annotations: M.annotations,
1763
- groups: M.groups,
1764
- lineStyle: R.value,
1821
+ title: P.title,
1822
+ imageUrl: P.imageUrl,
1823
+ annotations: P.annotations,
1824
+ groups: P.groups,
1825
+ lineStyle: V.value,
1765
1826
  exportTime: (/* @__PURE__ */ new Date()).toISOString()
1766
1827
  }, 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) => {
1828
+ n.href = URL.createObjectURL(t), n.download = `${P.title || "爆炸图"}.json`, n.click(), A.success("JSON已导出");
1829
+ }, Ce = (e) => {
1769
1830
  let t = e.target.files[0];
1770
1831
  if (!t) return;
1771
1832
  let n = new FileReader();
@@ -1776,84 +1837,84 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1776
1837
  A.error("JSON格式无效:缺少图片或标注数据");
1777
1838
  return;
1778
1839
  }
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("导入成功");
1840
+ P.title = t.title || "图片标注", P.imageUrl = t.imageUrl || "", P.annotations = t.annotations || [], P.groups = t.groups || [], V.value = t.lineStyle || "straight", H.value = null, U.value = null, $(), A.success("导入成功");
1780
1841
  } catch {
1781
1842
  A.error("JSON解析失败,请检查文件格式");
1782
1843
  }
1783
1844
  }, n.readAsText(t), e.target.value = "";
1784
1845
  }, $ = () => {
1785
- N.value && I && I.pushToYjs(M);
1846
+ F.value && z && z.pushToYjs(P);
1786
1847
  };
1787
- C(B, () => {
1848
+ C(U, () => {
1788
1849
  $();
1789
1850
  }, { 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)) {
1851
+ let we = (e) => {
1852
+ z &&= (z.destroy(), null), z = vt(e, { onRemoteChange: (e) => {
1853
+ e.title && (P.title = e.title), e.imageUrl && (P.imageUrl = e.imageUrl), e.annotations && (P.annotations = e.annotations), e.groups && (P.groups = e.groups);
1854
+ } }), z._setSyncReady(!1);
1855
+ }, Te = async () => {
1856
+ if (F.value) return;
1857
+ if (!T.value && (await pe(), !T.value)) {
1797
1858
  A.error("请先保存文档");
1798
1859
  return;
1799
1860
  }
1800
- xe(String(d.value)), I.connect();
1861
+ we(String(T.value)), z.connect();
1801
1862
  let e = {
1802
1863
  name: `用户${Math.floor(Math.random() * 1e3)}`,
1803
1864
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
1804
1865
  }, 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,
1866
+ if (z.provider && z.provider.synced) {
1867
+ z._setSyncReady(!0), z.setLocalUser(e);
1868
+ let t = z.pullFromYjs();
1869
+ t ? (t.title && (P.title = t.title), t.imageUrl && (P.imageUrl = t.imageUrl), t.annotations && (P.annotations = t.annotations), t.groups && (P.groups = t.groups)) : (P.annotations.length > 0 || P.imageUrl) && z.pushToYjs(P), F.value = !0, R.value = !0, L.value = !1, N.setCollabContext({
1870
+ ydoc: z.ydoc,
1871
+ provider: z.provider,
1872
+ onlineUsers: z.onlineUsers
1873
+ }), N.setCurrentUser({
1874
+ id: z.provider.awareness.clientID,
1814
1875
  name: e.name,
1815
1876
  color: e.color
1816
1877
  }), A.success("协作已开启");
1817
1878
  } else setTimeout(t, 100);
1818
1879
  };
1819
1880
  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;
1881
+ }, Ee = () => {
1882
+ z && (z.closeCollaboration(), F.value = !1, R.value = !1, A.info("协作已关闭"));
1883
+ }, De = () => {
1884
+ let e = f.params.id;
1824
1885
  if (!e) return;
1825
- xe(e), I.connect();
1886
+ we(e), z.connect();
1826
1887
  let t = {
1827
1888
  name: `协作人${Math.floor(Math.random() * 1e3)}`,
1828
1889
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
1829
1890
  }, n = () => {
1830
- if (I.provider && I.provider.synced) {
1831
- if (I.checkCollaborationClosed()) {
1832
- I.disconnect(), N.value = !1, A.warning("该协作已关闭,无法加入");
1891
+ if (z.provider && z.provider.synced) {
1892
+ if (z.checkCollaborationClosed()) {
1893
+ z.disconnect(), F.value = !1, A.warning("该协作已关闭,无法加入");
1833
1894
  return;
1834
1895
  }
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,
1896
+ z._setSyncReady(!0), z.setLocalUser(t);
1897
+ let e = z.pullFromYjs();
1898
+ e && (e.title && (P.title = e.title), e.imageUrl && (P.imageUrl = e.imageUrl), e.annotations && (P.annotations = e.annotations), e.groups && (P.groups = e.groups)), F.value = !0, R.value = !1, N.setCollabContext({
1899
+ ydoc: z.ydoc,
1900
+ provider: z.provider,
1901
+ onlineUsers: z.onlineUsers
1902
+ }), N.setCurrentUser({
1903
+ id: z.provider.awareness.clientID,
1843
1904
  name: t.name,
1844
1905
  color: t.color
1845
1906
  }), A.success("已加入协作");
1846
1907
  } else setTimeout(n, 100);
1847
1908
  };
1848
1909
  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)) {
1910
+ }, Oe = () => {
1911
+ F.value ? Ee() : Te();
1912
+ }, je = async () => {
1913
+ if (F.value || await Te(), !T.value && (await pe(), !T.value)) {
1853
1914
  A.warning("请先保存文档后再分享");
1854
1915
  return;
1855
1916
  }
1856
- let e = `${window.location.origin}/explosion-image/${d.value}?collab=1`;
1917
+ let e = `${window.location.origin}/explosion-image/${T.value}?collab=1`;
1857
1918
  try {
1858
1919
  await navigator.clipboard.writeText(e), A.success("协作链接已复制到剪贴板");
1859
1920
  } catch {
@@ -1861,44 +1922,46 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1861
1922
  }
1862
1923
  };
1863
1924
  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(),
1925
+ let e = l.user?.name || localStorage.getItem("editor-user-name") || `用户${Math.floor(Math.random() * 1e3)}`;
1926
+ localStorage.setItem("editor-user-name", e), N.setCurrentUser({
1927
+ id: l.user?.id || Date.now(),
1867
1928
  name: e,
1868
- color: "#409eff"
1869
- }), await de(), l.params.id && l.query.collab === "1" && we();
1929
+ color: l.user?.color || "#409eff"
1930
+ }), await me(), d.value && f.query.collab === "1" && De();
1870
1931
  });
1871
- let De = (e) => {
1872
- e.key === "Delete" && z.value && J();
1932
+ let Me = (e) => {
1933
+ e.key === "Delete" && H.value && se();
1873
1934
  };
1874
- return p(() => document.addEventListener("keydown", De)), m(() => {
1875
- document.removeEventListener("keydown", De), I &&= (I.destroy(), null);
1935
+ return p(() => document.addEventListener("keydown", Me)), m(() => {
1936
+ document.removeEventListener("keydown", Me), z &&= (z.destroy(), null);
1876
1937
  }), (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");
1938
+ 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");
1878
1939
  return h(), i("div", yt, [
1879
1940
  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
1941
+ title: P.title,
1942
+ "onUpdate:title": c[0] ||= (e) => P.title = e,
1943
+ "line-style": V.value,
1944
+ groups: P.groups,
1945
+ "active-group-id": G.value,
1946
+ "collapsed-groups": K.value,
1947
+ "is-connected": F.value,
1948
+ "online-users": S(z) ? S(z).onlineUsers.value : [],
1949
+ "is-join-mode": S(f).query.collab === "1",
1950
+ "show-back-button": u.value.backButton === "show",
1951
+ "title-disabled": !u.value.titleEditable,
1952
+ onBack: he,
1953
+ onAddAnnotation: ie,
1954
+ onSetLineStyle: c[1] ||= (e) => V.value = e,
1955
+ onAddGroup: ce,
1956
+ onGroupAction: X,
1957
+ onClearGroupFilter: fe,
1958
+ onExport: xe,
1959
+ onImportJson: Ce,
1960
+ onSave: pe,
1961
+ onToggleCollab: Oe,
1962
+ onShareCollab: je,
1963
+ "show-history": !!T.value,
1964
+ onHistory: ye
1902
1965
  }, null, 8, [
1903
1966
  "title",
1904
1967
  "line-style",
@@ -1908,18 +1971,20 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1908
1971
  "is-connected",
1909
1972
  "online-users",
1910
1973
  "is-join-mode",
1974
+ "show-back-button",
1975
+ "title-disabled",
1911
1976
  "show-history"
1912
1977
  ]),
1913
1978
  a("div", bt, [a("div", xt, [s(gt, {
1914
1979
  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,
1980
+ ref: te,
1981
+ "image-url": P.imageUrl,
1982
+ annotations: ne.value,
1983
+ "collapsed-groups": K.value,
1984
+ "selected-id": H.value,
1985
+ "line-style": V.value,
1986
+ onSelect: ae,
1987
+ onUploadImage: re,
1923
1988
  onChange: $
1924
1989
  }, null, 8, [
1925
1990
  "image-url",
@@ -1929,317 +1994,317 @@ var vt = (e, { onRemoteChange: t } = {}) => {
1929
1994
  "line-style"
1930
1995
  ]), a("input", {
1931
1996
  ref_key: "fileInputRef",
1932
- ref: f,
1997
+ ref: E,
1933
1998
  type: "file",
1934
1999
  accept: "image/*",
1935
2000
  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,
2001
+ onChange: q
2002
+ }, null, 544)]), a("div", St, [c[58] ||= a("h4", null, "标注属性", -1), U.value ? (h(), i(e, { key: 0 }, [
2003
+ a("div", Ct, [c[31] ||= a("label", null, "编号", -1), s(l, {
2004
+ modelValue: U.value.number,
2005
+ "onUpdate:modelValue": c[2] ||= (e) => U.value.number = e,
1941
2006
  min: 1,
1942
2007
  size: "small"
1943
2008
  }, 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,
2009
+ a("div", wt, [c[32] ||= a("label", null, "文字", -1), s(d, {
2010
+ modelValue: U.value.text,
2011
+ "onUpdate:modelValue": c[3] ||= (e) => U.value.text = e,
1947
2012
  size: "small"
1948
2013
  }, 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,
2014
+ a("div", Tt, [c[33] ||= a("label", null, "引线颜色", -1), s(p, {
2015
+ modelValue: U.value.lineColor,
2016
+ "onUpdate:modelValue": c[4] ||= (e) => U.value.lineColor = e,
1952
2017
  size: "small",
1953
2018
  "show-alpha": ""
1954
2019
  }, 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,
2020
+ a("div", Et, [c[34] ||= a("label", null, "标注点样式", -1), s(g, {
2021
+ modelValue: U.value.pointStyle,
2022
+ "onUpdate:modelValue": c[5] ||= (e) => U.value.pointStyle = e,
1958
2023
  size: "small"
1959
2024
  }, {
1960
2025
  default: w(() => [
1961
- s(g, {
2026
+ s(m, {
1962
2027
  label: "圆形",
1963
2028
  value: "circle"
1964
2029
  }),
1965
- s(g, {
2030
+ s(m, {
1966
2031
  label: "方形",
1967
2032
  value: "square"
1968
2033
  }),
1969
- s(g, {
2034
+ s(m, {
1970
2035
  label: "菱形",
1971
2036
  value: "diamond"
1972
2037
  }),
1973
- s(g, {
2038
+ s(m, {
1974
2039
  label: "箭头",
1975
2040
  value: "arrow"
1976
2041
  }),
1977
- s(g, {
2042
+ s(m, {
1978
2043
  label: "红旗",
1979
2044
  value: "flag"
1980
2045
  })
1981
2046
  ]),
1982
2047
  _: 1
1983
2048
  }, 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,
2049
+ a("div", Dt, [c[35] ||= a("label", null, "标注点颜色", -1), s(p, {
2050
+ modelValue: U.value.color,
2051
+ "onUpdate:modelValue": c[6] ||= (e) => U.value.color = e,
1987
2052
  size: "small"
1988
2053
  }, 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,
2054
+ a("div", Ot, [c[36] ||= a("label", null, "编号颜色", -1), s(p, {
2055
+ modelValue: U.value.numberColor,
2056
+ "onUpdate:modelValue": c[7] ||= (e) => U.value.numberColor = e,
1992
2057
  size: "small"
1993
2058
  }, 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,
2059
+ a("div", kt, [c[37] ||= a("label", null, "文字颜色", -1), s(p, {
2060
+ modelValue: U.value.textColor,
2061
+ "onUpdate:modelValue": c[8] ||= (e) => U.value.textColor = e,
1997
2062
  size: "small"
1998
2063
  }, 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,
2064
+ a("div", At, [c[38] ||= a("label", null, "文字背景色", -1), s(p, {
2065
+ modelValue: U.value.labelBgColor,
2066
+ "onUpdate:modelValue": c[9] ||= (e) => U.value.labelBgColor = e,
2002
2067
  size: "small",
2003
2068
  "show-alpha": ""
2004
2069
  }, 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,
2070
+ a("div", jt, [c[39] ||= a("label", null, "背景透明度", -1), s(_, {
2071
+ modelValue: U.value.labelBgOpacity,
2072
+ "onUpdate:modelValue": c[10] ||= (e) => U.value.labelBgOpacity = e,
2008
2073
  min: 0,
2009
2074
  max: 100,
2010
2075
  step: 5,
2011
2076
  "show-input": "",
2012
2077
  "input-size": "small"
2013
2078
  }, 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,
2079
+ a("div", Mt, [c[40] ||= a("label", null, "字体", -1), s(g, {
2080
+ modelValue: U.value.fontFamily,
2081
+ "onUpdate:modelValue": c[11] ||= (e) => U.value.fontFamily = e,
2017
2082
  size: "small",
2018
2083
  clearable: ""
2019
2084
  }, {
2020
2085
  default: w(() => [
2021
- s(g, {
2086
+ s(m, {
2022
2087
  label: "默认",
2023
2088
  value: ""
2024
2089
  }),
2025
- s(g, {
2090
+ s(m, {
2026
2091
  label: "宋体",
2027
2092
  value: "SimSun"
2028
2093
  }),
2029
- s(g, {
2094
+ s(m, {
2030
2095
  label: "黑体",
2031
2096
  value: "SimHei"
2032
2097
  }),
2033
- s(g, {
2098
+ s(m, {
2034
2099
  label: "微软雅黑",
2035
2100
  value: "Microsoft YaHei"
2036
2101
  }),
2037
- s(g, {
2102
+ s(m, {
2038
2103
  label: "楷体",
2039
2104
  value: "KaiTi"
2040
2105
  }),
2041
- s(g, {
2106
+ s(m, {
2042
2107
  label: "Arial",
2043
2108
  value: "Arial"
2044
2109
  }),
2045
- s(g, {
2110
+ s(m, {
2046
2111
  label: "Times New Roman",
2047
2112
  value: "Times New Roman"
2048
2113
  })
2049
2114
  ]),
2050
2115
  _: 1
2051
2116
  }, 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,
2117
+ a("div", Nt, [c[41] ||= a("label", null, "字号", -1), s(l, {
2118
+ modelValue: U.value.fontSize,
2119
+ "onUpdate:modelValue": c[12] ||= (e) => U.value.fontSize = e,
2055
2120
  min: 10,
2056
2121
  max: 32,
2057
2122
  size: "small"
2058
2123
  }, null, 8, ["modelValue"])]),
2059
2124
  a("div", Pt, [c[46] ||= a("label", null, "字体样式", -1), a("div", Ft, [
2060
- s(E, {
2061
- type: B.value.fontWeight === "bold" ? "primary" : "",
2125
+ s(b, {
2126
+ type: U.value.fontWeight === "bold" ? "primary" : "",
2062
2127
  size: "small",
2063
- onClick: c[13] ||= (e) => q("fontWeight", "bold")
2128
+ onClick: c[13] ||= (e) => J("fontWeight", "bold")
2064
2129
  }, {
2065
2130
  default: w(() => [...c[42] ||= [a("b", null, "B", -1)]]),
2066
2131
  _: 1
2067
2132
  }, 8, ["type"]),
2068
- s(E, {
2069
- type: B.value.fontWeight === "bolder" ? "primary" : "",
2133
+ s(b, {
2134
+ type: U.value.fontWeight === "bolder" ? "primary" : "",
2070
2135
  size: "small",
2071
- onClick: c[14] ||= (e) => q("fontWeight", "bolder")
2136
+ onClick: c[14] ||= (e) => J("fontWeight", "bolder")
2072
2137
  }, {
2073
2138
  default: w(() => [...c[43] ||= [a("b", { style: { "font-size": "14px" } }, "B", -1)]]),
2074
2139
  _: 1
2075
2140
  }, 8, ["type"]),
2076
- s(E, {
2077
- type: B.value.fontStyle === "italic" ? "primary" : "",
2141
+ s(b, {
2142
+ type: U.value.fontStyle === "italic" ? "primary" : "",
2078
2143
  size: "small",
2079
- onClick: c[15] ||= (e) => q("fontStyle", "italic")
2144
+ onClick: c[15] ||= (e) => J("fontStyle", "italic")
2080
2145
  }, {
2081
2146
  default: w(() => [...c[44] ||= [a("i", null, "I", -1)]]),
2082
2147
  _: 1
2083
2148
  }, 8, ["type"]),
2084
- s(E, {
2085
- type: B.value.fontStyle === "oblique" ? "primary" : "",
2149
+ s(b, {
2150
+ type: U.value.fontStyle === "oblique" ? "primary" : "",
2086
2151
  size: "small",
2087
- onClick: c[16] ||= (e) => q("fontStyle", "oblique")
2152
+ onClick: c[16] ||= (e) => J("fontStyle", "oblique")
2088
2153
  }, {
2089
2154
  default: w(() => [...c[45] ||= [a("i", { style: { "font-style": "oblique" } }, "I", -1)]]),
2090
2155
  _: 1
2091
2156
  }, 8, ["type"])
2092
2157
  ])]),
2093
2158
  a("div", It, [c[51] ||= a("label", null, "装饰", -1), a("div", Lt, [
2094
- s(E, {
2095
- type: B.value.textDecoration === "underline" ? "primary" : "",
2159
+ s(b, {
2160
+ type: U.value.textDecoration === "underline" ? "primary" : "",
2096
2161
  size: "small",
2097
- onClick: c[17] ||= (e) => q("textDecoration", "underline")
2162
+ onClick: c[17] ||= (e) => J("textDecoration", "underline")
2098
2163
  }, {
2099
2164
  default: w(() => [...c[47] ||= [a("u", null, "U", -1)]]),
2100
2165
  _: 1
2101
2166
  }, 8, ["type"]),
2102
- s(E, {
2103
- type: B.value.textDecoration === "line-through" ? "primary" : "",
2167
+ s(b, {
2168
+ type: U.value.textDecoration === "line-through" ? "primary" : "",
2104
2169
  size: "small",
2105
- onClick: c[18] ||= (e) => q("textDecoration", "line-through")
2170
+ onClick: c[18] ||= (e) => J("textDecoration", "line-through")
2106
2171
  }, {
2107
2172
  default: w(() => [...c[48] ||= [a("s", null, "S", -1)]]),
2108
2173
  _: 1
2109
2174
  }, 8, ["type"]),
2110
- s(E, {
2111
- type: B.value.textDecoration === "underline line-through" ? "primary" : "",
2175
+ s(b, {
2176
+ type: U.value.textDecoration === "underline line-through" ? "primary" : "",
2112
2177
  size: "small",
2113
- onClick: c[19] ||= (e) => q("textDecoration", "underline line-through")
2178
+ onClick: c[19] ||= (e) => J("textDecoration", "underline line-through")
2114
2179
  }, {
2115
2180
  default: w(() => [...c[49] ||= [a("u", null, [a("s", null, "U")], -1)]]),
2116
2181
  _: 1
2117
2182
  }, 8, ["type"]),
2118
- s(E, {
2183
+ s(b, {
2119
2184
  size: "small",
2120
- onClick: ie
2185
+ onClick: oe
2121
2186
  }, {
2122
2187
  default: w(() => [...c[50] ||= [o("清除", -1)]]),
2123
2188
  _: 1
2124
2189
  })
2125
2190
  ])]),
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,
2191
+ a("div", Rt, [c[52] ||= a("label", null, "X% (点)", -1), s(_, {
2192
+ modelValue: U.value.x,
2193
+ "onUpdate:modelValue": c[20] ||= (e) => U.value.x = e,
2129
2194
  min: 0,
2130
2195
  max: 100,
2131
2196
  step: .5,
2132
2197
  "show-input": "",
2133
2198
  "input-size": "small"
2134
2199
  }, 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,
2200
+ a("div", zt, [c[53] ||= a("label", null, "Y% (点)", -1), s(_, {
2201
+ modelValue: U.value.y,
2202
+ "onUpdate:modelValue": c[21] ||= (e) => U.value.y = e,
2138
2203
  min: 0,
2139
2204
  max: 100,
2140
2205
  step: .5,
2141
2206
  "show-input": "",
2142
2207
  "input-size": "small"
2143
2208
  }, 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,
2209
+ a("div", Bt, [c[54] ||= a("label", null, "线宽", -1), s(l, {
2210
+ modelValue: U.value.strokeWidth,
2211
+ "onUpdate:modelValue": c[22] ||= (e) => U.value.strokeWidth = e,
2147
2212
  min: 1,
2148
2213
  max: 5,
2149
2214
  size: "small"
2150
2215
  }, 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,
2216
+ a("div", Vt, [c[55] ||= a("label", null, "分组", -1), s(g, {
2217
+ modelValue: U.value.groupId,
2218
+ "onUpdate:modelValue": c[23] ||= (e) => U.value.groupId = e,
2154
2219
  size: "small",
2155
2220
  clearable: ""
2156
2221
  }, {
2157
- default: w(() => [(h(!0), i(e, null, v(M.groups, (e) => (h(), n(g, {
2222
+ default: w(() => [(h(!0), i(e, null, v(P.groups, (e) => (h(), n(m, {
2158
2223
  key: e.id,
2159
2224
  label: e.name,
2160
2225
  value: e.id
2161
2226
  }, null, 8, ["label", "value"]))), 128))]),
2162
2227
  _: 1
2163
2228
  }, 8, ["modelValue"])]),
2164
- U.value ? (h(), i("div", Ht, [s(k, {
2229
+ G.value ? (h(), i("div", Ht, [s(O, {
2165
2230
  size: "small",
2166
2231
  type: "info"
2167
2232
  }, {
2168
- default: w(() => [o(" 当前筛选: " + x(M.groups.find((e) => e.id === U.value)?.name || "未知分组") + " ", 1), s(O, {
2233
+ default: w(() => [o(" 当前筛选: " + x(P.groups.find((e) => e.id === G.value)?.name || "未知分组") + " ", 1), s(C, {
2169
2234
  class: "el-tag__close",
2170
- onClick: ue
2235
+ onClick: fe
2171
2236
  }, {
2172
- default: w(() => [s(S(L))]),
2237
+ default: w(() => [s(S(I))]),
2173
2238
  _: 1
2174
2239
  })]),
2175
2240
  _: 1
2176
2241
  })])) : r("", !0),
2177
- s(E, {
2242
+ s(b, {
2178
2243
  size: "small",
2179
2244
  type: "danger",
2180
- onClick: J
2245
+ onClick: se
2181
2246
  }, {
2182
2247
  default: w(() => [...c[56] ||= [o("删除", -1)]]),
2183
2248
  _: 1
2184
2249
  })
2185
- ], 64)) : (h(), i("div", Ut, [s(O, {
2250
+ ], 64)) : (h(), i("div", Ut, [s(C, {
2186
2251
  size: "48",
2187
2252
  color: "#ccc"
2188
2253
  }, {
2189
- default: w(() => [s(S(V))]),
2254
+ default: w(() => [s(S(B))]),
2190
2255
  _: 1
2191
2256
  }), c[57] ||= a("p", null, "点击标注进行编辑", -1)]))])]),
2192
- s(A, {
2193
- modelValue: X.value,
2194
- "onUpdate:modelValue": c[26] ||= (e) => X.value = e,
2257
+ s(k, {
2258
+ modelValue: Z.value,
2259
+ "onUpdate:modelValue": c[26] ||= (e) => Z.value = e,
2195
2260
  title: "批量修改颜色",
2196
2261
  width: "320px",
2197
2262
  "show-close": !0
2198
2263
  }, {
2199
- footer: w(() => [s(E, { onClick: c[25] ||= (e) => X.value = !1 }, {
2264
+ footer: w(() => [s(b, { onClick: c[25] ||= (e) => Z.value = !1 }, {
2200
2265
  default: w(() => [...c[60] ||= [o("取消", -1)]]),
2201
2266
  _: 1
2202
- }), s(E, {
2267
+ }), s(b, {
2203
2268
  type: "primary",
2204
- onClick: ce
2269
+ onClick: ue
2205
2270
  }, {
2206
2271
  default: w(() => [...c[61] ||= [o("确定", -1)]]),
2207
2272
  _: 1
2208
2273
  })]),
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,
2274
+ default: w(() => [a("div", Wt, [c[59] ||= a("span", null, "选择颜色:", -1), s(p, {
2275
+ modelValue: Q.value,
2276
+ "onUpdate:modelValue": c[24] ||= (e) => Q.value = e,
2212
2277
  "show-alpha": ""
2213
2278
  }, null, 8, ["modelValue"])])]),
2214
2279
  _: 1
2215
2280
  }, 8, ["modelValue"]),
2216
- s(E, {
2281
+ s(b, {
2217
2282
  class: "ai-chat-fab",
2218
- type: b.value ? "primary" : "default",
2283
+ type: D.value ? "primary" : "default",
2219
2284
  circle: "",
2220
2285
  size: "large",
2221
- onClick: c[27] ||= (e) => b.value = !b.value,
2286
+ onClick: c[27] ||= (e) => D.value = !D.value,
2222
2287
  title: "AI助手"
2223
2288
  }, {
2224
- default: w(() => [s(O, null, {
2225
- default: w(() => [s(j)]),
2289
+ default: w(() => [s(C, null, {
2290
+ default: w(() => [s(A)]),
2226
2291
  _: 1
2227
2292
  })]),
2228
2293
  _: 1
2229
2294
  }, 8, ["type"]),
2230
2295
  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
2296
+ visible: D.value,
2297
+ messages: S(N).messages.value,
2298
+ loading: S(N).loading.value,
2299
+ "is-collab": S(N).isCollabMode.value,
2300
+ "collab-users": S(N).collabUsers.value,
2301
+ "current-user": S(N).currentUser.value,
2302
+ "is-owner": R.value,
2303
+ onSend: _e,
2304
+ onClose: c[28] ||= (e) => D.value = !1,
2305
+ "unread-mention": S(N).unreadMention.value,
2306
+ onClearUnread: c[29] ||= (e) => S(N).clearUnreadMention(),
2307
+ onClear: ve
2243
2308
  }, null, 8, [
2244
2309
  "visible",
2245
2310
  "messages",
@@ -2251,15 +2316,15 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2251
2316
  "unread-mention"
2252
2317
  ]),
2253
2318
  s(Ge, {
2254
- modelValue: T.value,
2255
- "onUpdate:modelValue": c[30] ||= (e) => T.value = e,
2256
- "document-id": d.value,
2257
- onApply: _e
2319
+ modelValue: M.value,
2320
+ "onUpdate:modelValue": c[30] ||= (e) => M.value = e,
2321
+ "document-id": T.value,
2322
+ onApply: be
2258
2323
  }, null, 8, ["modelValue", "document-id"])
2259
2324
  ]);
2260
2325
  };
2261
2326
  }
2262
- }, [["__scopeId", "data-v-8aef20c7"]]), qt = c({
2327
+ }, [["__scopeId", "data-v-b215517d"]]), qt = c({
2263
2328
  name: "YourCompanyExplosionImage",
2264
2329
  props: {
2265
2330
  docId: {
@@ -2270,6 +2335,14 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2270
2335
  type: String,
2271
2336
  default: "/api"
2272
2337
  },
2338
+ saveApi: {
2339
+ type: [String, Function],
2340
+ default: null
2341
+ },
2342
+ loadApi: {
2343
+ type: [String, Function],
2344
+ default: null
2345
+ },
2273
2346
  wsUrl: {
2274
2347
  type: String,
2275
2348
  default: ""
@@ -2285,6 +2358,10 @@ var vt = (e, { onRemoteChange: t } = {}) => {
2285
2358
  roomId: {
2286
2359
  type: String,
2287
2360
  default: ""
2361
+ },
2362
+ uiConfig: {
2363
+ type: Object,
2364
+ default: () => ({})
2288
2365
  }
2289
2366
  },
2290
2367
  setup(e, { slots: t }) {