@blueking/bkflow-canvas-editor 1.1.0-beta.13 → 1.1.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-BATMae55.cjs +1 -0
- package/dist/{index-CL-6xfse.cjs → index-BbRhlaw6.cjs} +1 -1
- package/dist/{index-BtDOlbGL.cjs → index-CfoxDV8-.cjs} +25 -25
- package/dist/index-Ck8QaRqx.js +544 -0
- package/dist/{index-TlWjZWTn.js → index-DBNQiAYu.js} +4565 -4548
- package/dist/{index-CDYnK9uR.js → index-DNLxEB2o.js} +1 -1
- package/dist/{index-Bd-uczft.js → index-DuDHvlNA.js} +1 -1
- package/dist/{index-BWYUlSrn.cjs → index-E1QKDB8Z.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index-SgitELxm.cjs +0 -1
- package/dist/index-Sh7Bi-no.js +0 -540
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
import { defineComponent as I, ref as T, computed as c, watch as Y, nextTick as X, resolveComponent as P, openBlock as f, createElementBlock as k, createVNode as m, Fragment as Z, renderList as ee, withKeys as te, withModifiers as se, normalizeClass as N, createElementVNode as n, createCommentVNode as H, toDisplayString as B, createSlots as K, withCtx as y, createTextVNode as D, onBeforeUnmount as oe, resolveDirective as ae, normalizeStyle as ne, withDirectives as le, createBlock as q } from "vue";
|
|
2
|
+
import { L as ie, S as ue, E as re, _ as j, b as de, c as ce, t as pe, n as me, D as J, C as ve, d as be, s as fe } from "./index-DBNQiAYu.js";
|
|
3
|
+
import { a as U } from "./composable-C5enWl9b.js";
|
|
4
|
+
const ge = { class: "debug-result-node-list" }, _e = ["data-node-id", "aria-selected", "onClick", "onKeydown"], ye = ["title"], ke = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "debug-result-node-list__mock",
|
|
7
|
+
"data-test": "node-mock-flag"
|
|
8
|
+
}, we = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "debug-result-node-list__empty"
|
|
11
|
+
}, xe = /* @__PURE__ */ I({
|
|
12
|
+
__name: "node-list",
|
|
13
|
+
props: {
|
|
14
|
+
nodes: {},
|
|
15
|
+
modelValue: { default: "" }
|
|
16
|
+
},
|
|
17
|
+
emits: ["update:modelValue"],
|
|
18
|
+
setup(t, { emit: d }) {
|
|
19
|
+
const e = t, l = d, s = T(""), i = T("all"), g = T(null), _ = [
|
|
20
|
+
{ value: "all", label: "全部" },
|
|
21
|
+
{ value: "finished", icon: "bkflow-canvas-dark-circle-checkbox", iconColor: "#5fb8ac" },
|
|
22
|
+
{ value: "failed", icon: "bkflow-canvas-dark-circle-close", iconColor: "#fa4e41" },
|
|
23
|
+
{ value: "running", iconComponent: ie, iconColor: "#3a84ff" },
|
|
24
|
+
{ value: "not_run", icon: "bkflow-canvas-weizhixing2", iconColor: "#b8bbc4" },
|
|
25
|
+
{ value: "suspended", icon: "bkflow-canvas-zanting", iconColor: "#f59500" },
|
|
26
|
+
{ value: "skipped", icon: "bkflow-canvas-tiaoguo2", iconColor: "#6e89af" }
|
|
27
|
+
], E = c(
|
|
28
|
+
() => _.map((u) => ({
|
|
29
|
+
...u,
|
|
30
|
+
count: u.value === "all" ? e.nodes.length : e.nodes.filter((r) => r.status === u.value).length
|
|
31
|
+
}))
|
|
32
|
+
), C = c(() => {
|
|
33
|
+
const u = s.value.trim().toLowerCase();
|
|
34
|
+
return e.nodes.filter((r) => i.value !== "all" && r.status !== i.value ? !1 : u ? r.name.toLowerCase().includes(u) || r.type.toLowerCase().includes(u) || (r.typeName ?? "").toLowerCase().includes(u) : !0);
|
|
35
|
+
}), S = {
|
|
36
|
+
not_run: "未执行",
|
|
37
|
+
finished: "成功",
|
|
38
|
+
failed: "失败",
|
|
39
|
+
running: "正在调试",
|
|
40
|
+
suspended: "挂起",
|
|
41
|
+
skipped: "跳过"
|
|
42
|
+
}, L = c(() => s.value.trim() ? "搜索结果为空" : i.value !== "all" ? `暂无${S[i.value]}状态节点` : "暂无节点"), $ = () => {
|
|
43
|
+
s.value = "", i.value = "all";
|
|
44
|
+
}, h = (u) => {
|
|
45
|
+
const r = g.value, b = r?.querySelector(`[data-node-id="${CSS.escape(u)}"]`);
|
|
46
|
+
if (!r || !b) return;
|
|
47
|
+
const a = r.getBoundingClientRect(), w = b.getBoundingClientRect();
|
|
48
|
+
w.top < a.top ? r.scrollTop -= a.top - w.top : w.bottom > a.bottom && (r.scrollTop += w.bottom - a.bottom);
|
|
49
|
+
};
|
|
50
|
+
return Y(
|
|
51
|
+
() => e.modelValue,
|
|
52
|
+
async (u) => {
|
|
53
|
+
if (!u) return;
|
|
54
|
+
!C.value.some((b) => b.id === u) && e.nodes.some((b) => b.id === u) && (s.value = "", i.value = "all"), await X(), h(u);
|
|
55
|
+
},
|
|
56
|
+
{ flush: "post" }
|
|
57
|
+
), (u, r) => {
|
|
58
|
+
const b = P("bk-input");
|
|
59
|
+
return f(), k("aside", ge, [
|
|
60
|
+
m(b, {
|
|
61
|
+
modelValue: s.value,
|
|
62
|
+
"onUpdate:modelValue": r[0] || (r[0] = (a) => s.value = a),
|
|
63
|
+
class: "debug-result-node-list__search",
|
|
64
|
+
placeholder: "搜索节点名称 / 类型",
|
|
65
|
+
type: "search",
|
|
66
|
+
clearable: "",
|
|
67
|
+
"data-test": "node-search"
|
|
68
|
+
}, null, 8, ["modelValue"]),
|
|
69
|
+
m(ue, {
|
|
70
|
+
modelValue: i.value,
|
|
71
|
+
"onUpdate:modelValue": r[1] || (r[1] = (a) => i.value = a),
|
|
72
|
+
class: "debug-result-node-list__filters",
|
|
73
|
+
"data-test": "status-filters",
|
|
74
|
+
items: E.value
|
|
75
|
+
}, null, 8, ["modelValue", "items"]),
|
|
76
|
+
C.value.length > 0 ? (f(), k("div", {
|
|
77
|
+
key: 0,
|
|
78
|
+
ref_key: "itemsRef",
|
|
79
|
+
ref: g,
|
|
80
|
+
class: "debug-result-node-list__items",
|
|
81
|
+
role: "listbox"
|
|
82
|
+
}, [
|
|
83
|
+
(f(!0), k(Z, null, ee(C.value, (a) => (f(), k("div", {
|
|
84
|
+
key: a.id,
|
|
85
|
+
class: N([
|
|
86
|
+
"debug-result-node-list__item",
|
|
87
|
+
`is-${a.status}`,
|
|
88
|
+
{
|
|
89
|
+
"is-active": a.id === e.modelValue,
|
|
90
|
+
"is-unconfigured": !a.isConfigured
|
|
91
|
+
}
|
|
92
|
+
]),
|
|
93
|
+
role: "option",
|
|
94
|
+
"data-test": "node-item",
|
|
95
|
+
"data-node-id": a.id,
|
|
96
|
+
"aria-selected": a.id === e.modelValue,
|
|
97
|
+
tabindex: "0",
|
|
98
|
+
onClick: (w) => l("update:modelValue", a.id),
|
|
99
|
+
onKeydown: te(se((w) => l("update:modelValue", a.id), ["prevent"]), ["enter", "space"])
|
|
100
|
+
}, [
|
|
101
|
+
n("span", {
|
|
102
|
+
class: N([
|
|
103
|
+
"debug-result-node-list__status",
|
|
104
|
+
`is-${a.status}`,
|
|
105
|
+
{ "is-placeholder": !a.isConfigured }
|
|
106
|
+
])
|
|
107
|
+
}, [
|
|
108
|
+
a.icon ? (f(), k("i", {
|
|
109
|
+
key: 0,
|
|
110
|
+
class: N(a.icon),
|
|
111
|
+
"data-test": "node-icon"
|
|
112
|
+
}, null, 2)) : H("", !0)
|
|
113
|
+
], 2),
|
|
114
|
+
n("span", {
|
|
115
|
+
class: "debug-result-node-list__name",
|
|
116
|
+
title: a.isConfigured ? `${a.name} ${a.typeName || a.type}` : a.name
|
|
117
|
+
}, B(a.name), 9, ye),
|
|
118
|
+
a.isMock ? (f(), k("span", ke, "MOCK")) : H("", !0)
|
|
119
|
+
], 42, _e))), 128))
|
|
120
|
+
], 512)) : (f(), k("div", we, [
|
|
121
|
+
m(re, {
|
|
122
|
+
"is-search": !1,
|
|
123
|
+
title: L.value,
|
|
124
|
+
onClear: $
|
|
125
|
+
}, null, 8, ["title"])
|
|
126
|
+
]))
|
|
127
|
+
]);
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}), Ce = /* @__PURE__ */ j(xe, [["__scopeId", "data-v-30d37bc1"]]);
|
|
131
|
+
function Ee(t) {
|
|
132
|
+
if (t == null) return "";
|
|
133
|
+
if (typeof t == "string") return t;
|
|
134
|
+
if (typeof t == "object") {
|
|
135
|
+
const d = t, e = d.message;
|
|
136
|
+
if (typeof e == "string" && e) {
|
|
137
|
+
const l = d.type;
|
|
138
|
+
return typeof l == "string" && l ? `${l}: ${e}` : e;
|
|
139
|
+
}
|
|
140
|
+
try {
|
|
141
|
+
return JSON.stringify(t);
|
|
142
|
+
} catch {
|
|
143
|
+
return String(t);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return String(t);
|
|
147
|
+
}
|
|
148
|
+
const he = { class: "debug-result-tabs" }, Ve = {
|
|
149
|
+
class: "debug-result-tabs__failed-actions",
|
|
150
|
+
"data-test": "output-error-actions"
|
|
151
|
+
}, Me = {
|
|
152
|
+
class: "debug-result-tabs__execution",
|
|
153
|
+
"data-test": "tab-execution"
|
|
154
|
+
}, Re = { class: "debug-result-tabs__row" }, Te = { class: "value" }, Ne = { class: "debug-result-tabs__row" }, Se = { class: "value" }, Le = {
|
|
155
|
+
key: 0,
|
|
156
|
+
class: "debug-result-tabs__row is-error"
|
|
157
|
+
}, $e = { class: "value" }, Ae = {
|
|
158
|
+
class: "debug-result-tabs__mock-hint",
|
|
159
|
+
"data-test": "mock-banner"
|
|
160
|
+
}, Pe = {
|
|
161
|
+
class: "debug-result-tabs__logs",
|
|
162
|
+
"data-test": "tab-logs"
|
|
163
|
+
}, Be = /* @__PURE__ */ I({
|
|
164
|
+
__name: "result-tabs",
|
|
165
|
+
props: {
|
|
166
|
+
result: {},
|
|
167
|
+
component: {},
|
|
168
|
+
isMock: { type: Boolean, default: !1 },
|
|
169
|
+
canRunNodeDebug: { type: Boolean, default: !1 }
|
|
170
|
+
},
|
|
171
|
+
emits: ["reEditMock", "runReal", "runMock", "logsTabActive"],
|
|
172
|
+
setup(t, { emit: d }) {
|
|
173
|
+
const e = t, l = d, s = T("execution");
|
|
174
|
+
Y(
|
|
175
|
+
s,
|
|
176
|
+
(x) => l("logsTabActive", x === "logs"),
|
|
177
|
+
{ immediate: !0 }
|
|
178
|
+
);
|
|
179
|
+
const i = {
|
|
180
|
+
not_run: "未调试",
|
|
181
|
+
running: "正在调试",
|
|
182
|
+
finished: "成功",
|
|
183
|
+
failed: "失败",
|
|
184
|
+
suspended: "挂起",
|
|
185
|
+
skipped: "跳过"
|
|
186
|
+
}, g = c(() => i[e.result.execution.status] ?? e.result.execution.status), _ = c(() => de(e.result.execution.durationMs)), E = c(() => Ee(e.result.error || e.result.execution.errorDetail)), C = c(() => e.result.execution.status === "failed"), {
|
|
187
|
+
loading: S,
|
|
188
|
+
error: L,
|
|
189
|
+
visibleInputs: $,
|
|
190
|
+
outputNameMap: h
|
|
191
|
+
} = ce({ component: () => e.component }), u = c(() => e.result.loading || S.value), r = c(() => e.result.detailError || L.value), b = c(
|
|
192
|
+
() => $.value.filter(({ key: x }) => Object.prototype.hasOwnProperty.call(e.result.inputs, x)).map(({ key: x, name: o }) => ({ key: x, name: o, value: e.result.inputs[x] }))
|
|
193
|
+
), a = c(
|
|
194
|
+
() => pe(e.result.outputs, h.value)
|
|
195
|
+
), w = c(() => e.result.logs == null ? "" : me(e.result.logs));
|
|
196
|
+
return (x, o) => {
|
|
197
|
+
const A = P("bk-button"), V = P("bk-tab-panel"), G = P("bk-tab");
|
|
198
|
+
return f(), k("div", he, [
|
|
199
|
+
m(G, {
|
|
200
|
+
active: s.value,
|
|
201
|
+
"onUpdate:active": o[3] || (o[3] = (M) => s.value = M),
|
|
202
|
+
type: "card-grid"
|
|
203
|
+
}, K({
|
|
204
|
+
default: y(() => [
|
|
205
|
+
m(V, {
|
|
206
|
+
name: "execution",
|
|
207
|
+
label: "执行信息"
|
|
208
|
+
}, {
|
|
209
|
+
default: y(() => [
|
|
210
|
+
n("div", Me, [
|
|
211
|
+
n("div", Re, [
|
|
212
|
+
o[9] || (o[9] = n("span", { class: "label" }, "执行状态", -1)),
|
|
213
|
+
n("span", Te, B(g.value), 1)
|
|
214
|
+
]),
|
|
215
|
+
n("div", Ne, [
|
|
216
|
+
o[10] || (o[10] = n("span", { class: "label" }, "调试用时", -1)),
|
|
217
|
+
n("span", Se, B(_.value), 1)
|
|
218
|
+
]),
|
|
219
|
+
E.value ? (f(), k("div", Le, [
|
|
220
|
+
o[11] || (o[11] = n("span", { class: "label" }, "错误信息", -1)),
|
|
221
|
+
n("span", $e, B(E.value), 1)
|
|
222
|
+
])) : H("", !0)
|
|
223
|
+
])
|
|
224
|
+
]),
|
|
225
|
+
_: 1
|
|
226
|
+
}),
|
|
227
|
+
m(V, {
|
|
228
|
+
name: "inputs",
|
|
229
|
+
label: "输入参数"
|
|
230
|
+
}, {
|
|
231
|
+
default: y(() => [
|
|
232
|
+
m(J, {
|
|
233
|
+
rows: b.value,
|
|
234
|
+
loading: u.value,
|
|
235
|
+
error: r.value,
|
|
236
|
+
"empty-text": "暂无输入参数"
|
|
237
|
+
}, null, 8, ["rows", "loading", "error"])
|
|
238
|
+
]),
|
|
239
|
+
_: 1
|
|
240
|
+
}),
|
|
241
|
+
m(V, {
|
|
242
|
+
name: "outputs",
|
|
243
|
+
label: "输出结果"
|
|
244
|
+
}, {
|
|
245
|
+
default: y(() => [
|
|
246
|
+
m(J, {
|
|
247
|
+
rows: a.value,
|
|
248
|
+
loading: u.value,
|
|
249
|
+
error: r.value,
|
|
250
|
+
"empty-text": "暂无输出结果"
|
|
251
|
+
}, K({ _: 2 }, [
|
|
252
|
+
e.isMock ? {
|
|
253
|
+
name: "toolbar",
|
|
254
|
+
fn: y(() => [
|
|
255
|
+
n("div", Ae, [
|
|
256
|
+
o[13] || (o[13] = n("i", {
|
|
257
|
+
class: "bkflow-canvas-icon bkflow-canvas-info debug-result-tabs__mock-info",
|
|
258
|
+
"aria-hidden": "true"
|
|
259
|
+
}, null, -1)),
|
|
260
|
+
o[14] || (o[14] = n("span", null, "当前为 Mock 数据", -1)),
|
|
261
|
+
m(A, {
|
|
262
|
+
text: "",
|
|
263
|
+
theme: "primary",
|
|
264
|
+
size: "small",
|
|
265
|
+
"data-test": "re-edit-mock",
|
|
266
|
+
onClick: o[2] || (o[2] = (M) => l("reEditMock"))
|
|
267
|
+
}, {
|
|
268
|
+
default: y(() => [...o[12] || (o[12] = [
|
|
269
|
+
D(" 重新编辑 ", -1)
|
|
270
|
+
])]),
|
|
271
|
+
_: 1
|
|
272
|
+
})
|
|
273
|
+
])
|
|
274
|
+
]),
|
|
275
|
+
key: "0"
|
|
276
|
+
} : void 0
|
|
277
|
+
]), 1032, ["rows", "loading", "error"])
|
|
278
|
+
]),
|
|
279
|
+
_: 1
|
|
280
|
+
}),
|
|
281
|
+
m(V, {
|
|
282
|
+
name: "logs",
|
|
283
|
+
label: "调用日志"
|
|
284
|
+
}, {
|
|
285
|
+
default: y(() => [
|
|
286
|
+
n("div", Pe, [
|
|
287
|
+
m(ve, {
|
|
288
|
+
"log-text": w.value,
|
|
289
|
+
loading: e.result.logLoading,
|
|
290
|
+
error: e.result.logError
|
|
291
|
+
}, null, 8, ["log-text", "loading", "error"])
|
|
292
|
+
])
|
|
293
|
+
]),
|
|
294
|
+
_: 1
|
|
295
|
+
})
|
|
296
|
+
]),
|
|
297
|
+
_: 2
|
|
298
|
+
}, [
|
|
299
|
+
C.value && e.canRunNodeDebug ? {
|
|
300
|
+
name: "setting",
|
|
301
|
+
fn: y(() => [
|
|
302
|
+
n("div", Ve, [
|
|
303
|
+
o[6] || (o[6] = n("i", { class: "bkflow-canvas-icon bkflow-canvas-alert" }, null, -1)),
|
|
304
|
+
o[7] || (o[7] = n("span", null, "该节点执行失败,可", -1)),
|
|
305
|
+
m(A, {
|
|
306
|
+
text: "",
|
|
307
|
+
theme: "primary",
|
|
308
|
+
"data-test": "rerun-real",
|
|
309
|
+
onClick: o[0] || (o[0] = (M) => l("runReal"))
|
|
310
|
+
}, {
|
|
311
|
+
default: y(() => [...o[4] || (o[4] = [
|
|
312
|
+
D("重新调试", -1)
|
|
313
|
+
])]),
|
|
314
|
+
_: 1
|
|
315
|
+
}),
|
|
316
|
+
o[8] || (o[8] = n("span", null, "或直接", -1)),
|
|
317
|
+
m(A, {
|
|
318
|
+
text: "",
|
|
319
|
+
theme: "primary",
|
|
320
|
+
"data-test": "run-mock",
|
|
321
|
+
onClick: o[1] || (o[1] = (M) => l("runMock"))
|
|
322
|
+
}, {
|
|
323
|
+
default: y(() => [...o[5] || (o[5] = [
|
|
324
|
+
D("Mock 输出", -1)
|
|
325
|
+
])]),
|
|
326
|
+
_: 1
|
|
327
|
+
})
|
|
328
|
+
])
|
|
329
|
+
]),
|
|
330
|
+
key: "0"
|
|
331
|
+
} : void 0
|
|
332
|
+
]), 1032, ["active"])
|
|
333
|
+
]);
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
}), De = /* @__PURE__ */ j(Be, [["__scopeId", "data-v-08f04010"]]), Ge = {
|
|
337
|
+
ExclusiveGateway: "bkflow-canvas-icon bkflow-canvas-fenzhiwangguan",
|
|
338
|
+
ParallelGateway: "bkflow-canvas-icon bkflow-canvas-bingxingwangguan",
|
|
339
|
+
ConditionalParallelGateway: "bkflow-canvas-icon bkflow-canvas-tiaojianbingxingwangguan",
|
|
340
|
+
ConvergeGateway: "bkflow-canvas-icon bkflow-canvas-huijuwangguan"
|
|
341
|
+
}, O = {
|
|
342
|
+
ServiceActivity: "任务节点",
|
|
343
|
+
EmptyStartEvent: "开始节点",
|
|
344
|
+
EmptyEndEvent: "结束节点",
|
|
345
|
+
ExclusiveGateway: "分支网关",
|
|
346
|
+
ParallelGateway: "并行网关",
|
|
347
|
+
ConditionalParallelGateway: "条件并行网关",
|
|
348
|
+
ConvergeGateway: "汇聚网关"
|
|
349
|
+
}, ze = (t) => !t || t.includes("bkflow-canvas-icon") ? t : `bkflow-canvas-icon ${t}`;
|
|
350
|
+
function Ue(t) {
|
|
351
|
+
if (!t.component?.code) return "";
|
|
352
|
+
if (t.component.code === "uniform_api") {
|
|
353
|
+
const d = t.component.api_meta?.category?.name ?? "";
|
|
354
|
+
return U[d] ?? U.bkflow;
|
|
355
|
+
}
|
|
356
|
+
return U.bkflow;
|
|
357
|
+
}
|
|
358
|
+
function Oe(t, d) {
|
|
359
|
+
const e = t?.location?.find((g) => g.id === d), l = ze(e?.icon ?? ""), s = t?.activities?.[d];
|
|
360
|
+
if (s)
|
|
361
|
+
return {
|
|
362
|
+
name: !!s.component?.code ? s.name || e?.name || d : "节点未配置",
|
|
363
|
+
type: s.type || "ServiceActivity",
|
|
364
|
+
typeName: O[s.type] ?? "任务节点",
|
|
365
|
+
icon: Ue(s)
|
|
366
|
+
};
|
|
367
|
+
const i = t?.gateways?.[d];
|
|
368
|
+
return i ? {
|
|
369
|
+
name: i.name || e?.name || O[i.type] || d,
|
|
370
|
+
type: i.type,
|
|
371
|
+
typeName: O[i.type] ?? "网关",
|
|
372
|
+
icon: l || Ge[i.type] || ""
|
|
373
|
+
} : t?.start_event?.id === d ? {
|
|
374
|
+
name: t.start_event.name || "开始",
|
|
375
|
+
type: "EmptyStartEvent",
|
|
376
|
+
typeName: "开始节点",
|
|
377
|
+
icon: l || "bkflow-canvas-icon bkflow-canvas-kaishi"
|
|
378
|
+
} : t?.end_event?.id === d ? {
|
|
379
|
+
name: t.end_event.name || "结束",
|
|
380
|
+
type: "EmptyEndEvent",
|
|
381
|
+
typeName: "结束节点",
|
|
382
|
+
icon: l || "bkflow-canvas-icon bkflow-canvas-stop"
|
|
383
|
+
} : e ? {
|
|
384
|
+
name: e.name || d,
|
|
385
|
+
type: e.type || "",
|
|
386
|
+
typeName: "",
|
|
387
|
+
icon: l
|
|
388
|
+
} : { name: d, type: "", typeName: "", icon: "" };
|
|
389
|
+
}
|
|
390
|
+
function Fe(t, d, e = /* @__PURE__ */ new Set()) {
|
|
391
|
+
if (!t) return [];
|
|
392
|
+
const l = new Map(
|
|
393
|
+
(d ?? []).map((s) => [s.node_id, be(s.status)])
|
|
394
|
+
);
|
|
395
|
+
return fe(t).map((s) => {
|
|
396
|
+
const i = t.activities?.[s], g = i ? !!i.component?.code : !0, _ = Oe(t, s);
|
|
397
|
+
return {
|
|
398
|
+
id: s,
|
|
399
|
+
name: _.name,
|
|
400
|
+
type: _.type || i?.type || "",
|
|
401
|
+
typeName: _.typeName,
|
|
402
|
+
icon: _.icon,
|
|
403
|
+
status: l.get(s) ?? "not_run",
|
|
404
|
+
isMock: !!(i && e.has(s)),
|
|
405
|
+
isConfigured: g
|
|
406
|
+
};
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
const He = { class: "debug-result-drawer__header" }, Ie = { class: "debug-result-drawer__header-left" }, Ye = { class: "debug-result-drawer__body" }, je = { class: "debug-result-drawer__content" }, Ke = { class: "debug-result-drawer__result" }, qe = {
|
|
410
|
+
key: 1,
|
|
411
|
+
class: "debug-result-drawer__unselected",
|
|
412
|
+
"data-test": "node-unselected"
|
|
413
|
+
}, R = 44, F = 420, Je = /* @__PURE__ */ I({
|
|
414
|
+
__name: "index",
|
|
415
|
+
props: {
|
|
416
|
+
open: { type: Boolean },
|
|
417
|
+
context: {},
|
|
418
|
+
pipelineTree: {},
|
|
419
|
+
mockNodeIds: {},
|
|
420
|
+
modelValue: { default: "" },
|
|
421
|
+
result: {},
|
|
422
|
+
hasGlobalRun: { type: Boolean, default: !1 },
|
|
423
|
+
viewParamsPending: { type: Boolean, default: !1 },
|
|
424
|
+
offsetLeft: { default: 0 }
|
|
425
|
+
},
|
|
426
|
+
emits: ["update:open", "update:modelValue", "reEditMock", "runReal", "runMock", "viewParams", "logsTabActive"],
|
|
427
|
+
setup(t, { emit: d }) {
|
|
428
|
+
const e = t, l = d, s = T(F), i = T(!1);
|
|
429
|
+
let g = 0, _ = 0, E = "", C = "";
|
|
430
|
+
const S = c(() => ({
|
|
431
|
+
left: `${e.offsetLeft}px`,
|
|
432
|
+
height: `${e.open ? s.value : R}px`
|
|
433
|
+
})), L = () => {
|
|
434
|
+
e.open || (s.value = F), l("update:open", !e.open);
|
|
435
|
+
}, $ = (v) => {
|
|
436
|
+
const p = v > R;
|
|
437
|
+
p !== e.open && l("update:open", p);
|
|
438
|
+
}, h = (v) => {
|
|
439
|
+
const p = _ - (v.clientY - g);
|
|
440
|
+
s.value = Math.max(R, Math.min(window.innerHeight * 0.8, p)), $(s.value);
|
|
441
|
+
}, u = () => {
|
|
442
|
+
document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", u), document.body.style.cursor = E, document.body.style.userSelect = C, i.value = !1, s.value <= R && (s.value = F, l("update:open", !1));
|
|
443
|
+
}, r = (v) => {
|
|
444
|
+
v.preventDefault(), i.value = !0, g = v.clientY, e.open ? _ = s.value : (l("update:open", !0), s.value = R, _ = R), E = document.body.style.cursor, C = document.body.style.userSelect, document.body.style.cursor = "ns-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", h), document.addEventListener("mouseup", u);
|
|
445
|
+
};
|
|
446
|
+
oe(u);
|
|
447
|
+
const b = c({
|
|
448
|
+
get: () => e.modelValue,
|
|
449
|
+
set: (v) => l("update:modelValue", v)
|
|
450
|
+
});
|
|
451
|
+
Y(
|
|
452
|
+
() => e.modelValue,
|
|
453
|
+
(v) => {
|
|
454
|
+
v || l("logsTabActive", !1);
|
|
455
|
+
},
|
|
456
|
+
{ immediate: !0 }
|
|
457
|
+
);
|
|
458
|
+
const a = c(
|
|
459
|
+
() => Fe(e.pipelineTree, e.context?.nodes, e.mockNodeIds)
|
|
460
|
+
), w = c(() => e.mockNodeIds.has(e.modelValue)), x = c(() => e.pipelineTree?.activities?.[e.modelValue]?.component), o = c(() => {
|
|
461
|
+
const v = a.value.find((p) => p.id === e.modelValue);
|
|
462
|
+
return v?.type === "ServiceActivity" && v.isConfigured;
|
|
463
|
+
}), A = () => {
|
|
464
|
+
!e.hasGlobalRun || e.viewParamsPending || l("viewParams");
|
|
465
|
+
}, V = () => {
|
|
466
|
+
e.modelValue && l("reEditMock", e.modelValue);
|
|
467
|
+
}, G = () => {
|
|
468
|
+
e.modelValue && l("runReal", e.modelValue);
|
|
469
|
+
}, M = () => {
|
|
470
|
+
e.modelValue && l("runMock", e.modelValue);
|
|
471
|
+
};
|
|
472
|
+
return (v, p) => {
|
|
473
|
+
const W = P("bk-button"), Q = ae("bk-tooltips");
|
|
474
|
+
return f(), k("div", {
|
|
475
|
+
class: N(["debug-result-drawer-wrapper", { "is-resizing": i.value }]),
|
|
476
|
+
style: ne(S.value)
|
|
477
|
+
}, [
|
|
478
|
+
n("div", {
|
|
479
|
+
class: "debug-result-drawer__resize",
|
|
480
|
+
onMousedown: r
|
|
481
|
+
}, null, 32),
|
|
482
|
+
n("section", {
|
|
483
|
+
class: N(["debug-result-drawer", { "is-collapsed": !e.open }])
|
|
484
|
+
}, [
|
|
485
|
+
n("header", He, [
|
|
486
|
+
n("div", Ie, [
|
|
487
|
+
p[3] || (p[3] = n("span", { class: "debug-result-drawer__title" }, "调试结果", -1)),
|
|
488
|
+
p[4] || (p[4] = n("span", { class: "debug-result-drawer__divider" }, null, -1)),
|
|
489
|
+
le((f(), q(W, {
|
|
490
|
+
text: "",
|
|
491
|
+
theme: "primary",
|
|
492
|
+
disabled: !e.hasGlobalRun,
|
|
493
|
+
loading: e.viewParamsPending,
|
|
494
|
+
onClick: A
|
|
495
|
+
}, {
|
|
496
|
+
default: y(() => [...p[2] || (p[2] = [
|
|
497
|
+
n("i", { class: "bkflow-canvas-icon bkflow-canvas-audit view-params-icon" }, null, -1),
|
|
498
|
+
D(" 查看参数 ", -1)
|
|
499
|
+
])]),
|
|
500
|
+
_: 1
|
|
501
|
+
}, 8, ["disabled", "loading"])), [
|
|
502
|
+
[Q, { content: "请先进行调试", disabled: e.hasGlobalRun }]
|
|
503
|
+
])
|
|
504
|
+
]),
|
|
505
|
+
n("span", {
|
|
506
|
+
class: "debug-result-drawer__collapse",
|
|
507
|
+
onClick: L
|
|
508
|
+
}, [
|
|
509
|
+
n("span", null, B(e.open ? "收起" : "展开"), 1),
|
|
510
|
+
n("i", {
|
|
511
|
+
class: N(["bkflow-canvas-icon bkflow-canvas-arrows-down debug-result-drawer__collapse-icon", { "is-expanded": e.open }])
|
|
512
|
+
}, null, 2)
|
|
513
|
+
])
|
|
514
|
+
]),
|
|
515
|
+
n("div", Ye, [
|
|
516
|
+
n("div", je, [
|
|
517
|
+
m(Ce, {
|
|
518
|
+
modelValue: b.value,
|
|
519
|
+
"onUpdate:modelValue": p[0] || (p[0] = (z) => b.value = z),
|
|
520
|
+
nodes: a.value
|
|
521
|
+
}, null, 8, ["modelValue", "nodes"]),
|
|
522
|
+
n("div", Ke, [
|
|
523
|
+
e.modelValue ? (f(), q(De, {
|
|
524
|
+
key: 0,
|
|
525
|
+
result: e.result,
|
|
526
|
+
component: x.value,
|
|
527
|
+
"is-mock": w.value,
|
|
528
|
+
"can-run-node-debug": o.value,
|
|
529
|
+
onReEditMock: V,
|
|
530
|
+
onRunReal: G,
|
|
531
|
+
onRunMock: M,
|
|
532
|
+
onLogsTabActive: p[1] || (p[1] = (z) => l("logsTabActive", z))
|
|
533
|
+
}, null, 8, ["result", "component", "is-mock", "can-run-node-debug"])) : (f(), k("div", qe, " 请先选择节点查看调试详情 "))
|
|
534
|
+
])
|
|
535
|
+
])
|
|
536
|
+
])
|
|
537
|
+
], 2)
|
|
538
|
+
], 6);
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
}), Ze = /* @__PURE__ */ j(Je, [["__scopeId", "data-v-ea7fa807"]]);
|
|
542
|
+
export {
|
|
543
|
+
Ze as default
|
|
544
|
+
};
|