@blueking/bkflow-canvas-editor 1.1.0-beta.44 → 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.
- package/README.md +41 -1
- package/dist/advanced.cjs.js +1 -1
- package/dist/advanced.d.ts +22 -1
- package/dist/advanced.esm.js +1 -1
- package/dist/bkflow-canvas-editor_false-B70uLuHL.cjs +1 -0
- package/dist/bkflow-canvas-editor_false-BlC281Zg.cjs +1 -0
- package/dist/bkflow-canvas-editor_false-Casww7p4.js +5 -0
- package/dist/bkflow-canvas-editor_false-i9G8sqQi.js +5 -0
- package/dist/context-Bu4mmo1Q.js +1593 -0
- package/dist/context-bUpcrt8M.cjs +6 -0
- package/dist/index-Bb8gt0ZM.cjs +2 -0
- package/dist/index-BynYn4VD.cjs +1 -0
- package/dist/index-C1q_QVHM.cjs +1 -0
- package/dist/index-C8XJMS_J.js +236 -0
- package/dist/index-CddPhY6u.cjs +1 -0
- package/dist/{index-DEh6TdMZ.js → index-CgRqOi-E.js} +28949 -29515
- package/dist/index-Ci_fP1q2.js +127 -0
- package/dist/index-ClbXmmTg.js +168 -0
- package/dist/index-DQG9J2SZ.js +137 -0
- package/dist/index-FcnoAxWL.cjs +82 -0
- package/dist/index-Htumo8sH.cjs +1 -0
- package/dist/index-_LhW2Gn_.js +647 -0
- package/dist/index-pYNKHhNh.js +73 -0
- package/dist/index-rLG78MgZ.cjs +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +47 -2
- package/dist/index.esm.js +42 -33
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/context-CGIQsuRc.cjs +0 -1
- package/dist/context-Ce_Xpx5d.js +0 -724
- package/dist/index-B1K53ttM.cjs +0 -1
- package/dist/index-B5-BwbW-.js +0 -607
- package/dist/index-B7cHQkaD.cjs +0 -2
- package/dist/index-BhOE6_v7.cjs +0 -1
- package/dist/index-BiOM182-.js +0 -135
- package/dist/index-Bit4HgBF.cjs +0 -82
- package/dist/index-CLiOiJR2.js +0 -125
- package/dist/index-CbEGVZdT.cjs +0 -1
- package/dist/index-DVeWB2dR.js +0 -73
- package/dist/index-DjIpWxVu.cjs +0 -1
- package/dist/index-Dmx7sjvz.cjs +0 -1
- package/dist/index-DubPNExB.js +0 -234
- package/dist/index-sEixnRd3.js +0 -162
- package/dist/index.es.min-BpHMrg2Y.cjs +0 -2
- package/dist/index.es.min-DYp0DL9J.js +0 -3543
package/dist/index-CLiOiJR2.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { defineComponent as b, reactive as k, ref as V, watch as f, resolveComponent as i, openBlock as v, createBlock as E, withCtx as d, createElementVNode as o, unref as x, normalizeClass as M, createTextVNode as c, createVNode as a, createElementBlock as y, toDisplayString as B, createCommentVNode as D } from "vue";
|
|
2
|
-
import { _ as N } from "./index-DEh6TdMZ.js";
|
|
3
|
-
const F = "data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M47.3922%202.00779L47.193%200.806571L45.9918%200.607344C35.1926%20-1.7951%2023.3914%203.00979%2014.397%2013.604C9.79721%2013.4048%205.79512%2015.0044%201.99812%2018.403L0%2020.2019L10.4007%2026.9991C9.00031%2029.4015%209.80307%2032.9994%2012.3989%2035.601C15.0005%2038.0035%2018.5983%2038.9996%2021.0007%2037.5992L27.7978%2048L29.3975%2046.2011C32.9953%2042.199%2034.5949%2038.4019%2034.3957%2033.6029C44.9957%2024.4033%2049.7947%2012.602%2047.3922%202.00779ZM33.0832%2031.6927L31.5304%2033.0228V35.2436C31.753%2038.5719%2030.1358%2040.9391%2028.3603%2043.5994L21.7097%2033.6205L18.4635%2035.3022C17.5787%2035.7475%2015.5806%2035.3022%2014.0278%2033.7494C12.2524%2032.1966%2012.0297%2030.2043%2012.475%2029.5363L14.1685%2026.3018L4.41226%2019.6511C7.07251%2017.8757%209.73275%2016.6862%2012.8383%2016.6862H14.8364L16.3892%2014.9107C24.8153%204.93175%2035.9016%200.572186%2045.6637%202.12499C47.2165%2011.8871%2042.8394%2023.2665%2033.0832%2031.6927Z'%20fill='%23DCDEE5'/%3e%3cpath%20d='M41.6673%205.44539C35.3228%204.41268%2024.824%2010.6861%2019.3428%2017.3334L18.3346%2018.5145H17.0367C15.0204%2018.5145%2013.288%2019.3039%2011.5556%2020.4909L17.9001%2024.9244L16.7992%2027.0788C16.5095%2027.524%2016.6543%2028.8534%2017.8074%2029.8862C18.8155%2030.9189%2020.1134%2031.2156%2020.6928%2030.9189L22.8018%2029.7971L27.13%2036.4444C28.283%2034.6698%2029.3318%2033.0911%2029.1869%2030.8773V29.3995L30.1951%2028.5151C36.5454%2022.9005%2042.6813%2011.9503%2041.6673%205.44539Z'%20fill='%23A3C5FD'/%3e%3cpath%20d='M8.59356%2037.5135C7.21124%2038.9237%206.22222%2043.5556%206.22222%2043.5556C6.22222%2043.5556%2010.5658%2042.7472%2012.1448%2041.1364C13.3304%2039.9268%2013.5271%2038.1153%2012.7347%2037.1063C11.5548%2036.1033%209.77922%2036.3098%208.59356%2037.5135ZM32.7812%2013.8467C31.6129%2013.1622%2030.1785%2013.1622%2029.016%2013.8467C27.8476%2014.5311%2027.1305%2015.7997%2027.1305%2017.1745C27.1305%2018.5494%2027.8476%2019.818%2029.016%2020.5024C30.1785%2021.1869%2031.6186%2021.1869%2032.7812%2020.5024C33.9495%2019.818%2034.6667%2018.5494%2034.6667%2017.1745C34.6667%2015.8056%2033.9495%2014.537%2032.7812%2013.8467Z'%20fill='%23E1ECFF'/%3e%3c/svg%3e", H = { class: "release-dialog-body" }, I = { class: "release-illustration" }, Z = { class: "release-rocket-badge" }, A = ["src"], S = { class: "release-form" }, O = {
|
|
4
|
-
key: 0,
|
|
5
|
-
class: "form-error"
|
|
6
|
-
}, R = { class: "form-item" }, T = { class: "release-footer" }, q = 32, G = 255, U = `在此处填写你本次 FLOW 的关键信息!
|
|
7
|
-
养成良好的“变更日志”书写习惯,有助于提升信息的管理效率,完善的版本信息能够帮助提升版本管理的有效性和可靠性!`, X = /* @__PURE__ */ b({
|
|
8
|
-
__name: "index",
|
|
9
|
-
props: {
|
|
10
|
-
show: { type: Boolean },
|
|
11
|
-
defaultVersion: { default: "" },
|
|
12
|
-
pending: { type: Boolean, default: !1 },
|
|
13
|
-
errorMessage: { default: "" }
|
|
14
|
-
},
|
|
15
|
-
emits: ["update:show", "confirm"],
|
|
16
|
-
setup(_, { emit: g }) {
|
|
17
|
-
const s = _, m = g, t = k({ version: "", desc: "" }), l = V("");
|
|
18
|
-
f(
|
|
19
|
-
() => s.show,
|
|
20
|
-
(n) => {
|
|
21
|
-
n && (t.version = s.defaultVersion, t.desc = "", l.value = s.errorMessage);
|
|
22
|
-
}
|
|
23
|
-
), f(
|
|
24
|
-
() => s.errorMessage,
|
|
25
|
-
(n) => {
|
|
26
|
-
l.value = n;
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
const L = () => {
|
|
30
|
-
l.value = "";
|
|
31
|
-
}, h = () => {
|
|
32
|
-
if (s.pending) return;
|
|
33
|
-
const n = t.version.trim();
|
|
34
|
-
if (!n) {
|
|
35
|
-
l.value = "请输入版本号";
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
m("confirm", { version: n, desc: t.desc.trim() });
|
|
39
|
-
}, u = () => {
|
|
40
|
-
s.pending || m("update:show", !1);
|
|
41
|
-
};
|
|
42
|
-
return (n, e) => {
|
|
43
|
-
const p = i("bk-input"), C = i("bk-button"), w = i("bk-dialog");
|
|
44
|
-
return v(), E(w, {
|
|
45
|
-
"is-show": s.show,
|
|
46
|
-
"dialog-type": "show",
|
|
47
|
-
width: 480,
|
|
48
|
-
"esc-close": !1,
|
|
49
|
-
"quick-close": !1,
|
|
50
|
-
class: "flow-release-dialog",
|
|
51
|
-
onClosed: u
|
|
52
|
-
}, {
|
|
53
|
-
default: d(() => [
|
|
54
|
-
o("div", H, [
|
|
55
|
-
o("div", I, [
|
|
56
|
-
o("div", Z, [
|
|
57
|
-
o("img", {
|
|
58
|
-
src: x(F),
|
|
59
|
-
alt: ""
|
|
60
|
-
}, null, 8, A)
|
|
61
|
-
])
|
|
62
|
-
]),
|
|
63
|
-
e[6] || (e[6] = o("h3", { class: "release-title" }, "Flow 即将发布上线", -1)),
|
|
64
|
-
o("div", S, [
|
|
65
|
-
o("div", {
|
|
66
|
-
class: M(["form-item", { "is-error": !!l.value }])
|
|
67
|
-
}, [
|
|
68
|
-
e[2] || (e[2] = o("label", { class: "form-label" }, [
|
|
69
|
-
c(" 版本号 "),
|
|
70
|
-
o("span", { class: "required-mark" }, "*")
|
|
71
|
-
], -1)),
|
|
72
|
-
a(p, {
|
|
73
|
-
modelValue: t.version,
|
|
74
|
-
"onUpdate:modelValue": e[0] || (e[0] = (r) => t.version = r),
|
|
75
|
-
"data-test": "release-version-input",
|
|
76
|
-
placeholder: "请输入",
|
|
77
|
-
maxlength: q,
|
|
78
|
-
onInput: L
|
|
79
|
-
}, null, 8, ["modelValue"]),
|
|
80
|
-
l.value ? (v(), y("p", O, B(l.value), 1)) : D("", !0)
|
|
81
|
-
], 2),
|
|
82
|
-
o("div", R, [
|
|
83
|
-
e[3] || (e[3] = o("label", { class: "form-label" }, "版本描述", -1)),
|
|
84
|
-
a(p, {
|
|
85
|
-
modelValue: t.desc,
|
|
86
|
-
"onUpdate:modelValue": e[1] || (e[1] = (r) => t.desc = r),
|
|
87
|
-
type: "textarea",
|
|
88
|
-
rows: 4,
|
|
89
|
-
maxlength: G,
|
|
90
|
-
placeholder: U
|
|
91
|
-
}, null, 8, ["modelValue"])
|
|
92
|
-
])
|
|
93
|
-
]),
|
|
94
|
-
o("div", T, [
|
|
95
|
-
a(C, {
|
|
96
|
-
theme: "primary",
|
|
97
|
-
"data-test": "release-confirm",
|
|
98
|
-
loading: s.pending,
|
|
99
|
-
onClick: h
|
|
100
|
-
}, {
|
|
101
|
-
default: d(() => [...e[4] || (e[4] = [
|
|
102
|
-
c(" 提交并上线 ", -1)
|
|
103
|
-
])]),
|
|
104
|
-
_: 1
|
|
105
|
-
}, 8, ["loading"]),
|
|
106
|
-
a(C, {
|
|
107
|
-
disabled: s.pending,
|
|
108
|
-
onClick: u
|
|
109
|
-
}, {
|
|
110
|
-
default: d(() => [...e[5] || (e[5] = [
|
|
111
|
-
c("取消发布", -1)
|
|
112
|
-
])]),
|
|
113
|
-
_: 1
|
|
114
|
-
}, 8, ["disabled"])
|
|
115
|
-
])
|
|
116
|
-
])
|
|
117
|
-
]),
|
|
118
|
-
_: 1
|
|
119
|
-
}, 8, ["is-show"]);
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
}), W = /* @__PURE__ */ N(X, [["__scopeId", "data-v-37e4b277"]]);
|
|
123
|
-
export {
|
|
124
|
-
W as default
|
|
125
|
-
};
|
package/dist/index-CbEGVZdT.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-Bit4HgBF.cjs"),b={},_={class:"redo-icon"};function h(l,t){return e.openBlock(),e.createElementBlock("span",_,[...t[0]||(t[0]=[e.createElementVNode("svg",{width:"11",height:"10",viewBox:"0 0 11 10",fill:"none","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.5 5L0 2.5L3.5 0V2H7C9.20914 2 11 3.79086 11 6C11 8.20914 9.20914 10 7 10H4V9H7C8.65685 9 10 7.65685 10 6C10 4.34315 8.65685 3 7 3H3.5V5Z",fill:"currentColor"})],-1)])])}const v=a._export_sfc(b,[["render",h],["__scopeId","data-v-8e982205"]]),u="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20opacity='0.2'%20cx='8'%20cy='8'%20r='6'%20fill='%23C4C6CC'%20/%3e%3ccircle%20cx='8'%20cy='8'%20r='3'%20fill='%23979BA5'%20/%3e%3c/svg%3e",f={class:"version-history-item"},y=["src"],B={class:"item-head"},g={key:0,class:"item-online-tag"},w={class:"item-meta"},V={key:0,class:"item-desc"},D=e.defineComponent({__name:"version-history-item",props:{snapshot:{},online:{type:Boolean,default:!1},active:{type:Boolean,default:!1},showRollback:{type:Boolean,default:!1},rollbackDisabled:{type:Boolean,default:!1},rollbackDisabledTip:{default:""}},emits:["rollback"],setup(l,{emit:t}){const o=l,s=t,i=e.computed(()=>a.dayjs(o.snapshot.create_time).format("YYYY-MM-DD HH:mm:ss")),c=()=>{o.rollbackDisabled||!o.snapshot.version||s("rollback",o.snapshot.version)};return(r,d)=>{const p=e.resolveDirective("bk-tooltips");return e.openBlock(),e.createElementBlock("div",f,[e.createElementVNode("img",{class:"item-dot",src:e.unref(u),alt:""},null,8,y),e.createElementVNode("div",B,[e.createElementVNode("span",{class:e.normalizeClass(["item-version",{"is-active":o.active}])},"V"+e.toDisplayString(o.snapshot.version),3),o.online?(e.openBlock(),e.createElementBlock("span",g,"线上版本")):e.createCommentVNode("",!0),o.showRollback?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["item-rollback",{"is-disabled":o.rollbackDisabled}]),"data-test":"version-history-rollback",onClick:c},[e.createVNode(v),d[0]||(d[0]=e.createElementVNode("span",null,"加载至草稿",-1))],2)),[[p,{content:o.rollbackDisabledTip,disabled:!o.rollbackDisabledTip}]]):e.createCommentVNode("",!0)]),e.createElementVNode("div",w,[e.createElementVNode("span",null,e.toDisplayString(i.value),1),e.createElementVNode("span",null,e.toDisplayString(o.snapshot.operator),1)]),o.snapshot.desc?(e.openBlock(),e.createElementBlock("div",V,e.toDisplayString(o.snapshot.desc),1)):e.createCommentVNode("",!0)])}}}),C=a._export_sfc(D,[["__scopeId","data-v-fc0f5db5"]]),x={class:"version-history-slider"},E={key:1},N=e.defineComponent({__name:"index",props:{show:{type:Boolean},snapshots:{},onlineVersion:{default:null},activeVersion:{default:void 0},loading:{type:Boolean,default:!1},showRollback:{type:Boolean,default:!1},rollbackDisabled:{type:Boolean,default:!1},rollbackDisabledTip:{default:""}},emits:["update:show","rollback"],setup(l,{emit:t}){const o=l,s=t,i=()=>{s("update:show",!1)},c=r=>{s("rollback",r)};return(r,d)=>{const p=e.resolveComponent("bk-exception"),m=e.resolveComponent("bk-sideslider"),k=e.resolveDirective("bkloading");return e.openBlock(),e.createBlock(m,{title:"版本历史","is-show":o.show,width:640,"esc-close":!1,"before-close":i},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",x,[!o.loading&&o.snapshots.length===0?(e.openBlock(),e.createBlock(p,{key:0,class:"history-empty",scene:"part",type:"empty",title:"暂无历史版本"})):(e.openBlock(),e.createElementBlock("div",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.snapshots,n=>(e.openBlock(),e.createBlock(C,{key:n.id,snapshot:n,online:n.version===o.onlineVersion,active:n.version===o.activeVersion,"show-rollback":o.showRollback,"rollback-disabled":o.rollbackDisabled,"rollback-disabled-tip":o.rollbackDisabledTip,onRollback:c},null,8,["snapshot","online","active","show-rollback","rollback-disabled","rollback-disabled-tip"]))),128))]))])),[[k,{loading:o.loading}]])]),_:1},8,["is-show"])}}}),R=a._export_sfc(N,[["__scopeId","data-v-8efd434a"]]);exports.default=R;
|
package/dist/index-DVeWB2dR.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { defineComponent as b, resolveComponent as d, openBlock as k, createBlock as u, withCtx as t, createElementVNode as s, createVNode as l, unref as _, createTextVNode as n, toDisplayString as g } from "vue";
|
|
2
|
-
import { ExclamationCircleShape as w } from "bkui-vue/lib/icon";
|
|
3
|
-
import { _ as v } from "./index-DEh6TdMZ.js";
|
|
4
|
-
const C = { class: "rollback-dialog-body" }, x = { class: "rollback-icon-wrap" }, h = { class: "rollback-desc" }, y = { class: "rollback-version" }, B = { class: "rollback-footer" }, N = /* @__PURE__ */ b({
|
|
5
|
-
__name: "index",
|
|
6
|
-
props: {
|
|
7
|
-
show: { type: Boolean },
|
|
8
|
-
version: { default: "" },
|
|
9
|
-
pending: { type: Boolean, default: !1 }
|
|
10
|
-
},
|
|
11
|
-
emits: ["update:show", "confirm"],
|
|
12
|
-
setup(c, { emit: p }) {
|
|
13
|
-
const e = c, i = p, f = () => {
|
|
14
|
-
e.pending || !e.version || i("confirm", e.version);
|
|
15
|
-
}, r = () => {
|
|
16
|
-
e.pending || i("update:show", !1);
|
|
17
|
-
};
|
|
18
|
-
return (V, o) => {
|
|
19
|
-
const a = d("bk-button"), m = d("bk-dialog");
|
|
20
|
-
return k(), u(m, {
|
|
21
|
-
"is-show": e.show,
|
|
22
|
-
"dialog-type": "show",
|
|
23
|
-
width: 440,
|
|
24
|
-
"esc-close": !1,
|
|
25
|
-
"quick-close": !1,
|
|
26
|
-
class: "flow-rollback-confirm-dialog",
|
|
27
|
-
onClosed: r
|
|
28
|
-
}, {
|
|
29
|
-
default: t(() => [
|
|
30
|
-
s("div", C, [
|
|
31
|
-
s("div", x, [
|
|
32
|
-
l(_(w), { class: "rollback-icon" })
|
|
33
|
-
]),
|
|
34
|
-
o[6] || (o[6] = s("h3", { class: "rollback-title" }, "确认加载至草稿?", -1)),
|
|
35
|
-
s("p", h, [
|
|
36
|
-
o[0] || (o[0] = n(" 将版本 ", -1)),
|
|
37
|
-
s("span", y, g(e.version || "--"), 1),
|
|
38
|
-
o[1] || (o[1] = n(" 的内容加载至草稿,", -1)),
|
|
39
|
-
o[2] || (o[2] = s("strong", null, "当前草稿中未发布的改动将被覆盖", -1)),
|
|
40
|
-
o[3] || (o[3] = n(",该操作不可撤销。 ", -1))
|
|
41
|
-
]),
|
|
42
|
-
s("div", B, [
|
|
43
|
-
l(a, {
|
|
44
|
-
theme: "primary",
|
|
45
|
-
"data-test": "rollback-confirm",
|
|
46
|
-
loading: e.pending,
|
|
47
|
-
onClick: f
|
|
48
|
-
}, {
|
|
49
|
-
default: t(() => [...o[4] || (o[4] = [
|
|
50
|
-
n(" 确认恢复 ", -1)
|
|
51
|
-
])]),
|
|
52
|
-
_: 1
|
|
53
|
-
}, 8, ["loading"]),
|
|
54
|
-
l(a, {
|
|
55
|
-
disabled: e.pending,
|
|
56
|
-
onClick: r
|
|
57
|
-
}, {
|
|
58
|
-
default: t(() => [...o[5] || (o[5] = [
|
|
59
|
-
n("取消", -1)
|
|
60
|
-
])]),
|
|
61
|
-
_: 1
|
|
62
|
-
}, 8, ["disabled"])
|
|
63
|
-
])
|
|
64
|
-
])
|
|
65
|
-
]),
|
|
66
|
-
_: 1
|
|
67
|
-
}, 8, ["is-show"]);
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
}), D = /* @__PURE__ */ v(N, [["__scopeId", "data-v-98919657"]]);
|
|
71
|
-
export {
|
|
72
|
-
D as default
|
|
73
|
-
};
|
package/dist/index-DjIpWxVu.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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-Bit4HgBF.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;
|
package/dist/index-Dmx7sjvz.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-Bit4HgBF.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;
|
package/dist/index-DubPNExB.js
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import { defineComponent as A, ref as V, shallowRef as x, computed as C, watch as U, resolveComponent as j, resolveDirective as K, openBlock as l, createBlock as f, createSlots as S, withCtx as y, withDirectives as G, createElementBlock as d, createElementVNode as i, createCommentVNode as v, Fragment as H, renderList as J, toDisplayString as B, unref as Y, createVNode as R, createTextVNode as E } from "vue";
|
|
2
|
-
import { c as _, u as z, i as M, b as Q, d as W, g as X, D as Z, B as ee, R as te, E as ae, _ as oe } from "./index-DEh6TdMZ.js";
|
|
3
|
-
import "bkui-vue/lib/message";
|
|
4
|
-
import "bkui-vue/lib/icon";
|
|
5
|
-
import "monaco-editor";
|
|
6
|
-
const se = {
|
|
7
|
-
string: "input",
|
|
8
|
-
text: "input",
|
|
9
|
-
textarea: "textarea",
|
|
10
|
-
int: "input",
|
|
11
|
-
integer: "input",
|
|
12
|
-
number: "input",
|
|
13
|
-
float: "input",
|
|
14
|
-
json: "json",
|
|
15
|
-
object: "json",
|
|
16
|
-
array: "array",
|
|
17
|
-
list: "array",
|
|
18
|
-
select: "select",
|
|
19
|
-
time: "timepicker",
|
|
20
|
-
datetime: "timepicker"
|
|
21
|
-
}, L = (a) => a.replace(/^\$\{(.+)\}$/, "$1"), I = (a) => `\${${L(a)}}`;
|
|
22
|
-
function ne(a, c) {
|
|
23
|
-
const s = I(a.key), o = c ? _(c) : {}, p = a.custom_type ?? o.custom_type ?? se[a.type] ?? "input";
|
|
24
|
-
return {
|
|
25
|
-
...o,
|
|
26
|
-
key: s,
|
|
27
|
-
name: a.name ?? o.name ?? L(a.key),
|
|
28
|
-
custom_type: p,
|
|
29
|
-
desc: o.desc ?? "",
|
|
30
|
-
index: o.index ?? 0,
|
|
31
|
-
show_type: "show",
|
|
32
|
-
source_info: o.source_info ?? {},
|
|
33
|
-
source_tag: o.source_tag ?? "",
|
|
34
|
-
source_type: o.source_type ?? "custom",
|
|
35
|
-
validation: o.validation ?? "",
|
|
36
|
-
value: a.default ?? o.value,
|
|
37
|
-
meta: {
|
|
38
|
-
...o.meta ?? {},
|
|
39
|
-
required: a.required ?? o.meta?.required ?? !1
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function le(a, c = {}) {
|
|
44
|
-
if (!a) return {};
|
|
45
|
-
const s = a.constants;
|
|
46
|
-
return s && Object.keys(s).length > 0 ? { ...s } : Array.isArray(a.fields) && a.fields.length > 0 ? a.fields.reduce((o, p) => {
|
|
47
|
-
const n = I(p.key);
|
|
48
|
-
return o[n] = ne(p, c[n]), o;
|
|
49
|
-
}, {}) : {};
|
|
50
|
-
}
|
|
51
|
-
const ie = { class: "global-debug-input" }, re = {
|
|
52
|
-
key: 0,
|
|
53
|
-
class: "global-debug-input__params",
|
|
54
|
-
"data-test": "input-params"
|
|
55
|
-
}, ue = { key: 0 }, de = ["title"], ce = { class: "col-value" }, pe = {
|
|
56
|
-
key: 1,
|
|
57
|
-
class: "global-debug-input__value"
|
|
58
|
-
}, me = {
|
|
59
|
-
key: 1,
|
|
60
|
-
class: "form-params-wrapper"
|
|
61
|
-
}, fe = { class: "sideslider-footer-buttons" }, ye = /* @__PURE__ */ A({
|
|
62
|
-
__name: "index",
|
|
63
|
-
props: {
|
|
64
|
-
show: { type: Boolean },
|
|
65
|
-
schema: {},
|
|
66
|
-
pipelineConstants: { default: () => ({}) },
|
|
67
|
-
initialValues: { default: () => ({}) },
|
|
68
|
-
pending: { type: Boolean, default: !1 },
|
|
69
|
-
readonly: { type: Boolean, default: !1 }
|
|
70
|
-
},
|
|
71
|
-
emits: ["confirm", "close", "update:show"],
|
|
72
|
-
setup(a, { emit: c }) {
|
|
73
|
-
const s = a, o = c, p = z(), n = V({}), b = x([]), m = x([]), g = x(!1), h = V(), k = V(), w = C(() => b.value.filter((e) => M(e))), O = C(() => w.value.length > 0 || m.value.length > 0), F = C(
|
|
74
|
-
() => [...b.value].sort((e, t) => (e.index ?? 0) - (t.index ?? 0)).map((e) => {
|
|
75
|
-
const t = Object.prototype.hasOwnProperty.call(n.value, e.key) ? n.value[e.key] : e.value;
|
|
76
|
-
return {
|
|
77
|
-
key: e.key,
|
|
78
|
-
name: e.name || e.key,
|
|
79
|
-
value: t,
|
|
80
|
-
display: W(t),
|
|
81
|
-
isComplex: Q(t)
|
|
82
|
-
};
|
|
83
|
-
})
|
|
84
|
-
);
|
|
85
|
-
U(
|
|
86
|
-
() => s.show,
|
|
87
|
-
(e) => {
|
|
88
|
-
e && (n.value = _(s.initialValues ?? {}), q());
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
const q = async () => {
|
|
92
|
-
const e = le(s.schema, s.pipelineConstants), t = Object.values(e).filter(
|
|
93
|
-
(r) => typeof r == "object" && r !== null && r.show_type === "show"
|
|
94
|
-
);
|
|
95
|
-
if (b.value = t, s.readonly || Object.keys(e).length < 1) {
|
|
96
|
-
m.value = [];
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
g.value = !0;
|
|
100
|
-
try {
|
|
101
|
-
m.value = await X(p, e);
|
|
102
|
-
} catch (r) {
|
|
103
|
-
console.error("Failed to build debug input forms from schema:", r), m.value = [];
|
|
104
|
-
} finally {
|
|
105
|
-
g.value = !1;
|
|
106
|
-
}
|
|
107
|
-
}, N = (e) => {
|
|
108
|
-
n.value = { ...n.value, ..._(e) };
|
|
109
|
-
}, P = async () => {
|
|
110
|
-
const [e, t] = await Promise.all([
|
|
111
|
-
Promise.resolve(
|
|
112
|
-
typeof k.value?.validate == "function" ? k.value.validate() : !0
|
|
113
|
-
),
|
|
114
|
-
Promise.resolve(typeof h.value?.validate == "function" ? h.value.validate() : !0)
|
|
115
|
-
]);
|
|
116
|
-
!e || !t || o("confirm", _(n.value));
|
|
117
|
-
}, D = () => {
|
|
118
|
-
o("close"), o("update:show", !1);
|
|
119
|
-
};
|
|
120
|
-
return (e, t) => {
|
|
121
|
-
const r = j("bk-button"), T = j("bk-sideslider"), $ = K("bkloading");
|
|
122
|
-
return l(), f(T, {
|
|
123
|
-
title: "调试参数",
|
|
124
|
-
"is-show": s.show,
|
|
125
|
-
width: 960,
|
|
126
|
-
"quick-close": !0,
|
|
127
|
-
"esc-close": !1,
|
|
128
|
-
onClosed: D
|
|
129
|
-
}, S({
|
|
130
|
-
default: y(() => [
|
|
131
|
-
G((l(), d("div", ie, [
|
|
132
|
-
s.readonly ? (l(), d("table", re, [
|
|
133
|
-
t[2] || (t[2] = i("thead", null, [
|
|
134
|
-
i("tr", null, [
|
|
135
|
-
i("th", { class: "col-name" }, "参数名"),
|
|
136
|
-
i("th", { class: "col-value" }, "参数值")
|
|
137
|
-
])
|
|
138
|
-
], -1)),
|
|
139
|
-
i("tbody", null, [
|
|
140
|
-
F.value.length === 0 ? (l(), d("tr", ue, [...t[1] || (t[1] = [
|
|
141
|
-
i("td", {
|
|
142
|
-
class: "global-debug-input__empty",
|
|
143
|
-
colspan: "2"
|
|
144
|
-
}, "暂无参数", -1)
|
|
145
|
-
])])) : v("", !0),
|
|
146
|
-
(l(!0), d(H, null, J(F.value, (u) => (l(), d("tr", {
|
|
147
|
-
key: u.key,
|
|
148
|
-
"data-test": "input-row"
|
|
149
|
-
}, [
|
|
150
|
-
i("td", {
|
|
151
|
-
class: "col-name",
|
|
152
|
-
title: u.key
|
|
153
|
-
}, B(u.name), 9, de),
|
|
154
|
-
i("td", ce, [
|
|
155
|
-
u.isComplex ? (l(), f(Z, {
|
|
156
|
-
key: 0,
|
|
157
|
-
value: u.value,
|
|
158
|
-
"data-test": "json-viewer"
|
|
159
|
-
}, null, 8, ["value"])) : (l(), d("pre", pe, B(u.display), 1))
|
|
160
|
-
])
|
|
161
|
-
]))), 128))
|
|
162
|
-
])
|
|
163
|
-
])) : (l(), d("div", me, [
|
|
164
|
-
w.value.length > 0 ? (l(), f(Y(ee), {
|
|
165
|
-
key: 0,
|
|
166
|
-
ref_key: "builtinVariableFormRef",
|
|
167
|
-
ref: k,
|
|
168
|
-
modelValue: n.value,
|
|
169
|
-
"onUpdate:modelValue": t[0] || (t[0] = (u) => n.value = u),
|
|
170
|
-
variables: w.value
|
|
171
|
-
}, null, 8, ["modelValue", "variables"])) : v("", !0),
|
|
172
|
-
m.value.length > 0 ? (l(), f(te, {
|
|
173
|
-
key: 1,
|
|
174
|
-
ref_key: "renderFormRef",
|
|
175
|
-
ref: h,
|
|
176
|
-
scheme: m.value,
|
|
177
|
-
editable: "",
|
|
178
|
-
"form-option": {
|
|
179
|
-
showRequired: !0,
|
|
180
|
-
showGroup: !0,
|
|
181
|
-
showLabel: !1,
|
|
182
|
-
showHook: !1,
|
|
183
|
-
showDesc: !0,
|
|
184
|
-
formEdit: !0
|
|
185
|
-
},
|
|
186
|
-
"form-data": n.value,
|
|
187
|
-
onChange: N
|
|
188
|
-
}, null, 8, ["scheme", "form-data"])) : v("", !0),
|
|
189
|
-
O.value ? v("", !0) : (l(), f(ae, {
|
|
190
|
-
key: 2,
|
|
191
|
-
title: "暂无参数"
|
|
192
|
-
}))
|
|
193
|
-
]))
|
|
194
|
-
])), [
|
|
195
|
-
[$, { loading: g.value }]
|
|
196
|
-
])
|
|
197
|
-
]),
|
|
198
|
-
_: 2
|
|
199
|
-
}, [
|
|
200
|
-
s.readonly ? void 0 : {
|
|
201
|
-
name: "footer",
|
|
202
|
-
fn: y(() => [
|
|
203
|
-
i("div", fe, [
|
|
204
|
-
R(r, {
|
|
205
|
-
theme: "primary",
|
|
206
|
-
"data-test": "save-and-run",
|
|
207
|
-
loading: s.pending,
|
|
208
|
-
onClick: P
|
|
209
|
-
}, {
|
|
210
|
-
default: y(() => [...t[3] || (t[3] = [
|
|
211
|
-
E(" 保存并执行 ", -1)
|
|
212
|
-
])]),
|
|
213
|
-
_: 1
|
|
214
|
-
}, 8, ["loading"]),
|
|
215
|
-
R(r, {
|
|
216
|
-
disabled: s.pending,
|
|
217
|
-
onClick: D
|
|
218
|
-
}, {
|
|
219
|
-
default: y(() => [...t[4] || (t[4] = [
|
|
220
|
-
E("取消", -1)
|
|
221
|
-
])]),
|
|
222
|
-
_: 1
|
|
223
|
-
}, 8, ["disabled"])
|
|
224
|
-
])
|
|
225
|
-
]),
|
|
226
|
-
key: "0"
|
|
227
|
-
}
|
|
228
|
-
]), 1032, ["is-show"]);
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
}), ke = /* @__PURE__ */ oe(ye, [["__scopeId", "data-v-01a33593"]]);
|
|
232
|
-
export {
|
|
233
|
-
ke as default
|
|
234
|
-
};
|
package/dist/index-sEixnRd3.js
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { defineComponent as q, ref as f, shallowRef as J, computed as x, watch as P, resolveComponent as p, resolveDirective as U, openBlock as l, createBlock as v, withCtx as i, withDirectives as z, createElementBlock as y, Fragment as A, renderList as W, createVNode as b, createCommentVNode as g, createElementVNode as V, createTextVNode as C, toDisplayString as M } from "vue";
|
|
2
|
-
import { InfoBox as X } from "bkui-vue/lib";
|
|
3
|
-
import G from "bkui-vue/lib/message";
|
|
4
|
-
import { u as H, c as K, M as Q, p as Z, m as $, h as ee, r as T, f as te, a as oe, _ as se } from "./index-DEh6TdMZ.js";
|
|
5
|
-
const ae = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "mock-data-sideslider__title-sep"
|
|
8
|
-
}, ne = ["title"], le = { class: "mock-data-sideslider" }, re = { class: "mock-data-sideslider__footer" }, ce = "当前节点的输出不支持mock,是否需要在调试时跳过当前节点?", ie = "跳过调试", ue = /* @__PURE__ */ q({
|
|
9
|
-
__name: "index",
|
|
10
|
-
props: {
|
|
11
|
-
show: { type: Boolean },
|
|
12
|
-
node: { default: null },
|
|
13
|
-
outputs: { default: () => ({}) },
|
|
14
|
-
pending: { type: Boolean, default: !1 }
|
|
15
|
-
},
|
|
16
|
-
emits: ["confirm", "close", "update:show"],
|
|
17
|
-
setup(O, { emit: E }) {
|
|
18
|
-
const t = O, _ = E, F = H(), k = f(!1), u = J([]), d = f({}), h = f({}), m = f(!1), B = x(() => m.value ? ce : "暂无输出结果"), N = x(() => m.value ? ie : "确定"), D = async () => {
|
|
19
|
-
if (t.node) {
|
|
20
|
-
k.value = !0, h.value = {}, m.value = !1;
|
|
21
|
-
try {
|
|
22
|
-
const e = await Z(F, t.node.component);
|
|
23
|
-
u.value = $(e.outputs ?? []), m.value = ee(e.outputs);
|
|
24
|
-
const o = t.outputs ?? {}, a = {};
|
|
25
|
-
u.value.forEach((s) => {
|
|
26
|
-
const r = Object.prototype.hasOwnProperty.call(o, s.key) ? o[s.key] : s.type === "object" ? {} : void 0, n = T(s);
|
|
27
|
-
a[s.key] = n === "json-editor" || n === "data-table" ? te(r) : r;
|
|
28
|
-
}), d.value = a;
|
|
29
|
-
} catch (e) {
|
|
30
|
-
console.error(e), u.value = [], d.value = {}, m.value = !1, G({ theme: "error", message: "加载输出结果失败" });
|
|
31
|
-
} finally {
|
|
32
|
-
k.value = !1;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}, S = () => {
|
|
36
|
-
const e = {}, o = {};
|
|
37
|
-
return u.value.forEach((a) => {
|
|
38
|
-
const s = d.value[a.key], r = T(a);
|
|
39
|
-
if (r === "json-editor" || r === "data-table") {
|
|
40
|
-
const n = oe(s);
|
|
41
|
-
if (!n.valid) {
|
|
42
|
-
e[a.key] = n.message;
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
n.value !== void 0 && (o[a.key] = n.value);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
s !== void 0 && s !== "" && (o[a.key] = s);
|
|
49
|
-
}), { errors: e, outputs: o };
|
|
50
|
-
}, j = (e) => {
|
|
51
|
-
X({
|
|
52
|
-
title: "确认 Mock 输出?",
|
|
53
|
-
content: "Mock 输出将覆盖当前输出结果,执行时跳过该节点并以 Mock 值替代实际输出",
|
|
54
|
-
confirmText: "确定",
|
|
55
|
-
cancelText: "取消",
|
|
56
|
-
width: 400,
|
|
57
|
-
onConfirm: () => {
|
|
58
|
-
e();
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}, Y = () => {
|
|
62
|
-
if (m.value) {
|
|
63
|
-
_("confirm", { outputs: {} });
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const { errors: e, outputs: o } = S();
|
|
67
|
-
h.value = e, !(Object.keys(e).length > 0) && j(() => _("confirm", { outputs: o }));
|
|
68
|
-
}, w = () => {
|
|
69
|
-
_("close"), _("update:show", !1);
|
|
70
|
-
};
|
|
71
|
-
return P(
|
|
72
|
-
() => [t.show, t.node?.id],
|
|
73
|
-
([e]) => {
|
|
74
|
-
e && t.node && (d.value = K(t.outputs ?? {}), D());
|
|
75
|
-
},
|
|
76
|
-
{ immediate: !0 }
|
|
77
|
-
), (e, o) => {
|
|
78
|
-
const a = p("bk-form-item"), s = p("bk-form"), r = p("bk-exception"), n = p("bk-button"), I = p("bk-sideslider"), L = U("bkloading");
|
|
79
|
-
return l(), v(I, {
|
|
80
|
-
"is-show": t.show,
|
|
81
|
-
width: 960,
|
|
82
|
-
"quick-close": "",
|
|
83
|
-
"esc-close": !1,
|
|
84
|
-
onClosed: w
|
|
85
|
-
}, {
|
|
86
|
-
header: i(() => [
|
|
87
|
-
o[0] || (o[0] = V("span", { class: "mock-data-sideslider__title" }, "Mock输出", -1)),
|
|
88
|
-
t.node?.name ? (l(), y("span", ae, "-")) : g("", !0),
|
|
89
|
-
t.node?.name ? (l(), y("span", {
|
|
90
|
-
key: 1,
|
|
91
|
-
class: "mock-data-sideslider__title-node",
|
|
92
|
-
title: t.node.name
|
|
93
|
-
}, M(t.node.name), 9, ne)) : g("", !0)
|
|
94
|
-
]),
|
|
95
|
-
footer: i(() => [
|
|
96
|
-
V("div", re, [
|
|
97
|
-
b(n, {
|
|
98
|
-
theme: "primary",
|
|
99
|
-
"data-test": "mock-confirm",
|
|
100
|
-
loading: t.pending,
|
|
101
|
-
onClick: Y
|
|
102
|
-
}, {
|
|
103
|
-
default: i(() => [
|
|
104
|
-
C(M(N.value), 1)
|
|
105
|
-
]),
|
|
106
|
-
_: 1
|
|
107
|
-
}, 8, ["loading"]),
|
|
108
|
-
b(n, {
|
|
109
|
-
disabled: t.pending,
|
|
110
|
-
onClick: w
|
|
111
|
-
}, {
|
|
112
|
-
default: i(() => [...o[1] || (o[1] = [
|
|
113
|
-
C("取消", -1)
|
|
114
|
-
])]),
|
|
115
|
-
_: 1
|
|
116
|
-
}, 8, ["disabled"])
|
|
117
|
-
])
|
|
118
|
-
]),
|
|
119
|
-
default: i(() => [
|
|
120
|
-
z((l(), y("div", le, [
|
|
121
|
-
u.value.length > 0 ? (l(), v(s, {
|
|
122
|
-
key: 0,
|
|
123
|
-
"form-type": "vertical",
|
|
124
|
-
"label-width": 120,
|
|
125
|
-
"data-test": "mock-outputs-form"
|
|
126
|
-
}, {
|
|
127
|
-
default: i(() => [
|
|
128
|
-
(l(!0), y(A, null, W(u.value, (c) => (l(), v(a, {
|
|
129
|
-
key: c.key,
|
|
130
|
-
label: c.name || c.key
|
|
131
|
-
}, {
|
|
132
|
-
default: i(() => [
|
|
133
|
-
b(Q, {
|
|
134
|
-
modelValue: d.value[c.key],
|
|
135
|
-
"onUpdate:modelValue": (R) => d.value[c.key] = R,
|
|
136
|
-
field: c,
|
|
137
|
-
error: h.value[c.key]
|
|
138
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "field", "error"])
|
|
139
|
-
]),
|
|
140
|
-
_: 2
|
|
141
|
-
}, 1032, ["label"]))), 128))
|
|
142
|
-
]),
|
|
143
|
-
_: 1
|
|
144
|
-
})) : k.value ? g("", !0) : (l(), v(r, {
|
|
145
|
-
key: 1,
|
|
146
|
-
class: "mock-data-sideslider__exception",
|
|
147
|
-
scene: "part",
|
|
148
|
-
type: "empty",
|
|
149
|
-
title: B.value
|
|
150
|
-
}, null, 8, ["title"]))
|
|
151
|
-
])), [
|
|
152
|
-
[L, { loading: k.value }]
|
|
153
|
-
])
|
|
154
|
-
]),
|
|
155
|
-
_: 1
|
|
156
|
-
}, 8, ["is-show"]);
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
}), ke = /* @__PURE__ */ se(ue, [["__scopeId", "data-v-c4e2476a"]]);
|
|
160
|
-
export {
|
|
161
|
-
ke as default
|
|
162
|
-
};
|