chunk-90d03492.3d6ac5fb.js 8.2 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-90d03492"],{"49ee":function(e,t,a){},"5c58":function(e,t,a){"use strict";a("dbee")},"84b2":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{ref:"propertyPanel",staticClass:"property-panel"},[a("el-form",{attrs:{inline:!0,model:e.form,"label-width":"100px",size:"small"}},[a("el-form-item",{attrs:{label:"节点ID"}},[a("el-input",{attrs:{disabled:""},model:{value:e.form.id,callback:function(t){e.$set(e.form,"id",t)},expression:"form.id"}})],1),a("el-form-item",{attrs:{label:"节点名称"}},[a("el-input",{on:{input:e.nameChange},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),a("el-form-item",{attrs:{label:"节点颜色"}},[a("el-color-picker",{on:{"active-change":e.colorChange},model:{value:e.form.color,callback:function(t){e.$set(e.form,"color",t)},expression:"form.color"}})],1),e.userTask?a("el-form-item",{attrs:{label:"节点人员"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:e.typeChange},model:{value:e.form.userType,callback:function(t){e.$set(e.form,"userType",t)},expression:"form.userType"}},[a("el-option",{attrs:{value:"assignee",label:"指定人员"}}),a("el-option",{attrs:{value:"candidateUsers",label:"候选人员"}}),a("el-option",{attrs:{value:"candidateGroups",label:"角色/岗位"}})],1)],1):e._e(),e.userTask&&"assignee"===e.form.userType?a("el-form-item",{attrs:{label:"指定人员"}},[a("el-select",{key:"1",attrs:{placeholder:"请选择"},on:{change:function(t){return e.addUser({assignee:t})}},model:{value:e.form.assignee,callback:function(t){e.$set(e.form,"assignee",t)},expression:"form.assignee"}},e._l(e.users,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1):e.userTask&&"candidateUsers"===e.form.userType?a("el-form-item",{attrs:{label:"候选人员"}},[a("el-select",{key:"2",attrs:{placeholder:"请选择",multiple:""},on:{change:function(t){return e.addUser({candidateUsers:t.join(",")||t})}},model:{value:e.form.candidateUsers,callback:function(t){e.$set(e.form,"candidateUsers",t)},expression:"form.candidateUsers"}},e._l(e.users,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1):e.userTask&&"candidateGroups"===e.form.userType?a("el-form-item",{attrs:{label:"角色/岗位"}},[a("el-select",{attrs:{placeholder:"请选择"},on:{change:function(t){return e.addUser({candidateGroups:t})}},model:{value:e.form.candidateGroups,callback:function(t){e.$set(e.form,"candidateGroups",t)},expression:"form.candidateGroups"}},e._l(e.roles,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1):e._e(),e.sequenceFlow?a("el-form-item",{attrs:{label:"分支条件"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:e.form.user,callback:function(t){e.$set(e.form,"user",t)},expression:"form.user"}},e._l(e.users,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1):e._e()],1)],1)},r=[],l=(a("ac6a"),a("456d"),a("7f7f"),a("28a5"),a("5530")),s={name:"PropertyPanel",props:{modeler:{type:Object,required:!0}},computed:{userTask:function(){if(this.element)return"bpmn:UserTask"===this.element.type},sequenceFlow:function(){if(this.element)return"bpmn:SequenceFlow"===this.element.type}},data:function(){return{form:{id:"",name:"",color:null},element:{},users:[{value:"zhangsan",label:"张三"},{value:"lisi",label:"李四"},{value:"wangwu",label:"王五"}],roles:[{value:"manager",label:"经理"},{value:"personnel",label:"人事"},{value:"charge",label:"主管"}]}},mounted:function(){this.handleModeler()},methods:{handleModeler:function(){var e=this;this.modeler.on("selection.changed",(function(t){var a=t.newSelection[0];e.element=a,a&&(e.form=Object(l["a"])(Object(l["a"])({},a.businessObject),a.businessObject.$attrs),"candidateUsers"===e.form.userType&&(e.form["candidateUsers"]=e.form["candidateUsers"].split(",")||[]))})),this.modeler.on("element.changed",(function(t){var a=t.element;a&&a.id===e.form.id&&(e.form.name=a.businessObject.name,e.form=Object(l["a"])({},e.form))}))},nameChange:function(e){var t=this.modeler.get("modeling");t.updateLabel(this.element,e)},colorChange:function(e){var t=this.modeler.get("modeling");t.setColor(this.element,{fill:null,stroke:e}),t.updateProperties(this.element,{color:e})},addUser:function(e){this.updateProperties(Object.assign(e,{userType:Object.keys(e)[0]}))},typeChange:function(){var e=this,t=["assignee","candidateUsers","candidateGroups"];t.forEach((function(t){delete e.element.businessObject.$attrs[t],delete e.form[t]}))},updateProperties:function(e){var t=this.modeler.get("modeling");t.updateProperties(this.element,e)}}},o=s,i=(a("5c58"),a("2877")),c=Object(i["a"])(o,n,r,!1,null,"52f96d95",null);t["default"]=c.exports},"8a39":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"containers"},[a("div",{ref:"canvas",staticClass:"canvas"}),e.bpmnModeler?a("panel",{attrs:{modeler:e.bpmnModeler}}):e._e(),a("div",{staticClass:"toolbar"},[a("a",{attrs:{title:"download"}},[e._v("下载")]),a("a",{ref:"saveDiagram",attrs:{href:"javascript:",title:"download BPMN diagram"}},[e._v("BPMN")]),a("a",{ref:"saveSvg",attrs:{href:"javascript:",title:"download as SVG image"}},[e._v("SVG")])])],1)},r=[],l=a("84b2");function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,a){return t&&o(e.prototype,t),a&&o(e,a),e}var c=function(){function e(){s(this,e),this.controls=[],this.init()}return i(e,[{key:"init",value:function(){this.controls=[{action:"create.start-event",title:"开始"},{action:"create.intermediate-event",title:"中间"},{action:"create.end-event",title:"结束"},{action:"create.exclusive-gateway",title:"网关"},{action:"create.task",title:"任务"},{action:"create.user-task",title:"用户任务"},{action:"create.user-sign-task",title:"会签任务"},{action:"create.subprocess-expanded",title:"子流程"},{action:"create.data-object",title:"数据对象"},{action:"create.data-store",title:"数据存储"},{action:"create.participant-expanded",title:"扩展流程"},{action:"create.group",title:"分组"}]}},{key:"getControl",value:function(e){var t=this.controls.filter((function(t){return t.action===e}));return t[0]||{}}}]),e}(),u={name:"Page401",data:function(){return{bpmnModeler:null,element:null,bpmData:new c}},components:{panel:l["default"]},methods:{createNewDiagram:function(){var e=this,t="";this.bpmnModeler.importXML(t,(function(t){t?console.error(t):e.adjustPalette()}))},adjustPalette:function(){try{var e=this.$refs.canvas,t=e.children[0].children[1].children[4],a={width:"130px",padding:"5px",background:"white",left:"20px",borderRadius:0};for(var n in a)t.style[n]=a[n];var r=t.children[0],l=r.children;for(var s in l[0].style["display"]="none",l){var o=l[s];for(var i in o.children){var c=o.children[i],u={display:"flex",justifyContent:"flex-start",alignItems:"center",width:"100%",padding:"5px"};if(c.className&&c.dataset&&-1!==c.className.indexOf("entry")){var d=this.bpmData.getControl(c.dataset.action);for(var m in c.innerHTML="<div style='font-size: 14px;font-weight:500;margin-left:15px;'>".concat(d["title"],"</div>"),u)c.style[m]=u[m]}}}}catch(f){}},saveSVG:function(e){this.bpmnModeler.saveSVG(e)},saveDiagram:function(e){this.bpmnModeler.saveXML({format:!0},(function(t,a){e(t,a)}))},setEncoded:function(e,t,a){var n=encodeURIComponent(a);this.xmlStr=a,a&&(e.className="active",e.href="data:application/bpmn20-xml;charset=UTF-8,"+n,e.download=t)}},mounted:function(){var e=this.$refs.canvas;this.bpmnModeler=new BpmnModeler({container:e});var t=this.$refs.saveDiagram,a=this.$refs.saveSvg,n=this;this.bpmnModeler.on("commandStack.changed",(function(){n.saveSVG((function(e,t){n.setEncoded(a,"diagram.svg",e?null:t)})),n.saveDiagram((function(e,a){n.setEncoded(t,"diagram.bpmn",e?null:a)}))})),this.createNewDiagram()}},d=u,m=(a("93dc"),a("2877")),f=Object(m["a"])(d,n,r,!1,null,"3d99a76d",null);t["default"]=f.exports},"93dc":function(e,t,a){"use strict";a("49ee")},dbee:function(e,t,a){}}]);