@billtaofbj/fishbone 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/fishbone.css +1 -1
- package/dist/index.cjs.js +10 -10
- package/dist/index.es.js +1259 -1166
- package/package.json +33 -26
package/dist/index.es.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, h as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as p, onMounted as m, onUnmounted as h, openBlock as g, reactive as _, ref as v, renderList as y, resolveComponent as b, toDisplayString as x, unref as S, vModelSelect as
|
|
2
|
-
import { BrandWatermark as
|
|
3
|
-
import { useRoute as
|
|
4
|
-
import { ElMessage as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import * as
|
|
8
|
-
import { HocuspocusProvider as
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, h as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as p, onMounted as m, onUnmounted as h, openBlock as g, reactive as _, ref as v, renderList as y, resolveComponent as b, toDisplayString as x, unref as S, vModelSelect as ee, vModelText as C, vShow as w, watch as T, withCtx as E, withDirectives as D, withKeys as O, withModifiers as k } from "vue";
|
|
2
|
+
import { BrandWatermark as A } from "@billtaofbj/core";
|
|
3
|
+
import { useRoute as te, useRouter as j } from "vue-router";
|
|
4
|
+
import { ElMessage as M, ElMessageBox as ne } from "element-plus";
|
|
5
|
+
import N from "axios";
|
|
6
|
+
import { ArrowLeft as re, Bell as ie, Brush as ae, Check as P, Clock as oe, Close as F, Delete as se, Document as I, Download as L, Edit as ce, FullScreen as le, InfoFilled as ue, Link as de, Loading as fe, MagicStick as pe, Monitor as me, Picture as he, PictureFilled as ge, Plus as _e, Promotion as ve, RefreshLeft as ye, RefreshRight as be, Right as xe, Share as Se, ZoomIn as Ce, ZoomOut as R } from "@element-plus/icons-vue";
|
|
7
|
+
import * as z from "yjs";
|
|
8
|
+
import { HocuspocusProvider as we } from "@hocuspocus/provider";
|
|
9
9
|
//#region \0plugin-vue:export-helper
|
|
10
|
-
var
|
|
10
|
+
var B = (e, t) => {
|
|
11
11
|
let n = e.__vccOpts || e;
|
|
12
12
|
for (let [e, r] of t) n[e] = r;
|
|
13
13
|
return n;
|
|
14
|
-
},
|
|
14
|
+
}, V = { class: "chat-header" }, H = { class: "chat-header-left" }, U = { class: "chat-title" }, Te = { class: "online-users-list" }, Ee = { class: "online-user-item" }, W = { class: "online-user-name" }, De = { key: 1 }, G = { class: "online-user-name" }, Oe = { class: "chat-header-right" }, ke = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "chat-empty"
|
|
17
|
-
},
|
|
17
|
+
}, Ae = { class: "chat-empty-hint" }, je = { key: 1 }, Me = { class: "message-content" }, K = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "message-meta"
|
|
20
|
-
},
|
|
20
|
+
}, q = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "message-mention"
|
|
23
|
-
},
|
|
23
|
+
}, J = ["innerHTML"], Ne = { class: "message-time" }, Pe = {
|
|
24
24
|
key: 1,
|
|
25
25
|
class: "chat-message chat-message-ai"
|
|
26
26
|
}, Fe = { class: "message-avatar ai" }, Ie = { class: "chat-input-area" }, Le = {
|
|
27
27
|
key: 0,
|
|
28
28
|
class: "mention-popup"
|
|
29
|
-
}, Re = ["onClick", "onMouseenter"], ze = { key: 1 }, Be = /*#__PURE__*/
|
|
29
|
+
}, Re = ["onClick", "onMouseenter"], ze = { key: 1 }, Be = /*#__PURE__*/ B({
|
|
30
30
|
__name: "AiChatPanel",
|
|
31
31
|
props: {
|
|
32
32
|
visible: {
|
|
@@ -77,44 +77,44 @@ var V = (e, t) => {
|
|
|
77
77
|
"clear-unread"
|
|
78
78
|
],
|
|
79
79
|
setup(c, { emit: l }) {
|
|
80
|
-
let p = c, m = l, h = v(""), _ = v(null),
|
|
80
|
+
let p = c, m = l, h = v(""), _ = v(null), ee = v(null), C = v(!1), w = v([]), D = v(0), A = "", te = -1, j = {
|
|
81
81
|
id: "ai-assistant",
|
|
82
82
|
name: "AI助手",
|
|
83
83
|
color: "#409EFF",
|
|
84
84
|
isAi: !0
|
|
85
|
-
},
|
|
85
|
+
}, M = t(() => {
|
|
86
86
|
let e = p.currentUser.id, t = /* @__PURE__ */ new Set();
|
|
87
|
-
return [
|
|
87
|
+
return [j, ...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
|
-
}),
|
|
93
|
+
}), ne = t(() => M.value.length + 1), N = (e) => e.role === "ai" ? "chat-message-ai" : p.isCollab && e.user_id && e.user_id !== p.currentUser.id ? "chat-message-other" : "chat-message-user", re = (e) => e.role === "ai" ? { background: "linear-gradient(135deg, #409EFF, #337ECC)" } : { background: e.user_color || "#67C23A" }, ae = (e) => (e.user_name || "U").charAt(0), P = (e) => {
|
|
94
94
|
if (!p.isCollab) return;
|
|
95
95
|
let t = typeof e == "string" ? e : e.target?.value || h.value, n = t.length, r = t.lastIndexOf("@", n);
|
|
96
96
|
if (r !== -1 && r < n) {
|
|
97
97
|
let e = t.slice(r + 1, n);
|
|
98
98
|
if (!e.includes(" ") && !e.includes("\n")) {
|
|
99
|
-
|
|
99
|
+
A = e, te = r, w.value = M.value.filter((t) => t.name && t.name.toLowerCase().includes(e.toLowerCase())), C.value = w.value.length > 0, D.value = 0;
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
|
|
104
|
-
}, ae = () => {
|
|
105
|
-
w.value && (O.value = Math.min(O.value + 1, T.value.length - 1));
|
|
103
|
+
C.value = !1;
|
|
106
104
|
}, oe = () => {
|
|
107
|
-
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
C.value && (D.value = Math.min(D.value + 1, w.value.length - 1));
|
|
106
|
+
}, I = () => {
|
|
107
|
+
C.value && (D.value = Math.max(D.value - 1, 0));
|
|
108
|
+
}, L = (e) => {
|
|
109
|
+
let t = h.value.slice(0, te), n = h.value.slice(te + A.length + 1);
|
|
110
|
+
h.value = `${t}@${e.name} ${n}`, C.value = !1;
|
|
111
111
|
}, ce = (e) => {
|
|
112
112
|
if (e) {
|
|
113
113
|
if (e.shiftKey) return;
|
|
114
|
-
if (
|
|
115
|
-
let t =
|
|
114
|
+
if (C.value) {
|
|
115
|
+
let t = w.value[D.value];
|
|
116
116
|
if (t) {
|
|
117
|
-
e.preventDefault(),
|
|
117
|
+
e.preventDefault(), L(t);
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -127,60 +127,60 @@ var V = (e, t) => {
|
|
|
127
127
|
let e = t.match(/@(\S+)/);
|
|
128
128
|
e && (n = e[1]);
|
|
129
129
|
}
|
|
130
|
-
m("send", t, { mentionedUser: n }), h.value = "",
|
|
130
|
+
m("send", t, { mentionedUser: n }), h.value = "", C.value = !1;
|
|
131
131
|
}, le = () => {
|
|
132
132
|
u(() => {
|
|
133
133
|
_.value && (_.value.scrollTop = _.value.scrollHeight);
|
|
134
134
|
});
|
|
135
135
|
};
|
|
136
|
-
return
|
|
137
|
-
let u = b("el-icon"), p = b("el-tag"), v = b("el-popover"),
|
|
136
|
+
return T(() => p.messages.length, le), T(() => p.messages, le, { deep: !0 }), (t, l) => {
|
|
137
|
+
let u = b("el-icon"), p = b("el-tag"), v = b("el-popover"), T = b("el-button"), A = b("el-input");
|
|
138
138
|
return c.visible ? (g(), 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",
|
|
143
|
+
a("div", V, [a("div", H, [
|
|
144
144
|
s(u, {
|
|
145
145
|
size: 18,
|
|
146
146
|
color: "#409EFF"
|
|
147
147
|
}, {
|
|
148
|
-
default:
|
|
148
|
+
default: E(() => [s(S(me))]),
|
|
149
149
|
_: 1
|
|
150
150
|
}),
|
|
151
|
-
a("span",
|
|
151
|
+
a("span", U, x(c.isCollab ? "协作聊天" : "AI 助手"), 1),
|
|
152
152
|
c.isCollab ? (g(), n(v, {
|
|
153
153
|
key: 0,
|
|
154
154
|
width: 200,
|
|
155
155
|
placement: "bottom-start",
|
|
156
156
|
trigger: "click"
|
|
157
157
|
}, {
|
|
158
|
-
reference:
|
|
158
|
+
reference: E(() => [s(p, {
|
|
159
159
|
size: "small",
|
|
160
160
|
type: "success",
|
|
161
161
|
effect: "plain",
|
|
162
162
|
class: "online-tag"
|
|
163
163
|
}, {
|
|
164
|
-
default:
|
|
164
|
+
default: E(() => [o(x(ne.value) + "人在线 ", 1)]),
|
|
165
165
|
_: 1
|
|
166
166
|
})]),
|
|
167
|
-
default:
|
|
167
|
+
default: E(() => [a("div", Te, [a("div", Ee, [
|
|
168
168
|
a("div", {
|
|
169
169
|
class: "online-user-avatar",
|
|
170
170
|
style: f({ background: c.currentUser.color || "#409EFF" })
|
|
171
171
|
}, x((c.currentUser.name || "U").charAt(0)), 5),
|
|
172
|
-
a("span",
|
|
172
|
+
a("span", W, x(c.currentUser.name || "我"), 1),
|
|
173
173
|
s(p, {
|
|
174
174
|
size: "small",
|
|
175
175
|
type: c.isOwner ? "warning" : "success",
|
|
176
176
|
effect: "plain",
|
|
177
177
|
class: "role-tag"
|
|
178
178
|
}, {
|
|
179
|
-
default:
|
|
179
|
+
default: E(() => [o(x(c.isOwner ? "发起人" : "协作人"), 1)]),
|
|
180
180
|
_: 1
|
|
181
181
|
}, 8, ["type"]),
|
|
182
182
|
l[4] ||= a("span", { class: "self-tag" }, "(我)", -1)
|
|
183
|
-
]), (g(!0), i(e, null, y(
|
|
183
|
+
]), (g(!0), i(e, null, y(M.value, (e) => (g(), i("div", {
|
|
184
184
|
key: e.id || e.clientId,
|
|
185
185
|
class: "online-user-item"
|
|
186
186
|
}, [
|
|
@@ -191,10 +191,10 @@ var V = (e, t) => {
|
|
|
191
191
|
key: 0,
|
|
192
192
|
size: 14
|
|
193
193
|
}, {
|
|
194
|
-
default:
|
|
194
|
+
default: E(() => [s(S(me))]),
|
|
195
195
|
_: 1
|
|
196
|
-
})) : (g(), i("span",
|
|
197
|
-
a("span",
|
|
196
|
+
})) : (g(), i("span", De, x((e.name || "U").charAt(0)), 1))], 4),
|
|
197
|
+
a("span", G, x(e.name || "未知用户"), 1),
|
|
198
198
|
e.isAi ? (g(), n(p, {
|
|
199
199
|
key: 0,
|
|
200
200
|
size: "small",
|
|
@@ -202,7 +202,7 @@ var V = (e, t) => {
|
|
|
202
202
|
effect: "plain",
|
|
203
203
|
class: "role-tag"
|
|
204
204
|
}, {
|
|
205
|
-
default:
|
|
205
|
+
default: E(() => [...l[5] ||= [o("AI助手", -1)]]),
|
|
206
206
|
_: 1
|
|
207
207
|
})) : (g(), n(p, {
|
|
208
208
|
key: 1,
|
|
@@ -211,13 +211,13 @@ var V = (e, t) => {
|
|
|
211
211
|
effect: "plain",
|
|
212
212
|
class: "role-tag"
|
|
213
213
|
}, {
|
|
214
|
-
default:
|
|
214
|
+
default: E(() => [...l[6] ||= [o("协作人", -1)]]),
|
|
215
215
|
_: 1
|
|
216
216
|
}))
|
|
217
217
|
]))), 128))])]),
|
|
218
218
|
_: 1
|
|
219
219
|
})) : r("", !0)
|
|
220
|
-
]), a("div",
|
|
220
|
+
]), a("div", Oe, [
|
|
221
221
|
c.isCollab && c.unreadMention ? (g(), i("div", {
|
|
222
222
|
key: 0,
|
|
223
223
|
class: "mention-bell",
|
|
@@ -227,31 +227,31 @@ var V = (e, t) => {
|
|
|
227
227
|
size: 18,
|
|
228
228
|
color: "#F56C6C"
|
|
229
229
|
}, {
|
|
230
|
-
default:
|
|
230
|
+
default: E(() => [s(S(ie))]),
|
|
231
231
|
_: 1
|
|
232
232
|
})])) : r("", !0),
|
|
233
|
-
s(
|
|
233
|
+
s(T, {
|
|
234
234
|
text: "",
|
|
235
235
|
circle: "",
|
|
236
236
|
size: "small",
|
|
237
237
|
onClick: l[1] ||= (e) => t.$emit("clear"),
|
|
238
238
|
title: "清空对话"
|
|
239
239
|
}, {
|
|
240
|
-
default:
|
|
241
|
-
default:
|
|
240
|
+
default: E(() => [s(u, null, {
|
|
241
|
+
default: E(() => [s(S(se))]),
|
|
242
242
|
_: 1
|
|
243
243
|
})]),
|
|
244
244
|
_: 1
|
|
245
245
|
}),
|
|
246
|
-
s(
|
|
246
|
+
s(T, {
|
|
247
247
|
text: "",
|
|
248
248
|
circle: "",
|
|
249
249
|
size: "small",
|
|
250
250
|
onClick: l[2] ||= (e) => t.$emit("close"),
|
|
251
251
|
title: "关闭"
|
|
252
252
|
}, {
|
|
253
|
-
default:
|
|
254
|
-
default:
|
|
253
|
+
default: E(() => [s(u, null, {
|
|
254
|
+
default: E(() => [s(S(F))]),
|
|
255
255
|
_: 1
|
|
256
256
|
})]),
|
|
257
257
|
_: 1
|
|
@@ -262,42 +262,42 @@ var V = (e, t) => {
|
|
|
262
262
|
ref_key: "messagesRef",
|
|
263
263
|
ref: _
|
|
264
264
|
}, [
|
|
265
|
-
c.messages.length === 0 ? (g(), i("div",
|
|
265
|
+
c.messages.length === 0 ? (g(), i("div", ke, [
|
|
266
266
|
s(u, {
|
|
267
267
|
size: 40,
|
|
268
268
|
color: "#c0c4cc"
|
|
269
269
|
}, {
|
|
270
|
-
default:
|
|
270
|
+
default: E(() => [s(S(me))]),
|
|
271
271
|
_: 1
|
|
272
272
|
}),
|
|
273
273
|
a("p", null, x(c.isCollab ? "协作聊天室" : "你好!我是 AI 助手"), 1),
|
|
274
|
-
a("p",
|
|
274
|
+
a("p", Ae, x(c.isCollab ? "与团队成员和AI助手实时聊天" : "可以问我任何关于文档编辑的问题"), 1)
|
|
275
275
|
])) : r("", !0),
|
|
276
276
|
(g(!0), i(e, null, y(c.messages, (e) => (g(), i("div", {
|
|
277
277
|
key: e._msgId || e.time + e.content,
|
|
278
|
-
class: d(["chat-message",
|
|
278
|
+
class: d(["chat-message", N(e)])
|
|
279
279
|
}, [a("div", {
|
|
280
280
|
class: "message-avatar",
|
|
281
|
-
style: f(
|
|
281
|
+
style: f(re(e))
|
|
282
282
|
}, [e.role === "ai" ? (g(), n(u, {
|
|
283
283
|
key: 0,
|
|
284
284
|
size: 16
|
|
285
285
|
}, {
|
|
286
|
-
default:
|
|
286
|
+
default: E(() => [s(S(me))]),
|
|
287
287
|
_: 1
|
|
288
|
-
})) : (g(), i("span",
|
|
289
|
-
c.isCollab && e.role === "user" ? (g(), i("div",
|
|
288
|
+
})) : (g(), i("span", je, x(ae(e)), 1))], 4), a("div", Me, [
|
|
289
|
+
c.isCollab && e.role === "user" ? (g(), i("div", K, [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 ? (g(), i("span",
|
|
292
|
+
}, x(e.user_name || "用户"), 5), e.mentioned_user ? (g(), i("span", q, "@" + 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,
|
|
296
|
+
}, null, 8, J),
|
|
297
297
|
a("div", Ne, x(e.time), 1)
|
|
298
298
|
])], 2))), 128)),
|
|
299
299
|
c.loading ? (g(), i("div", Pe, [a("div", Fe, [s(u, { size: 16 }, {
|
|
300
|
-
default:
|
|
300
|
+
default: E(() => [s(S(me))]),
|
|
301
301
|
_: 1
|
|
302
302
|
})]), l[7] ||= a("div", { class: "message-content" }, [a("div", { class: "message-text typing-indicator" }, [
|
|
303
303
|
a("span"),
|
|
@@ -308,9 +308,9 @@ var V = (e, t) => {
|
|
|
308
308
|
a("div", Ie, [a("div", {
|
|
309
309
|
class: "chat-input-wrapper",
|
|
310
310
|
ref_key: "inputWrapperRef",
|
|
311
|
-
ref:
|
|
311
|
+
ref: ee
|
|
312
312
|
}, [
|
|
313
|
-
s(
|
|
313
|
+
s(A, {
|
|
314
314
|
modelValue: h.value,
|
|
315
315
|
"onUpdate:modelValue": l[3] ||= (e) => h.value = e,
|
|
316
316
|
type: "textarea",
|
|
@@ -320,22 +320,22 @@ var V = (e, t) => {
|
|
|
320
320
|
},
|
|
321
321
|
placeholder: c.isCollab ? "输入消息... @提及成员" : "输入消息...",
|
|
322
322
|
onKeydown: [
|
|
323
|
-
k(
|
|
324
|
-
k(
|
|
325
|
-
k(
|
|
323
|
+
O(k(ce, ["exact"]), ["enter"]),
|
|
324
|
+
O(k(oe, ["prevent"]), ["down"]),
|
|
325
|
+
O(k(I, ["prevent"]), ["up"])
|
|
326
326
|
],
|
|
327
|
-
onInput:
|
|
327
|
+
onInput: P,
|
|
328
328
|
resize: "none"
|
|
329
329
|
}, null, 8, [
|
|
330
330
|
"modelValue",
|
|
331
331
|
"placeholder",
|
|
332
332
|
"onKeydown"
|
|
333
333
|
]),
|
|
334
|
-
|
|
334
|
+
C.value ? (g(), i("div", Le, [(g(!0), i(e, null, y(w.value, (e, t) => (g(), i("div", {
|
|
335
335
|
key: e.id || e.clientId,
|
|
336
|
-
class: d(["mention-item", { active: t ===
|
|
337
|
-
onClick: (t) =>
|
|
338
|
-
onMouseenter: (e) =>
|
|
336
|
+
class: d(["mention-item", { active: t === D.value }]),
|
|
337
|
+
onClick: (t) => L(e),
|
|
338
|
+
onMouseenter: (e) => D.value = t
|
|
339
339
|
}, [a("div", {
|
|
340
340
|
class: "mention-avatar",
|
|
341
341
|
style: f({ background: e.color || "#909399" })
|
|
@@ -343,18 +343,18 @@ var V = (e, t) => {
|
|
|
343
343
|
key: 0,
|
|
344
344
|
size: 12
|
|
345
345
|
}, {
|
|
346
|
-
default:
|
|
346
|
+
default: E(() => [s(S(me))]),
|
|
347
347
|
_: 1
|
|
348
348
|
})) : (g(), i("span", ze, x((e.name || "U").charAt(0)), 1))], 4), a("span", null, x(e.name), 1)], 42, Re))), 128))])) : r("", !0),
|
|
349
|
-
s(
|
|
349
|
+
s(T, {
|
|
350
350
|
class: "send-btn",
|
|
351
351
|
type: "primary",
|
|
352
352
|
circle: "",
|
|
353
353
|
disabled: !h.value.trim() || c.loading,
|
|
354
354
|
onClick: ce
|
|
355
355
|
}, {
|
|
356
|
-
default:
|
|
357
|
-
default:
|
|
356
|
+
default: E(() => [s(u, null, {
|
|
357
|
+
default: E(() => [s(S(ve))]),
|
|
358
358
|
_: 1
|
|
359
359
|
})]),
|
|
360
360
|
_: 1
|
|
@@ -373,7 +373,7 @@ function Ve() {
|
|
|
373
373
|
color: ""
|
|
374
374
|
}), a = v(!1), o = null, s = null, c = null, l = /* @__PURE__ */ new Set(), u = "/api/chat", d = null, f = ({ ydoc: t, provider: s, onlineUsers: u }) => {
|
|
375
375
|
if (t) {
|
|
376
|
-
n.value = !0, c = u, d && d(), d =
|
|
376
|
+
n.value = !0, c = u, d && d(), d = T(c, (e) => {
|
|
377
377
|
r.value = Array.isArray(e) ? e : [];
|
|
378
378
|
}, {
|
|
379
379
|
immediate: !0,
|
|
@@ -422,7 +422,7 @@ function Ve() {
|
|
|
422
422
|
console.warn("[useChat] Failed to push to Y.Array:", e);
|
|
423
423
|
}
|
|
424
424
|
if (r.roomId) try {
|
|
425
|
-
await
|
|
425
|
+
await N.post(u, {
|
|
426
426
|
room_id: r.roomId,
|
|
427
427
|
role: "user",
|
|
428
428
|
content: t,
|
|
@@ -448,7 +448,7 @@ function Ve() {
|
|
|
448
448
|
console.warn("[useChat] Failed to push AI message to Y.Array:", e);
|
|
449
449
|
}
|
|
450
450
|
if (r) try {
|
|
451
|
-
await
|
|
451
|
+
await N.post(u, {
|
|
452
452
|
room_id: r,
|
|
453
453
|
role: "ai",
|
|
454
454
|
content: t,
|
|
@@ -460,7 +460,7 @@ function Ve() {
|
|
|
460
460
|
}
|
|
461
461
|
}, b = async (t) => {
|
|
462
462
|
if (t) try {
|
|
463
|
-
let n = await
|
|
463
|
+
let n = await N.get(u, { params: { room_id: t } });
|
|
464
464
|
if (Array.isArray(n.data)) {
|
|
465
465
|
let t = n.data.map((e) => ({
|
|
466
466
|
_msgId: e._msgId || `hist-${e.id || Date.now()}`,
|
|
@@ -479,13 +479,13 @@ function Ve() {
|
|
|
479
479
|
}
|
|
480
480
|
}, x = async (t) => {
|
|
481
481
|
if (e.value = [], l.clear(), t) try {
|
|
482
|
-
await
|
|
482
|
+
await N.delete(u, { params: { room_id: t } });
|
|
483
483
|
} catch (e) {
|
|
484
484
|
console.warn("[useChat] Failed to clear messages on server:", e);
|
|
485
485
|
}
|
|
486
|
-
},
|
|
486
|
+
}, ee = () => {
|
|
487
487
|
a.value = !1;
|
|
488
|
-
},
|
|
488
|
+
}, C = () => {
|
|
489
489
|
if (d &&= (d(), null), o && s) {
|
|
490
490
|
try {
|
|
491
491
|
o.unobserve(s);
|
|
@@ -494,7 +494,7 @@ function Ve() {
|
|
|
494
494
|
}
|
|
495
495
|
o = null, c = null, l.clear();
|
|
496
496
|
};
|
|
497
|
-
return h(() =>
|
|
497
|
+
return h(() => C()), {
|
|
498
498
|
messages: e,
|
|
499
499
|
loading: t,
|
|
500
500
|
isCollabMode: n,
|
|
@@ -508,8 +508,8 @@ function Ve() {
|
|
|
508
508
|
sendAiMessage: y,
|
|
509
509
|
loadHistory: b,
|
|
510
510
|
clearMessages: x,
|
|
511
|
-
clearUnreadMention:
|
|
512
|
-
destroy:
|
|
511
|
+
clearUnreadMention: ee,
|
|
512
|
+
destroy: C
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
515
|
//#endregion
|
|
@@ -522,7 +522,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
522
522
|
saveVersion: async ({ documentId: e, docType: t, content: n, userId: r, userName: i }) => {
|
|
523
523
|
if (!e || !t || !n) return null;
|
|
524
524
|
try {
|
|
525
|
-
let { data: a } = await
|
|
525
|
+
let { data: a } = await N.post(He, {
|
|
526
526
|
document_id: e,
|
|
527
527
|
doc_type: t,
|
|
528
528
|
content: typeof n == "string" ? n : JSON.stringify(n),
|
|
@@ -538,7 +538,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
538
538
|
if (!n) return [];
|
|
539
539
|
t.value = !0;
|
|
540
540
|
try {
|
|
541
|
-
let { data: t } = await
|
|
541
|
+
let { data: t } = await N.get(He, {
|
|
542
542
|
params: { document_id: n },
|
|
543
543
|
timeout: Ue
|
|
544
544
|
});
|
|
@@ -551,7 +551,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
551
551
|
},
|
|
552
552
|
getVersionContent: async (e) => {
|
|
553
553
|
try {
|
|
554
|
-
let { data: t } = await
|
|
554
|
+
let { data: t } = await N.get(`${He}/${e}`, { timeout: Ue });
|
|
555
555
|
return t;
|
|
556
556
|
} catch (e) {
|
|
557
557
|
return console.warn("[useVersionHistory] Failed to get version content:", e), null;
|
|
@@ -570,7 +570,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
570
570
|
}, Ye = {
|
|
571
571
|
key: 0,
|
|
572
572
|
class: "current-version"
|
|
573
|
-
}, Xe = { class: "current-version-header" }, Ze = { class: "version-number" }, Qe = ["onClick"], $e = { class: "version-number" }, et = { class: "version-user" }, tt = { class: "panel-footer" }, nt = /*#__PURE__*/
|
|
573
|
+
}, Xe = { class: "current-version-header" }, Ze = { class: "version-number" }, Qe = ["onClick"], $e = { class: "version-number" }, et = { class: "version-user" }, tt = { class: "panel-footer" }, nt = /*#__PURE__*/ B({
|
|
574
574
|
__name: "VersionHistoryPanel",
|
|
575
575
|
props: {
|
|
576
576
|
modelValue: {
|
|
@@ -584,78 +584,78 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
584
584
|
},
|
|
585
585
|
emits: ["update:modelValue", "apply"],
|
|
586
586
|
setup(t, { expose: c, emit: l }) {
|
|
587
|
-
let u = t, f = l, { versions: p, loading: m, loadVersions: h, getVersionContent: _ } = We(),
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
e && e.length > 0 && (
|
|
587
|
+
let u = t, f = l, { versions: p, loading: m, loadVersions: h, getVersionContent: _ } = We(), ee = v(!1), C = v(null), w = v(!1), D = v(null);
|
|
588
|
+
T(() => u.modelValue, (e) => {
|
|
589
|
+
ee.value = e, e && u.documentId && (C.value = null, h(u.documentId).then((e) => {
|
|
590
|
+
e && e.length > 0 && (D.value = e[0]);
|
|
591
591
|
}));
|
|
592
|
-
}),
|
|
592
|
+
}), T(ee, (e) => {
|
|
593
593
|
f("update:modelValue", e);
|
|
594
594
|
});
|
|
595
|
-
let
|
|
596
|
-
|
|
597
|
-
},
|
|
598
|
-
if (
|
|
599
|
-
|
|
595
|
+
let O = (e) => {
|
|
596
|
+
C.value = e;
|
|
597
|
+
}, k = async () => {
|
|
598
|
+
if (C.value) {
|
|
599
|
+
w.value = !0;
|
|
600
600
|
try {
|
|
601
|
-
let e = await _(
|
|
602
|
-
e && e.content ? (
|
|
601
|
+
let e = await _(C.value.id);
|
|
602
|
+
e && e.content ? (D.value = C.value, C.value = null, f("apply", e.content), M.success("已切换到版本 v" + D.value.version_number)) : M.error("获取版本内容失败");
|
|
603
603
|
} finally {
|
|
604
|
-
|
|
604
|
+
w.value = !1;
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
|
-
},
|
|
608
|
-
|
|
609
|
-
},
|
|
607
|
+
}, A = () => {
|
|
608
|
+
ee.value = !1;
|
|
609
|
+
}, te = (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())}`;
|
|
613
613
|
};
|
|
614
|
-
return c({ currentVersion:
|
|
614
|
+
return c({ currentVersion: D }), (t, c) => {
|
|
615
615
|
let l = b("el-icon"), u = b("el-tag"), f = b("el-timeline-item"), h = b("el-timeline"), _ = b("el-button"), v = b("el-drawer");
|
|
616
616
|
return g(), n(v, {
|
|
617
|
-
modelValue:
|
|
618
|
-
"onUpdate:modelValue": c[0] ||= (e) =>
|
|
617
|
+
modelValue: ee.value,
|
|
618
|
+
"onUpdate:modelValue": c[0] ||= (e) => ee.value = e,
|
|
619
619
|
title: "更新履历",
|
|
620
620
|
direction: "rtl",
|
|
621
621
|
size: "420px",
|
|
622
|
-
"before-close":
|
|
622
|
+
"before-close": A
|
|
623
623
|
}, {
|
|
624
|
-
footer:
|
|
624
|
+
footer: E(() => [a("div", tt, [s(_, {
|
|
625
625
|
type: "primary",
|
|
626
|
-
disabled: !
|
|
627
|
-
loading:
|
|
628
|
-
onClick:
|
|
626
|
+
disabled: !C.value,
|
|
627
|
+
loading: w.value,
|
|
628
|
+
onClick: k
|
|
629
629
|
}, {
|
|
630
|
-
default:
|
|
630
|
+
default: E(() => [...c[4] ||= [o(" 切换到此版本 ", -1)]]),
|
|
631
631
|
_: 1
|
|
632
632
|
}, 8, ["disabled", "loading"])])]),
|
|
633
|
-
default:
|
|
634
|
-
default:
|
|
633
|
+
default: E(() => [a("div", Ge, [S(m) ? (g(), i("div", Ke, [s(l, { class: "is-loading" }, {
|
|
634
|
+
default: E(() => [s(S(fe))]),
|
|
635
635
|
_: 1
|
|
636
636
|
}), c[1] ||= a("span", null, "加载中...", -1)])) : S(p).length === 0 ? (g(), i("div", qe, [s(l, {
|
|
637
637
|
size: 48,
|
|
638
638
|
color: "#c0c4cc"
|
|
639
639
|
}, {
|
|
640
|
-
default:
|
|
640
|
+
default: E(() => [s(S(oe))]),
|
|
641
641
|
_: 1
|
|
642
|
-
}), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (g(), i("div", Je, [
|
|
642
|
+
}), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (g(), i("div", Je, [D.value ? (g(), i("div", Ye, [a("div", Xe, [s(u, {
|
|
643
643
|
type: "success",
|
|
644
644
|
size: "small"
|
|
645
645
|
}, {
|
|
646
|
-
default:
|
|
646
|
+
default: E(() => [...c[3] ||= [o("当前版本", -1)]]),
|
|
647
647
|
_: 1
|
|
648
|
-
}), a("span", Ze, "v" + x(
|
|
649
|
-
default:
|
|
648
|
+
}), a("span", Ze, "v" + x(D.value.version_number), 1)])])) : r("", !0), s(h, null, {
|
|
649
|
+
default: E(() => [(g(!0), i(e, null, y(S(p), (e) => (g(), n(f, {
|
|
650
650
|
key: e.id,
|
|
651
|
-
timestamp:
|
|
651
|
+
timestamp: te(e.created_at),
|
|
652
652
|
placement: "top",
|
|
653
|
-
type:
|
|
654
|
-
hollow:
|
|
653
|
+
type: C.value?.id === e.id ? "primary" : "",
|
|
654
|
+
hollow: C.value?.id !== e.id
|
|
655
655
|
}, {
|
|
656
|
-
default:
|
|
657
|
-
class: d(["version-item", { active:
|
|
658
|
-
onClick: (t) =>
|
|
656
|
+
default: E(() => [a("div", {
|
|
657
|
+
class: d(["version-item", { active: C.value?.id === e.id }]),
|
|
658
|
+
onClick: (t) => O(e)
|
|
659
659
|
}, [a("span", $e, "版本号:v" + x(e.version_number), 1), a("span", et, "提交人:" + x(e.user_name || "未知用户"), 1)], 10, Qe)]),
|
|
660
660
|
_: 2
|
|
661
661
|
}, 1032, [
|
|
@@ -669,7 +669,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
669
669
|
}, 8, ["modelValue"]);
|
|
670
670
|
};
|
|
671
671
|
}
|
|
672
|
-
}, [["__scopeId", "data-v-87924b7c"]]), rt = { class: "theme-picker" }, it = { class: "theme-header" }, at = { class: "theme-count" }, ot = { class: "theme-grid" }, st = ["onClick", "title"], ct = { class: "theme-name" }, lt = /*#__PURE__*/
|
|
672
|
+
}, [["__scopeId", "data-v-87924b7c"]]), rt = { class: "theme-picker" }, it = { class: "theme-header" }, at = { class: "theme-count" }, ot = { class: "theme-grid" }, st = ["onClick", "title"], ct = { class: "theme-name" }, lt = /*#__PURE__*/ B({
|
|
673
673
|
__name: "ThemePicker",
|
|
674
674
|
props: {
|
|
675
675
|
currentTheme: {
|
|
@@ -871,24 +871,24 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
871
871
|
width: "340",
|
|
872
872
|
placement: "bottom-end"
|
|
873
873
|
}, {
|
|
874
|
-
reference:
|
|
874
|
+
reference: E(() => [s(p, {
|
|
875
875
|
size: "small",
|
|
876
876
|
circle: "",
|
|
877
877
|
tabindex: "-1",
|
|
878
878
|
title: "主题",
|
|
879
879
|
disabled: t.disabled
|
|
880
880
|
}, {
|
|
881
|
-
default:
|
|
882
|
-
default:
|
|
881
|
+
default: E(() => [s(u, null, {
|
|
882
|
+
default: E(() => [s(S(ae))]),
|
|
883
883
|
_: 1
|
|
884
884
|
})]),
|
|
885
885
|
_: 1
|
|
886
886
|
}, 8, ["disabled"])]),
|
|
887
|
-
default:
|
|
887
|
+
default: E(() => [a("div", rt, [a("div", it, [o[1] ||= a("h4", null, "选择主题", -1), a("span", at, x(c.length) + " 种配色", 1)]), a("div", ot, [(g(), i(e, null, y(c, (e) => a("div", {
|
|
888
888
|
key: e.id,
|
|
889
889
|
class: d(["theme-item", { active: t.currentTheme === e.id }]),
|
|
890
890
|
onClick: (t) => l(e.id),
|
|
891
|
-
onMousedown: o[0] ||=
|
|
891
|
+
onMousedown: o[0] ||= k(() => {}, ["prevent"]),
|
|
892
892
|
title: e.name
|
|
893
893
|
}, [a("div", {
|
|
894
894
|
class: "theme-preview",
|
|
@@ -1436,22 +1436,22 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1436
1436
|
verticalGap: 140,
|
|
1437
1437
|
fontFamily: "Arial"
|
|
1438
1438
|
}
|
|
1439
|
-
], dt = { class: "style-picker" }, ft = { class: "style-header" }, pt = { class: "style-count" }, mt = { class: "style-grid" }, ht = ["onClick"],
|
|
1439
|
+
], dt = { class: "style-picker" }, ft = { class: "style-header" }, pt = { class: "style-count" }, mt = { class: "style-grid" }, ht = ["onClick"], gt = { class: "style-preview" }, _t = {
|
|
1440
1440
|
viewBox: "0 0 80 40",
|
|
1441
1441
|
class: "style-svg"
|
|
1442
|
-
},
|
|
1442
|
+
}, vt = ["stroke", "stroke-width"], yt = [
|
|
1443
1443
|
"y2",
|
|
1444
1444
|
"stroke",
|
|
1445
1445
|
"stroke-width",
|
|
1446
1446
|
"opacity",
|
|
1447
1447
|
"stroke-dasharray"
|
|
1448
|
-
],
|
|
1448
|
+
], bt = [
|
|
1449
1449
|
"y2",
|
|
1450
1450
|
"stroke",
|
|
1451
1451
|
"stroke-width",
|
|
1452
1452
|
"opacity",
|
|
1453
1453
|
"stroke-dasharray"
|
|
1454
|
-
],
|
|
1454
|
+
], Y = [
|
|
1455
1455
|
"y",
|
|
1456
1456
|
"height",
|
|
1457
1457
|
"rx",
|
|
@@ -1465,7 +1465,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1465
1465
|
"rx",
|
|
1466
1466
|
"ry",
|
|
1467
1467
|
"fill"
|
|
1468
|
-
], Ct = { class: "style-name" },
|
|
1468
|
+
], Ct = { class: "style-name" }, wt = /*#__PURE__*/ B({
|
|
1469
1469
|
__name: "StylePicker",
|
|
1470
1470
|
props: {
|
|
1471
1471
|
currentStyle: {
|
|
@@ -1484,24 +1484,24 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1484
1484
|
width: "480",
|
|
1485
1485
|
placement: "bottom-end"
|
|
1486
1486
|
}, {
|
|
1487
|
-
reference:
|
|
1487
|
+
reference: E(() => [s(u, {
|
|
1488
1488
|
size: "small",
|
|
1489
1489
|
circle: "",
|
|
1490
1490
|
title: "样式",
|
|
1491
1491
|
disabled: t.disabled
|
|
1492
1492
|
}, {
|
|
1493
|
-
default:
|
|
1494
|
-
default:
|
|
1493
|
+
default: E(() => [s(l, null, {
|
|
1494
|
+
default: E(() => [s(S(pe))]),
|
|
1495
1495
|
_: 1
|
|
1496
1496
|
})]),
|
|
1497
1497
|
_: 1
|
|
1498
1498
|
}, 8, ["disabled"])]),
|
|
1499
|
-
default:
|
|
1499
|
+
default: E(() => [a("div", dt, [a("div", ft, [c[1] ||= a("h4", null, "鱼骨图样式", -1), a("span", pt, x(S(r).length) + " 种", 1)]), a("div", mt, [(g(!0), i(e, null, y(S(r), (e) => (g(), i("div", {
|
|
1500
1500
|
key: e.id,
|
|
1501
1501
|
class: d(["style-item", { active: t.currentStyle === e.id }]),
|
|
1502
1502
|
onClick: (t) => o.$emit("selectStyle", e.id),
|
|
1503
|
-
onMousedown: c[0] ||=
|
|
1504
|
-
}, [a("div",
|
|
1503
|
+
onMousedown: c[0] ||= k(() => {}, ["prevent"])
|
|
1504
|
+
}, [a("div", gt, [(g(), i("svg", _t, [
|
|
1505
1505
|
a("line", {
|
|
1506
1506
|
x1: "10",
|
|
1507
1507
|
y1: "20",
|
|
@@ -1510,7 +1510,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1510
1510
|
stroke: e.spineColor,
|
|
1511
1511
|
"stroke-width": e.spineWidth * .4,
|
|
1512
1512
|
"stroke-linecap": "round"
|
|
1513
|
-
}, null, 8,
|
|
1513
|
+
}, null, 8, vt),
|
|
1514
1514
|
a("line", {
|
|
1515
1515
|
x1: "30",
|
|
1516
1516
|
y1: "20",
|
|
@@ -1520,7 +1520,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1520
1520
|
"stroke-width": e.branchWidth * .4,
|
|
1521
1521
|
opacity: e.branchOpacity,
|
|
1522
1522
|
"stroke-dasharray": e.branchDashed ? "3,2" : "none"
|
|
1523
|
-
}, null, 8,
|
|
1523
|
+
}, null, 8, yt),
|
|
1524
1524
|
a("line", {
|
|
1525
1525
|
x1: "45",
|
|
1526
1526
|
y1: "20",
|
|
@@ -1530,7 +1530,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1530
1530
|
"stroke-width": e.branchWidth * .4,
|
|
1531
1531
|
opacity: e.branchOpacity,
|
|
1532
1532
|
"stroke-dasharray": e.branchDashed ? "3,2" : "none"
|
|
1533
|
-
}, null, 8,
|
|
1533
|
+
}, null, 8, bt),
|
|
1534
1534
|
a("rect", {
|
|
1535
1535
|
x: "34",
|
|
1536
1536
|
y: 20 - e.branchAngle * .4 - e.nodeHeight * .15,
|
|
@@ -1539,7 +1539,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1539
1539
|
rx: e.nodeRadius * .15,
|
|
1540
1540
|
fill: e.spineColor,
|
|
1541
1541
|
opacity: "0.8"
|
|
1542
|
-
}, null, 8,
|
|
1542
|
+
}, null, 8, Y),
|
|
1543
1543
|
a("rect", {
|
|
1544
1544
|
x: "49",
|
|
1545
1545
|
y: 20 + e.branchAngle * .4 - e.nodeHeight * .15,
|
|
@@ -1562,13 +1562,13 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1562
1562
|
});
|
|
1563
1563
|
};
|
|
1564
1564
|
}
|
|
1565
|
-
}, [["__scopeId", "data-v-0387ce0f"]]),
|
|
1565
|
+
}, [["__scopeId", "data-v-0387ce0f"]]), Tt = { class: "toolbar-left" }, Et = { class: "toolbar-center" }, Dt = { class: "zoom-value" }, Ot = { class: "toolbar-right" }, X = {
|
|
1566
1566
|
key: 1,
|
|
1567
1567
|
class: "online-users"
|
|
1568
|
-
},
|
|
1568
|
+
}, kt = {
|
|
1569
1569
|
key: 0,
|
|
1570
1570
|
class: "more-users"
|
|
1571
|
-
},
|
|
1571
|
+
}, At = /*#__PURE__*/ B({
|
|
1572
1572
|
__name: "Toolbar",
|
|
1573
1573
|
props: {
|
|
1574
1574
|
title: String,
|
|
@@ -1594,6 +1594,18 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1594
1594
|
showHistory: {
|
|
1595
1595
|
type: Boolean,
|
|
1596
1596
|
default: !1
|
|
1597
|
+
},
|
|
1598
|
+
backButton: {
|
|
1599
|
+
type: String,
|
|
1600
|
+
default: "show"
|
|
1601
|
+
},
|
|
1602
|
+
titleEditable: {
|
|
1603
|
+
type: Boolean,
|
|
1604
|
+
default: !0
|
|
1605
|
+
},
|
|
1606
|
+
authorEditable: {
|
|
1607
|
+
type: Boolean,
|
|
1608
|
+
default: !0
|
|
1597
1609
|
}
|
|
1598
1610
|
},
|
|
1599
1611
|
emits: [
|
|
@@ -1618,39 +1630,42 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1618
1630
|
"history"
|
|
1619
1631
|
],
|
|
1620
1632
|
setup(t, { emit: c }) {
|
|
1621
|
-
let l = t, u = c, p = v(l.title), m = v(l.effect), h = v(l.author), _ = v(null),
|
|
1622
|
-
|
|
1633
|
+
let l = t, u = c, p = v(l.title), m = v(l.effect), h = v(l.author), _ = v(null), ee = v(null), C = v(null), w = v(!1), D = v(""), O = () => {
|
|
1634
|
+
D.value.trim() && (u("ai-generate", D.value.trim()), w.value = !1, D.value = "");
|
|
1623
1635
|
};
|
|
1624
|
-
|
|
1636
|
+
T(() => l.title, (e) => {
|
|
1625
1637
|
p.value = e;
|
|
1626
|
-
}),
|
|
1638
|
+
}), T(() => l.effect, (e) => {
|
|
1627
1639
|
m.value = e;
|
|
1628
|
-
}),
|
|
1640
|
+
}), T(() => l.author, (e) => {
|
|
1629
1641
|
h.value = e;
|
|
1630
1642
|
});
|
|
1631
|
-
let
|
|
1643
|
+
let k = (e) => {
|
|
1632
1644
|
let t = e.target?.tagName;
|
|
1633
|
-
t !== "INPUT" && t !== "TEXTAREA" && (_.value?.blur(),
|
|
1645
|
+
t !== "INPUT" && t !== "TEXTAREA" && (_.value?.blur(), ee.value?.blur());
|
|
1634
1646
|
};
|
|
1635
1647
|
return (c, l) => {
|
|
1636
|
-
let u = b("el-icon"), v = b("el-button"),
|
|
1648
|
+
let u = b("el-icon"), v = b("el-button"), T = b("el-input"), A = b("el-divider"), te = b("Clock"), j = b("el-dropdown-item"), M = b("el-dropdown-menu"), ne = b("el-dropdown"), N = b("el-avatar"), ie = b("el-dialog");
|
|
1637
1649
|
return g(), i(e, null, [a("div", {
|
|
1638
1650
|
class: "toolbar",
|
|
1639
|
-
onMousedown:
|
|
1651
|
+
onMousedown: k
|
|
1640
1652
|
}, [
|
|
1641
|
-
a("div",
|
|
1642
|
-
|
|
1643
|
-
|
|
1653
|
+
a("div", Tt, [
|
|
1654
|
+
t.backButton === "hide" ? r("", !0) : (g(), n(v, {
|
|
1655
|
+
key: 0,
|
|
1644
1656
|
size: "small",
|
|
1645
|
-
circle: ""
|
|
1657
|
+
circle: "",
|
|
1658
|
+
disabled: t.backButton === "disable",
|
|
1659
|
+
onClick: l[0] ||= (e) => c.$emit("back"),
|
|
1660
|
+
title: "返回"
|
|
1646
1661
|
}, {
|
|
1647
|
-
default:
|
|
1648
|
-
default:
|
|
1662
|
+
default: E(() => [s(u, null, {
|
|
1663
|
+
default: E(() => [s(S(re))]),
|
|
1649
1664
|
_: 1
|
|
1650
1665
|
})]),
|
|
1651
1666
|
_: 1
|
|
1652
|
-
}),
|
|
1653
|
-
s(
|
|
1667
|
+
}, 8, ["disabled"])),
|
|
1668
|
+
s(T, {
|
|
1654
1669
|
ref_key: "titleInputRef",
|
|
1655
1670
|
ref: _,
|
|
1656
1671
|
modelValue: p.value,
|
|
@@ -1659,40 +1674,40 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1659
1674
|
placeholder: "标题 *",
|
|
1660
1675
|
class: "title-input",
|
|
1661
1676
|
size: "small",
|
|
1662
|
-
disabled: t.readonly
|
|
1677
|
+
disabled: t.readonly || !t.titleEditable
|
|
1663
1678
|
}, null, 8, ["modelValue", "disabled"]),
|
|
1664
|
-
s(
|
|
1679
|
+
s(T, {
|
|
1665
1680
|
ref_key: "effectInputRef",
|
|
1666
|
-
ref:
|
|
1681
|
+
ref: ee,
|
|
1667
1682
|
modelValue: m.value,
|
|
1668
1683
|
"onUpdate:modelValue": l[3] ||= (e) => m.value = e,
|
|
1669
1684
|
onBlur: l[4] ||= (e) => c.$emit("update:effect", m.value),
|
|
1670
1685
|
placeholder: "问题/结果 *",
|
|
1671
1686
|
class: "effect-input",
|
|
1672
1687
|
size: "small",
|
|
1673
|
-
disabled: t.readonly
|
|
1688
|
+
disabled: t.readonly || !t.titleEditable
|
|
1674
1689
|
}, null, 8, ["modelValue", "disabled"]),
|
|
1675
|
-
s(
|
|
1690
|
+
s(T, {
|
|
1676
1691
|
ref_key: "authorInputRef",
|
|
1677
|
-
ref:
|
|
1692
|
+
ref: C,
|
|
1678
1693
|
modelValue: h.value,
|
|
1679
1694
|
"onUpdate:modelValue": l[5] ||= (e) => h.value = e,
|
|
1680
1695
|
onBlur: l[6] ||= (e) => c.$emit("update:author", h.value),
|
|
1681
1696
|
placeholder: "作者 *",
|
|
1682
1697
|
class: "author-input",
|
|
1683
1698
|
size: "small",
|
|
1684
|
-
disabled: t.readonly
|
|
1699
|
+
disabled: t.readonly || !t.authorEditable
|
|
1685
1700
|
}, null, 8, ["modelValue", "disabled"])
|
|
1686
1701
|
]),
|
|
1687
|
-
a("div",
|
|
1702
|
+
a("div", Et, [
|
|
1688
1703
|
s(v, {
|
|
1689
1704
|
size: "small",
|
|
1690
1705
|
circle: "",
|
|
1691
|
-
onClick: l[7] ||= (e) =>
|
|
1706
|
+
onClick: l[7] ||= (e) => w.value = !0,
|
|
1692
1707
|
title: "AI生成",
|
|
1693
1708
|
disabled: t.readonly
|
|
1694
1709
|
}, {
|
|
1695
|
-
default:
|
|
1710
|
+
default: E(() => [...l[25] ||= [a("svg", {
|
|
1696
1711
|
viewBox: "0 0 24 24",
|
|
1697
1712
|
width: "14",
|
|
1698
1713
|
height: "14",
|
|
@@ -1708,8 +1723,8 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1708
1723
|
onClick: l[8] ||= (e) => c.$emit("addTextBox"),
|
|
1709
1724
|
title: "文本框"
|
|
1710
1725
|
}, {
|
|
1711
|
-
default:
|
|
1712
|
-
default:
|
|
1726
|
+
default: E(() => [s(u, null, {
|
|
1727
|
+
default: E(() => [s(S(ce))]),
|
|
1713
1728
|
_: 1
|
|
1714
1729
|
})]),
|
|
1715
1730
|
_: 1
|
|
@@ -1721,21 +1736,21 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1721
1736
|
title: "箭头线",
|
|
1722
1737
|
disabled: !t.canAddArrow
|
|
1723
1738
|
}, {
|
|
1724
|
-
default:
|
|
1725
|
-
default:
|
|
1739
|
+
default: E(() => [s(u, null, {
|
|
1740
|
+
default: E(() => [s(S(xe))]),
|
|
1726
1741
|
_: 1
|
|
1727
1742
|
})]),
|
|
1728
1743
|
_: 1
|
|
1729
1744
|
}, 8, ["disabled"]),
|
|
1730
|
-
s(
|
|
1745
|
+
s(A, { direction: "vertical" }),
|
|
1731
1746
|
s(v, {
|
|
1732
1747
|
size: "small",
|
|
1733
1748
|
circle: "",
|
|
1734
1749
|
onClick: l[10] ||= (e) => c.$emit("undo"),
|
|
1735
1750
|
disabled: !t.canUndo
|
|
1736
1751
|
}, {
|
|
1737
|
-
default:
|
|
1738
|
-
default:
|
|
1752
|
+
default: E(() => [s(u, null, {
|
|
1753
|
+
default: E(() => [s(S(ye))]),
|
|
1739
1754
|
_: 1
|
|
1740
1755
|
})]),
|
|
1741
1756
|
_: 1
|
|
@@ -1746,32 +1761,32 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1746
1761
|
onClick: l[11] ||= (e) => c.$emit("redo"),
|
|
1747
1762
|
disabled: !t.canRedo
|
|
1748
1763
|
}, {
|
|
1749
|
-
default:
|
|
1750
|
-
default:
|
|
1764
|
+
default: E(() => [s(u, null, {
|
|
1765
|
+
default: E(() => [s(S(be))]),
|
|
1751
1766
|
_: 1
|
|
1752
1767
|
})]),
|
|
1753
1768
|
_: 1
|
|
1754
1769
|
}, 8, ["disabled"]),
|
|
1755
|
-
s(
|
|
1770
|
+
s(A, { direction: "vertical" }),
|
|
1756
1771
|
s(v, {
|
|
1757
1772
|
size: "small",
|
|
1758
1773
|
circle: "",
|
|
1759
1774
|
onClick: l[12] ||= (e) => c.$emit("zoomOut")
|
|
1760
1775
|
}, {
|
|
1761
|
-
default:
|
|
1762
|
-
default:
|
|
1776
|
+
default: E(() => [s(u, null, {
|
|
1777
|
+
default: E(() => [s(S(R))]),
|
|
1763
1778
|
_: 1
|
|
1764
1779
|
})]),
|
|
1765
1780
|
_: 1
|
|
1766
1781
|
}),
|
|
1767
|
-
a("span",
|
|
1782
|
+
a("span", Dt, x(t.zoom) + "%", 1),
|
|
1768
1783
|
s(v, {
|
|
1769
1784
|
size: "small",
|
|
1770
1785
|
circle: "",
|
|
1771
1786
|
onClick: l[13] ||= (e) => c.$emit("zoomIn")
|
|
1772
1787
|
}, {
|
|
1773
|
-
default:
|
|
1774
|
-
default:
|
|
1788
|
+
default: E(() => [s(u, null, {
|
|
1789
|
+
default: E(() => [s(S(Ce))]),
|
|
1775
1790
|
_: 1
|
|
1776
1791
|
})]),
|
|
1777
1792
|
_: 1
|
|
@@ -1782,25 +1797,25 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1782
1797
|
onClick: l[14] ||= (e) => c.$emit("fitView"),
|
|
1783
1798
|
title: "适应画布"
|
|
1784
1799
|
}, {
|
|
1785
|
-
default:
|
|
1786
|
-
default:
|
|
1800
|
+
default: E(() => [s(u, null, {
|
|
1801
|
+
default: E(() => [s(S(le))]),
|
|
1787
1802
|
_: 1
|
|
1788
1803
|
})]),
|
|
1789
1804
|
_: 1
|
|
1790
1805
|
})
|
|
1791
1806
|
]),
|
|
1792
|
-
a("div",
|
|
1807
|
+
a("div", Ot, [
|
|
1793
1808
|
s(lt, {
|
|
1794
1809
|
"current-theme": t.currentTheme,
|
|
1795
1810
|
onSelectTheme: l[15] ||= (e) => c.$emit("selectTheme", e),
|
|
1796
1811
|
disabled: t.readonly
|
|
1797
1812
|
}, null, 8, ["current-theme", "disabled"]),
|
|
1798
|
-
s(
|
|
1813
|
+
s(wt, {
|
|
1799
1814
|
"current-style": t.currentDiagramStyle,
|
|
1800
1815
|
onSelectStyle: l[16] ||= (e) => c.$emit("selectStyle", e),
|
|
1801
1816
|
disabled: t.readonly
|
|
1802
1817
|
}, null, 8, ["current-style", "disabled"]),
|
|
1803
|
-
s(
|
|
1818
|
+
s(A, { direction: "vertical" }),
|
|
1804
1819
|
s(v, {
|
|
1805
1820
|
size: "small",
|
|
1806
1821
|
type: "primary",
|
|
@@ -1808,8 +1823,8 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1808
1823
|
onClick: l[17] ||= (e) => c.$emit("save"),
|
|
1809
1824
|
title: "保存"
|
|
1810
1825
|
}, {
|
|
1811
|
-
default:
|
|
1812
|
-
default:
|
|
1826
|
+
default: E(() => [s(u, null, {
|
|
1827
|
+
default: E(() => [s(S(P))]),
|
|
1813
1828
|
_: 1
|
|
1814
1829
|
})]),
|
|
1815
1830
|
_: 1
|
|
@@ -1821,52 +1836,52 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1821
1836
|
title: "更新履历",
|
|
1822
1837
|
onClick: l[18] ||= (e) => c.$emit("history")
|
|
1823
1838
|
}, {
|
|
1824
|
-
default:
|
|
1825
|
-
default:
|
|
1839
|
+
default: E(() => [s(u, null, {
|
|
1840
|
+
default: E(() => [s(te)]),
|
|
1826
1841
|
_: 1
|
|
1827
1842
|
})]),
|
|
1828
1843
|
_: 1
|
|
1829
1844
|
})) : r("", !0),
|
|
1830
|
-
s(
|
|
1845
|
+
s(ne, {
|
|
1831
1846
|
trigger: "click",
|
|
1832
1847
|
onCommand: l[19] ||= (e) => c.$emit("export", e)
|
|
1833
1848
|
}, {
|
|
1834
|
-
dropdown:
|
|
1835
|
-
default:
|
|
1836
|
-
s(
|
|
1837
|
-
default:
|
|
1838
|
-
default:
|
|
1849
|
+
dropdown: E(() => [s(M, null, {
|
|
1850
|
+
default: E(() => [
|
|
1851
|
+
s(j, { command: "svg" }, {
|
|
1852
|
+
default: E(() => [s(u, null, {
|
|
1853
|
+
default: E(() => [s(S(he))]),
|
|
1839
1854
|
_: 1
|
|
1840
1855
|
}), l[26] ||= o(" SVG 矢量图 ", -1)]),
|
|
1841
1856
|
_: 1
|
|
1842
1857
|
}),
|
|
1843
|
-
s(
|
|
1844
|
-
default:
|
|
1845
|
-
default:
|
|
1858
|
+
s(j, { command: "png" }, {
|
|
1859
|
+
default: E(() => [s(u, null, {
|
|
1860
|
+
default: E(() => [s(S(ge))]),
|
|
1846
1861
|
_: 1
|
|
1847
1862
|
}), l[27] ||= o(" PNG 图片 ", -1)]),
|
|
1848
1863
|
_: 1
|
|
1849
1864
|
}),
|
|
1850
|
-
s(
|
|
1851
|
-
default:
|
|
1852
|
-
default:
|
|
1865
|
+
s(j, { command: "jpg" }, {
|
|
1866
|
+
default: E(() => [s(u, null, {
|
|
1867
|
+
default: E(() => [s(S(ge))]),
|
|
1853
1868
|
_: 1
|
|
1854
1869
|
}), l[28] ||= o(" JPG 图片 ", -1)]),
|
|
1855
1870
|
_: 1
|
|
1856
1871
|
}),
|
|
1857
|
-
s(
|
|
1872
|
+
s(j, {
|
|
1858
1873
|
divided: "",
|
|
1859
1874
|
command: "json"
|
|
1860
1875
|
}, {
|
|
1861
|
-
default:
|
|
1862
|
-
default:
|
|
1876
|
+
default: E(() => [s(u, null, {
|
|
1877
|
+
default: E(() => [s(S(I))]),
|
|
1863
1878
|
_: 1
|
|
1864
1879
|
}), l[29] ||= o(" JSON 数据 ", -1)]),
|
|
1865
1880
|
_: 1
|
|
1866
1881
|
}),
|
|
1867
|
-
s(
|
|
1868
|
-
default:
|
|
1869
|
-
default:
|
|
1882
|
+
s(j, { command: "xml" }, {
|
|
1883
|
+
default: E(() => [s(u, null, {
|
|
1884
|
+
default: E(() => [s(S(I))]),
|
|
1870
1885
|
_: 1
|
|
1871
1886
|
}), l[30] ||= o(" XML 格式 ", -1)]),
|
|
1872
1887
|
_: 1
|
|
@@ -1874,22 +1889,22 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1874
1889
|
]),
|
|
1875
1890
|
_: 1
|
|
1876
1891
|
})]),
|
|
1877
|
-
default:
|
|
1892
|
+
default: E(() => [s(v, {
|
|
1878
1893
|
size: "small",
|
|
1879
1894
|
type: "warning",
|
|
1880
1895
|
circle: "",
|
|
1881
1896
|
title: "导出"
|
|
1882
1897
|
}, {
|
|
1883
|
-
default:
|
|
1884
|
-
default:
|
|
1898
|
+
default: E(() => [s(u, null, {
|
|
1899
|
+
default: E(() => [s(S(L))]),
|
|
1885
1900
|
_: 1
|
|
1886
1901
|
})]),
|
|
1887
1902
|
_: 1
|
|
1888
1903
|
})]),
|
|
1889
1904
|
_: 1
|
|
1890
1905
|
}),
|
|
1891
|
-
s(
|
|
1892
|
-
t.onlineCount > 0 ? (g(), i("div",
|
|
1906
|
+
s(A, { direction: "vertical" }),
|
|
1907
|
+
t.onlineCount > 0 ? (g(), i("div", X, [(g(!0), i(e, null, y(t.onlineUsers.slice(0, 3), (e, t) => (g(), n(N, {
|
|
1893
1908
|
key: e.id || t,
|
|
1894
1909
|
size: 24,
|
|
1895
1910
|
style: f({
|
|
@@ -1898,9 +1913,9 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1898
1913
|
}),
|
|
1899
1914
|
title: e.name
|
|
1900
1915
|
}, {
|
|
1901
|
-
default:
|
|
1916
|
+
default: E(() => [o(x(e.name?.charAt(0) || "?"), 1)]),
|
|
1902
1917
|
_: 2
|
|
1903
|
-
}, 1032, ["style", "title"]))), 128)), t.onlineCount > 3 ? (g(), i("span",
|
|
1918
|
+
}, 1032, ["style", "title"]))), 128)), t.onlineCount > 3 ? (g(), i("span", kt, "+" + x(t.onlineCount - 3), 1)) : r("", !0)])) : r("", !0),
|
|
1904
1919
|
t.readonly ? r("", !0) : (g(), n(v, {
|
|
1905
1920
|
key: 2,
|
|
1906
1921
|
size: "small",
|
|
@@ -1908,8 +1923,8 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1908
1923
|
onClick: l[20] ||= (e) => c.$emit("toggle-collab"),
|
|
1909
1924
|
title: "协作"
|
|
1910
1925
|
}, {
|
|
1911
|
-
default:
|
|
1912
|
-
default:
|
|
1926
|
+
default: E(() => [s(u, null, {
|
|
1927
|
+
default: E(() => [s(S(Se))]),
|
|
1913
1928
|
_: 1
|
|
1914
1929
|
}), a("span", null, x(t.isConnected ? "协作中" : "协作"), 1)]),
|
|
1915
1930
|
_: 1
|
|
@@ -1921,36 +1936,36 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1921
1936
|
onClick: l[21] ||= (e) => c.$emit("share-collab"),
|
|
1922
1937
|
title: "分享链接"
|
|
1923
1938
|
}, {
|
|
1924
|
-
default:
|
|
1925
|
-
default:
|
|
1939
|
+
default: E(() => [s(u, null, {
|
|
1940
|
+
default: E(() => [s(S(de))]),
|
|
1926
1941
|
_: 1
|
|
1927
1942
|
})]),
|
|
1928
1943
|
_: 1
|
|
1929
1944
|
})),
|
|
1930
1945
|
a("div", { class: d(["connection-status", { connected: t.isConnected }]) }, [...l[31] ||= [a("span", { class: "status-dot" }, null, -1)]], 2)
|
|
1931
1946
|
])
|
|
1932
|
-
], 32), s(
|
|
1933
|
-
modelValue:
|
|
1934
|
-
"onUpdate:modelValue": l[24] ||= (e) =>
|
|
1947
|
+
], 32), s(ie, {
|
|
1948
|
+
modelValue: w.value,
|
|
1949
|
+
"onUpdate:modelValue": l[24] ||= (e) => w.value = e,
|
|
1935
1950
|
title: "AI生成鱼骨图",
|
|
1936
1951
|
width: "70vw",
|
|
1937
1952
|
top: "50px",
|
|
1938
1953
|
center: "",
|
|
1939
1954
|
class: "ai-dialog"
|
|
1940
1955
|
}, {
|
|
1941
|
-
footer:
|
|
1942
|
-
default:
|
|
1956
|
+
footer: E(() => [s(v, { onClick: l[23] ||= (e) => w.value = !1 }, {
|
|
1957
|
+
default: E(() => [...l[32] ||= [o("取消", -1)]]),
|
|
1943
1958
|
_: 1
|
|
1944
1959
|
}), s(v, {
|
|
1945
1960
|
type: "primary",
|
|
1946
|
-
onClick:
|
|
1961
|
+
onClick: O
|
|
1947
1962
|
}, {
|
|
1948
|
-
default:
|
|
1963
|
+
default: E(() => [...l[33] ||= [o("生成", -1)]]),
|
|
1949
1964
|
_: 1
|
|
1950
1965
|
})]),
|
|
1951
|
-
default:
|
|
1952
|
-
modelValue:
|
|
1953
|
-
"onUpdate:modelValue": l[22] ||= (e) =>
|
|
1966
|
+
default: E(() => [s(T, {
|
|
1967
|
+
modelValue: D.value,
|
|
1968
|
+
"onUpdate:modelValue": l[22] ||= (e) => D.value = e,
|
|
1954
1969
|
type: "textarea",
|
|
1955
1970
|
autosize: {
|
|
1956
1971
|
minRows: 27,
|
|
@@ -1963,12 +1978,12 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1963
1978
|
}, 8, ["modelValue"])], 64);
|
|
1964
1979
|
};
|
|
1965
1980
|
}
|
|
1966
|
-
}, [["__scopeId", "data-v-
|
|
1981
|
+
}, [["__scopeId", "data-v-554e46a6"]]), jt = (e, t) => !e || e.length <= t ? e || "" : e.substring(0, t - 1) + "...", Mt = (e, t = 14) => {
|
|
1967
1982
|
if (!e) return 0;
|
|
1968
1983
|
let n = 0;
|
|
1969
1984
|
for (let r of e) r.charCodeAt(0) > 127 ? n += t : n += t * .6;
|
|
1970
1985
|
return n;
|
|
1971
|
-
},
|
|
1986
|
+
}, Nt = (e, t = "cause") => {
|
|
1972
1987
|
let n = {
|
|
1973
1988
|
category: 100,
|
|
1974
1989
|
cause: 80,
|
|
@@ -1977,13 +1992,13 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
1977
1992
|
category: 180,
|
|
1978
1993
|
cause: 140,
|
|
1979
1994
|
child: 100
|
|
1980
|
-
}, i =
|
|
1995
|
+
}, i = Mt(e);
|
|
1981
1996
|
return Math.max(n[t] || n.cause, Math.min(r[t] || r.cause, i + 30));
|
|
1982
|
-
},
|
|
1997
|
+
}, Pt = { class: "fishbone-wrapper" }, Ft = [
|
|
1983
1998
|
"viewBox",
|
|
1984
1999
|
"width",
|
|
1985
2000
|
"height"
|
|
1986
|
-
],
|
|
2001
|
+
], Z = ["width", "height"], It = ["transform"], Lt = ["width", "height"], Rt = ["width", "height"], zt = {
|
|
1987
2002
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
1988
2003
|
class: "tooltip-content"
|
|
1989
2004
|
}, Bt = [
|
|
@@ -2156,12 +2171,12 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2156
2171
|
"fill",
|
|
2157
2172
|
"font-size",
|
|
2158
2173
|
"font-family"
|
|
2159
|
-
],
|
|
2174
|
+
], An = ["onMouseenter"], jn = ["onClick"], Mn = ["cx", "cy"], Nn = ["cx", "cy"], Pn = [
|
|
2160
2175
|
"x1",
|
|
2161
2176
|
"y1",
|
|
2162
2177
|
"x2",
|
|
2163
2178
|
"y2"
|
|
2164
|
-
],
|
|
2179
|
+
], Q = [
|
|
2165
2180
|
"x1",
|
|
2166
2181
|
"y1",
|
|
2167
2182
|
"x2",
|
|
@@ -2186,7 +2201,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2186
2201
|
"y1",
|
|
2187
2202
|
"x2",
|
|
2188
2203
|
"y2"
|
|
2189
|
-
], Gn = 150, $ = 250, Kn = 60, qn = /*#__PURE__*/
|
|
2204
|
+
], Gn = 150, $ = 250, Kn = 60, qn = /*#__PURE__*/ B({
|
|
2190
2205
|
__name: "FishboneRenderer",
|
|
2191
2206
|
props: {
|
|
2192
2207
|
categories: {
|
|
@@ -2264,20 +2279,20 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2264
2279
|
type: e,
|
|
2265
2280
|
id: t,
|
|
2266
2281
|
catIndex: n
|
|
2267
|
-
}),
|
|
2282
|
+
}), ee = (e, t, n) => p("openMindmap", {
|
|
2268
2283
|
catIndex: e,
|
|
2269
2284
|
causeIndex: t,
|
|
2270
2285
|
measureIndex: n
|
|
2271
|
-
}),
|
|
2286
|
+
}), C = () => p("clearSelection"), w = v({
|
|
2272
2287
|
show: !1,
|
|
2273
2288
|
text: "",
|
|
2274
2289
|
x: 0,
|
|
2275
2290
|
y: 0,
|
|
2276
2291
|
w: 300,
|
|
2277
2292
|
h: 200
|
|
2278
|
-
}),
|
|
2293
|
+
}), T = (e, t, n) => {
|
|
2279
2294
|
let r = e.split("\n"), i = Math.max(...r.map((e) => e.length)), a = Math.max(120, Math.min(300, i * 14 + 24)), o = Math.max(40, Math.min(200, r.length * 22 + 20));
|
|
2280
|
-
|
|
2295
|
+
w.value = {
|
|
2281
2296
|
show: !0,
|
|
2282
2297
|
text: e,
|
|
2283
2298
|
x: Math.max(10, Math.min(t - a / 2, Te.value - a - 10)),
|
|
@@ -2285,17 +2300,17 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2285
2300
|
w: a,
|
|
2286
2301
|
h: o
|
|
2287
2302
|
};
|
|
2288
|
-
},
|
|
2289
|
-
|
|
2290
|
-
},
|
|
2303
|
+
}, E = () => {
|
|
2304
|
+
w.value.show = !1;
|
|
2305
|
+
}, D = t(() => d.theme.primary || "#546E7A"), O = t(() => d.theme.primary || "#37474F"), A = t(() => ut.find((e) => e.id === d.diagramStyle) || ut[0]), te = (e) => e === "left" ? "start" : e === "right" ? "end" : "middle", j = (e, t) => e === "left" ? -t / 2 : e === "right" ? t / 2 : 0, M = t(() => Math.max(d.categories.length, 1)), ne = t(() => Math.max(600, M.value * 130)), N = t(() => ne.value / (M.value + 1)), re = t(() => 150 + ne.value), ie = t(() => jt(d.effect || "问题", 8)), ae = t(() => {
|
|
2291
2306
|
let e = $;
|
|
2292
2307
|
return `M 70 ${e} Q 20 ${e - 30} 35 ${e - 65} Q 55 ${e} 35 315 Q 20 280 70 ${e} Z`;
|
|
2293
|
-
}),
|
|
2308
|
+
}), P = (e) => 150 + N.value * (e + 1), oe = (e) => e % 2 == 0 ? $ - Gn : 400, F = (e) => e % 2 == 0 ? $ - Gn - (A.value.nodeHeight / 2 + 8) : 400 + (A.value.nodeHeight / 2 + 8), se = (e) => P(e) + K("anchor", e).dx, I = (e) => $, L = (e) => P(e) + 30 + K("cat", e).dx, ce = (e) => oe(e) + K("cat", e).dy, le = (e) => ({
|
|
2294
2309
|
dx: (e.direction || "left") === "left" ? -35 : 35,
|
|
2295
2310
|
dy: 0
|
|
2296
2311
|
}), ue = (e, t, n) => {
|
|
2297
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2298
|
-
let r =
|
|
2312
|
+
e.preventDefault(), e.stopPropagation(), E(), h.value = null;
|
|
2313
|
+
let r = ke(e), i = se(t), a = I(t), o = L(t), s = ce(t), c = d.categories?.[t]?.causes || [], l = c.length === 1 ? .5 : (n + 1) / (c.length + 1), u = c[n]?.style?.anchorT ?? l;
|
|
2299
2314
|
de.value = {
|
|
2300
2315
|
i: t,
|
|
2301
2316
|
ci: n,
|
|
@@ -2327,13 +2342,13 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2327
2342
|
x: 0,
|
|
2328
2343
|
y: $
|
|
2329
2344
|
};
|
|
2330
|
-
let i = n.length === 1 ? .5 : (t + 1) / (n.length + 1), a = r?.style?.anchorT ?? i, o =
|
|
2345
|
+
let i = n.length === 1 ? .5 : (t + 1) / (n.length + 1), a = r?.style?.anchorT ?? i, o = se(e), s = I(e), c = L(e), l = ce(e);
|
|
2331
2346
|
return {
|
|
2332
2347
|
x: o + (c - o) * a,
|
|
2333
2348
|
y: s + (l - s) * a
|
|
2334
2349
|
};
|
|
2335
2350
|
}, me = (e, t) => pe(e, t).x, he = (e, t) => pe(e, t).y, ge = (e, t, n) => {
|
|
2336
|
-
let r = n.direction || "left", i =
|
|
2351
|
+
let r = n.direction || "left", i = z(n.text) / 2;
|
|
2337
2352
|
return me(e, t) + le(n).dx + (r === "left" ? -i : i);
|
|
2338
2353
|
}, _e = (e, t) => he(e, t), ve = (e, t, n) => {
|
|
2339
2354
|
let r = d.categories?.[e]?.causes?.[t];
|
|
@@ -2349,35 +2364,35 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2349
2364
|
}, Se = (e, t, n) => {
|
|
2350
2365
|
let r = be(e, t), i = d.categories?.[e]?.causes?.[t]?.children?.[n];
|
|
2351
2366
|
return i?.style?.color ? i.style.color : u(r, 2);
|
|
2352
|
-
},
|
|
2367
|
+
}, Ce = (e, t, n) => {
|
|
2353
2368
|
let r = xe(e, t), i = d.categories?.[e]?.causes?.[t]?.children?.[n];
|
|
2354
2369
|
return i?.style?.fontSize ? i.style.fontSize : Math.max(8, r - 2);
|
|
2355
|
-
},
|
|
2370
|
+
}, R = (e) => Nt(e, "category"), z = (e) => Nt(e, "cause"), we = (e, t) => jt(e, t), B = (e) => (e?.style?.fontSize ?? 12) * 2 + 8, V = (e) => (e?.style?.fontSize ?? 11) * 2 + 6, H = (e, t = 0) => isNaN(e) || !isFinite(e) ? t : e, U = t(() => {
|
|
2356
2371
|
let e = 30, t = 100, n = $, r = $;
|
|
2357
|
-
n = Math.min(n, $ - 70), r = Math.max(r, 320), t = Math.max(t,
|
|
2358
|
-
for (let i = 0; i <
|
|
2359
|
-
let a =
|
|
2360
|
-
e = Math.min(e, a - c), t = Math.max(t, a + c + 40), n = Math.min(n, o, s - (
|
|
2372
|
+
n = Math.min(n, $ - 70), r = Math.max(r, 320), t = Math.max(t, re.value + 120);
|
|
2373
|
+
for (let i = 0; i < M.value; i++) {
|
|
2374
|
+
let a = P(i), o = oe(i), s = F(i), c = (R(d.categories?.[i]?.name || "test") || 80) / 2 + 20;
|
|
2375
|
+
e = Math.min(e, a - c), t = Math.max(t, a + c + 40), n = Math.min(n, o, s - (A.value?.nodeHeight || 36) / 2), r = Math.max(r, o, s + (A.value?.nodeHeight || 36) / 2);
|
|
2361
2376
|
}
|
|
2362
|
-
for (let i = 0; i <
|
|
2377
|
+
for (let i = 0; i < M.value; i++) {
|
|
2363
2378
|
let a = d.categories?.[i]?.causes || [];
|
|
2364
2379
|
for (let o = 0; o < a.length; o++) {
|
|
2365
|
-
let s =
|
|
2366
|
-
e = Math.min(e, s - l), t = Math.max(t, s + l + 30), n = Math.min(n, c - (
|
|
2380
|
+
let s = H(me(i, o)), c = H(he(i, o), $), l = H(z(a[o]?.text || "test"), 80) / 2 + 20;
|
|
2381
|
+
e = Math.min(e, s - l), t = Math.max(t, s + l + 30), n = Math.min(n, c - (A.value?.causeHeight || 26) / 2 - 10), r = Math.max(r, c + (A.value?.causeHeight || 26) / 2 + 10);
|
|
2367
2382
|
let u = a[o]?.children || [];
|
|
2368
2383
|
for (let a = 0; a < u.length; a++) {
|
|
2369
|
-
let s =
|
|
2370
|
-
e = Math.min(e, s - d), t = Math.max(t, s + d + 25), n = Math.min(n, l - (
|
|
2384
|
+
let s = H(ve(i, o, a)), l = H(ye(i, o, a), c), d = H(z(u[a]?.text || "test"), 60) / 2 + 15;
|
|
2385
|
+
e = Math.min(e, s - d), t = Math.max(t, s + d + 25), n = Math.min(n, l - (A.value?.causeHeight || 26) / 2 - 8), r = Math.max(r, l + (A.value?.causeHeight || 26) / 2 + 8);
|
|
2371
2386
|
}
|
|
2372
2387
|
}
|
|
2373
2388
|
}
|
|
2374
2389
|
return {
|
|
2375
|
-
minX:
|
|
2376
|
-
maxX:
|
|
2377
|
-
minY:
|
|
2378
|
-
maxY:
|
|
2390
|
+
minX: H(e, 0),
|
|
2391
|
+
maxX: H(t, 800),
|
|
2392
|
+
minY: H(n, 0),
|
|
2393
|
+
maxY: H(r, 500)
|
|
2379
2394
|
};
|
|
2380
|
-
}), Te = t(() => U
|
|
2395
|
+
}), Te = t(() => H(U.value.maxX - U.value.minX + Kn * 2, 800)), Ee = t(() => H(U.value.maxY - U.value.minY + Kn * 2, 500)), W = t(() => H(U.value.minX - Kn, 0)), De = t(() => H(U.value.minY - Kn, 0)), G = v(null), Oe = v({}), ke = (e) => {
|
|
2381
2396
|
if (!m.value) return {
|
|
2382
2397
|
x: 0,
|
|
2383
2398
|
y: 0
|
|
@@ -2394,10 +2409,10 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2394
2409
|
x: i.x,
|
|
2395
2410
|
y: i.y
|
|
2396
2411
|
};
|
|
2397
|
-
},
|
|
2398
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2399
|
-
let a =
|
|
2400
|
-
|
|
2412
|
+
}, Ae = (e, t, n, r, i) => {
|
|
2413
|
+
e.preventDefault(), e.stopPropagation(), E(), h.value = null;
|
|
2414
|
+
let a = ke(e), o = K(t, n, r, i);
|
|
2415
|
+
G.value = {
|
|
2401
2416
|
type: t,
|
|
2402
2417
|
ci: n,
|
|
2403
2418
|
cii: r,
|
|
@@ -2407,45 +2422,45 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2407
2422
|
baseDx: o.dx,
|
|
2408
2423
|
baseDy: o.dy
|
|
2409
2424
|
}, setTimeout(() => {
|
|
2410
|
-
document.addEventListener("mouseup",
|
|
2425
|
+
document.addEventListener("mouseup", Me, { once: !0 });
|
|
2411
2426
|
}, 0);
|
|
2412
|
-
},
|
|
2427
|
+
}, je = (e) => {
|
|
2413
2428
|
if (!e.buttons) {
|
|
2414
|
-
|
|
2429
|
+
G.value && Me(), de.value && fe();
|
|
2415
2430
|
return;
|
|
2416
2431
|
}
|
|
2417
2432
|
if (de.value) {
|
|
2418
|
-
let t = de.value, n =
|
|
2433
|
+
let t = de.value, n = ke(e), r = n.x - t.smx, i = n.y - t.smy, a = Math.sqrt((t.ex - t.sx) ** 2 + (t.ey - t.sy) ** 2);
|
|
2419
2434
|
if (a > 0) {
|
|
2420
2435
|
let e = (r * (t.ex - t.sx) + i * (t.ey - t.sy)) / (a * a), n = Math.max(.05, Math.min(.95, t.startT + e)), o = (d.categories?.[t.i]?.causes || [])[t.ci];
|
|
2421
2436
|
o && (o.style ||= {}, o.style.anchorT = n);
|
|
2422
2437
|
}
|
|
2423
2438
|
return;
|
|
2424
2439
|
}
|
|
2425
|
-
if (!
|
|
2426
|
-
let t =
|
|
2427
|
-
|
|
2428
|
-
let i = `${
|
|
2429
|
-
|
|
2440
|
+
if (!G.value) return;
|
|
2441
|
+
let t = ke(e), n = G.value.baseDx + (t.x - G.value.smx), r = G.value.baseDy + (t.y - G.value.smy);
|
|
2442
|
+
G.value.type === "anchor" && (r = 0);
|
|
2443
|
+
let i = `${G.value.type}-${G.value.ci}-${G.value.cii ?? ""}-${G.value.mii ?? ""}`;
|
|
2444
|
+
Oe.value[i] = {
|
|
2430
2445
|
dx: n,
|
|
2431
2446
|
dy: r
|
|
2432
2447
|
};
|
|
2433
|
-
},
|
|
2434
|
-
if (
|
|
2435
|
-
let e = `${
|
|
2448
|
+
}, Me = () => {
|
|
2449
|
+
if (G.value) {
|
|
2450
|
+
let e = `${G.value.type}-${G.value.ci}-${G.value.cii ?? ""}-${G.value.mii ?? ""}`, t = Oe.value[e];
|
|
2436
2451
|
t && p("nodeDragged", {
|
|
2437
|
-
type:
|
|
2438
|
-
catIndex:
|
|
2439
|
-
causeIndex:
|
|
2440
|
-
measureIndex:
|
|
2452
|
+
type: G.value.type,
|
|
2453
|
+
catIndex: G.value.ci,
|
|
2454
|
+
causeIndex: G.value.cii,
|
|
2455
|
+
measureIndex: G.value.mii,
|
|
2441
2456
|
dx: t.dx,
|
|
2442
2457
|
dy: t.dy
|
|
2443
2458
|
});
|
|
2444
2459
|
}
|
|
2445
|
-
|
|
2446
|
-
},
|
|
2460
|
+
G.value = null, Oe.value = {};
|
|
2461
|
+
}, K = (e, t, n, r) => {
|
|
2447
2462
|
let i = `${e}-${t}-${n ?? ""}-${r ?? ""}`;
|
|
2448
|
-
if (
|
|
2463
|
+
if (Oe.value[i]) return Oe.value[i];
|
|
2449
2464
|
if (e === "cat") {
|
|
2450
2465
|
let e = d.categories?.[t];
|
|
2451
2466
|
return {
|
|
@@ -2472,22 +2487,22 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2472
2487
|
dx: 0,
|
|
2473
2488
|
dy: 0
|
|
2474
2489
|
};
|
|
2475
|
-
},
|
|
2476
|
-
h.value = null,
|
|
2477
|
-
},
|
|
2478
|
-
|
|
2490
|
+
}, q = () => {
|
|
2491
|
+
h.value = null, E();
|
|
2492
|
+
}, J = () => {
|
|
2493
|
+
Me(), fe();
|
|
2479
2494
|
}, Ne = () => {
|
|
2480
|
-
|
|
2495
|
+
G.value && Me(), document.activeElement?.blur(), p("clearSelection");
|
|
2481
2496
|
}, Pe = (e) => {
|
|
2482
|
-
!e.target.closest("[style*=\"cursor: grab\"]") &&
|
|
2497
|
+
!e.target.closest("[style*=\"cursor: grab\"]") && G.value && Me(), e.target.closest("[style*=\"cursor: grab\"]") || p("clearSelection");
|
|
2483
2498
|
}, Fe = (e, t) => {
|
|
2484
2499
|
h.value = {
|
|
2485
2500
|
type: "category",
|
|
2486
2501
|
id: t.id,
|
|
2487
2502
|
catIndex: e
|
|
2488
2503
|
};
|
|
2489
|
-
let n =
|
|
2490
|
-
|
|
2504
|
+
let n = K("anchor", e), r = K("cat", e);
|
|
2505
|
+
T(t.name, P(e) + 30 + n.dx + r.dx, F(e) + r.dy);
|
|
2491
2506
|
}, Ie = (e, t, n) => {
|
|
2492
2507
|
h.value = {
|
|
2493
2508
|
type: "cause",
|
|
@@ -2495,8 +2510,8 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2495
2510
|
catIndex: e,
|
|
2496
2511
|
causeIndex: t
|
|
2497
2512
|
};
|
|
2498
|
-
let r =
|
|
2499
|
-
|
|
2513
|
+
let r = K("cause", e, t), i = me(e, t) + le(n).dx + r.dx, a = he(e, t) + le(n).dy + r.dy;
|
|
2514
|
+
T(n.text, i, a);
|
|
2500
2515
|
}, Le = (e, t, n, r) => {
|
|
2501
2516
|
h.value = {
|
|
2502
2517
|
type: "measure",
|
|
@@ -2505,35 +2520,35 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2505
2520
|
causeIndex: t,
|
|
2506
2521
|
measureIndex: n
|
|
2507
2522
|
};
|
|
2508
|
-
let i =
|
|
2509
|
-
|
|
2523
|
+
let i = K("cause", e, t), a = K("measure", e, t, n);
|
|
2524
|
+
T(r.text, ve(e, t, n) + i.dx + a.dx, ye(e, t, n) + i.dy + a.dy);
|
|
2510
2525
|
};
|
|
2511
2526
|
return o({
|
|
2512
2527
|
getSvgElement: () => m.value,
|
|
2513
2528
|
getViewBox: () => ({
|
|
2514
|
-
x:
|
|
2515
|
-
y:
|
|
2529
|
+
x: W.value,
|
|
2530
|
+
y: De.value,
|
|
2516
2531
|
w: Te.value,
|
|
2517
2532
|
h: Ee.value
|
|
2518
2533
|
})
|
|
2519
|
-
}), (t, o) => (g(), i("div",
|
|
2534
|
+
}), (t, o) => (g(), i("div", Pt, [(g(), i("svg", {
|
|
2520
2535
|
ref_key: "svgRef",
|
|
2521
2536
|
ref: m,
|
|
2522
2537
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2523
|
-
viewBox: `${
|
|
2538
|
+
viewBox: `${W.value} ${De.value} ${Te.value} ${Ee.value}`,
|
|
2524
2539
|
width: Te.value,
|
|
2525
2540
|
height: Ee.value,
|
|
2526
2541
|
preserveAspectRatio: "xMidYMid meet",
|
|
2527
2542
|
class: "fishbone-svg",
|
|
2528
2543
|
style: f({
|
|
2529
2544
|
background: n.theme.bg || "#fafbfc",
|
|
2530
|
-
cursor:
|
|
2545
|
+
cursor: G.value ? "grabbing" : "default"
|
|
2531
2546
|
}),
|
|
2532
|
-
onClick:
|
|
2547
|
+
onClick: k(C, ["self"]),
|
|
2533
2548
|
onMousedown: Pe,
|
|
2534
|
-
onMousemove:
|
|
2535
|
-
onMouseup:
|
|
2536
|
-
onMouseleave:
|
|
2549
|
+
onMousemove: je,
|
|
2550
|
+
onMouseup: Me,
|
|
2551
|
+
onMouseleave: J
|
|
2537
2552
|
}, [
|
|
2538
2553
|
a("rect", {
|
|
2539
2554
|
x: "0",
|
|
@@ -2542,150 +2557,150 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2542
2557
|
height: Ee.value,
|
|
2543
2558
|
fill: "transparent",
|
|
2544
2559
|
onClick: Ne
|
|
2545
|
-
}, null, 8,
|
|
2546
|
-
|
|
2560
|
+
}, null, 8, Z),
|
|
2561
|
+
w.value.show ? (g(), i("g", {
|
|
2547
2562
|
key: 0,
|
|
2548
|
-
transform: `translate(${
|
|
2563
|
+
transform: `translate(${w.value.x}, ${w.value.y})`
|
|
2549
2564
|
}, [a("rect", {
|
|
2550
2565
|
x: "0",
|
|
2551
2566
|
y: "0",
|
|
2552
|
-
width:
|
|
2553
|
-
height:
|
|
2567
|
+
width: w.value.w,
|
|
2568
|
+
height: w.value.h,
|
|
2554
2569
|
rx: "6",
|
|
2555
2570
|
fill: "#303236",
|
|
2556
2571
|
opacity: "0.4"
|
|
2557
2572
|
}, null, 8, Lt), (g(), i("foreignObject", {
|
|
2558
2573
|
x: "8",
|
|
2559
2574
|
y: "6",
|
|
2560
|
-
width:
|
|
2561
|
-
height:
|
|
2562
|
-
}, [a("div", zt, x(
|
|
2575
|
+
width: w.value.w - 16,
|
|
2576
|
+
height: w.value.h - 12
|
|
2577
|
+
}, [a("div", zt, x(w.value.text), 1)], 8, Rt))], 8, It)) : r("", !0),
|
|
2563
2578
|
(g(), i("g", { key: n.styleTick }, [
|
|
2564
2579
|
a("line", {
|
|
2565
2580
|
x1: 100,
|
|
2566
2581
|
y1: $,
|
|
2567
|
-
x2:
|
|
2582
|
+
x2: re.value,
|
|
2568
2583
|
y2: $,
|
|
2569
|
-
stroke:
|
|
2570
|
-
"stroke-width":
|
|
2584
|
+
stroke: A.value.spineColor || D.value,
|
|
2585
|
+
"stroke-width": A.value.spineWidth,
|
|
2571
2586
|
"stroke-linecap": "round"
|
|
2572
2587
|
}, null, 8, Bt),
|
|
2573
2588
|
a("path", {
|
|
2574
|
-
d:
|
|
2575
|
-
fill:
|
|
2589
|
+
d: ae.value,
|
|
2590
|
+
fill: A.value.spineColor || D.value,
|
|
2576
2591
|
opacity: "0.5"
|
|
2577
2592
|
}, null, 8, Vt),
|
|
2578
2593
|
a("g", null, [
|
|
2579
2594
|
a("ellipse", {
|
|
2580
|
-
cx:
|
|
2595
|
+
cx: re.value + 55,
|
|
2581
2596
|
cy: $,
|
|
2582
|
-
rx:
|
|
2583
|
-
ry:
|
|
2584
|
-
fill:
|
|
2597
|
+
rx: A.value.headRx,
|
|
2598
|
+
ry: A.value.headRy,
|
|
2599
|
+
fill: A.value.spineColor || O.value,
|
|
2585
2600
|
style: { "pointer-events": "none" }
|
|
2586
2601
|
}, null, 8, Ht),
|
|
2587
2602
|
a("circle", {
|
|
2588
|
-
cx:
|
|
2603
|
+
cx: re.value + 45,
|
|
2589
2604
|
cy: $ - 7,
|
|
2590
2605
|
r: "6",
|
|
2591
2606
|
fill: "white",
|
|
2592
2607
|
style: { "pointer-events": "none" }
|
|
2593
2608
|
}, null, 8, Ut),
|
|
2594
2609
|
a("circle", {
|
|
2595
|
-
cx:
|
|
2610
|
+
cx: re.value + 47,
|
|
2596
2611
|
cy: $ - 7,
|
|
2597
2612
|
r: "3.5",
|
|
2598
2613
|
fill: "#263238",
|
|
2599
2614
|
style: { "pointer-events": "none" }
|
|
2600
2615
|
}, null, 8, Wt),
|
|
2601
2616
|
a("circle", {
|
|
2602
|
-
cx:
|
|
2617
|
+
cx: re.value + 49,
|
|
2603
2618
|
cy: $ - 9,
|
|
2604
2619
|
r: "1.2",
|
|
2605
2620
|
fill: "white",
|
|
2606
2621
|
style: { "pointer-events": "none" }
|
|
2607
2622
|
}, null, 8, Gt),
|
|
2608
2623
|
a("text", {
|
|
2609
|
-
x:
|
|
2624
|
+
x: re.value + 55,
|
|
2610
2625
|
y: 268,
|
|
2611
2626
|
"text-anchor": "middle",
|
|
2612
2627
|
"dominant-baseline": "middle",
|
|
2613
2628
|
fill: "white",
|
|
2614
2629
|
"font-size": "12",
|
|
2615
|
-
"font-family":
|
|
2630
|
+
"font-family": A.value.fontFamily + ", sans-serif",
|
|
2616
2631
|
style: { "pointer-events": "none" }
|
|
2617
|
-
}, x(
|
|
2632
|
+
}, x(ie.value), 9, Kt)
|
|
2618
2633
|
]),
|
|
2619
2634
|
(g(!0), i(e, null, y(n.categories, (t, s) => (g(), i("g", { key: t.id }, [
|
|
2620
2635
|
a("line", {
|
|
2621
|
-
x1:
|
|
2636
|
+
x1: P(s) + K("anchor", s).dx,
|
|
2622
2637
|
y1: $,
|
|
2623
|
-
x2:
|
|
2624
|
-
y2:
|
|
2625
|
-
stroke: t.style?.lineColor ||
|
|
2626
|
-
"stroke-width":
|
|
2638
|
+
x2: P(s) + 30 + K("cat", s).dx,
|
|
2639
|
+
y2: oe(s) + K("cat", s).dy,
|
|
2640
|
+
stroke: t.style?.lineColor || A.value.spineColor || t.color,
|
|
2641
|
+
"stroke-width": A.value.branchWidth,
|
|
2627
2642
|
"stroke-linecap": "round",
|
|
2628
|
-
opacity: (t.style?.lineOpacity ??
|
|
2643
|
+
opacity: (t.style?.lineOpacity ?? A.value.branchOpacity * 100) / 100,
|
|
2629
2644
|
"stroke-dasharray": t.style?.lineStyle === "dashed" ? "6,3" : "none"
|
|
2630
2645
|
}, null, 8, qt),
|
|
2631
|
-
|
|
2646
|
+
A.value.showDots ? (g(), i("circle", {
|
|
2632
2647
|
key: 0,
|
|
2633
|
-
cx:
|
|
2648
|
+
cx: P(s) + K("anchor", s).dx,
|
|
2634
2649
|
cy: $,
|
|
2635
2650
|
r: "4",
|
|
2636
|
-
fill:
|
|
2651
|
+
fill: A.value.spineColor || t.color
|
|
2637
2652
|
}, null, 8, Jt)) : r("", !0),
|
|
2638
2653
|
a("circle", {
|
|
2639
|
-
cx:
|
|
2654
|
+
cx: P(s) + K("anchor", s).dx,
|
|
2640
2655
|
cy: $,
|
|
2641
2656
|
r: n.selectedNode?.id === t.id ? 6 : 4,
|
|
2642
2657
|
fill: n.selectedNode?.id === t.id ? "#409EFF" : "transparent",
|
|
2643
2658
|
stroke: n.selectedNode?.id === t.id ? "#409EFF" : "#909399",
|
|
2644
2659
|
"stroke-width": 1.5,
|
|
2645
2660
|
style: { cursor: "ew-resize" },
|
|
2646
|
-
onMousedown:
|
|
2647
|
-
onMouseup:
|
|
2661
|
+
onMousedown: k((e) => Ae(e, "anchor", s), ["stop"]),
|
|
2662
|
+
onMouseup: Me
|
|
2648
2663
|
}, null, 40, Yt),
|
|
2649
2664
|
a("g", {
|
|
2650
|
-
transform: `translate(${
|
|
2651
|
-
onClick:
|
|
2652
|
-
onMousedown: (e) =>
|
|
2653
|
-
onMouseup:
|
|
2654
|
-
onMouseleave:
|
|
2665
|
+
transform: `translate(${P(s) + 30 + K("cat", s).dx}, ${F(s) + K("cat", s).dy})`,
|
|
2666
|
+
onClick: k((e) => _("category", t.id, s), ["stop"]),
|
|
2667
|
+
onMousedown: (e) => Ae(e, "cat", s),
|
|
2668
|
+
onMouseup: Me,
|
|
2669
|
+
onMouseleave: q,
|
|
2655
2670
|
onMouseenter: (e) => Fe(s, t),
|
|
2656
2671
|
style: { cursor: "grab" }
|
|
2657
2672
|
}, [
|
|
2658
2673
|
n.selectedNode?.id === t.id ? (g(), i("rect", {
|
|
2659
2674
|
key: 0,
|
|
2660
|
-
x: -
|
|
2661
|
-
y: -(
|
|
2662
|
-
width:
|
|
2663
|
-
height:
|
|
2664
|
-
rx:
|
|
2675
|
+
x: -R(t.name) / 2 - 4,
|
|
2676
|
+
y: -(B(t) / 2 + 4),
|
|
2677
|
+
width: R(t.name) + 8,
|
|
2678
|
+
height: B(t) + 8,
|
|
2679
|
+
rx: A.value.nodeRadius + 4,
|
|
2665
2680
|
fill: "none",
|
|
2666
2681
|
stroke: "#409EFF",
|
|
2667
2682
|
"stroke-width": "3"
|
|
2668
2683
|
}, null, 8, Zt)) : r("", !0),
|
|
2669
2684
|
a("rect", {
|
|
2670
|
-
x: -
|
|
2671
|
-
y: -
|
|
2672
|
-
width:
|
|
2673
|
-
height:
|
|
2674
|
-
rx:
|
|
2685
|
+
x: -R(t.name) / 2,
|
|
2686
|
+
y: -B(t) / 2,
|
|
2687
|
+
width: R(t.name),
|
|
2688
|
+
height: B(t),
|
|
2689
|
+
rx: A.value.nodeRadius,
|
|
2675
2690
|
fill: t.color,
|
|
2676
2691
|
opacity: (t.style?.opacity ?? 100) / 100,
|
|
2677
2692
|
stroke: n.selectedNode?.id === t.id ? "#409EFF" : t.style?.borderStyle === "none" ? "none" : t.style?.borderColor || t.color,
|
|
2678
2693
|
"stroke-width": n.selectedNode?.id === t.id ? 3 : t.style?.borderStyle === "none" ? 0 : t.style?.borderWidth ?? 1.5
|
|
2679
2694
|
}, null, 8, Qt),
|
|
2680
2695
|
a("text", {
|
|
2681
|
-
"text-anchor":
|
|
2696
|
+
"text-anchor": te(t.style?.textAlign),
|
|
2682
2697
|
"dominant-baseline": "middle",
|
|
2683
|
-
x:
|
|
2698
|
+
x: j(t.style?.textAlign, R(t.name)),
|
|
2684
2699
|
fill: t.style?.textColor || "white",
|
|
2685
2700
|
"font-size": t.style?.fontSize ?? 12,
|
|
2686
|
-
"font-family": (t.style?.fontFamily ||
|
|
2701
|
+
"font-family": (t.style?.fontFamily || A.value.fontFamily) + ", sans-serif",
|
|
2687
2702
|
style: { "pointer-events": "none" }
|
|
2688
|
-
}, x(
|
|
2703
|
+
}, x(we(t.name, t.style?.maxChars ?? 15)), 9, $t),
|
|
2689
2704
|
h.value?.id === t.id ? (g(), i("g", {
|
|
2690
2705
|
key: 1,
|
|
2691
2706
|
style: { "pointer-events": "auto" },
|
|
@@ -2696,61 +2711,61 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2696
2711
|
},
|
|
2697
2712
|
onMouseleave: o[2] ||= (e) => h.value = null
|
|
2698
2713
|
}, [a("g", {
|
|
2699
|
-
onClick:
|
|
2700
|
-
onMousedown: o[0] ||=
|
|
2714
|
+
onClick: k((e) => b("category", t.id, s), ["stop"]),
|
|
2715
|
+
onMousedown: o[0] ||= k(() => {}, ["stop"]),
|
|
2701
2716
|
style: { cursor: "pointer" }
|
|
2702
2717
|
}, [
|
|
2703
2718
|
a("circle", {
|
|
2704
|
-
cx:
|
|
2705
|
-
cy: -
|
|
2719
|
+
cx: R(t.name) / 2 - 24,
|
|
2720
|
+
cy: -B(t) / 2 - 6,
|
|
2706
2721
|
r: "7",
|
|
2707
2722
|
fill: "#409EFF",
|
|
2708
2723
|
opacity: "0.9"
|
|
2709
2724
|
}, null, 8, nn),
|
|
2710
2725
|
a("line", {
|
|
2711
|
-
x1:
|
|
2712
|
-
y1: -
|
|
2713
|
-
x2:
|
|
2714
|
-
y2: -
|
|
2726
|
+
x1: R(t.name) / 2 - 27,
|
|
2727
|
+
y1: -B(t) / 2 - 6,
|
|
2728
|
+
x2: R(t.name) / 2 - 21,
|
|
2729
|
+
y2: -B(t) / 2 - 6,
|
|
2715
2730
|
stroke: "white",
|
|
2716
2731
|
"stroke-width": "1.5",
|
|
2717
2732
|
"stroke-linecap": "round"
|
|
2718
2733
|
}, null, 8, rn),
|
|
2719
2734
|
a("line", {
|
|
2720
|
-
x1:
|
|
2721
|
-
y1: -
|
|
2722
|
-
x2:
|
|
2723
|
-
y2: -
|
|
2735
|
+
x1: R(t.name) / 2 - 24,
|
|
2736
|
+
y1: -B(t) / 2 - 9,
|
|
2737
|
+
x2: R(t.name) / 2 - 24,
|
|
2738
|
+
y2: -B(t) / 2 - 3,
|
|
2724
2739
|
stroke: "white",
|
|
2725
2740
|
"stroke-width": "1.5",
|
|
2726
2741
|
"stroke-linecap": "round"
|
|
2727
2742
|
}, null, 8, an)
|
|
2728
2743
|
], 40, tn), a("g", {
|
|
2729
|
-
onClick:
|
|
2730
|
-
onMousedown: o[1] ||=
|
|
2744
|
+
onClick: k((e) => S("category", t.id, s), ["stop"]),
|
|
2745
|
+
onMousedown: o[1] ||= k(() => {}, ["stop"]),
|
|
2731
2746
|
style: { cursor: "pointer" }
|
|
2732
2747
|
}, [
|
|
2733
2748
|
a("circle", {
|
|
2734
|
-
cx:
|
|
2735
|
-
cy: -
|
|
2749
|
+
cx: R(t.name) / 2 - 8,
|
|
2750
|
+
cy: -B(t) / 2 - 6,
|
|
2736
2751
|
r: "7",
|
|
2737
2752
|
fill: "#F56C6C",
|
|
2738
2753
|
opacity: "0.9"
|
|
2739
2754
|
}, null, 8, sn),
|
|
2740
2755
|
a("line", {
|
|
2741
|
-
x1:
|
|
2742
|
-
y1: -
|
|
2743
|
-
x2:
|
|
2744
|
-
y2: -
|
|
2756
|
+
x1: R(t.name) / 2 - 11,
|
|
2757
|
+
y1: -B(t) / 2 - 9,
|
|
2758
|
+
x2: R(t.name) / 2 - 5,
|
|
2759
|
+
y2: -B(t) / 2 - 3,
|
|
2745
2760
|
stroke: "white",
|
|
2746
2761
|
"stroke-width": "1.5",
|
|
2747
2762
|
"stroke-linecap": "round"
|
|
2748
2763
|
}, null, 8, cn),
|
|
2749
2764
|
a("line", {
|
|
2750
|
-
x1:
|
|
2751
|
-
y1: -
|
|
2752
|
-
x2:
|
|
2753
|
-
y2: -
|
|
2765
|
+
x1: R(t.name) / 2 - 5,
|
|
2766
|
+
y1: -B(t) / 2 - 9,
|
|
2767
|
+
x2: R(t.name) / 2 - 11,
|
|
2768
|
+
y2: -B(t) / 2 - 3,
|
|
2754
2769
|
stroke: "white",
|
|
2755
2770
|
"stroke-width": "1.5",
|
|
2756
2771
|
"stroke-linecap": "round"
|
|
@@ -2766,59 +2781,59 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2766
2781
|
stroke: n.selectedNode?.id === c.id ? "#409EFF" : "#fff",
|
|
2767
2782
|
"stroke-width": 1.5,
|
|
2768
2783
|
style: { cursor: "ew-resize" },
|
|
2769
|
-
onMousedown:
|
|
2770
|
-
onMouseup:
|
|
2771
|
-
onClick:
|
|
2784
|
+
onMousedown: k((e) => ue(e, s, l), ["stop"]),
|
|
2785
|
+
onMouseup: Me,
|
|
2786
|
+
onClick: k((e) => _("cause", c.id, s, l), ["stop"])
|
|
2772
2787
|
}, null, 40, un),
|
|
2773
2788
|
a("line", {
|
|
2774
2789
|
x1: me(s, l),
|
|
2775
2790
|
y1: he(s, l),
|
|
2776
|
-
x2: me(s, l) + le(c).dx +
|
|
2777
|
-
y2: he(s, l) + le(c).dy +
|
|
2791
|
+
x2: me(s, l) + le(c).dx + K("cause", s, l).dx,
|
|
2792
|
+
y2: he(s, l) + le(c).dy + K("cause", s, l).dy,
|
|
2778
2793
|
stroke: t.color,
|
|
2779
2794
|
"stroke-width": 1,
|
|
2780
2795
|
opacity: .4
|
|
2781
2796
|
}, null, 8, dn),
|
|
2782
2797
|
a("g", {
|
|
2783
|
-
transform: `translate(${me(s, l) + le(c).dx +
|
|
2784
|
-
onClick:
|
|
2785
|
-
onMousedown: (e) =>
|
|
2786
|
-
onMouseup:
|
|
2787
|
-
onMouseleave:
|
|
2798
|
+
transform: `translate(${me(s, l) + le(c).dx + K("cause", s, l).dx}, ${he(s, l) + le(c).dy + K("cause", s, l).dy})`,
|
|
2799
|
+
onClick: k((e) => _("cause", c.id, s, l), ["stop"]),
|
|
2800
|
+
onMousedown: (e) => Ae(e, "cause", s, l),
|
|
2801
|
+
onMouseup: Me,
|
|
2802
|
+
onMouseleave: q,
|
|
2788
2803
|
onMouseenter: (e) => Ie(s, l, c),
|
|
2789
2804
|
style: { cursor: "grab" }
|
|
2790
2805
|
}, [
|
|
2791
2806
|
n.selectedNode?.id === c.id ? (g(), i("rect", {
|
|
2792
2807
|
key: 0,
|
|
2793
|
-
x: -
|
|
2794
|
-
y: -(
|
|
2795
|
-
width:
|
|
2796
|
-
height:
|
|
2797
|
-
rx:
|
|
2808
|
+
x: -z(c.text) / 2 - 4,
|
|
2809
|
+
y: -(V(c) / 2 + 4),
|
|
2810
|
+
width: z(c.text) + 8,
|
|
2811
|
+
height: V(c) + 8,
|
|
2812
|
+
rx: A.value.causeRadius + 4,
|
|
2798
2813
|
fill: "none",
|
|
2799
2814
|
stroke: "#409EFF",
|
|
2800
2815
|
"stroke-width": "3"
|
|
2801
2816
|
}, null, 8, pn)) : r("", !0),
|
|
2802
2817
|
a("rect", {
|
|
2803
|
-
x: -
|
|
2804
|
-
y: -
|
|
2805
|
-
width:
|
|
2806
|
-
height:
|
|
2807
|
-
rx:
|
|
2818
|
+
x: -z(c.text) / 2,
|
|
2819
|
+
y: -V(c) / 2,
|
|
2820
|
+
width: z(c.text),
|
|
2821
|
+
height: V(c),
|
|
2822
|
+
rx: A.value.causeRadius,
|
|
2808
2823
|
fill: be(s, l),
|
|
2809
2824
|
opacity: (c.style?.opacity ?? 100) / 100,
|
|
2810
2825
|
stroke: n.selectedNode?.id === c.id ? "#409EFF" : c.style?.borderStyle === "none" ? "none" : c.style?.borderColor || t.color,
|
|
2811
2826
|
"stroke-width": n.selectedNode?.id === c.id ? 3 : c.style?.borderStyle === "none" ? 0 : c.style?.borderWidth ?? 1.5
|
|
2812
2827
|
}, null, 8, mn),
|
|
2813
2828
|
a("text", {
|
|
2814
|
-
"text-anchor":
|
|
2829
|
+
"text-anchor": te(c.style?.textAlign),
|
|
2815
2830
|
"dominant-baseline": "middle",
|
|
2816
|
-
x:
|
|
2831
|
+
x: j(c.style?.textAlign, z(c.text)),
|
|
2817
2832
|
fill: c.style?.textColor || "#263238",
|
|
2818
2833
|
"font-size": xe(s, l),
|
|
2819
|
-
"font-family": (c.style?.fontFamily ||
|
|
2834
|
+
"font-family": (c.style?.fontFamily || A.value.fontFamily) + ", sans-serif",
|
|
2820
2835
|
style: { "pointer-events": "none" }
|
|
2821
|
-
}, x(
|
|
2836
|
+
}, x(we(c.text, c.style?.maxChars ?? 20)), 9, hn),
|
|
2822
2837
|
h.value?.id === c.id ? (g(), i("g", {
|
|
2823
2838
|
key: 1,
|
|
2824
2839
|
style: { "pointer-events": "auto" },
|
|
@@ -2830,61 +2845,61 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2830
2845
|
},
|
|
2831
2846
|
onMouseleave: o[5] ||= (e) => h.value = null
|
|
2832
2847
|
}, [a("g", {
|
|
2833
|
-
onClick:
|
|
2834
|
-
onMousedown: o[3] ||=
|
|
2848
|
+
onClick: k((e) => b("cause", c.id, s, l), ["stop"]),
|
|
2849
|
+
onMousedown: o[3] ||= k(() => {}, ["stop"]),
|
|
2835
2850
|
style: { cursor: "pointer" }
|
|
2836
2851
|
}, [
|
|
2837
2852
|
a("circle", {
|
|
2838
|
-
cx:
|
|
2839
|
-
cy: -
|
|
2853
|
+
cx: z(c.text) / 2 - 30,
|
|
2854
|
+
cy: -V(c) / 2 - 6,
|
|
2840
2855
|
r: "6",
|
|
2841
2856
|
fill: "#409EFF",
|
|
2842
2857
|
opacity: "0.9"
|
|
2843
2858
|
}, null, 8, vn),
|
|
2844
2859
|
a("line", {
|
|
2845
|
-
x1:
|
|
2846
|
-
y1: -
|
|
2847
|
-
x2:
|
|
2848
|
-
y2: -
|
|
2860
|
+
x1: z(c.text) / 2 - 33,
|
|
2861
|
+
y1: -V(c) / 2 - 6,
|
|
2862
|
+
x2: z(c.text) / 2 - 27,
|
|
2863
|
+
y2: -V(c) / 2 - 6,
|
|
2849
2864
|
stroke: "white",
|
|
2850
2865
|
"stroke-width": "1.5",
|
|
2851
2866
|
"stroke-linecap": "round"
|
|
2852
2867
|
}, null, 8, yn),
|
|
2853
2868
|
a("line", {
|
|
2854
|
-
x1:
|
|
2855
|
-
y1: -
|
|
2856
|
-
x2:
|
|
2857
|
-
y2: -
|
|
2869
|
+
x1: z(c.text) / 2 - 30,
|
|
2870
|
+
y1: -V(c) / 2 - 9,
|
|
2871
|
+
x2: z(c.text) / 2 - 30,
|
|
2872
|
+
y2: -V(c) / 2 - 3,
|
|
2858
2873
|
stroke: "white",
|
|
2859
2874
|
"stroke-width": "1.5",
|
|
2860
2875
|
"stroke-linecap": "round"
|
|
2861
2876
|
}, null, 8, bn)
|
|
2862
2877
|
], 40, _n), a("g", {
|
|
2863
|
-
onClick:
|
|
2864
|
-
onMousedown: o[4] ||=
|
|
2878
|
+
onClick: k((e) => S("cause", c.id, s), ["stop"]),
|
|
2879
|
+
onMousedown: o[4] ||= k(() => {}, ["stop"]),
|
|
2865
2880
|
style: { cursor: "pointer" }
|
|
2866
2881
|
}, [
|
|
2867
2882
|
a("circle", {
|
|
2868
|
-
cx:
|
|
2869
|
-
cy: -
|
|
2883
|
+
cx: z(c.text) / 2 - 14,
|
|
2884
|
+
cy: -V(c) / 2 - 6,
|
|
2870
2885
|
r: "6",
|
|
2871
2886
|
fill: "#F56C6C",
|
|
2872
2887
|
opacity: "0.9"
|
|
2873
2888
|
}, null, 8, Sn),
|
|
2874
2889
|
a("line", {
|
|
2875
|
-
x1:
|
|
2876
|
-
y1: -
|
|
2877
|
-
x2:
|
|
2878
|
-
y2: -
|
|
2890
|
+
x1: z(c.text) / 2 - 17,
|
|
2891
|
+
y1: -V(c) / 2 - 9,
|
|
2892
|
+
x2: z(c.text) / 2 - 11,
|
|
2893
|
+
y2: -V(c) / 2 - 3,
|
|
2879
2894
|
stroke: "white",
|
|
2880
2895
|
"stroke-width": "1.5",
|
|
2881
2896
|
"stroke-linecap": "round"
|
|
2882
2897
|
}, null, 8, Cn),
|
|
2883
2898
|
a("line", {
|
|
2884
|
-
x1:
|
|
2885
|
-
y1: -
|
|
2886
|
-
x2:
|
|
2887
|
-
y2: -
|
|
2899
|
+
x1: z(c.text) / 2 - 11,
|
|
2900
|
+
y1: -V(c) / 2 - 9,
|
|
2901
|
+
x2: z(c.text) / 2 - 17,
|
|
2902
|
+
y2: -V(c) / 2 - 3,
|
|
2888
2903
|
stroke: "white",
|
|
2889
2904
|
"stroke-width": "1.5",
|
|
2890
2905
|
"stroke-linecap": "round"
|
|
@@ -2893,52 +2908,52 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2893
2908
|
(g(!0), i(e, null, y(c.children || [], (e, u) => (g(), i("g", { key: e.id }, [a("line", {
|
|
2894
2909
|
x1: ge(s, l, c) - (me(s, l) + le(c).dx),
|
|
2895
2910
|
y1: 0,
|
|
2896
|
-
x2: ve(s, l, u) - (me(s, l) + le(c).dx) +
|
|
2897
|
-
y2: ye(s, l, u) - he(s, l) +
|
|
2898
|
-
stroke: e.style?.lineColor ||
|
|
2899
|
-
"stroke-width":
|
|
2900
|
-
opacity: (e.style?.lineOpacity ??
|
|
2911
|
+
x2: ve(s, l, u) - (me(s, l) + le(c).dx) + K("measure", s, l, u).dx,
|
|
2912
|
+
y2: ye(s, l, u) - he(s, l) + K("measure", s, l, u).dy,
|
|
2913
|
+
stroke: e.style?.lineColor || A.value.spineColor || t.color,
|
|
2914
|
+
"stroke-width": A.value.branchWidth * .4,
|
|
2915
|
+
opacity: (e.style?.lineOpacity ?? A.value.branchOpacity * 40) / 100,
|
|
2901
2916
|
"stroke-dasharray": e.style?.lineStyle === "dashed" ? "3,2" : "none"
|
|
2902
2917
|
}, null, 8, Tn), a("g", {
|
|
2903
|
-
transform: `translate(${ve(s, l, u) - (me(s, l) + le(c).dx) +
|
|
2904
|
-
onClick:
|
|
2905
|
-
onMousedown: (e) =>
|
|
2906
|
-
onMouseup:
|
|
2918
|
+
transform: `translate(${ve(s, l, u) - (me(s, l) + le(c).dx) + K("measure", s, l, u).dx}, ${ye(s, l, u) - he(s, l) + K("measure", s, l, u).dy})`,
|
|
2919
|
+
onClick: k((t) => _("measure", e.id, s, l, u), ["stop"]),
|
|
2920
|
+
onMousedown: (e) => Ae(e, "measure", s, l, u),
|
|
2921
|
+
onMouseup: Me,
|
|
2907
2922
|
onMouseenter: (t) => Le(s, l, u, e),
|
|
2908
|
-
onMouseleave:
|
|
2923
|
+
onMouseleave: q,
|
|
2909
2924
|
style: { cursor: "grab" }
|
|
2910
2925
|
}, [
|
|
2911
2926
|
n.selectedNode?.id === e.id ? (g(), i("rect", {
|
|
2912
2927
|
key: 0,
|
|
2913
|
-
x: -
|
|
2914
|
-
y: -(
|
|
2915
|
-
width:
|
|
2916
|
-
height:
|
|
2917
|
-
rx:
|
|
2928
|
+
x: -z(e.text) / 2 - 3,
|
|
2929
|
+
y: -(V(e) / 2 + 3),
|
|
2930
|
+
width: z(e.text) + 6,
|
|
2931
|
+
height: V(e) + 6,
|
|
2932
|
+
rx: A.value.causeRadius + 3,
|
|
2918
2933
|
fill: "none",
|
|
2919
2934
|
stroke: "#409EFF",
|
|
2920
2935
|
"stroke-width": "2.5"
|
|
2921
2936
|
}, null, 8, Dn)) : r("", !0),
|
|
2922
2937
|
a("rect", {
|
|
2923
|
-
x: -
|
|
2924
|
-
y: -
|
|
2925
|
-
width:
|
|
2926
|
-
height:
|
|
2927
|
-
rx:
|
|
2938
|
+
x: -z(e.text) / 2,
|
|
2939
|
+
y: -V(e) / 2,
|
|
2940
|
+
width: z(e.text),
|
|
2941
|
+
height: V(e),
|
|
2942
|
+
rx: A.value.causeRadius,
|
|
2928
2943
|
fill: Se(s, l, u),
|
|
2929
2944
|
opacity: (e.style?.opacity ?? 100) / 100,
|
|
2930
2945
|
stroke: n.selectedNode?.id === e.id ? "#409EFF" : e.style?.borderStyle === "none" ? "none" : e.style?.borderColor || t.color,
|
|
2931
2946
|
"stroke-width": n.selectedNode?.id === e.id ? 2.5 : e.style?.borderStyle === "none" ? 0 : e.style?.borderWidth ?? 1
|
|
2932
2947
|
}, null, 8, On),
|
|
2933
2948
|
a("text", {
|
|
2934
|
-
"text-anchor":
|
|
2949
|
+
"text-anchor": te(e.style?.textAlign),
|
|
2935
2950
|
"dominant-baseline": "middle",
|
|
2936
|
-
x:
|
|
2951
|
+
x: j(e.style?.textAlign, z(e.text)),
|
|
2937
2952
|
fill: e.style?.textColor || "#263238",
|
|
2938
|
-
"font-size":
|
|
2939
|
-
"font-family": (e.style?.fontFamily ||
|
|
2953
|
+
"font-size": Ce(s, l, u),
|
|
2954
|
+
"font-family": (e.style?.fontFamily || A.value.fontFamily) + ", sans-serif",
|
|
2940
2955
|
style: { "pointer-events": "none" }
|
|
2941
|
-
}, x(
|
|
2956
|
+
}, x(we(e.text, e.style?.maxChars ?? 15)), 9, kn),
|
|
2942
2957
|
h.value?.id === e.id ? (g(), i("g", {
|
|
2943
2958
|
key: 1,
|
|
2944
2959
|
style: { "pointer-events": "auto" },
|
|
@@ -2951,120 +2966,120 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
2951
2966
|
},
|
|
2952
2967
|
onMouseleave: o[8] ||= (e) => h.value = null
|
|
2953
2968
|
}, [a("g", {
|
|
2954
|
-
onClick:
|
|
2955
|
-
onMousedown: o[6] ||=
|
|
2969
|
+
onClick: k((e) => ee(s, l, u), ["stop"]),
|
|
2970
|
+
onMousedown: o[6] ||= k(() => {}, ["stop"]),
|
|
2956
2971
|
style: { cursor: "pointer" }
|
|
2957
2972
|
}, [
|
|
2958
2973
|
a("circle", {
|
|
2959
|
-
cx:
|
|
2960
|
-
cy: -
|
|
2974
|
+
cx: z(e.text) / 2 - 28,
|
|
2975
|
+
cy: -V(e) / 2 - 6,
|
|
2961
2976
|
r: "6",
|
|
2962
2977
|
fill: "#67C23A",
|
|
2963
2978
|
opacity: "0.9"
|
|
2964
|
-
}, null, 8,
|
|
2979
|
+
}, null, 8, Mn),
|
|
2965
2980
|
a("circle", {
|
|
2966
|
-
cx:
|
|
2967
|
-
cy: -
|
|
2981
|
+
cx: z(e.text) / 2 - 28,
|
|
2982
|
+
cy: -V(e) / 2 - 6,
|
|
2968
2983
|
r: "2",
|
|
2969
2984
|
fill: "white"
|
|
2970
|
-
}, null, 8,
|
|
2985
|
+
}, null, 8, Nn),
|
|
2971
2986
|
a("line", {
|
|
2972
|
-
x1:
|
|
2973
|
-
y1: -
|
|
2974
|
-
x2:
|
|
2975
|
-
y2: -
|
|
2987
|
+
x1: z(e.text) / 2 - 28,
|
|
2988
|
+
y1: -V(e) / 2 - 6,
|
|
2989
|
+
x2: z(e.text) / 2 - 32,
|
|
2990
|
+
y2: -V(e) / 2 - 9,
|
|
2976
2991
|
stroke: "white",
|
|
2977
2992
|
"stroke-width": "1",
|
|
2978
2993
|
"stroke-linecap": "round"
|
|
2979
|
-
}, null, 8,
|
|
2994
|
+
}, null, 8, Pn),
|
|
2980
2995
|
a("line", {
|
|
2981
|
-
x1:
|
|
2982
|
-
y1: -
|
|
2983
|
-
x2:
|
|
2984
|
-
y2: -
|
|
2996
|
+
x1: z(e.text) / 2 - 28,
|
|
2997
|
+
y1: -V(e) / 2 - 6,
|
|
2998
|
+
x2: z(e.text) / 2 - 32,
|
|
2999
|
+
y2: -V(e) / 2 - 3,
|
|
2985
3000
|
stroke: "white",
|
|
2986
3001
|
"stroke-width": "1",
|
|
2987
3002
|
"stroke-linecap": "round"
|
|
2988
|
-
}, null, 8,
|
|
3003
|
+
}, null, 8, Q),
|
|
2989
3004
|
a("line", {
|
|
2990
|
-
x1:
|
|
2991
|
-
y1: -
|
|
2992
|
-
x2:
|
|
2993
|
-
y2: -
|
|
3005
|
+
x1: z(e.text) / 2 - 28,
|
|
3006
|
+
y1: -V(e) / 2 - 6,
|
|
3007
|
+
x2: z(e.text) / 2 - 24,
|
|
3008
|
+
y2: -V(e) / 2 - 9,
|
|
2994
3009
|
stroke: "white",
|
|
2995
3010
|
"stroke-width": "1",
|
|
2996
3011
|
"stroke-linecap": "round"
|
|
2997
3012
|
}, null, 8, Fn),
|
|
2998
3013
|
a("line", {
|
|
2999
|
-
x1:
|
|
3000
|
-
y1: -
|
|
3001
|
-
x2:
|
|
3002
|
-
y2: -
|
|
3014
|
+
x1: z(e.text) / 2 - 28,
|
|
3015
|
+
y1: -V(e) / 2 - 6,
|
|
3016
|
+
x2: z(e.text) / 2 - 24,
|
|
3017
|
+
y2: -V(e) / 2 - 3,
|
|
3003
3018
|
stroke: "white",
|
|
3004
3019
|
"stroke-width": "1",
|
|
3005
3020
|
"stroke-linecap": "round"
|
|
3006
3021
|
}, null, 8, In),
|
|
3007
3022
|
a("circle", {
|
|
3008
|
-
cx:
|
|
3009
|
-
cy: -
|
|
3023
|
+
cx: z(e.text) / 2 - 32,
|
|
3024
|
+
cy: -V(e) / 2 - 9,
|
|
3010
3025
|
r: "1",
|
|
3011
3026
|
fill: "white"
|
|
3012
3027
|
}, null, 8, Ln),
|
|
3013
3028
|
a("circle", {
|
|
3014
|
-
cx:
|
|
3015
|
-
cy: -
|
|
3029
|
+
cx: z(e.text) / 2 - 32,
|
|
3030
|
+
cy: -V(e) / 2 - 3,
|
|
3016
3031
|
r: "1",
|
|
3017
3032
|
fill: "white"
|
|
3018
3033
|
}, null, 8, Rn),
|
|
3019
3034
|
a("circle", {
|
|
3020
|
-
cx:
|
|
3021
|
-
cy: -
|
|
3035
|
+
cx: z(e.text) / 2 - 24,
|
|
3036
|
+
cy: -V(e) / 2 - 9,
|
|
3022
3037
|
r: "1",
|
|
3023
3038
|
fill: "white"
|
|
3024
3039
|
}, null, 8, zn),
|
|
3025
3040
|
a("circle", {
|
|
3026
|
-
cx:
|
|
3027
|
-
cy: -
|
|
3041
|
+
cx: z(e.text) / 2 - 24,
|
|
3042
|
+
cy: -V(e) / 2 - 3,
|
|
3028
3043
|
r: "1",
|
|
3029
3044
|
fill: "white"
|
|
3030
3045
|
}, null, 8, Bn)
|
|
3031
|
-
], 40,
|
|
3032
|
-
onClick:
|
|
3033
|
-
onMousedown: o[7] ||=
|
|
3046
|
+
], 40, jn), a("g", {
|
|
3047
|
+
onClick: k((t) => S("measure", e.id, s), ["stop"]),
|
|
3048
|
+
onMousedown: o[7] ||= k(() => {}, ["stop"]),
|
|
3034
3049
|
style: { cursor: "pointer" }
|
|
3035
3050
|
}, [
|
|
3036
3051
|
a("circle", {
|
|
3037
|
-
cx:
|
|
3038
|
-
cy: -
|
|
3052
|
+
cx: z(e.text) / 2 - 12,
|
|
3053
|
+
cy: -V(e) / 2 - 6,
|
|
3039
3054
|
r: "6",
|
|
3040
3055
|
fill: "#F56C6C",
|
|
3041
3056
|
opacity: "0.9"
|
|
3042
3057
|
}, null, 8, Hn),
|
|
3043
3058
|
a("line", {
|
|
3044
|
-
x1:
|
|
3045
|
-
y1: -
|
|
3046
|
-
x2:
|
|
3047
|
-
y2: -
|
|
3059
|
+
x1: z(e.text) / 2 - 15,
|
|
3060
|
+
y1: -V(e) / 2 - 9,
|
|
3061
|
+
x2: z(e.text) / 2 - 9,
|
|
3062
|
+
y2: -V(e) / 2 - 3,
|
|
3048
3063
|
stroke: "white",
|
|
3049
3064
|
"stroke-width": "1.5",
|
|
3050
3065
|
"stroke-linecap": "round"
|
|
3051
3066
|
}, null, 8, Un),
|
|
3052
3067
|
a("line", {
|
|
3053
|
-
x1:
|
|
3054
|
-
y1: -
|
|
3055
|
-
x2:
|
|
3056
|
-
y2: -
|
|
3068
|
+
x1: z(e.text) / 2 - 9,
|
|
3069
|
+
y1: -V(e) / 2 - 9,
|
|
3070
|
+
x2: z(e.text) / 2 - 15,
|
|
3071
|
+
y2: -V(e) / 2 - 3,
|
|
3057
3072
|
stroke: "white",
|
|
3058
3073
|
"stroke-width": "1.5",
|
|
3059
3074
|
"stroke-linecap": "round"
|
|
3060
3075
|
}, null, 8, Wn)
|
|
3061
|
-
], 40, Vn)], 40,
|
|
3076
|
+
], 40, Vn)], 40, An)) : r("", !0)
|
|
3062
3077
|
], 40, En)]))), 128))
|
|
3063
3078
|
], 40, fn)
|
|
3064
3079
|
]))), 128))
|
|
3065
3080
|
]))), 128))
|
|
3066
3081
|
]))
|
|
3067
|
-
], 44,
|
|
3082
|
+
], 44, Ft))]));
|
|
3068
3083
|
}
|
|
3069
3084
|
}, [["__scopeId", "data-v-52439ed0"]]), Jn = [
|
|
3070
3085
|
{
|
|
@@ -3167,7 +3182,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
3167
3182
|
}, rr = { style: {
|
|
3168
3183
|
"font-size": "12px",
|
|
3169
3184
|
color: "#909399"
|
|
3170
|
-
} }, ir = { class: "size-preview" }, ar = /*#__PURE__*/
|
|
3185
|
+
} }, ir = { class: "size-preview" }, ar = /*#__PURE__*/ B({
|
|
3171
3186
|
__name: "ExportDialog",
|
|
3172
3187
|
props: {
|
|
3173
3188
|
modelValue: Boolean,
|
|
@@ -3184,22 +3199,22 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
3184
3199
|
get: () => u.modelValue,
|
|
3185
3200
|
set: (e) => d("update:modelValue", e)
|
|
3186
3201
|
}), p = v(u.initialFormat);
|
|
3187
|
-
|
|
3202
|
+
T(() => u.initialFormat, (e) => {
|
|
3188
3203
|
p.value = e;
|
|
3189
3204
|
});
|
|
3190
|
-
let m = v(2), h = v(1), _ = v(!1),
|
|
3205
|
+
let m = v(2), h = v(1), _ = v(!1), ee = t(() => [
|
|
3191
3206
|
"svg",
|
|
3192
3207
|
"png",
|
|
3193
3208
|
"jpg"
|
|
3194
|
-
].includes(p.value)),
|
|
3209
|
+
].includes(p.value)), C = t(() => {
|
|
3195
3210
|
if (!u.svgElement) return 0;
|
|
3196
3211
|
let e = u.svgElement.viewBox?.baseVal?.width || 800;
|
|
3197
3212
|
return Math.round(e * m.value);
|
|
3198
|
-
}),
|
|
3213
|
+
}), w = t(() => {
|
|
3199
3214
|
if (!u.svgElement) return 0;
|
|
3200
3215
|
let e = u.svgElement.viewBox?.baseVal?.height || 500;
|
|
3201
3216
|
return Math.round(e * m.value);
|
|
3202
|
-
}),
|
|
3217
|
+
}), D = async () => {
|
|
3203
3218
|
if (!(!u.svgElement || !u.fishboneData)) {
|
|
3204
3219
|
_.value = !0;
|
|
3205
3220
|
try {
|
|
@@ -3218,74 +3233,74 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
3218
3233
|
}
|
|
3219
3234
|
}
|
|
3220
3235
|
};
|
|
3221
|
-
return
|
|
3236
|
+
return T(() => u.modelValue, (e) => {
|
|
3222
3237
|
e && (p.value = u.initialFormat, m.value = 2, h.value = 1);
|
|
3223
3238
|
}), (t, c) => {
|
|
3224
|
-
let l = b("el-icon"), u = b("el-radio-button"), d = b("el-radio-group"), v = b("el-form-item"),
|
|
3225
|
-
return g(), n(
|
|
3239
|
+
let l = b("el-icon"), u = b("el-radio-button"), d = b("el-radio-group"), v = b("el-form-item"), T = b("el-option"), O = b("el-select"), k = b("el-slider"), A = b("el-form"), te = b("el-button"), j = b("el-dialog");
|
|
3240
|
+
return g(), n(j, {
|
|
3226
3241
|
title: "导出鱼骨图",
|
|
3227
3242
|
modelValue: f.value,
|
|
3228
3243
|
"onUpdate:modelValue": c[4] ||= (e) => f.value = e,
|
|
3229
3244
|
width: "480px",
|
|
3230
3245
|
"close-on-click-modal": !1
|
|
3231
3246
|
}, {
|
|
3232
|
-
footer:
|
|
3233
|
-
default:
|
|
3247
|
+
footer: E(() => [s(te, { onClick: c[3] ||= (e) => f.value = !1 }, {
|
|
3248
|
+
default: E(() => [...c[10] ||= [o("取消", -1)]]),
|
|
3234
3249
|
_: 1
|
|
3235
|
-
}), s(
|
|
3250
|
+
}), s(te, {
|
|
3236
3251
|
type: "primary",
|
|
3237
|
-
onClick:
|
|
3252
|
+
onClick: D,
|
|
3238
3253
|
loading: _.value
|
|
3239
3254
|
}, {
|
|
3240
|
-
default:
|
|
3241
|
-
default:
|
|
3255
|
+
default: E(() => [_.value ? r("", !0) : (g(), n(l, { key: 0 }, {
|
|
3256
|
+
default: E(() => [s(S(L))]),
|
|
3242
3257
|
_: 1
|
|
3243
3258
|
})), o(" " + x(_.value ? "导出中..." : "导出"), 1)]),
|
|
3244
3259
|
_: 1
|
|
3245
3260
|
}, 8, ["loading"])]),
|
|
3246
|
-
default:
|
|
3261
|
+
default: E(() => [s(A, {
|
|
3247
3262
|
"label-width": "100px",
|
|
3248
3263
|
"label-position": "left"
|
|
3249
3264
|
}, {
|
|
3250
|
-
default:
|
|
3265
|
+
default: E(() => [
|
|
3251
3266
|
s(v, { label: "导出格式" }, {
|
|
3252
|
-
default:
|
|
3267
|
+
default: E(() => [s(d, {
|
|
3253
3268
|
modelValue: p.value,
|
|
3254
3269
|
"onUpdate:modelValue": c[0] ||= (e) => p.value = e,
|
|
3255
3270
|
class: "format-group"
|
|
3256
3271
|
}, {
|
|
3257
|
-
default:
|
|
3272
|
+
default: E(() => [
|
|
3258
3273
|
s(u, { value: "svg" }, {
|
|
3259
|
-
default:
|
|
3260
|
-
default:
|
|
3274
|
+
default: E(() => [s(l, null, {
|
|
3275
|
+
default: E(() => [s(S(he))]),
|
|
3261
3276
|
_: 1
|
|
3262
3277
|
}), c[5] ||= o(" SVG ", -1)]),
|
|
3263
3278
|
_: 1
|
|
3264
3279
|
}),
|
|
3265
3280
|
s(u, { value: "png" }, {
|
|
3266
|
-
default:
|
|
3267
|
-
default:
|
|
3281
|
+
default: E(() => [s(l, null, {
|
|
3282
|
+
default: E(() => [s(S(ge))]),
|
|
3268
3283
|
_: 1
|
|
3269
3284
|
}), c[6] ||= o(" PNG ", -1)]),
|
|
3270
3285
|
_: 1
|
|
3271
3286
|
}),
|
|
3272
3287
|
s(u, { value: "jpg" }, {
|
|
3273
|
-
default:
|
|
3274
|
-
default:
|
|
3288
|
+
default: E(() => [s(l, null, {
|
|
3289
|
+
default: E(() => [s(S(ge))]),
|
|
3275
3290
|
_: 1
|
|
3276
3291
|
}), c[7] ||= o(" JPG ", -1)]),
|
|
3277
3292
|
_: 1
|
|
3278
3293
|
}),
|
|
3279
3294
|
s(u, { value: "json" }, {
|
|
3280
|
-
default:
|
|
3281
|
-
default:
|
|
3295
|
+
default: E(() => [s(l, null, {
|
|
3296
|
+
default: E(() => [s(S(I))]),
|
|
3282
3297
|
_: 1
|
|
3283
3298
|
}), c[8] ||= o(" JSON ", -1)]),
|
|
3284
3299
|
_: 1
|
|
3285
3300
|
}),
|
|
3286
3301
|
s(u, { value: "xml" }, {
|
|
3287
|
-
default:
|
|
3288
|
-
default:
|
|
3302
|
+
default: E(() => [s(l, null, {
|
|
3303
|
+
default: E(() => [s(S(I))]),
|
|
3289
3304
|
_: 1
|
|
3290
3305
|
}), c[9] ||= o(" XML ", -1)]),
|
|
3291
3306
|
_: 1
|
|
@@ -3295,16 +3310,16 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
3295
3310
|
}, 8, ["modelValue"])]),
|
|
3296
3311
|
_: 1
|
|
3297
3312
|
}),
|
|
3298
|
-
|
|
3313
|
+
ee.value ? (g(), n(v, {
|
|
3299
3314
|
key: 0,
|
|
3300
3315
|
label: "分辨率"
|
|
3301
3316
|
}, {
|
|
3302
|
-
default:
|
|
3317
|
+
default: E(() => [s(O, {
|
|
3303
3318
|
modelValue: m.value,
|
|
3304
3319
|
"onUpdate:modelValue": c[1] ||= (e) => m.value = e,
|
|
3305
3320
|
style: { width: "100%" }
|
|
3306
3321
|
}, {
|
|
3307
|
-
default:
|
|
3322
|
+
default: E(() => [(g(!0), i(e, null, y(S(Jn), (e) => (g(), n(T, {
|
|
3308
3323
|
key: e.value,
|
|
3309
3324
|
label: e.label,
|
|
3310
3325
|
value: e.value
|
|
@@ -3317,7 +3332,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
3317
3332
|
key: 1,
|
|
3318
3333
|
label: "图片质量"
|
|
3319
3334
|
}, {
|
|
3320
|
-
default:
|
|
3335
|
+
default: E(() => [s(k, {
|
|
3321
3336
|
modelValue: h.value,
|
|
3322
3337
|
"onUpdate:modelValue": c[2] ||= (e) => h.value = e,
|
|
3323
3338
|
min: .1,
|
|
@@ -3328,11 +3343,11 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
3328
3343
|
}, null, 8, ["modelValue", "format-tooltip"]), a("span", rr, x(Math.round(h.value * 100)) + "%", 1)]),
|
|
3329
3344
|
_: 1
|
|
3330
3345
|
})) : r("", !0),
|
|
3331
|
-
|
|
3346
|
+
ee.value ? (g(), n(v, {
|
|
3332
3347
|
key: 2,
|
|
3333
3348
|
label: "预览尺寸"
|
|
3334
3349
|
}, {
|
|
3335
|
-
default:
|
|
3350
|
+
default: E(() => [a("div", ir, [a("span", null, "宽度: " + x(C.value) + "px", 1), a("span", null, "高度: " + x(w.value) + "px", 1)])]),
|
|
3336
3351
|
_: 1
|
|
3337
3352
|
})) : r("", !0)
|
|
3338
3353
|
]),
|
|
@@ -3593,7 +3608,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
|
|
|
3593
3608
|
//#endregion
|
|
3594
3609
|
//#region ../../src/composables/useCollaboration.js
|
|
3595
3610
|
function cr(e, t = {}) {
|
|
3596
|
-
let n = new
|
|
3611
|
+
let n = new z.Doc(), r = v(!1), i = v(!1), a = v(null), o = v([]), s = v(!1), c = _({
|
|
3597
3612
|
name: `用户${Math.floor(Math.random() * 1e3)}`,
|
|
3598
3613
|
color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
|
|
3599
3614
|
}), l = null, u = null, d = null, f = () => {
|
|
@@ -3607,7 +3622,7 @@ function cr(e, t = {}) {
|
|
|
3607
3622
|
}, p = () => {
|
|
3608
3623
|
u &&= (clearInterval(u), null);
|
|
3609
3624
|
}, m = (t, c) => {
|
|
3610
|
-
l && g(), l = new
|
|
3625
|
+
l && g(), l = new we({
|
|
3611
3626
|
url: c || `ws://${window.location.hostname}:1234`,
|
|
3612
3627
|
name: t || (typeof e == "object" ? e.value : e),
|
|
3613
3628
|
document: n,
|
|
@@ -3719,9 +3734,9 @@ function cr(e, t = {}) {
|
|
|
3719
3734
|
let r = n.getMap(e);
|
|
3720
3735
|
return r.observe(t), () => r.unobserve(t);
|
|
3721
3736
|
},
|
|
3722
|
-
encodeState: () =>
|
|
3737
|
+
encodeState: () => z.encodeStateAsUpdate(n),
|
|
3723
3738
|
decodeState: (e) => {
|
|
3724
|
-
|
|
3739
|
+
z.applyUpdate(n, e);
|
|
3725
3740
|
},
|
|
3726
3741
|
getDocId: () => n.clientID
|
|
3727
3742
|
};
|
|
@@ -3729,13 +3744,13 @@ function cr(e, t = {}) {
|
|
|
3729
3744
|
//#endregion
|
|
3730
3745
|
//#region ../../src/composables/useFishboneSync.js
|
|
3731
3746
|
var lr = (e, n, r, i) => {
|
|
3732
|
-
let { doc: a, isConnected: o, isSynced: s, peers: c, awareness: l, setLocalUser: u, connect: d, disconnect: f, closeCollaboration: p, checkCollaborationClosed: m, collaborationClosed: h, syncToYjs: g, onRemoteChange: _ } = cr(e), v = s, y = c, b = !1, x = !1, S = null,
|
|
3747
|
+
let { doc: a, isConnected: o, isSynced: s, peers: c, awareness: l, setLocalUser: u, connect: d, disconnect: f, closeCollaboration: p, checkCollaborationClosed: m, collaborationClosed: h, syncToYjs: g, onRemoteChange: _ } = cr(e), v = s, y = c, b = !1, x = !1, S = null, ee = (e = {}) => {
|
|
3733
3748
|
u({
|
|
3734
3749
|
name: e.name || `用户${Math.floor(Math.random() * 1e3)}`,
|
|
3735
|
-
color: e.color ||
|
|
3750
|
+
color: e.color || C(),
|
|
3736
3751
|
...e
|
|
3737
3752
|
});
|
|
3738
|
-
},
|
|
3753
|
+
}, C = () => {
|
|
3739
3754
|
let e = [
|
|
3740
3755
|
"#409EFF",
|
|
3741
3756
|
"#67C23A",
|
|
@@ -3751,7 +3766,7 @@ var lr = (e, n, r, i) => {
|
|
|
3751
3766
|
"#8E44AD"
|
|
3752
3767
|
];
|
|
3753
3768
|
return e[Math.floor(Math.random() * e.length)];
|
|
3754
|
-
},
|
|
3769
|
+
}, w = () => {
|
|
3755
3770
|
let e = n.value;
|
|
3756
3771
|
return {
|
|
3757
3772
|
title: e.title,
|
|
@@ -3765,13 +3780,13 @@ var lr = (e, n, r, i) => {
|
|
|
3765
3780
|
textBoxes: r ? r.value : [],
|
|
3766
3781
|
arrowLines: i ? i.value : []
|
|
3767
3782
|
};
|
|
3783
|
+
}, E = () => {
|
|
3784
|
+
b || x && o.value && g("fishbone", w());
|
|
3768
3785
|
}, D = () => {
|
|
3769
|
-
|
|
3786
|
+
S && clearTimeout(S), S = setTimeout(E, 100);
|
|
3770
3787
|
}, O = () => {
|
|
3771
|
-
|
|
3788
|
+
T(() => n.value.title, () => D()), T(() => n.value.effect, () => D()), T(() => n.value.author, () => D()), T(() => n.value.theme, () => D()), T(() => n.value.diagramStyle, () => D()), T(() => n.value.categories, () => D(), { deep: !0 }), T(() => n.value.titleStyle, () => D(), { deep: !0 }), r && T(() => r.value, () => D(), { deep: !0 }), i && T(() => i.value, () => D(), { deep: !0 });
|
|
3772
3789
|
}, k = () => {
|
|
3773
|
-
E(() => n.value.title, () => O()), E(() => n.value.effect, () => O()), E(() => n.value.author, () => O()), E(() => n.value.theme, () => O()), E(() => n.value.diagramStyle, () => O()), E(() => n.value.categories, () => O(), { deep: !0 }), E(() => n.value.titleStyle, () => O(), { deep: !0 }), r && E(() => r.value, () => O(), { deep: !0 }), i && E(() => i.value, () => O(), { deep: !0 });
|
|
3774
|
-
}, A = () => {
|
|
3775
3790
|
_("fishbone", (e) => {
|
|
3776
3791
|
e && (b = !0, Object.assign(n.value, {
|
|
3777
3792
|
title: e.title,
|
|
@@ -3784,28 +3799,28 @@ var lr = (e, n, r, i) => {
|
|
|
3784
3799
|
meta: e.meta
|
|
3785
3800
|
}), r && e.textBoxes && (r.value = e.textBoxes), i && e.arrowLines && (i.value = e.arrowLines), b = !1);
|
|
3786
3801
|
});
|
|
3787
|
-
},
|
|
3802
|
+
}, A = t(() => ({
|
|
3788
3803
|
isConnected: o.value,
|
|
3789
3804
|
isSynced: v.value,
|
|
3790
3805
|
onlineCount: y.value.length
|
|
3791
3806
|
}));
|
|
3792
|
-
return
|
|
3807
|
+
return O(), k(), {
|
|
3793
3808
|
doc: a,
|
|
3794
3809
|
isConnected: o,
|
|
3795
3810
|
isSynced: s,
|
|
3796
3811
|
awareness: l,
|
|
3797
3812
|
syncStatus: v,
|
|
3798
3813
|
onlineUsers: y,
|
|
3799
|
-
connectionStatus:
|
|
3814
|
+
connectionStatus: A,
|
|
3800
3815
|
collaborationClosed: h,
|
|
3801
|
-
initUser:
|
|
3816
|
+
initUser: ee,
|
|
3802
3817
|
connect: d,
|
|
3803
3818
|
disconnect: f,
|
|
3804
3819
|
closeCollaboration: p,
|
|
3805
3820
|
checkCollaborationClosed: m,
|
|
3806
3821
|
destroy: f,
|
|
3807
3822
|
startSync: () => {
|
|
3808
|
-
x = !0, g("fishbone",
|
|
3823
|
+
x = !0, g("fishbone", w());
|
|
3809
3824
|
},
|
|
3810
3825
|
enableLocalPush: () => {
|
|
3811
3826
|
x = !0;
|
|
@@ -3814,225 +3829,281 @@ var lr = (e, n, r, i) => {
|
|
|
3814
3829
|
x = !1, S &&= (clearTimeout(S), null);
|
|
3815
3830
|
}
|
|
3816
3831
|
};
|
|
3817
|
-
}
|
|
3832
|
+
};
|
|
3833
|
+
N.create({
|
|
3818
3834
|
baseURL: "/api",
|
|
3819
3835
|
timeout: 3e4
|
|
3820
|
-
})
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
}
|
|
3836
|
+
});
|
|
3837
|
+
function ur(e = "/api") {
|
|
3838
|
+
let t = N.create({
|
|
3839
|
+
baseURL: e,
|
|
3840
|
+
timeout: 3e4
|
|
3841
|
+
});
|
|
3842
|
+
return {
|
|
3843
|
+
list: (e) => t.get("/documents/", { params: e }),
|
|
3844
|
+
get: (e) => t.get(`/documents/${e}`),
|
|
3845
|
+
create: (e) => t.post("/documents/", e),
|
|
3846
|
+
update: (e, n) => t.put(`/documents/${e}`, n),
|
|
3847
|
+
delete: (e) => t.delete(`/documents/${e}`),
|
|
3848
|
+
addAttachment: (e, n) => t.post(`/documents/${e}/attachments`, n),
|
|
3849
|
+
listAttachments: (e) => t.get(`/documents/${e}/attachments`)
|
|
3850
|
+
};
|
|
3851
|
+
}
|
|
3852
|
+
function dr(e = "/api") {
|
|
3853
|
+
let t = N.create({
|
|
3854
|
+
baseURL: e,
|
|
3855
|
+
timeout: 3e4
|
|
3856
|
+
});
|
|
3857
|
+
return {
|
|
3858
|
+
get: (e) => t.get(`/questionnaires/${e}`),
|
|
3859
|
+
create: (e) => t.post("/questionnaires/", e),
|
|
3860
|
+
update: (e, n) => t.put(`/questionnaires/${e}`, n)
|
|
3861
|
+
};
|
|
3862
|
+
}
|
|
3863
|
+
dr("/api");
|
|
3864
|
+
var fr = ur("/api");
|
|
3829
3865
|
(/* @__PURE__ */ new Date()).toISOString(), (/* @__PURE__ */ new Date()).toISOString();
|
|
3830
3866
|
//#endregion
|
|
3831
3867
|
//#region ../../src/views/FishboneEditor.vue
|
|
3832
|
-
var
|
|
3868
|
+
var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { class: "panel-content" }, gr = ["onClick"], _r = { class: "category-name" }, vr = { class: "cause-count" }, yr = {
|
|
3833
3869
|
key: 0,
|
|
3834
3870
|
class: "diagram-effect"
|
|
3835
|
-
},
|
|
3871
|
+
}, br = [
|
|
3836
3872
|
"data-textbox-id",
|
|
3837
3873
|
"onMousedown",
|
|
3838
3874
|
"onDblclick"
|
|
3839
|
-
],
|
|
3875
|
+
], xr = [
|
|
3840
3876
|
"onUpdate:modelValue",
|
|
3841
3877
|
"readonly",
|
|
3842
3878
|
"onBlur"
|
|
3843
|
-
],
|
|
3879
|
+
], Sr = ["onMousedown"], Cr = ["onMousedown"], wr = ["onMousedown"], Tr = ["onMousedown"], Er = ["onClick"], Dr = ["viewBox"], Or = ["id"], kr = ["fill"], Ar = ["id"], jr = ["fill"], Mr = { key: 0 }, Nr = [
|
|
3844
3880
|
"cx",
|
|
3845
3881
|
"cy",
|
|
3846
3882
|
"onMouseenter",
|
|
3847
3883
|
"onMousedown"
|
|
3848
|
-
],
|
|
3884
|
+
], Pr = { key: 0 }, Fr = [
|
|
3849
3885
|
"cx",
|
|
3850
3886
|
"cy",
|
|
3851
3887
|
"onMouseenter",
|
|
3852
3888
|
"onMousedown"
|
|
3853
|
-
],
|
|
3889
|
+
], Ir = [
|
|
3854
3890
|
"d",
|
|
3855
3891
|
"stroke",
|
|
3856
3892
|
"stroke-width",
|
|
3857
3893
|
"stroke-dasharray",
|
|
3858
3894
|
"marker-end",
|
|
3859
3895
|
"marker-start"
|
|
3860
|
-
],
|
|
3896
|
+
], Lr = [
|
|
3861
3897
|
"d",
|
|
3862
3898
|
"stroke-width",
|
|
3863
3899
|
"onMousedown"
|
|
3864
|
-
],
|
|
3900
|
+
], Rr = [
|
|
3865
3901
|
"cx",
|
|
3866
3902
|
"cy",
|
|
3867
3903
|
"onMousedown"
|
|
3868
|
-
],
|
|
3904
|
+
], zr = [
|
|
3869
3905
|
"cx",
|
|
3870
3906
|
"cy",
|
|
3871
3907
|
"onMousedown"
|
|
3872
|
-
],
|
|
3908
|
+
], Br = ["cx", "cy"], Vr = ["cx", "cy"], Hr = [
|
|
3873
3909
|
"x1",
|
|
3874
3910
|
"y1",
|
|
3875
3911
|
"x2",
|
|
3876
3912
|
"y2"
|
|
3877
|
-
],
|
|
3913
|
+
], Ur = [
|
|
3878
3914
|
"x1",
|
|
3879
3915
|
"y1",
|
|
3880
3916
|
"x2",
|
|
3881
3917
|
"y2"
|
|
3882
|
-
],
|
|
3918
|
+
], Wr = [
|
|
3883
3919
|
"x1",
|
|
3884
3920
|
"y1",
|
|
3885
3921
|
"x2",
|
|
3886
3922
|
"y2"
|
|
3887
|
-
],
|
|
3923
|
+
], Gr = [
|
|
3888
3924
|
"cx",
|
|
3889
3925
|
"cy",
|
|
3890
3926
|
"onMousedown"
|
|
3891
|
-
],
|
|
3927
|
+
], Kr = ["transform", "onClick"], qr = { class: "panel-content" }, Jr = {
|
|
3892
3928
|
key: 0,
|
|
3893
3929
|
class: "detail-form"
|
|
3894
|
-
},
|
|
3930
|
+
}, Yr = {
|
|
3895
3931
|
key: 1,
|
|
3896
3932
|
class: "detail-form"
|
|
3897
|
-
},
|
|
3933
|
+
}, Xr = ["value"], Zr = { class: "children-list" }, Qr = {
|
|
3898
3934
|
key: 1,
|
|
3899
3935
|
class: "detail-form"
|
|
3900
|
-
},
|
|
3936
|
+
}, $r = {
|
|
3901
3937
|
key: 2,
|
|
3902
3938
|
class: "detail-form"
|
|
3903
|
-
},
|
|
3939
|
+
}, ei = {
|
|
3904
3940
|
key: 0,
|
|
3905
3941
|
style: {
|
|
3906
3942
|
display: "flex",
|
|
3907
3943
|
"align-items": "center",
|
|
3908
3944
|
gap: "8px"
|
|
3909
3945
|
}
|
|
3910
|
-
},
|
|
3946
|
+
}, ti = {
|
|
3911
3947
|
key: 1,
|
|
3912
3948
|
style: {
|
|
3913
3949
|
color: "#909399",
|
|
3914
3950
|
"font-size": "12px"
|
|
3915
3951
|
}
|
|
3916
|
-
},
|
|
3952
|
+
}, ni = {
|
|
3917
3953
|
key: 0,
|
|
3918
3954
|
style: {
|
|
3919
3955
|
display: "flex",
|
|
3920
3956
|
"align-items": "center",
|
|
3921
3957
|
gap: "8px"
|
|
3922
3958
|
}
|
|
3923
|
-
},
|
|
3959
|
+
}, ri = {
|
|
3924
3960
|
key: 1,
|
|
3925
3961
|
style: {
|
|
3926
3962
|
color: "#909399",
|
|
3927
3963
|
"font-size": "12px"
|
|
3928
3964
|
}
|
|
3929
|
-
},
|
|
3965
|
+
}, ii = {
|
|
3930
3966
|
key: 3,
|
|
3931
3967
|
class: "no-selection"
|
|
3932
|
-
},
|
|
3968
|
+
}, ai = "fishbone", oi = /*#__PURE__*/ B({
|
|
3933
3969
|
__name: "FishboneEditor",
|
|
3970
|
+
props: {
|
|
3971
|
+
docId: {
|
|
3972
|
+
type: [Number, String],
|
|
3973
|
+
default: null
|
|
3974
|
+
},
|
|
3975
|
+
apiBase: {
|
|
3976
|
+
type: String,
|
|
3977
|
+
default: "/api"
|
|
3978
|
+
},
|
|
3979
|
+
saveApi: {
|
|
3980
|
+
type: [String, Function],
|
|
3981
|
+
default: null
|
|
3982
|
+
},
|
|
3983
|
+
loadApi: {
|
|
3984
|
+
type: [String, Function],
|
|
3985
|
+
default: null
|
|
3986
|
+
},
|
|
3987
|
+
wsUrl: {
|
|
3988
|
+
type: String,
|
|
3989
|
+
default: ""
|
|
3990
|
+
},
|
|
3991
|
+
user: {
|
|
3992
|
+
type: Object,
|
|
3993
|
+
default: null
|
|
3994
|
+
},
|
|
3995
|
+
uiConfig: {
|
|
3996
|
+
type: Object,
|
|
3997
|
+
default: () => ({})
|
|
3998
|
+
}
|
|
3999
|
+
},
|
|
3934
4000
|
setup(n) {
|
|
3935
|
-
let c =
|
|
3936
|
-
|
|
3937
|
-
|
|
4001
|
+
let c = j(), l = te(), h = n, _ = t(() => ({
|
|
4002
|
+
backButton: "show",
|
|
4003
|
+
titleEditable: !0,
|
|
4004
|
+
authorEditable: !0,
|
|
4005
|
+
...h.uiConfig
|
|
4006
|
+
})), O = t(() => h.docId ?? l.params.id), A = t(() => h.apiBase && h.apiBase !== "/api" ? ur(h.apiBase) : fr), re = v(!1), ie = v(!1), { saveVersion: ae } = We(), P = Ve(), oe = v(O.value || `fishbone-${Date.now()}`), { fishboneData: F, selectedNode: I, selectedNodeType: L, history: ce, historyIndex: le, addCategory: de, updateCategory: fe, deleteCategory: pe, addCause: he, updateCause: ge, deleteCause: ve, addChild: ye, updateChild: be, deleteChild: xe, selectNode: Se, clearSelection: Ce, undo: R, redo: z, saveHistory: we } = sr(), B = () => {
|
|
4007
|
+
Ce(), H.value = null, U.value = null, J.value = null;
|
|
4008
|
+
}, V = v([]), H = v(null), U = v(null), Te = v(!1), Ee = v(!1), W = v(null), De = v(""), G = v(0), Oe = v(0), ke = v(0), Ae = v(0), je = v(0), Me = v(0), K = v(!1), q = v([]), J = v(null), Ne = v(null), Pe = v(!1), Fe = v(!1), Ie = v(!1), Le = v(""), Re = v(0), ze = v(0), { isConnected: He, isSynced: Ue, onlineUsers: Ge, doc: Ke, awareness: qe, initUser: Je, connect: Ye, disconnect: Xe, closeCollaboration: Ze, checkCollaborationClosed: Qe, collaborationClosed: $e, startSync: et, enableLocalPush: tt, stopSync: rt } = lr(oe.value, F, V, q), it = v(!1), at = v(!1), ot = v(!1), st = v([]), ct = null, lt = () => {
|
|
3938
4009
|
if (!F.value.title?.trim()) {
|
|
3939
|
-
|
|
4010
|
+
M.warning("请输入标题");
|
|
3940
4011
|
return;
|
|
3941
4012
|
}
|
|
3942
|
-
let e =
|
|
3943
|
-
|
|
3944
|
-
let t = `用户${Math.floor(Math.random() * 1e3)}`;
|
|
3945
|
-
|
|
3946
|
-
let n =
|
|
4013
|
+
let e = oe.value;
|
|
4014
|
+
Ye(e, h.wsUrl || void 0);
|
|
4015
|
+
let t = h.user?.name || `用户${Math.floor(Math.random() * 1e3)}`;
|
|
4016
|
+
Je({ name: t });
|
|
4017
|
+
let n = qe.value;
|
|
3947
4018
|
n.on("change", () => {
|
|
3948
|
-
|
|
4019
|
+
st.value = Array.from(n.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
|
|
3949
4020
|
clientId: e,
|
|
3950
4021
|
...t.user
|
|
3951
4022
|
}));
|
|
3952
|
-
}),
|
|
3953
|
-
ydoc:
|
|
4023
|
+
}), P.setCollabContext({
|
|
4024
|
+
ydoc: Ke,
|
|
3954
4025
|
provider: null,
|
|
3955
|
-
onlineUsers:
|
|
3956
|
-
}),
|
|
4026
|
+
onlineUsers: st
|
|
4027
|
+
}), P.setCurrentUser({
|
|
3957
4028
|
id: n.clientID,
|
|
3958
4029
|
name: t,
|
|
3959
4030
|
color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
|
|
3960
|
-
}),
|
|
3961
|
-
|
|
4031
|
+
}), it.value = !0, at.value = !0, ot.value = !1, ct = setInterval(() => {
|
|
4032
|
+
He.value && Ge.value;
|
|
3962
4033
|
}, 5e3);
|
|
3963
4034
|
let r = () => {
|
|
3964
|
-
|
|
4035
|
+
et();
|
|
3965
4036
|
};
|
|
3966
|
-
if (
|
|
4037
|
+
if (Ue.value) r();
|
|
3967
4038
|
else {
|
|
3968
|
-
let e =
|
|
4039
|
+
let e = T(() => Ue.value, (t) => {
|
|
3969
4040
|
t && (e(), r());
|
|
3970
4041
|
});
|
|
3971
4042
|
}
|
|
3972
4043
|
let i = `${window.location.origin}/fishbone-editor/${e}?collab=1`;
|
|
3973
4044
|
navigator.clipboard.writeText(i).then(() => {
|
|
3974
|
-
|
|
4045
|
+
M.success("协作已开启,分享链接已复制");
|
|
3975
4046
|
}).catch(() => {
|
|
3976
|
-
|
|
4047
|
+
M.success("协作已开启");
|
|
3977
4048
|
});
|
|
3978
|
-
},
|
|
3979
|
-
|
|
3980
|
-
},
|
|
3981
|
-
let e =
|
|
4049
|
+
}, dt = () => {
|
|
4050
|
+
ct &&= (clearInterval(ct), null), rt(), Ze(), it.value = !1, at.value = !1, ot.value = !1, M.info("协作已关闭");
|
|
4051
|
+
}, ft = async () => {
|
|
4052
|
+
let e = O.value;
|
|
3982
4053
|
if (!e) return;
|
|
3983
|
-
|
|
3984
|
-
let t = `协作人${Math.floor(Math.random() * 1e3)}`;
|
|
3985
|
-
|
|
3986
|
-
let n =
|
|
4054
|
+
Ye(e, h.wsUrl || void 0);
|
|
4055
|
+
let t = h.user?.name || `协作人${Math.floor(Math.random() * 1e3)}`;
|
|
4056
|
+
Je({ name: t });
|
|
4057
|
+
let n = qe.value;
|
|
3987
4058
|
n.on("change", () => {
|
|
3988
|
-
|
|
4059
|
+
st.value = Array.from(n.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
|
|
3989
4060
|
clientId: e,
|
|
3990
4061
|
...t.user
|
|
3991
4062
|
}));
|
|
3992
|
-
}),
|
|
3993
|
-
ydoc:
|
|
4063
|
+
}), P.setCollabContext({
|
|
4064
|
+
ydoc: Ke,
|
|
3994
4065
|
provider: null,
|
|
3995
|
-
onlineUsers:
|
|
3996
|
-
}),
|
|
4066
|
+
onlineUsers: st
|
|
4067
|
+
}), P.setCurrentUser({
|
|
3997
4068
|
id: n.clientID,
|
|
3998
4069
|
name: t,
|
|
3999
4070
|
color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
|
|
4000
4071
|
});
|
|
4001
4072
|
let r = (e) => {
|
|
4002
4073
|
if (e) {
|
|
4003
|
-
if (
|
|
4004
|
-
|
|
4074
|
+
if (Qe()) return Xe(), it.value = !1, ot.value = !1, M.warning("该协作已关闭,无法加入"), !0;
|
|
4075
|
+
tt();
|
|
4005
4076
|
}
|
|
4006
4077
|
return !1;
|
|
4007
4078
|
};
|
|
4008
|
-
if (
|
|
4079
|
+
if (Ue.value) r(!0);
|
|
4009
4080
|
else {
|
|
4010
|
-
let e =
|
|
4081
|
+
let e = T(() => Ue.value, (t) => {
|
|
4011
4082
|
e(), r(t);
|
|
4012
4083
|
});
|
|
4013
4084
|
}
|
|
4014
|
-
|
|
4015
|
-
|
|
4085
|
+
it.value = !0, ot.value = !0, at.value = !1, ct = setInterval(() => {
|
|
4086
|
+
He.value && Ge.value;
|
|
4016
4087
|
}, 5e3);
|
|
4017
|
-
},
|
|
4018
|
-
|
|
4019
|
-
},
|
|
4020
|
-
if (!
|
|
4021
|
-
|
|
4088
|
+
}, pt = () => {
|
|
4089
|
+
it.value ? dt() : lt();
|
|
4090
|
+
}, mt = async () => {
|
|
4091
|
+
if (!it.value) {
|
|
4092
|
+
lt();
|
|
4022
4093
|
return;
|
|
4023
4094
|
}
|
|
4024
|
-
let e = `${window.location.origin}/fishbone-editor/${
|
|
4095
|
+
let e = `${window.location.origin}/fishbone-editor/${oe.value}?collab=1`;
|
|
4025
4096
|
try {
|
|
4026
|
-
await navigator.clipboard.writeText(e),
|
|
4097
|
+
await navigator.clipboard.writeText(e), M.success("分享链接已复制到剪贴板");
|
|
4027
4098
|
} catch {
|
|
4028
|
-
|
|
4099
|
+
M.info(`分享链接: ${e}`);
|
|
4029
4100
|
}
|
|
4030
|
-
},
|
|
4101
|
+
}, ht = v(null), gt = v(null), _t = v(100), vt = v(!1), yt = v(null), bt = v("png"), Y = t(() => J.value && q.value.find((e) => e.id === J.value) || null), xt = v(!1);
|
|
4031
4102
|
v("");
|
|
4032
|
-
let
|
|
4103
|
+
let St = v(!1), Ct = v(null), wt = t(() => {
|
|
4033
4104
|
let e = [], t = F.value.categories || [], n = Math.max(t.length, 1), r = Math.max(600, n * 130) / (n + 1), i = (ut.find((e) => e.id === F.value.diagramStyle) || ut[0]).nodeHeight || 36;
|
|
4034
4105
|
return t.forEach((t, n) => {
|
|
4035
|
-
let a = 150 + r * (n + 1), o = n % 2 == 0 ? 100 - (i / 2 + 8) : 400 + (i / 2 + 8), s =
|
|
4106
|
+
let a = 150 + r * (n + 1), o = n % 2 == 0 ? 100 - (i / 2 + 8) : 400 + (i / 2 + 8), s = Nt(t.name, "category"), c = (t.style?.fontSize ?? 12) * 2 + 8, l = t.style?.dragDx || 0, u = t.style?.dragDy || 0, d = t.style?.anchorDx || 0, f = a + 30 + l, p = o + u;
|
|
4036
4107
|
e.push({
|
|
4037
4108
|
id: t.id,
|
|
4038
4109
|
type: "node",
|
|
@@ -4062,7 +4133,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4062
4133
|
});
|
|
4063
4134
|
let m = t.causes || [], h = (t.style?.fontSize ?? 12) - 2, g = a + d, _ = a + 30 + l, v = n % 2 == 0 ? 100 : 400;
|
|
4064
4135
|
m.forEach((t, n) => {
|
|
4065
|
-
let r =
|
|
4136
|
+
let r = Nt(t.text, "cause"), i = h * 2 + 6, a = t.style?.dragDx || 0, o = t.style?.dragDy || 0, s = m.length === 1 ? .5 : (n + 1) / (m.length + 1), c = t.style?.anchorT ?? s, l = g + (_ - g) * c, u = 250 + (v - 250) * c, d = t.direction || "left", f = l + (d === "left" ? -35 : 35) + a, p = u + o;
|
|
4066
4137
|
e.push({
|
|
4067
4138
|
id: t.id,
|
|
4068
4139
|
type: "node",
|
|
@@ -4092,7 +4163,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4092
4163
|
});
|
|
4093
4164
|
let y = t.children || [], b = Math.max(8, h - 2);
|
|
4094
4165
|
y.forEach((t, n) => {
|
|
4095
|
-
let i =
|
|
4166
|
+
let i = Nt(t.text, "cause"), a = b * 2 + 6, o = t.style?.dragDx || 0, s = t.style?.dragDy || 0, c = d === "left" ? f - r / 2 : f + r / 2, l = d === "left" ? c - (25 + n * 45) : c + (25 + n * 45), u = p + n * 25, m = l + o, h = u + s;
|
|
4096
4167
|
e.push({
|
|
4097
4168
|
id: t.id,
|
|
4098
4169
|
type: "node",
|
|
@@ -4123,33 +4194,33 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4123
4194
|
});
|
|
4124
4195
|
});
|
|
4125
4196
|
}), e;
|
|
4126
|
-
}),
|
|
4127
|
-
if (
|
|
4128
|
-
let e =
|
|
4197
|
+
}), Tt = t(() => {
|
|
4198
|
+
if (gt.value) {
|
|
4199
|
+
let e = gt.value.getViewBox();
|
|
4129
4200
|
if (e && e.w > 0 && e.h > 0) return `${e.x} ${e.y} ${e.w} ${e.h}`;
|
|
4130
4201
|
}
|
|
4131
4202
|
let e = F.value.categories || [], t = Math.max(e.length, 1), n = Math.max(600, t * 130), r = 150 + n, i = ut.find((e) => e.id === F.value.diagramStyle) || ut[0], a = i.nodeHeight || 36;
|
|
4132
4203
|
i.causeHeight;
|
|
4133
4204
|
let o = 30, s = 100, c = 250, l = 250;
|
|
4134
4205
|
return c = Math.min(c, 180), l = Math.max(l, 320), s = Math.max(s, r + 120), e.forEach((e, r) => {
|
|
4135
|
-
let i = 150 + n / (t + 1) * (r + 1), u = r % 2 == 0 ? 100 - (a / 2 + 8) : 400 + (a / 2 + 8), d =
|
|
4206
|
+
let i = 150 + n / (t + 1) * (r + 1), u = r % 2 == 0 ? 100 - (a / 2 + 8) : 400 + (a / 2 + 8), d = Nt(e.name, "category") / 2 + 20, f = r % 2 == 0 ? 100 : 400;
|
|
4136
4207
|
o = Math.min(o, i + 30 - d), s = Math.max(s, i + 30 + d + 40), c = Math.min(c, f, u - a / 2), l = Math.max(l, f, u + a / 2);
|
|
4137
4208
|
}), `${o - 60} ${c - 60} ${s - o + 120} ${l - c + 120}`;
|
|
4138
|
-
}),
|
|
4209
|
+
}), Et = (e) => ln({
|
|
4139
4210
|
x: 0,
|
|
4140
4211
|
y: 0,
|
|
4141
4212
|
width: e.width,
|
|
4142
4213
|
height: e.height
|
|
4143
|
-
}, 60).map((t) =>
|
|
4144
|
-
let e =
|
|
4214
|
+
}, 60).map((t) => Ot(e.x + t.x, e.y + t.y)), Dt = t(() => {
|
|
4215
|
+
let e = Tt.value.split(" ").map(Number);
|
|
4145
4216
|
return {
|
|
4146
4217
|
x: e[0] || 0,
|
|
4147
4218
|
y: e[1] || 0,
|
|
4148
4219
|
w: e[2] || 800,
|
|
4149
4220
|
h: e[3] || 500
|
|
4150
4221
|
};
|
|
4151
|
-
}),
|
|
4152
|
-
let n =
|
|
4222
|
+
}), Ot = (e, t) => {
|
|
4223
|
+
let n = gt.value?.getSvgElement(), r = ht.value?.querySelector(".canvas-wrapper");
|
|
4153
4224
|
if (n && r) {
|
|
4154
4225
|
let i = r.getBoundingClientRect(), a = e + i.left, o = t + i.top, s = n.createSVGPoint();
|
|
4155
4226
|
s.x = a, s.y = o;
|
|
@@ -4162,7 +4233,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4162
4233
|
};
|
|
4163
4234
|
}
|
|
4164
4235
|
}
|
|
4165
|
-
let i =
|
|
4236
|
+
let i = Dt.value;
|
|
4166
4237
|
return {
|
|
4167
4238
|
x: e / X.value.width * i.w + i.x,
|
|
4168
4239
|
y: t / X.value.height * i.h + i.y
|
|
@@ -4170,11 +4241,11 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4170
4241
|
}, X = v({
|
|
4171
4242
|
width: 800,
|
|
4172
4243
|
height: 600
|
|
4173
|
-
}),
|
|
4244
|
+
}), kt = v({
|
|
4174
4245
|
width: 800,
|
|
4175
4246
|
height: 600
|
|
4176
|
-
}),
|
|
4177
|
-
let e =
|
|
4247
|
+
}), jt = () => {
|
|
4248
|
+
let e = ht.value?.querySelector(".canvas-wrapper");
|
|
4178
4249
|
return e ? {
|
|
4179
4250
|
width: e.scrollWidth || e.offsetWidth || 800,
|
|
4180
4251
|
height: e.scrollHeight || e.offsetHeight || 600
|
|
@@ -4182,7 +4253,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4182
4253
|
width: 800,
|
|
4183
4254
|
height: 600
|
|
4184
4255
|
};
|
|
4185
|
-
},
|
|
4256
|
+
}, Mt = t(() => {
|
|
4186
4257
|
let e = {
|
|
4187
4258
|
ocean: {
|
|
4188
4259
|
primary: "#1E90FF",
|
|
@@ -4396,35 +4467,35 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4396
4467
|
}
|
|
4397
4468
|
};
|
|
4398
4469
|
return e[F.value.theme] || e.ocean;
|
|
4399
|
-
}),
|
|
4470
|
+
}), Pt = v(!1), Ft = t(() => !!I.value || L.value === "title" || !!H.value || !!J.value), Z = t(() => H.value && V.value.find((e) => e.id === H.value) || null), It = t(() => !!I.value || !!H.value), Lt = t(() => {
|
|
4400
4471
|
let e = F.value.titleStyle, t = { textAlign: e.textAlign }, n = e.bgColor, r = e.bgOpacity;
|
|
4401
4472
|
return n && r > 0 && (n.startsWith("#") && n.length >= 7 ? t.backgroundColor = `rgba(${parseInt(n.slice(1, 3), 16)}, ${parseInt(n.slice(3, 5), 16)}, ${parseInt(n.slice(5, 7), 16)}, ${r / 100})` : n.startsWith("rgb") && (t.backgroundColor = n)), t;
|
|
4402
|
-
}),
|
|
4473
|
+
}), Rt = t(() => {
|
|
4403
4474
|
let e = F.value.titleStyle;
|
|
4404
4475
|
return {
|
|
4405
4476
|
fontFamily: e.fontFamily,
|
|
4406
4477
|
fontSize: e.fontSize + "px",
|
|
4407
4478
|
color: e.color
|
|
4408
4479
|
};
|
|
4409
|
-
}),
|
|
4480
|
+
}), zt = () => {
|
|
4410
4481
|
document.activeElement?.blur(), u(() => document.activeElement?.blur()), I.value = { ...F.value.titleStyle }, L.value = "title";
|
|
4411
|
-
},
|
|
4412
|
-
c.push("/");
|
|
4413
|
-
},
|
|
4414
|
-
|
|
4415
|
-
},
|
|
4416
|
-
|
|
4417
|
-
},
|
|
4482
|
+
}, Bt = () => {
|
|
4483
|
+
h.docId || c.push("/");
|
|
4484
|
+
}, Vt = async (e) => {
|
|
4485
|
+
M.info("AI生成功能开发中,敬请期待...");
|
|
4486
|
+
}, Ht = () => {
|
|
4487
|
+
Se(de(), "category"), M.success("类别已添加");
|
|
4488
|
+
}, Ut = async (e) => {
|
|
4418
4489
|
try {
|
|
4419
|
-
await
|
|
4490
|
+
await ne.confirm("确定要删除此类别吗?", "提示", { type: "warning" }), pe(e), I.value?.id === e && Ce(), M.success("类别已删除");
|
|
4420
4491
|
} catch {}
|
|
4421
|
-
},
|
|
4422
|
-
!I.value || L.value !== "cause" ||
|
|
4423
|
-
},
|
|
4424
|
-
!I.value || L.value !== "cause" || (
|
|
4425
|
-
},
|
|
4426
|
-
if (document.activeElement?.blur(), u(() => document.activeElement?.blur()),
|
|
4427
|
-
|
|
4492
|
+
}, Wt = () => {
|
|
4493
|
+
!I.value || L.value !== "cause" || ye(I.value.categoryId, I.value.id, { direction: "left" }) && (M.success("措施已添加"), Q.value++);
|
|
4494
|
+
}, Gt = (e) => {
|
|
4495
|
+
!I.value || L.value !== "cause" || (xe(I.value.categoryId, I.value.id, e), M.success("子原因已删除"));
|
|
4496
|
+
}, Kt = (e) => {
|
|
4497
|
+
if (document.activeElement?.blur(), u(() => document.activeElement?.blur()), H.value = null, U.value = null, J.value = null, e.type === "head") {
|
|
4498
|
+
Ce();
|
|
4428
4499
|
return;
|
|
4429
4500
|
}
|
|
4430
4501
|
let t = null, n = e.type;
|
|
@@ -4448,8 +4519,8 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4448
4519
|
lineColor: "",
|
|
4449
4520
|
lineOpacity: 60,
|
|
4450
4521
|
lineStyle: "solid"
|
|
4451
|
-
}), t &&
|
|
4452
|
-
},
|
|
4522
|
+
}), t && Se(t, n);
|
|
4523
|
+
}, qt = (e) => {
|
|
4453
4524
|
let t = e.style || {}, n = t.bgColor || "#FFEB3B", r = (t.bgOpacity ?? 90) / 100, i = "rgba(255, 235, 59, 0.9)";
|
|
4454
4525
|
return n.startsWith("#") && n.length >= 7 && (i = `rgba(${parseInt(n.slice(1, 3), 16)}, ${parseInt(n.slice(3, 5), 16)}, ${parseInt(n.slice(5, 7), 16)}, ${r})`), {
|
|
4455
4526
|
position: "absolute",
|
|
@@ -4459,7 +4530,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4459
4530
|
height: e.height + "px",
|
|
4460
4531
|
background: i
|
|
4461
4532
|
};
|
|
4462
|
-
},
|
|
4533
|
+
}, Jt = (e) => {
|
|
4463
4534
|
let t = e.style || {}, n = t.fontStyle || "normal", r = "normal", i = "normal", a = "none";
|
|
4464
4535
|
return n === "bold" ? i = "bold" : n === "italic" ? r = "italic" : n === "bold italic" ? (i = "bold", r = "italic") : n === "underline" ? a = "underline" : n === "line-through" && (a = "line-through"), {
|
|
4465
4536
|
color: t.textColor || "#303133",
|
|
@@ -4470,7 +4541,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4470
4541
|
fontWeight: i,
|
|
4471
4542
|
textDecoration: a
|
|
4472
4543
|
};
|
|
4473
|
-
},
|
|
4544
|
+
}, Yt = () => {
|
|
4474
4545
|
let e = "textbox-" + Date.now(), t = X.value, n = t.width / 2 - 100, r = t.height / 2 - 40, i = {
|
|
4475
4546
|
id: e,
|
|
4476
4547
|
x: n,
|
|
@@ -4495,51 +4566,51 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4495
4566
|
textDecoration: "none"
|
|
4496
4567
|
}
|
|
4497
4568
|
};
|
|
4498
|
-
|
|
4499
|
-
},
|
|
4500
|
-
|
|
4501
|
-
},
|
|
4502
|
-
|
|
4503
|
-
},
|
|
4504
|
-
|
|
4569
|
+
V.value.push(i);
|
|
4570
|
+
}, Xt = (e) => {
|
|
4571
|
+
U.value === e.id && (U.value = null);
|
|
4572
|
+
}, Zt = (e, t) => {
|
|
4573
|
+
U.value === e.id && t.target.classList.contains("textbox-content") || (H.value = e.id, U.value = null, J.value = null, Ce(), Te.value = !0, W.value = e, G.value = t.clientX, Oe.value = t.clientY, ke.value = e.x, Ae.value = e.y, K.value = !1, document.addEventListener("mousemove", $t), document.addEventListener("mouseup", en), t.preventDefault());
|
|
4574
|
+
}, Qt = (e) => {
|
|
4575
|
+
U.value = e.id, u(() => {
|
|
4505
4576
|
let t = document.querySelector(`[data-textbox-id="${e.id}"] .textbox-content`);
|
|
4506
4577
|
t && t.focus();
|
|
4507
4578
|
});
|
|
4508
|
-
},
|
|
4509
|
-
if (!
|
|
4510
|
-
let t = (e.clientX -
|
|
4511
|
-
!
|
|
4512
|
-
},
|
|
4513
|
-
if (
|
|
4579
|
+
}, $t = (e) => {
|
|
4580
|
+
if (!Te.value || !W.value) return;
|
|
4581
|
+
let t = (e.clientX - G.value) / (_t.value / 100), n = (e.clientY - Oe.value) / (_t.value / 100);
|
|
4582
|
+
!K.value && Math.abs(t) < 3 && Math.abs(n) < 3 || (K.value = !0, W.value.x = ke.value + t, W.value.y = Ae.value + n);
|
|
4583
|
+
}, en = () => {
|
|
4584
|
+
if (Te.value = !1, W.value && K.value) {
|
|
4514
4585
|
let e = X.value;
|
|
4515
|
-
|
|
4586
|
+
W.value._xPercent = W.value.x / e.width, W.value._yPercent = W.value.y / e.height, W.value._hasPercent = !0;
|
|
4516
4587
|
}
|
|
4517
|
-
|
|
4518
|
-
},
|
|
4519
|
-
|
|
4520
|
-
},
|
|
4521
|
-
if (!
|
|
4522
|
-
let t = (e.clientX -
|
|
4523
|
-
r.includes("e") && (
|
|
4524
|
-
},
|
|
4525
|
-
if (
|
|
4588
|
+
K.value = !1, W.value = null, document.removeEventListener("mousemove", $t), document.removeEventListener("mouseup", en);
|
|
4589
|
+
}, tn = (e, t, n) => {
|
|
4590
|
+
Ee.value = !0, De.value = t, W.value = e, G.value = n.clientX, Oe.value = n.clientY, ke.value = e.x, Ae.value = e.y, je.value = e.width, Me.value = e.height, document.addEventListener("mousemove", nn), document.addEventListener("mouseup", rn), n.preventDefault();
|
|
4591
|
+
}, nn = (e) => {
|
|
4592
|
+
if (!Ee.value || !W.value) return;
|
|
4593
|
+
let t = (e.clientX - G.value) / (_t.value / 100), n = (e.clientY - Oe.value) / (_t.value / 100), r = De.value;
|
|
4594
|
+
r.includes("e") && (W.value.width = Math.max(50, je.value + t)), r.includes("w") && (W.value.x = ke.value + t, W.value.width = Math.max(50, je.value - t)), r.includes("s") && (W.value.height = Math.max(30, Me.value + n)), r.includes("n") && (W.value.y = Ae.value + n, W.value.height = Math.max(30, Me.value - n));
|
|
4595
|
+
}, rn = () => {
|
|
4596
|
+
if (Ee.value = !1, W.value) {
|
|
4526
4597
|
let e = X.value;
|
|
4527
|
-
|
|
4598
|
+
W.value._xPercent = W.value.x / e.width, W.value._yPercent = W.value.y / e.height, W.value._wPercent = W.value.width / e.width, W.value._hPercent = W.value.height / e.height, W.value._hasPercent = !0;
|
|
4528
4599
|
}
|
|
4529
|
-
|
|
4530
|
-
},
|
|
4531
|
-
let t =
|
|
4532
|
-
t >= 0 && (
|
|
4533
|
-
},
|
|
4534
|
-
if (!
|
|
4600
|
+
W.value = null, document.removeEventListener("mousemove", nn), document.removeEventListener("mouseup", rn);
|
|
4601
|
+
}, an = (e) => {
|
|
4602
|
+
let t = V.value.findIndex((t) => t.id === e);
|
|
4603
|
+
t >= 0 && (V.value.splice(t, 1), H.value = null, U.value = null);
|
|
4604
|
+
}, on = () => {
|
|
4605
|
+
if (!It.value) return;
|
|
4535
4606
|
let e = Z.value, t = I.value, n = X.value, r = "arrow-" + Date.now(), i, a, o, s, c = null, l = null, u = null;
|
|
4536
4607
|
if (e) {
|
|
4537
|
-
let t =
|
|
4608
|
+
let t = Ot(e.x + e.width, e.y + e.height / 2);
|
|
4538
4609
|
i = t.x, a = t.y, o = i + 150, s = a, c = e.id, l = "textbox", u = "border-15";
|
|
4539
4610
|
} else if (t) {
|
|
4540
|
-
let e = t.id, n =
|
|
4611
|
+
let e = t.id, n = wt.value.find((t) => t.id === e);
|
|
4541
4612
|
if (n) {
|
|
4542
|
-
let t =
|
|
4613
|
+
let t = un(n, "right", "node");
|
|
4543
4614
|
i = t.x, a = t.y, o = i + 150, s = a, c = e, l = "node", u = "right";
|
|
4544
4615
|
}
|
|
4545
4616
|
}
|
|
@@ -4573,14 +4644,14 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4573
4644
|
arrowEnd: !0
|
|
4574
4645
|
}
|
|
4575
4646
|
};
|
|
4576
|
-
|
|
4577
|
-
},
|
|
4578
|
-
let t =
|
|
4579
|
-
t >= 0 && (
|
|
4580
|
-
},
|
|
4647
|
+
q.value.push(d), J.value = r, H.value = null, I.value = null, L.value = null;
|
|
4648
|
+
}, sn = (e) => {
|
|
4649
|
+
let t = q.value.findIndex((t) => t.id === e);
|
|
4650
|
+
t >= 0 && (q.value.splice(t, 1), J.value = null);
|
|
4651
|
+
}, cn = (e) => {
|
|
4581
4652
|
let { startX: t, startY: n, endX: r, endY: i, cpX: a, cpY: o, style: s } = e;
|
|
4582
4653
|
return s.lineType === "curve" ? `M ${t} ${n} Q ${a} ${o} ${r} ${i}` : `M ${t} ${n} L ${r} ${i}`;
|
|
4583
|
-
},
|
|
4654
|
+
}, ln = (e, t = 30) => {
|
|
4584
4655
|
let { x: n, y: r, width: i, height: a } = e, o = [], s = 2 * (i + a);
|
|
4585
4656
|
for (let e = 0; e < t; e++) {
|
|
4586
4657
|
let c = e / t * s, l, u;
|
|
@@ -4591,16 +4662,16 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4591
4662
|
});
|
|
4592
4663
|
}
|
|
4593
4664
|
return o;
|
|
4594
|
-
},
|
|
4665
|
+
}, un = (e, t, n) => {
|
|
4595
4666
|
if (e.anchors && e.anchors[t]) return e.anchors[t];
|
|
4596
4667
|
if (n === "textbox" && t && t.startsWith("border-")) {
|
|
4597
|
-
let n = parseInt(t.split("-")[1]), r =
|
|
4668
|
+
let n = parseInt(t.split("-")[1]), r = ln({
|
|
4598
4669
|
x: 0,
|
|
4599
4670
|
y: 0,
|
|
4600
4671
|
width: e.width,
|
|
4601
4672
|
height: e.height
|
|
4602
4673
|
}, 60)[n];
|
|
4603
|
-
return r ?
|
|
4674
|
+
return r ? Ot(e.x + r.x, e.y + r.y) : null;
|
|
4604
4675
|
}
|
|
4605
4676
|
if (t === "top") return {
|
|
4606
4677
|
x: e.x + e.width / 2,
|
|
@@ -4620,30 +4691,30 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4620
4691
|
};
|
|
4621
4692
|
if (t && t.startsWith("border-")) {
|
|
4622
4693
|
let n = parseInt(t.split("-")[1]);
|
|
4623
|
-
return
|
|
4694
|
+
return ln(e)[n] || null;
|
|
4624
4695
|
}
|
|
4625
4696
|
return {
|
|
4626
4697
|
x: e.x,
|
|
4627
4698
|
y: e.y
|
|
4628
4699
|
};
|
|
4629
|
-
},
|
|
4700
|
+
}, dn = (e, t) => {
|
|
4630
4701
|
let n = t === "start" ? e.startX : e.endX, r = t === "start" ? e.startY : e.endY, i = 30, a = null, o = null, s = null, c = null;
|
|
4631
|
-
|
|
4632
|
-
|
|
4702
|
+
wt.value.forEach((e) => {
|
|
4703
|
+
ln(e).forEach((t, l) => {
|
|
4633
4704
|
let u = Math.hypot(n - t.x, r - t.y);
|
|
4634
4705
|
u < i && (i = u, a = t, o = e.id, s = "node", c = "border-" + l);
|
|
4635
4706
|
});
|
|
4636
|
-
}),
|
|
4637
|
-
|
|
4707
|
+
}), V.value.forEach((e) => {
|
|
4708
|
+
ln({
|
|
4638
4709
|
x: 0,
|
|
4639
4710
|
y: 0,
|
|
4640
4711
|
width: e.width,
|
|
4641
4712
|
height: e.height
|
|
4642
4713
|
}, 60).forEach((t, l) => {
|
|
4643
|
-
let u =
|
|
4714
|
+
let u = Ot(e.x + t.x, e.y + t.y), d = Math.hypot(n - u.x, r - u.y);
|
|
4644
4715
|
d < i && (i = d, a = u, o = e.id, s = "textbox", c = "border-" + l);
|
|
4645
4716
|
});
|
|
4646
|
-
}), a ? t === "start" ? (e.startX = a.x, e.startY = a.y, e.startConnectId = o, e.startConnectType = s, e.startAnchor = c) : (e.endX = a.x, e.endY = a.y, e.endConnectId = o, e.endConnectType = s, e.endAnchor = c) : t === "start" ? (e.startConnectId = null, e.startConnectType = null, e.startAnchor = null) : (e.endConnectId = null, e.endConnectType = null, e.endAnchor = null),
|
|
4717
|
+
}), a ? t === "start" ? (e.startX = a.x, e.startY = a.y, e.startConnectId = o, e.startConnectType = s, e.startAnchor = c) : (e.endX = a.x, e.endY = a.y, e.endConnectId = o, e.endConnectType = s, e.endAnchor = c) : t === "start" ? (e.startConnectId = null, e.startConnectType = null, e.startAnchor = null) : (e.endConnectId = null, e.endConnectType = null, e.endAnchor = null), V.value.forEach((e) => {
|
|
4647
4718
|
let t = {
|
|
4648
4719
|
top: {
|
|
4649
4720
|
x: e.x + e.width / 2,
|
|
@@ -4667,50 +4738,50 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4667
4738
|
u < i && (i = u, a = l, o = e.id, s = "textbox", c = t);
|
|
4668
4739
|
});
|
|
4669
4740
|
}), a ? t === "start" ? (e.startX = a.x, e.startY = a.y, e.startConnectId = o, e.startConnectType = s, e.startAnchor = c) : (e.endX = a.x, e.endY = a.y, e.endConnectId = o, e.endConnectType = s, e.endAnchor = c) : t === "start" ? (e.startConnectId = null, e.startConnectType = null, e.startAnchor = null) : (e.endConnectId = null, e.endConnectType = null, e.endAnchor = null);
|
|
4670
|
-
},
|
|
4741
|
+
}, fn = (e, t, n, r) => {
|
|
4671
4742
|
if (!Y.value) return;
|
|
4672
4743
|
let i = e;
|
|
4673
|
-
t === "node" && (i =
|
|
4674
|
-
let a =
|
|
4744
|
+
t === "node" && (i = wt.value.find((t) => t.id === e.id) || e);
|
|
4745
|
+
let a = un(i, n, t);
|
|
4675
4746
|
if (!a) return;
|
|
4676
4747
|
let o = Y.value;
|
|
4677
4748
|
Math.hypot(a.x - o.startX, a.y - o.startY) <= Math.hypot(a.x - o.endX, a.y - o.endY) ? (o.startX = a.x, o.startY = a.y, o.startConnectId = i.id, o.startConnectType = t, o.startAnchor = n) : (o.endX = a.x, o.endY = a.y, o.endConnectId = i.id, o.endConnectType = t, o.endAnchor = n);
|
|
4678
4749
|
let s = X.value;
|
|
4679
4750
|
o._startXP = o.startX / s.width, o._startYP = o.startY / s.height, o._endXP = o.endX / s.width, o._endYP = o.endY / s.height;
|
|
4680
|
-
},
|
|
4681
|
-
|
|
4751
|
+
}, pn = () => {
|
|
4752
|
+
q.value.forEach((e) => {
|
|
4682
4753
|
if (e.startConnectId) {
|
|
4683
4754
|
let t = null;
|
|
4684
|
-
if (e.startConnectType === "textbox" ? t =
|
|
4685
|
-
let n =
|
|
4755
|
+
if (e.startConnectType === "textbox" ? t = V.value.find((t) => t.id === e.startConnectId) : e.startConnectType === "node" && (t = wt.value.find((t) => t.id === e.startConnectId)), t && e.startAnchor) {
|
|
4756
|
+
let n = un(t, e.startAnchor, e.startConnectType);
|
|
4686
4757
|
n && (e.startX = n.x, e.startY = n.y);
|
|
4687
4758
|
}
|
|
4688
4759
|
}
|
|
4689
4760
|
if (e.endConnectId) {
|
|
4690
4761
|
let t = null;
|
|
4691
|
-
if (e.endConnectType === "textbox" ? t =
|
|
4692
|
-
let n =
|
|
4762
|
+
if (e.endConnectType === "textbox" ? t = V.value.find((t) => t.id === e.endConnectId) : e.endConnectType === "node" && (t = wt.value.find((t) => t.id === e.endConnectId)), t && e.endAnchor) {
|
|
4763
|
+
let n = un(t, e.endAnchor, e.endConnectType);
|
|
4693
4764
|
n && (e.endX = n.x, e.endY = n.y);
|
|
4694
4765
|
}
|
|
4695
4766
|
}
|
|
4696
4767
|
let t = X.value;
|
|
4697
4768
|
e._startXP = e.startX / t.width, e._startYP = e.startY / t.height, e._endXP = e.endX / t.width, e._endYP = e.endY / t.height;
|
|
4698
4769
|
});
|
|
4699
|
-
},
|
|
4700
|
-
|
|
4701
|
-
},
|
|
4702
|
-
if (!
|
|
4703
|
-
let t = (e.clientX -
|
|
4704
|
-
|
|
4705
|
-
},
|
|
4706
|
-
if ((
|
|
4707
|
-
|
|
4770
|
+
}, mn = (e, t, n) => {
|
|
4771
|
+
Pe.value = !0, St.value = !0, Le.value = t, J.value = e.id, Re.value = n.clientX, ze.value = n.clientY, document.addEventListener("mousemove", hn), document.addEventListener("mouseup", gn), n.preventDefault(), n.stopPropagation();
|
|
4772
|
+
}, hn = (e) => {
|
|
4773
|
+
if (!Pe.value && !Fe.value && !Ie.value || !Y.value) return;
|
|
4774
|
+
let t = (e.clientX - Re.value) / (_t.value / 100), n = (e.clientY - ze.value) / (_t.value / 100);
|
|
4775
|
+
Fe.value ? (Y.value.startX += t, Y.value.startY += n, Y.value.endX += t, Y.value.endY += n, Y.value.cpX += t, Y.value.cpY += n) : Le.value === "start" ? (Y.value.startX += t, Y.value.startY += n) : Le.value === "end" ? (Y.value.endX += t, Y.value.endY += n) : Le.value === "cp" && (Y.value.cpX += t, Y.value.cpY += n), Re.value = e.clientX, ze.value = e.clientY;
|
|
4776
|
+
}, gn = () => {
|
|
4777
|
+
if ((Pe.value || Fe.value || Ie.value) && Y.value) {
|
|
4778
|
+
Pe.value && (Le.value === "start" ? dn(Y.value, "start") : Le.value === "end" && dn(Y.value, "end"));
|
|
4708
4779
|
let e = X.value;
|
|
4709
4780
|
Y.value._startXP = Y.value.startX / e.width, Y.value._startYP = Y.value.startY / e.height, Y.value._endXP = Y.value.endX / e.width, Y.value._endYP = Y.value.endY / e.height, Y.value._cpXP = Y.value.cpX / e.width, Y.value._cpYP = Y.value.cpY / e.height;
|
|
4710
4781
|
}
|
|
4711
|
-
|
|
4712
|
-
},
|
|
4713
|
-
|
|
4782
|
+
Pe.value = !1, Fe.value = !1, Ie.value = !1, St.value = !1, Le.value = "", document.removeEventListener("mousemove", hn), document.removeEventListener("mouseup", gn);
|
|
4783
|
+
}, _n = (e, t) => {
|
|
4784
|
+
Fe.value = !0, J.value = e.id, Re.value = t.clientX, ze.value = t.clientY, document.addEventListener("mousemove", hn), document.addEventListener("mouseup", gn), t.preventDefault(), t.stopPropagation(), console.log("=== 选中箭头线,调试文本框锚点 ==="), V.value.forEach((e) => {
|
|
4714
4785
|
console.log(`文本框 [${e.id}]: CSS x=${e.x}, y=${e.y}, w=${e.width}, h=${e.height}`), [
|
|
4715
4786
|
{
|
|
4716
4787
|
name: "左上",
|
|
@@ -4732,7 +4803,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4732
4803
|
x: e.x,
|
|
4733
4804
|
y: e.y + e.height
|
|
4734
4805
|
}
|
|
4735
|
-
].forEach((e) => console.log(` 角 ${e.name}: CSS(${e.x.toFixed(1)}, ${e.y.toFixed(1)}) → SVG(${
|
|
4806
|
+
].forEach((e) => console.log(` 角 ${e.name}: CSS(${e.x.toFixed(1)}, ${e.y.toFixed(1)}) → SVG(${Ot(e.x, e.y).x.toFixed(1)}, ${Ot(e.x, e.y).y.toFixed(1)})`));
|
|
4736
4807
|
let t = {
|
|
4737
4808
|
top: {
|
|
4738
4809
|
x: e.x + e.width / 2,
|
|
@@ -4751,15 +4822,15 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4751
4822
|
y: e.y + e.height / 2
|
|
4752
4823
|
}
|
|
4753
4824
|
};
|
|
4754
|
-
Object.entries(t).forEach(([e, t]) => console.log(` 锚点 ${e}: CSS(${t.x.toFixed(1)}, ${t.y.toFixed(1)}) → SVG(${
|
|
4755
|
-
}), console.log("viewBox:",
|
|
4756
|
-
},
|
|
4757
|
-
|
|
4758
|
-
},
|
|
4759
|
-
F.value.theme = e,
|
|
4760
|
-
},
|
|
4761
|
-
F.value.diagramStyle = e, Q.value++,
|
|
4762
|
-
},
|
|
4825
|
+
Object.entries(t).forEach(([e, t]) => console.log(` 锚点 ${e}: CSS(${t.x.toFixed(1)}, ${t.y.toFixed(1)}) → SVG(${Ot(t.x, t.y).x.toFixed(1)}, ${Ot(t.x, t.y).y.toFixed(1)})`));
|
|
4826
|
+
}), console.log("viewBox:", Tt.value), console.log("canvasSize:", X.value);
|
|
4827
|
+
}, vn = (e, t) => {
|
|
4828
|
+
Ie.value = !0, Le.value = "cp", J.value = e.id, Re.value = t.clientX, ze.value = t.clientY, document.addEventListener("mousemove", hn), document.addEventListener("mouseup", gn), t.preventDefault(), t.stopPropagation();
|
|
4829
|
+
}, yn = (e) => {
|
|
4830
|
+
F.value.theme = e, M.success("主题已切换");
|
|
4831
|
+
}, bn = (e) => {
|
|
4832
|
+
F.value.diagramStyle = e, Q.value++, M.success("样式已切换");
|
|
4833
|
+
}, xn = async (e) => {
|
|
4763
4834
|
let t = {
|
|
4764
4835
|
category: "类别",
|
|
4765
4836
|
cause: "原因",
|
|
@@ -4767,40 +4838,40 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4767
4838
|
measure: "措施"
|
|
4768
4839
|
}[e.type] || "节点";
|
|
4769
4840
|
try {
|
|
4770
|
-
if (await
|
|
4841
|
+
if (await ne.confirm(`确定要删除此${t}吗?`, "删除确认", {
|
|
4771
4842
|
confirmButtonText: "确定",
|
|
4772
4843
|
cancelButtonText: "取消",
|
|
4773
4844
|
type: "warning"
|
|
4774
|
-
}), e.type === "category")
|
|
4775
|
-
else if (e.type === "cause")
|
|
4845
|
+
}), e.type === "category") pe(e.id);
|
|
4846
|
+
else if (e.type === "cause") ve(e.catIndex === void 0 ? "" : F.value.categories[e.catIndex]?.id, e.id);
|
|
4776
4847
|
else if (e.type === "child") {
|
|
4777
|
-
|
|
4848
|
+
we();
|
|
4778
4849
|
let t = F.value.categories[e.catIndex]?.causes?.[e.causeIndex];
|
|
4779
4850
|
if (t?.children) {
|
|
4780
4851
|
let n = t.children.findIndex((t) => t.id === e.id);
|
|
4781
4852
|
n !== -1 && t.children.splice(n, 1);
|
|
4782
4853
|
}
|
|
4783
4854
|
} else if (e.type === "measure") {
|
|
4784
|
-
|
|
4855
|
+
we();
|
|
4785
4856
|
let t = F.value.categories[e.catIndex]?.causes?.[e.causeIndex];
|
|
4786
4857
|
if (t?.children) {
|
|
4787
4858
|
let n = t.children.findIndex((t) => t.id === e.id);
|
|
4788
4859
|
n !== -1 && t.children.splice(n, 1);
|
|
4789
4860
|
}
|
|
4790
4861
|
}
|
|
4791
|
-
I.value?.id === e.id &&
|
|
4862
|
+
I.value?.id === e.id && Ce(), Q.value++, M.success("已删除");
|
|
4792
4863
|
} catch {}
|
|
4793
|
-
},
|
|
4864
|
+
}, Sn = v(!1), Cn = v({
|
|
4794
4865
|
text: "",
|
|
4795
4866
|
direction: "left",
|
|
4796
4867
|
parentType: "",
|
|
4797
4868
|
parentId: "",
|
|
4798
4869
|
catIndex: 0,
|
|
4799
4870
|
causeIndex: 0
|
|
4800
|
-
}),
|
|
4871
|
+
}), wn = (e) => {
|
|
4801
4872
|
let { type: t, catIndex: n, causeIndex: r, measureIndex: i, dx: a, dy: o } = e, s = F.value.categories[n];
|
|
4802
4873
|
if (s) {
|
|
4803
|
-
if (
|
|
4874
|
+
if (we(), t === "cat") s.style ||= {}, s.style.dragDx = a, s.style.dragDy = o;
|
|
4804
4875
|
else if (t === "anchor") s.style ||= {}, s.style.anchorDx = a;
|
|
4805
4876
|
else if (t === "cause") {
|
|
4806
4877
|
let e = s.causes?.[r];
|
|
@@ -4809,27 +4880,27 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4809
4880
|
let e = (s.causes?.[r])?.children?.[i];
|
|
4810
4881
|
e && (e.style ||= {}, e.style.dragDx = a, e.style.dragDy = o);
|
|
4811
4882
|
}
|
|
4812
|
-
Q.value++, u(() =>
|
|
4883
|
+
Q.value++, u(() => pn());
|
|
4813
4884
|
}
|
|
4814
|
-
},
|
|
4815
|
-
|
|
4885
|
+
}, Tn = (e) => {
|
|
4886
|
+
Cn.value = {
|
|
4816
4887
|
text: "",
|
|
4817
4888
|
direction: "left",
|
|
4818
4889
|
parentType: e.type,
|
|
4819
4890
|
parentId: e.id,
|
|
4820
4891
|
catIndex: e.catIndex ?? 0,
|
|
4821
4892
|
causeIndex: e.causeIndex ?? 0
|
|
4822
|
-
},
|
|
4823
|
-
},
|
|
4824
|
-
if (!
|
|
4825
|
-
|
|
4893
|
+
}, Sn.value = !0;
|
|
4894
|
+
}, En = () => {
|
|
4895
|
+
if (!Cn.value.text.trim()) {
|
|
4896
|
+
M.warning("请输入子节点名称");
|
|
4826
4897
|
return;
|
|
4827
4898
|
}
|
|
4828
|
-
let { parentType: e, catIndex: t, causeIndex: n, text: r, direction: i } =
|
|
4899
|
+
let { parentType: e, catIndex: t, causeIndex: n, text: r, direction: i } = Cn.value, a = F.value.categories[t];
|
|
4829
4900
|
if (!a) return;
|
|
4830
4901
|
let o = null, s = "";
|
|
4831
4902
|
if (e === "category") {
|
|
4832
|
-
|
|
4903
|
+
we(), a.causes ||= [];
|
|
4833
4904
|
let e = {
|
|
4834
4905
|
id: `cause-${Date.now()}`,
|
|
4835
4906
|
text: r,
|
|
@@ -4852,7 +4923,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4852
4923
|
};
|
|
4853
4924
|
a.causes.push(e), o = e, s = "cause";
|
|
4854
4925
|
} else if (e === "cause") {
|
|
4855
|
-
|
|
4926
|
+
we();
|
|
4856
4927
|
let e = a.causes?.[n];
|
|
4857
4928
|
if (e) {
|
|
4858
4929
|
e.children ||= [];
|
|
@@ -4877,28 +4948,28 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4877
4948
|
e.children.push(t), o = t, s = "measure";
|
|
4878
4949
|
}
|
|
4879
4950
|
}
|
|
4880
|
-
|
|
4881
|
-
},
|
|
4882
|
-
|
|
4883
|
-
},
|
|
4884
|
-
|
|
4885
|
-
},
|
|
4886
|
-
|
|
4887
|
-
},
|
|
4888
|
-
if (
|
|
4889
|
-
|
|
4951
|
+
Sn.value = !1, o && Se(o, s), Q.value++, M.success("已添加");
|
|
4952
|
+
}, Dn = () => {
|
|
4953
|
+
_t.value = Math.min(200, _t.value + 10);
|
|
4954
|
+
}, On = () => {
|
|
4955
|
+
_t.value = Math.max(50, _t.value - 10);
|
|
4956
|
+
}, kn = () => {
|
|
4957
|
+
_t.value = 100;
|
|
4958
|
+
}, An = async () => {
|
|
4959
|
+
if (ot.value && $e.value) {
|
|
4960
|
+
M.error("协作已关闭,无法提交保存");
|
|
4890
4961
|
return;
|
|
4891
4962
|
}
|
|
4892
4963
|
if (!F.value.title?.trim()) {
|
|
4893
|
-
|
|
4964
|
+
M.warning("请输入标题");
|
|
4894
4965
|
return;
|
|
4895
4966
|
}
|
|
4896
4967
|
if (!F.value.effect?.trim()) {
|
|
4897
|
-
|
|
4968
|
+
M.warning("请输入问题/结果");
|
|
4898
4969
|
return;
|
|
4899
4970
|
}
|
|
4900
4971
|
if (!F.value.author?.trim()) {
|
|
4901
|
-
|
|
4972
|
+
M.warning("请输入作者");
|
|
4902
4973
|
return;
|
|
4903
4974
|
}
|
|
4904
4975
|
try {
|
|
@@ -4906,51 +4977,55 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4906
4977
|
title: F.value.title,
|
|
4907
4978
|
content: JSON.stringify({
|
|
4908
4979
|
...F.value,
|
|
4909
|
-
textBoxes:
|
|
4910
|
-
arrowLines:
|
|
4980
|
+
textBoxes: V.value,
|
|
4981
|
+
arrowLines: q.value
|
|
4911
4982
|
}),
|
|
4912
4983
|
doc_type: "fishbone",
|
|
4913
4984
|
status: 2
|
|
4914
|
-
};
|
|
4915
|
-
if (
|
|
4985
|
+
}, t = F.value.id || O.value, n = typeof h.saveApi == "function" ? h.saveApi : h.saveApi ? (e) => t ? N.put(`${h.saveApi}/${t}`, e) : N.post(h.saveApi, e) : null;
|
|
4986
|
+
if (n) {
|
|
4987
|
+
let r = await n(e, t);
|
|
4988
|
+
F.value.id = r.data?.id || t;
|
|
4989
|
+
} else if (t) await A.value.update(t, e), F.value.id = t;
|
|
4916
4990
|
else {
|
|
4917
|
-
let t = await
|
|
4918
|
-
F.value.id = t.data.id;
|
|
4991
|
+
let t = await A.value.create(e);
|
|
4992
|
+
F.value.id = t.data.id, h.docId || c.replace(`/fishbone-editor/${t.data.id}`);
|
|
4919
4993
|
}
|
|
4920
|
-
|
|
4994
|
+
M.success("保存成功"), ae({
|
|
4921
4995
|
documentId: F.value.id,
|
|
4922
4996
|
docType: "fishbone",
|
|
4923
4997
|
content: JSON.stringify({
|
|
4924
4998
|
...F.value,
|
|
4925
|
-
textBoxes:
|
|
4926
|
-
arrowLines:
|
|
4999
|
+
textBoxes: V.value,
|
|
5000
|
+
arrowLines: q.value
|
|
4927
5001
|
}),
|
|
4928
|
-
userId: String(
|
|
4929
|
-
userName:
|
|
5002
|
+
userId: String(P.currentUser.value?.id || ""),
|
|
5003
|
+
userName: P.currentUser.value?.name || "未知"
|
|
4930
5004
|
});
|
|
4931
5005
|
} catch (e) {
|
|
4932
|
-
|
|
5006
|
+
M.error("保存失败"), console.error(e);
|
|
4933
5007
|
}
|
|
4934
|
-
},
|
|
4935
|
-
|
|
4936
|
-
},
|
|
4937
|
-
|
|
4938
|
-
},
|
|
5008
|
+
}, jn = (e) => {
|
|
5009
|
+
bt.value = e || "png", yt.value = gt.value?.getSvgElement(), vt.value = !0;
|
|
5010
|
+
}, Mn = ({ format: e, filename: t }) => {
|
|
5011
|
+
M.success(`已导出: ${t}`);
|
|
5012
|
+
}, Nn = (e) => {
|
|
4939
5013
|
let { catIndex: t, causeIndex: n, measureIndex: r } = e, i = (F.value.categories[t]?.causes?.[n])?.children?.[r];
|
|
4940
|
-
i &&
|
|
4941
|
-
},
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
5014
|
+
i && M.info(`思维导图功能开发中: ${i.text}`);
|
|
5015
|
+
}, Pn = async () => {
|
|
5016
|
+
let e = O.value;
|
|
5017
|
+
if (e && !String(e).startsWith("fishbone-")) try {
|
|
5018
|
+
let t;
|
|
5019
|
+
if (t = typeof h.loadApi == "function" ? await h.loadApi(e) : h.loadApi ? await N.get(`${h.loadApi}/${e}`) : await A.value.get(e), t.data?.content) {
|
|
5020
|
+
let e = JSON.parse(t.data.content);
|
|
5021
|
+
Object.assign(F.value, e), e.textBoxes && (V.value = e.textBoxes, u(() => {
|
|
4947
5022
|
let e = X.value;
|
|
4948
|
-
|
|
5023
|
+
V.value.forEach((t) => {
|
|
4949
5024
|
t._hasPercent ||= (t._xPercent = t.x / e.width, t._yPercent = t.y / e.height, t._wPercent = t.width / e.width, t._hPercent = t.height / e.height, !0);
|
|
4950
5025
|
});
|
|
4951
|
-
})),
|
|
5026
|
+
})), e.arrowLines && (q.value = e.arrowLines, u(() => {
|
|
4952
5027
|
let e = X.value;
|
|
4953
|
-
|
|
5028
|
+
q.value.forEach((t) => {
|
|
4954
5029
|
t._startXP === void 0 && (t._startXP = t.startX / e.width, t._startYP = t.startY / e.height, t._endXP = t.endX / e.width, t._endYP = t.endY / e.height), t._cpXP === void 0 && (t.cpX = t.cpX ?? (t.startX + t.endX) / 2, t.cpY = t.cpY ?? (t.startY + t.endY) / 2 - 60, t._cpXP = t.cpX / e.width, t._cpYP = t.cpY / e.height);
|
|
4955
5030
|
});
|
|
4956
5031
|
}));
|
|
@@ -4959,36 +5034,36 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4959
5034
|
console.error("加载文档失败:", e);
|
|
4960
5035
|
}
|
|
4961
5036
|
}, Q = v(0);
|
|
4962
|
-
|
|
5037
|
+
T(() => F.value.categories, () => {
|
|
4963
5038
|
Q.value++;
|
|
4964
|
-
}, { deep: !0 }),
|
|
5039
|
+
}, { deep: !0 }), T(I, () => {
|
|
4965
5040
|
u(() => {
|
|
4966
5041
|
let e = document.activeElement;
|
|
4967
5042
|
e && e.tagName !== "BODY" && e.blur();
|
|
4968
5043
|
});
|
|
4969
|
-
}),
|
|
4970
|
-
|
|
4971
|
-
}, { deep: !0 }),
|
|
4972
|
-
|
|
4973
|
-
}, { deep: !0 }),
|
|
4974
|
-
|
|
5044
|
+
}), T(V, () => {
|
|
5045
|
+
pn();
|
|
5046
|
+
}, { deep: !0 }), T(() => F.value.categories, () => {
|
|
5047
|
+
pn();
|
|
5048
|
+
}, { deep: !0 }), T(wt, () => {
|
|
5049
|
+
pn();
|
|
4975
5050
|
}, { deep: !0 });
|
|
4976
|
-
let
|
|
5051
|
+
let Fn = () => {
|
|
4977
5052
|
u(() => {
|
|
4978
|
-
let e =
|
|
5053
|
+
let e = jt();
|
|
4979
5054
|
if (e.width > 0 && e.height > 0) {
|
|
4980
5055
|
let t = X.value.width, n = X.value.height;
|
|
4981
|
-
t > 0 && n > 0 && (Math.abs(e.width - t) > 1 || Math.abs(e.height - n) > 1) && (
|
|
5056
|
+
t > 0 && n > 0 && (Math.abs(e.width - t) > 1 || Math.abs(e.height - n) > 1) && (V.value.forEach((r) => {
|
|
4982
5057
|
r._xPercent = r._xPercent ?? r.x / t, r._yPercent = r._yPercent ?? r.y / n, r._wPercent = r._wPercent ?? r.width / t, r._hPercent = r._hPercent ?? r.height / n, r._hasPercent = !0, r.x = r._xPercent * e.width, r.y = r._yPercent * e.height, r.width = Math.max(50, r._wPercent * e.width), r.height = Math.max(30, r._hPercent * e.height);
|
|
4983
|
-
}),
|
|
5058
|
+
}), q.value.forEach((r) => {
|
|
4984
5059
|
r._startXP = r._startXP ?? r.startX / t, r._startYP = r._startYP ?? r.startY / n, r._endXP = r._endXP ?? r.endX / t, r._endYP = r._endYP ?? r.endY / n, r._cpXP = r._cpXP ?? r.cpX / t, r._cpYP = r._cpYP ?? r.cpY / n, r.startX = r._startXP * e.width, r.startY = r._startYP * e.height, r.endX = r._endXP * e.width, r.endY = r._endYP * e.height, r.cpX = r._cpXP * e.width, r.cpY = r._cpYP * e.height;
|
|
4985
5060
|
})), X.value = {
|
|
4986
5061
|
width: e.width,
|
|
4987
5062
|
height: e.height
|
|
4988
|
-
},
|
|
5063
|
+
}, pn();
|
|
4989
5064
|
}
|
|
4990
5065
|
});
|
|
4991
|
-
},
|
|
5066
|
+
}, In = [
|
|
4992
5067
|
"我可以帮您分析鱼骨图结构、梳理因果关系,或者提供问题分析思路。请问有什么需要帮助的?",
|
|
4993
5068
|
"这个鱼骨图的分类很全面。建议检查每个主分支下的子原因是否充分,有没有遗漏的关键因素。",
|
|
4994
5069
|
"根据当前的问题定义,我建议从人、机、料、法、环、测六个维度全面分析可能的根本原因。",
|
|
@@ -4997,46 +5072,46 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
4997
5072
|
"建议对每个主要原因添加权重或优先级标注,这样可以帮助团队聚焦最关键的问题。",
|
|
4998
5073
|
"这个鱼骨图的分析框架不错。建议在关键原因节点添加数据和证据支持,增强分析的说服力。",
|
|
4999
5074
|
"我可以帮您将鱼骨图的分析结果转化为改进计划或解决方案文档。"
|
|
5000
|
-
],
|
|
5001
|
-
let n =
|
|
5002
|
-
await
|
|
5075
|
+
], Ln = async (e, t = {}) => {
|
|
5076
|
+
let n = O.value ? `${ai}-${O.value}` : null;
|
|
5077
|
+
await P.sendMessage(e, {
|
|
5003
5078
|
...t,
|
|
5004
5079
|
roomId: n
|
|
5005
5080
|
});
|
|
5006
|
-
let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a =
|
|
5007
|
-
(!r || i || a.length === 0) && (
|
|
5008
|
-
|
|
5081
|
+
let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a = P.collabUsers.value.filter((e) => e.name !== P.currentUser.value.name);
|
|
5082
|
+
(!r || i || a.length === 0) && (P.loading.value = !0, setTimeout(() => {
|
|
5083
|
+
P.sendAiMessage(In[Math.floor(Math.random() * In.length)], n), P.loading.value = !1;
|
|
5009
5084
|
}, 800 + Math.random() * 1200));
|
|
5010
|
-
},
|
|
5011
|
-
let e =
|
|
5012
|
-
|
|
5013
|
-
},
|
|
5085
|
+
}, Rn = () => {
|
|
5086
|
+
let e = O.value ? `${ai}-${O.value}` : null;
|
|
5087
|
+
P.clearMessages(e);
|
|
5088
|
+
}, zn = () => {
|
|
5014
5089
|
if (!F.value.id) {
|
|
5015
|
-
|
|
5090
|
+
M.warning("请先保存文档");
|
|
5016
5091
|
return;
|
|
5017
5092
|
}
|
|
5018
|
-
|
|
5019
|
-
},
|
|
5093
|
+
ie.value = !0;
|
|
5094
|
+
}, Bn = (e) => {
|
|
5020
5095
|
try {
|
|
5021
5096
|
let t = typeof e == "string" ? JSON.parse(e) : e;
|
|
5022
|
-
Object.assign(F.value, t), t.textBoxes && (
|
|
5097
|
+
Object.assign(F.value, t), t.textBoxes && (V.value = t.textBoxes), t.arrowLines && (q.value = t.arrowLines);
|
|
5023
5098
|
} catch (e) {
|
|
5024
5099
|
console.error("Version apply error:", e);
|
|
5025
5100
|
}
|
|
5026
5101
|
};
|
|
5027
5102
|
return m(() => {
|
|
5028
|
-
let e = localStorage.getItem("editor-user-name") || `用户${Math.floor(Math.random() * 1e3)}`;
|
|
5029
|
-
localStorage.setItem("editor-user-name", e),
|
|
5103
|
+
let e = h.user?.name || localStorage.getItem("editor-user-name") || `用户${Math.floor(Math.random() * 1e3)}`;
|
|
5104
|
+
localStorage.setItem("editor-user-name", e), P.setCurrentUser({
|
|
5030
5105
|
id: Date.now(),
|
|
5031
5106
|
name: e,
|
|
5032
5107
|
color: "#409eff"
|
|
5033
|
-
}),
|
|
5034
|
-
l.query.collab === "1" &&
|
|
5108
|
+
}), Je({ name: e }), Pn().then(() => {
|
|
5109
|
+
l.query.collab === "1" && O.value && ft();
|
|
5035
5110
|
}), u(() => {
|
|
5036
|
-
let e =
|
|
5037
|
-
X.value = { ...e },
|
|
5038
|
-
let t =
|
|
5039
|
-
t && new ResizeObserver(() =>
|
|
5111
|
+
let e = jt();
|
|
5112
|
+
X.value = { ...e }, kt.value = { ...e };
|
|
5113
|
+
let t = ht.value;
|
|
5114
|
+
t && new ResizeObserver(() => Fn()).observe(t);
|
|
5040
5115
|
});
|
|
5041
5116
|
}), m(() => {
|
|
5042
5117
|
document.addEventListener("mousedown", (e) => {
|
|
@@ -5045,14 +5120,14 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5045
5120
|
});
|
|
5046
5121
|
}), m(() => {
|
|
5047
5122
|
document.addEventListener("keydown", (e) => {
|
|
5048
|
-
e.ctrlKey || e.metaKey ? e.key === "z" ? (e.preventDefault(),
|
|
5123
|
+
e.ctrlKey || e.metaKey ? e.key === "z" ? (e.preventDefault(), R()) : e.key === "y" ? (e.preventDefault(), z()) : e.key === "s" && (e.preventDefault(), An()) : (e.key === "Delete" || e.key === "Backspace") && I.value && L.value === "category" && Ut(I.value.id);
|
|
5049
5124
|
});
|
|
5050
5125
|
}), p(() => {
|
|
5051
|
-
|
|
5126
|
+
ct &&= (clearInterval(ct), null), document.removeEventListener("mousemove", $t), document.removeEventListener("mouseup", en), document.removeEventListener("mousemove", nn), document.removeEventListener("mouseup", rn), document.removeEventListener("mousemove", hn), document.removeEventListener("mouseup", gn), Fn && window.removeEventListener("resize", Fn);
|
|
5052
5127
|
}), (t, n) => {
|
|
5053
|
-
let c = b("el-icon"), l = b("el-button"), u = b("el-input"), p = b("el-form-item"), m = b("el-option"),
|
|
5128
|
+
let c = b("el-icon"), l = b("el-button"), u = b("el-input"), p = b("el-form-item"), m = b("el-option"), h = b("el-select"), v = b("el-slider"), T = b("el-color-picker"), O = b("el-radio-button"), A = b("el-radio-group"), te = b("el-form"), j = b("el-divider"), M = b("el-checkbox"), ne = b("el-tag"), N = b("el-dialog");
|
|
5054
5129
|
return g(), i("div", { class: d(["fishbone-editor", `theme-${S(F).theme}`]) }, [
|
|
5055
|
-
s(
|
|
5130
|
+
s(At, {
|
|
5056
5131
|
title: S(F).title,
|
|
5057
5132
|
"onUpdate:title": n[0] ||= (e) => S(F).title = e,
|
|
5058
5133
|
effect: S(F).effect,
|
|
@@ -5061,32 +5136,35 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5061
5136
|
"onUpdate:author": n[2] ||= (e) => S(F).author = e,
|
|
5062
5137
|
"current-theme": S(F).theme,
|
|
5063
5138
|
"current-diagram-style": S(F).diagramStyle,
|
|
5064
|
-
zoom:
|
|
5065
|
-
"can-undo": S(
|
|
5066
|
-
"can-redo": S(
|
|
5139
|
+
zoom: _t.value,
|
|
5140
|
+
"can-undo": S(le) > 0,
|
|
5141
|
+
"can-redo": S(le) < S(ce).length - 1,
|
|
5067
5142
|
"can-add-cause": S(F).categories.length > 0,
|
|
5068
|
-
"is-connected":
|
|
5069
|
-
"online-users": S(
|
|
5070
|
-
"online-count": S(
|
|
5071
|
-
onBack:
|
|
5072
|
-
onAddTextBox:
|
|
5073
|
-
"can-add-arrow":
|
|
5074
|
-
onAddArrow:
|
|
5075
|
-
onUndo: S(
|
|
5076
|
-
onRedo: S(
|
|
5077
|
-
onZoomIn:
|
|
5078
|
-
onZoomOut:
|
|
5079
|
-
onFitView:
|
|
5080
|
-
onSelectTheme:
|
|
5081
|
-
onSelectStyle:
|
|
5082
|
-
onSave:
|
|
5083
|
-
onExport:
|
|
5084
|
-
onToggleCollab:
|
|
5085
|
-
onShareCollab:
|
|
5086
|
-
onAiGenerate:
|
|
5087
|
-
readonly:
|
|
5143
|
+
"is-connected": it.value,
|
|
5144
|
+
"online-users": S(Ge),
|
|
5145
|
+
"online-count": S(Ge).length,
|
|
5146
|
+
onBack: Bt,
|
|
5147
|
+
onAddTextBox: Yt,
|
|
5148
|
+
"can-add-arrow": It.value,
|
|
5149
|
+
onAddArrow: on,
|
|
5150
|
+
onUndo: S(R),
|
|
5151
|
+
onRedo: S(z),
|
|
5152
|
+
onZoomIn: Dn,
|
|
5153
|
+
onZoomOut: On,
|
|
5154
|
+
onFitView: kn,
|
|
5155
|
+
onSelectTheme: yn,
|
|
5156
|
+
onSelectStyle: bn,
|
|
5157
|
+
onSave: An,
|
|
5158
|
+
onExport: jn,
|
|
5159
|
+
onToggleCollab: pt,
|
|
5160
|
+
onShareCollab: mt,
|
|
5161
|
+
onAiGenerate: Vt,
|
|
5162
|
+
readonly: ot.value && !at.value,
|
|
5163
|
+
"back-button": _.value.backButton,
|
|
5164
|
+
"title-editable": _.value.titleEditable,
|
|
5165
|
+
"author-editable": _.value.authorEditable,
|
|
5088
5166
|
"show-history": !!S(F).id,
|
|
5089
|
-
onHistory:
|
|
5167
|
+
onHistory: zn
|
|
5090
5168
|
}, null, 8, [
|
|
5091
5169
|
"title",
|
|
5092
5170
|
"effect",
|
|
@@ -5104,82 +5182,85 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5104
5182
|
"onUndo",
|
|
5105
5183
|
"onRedo",
|
|
5106
5184
|
"readonly",
|
|
5185
|
+
"back-button",
|
|
5186
|
+
"title-editable",
|
|
5187
|
+
"author-editable",
|
|
5107
5188
|
"show-history"
|
|
5108
5189
|
]),
|
|
5109
|
-
a("div",
|
|
5110
|
-
a("div", { class: d(["side-panel left-panel", { collapsed: !
|
|
5190
|
+
a("div", pr, [
|
|
5191
|
+
a("div", { class: d(["side-panel left-panel", { collapsed: !Pt.value }]) }, [a("div", {
|
|
5111
5192
|
class: "panel-header",
|
|
5112
|
-
onClick: n[3] ||= (e) =>
|
|
5193
|
+
onClick: n[3] ||= (e) => Pt.value = !Pt.value,
|
|
5113
5194
|
style: { cursor: "pointer" }
|
|
5114
|
-
}, [a("h4", null, x(
|
|
5195
|
+
}, [a("h4", null, x(Pt.value ? "类别列表" : ""), 1), a("span", mr, x(Pt.value ? "«" : "»"), 1)]), D(a("div", hr, [(g(!0), i(e, null, y(S(F).categories, (e) => (g(), i("div", {
|
|
5115
5196
|
key: e.id,
|
|
5116
5197
|
class: d(["category-item", { active: S(I)?.id === e.id }]),
|
|
5117
|
-
onClick: (t) => S(
|
|
5198
|
+
onClick: (t) => S(Se)(e, "category")
|
|
5118
5199
|
}, [
|
|
5119
5200
|
a("div", {
|
|
5120
5201
|
class: "category-color",
|
|
5121
5202
|
style: f({ background: e.color })
|
|
5122
5203
|
}, null, 4),
|
|
5123
|
-
a("span",
|
|
5124
|
-
a("span",
|
|
5204
|
+
a("span", _r, x(e.name), 1),
|
|
5205
|
+
a("span", vr, x(e.causes?.length || 0), 1),
|
|
5125
5206
|
s(l, {
|
|
5126
5207
|
size: "small",
|
|
5127
5208
|
circle: "",
|
|
5128
5209
|
class: "delete-btn",
|
|
5129
|
-
onClick:
|
|
5210
|
+
onClick: k((t) => Ut(e.id), ["stop"])
|
|
5130
5211
|
}, {
|
|
5131
|
-
default:
|
|
5132
|
-
default:
|
|
5212
|
+
default: E(() => [s(c, null, {
|
|
5213
|
+
default: E(() => [s(S(se))]),
|
|
5133
5214
|
_: 1
|
|
5134
5215
|
})]),
|
|
5135
5216
|
_: 1
|
|
5136
5217
|
}, 8, ["onClick"])
|
|
5137
|
-
], 10,
|
|
5218
|
+
], 10, gr))), 128)), s(l, {
|
|
5138
5219
|
size: "small",
|
|
5139
5220
|
type: "primary",
|
|
5140
5221
|
class: "add-btn",
|
|
5141
|
-
onClick:
|
|
5222
|
+
onClick: Ht
|
|
5142
5223
|
}, {
|
|
5143
|
-
default:
|
|
5144
|
-
default:
|
|
5224
|
+
default: E(() => [s(c, null, {
|
|
5225
|
+
default: E(() => [s(S(_e))]),
|
|
5145
5226
|
_: 1
|
|
5146
5227
|
}), n[65] ||= o(" 添加类别 ", -1)]),
|
|
5147
5228
|
_: 1
|
|
5148
|
-
})], 512), [[
|
|
5229
|
+
})], 512), [[w, Pt.value]])], 2),
|
|
5149
5230
|
a("div", {
|
|
5150
5231
|
class: "canvas-container",
|
|
5151
5232
|
ref_key: "canvasContainer",
|
|
5152
|
-
ref:
|
|
5153
|
-
onMousedown:
|
|
5233
|
+
ref: ht,
|
|
5234
|
+
onMousedown: k(B, ["self"])
|
|
5154
5235
|
}, [a("div", {
|
|
5155
5236
|
class: d(["diagram-title-area", { "selected-title": S(L) === "title" }]),
|
|
5156
|
-
style: f(
|
|
5157
|
-
onClick:
|
|
5237
|
+
style: f(Lt.value),
|
|
5238
|
+
onClick: k(zt, ["stop"])
|
|
5158
5239
|
}, [a("h2", {
|
|
5159
5240
|
class: "diagram-title",
|
|
5160
|
-
style: f(
|
|
5161
|
-
}, x(S(F).title || "鱼骨图分析"), 5), S(F).effect ? (g(), i("p",
|
|
5241
|
+
style: f(Rt.value)
|
|
5242
|
+
}, x(S(F).title || "鱼骨图分析"), 5), S(F).effect ? (g(), i("p", yr, "问题:" + x(S(F).effect), 1)) : r("", !0)], 6), a("div", {
|
|
5162
5243
|
class: "canvas-wrapper",
|
|
5163
|
-
style: f({ transform: `scale(${
|
|
5164
|
-
onMousedown:
|
|
5244
|
+
style: f({ transform: `scale(${_t.value / 100})` }),
|
|
5245
|
+
onMousedown: k(B, ["self"])
|
|
5165
5246
|
}, [
|
|
5166
5247
|
s(qn, {
|
|
5167
5248
|
ref_key: "fishboneRenderer",
|
|
5168
|
-
ref:
|
|
5249
|
+
ref: gt,
|
|
5169
5250
|
categories: S(F).categories,
|
|
5170
5251
|
effect: S(F).effect,
|
|
5171
|
-
theme:
|
|
5252
|
+
theme: Mt.value,
|
|
5172
5253
|
"selected-node": S(I),
|
|
5173
5254
|
"style-tick": Q.value,
|
|
5174
5255
|
"diagram-style": S(F).diagramStyle,
|
|
5175
5256
|
width: "100%",
|
|
5176
5257
|
height: "100%",
|
|
5177
|
-
onSelectNode:
|
|
5178
|
-
onClearSelection:
|
|
5179
|
-
onDeleteNode:
|
|
5180
|
-
onAddChild:
|
|
5181
|
-
onNodeDragged:
|
|
5182
|
-
onOpenMindmap:
|
|
5258
|
+
onSelectNode: Kt,
|
|
5259
|
+
onClearSelection: B,
|
|
5260
|
+
onDeleteNode: xn,
|
|
5261
|
+
onAddChild: Tn,
|
|
5262
|
+
onNodeDragged: wn,
|
|
5263
|
+
onOpenMindmap: Nn
|
|
5183
5264
|
}, null, 8, [
|
|
5184
5265
|
"categories",
|
|
5185
5266
|
"effect",
|
|
@@ -5188,56 +5269,56 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5188
5269
|
"style-tick",
|
|
5189
5270
|
"diagram-style"
|
|
5190
5271
|
]),
|
|
5191
|
-
(g(!0), i(e, null, y(
|
|
5272
|
+
(g(!0), i(e, null, y(V.value, (t) => (g(), i("div", {
|
|
5192
5273
|
key: t.id,
|
|
5193
5274
|
class: d(["textbox-rect", {
|
|
5194
|
-
selected:
|
|
5195
|
-
editing:
|
|
5196
|
-
"show-anchors":
|
|
5275
|
+
selected: H.value === t.id,
|
|
5276
|
+
editing: U.value === t.id,
|
|
5277
|
+
"show-anchors": xt.value || St.value
|
|
5197
5278
|
}]),
|
|
5198
5279
|
"data-textbox-id": t.id,
|
|
5199
|
-
style: f(
|
|
5200
|
-
onMousedown:
|
|
5201
|
-
onDblclick:
|
|
5202
|
-
}, [
|
|
5280
|
+
style: f(qt(t)),
|
|
5281
|
+
onMousedown: k((e) => Zt(t, e), ["stop"]),
|
|
5282
|
+
onDblclick: k((e) => Qt(t), ["stop"])
|
|
5283
|
+
}, [D(a("textarea", {
|
|
5203
5284
|
class: "textbox-content",
|
|
5204
5285
|
"onUpdate:modelValue": (e) => t.text = e,
|
|
5205
|
-
style: f(
|
|
5286
|
+
style: f(Jt(t)),
|
|
5206
5287
|
placeholder: "输入文字...",
|
|
5207
|
-
readonly:
|
|
5208
|
-
onBlur: (e) =>
|
|
5209
|
-
}, null, 44,
|
|
5288
|
+
readonly: U.value !== t.id,
|
|
5289
|
+
onBlur: (e) => Xt(t)
|
|
5290
|
+
}, null, 44, xr), [[C, t.text]]), H.value === t.id || xt.value || St.value ? (g(), i(e, { key: 0 }, [
|
|
5210
5291
|
a("div", {
|
|
5211
5292
|
class: "resize-handle resize-handle-se",
|
|
5212
|
-
onMousedown:
|
|
5213
|
-
}, null, 40,
|
|
5293
|
+
onMousedown: k((e) => tn(t, "se", e), ["stop"])
|
|
5294
|
+
}, null, 40, Sr),
|
|
5214
5295
|
a("div", {
|
|
5215
5296
|
class: "resize-handle resize-handle-sw",
|
|
5216
|
-
onMousedown:
|
|
5217
|
-
}, null, 40,
|
|
5297
|
+
onMousedown: k((e) => tn(t, "sw", e), ["stop"])
|
|
5298
|
+
}, null, 40, Cr),
|
|
5218
5299
|
a("div", {
|
|
5219
5300
|
class: "resize-handle resize-handle-ne",
|
|
5220
|
-
onMousedown:
|
|
5221
|
-
}, null, 40,
|
|
5301
|
+
onMousedown: k((e) => tn(t, "ne", e), ["stop"])
|
|
5302
|
+
}, null, 40, wr),
|
|
5222
5303
|
a("div", {
|
|
5223
5304
|
class: "resize-handle resize-handle-nw",
|
|
5224
|
-
onMousedown:
|
|
5225
|
-
}, null, 40,
|
|
5305
|
+
onMousedown: k((e) => tn(t, "nw", e), ["stop"])
|
|
5306
|
+
}, null, 40, Tr),
|
|
5226
5307
|
a("div", {
|
|
5227
5308
|
class: "textbox-delete-btn",
|
|
5228
|
-
onClick:
|
|
5229
|
-
}, "×", 8,
|
|
5230
|
-
], 64)) : r("", !0)], 46,
|
|
5309
|
+
onClick: k((e) => an(t.id), ["stop"])
|
|
5310
|
+
}, "×", 8, Er)
|
|
5311
|
+
], 64)) : r("", !0)], 46, br))), 128)),
|
|
5231
5312
|
(g(), i("svg", {
|
|
5232
5313
|
ref_key: "arrowSvgRef",
|
|
5233
|
-
ref:
|
|
5314
|
+
ref: Ne,
|
|
5234
5315
|
class: "arrow-lines-svg",
|
|
5235
5316
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5236
|
-
viewBox:
|
|
5317
|
+
viewBox: Tt.value,
|
|
5237
5318
|
preserveAspectRatio: "xMidYMid meet",
|
|
5238
5319
|
"pointer-events": "none"
|
|
5239
5320
|
}, [
|
|
5240
|
-
a("defs", null, [(g(!0), i(e, null, y(
|
|
5321
|
+
a("defs", null, [(g(!0), i(e, null, y(q.value, (e) => (g(), i("marker", {
|
|
5241
5322
|
key: "marker-end-" + e.id,
|
|
5242
5323
|
id: "arrowhead-end-" + e.id,
|
|
5243
5324
|
markerWidth: "10",
|
|
@@ -5248,7 +5329,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5248
5329
|
}, [a("polygon", {
|
|
5249
5330
|
points: "0 0, 10 3.5, 0 7",
|
|
5250
5331
|
fill: e.style.lineColor
|
|
5251
|
-
}, null, 8,
|
|
5332
|
+
}, null, 8, kr)], 8, Or))), 128)), (g(!0), i(e, null, y(q.value, (e) => (g(), i("marker", {
|
|
5252
5333
|
key: "marker-start-" + e.id,
|
|
5253
5334
|
id: "arrowhead-start-" + e.id,
|
|
5254
5335
|
markerWidth: "10",
|
|
@@ -5259,8 +5340,8 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5259
5340
|
}, [a("polygon", {
|
|
5260
5341
|
points: "10 0, 0 3.5, 10 7",
|
|
5261
5342
|
fill: e.style.lineColor
|
|
5262
|
-
}, null, 8,
|
|
5263
|
-
|
|
5343
|
+
}, null, 8, jr)], 8, Ar))), 128))]),
|
|
5344
|
+
J.value || Pe.value || Fe.value || St.value ? (g(), i("g", Mr, [(g(!0), i(e, null, y(wt.value, (t) => (g(), i(e, { key: "anchors-" + t.id }, [(g(!0), i(e, null, y(ln(t), (e, r) => (g(), i("circle", {
|
|
5264
5345
|
key: "anchor-" + r,
|
|
5265
5346
|
cx: e.x,
|
|
5266
5347
|
cy: e.y,
|
|
@@ -5271,10 +5352,10 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5271
5352
|
opacity: "0.6",
|
|
5272
5353
|
"pointer-events": "auto",
|
|
5273
5354
|
style: { cursor: "crosshair" },
|
|
5274
|
-
onMouseenter: (e) =>
|
|
5275
|
-
onMouseleave: n[4] ||= (e) =>
|
|
5276
|
-
onMousedown:
|
|
5277
|
-
}, null, 40,
|
|
5355
|
+
onMouseenter: (e) => Ct.value = t.id,
|
|
5356
|
+
onMouseleave: n[4] ||= (e) => Ct.value = null,
|
|
5357
|
+
onMousedown: k((e) => fn(t, "node", "border-" + r, e), ["stop"])
|
|
5358
|
+
}, null, 40, Nr))), 128))], 64))), 128)), (g(!0), i(e, null, y(V.value, (t) => (g(), i(e, { key: "tb-anchors-" + t.id }, [J.value || Pe.value || Fe.value || St.value ? (g(), i("g", Pr, [(g(!0), i(e, null, y(Et(t), (e, r) => (g(), i("circle", {
|
|
5278
5359
|
key: "tb-anchor-" + r,
|
|
5279
5360
|
cx: e.x,
|
|
5280
5361
|
cy: e.y,
|
|
@@ -5285,31 +5366,31 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5285
5366
|
opacity: "0.7",
|
|
5286
5367
|
"pointer-events": "auto",
|
|
5287
5368
|
style: { cursor: "crosshair" },
|
|
5288
|
-
onMouseenter: (e) =>
|
|
5289
|
-
onMouseleave: n[5] ||= (e) =>
|
|
5290
|
-
onMousedown:
|
|
5291
|
-
}, null, 40,
|
|
5292
|
-
(g(!0), i(e, null, y(
|
|
5369
|
+
onMouseenter: (e) => Ct.value = t.id,
|
|
5370
|
+
onMouseleave: n[5] ||= (e) => Ct.value = null,
|
|
5371
|
+
onMousedown: k((e) => fn(t, "textbox", "border-" + r, e), ["stop"])
|
|
5372
|
+
}, null, 40, Fr))), 128))])) : r("", !0)], 64))), 128))])) : r("", !0),
|
|
5373
|
+
(g(!0), i(e, null, y(q.value, (t) => (g(), i("g", { key: t.id }, [
|
|
5293
5374
|
a("path", {
|
|
5294
|
-
d:
|
|
5375
|
+
d: cn(t),
|
|
5295
5376
|
fill: "none",
|
|
5296
|
-
stroke:
|
|
5377
|
+
stroke: J.value === t.id ? "#409EFF" : t.style.lineColor,
|
|
5297
5378
|
"stroke-width": t.style.lineWidth,
|
|
5298
5379
|
"stroke-dasharray": t.style.lineStyle === "dashed" ? "8,4" : "none",
|
|
5299
5380
|
"marker-end": t.style.arrowEnd ? `url(#arrowhead-end-${t.id})` : "",
|
|
5300
5381
|
"marker-start": t.style.arrowStart ? `url(#arrowhead-start-${t.id})` : "",
|
|
5301
5382
|
"pointer-events": "none"
|
|
5302
|
-
}, null, 8,
|
|
5383
|
+
}, null, 8, Ir),
|
|
5303
5384
|
a("path", {
|
|
5304
|
-
d:
|
|
5385
|
+
d: cn(t),
|
|
5305
5386
|
fill: "none",
|
|
5306
5387
|
stroke: "rgba(0,0,0,0.01)",
|
|
5307
5388
|
"stroke-width": Math.max(t.style.lineWidth * 3, 12),
|
|
5308
5389
|
"pointer-events": "auto",
|
|
5309
5390
|
style: { cursor: "move" },
|
|
5310
|
-
onMousedown:
|
|
5311
|
-
}, null, 40,
|
|
5312
|
-
|
|
5391
|
+
onMousedown: k((e) => _n(t, e), ["stop"])
|
|
5392
|
+
}, null, 40, Lr),
|
|
5393
|
+
J.value === t.id ? (g(), i("circle", {
|
|
5313
5394
|
key: 0,
|
|
5314
5395
|
cx: t.startX,
|
|
5315
5396
|
cy: t.startY,
|
|
@@ -5317,9 +5398,9 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5317
5398
|
fill: "#409EFF",
|
|
5318
5399
|
"pointer-events": "auto",
|
|
5319
5400
|
style: { cursor: "move" },
|
|
5320
|
-
onMousedown:
|
|
5321
|
-
}, null, 40,
|
|
5322
|
-
|
|
5401
|
+
onMousedown: k((e) => mn(t, "start", e), ["stop"])
|
|
5402
|
+
}, null, 40, Rr)) : r("", !0),
|
|
5403
|
+
J.value === t.id ? (g(), i("circle", {
|
|
5323
5404
|
key: 1,
|
|
5324
5405
|
cx: t.endX,
|
|
5325
5406
|
cy: t.endY,
|
|
@@ -5327,23 +5408,23 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5327
5408
|
fill: "#409EFF",
|
|
5328
5409
|
"pointer-events": "auto",
|
|
5329
5410
|
style: { cursor: "move" },
|
|
5330
|
-
onMousedown:
|
|
5331
|
-
}, null, 40,
|
|
5332
|
-
|
|
5411
|
+
onMousedown: k((e) => mn(t, "end", e), ["stop"])
|
|
5412
|
+
}, null, 40, zr)) : r("", !0),
|
|
5413
|
+
J.value === t.id ? (g(), i(e, { key: 2 }, [
|
|
5333
5414
|
a("circle", {
|
|
5334
5415
|
cx: t.startX,
|
|
5335
5416
|
cy: t.startY,
|
|
5336
5417
|
r: "4",
|
|
5337
5418
|
fill: "#409EFF",
|
|
5338
5419
|
"pointer-events": "none"
|
|
5339
|
-
}, null, 8,
|
|
5420
|
+
}, null, 8, Br),
|
|
5340
5421
|
a("circle", {
|
|
5341
5422
|
cx: t.endX,
|
|
5342
5423
|
cy: t.endY,
|
|
5343
5424
|
r: "4",
|
|
5344
5425
|
fill: "#409EFF",
|
|
5345
5426
|
"pointer-events": "none"
|
|
5346
|
-
}, null, 8,
|
|
5427
|
+
}, null, 8, Vr),
|
|
5347
5428
|
t.style.lineType === "curve" ? (g(), i(e, { key: 0 }, [
|
|
5348
5429
|
a("line", {
|
|
5349
5430
|
x1: (t.startX + t.endX) / 2,
|
|
@@ -5355,7 +5436,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5355
5436
|
"stroke-dasharray": "4,3",
|
|
5356
5437
|
opacity: "0.5",
|
|
5357
5438
|
"pointer-events": "none"
|
|
5358
|
-
}, null, 8,
|
|
5439
|
+
}, null, 8, Hr),
|
|
5359
5440
|
a("line", {
|
|
5360
5441
|
x1: t.startX,
|
|
5361
5442
|
y1: t.startY,
|
|
@@ -5366,7 +5447,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5366
5447
|
"stroke-dasharray": "4,3",
|
|
5367
5448
|
opacity: "0.3",
|
|
5368
5449
|
"pointer-events": "none"
|
|
5369
|
-
}, null, 8,
|
|
5450
|
+
}, null, 8, Ur),
|
|
5370
5451
|
a("line", {
|
|
5371
5452
|
x1: t.endX,
|
|
5372
5453
|
y1: t.endY,
|
|
@@ -5377,7 +5458,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5377
5458
|
"stroke-dasharray": "4,3",
|
|
5378
5459
|
opacity: "0.3",
|
|
5379
5460
|
"pointer-events": "none"
|
|
5380
|
-
}, null, 8,
|
|
5461
|
+
}, null, 8, Wr),
|
|
5381
5462
|
a("circle", {
|
|
5382
5463
|
cx: t.cpX,
|
|
5383
5464
|
cy: t.cpY,
|
|
@@ -5386,13 +5467,13 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5386
5467
|
stroke: "white",
|
|
5387
5468
|
"stroke-width": "2",
|
|
5388
5469
|
style: { cursor: "grab" },
|
|
5389
|
-
onMousedown:
|
|
5390
|
-
}, null, 40,
|
|
5470
|
+
onMousedown: k((e) => vn(t, e), ["stop"])
|
|
5471
|
+
}, null, 40, Gr)
|
|
5391
5472
|
], 64)) : r("", !0),
|
|
5392
5473
|
a("g", {
|
|
5393
5474
|
transform: `translate(${(t.startX + t.endX) / 2}, ${(t.startY + t.endY) / 2 - 16})`,
|
|
5394
5475
|
style: { cursor: "pointer" },
|
|
5395
|
-
onClick:
|
|
5476
|
+
onClick: k((e) => sn(t.id), ["stop"])
|
|
5396
5477
|
}, [...n[66] ||= [
|
|
5397
5478
|
a("circle", {
|
|
5398
5479
|
r: "9",
|
|
@@ -5417,23 +5498,23 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5417
5498
|
"stroke-width": "2",
|
|
5418
5499
|
"stroke-linecap": "round"
|
|
5419
5500
|
}, null, -1)
|
|
5420
|
-
]], 8,
|
|
5501
|
+
]], 8, Kr)
|
|
5421
5502
|
], 64)) : r("", !0)
|
|
5422
5503
|
]))), 128))
|
|
5423
|
-
], 8,
|
|
5504
|
+
], 8, Dr))
|
|
5424
5505
|
], 36)], 544),
|
|
5425
|
-
a("div", { class: d(["side-panel right-panel", { collapsed: !
|
|
5506
|
+
a("div", { class: d(["side-panel right-panel", { collapsed: !Ft.value }]) }, [a("div", {
|
|
5426
5507
|
class: "panel-header",
|
|
5427
|
-
onClick: n[6] ||= (e) =>
|
|
5508
|
+
onClick: n[6] ||= (e) => Ft.value = !Ft.value,
|
|
5428
5509
|
style: { cursor: "pointer" }
|
|
5429
|
-
}, [a("h4", null, x(
|
|
5430
|
-
S(I) ? (g(), i(e, { key: 0 }, [S(L) === "title" ? (g(), i("div",
|
|
5510
|
+
}, [a("h4", null, x(Ft.value ? S(L) === "title" ? "标题设置" : Z.value ? "文本框设置" : Y.value ? "箭头线设置" : S(L) ? "节点详情" : "属性面板" : ""), 1)]), D(a("div", qr, [
|
|
5511
|
+
S(I) ? (g(), i(e, { key: 0 }, [S(L) === "title" ? (g(), i("div", Jr, [s(te, {
|
|
5431
5512
|
"label-position": "top",
|
|
5432
5513
|
size: "small"
|
|
5433
5514
|
}, {
|
|
5434
|
-
default:
|
|
5515
|
+
default: E(() => [
|
|
5435
5516
|
s(p, { label: "标题文本" }, {
|
|
5436
|
-
default:
|
|
5517
|
+
default: E(() => [s(u, {
|
|
5437
5518
|
modelValue: S(F).title,
|
|
5438
5519
|
"onUpdate:modelValue": n[7] ||= (e) => S(F).title = e,
|
|
5439
5520
|
tabindex: "-1"
|
|
@@ -5441,12 +5522,12 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5441
5522
|
_: 1
|
|
5442
5523
|
}),
|
|
5443
5524
|
s(p, { label: "字体" }, {
|
|
5444
|
-
default:
|
|
5525
|
+
default: E(() => [s(h, {
|
|
5445
5526
|
modelValue: S(F).titleStyle.fontFamily,
|
|
5446
5527
|
"onUpdate:modelValue": n[8] ||= (e) => S(F).titleStyle.fontFamily = e,
|
|
5447
5528
|
style: { width: "100%" }
|
|
5448
5529
|
}, {
|
|
5449
|
-
default:
|
|
5530
|
+
default: E(() => [
|
|
5450
5531
|
s(m, {
|
|
5451
5532
|
label: "微软雅黑",
|
|
5452
5533
|
value: "Microsoft YaHei"
|
|
@@ -5477,7 +5558,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5477
5558
|
_: 1
|
|
5478
5559
|
}),
|
|
5479
5560
|
s(p, { label: "字号" }, {
|
|
5480
|
-
default:
|
|
5561
|
+
default: E(() => [s(v, {
|
|
5481
5562
|
modelValue: S(F).titleStyle.fontSize,
|
|
5482
5563
|
"onUpdate:modelValue": n[9] ||= (e) => S(F).titleStyle.fontSize = e,
|
|
5483
5564
|
min: 12,
|
|
@@ -5488,21 +5569,21 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5488
5569
|
_: 1
|
|
5489
5570
|
}),
|
|
5490
5571
|
s(p, { label: "文字颜色" }, {
|
|
5491
|
-
default:
|
|
5572
|
+
default: E(() => [s(T, {
|
|
5492
5573
|
modelValue: S(F).titleStyle.color,
|
|
5493
5574
|
"onUpdate:modelValue": n[10] ||= (e) => S(F).titleStyle.color = e
|
|
5494
5575
|
}, null, 8, ["modelValue"])]),
|
|
5495
5576
|
_: 1
|
|
5496
5577
|
}),
|
|
5497
5578
|
s(p, { label: "标题背景色" }, {
|
|
5498
|
-
default:
|
|
5579
|
+
default: E(() => [s(T, {
|
|
5499
5580
|
modelValue: S(F).titleStyle.bgColor,
|
|
5500
5581
|
"onUpdate:modelValue": n[11] ||= (e) => S(F).titleStyle.bgColor = e
|
|
5501
5582
|
}, null, 8, ["modelValue"])]),
|
|
5502
5583
|
_: 1
|
|
5503
5584
|
}),
|
|
5504
5585
|
s(p, { label: "背景透明度" }, {
|
|
5505
|
-
default:
|
|
5586
|
+
default: E(() => [s(v, {
|
|
5506
5587
|
modelValue: S(F).titleStyle.bgOpacity,
|
|
5507
5588
|
"onUpdate:modelValue": n[12] ||= (e) => S(F).titleStyle.bgOpacity = e,
|
|
5508
5589
|
min: 0,
|
|
@@ -5513,21 +5594,21 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5513
5594
|
_: 1
|
|
5514
5595
|
}),
|
|
5515
5596
|
s(p, { label: "对齐方式" }, {
|
|
5516
|
-
default:
|
|
5597
|
+
default: E(() => [s(A, {
|
|
5517
5598
|
modelValue: S(F).titleStyle.textAlign,
|
|
5518
5599
|
"onUpdate:modelValue": n[13] ||= (e) => S(F).titleStyle.textAlign = e
|
|
5519
5600
|
}, {
|
|
5520
|
-
default:
|
|
5521
|
-
s(
|
|
5522
|
-
default:
|
|
5601
|
+
default: E(() => [
|
|
5602
|
+
s(O, { value: "left" }, {
|
|
5603
|
+
default: E(() => [...n[67] ||= [o("左", -1)]]),
|
|
5523
5604
|
_: 1
|
|
5524
5605
|
}),
|
|
5525
|
-
s(
|
|
5526
|
-
default:
|
|
5606
|
+
s(O, { value: "center" }, {
|
|
5607
|
+
default: E(() => [...n[68] ||= [o("中", -1)]]),
|
|
5527
5608
|
_: 1
|
|
5528
5609
|
}),
|
|
5529
|
-
s(
|
|
5530
|
-
default:
|
|
5610
|
+
s(O, { value: "right" }, {
|
|
5611
|
+
default: E(() => [...n[69] ||= [o("右", -1)]]),
|
|
5531
5612
|
_: 1
|
|
5532
5613
|
})
|
|
5533
5614
|
]),
|
|
@@ -5537,35 +5618,35 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5537
5618
|
})
|
|
5538
5619
|
]),
|
|
5539
5620
|
_: 1
|
|
5540
|
-
})])) : (g(), i("div",
|
|
5621
|
+
})])) : (g(), i("div", Yr, [s(te, {
|
|
5541
5622
|
"label-position": "top",
|
|
5542
5623
|
size: "small"
|
|
5543
5624
|
}, {
|
|
5544
|
-
default:
|
|
5625
|
+
default: E(() => [
|
|
5545
5626
|
s(p, { label: S(L) === "category" ? "类别名称" : "节点文本" }, {
|
|
5546
|
-
default:
|
|
5627
|
+
default: E(() => [a("input", {
|
|
5547
5628
|
class: "node-name-input",
|
|
5548
5629
|
value: S(L) === "category" ? S(I).name : S(I).text,
|
|
5549
5630
|
onInput: n[14] ||= (e) => S(L) === "category" ? S(I).name = e.target.value : S(I).text = e.target.value,
|
|
5550
5631
|
onFocus: n[15] ||= (e) => e.target.select(),
|
|
5551
5632
|
spellcheck: "false"
|
|
5552
|
-
}, null, 40,
|
|
5633
|
+
}, null, 40, Xr)]),
|
|
5553
5634
|
_: 1
|
|
5554
5635
|
}, 8, ["label"]),
|
|
5555
5636
|
S(I).style ? (g(), i(e, { key: 0 }, [
|
|
5556
|
-
s(
|
|
5557
|
-
default:
|
|
5637
|
+
s(j, { "content-position": "left" }, {
|
|
5638
|
+
default: E(() => [...n[70] ||= [o("外观", -1)]]),
|
|
5558
5639
|
_: 1
|
|
5559
5640
|
}),
|
|
5560
5641
|
s(p, { label: "节点颜色" }, {
|
|
5561
|
-
default:
|
|
5642
|
+
default: E(() => [s(T, {
|
|
5562
5643
|
modelValue: S(I).color,
|
|
5563
5644
|
"onUpdate:modelValue": [n[16] ||= (e) => S(I).color = e, n[17] ||= (e) => Q.value++]
|
|
5564
5645
|
}, null, 8, ["modelValue"])]),
|
|
5565
5646
|
_: 1
|
|
5566
5647
|
}),
|
|
5567
5648
|
s(p, { label: "节点透明度" }, {
|
|
5568
|
-
default:
|
|
5649
|
+
default: E(() => [s(v, {
|
|
5569
5650
|
modelValue: S(I).style.opacity,
|
|
5570
5651
|
"onUpdate:modelValue": [n[18] ||= (e) => S(I).style.opacity = e, n[19] ||= (e) => Q.value++],
|
|
5571
5652
|
min: 0,
|
|
@@ -5575,34 +5656,34 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5575
5656
|
}, null, 8, ["modelValue"])]),
|
|
5576
5657
|
_: 1
|
|
5577
5658
|
}),
|
|
5578
|
-
s(
|
|
5579
|
-
default:
|
|
5659
|
+
s(j, { "content-position": "left" }, {
|
|
5660
|
+
default: E(() => [...n[71] ||= [o("边框", -1)]]),
|
|
5580
5661
|
_: 1
|
|
5581
5662
|
}),
|
|
5582
5663
|
s(p, { label: "边框颜色" }, {
|
|
5583
|
-
default:
|
|
5664
|
+
default: E(() => [s(T, {
|
|
5584
5665
|
modelValue: S(I).style.borderColor,
|
|
5585
5666
|
"onUpdate:modelValue": [n[20] ||= (e) => S(I).style.borderColor = e, n[21] ||= (e) => Q.value++]
|
|
5586
5667
|
}, null, 8, ["modelValue"])]),
|
|
5587
5668
|
_: 1
|
|
5588
5669
|
}),
|
|
5589
5670
|
s(p, { label: "边框样式" }, {
|
|
5590
|
-
default:
|
|
5671
|
+
default: E(() => [s(A, {
|
|
5591
5672
|
modelValue: S(I).style.borderStyle,
|
|
5592
5673
|
"onUpdate:modelValue": n[22] ||= (e) => S(I).style.borderStyle = e,
|
|
5593
5674
|
onChange: n[23] ||= (e) => Q.value++
|
|
5594
5675
|
}, {
|
|
5595
|
-
default:
|
|
5596
|
-
s(
|
|
5597
|
-
default:
|
|
5676
|
+
default: E(() => [
|
|
5677
|
+
s(O, { value: "solid" }, {
|
|
5678
|
+
default: E(() => [...n[72] ||= [o("实线", -1)]]),
|
|
5598
5679
|
_: 1
|
|
5599
5680
|
}),
|
|
5600
|
-
s(
|
|
5601
|
-
default:
|
|
5681
|
+
s(O, { value: "dashed" }, {
|
|
5682
|
+
default: E(() => [...n[73] ||= [o("虚线", -1)]]),
|
|
5602
5683
|
_: 1
|
|
5603
5684
|
}),
|
|
5604
|
-
s(
|
|
5605
|
-
default:
|
|
5685
|
+
s(O, { value: "none" }, {
|
|
5686
|
+
default: E(() => [...n[74] ||= [o("无边框", -1)]]),
|
|
5606
5687
|
_: 1
|
|
5607
5688
|
})
|
|
5608
5689
|
]),
|
|
@@ -5611,7 +5692,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5611
5692
|
_: 1
|
|
5612
5693
|
}),
|
|
5613
5694
|
s(p, { label: "边框宽度" }, {
|
|
5614
|
-
default:
|
|
5695
|
+
default: E(() => [s(v, {
|
|
5615
5696
|
modelValue: S(I).style.borderWidth,
|
|
5616
5697
|
"onUpdate:modelValue": [n[24] ||= (e) => S(I).style.borderWidth = e, n[25] ||= (e) => Q.value++],
|
|
5617
5698
|
min: 0,
|
|
@@ -5621,19 +5702,19 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5621
5702
|
}, null, 8, ["modelValue"])]),
|
|
5622
5703
|
_: 1
|
|
5623
5704
|
}),
|
|
5624
|
-
s(
|
|
5625
|
-
default:
|
|
5705
|
+
s(j, { "content-position": "left" }, {
|
|
5706
|
+
default: E(() => [...n[75] ||= [o("文字", -1)]]),
|
|
5626
5707
|
_: 1
|
|
5627
5708
|
}),
|
|
5628
5709
|
s(p, { label: "文字颜色" }, {
|
|
5629
|
-
default:
|
|
5710
|
+
default: E(() => [s(T, {
|
|
5630
5711
|
modelValue: S(I).style.textColor,
|
|
5631
5712
|
"onUpdate:modelValue": [n[26] ||= (e) => S(I).style.textColor = e, n[27] ||= (e) => Q.value++]
|
|
5632
5713
|
}, null, 8, ["modelValue"])]),
|
|
5633
5714
|
_: 1
|
|
5634
5715
|
}),
|
|
5635
5716
|
s(p, { label: "字号" }, {
|
|
5636
|
-
default:
|
|
5717
|
+
default: E(() => [s(v, {
|
|
5637
5718
|
modelValue: S(I).style.fontSize,
|
|
5638
5719
|
"onUpdate:modelValue": [n[28] ||= (e) => S(I).style.fontSize = e, n[29] ||= (e) => Q.value++],
|
|
5639
5720
|
min: 8,
|
|
@@ -5644,7 +5725,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5644
5725
|
_: 1
|
|
5645
5726
|
}),
|
|
5646
5727
|
s(p, { label: "字体" }, {
|
|
5647
|
-
default:
|
|
5728
|
+
default: E(() => [D(a("select", {
|
|
5648
5729
|
class: "node-font-select",
|
|
5649
5730
|
"onUpdate:modelValue": n[30] ||= (e) => S(I).style.fontFamily = e,
|
|
5650
5731
|
onChange: n[31] ||= (e) => Q.value++
|
|
@@ -5653,26 +5734,26 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5653
5734
|
a("option", { value: "SimSun" }, "宋体", -1),
|
|
5654
5735
|
a("option", { value: "SimHei" }, "黑体", -1),
|
|
5655
5736
|
a("option", { value: "Arial" }, "Arial", -1)
|
|
5656
|
-
]], 544), [[
|
|
5737
|
+
]], 544), [[ee, S(I).style.fontFamily]])]),
|
|
5657
5738
|
_: 1
|
|
5658
5739
|
}),
|
|
5659
5740
|
s(p, { label: "对齐方式" }, {
|
|
5660
|
-
default:
|
|
5741
|
+
default: E(() => [s(A, {
|
|
5661
5742
|
modelValue: S(I).style.textAlign,
|
|
5662
5743
|
"onUpdate:modelValue": n[32] ||= (e) => S(I).style.textAlign = e,
|
|
5663
5744
|
onChange: n[33] ||= (e) => Q.value++
|
|
5664
5745
|
}, {
|
|
5665
|
-
default:
|
|
5666
|
-
s(
|
|
5667
|
-
default:
|
|
5746
|
+
default: E(() => [
|
|
5747
|
+
s(O, { value: "left" }, {
|
|
5748
|
+
default: E(() => [...n[77] ||= [o("左", -1)]]),
|
|
5668
5749
|
_: 1
|
|
5669
5750
|
}),
|
|
5670
|
-
s(
|
|
5671
|
-
default:
|
|
5751
|
+
s(O, { value: "center" }, {
|
|
5752
|
+
default: E(() => [...n[78] ||= [o("中", -1)]]),
|
|
5672
5753
|
_: 1
|
|
5673
5754
|
}),
|
|
5674
|
-
s(
|
|
5675
|
-
default:
|
|
5755
|
+
s(O, { value: "right" }, {
|
|
5756
|
+
default: E(() => [...n[79] ||= [o("右", -1)]]),
|
|
5676
5757
|
_: 1
|
|
5677
5758
|
})
|
|
5678
5759
|
]),
|
|
@@ -5680,19 +5761,19 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5680
5761
|
}, 8, ["modelValue"])]),
|
|
5681
5762
|
_: 1
|
|
5682
5763
|
}),
|
|
5683
|
-
s(
|
|
5684
|
-
default:
|
|
5764
|
+
s(j, { "content-position": "left" }, {
|
|
5765
|
+
default: E(() => [...n[80] ||= [o("连接线", -1)]]),
|
|
5685
5766
|
_: 1
|
|
5686
5767
|
}),
|
|
5687
5768
|
s(p, { label: "连接线颜色" }, {
|
|
5688
|
-
default:
|
|
5769
|
+
default: E(() => [s(T, {
|
|
5689
5770
|
modelValue: S(I).style.lineColor,
|
|
5690
5771
|
"onUpdate:modelValue": [n[34] ||= (e) => S(I).style.lineColor = e, n[35] ||= (e) => Q.value++]
|
|
5691
5772
|
}, null, 8, ["modelValue"])]),
|
|
5692
5773
|
_: 1
|
|
5693
5774
|
}),
|
|
5694
5775
|
s(p, { label: "连接线透明度" }, {
|
|
5695
|
-
default:
|
|
5776
|
+
default: E(() => [s(v, {
|
|
5696
5777
|
modelValue: S(I).style.lineOpacity,
|
|
5697
5778
|
"onUpdate:modelValue": [n[36] ||= (e) => S(I).style.lineOpacity = e, n[37] ||= (e) => Q.value++],
|
|
5698
5779
|
min: 0,
|
|
@@ -5703,16 +5784,16 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5703
5784
|
_: 1
|
|
5704
5785
|
}),
|
|
5705
5786
|
s(p, { label: "连接线类型" }, {
|
|
5706
|
-
default:
|
|
5787
|
+
default: E(() => [s(A, {
|
|
5707
5788
|
modelValue: S(I).style.lineStyle,
|
|
5708
5789
|
"onUpdate:modelValue": n[38] ||= (e) => S(I).style.lineStyle = e,
|
|
5709
5790
|
onChange: n[39] ||= (e) => Q.value++
|
|
5710
5791
|
}, {
|
|
5711
|
-
default:
|
|
5712
|
-
default:
|
|
5792
|
+
default: E(() => [s(O, { value: "solid" }, {
|
|
5793
|
+
default: E(() => [...n[81] ||= [o("实线", -1)]]),
|
|
5713
5794
|
_: 1
|
|
5714
|
-
}), s(
|
|
5715
|
-
default:
|
|
5795
|
+
}), s(O, { value: "dashed" }, {
|
|
5796
|
+
default: E(() => [...n[82] ||= [o("虚线", -1)]]),
|
|
5716
5797
|
_: 1
|
|
5717
5798
|
})]),
|
|
5718
5799
|
_: 1
|
|
@@ -5720,10 +5801,10 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5720
5801
|
_: 1
|
|
5721
5802
|
})
|
|
5722
5803
|
], 64)) : r("", !0),
|
|
5723
|
-
S(L) === "cause" ? (g(), i(e, { key: 1 }, [s(
|
|
5724
|
-
default:
|
|
5804
|
+
S(L) === "cause" ? (g(), i(e, { key: 1 }, [s(j, { "content-position": "left" }, {
|
|
5805
|
+
default: E(() => [...n[83] ||= [o("措施", -1)]]),
|
|
5725
5806
|
_: 1
|
|
5726
|
-
}), a("div",
|
|
5807
|
+
}), a("div", Zr, [(g(!0), i(e, null, y(S(I).children, (e) => (g(), i("div", {
|
|
5727
5808
|
key: e.id,
|
|
5728
5809
|
class: "child-item"
|
|
5729
5810
|
}, [s(u, {
|
|
@@ -5734,19 +5815,19 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5734
5815
|
}, null, 8, ["modelValue", "onUpdate:modelValue"]), s(l, {
|
|
5735
5816
|
size: "small",
|
|
5736
5817
|
circle: "",
|
|
5737
|
-
onClick: (t) =>
|
|
5818
|
+
onClick: (t) => Gt(e.id)
|
|
5738
5819
|
}, {
|
|
5739
|
-
default:
|
|
5740
|
-
default:
|
|
5820
|
+
default: E(() => [s(c, null, {
|
|
5821
|
+
default: E(() => [s(S(se))]),
|
|
5741
5822
|
_: 1
|
|
5742
5823
|
})]),
|
|
5743
5824
|
_: 1
|
|
5744
5825
|
}, 8, ["onClick"])]))), 128)), s(l, {
|
|
5745
5826
|
size: "small",
|
|
5746
|
-
onClick:
|
|
5827
|
+
onClick: Wt
|
|
5747
5828
|
}, {
|
|
5748
|
-
default:
|
|
5749
|
-
default:
|
|
5829
|
+
default: E(() => [s(c, null, {
|
|
5830
|
+
default: E(() => [s(S(_e))]),
|
|
5750
5831
|
_: 1
|
|
5751
5832
|
}), n[84] ||= o(" 添加措施 ", -1)]),
|
|
5752
5833
|
_: 1
|
|
@@ -5754,24 +5835,24 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5754
5835
|
]),
|
|
5755
5836
|
_: 1
|
|
5756
5837
|
})]))], 64)) : r("", !0),
|
|
5757
|
-
Z.value ? (g(), i("div",
|
|
5838
|
+
Z.value ? (g(), i("div", Qr, [s(te, {
|
|
5758
5839
|
"label-position": "top",
|
|
5759
5840
|
size: "small"
|
|
5760
5841
|
}, {
|
|
5761
|
-
default:
|
|
5762
|
-
s(
|
|
5763
|
-
default:
|
|
5842
|
+
default: E(() => [
|
|
5843
|
+
s(j, { "content-position": "left" }, {
|
|
5844
|
+
default: E(() => [...n[85] ||= [o("文本框设置", -1)]]),
|
|
5764
5845
|
_: 1
|
|
5765
5846
|
}),
|
|
5766
5847
|
s(p, { label: "背景颜色" }, {
|
|
5767
|
-
default:
|
|
5848
|
+
default: E(() => [s(T, {
|
|
5768
5849
|
modelValue: Z.value.style.bgColor,
|
|
5769
5850
|
"onUpdate:modelValue": n[40] ||= (e) => Z.value.style.bgColor = e
|
|
5770
5851
|
}, null, 8, ["modelValue"])]),
|
|
5771
5852
|
_: 1
|
|
5772
5853
|
}),
|
|
5773
5854
|
s(p, { label: "背景透明度" }, {
|
|
5774
|
-
default:
|
|
5855
|
+
default: E(() => [s(v, {
|
|
5775
5856
|
modelValue: Z.value.style.bgOpacity,
|
|
5776
5857
|
"onUpdate:modelValue": n[41] ||= (e) => Z.value.style.bgOpacity = e,
|
|
5777
5858
|
min: 0,
|
|
@@ -5782,12 +5863,12 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5782
5863
|
_: 1
|
|
5783
5864
|
}),
|
|
5784
5865
|
s(p, { label: "字体" }, {
|
|
5785
|
-
default:
|
|
5866
|
+
default: E(() => [s(h, {
|
|
5786
5867
|
modelValue: Z.value.style.fontFamily,
|
|
5787
5868
|
"onUpdate:modelValue": n[42] ||= (e) => Z.value.style.fontFamily = e,
|
|
5788
5869
|
style: { width: "100%" }
|
|
5789
5870
|
}, {
|
|
5790
|
-
default:
|
|
5871
|
+
default: E(() => [
|
|
5791
5872
|
s(m, {
|
|
5792
5873
|
label: "微软雅黑",
|
|
5793
5874
|
value: "Microsoft YaHei"
|
|
@@ -5818,7 +5899,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5818
5899
|
_: 1
|
|
5819
5900
|
}),
|
|
5820
5901
|
s(p, { label: "字号" }, {
|
|
5821
|
-
default:
|
|
5902
|
+
default: E(() => [s(v, {
|
|
5822
5903
|
modelValue: Z.value.style.fontSize,
|
|
5823
5904
|
"onUpdate:modelValue": n[43] ||= (e) => Z.value.style.fontSize = e,
|
|
5824
5905
|
min: 10,
|
|
@@ -5829,28 +5910,28 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5829
5910
|
_: 1
|
|
5830
5911
|
}),
|
|
5831
5912
|
s(p, { label: "字体颜色" }, {
|
|
5832
|
-
default:
|
|
5913
|
+
default: E(() => [s(T, {
|
|
5833
5914
|
modelValue: Z.value.style.textColor,
|
|
5834
5915
|
"onUpdate:modelValue": n[44] ||= (e) => Z.value.style.textColor = e
|
|
5835
5916
|
}, null, 8, ["modelValue"])]),
|
|
5836
5917
|
_: 1
|
|
5837
5918
|
}),
|
|
5838
5919
|
s(p, { label: "对齐方式" }, {
|
|
5839
|
-
default:
|
|
5920
|
+
default: E(() => [s(A, {
|
|
5840
5921
|
modelValue: Z.value.style.textAlign,
|
|
5841
5922
|
"onUpdate:modelValue": n[45] ||= (e) => Z.value.style.textAlign = e
|
|
5842
5923
|
}, {
|
|
5843
|
-
default:
|
|
5844
|
-
s(
|
|
5845
|
-
default:
|
|
5924
|
+
default: E(() => [
|
|
5925
|
+
s(O, { value: "left" }, {
|
|
5926
|
+
default: E(() => [...n[86] ||= [o("左对齐", -1)]]),
|
|
5846
5927
|
_: 1
|
|
5847
5928
|
}),
|
|
5848
|
-
s(
|
|
5849
|
-
default:
|
|
5929
|
+
s(O, { value: "center" }, {
|
|
5930
|
+
default: E(() => [...n[87] ||= [o("居中", -1)]]),
|
|
5850
5931
|
_: 1
|
|
5851
5932
|
}),
|
|
5852
|
-
s(
|
|
5853
|
-
default:
|
|
5933
|
+
s(O, { value: "right" }, {
|
|
5934
|
+
default: E(() => [...n[88] ||= [o("右对齐", -1)]]),
|
|
5854
5935
|
_: 1
|
|
5855
5936
|
})
|
|
5856
5937
|
]),
|
|
@@ -5859,12 +5940,12 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5859
5940
|
_: 1
|
|
5860
5941
|
}),
|
|
5861
5942
|
s(p, { label: "字体样式" }, {
|
|
5862
|
-
default:
|
|
5943
|
+
default: E(() => [s(h, {
|
|
5863
5944
|
modelValue: Z.value.style.fontStyle,
|
|
5864
5945
|
"onUpdate:modelValue": n[46] ||= (e) => Z.value.style.fontStyle = e,
|
|
5865
5946
|
style: { width: "100%" }
|
|
5866
5947
|
}, {
|
|
5867
|
-
default:
|
|
5948
|
+
default: E(() => [
|
|
5868
5949
|
s(m, {
|
|
5869
5950
|
label: "正常",
|
|
5870
5951
|
value: "normal"
|
|
@@ -5897,24 +5978,24 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5897
5978
|
]),
|
|
5898
5979
|
_: 1
|
|
5899
5980
|
})])) : r("", !0),
|
|
5900
|
-
Y.value ? (g(), i("div",
|
|
5981
|
+
Y.value ? (g(), i("div", $r, [s(te, {
|
|
5901
5982
|
"label-position": "top",
|
|
5902
5983
|
size: "small"
|
|
5903
5984
|
}, {
|
|
5904
|
-
default:
|
|
5905
|
-
s(
|
|
5906
|
-
default:
|
|
5985
|
+
default: E(() => [
|
|
5986
|
+
s(j, { "content-position": "left" }, {
|
|
5987
|
+
default: E(() => [...n[89] ||= [o("箭头线设置", -1)]]),
|
|
5907
5988
|
_: 1
|
|
5908
5989
|
}),
|
|
5909
5990
|
s(p, { label: "线段颜色" }, {
|
|
5910
|
-
default:
|
|
5991
|
+
default: E(() => [s(T, {
|
|
5911
5992
|
modelValue: Y.value.style.lineColor,
|
|
5912
5993
|
"onUpdate:modelValue": n[47] ||= (e) => Y.value.style.lineColor = e
|
|
5913
5994
|
}, null, 8, ["modelValue"])]),
|
|
5914
5995
|
_: 1
|
|
5915
5996
|
}),
|
|
5916
5997
|
s(p, { label: "线段粗细" }, {
|
|
5917
|
-
default:
|
|
5998
|
+
default: E(() => [s(v, {
|
|
5918
5999
|
modelValue: Y.value.style.lineWidth,
|
|
5919
6000
|
"onUpdate:modelValue": n[48] ||= (e) => Y.value.style.lineWidth = e,
|
|
5920
6001
|
min: 1,
|
|
@@ -5925,15 +6006,15 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5925
6006
|
_: 1
|
|
5926
6007
|
}),
|
|
5927
6008
|
s(p, { label: "线段样式" }, {
|
|
5928
|
-
default:
|
|
6009
|
+
default: E(() => [s(A, {
|
|
5929
6010
|
modelValue: Y.value.style.lineStyle,
|
|
5930
6011
|
"onUpdate:modelValue": n[49] ||= (e) => Y.value.style.lineStyle = e
|
|
5931
6012
|
}, {
|
|
5932
|
-
default:
|
|
5933
|
-
default:
|
|
6013
|
+
default: E(() => [s(O, { value: "solid" }, {
|
|
6014
|
+
default: E(() => [...n[90] ||= [o("实线", -1)]]),
|
|
5934
6015
|
_: 1
|
|
5935
|
-
}), s(
|
|
5936
|
-
default:
|
|
6016
|
+
}), s(O, { value: "dashed" }, {
|
|
6017
|
+
default: E(() => [...n[91] ||= [o("虚线", -1)]]),
|
|
5937
6018
|
_: 1
|
|
5938
6019
|
})]),
|
|
5939
6020
|
_: 1
|
|
@@ -5941,15 +6022,15 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5941
6022
|
_: 1
|
|
5942
6023
|
}),
|
|
5943
6024
|
s(p, { label: "线段类型" }, {
|
|
5944
|
-
default:
|
|
6025
|
+
default: E(() => [s(A, {
|
|
5945
6026
|
modelValue: Y.value.style.lineType,
|
|
5946
6027
|
"onUpdate:modelValue": n[50] ||= (e) => Y.value.style.lineType = e
|
|
5947
6028
|
}, {
|
|
5948
|
-
default:
|
|
5949
|
-
default:
|
|
6029
|
+
default: E(() => [s(O, { value: "straight" }, {
|
|
6030
|
+
default: E(() => [...n[92] ||= [o("直线", -1)]]),
|
|
5950
6031
|
_: 1
|
|
5951
|
-
}), s(
|
|
5952
|
-
default:
|
|
6032
|
+
}), s(O, { value: "curve" }, {
|
|
6033
|
+
default: E(() => [...n[93] ||= [o("曲线", -1)]]),
|
|
5953
6034
|
_: 1
|
|
5954
6035
|
})]),
|
|
5955
6036
|
_: 1
|
|
@@ -5957,31 +6038,31 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5957
6038
|
_: 1
|
|
5958
6039
|
}),
|
|
5959
6040
|
s(p, { label: "箭头方向" }, {
|
|
5960
|
-
default:
|
|
6041
|
+
default: E(() => [s(M, {
|
|
5961
6042
|
modelValue: Y.value.style.arrowStart,
|
|
5962
6043
|
"onUpdate:modelValue": n[51] ||= (e) => Y.value.style.arrowStart = e
|
|
5963
6044
|
}, {
|
|
5964
|
-
default:
|
|
6045
|
+
default: E(() => [...n[94] ||= [o("起点箭头", -1)]]),
|
|
5965
6046
|
_: 1
|
|
5966
|
-
}, 8, ["modelValue"]), s(
|
|
6047
|
+
}, 8, ["modelValue"]), s(M, {
|
|
5967
6048
|
modelValue: Y.value.style.arrowEnd,
|
|
5968
6049
|
"onUpdate:modelValue": n[52] ||= (e) => Y.value.style.arrowEnd = e
|
|
5969
6050
|
}, {
|
|
5970
|
-
default:
|
|
6051
|
+
default: E(() => [...n[95] ||= [o("终点箭头", -1)]]),
|
|
5971
6052
|
_: 1
|
|
5972
6053
|
}, 8, ["modelValue"])]),
|
|
5973
6054
|
_: 1
|
|
5974
6055
|
}),
|
|
5975
|
-
s(
|
|
5976
|
-
default:
|
|
6056
|
+
s(j, { "content-position": "left" }, {
|
|
6057
|
+
default: E(() => [...n[96] ||= [o("连接状态", -1)]]),
|
|
5977
6058
|
_: 1
|
|
5978
6059
|
}),
|
|
5979
6060
|
s(p, { label: "起点连接" }, {
|
|
5980
|
-
default:
|
|
6061
|
+
default: E(() => [Y.value.startConnectId ? (g(), i("div", ei, [s(ne, {
|
|
5981
6062
|
size: "small",
|
|
5982
6063
|
type: "success"
|
|
5983
6064
|
}, {
|
|
5984
|
-
default:
|
|
6065
|
+
default: E(() => [o(x(Y.value.startConnectType === "node" ? "节点" : "文本框"), 1)]),
|
|
5985
6066
|
_: 1
|
|
5986
6067
|
}), s(l, {
|
|
5987
6068
|
size: "small",
|
|
@@ -5991,17 +6072,17 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
5991
6072
|
Y.value.startConnectId = null, Y.value.startConnectType = null, Y.value.startAnchor = null;
|
|
5992
6073
|
}
|
|
5993
6074
|
}, {
|
|
5994
|
-
default:
|
|
6075
|
+
default: E(() => [...n[97] ||= [o("断开", -1)]]),
|
|
5995
6076
|
_: 1
|
|
5996
|
-
})])) : (g(), i("span",
|
|
6077
|
+
})])) : (g(), i("span", ti, "未连接(点击锚点连接)"))]),
|
|
5997
6078
|
_: 1
|
|
5998
6079
|
}),
|
|
5999
6080
|
s(p, { label: "终点连接" }, {
|
|
6000
|
-
default:
|
|
6081
|
+
default: E(() => [Y.value.endConnectId ? (g(), i("div", ni, [s(ne, {
|
|
6001
6082
|
size: "small",
|
|
6002
6083
|
type: "success"
|
|
6003
6084
|
}, {
|
|
6004
|
-
default:
|
|
6085
|
+
default: E(() => [o(x(Y.value.endConnectType === "node" ? "节点" : "文本框"), 1)]),
|
|
6005
6086
|
_: 1
|
|
6006
6087
|
}), s(l, {
|
|
6007
6088
|
size: "small",
|
|
@@ -6011,19 +6092,19 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
6011
6092
|
Y.value.endConnectId = null, Y.value.endConnectType = null, Y.value.endAnchor = null;
|
|
6012
6093
|
}
|
|
6013
6094
|
}, {
|
|
6014
|
-
default:
|
|
6095
|
+
default: E(() => [...n[98] ||= [o("断开", -1)]]),
|
|
6015
6096
|
_: 1
|
|
6016
|
-
})])) : (g(), i("span",
|
|
6097
|
+
})])) : (g(), i("span", ri, "未连接(点击锚点连接)"))]),
|
|
6017
6098
|
_: 1
|
|
6018
6099
|
}),
|
|
6019
6100
|
s(p, null, {
|
|
6020
|
-
default:
|
|
6101
|
+
default: E(() => [s(l, {
|
|
6021
6102
|
type: "danger",
|
|
6022
6103
|
size: "small",
|
|
6023
|
-
onClick: n[55] ||= (e) =>
|
|
6104
|
+
onClick: n[55] ||= (e) => sn(Y.value.id)
|
|
6024
6105
|
}, {
|
|
6025
|
-
default:
|
|
6026
|
-
default:
|
|
6106
|
+
default: E(() => [s(c, null, {
|
|
6107
|
+
default: E(() => [s(S(se))]),
|
|
6027
6108
|
_: 1
|
|
6028
6109
|
}), n[99] ||= o(" 删除箭头线 ", -1)]),
|
|
6029
6110
|
_: 1
|
|
@@ -6033,48 +6114,48 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
6033
6114
|
]),
|
|
6034
6115
|
_: 1
|
|
6035
6116
|
})])) : r("", !0),
|
|
6036
|
-
!S(I) && !Z.value && !Y.value ? (g(), i("div",
|
|
6117
|
+
!S(I) && !Z.value && !Y.value ? (g(), i("div", ii, [s(c, {
|
|
6037
6118
|
size: 48,
|
|
6038
6119
|
color: "#c0c4cc"
|
|
6039
6120
|
}, {
|
|
6040
|
-
default:
|
|
6121
|
+
default: E(() => [s(S(ue))]),
|
|
6041
6122
|
_: 1
|
|
6042
6123
|
}), n[100] ||= a("p", null, "点击节点或标题进行编辑", -1)])) : r("", !0)
|
|
6043
|
-
], 512), [[
|
|
6124
|
+
], 512), [[w, Ft.value]])], 2)
|
|
6044
6125
|
]),
|
|
6045
|
-
s(
|
|
6046
|
-
modelValue:
|
|
6047
|
-
"onUpdate:modelValue": n[59] ||= (e) =>
|
|
6126
|
+
s(N, {
|
|
6127
|
+
modelValue: Sn.value,
|
|
6128
|
+
"onUpdate:modelValue": n[59] ||= (e) => Sn.value = e,
|
|
6048
6129
|
title: "添加子节点",
|
|
6049
6130
|
width: "400px",
|
|
6050
6131
|
"close-on-click-modal": !1
|
|
6051
6132
|
}, {
|
|
6052
|
-
footer:
|
|
6053
|
-
default:
|
|
6133
|
+
footer: E(() => [s(l, { onClick: n[58] ||= (e) => Sn.value = !1 }, {
|
|
6134
|
+
default: E(() => [...n[102] ||= [o("取消", -1)]]),
|
|
6054
6135
|
_: 1
|
|
6055
6136
|
}), s(l, {
|
|
6056
6137
|
type: "primary",
|
|
6057
|
-
onClick:
|
|
6138
|
+
onClick: En
|
|
6058
6139
|
}, {
|
|
6059
|
-
default:
|
|
6140
|
+
default: E(() => [...n[103] ||= [o("确定", -1)]]),
|
|
6060
6141
|
_: 1
|
|
6061
6142
|
})]),
|
|
6062
|
-
default:
|
|
6143
|
+
default: E(() => [s(te, {
|
|
6063
6144
|
"label-position": "top",
|
|
6064
6145
|
size: "small"
|
|
6065
6146
|
}, {
|
|
6066
|
-
default:
|
|
6067
|
-
default:
|
|
6147
|
+
default: E(() => [s(p, { label: "子节点名称" }, {
|
|
6148
|
+
default: E(() => [D(a("input", {
|
|
6068
6149
|
class: "node-name-input",
|
|
6069
|
-
"onUpdate:modelValue": n[56] ||= (e) =>
|
|
6150
|
+
"onUpdate:modelValue": n[56] ||= (e) => Cn.value.text = e,
|
|
6070
6151
|
placeholder: "请输入名称"
|
|
6071
|
-
}, null, 512), [[
|
|
6152
|
+
}, null, 512), [[C, Cn.value.text]])]),
|
|
6072
6153
|
_: 1
|
|
6073
6154
|
}), s(p, { label: "添加方向" }, {
|
|
6074
|
-
default:
|
|
6155
|
+
default: E(() => [D(a("select", {
|
|
6075
6156
|
class: "node-font-select",
|
|
6076
|
-
"onUpdate:modelValue": n[57] ||= (e) =>
|
|
6077
|
-
}, [...n[101] ||= [a("option", { value: "left" }, "左侧", -1), a("option", { value: "right" }, "右侧", -1)]], 512), [[
|
|
6157
|
+
"onUpdate:modelValue": n[57] ||= (e) => Cn.value.direction = e
|
|
6158
|
+
}, [...n[101] ||= [a("option", { value: "left" }, "左侧", -1), a("option", { value: "right" }, "右侧", -1)]], 512), [[ee, Cn.value.direction]])]),
|
|
6078
6159
|
_: 1
|
|
6079
6160
|
})]),
|
|
6080
6161
|
_: 1
|
|
@@ -6082,12 +6163,12 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
6082
6163
|
_: 1
|
|
6083
6164
|
}, 8, ["modelValue"]),
|
|
6084
6165
|
s(ar, {
|
|
6085
|
-
modelValue:
|
|
6086
|
-
"onUpdate:modelValue": n[60] ||= (e) =>
|
|
6087
|
-
"svg-element":
|
|
6166
|
+
modelValue: vt.value,
|
|
6167
|
+
"onUpdate:modelValue": n[60] ||= (e) => vt.value = e,
|
|
6168
|
+
"svg-element": yt.value,
|
|
6088
6169
|
"fishbone-data": S(F),
|
|
6089
|
-
"initial-format":
|
|
6090
|
-
onExported:
|
|
6170
|
+
"initial-format": bt.value,
|
|
6171
|
+
onExported: Mn
|
|
6091
6172
|
}, null, 8, [
|
|
6092
6173
|
"modelValue",
|
|
6093
6174
|
"svg-element",
|
|
@@ -6096,31 +6177,31 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
6096
6177
|
]),
|
|
6097
6178
|
s(l, {
|
|
6098
6179
|
class: "ai-chat-fab",
|
|
6099
|
-
type:
|
|
6180
|
+
type: re.value ? "primary" : "default",
|
|
6100
6181
|
circle: "",
|
|
6101
6182
|
size: "large",
|
|
6102
|
-
onClick: n[61] ||= (e) =>
|
|
6183
|
+
onClick: n[61] ||= (e) => re.value = !re.value,
|
|
6103
6184
|
title: "AI助手"
|
|
6104
6185
|
}, {
|
|
6105
|
-
default:
|
|
6106
|
-
default:
|
|
6186
|
+
default: E(() => [s(c, null, {
|
|
6187
|
+
default: E(() => [s(S(me))]),
|
|
6107
6188
|
_: 1
|
|
6108
6189
|
})]),
|
|
6109
6190
|
_: 1
|
|
6110
6191
|
}, 8, ["type"]),
|
|
6111
6192
|
s(Be, {
|
|
6112
|
-
visible:
|
|
6113
|
-
messages: S(
|
|
6114
|
-
loading: S(
|
|
6115
|
-
"is-collab": S(
|
|
6116
|
-
"collab-users": S(
|
|
6117
|
-
"current-user": S(
|
|
6118
|
-
"is-owner":
|
|
6119
|
-
onSend:
|
|
6120
|
-
onClose: n[62] ||= (e) =>
|
|
6121
|
-
"unread-mention": S(
|
|
6122
|
-
onClearUnread: n[63] ||= (e) => S(
|
|
6123
|
-
onClear:
|
|
6193
|
+
visible: re.value,
|
|
6194
|
+
messages: S(P).messages.value,
|
|
6195
|
+
loading: S(P).loading.value,
|
|
6196
|
+
"is-collab": S(P).isCollabMode.value,
|
|
6197
|
+
"collab-users": S(P).collabUsers.value,
|
|
6198
|
+
"current-user": S(P).currentUser.value,
|
|
6199
|
+
"is-owner": at.value,
|
|
6200
|
+
onSend: Ln,
|
|
6201
|
+
onClose: n[62] ||= (e) => re.value = !1,
|
|
6202
|
+
"unread-mention": S(P).unreadMention.value,
|
|
6203
|
+
onClearUnread: n[63] ||= (e) => S(P).clearUnreadMention(),
|
|
6204
|
+
onClear: Rn
|
|
6124
6205
|
}, null, 8, [
|
|
6125
6206
|
"visible",
|
|
6126
6207
|
"messages",
|
|
@@ -6132,15 +6213,15 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
6132
6213
|
"unread-mention"
|
|
6133
6214
|
]),
|
|
6134
6215
|
s(nt, {
|
|
6135
|
-
modelValue:
|
|
6136
|
-
"onUpdate:modelValue": n[64] ||= (e) =>
|
|
6216
|
+
modelValue: ie.value,
|
|
6217
|
+
"onUpdate:modelValue": n[64] ||= (e) => ie.value = e,
|
|
6137
6218
|
"document-id": S(F).id,
|
|
6138
|
-
onApply:
|
|
6219
|
+
onApply: Bn
|
|
6139
6220
|
}, null, 8, ["modelValue", "document-id"])
|
|
6140
6221
|
], 2);
|
|
6141
6222
|
};
|
|
6142
6223
|
}
|
|
6143
|
-
}, [["__scopeId", "data-v-
|
|
6224
|
+
}, [["__scopeId", "data-v-f4ad3ba7"]]), si = c({
|
|
6144
6225
|
name: "YourCompanyFishbone",
|
|
6145
6226
|
props: {
|
|
6146
6227
|
docId: {
|
|
@@ -6151,6 +6232,14 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
6151
6232
|
type: String,
|
|
6152
6233
|
default: "/api"
|
|
6153
6234
|
},
|
|
6235
|
+
saveApi: {
|
|
6236
|
+
type: [String, Function],
|
|
6237
|
+
default: null
|
|
6238
|
+
},
|
|
6239
|
+
loadApi: {
|
|
6240
|
+
type: [String, Function],
|
|
6241
|
+
default: null
|
|
6242
|
+
},
|
|
6154
6243
|
wsUrl: {
|
|
6155
6244
|
type: String,
|
|
6156
6245
|
default: ""
|
|
@@ -6166,14 +6255,18 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
|
|
|
6166
6255
|
roomId: {
|
|
6167
6256
|
type: String,
|
|
6168
6257
|
default: ""
|
|
6258
|
+
},
|
|
6259
|
+
uiConfig: {
|
|
6260
|
+
type: Object,
|
|
6261
|
+
default: () => ({})
|
|
6169
6262
|
}
|
|
6170
6263
|
},
|
|
6171
6264
|
setup(e, { slots: t }) {
|
|
6172
6265
|
return () => l("div", {
|
|
6173
6266
|
class: "yourcompany-fishbone-wrapper",
|
|
6174
6267
|
style: "position:relative"
|
|
6175
|
-
}, [l(
|
|
6268
|
+
}, [l(oi, { ...e }), l(A)]);
|
|
6176
6269
|
}
|
|
6177
6270
|
});
|
|
6178
6271
|
//#endregion
|
|
6179
|
-
export {
|
|
6272
|
+
export { si as default };
|