工业互联网平台脚手架前端代码
houzhongjian
2024-09-18 23db5e5c6bfcbd7030a4003cd4ea18fbb920024f
1
2
3
4
5
6
7
import{_ as G}from"./ContentWrap.vue_vue_type_script_setup_true_lang-CR_2gECF.js";import{i as S,a as O,g as $,b as l,c as T,d as X,e as U,f as V,P as I,_ as q,h as K}from"./bpmn-embedded-DgbZ9dtA.js";import{g as z,u as H,c as Q}from"./index-D1RxyxVK.js";import{d as J,u as W,a0 as Y,r as N,b as Z,o as B,g as R,B as ee,a as f,m as te,I as ne,h as ae,k as oe,Q as ie}from"./index-BP6bNRoi.js";import"./el-card-bU92WWV4.js";import"./Dialog.vue_vue_type_style_index_0_lang-DFckl8Er.js";import"./XTextButton-B6L8upsJ.js";import"./XButton-BfzTlH8o.js";import"./index-CeFKtjBg.js";import"./el-tree-select-pYALMRc9.js";import"./tree-BBZY150N.js";import"./index-NsInNyZ_.js";import"./index-BdNokKwC.js";import"./index-DkNlrmPs.js";import"./index-vFgEqmZu.js";import"./index-Y1ylnZaQ.js";import"./index.vue_vue_type_script_setup_true_lang-sJUY8qtC.js";import"./index-BZESAUPP.js";import"./constants-CuOBQ73z.js";import"./index-ox_WxZBR.js";import"./el-drawer-CuGR_O5R.js";import"./DictTag.vue_vue_type_script_lang-DwXPHgid.js";import"./color-DXkOL5Tu.js";import"./index-BRcqC2Y4.js";import"./formatTime-DwR9f7DP.js";function F(n){return n.originalEvent||n.srcEvent}function ce(n){return function(i,c){return(F(i)||i).button===c}(n,0)}function re(n){var i=F(n)||n;return!!ce(n)&&(/mac/i.test(navigator.platform)?i.metaKey:i.ctrlKey)}function M(n,i,c,p,s,g,u,o,b,y,a,e){n=n||{},p.registerProvider(this),this._contextPad=p,this._modeling=s,this._elementFactory=g,this._connect=u,this._create=o,this._popupMenu=b,this._canvas=y,this._rules=a,this._translate=e,n.autoPlace!==!1&&(this._autoPlace=i.get("autoPlace",!1)),c.on("create.end",250,function(t){const m=t.context.shape;if(!re(t)||!p.isOpen(m))return;const r=p.getEntries(m);r.replace&&r.replace.action.click(t,m)})}function L(n,i,c){const p=n.$instanceOf(i);let s=!1;const g=n.eventDefinitions||[];return V(g,function(u){u.$type===c&&(s=!0)}),p&&s}M.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate","elementRegistry"],M.prototype.getContextPadEntries=function(n){const i=this._contextPad,c=this._modeling,p=this._elementFactory,s=this._connect,g=this._create,u=this._popupMenu,o=this._canvas,b=this._rules,y=this._autoPlace,a=this._translate,e={};if(n.type==="label")return e;const t=n.businessObject;function m(v,h){s.start(v,h)}function r(v,h,d,x){function D(_,w){const k=p.createShape(l({type:v},x));g.start(_,k,{source:w})}return typeof d!="string"&&(x=d,d=a("Append {type}",{type:v.replace(/^bpmn:/,"")})),{group:"model",className:h,title:d,action:{dragstart:D,click:y?function(_,w){const k=p.createShape(l({type:v},x));y.append(w,k)}:D}}}function P(v){return function(h,d){c.splitLane(d,v),i.open(d,!0)}}if(S(t,["bpmn:Lane","bpmn:Participant"])&&O(t)){const v=$(n);l(e,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:a("Add Lane above"),action:{click:function(h,d){c.addLane(d,"top")}}}}),v.length<2&&(n.height>=120&&l(e,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:a("Divide into two Lanes"),action:{click:P(2)}}}),n.height>=180&&l(e,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:a("Divide into three Lanes"),action:{click:P(3)}}})),l(e,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:a("Add Lane below"),action:{click:function(h,d){c.addLane(d,"bottom")}}}})}T(t,"bpmn:FlowNode")&&(T(t,"bpmn:EventBasedGateway")?l(e,{"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"})}):L(t,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?l(e,{"append.compensation-activity":r("bpmn:Task","bpmn-icon-task",a("Append compensation activity"),{isForCompensation:!0})}):T(t,"bpmn:EndEvent")||t.isForCompensation||L(t,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||X(t)||l(e,{"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(e,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:"\u4FEE\u6539\u7C7B\u578B",action:{click:function(v,h){const d=l(function(x){const D=o.getContainer(),A=i.getPad(x).html,_=D.getBoundingClientRect(),w=A.getBoundingClientRect(),k=w.top-_.top;return{x:w.left-_.left,y:k+w.height+5}}(h),{cursor:{x:v.x,y:v.y}});u.open(h,"bpmn-replace",d)}}}}),S(t,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&l(e,{"append.text-annotation":r("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:a("Connect using "+(t.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:m,dragstart:m}}}),S(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&l(e,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:a("Connect using DataInputAssociation"),action:{click:m,dragstart:m}}}),T(t,"bpmn:Group")&&l(e,{"append.text-annotation":r("bpmn:TextAnnotation","bpmn-icon-text-annotation")});let E=b.allowed("elements.delete",{elements:[n]});return U(E)&&(E=E[0]===n),E&&l(e,{delete:{group:"edit",className:"bpmn-icon-trash",title:a("Remove"),action:{click:function(){c.removeElements([n])}}}}),e};const pe={__init__:["contextPadProvider"],contextPadProvider:["type",M]};function C(n,i,c,p,s,g,u,o){I.call(this,n,i,c,p,s,g,u,o,2e3)}const j=function(){};(j.prototype=I.prototype).getPaletteEntries=function(){const n={},i=this._create,c=this._elementFactory,p=this._spaceTool,s=this._lassoTool,g=this._handTool,u=this._globalConnect,o=this._translate;function b(e,t,m,r,P){function E(h){const d=c.createShape(l({type:e},P));i.start(h,d)}const v=e.replace(/^bpmn:/,"");return{group:t,className:m,title:r||o("Create {type}",{type:v}),action:{dragstart:E,click:E}}}function y(e){const t=c.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),m=c.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:t});i.start(e,[t,m],{hints:{autoSelect:[m]}})}function a(e){i.start(e,c.createParticipantShape())}return l(n,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:"\u6FC0\u6D3B\u6293\u624B\u5DE5\u5177",action:{click:function(e){g.activateHand(e)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:o("Activate the lasso tool"),action:{click:function(e){s.activateSelection(e)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:o("Activate the create/remove space tool"),action:{click:function(e){p.activateSelection(e)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:o("Activate the global connect tool"),action:{click:function(e){u.toggle(e)}}},"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:y,click:y}},"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},C.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],C.prototype=new j,C.prototype.constructor=C;const se={__init__:["paletteProvider"],paletteProvider:["type",C]},le=J({name:"BpmModelEditor",__name:"index",setup(n){const i=W(),{query:c}=Y(),p=ie(),s=N(void 0),g=N(null),u=N({simulation:!0,labelEditing:!1,labelVisible:!1,prefix:"flowable",headerButtonSize:"mini",additionalModel:[pe,se]}),o=N(),b=e=>{setTimeout(()=>{g.value=e},10)},y=async e=>{const t={...o.value,bpmnXml:e};t.id?(await H(t),p.success("\u4FEE\u6539\u6210\u529F")):(await Q(t),p.success("\u65B0\u589E\u6210\u529F")),a()},a=()=>{i.push({path:"/bpm/manager/model"})};return Z(async()=>{const e=c.modelId;if(!e)return void p.error("\u7F3A\u5C11\u6A21\u578B modelId \u7F16\u53F7");const t=await z(e);t.bpmnXml||(t.bpmnXml=` <?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.activiti.org/processdef">
  <process id="${t.key}" name="${t.name}" isExecutable="true" />
  <bpmndi:BPMNDiagram id="BPMNDiagram">
    <bpmndi:BPMNPlane id="${t.key}_di" bpmnElement="${t.key}" />
  </bpmndi:BPMNDiagram>
</definitions>`),o.value={...t,bpmnXml:void 0},s.value=t.bpmnXml}),(e,t)=>{const m=G;return B(),R(m,null,{default:ee(()=>[f(s)!==void 0?(B(),R(f(q),te({key:"designer",modelValue:f(s),"onUpdate:modelValue":t[0]||(t[0]=r=>ne(s)?s.value=r:null),value:f(s)},f(u),{keyboard:"",ref:"processDesigner",onInitFinished:b,additionalModel:f(u).additionalModel,onSave:y}),null,16,["modelValue","value","additionalModel"])):ae("",!0),oe(f(K),{key:"penal",bpmnModeler:f(g),prefix:f(u).prefix,class:"process-panel",model:f(o)},null,8,["bpmnModeler","prefix","model"])]),_:1})}}});export{le as default};