@blueking/bkflow-canvas-editor 1.1.0-beta.9 → 1.2.0-beta.1

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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-DuddWhYg.cjs");require("bkui-vue/lib/message");require("bkui-vue/lib/icon");require("monaco-editor");const N={string:"input",text:"input",textarea:"textarea",int:"input",integer:"input",number:"input",float:"input",json:"json",object:"json",array:"array",list:"array",select:"select",time:"timepicker",datetime:"timepicker"},h=l=>l.replace(/^\$\{(.+)\}$/,"$1"),g=l=>`\${${h(l)}}`;function F(l,c){const a=g(l.key),n=c?s.cloneDeep(c):{},d=l.custom_type??n.custom_type??N[l.type]??"input";return{...n,key:a,name:l.name??n.name??h(l.key),custom_type:d,desc:n.desc??"",index:n.index??0,show_type:"show",source_info:n.source_info??{},source_tag:n.source_tag??"",source_type:n.source_type??"custom",validation:n.validation??"",value:l.default??n.value,meta:{...n.meta??{},required:l.required??n.meta?.required??!1}}}function D(l,c={}){if(!l)return{};const a=l.constants;return a&&Object.keys(a).length>0?{...a}:Array.isArray(l.fields)&&l.fields.length>0?l.fields.reduce((n,d)=>{const r=g(d.key);return n[r]=F(d,c[r]),n},{}):{}}const j={class:"global-debug-input"},q={key:0,class:"global-debug-input__params","data-test":"input-params"},R={key:0},L=["title"],O={class:"col-value"},T={key:1,class:"global-debug-input__value"},I={key:1,class:"form-params-wrapper"},P={class:"sideslider-footer-buttons"},$=e.defineComponent({__name:"index",props:{show:{type:Boolean},schema:{},pipelineConstants:{default:()=>({})},initialValues:{default:()=>({})},pending:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["confirm","close","update:show"],setup(l,{emit:c}){const a=l,n=c,d=s.useFlowApiConfig(),r=e.ref({}),p=e.shallowRef([]),m=e.shallowRef([]),f=e.shallowRef(!1),y=e.ref(),v=e.ref(),k=e.computed(()=>p.value.filter(t=>s.isBuiltinUsageVariable(t))),V=e.computed(()=>k.value.length>0||m.value.length>0),b=e.computed(()=>[...p.value].sort((t,o)=>(t.index??0)-(o.index??0)).map(t=>{const o=Object.prototype.hasOwnProperty.call(r.value,t.key)?r.value[t.key]:t.value;return{key:t.key,name:t.name||t.key,value:o,display:s.formatDebugValue(o),isComplex:s.isComplexDebugValue(o)}}));e.watch(()=>a.show,t=>{t&&(r.value=s.cloneDeep(a.initialValues??{}),w())});const w=async()=>{const t=D(a.schema,a.pipelineConstants),o=Object.values(t).filter(i=>typeof i=="object"&&i!==null&&i.show_type==="show");if(p.value=o,a.readonly||Object.keys(t).length<1){m.value=[];return}f.value=!0;try{m.value=await s.getInputFormsFromConstants(d,t)}catch(i){console.error("Failed to build debug input forms from schema:",i),m.value=[]}finally{f.value=!1}},B=t=>{r.value={...r.value,...s.cloneDeep(t)}},C=async()=>{const[t,o]=await Promise.all([Promise.resolve(typeof v.value?.validate=="function"?v.value.validate():!0),Promise.resolve(typeof y.value?.validate=="function"?y.value.validate():!0)]);!t||!o||n("confirm",s.cloneDeep(r.value))},_=()=>{n("close"),n("update:show",!1)};return(t,o)=>{const i=e.resolveComponent("bk-button"),x=e.resolveComponent("bk-sideslider"),E=e.resolveDirective("bkloading");return e.openBlock(),e.createBlock(x,{title:"调试参数","is-show":a.show,width:960,"quick-close":!0,"esc-close":!1,onClosed:_},e.createSlots({default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",j,[a.readonly?(e.openBlock(),e.createElementBlock("table",q,[o[2]||(o[2]=e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",{class:"col-name"},"参数名"),e.createElementVNode("th",{class:"col-value"},"参数值")])],-1)),e.createElementVNode("tbody",null,[b.value.length===0?(e.openBlock(),e.createElementBlock("tr",R,[...o[1]||(o[1]=[e.createElementVNode("td",{class:"global-debug-input__empty",colspan:"2"},"暂无参数",-1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,u=>(e.openBlock(),e.createElementBlock("tr",{key:u.key,"data-test":"input-row"},[e.createElementVNode("td",{class:"col-name",title:u.key},e.toDisplayString(u.name),9,L),e.createElementVNode("td",O,[u.isComplex?(e.openBlock(),e.createBlock(s.DebugJsonViewer,{key:0,value:u.value,"data-test":"json-viewer"},null,8,["value"])):(e.openBlock(),e.createElementBlock("pre",T,e.toDisplayString(u.display),1))])]))),128))])])):(e.openBlock(),e.createElementBlock("div",I,[k.value.length>0?(e.openBlock(),e.createBlock(e.unref(s.BuiltinVariableUsageForm),{key:0,ref_key:"builtinVariableFormRef",ref:v,modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=u=>r.value=u),variables:k.value},null,8,["modelValue","variables"])):e.createCommentVNode("",!0),m.value.length>0?(e.openBlock(),e.createBlock(s.RenderForm,{key:1,ref_key:"renderFormRef",ref:y,scheme:m.value,editable:"","form-option":{showRequired:!0,showGroup:!0,showLabel:!1,showHook:!1,showDesc:!0,formEdit:!0},"form-data":r.value,onChange:B},null,8,["scheme","form-data"])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(s.EmptyException,{key:2,title:"暂无参数"}))]))])),[[E,{loading:f.value}]])]),_:2},[a.readonly?void 0:{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",P,[e.createVNode(i,{theme:"primary","data-test":"save-and-run",loading:a.pending,onClick:C},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode(" 保存并执行 ",-1)])]),_:1},8,["loading"]),e.createVNode(i,{disabled:a.pending,onClick:_},{default:e.withCtx(()=>[...o[4]||(o[4]=[e.createTextVNode("取消",-1)])]),_:1},8,["disabled"])])]),key:"0"}]),1032,["is-show"])}}}),S=s._export_sfc($,[["__scopeId","data-v-01a33593"]]);exports.default=S;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),M=require("bkui-vue/lib"),N=require("bkui-vue/lib/message"),s=require("./index-DuddWhYg.cjs"),O={key:0,class:"mock-data-sideslider__title-sep"},F=["title"],S={class:"mock-data-sideslider"},D={class:"mock-data-sideslider__footer"},j="当前节点的输出不支持mock,是否需要在调试时跳过当前节点?",q="跳过调试",Y=e.defineComponent({__name:"index",props:{show:{type:Boolean},node:{default:null},outputs:{default:()=>({})},pending:{type:Boolean,default:!1}},emits:["confirm","close","update:show"],setup(f,{emit:y}){const o=f,p=y,h=s.useFlowApiConfig(),k=e.ref(!1),u=e.shallowRef([]),d=e.ref({}),_=e.ref({}),m=e.ref(!1),b=e.computed(()=>m.value?j:"暂无输出结果"),C=e.computed(()=>m.value?q:"确定"),w=async()=>{if(o.node){k.value=!0,_.value={},m.value=!1;try{const t=await s.pluginDetailRequest(h,o.node.component);u.value=s.mergeOutputs(t.outputs??[]),m.value=s.hasOnlySystemOutputs(t.outputs);const n=o.outputs??{},a={};u.value.forEach(l=>{const c=Object.prototype.hasOwnProperty.call(n,l.key)?n[l.key]:l.type==="object"?{}:void 0,r=s.resolveMockFormControl(l);a[l.key]=r==="json-editor"||r==="data-table"?s.formatJsonFieldValue(c):c}),d.value=a}catch(t){console.error(t),u.value=[],d.value={},m.value=!1,N({theme:"error",message:"加载输出结果失败"})}finally{k.value=!1}}},g=()=>{const t={},n={};return u.value.forEach(a=>{const l=d.value[a.key],c=s.resolveMockFormControl(a);if(c==="json-editor"||c==="data-table"){const r=s.parseJsonFieldValue(l);if(!r.valid){t[a.key]=r.message;return}r.value!==void 0&&(n[a.key]=r.value);return}l!==void 0&&l!==""&&(n[a.key]=l)}),{errors:t,outputs:n}},x=t=>{M.InfoBox({title:"确认 Mock 输出?",content:"Mock 输出将覆盖当前输出结果,执行时跳过该节点并以 Mock 值替代实际输出",confirmText:"确定",cancelText:"取消",width:400,onConfirm:()=>{t()}})},V=()=>{if(m.value){p("confirm",{outputs:{}});return}const{errors:t,outputs:n}=g();_.value=t,!(Object.keys(t).length>0)&&x(()=>p("confirm",{outputs:n}))},v=()=>{p("close"),p("update:show",!1)};return e.watch(()=>[o.show,o.node?.id],([t])=>{t&&o.node&&(d.value=s.cloneDeep(o.outputs??{}),w())},{immediate:!0}),(t,n)=>{const a=e.resolveComponent("bk-form-item"),l=e.resolveComponent("bk-form"),c=e.resolveComponent("bk-exception"),r=e.resolveComponent("bk-button"),B=e.resolveComponent("bk-sideslider"),E=e.resolveDirective("bkloading");return e.openBlock(),e.createBlock(B,{"is-show":o.show,width:960,"quick-close":"","esc-close":!1,onClosed:v},{header:e.withCtx(()=>[n[0]||(n[0]=e.createElementVNode("span",{class:"mock-data-sideslider__title"},"Mock输出",-1)),o.node?.name?(e.openBlock(),e.createElementBlock("span",O,"-")):e.createCommentVNode("",!0),o.node?.name?(e.openBlock(),e.createElementBlock("span",{key:1,class:"mock-data-sideslider__title-node",title:o.node.name},e.toDisplayString(o.node.name),9,F)):e.createCommentVNode("",!0)]),footer:e.withCtx(()=>[e.createElementVNode("div",D,[e.createVNode(r,{theme:"primary","data-test":"mock-confirm",loading:o.pending,onClick:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.value),1)]),_:1},8,["loading"]),e.createVNode(r,{disabled:o.pending,onClick:v},{default:e.withCtx(()=>[...n[1]||(n[1]=[e.createTextVNode("取消",-1)])]),_:1},8,["disabled"])])]),default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",S,[u.value.length>0?(e.openBlock(),e.createBlock(l,{key:0,"form-type":"vertical","label-width":120,"data-test":"mock-outputs-form"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,i=>(e.openBlock(),e.createBlock(a,{key:i.key,label:i.name||i.key},{default:e.withCtx(()=>[e.createVNode(s.MockFieldRenderer,{modelValue:d.value[i.key],"onUpdate:modelValue":T=>d.value[i.key]=T,field:i,error:_.value[i.key]},null,8,["modelValue","onUpdate:modelValue","field","error"])]),_:2},1032,["label"]))),128))]),_:1})):k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(c,{key:1,class:"mock-data-sideslider__exception",scene:"part",type:"empty",title:b.value},null,8,["title"]))])),[[E,{loading:k.value}]])]),_:1},8,["is-show"])}}}),I=s._export_sfc(Y,[["__scopeId","data-v-c4e2476a"]]);exports.default=I;
@@ -0,0 +1,514 @@
1
+ import { defineComponent as G, ref as S, computed as i, watch as K, nextTick as Q, resolveComponent as N, openBlock as f, createElementBlock as y, createVNode as p, Fragment as W, renderList as X, withKeys as Z, withModifiers as ee, normalizeClass as L, createElementVNode as o, createCommentVNode as F, toDisplayString as E, createSlots as Y, withCtx as k, createTextVNode as A, onBeforeUnmount as te, resolveDirective as se, normalizeStyle as oe, withDirectives as le, createBlock as q } from "vue";
2
+ import { L as ae, S as ne, E as ue, _ as j, e as ie, j as re, k as de, o as ce, t as pe, s as me, n as ve, l as J, C as be, q as fe, v as ge } from "./index-Bij1hZGP.js";
3
+ const _e = { class: "debug-result-node-list" }, ke = ["data-node-id", "aria-selected", "onClick", "onKeydown"], ye = ["title"], we = {
4
+ key: 0,
5
+ class: "debug-result-node-list__mock",
6
+ "data-test": "node-mock-flag"
7
+ }, xe = {
8
+ key: 1,
9
+ class: "debug-result-node-list__empty"
10
+ }, he = /* @__PURE__ */ G({
11
+ __name: "node-list",
12
+ props: {
13
+ nodes: {},
14
+ modelValue: { default: "" }
15
+ },
16
+ emits: ["update:modelValue"],
17
+ setup(c, { emit: w }) {
18
+ const e = c, l = w, r = S(""), m = S("all"), x = S(null), v = {
19
+ not_run: "未执行",
20
+ finished: "成功",
21
+ failed: "失败",
22
+ running: "正在调试",
23
+ suspended: "挂起",
24
+ skipped: "跳过",
25
+ revoked: "终止"
26
+ }, h = [
27
+ { value: "all", label: "全部" },
28
+ {
29
+ value: "finished",
30
+ icon: "bkflow-canvas-dark-circle-checkbox",
31
+ iconColor: "#5fb8ac",
32
+ tooltip: v.finished
33
+ },
34
+ {
35
+ value: "failed",
36
+ icon: "bkflow-canvas-dark-circle-close",
37
+ iconColor: "#fa4e41",
38
+ tooltip: v.failed
39
+ },
40
+ {
41
+ value: "revoked",
42
+ icon: "bkflow-canvas-stop-fill",
43
+ iconColor: "#fa4e41",
44
+ tooltip: v.revoked
45
+ },
46
+ {
47
+ value: "running",
48
+ iconComponent: ae,
49
+ iconColor: "#3a84ff",
50
+ tooltip: v.running
51
+ },
52
+ {
53
+ value: "not_run",
54
+ icon: "bkflow-canvas-weizhixing2",
55
+ iconColor: "#b8bbc4",
56
+ tooltip: v.not_run
57
+ },
58
+ {
59
+ value: "suspended",
60
+ icon: "bkflow-canvas-zanting",
61
+ iconColor: "#f59500",
62
+ tooltip: v.suspended
63
+ },
64
+ {
65
+ value: "skipped",
66
+ icon: "bkflow-canvas-tiaoguo2",
67
+ iconColor: "#6e89af",
68
+ tooltip: v.skipped
69
+ }
70
+ ], R = i(
71
+ () => h.map((n) => ({
72
+ ...n,
73
+ count: n.value === "all" ? e.nodes.length : e.nodes.filter((a) => a.status === n.value).length
74
+ }))
75
+ ), C = i(() => {
76
+ const n = r.value.trim().toLowerCase();
77
+ return e.nodes.filter((a) => m.value !== "all" && a.status !== m.value ? !1 : n ? a.name.toLowerCase().includes(n) || a.type.toLowerCase().includes(n) || (a.typeName ?? "").toLowerCase().includes(n) : !0);
78
+ }), $ = i(() => r.value.trim() ? "搜索结果为空" : m.value !== "all" ? `暂无${v[m.value]}状态节点` : "暂无节点"), D = () => {
79
+ r.value = "", m.value = "all";
80
+ }, V = (n) => {
81
+ const a = x.value, b = a?.querySelector(`[data-node-id="${CSS.escape(n)}"]`);
82
+ if (!a || !b) return;
83
+ const t = a.getBoundingClientRect(), g = b.getBoundingClientRect();
84
+ g.top < t.top ? a.scrollTop -= t.top - g.top : g.bottom > t.bottom && (a.scrollTop += g.bottom - t.bottom);
85
+ };
86
+ return K(
87
+ () => e.modelValue,
88
+ async (n) => {
89
+ if (!n) return;
90
+ !C.value.some((b) => b.id === n) && e.nodes.some((b) => b.id === n) && (r.value = "", m.value = "all"), await Q(), V(n);
91
+ },
92
+ { flush: "post" }
93
+ ), (n, a) => {
94
+ const b = N("bk-input");
95
+ return f(), y("aside", _e, [
96
+ p(b, {
97
+ modelValue: r.value,
98
+ "onUpdate:modelValue": a[0] || (a[0] = (t) => r.value = t),
99
+ class: "debug-result-node-list__search",
100
+ placeholder: "搜索节点名称 / 类型",
101
+ type: "search",
102
+ clearable: "",
103
+ "data-test": "node-search"
104
+ }, null, 8, ["modelValue"]),
105
+ p(ne, {
106
+ modelValue: m.value,
107
+ "onUpdate:modelValue": a[1] || (a[1] = (t) => m.value = t),
108
+ class: "debug-result-node-list__filters",
109
+ "data-test": "status-filters",
110
+ items: R.value
111
+ }, null, 8, ["modelValue", "items"]),
112
+ C.value.length > 0 ? (f(), y("div", {
113
+ key: 0,
114
+ ref_key: "itemsRef",
115
+ ref: x,
116
+ class: "debug-result-node-list__items",
117
+ role: "listbox"
118
+ }, [
119
+ (f(!0), y(W, null, X(C.value, (t) => (f(), y("div", {
120
+ key: t.id,
121
+ class: L([
122
+ "debug-result-node-list__item",
123
+ `is-${t.status}`,
124
+ {
125
+ "is-active": t.id === e.modelValue,
126
+ "is-unconfigured": !t.isConfigured
127
+ }
128
+ ]),
129
+ role: "option",
130
+ "data-test": "node-item",
131
+ "data-node-id": t.id,
132
+ "aria-selected": t.id === e.modelValue,
133
+ tabindex: "0",
134
+ onClick: (g) => l("update:modelValue", t.id),
135
+ onKeydown: Z(ee((g) => l("update:modelValue", t.id), ["prevent"]), ["enter", "space"])
136
+ }, [
137
+ o("span", {
138
+ class: L([
139
+ "debug-result-node-list__status",
140
+ `is-${t.status}`,
141
+ { "is-placeholder": !t.isConfigured }
142
+ ])
143
+ }, [
144
+ t.icon ? (f(), y("i", {
145
+ key: 0,
146
+ class: L(t.icon),
147
+ "data-test": "node-icon"
148
+ }, null, 2)) : F("", !0)
149
+ ], 2),
150
+ o("span", {
151
+ class: "debug-result-node-list__name",
152
+ title: t.isConfigured ? `${t.name} ${t.typeName || t.type}` : t.name
153
+ }, E(t.name), 9, ye),
154
+ t.isMock ? (f(), y("span", we, "MOCK")) : F("", !0)
155
+ ], 42, ke))), 128))
156
+ ], 512)) : (f(), y("div", xe, [
157
+ p(ue, {
158
+ "is-search": !1,
159
+ title: $.value,
160
+ onClear: D
161
+ }, null, 8, ["title"])
162
+ ]))
163
+ ]);
164
+ };
165
+ }
166
+ }), Ce = /* @__PURE__ */ j(he, [["__scopeId", "data-v-db0cb31c"]]);
167
+ function Re(c) {
168
+ if (c == null) return "";
169
+ if (typeof c == "string") return c;
170
+ if (typeof c == "object") {
171
+ const w = c, e = w.message;
172
+ if (typeof e == "string" && e) {
173
+ const l = w.type;
174
+ return typeof l == "string" && l ? `${l}: ${e}` : e;
175
+ }
176
+ try {
177
+ return JSON.stringify(c);
178
+ } catch {
179
+ return String(c);
180
+ }
181
+ }
182
+ return String(c);
183
+ }
184
+ const Ve = { class: "debug-result-tabs" }, Te = {
185
+ class: "debug-result-tabs__failed-actions",
186
+ "data-test": "output-error-actions"
187
+ }, Me = {
188
+ class: "debug-result-tabs__execution",
189
+ "data-test": "tab-execution"
190
+ }, Ee = { class: "debug-result-tabs__row" }, Se = { class: "value" }, Le = { class: "debug-result-tabs__row" }, $e = { class: "value" }, De = {
191
+ key: 0,
192
+ class: "debug-result-tabs__row is-error"
193
+ }, Ne = { class: "value" }, Ae = {
194
+ class: "debug-result-tabs__mock-hint",
195
+ "data-test": "mock-banner"
196
+ }, Be = {
197
+ class: "debug-result-tabs__logs",
198
+ "data-test": "tab-logs"
199
+ }, Ie = /* @__PURE__ */ G({
200
+ __name: "result-tabs",
201
+ props: {
202
+ result: {},
203
+ component: {},
204
+ isMock: { type: Boolean, default: !1 },
205
+ canRunNodeDebug: { type: Boolean, default: !1 }
206
+ },
207
+ emits: ["reEditMock", "runReal", "runMock", "logsTabActive"],
208
+ setup(c, { emit: w }) {
209
+ const e = c, l = w, r = S("execution");
210
+ K(
211
+ r,
212
+ (_) => l("logsTabActive", _ === "logs"),
213
+ { immediate: !0 }
214
+ );
215
+ const m = {
216
+ not_run: "未调试",
217
+ running: "正在调试",
218
+ finished: "成功",
219
+ failed: "失败",
220
+ suspended: "挂起",
221
+ skipped: "跳过",
222
+ revoked: "已终止"
223
+ }, x = i(() => m[e.result.execution.status] ?? e.result.execution.status), v = i(() => ie(e.result.execution.durationMs)), h = i(() => Re(e.result.error || e.result.execution.errorDetail)), R = i(() => e.result.execution.status === "revoked"), C = i(() => re(e.result.execution.status)), $ = i(() => R.value ? "该节点调试已终止,可" : "该节点执行失败,可"), {
224
+ loading: D,
225
+ error: V,
226
+ visibleInputs: n,
227
+ visibleOutputs: a,
228
+ outputNameMap: b
229
+ } = de({ component: () => e.component }), t = i(() => e.result.loading || D.value), g = i(() => e.result.detailError || V.value), B = i(
230
+ () => n.value.filter(({ key: _ }) => Object.prototype.hasOwnProperty.call(e.result.inputs, _)).map(({ key: _, name: s }) => ({ key: _, name: s, value: e.result.inputs[_] }))
231
+ ), I = i(
232
+ () => ce(
233
+ pe(e.result.outputs, b.value),
234
+ a.value.map((_) => _.key)
235
+ )
236
+ ), P = i(() => me(e.isMock, a.value)), z = i(() => e.result.logs == null ? "" : ve(e.result.logs));
237
+ return (_, s) => {
238
+ const d = N("bk-button"), u = N("bk-tab-panel"), H = N("bk-tab");
239
+ return f(), y("div", Ve, [
240
+ p(H, {
241
+ active: r.value,
242
+ "onUpdate:active": s[3] || (s[3] = (T) => r.value = T),
243
+ type: "card-grid"
244
+ }, Y({
245
+ default: k(() => [
246
+ p(u, {
247
+ name: "execution",
248
+ label: "执行信息"
249
+ }, {
250
+ default: k(() => [
251
+ o("div", Me, [
252
+ o("div", Ee, [
253
+ s[8] || (s[8] = o("span", { class: "label" }, "执行状态", -1)),
254
+ o("span", Se, E(x.value), 1)
255
+ ]),
256
+ o("div", Le, [
257
+ s[9] || (s[9] = o("span", { class: "label" }, "调试用时", -1)),
258
+ o("span", $e, E(v.value), 1)
259
+ ]),
260
+ h.value ? (f(), y("div", De, [
261
+ s[10] || (s[10] = o("span", { class: "label" }, "错误信息", -1)),
262
+ o("span", Ne, E(h.value), 1)
263
+ ])) : F("", !0)
264
+ ])
265
+ ]),
266
+ _: 1
267
+ }),
268
+ p(u, {
269
+ name: "inputs",
270
+ label: "输入参数"
271
+ }, {
272
+ default: k(() => [
273
+ p(J, {
274
+ rows: B.value,
275
+ loading: t.value,
276
+ error: g.value,
277
+ "empty-text": "暂无输入参数"
278
+ }, null, 8, ["rows", "loading", "error"])
279
+ ]),
280
+ _: 1
281
+ }),
282
+ p(u, {
283
+ name: "outputs",
284
+ label: "输出结果"
285
+ }, {
286
+ default: k(() => [
287
+ p(J, {
288
+ rows: I.value,
289
+ loading: t.value,
290
+ error: g.value,
291
+ "empty-text": "暂无输出结果"
292
+ }, Y({ _: 2 }, [
293
+ P.value ? {
294
+ name: "toolbar",
295
+ fn: k(() => [
296
+ o("div", Ae, [
297
+ s[12] || (s[12] = o("i", {
298
+ class: "bkflow-canvas-icon bkflow-canvas-info debug-result-tabs__mock-info",
299
+ "aria-hidden": "true"
300
+ }, null, -1)),
301
+ s[13] || (s[13] = o("span", null, "当前为 Mock 数据", -1)),
302
+ p(d, {
303
+ text: "",
304
+ theme: "primary",
305
+ size: "small",
306
+ "data-test": "re-edit-mock",
307
+ onClick: s[2] || (s[2] = (T) => l("reEditMock"))
308
+ }, {
309
+ default: k(() => [...s[11] || (s[11] = [
310
+ A(" 重新编辑 ", -1)
311
+ ])]),
312
+ _: 1
313
+ })
314
+ ])
315
+ ]),
316
+ key: "0"
317
+ } : void 0
318
+ ]), 1032, ["rows", "loading", "error"])
319
+ ]),
320
+ _: 1
321
+ }),
322
+ p(u, {
323
+ name: "logs",
324
+ label: "调用日志"
325
+ }, {
326
+ default: k(() => [
327
+ o("div", Be, [
328
+ p(be, {
329
+ "log-text": z.value,
330
+ loading: e.result.logLoading,
331
+ error: e.result.logError
332
+ }, null, 8, ["log-text", "loading", "error"])
333
+ ])
334
+ ]),
335
+ _: 1
336
+ })
337
+ ]),
338
+ _: 2
339
+ }, [
340
+ C.value && e.canRunNodeDebug ? {
341
+ name: "setting",
342
+ fn: k(() => [
343
+ o("div", Te, [
344
+ s[6] || (s[6] = o("i", { class: "bkflow-canvas-icon bkflow-canvas-alert" }, null, -1)),
345
+ o("span", null, E($.value), 1),
346
+ p(d, {
347
+ text: "",
348
+ theme: "primary",
349
+ "data-test": "rerun-real",
350
+ onClick: s[0] || (s[0] = (T) => l("runReal"))
351
+ }, {
352
+ default: k(() => [...s[4] || (s[4] = [
353
+ A("重新调试", -1)
354
+ ])]),
355
+ _: 1
356
+ }),
357
+ s[7] || (s[7] = o("span", null, "或直接", -1)),
358
+ p(d, {
359
+ text: "",
360
+ theme: "primary",
361
+ "data-test": "run-mock",
362
+ onClick: s[1] || (s[1] = (T) => l("runMock"))
363
+ }, {
364
+ default: k(() => [...s[5] || (s[5] = [
365
+ A("Mock 输出", -1)
366
+ ])]),
367
+ _: 1
368
+ })
369
+ ])
370
+ ]),
371
+ key: "0"
372
+ } : void 0
373
+ ]), 1032, ["active"])
374
+ ]);
375
+ };
376
+ }
377
+ }), Pe = /* @__PURE__ */ j(Ie, [["__scopeId", "data-v-2a925689"]]), ze = { class: "debug-result-drawer__header" }, He = { class: "debug-result-drawer__header-left" }, Ue = { class: "debug-result-drawer__body" }, Oe = { class: "debug-result-drawer__content" }, Fe = { class: "debug-result-drawer__result" }, Ge = {
378
+ key: 1,
379
+ class: "debug-result-drawer__unselected",
380
+ "data-test": "node-unselected"
381
+ }, M = 44, O = 420, Ke = /* @__PURE__ */ G({
382
+ __name: "index",
383
+ props: {
384
+ open: { type: Boolean },
385
+ context: {},
386
+ pipelineTree: {},
387
+ mockNodeIds: {},
388
+ modelValue: { default: "" },
389
+ result: {},
390
+ hasGlobalRun: { type: Boolean, default: !1 },
391
+ viewParamsPending: { type: Boolean, default: !1 },
392
+ offsetLeft: { default: 0 }
393
+ },
394
+ emits: ["update:open", "update:modelValue", "reEditMock", "runReal", "runMock", "viewParams", "logsTabActive"],
395
+ setup(c, { emit: w }) {
396
+ const e = c, l = w, r = S(O), m = S(!1);
397
+ let x = 0, v = 0, h = "", R = "";
398
+ const C = i(() => ({
399
+ left: `${e.offsetLeft}px`,
400
+ height: `${e.open ? r.value : M}px`
401
+ })), $ = () => {
402
+ e.open || (r.value = O), l("update:open", !e.open);
403
+ }, D = (d) => {
404
+ const u = d > M;
405
+ u !== e.open && l("update:open", u);
406
+ }, V = (d) => {
407
+ const u = v - (d.clientY - x);
408
+ r.value = Math.max(M, Math.min(window.innerHeight * 0.8, u)), D(r.value);
409
+ }, n = () => {
410
+ document.removeEventListener("mousemove", V), document.removeEventListener("mouseup", n), document.body.style.cursor = h, document.body.style.userSelect = R, m.value = !1, r.value <= M && (r.value = O, l("update:open", !1));
411
+ }, a = (d) => {
412
+ d.preventDefault(), m.value = !0, x = d.clientY, e.open ? v = r.value : (l("update:open", !0), r.value = M, v = M), h = document.body.style.cursor, R = document.body.style.userSelect, document.body.style.cursor = "ns-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", V), document.addEventListener("mouseup", n);
413
+ };
414
+ te(n);
415
+ const b = i({
416
+ get: () => e.modelValue,
417
+ set: (d) => l("update:modelValue", d)
418
+ });
419
+ K(
420
+ () => e.modelValue,
421
+ (d) => {
422
+ d || l("logsTabActive", !1);
423
+ },
424
+ { immediate: !0 }
425
+ );
426
+ const t = i(
427
+ () => fe(e.pipelineTree, e.context?.nodes, e.mockNodeIds)
428
+ ), g = i(() => e.mockNodeIds.has(e.modelValue)), B = i(
429
+ () => ge(e.pipelineTree?.activities?.[e.modelValue])
430
+ ), I = i(() => {
431
+ const d = t.value.find((u) => u.id === e.modelValue);
432
+ return d?.type === "ServiceActivity" && d.isConfigured;
433
+ }), P = () => {
434
+ !e.hasGlobalRun || e.viewParamsPending || l("viewParams");
435
+ }, z = () => {
436
+ e.modelValue && l("reEditMock", e.modelValue);
437
+ }, _ = () => {
438
+ e.modelValue && l("runReal", e.modelValue);
439
+ }, s = () => {
440
+ e.modelValue && l("runMock", e.modelValue);
441
+ };
442
+ return (d, u) => {
443
+ const H = N("bk-button"), T = se("bk-tooltips");
444
+ return f(), y("div", {
445
+ class: L(["debug-result-drawer-wrapper", { "is-resizing": m.value }]),
446
+ style: oe(C.value)
447
+ }, [
448
+ o("div", {
449
+ class: "debug-result-drawer__resize",
450
+ onMousedown: a
451
+ }, null, 32),
452
+ o("section", {
453
+ class: L(["debug-result-drawer", { "is-collapsed": !e.open }])
454
+ }, [
455
+ o("header", ze, [
456
+ o("div", He, [
457
+ u[3] || (u[3] = o("span", { class: "debug-result-drawer__title" }, "调试结果", -1)),
458
+ u[4] || (u[4] = o("span", { class: "debug-result-drawer__divider" }, null, -1)),
459
+ le((f(), q(H, {
460
+ text: "",
461
+ theme: "primary",
462
+ disabled: !e.hasGlobalRun,
463
+ loading: e.viewParamsPending,
464
+ onClick: P
465
+ }, {
466
+ default: k(() => [...u[2] || (u[2] = [
467
+ o("i", { class: "bkflow-canvas-icon bkflow-canvas-audit view-params-icon" }, null, -1),
468
+ A(" 查看参数 ", -1)
469
+ ])]),
470
+ _: 1
471
+ }, 8, ["disabled", "loading"])), [
472
+ [T, { content: "请先进行调试", disabled: e.hasGlobalRun }]
473
+ ])
474
+ ]),
475
+ o("span", {
476
+ class: "debug-result-drawer__collapse",
477
+ onClick: $
478
+ }, [
479
+ o("span", null, E(e.open ? "收起" : "展开"), 1),
480
+ o("i", {
481
+ class: L(["bkflow-canvas-icon bkflow-canvas-arrows-down debug-result-drawer__collapse-icon", { "is-expanded": e.open }])
482
+ }, null, 2)
483
+ ])
484
+ ]),
485
+ o("div", Ue, [
486
+ o("div", Oe, [
487
+ p(Ce, {
488
+ modelValue: b.value,
489
+ "onUpdate:modelValue": u[0] || (u[0] = (U) => b.value = U),
490
+ nodes: t.value
491
+ }, null, 8, ["modelValue", "nodes"]),
492
+ o("div", Fe, [
493
+ e.modelValue ? (f(), q(Pe, {
494
+ key: 0,
495
+ result: e.result,
496
+ component: B.value,
497
+ "is-mock": g.value,
498
+ "can-run-node-debug": I.value,
499
+ onReEditMock: z,
500
+ onRunReal: _,
501
+ onRunMock: s,
502
+ onLogsTabActive: u[1] || (u[1] = (U) => l("logsTabActive", U))
503
+ }, null, 8, ["result", "component", "is-mock", "can-run-node-debug"])) : (f(), y("div", Ge, " 请先选择节点查看调试详情 "))
504
+ ])
505
+ ])
506
+ ])
507
+ ], 2)
508
+ ], 6);
509
+ };
510
+ }
511
+ }), qe = /* @__PURE__ */ j(Ke, [["__scopeId", "data-v-1d34ca9a"]]);
512
+ export {
513
+ qe as default
514
+ };