index-a5cbdec2.js 11 KB

1
  1. import{_ as q,__tla as X}from"./ContentWrap.vue_vue_type_script_setup_true_lang-5a63038a.js";import{i as N,a as D,b as l,c as K,d as z,f as H,e as J,g as Q,P as B,_ as W,h as Y,__tla as Z}from"./bpmn-embedded-7a47b8f8.js";import{g as tt,u as et,c as nt,__tla as at}from"./index-762c49bf.js";import{d as ot,u as it,I as ct,r as S,k as rt,o as L,q as O,w as st,a as f,ai as pt,N as lt,O as mt,f as dt,__tla as ut}from"./index-2eab2d23.js";import{u as bt,__tla as _t}from"./useMessage-171aa63e.js";import{__tla as vt}from"./el-card-c558f0ec.js";import{__tla as ht}from"./Dialog-c2716df6.js";import"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as ft}from"./XTextButton-caeba438.js";import{__tla as gt}from"./XTextButton.vue_vue_type_style_index_0_scoped_7561ab3f_lang-e264c7bf.js";import{__tla as yt}from"./XButton-f05c5131.js";import{__tla as Et}from"./el-collapse-item-5ecf4321.js";import{__tla as kt}from"./el-link-f0d278a2.js";import{__tla as xt}from"./el-drawer-7ad3d607.js";import{__tla as Ct}from"./dict-1ad71b6f.js";import{__tla as wt}from"./formatTime-41155543.js";let G,Pt=Promise.all([(()=>{try{return X}catch{}})(),(()=>{try{return Z}catch{}})(),(()=>{try{return at}catch{}})(),(()=>{try{return ut}catch{}})(),(()=>{try{return _t}catch{}})(),(()=>{try{return vt}catch{}})(),(()=>{try{return ht}catch{}})(),(()=>{try{return ft}catch{}})(),(()=>{try{return gt}catch{}})(),(()=>{try{return yt}catch{}})(),(()=>{try{return Et}catch{}})(),(()=>{try{return kt}catch{}})(),(()=>{try{return xt}catch{}})(),(()=>{try{return Ct}catch{}})(),(()=>{try{return wt}catch{}})()]).then(async()=>{function I(n){return n.originalEvent||n.srcEvent}function U(n){return function(i,c){return(I(i)||i).button===c}(n,0)}function V(n){var i=I(n)||n;return!!U(n)&&(/mac/i.test(navigator.platform)?i.metaKey:i.ctrlKey)}function A(n,i,c,s,p,v,u,o,b,g,a,t){n=n||{},s.registerProvider(this),this._contextPad=s,this._modeling=p,this._elementFactory=v,this._connect=u,this._create=o,this._popupMenu=b,this._canvas=g,this._rules=a,this._translate=t,n.autoPlace!==!1&&(this._autoPlace=i.get("autoPlace",!1)),c.on("create.end",250,function(e){const d=e.context.shape;if(!V(e)||!s.isOpen(d))return;const r=s.getEntries(d);r.replace&&r.replace.action.click(e,d)})}function R(n,i,c){const s=n.$instanceOf(i);let p=!1;const v=n.eventDefinitions||[];return H(v,function(u){u.$type===c&&(p=!0)}),s&&p}A.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","elementRegistry"],A.prototype.getContextPadEntries=function(n){const i=this._contextPad,c=this._modeling,s=this._elementFactory,p=this._connect,v=this._create,u=this._popupMenu,o=this._canvas,b=this._rules,g=this._autoPlace,a=this._translate,t={};if(n.type==="label")return t;const e=n.businessObject;function d(_,h){p.start(_,h)}function r(_,h,m,C){function T(w,E){const P=s.createShape(l({type:_},C));v.start(w,P,{source:E})}return typeof m!="string"&&(C=m,m=a("Append {type}",{type:_.replace(/^bpmn:/,"")})),{group:"model",className:h,title:m,action:{dragstart:T,click:g?function(w,E){const P=s.createShape(l({type:_},C));g.append(E,P)}:T}}}function k(_){return function(h,m){c.splitLane(m,_),i.open(m,!0)}}if(N(e,["bpmn:Lane","bpmn:Participant"])&&J(e)){const _=Q(n);l(t,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:a("Add Lane above"),action:{click:function(h,m){c.addLane(m,"top")}}}}),_.length<2&&(n.height>=120&&l(t,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:a("Divide into two Lanes"),action:{click:k(2)}}}),n.height>=180&&l(t,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:a("Divide into three Lanes"),action:{click:k(3)}}})),l(t,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:a("Add Lane below"),action:{click:function(h,m){c.addLane(m,"bottom")}}}})}D(e,"bpmn:FlowNode")&&(D(e,"bpmn:EventBasedGateway")?l(t,{"append.receive-task":r("bpmn:ReceiveTask","bpmn-icon-receive-task",a("Append ReceiveTask")),"append.message-intermediate-event":r("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",a("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":r("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",a("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":r("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",a("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":r("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",a("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):R(e,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?l(t,{"append.compensation-activity":r("bpmn:Task","bpmn-icon-task",a("Append compensation activity"),{isForCompensation:!0})}):D(e,"bpmn:EndEvent")||e.isForCompensation||R(e,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||K(e)||l(t,{"append.end-event":r("bpmn:EndEvent","bpmn-icon-end-event-none",a("Append EndEvent")),"append.gateway":r("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",a("Append Gateway")),"append.append-task":r("bpmn:UserTask","bpmn-icon-user-task",a("Append Task")),"append.intermediate-event":r("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",a("Append Intermediate/Boundary Event"))})),u.isEmpty(n,"bpmn-replace")||l(t,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:"\u4FEE\u6539\u7C7B\u578B",action:{click:function(_,h){const m=l(function(C){const T=o.getContainer(),F=i.getPad(C).html,w=T.getBoundingClientRect(),E=F.getBoundingClientRect(),P=E.top-w.top;return{x:E.left-w.left,y:P+E.height+5}}(h),{cursor:{x:_.x,y:_.y}});u.open(h,"bpmn-replace",m)}}}}),N(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&l(t,{"append.text-annotation":r("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:a("Connect using "+(e.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:d,dragstart:d}}}),N(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&l(t,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:a("Connect using DataInputAssociation"),action:{click:d,dragstart:d}}}),D(e,"bpmn:Group")&&l(t,{"append.text-annotation":r("bpmn:TextAnnotation","bpmn-icon-text-annotation")});let y=b.allowed("elements.delete",{elements:[n]});return z(y)&&(y=y[0]===n),y&&l(t,{delete:{group:"edit",className:"bpmn-icon-trash",title:a("Remove"),action:{click:function(){c.removeElements([n])}}}}),t};const $={__init__:["contextPadProvider"],contextPadProvider:["type",A]};function x(n,i,c,s,p,v,u,o){B.call(this,n,i,c,s,p,v,u,o,2e3)}const M=function(){};(M.prototype=B.prototype).getPaletteEntries=function(){const n={},i=this._create,c=this._elementFactory,s=this._spaceTool,p=this._lassoTool,v=this._handTool,u=this._globalConnect,o=this._translate;function b(t,e,d,r,k){function y(h){const m=c.createShape(l({type:t},k));k&&(m.businessObject.di.isExpanded=k.isExpanded),i.start(h,m)}const _=t.replace(/^bpmn:/,"");return{group:e,className:d,title:r||o("Create {type}",{type:_}),action:{dragstart:y,click:y}}}function g(t){const e=c.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),d=c.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:e});i.start(t,[e,d],{hints:{autoSelect:[d]}})}function a(t){i.start(t,c.createParticipantShape())}return l(n,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:"\u6FC0\u6D3B\u6293\u624B\u5DE5\u5177",action:{click:function(t){v.activateHand(t)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:o("Activate the lasso tool"),action:{click:function(t){p.activateSelection(t)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:o("Activate the create/remove space tool"),action:{click:function(t){s.activateSelection(t)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:o("Activate the global connect tool"),action:{click:function(t){u.toggle(t)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":b("bpmn:StartEvent","event","bpmn-icon-start-event-none",o("Create StartEvent")),"create.intermediate-event":b("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",o("Create Intermediate/Boundary Event")),"create.end-event":b("bpmn:EndEvent","event","bpmn-icon-end-event-none",o("Create EndEvent")),"create.exclusive-gateway":b("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",o("Create Gateway")),"create.user-task":b("bpmn:UserTask","activity","bpmn-icon-user-task",o("Create User Task")),"create.data-object":b("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",o("Create DataObjectReference")),"create.data-store":b("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",o("Create DataStoreReference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:o("Create expanded SubProcess"),action:{dragstart:g,click:g}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:o("Create Pool/Participant"),action:{dragstart:a,click:a}},"create.group":b("bpmn:Group","artifact","bpmn-icon-group",o("Create Group"))}),n},x.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],x.prototype=new M,x.prototype.constructor=x;let j;j={__init__:["paletteProvider"],paletteProvider:["type",x]},G=ot({name:"BpmModelEditor",__name:"index",setup(n){const i=it(),{query:c}=ct(),s=bt(),p=S(void 0),v=S(null),u=S({simulation:!0,labelEditing:!1,labelVisible:!1,prefix:"flowable",headerButtonSize:"mini",additionalModel:[$,j]}),o=S(),b=t=>{setTimeout(()=>{v.value=t},10)},g=async t=>{const e={...o.value,bpmnXml:t};e.id?(await et(e),s.success("\u4FEE\u6539\u6210\u529F")):(await nt(e),s.success("\u65B0\u589E\u6210\u529F")),a()},a=()=>{i.push({path:"/bpm/manager/model"})};return rt(async()=>{const t=c.modelId;if(!t)return void s.error("\u7F3A\u5C11\u6A21\u578B modelId \u7F16\u53F7");const e=await tt(t);p.value=e.bpmnXml,o.value={...e,bpmnXml:void 0}}),(t,e)=>{const d=q;return L(),O(d,null,{default:st(()=>[f(p)!==void 0?(L(),O(f(W),pt({key:"designer",modelValue:f(p),"onUpdate:modelValue":e[0]||(e[0]=r=>lt(p)?p.value=r:null),value:f(p)},f(u),{keyboard:"",ref:"processDesigner",onInitFinished:b,additionalModel:f(u).additionalModel,onSave:g}),null,16,["modelValue","value","additionalModel"])):mt("",!0),dt(f(Y),{key:"penal",bpmnModeler:f(v),prefix:f(u).prefix,class:"process-panel",model:f(o)},null,8,["bpmnModeler","prefix","model"])]),_:1})}}})});export{Pt as __tla,G as default};