@blueking/bkflow-canvas-editor 1.2.0-beta.5 → 1.2.0-beta.6
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 +96 -4
- package/dist/advanced.cjs.js +1 -1
- package/dist/advanced.d.ts +303 -28
- package/dist/advanced.esm.js +5 -2
- package/dist/context-CRk9vKJC.js +1621 -0
- package/dist/context-DhrPIIhQ.cjs +6 -0
- package/dist/index-6rNDFrb4.cjs +1 -0
- package/dist/index-8pQzq3Ur.js +73 -0
- package/dist/index-AG8VS7s1.js +63948 -0
- package/dist/index-B23-CKGW.js +137 -0
- package/dist/index-Bfi8TnAs.cjs +1 -0
- package/dist/index-BixpBxnO.cjs +1 -0
- package/dist/index-Bqf2hF4V.js +236 -0
- package/dist/index-BxgXAWVo.cjs +2 -0
- package/dist/index-C9br9kc6.js +127 -0
- package/dist/index-CKRWpad1.cjs +1 -0
- package/dist/index-CM38Ngjr.cjs +101 -0
- package/dist/index-CwRfChg0.cjs +1 -0
- package/dist/index-RHH-xjOH.js +647 -0
- package/dist/index-kieIlAaW.js +168 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +403 -27
- package/dist/index.esm.js +38 -28
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/context-Bj442dps.cjs +0 -1
- package/dist/context-CdSU0w5S.js +0 -633
- package/dist/index-C1XiYW6i.cjs +0 -93
- package/dist/index-ClFOndkK.js +0 -162
- package/dist/index-CoM_iLar.cjs +0 -1
- package/dist/index-D9tWoY5i.js +0 -514
- package/dist/index-DV2Z3oiJ.js +0 -58627
- package/dist/index-DwS9cgRG.cjs +0 -1
- package/dist/index-Dzam0n1k.js +0 -234
- package/dist/index-g6e2NJbw.cjs +0 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { openBlock as o, createElementBlock as t, createElementVNode as s, defineComponent as y, computed as B, resolveDirective as w, unref as a, normalizeClass as u, toDisplayString as i, createCommentVNode as h, withDirectives as g, createVNode as V, resolveComponent as v, createBlock as k, withCtx as R, Fragment as H, renderList as T } from "vue";
|
|
2
|
+
import "./context-CRk9vKJC.js";
|
|
3
|
+
import { _ as f, e as I } from "./index-AG8VS7s1.js";
|
|
4
|
+
import { t as d } from "@blueking/flow-canvas";
|
|
5
|
+
const $ = {}, Y = { class: "redo-icon" };
|
|
6
|
+
function L(n, l) {
|
|
7
|
+
return o(), t("span", Y, [...l[0] || (l[0] = [
|
|
8
|
+
s("svg", {
|
|
9
|
+
width: "11",
|
|
10
|
+
height: "10",
|
|
11
|
+
viewBox: "0 0 11 10",
|
|
12
|
+
fill: "none",
|
|
13
|
+
"aria-hidden": "true"
|
|
14
|
+
}, [
|
|
15
|
+
s("path", {
|
|
16
|
+
"fill-rule": "evenodd",
|
|
17
|
+
"clip-rule": "evenodd",
|
|
18
|
+
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",
|
|
19
|
+
fill: "currentColor"
|
|
20
|
+
})
|
|
21
|
+
], -1)
|
|
22
|
+
])]);
|
|
23
|
+
}
|
|
24
|
+
const M = /* @__PURE__ */ f($, [["render", L], ["__scopeId", "data-v-9149475f"]]), N = "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", E = { class: "version-history-item" }, j = ["src"], z = { class: "item-head" }, A = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "item-online-tag"
|
|
27
|
+
}, F = { class: "item-meta" }, S = {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "item-desc"
|
|
30
|
+
}, Z = /* @__PURE__ */ y({
|
|
31
|
+
__name: "version-history-item",
|
|
32
|
+
props: {
|
|
33
|
+
snapshot: {},
|
|
34
|
+
online: { type: Boolean, default: !1 },
|
|
35
|
+
active: { type: Boolean, default: !1 },
|
|
36
|
+
showRollback: { type: Boolean, default: !1 },
|
|
37
|
+
rollbackDisabled: { type: Boolean, default: !1 },
|
|
38
|
+
rollbackDisabledTip: { default: "" }
|
|
39
|
+
},
|
|
40
|
+
emits: ["rollback"],
|
|
41
|
+
setup(n, { emit: l }) {
|
|
42
|
+
const e = n, c = l, p = B(() => I(e.snapshot.create_time).format("YYYY-MM-DD HH:mm:ss")), _ = () => {
|
|
43
|
+
e.rollbackDisabled || !e.snapshot.version || c("rollback", e.snapshot.version);
|
|
44
|
+
};
|
|
45
|
+
return (b, x) => {
|
|
46
|
+
const m = w("bk-tooltips");
|
|
47
|
+
return o(), t("div", E, [
|
|
48
|
+
s("img", {
|
|
49
|
+
class: "item-dot",
|
|
50
|
+
src: a(N),
|
|
51
|
+
alt: ""
|
|
52
|
+
}, null, 8, j),
|
|
53
|
+
s("div", z, [
|
|
54
|
+
s("span", {
|
|
55
|
+
class: u(["item-version", { "is-active": e.active }])
|
|
56
|
+
}, "V" + i(e.snapshot.version), 3),
|
|
57
|
+
e.online ? (o(), t("span", A, i(a(d)("线上版本")), 1)) : h("", !0),
|
|
58
|
+
e.showRollback ? g((o(), t("div", {
|
|
59
|
+
key: 1,
|
|
60
|
+
class: u(["item-rollback", { "is-disabled": e.rollbackDisabled }]),
|
|
61
|
+
"data-test": "version-history-rollback",
|
|
62
|
+
onClick: _
|
|
63
|
+
}, [
|
|
64
|
+
V(M),
|
|
65
|
+
s("span", null, i(a(d)("加载至草稿")), 1)
|
|
66
|
+
], 2)), [
|
|
67
|
+
[m, { content: e.rollbackDisabledTip, disabled: !e.rollbackDisabledTip }]
|
|
68
|
+
]) : h("", !0)
|
|
69
|
+
]),
|
|
70
|
+
s("div", F, [
|
|
71
|
+
s("span", null, i(p.value), 1),
|
|
72
|
+
s("span", null, i(e.snapshot.operator), 1)
|
|
73
|
+
]),
|
|
74
|
+
e.snapshot.desc ? (o(), t("div", S, i(e.snapshot.desc), 1)) : h("", !0)
|
|
75
|
+
]);
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}), q = /* @__PURE__ */ f(Z, [["__scopeId", "data-v-4f42f220"]]), G = { class: "version-history-slider" }, J = { key: 1 }, K = /* @__PURE__ */ y({
|
|
79
|
+
__name: "index",
|
|
80
|
+
props: {
|
|
81
|
+
show: { type: Boolean },
|
|
82
|
+
snapshots: {},
|
|
83
|
+
onlineVersion: { default: null },
|
|
84
|
+
activeVersion: { default: void 0 },
|
|
85
|
+
loading: { type: Boolean, default: !1 },
|
|
86
|
+
showRollback: { type: Boolean, default: !1 },
|
|
87
|
+
rollbackDisabled: { type: Boolean, default: !1 },
|
|
88
|
+
rollbackDisabledTip: { default: "" }
|
|
89
|
+
},
|
|
90
|
+
emits: ["update:show", "rollback"],
|
|
91
|
+
setup(n, { emit: l }) {
|
|
92
|
+
const e = n, c = l, p = () => {
|
|
93
|
+
c("update:show", !1);
|
|
94
|
+
}, _ = (b) => {
|
|
95
|
+
c("rollback", b);
|
|
96
|
+
};
|
|
97
|
+
return (b, x) => {
|
|
98
|
+
const m = v("bk-exception"), D = v("bk-sideslider"), C = w("bkloading");
|
|
99
|
+
return o(), k(D, {
|
|
100
|
+
title: a(d)("版本历史"),
|
|
101
|
+
"is-show": e.show,
|
|
102
|
+
width: 640,
|
|
103
|
+
"esc-close": !1,
|
|
104
|
+
"before-close": p
|
|
105
|
+
}, {
|
|
106
|
+
default: R(() => [
|
|
107
|
+
g((o(), t("div", G, [
|
|
108
|
+
!e.loading && e.snapshots.length === 0 ? (o(), k(m, {
|
|
109
|
+
key: 0,
|
|
110
|
+
class: "history-empty",
|
|
111
|
+
scene: "part",
|
|
112
|
+
type: "empty",
|
|
113
|
+
title: a(d)("暂无历史版本")
|
|
114
|
+
}, null, 8, ["title"])) : (o(), t("div", J, [
|
|
115
|
+
(o(!0), t(H, null, T(e.snapshots, (r) => (o(), k(q, {
|
|
116
|
+
key: r.id,
|
|
117
|
+
snapshot: r,
|
|
118
|
+
online: r.version === e.onlineVersion,
|
|
119
|
+
active: r.version === e.activeVersion,
|
|
120
|
+
"show-rollback": e.showRollback,
|
|
121
|
+
"rollback-disabled": e.rollbackDisabled,
|
|
122
|
+
"rollback-disabled-tip": e.rollbackDisabledTip,
|
|
123
|
+
onRollback: _
|
|
124
|
+
}, null, 8, ["snapshot", "online", "active", "show-rollback", "rollback-disabled", "rollback-disabled-tip"]))), 128))
|
|
125
|
+
]))
|
|
126
|
+
])), [
|
|
127
|
+
[C, { loading: e.loading }]
|
|
128
|
+
])
|
|
129
|
+
]),
|
|
130
|
+
_: 1
|
|
131
|
+
}, 8, ["title", "is-show"]);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}), W = /* @__PURE__ */ f(K, [["__scopeId", "data-v-4b967ce3"]]);
|
|
135
|
+
export {
|
|
136
|
+
W as default
|
|
137
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");require("./context-DhrPIIhQ.cjs");const F=require("bkui-vue/lib"),M=require("bkui-vue/lib/message"),s=require("./index-CM38Ngjr.cjs"),l=require("@blueking/flow-canvas"),O={class:"mock-data-sideslider__title"},q={key:0,class:"mock-data-sideslider__title-sep"},S=["title"],T={class:"mock-data-sideslider"},j={class:"mock-data-sideslider__footer"},R=e.defineComponent({__name:"index",props:{show:{type:Boolean},node:{default:null},outputs:{default:()=>({})},pending:{type:Boolean,default:!1}},emits:["confirm","close","update:show"],setup(y,{emit:h}){const o=y,k=h,b=s.useFlowApiConfig(),_=e.ref(!1),d=e.shallowRef([]),m=e.ref({}),v=e.ref({}),p=e.ref(!1),g=e.computed(()=>p.value?l.t("当前节点的输出不支持mock,是否需要在调试时跳过当前节点?"):l.t("暂无输出结果")),w=e.computed(()=>p.value?l.t("跳过调试"):l.t("确定")),C=async()=>{if(o.node){_.value=!0,v.value={},p.value=!1;try{const t=await s.pluginDetailRequest(b,o.node.component);d.value=s.mergeOutputs(t.outputs??[]),p.value=s.hasOnlySystemOutputs(t.outputs);const c=o.outputs??{},a={};d.value.forEach(n=>{const i=Object.prototype.hasOwnProperty.call(c,n.key)?c[n.key]:n.type==="object"?{}:void 0,r=s.resolveMockFormControl(n);a[n.key]=r==="json-editor"||r==="data-table"?s.formatJsonFieldValue(i):i}),m.value=a}catch(t){console.error(t),d.value=[],m.value={},p.value=!1,M({theme:"error",message:l.t("加载输出结果失败")})}finally{_.value=!1}}},x=()=>{const t={},c={};return d.value.forEach(a=>{const n=m.value[a.key],i=s.resolveMockFormControl(a);if(i==="json-editor"||i==="data-table"){const r=s.parseJsonFieldValue(n);if(!r.valid){t[a.key]=r.message;return}r.value!==void 0&&(c[a.key]=r.value);return}n!==void 0&&n!==""&&(c[a.key]=n)}),{errors:t,outputs:c}},V=t=>{F.InfoBox({title:l.t("确认 Mock 输出?"),content:l.t("Mock 输出将覆盖当前输出结果,执行时跳过该节点并以 Mock 值替代实际输出"),confirmText:l.t("确定"),cancelText:l.t("取消"),width:400,onConfirm:()=>{t()}})},B=()=>{if(p.value){k("confirm",{outputs:{}});return}const{errors:t,outputs:c}=x();v.value=t,!(Object.keys(t).length>0)&&V(()=>k("confirm",{outputs:c}))},f=()=>{k("close"),k("update:show",!1)};return e.watch(()=>[o.show,o.node?.id],([t])=>{t&&o.node&&(m.value=s.cloneDeep(o.outputs??{}),C())},{immediate:!0}),(t,c)=>{const a=e.resolveComponent("bk-form-item"),n=e.resolveComponent("bk-form"),i=e.resolveComponent("bk-exception"),r=e.resolveComponent("bk-button"),N=e.resolveComponent("bk-sideslider"),D=e.resolveDirective("bkloading");return e.openBlock(),e.createBlock(N,{"is-show":o.show,width:960,"quick-close":"","esc-close":!1,onClosed:f},{header:e.withCtx(()=>[e.createElementVNode("span",O,e.toDisplayString(e.unref(l.t)("Mock输出")),1),o.node?.name?(e.openBlock(),e.createElementBlock("span",q,"-")):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,S)):e.createCommentVNode("",!0)]),footer:e.withCtx(()=>[e.createElementVNode("div",j,[e.createVNode(r,{theme:"primary","data-test":"mock-confirm",loading:o.pending,onClick:B},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w.value),1)]),_:1},8,["loading"]),e.createVNode(r,{disabled:o.pending,onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l.t)("取消")),1)]),_:1},8,["disabled"])])]),default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",T,[d.value.length>0?(e.openBlock(),e.createBlock(n,{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(d.value,u=>(e.openBlock(),e.createBlock(a,{key:u.key,label:u.name||u.key},{default:e.withCtx(()=>[e.createVNode(s.MockFieldRenderer,{modelValue:m.value[u.key],"onUpdate:modelValue":E=>m.value[u.key]=E,field:u,error:v.value[u.key]},null,8,["modelValue","onUpdate:modelValue","field","error"])]),_:2},1032,["label"]))),128))]),_:1})):_.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(i,{key:1,class:"mock-data-sideslider__exception",scene:"part",type:"empty",title:g.value},null,8,["title"]))])),[[D,{loading:_.value}]])]),_:1},8,["is-show"])}}}),I=s._export_sfc(R,[["__scopeId","data-v-402876f9"]]);exports.default=I;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");require("./context-DhrPIIhQ.cjs");const l=require("./index-CM38Ngjr.cjs");require("bkui-vue/lib/message");require("bkui-vue/lib/icon");require("monaco-editor");const u=require("@blueking/flow-canvas"),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"},g=o=>o.replace(/^\$\{(.+)\}$/,"$1"),V=o=>`\${${g(o)}}`;function F(o,d){const a=V(o.key),n=d?l.cloneDeep(d):{},p=o.custom_type??n.custom_type??N[o.type]??"input";return{...n,key:a,name:o.name??n.name??g(o.key),custom_type:p,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:o.default??n.value,meta:{...n.meta??{},required:o.required??n.meta?.required??!1}}}function q(o,d={}){if(!o)return{};const a=o.constants;return a&&Object.keys(a).length>0?{...a}:Array.isArray(o.fields)&&o.fields.length>0?o.fields.reduce((n,p)=>{const s=V(p.key);return n[s]=F(p,d[s]),n},{}):{}}const j={class:"global-debug-input"},R={key:0,class:"global-debug-input__params","data-test":"input-params"},S={class:"col-name"},L={class:"col-value"},O={key:0},T={class:"global-debug-input__empty",colspan:"2"},I=["title"],P={class:"col-value"},$={key:1,class:"global-debug-input__value"},A={key:1,class:"form-params-wrapper"},U={class:"sideslider-footer-buttons"},K=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(o,{emit:d}){const a=o,n=d,p=l.useFlowApiConfig(),s=e.ref({}),f=e.shallowRef([]),m=e.shallowRef([]),y=e.shallowRef(!1),v=e.ref(),_=e.ref(),k=e.computed(()=>f.value.filter(t=>l.isBuiltinUsageVariable(t))),w=e.computed(()=>k.value.length>0||m.value.length>0),h=e.computed(()=>[...f.value].sort((t,r)=>(t.index??0)-(r.index??0)).map(t=>{const r=Object.prototype.hasOwnProperty.call(s.value,t.key)?s.value[t.key]:t.value;return{key:t.key,name:t.name||t.key,value:r,display:l.formatDebugValue(r),isComplex:l.isComplexDebugValue(r)}}));e.watch(()=>a.show,t=>{t&&(s.value=l.cloneDeep(a.initialValues??{}),B())});const B=async()=>{const t=q(a.schema,a.pipelineConstants),r=Object.values(t).filter(i=>typeof i=="object"&&i!==null&&i.show_type==="show");if(f.value=r,a.readonly||Object.keys(t).length<1){m.value=[];return}y.value=!0;try{m.value=await l.getInputFormsFromConstants(p,t)}catch(i){console.error("Failed to build debug input forms from schema:",i),m.value=[]}finally{y.value=!1}},C=t=>{s.value={...s.value,...l.cloneDeep(t)}},x=async()=>{const[t,r]=await Promise.all([Promise.resolve(typeof _.value?.validate=="function"?_.value.validate():!0),Promise.resolve(typeof v.value?.validate=="function"?v.value.validate():!0)]);!t||!r||n("confirm",l.cloneDeep(s.value))},b=()=>{n("close"),n("update:show",!1)};return(t,r)=>{const i=e.resolveComponent("bk-button"),E=e.resolveComponent("bk-sideslider"),D=e.resolveDirective("bkloading");return e.openBlock(),e.createBlock(E,{title:e.unref(u.t)("调试参数"),"is-show":a.show,width:960,"quick-close":!0,"esc-close":!1,onClosed:b},e.createSlots({default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",j,[a.readonly?(e.openBlock(),e.createElementBlock("table",R,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",S,e.toDisplayString(e.unref(u.t)("参数名")),1),e.createElementVNode("th",L,e.toDisplayString(e.unref(u.t)("参数值")),1)])]),e.createElementVNode("tbody",null,[h.value.length===0?(e.openBlock(),e.createElementBlock("tr",O,[e.createElementVNode("td",T,e.toDisplayString(e.unref(u.t)("暂无参数")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,c=>(e.openBlock(),e.createElementBlock("tr",{key:c.key,"data-test":"input-row"},[e.createElementVNode("td",{class:"col-name",title:c.key},e.toDisplayString(c.name),9,I),e.createElementVNode("td",P,[c.isComplex?(e.openBlock(),e.createBlock(l.DebugJsonViewer,{key:0,value:c.value,"data-test":"json-viewer"},null,8,["value"])):(e.openBlock(),e.createElementBlock("pre",$,e.toDisplayString(c.display),1))])]))),128))])])):(e.openBlock(),e.createElementBlock("div",A,[k.value.length>0?(e.openBlock(),e.createBlock(e.unref(l.BuiltinVariableUsageForm),{key:0,ref_key:"builtinVariableFormRef",ref:_,modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=c=>s.value=c),variables:k.value},null,8,["modelValue","variables"])):e.createCommentVNode("",!0),m.value.length>0?(e.openBlock(),e.createBlock(l.RenderForm,{key:1,ref_key:"renderFormRef",ref:v,scheme:m.value,editable:"","form-option":{showRequired:!0,showGroup:!0,showLabel:!1,showHook:!1,showDesc:!0,formEdit:!0},"form-data":s.value,onChange:C},null,8,["scheme","form-data"])):e.createCommentVNode("",!0),w.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(l.EmptyException,{key:2,title:e.unref(u.t)("暂无参数")},null,8,["title"]))]))])),[[D,{loading:y.value}]])]),_:2},[a.readonly?void 0:{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",U,[e.createVNode(i,{theme:"primary","data-test":"save-and-run",loading:a.pending,onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u.t)("保存并执行")),1)]),_:1},8,["loading"]),e.createVNode(i,{disabled:a.pending,onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u.t)("取消")),1)]),_:1},8,["disabled"])])]),key:"0"}]),1032,["title","is-show"])}}}),G=l._export_sfc(K,[["__scopeId","data-v-8eaa2ef7"]]);exports.default=G;
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { defineComponent as K, ref as F, shallowRef as D, computed as j, watch as S, resolveComponent as E, resolveDirective as G, openBlock as l, createBlock as v, unref as c, createSlots as H, withCtx as h, withDirectives as J, createElementBlock as d, createElementVNode as i, toDisplayString as p, createCommentVNode as b, Fragment as Y, renderList as z, createVNode as L, createTextVNode as I } from "vue";
|
|
2
|
+
import "./context-CRk9vKJC.js";
|
|
3
|
+
import { c as g, u as M, i as Q, b as W, d as X, g as Z, D as ee, B as te, R as ae, E as oe, _ as se } from "./index-AG8VS7s1.js";
|
|
4
|
+
import "bkui-vue/lib/message";
|
|
5
|
+
import "bkui-vue/lib/icon";
|
|
6
|
+
import "monaco-editor";
|
|
7
|
+
import { t as m } from "@blueking/flow-canvas";
|
|
8
|
+
const ne = {
|
|
9
|
+
string: "input",
|
|
10
|
+
text: "input",
|
|
11
|
+
textarea: "textarea",
|
|
12
|
+
int: "input",
|
|
13
|
+
integer: "input",
|
|
14
|
+
number: "input",
|
|
15
|
+
float: "input",
|
|
16
|
+
json: "json",
|
|
17
|
+
object: "json",
|
|
18
|
+
array: "array",
|
|
19
|
+
list: "array",
|
|
20
|
+
select: "select",
|
|
21
|
+
time: "timepicker",
|
|
22
|
+
datetime: "timepicker"
|
|
23
|
+
}, O = (t) => t.replace(/^\$\{(.+)\}$/, "$1"), q = (t) => `\${${O(t)}}`;
|
|
24
|
+
function le(t, f) {
|
|
25
|
+
const o = q(t.key), a = f ? g(f) : {}, y = t.custom_type ?? a.custom_type ?? ne[t.type] ?? "input";
|
|
26
|
+
return {
|
|
27
|
+
...a,
|
|
28
|
+
key: o,
|
|
29
|
+
name: t.name ?? a.name ?? O(t.key),
|
|
30
|
+
custom_type: y,
|
|
31
|
+
desc: a.desc ?? "",
|
|
32
|
+
index: a.index ?? 0,
|
|
33
|
+
show_type: "show",
|
|
34
|
+
source_info: a.source_info ?? {},
|
|
35
|
+
source_tag: a.source_tag ?? "",
|
|
36
|
+
source_type: a.source_type ?? "custom",
|
|
37
|
+
validation: a.validation ?? "",
|
|
38
|
+
value: t.default ?? a.value,
|
|
39
|
+
meta: {
|
|
40
|
+
...a.meta ?? {},
|
|
41
|
+
required: t.required ?? a.meta?.required ?? !1
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function ie(t, f = {}) {
|
|
46
|
+
if (!t) return {};
|
|
47
|
+
const o = t.constants;
|
|
48
|
+
return o && Object.keys(o).length > 0 ? { ...o } : Array.isArray(t.fields) && t.fields.length > 0 ? t.fields.reduce((a, y) => {
|
|
49
|
+
const s = q(y.key);
|
|
50
|
+
return a[s] = le(y, f[s]), a;
|
|
51
|
+
}, {}) : {};
|
|
52
|
+
}
|
|
53
|
+
const re = { class: "global-debug-input" }, ue = {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: "global-debug-input__params",
|
|
56
|
+
"data-test": "input-params"
|
|
57
|
+
}, ce = { class: "col-name" }, de = { class: "col-value" }, pe = { key: 0 }, me = {
|
|
58
|
+
class: "global-debug-input__empty",
|
|
59
|
+
colspan: "2"
|
|
60
|
+
}, fe = ["title"], ye = { class: "col-value" }, _e = {
|
|
61
|
+
key: 1,
|
|
62
|
+
class: "global-debug-input__value"
|
|
63
|
+
}, ve = {
|
|
64
|
+
key: 1,
|
|
65
|
+
class: "form-params-wrapper"
|
|
66
|
+
}, he = { class: "sideslider-footer-buttons" }, be = /* @__PURE__ */ K({
|
|
67
|
+
__name: "index",
|
|
68
|
+
props: {
|
|
69
|
+
show: { type: Boolean },
|
|
70
|
+
schema: {},
|
|
71
|
+
pipelineConstants: { default: () => ({}) },
|
|
72
|
+
initialValues: { default: () => ({}) },
|
|
73
|
+
pending: { type: Boolean, default: !1 },
|
|
74
|
+
readonly: { type: Boolean, default: !1 }
|
|
75
|
+
},
|
|
76
|
+
emits: ["confirm", "close", "update:show"],
|
|
77
|
+
setup(t, { emit: f }) {
|
|
78
|
+
const o = t, a = f, y = M(), s = F({}), k = D([]), _ = D([]), w = D(!1), V = F(), x = F(), C = j(() => k.value.filter((e) => Q(e))), N = j(() => C.value.length > 0 || _.value.length > 0), B = j(
|
|
79
|
+
() => [...k.value].sort((e, n) => (e.index ?? 0) - (n.index ?? 0)).map((e) => {
|
|
80
|
+
const n = Object.prototype.hasOwnProperty.call(s.value, e.key) ? s.value[e.key] : e.value;
|
|
81
|
+
return {
|
|
82
|
+
key: e.key,
|
|
83
|
+
name: e.name || e.key,
|
|
84
|
+
value: n,
|
|
85
|
+
display: X(n),
|
|
86
|
+
isComplex: W(n)
|
|
87
|
+
};
|
|
88
|
+
})
|
|
89
|
+
);
|
|
90
|
+
S(
|
|
91
|
+
() => o.show,
|
|
92
|
+
(e) => {
|
|
93
|
+
e && (s.value = g(o.initialValues ?? {}), P());
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
const P = async () => {
|
|
97
|
+
const e = ie(o.schema, o.pipelineConstants), n = Object.values(e).filter(
|
|
98
|
+
(r) => typeof r == "object" && r !== null && r.show_type === "show"
|
|
99
|
+
);
|
|
100
|
+
if (k.value = n, o.readonly || Object.keys(e).length < 1) {
|
|
101
|
+
_.value = [];
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
w.value = !0;
|
|
105
|
+
try {
|
|
106
|
+
_.value = await Z(y, e);
|
|
107
|
+
} catch (r) {
|
|
108
|
+
console.error("Failed to build debug input forms from schema:", r), _.value = [];
|
|
109
|
+
} finally {
|
|
110
|
+
w.value = !1;
|
|
111
|
+
}
|
|
112
|
+
}, T = (e) => {
|
|
113
|
+
s.value = { ...s.value, ...g(e) };
|
|
114
|
+
}, $ = async () => {
|
|
115
|
+
const [e, n] = await Promise.all([
|
|
116
|
+
Promise.resolve(
|
|
117
|
+
typeof x.value?.validate == "function" ? x.value.validate() : !0
|
|
118
|
+
),
|
|
119
|
+
Promise.resolve(typeof V.value?.validate == "function" ? V.value.validate() : !0)
|
|
120
|
+
]);
|
|
121
|
+
!e || !n || a("confirm", g(s.value));
|
|
122
|
+
}, R = () => {
|
|
123
|
+
a("close"), a("update:show", !1);
|
|
124
|
+
};
|
|
125
|
+
return (e, n) => {
|
|
126
|
+
const r = E("bk-button"), A = E("bk-sideslider"), U = G("bkloading");
|
|
127
|
+
return l(), v(A, {
|
|
128
|
+
title: c(m)("调试参数"),
|
|
129
|
+
"is-show": o.show,
|
|
130
|
+
width: 960,
|
|
131
|
+
"quick-close": !0,
|
|
132
|
+
"esc-close": !1,
|
|
133
|
+
onClosed: R
|
|
134
|
+
}, H({
|
|
135
|
+
default: h(() => [
|
|
136
|
+
J((l(), d("div", re, [
|
|
137
|
+
o.readonly ? (l(), d("table", ue, [
|
|
138
|
+
i("thead", null, [
|
|
139
|
+
i("tr", null, [
|
|
140
|
+
i("th", ce, p(c(m)("参数名")), 1),
|
|
141
|
+
i("th", de, p(c(m)("参数值")), 1)
|
|
142
|
+
])
|
|
143
|
+
]),
|
|
144
|
+
i("tbody", null, [
|
|
145
|
+
B.value.length === 0 ? (l(), d("tr", pe, [
|
|
146
|
+
i("td", me, p(c(m)("暂无参数")), 1)
|
|
147
|
+
])) : b("", !0),
|
|
148
|
+
(l(!0), d(Y, null, z(B.value, (u) => (l(), d("tr", {
|
|
149
|
+
key: u.key,
|
|
150
|
+
"data-test": "input-row"
|
|
151
|
+
}, [
|
|
152
|
+
i("td", {
|
|
153
|
+
class: "col-name",
|
|
154
|
+
title: u.key
|
|
155
|
+
}, p(u.name), 9, fe),
|
|
156
|
+
i("td", ye, [
|
|
157
|
+
u.isComplex ? (l(), v(ee, {
|
|
158
|
+
key: 0,
|
|
159
|
+
value: u.value,
|
|
160
|
+
"data-test": "json-viewer"
|
|
161
|
+
}, null, 8, ["value"])) : (l(), d("pre", _e, p(u.display), 1))
|
|
162
|
+
])
|
|
163
|
+
]))), 128))
|
|
164
|
+
])
|
|
165
|
+
])) : (l(), d("div", ve, [
|
|
166
|
+
C.value.length > 0 ? (l(), v(c(te), {
|
|
167
|
+
key: 0,
|
|
168
|
+
ref_key: "builtinVariableFormRef",
|
|
169
|
+
ref: x,
|
|
170
|
+
modelValue: s.value,
|
|
171
|
+
"onUpdate:modelValue": n[0] || (n[0] = (u) => s.value = u),
|
|
172
|
+
variables: C.value
|
|
173
|
+
}, null, 8, ["modelValue", "variables"])) : b("", !0),
|
|
174
|
+
_.value.length > 0 ? (l(), v(ae, {
|
|
175
|
+
key: 1,
|
|
176
|
+
ref_key: "renderFormRef",
|
|
177
|
+
ref: V,
|
|
178
|
+
scheme: _.value,
|
|
179
|
+
editable: "",
|
|
180
|
+
"form-option": {
|
|
181
|
+
showRequired: !0,
|
|
182
|
+
showGroup: !0,
|
|
183
|
+
showLabel: !1,
|
|
184
|
+
showHook: !1,
|
|
185
|
+
showDesc: !0,
|
|
186
|
+
formEdit: !0
|
|
187
|
+
},
|
|
188
|
+
"form-data": s.value,
|
|
189
|
+
onChange: T
|
|
190
|
+
}, null, 8, ["scheme", "form-data"])) : b("", !0),
|
|
191
|
+
N.value ? b("", !0) : (l(), v(oe, {
|
|
192
|
+
key: 2,
|
|
193
|
+
title: c(m)("暂无参数")
|
|
194
|
+
}, null, 8, ["title"]))
|
|
195
|
+
]))
|
|
196
|
+
])), [
|
|
197
|
+
[U, { loading: w.value }]
|
|
198
|
+
])
|
|
199
|
+
]),
|
|
200
|
+
_: 2
|
|
201
|
+
}, [
|
|
202
|
+
o.readonly ? void 0 : {
|
|
203
|
+
name: "footer",
|
|
204
|
+
fn: h(() => [
|
|
205
|
+
i("div", he, [
|
|
206
|
+
L(r, {
|
|
207
|
+
theme: "primary",
|
|
208
|
+
"data-test": "save-and-run",
|
|
209
|
+
loading: o.pending,
|
|
210
|
+
onClick: $
|
|
211
|
+
}, {
|
|
212
|
+
default: h(() => [
|
|
213
|
+
I(p(c(m)("保存并执行")), 1)
|
|
214
|
+
]),
|
|
215
|
+
_: 1
|
|
216
|
+
}, 8, ["loading"]),
|
|
217
|
+
L(r, {
|
|
218
|
+
disabled: o.pending,
|
|
219
|
+
onClick: R
|
|
220
|
+
}, {
|
|
221
|
+
default: h(() => [
|
|
222
|
+
I(p(c(m)("取消")), 1)
|
|
223
|
+
]),
|
|
224
|
+
_: 1
|
|
225
|
+
}, 8, ["disabled"])
|
|
226
|
+
])
|
|
227
|
+
]),
|
|
228
|
+
key: "0"
|
|
229
|
+
}
|
|
230
|
+
]), 1032, ["title", "is-show"]);
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
}), De = /* @__PURE__ */ se(be, [["__scopeId", "data-v-8eaa2ef7"]]);
|
|
234
|
+
export {
|
|
235
|
+
De as default
|
|
236
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");require("./context-DhrPIIhQ.cjs");const s=require("@blueking/flow-canvas"),v=require("./index-CM38Ngjr.cjs"),g="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",V={class:"release-dialog-body"},E={class:"release-illustration"},w={class:"release-rocket-badge"},L=["src"],N={class:"release-title"},b={class:"release-form"},k={class:"form-label"},x={key:0,class:"form-error"},y={class:"form-item"},D={class:"form-label"},M={class:"release-footer"},S=32,B=255,q=e.defineComponent({__name:"index",props:{show:{type:Boolean},defaultVersion:{default:""},pending:{type:Boolean,default:!1},errorMessage:{default:""}},emits:["update:show","confirm"],setup(m,{emit:p}){const C=s.t(`在此处填写你本次 FLOW 的关键信息!
|
|
2
|
+
养成良好的“变更日志”书写习惯,有助于提升信息的管理效率,完善的版本信息能够帮助提升版本管理的有效性和可靠性!`),t=m,i=p,o=e.reactive({version:"",desc:""}),n=e.ref("");e.watch(()=>t.show,l=>{l&&(o.version=t.defaultVersion,o.desc="",n.value=t.errorMessage)}),e.watch(()=>t.errorMessage,l=>{n.value=l});const f=()=>{n.value=""},_=()=>{if(t.pending)return;const l=o.version.trim();if(!l){n.value=s.t("请输入版本号");return}i("confirm",{version:l,desc:o.desc.trim()})},d=()=>{t.pending||i("update:show",!1)};return(l,r)=>{const c=e.resolveComponent("bk-input"),u=e.resolveComponent("bk-button"),h=e.resolveComponent("bk-dialog");return e.openBlock(),e.createBlock(h,{"is-show":t.show,"dialog-type":"show",width:480,"esc-close":!1,"quick-close":!1,class:"flow-release-dialog",onClosed:d},{default:e.withCtx(()=>[e.createElementVNode("div",V,[e.createElementVNode("div",E,[e.createElementVNode("div",w,[e.createElementVNode("img",{src:e.unref(g),alt:""},null,8,L)])]),e.createElementVNode("h3",N,e.toDisplayString(e.unref(s.t)("Flow 即将发布上线")),1),e.createElementVNode("div",b,[e.createElementVNode("div",{class:e.normalizeClass(["form-item",{"is-error":!!n.value}])},[e.createElementVNode("label",k,[e.createTextVNode(e.toDisplayString(e.unref(s.t)("版本号"))+" ",1),r[2]||(r[2]=e.createElementVNode("span",{class:"required-mark"},"*",-1))]),e.createVNode(c,{modelValue:o.version,"onUpdate:modelValue":r[0]||(r[0]=a=>o.version=a),"data-test":"release-version-input",placeholder:e.unref(s.t)("请输入"),maxlength:S,onInput:f},null,8,["modelValue","placeholder"]),n.value?(e.openBlock(),e.createElementBlock("p",x,e.toDisplayString(n.value),1)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",y,[e.createElementVNode("label",D,e.toDisplayString(e.unref(s.t)("版本描述")),1),e.createVNode(c,{modelValue:o.desc,"onUpdate:modelValue":r[1]||(r[1]=a=>o.desc=a),type:"textarea",rows:4,maxlength:B,placeholder:e.unref(C)},null,8,["modelValue","placeholder"])])]),e.createElementVNode("div",M,[e.createVNode(u,{theme:"primary","data-test":"release-confirm",loading:t.pending,onClick:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s.t)("提交并上线")),1)]),_:1},8,["loading"]),e.createVNode(u,{disabled:t.pending,onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s.t)("取消发布")),1)]),_:1},8,["disabled"])])])]),_:1},8,["is-show"])}}}),T=v._export_sfc(q,[["__scopeId","data-v-5465e0b3"]]);exports.default=T;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { defineComponent as x, reactive as M, ref as y, watch as v, resolveComponent as m, openBlock as g, createBlock as B, withCtx as p, createElementVNode as e, unref as t, toDisplayString as i, normalizeClass as D, createTextVNode as u, createVNode as d, createElementBlock as N, createCommentVNode as F } from "vue";
|
|
2
|
+
import "./context-CRk9vKJC.js";
|
|
3
|
+
import { t as l } from "@blueking/flow-canvas";
|
|
4
|
+
import { _ as H } from "./index-AG8VS7s1.js";
|
|
5
|
+
const I = "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", Z = { class: "release-dialog-body" }, A = { class: "release-illustration" }, S = { class: "release-rocket-badge" }, O = ["src"], R = { class: "release-title" }, T = { class: "release-form" }, q = { class: "form-label" }, G = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "form-error"
|
|
8
|
+
}, U = { class: "form-item" }, X = { class: "form-label" }, z = { class: "release-footer" }, P = 32, W = 255, j = /* @__PURE__ */ x({
|
|
9
|
+
__name: "index",
|
|
10
|
+
props: {
|
|
11
|
+
show: { type: Boolean },
|
|
12
|
+
defaultVersion: { default: "" },
|
|
13
|
+
pending: { type: Boolean, default: !1 },
|
|
14
|
+
errorMessage: { default: "" }
|
|
15
|
+
},
|
|
16
|
+
emits: ["update:show", "confirm"],
|
|
17
|
+
setup(L, { emit: w }) {
|
|
18
|
+
const b = l(`在此处填写你本次 FLOW 的关键信息!
|
|
19
|
+
养成良好的“变更日志”书写习惯,有助于提升信息的管理效率,完善的版本信息能够帮助提升版本管理的有效性和可靠性!`), o = L, C = w, s = M({ version: "", desc: "" }), n = y("");
|
|
20
|
+
v(
|
|
21
|
+
() => o.show,
|
|
22
|
+
(a) => {
|
|
23
|
+
a && (s.version = o.defaultVersion, s.desc = "", n.value = o.errorMessage);
|
|
24
|
+
}
|
|
25
|
+
), v(
|
|
26
|
+
() => o.errorMessage,
|
|
27
|
+
(a) => {
|
|
28
|
+
n.value = a;
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
const k = () => {
|
|
32
|
+
n.value = "";
|
|
33
|
+
}, V = () => {
|
|
34
|
+
if (o.pending) return;
|
|
35
|
+
const a = s.version.trim();
|
|
36
|
+
if (!a) {
|
|
37
|
+
n.value = l("请输入版本号");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
C("confirm", { version: a, desc: s.desc.trim() });
|
|
41
|
+
}, _ = () => {
|
|
42
|
+
o.pending || C("update:show", !1);
|
|
43
|
+
};
|
|
44
|
+
return (a, r) => {
|
|
45
|
+
const f = m("bk-input"), h = m("bk-button"), E = m("bk-dialog");
|
|
46
|
+
return g(), B(E, {
|
|
47
|
+
"is-show": o.show,
|
|
48
|
+
"dialog-type": "show",
|
|
49
|
+
width: 480,
|
|
50
|
+
"esc-close": !1,
|
|
51
|
+
"quick-close": !1,
|
|
52
|
+
class: "flow-release-dialog",
|
|
53
|
+
onClosed: _
|
|
54
|
+
}, {
|
|
55
|
+
default: p(() => [
|
|
56
|
+
e("div", Z, [
|
|
57
|
+
e("div", A, [
|
|
58
|
+
e("div", S, [
|
|
59
|
+
e("img", {
|
|
60
|
+
src: t(I),
|
|
61
|
+
alt: ""
|
|
62
|
+
}, null, 8, O)
|
|
63
|
+
])
|
|
64
|
+
]),
|
|
65
|
+
e("h3", R, i(t(l)("Flow 即将发布上线")), 1),
|
|
66
|
+
e("div", T, [
|
|
67
|
+
e("div", {
|
|
68
|
+
class: D(["form-item", { "is-error": !!n.value }])
|
|
69
|
+
}, [
|
|
70
|
+
e("label", q, [
|
|
71
|
+
u(i(t(l)("版本号")) + " ", 1),
|
|
72
|
+
r[2] || (r[2] = e("span", { class: "required-mark" }, "*", -1))
|
|
73
|
+
]),
|
|
74
|
+
d(f, {
|
|
75
|
+
modelValue: s.version,
|
|
76
|
+
"onUpdate:modelValue": r[0] || (r[0] = (c) => s.version = c),
|
|
77
|
+
"data-test": "release-version-input",
|
|
78
|
+
placeholder: t(l)("请输入"),
|
|
79
|
+
maxlength: P,
|
|
80
|
+
onInput: k
|
|
81
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
82
|
+
n.value ? (g(), N("p", G, i(n.value), 1)) : F("", !0)
|
|
83
|
+
], 2),
|
|
84
|
+
e("div", U, [
|
|
85
|
+
e("label", X, i(t(l)("版本描述")), 1),
|
|
86
|
+
d(f, {
|
|
87
|
+
modelValue: s.desc,
|
|
88
|
+
"onUpdate:modelValue": r[1] || (r[1] = (c) => s.desc = c),
|
|
89
|
+
type: "textarea",
|
|
90
|
+
rows: 4,
|
|
91
|
+
maxlength: W,
|
|
92
|
+
placeholder: t(b)
|
|
93
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
94
|
+
])
|
|
95
|
+
]),
|
|
96
|
+
e("div", z, [
|
|
97
|
+
d(h, {
|
|
98
|
+
theme: "primary",
|
|
99
|
+
"data-test": "release-confirm",
|
|
100
|
+
loading: o.pending,
|
|
101
|
+
onClick: V
|
|
102
|
+
}, {
|
|
103
|
+
default: p(() => [
|
|
104
|
+
u(i(t(l)("提交并上线")), 1)
|
|
105
|
+
]),
|
|
106
|
+
_: 1
|
|
107
|
+
}, 8, ["loading"]),
|
|
108
|
+
d(h, {
|
|
109
|
+
disabled: o.pending,
|
|
110
|
+
onClick: _
|
|
111
|
+
}, {
|
|
112
|
+
default: p(() => [
|
|
113
|
+
u(i(t(l)("取消发布")), 1)
|
|
114
|
+
]),
|
|
115
|
+
_: 1
|
|
116
|
+
}, 8, ["disabled"])
|
|
117
|
+
])
|
|
118
|
+
])
|
|
119
|
+
]),
|
|
120
|
+
_: 1
|
|
121
|
+
}, 8, ["is-show"]);
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}), $ = /* @__PURE__ */ H(j, [["__scopeId", "data-v-5465e0b3"]]);
|
|
125
|
+
export {
|
|
126
|
+
$ as default
|
|
127
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");require("./context-DhrPIIhQ.cjs");const i=require("./index-CM38Ngjr.cjs"),a=require("@blueking/flow-canvas"),b={},u={class:"redo-icon"};function h(l,t){return e.openBlock(),e.createElementBlock("span",u,[...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 f=i._export_sfc(b,[["render",h],["__scopeId","data-v-9149475f"]]),v="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",y={class:"version-history-item"},B=["src"],g={class:"item-head"},w={key:0,class:"item-online-tag"},D={class:"item-meta"},V={key:0,class:"item-desc"},C=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,c=e.computed(()=>i.dayjs(o.snapshot.create_time).format("YYYY-MM-DD HH:mm:ss")),r=()=>{o.rollbackDisabled||!o.snapshot.version||s("rollback",o.snapshot.version)};return(d,m)=>{const p=e.resolveDirective("bk-tooltips");return e.openBlock(),e.createElementBlock("div",y,[e.createElementVNode("img",{class:"item-dot",src:e.unref(v),alt:""},null,8,B),e.createElementVNode("div",g,[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",w,e.toDisplayString(e.unref(a.t)("线上版本")),1)):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:r},[e.createVNode(f),e.createElementVNode("span",null,e.toDisplayString(e.unref(a.t)("加载至草稿")),1)],2)),[[p,{content:o.rollbackDisabledTip,disabled:!o.rollbackDisabledTip}]]):e.createCommentVNode("",!0)]),e.createElementVNode("div",D,[e.createElementVNode("span",null,e.toDisplayString(c.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)])}}}),x=i._export_sfc(C,[["__scopeId","data-v-4f42f220"]]),E={class:"version-history-slider"},N={key:1},R=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,c=()=>{s("update:show",!1)},r=d=>{s("rollback",d)};return(d,m)=>{const p=e.resolveComponent("bk-exception"),k=e.resolveComponent("bk-sideslider"),_=e.resolveDirective("bkloading");return e.openBlock(),e.createBlock(k,{title:e.unref(a.t)("版本历史"),"is-show":o.show,width:640,"esc-close":!1,"before-close":c},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",E,[!o.loading&&o.snapshots.length===0?(e.openBlock(),e.createBlock(p,{key:0,class:"history-empty",scene:"part",type:"empty",title:e.unref(a.t)("暂无历史版本")},null,8,["title"])):(e.openBlock(),e.createElementBlock("div",N,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.snapshots,n=>(e.openBlock(),e.createBlock(x,{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:r},null,8,["snapshot","online","active","show-rollback","rollback-disabled","rollback-disabled-tip"]))),128))]))])),[[_,{loading:o.loading}]])]),_:1},8,["title","is-show"])}}}),S=i._export_sfc(R,[["__scopeId","data-v-4b967ce3"]]);exports.default=S;
|