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