@blueking/bkflow-canvas-editor 1.1.0-beta.43 → 1.1.0-beta.45

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.
Files changed (40) hide show
  1. package/README.md +59 -2
  2. package/dist/advanced.cjs.js +1 -1
  3. package/dist/advanced.d.ts +69 -3
  4. package/dist/advanced.esm.js +1 -1
  5. package/dist/bkflow-canvas-editor_false-B70uLuHL.cjs +1 -0
  6. package/dist/bkflow-canvas-editor_false-BlC281Zg.cjs +1 -0
  7. package/dist/bkflow-canvas-editor_false-Casww7p4.js +5 -0
  8. package/dist/bkflow-canvas-editor_false-i9G8sqQi.js +5 -0
  9. package/dist/context-Bu4mmo1Q.js +1593 -0
  10. package/dist/context-bUpcrt8M.cjs +6 -0
  11. package/dist/index-Bb8gt0ZM.cjs +2 -0
  12. package/dist/index-BynYn4VD.cjs +1 -0
  13. package/dist/index-C1q_QVHM.cjs +1 -0
  14. package/dist/index-C8XJMS_J.js +236 -0
  15. package/dist/index-CddPhY6u.cjs +1 -0
  16. package/dist/{index-Bqm08e7H.js → index-CgRqOi-E.js} +28172 -28252
  17. package/dist/index-Ci_fP1q2.js +127 -0
  18. package/dist/index-ClbXmmTg.js +168 -0
  19. package/dist/index-DQG9J2SZ.js +137 -0
  20. package/dist/index-FcnoAxWL.cjs +82 -0
  21. package/dist/index-Htumo8sH.cjs +1 -0
  22. package/dist/index-_LhW2Gn_.js +647 -0
  23. package/dist/index-pYNKHhNh.js +73 -0
  24. package/dist/index-rLG78MgZ.cjs +1 -0
  25. package/dist/index.cjs.js +1 -1
  26. package/dist/index.d.ts +104 -4
  27. package/dist/index.esm.js +43 -34
  28. package/dist/style.css +1 -1
  29. package/package.json +1 -1
  30. package/dist/context-Bg6nsbrK.js +0 -688
  31. package/dist/context-iqnF_HqS.cjs +0 -1
  32. package/dist/index-B0DQFaEe.cjs +0 -82
  33. package/dist/index-BBNwbryo.cjs +0 -1
  34. package/dist/index-BSJC2Tb-.js +0 -512
  35. package/dist/index-BycpBKMO.cjs +0 -1
  36. package/dist/index-Ckij2Mxn.cjs +0 -1
  37. package/dist/index-D7t1wcMU.js +0 -234
  38. package/dist/index-DgQ-ScE5.js +0 -162
  39. package/dist/index.es.min-BpHMrg2Y.cjs +0 -2
  40. package/dist/index.es.min-DYp0DL9J.js +0 -3543
@@ -0,0 +1,647 @@
1
+ import { defineComponent as O, openBlock as c, createElementBlock as f, Fragment as P, renderList as G, unref as a, normalizeClass as D, toDisplayString as m, createBlock as Q, normalizeStyle as K, createElementVNode as s, ref as z, computed as v, watch as Z, nextTick as ue, resolveComponent as A, createVNode as k, withKeys as ie, withModifiers as re, createCommentVNode as j, resolveDirective as se, withDirectives as le, createTextVNode as C, createSlots as ee, withCtx as w, onBeforeUnmount as de } from "vue";
2
+ import "./context-Bu4mmo1Q.js";
3
+ import { L as ce, _ as H, E as pe, j as be, k as me, l as fe, t as _e, o as ve, n as ge, s as ke, q as ye, v as te, C as we, w as he, x as xe, y as Re } from "./index-CgRqOi-E.js";
4
+ import { t } from "@blueking/flow-canvas";
5
+ const I = {
6
+ finished: { icon: "bkflow-canvas-dark-circle-checkbox", color: "#5fb8ac" },
7
+ failed: { icon: "bkflow-canvas-dark-circle-close", color: "#fa4e41" },
8
+ revoked: { icon: "bkflow-canvas-stop-fill", color: "#fa4e41" },
9
+ running: { color: "#3a84ff", loading: !0 },
10
+ not_run: { icon: "bkflow-canvas-weizhixing2", color: "#b8bbc4" },
11
+ skipped: { icon: "bkflow-canvas-tiaoguo2", color: "#6e89af" },
12
+ suspended: { icon: "bkflow-canvas-zanting", color: "#f59500" },
13
+ invalid: { icon: "bkflow-canvas-yishixiao", color: "#ff802b" }
14
+ };
15
+ function q(u) {
16
+ switch (u) {
17
+ case "all":
18
+ return t("全部");
19
+ case "finished":
20
+ return t("成功");
21
+ case "failed":
22
+ return t("失败");
23
+ case "revoked":
24
+ return t("终止");
25
+ case "running":
26
+ return t("执行中");
27
+ case "not_run":
28
+ return t("待执行");
29
+ case "skipped":
30
+ return t("跳过");
31
+ case "suspended":
32
+ return t("挂起");
33
+ case "invalid":
34
+ return t("已失效");
35
+ }
36
+ }
37
+ const Ve = [
38
+ ["all", "finished", "failed", "revoked", "running"],
39
+ ["not_run", "skipped", "suspended", "invalid"]
40
+ ];
41
+ function X(u) {
42
+ return u.isInvalid ? "invalid" : u.status;
43
+ }
44
+ function $e(u, _) {
45
+ return _ === "all" ? u.length : u.filter((e) => X(e) === _).length;
46
+ }
47
+ const Ee = { class: "debug-status-filter-tabs" }, Te = ["data-status", "disabled", "aria-pressed", "onClick"], Ce = {
48
+ key: 0,
49
+ class: "debug-status-filter-tabs__label"
50
+ }, De = { class: "debug-status-filter-tabs__label" }, Me = /* @__PURE__ */ O({
51
+ __name: "status-filter-tabs",
52
+ props: {
53
+ modelValue: {},
54
+ nodes: {}
55
+ },
56
+ emits: ["update:modelValue"],
57
+ setup(u, { emit: _ }) {
58
+ const e = u, i = _, n = (p) => $e(e.nodes, p), d = (p) => p !== "all" && n(p) === 0, h = (p) => {
59
+ d(p) || i("update:modelValue", p);
60
+ };
61
+ return (p, y) => (c(), f("div", Ee, [
62
+ (c(!0), f(P, null, G(a(Ve), (x, $) => (c(), f("div", {
63
+ key: $,
64
+ class: "debug-status-filter-tabs__row",
65
+ "data-test": "status-filter-row"
66
+ }, [
67
+ (c(!0), f(P, null, G(x, (l) => (c(), f("button", {
68
+ key: l,
69
+ class: D([
70
+ "debug-status-filter-tabs__item",
71
+ `is-${l}`,
72
+ { "is-active": l === e.modelValue }
73
+ ]),
74
+ type: "button",
75
+ "data-test": "status-filter-item",
76
+ "data-status": l,
77
+ disabled: d(l),
78
+ "aria-pressed": l === e.modelValue,
79
+ onClick: (b) => h(l)
80
+ }, [
81
+ l === "all" ? (c(), f("span", Ce, m(a(q)(l)), 1)) : (c(), f(P, { key: 1 }, [
82
+ a(I)[l].loading ? (c(), Q(ce, {
83
+ key: 0,
84
+ class: "debug-status-filter-tabs__icon",
85
+ style: K({ color: a(I)[l].color }),
86
+ size: 14
87
+ }, null, 8, ["style"])) : (c(), f("i", {
88
+ key: 1,
89
+ class: D(["debug-status-filter-tabs__icon bkflow-canvas-icon", a(I)[l].icon]),
90
+ style: K({ color: a(I)[l].color })
91
+ }, null, 6)),
92
+ s("span", De, m(a(q)(l)) + " (" + m(n(l)) + ") ", 1)
93
+ ], 64))
94
+ ], 10, Te))), 128))
95
+ ]))), 128))
96
+ ]));
97
+ }
98
+ }), Se = /* @__PURE__ */ H(Me, [["__scopeId", "data-v-7de7925b"]]), Le = { class: "debug-result-node-list" }, Ne = ["data-node-id", "aria-selected", "onClick", "onKeydown"], Be = ["title"], Ie = {
99
+ key: 0,
100
+ class: "debug-result-node-list__mock",
101
+ "data-test": "node-mock-flag"
102
+ }, ze = {
103
+ key: 1,
104
+ class: "debug-result-node-list__empty"
105
+ }, Pe = /* @__PURE__ */ O({
106
+ __name: "node-list",
107
+ props: {
108
+ nodes: {},
109
+ modelValue: { default: "" }
110
+ },
111
+ emits: ["update:modelValue"],
112
+ setup(u, { emit: _ }) {
113
+ const e = u, i = _, n = z(""), d = z("all"), h = z(null), p = v(() => {
114
+ const l = n.value.trim().toLowerCase();
115
+ return e.nodes.filter((b) => d.value !== "all" && X(b) !== d.value ? !1 : l ? b.name.toLowerCase().includes(l) || b.type.toLowerCase().includes(l) || (b.typeName ?? "").toLowerCase().includes(l) : !0);
116
+ }), y = v(() => n.value.trim() ? t("搜索结果为空") : d.value !== "all" ? t("暂无{status}状态节点", {
117
+ status: q(d.value)
118
+ }) : t("暂无节点")), x = () => {
119
+ n.value = "", d.value = "all";
120
+ }, $ = (l) => {
121
+ const b = h.value, g = b?.querySelector(`[data-node-id="${CSS.escape(l)}"]`);
122
+ if (!b || !g) return;
123
+ const o = b.getBoundingClientRect(), E = g.getBoundingClientRect();
124
+ E.top < o.top ? b.scrollTop -= o.top - E.top : E.bottom > o.bottom && (b.scrollTop += E.bottom - o.bottom);
125
+ };
126
+ return Z(
127
+ () => e.modelValue,
128
+ async (l) => {
129
+ if (!l) return;
130
+ !p.value.some((g) => g.id === l) && e.nodes.some((g) => g.id === l) && (n.value = "", d.value = "all"), await ue(), $(l);
131
+ },
132
+ { flush: "post" }
133
+ ), (l, b) => {
134
+ const g = A("bk-input");
135
+ return c(), f("aside", Le, [
136
+ k(g, {
137
+ modelValue: n.value,
138
+ "onUpdate:modelValue": b[0] || (b[0] = (o) => n.value = o),
139
+ class: "debug-result-node-list__search",
140
+ placeholder: a(t)("搜索 节点名称、节点类型"),
141
+ type: "search",
142
+ clearable: "",
143
+ "data-test": "node-search"
144
+ }, null, 8, ["modelValue", "placeholder"]),
145
+ k(Se, {
146
+ modelValue: d.value,
147
+ "onUpdate:modelValue": b[1] || (b[1] = (o) => d.value = o),
148
+ class: "debug-result-node-list__filters",
149
+ "data-test": "status-filters",
150
+ nodes: e.nodes
151
+ }, null, 8, ["modelValue", "nodes"]),
152
+ p.value.length > 0 ? (c(), f("div", {
153
+ key: 0,
154
+ ref_key: "itemsRef",
155
+ ref: h,
156
+ class: "debug-result-node-list__items",
157
+ role: "listbox"
158
+ }, [
159
+ (c(!0), f(P, null, G(p.value, (o) => (c(), f("div", {
160
+ key: o.id,
161
+ class: D([
162
+ "debug-result-node-list__item",
163
+ `is-${o.status}`,
164
+ {
165
+ "is-active": o.id === e.modelValue,
166
+ "is-unconfigured": !o.isConfigured
167
+ }
168
+ ]),
169
+ role: "option",
170
+ "data-test": "node-item",
171
+ "data-node-id": o.id,
172
+ "aria-selected": o.id === e.modelValue,
173
+ tabindex: "0",
174
+ onClick: (E) => i("update:modelValue", o.id),
175
+ onKeydown: ie(re((E) => i("update:modelValue", o.id), ["prevent"]), ["enter", "space"])
176
+ }, [
177
+ s("span", {
178
+ class: D([
179
+ "debug-result-node-list__status",
180
+ `is-${a(X)(o)}`,
181
+ { "is-placeholder": !o.isConfigured }
182
+ ])
183
+ }, [
184
+ o.icon ? (c(), f("i", {
185
+ key: 0,
186
+ class: D(o.icon),
187
+ "data-test": "node-icon"
188
+ }, null, 2)) : j("", !0)
189
+ ], 2),
190
+ s("span", {
191
+ class: "debug-result-node-list__name",
192
+ title: o.isConfigured ? `${o.name} ${o.typeName || o.type}` : o.name
193
+ }, m(o.name), 9, Be),
194
+ o.isMock ? (c(), f("span", Ie, "MOCK")) : j("", !0)
195
+ ], 42, Ne))), 128))
196
+ ], 512)) : (c(), f("div", ze, [
197
+ k(pe, {
198
+ "is-search": !1,
199
+ title: y.value,
200
+ onClear: x
201
+ }, null, 8, ["title"])
202
+ ]))
203
+ ]);
204
+ };
205
+ }
206
+ }), Ae = /* @__PURE__ */ H(Pe, [["__scopeId", "data-v-3d90cfb1"]]);
207
+ function Oe(u) {
208
+ if (u == null) return "";
209
+ if (typeof u == "string") return u;
210
+ if (typeof u == "object") {
211
+ const _ = u, e = _.message;
212
+ if (typeof e == "string" && e) {
213
+ const i = _.type;
214
+ return typeof i == "string" && i ? `${i}: ${e}` : e;
215
+ }
216
+ try {
217
+ return JSON.stringify(u);
218
+ } catch {
219
+ return String(u);
220
+ }
221
+ }
222
+ return String(u);
223
+ }
224
+ const He = {
225
+ class: "execution-record",
226
+ "data-test": "execution-record"
227
+ }, Ue = { class: "execution-record__table" }, Fe = { key: 0 }, Ge = /* @__PURE__ */ O({
228
+ __name: "execution-record",
229
+ props: {
230
+ result: {},
231
+ isDeleted: { type: Boolean, default: !1 }
232
+ },
233
+ setup(u) {
234
+ const _ = u, e = (d) => d || "--", i = v(() => {
235
+ const { executor: d, startTime: h, finishTime: p, elapsedSeconds: y, durationMs: x } = _.result.execution, $ = y ?? (typeof x == "number" ? Math.floor(x / 1e3) : void 0);
236
+ return [
237
+ { label: t("执行人"), value: e(d) },
238
+ { label: t("开始时间"), value: e(h) },
239
+ { label: t("结束时间"), value: e(p) },
240
+ { label: t("耗时"), value: be($) }
241
+ ];
242
+ }), n = v(() => {
243
+ const { status: d, configChanged: h, errorDetail: p } = _.result.execution;
244
+ if (_.isDeleted || h) {
245
+ const { icon: b, color: g } = I.invalid;
246
+ return {
247
+ prefix: t("已失效:"),
248
+ text: _.isDeleted ? t("该节点已被删除,调试结果无效") : t("该节点配置已修改,需要重新调试"),
249
+ icon: b,
250
+ color: g
251
+ };
252
+ }
253
+ const { icon: y, color: x } = I[d], $ = q(d), l = d === "failed" ? Oe(p || _.result.error) : "";
254
+ return {
255
+ prefix: "",
256
+ text: l ? t("{status}:{error}", { status: $, error: l }) : $,
257
+ icon: y,
258
+ color: x
259
+ };
260
+ });
261
+ return (d, h) => {
262
+ const p = se("bkloading");
263
+ return le((c(), f("div", He, [
264
+ s("table", Ue, [
265
+ s("tbody", null, [
266
+ (c(!0), f(P, null, G(i.value, (y) => (c(), f("tr", {
267
+ key: y.label
268
+ }, [
269
+ s("th", null, m(y.label), 1),
270
+ s("td", null, m(y.value), 1)
271
+ ]))), 128)),
272
+ s("tr", null, [
273
+ s("th", null, m(a(t)("调试结果")), 1),
274
+ s("td", null, [
275
+ s("span", {
276
+ class: "execution-record__status",
277
+ style: K({ color: n.value.color })
278
+ }, [
279
+ n.value.icon ? (c(), f("i", {
280
+ key: 0,
281
+ class: D(["bkflow-canvas-icon", n.value.icon]),
282
+ "aria-hidden": "true"
283
+ }, null, 2)) : j("", !0),
284
+ s("span", null, [
285
+ n.value.prefix ? (c(), f("strong", Fe, m(n.value.prefix), 1)) : j("", !0),
286
+ C(m(n.value.text), 1)
287
+ ])
288
+ ], 4)
289
+ ])
290
+ ])
291
+ ])
292
+ ])
293
+ ])), [
294
+ [p, { loading: _.result.loading }]
295
+ ]);
296
+ };
297
+ }
298
+ }), Ke = /* @__PURE__ */ H(Ge, [["__scopeId", "data-v-5cfcb28b"]]), je = { class: "debug-result-tabs" }, qe = {
299
+ class: "debug-result-tabs__failed-actions",
300
+ "data-test": "output-error-actions"
301
+ }, Ye = { class: "debug-result-tabs__label" }, Je = { class: "debug-result-tabs__label" }, We = { class: "debug-result-tabs__label" }, Qe = {
302
+ class: "debug-result-tabs__mock-hint",
303
+ "data-test": "mock-banner"
304
+ }, Xe = { class: "debug-result-tabs__label" }, Ze = {
305
+ class: "debug-result-tabs__logs",
306
+ "data-test": "tab-logs"
307
+ }, et = /* @__PURE__ */ O({
308
+ __name: "result-tabs",
309
+ props: {
310
+ result: {},
311
+ component: {},
312
+ isMock: { type: Boolean, default: !1 },
313
+ isDeleted: { type: Boolean, default: !1 },
314
+ canRunNodeDebug: { type: Boolean, default: !1 }
315
+ },
316
+ emits: ["reEditMock", "runReal", "runMock", "logsTabActive"],
317
+ setup(u, { emit: _ }) {
318
+ const e = u, i = _, n = z("execution");
319
+ Z(
320
+ n,
321
+ (T) => i("logsTabActive", T === "logs"),
322
+ { immediate: !0 }
323
+ );
324
+ const d = v(() => e.result.execution.status === "revoked"), h = v(() => me(e.result.execution.status)), p = v(
325
+ () => d.value ? t("该节点调试已终止,可") : t("该节点执行失败,可")
326
+ ), {
327
+ loading: y,
328
+ error: x,
329
+ visibleInputs: $,
330
+ visibleOutputs: l,
331
+ outputNameMap: b
332
+ } = fe({ component: () => e.component }), g = v(() => e.result.loading || y.value), o = v(() => e.result.detailError || x.value), E = v(() => {
333
+ const { inputs: T } = e.result;
334
+ return e.component ? $.value.filter(({ key: r }) => Object.prototype.hasOwnProperty.call(T, r)).map(({ key: r, name: M }) => ({ key: r, name: M, value: T[r] })) : _e(T);
335
+ }), U = v(
336
+ () => ve(
337
+ ge(e.result.outputs, b.value),
338
+ l.value.map((T) => T.key)
339
+ )
340
+ ), F = v(
341
+ () => e.canRunNodeDebug && !e.isDeleted && ke(e.isMock, l.value)
342
+ ), S = v(() => e.result.logs == null ? "" : ye(e.result.logs));
343
+ return (T, r) => {
344
+ const M = A("bk-button"), L = A("bk-tab-panel"), Y = A("bk-tab");
345
+ return c(), f("div", je, [
346
+ k(Y, {
347
+ active: n.value,
348
+ "onUpdate:active": r[3] || (r[3] = (N) => n.value = N),
349
+ type: "card-grid"
350
+ }, ee({
351
+ default: w(() => [
352
+ k(L, {
353
+ name: "execution",
354
+ label: a(t)("执行记录")
355
+ }, {
356
+ label: w(() => [
357
+ s("span", Ye, [
358
+ r[5] || (r[5] = s("i", {
359
+ class: "bkflow-canvas-icon bkflow-canvas-xiangqing",
360
+ "aria-hidden": "true"
361
+ }, null, -1)),
362
+ C(m(a(t)("执行记录")), 1)
363
+ ])
364
+ ]),
365
+ default: w(() => [
366
+ k(Ke, {
367
+ result: e.result,
368
+ "is-deleted": e.isDeleted
369
+ }, null, 8, ["result", "is-deleted"])
370
+ ]),
371
+ _: 1
372
+ }, 8, ["label"]),
373
+ k(L, {
374
+ name: "inputs",
375
+ label: a(t)("输入参数")
376
+ }, {
377
+ label: w(() => [
378
+ s("span", Je, [
379
+ r[6] || (r[6] = s("i", {
380
+ class: "bkflow-canvas-icon bkflow-canvas-daoru",
381
+ "aria-hidden": "true"
382
+ }, null, -1)),
383
+ C(m(a(t)("输入参数")), 1)
384
+ ])
385
+ ]),
386
+ default: w(() => [
387
+ k(te, {
388
+ rows: E.value,
389
+ loading: g.value,
390
+ error: o.value,
391
+ "empty-text": a(t)("暂无输入参数")
392
+ }, null, 8, ["rows", "loading", "error", "empty-text"])
393
+ ]),
394
+ _: 1
395
+ }, 8, ["label"]),
396
+ k(L, {
397
+ name: "outputs",
398
+ label: a(t)("输出结果")
399
+ }, {
400
+ label: w(() => [
401
+ s("span", We, [
402
+ r[7] || (r[7] = s("i", {
403
+ class: "bkflow-canvas-icon bkflow-canvas-daochu",
404
+ "aria-hidden": "true"
405
+ }, null, -1)),
406
+ C(m(a(t)("输出结果")), 1)
407
+ ])
408
+ ]),
409
+ default: w(() => [
410
+ k(te, {
411
+ rows: U.value,
412
+ loading: g.value,
413
+ error: o.value,
414
+ "empty-text": a(t)("暂无输出结果")
415
+ }, ee({ _: 2 }, [
416
+ F.value ? {
417
+ name: "toolbar",
418
+ fn: w(() => [
419
+ s("div", Qe, [
420
+ r[8] || (r[8] = s("i", {
421
+ class: "bkflow-canvas-icon bkflow-canvas-info debug-result-tabs__mock-info",
422
+ "aria-hidden": "true"
423
+ }, null, -1)),
424
+ s("span", null, m(a(t)("当前为 Mock 数据")), 1),
425
+ k(M, {
426
+ text: "",
427
+ theme: "primary",
428
+ size: "small",
429
+ "data-test": "re-edit-mock",
430
+ onClick: r[2] || (r[2] = (N) => i("reEditMock"))
431
+ }, {
432
+ default: w(() => [
433
+ C(m(a(t)("重新编辑")), 1)
434
+ ]),
435
+ _: 1
436
+ })
437
+ ])
438
+ ]),
439
+ key: "0"
440
+ } : void 0
441
+ ]), 1032, ["rows", "loading", "error", "empty-text"])
442
+ ]),
443
+ _: 1
444
+ }, 8, ["label"]),
445
+ k(L, {
446
+ name: "logs",
447
+ label: a(t)("调用日志")
448
+ }, {
449
+ label: w(() => [
450
+ s("span", Xe, [
451
+ r[9] || (r[9] = s("i", {
452
+ class: "bkflow-canvas-icon bkflow-canvas-rizhi",
453
+ "aria-hidden": "true"
454
+ }, null, -1)),
455
+ C(m(a(t)("调用日志")), 1)
456
+ ])
457
+ ]),
458
+ default: w(() => [
459
+ s("div", Ze, [
460
+ k(we, {
461
+ "log-text": S.value,
462
+ loading: e.result.logLoading,
463
+ error: e.result.logError
464
+ }, null, 8, ["log-text", "loading", "error"])
465
+ ])
466
+ ]),
467
+ _: 1
468
+ }, 8, ["label"])
469
+ ]),
470
+ _: 2
471
+ }, [
472
+ h.value && e.canRunNodeDebug ? {
473
+ name: "setting",
474
+ fn: w(() => [
475
+ s("div", qe, [
476
+ r[4] || (r[4] = s("i", { class: "bkflow-canvas-icon bkflow-canvas-alert" }, null, -1)),
477
+ s("span", null, m(p.value), 1),
478
+ k(M, {
479
+ text: "",
480
+ theme: "primary",
481
+ "data-test": "rerun-real",
482
+ onClick: r[0] || (r[0] = (N) => i("runReal"))
483
+ }, {
484
+ default: w(() => [
485
+ C(m(a(t)("重新调试")), 1)
486
+ ]),
487
+ _: 1
488
+ }),
489
+ s("span", null, m(a(t)("或直接")), 1),
490
+ k(M, {
491
+ text: "",
492
+ theme: "primary",
493
+ "data-test": "run-mock",
494
+ onClick: r[1] || (r[1] = (N) => i("runMock"))
495
+ }, {
496
+ default: w(() => [
497
+ C(m(a(t)("Mock 输出")), 1)
498
+ ]),
499
+ _: 1
500
+ })
501
+ ])
502
+ ]),
503
+ key: "0"
504
+ } : void 0
505
+ ]), 1032, ["active"])
506
+ ]);
507
+ };
508
+ }
509
+ }), tt = /* @__PURE__ */ H(et, [["__scopeId", "data-v-0e5cd69b"]]), st = { class: "debug-result-drawer__header" }, lt = { class: "debug-result-drawer__header-left" }, ot = { class: "debug-result-drawer__title" }, at = { class: "debug-result-drawer__body" }, nt = { class: "debug-result-drawer__content" }, ut = { class: "debug-result-drawer__result" }, it = {
510
+ key: 1,
511
+ class: "debug-result-drawer__unselected",
512
+ "data-test": "node-unselected"
513
+ }, B = 44, W = 420, rt = /* @__PURE__ */ O({
514
+ __name: "index",
515
+ props: {
516
+ open: { type: Boolean },
517
+ context: {},
518
+ pipelineTree: {},
519
+ modelValue: { default: "" },
520
+ result: {},
521
+ hasGlobalRun: { type: Boolean, default: !1 },
522
+ viewParamsPending: { type: Boolean, default: !1 },
523
+ offsetLeft: { default: 0 }
524
+ },
525
+ emits: ["update:open", "update:modelValue", "reEditMock", "runReal", "runMock", "viewParams", "logsTabActive"],
526
+ setup(u, { emit: _ }) {
527
+ const e = u, i = _, n = z(W), d = z(!1);
528
+ let h = 0, p = 0, y = "", x = "";
529
+ const $ = v(() => ({
530
+ left: `${e.offsetLeft}px`,
531
+ height: `${e.open ? n.value : B}px`
532
+ })), l = () => {
533
+ e.open || (n.value = W), i("update:open", !e.open);
534
+ }, b = (R) => {
535
+ const V = R > B;
536
+ V !== e.open && i("update:open", V);
537
+ }, g = (R) => {
538
+ const V = p - (R.clientY - h);
539
+ n.value = Math.max(B, Math.min(window.innerHeight * 0.8, V)), b(n.value);
540
+ }, o = () => {
541
+ document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", o), document.body.style.cursor = y, document.body.style.userSelect = x, d.value = !1, n.value <= B && (n.value = W, i("update:open", !1));
542
+ }, E = (R) => {
543
+ R.preventDefault(), d.value = !0, h = R.clientY, e.open ? p = n.value : (i("update:open", !0), n.value = B, p = B), y = document.body.style.cursor, x = document.body.style.userSelect, document.body.style.cursor = "ns-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", g), document.addEventListener("mouseup", o);
544
+ };
545
+ de(o);
546
+ const U = v({
547
+ get: () => e.modelValue,
548
+ set: (R) => i("update:modelValue", R)
549
+ });
550
+ Z(
551
+ () => e.modelValue,
552
+ (R) => {
553
+ R || i("logsTabActive", !1);
554
+ },
555
+ { immediate: !0 }
556
+ );
557
+ const F = v(
558
+ () => he(e.pipelineTree, e.context?.debug_snapshot?.nodes)
559
+ ), S = v(() => F.value.find((R) => R.id === e.modelValue)), T = v(() => S.value?.isMock ?? !1), r = v(
560
+ () => xe(
561
+ e.result.component,
562
+ e.pipelineTree?.activities?.[e.modelValue]?.component,
563
+ S.value
564
+ )
565
+ ), M = v(() => Re(S.value)), L = () => {
566
+ !e.hasGlobalRun || e.viewParamsPending || i("viewParams");
567
+ }, Y = () => {
568
+ e.modelValue && i("reEditMock", e.modelValue);
569
+ }, N = () => {
570
+ e.modelValue && i("runReal", e.modelValue);
571
+ }, oe = () => {
572
+ e.modelValue && i("runMock", e.modelValue);
573
+ };
574
+ return (R, V) => {
575
+ const ae = A("bk-button"), ne = se("bk-tooltips");
576
+ return c(), f("div", {
577
+ class: D(["debug-result-drawer-wrapper", { "is-resizing": d.value }]),
578
+ style: K($.value)
579
+ }, [
580
+ s("div", {
581
+ class: "debug-result-drawer__resize",
582
+ onMousedown: E
583
+ }, null, 32),
584
+ s("section", {
585
+ class: D(["debug-result-drawer", { "is-collapsed": !e.open }])
586
+ }, [
587
+ s("header", st, [
588
+ s("div", lt, [
589
+ s("span", ot, m(a(t)("调试结果")), 1),
590
+ V[3] || (V[3] = s("span", { class: "debug-result-drawer__divider" }, null, -1)),
591
+ le((c(), Q(ae, {
592
+ text: "",
593
+ theme: "primary",
594
+ disabled: !e.hasGlobalRun,
595
+ loading: e.viewParamsPending,
596
+ onClick: L
597
+ }, {
598
+ default: w(() => [
599
+ V[2] || (V[2] = s("i", { class: "bkflow-canvas-icon bkflow-canvas-audit view-params-icon" }, null, -1)),
600
+ C(" " + m(a(t)("查看参数")), 1)
601
+ ]),
602
+ _: 1
603
+ }, 8, ["disabled", "loading"])), [
604
+ [ne, { content: a(t)("请先进行调试"), disabled: e.hasGlobalRun }]
605
+ ])
606
+ ]),
607
+ s("span", {
608
+ class: "debug-result-drawer__collapse",
609
+ onClick: l
610
+ }, [
611
+ s("span", null, m(e.open ? a(t)("收起") : a(t)("展开")), 1),
612
+ s("i", {
613
+ class: D(["bkflow-canvas-icon bkflow-canvas-arrows-down debug-result-drawer__collapse-icon", { "is-expanded": e.open }])
614
+ }, null, 2)
615
+ ])
616
+ ]),
617
+ s("div", at, [
618
+ s("div", nt, [
619
+ k(Ae, {
620
+ modelValue: U.value,
621
+ "onUpdate:modelValue": V[0] || (V[0] = (J) => U.value = J),
622
+ nodes: F.value
623
+ }, null, 8, ["modelValue", "nodes"]),
624
+ s("div", ut, [
625
+ e.modelValue ? (c(), Q(tt, {
626
+ key: 0,
627
+ result: e.result,
628
+ component: r.value,
629
+ "is-mock": T.value,
630
+ "is-deleted": S.value?.isDeleted,
631
+ "can-run-node-debug": M.value,
632
+ onReEditMock: Y,
633
+ onRunReal: N,
634
+ onRunMock: oe,
635
+ onLogsTabActive: V[1] || (V[1] = (J) => i("logsTabActive", J))
636
+ }, null, 8, ["result", "component", "is-mock", "is-deleted", "can-run-node-debug"])) : (c(), f("div", it, m(a(t)("请先选择节点查看调试详情")), 1))
637
+ ])
638
+ ])
639
+ ])
640
+ ], 2)
641
+ ], 6);
642
+ };
643
+ }
644
+ }), mt = /* @__PURE__ */ H(rt, [["__scopeId", "data-v-bbef416a"]]);
645
+ export {
646
+ mt as default
647
+ };