workflow-editor 0.0.4 → 0.0.6-up
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/.vscode/extensions.json +3 -0
- package/README.md +7 -0
- package/index.html +13 -0
- package/lib/workflow-editor.js +23979 -0
- package/package.json +30 -38
- package/packages/index.js +34 -0
- package/packages/plugins/formValidatorUtil.js +533 -0
- package/packages/plugins/index.js +8 -0
- package/packages/workflow-editor/index.js +14 -0
- package/packages/workflow-editor/src/api.js +7 -0
- package/packages/workflow-editor/src/assets/wf-editor-icons.js +2 -0
- package/packages/workflow-editor/src/constant.js +8 -0
- package/packages/workflow-editor/src/json-object-templates/auto-task.js +70 -0
- package/packages/workflow-editor/src/json-object-templates/copy-task.js +72 -0
- package/packages/workflow-editor/src/json-object-templates/decision.js +11 -0
- package/packages/workflow-editor/src/json-object-templates/end.js +14 -0
- package/packages/workflow-editor/src/json-object-templates/fork.js +10 -0
- package/packages/workflow-editor/src/json-object-templates/human-decision.js +9 -0
- package/packages/workflow-editor/src/json-object-templates/human-task.js +199 -0
- package/packages/workflow-editor/src/json-object-templates/join.js +10 -0
- package/packages/workflow-editor/src/json-object-templates/process.js +98 -0
- package/packages/workflow-editor/src/json-object-templates/start.js +13 -0
- package/packages/workflow-editor/src/json-object-templates/subprocess.js +31 -0
- package/packages/workflow-editor/src/json-object-templates/transition.js +26 -0
- package/packages/workflow-editor/src/main/admin-save-dialog.vue +66 -0
- package/packages/workflow-editor/src/main/canvas.vue +483 -0
- package/packages/workflow-editor/src/main/context-menu.vue +132 -0
- package/packages/workflow-editor/src/main/icon-svg.vue +32 -0
- package/packages/workflow-editor/src/main/selection-region.vue +66 -0
- package/packages/workflow-editor/src/main/tache-history-tooltip.vue +38 -0
- package/packages/workflow-editor/src/main/tache-name-input.vue +19 -0
- package/packages/workflow-editor/src/main/tache-subprocess-history-dialog.vue +35 -0
- package/packages/workflow-editor/src/main/toolbox.vue +60 -0
- package/packages/workflow-editor/src/main/wf-history-canvas.vue +304 -0
- package/packages/workflow-editor/src/process-json.js +623 -0
- package/packages/workflow-editor/src/process-service.js +31 -0
- package/packages/workflow-editor/src/properties-editors/auto-task/basic-properties.vue +81 -0
- package/packages/workflow-editor/src/properties-editors/auto-task/permission-settings.vue +155 -0
- package/packages/workflow-editor/src/properties-editors/auto-task.vue +73 -0
- package/packages/workflow-editor/src/properties-editors/common/additional-condition-utils.js +531 -0
- package/packages/workflow-editor/src/properties-editors/common/additional-condition.vue +276 -0
- package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields-utils.js +34 -0
- package/packages/workflow-editor/src/properties-editors/common/auto-filled-fields.vue +239 -0
- package/packages/workflow-editor/src/properties-editors/common/common-notice-tool.vue +67 -0
- package/packages/workflow-editor/src/properties-editors/common/common-user-condition.vue +241 -0
- package/packages/workflow-editor/src/properties-editors/common/form-fields-utils.js +23 -0
- package/packages/workflow-editor/src/properties-editors/common/form-fields.vue +116 -0
- package/packages/workflow-editor/src/properties-editors/common/i18n-input.vue +75 -0
- package/packages/workflow-editor/src/properties-editors/common/i18n-set-dialog.vue +125 -0
- package/packages/workflow-editor/src/properties-editors/common/notice-reminder.vue +72 -0
- package/packages/workflow-editor/src/properties-editors/common/notice.vue +101 -0
- package/packages/workflow-editor/src/properties-editors/common/reminder.vue +185 -0
- package/packages/workflow-editor/src/properties-editors/common/select-mail-template.vue +83 -0
- package/packages/workflow-editor/src/properties-editors/common/standard-fields.vue +65 -0
- package/packages/workflow-editor/src/properties-editors/common/system-role-tree-inline.vue +347 -0
- package/packages/workflow-editor/src/properties-editors/common/system-role-tree.vue +63 -0
- package/packages/workflow-editor/src/properties-editors/common/task-title.vue +148 -0
- package/packages/workflow-editor/src/properties-editors/common/transactor-settings.vue +233 -0
- package/packages/workflow-editor/src/properties-editors/common/user-selection.vue +386 -0
- package/packages/workflow-editor/src/properties-editors/common/value-selection-dialog.vue +209 -0
- package/packages/workflow-editor/src/properties-editors/common/variables.vue +135 -0
- package/packages/workflow-editor/src/properties-editors/copy-task/basic-properties.vue +90 -0
- package/packages/workflow-editor/src/properties-editors/copy-task/permission-settings.vue +155 -0
- package/packages/workflow-editor/src/properties-editors/copy-task.vue +94 -0
- package/packages/workflow-editor/src/properties-editors/decision.vue +90 -0
- package/packages/workflow-editor/src/properties-editors/fork.vue +72 -0
- package/packages/workflow-editor/src/properties-editors/human-decision.vue +44 -0
- package/packages/workflow-editor/src/properties-editors/human-task/additional-condition-dialog.vue +60 -0
- package/packages/workflow-editor/src/properties-editors/human-task/basic-properties.vue +160 -0
- package/packages/workflow-editor/src/properties-editors/human-task/componentsConfigUtil.js +291 -0
- package/packages/workflow-editor/src/properties-editors/human-task/custom-actions.vue +249 -0
- package/packages/workflow-editor/src/properties-editors/human-task/editable-child-field-setting.vue +392 -0
- package/packages/workflow-editor/src/properties-editors/human-task/editable-child-fields.vue +241 -0
- package/packages/workflow-editor/src/properties-editors/human-task/editable-field-selection.vue +220 -0
- package/packages/workflow-editor/src/properties-editors/human-task/editable-fields.vue +204 -0
- package/packages/workflow-editor/src/properties-editors/human-task/events.vue +59 -0
- package/packages/workflow-editor/src/properties-editors/human-task/permission-settings.vue +207 -0
- package/packages/workflow-editor/src/properties-editors/human-task/selection-conditions.vue +390 -0
- package/packages/workflow-editor/src/properties-editors/human-task.vue +109 -0
- package/packages/workflow-editor/src/properties-editors/join.vue +44 -0
- package/packages/workflow-editor/src/properties-editors/process/basic-properties.vue +273 -0
- package/packages/workflow-editor/src/properties-editors/process/events.vue +76 -0
- package/packages/workflow-editor/src/properties-editors/process/notice-settings.vue +60 -0
- package/packages/workflow-editor/src/properties-editors/process/parameter-settings.vue +95 -0
- package/packages/workflow-editor/src/properties-editors/process/permission-settings.vue +28 -0
- package/packages/workflow-editor/src/properties-editors/process/selectPage.vue +81 -0
- package/packages/workflow-editor/src/properties-editors/process.vue +115 -0
- package/packages/workflow-editor/src/properties-editors/subprocess/basic-properties.vue +199 -0
- package/packages/workflow-editor/src/properties-editors/subprocess/events.vue +26 -0
- package/packages/workflow-editor/src/properties-editors/subprocess/field-mappings.vue +206 -0
- package/packages/workflow-editor/src/properties-editors/subprocess/transactor-settings.vue +64 -0
- package/packages/workflow-editor/src/properties-editors/subprocess.vue +79 -0
- package/packages/workflow-editor/src/properties-editors/transition/basic-properties.vue +53 -0
- package/packages/workflow-editor/src/properties-editors/transition.vue +74 -0
- package/packages/workflow-editor/src/properties-editors/user-condition.js +177 -0
- package/packages/workflow-editor/src/store/getters.js +27 -0
- package/packages/workflow-editor/src/store/workflow-editor.js +125 -0
- package/packages/workflow-editor/src/taches/auto-task.vue +99 -0
- package/packages/workflow-editor/src/taches/common-methods.js +21 -0
- package/packages/workflow-editor/src/taches/copy-task.vue +99 -0
- package/packages/workflow-editor/src/taches/custom-task.vue +88 -0
- package/packages/workflow-editor/src/taches/decision.vue +102 -0
- package/packages/workflow-editor/src/taches/end.vue +76 -0
- package/packages/workflow-editor/src/taches/fork.vue +102 -0
- package/packages/workflow-editor/src/taches/human-decision.vue +102 -0
- package/packages/workflow-editor/src/taches/human-task.vue +113 -0
- package/packages/workflow-editor/src/taches/join.vue +91 -0
- package/packages/workflow-editor/src/taches/joint.vue +177 -0
- package/packages/workflow-editor/src/taches/start.vue +76 -0
- package/packages/workflow-editor/src/taches/subprocess.vue +99 -0
- package/packages/workflow-editor/src/taches/tache-resizer.vue +80 -0
- package/packages/workflow-editor/src/transitions/broken-line.vue +91 -0
- package/packages/workflow-editor/src/transitions/curve-line.vue +91 -0
- package/packages/workflow-editor/src/transitions/straight-line.vue +26 -0
- package/packages/workflow-editor/src/transitions/transition.vue +212 -0
- package/packages/workflow-editor/src/transitions/virtual-transition.vue +43 -0
- package/packages/workflow-editor/src/util.js +489 -0
- package/packages/workflow-editor/src/workflow-editor.vue +606 -0
- package/packages/workflow-editor/src/workflow-history.vue +153 -0
- package/public/vite.svg +1 -0
- package/src/i18n/i18n.js +16 -0
- package/src/i18n/langs/cn.js +509 -0
- package/src/i18n/langs/en.js +551 -0
- package/vite.config.js +36 -0
- package/lib/img/decision.94e75269.png +0 -0
- package/lib/workflow-editor.css +0 -1
- package/lib/workflow-editor.umd.min.js +0 -8
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["workflow-editor"]=e():t["workflow-editor"]=e()})("undefined"!==typeof self?self:this,function(){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(n,i,function(e){return t[e]}.bind(null,i));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s="fb15")}({"0b21":function(t,e,o){"use strict";var n=o("4e68"),i=o.n(n);i.a},"0b49":function(t,e,o){},2905:function(t,e,o){},"40a9":function(t,e,o){"use strict";var n=o("fdb4"),i=o.n(n);i.a},"4e68":function(t,e,o){},"4f34":function(t,e,o){t.exports=o.p+"img/decision.94e75269.png"},"5a50":function(t,e,o){},7122:function(t,e,o){"use strict";var n=o("5a50"),i=o.n(n);i.a},"8bc5":function(t,e,o){},"925c":function(t,e,o){"use strict";var n=o("eaed"),i=o.n(n);i.a},"939d":function(t,e,o){"use strict";var n=o("0b49"),i=o.n(n);i.a},"9f68":function(t,e,o){"use strict";var n=o("8bc5"),i=o.n(n);i.a},bcc1:function(t,e,o){},c393:function(t,e,o){"use strict";var n=o("de1d"),i=o.n(n);i.a},c410:function(t,e,o){},d17b:function(t,e,o){"use strict";var n=o("c410"),i=o.n(n);i.a},d3a9:function(t,e,o){"use strict";var n=o("bcc1"),i=o.n(n);i.a},de1d:function(t,e,o){},deb8:function(t,e,o){"use strict";var n=o("2905"),i=o.n(n);i.a},eaed:function(t,e,o){},fb15:function(t,e,o){"use strict";var n;(o.r(e),"undefined"!==typeof window)&&((n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(o.p=n[1]));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{onselectstart:"return false",oncontextmenu:"return false"}},[n("el-row",{staticClass:"button-area"},[n("el-button",{attrs:{type:"primary"}},[t._v("\n 保存\n ")]),n("el-button",{attrs:{type:"primary"}},[t._v("\n 导出\n ")]),n("el-button",{attrs:{type:"primary"}},[t._v("\n 打开\n ")]),n("el-button",{attrs:{type:"primary"}},[t._v("\n 打印\n ")]),n("el-button",{attrs:{type:"primary"}},[t._v("\n 返回\n ")])],1),n("div",{staticClass:"canvas-container",on:{mousedown:t.startDrag,mousemove:t.drag,mouseup:t.endDrag,mouseleave:t.clearStatus}},[n("toolbox",{staticClass:"toolbox"}),n("workflow-canvas",{staticClass:"canvas",nativeOn:{mouseup:function(e){return t.addTache(e)}}}),t.componentToDraw?n("img",{staticClass:"component-icon",style:{left:t.currentPosition.x+"px",top:t.currentPosition.y+"px"},attrs:{src:o("4f34")}}):t._e()],1)],1)},r=[];
|
|
2
|
-
/**
|
|
3
|
-
* vuex v3.1.0
|
|
4
|
-
* (c) 2019 Evan You
|
|
5
|
-
* @license MIT
|
|
6
|
-
*/
|
|
7
|
-
function s(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:n});else{var o=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[n].concat(t.init):n,o.call(this,t)}}function n(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}var a="undefined"!==typeof window&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function c(t){a&&(t._devtoolHook=a,a.emit("vuex:init",t),a.on("vuex:travel-to-state",function(e){t.replaceState(e)}),t.subscribe(function(t,e){a.emit("vuex:mutation",t,e)}))}function l(t,e){Object.keys(t).forEach(function(o){return e(t[o],o)})}function u(t){return null!==t&&"object"===typeof t}function h(t){return t&&"function"===typeof t.then}var d=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var o=t.state;this.state=("function"===typeof o?o():o)||{}},p={namespaced:{configurable:!0}};p.namespaced.get=function(){return!!this._rawModule.namespaced},d.prototype.addChild=function(t,e){this._children[t]=e},d.prototype.removeChild=function(t){delete this._children[t]},d.prototype.getChild=function(t){return this._children[t]},d.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},d.prototype.forEachChild=function(t){l(this._children,t)},d.prototype.forEachGetter=function(t){this._rawModule.getters&&l(this._rawModule.getters,t)},d.prototype.forEachAction=function(t){this._rawModule.actions&&l(this._rawModule.actions,t)},d.prototype.forEachMutation=function(t){this._rawModule.mutations&&l(this._rawModule.mutations,t)},Object.defineProperties(d.prototype,p);var f=function(t){this.register([],t,!1)};function g(t,e,o){if(e.update(o),o.modules)for(var n in o.modules){if(!e.getChild(n))return void 0;g(t.concat(n),e.getChild(n),o.modules[n])}}f.prototype.get=function(t){return t.reduce(function(t,e){return t.getChild(e)},this.root)},f.prototype.getNamespace=function(t){var e=this.root;return t.reduce(function(t,o){return e=e.getChild(o),t+(e.namespaced?o+"/":"")},"")},f.prototype.update=function(t){g([],this.root,t)},f.prototype.register=function(t,e,o){var n=this;void 0===o&&(o=!0);var i=new d(e,o);if(0===t.length)this.root=i;else{var r=this.get(t.slice(0,-1));r.addChild(t[t.length-1],i)}e.modules&&l(e.modules,function(e,i){n.register(t.concat(i),e,o)})},f.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),o=t[t.length-1];e.getChild(o).runtime&&e.removeChild(o)};var m;var v=function(t){var e=this;void 0===t&&(t={}),!m&&"undefined"!==typeof window&&window.Vue&&j(window.Vue);var o=t.plugins;void 0===o&&(o=[]);var n=t.strict;void 0===n&&(n=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new f(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new m;var i=this,r=this,s=r.dispatch,a=r.commit;this.dispatch=function(t,e){return s.call(i,t,e)},this.commit=function(t,e,o){return a.call(i,t,e,o)},this.strict=n;var l=this._modules.root.state;_(this,l,[],this._modules.root),b(this,l),o.forEach(function(t){return t(e)});var u=void 0!==t.devtools?t.devtools:m.config.devtools;u&&c(this)},w={state:{configurable:!0}};function y(t,e){return e.indexOf(t)<0&&e.push(t),function(){var o=e.indexOf(t);o>-1&&e.splice(o,1)}}function T(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var o=t.state;_(t,o,[],t._modules.root,!0),b(t,o,e)}function b(t,e,o){var n=t._vm;t.getters={};var i=t._wrappedGetters,r={};l(i,function(e,o){r[o]=function(){return e(t)},Object.defineProperty(t.getters,o,{get:function(){return t._vm[o]},enumerable:!0})});var s=m.config.silent;m.config.silent=!0,t._vm=new m({data:{$$state:e},computed:r}),m.config.silent=s,t.strict&&S(t),n&&(o&&t._withCommit(function(){n._data.$$state=null}),m.nextTick(function(){return n.$destroy()}))}function _(t,e,o,n,i){var r=!o.length,s=t._modules.getNamespace(o);if(n.namespaced&&(t._modulesNamespaceMap[s]=n),!r&&!i){var a=J(e,o.slice(0,-1)),c=o[o.length-1];t._withCommit(function(){m.set(a,c,n.state)})}var l=n.context=x(t,s,o);n.forEachMutation(function(e,o){var n=s+o;M(t,n,e,l)}),n.forEachAction(function(e,o){var n=e.root?o:s+o,i=e.handler||e;E(t,n,i,l)}),n.forEachGetter(function(e,o){var n=s+o;D(t,n,e,l)}),n.forEachChild(function(n,r){_(t,e,o.concat(r),n,i)})}function x(t,e,o){var n=""===e,i={dispatch:n?t.dispatch:function(o,n,i){var r=C(o,n,i),s=r.payload,a=r.options,c=r.type;return a&&a.root||(c=e+c),t.dispatch(c,s)},commit:n?t.commit:function(o,n,i){var r=C(o,n,i),s=r.payload,a=r.options,c=r.type;a&&a.root||(c=e+c),t.commit(c,s,a)}};return Object.defineProperties(i,{getters:{get:n?function(){return t.getters}:function(){return P(t,e)}},state:{get:function(){return J(t.state,o)}}}),i}function P(t,e){var o={},n=e.length;return Object.keys(t.getters).forEach(function(i){if(i.slice(0,n)===e){var r=i.slice(n);Object.defineProperty(o,r,{get:function(){return t.getters[i]},enumerable:!0})}}),o}function M(t,e,o,n){var i=t._mutations[e]||(t._mutations[e]=[]);i.push(function(e){o.call(t,n.state,e)})}function E(t,e,o,n){var i=t._actions[e]||(t._actions[e]=[]);i.push(function(e,i){var r=o.call(t,{dispatch:n.dispatch,commit:n.commit,getters:n.getters,state:n.state,rootGetters:t.getters,rootState:t.state},e,i);return h(r)||(r=Promise.resolve(r)),t._devtoolHook?r.catch(function(e){throw t._devtoolHook.emit("vuex:error",e),e}):r})}function D(t,e,o,n){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(t){return o(n.state,n.getters,t.state,t.getters)})}function S(t){t._vm.$watch(function(){return this._data.$$state},function(){0},{deep:!0,sync:!0})}function J(t,e){return e.length?e.reduce(function(t,e){return t[e]},t):t}function C(t,e,o){return u(t)&&t.type&&(o=e,e=t,t=t.type),{type:t,payload:e,options:o}}function j(t){m&&t===m||(m=t,s(m))}w.state.get=function(){return this._vm._data.$$state},w.state.set=function(t){0},v.prototype.commit=function(t,e,o){var n=this,i=C(t,e,o),r=i.type,s=i.payload,a=(i.options,{type:r,payload:s}),c=this._mutations[r];c&&(this._withCommit(function(){c.forEach(function(t){t(s)})}),this._subscribers.forEach(function(t){return t(a,n.state)}))},v.prototype.dispatch=function(t,e){var o=this,n=C(t,e),i=n.type,r=n.payload,s={type:i,payload:r},a=this._actions[i];if(a){try{this._actionSubscribers.filter(function(t){return t.before}).forEach(function(t){return t.before(s,o.state)})}catch(l){0}var c=a.length>1?Promise.all(a.map(function(t){return t(r)})):a[0](r);return c.then(function(t){try{o._actionSubscribers.filter(function(t){return t.after}).forEach(function(t){return t.after(s,o.state)})}catch(l){0}return t})}},v.prototype.subscribe=function(t){return y(t,this._subscribers)},v.prototype.subscribeAction=function(t){var e="function"===typeof t?{before:t}:t;return y(e,this._actionSubscribers)},v.prototype.watch=function(t,e,o){var n=this;return this._watcherVM.$watch(function(){return t(n.state,n.getters)},e,o)},v.prototype.replaceState=function(t){var e=this;this._withCommit(function(){e._vm._data.$$state=t})},v.prototype.registerModule=function(t,e,o){void 0===o&&(o={}),"string"===typeof t&&(t=[t]),this._modules.register(t,e),_(this,this.state,t,this._modules.get(t),o.preserveState),b(this,this.state)},v.prototype.unregisterModule=function(t){var e=this;"string"===typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var o=J(e.state,t.slice(0,-1));m.delete(o,t[t.length-1])}),T(this)},v.prototype.hotUpdate=function(t){this._modules.update(t),T(this,!0)},v.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(v.prototype,w);O(function(t,e){var o={};return R(e).forEach(function(e){var n=e.key,i=e.val;o[n]=function(){var e=this.$store.state,o=this.$store.getters;if(t){var n=I(this.$store,"mapState",t);if(!n)return;e=n.context.state,o=n.context.getters}return"function"===typeof i?i.call(this,e,o):e[i]},o[n].vuex=!0}),o});var k=O(function(t,e){var o={};return R(e).forEach(function(e){var n=e.key,i=e.val;o[n]=function(){var e=[],o=arguments.length;while(o--)e[o]=arguments[o];var n=this.$store.commit;if(t){var r=I(this.$store,"mapMutations",t);if(!r)return;n=r.context.commit}return"function"===typeof i?i.apply(this,[n].concat(e)):n.apply(this.$store,[i].concat(e))}}),o}),$=O(function(t,e){var o={};return R(e).forEach(function(e){var n=e.key,i=e.val;i=t+i,o[n]=function(){if(!t||I(this.$store,"mapGetters",t))return this.$store.getters[i]},o[n].vuex=!0}),o});O(function(t,e){var o={};return R(e).forEach(function(e){var n=e.key,i=e.val;o[n]=function(){var e=[],o=arguments.length;while(o--)e[o]=arguments[o];var n=this.$store.dispatch;if(t){var r=I(this.$store,"mapActions",t);if(!r)return;n=r.context.dispatch}return"function"===typeof i?i.apply(this,[n].concat(e)):n.apply(this.$store,[i].concat(e))}}),o});function R(t){return Array.isArray(t)?t.map(function(t){return{key:t,val:t}}):Object.keys(t).map(function(e){return{key:e,val:t[e]}})}function O(t){return function(e,o){return"string"!==typeof e?(o=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,o)}}function I(t,e,o){var n=t._modulesNamespaceMap[o];return n}function L(){return window.Vue.$store}function z(t,e){switch(e){case"up":return{position:"up",x:t.x+t.width/2,y:t.y};case"right":return{position:"right",x:t.x+t.width,y:t.y+t.height/2};case"down":return{position:"down",x:t.x+t.width/2,y:t.y+t.height};case"left":return{position:"left",x:t.x,y:t.y+t.height/2};default:return{position:"",x:t.x,y:t.y}}}function N(t){var e=document.getElementById("svg").getScreenCTM();return{x:(t.clientX-e.e)/e.a,y:(t.clientY-e.f)/e.d}}function A(t,e){if(!t||!e)return{};const{x:o,y:n}=t,{x:i,y:r}=e;var s={x:0,y:0,width:Math.abs(i-o),height:Math.abs(r-n)};return o<=i?n<=r?(s.x=o,s.y=n):(s.x=o,s.y=r):n>=r?(s.x=i,s.y=r):(s.x=i,s.y=n),s}function W(t){let e,o,n,i;e=o=1e4,n=i=0;for(const r of t)e>r.x&&(e=r.x),o>r.y&&(o=r.y),n<r.x+r.width&&(n=r.x+r.width),i<r.y+r.height&&(i=r.y+r.height);return{x:e-10,y:o-10,width:n-e+20,height:i-o+20}}function F(t,e){G(),e.$parent.region=null,e.model.isSelected=!0,L().getters["wfEditor/selectedTaches"].push(e.model);const o=N(t);L().commit("wfEditor/setMouseDownPosition",o),L().commit("wfEditor/setMovingTache",!0)}function V(){L().commit("wfEditor/setMovingTache",!1),L().commit("wfEditor/setMouseDownPosition",null)}function H(){for(const t of L().getters["wfEditor/selectedTaches"])t.isSelected=!1;L().commit("wfEditor/setSelectedTaches",[])}function G(){H(),L().getters["wfEditor/selectedTransition"]&&(L().getters["wfEditor/selectedTransition"].isSelected=!1),L().commit("wfEditor/setSelectedTransition",null)}var U=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("ul",t._l(t.componentList,function(e){return o("li",{key:e.name,class:{selected:t.componentToDraw===e.name},on:{mousedown:function(o){return t.select(e.name)}}},[t._v(t._s(e.label))])}),0)])},X=[],Y={name:"Toolbox",data(){return{componentList:[{name:"HumanTask",label:"任务",icon:""},{name:"Decision",label:"条件判断",icon:""}]}},computed:{...$("wfEditor",["componentToDraw"])},methods:{...k("wfEditor",["setComponentToDraw"]),select(t){this.setComponentToDraw(t)}}},B=Y;o("c393");function K(t,e,o,n,i,r,s,a){var c,l="function"===typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=o,l._compiled=!0),n&&(l.functional=!0),r&&(l._scopeId="data-v-"+r),s?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},l._ssrRegister=c):i&&(c=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,e){return c.call(e),u(t,e)}}else{var h=l.beforeCreate;l.beforeCreate=h?[].concat(h,c):[c]}return{exports:t,options:l}}var Q=K(B,U,X,!1,null,"65f019f4",null),q=Q.exports,Z=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("svg",{attrs:{id:"svg",width:"100%",height:"1000"},on:{mousedown:t.mousedown,mousemove:t.mousemove,mouseup:t.mouseup,mouseleave:t.mouseleave}},[o("defs",[o("marker",{attrs:{id:"arrow",markerWidth:"10",markerHeight:"10",refX:"6",refY:"2",orient:"auto",markerUnits:"strokeWidth"}},[o("path",{attrs:{d:"M0,0 L0,4 L6,2 z",fill:"#000"}})])]),t._l(t.taches,function(t){return o(t.type,{key:t.name+":"+t.id,tag:"component",attrs:{model:t}})}),t._l(t.transitions,function(t){return o("transition",{key:t.id,attrs:{model:t}})}),o("virtual-transition",{attrs:{toPosition:t.currentPosition}}),o("selection-region",{attrs:{region:t.region}})],2),t.propertiesEditorFor?o(t.propertiesEditorFor+"PropertiesEditor",{tag:"component",on:{close:function(e){return t.setPropertiesEditorFor("")}}}):t._e()],1)},tt=[],et=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("g",{on:{mousedown:function(e){return e.stopPropagation(),t.startDrag(e)},mouseup:t.endDrag,mouseenter:t.showJoints,mouseleave:t.hideJoints,dblclick:function(e){return e.stopPropagation(),t.setPropertiesEditorFor("HumanTask")}}},[o("rect",{ref:"tache",class:{draggable:!0,"task-tache":!0,selected:t.model.isSelected},attrs:{width:t.model.width,height:t.model.height,x:t.model.x,y:t.model.y,rx:"6",ry:"6"}}),o("text",{staticClass:"draggable",attrs:{x:t.text.x,y:t.text.y,"text-anchor":"middle"}},[t._v(t._s(t.model.name))]),t._l(t.jointPoints,function(e){return o("joint",{key:e,attrs:{parent:t.model,position:e}})}),t._l(t.resizers,function(e){return o("tache-resizer",{key:e,attrs:{owner:t.model,position:e}})})],2)},ot=[],nt=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("g",[o("rect",{class:{"joint-container":!0,"joint-activated":t.isActivated},attrs:{x:t.jointContainer.x,y:t.jointContainer.y,width:"20",height:"20",rx:"3",ry:"3"},on:{mousemove:function(e){return e.stopPropagation(),t.enterJoint(e)},mouseout:function(e){return e.stopPropagation(),t.leaveJoint(e)},mousedown:function(e){return e.stopPropagation(),t.setStartJoint({parent:t.parent,position:t.position})},mouseup:t.mouseup}}),o("circle",{directives:[{name:"show",rawName:"v-show",value:!t.isActivated,expression:"!isActivated"}],staticClass:"joint",attrs:{cx:t.joint.x,cy:t.joint.y,r:"3"}})])},it=[],rt={name:"Joint",props:{parent:{type:Object,default:null},position:{type:String,default:null}},data(){return{isActivated:!1}},computed:{...$("wfEditor",["transitions","startJoint","endJoint","draggerToMove"]),joint(){return z(this.parent,this.position)},jointContainer(){return{x:this.joint.x-10,y:this.joint.y-10}}},methods:{...k("wfEditor",["setStartJoint","setEndJoint","stopDrawingLine","setDraggerToMove"]),mouseup(){if(console.log("joint mouseup"),this.draggerToMove){const t=this.draggerToMove.position,e={parent:this.parent,position:this.position};"start"===t?this.draggerToMove.owner.startJoint=e:this.draggerToMove.owner.endJoint=e,this.setDraggerToMove(null)}else this.addTransition()},addTransition(){this.startJoint&&this.startJoint.parent!==this.parent&&(this.setEndJoint({parent:this.parent,position:this.position}),this.transitions.push({startJoint:this.startJoint,endJoint:this.endJoint,isSelected:!1,lineInfo:{type:"StraightLine",controlPoint:null}})),this.stopDrawingLine()},enterJoint(){this.isActivated=!0,this.$emit("enter-joint")},leaveJoint(){this.isActivated=!1,this.$emit("leave-joint")}}},st=rt,at=(o("939d"),K(st,nt,it,!1,null,null,null)),ct=at.exports,lt=function(){var t=this,e=t.$createElement,o=t._self._c||e;return t.owner.isSelected&&1==t.selectedTaches.length?o("rect",{staticClass:"resizer",style:{cursor:t.area.cursor},attrs:{x:t.area.x,y:t.area.y,width:t.area.width,height:t.area.height},on:{mousedown:function(e){return e.stopPropagation(),t.setResizerToMove({owner:t.owner,position:t.position})},mouseup:function(e){return e.stopPropagation(),t.setResizerToMove(null)}}}):t._e()},ut=[],ht={name:"TacheResizer",props:{owner:{type:Object,default:null},position:{type:String,default:""}},computed:{...$("wfEditor",["selectedTaches"]),area(){const t=8,e=8;let o,n;switch(this.position){case"NW":o=this.owner.x,n=this.owner.y;break;case"NE":o=this.owner.x+this.owner.width,n=this.owner.y;break;case"SW":o=this.owner.x,n=this.owner.y+this.owner.height;break;case"SE":o=this.owner.x+this.owner.width,n=this.owner.y+this.owner.height;break}o-=t/2,n-=e/2;const i=this.position.toLowerCase()+"-resize";return{x:o,y:n,width:t,height:e,cursor:i}}},methods:{...k("wfEditor",["setMovingResizer","setResizerToMove"])}},dt=ht,pt=(o("925c"),K(dt,lt,ut,!1,null,null,null)),ft=pt.exports,gt={name:"Tache",components:{Joint:ct,TacheResizer:ft},props:{model:{type:Object,default:null}},data(){return{jointPoints:[],resizers:["NW","NE","SW","SE"]}},computed:{...$("wfEditor",["selectedTaches"]),text(){return{x:this.model.x+this.model.width/2,y:this.model.y+this.model.height/2}}},methods:{...k("wfEditor",["setPropertiesEditorFor"]),startDrag(t){console.log(this.model.name+" mousedown"),F(t,this)},endDrag(){console.log(this.model.name+" mouseup"),V()},showJoints(){this.jointPoints=["up","right","down","left"]},hideJoints(){this.jointPoints=[]}}},mt=gt,vt=K(mt,et,ot,!1,null,null,null),wt=vt.exports,yt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("g",{on:{mousedown:function(e){return e.stopPropagation(),t.startDrag(e)},mouseup:t.endDrag,mouseenter:t.showJoints,mouseleave:t.hideJoints}},[n("rect",{class:{draggable:!0,"task-tache":!0,selected:t.model.isSelected},attrs:{width:t.model.width,height:t.model.height,x:t.model.x,y:t.model.y,rx:"6",ry:"6"}}),n("image",{staticClass:"draggable",attrs:{x:t.model.x,y:t.model.y,width:t.model.width,height:t.model.height,"xlink:href":o("4f34")}}),t._l(t.jointPoints,function(e){return n("joint",{key:e,attrs:{parent:t.model,position:e}})})],2)},Tt=[],bt={name:"Decision",components:{Joint:ct},props:{model:{type:Object,default:null}},data(){return{jointPoints:[]}},computed:{...$("wfEditor",["selectedTaches"])},methods:{startDrag(t){console.log("decision mousedown"),F(t,this)},endDrag(){console.log("decision mouseup"),V()},showJoints(){this.jointPoints=["up","right","down","left"]},hideJoints(){this.jointPoints=[]}}},_t=bt,xt=K(_t,yt,Tt,!1,null,null,null),Pt=xt.exports,Mt=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("g",{class:{"no-events":null!=t.draggerToMove},on:{mousedown:function(e){return e.stopPropagation(),t.select(e)},contextmenu:function(e){return e.preventDefault(),e.stopPropagation(),t.switchLineType(e)}}},[o(t.model.lineInfo.type,{tag:"component",class:{transition:!0,selected:t.model.isSelected||t.model.startJoint.parent.isSelected&&t.model.endJoint.parent.isSelected},attrs:{owner:t.model}}),t.model.isSelected?o("g",t._l(t.draggers,function(e){return o("circle",{key:e.position,staticClass:"transition-dragger",attrs:{cx:e.x,cy:e.y,r:"4"},on:{mousedown:function(o){return o.stopPropagation(),t.startDrag(o,e.position)},mouseup:t.endDrag}})}),0):t._e()],1)},Et=[],Dt=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("path",{attrs:{d:t.path,"marker-end":"url(#arrow)"}})},St=[],Jt={name:"StraightLine",props:{owner:{type:Object,default:null}},computed:{path(){const t=z(this.owner.startJoint.parent,this.owner.startJoint.position),e=z(this.owner.endJoint.parent,this.owner.endJoint.position);return"M"+t.x+" "+t.y+" L"+e.x+" "+e.y}}},Ct=Jt,jt=K(Ct,Dt,St,!1,null,null,null),kt=jt.exports,$t=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("g",[o("path",{attrs:{d:t.path,"marker-end":"url(#arrow)"}}),t.owner.isSelected?[o("path",{staticClass:"control-line",attrs:{d:t.pathToStartPoint}}),o("path",{staticClass:"control-line",attrs:{d:t.pathToEndPoint}}),o("circle",{staticClass:"control-point",attrs:{cx:t.controlPoint.x,cy:t.controlPoint.y,r:"3"},on:{mousedown:function(e){return e.stopPropagation(),t.startDrag(e)},mouseup:function(e){return e.stopPropagation(),t.endDrag(e)}}})]:t._e()],2)},Rt=[],Ot={name:"CurveLine",props:{owner:{type:Object,default:null}},computed:{startPoint(){return z(this.owner.startJoint.parent,this.owner.startJoint.position)},endPoint(){return z(this.owner.endJoint.parent,this.owner.endJoint.position)},controlPoint(){return this.owner.lineInfo.controlPoint},path(){return"M "+this.startPoint.x+" "+this.startPoint.y+" Q "+this.controlPoint.x+" "+this.controlPoint.y+" "+this.endPoint.x+" "+this.endPoint.y},pathToStartPoint(){return"M "+this.controlPoint.x+" "+this.controlPoint.y+"L "+this.startPoint.x+" "+this.startPoint.y},pathToEndPoint(){return"M "+this.controlPoint.x+" "+this.controlPoint.y+"L "+this.endPoint.x+" "+this.endPoint.y}},created:function(){this.owner.lineInfo.controlPoint||(this.owner.lineInfo.controlPoint={x:this.startPoint.x,y:this.endPoint.y})},methods:{...k("wfEditor",["setControlPointToMove"]),startDrag(t){this.setControlPointToMove({owner:this.owner})},endDrag(){this.setControlPointToMove(null)}}},It=Ot,Lt=(o("deb8"),K(It,$t,Rt,!1,null,"1fe57c16",null)),zt=Lt.exports,Nt={name:"Transition",components:{StraightLine:kt,CurveLine:zt},props:{model:{type:Object,default:null}},data(){return{}},computed:{...$("wfEditor",["draggerToMove"]),draggers(){const t=z(this.model.startJoint.parent,this.model.startJoint.position);t.position="start";const e=z(this.model.endJoint.parent,this.model.endJoint.position);return e.position="end",[t,e]},path(){return"M"+this.draggers[0].x+" "+this.draggers[0].y+" L"+this.draggers[1].x+" "+this.draggers[1].y}},methods:{...k("wfEditor",["setMouseDownPosition","setDraggerToMove","setSelectedTransition"]),select(t){G(),this.model.isSelected=!0,this.setSelectedTransition(this.model)},startDrag(t,e){console.log("start dragging line"),this.setMouseDownPosition(N(t)),this.setDraggerToMove({owner:this.model,position:e,originStartJoint:this.model.startJoint,originEndJoint:this.model.endJoint})},endDrag(){},switchLineType(){"CurveLine"===this.model.lineInfo.type?this.model.lineInfo.type="StraightLine":this.model.lineInfo.type="CurveLine"}}},At=Nt,Wt=(o("d3a9"),K(At,Mt,Et,!1,null,"0976e9aa",null)),Ft=Wt.exports,Vt=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("g",[o("path",{directives:[{name:"show",rawName:"v-show",value:t.path,expression:"path"}],staticClass:"virtual-transition",attrs:{d:t.path,"marker-end":"url(#arrow)"}})])},Ht=[],Gt={name:"VirtualTransition",props:{toPosition:{type:Object,default:null}},computed:{...$("wfEditor",["startJoint"]),path(){if(!this.startJoint)return null;const t=z(this.startJoint.parent,this.startJoint.position),e=this.toPosition;return"M"+t.x+" "+t.y+" L"+e.x+" "+e.y}},methods:{}},Ut=Gt,Xt=(o("0b21"),K(Ut,Vt,Ht,!1,null,null,null)),Yt=Xt.exports,Bt=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("g",[t.region?o("rect",{class:{draggable:!0,"selection-region":!0,dashed:t.selectedTaches.length<1},attrs:{x:t.region.x,y:t.region.y,width:t.region.width,height:t.region.height},on:{mousedown:function(e){return e.stopPropagation(),t.startDrag(e)},mouseup:function(e){return e.stopPropagation(),t.endDrag(e)}}}):t._e()])},Kt=[],Qt={name:"SelectionRegion",props:{region:{type:Object,default:null}},computed:{...$("wfEditor",["selectedTaches"])},methods:{...k("wfEditor",["setDrawingRegion","setMovingRegion","setMouseDownPosition"]),startDrag(t){console.log("region mousedown");const e=N(t);this.setMouseDownPosition(e),this.setMovingRegion(!0)},endDrag(t){console.log("region mouseup"),this.setMovingRegion(!1),this.setMouseDownPosition(null)}}},qt=Qt,Zt=(o("40a9"),K(qt,Bt,Kt,!1,null,null,null)),te=Zt.exports,ee=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"properties-editor"},[o("el-dialog",{attrs:{visible:"",title:"环节属性"},on:{open:function(e){return t.$emit("open")},opend:function(e){return t.$emit("opend")},close:function(e){return t.$emit("close")},closed:function(e){return t.$emit("closed")}}},[o("el-row",[o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.$emit("close")}}},[t._v("保存")]),o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.$emit("close")}}},[t._v("返回")])],1),o("el-tabs",{attrs:{type:"card"},on:{"tab-click":t.handleClick},model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[o("el-tab-pane",{attrs:{label:"基本属性",name:"basicInfo"}},[o("el-form",{attrs:{model:t.basicInfo,"label-width":"80px"}},[o("el-row",[o("el-col",{attrs:{span:12}},[o("el-form-item",{attrs:{label:"名称"}},[o("el-input",{model:{value:t.basicInfo.name,callback:function(e){t.$set(t.basicInfo,"name",e)},expression:"basicInfo.name"}})],1)],1),o("el-col",{attrs:{span:12}},[o("el-form-item",{attrs:{label:"编码"}},[o("el-input",{model:{value:t.basicInfo.region,callback:function(e){t.$set(t.basicInfo,"region",e)},expression:"basicInfo.region"}})],1)],1)],1),o("el-form-item",{attrs:{label:"任务标题"}},[o("el-input",{model:{value:t.basicInfo.type,callback:function(e){t.$set(t.basicInfo,"type",e)},expression:"basicInfo.type"}})],1)],1)],1),o("el-tab-pane",{attrs:{label:"权限设置",name:"permissions"}},[t._v("\n 权限设置\n ")]),o("el-tab-pane",{attrs:{label:"办理人设置",name:"transactors"}},[t._v("\n 办理人设置\n ")]),o("el-tab-pane",{attrs:{label:"自动填写字段设置",name:"autoFilledFields"}},[t._v("\n 自动填写字段设置\n ")]),o("el-tab-pane",{attrs:{label:"催办设置",name:"reminders"}},[t._v("\n 催办设置\n ")]),o("el-tab-pane",{attrs:{label:"事件处理",name:"events"}},[t._v("\n 事件处理\n ")]),o("el-tab-pane",{attrs:{label:"环节扩展属性",name:"extendedProperties"}},[t._v("\n 自动填写字段设置\n ")])],1)],1)],1)},oe=[],ne={name:"HumanTaskPropertiesEditor",data(){return{activeTab:"basicInfo",basicInfo:{name:"",code:"",taskTitle:""}}},methods:{handleClick(t,e){console.log(t,e)}}},ie=ne,re=(o("9f68"),K(ie,ee,oe,!1,null,"56393879",null)),se=re.exports,ae={name:"Canvas",components:{HumanTask:wt,Decision:Pt,Transition:Ft,VirtualTransition:Yt,SelectionRegion:te,HumanTaskPropertiesEditor:se},data:function(){const t=[{id:1,name:"新任务",x:50,y:50,width:80,height:40,type:"HumanTask",isSelected:!1},{id:2,name:"",x:100,y:100,width:80,height:40,type:"Decision",isSelected:!1}],e=[{id:"t1",startJoint:{parent:t[0],position:"right"},endJoint:{parent:t[1],position:"left"},isSelected:!1,lineInfo:{type:"CurveLine",controlPoint:null}}];return this.setTaches(t),this.setTransitions(e),{inputArea:null,currentPosition:null,originPosition:null,offset:null,startPoint:null,region:null,endPoint:null,transitionsInRegion:[],taches:t,transitions:e}},computed:{...$("wfEditor",["isMovingTache","mouseDownPosition","startJoint","endJoint","isDrawingRegion","isMovingRegion","selectedTaches","resizerToMove","draggerToMove","controlPointToMove","propertiesEditorFor"])},created:function(){let t=150;for(let e=3;e<20;e++)this.taches.push({id:e,name:"新任务"+e,x:t,y:t,width:80,height:40,type:"HumanTask",isSelected:!1}),t+=50},mounted:function(){},methods:{...k("wfEditor",["setTaches","setTransitions","resetState","setMovingTache","stopDrawingLine","setSelectedTaches","setDrawingRegion","setResizerToMove","setDraggerToMove","setControlPointToMove","setPropertiesEditorFor"]),forbidSelection(){return!1},add:function(){},mousedown(t){console.log("mousedown"),this.unselectAll(),this.setDrawingRegion(!0),this.startPoint=N(t)},mousemove(t){!this.originPosition&&this.mouseDownPosition&&(this.originPosition=this.mouseDownPosition),this.currentPosition=N(t),this.isMovingTache&&this.moveTache(this.selectedTaches[0]),this.drawVirtualSelectionRegion(),this.moveSelectionRegion(),this.resizeSelectedTache(),this.moveTransition(),this.adjustCurveLine(),this.originPosition=this.currentPosition},mouseup(t){console.log("mouseup"),this.isMovingTache&&this.setMovingTache(!1),this.startJoint&&this.stopDrawingLine(),this.drawRegionWhenNeeded(),this.resizerToMove&&this.setResizerToMove(null),this.resetMovedTransition()},mouseleave(t){this.drawRegionWhenNeeded(),this.resetMovedTransition(),this.resetState()},drawRegionWhenNeeded(){this.isDrawingRegion&&(this.selectComponents(),this.drawRealSelectionRegion(),this.setDrawingRegion(!1))},resetMovedTransition(){this.draggerToMove&&(this.draggerToMove.owner.startJoint=this.draggerToMove.originStartJoint,this.draggerToMove.owner.endJoint=this.draggerToMove.originEndJoint,this.setDraggerToMove(null))},unselectAll(){G(),this.transitionsInRegion=[],this.startPoint=null,this.region=null},selectComponents(){if(!this.startPoint||!this.region)return this.startPoint=null,void(this.region=null);for(const t of this.taches)this.isInsideSelectionRegion(t)&&(t.isSelected=!0,this.selectedTaches.push(t));for(const t of this.transitions)t.startJoint.parent.isSelected&&t.endJoint.parent.isSelected&&this.transitionsInRegion.push(t)},isInsideSelectionRegion(t){const e=t.x>=this.region.x&&t.y>=this.region.y,o=t.x+t.width<=this.region.x+this.region.width&&t.y+t.height<=this.region.y+this.region.height;return e&&o},moveTache(t){const e=this.currentPosition.x-this.originPosition.x,o=this.currentPosition.y-this.originPosition.y;t.x+=e,t.y+=o,t.x<0&&(t.x=2),t.y<0&&(t.y=2)},drawVirtualSelectionRegion(){this.isDrawingRegion&&this.startPoint&&(this.region=A(this.startPoint,this.currentPosition))},drawRealSelectionRegion(){if(this.selectedTaches.length<=1)return this.startPoint=null,void(this.region=null);this.region=W(this.selectedTaches)},moveSelectionRegion(){if(!this.isMovingRegion)return;let t=this.currentPosition.x-this.originPosition.x,e=this.currentPosition.y-this.originPosition.y;this.region.x+t<0&&(t=2-this.region.x),this.region.y+e<0&&(e=2-this.region.y),this.region.x=this.region.x+t,this.region.y=this.region.y+e,this.moveTachesInRegion(t,e),this.moveTransitionControlPoints(t,e)},moveTachesInRegion(t,e){for(const o of this.selectedTaches)o.x+=t,o.y+=e},moveTransitionControlPoints(t,e){for(const o of this.transitionsInRegion)"CurveLine"===o.lineInfo.type&&(o.lineInfo.controlPoint.x+=t,o.lineInfo.controlPoint.y+=e)},resizeSelectedTache(){if(!this.resizerToMove)return;let t=this.currentPosition.x-this.originPosition.x,e=this.currentPosition.y-this.originPosition.y;const o=this.resizerToMove.owner;switch(this.resizerToMove.position){case"NW":o.width-t<80&&(t=o.width-80),o.height-e<40&&(e=o.height-40),o.width-=t,o.height-=e,o.x+=t,o.y+=e;break;case"NE":o.width+t<80&&(t=80-o.width),o.height-e<40&&(e=o.height-40),o.width+=t,o.height-=e,o.y+=e;break;case"SW":o.width-t<80&&(t=o.width-80),o.height+e<40&&(e=40-o.height),o.width-=t,o.height+=e,o.x+=t;break;case"SE":o.width+t<80&&(t=80-o.width),o.height+e<40&&(e=40-o.height),o.width+=t,o.height+=e;break}},moveTransition(){if(!this.draggerToMove)return;const t=this.draggerToMove.owner,e=this.draggerToMove.position,o={parent:this.currentPosition,position:""};"start"===e?t.startJoint=o:t.endJoint=o},adjustCurveLine(){if(!this.controlPointToMove)return;const t=this.controlPointToMove.owner;t.lineInfo.controlPoint=this.currentPosition},endDrag(t){}}},ce=ae,le=(o("7122"),K(ce,Z,tt,!1,null,null,null)),ue=le.exports,he={name:"WorkflowEditor",components:{WorkflowCanvas:ue,Toolbox:q},data:function(){return{count:1,currentPosition:null}},computed:{...$("wfEditor",["componentToDraw","taches"]),...$(["sidebar"])},created:function(){},mounted:function(){},methods:{...k("wfEditor",["setComponentToDraw"]),getCurrentPosition(t){if(this.componentToDraw){let e=180;this.sidebar.opened||(e=54),this.currentPosition={x:t.clientX-e-22,y:t.clientY-50-22}}},startDrag(t){this.getCurrentPosition(t)},drag(t){this.getCurrentPosition(t)},endDrag(){this.componentToDraw&&this.setComponentToDraw("")},addTache(t){if(this.componentToDraw){const e=N(t);this.taches.push({id:"",name:"任务"+this.count,x:e.x-40,y:e.y-20,width:80,height:40,type:this.componentToDraw,isSelected:!1}),this.count++}},clearStatus(){this.componentToDraw&&this.setComponentToDraw("")}}},de=he,pe=(o("d17b"),K(de,i,r,!1,null,null,null)),fe=pe.exports;const ge={taches:t=>t.taches,transitions:t=>t.transitions,startJoint:t=>t.startJoint,endJoint:t=>t.endJoint,isMovingTache:t=>t.isMovingTache,mouseDownPosition:t=>t.mouseDownPosition,isDrawingRegion:t=>t.isDrawingRegion,isMovingRegion:t=>t.isMovingRegion,selectedTaches:t=>t.selectedTaches,selectedTransition:t=>t.selectedTransition,resizerToMove:t=>t.resizerToMove,draggerToMove:t=>t.draggerToMove,propertiesEditorFor:t=>t.propertiesEditorFor,componentToDraw:t=>t.componentToDraw,controlPointToMove:t=>t.controlPointToMove};var me=ge;const ve={namespaced:!0,state:{taches:null,transitions:null,startJoint:null,endJoint:null,isMovingTache:!1,mouseDownPosition:null,isDrawingRegion:!1,isMovingRegion:!1,selectedTaches:[],selectedTransition:null,resizerToMove:null,draggerToMove:null,propertiesEditorFor:"",componentToDraw:"",controlPointToMove:null},getters:me,mutations:{setTaches(t,e){t.taches=e},setTransitions(t,e){t.transitions=e},resetState(t){t.isMovingTache=!1,t.startJoint=null,t.endJoint=null,t.isDrawingRegion=!1,t.isMovingRegion=!1,t.resizerToMove=null,t.draggerToMove=null,t.controlPointToMove=null},stopDrawingLine(t){t.startJoint=null,t.endJoint=null},setStartJoint(t,e){t.startJoint=e},setEndJoint(t,e){t.endJoint=e},setMovingTache(t,e){t.isMovingTache=e},setMouseDownPosition(t,e){t.mouseDownPosition=e},setDrawingRegion(t,e){t.isDrawingRegion=e},setMovingRegion(t,e){t.isMovingRegion=e},setSelectedTaches(t,e){t.selectedTaches=e},setSelectedTransition(t,e){t.selectedTransition=e},setResizerToMove(t,e){t.resizerToMove=e},setDraggerToMove(t,e){t.draggerToMove=e},setPropertiesEditorFor(t,e){t.propertiesEditorFor=e},setComponentToDraw(t,e){t.componentToDraw=e},setControlPointToMove(t,e){t.controlPointToMove=e}},actions:{}};var we=ve;fe.install=function(t){t.component(fe.name,fe)};var ye={WorkflowEditor:fe,wfEditorStore:we};const Te=ye.WorkflowEditor,be=ye.wfEditorStore,_e=[Te],xe=function(t){xe.installed||_e.map(e=>t.component(e.name,e))};"undefined"!==typeof window&&window.Vue&&xe(window.Vue);var Pe={install:xe,WorkflowEditor:Te,wfEditorStore:be};e["default"]=Pe},fdb4:function(t,e,o){}})});
|
|
8
|
-
//# sourceMappingURL=workflow-editor.umd.min.js.map
|