diff --git a/yanzhu-ui-vue3/package.json b/yanzhu-ui-vue3/package.json index b9d7c491..c3bcdde5 100644 --- a/yanzhu-ui-vue3/package.json +++ b/yanzhu-ui-vue3/package.json @@ -19,23 +19,31 @@ "@vueup/vue-quill": "1.1.0", "@vueuse/core": "9.5.0", "animate.css": "4.1.1", + "await-to-js": "^3.0.0", "axios": "^1.0.0", "bpmn-js": "^8.10.0", "bpmn-js-task-resize": "^1.2.0", "bpmn-js-token-simulation": "^0.10.0", "codemirror-editor-vue3": "^2.0.6", + "core-js": "^3.6.5", + "diagram-js": "^12.2.0", + "diagram-js-minimap": "^2.1.1", "echarts": "5.4.0", "element-plus": "2.2.27", "file-saver": "2.0.5", "fuse.js": "6.6.2", "js-cookie": "3.0.1", "jsencrypt": "3.3.1", + "lodash": "^4.17.21", + "mitt": "^3.0.1", "nprogress": "0.2.0", + "path-browserify": "1.0.1", + "path-to-regexp": "6.2.0", "pinia": "2.0.22", "vue": "3.2.45", "vue-cropper": "1.0.3", "vue-router": "4.1.4", - "yanzhu": "file:" + "x2js": "^3.4.4" }, "devDependencies": { "@vitejs/plugin-vue": "3.1.0", diff --git a/yanzhu-ui-vue3/src/components/ProcessDesigner/index.vue b/yanzhu-ui-vue3/src/components/ProcessDesigner/index.vue new file mode 100644 index 00000000..9bbbb1fa --- /dev/null +++ b/yanzhu-ui-vue3/src/components/ProcessDesigner/index.vue @@ -0,0 +1,214 @@ + + + + + diff --git a/yanzhu-ui-vue3/src/components/ProcessViewer/index.vue b/yanzhu-ui-vue3/src/components/ProcessViewer/index.vue new file mode 100644 index 00000000..55fa50c6 --- /dev/null +++ b/yanzhu-ui-vue3/src/components/ProcessViewer/index.vue @@ -0,0 +1,237 @@ + + + diff --git a/yanzhu-ui-vue3/src/modules/auto-place/CustomAutoPlace.js b/yanzhu-ui-vue3/src/modules/auto-place/CustomAutoPlace.js new file mode 100644 index 00000000..64a1560a --- /dev/null +++ b/yanzhu-ui-vue3/src/modules/auto-place/CustomAutoPlace.js @@ -0,0 +1,81 @@ +import AutoPlace from 'diagram-js/lib/features/auto-place/AutoPlace'; + +export default function CustomAutoPlace(eventBus, modeling) { + AutoPlace.call(this, eventBus, modeling, 3000); + + eventBus.on('autoPlace', 3000, function(context) { + const shape = context.shape; + const source = context.source; + + return getNewCustomShapePosition(source, shape); + }); + + this.append = function(source, shape, hints) { + eventBus.fire('autoPlace.start', { + source: source, + shape: shape + }); + + // allow others to provide the position + var position = eventBus.fire('autoPlace', { + source: source, + shape: shape + }); + + console.log('hints', hints, 'position', position); + + var newShape = modeling.appendShape(source, shape, position, source.parent, hints); + + eventBus.fire('autoPlace.end', { + source: source, + shape: newShape + }); + + return newShape; + }; +} + +export function asTRBL(bounds) { + return { + top: bounds.y, + right: bounds.x + (bounds.width || 0), + bottom: bounds.y + (bounds.height || 0), + left: bounds.x + }; +} + +export function roundPoint(point) { + return { + x: Math.round(point.x), + y: Math.round(point.y) + }; +} + +export function getMid(bounds) { + return roundPoint({ + x: bounds.x + (bounds.width || 0) / 2, + y: bounds.y + (bounds.height || 0) / 2 + }); +} + +export function getNewCustomShapePosition(source, element, hints) { + if (!hints) { + hints = {}; + } + + var distance = hints.defaultDistance || 50; + + var sourceMid = getMid(source); + var sourceTrbl = asTRBL(source); + + // simply put element right next to source + return { + x: sourceMid.x, + y: sourceTrbl.bottom + distance + element.height / 2 + }; +} + +const F = function() {}; // 核心,利用空对象作为中介; +F.prototype = AutoPlace.prototype; // 核心,将父类的原型赋值给空对象F; +CustomAutoPlace.prototype = new F(); // 核心,将 F的实例赋值给子类; +CustomAutoPlace.prototype.constructor = AutoPlace; // 修复子类CustomRenderer的构造器指向,防止原型链的混乱; diff --git a/yanzhu-ui-vue3/src/modules/auto-place/index.js b/yanzhu-ui-vue3/src/modules/auto-place/index.js new file mode 100644 index 00000000..44dc28e1 --- /dev/null +++ b/yanzhu-ui-vue3/src/modules/auto-place/index.js @@ -0,0 +1,6 @@ +import CustomAutoPlace from './CustomAutoPlace'; + +export default { + __init__: ['autoPlace'], + autoPlace: ['type', CustomAutoPlace] +}; diff --git a/yanzhu-ui-vue3/src/modules/custom-renderer/CustomRenderer.js b/yanzhu-ui-vue3/src/modules/custom-renderer/CustomRenderer.js new file mode 100644 index 00000000..6e9988b7 --- /dev/null +++ b/yanzhu-ui-vue3/src/modules/custom-renderer/CustomRenderer.js @@ -0,0 +1,17 @@ +import BpmnRenderer from 'bpmn-js/lib/draw/BpmnRenderer'; + +export default function CustomRenderer(eventBus, styles, pathMap, canvas, textRenderer) { + const config = { + defaultFillColor: '', + defaultStrokeColor: '#8b238f', + defaultLabelColor: '#2dd257' + }; + BpmnRenderer.call(this, config, eventBus, styles, pathMap, canvas, textRenderer, 2000); +} + +CustomRenderer.$inject = ['eventBus', 'styles', 'pathMap', 'canvas', 'textRenderer']; + +const F = function() {}; // 核心,利用空对象作为中介; +F.prototype = BpmnRenderer.prototype; // 核心,将父类的原型赋值给空对象F; +CustomRenderer.prototype = new F(); // 核心,将 F的实例赋值给子类; +CustomRenderer.prototype.constructor = CustomRenderer; // 修复子类CustomRenderer的构造器指向,防止原型链的混乱; diff --git a/yanzhu-ui-vue3/src/modules/custom-renderer/index.js b/yanzhu-ui-vue3/src/modules/custom-renderer/index.js new file mode 100644 index 00000000..ab0b4ef2 --- /dev/null +++ b/yanzhu-ui-vue3/src/modules/custom-renderer/index.js @@ -0,0 +1,6 @@ +import CustomRenderer from './CustomRenderer'; + +export default { + __init__: ['customRenderer'], + customRenderer: ['type', CustomRenderer] +}; diff --git a/yanzhu-ui-vue3/src/modules/rules/CustomRules.js b/yanzhu-ui-vue3/src/modules/rules/CustomRules.js new file mode 100644 index 00000000..4f659cc7 --- /dev/null +++ b/yanzhu-ui-vue3/src/modules/rules/CustomRules.js @@ -0,0 +1,16 @@ +import BpmnRules from 'bpmn-js/lib/features/rules/BpmnRules'; +import inherits from 'inherits'; + +export default function CustomRules(eventBus) { + BpmnRules.call(this, eventBus); +} + +inherits(CustomRules, BpmnRules); + +CustomRules.prototype.canDrop = function() { + return false; +}; + +CustomRules.prototype.canMove = function() { + return false; +}; diff --git a/yanzhu-ui-vue3/src/modules/rules/index.js b/yanzhu-ui-vue3/src/modules/rules/index.js new file mode 100644 index 00000000..bc0a21fc --- /dev/null +++ b/yanzhu-ui-vue3/src/modules/rules/index.js @@ -0,0 +1,6 @@ +import CustomRules from './CustomRules'; + +export default { + __init__: ['customRules'], + customRules: ['type', CustomRules] +}; diff --git a/yanzhu-ui-vue3/src/package/Log.js b/yanzhu-ui-vue3/src/package/Log.js new file mode 100644 index 00000000..f1605fdb --- /dev/null +++ b/yanzhu-ui-vue3/src/package/Log.js @@ -0,0 +1,99 @@ +function Log() {} + +Log.prototype.type = ['primary', 'success', 'warn', 'error', 'info']; + +Log.prototype.typeColor = function(type) { + let color = ''; + switch (type) { + case 'primary': + color = '#2d8cf0'; + break; + case 'success': + color = '#19be6b'; + break; + case 'info': + color = '#909399'; + break; + case 'warn': + color = '#ff9900'; + break; + case 'error': + color = '#f03f14'; + break; + default: + color = '#35495E'; + break; + } + return color; +}; + +Log.prototype.isArray = function(obj) { + return Object.prototype.toString.call(obj) === '[object Array]'; +}; + +Log.prototype.print = function(text, type = 'default', back = false) { + if (typeof text === 'object') { + // 如果是對象則調用打印對象方式 + this.isArray(text) ? console.table(text) : console.dir(text); + return; + } + if (back) { + // 如果是打印帶背景圖的 + console.log(`%c ${text} `, `background:${this.typeColor(type)}; padding: 2px; border-radius: 4px; color: #fff;`); + } else { + console.log( + `%c ${text} `, + `border: 1px solid ${this.typeColor(type)}; + padding: 2px; border-radius: 4px; + color: ${this.typeColor(type)};` + ); + } +}; + +Log.prototype.printBack = function(type = 'primary', title) { + this.print(type, title, true); +}; + +Log.prototype.pretty = function(type = 'primary', title, text) { + if (typeof text === 'object') { + console.group('Console Group', title); + console.log( + `%c ${title}`, + `background:${this.typeColor(type)};border:1px solid ${this.typeColor(type)}; + padding: 1px; border-radius: 4px; color: #fff;` + ); + this.isArray(text) ? console.table(text) : console.dir(text); + console.groupEnd(); + return; + } + console.log( + `%c ${title} %c ${text} %c`, + `background:${this.typeColor(type)};border:1px solid ${this.typeColor(type)}; + padding: 1px; border-radius: 4px 0 0 4px; color: #fff;`, + `border:1px solid ${this.typeColor(type)}; + padding: 1px; border-radius: 0 4px 4px 0; color: ${this.typeColor(type)};`, + 'background:transparent' + ); +}; + +Log.prototype.prettyPrimary = function(title, ...text) { + text.forEach(t => this.pretty('primary', title, t)); +}; + +Log.prototype.prettySuccess = function(title, ...text) { + text.forEach(t => this.pretty('success', title, t)); +}; + +Log.prototype.prettyWarn = function(title, ...text) { + text.forEach(t => this.pretty('warn', title, t)); +}; + +Log.prototype.prettyError = function(title, ...text) { + text.forEach(t => this.pretty('error', title, t)); +}; + +Log.prototype.prettyInfo = function(title, ...text) { + text.forEach(t => this.pretty('info', title, t)); +}; + +export default new Log(); diff --git a/yanzhu-ui-vue3/src/package/designer/ProcessDesigner.vue b/yanzhu-ui-vue3/src/package/designer/ProcessDesigner.vue new file mode 100644 index 00000000..af893837 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/ProcessDesigner.vue @@ -0,0 +1,520 @@ + + + diff --git a/yanzhu-ui-vue3/src/package/designer/index.js b/yanzhu-ui-vue3/src/package/designer/index.js new file mode 100644 index 00000000..333d1bce --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/index.js @@ -0,0 +1,7 @@ +import MyProcessDesigner from './ProcessDesigner.vue'; + +MyProcessDesigner.install = function(Vue) { + Vue.component(MyProcessDesigner.name, MyProcessDesigner); +}; + +export default MyProcessDesigner; diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/content-pad/contentPadProvider.js b/yanzhu-ui-vue3/src/package/designer/plugins/content-pad/contentPadProvider.js new file mode 100644 index 00000000..d3eae191 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/content-pad/contentPadProvider.js @@ -0,0 +1,390 @@ +import { assign, forEach, isArray } from 'min-dash'; + +import { is } from 'bpmn-js/lib/util/ModelUtil'; + +import { isExpanded, isEventSubProcess } from 'bpmn-js/lib/util/DiUtil'; + +import { isAny } from 'bpmn-js/lib/features/modeling/util/ModelingUtil'; + +import { getChildLanes } from 'bpmn-js/lib/features/modeling/util/LaneUtil'; + +import { hasPrimaryModifier } from 'diagram-js/lib/util/Mouse'; + +/** + * A provider for BPMN 2.0 elements context pad + */ +export default function ContextPadProvider( + config, + injector, + eventBus, + contextPad, + modeling, + elementFactory, + connect, + create, + popupMenu, + canvas, + rules, + translate, + elementRegistry +) { + config = config || {}; + + contextPad.registerProvider(this); + + this._contextPad = contextPad; + + this._modeling = modeling; + + this._elementFactory = elementFactory; + this._connect = connect; + this._create = create; + this._popupMenu = popupMenu; + this._canvas = canvas; + this._rules = rules; + this._translate = translate; + + if (config.autoPlace !== false) { + this._autoPlace = injector.get('autoPlace', false); + } + + eventBus.on('create.end', 250, function(event) { + var context = event.context; + var shape = context.shape; + + if (!hasPrimaryModifier(event) || !contextPad.isOpen(shape)) { + return; + } + + var entries = contextPad.getEntries(shape); + + if (entries.replace) { + entries.replace.action.click(event, shape); + } + }); +} + +ContextPadProvider.$inject = [ + 'config.contextPad', + 'injector', + 'eventBus', + 'contextPad', + 'modeling', + 'elementFactory', + 'connect', + 'create', + 'popupMenu', + 'canvas', + 'rules', + 'translate', + 'elementRegistry' +]; + +ContextPadProvider.prototype.getContextPadEntries = function(element) { + var contextPad = this._contextPad; + var modeling = this._modeling; + var elementFactory = this._elementFactory; + var connect = this._connect; + var create = this._create; + var popupMenu = this._popupMenu; + var canvas = this._canvas; + var rules = this._rules; + var autoPlace = this._autoPlace; + var translate = this._translate; + + var actions = {}; + + if (element.type === 'label') { + return actions; + } + + var businessObject = element.businessObject; + + function startConnect(event, element) { + connect.start(event, element); + } + + function removeElement() { + modeling.removeElements([element]); + } + + function getReplaceMenuPosition(element) { + var Y_OFFSET = 5; + + var diagramContainer = canvas.getContainer(); + var pad = contextPad.getPad(element).html; + + var diagramRect = diagramContainer.getBoundingClientRect(); + var padRect = pad.getBoundingClientRect(); + + var top = padRect.top - diagramRect.top; + var left = padRect.left - diagramRect.left; + + var pos = { + x: left, + y: top + padRect.height + Y_OFFSET + }; + + return pos; + } + + /** + * Create an append action + * + * @param {string} type + * @param {string} className + * @param {string} [title] + * @param {Object} [options] + * + * @return {Object} descriptor + */ + function appendAction(type, className, title, options) { + if (typeof title !== 'string') { + options = title; + title = translate('Append {type}', { type: type.replace(/^bpmn:/, '') }); + } + + function appendStart(event, element) { + var shape = elementFactory.createShape(assign({ type: type }, options)); + create.start(event, shape, { + source: element + }); + } + + var append = autoPlace + ? function(event, element) { + var shape = elementFactory.createShape(assign({ type: type }, options)); + + autoPlace.append(element, shape); + } + : appendStart; + + return { + group: 'model', + className: className, + title: title, + action: { + dragstart: appendStart, + click: append + } + }; + } + + function splitLaneHandler(count) { + return function(event, element) { + // actual split + modeling.splitLane(element, count); + + // refresh context pad after split to + // get rid of split icons + contextPad.open(element, true); + }; + } + + if (isAny(businessObject, ['bpmn:Lane', 'bpmn:Participant']) && isExpanded(businessObject)) { + var childLanes = getChildLanes(element); + + assign(actions, { + 'lane-insert-above': { + group: 'lane-insert-above', + className: 'bpmn-icon-lane-insert-above', + title: translate('Add Lane above'), + action: { + click: function(event, element) { + modeling.addLane(element, 'top'); + } + } + } + }); + + if (childLanes.length < 2) { + if (element.height >= 120) { + assign(actions, { + 'lane-divide-two': { + group: 'lane-divide', + className: 'bpmn-icon-lane-divide-two', + title: translate('Divide into two Lanes'), + action: { + click: splitLaneHandler(2) + } + } + }); + } + + if (element.height >= 180) { + assign(actions, { + 'lane-divide-three': { + group: 'lane-divide', + className: 'bpmn-icon-lane-divide-three', + title: translate('Divide into three Lanes'), + action: { + click: splitLaneHandler(3) + } + } + }); + } + } + + assign(actions, { + 'lane-insert-below': { + group: 'lane-insert-below', + className: 'bpmn-icon-lane-insert-below', + title: translate('Add Lane below'), + action: { + click: function(event, element) { + modeling.addLane(element, 'bottom'); + } + } + } + }); + } + + if (is(businessObject, 'bpmn:FlowNode')) { + if (is(businessObject, 'bpmn:EventBasedGateway')) { + assign(actions, { + 'append.receive-task': appendAction('bpmn:ReceiveTask', 'bpmn-icon-receive-task', translate('Append ReceiveTask')), + 'append.message-intermediate-event': appendAction( + 'bpmn:IntermediateCatchEvent', + 'bpmn-icon-intermediate-event-catch-message', + translate('Append MessageIntermediateCatchEvent'), + { eventDefinitionType: 'bpmn:MessageEventDefinition' } + ), + 'append.timer-intermediate-event': appendAction( + 'bpmn:IntermediateCatchEvent', + 'bpmn-icon-intermediate-event-catch-timer', + translate('Append TimerIntermediateCatchEvent'), + { eventDefinitionType: 'bpmn:TimerEventDefinition' } + ), + 'append.condition-intermediate-event': appendAction( + 'bpmn:IntermediateCatchEvent', + 'bpmn-icon-intermediate-event-catch-condition', + translate('Append ConditionIntermediateCatchEvent'), + { eventDefinitionType: 'bpmn:ConditionalEventDefinition' } + ), + 'append.signal-intermediate-event': appendAction( + 'bpmn:IntermediateCatchEvent', + 'bpmn-icon-intermediate-event-catch-signal', + translate('Append SignalIntermediateCatchEvent'), + { eventDefinitionType: 'bpmn:SignalEventDefinition' } + ) + }); + } else if (isEventType(businessObject, 'bpmn:BoundaryEvent', 'bpmn:CompensateEventDefinition')) { + assign(actions, { + 'append.compensation-activity': appendAction('bpmn:Task', 'bpmn-icon-task', translate('Append compensation activity'), { + isForCompensation: true + }) + }); + } else if ( + !is(businessObject, 'bpmn:EndEvent') && + !businessObject.isForCompensation && + !isEventType(businessObject, 'bpmn:IntermediateThrowEvent', 'bpmn:LinkEventDefinition') && + !isEventSubProcess(businessObject) + ) { + assign(actions, { + 'append.end-event': appendAction('bpmn:EndEvent', 'bpmn-icon-end-event-none', translate('Append EndEvent')), + 'append.gateway': appendAction('bpmn:ExclusiveGateway', 'bpmn-icon-gateway-none', translate('Append Gateway')), + 'append.append-task': appendAction('bpmn:UserTask', 'bpmn-icon-user-task', translate('Append Task')), + 'append.intermediate-event': appendAction( + 'bpmn:IntermediateThrowEvent', + 'bpmn-icon-intermediate-event-none', + translate('Append Intermediate/Boundary Event') + ) + }); + } + } + + if (!popupMenu.isEmpty(element, 'bpmn-replace')) { + // Replace menu entry + assign(actions, { + replace: { + group: 'edit', + className: 'bpmn-icon-screw-wrench', + title: translate('Change type'), + action: { + click: function(event, element) { + var position = assign(getReplaceMenuPosition(element), { + cursor: { x: event.x, y: event.y } + }); + + popupMenu.open(element, 'bpmn-replace', position); + } + } + } + }); + } + + if (isAny(businessObject, ['bpmn:FlowNode', 'bpmn:InteractionNode', 'bpmn:DataObjectReference', 'bpmn:DataStoreReference'])) { + assign(actions, { + 'append.text-annotation': appendAction('bpmn:TextAnnotation', 'bpmn-icon-text-annotation'), + + connect: { + group: 'connect', + className: 'bpmn-icon-connection-multi', + title: translate('Connect using ' + (businessObject.isForCompensation ? '' : 'Sequence/MessageFlow or ') + 'Association'), + action: { + click: startConnect, + dragstart: startConnect + } + } + }); + } + + if (isAny(businessObject, ['bpmn:DataObjectReference', 'bpmn:DataStoreReference'])) { + assign(actions, { + connect: { + group: 'connect', + className: 'bpmn-icon-connection-multi', + title: translate('Connect using DataInputAssociation'), + action: { + click: startConnect, + dragstart: startConnect + } + } + }); + } + + if (is(businessObject, 'bpmn:Group')) { + assign(actions, { + 'append.text-annotation': appendAction('bpmn:TextAnnotation', 'bpmn-icon-text-annotation') + }); + } + + // delete element entry, only show if allowed by rules + var deleteAllowed = rules.allowed('elements.delete', { elements: [element] }); + + if (isArray(deleteAllowed)) { + // was the element returned as a deletion candidate? + deleteAllowed = deleteAllowed[0] === element; + } + + if (deleteAllowed) { + assign(actions, { + delete: { + group: 'edit', + className: 'bpmn-icon-trash', + title: translate('Remove'), + action: { + click: removeElement + } + } + }); + } + + return actions; +}; + +// helpers ///////// + +function isEventType(eventBo, type, definition) { + var isType = eventBo.$instanceOf(type); + var isDefinition = false; + + var definitions = eventBo.eventDefinitions || []; + forEach(definitions, function(def) { + if (def.$type === definition) { + isDefinition = true; + } + }); + + return isType && isDefinition; +} diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/content-pad/index.js b/yanzhu-ui-vue3/src/package/designer/plugins/content-pad/index.js new file mode 100644 index 00000000..ad826f14 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/content-pad/index.js @@ -0,0 +1,6 @@ +import CustomContextPadProvider from './contentPadProvider'; + +export default { + __init__: ['contextPadProvider'], + contextPadProvider: ['type', CustomContextPadProvider] +}; diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/defaultEmpty.js b/yanzhu-ui-vue3/src/package/designer/plugins/defaultEmpty.js new file mode 100644 index 00000000..46dd4c1f --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/defaultEmpty.js @@ -0,0 +1,24 @@ +export default (key, name, type) => { + if (!type) type = 'camunda'; + const TYPE_TARGET = { + activiti: 'http://activiti.org/bpmn', + camunda: 'http://bpmn.io/schema/bpmn', + flowable: 'http://flowable.org/bpmn' + }; + return ` + + + + + + + +`; +}; diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/descriptor/activitiDescriptor.json b/yanzhu-ui-vue3/src/package/designer/plugins/descriptor/activitiDescriptor.json new file mode 100644 index 00000000..9daed508 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/descriptor/activitiDescriptor.json @@ -0,0 +1,1071 @@ +{ + "name": "Activiti", + "uri": "http://activiti.org/bpmn", + "prefix": "activiti", + "xml": { + "tagAlias": "lowerCase" + }, + "associations": [], + "types": [ + { + "name": "Definitions", + "isAbstract": true, + "extends": [ + "bpmn:Definitions" + ], + "properties": [ + { + "name": "diagramRelationId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "InOutBinding", + "superClass": [ + "Element" + ], + "isAbstract": true, + "properties": [ + { + "name": "source", + "isAttr": true, + "type": "String" + }, + { + "name": "sourceExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "target", + "isAttr": true, + "type": "String" + }, + { + "name": "businessKey", + "isAttr": true, + "type": "String" + }, + { + "name": "local", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "variables", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "In", + "superClass": [ + "InOutBinding" + ], + "meta": { + "allowedIn": [ + "bpmn:CallActivity" + ] + } + }, + { + "name": "Out", + "superClass": [ + "InOutBinding" + ], + "meta": { + "allowedIn": [ + "bpmn:CallActivity" + ] + } + }, + { + "name": "AsyncCapable", + "isAbstract": true, + "extends": [ + "bpmn:Activity", + "bpmn:Gateway", + "bpmn:Event" + ], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncBefore", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncAfter", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "exclusive", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "JobPriorized", + "isAbstract": true, + "extends": [ + "bpmn:Process", + "activiti:AsyncCapable" + ], + "properties": [ + { + "name": "jobPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "SignalEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:SignalEventDefinition" + ], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + } + ] + }, + { + "name": "ErrorEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:ErrorEventDefinition" + ], + "properties": [ + { + "name": "errorCodeVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "errorMessageVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Error", + "isAbstract": true, + "extends": [ + "bpmn:Error" + ], + "properties": [ + { + "name": "activiti:errorMessage", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "PotentialStarter", + "superClass": [ + "Element" + ], + "properties": [ + { + "name": "resourceAssignmentExpression", + "type": "bpmn:ResourceAssignmentExpression" + } + ] + }, + { + "name": "FormSupported", + "isAbstract": true, + "extends": [ + "bpmn:StartEvent", + "bpmn:UserTask" + ], + "properties": [ + { + "name": "formHandlerClass", + "isAttr": true, + "type": "String" + }, + { + "name": "formKey", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TemplateSupported", + "isAbstract": true, + "extends": [ + "bpmn:Process", + "bpmn:FlowElement" + ], + "properties": [ + { + "name": "modelerTemplate", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Initiator", + "isAbstract": true, + "extends": [ "bpmn:StartEvent" ], + "properties": [ + { + "name": "initiator", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ScriptTask", + "isAbstract": true, + "extends": [ + "bpmn:ScriptTask" + ], + "properties": [ + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Process", + "isAbstract": true, + "extends": [ + "bpmn:Process" + ], + "properties": [ + { + "name": "candidateStarterGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateStarterUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "versionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "historyTimeToLive", + "isAttr": true, + "type": "String" + }, + { + "name": "isStartableInTasklist", + "isAttr": true, + "type": "Boolean", + "default": true + }, + { + "name":"executionListener", + "isAbstract": true, + "type":"Expression" + } + ] + }, + { + "name": "EscalationEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:EscalationEventDefinition" + ], + "properties": [ + { + "name": "escalationCodeVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FormalExpression", + "isAbstract": true, + "extends": [ + "bpmn:FormalExpression" + ], + "properties": [ + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "multiinstance_type", + "superClass":[ + "Element" + ] + }, + { + "name": "multiinstance_condition", + "superClass":[ + "Element" + ] + }, + { + "name": "Assignable", + "extends": [ "bpmn:UserTask" ], + "properties": [ + { + "name": "assignee", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "dueDate", + "isAttr": true, + "type": "String" + }, + { + "name": "followUpDate", + "isAttr": true, + "type": "String" + }, + { + "name": "priority", + "isAttr": true, + "type": "String" + }, + { + "name": "multiinstance_condition", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "CallActivity", + "extends": [ "bpmn:CallActivity" ], + "properties": [ + { + "name": "calledElementBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "calledElementVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementVersionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "caseRef", + "isAttr": true, + "type": "String" + }, + { + "name": "caseBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "caseVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "caseTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingClass", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingDelegateExpression", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ServiceTaskLike", + "extends": [ + "bpmn:ServiceTask", + "bpmn:BusinessRuleTask", + "bpmn:SendTask", + "bpmn:MessageEventDefinition" + ], + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "DmnCapable", + "extends": [ + "bpmn:BusinessRuleTask" + ], + "properties": [ + { + "name": "decisionRef", + "isAttr": true, + "type": "String" + }, + { + "name": "decisionRefBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "decisionRefVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "mapDecisionResult", + "isAttr": true, + "type": "String", + "default": "resultList" + }, + { + "name": "decisionRefTenantId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ExternalCapable", + "extends": [ + "activiti:ServiceTaskLike" + ], + "properties": [ + { + "name": "type", + "isAttr": true, + "type": "String" + }, + { + "name": "topic", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TaskPriorized", + "extends": [ + "bpmn:Process", + "activiti:ExternalCapable" + ], + "properties": [ + { + "name": "taskPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Properties", + "superClass": [ + "Element" + ], + "meta": { + "allowedIn": [ "*" ] + }, + "properties": [ + { + "name": "values", + "type": "Property", + "isMany": true + } + ] + }, + { + "name": "Property", + "superClass": [ + "Element" + ], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "Connector", + "superClass": [ + "Element" + ], + "meta": { + "allowedIn": [ + "activiti:ServiceTaskLike" + ] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + } + ] + }, + { + "name": "InputOutput", + "superClass": [ + "Element" + ], + "meta": { + "allowedIn": [ + "bpmn:FlowNode", + "activiti:Connector" + ] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + }, + { + "name": "inputParameters", + "isMany": true, + "type": "InputParameter" + }, + { + "name": "outputParameters", + "isMany": true, + "type": "OutputParameter" + } + ] + }, + { + "name": "InputOutputParameter", + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "InputOutputParameterDefinition", + "isAbstract": true + }, + { + "name": "List", + "superClass": [ "InputOutputParameterDefinition" ], + "properties": [ + { + "name": "items", + "isMany": true, + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Map", + "superClass": [ "InputOutputParameterDefinition" ], + "properties": [ + { + "name": "entries", + "isMany": true, + "type": "Entry" + } + ] + }, + { + "name": "Entry", + "properties": [ + { + "name": "key", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Value", + "superClass": [ + "InputOutputParameterDefinition" + ], + "properties": [ + { + "name": "id", + "isAttr": true, + "type": "String" + }, + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Script", + "superClass": [ "InputOutputParameterDefinition" ], + "properties": [ + { + "name": "scriptFormat", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Field", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "activiti:ServiceTaskLike", + "activiti:ExecutionListener", + "activiti:TaskListener" + ] + }, + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "expression", + "type": "String" + }, + { + "name": "stringValue", + "isAttr": true, + "type": "String" + }, + { + "name": "string", + "type": "String" + } + ] + }, + { + "name": "InputParameter", + "superClass": [ "InputOutputParameter" ] + }, + { + "name": "OutputParameter", + "superClass": [ "InputOutputParameter" ] + }, + { + "name": "Collectable", + "isAbstract": true, + "extends": [ "bpmn:MultiInstanceLoopCharacteristics" ], + "superClass": [ "activiti:AsyncCapable" ], + "properties": [ + { + "name": "collection", + "isAttr": true, + "type": "String" + }, + { + "name": "elementVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FailedJobRetryTimeCycle", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "activiti:AsyncCapable", + "bpmn:MultiInstanceLoopCharacteristics" + ] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "ExecutionListener", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "bpmn:Task", + "bpmn:ServiceTask", + "bpmn:UserTask", + "bpmn:BusinessRuleTask", + "bpmn:ScriptTask", + "bpmn:ReceiveTask", + "bpmn:ManualTask", + "bpmn:ExclusiveGateway", + "bpmn:SequenceFlow", + "bpmn:ParallelGateway", + "bpmn:InclusiveGateway", + "bpmn:EventBasedGateway", + "bpmn:StartEvent", + "bpmn:IntermediateCatchEvent", + "bpmn:IntermediateThrowEvent", + "bpmn:EndEvent", + "bpmn:BoundaryEvent", + "bpmn:CallActivity", + "bpmn:SubProcess", + "bpmn:Process" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "TaskListener", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "bpmn:UserTask" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "FormProperty", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "bpmn:StartEvent", + "bpmn:UserTask" + ] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "required", + "type": "String", + "isAttr": true + }, + { + "name": "readable", + "type": "String", + "isAttr": true + }, + { + "name": "writable", + "type": "String", + "isAttr": true + }, + { + "name": "variable", + "type": "String", + "isAttr": true + }, + { + "name": "expression", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "default", + "type": "String", + "isAttr": true + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "FormProperty", + "superClass": [ "Element" ], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "label", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "defaultValue", + "type": "String", + "isAttr": true + }, + { + "name": "properties", + "type": "Properties" + }, + { + "name": "validation", + "type": "Validation" + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "Validation", + "superClass": [ "Element" ], + "properties": [ + { + "name": "constraints", + "type": "Constraint", + "isMany": true + } + ] + }, + { + "name": "Constraint", + "superClass": [ "Element" ], + "properties": [ + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "config", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "ConditionalEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:ConditionalEventDefinition" + ], + "properties": [ + { + "name": "variableName", + "isAttr": true, + "type": "String" + }, + { + "name": "variableEvent", + "isAttr": true, + "type": "String" + } + ] + } + ], + "emumerations": [ ] +} diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/descriptor/camundaDescriptor.json b/yanzhu-ui-vue3/src/package/designer/plugins/descriptor/camundaDescriptor.json new file mode 100644 index 00000000..a57dbe63 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/descriptor/camundaDescriptor.json @@ -0,0 +1,1087 @@ +{ + "name": "Camunda", + "uri": "http://camunda.org/schema/1.0/bpmn", + "prefix": "camunda", + "xml": { + "tagAlias": "lowerCase" + }, + "associations": [], + "types": [ + { + "name": "Definitions", + "isAbstract": true, + "extends": [ + "bpmn:Definitions" + ], + "properties": [ + { + "name": "diagramRelationId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "InOutBinding", + "superClass": [ + "Element" + ], + "isAbstract": true, + "properties": [ + { + "name": "source", + "isAttr": true, + "type": "String" + }, + { + "name": "sourceExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "target", + "isAttr": true, + "type": "String" + }, + { + "name": "businessKey", + "isAttr": true, + "type": "String" + }, + { + "name": "local", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "variables", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "In", + "superClass": [ + "InOutBinding" + ], + "meta": { + "allowedIn": [ + "bpmn:CallActivity", + "bpmn:SignalEventDefinition" + ] + } + }, + { + "name": "Out", + "superClass": [ + "InOutBinding" + ], + "meta": { + "allowedIn": [ + "bpmn:CallActivity" + ] + } + }, + { + "name": "AsyncCapable", + "isAbstract": true, + "extends": [ + "bpmn:Activity", + "bpmn:Gateway", + "bpmn:Event" + ], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncBefore", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncAfter", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "exclusive", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "JobPriorized", + "isAbstract": true, + "extends": [ + "bpmn:Process", + "camunda:AsyncCapable" + ], + "properties": [ + { + "name": "jobPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "SignalEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:SignalEventDefinition" + ], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + } + ] + }, + { + "name": "ErrorEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:ErrorEventDefinition" + ], + "properties": [ + { + "name": "errorCodeVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "errorMessageVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Error", + "isAbstract": true, + "extends": [ + "bpmn:Error" + ], + "properties": [ + { + "name": "camunda:errorMessage", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "PotentialStarter", + "superClass": [ + "Element" + ], + "properties": [ + { + "name": "resourceAssignmentExpression", + "type": "bpmn:ResourceAssignmentExpression" + } + ] + }, + { + "name": "FormSupported", + "isAbstract": true, + "extends": [ + "bpmn:StartEvent", + "bpmn:UserTask" + ], + "properties": [ + { + "name": "formHandlerClass", + "isAttr": true, + "type": "String" + }, + { + "name": "formKey", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TemplateSupported", + "isAbstract": true, + "extends": [ + "bpmn:Process", + "bpmn:FlowElement" + ], + "properties": [ + { + "name": "modelerTemplate", + "isAttr": true, + "type": "String" + }, + { + "name": "modelerTemplateVersion", + "isAttr": true, + "type": "Integer" + } + ] + }, + { + "name": "Initiator", + "isAbstract": true, + "extends": [ "bpmn:StartEvent" ], + "properties": [ + { + "name": "initiator", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ScriptTask", + "isAbstract": true, + "extends": [ + "bpmn:ScriptTask" + ], + "properties": [ + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Process", + "isAbstract": true, + "extends": [ + "bpmn:Process" + ], + "properties": [ + { + "name": "candidateStarterGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateStarterUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "versionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "historyTimeToLive", + "isAttr": true, + "type": "String" + }, + { + "name": "isStartableInTasklist", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "EscalationEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:EscalationEventDefinition" + ], + "properties": [ + { + "name": "escalationCodeVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FormalExpression", + "isAbstract": true, + "extends": [ + "bpmn:FormalExpression" + ], + "properties": [ + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Assignable", + "extends": [ "bpmn:UserTask" ], + "properties": [ + { + "name": "assignee", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "dueDate", + "isAttr": true, + "type": "String" + }, + { + "name": "followUpDate", + "isAttr": true, + "type": "String" + }, + { + "name": "priority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "CallActivity", + "extends": [ "bpmn:CallActivity" ], + "properties": [ + { + "name": "calledElementBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "calledElementVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementVersionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "caseRef", + "isAttr": true, + "type": "String" + }, + { + "name": "caseBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "caseVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "caseTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingClass", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingDelegateExpression", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ServiceTaskLike", + "extends": [ + "bpmn:ServiceTask", + "bpmn:BusinessRuleTask", + "bpmn:SendTask", + "bpmn:MessageEventDefinition" + ], + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "DmnCapable", + "extends": [ + "bpmn:BusinessRuleTask" + ], + "properties": [ + { + "name": "decisionRef", + "isAttr": true, + "type": "String" + }, + { + "name": "decisionRefBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "decisionRefVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "mapDecisionResult", + "isAttr": true, + "type": "String", + "default": "resultList" + }, + { + "name": "decisionRefTenantId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ExternalCapable", + "extends": [ + "camunda:ServiceTaskLike" + ], + "properties": [ + { + "name": "type", + "isAttr": true, + "type": "String" + }, + { + "name": "topic", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TaskPriorized", + "extends": [ + "bpmn:Process", + "camunda:ExternalCapable" + ], + "properties": [ + { + "name": "taskPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Properties", + "superClass": [ + "Element" + ], + "meta": { + "allowedIn": [ "*" ] + }, + "properties": [ + { + "name": "values", + "type": "Property", + "isMany": true + } + ] + }, + { + "name": "Property", + "superClass": [ + "Element" + ], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "Connector", + "superClass": [ + "Element" + ], + "meta": { + "allowedIn": [ + "camunda:ServiceTaskLike" + ] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + } + ] + }, + { + "name": "InputOutput", + "superClass": [ + "Element" + ], + "meta": { + "allowedIn": [ + "bpmn:FlowNode", + "camunda:Connector" + ] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + }, + { + "name": "inputParameters", + "isMany": true, + "type": "InputParameter" + }, + { + "name": "outputParameters", + "isMany": true, + "type": "OutputParameter" + } + ] + }, + { + "name": "InputOutputParameter", + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "InputOutputParameterDefinition", + "isAbstract": true + }, + { + "name": "List", + "superClass": [ "InputOutputParameterDefinition" ], + "properties": [ + { + "name": "items", + "isMany": true, + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Map", + "superClass": [ "InputOutputParameterDefinition" ], + "properties": [ + { + "name": "entries", + "isMany": true, + "type": "Entry" + } + ] + }, + { + "name": "Entry", + "properties": [ + { + "name": "key", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Value", + "superClass": [ + "InputOutputParameterDefinition" + ], + "properties": [ + { + "name": "id", + "isAttr": true, + "type": "String" + }, + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Script", + "superClass": [ "InputOutputParameterDefinition" ], + "properties": [ + { + "name": "scriptFormat", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Field", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "camunda:ServiceTaskLike", + "camunda:ExecutionListener", + "camunda:TaskListener" + ] + }, + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "expression", + "type": "String" + }, + { + "name": "stringValue", + "isAttr": true, + "type": "String" + }, + { + "name": "string", + "type": "String" + } + ] + }, + { + "name": "InputParameter", + "superClass": [ "InputOutputParameter" ] + }, + { + "name": "OutputParameter", + "superClass": [ "InputOutputParameter" ] + }, + { + "name": "Collectable", + "isAbstract": true, + "extends": [ "bpmn:MultiInstanceLoopCharacteristics" ], + "superClass": [ "camunda:AsyncCapable" ], + "properties": [ + { + "name": "collection", + "isAttr": true, + "type": "String" + }, + { + "name": "elementVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FailedJobRetryTimeCycle", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "camunda:AsyncCapable", + "bpmn:MultiInstanceLoopCharacteristics" + ] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "ExecutionListener", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "bpmn:Task", + "bpmn:ServiceTask", + "bpmn:UserTask", + "bpmn:BusinessRuleTask", + "bpmn:ScriptTask", + "bpmn:ReceiveTask", + "bpmn:ManualTask", + "bpmn:ExclusiveGateway", + "bpmn:SequenceFlow", + "bpmn:ParallelGateway", + "bpmn:InclusiveGateway", + "bpmn:EventBasedGateway", + "bpmn:StartEvent", + "bpmn:IntermediateCatchEvent", + "bpmn:IntermediateThrowEvent", + "bpmn:EndEvent", + "bpmn:BoundaryEvent", + "bpmn:CallActivity", + "bpmn:SubProcess", + "bpmn:Process" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "TaskListener", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "bpmn:UserTask" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + }, + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "eventDefinitions", + "type": "bpmn:TimerEventDefinition", + "isMany": true + } + ] + }, + { + "name": "FormProperty", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "bpmn:StartEvent", + "bpmn:UserTask" + ] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "required", + "type": "String", + "isAttr": true + }, + { + "name": "readable", + "type": "String", + "isAttr": true + }, + { + "name": "writable", + "type": "String", + "isAttr": true + }, + { + "name": "variable", + "type": "String", + "isAttr": true + }, + { + "name": "expression", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "default", + "type": "String", + "isAttr": true + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "FormData", + "superClass": [ "Element" ], + "meta": { + "allowedIn": [ + "bpmn:StartEvent", + "bpmn:UserTask" + ] + }, + "properties": [ + { + "name": "fields", + "type": "FormField", + "isMany": true + }, + { + "name": "businessKey", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "FormField", + "superClass": [ "Element" ], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "label", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "defaultValue", + "type": "String", + "isAttr": true + }, + { + "name": "properties", + "type": "Properties" + }, + { + "name": "validation", + "type": "Validation" + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "Validation", + "superClass": [ "Element" ], + "properties": [ + { + "name": "constraints", + "type": "Constraint", + "isMany": true + } + ] + }, + { + "name": "Constraint", + "superClass": [ "Element" ], + "properties": [ + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "config", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "ConditionalEventDefinition", + "isAbstract": true, + "extends": [ + "bpmn:ConditionalEventDefinition" + ], + "properties": [ + { + "name": "variableName", + "isAttr": true, + "type": "String" + }, + { + "name": "variableEvents", + "isAttr": true, + "type": "String" + } + ] + } + ], + "emumerations": [ ] +} diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/descriptor/flowableDescriptor.json b/yanzhu-ui-vue3/src/package/designer/plugins/descriptor/flowableDescriptor.json new file mode 100644 index 00000000..7b661555 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/descriptor/flowableDescriptor.json @@ -0,0 +1,1230 @@ +{ + "name": "Flowable", + "uri": "http://flowable.org/bpmn", + "prefix": "flowable", + "xml": { + "tagAlias": "lowerCase" + }, + "associations": [], + "types": [ + { + "name": "InOutBinding", + "superClass": ["Element"], + "isAbstract": true, + "properties": [ + { + "name": "source", + "isAttr": true, + "type": "String" + }, + { + "name": "sourceExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "target", + "isAttr": true, + "type": "String" + }, + { + "name": "businessKey", + "isAttr": true, + "type": "String" + }, + { + "name": "local", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "variables", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "In", + "superClass": ["InOutBinding"], + "meta": { + "allowedIn": ["bpmn:CallActivity"] + } + }, + { + "name": "Out", + "superClass": ["InOutBinding"], + "meta": { + "allowedIn": ["bpmn:CallActivity"] + } + }, + { + "name": "AsyncCapable", + "isAbstract": true, + "extends": ["bpmn:Activity", "bpmn:Gateway", "bpmn:Event"], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncBefore", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncAfter", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "exclusive", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "JobPriorized", + "isAbstract": true, + "extends": ["bpmn:Process", "flowable:AsyncCapable"], + "properties": [ + { + "name": "jobPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "SignalEventDefinition", + "isAbstract": true, + "extends": ["bpmn:SignalEventDefinition"], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + } + ] + }, + { + "name": "ErrorEventDefinition", + "isAbstract": true, + "extends": ["bpmn:ErrorEventDefinition"], + "properties": [ + { + "name": "errorCodeVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "errorMessageVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Error", + "isAbstract": true, + "extends": ["bpmn:Error"], + "properties": [ + { + "name": "flowable:errorMessage", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "PotentialStarter", + "superClass": ["Element"], + "properties": [ + { + "name": "resourceAssignmentExpression", + "type": "bpmn:ResourceAssignmentExpression" + } + ] + }, + { + "name": "FormSupported", + "isAbstract": true, + "extends": ["bpmn:StartEvent", "bpmn:UserTask"], + "properties": [ + { + "name": "formHandlerClass", + "isAttr": true, + "type": "String" + }, + { + "name": "formKey", + "isAttr": true, + "type": "String" + }, + { + "name": "formType", + "isAttr": true, + "type": "String" + }, + { + "name": "formReadOnly", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "formInit", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "TemplateSupported", + "isAbstract": true, + "extends": ["bpmn:Process", "bpmn:FlowElement"], + "properties": [ + { + "name": "modelerTemplate", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Initiator", + "isAbstract": true, + "extends": ["bpmn:StartEvent"], + "properties": [ + { + "name": "initiator", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ScriptTask", + "isAbstract": true, + "extends": ["bpmn:ScriptTask"], + "properties": [ + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Process", + "isAbstract": true, + "extends": ["bpmn:Process"], + "properties": [ + { + "name": "candidateStarterGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateStarterUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "versionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "historyTimeToLive", + "isAttr": true, + "type": "String" + }, + { + "name": "isStartableInTasklist", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "EscalationEventDefinition", + "isAbstract": true, + "extends": ["bpmn:EscalationEventDefinition"], + "properties": [ + { + "name": "escalationCodeVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FormalExpression", + "isAbstract": true, + "extends": ["bpmn:FormalExpression"], + "properties": [ + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Assignable", + "extends": ["bpmn:UserTask"], + "properties": [ + { + "name": "assignee", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "dueDate", + "isAttr": true, + "type": "String" + }, + { + "name": "followUpDate", + "isAttr": true, + "type": "String" + }, + { + "name": "priority", + "isAttr": true, + "type": "String" + }, + { + "name": "dataType", + "isAttr": true, + "type": "String" + }, + { + "name": "text", + "isAttr": true, + "type": "String" + }, + { + "name": "deptId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Assignee", + "supperClass": "Element", + "meta": { + "allowedIn": ["*"] + }, + "properties": [ + { + "name": "label", + "type": "String", + "isAttr": true + }, + { + "name": "viewId", + "type": "Number", + "isAttr": true + } + ] + }, + { + "name": "CallActivity", + "extends": ["bpmn:CallActivity"], + "properties": [ + { + "name": "calledElementBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "calledElementVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementVersionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "caseRef", + "isAttr": true, + "type": "String" + }, + { + "name": "caseBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "caseVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "caseTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingClass", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingDelegateExpression", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ServiceTaskLike", + "extends": [ + "bpmn:ServiceTask", + "bpmn:BusinessRuleTask", + "bpmn:SendTask", + "bpmn:MessageEventDefinition" + ], + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "DmnCapable", + "extends": ["bpmn:BusinessRuleTask"], + "properties": [ + { + "name": "decisionRef", + "isAttr": true, + "type": "String" + }, + { + "name": "decisionRefBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "decisionRefVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "mapDecisionResult", + "isAttr": true, + "type": "String", + "default": "resultList" + }, + { + "name": "decisionRefTenantId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ExternalCapable", + "extends": ["flowable:ServiceTaskLike"], + "properties": [ + { + "name": "type", + "isAttr": true, + "type": "String" + }, + { + "name": "topic", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TaskPriorized", + "extends": ["bpmn:Process", "flowable:ExternalCapable"], + "properties": [ + { + "name": "taskPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Properties", + "superClass": ["Element"], + "meta": { + "allowedIn": ["*"] + }, + "properties": [ + { + "name": "values", + "type": "Property", + "isMany": true + } + ] + }, + { + "name": "Property", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "Button", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:UserTask"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "code", + "type": "String", + "isAttr": true + }, + { + "name": "isHide", + "type": "String", + "isAttr": true + }, + { + "name": "next", + "type": "String", + "isAttr": true + }, + { + "name": "sort", + "type": "Integer", + "isAttr": true + } + ] + }, + { + "name": "Assignee", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:UserTask"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + }, + { + "name": "condition", + "type": "String", + "isAttr": true + }, + { + "name": "operationType", + "type": "String", + "isAttr": true + }, + { + "name": "sort", + "type": "Integer", + "isAttr": true + } + ] + }, + { + "name": "Connector", + "superClass": ["Element"], + "meta": { + "allowedIn": ["flowable:ServiceTaskLike"] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + } + ] + }, + { + "name": "InputOutput", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:FlowNode", "flowable:Connector"] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + }, + { + "name": "inputParameters", + "isMany": true, + "type": "InputParameter" + }, + { + "name": "outputParameters", + "isMany": true, + "type": "OutputParameter" + } + ] + }, + { + "name": "InputOutputParameter", + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "InputOutputParameterDefinition", + "isAbstract": true + }, + { + "name": "List", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "items", + "isMany": true, + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Map", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "entries", + "isMany": true, + "type": "Entry" + } + ] + }, + { + "name": "Entry", + "properties": [ + { + "name": "key", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Value", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "id", + "isAttr": true, + "type": "String" + }, + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Script", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "scriptFormat", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Field", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "flowable:ServiceTaskLike", + "flowable:ExecutionListener", + "flowable:TaskListener", + "bpmn:ServiceTask" + ] + }, + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "expression", + "type": "String" + }, + { + "name": "stringValue", + "isAttr": true, + "type": "String" + }, + { + "name": "string", + "type": "String" + }, + { + "name": "htmlVar", + "type": "Expression" + } + ] + }, + { + "name": "ChildField", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "required", + "type": "String", + "isAttr": true + }, + { + "name": "readable", + "type": "String", + "isAttr": true + }, + { + "name": "writable", + "type": "String", + "isAttr": true + }, + { + "name": "variable", + "type": "String", + "isAttr": true + }, + { + "name": "expression", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "default", + "type": "String", + "isAttr": true + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "InputParameter", + "superClass": ["InputOutputParameter"] + }, + { + "name": "OutputParameter", + "superClass": ["InputOutputParameter"] + }, + { + "name": "Collectable", + "isAbstract": true, + "extends": ["bpmn:MultiInstanceLoopCharacteristics"], + "superClass": ["flowable:AsyncCapable"], + "properties": [ + { + "name": "collection", + "isAttr": true, + "type": "String" + }, + { + "name": "elementVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FailedJobRetryTimeCycle", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "flowable:AsyncCapable", + "bpmn:MultiInstanceLoopCharacteristics" + ] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "ExecutionListener", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "bpmn:Task", + "bpmn:ServiceTask", + "bpmn:UserTask", + "bpmn:BusinessRuleTask", + "bpmn:ScriptTask", + "bpmn:ReceiveTask", + "bpmn:ManualTask", + "bpmn:ExclusiveGateway", + "bpmn:SequenceFlow", + "bpmn:ParallelGateway", + "bpmn:InclusiveGateway", + "bpmn:EventBasedGateway", + "bpmn:StartEvent", + "bpmn:IntermediateCatchEvent", + "bpmn:IntermediateThrowEvent", + "bpmn:EndEvent", + "bpmn:BoundaryEvent", + "bpmn:CallActivity", + "bpmn:SubProcess", + "bpmn:Process" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "TaskListener", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:UserTask"] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "FormProperty", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "required", + "type": "String", + "isAttr": true + }, + { + "name": "readable", + "type": "String", + "isAttr": true + }, + { + "name": "writable", + "type": "String", + "isAttr": true + }, + { + "name": "variable", + "type": "String", + "isAttr": true + }, + { + "name": "expression", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "default", + "type": "String", + "isAttr": true + }, + { + "name": "values", + "type": "Value", + "isMany": true + }, + { + "name": "children", + "type": "ChildField", + "isMany": true + }, + { + "name": "extensionElements", + "type": "bpmn:ExtensionElements", + "isMany": true + } + ] + }, + { + "name": "FormData", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"] + }, + "properties": [ + { + "name": "fields", + "type": "FormField", + "isMany": true + }, + { + "name": "businessKey", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "FormField", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "label", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "defaultValue", + "type": "String", + "isAttr": true + }, + { + "name": "properties", + "type": "Properties" + }, + { + "name": "validation", + "type": "Validation" + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "Validation", + "superClass": ["Element"], + "properties": [ + { + "name": "constraints", + "type": "Constraint", + "isMany": true + } + ] + }, + { + "name": "Constraint", + "superClass": ["Element"], + "properties": [ + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "config", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "ConditionalEventDefinition", + "isAbstract": true, + "extends": ["bpmn:ConditionalEventDefinition"], + "properties": [ + { + "name": "variableName", + "isAttr": true, + "type": "String" + }, + { + "name": "variableEvent", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Condition", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:SequenceFlow"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "field", + "type": "String", + "isAttr": true + }, + { + "name": "compare", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + }, + { + "name": "logic", + "type": "String", + "isAttr": true + }, + { + "name": "sort", + "type": "Integer", + "isAttr": true + } + ] + } + ], + "emumerations": [] +} diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/activiti/activitiExtension.js b/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/activiti/activitiExtension.js new file mode 100644 index 00000000..d8c4ec5c --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/activiti/activitiExtension.js @@ -0,0 +1,73 @@ +'use strict'; + +import { some } from '@/utils/min-dash.js'; + +var ALLOWED_TYPES = { + FailedJobRetryTimeCycle: ['bpmn:StartEvent', 'bpmn:BoundaryEvent', 'bpmn:IntermediateCatchEvent', 'bpmn:Activity'], + Connector: ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'], + Field: ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'] +}; + +function is(element, type) { + return element && typeof element.$instanceOf === 'function' && element.$instanceOf(type); +} + +function exists(element) { + return element && element.length; +} + +function includesType(collection, type) { + return ( + exists(collection) && + some(collection, function(element) { + return is(element, type); + }) + ); +} + +function anyType(element, types) { + return some(types, function(type) { + return is(element, type); + }); +} + +function isAllowed(propName, propDescriptor, newElement) { + var name = propDescriptor.name; + var types = ALLOWED_TYPES[name.replace(/activiti:/, '')]; + + return name === propName && anyType(newElement, types); +} + +export default function ActivitiModdleExtension(eventBus) { + eventBus.on( + 'property.clone', + function(context) { + var newElement = context.newElement; + var propDescriptor = context.propertyDescriptor; + + this.canCloneProperty(newElement, propDescriptor); + }, + this + ); +} + +ActivitiModdleExtension.$inject = ['eventBus']; + +ActivitiModdleExtension.prototype.canCloneProperty = function(newElement, propDescriptor) { + if (isAllowed('activiti:FailedJobRetryTimeCycle', propDescriptor, newElement)) { + return ( + includesType(newElement.eventDefinitions, 'bpmn:TimerEventDefinition') || + includesType(newElement.eventDefinitions, 'bpmn:SignalEventDefinition') || + is(newElement.loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics') + ); + } + + if (isAllowed('activiti:Connector', propDescriptor, newElement)) { + return includesType(newElement.eventDefinitions, 'bpmn:MessageEventDefinition'); + } + + if (isAllowed('activiti:Field', propDescriptor, newElement)) { + return includesType(newElement.eventDefinitions, 'bpmn:MessageEventDefinition'); + } +}; + diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/activiti/index.js b/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/activiti/index.js new file mode 100644 index 00000000..9132e5a1 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/activiti/index.js @@ -0,0 +1,10 @@ +/* + * @author igdianov + * address https://github.com/igdianov/activiti-bpmn-moddle + * */ + +import ActivitiModdleExtension from './activitiExtension.js' +export default { + __init__: ['ActivitiModdleExtension'], + ActivitiModdleExtension: ['type', ActivitiModdleExtension] +}; diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/camunda/extension.js b/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/camunda/extension.js new file mode 100644 index 00000000..ea006757 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/camunda/extension.js @@ -0,0 +1,144 @@ +'use strict'; + +import { some, isObject, isFunction } from '@/utils/min-dash.js'; + +var WILDCARD = '*'; + +export default function CamundaModdleExtension(eventBus) { + var self = this; + + eventBus.on('moddleCopy.canCopyProperty', function(context) { + var property = context.property; + var parent = context.parent; + + return self.canCopyProperty(property, parent); + }); +} + +CamundaModdleExtension.$inject = ['eventBus']; + +/** + * Check wether to disallow copying property. + */ +CamundaModdleExtension.prototype.canCopyProperty = function(property, parent) { + // (1) check wether property is allowed in parent + if (isObject(property) && !isAllowedInParent(property, parent)) { + return false; + } + + // (2) check more complex scenarios + + if (is(property, 'camunda:InputOutput') && !this.canHostInputOutput(parent)) { + return false; + } + + if (isAny(property, ['camunda:Connector', 'camunda:Field']) && !this.canHostConnector(parent)) { + return false; + } + + if (is(property, 'camunda:In') && !this.canHostIn(parent)) { + return false; + } +}; + +CamundaModdleExtension.prototype.canHostInputOutput = function(parent) { + // allowed in camunda:Connector + var connector = getParent(parent, 'camunda:Connector'); + + if (connector) { + return true; + } + + // special rules inside bpmn:FlowNode + var flowNode = getParent(parent, 'bpmn:FlowNode'); + + if (!flowNode) { + return false; + } + + if (isAny(flowNode, ['bpmn:StartEvent', 'bpmn:Gateway', 'bpmn:BoundaryEvent'])) { + return false; + } + + if (is(flowNode, 'bpmn:SubProcess') && flowNode.get('triggeredByEvent')) { + return false; + } + + return true; +}; + +CamundaModdleExtension.prototype.canHostConnector = function(parent) { + var serviceTaskLike = getParent(parent, 'camunda:ServiceTaskLike'); + + if (is(serviceTaskLike, 'bpmn:MessageEventDefinition')) { + // only allow on throw and end events + return getParent(parent, 'bpmn:IntermediateThrowEvent') || getParent(parent, 'bpmn:EndEvent'); + } + + return true; +}; + +CamundaModdleExtension.prototype.canHostIn = function(parent) { + var callActivity = getParent(parent, 'bpmn:CallActivity'); + + if (callActivity) { + return true; + } + + var signalEventDefinition = getParent(parent, 'bpmn:SignalEventDefinition'); + + if (signalEventDefinition) { + // only allow on throw and end events + return getParent(parent, 'bpmn:IntermediateThrowEvent') || getParent(parent, 'bpmn:EndEvent'); + } + + return true; +}; + +// helpers ////////// + +function is(element, type) { + return element && isFunction(element.$instanceOf) && element.$instanceOf(type); +} + +function isAny(element, types) { + return some(types, function(t) { + return is(element, t); + }); +} + +function getParent(element, type) { + if (!type) { + return element.$parent; + } + + if (is(element, type)) { + return element; + } + + if (!element.$parent) { + return; + } + + return getParent(element.$parent, type); +} + +function isAllowedInParent(property, parent) { + // (1) find property descriptor + var descriptor = property.$type && property.$model.getTypeDescriptor(property.$type); + + var allowedIn = descriptor && descriptor.meta && descriptor.meta.allowedIn; + + if (!allowedIn || isWildcard(allowedIn)) { + return true; + } + + // (2) check wether property has parent of allowed type + return some(allowedIn, function(type) { + return getParent(parent, type); + }); +} + +function isWildcard(allowedIn) { + return allowedIn.indexOf(WILDCARD) !== -1; +} diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/camunda/index.js b/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/camunda/index.js new file mode 100644 index 00000000..007c1f4d --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/camunda/index.js @@ -0,0 +1,7 @@ +'use strict'; + +import CamundaModdleExtension from './extension.js'; +export default { + __init__: ['CamundaModdleExtension'], + CamundaModdleExtension: ['type', CamundaModdleExtension] +}; diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/flowable/flowableExtension.js b/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/flowable/flowableExtension.js new file mode 100644 index 00000000..652bfb82 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/flowable/flowableExtension.js @@ -0,0 +1,72 @@ +'use strict'; + +import { some } from '@/utils/min-dash.js'; + +var ALLOWED_TYPES = { + FailedJobRetryTimeCycle: ['bpmn:StartEvent', 'bpmn:BoundaryEvent', 'bpmn:IntermediateCatchEvent', 'bpmn:Activity'], + Connector: ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'], + Field: ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'] +}; + +function is(element, type) { + return element && typeof element.$instanceOf === 'function' && element.$instanceOf(type); +} + +function exists(element) { + return element && element.length; +} + +function includesType(collection, type) { + return ( + exists(collection) && + some(collection, function(element) { + return is(element, type); + }) + ); +} + +function anyType(element, types) { + return some(types, function(type) { + return is(element, type); + }); +} + +function isAllowed(propName, propDescriptor, newElement) { + var name = propDescriptor.name; + var types = ALLOWED_TYPES[name.replace(/flowable:/, '')]; + + return name === propName && anyType(newElement, types); +} + +export default function FlowableModdleExtension(eventBus) { + eventBus.on( + 'property.clone', + function(context) { + var newElement = context.newElement; + var propDescriptor = context.propertyDescriptor; + + this.canCloneProperty(newElement, propDescriptor); + }, + this + ); +} + +FlowableModdleExtension.$inject = ['eventBus']; + +FlowableModdleExtension.prototype.canCloneProperty = function(newElement, propDescriptor) { + if (isAllowed('flowable:FailedJobRetryTimeCycle', propDescriptor, newElement)) { + return ( + includesType(newElement.eventDefinitions, 'bpmn:TimerEventDefinition') || + includesType(newElement.eventDefinitions, 'bpmn:SignalEventDefinition') || + is(newElement.loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics') + ); + } + + if (isAllowed('flowable:Connector', propDescriptor, newElement)) { + return includesType(newElement.eventDefinitions, 'bpmn:MessageEventDefinition'); + } + + if (isAllowed('flowable:Field', propDescriptor, newElement)) { + return includesType(newElement.eventDefinitions, 'bpmn:MessageEventDefinition'); + } +}; diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/flowable/index.js b/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/flowable/index.js new file mode 100644 index 00000000..c0c39684 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/extension-moddle/flowable/index.js @@ -0,0 +1,10 @@ +/* + * @author igdianov + * address https://github.com/igdianov/activiti-bpmn-moddle + * */ + +import FlowableModdleExtension from './flowableExtension.js' +export default { + __init__: ['FlowableModdleExtension'], + FlowableModdleExtension: ['type', FlowableModdleExtension] +}; diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/palette/CustomPalette.js b/yanzhu-ui-vue3/src/package/designer/plugins/palette/CustomPalette.js new file mode 100644 index 00000000..b7ea83f6 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/palette/CustomPalette.js @@ -0,0 +1,156 @@ +import PaletteProvider from 'bpmn-js/lib/features/palette/PaletteProvider'; +import { assign } from '@/utils/min-dash.js'; + +export default function CustomPalette(palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate) { + PaletteProvider.call(this, palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate, 2000); +} + +const F = function() {}; // 核心,利用空对象作为中介; +F.prototype = PaletteProvider.prototype; // 核心,将父类的原型赋值给空对象F; + +// 利用中介函数重写原型链方法 +F.prototype.getPaletteEntries = function() { + var actions = {}; + var create = this._create; + var elementFactory = this._elementFactory; + var spaceTool = this._spaceTool; + var lassoTool = this._lassoTool; + var handTool = this._handTool; + var globalConnect = this._globalConnect; + var translate = this._translate; + + function createAction(type, group, className, title, options) { + function createListener(event) { + var shape = elementFactory.createShape(assign({ type: type }, options)); + + if (options) { + shape.businessObject.di.isExpanded = options.isExpanded; + } + + create.start(event, shape); + } + + var shortType = type.replace(/^bpmn:/, ''); + + return { + group: group, + className: className, + title: title || translate('Create {type}', { type: shortType }), + action: { + dragstart: createListener, + click: createListener + } + }; + } + + function createSubprocess(event) { + var subProcess = elementFactory.createShape({ + type: 'bpmn:SubProcess', + x: 0, + y: 0, + isExpanded: true + }); + + var startEvent = elementFactory.createShape({ + type: 'bpmn:StartEvent', + x: 40, + y: 82, + parent: subProcess + }); + + create.start(event, [subProcess, startEvent], { + hints: { + autoSelect: [startEvent] + } + }); + } + + function createParticipant(event) { + create.start(event, elementFactory.createParticipantShape()); + } + + assign(actions, { + 'hand-tool': { + group: 'tools', + className: 'bpmn-icon-hand-tool', + title: translate('Activate the hand tool'), + action: { + click: function(event) { + handTool.activateHand(event); + } + } + }, + 'lasso-tool': { + group: 'tools', + className: 'bpmn-icon-lasso-tool', + title: translate('Activate the lasso tool'), + action: { + click: function(event) { + lassoTool.activateSelection(event); + } + } + }, + 'space-tool': { + group: 'tools', + className: 'bpmn-icon-space-tool', + title: translate('Activate the create/remove space tool'), + action: { + click: function(event) { + spaceTool.activateSelection(event); + } + } + }, + 'global-connect-tool': { + group: 'tools', + className: 'bpmn-icon-connection-multi', + title: translate('Activate the global connect tool'), + action: { + click: function(event) { + globalConnect.toggle(event); + } + } + }, + 'tool-separator': { + group: 'tools', + separator: true + }, + 'create.start-event': createAction('bpmn:StartEvent', 'event', 'bpmn-icon-start-event-none', translate('Create StartEvent')), + 'create.intermediate-event': createAction( + 'bpmn:IntermediateThrowEvent', + 'event', + 'bpmn-icon-intermediate-event-none', + translate('Create Intermediate/Boundary Event') + ), + 'create.end-event': createAction('bpmn:EndEvent', 'event', 'bpmn-icon-end-event-none', translate('Create EndEvent')), + 'create.exclusive-gateway': createAction('bpmn:ExclusiveGateway', 'gateway', 'bpmn-icon-gateway-none', translate('Create Gateway')), + 'create.user-task': createAction('bpmn:UserTask', 'activity', 'bpmn-icon-user-task', translate('Create User Task')), + 'create.data-object': createAction('bpmn:DataObjectReference', 'data-object', 'bpmn-icon-data-object', translate('Create DataObjectReference')), + 'create.data-store': createAction('bpmn:DataStoreReference', 'data-store', 'bpmn-icon-data-store', translate('Create DataStoreReference')), + 'create.subprocess-expanded': { + group: 'activity', + className: 'bpmn-icon-subprocess-expanded', + title: translate('Create expanded SubProcess'), + action: { + dragstart: createSubprocess, + click: createSubprocess + } + }, + 'create.participant-expanded': { + group: 'collaboration', + className: 'bpmn-icon-participant', + title: translate('Create Pool/Participant'), + action: { + dragstart: createParticipant, + click: createParticipant + } + }, + 'create.group': createAction('bpmn:Group', 'artifact', 'bpmn-icon-group', translate('Create Group')) + }); + + return actions; +}; + +CustomPalette.$inject = ['palette', 'create', 'elementFactory', 'spaceTool', 'lassoTool', 'handTool', 'globalConnect', 'translate']; + +CustomPalette.prototype = new F(); // 核心,将 F的实例赋值给子类; +CustomPalette.prototype.constructor = CustomPalette; // 修复子类CustomPalette的构造器指向,防止原型链的混乱; diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/palette/index.js b/yanzhu-ui-vue3/src/package/designer/plugins/palette/index.js new file mode 100644 index 00000000..8d5f03fe --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/palette/index.js @@ -0,0 +1,6 @@ +import CustomPalette from './CustomPalette'; + +export default { + __init__: ['customPalette'], + customPalette: ['type', CustomPalette] +}; diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/palette/paletteProvider.js b/yanzhu-ui-vue3/src/package/designer/plugins/palette/paletteProvider.js new file mode 100644 index 00000000..8fa00ff7 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/palette/paletteProvider.js @@ -0,0 +1,160 @@ +import { assign } from '@/utils/min-dash.js'; + +/** + * A palette provider for BPMN 2.0 elements. + */ +export default function PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate) { + this._palette = palette; + this._create = create; + this._elementFactory = elementFactory; + this._spaceTool = spaceTool; + this._lassoTool = lassoTool; + this._handTool = handTool; + this._globalConnect = globalConnect; + this._translate = translate; + + palette.registerProvider(this); +} + +PaletteProvider.$inject = ['palette', 'create', 'elementFactory', 'spaceTool', 'lassoTool', 'handTool', 'globalConnect', 'translate']; + +PaletteProvider.prototype.getPaletteEntries = function() { + var actions = {}; + var create = this._create; + var elementFactory = this._elementFactory; + var spaceTool = this._spaceTool; + var lassoTool = this._lassoTool; + var handTool = this._handTool; + var globalConnect = this._globalConnect; + var translate = this._translate; + + function createAction(type, group, className, title, options) { + function createListener(event) { + var shape = elementFactory.createShape(assign({ type: type }, options)); + + if (options) { + shape.businessObject.di.isExpanded = options.isExpanded; + } + + create.start(event, shape); + } + + var shortType = type.replace(/^bpmn:/, ''); + + return { + group: group, + className: className, + title: title || translate('Create {type}', { type: shortType }), + action: { + dragstart: createListener, + click: createListener + } + }; + } + + function createSubprocess(event) { + var subProcess = elementFactory.createShape({ + type: 'bpmn:SubProcess', + x: 0, + y: 0, + isExpanded: true + }); + + var startEvent = elementFactory.createShape({ + type: 'bpmn:StartEvent', + x: 40, + y: 82, + parent: subProcess + }); + + create.start(event, [subProcess, startEvent], { + hints: { + autoSelect: [startEvent] + } + }); + } + + function createParticipant(event) { + create.start(event, elementFactory.createParticipantShape()); + } + + assign(actions, { + 'hand-tool': { + group: 'tools', + className: 'bpmn-icon-hand-tool', + title: translate('Activate the hand tool'), + action: { + click: function(event) { + handTool.activateHand(event); + } + } + }, + 'lasso-tool': { + group: 'tools', + className: 'bpmn-icon-lasso-tool', + title: translate('Activate the lasso tool'), + action: { + click: function(event) { + lassoTool.activateSelection(event); + } + } + }, + 'space-tool': { + group: 'tools', + className: 'bpmn-icon-space-tool', + title: translate('Activate the create/remove space tool'), + action: { + click: function(event) { + spaceTool.activateSelection(event); + } + } + }, + 'global-connect-tool': { + group: 'tools', + className: 'bpmn-icon-connection-multi', + title: translate('Activate the global connect tool'), + action: { + click: function(event) { + globalConnect.toggle(event); + } + } + }, + 'tool-separator': { + group: 'tools', + separator: true + }, + 'create.start-event': createAction('bpmn:StartEvent', 'event', 'bpmn-icon-start-event-none', translate('Create StartEvent')), + 'create.intermediate-event': createAction( + 'bpmn:IntermediateThrowEvent', + 'event', + 'bpmn-icon-intermediate-event-none', + translate('Create Intermediate/Boundary Event') + ), + 'create.end-event': createAction('bpmn:EndEvent', 'event', 'bpmn-icon-end-event-none', translate('Create EndEvent')), + 'create.exclusive-gateway': createAction('bpmn:ExclusiveGateway', 'gateway', 'bpmn-icon-gateway-none', translate('Create Gateway')), + 'create.user-task': createAction('bpmn:UserTask', 'activity', 'bpmn-icon-user-task', translate('Create User Task')), + 'create.data-object': createAction('bpmn:DataObjectReference', 'data-object', 'bpmn-icon-data-object', translate('Create DataObjectReference')), + 'create.data-store': createAction('bpmn:DataStoreReference', 'data-store', 'bpmn-icon-data-store', translate('Create DataStoreReference')), + 'create.subprocess-expanded': { + group: 'activity', + className: 'bpmn-icon-subprocess-expanded', + title: translate('Create expanded SubProcess'), + action: { + dragstart: createSubprocess, + click: createSubprocess + } + }, + 'create.participant-expanded': { + group: 'collaboration', + className: 'bpmn-icon-participant', + title: translate('Create Pool/Participant'), + action: { + dragstart: createParticipant, + click: createParticipant + } + }, + 'create.group': createAction('bpmn:Group', 'artifact', 'bpmn-icon-group', translate('Create Group')) + }); + + return actions; +}; diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/translate/customTranslate.js b/yanzhu-ui-vue3/src/package/designer/plugins/translate/customTranslate.js new file mode 100644 index 00000000..12cae81e --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/translate/customTranslate.js @@ -0,0 +1,41 @@ +// import translations from "./zh"; +// +// export default function customTranslate(template, replacements) { +// replacements = replacements || {}; +// +// // Translate +// template = translations[template] || template; +// +// // Replace +// return template.replace(/{([^}]+)}/g, function(_, key) { +// let str = replacements[key]; +// if ( +// translations[replacements[key]] !== null && +// translations[replacements[key]] !== "undefined" +// ) { +// // eslint-disable-next-line no-mixed-spaces-and-tabs +// str = translations[replacements[key]]; +// // eslint-disable-next-line no-mixed-spaces-and-tabs +// } +// return str || "{" + key + "}"; +// }); +// } + +export default function customTranslate(translations) { + return function(template, replacements) { + replacements = replacements || {}; + // Translate + template = translations[template] || template; + + // Replace + return template.replace(/{([^}]+)}/g, function(_, key) { + let str = replacements[key]; + if (translations[replacements[key]] !== null && translations[replacements[key]] !== undefined) { + // eslint-disable-next-line no-mixed-spaces-and-tabs + str = translations[replacements[key]]; + // eslint-disable-next-line no-mixed-spaces-and-tabs + } + return str || '{' + key + '}'; + }); + }; +} diff --git a/yanzhu-ui-vue3/src/package/designer/plugins/translate/zh.js b/yanzhu-ui-vue3/src/package/designer/plugins/translate/zh.js new file mode 100644 index 00000000..03b20ab0 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/designer/plugins/translate/zh.js @@ -0,0 +1,238 @@ +/** + * This is a sample file that should be replaced with the actual translation. + * + * Checkout https://github.com/bpmn-io/bpmn-js-i18n for a list of available + * translations and labels to translate. + */ +export default { + // 添加部分 + 'Append EndEvent': '追加结束事件', + 'Append Gateway': '追加网关', + 'Append Task': '追加任务', + 'Append Intermediate/Boundary Event': '追加中间抛出事件/边界事件', + + 'Activate the global connect tool': '激活全局连接工具', + 'Append {type}': '添加 {type}', + 'Add Lane above': '在上面添加道', + 'Divide into two Lanes': '分割成两个道', + 'Divide into three Lanes': '分割成三个道', + 'Add Lane below': '在下面添加道', + 'Append compensation activity': '追加补偿活动', + 'Change type': '修改类型', + 'Connect using Association': '使用关联连接', + 'Connect using Sequence/MessageFlow or Association': '使用顺序/消息流或者关联连接', + 'Connect using DataInputAssociation': '使用数据输入关联连接', + Remove: '移除', + 'Activate the hand tool': '激活抓手工具', + 'Activate the lasso tool': '激活套索工具', + 'Activate the create/remove space tool': '激活创建/删除空间工具', + 'Create expanded SubProcess': '创建扩展子过程', + 'Create IntermediateThrowEvent/BoundaryEvent': '创建中间抛出事件/边界事件', + 'Create Pool/Participant': '创建池/参与者', + 'Parallel Multi Instance': '并行多重事件', + 'Sequential Multi Instance': '时序多重事件', + DataObjectReference: '数据对象参考', + DataStoreReference: '数据存储参考', + Loop: '循环', + 'Ad-hoc': '即席', + 'Create {type}': '创建 {type}', + Task: '任务', + 'Send Task': '发送任务', + 'Receive Task': '接收任务', + 'User Task': '用户任务', + 'Manual Task': '手工任务', + 'Business Rule Task': '业务规则任务', + 'Service Task': '服务任务', + 'Script Task': '脚本任务', + 'Call Activity': '调用活动', + 'Sub Process (collapsed)': '子流程(折叠的)', + 'Sub Process (expanded)': '子流程(展开的)', + 'Start Event': '开始事件', + StartEvent: '开始事件', + 'Intermediate Throw Event': '中间事件', + 'End Event': '结束事件', + EndEvent: '结束事件', + 'Create StartEvent': '创建开始事件', + 'Create EndEvent': '创建结束事件', + 'Create Task': '创建任务', + 'Create User Task': '创建用户任务', + 'Create Gateway': '创建网关', + 'Create DataObjectReference': '创建数据对象', + 'Create DataStoreReference': '创建数据存储', + 'Create Group': '创建分组', + 'Create Intermediate/Boundary Event': '创建中间/边界事件', + 'Message Start Event': '消息开始事件', + 'Timer Start Event': '定时开始事件', + 'Conditional Start Event': '条件开始事件', + 'Signal Start Event': '信号开始事件', + 'Error Start Event': '错误开始事件', + 'Escalation Start Event': '升级开始事件', + 'Compensation Start Event': '补偿开始事件', + 'Message Start Event (non-interrupting)': '消息开始事件(非中断)', + 'Timer Start Event (non-interrupting)': '定时开始事件(非中断)', + 'Conditional Start Event (non-interrupting)': '条件开始事件(非中断)', + 'Signal Start Event (non-interrupting)': '信号开始事件(非中断)', + 'Escalation Start Event (non-interrupting)': '升级开始事件(非中断)', + 'Message Intermediate Catch Event': '消息中间捕获事件', + 'Message Intermediate Throw Event': '消息中间抛出事件', + 'Timer Intermediate Catch Event': '定时中间捕获事件', + 'Escalation Intermediate Throw Event': '升级中间抛出事件', + 'Conditional Intermediate Catch Event': '条件中间捕获事件', + 'Link Intermediate Catch Event': '链接中间捕获事件', + 'Link Intermediate Throw Event': '链接中间抛出事件', + 'Compensation Intermediate Throw Event': '补偿中间抛出事件', + 'Signal Intermediate Catch Event': '信号中间捕获事件', + 'Signal Intermediate Throw Event': '信号中间抛出事件', + 'Message End Event': '消息结束事件', + 'Escalation End Event': '定时结束事件', + 'Error End Event': '错误结束事件', + 'Cancel End Event': '取消结束事件', + 'Compensation End Event': '补偿结束事件', + 'Signal End Event': '信号结束事件', + 'Terminate End Event': '终止结束事件', + 'Message Boundary Event': '消息边界事件', + 'Message Boundary Event (non-interrupting)': '消息边界事件(非中断)', + 'Timer Boundary Event': '定时边界事件', + 'Timer Boundary Event (non-interrupting)': '定时边界事件(非中断)', + 'Escalation Boundary Event': '升级边界事件', + 'Escalation Boundary Event (non-interrupting)': '升级边界事件(非中断)', + 'Conditional Boundary Event': '条件边界事件', + 'Conditional Boundary Event (non-interrupting)': '条件边界事件(非中断)', + 'Error Boundary Event': '错误边界事件', + 'Cancel Boundary Event': '取消边界事件', + 'Signal Boundary Event': '信号边界事件', + 'Signal Boundary Event (non-interrupting)': '信号边界事件(非中断)', + 'Compensation Boundary Event': '补偿边界事件', + 'Exclusive Gateway': '互斥网关', + 'Parallel Gateway': '并行网关', + 'Inclusive Gateway': '相容网关', + 'Complex Gateway': '复杂网关', + 'Event based Gateway': '事件网关', + Transaction: '转运', + 'Sub Process': '子流程', + 'Event Sub Process': '事件子流程', + 'Collapsed Pool': '折叠池', + 'Expanded Pool': '展开池', + + // Errors + 'no parent for {element} in {parent}': '在{parent}里,{element}没有父类', + 'no shape type specified': '没有指定的形状类型', + 'flow elements must be children of pools/participants': '流元素必须是池/参与者的子类', + 'out of bounds release': 'out of bounds release', + 'more than {count} child lanes': '子道大于{count} ', + 'element required': '元素不能为空', + 'diagram not part of bpmn:Definitions': '流程图不符合bpmn规范', + 'no diagram to display': '没有可展示的流程图', + 'no process or collaboration to display': '没有可展示的流程/协作', + 'element {element} referenced by {referenced}#{property} not yet drawn': '由{referenced}#{property}引用的{element}元素仍未绘制', + 'already rendered {element}': '{element} 已被渲染', + 'failed to import {element}': '导入{element}失败', + // 属性面板的参数 + Id: '编号', + Name: '名称', + General: '常规', + Details: '详情', + 'Message Name': '消息名称', + Message: '消息', + Initiator: '创建者', + 'Asynchronous Continuations': '持续异步', + 'Asynchronous Before': '异步前', + 'Asynchronous After': '异步后', + 'Job Configuration': '工作配置', + Exclusive: '排除', + 'Job Priority': '工作优先级', + 'Retry Time Cycle': '重试时间周期', + Documentation: '文档', + 'Element Documentation': '元素文档', + 'History Configuration': '历史配置', + 'History Time To Live': '历史的生存时间', + Forms: '表单', + 'Form Key': '表单key', + 'Form Fields': '表单字段', + 'Business Key': '业务key', + 'Form Field': '表单字段', + ID: '编号', + Type: '类型', + Label: '名称', + 'Default Value': '默认值', + 'Default Flow': '默认流转路径', + 'Conditional Flow': '条件流转路径', + 'Sequence Flow': '普通流转路径', + Validation: '校验', + 'Add Constraint': '添加约束', + Config: '配置', + Properties: '属性', + 'Add Property': '添加属性', + Value: '值', + Listeners: '监听器', + 'Execution Listener': '执行监听', + 'Event Type': '事件类型', + 'Listener Type': '监听器类型', + 'Java Class': 'Java类', + Expression: '表达式', + 'Must provide a value': '必须提供一个值', + 'Delegate Expression': '代理表达式', + Script: '脚本', + 'Script Format': '脚本格式', + 'Script Type': '脚本类型', + 'Inline Script': '内联脚本', + 'External Script': '外部脚本', + Resource: '资源', + 'Field Injection': '字段注入', + Extensions: '扩展', + 'Input/Output': '输入/输出', + 'Input Parameters': '输入参数', + 'Output Parameters': '输出参数', + Parameters: '参数', + 'Output Parameter': '输出参数', + 'Timer Definition Type': '定时器定义类型', + 'Timer Definition': '定时器定义', + Date: '日期', + Duration: '持续', + Cycle: '循环', + Signal: '信号', + 'Signal Name': '信号名称', + Escalation: '升级', + Error: '错误', + 'Link Name': '链接名称', + Condition: '条件名称', + 'Variable Name': '变量名称', + 'Variable Event': '变量事件', + 'Specify more than one variable change event as a comma separated list.': '多个变量事件以逗号隔开', + 'Wait for Completion': '等待完成', + 'Activity Ref': '活动参考', + 'Version Tag': '版本标签', + Executable: '可执行文件', + 'External Task Configuration': '扩展任务配置', + 'Task Priority': '任务优先级', + External: '外部', + Connector: '连接器', + 'Must configure Connector': '必须配置连接器', + 'Connector Id': '连接器编号', + Implementation: '实现方式', + 'Field Injections': '字段注入', + Fields: '字段', + 'Result Variable': '结果变量', + Topic: '主题', + 'Configure Connector': '配置连接器', + 'Input Parameter': '输入参数', + Assignee: '代理人', + 'Candidate Users': '候选用户', + 'Candidate Groups': '候选组', + 'Due Date': '到期时间', + 'Follow Up Date': '跟踪日期', + Priority: '优先级', + 'The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)': + '跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00', + 'The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)': + '跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00', + Variables: '变量', + 'Candidate Starter Configuration': '候选人起动器配置', + 'Candidate Starter Groups': '候选人起动器组', + 'This maps to the process definition key.': '这映射到流程定义键。', + 'Candidate Starter Users': '候选人起动器的用户', + 'Specify more than one user as a comma separated list.': '指定多个用户作为逗号分隔的列表。', + 'Tasklist Configuration': 'Tasklist配置', + Startable: '启动', + 'Specify more than one group as a comma separated list.': '指定多个组作为逗号分隔的列表。' +}; diff --git a/yanzhu-ui-vue3/src/package/index.js b/yanzhu-ui-vue3/src/package/index.js new file mode 100644 index 00000000..62532f50 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/index.js @@ -0,0 +1,21 @@ +import MyProcessDesigner from './designer'; +import MyProcessPalette from './palette'; +import MyProcessPenal from './penal'; + +const components = [MyProcessDesigner, MyProcessPenal, MyProcessPalette]; + +const install = function(Vue) { + components.forEach(component => { + Vue.component(component.name, component); + }); +}; + +if (typeof window !== 'undefined' && window.Vue) { + install(window.Vue); +} + +export default { + version: '0.0.1', + install, + ...components +}; diff --git a/yanzhu-ui-vue3/src/package/palette/ProcessPalette.vue b/yanzhu-ui-vue3/src/package/palette/ProcessPalette.vue new file mode 100644 index 00000000..5fa14153 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/palette/ProcessPalette.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/yanzhu-ui-vue3/src/package/palette/index.js b/yanzhu-ui-vue3/src/package/palette/index.js new file mode 100644 index 00000000..1e94b22d --- /dev/null +++ b/yanzhu-ui-vue3/src/package/palette/index.js @@ -0,0 +1,7 @@ +import MyPropertiesPalette from './ProcessPalette.vue'; + +MyPropertiesPalette.install = function(Vue) { + Vue.component(MyPropertiesPalette.name, MyPropertiesPalette); +}; + +export default MyPropertiesPalette; diff --git a/yanzhu-ui-vue3/src/package/penal/PropertiesPanel.vue b/yanzhu-ui-vue3/src/package/penal/PropertiesPanel.vue new file mode 100644 index 00000000..42ded620 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/PropertiesPanel.vue @@ -0,0 +1,209 @@ + + diff --git a/yanzhu-ui-vue3/src/package/penal/base/ElementBaseInfo.vue b/yanzhu-ui-vue3/src/package/penal/base/ElementBaseInfo.vue new file mode 100644 index 00000000..a6d1f9a0 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/base/ElementBaseInfo.vue @@ -0,0 +1,80 @@ + + diff --git a/yanzhu-ui-vue3/src/package/penal/flow-condition/FlowCondition.vue b/yanzhu-ui-vue3/src/package/penal/flow-condition/FlowCondition.vue new file mode 100644 index 00000000..d06eeb66 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/flow-condition/FlowCondition.vue @@ -0,0 +1,142 @@ + + + diff --git a/yanzhu-ui-vue3/src/package/penal/form/ElementForm.vue b/yanzhu-ui-vue3/src/package/penal/form/ElementForm.vue new file mode 100644 index 00000000..cdf963bd --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/form/ElementForm.vue @@ -0,0 +1,415 @@ + + + diff --git a/yanzhu-ui-vue3/src/package/penal/index.js b/yanzhu-ui-vue3/src/package/penal/index.js new file mode 100644 index 00000000..873d5556 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/index.js @@ -0,0 +1,7 @@ +import MyPropertiesPanel from './PropertiesPanel.vue'; + +MyPropertiesPanel.install = function(Vue) { + Vue.component(MyPropertiesPanel.name, MyPropertiesPanel); +}; + +export default MyPropertiesPanel; diff --git a/yanzhu-ui-vue3/src/package/penal/listeners/ElementListeners.vue b/yanzhu-ui-vue3/src/package/penal/listeners/ElementListeners.vue new file mode 100644 index 00000000..f0c86ec5 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/listeners/ElementListeners.vue @@ -0,0 +1,303 @@ + + diff --git a/yanzhu-ui-vue3/src/package/penal/listeners/UserTaskListeners.vue b/yanzhu-ui-vue3/src/package/penal/listeners/UserTaskListeners.vue new file mode 100644 index 00000000..2c49e100 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/listeners/UserTaskListeners.vue @@ -0,0 +1,336 @@ + + diff --git a/yanzhu-ui-vue3/src/package/penal/listeners/template.js b/yanzhu-ui-vue3/src/package/penal/listeners/template.js new file mode 100644 index 00000000..2839c1f7 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/listeners/template.js @@ -0,0 +1,178 @@ +export const template = isTaskListener => { + return ` +
+ + + + + + + + +
+ 添加监听器 +
+ + + + + + + + + + + + + + + + + + + + + + + + + + ${ + isTaskListener + ? "" + + "" + + "" + + "" + + "" + + "" + + '' + + '' + + "" + + "" + + '' + : '' +} + + +

+

注入字段: + 添加字段 +

+ + + + + + + + + + +
+ 取 消 + 保 存 +
+ + + + + + + + + + + + + + + + + + + + + + +
+ `; +}; diff --git a/yanzhu-ui-vue3/src/package/penal/listeners/utilSelf.js b/yanzhu-ui-vue3/src/package/penal/listeners/utilSelf.js new file mode 100644 index 00000000..a001b9c8 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/listeners/utilSelf.js @@ -0,0 +1,80 @@ +// 初始化表单数据 +export function initListenerForm(listener) { + let self = { + ...listener + }; + if (listener.script) { + self = { + ...listener, + ...listener.script, + scriptType: listener.script.resource ? "externalScript" : "inlineScript" + }; + } + if (listener.event === "timeout" && listener.eventDefinitions) { + if (listener.eventDefinitions.length) { + let k = ""; + for (let key in listener.eventDefinitions[0]) { + console.log(listener.eventDefinitions, key); + if (key.indexOf("time") !== -1) { + k = key; + self.eventDefinitionType = key.replace("time", "").toLowerCase(); + } + } + console.log(k); + self.eventTimeDefinitions = listener.eventDefinitions[0][k].body; + } + } + return self; +} + +export function initListenerType(listener) { + let listenerType; + if (listener.class) listenerType = "classListener"; + if (listener.expression) listenerType = "expressionListener"; + if (listener.delegateExpression) listenerType = "delegateExpressionListener"; + if (listener.script) listenerType = "scriptListener"; + return { + ...JSON.parse(JSON.stringify(listener)), + ...(listener.script ?? {}), + listenerType: listenerType + }; +} + +// 监听类型 +export const LISTENER_TYPE = [ + { label: "Java 类", value: "classListener", prop: "class", key: "listener-class" }, + { label: "表达式", value: "expressionListener", prop: "expression", key: "listener-expression" }, + { label: "代理表达式", value: "delegateExpressionListener", prop: "delegateExpression", key: "listener-delegate" }, + // { label: "脚本", value: "scriptListener", prop: "scriptFormat", key: "listener-script-format" }, +] +// 脚本类型 +export const SCRIPT_TYPE = [ + { label: "内联脚本", value: "inlineScript" }, + { label: "外部脚本", value: "externalScript" }, +] +// 任务监听器: 事件类型 +export const TASK_EVENT_TYPE = [ + { label: "创建", value: "create" }, + { label: "指派", value: "assignment" }, + { label: "完成", value: "complete" }, + { label: "删除", value: "delete" }, + { label: "更新", value: "update" }, + { label: "超时", value: "timeout" }, +] +// 执行监听器: 事件类型 +export const EXECUTION_EVENT_TYPE = [ + { label: "开始", value: "start" }, + { label: "结束", value: "end" }, +] +// 事件类型: 定时器类型 +export const EVENT_DEFINITION_TYPE = [ + { label: "无", value: "null" }, + { label: "日期", value: "date" }, + { label: "持续时长", value: "duration" }, + { label: "循环", value: "cycle" }, +] +// 字段配置 +export const FIELD_TYPE = [ + { label: "字符串", value: "string" }, + { label: "表达式", value: "expression" }, +] diff --git a/yanzhu-ui-vue3/src/package/penal/multi-instance/ElementMultiInstance.vue b/yanzhu-ui-vue3/src/package/penal/multi-instance/ElementMultiInstance.vue new file mode 100644 index 00000000..e13eaf5f --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/multi-instance/ElementMultiInstance.vue @@ -0,0 +1,331 @@ + + diff --git a/yanzhu-ui-vue3/src/package/penal/other/ElementOtherConfig.vue b/yanzhu-ui-vue3/src/package/penal/other/ElementOtherConfig.vue new file mode 100644 index 00000000..7016a06a --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/other/ElementOtherConfig.vue @@ -0,0 +1,59 @@ + + + diff --git a/yanzhu-ui-vue3/src/package/penal/properties/ElementProperties.vue b/yanzhu-ui-vue3/src/package/penal/properties/ElementProperties.vue new file mode 100644 index 00000000..a8715b8a --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/properties/ElementProperties.vue @@ -0,0 +1,141 @@ + + + diff --git a/yanzhu-ui-vue3/src/package/penal/signal-message/SignalAndMessage.vue b/yanzhu-ui-vue3/src/package/penal/signal-message/SignalAndMessage.vue new file mode 100644 index 00000000..663788e2 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/signal-message/SignalAndMessage.vue @@ -0,0 +1,110 @@ + + diff --git a/yanzhu-ui-vue3/src/package/penal/task/ElementTask.vue b/yanzhu-ui-vue3/src/package/penal/task/ElementTask.vue new file mode 100644 index 00000000..8a826bc5 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/task/ElementTask.vue @@ -0,0 +1,72 @@ + + + diff --git a/yanzhu-ui-vue3/src/package/penal/task/task-components/ReceiveTask.vue b/yanzhu-ui-vue3/src/package/penal/task/task-components/ReceiveTask.vue new file mode 100644 index 00000000..51a1208f --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/task/task-components/ReceiveTask.vue @@ -0,0 +1,103 @@ + + + diff --git a/yanzhu-ui-vue3/src/package/penal/task/task-components/ScriptTask.vue b/yanzhu-ui-vue3/src/package/penal/task/task-components/ScriptTask.vue new file mode 100644 index 00000000..22392199 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/task/task-components/ScriptTask.vue @@ -0,0 +1,85 @@ + + + diff --git a/yanzhu-ui-vue3/src/package/penal/task/task-components/UserTask.vue b/yanzhu-ui-vue3/src/package/penal/task/task-components/UserTask.vue new file mode 100644 index 00000000..0d25fdc7 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/penal/task/task-components/UserTask.vue @@ -0,0 +1,666 @@ + + + + diff --git a/yanzhu-ui-vue3/src/package/theme/element-variables.scss b/yanzhu-ui-vue3/src/package/theme/element-variables.scss new file mode 100644 index 00000000..02f74f09 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/theme/element-variables.scss @@ -0,0 +1,70 @@ +/* 改变主题色变量 */ +$--color-primary: #1890ff; +$--color-danger: #ff4d4f; + +/* 改变 icon 字体路径变量,必需 */ +// $--font-path: '~element-ui/lib/theme-chalk/fonts'; + +// @import "~element-ui/packages/theme-chalk/src/index"; + +.el-table td, +.el-table th { + color: #333; +} +.el-drawer__header { + padding: 16px 16px 8px 16px; + margin: 0; + line-height: 24px; + font-size: 18px; + color: #303133; + box-sizing: border-box; + border-bottom: 1px solid #e8e8e8; +} +div[class^="el-drawer"]:focus, +span:focus { + outline: none; +} +.el-drawer__body { + box-sizing: border-box; + padding: 16px; + width: 100%; + overflow-y: auto; +} + +.el-dialog { + margin-top: 50vh !important; + transform: translateY(-50%); + overflow: hidden; +} +.el-dialog__wrapper { + overflow: hidden; + max-height: 100vh; +} +.el-dialog__header { + padding: 16px 16px 8px 16px; + box-sizing: border-box; + border-bottom: 1px solid #e8e8e8; +} +.el-dialog__body { + padding: 16px; + max-height: 80vh; + box-sizing: border-box; + overflow-y: auto; +} +.el-dialog__footer { + padding: 16px; + box-sizing: border-box; + border-top: 1px solid #e8e8e8; +} +.el-dialog__close { + font-weight: 600; +} +.el-select { + width: 100%; +} +.el-divider:not(.el-divider--horizontal) { + margin: 0 8px ; +} +.el-divider.el-divider--horizontal { + margin: 16px 0; +} diff --git a/yanzhu-ui-vue3/src/package/theme/index.scss b/yanzhu-ui-vue3/src/package/theme/index.scss new file mode 100644 index 00000000..ed00ca38 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/theme/index.scss @@ -0,0 +1,170 @@ +@import "bpmn-js-token-simulation/assets/css/bpmn-js-token-simulation.css"; +@import "bpmn-js-token-simulation/assets/css/font-awesome.min.css"; +@import "bpmn-js-token-simulation/assets/css/normalize.css"; +@import "bpmn-js/dist/assets/diagram-js.css"; +@import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css"; +@import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css"; +@import "./process-designer.scss"; +@import "./process-panel.scss"; + +$success-color: #4eb819; +$primary-color: #409EFF; +$warning-color: #E6A23C; +$danger-color: #F56C6C; +$cancel-color: #909399; + +.process-viewer { + position: relative; + border: 1px solid #EFEFEF; + background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImEiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTTAgMTBoNDBNMTAgMHY0ME0wIDIwaDQwTTIwIDB2NDBNMCAzMGg0ME0zMCAwdjQwIiBmaWxsPSJub25lIiBzdHJva2U9IiNlMGUwZTAiIG9wYWNpdHk9Ii4yIi8+PHBhdGggZD0iTTQwIDBIMHY0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIi8+PC9wYXR0ZXJuPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2EpIi8+PC9zdmc+') repeat!important; + + .success-arrow { + fill: $success-color; + stroke: $success-color; + } + + .success-conditional { + fill: white; + stroke: $success-color; + } + + .fail-arrow { + fill: $warning-color; + stroke: $warning-color; + } + + .fail-conditional { + fill: white; + stroke: $warning-color; + } + + .success.djs-connection { + .djs-visual path { + stroke: $success-color!important; + marker-end: url(#sequenceflow-end-white-success)!important; + } + } + + .success.djs-connection.condition-expression { + .djs-visual path { + marker-start: url(#conditional-flow-marker-white-success)!important; + } + } + + .success.djs-shape { + .djs-visual rect { + stroke: $success-color!important; + fill: $success-color!important; + fill-opacity: 0.15!important; + } + + .djs-visual polygon { + stroke: $success-color!important; + } + + .djs-visual path:nth-child(2) { + stroke: $success-color!important; + fill: $success-color!important; + } + + .djs-visual circle { + stroke: $success-color!important; + fill: $success-color!important; + fill-opacity: 0.15!important; + } + } + + .primary.djs-shape { + .djs-visual rect { + stroke: $primary-color!important; + fill: $primary-color!important; + fill-opacity: 0.15!important; + } + + .djs-visual polygon { + stroke: $primary-color!important; + } + + .djs-visual circle { + stroke: $primary-color!important; + fill: $primary-color!important; + fill-opacity: 0.15!important; + } + } + + .warning.djs-connection { + .djs-visual path { + stroke: $warning-color!important; + marker-end: url(#sequenceflow-end-white-fail)!important; + } + } + + .warning.djs-connection.condition-expression { + .djs-visual path { + marker-start: url(#conditional-flow-marker-white-fail)!important; + } + } + + .warning.djs-shape { + .djs-visual rect { + stroke: $warning-color!important; + fill: $warning-color!important; + fill-opacity: 0.15!important; + } + + .djs-visual polygon { + stroke: $warning-color!important; + } + + .djs-visual path:nth-child(2) { + stroke: $warning-color!important; + fill: $warning-color!important; + } + + .djs-visual circle { + stroke: $warning-color!important; + fill: $warning-color!important; + fill-opacity: 0.15!important; + } + } + + .danger.djs-shape { + .djs-visual rect { + stroke: $danger-color!important; + fill: $danger-color!important; + fill-opacity: 0.15!important; + } + + .djs-visual polygon { + stroke: $danger-color!important; + } + + .djs-visual circle { + stroke: $danger-color!important; + fill: $danger-color!important; + fill-opacity: 0.15!important; + } + } + + .cancel.djs-shape { + .djs-visual rect { + stroke: $cancel-color!important; + fill: $cancel-color!important; + fill-opacity: 0.15!important; + } + + .djs-visual polygon { + stroke: $cancel-color!important; + } + + .djs-visual circle { + stroke: $cancel-color!important; + fill: $cancel-color!important; + fill-opacity: 0.15!important; + } + } +} + +.process-viewer .djs-tooltip-container, .process-viewer .djs-overlay-container, .process-viewer .djs-palette { + display: none; +} diff --git a/yanzhu-ui-vue3/src/package/theme/process-designer.scss b/yanzhu-ui-vue3/src/package/theme/process-designer.scss new file mode 100644 index 00000000..5d8a7b8d --- /dev/null +++ b/yanzhu-ui-vue3/src/package/theme/process-designer.scss @@ -0,0 +1,157 @@ +@import "bpmn-js-token-simulation/assets/css/bpmn-js-token-simulation.css"; +@import "bpmn-js-token-simulation/assets/css/font-awesome.min.css"; +@import "bpmn-js-token-simulation/assets/css/normalize.css"; +@import "diagram-js-minimap/assets/diagram-js-minimap.css"; + +// 边框被 token-simulation 样式覆盖了 +.djs-palette { + background: var(--palette-background-color); + border: solid 1px var(--palette-border-color) !important; + border-radius: 2px; +} + +.my-process-designer { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + box-sizing: border-box; + .my-process-designer__header { + width: 100%; + min-height: 36px; + .el-button { + text-align: center; + } + .el-button-group { + margin: 4px; + } + .el-tooltip__popper { + .el-button { + width: 100%; + text-align: left; + padding-left: 8px; + padding-right: 8px; + } + .el-button:hover { + background: rgba(64, 158, 255, 0.8); + color: #ffffff; + } + } + .align { + position: relative; + i { + &:after { + content: "|"; + position: absolute; + transform: rotate(90deg) translate(200%, -10%); + } + } + } + .align.align-left i { + transform: rotate(90deg); + } + .align.align-right i { + transform: rotate(-90deg); + } + .align.align-top i { + transform: rotate(180deg); + } + .align.align-bottom i { + transform: rotate(0deg); + } + .align.align-center i { + transform: rotate(90deg); + &:after { + transform: rotate(90deg) translate(0, -10%); + } + } + .align.align-middle i { + transform: rotate(0deg); + &:after { + transform: rotate(90deg) translate(0, -10%); + } + } + } + .my-process-designer__container { + display: inline-flex; + width: 100%; + flex: 1; + .my-process-designer__canvas { + flex: 1; + height: 100%; + position: relative; + background: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImEiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTTAgMTBoNDBNMTAgMHY0ME0wIDIwaDQwTTIwIDB2NDBNMCAzMGg0ME0zMCAwdjQwIiBmaWxsPSJub25lIiBzdHJva2U9IiNlMGUwZTAiIG9wYWNpdHk9Ii4yIi8+PHBhdGggZD0iTTQwIDBIMHY0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIi8+PC9wYXR0ZXJuPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2EpIi8+PC9zdmc+") + repeat !important; + div.toggle-mode { + display: none; + } + } + .my-process-designer__property-panel { + height: 100%; + overflow: scroll; + overflow-y: auto; + z-index: 10; + * { + box-sizing: border-box; + } + } + svg { + width: 100%; + height: 100%; + min-height: 100%; + overflow: hidden; + } + } +} + +//侧边栏配置 +.djs-palette.open { + .djs-palette-entries { + div[class^="bpmn-icon-"]:before, + div[class*="bpmn-icon-"]:before { + line-height: unset; + } + div.entry { + position: relative; + } + div.entry:hover { + &::after { + width: max-content; + content: attr(title); + vertical-align: text-bottom; + position: absolute; + right: -10px; + top: 0; + bottom: 0; + overflow: hidden; + transform: translateX(100%); + font-size: 0.5em; + display: inline-block; + text-decoration: inherit; + font-variant: normal; + text-transform: none; + background: #fafafa; + box-shadow: 0 0 6px #eeeeee; + border: 1px solid #cccccc; + box-sizing: border-box; + padding: 0 16px; + border-radius: 4px; + z-index: 100; + } + } + } +} +pre { + margin: 0; + height: 100%; + overflow: hidden; + max-height: calc(80vh - 32px); + overflow-y: auto; +} +.hljs { + word-break: break-word; + white-space: pre-wrap; +} +.hljs * { + font-family: Consolas, Monaco, monospace; +} diff --git a/yanzhu-ui-vue3/src/package/theme/process-panel.scss b/yanzhu-ui-vue3/src/package/theme/process-panel.scss new file mode 100644 index 00000000..8d72afb0 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/theme/process-panel.scss @@ -0,0 +1,129 @@ +.process-panel__container { + box-sizing: border-box; + padding: 0 8px; + border-left: 1px solid #eeeeee; + box-shadow: 0 0 8px #cccccc; + max-height: 100%; + overflow-y: scroll; +} +.panel-tab__title { + font-weight: 600; + padding: 0 8px; + font-size: 1.1em; + line-height: 1.2em; + i { + margin-right: 8px; + font-size: 1.2em; + } +} +.panel-tab__content { + width: 100%; + box-sizing: border-box; + border-top: 1px solid #eeeeee; + padding: 8px 16px; + .panel-tab__content--title { + display: flex; + justify-content: space-between; + padding-bottom: 8px; + span { + flex: 1; + text-align: left; + } + } +} +.element-property { + width: 100%; + display: flex; + align-items: flex-start; + margin: 8px 0; + .element-property__label { + display: block; + width: 90px; + text-align: right; + overflow: hidden; + padding-right: 12px; + line-height: 32px; + font-size: 14px; + box-sizing: border-box; + } + .element-property__value { + flex: 1; + line-height: 32px; + } + .el-form-item { + width: 100%; + margin-bottom: 0; + padding-bottom: 18px; + } +} +.list-property { + flex-direction: column; + .element-listener-item { + width: 100%; + display: inline-grid; + grid-template-columns: 16px auto 32px 32px; + grid-column-gap: 8px; + } + .element-listener-item + .element-listener-item { + margin-top: 8px; + } +} +.listener-drawer { + + .el-drawer__header { + margin: 0PX; + padding: 10PX; + border-bottom: 1px solid #eeeeee; + .el-drawer__title { + font-size: 18px + } + } + + .el-drawer__body { + .el-form-item__label { + font-size: 14PX; + font-weight: 500; + } + .input-with-select .el-input-group__prepend { + background-color: var(--el-fill-color-blank); + padding: 0; + } + } +} +.listener-filed__title { + display: inline-flex; + width: 100%; + justify-content: space-between; + align-items: center; + margin-top: 0; + span { + // width: 200px; + text-align: left; + font-size: 14px; + } + i { + margin-right: 8px; + } +} +.element-drawer__button { + margin-top: 8px; + width: 100%; + display: inline-flex; + justify-content: space-around; +} +.element-drawer__button > .el-button { + width: 100%; +} + +.el-collapse-item__content { + padding-bottom: 0; +} +.el-input.is-disabled .el-input__inner { + color: #999999; +} +.el-form-item.el-form-item--mini { + margin-bottom: 0; + & + .el-form-item { + margin-top: 16px; + } +} diff --git a/yanzhu-ui-vue3/src/package/utils.js b/yanzhu-ui-vue3/src/package/utils.js new file mode 100644 index 00000000..bd61ef69 --- /dev/null +++ b/yanzhu-ui-vue3/src/package/utils.js @@ -0,0 +1,71 @@ +// 创建监听器实例 +export function createListenerObject(options, isTask, prefix) { + const listenerObj = Object.create(null); + listenerObj.event = options.event; + isTask && (listenerObj.id = options.id); // 任务监听器特有的 id 字段 + switch (options.listenerType) { + case 'scriptListener': + listenerObj.script = createScriptObject(options, prefix); + break; + case 'expressionListener': + listenerObj.expression = options.expression; + break; + case 'delegateExpressionListener': + listenerObj.delegateExpression = options.delegateExpression; + break; + default: + listenerObj.class = options.class; + } + // 注入字段 + if (options.fields) { + listenerObj.fields = options.fields.map(field => { + return createFieldObject(field, prefix); + }); + } + // 任务监听器的 定时器 设置 + if (isTask && options.event === 'timeout' && !!options.eventDefinitionType) { + const timeDefinition = window.bpmnInstances.moddle.create('bpmn:FormalExpression', { + body: options.eventTimeDefinitions + }); + const TimerEventDefinition = window.bpmnInstances.moddle.create('bpmn:TimerEventDefinition', { + id: `TimerEventDefinition_${uuid(8)}`, + [`time${options.eventDefinitionType.replace(/^\S/, s => s.toUpperCase())}`]: timeDefinition + }); + listenerObj.eventDefinitions = [TimerEventDefinition]; + } + return window.bpmnInstances.moddle.create(`${prefix}:${isTask ? 'TaskListener' : 'ExecutionListener'}`, listenerObj); +} + +// 创建 监听器的注入字段 实例 +export function createFieldObject(option, prefix) { + const { name, fieldType, string, expression } = option; + const fieldConfig = fieldType === 'string' ? { name, string } : { name, expression }; + return window.bpmnInstances.moddle.create(`${prefix}:Field`, fieldConfig); +} + +// 创建脚本实例 +export function createScriptObject(options, prefix) { + const { scriptType, scriptFormat, value, resource } = options; + const scriptConfig = scriptType === 'inlineScript' ? { scriptFormat, value } : { scriptFormat, resource }; + return window.bpmnInstances.moddle.create(`${prefix}:Script`, scriptConfig); +} + +// 更新元素扩展属性 +export function updateElementExtensions(element, extensionList) { + const extensions = window.bpmnInstances.moddle.create('bpmn:ExtensionElements', { + values: extensionList + }); + window.bpmnInstances.modeling.updateProperties(element, { + extensionElements: extensions + }); +} + +// 创建一个id +export function uuid(length = 8, chars) { + let result = ''; + const charsString = chars || '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + for (let i = length; i > 0; --i) { + result += charsString[Math.floor(Math.random() * charsString.length)]; + } + return result; +} diff --git a/yanzhu-ui-vue3/src/utils/min-dash.js b/yanzhu-ui-vue3/src/utils/min-dash.js new file mode 100644 index 00000000..ab8b4e06 --- /dev/null +++ b/yanzhu-ui-vue3/src/utils/min-dash.js @@ -0,0 +1,694 @@ +/* eslint-disable no-func-assign */ +/** + * Flatten array, one level deep. + * + * @param {Array} arr + * + * @return {Array} + */ +function flatten(arr) { + return Array.prototype.concat.apply([], arr); +} + +var nativeToString = Object.prototype.toString; +var nativeHasOwnProperty = Object.prototype.hasOwnProperty; +function isUndefined(obj) { + return obj === undefined; +} +function isDefined(obj) { + return obj !== undefined; +} +function isNil(obj) { + return obj == null; +} +function isArray(obj) { + return nativeToString.call(obj) === '[object Array]'; +} +function isObject(obj) { + return nativeToString.call(obj) === '[object Object]'; +} +function isNumber(obj) { + return nativeToString.call(obj) === '[object Number]'; +} +function isFunction(obj) { + var tag = nativeToString.call(obj); + return tag === '[object Function]' || tag === '[object AsyncFunction]' || tag === '[object GeneratorFunction]' || tag === '[object AsyncGeneratorFunction]' || tag === '[object Proxy]'; +} +function isString(obj) { + return nativeToString.call(obj) === '[object String]'; +} +/** + * Ensure collection is an array. + * + * @param {Object} obj + */ + +function ensureArray(obj) { + if (isArray(obj)) { + return; + } + + throw new Error('must supply array'); +} +/** + * Return true, if target owns a property with the given key. + * + * @param {Object} target + * @param {String} key + * + * @return {Boolean} + */ + +function has(target, key) { + return nativeHasOwnProperty.call(target, key); +} + +/** + * Find element in collection. + * + * @param {Array|Object} collection + * @param {Function|Object} matcher + * + * @return {Object} + */ + +function find(collection, matcher) { + matcher = toMatcher(matcher); + var match; + forEach(collection, function(val, key) { + if (matcher(val, key)) { + match = val; + return false; + } + }); + return match; +} +/** + * Find element index in collection. + * + * @param {Array|Object} collection + * @param {Function} matcher + * + * @return {Object} + */ + +function findIndex(collection, matcher) { + matcher = toMatcher(matcher); + var idx = isArray(collection) ? -1 : undefined; + forEach(collection, function(val, key) { + if (matcher(val, key)) { + idx = key; + return false; + } + }); + return idx; +} +/** + * Find element in collection. + * + * @param {Array|Object} collection + * @param {Function} matcher + * + * @return {Array} result + */ + +function filter(collection, matcher) { + var result = []; + forEach(collection, function(val, key) { + if (matcher(val, key)) { + result.push(val); + } + }); + return result; +} +/** + * Iterate over collection; returning something + * (non-undefined) will stop iteration. + * + * @param {Array|Object} collection + * @param {Function} iterator + * + * @return {Object} return result that stopped the iteration + */ + +function forEach(collection, iterator) { + var val, result; + + if (isUndefined(collection)) { + return; + } + + var convertKey = isArray(collection) ? toNum : identity; + + for (var key in collection) { + if (has(collection, key)) { + val = collection[key]; + result = iterator(val, convertKey(key)); + + if (result === false) { + return val; + } + } + } +} +/** + * Return collection without element. + * + * @param {Array} arr + * @param {Function} matcher + * + * @return {Array} + */ + +function without(arr, matcher) { + if (isUndefined(arr)) { + return []; + } + + ensureArray(arr); + matcher = toMatcher(matcher); + return arr.filter(function(el, idx) { + return !matcher(el, idx); + }); +} +/** + * Reduce collection, returning a single result. + * + * @param {Object|Array} collection + * @param {Function} iterator + * @param {Any} result + * + * @return {Any} result returned from last iterator + */ + +function reduce(collection, iterator, result) { + forEach(collection, function(value, idx) { + result = iterator(result, value, idx); + }); + return result; +} +/** + * Return true if every element in the collection + * matches the criteria. + * + * @param {Object|Array} collection + * @param {Function} matcher + * + * @return {Boolean} + */ + +function every(collection, matcher) { + return !!reduce(collection, function(matches, val, key) { + return matches && matcher(val, key); + }, true); +} +/** + * Return true if some elements in the collection + * match the criteria. + * + * @param {Object|Array} collection + * @param {Function} matcher + * + * @return {Boolean} + */ + +function some(collection, matcher) { + return !!find(collection, matcher); +} +/** + * Transform a collection into another collection + * by piping each member through the given fn. + * + * @param {Object|Array} collection + * @param {Function} fn + * + * @return {Array} transformed collection + */ + +function map(collection, fn) { + var result = []; + forEach(collection, function(val, key) { + result.push(fn(val, key)); + }); + return result; +} +/** + * Get the collections keys. + * + * @param {Object|Array} collection + * + * @return {Array} + */ + +function keys(collection) { + return collection && Object.keys(collection) || []; +} +/** + * Shorthand for `keys(o).length`. + * + * @param {Object|Array} collection + * + * @return {Number} + */ + +function size(collection) { + return keys(collection).length; +} +/** + * Get the values in the collection. + * + * @param {Object|Array} collection + * + * @return {Array} + */ + +function values(collection) { + return map(collection, function(val) { + return val; + }); +} +/** + * Group collection members by attribute. + * + * @param {Object|Array} collection + * @param {Function} extractor + * + * @return {Object} map with { attrValue => [ a, b, c ] } + */ + +function groupBy(collection, extractor) { + var grouped = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + extractor = toExtractor(extractor); + forEach(collection, function(val) { + var discriminator = extractor(val) || '_'; + var group = grouped[discriminator]; + + if (!group) { + group = grouped[discriminator] = []; + } + + group.push(val); + }); + return grouped; +} +function uniqueBy(extractor) { + extractor = toExtractor(extractor); + var grouped = {}; + + for (var _len = arguments.length, collections = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + collections[_key - 1] = arguments[_key]; + } + + forEach(collections, function(c) { + return groupBy(c, extractor, grouped); + }); + var result = map(grouped, function(val, key) { + return val[0]; + }); + return result; +} +var unionBy = uniqueBy; +/** + * Sort collection by criteria. + * + * @param {Object|Array} collection + * @param {String|Function} extractor + * + * @return {Array} + */ + +function sortBy(collection, extractor) { + extractor = toExtractor(extractor); + var sorted = []; + forEach(collection, function(value, key) { + var disc = extractor(value, key); + var entry = { + d: disc, + v: value + }; + + for (var idx = 0; idx < sorted.length; idx++) { + var d = sorted[idx].d; + + if (disc < d) { + sorted.splice(idx, 0, entry); + return; + } + } // not inserted, append (!) + + sorted.push(entry); + }); + return map(sorted, function(e) { + return e.v; + }); +} +/** + * Create an object pattern matcher. + * + * @example + * + * const matcher = matchPattern({ id: 1 }); + * + * let element = find(elements, matcher); + * + * @param {Object} pattern + * + * @return {Function} matcherFn + */ + +function matchPattern(pattern) { + return function(el) { + return every(pattern, function(val, key) { + return el[key] === val; + }); + }; +} + +function toExtractor(extractor) { + return isFunction(extractor) ? extractor : function(e) { + return e[extractor]; + }; +} + +function toMatcher(matcher) { + return isFunction(matcher) ? matcher : function(e) { + return e === matcher; + }; +} + +function identity(arg) { + return arg; +} + +function toNum(arg) { + return Number(arg); +} + +/** + * Debounce fn, calling it only once if the given time + * elapsed between calls. + * + * Lodash-style the function exposes methods to `#clear` + * and `#flush` to control internal behavior. + * + * @param {Function} fn + * @param {Number} timeout + * + * @return {Function} debounced function + */ +function debounce(fn, timeout) { + var timer; + var lastArgs; + var lastThis; + var lastNow; + + function fire(force) { + var now = Date.now(); + var scheduledDiff = force ? 0 : lastNow + timeout - now; + + if (scheduledDiff > 0) { + return schedule(scheduledDiff); + } + + fn.apply(lastThis, lastArgs); + clear(); + } + + function schedule(timeout) { + timer = setTimeout(fire, timeout); + } + + function clear() { + if (timer) { + clearTimeout(timer); + } + + timer = lastNow = lastArgs = lastThis = undefined; + } + + function flush() { + if (timer) { + fire(true); + } + + clear(); + } + + function callback() { + lastNow = Date.now(); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + lastArgs = args; + lastThis = this; // ensure an execution is scheduled + + if (!timer) { + schedule(timeout); + } + } + + callback.flush = flush; + callback.cancel = clear; + return callback; +} +/** + * Throttle fn, calling at most once + * in the given interval. + * + * @param {Function} fn + * @param {Number} interval + * + * @return {Function} throttled function + */ + +function throttle(fn, interval) { + var throttling = false; + return function() { + if (throttling) { + return; + } + + fn.apply(void 0, arguments); + throttling = true; + setTimeout(function() { + throttling = false; + }, interval); + }; +} +/** + * Bind function against target . + * + * @param {Function} fn + * @param {Object} target + * + * @return {Function} bound function + */ + +function bind(fn, target) { + return fn.bind(target); +} + +function _typeof(obj) { + '@babel/helpers - typeof'; + + if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { + _typeof = function(obj) { + return typeof obj; + }; + } else { + _typeof = function(obj) { + return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; + }; + } + + return _typeof(obj); +} + +function _extends() { + _extends = Object.assign || function(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +/** + * Convenience wrapper for `Object.assign`. + * + * @param {Object} target + * @param {...Object} others + * + * @return {Object} the target + */ + +function assign(target) { + for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + others[_key - 1] = arguments[_key]; + } + + return _extends.apply(void 0, [target].concat(others)); +} +/** + * Sets a nested property of a given object to the specified value. + * + * This mutates the object and returns it. + * + * @param {Object} target The target of the set operation. + * @param {(string|number)[]} path The path to the nested value. + * @param {any} value The value to set. + */ + +function set(target, path, value) { + var currentTarget = target; + forEach(path, function(key, idx) { + if (typeof key !== 'number' && typeof key !== 'string') { + throw new Error('illegal key type: ' + _typeof(key) + '. Key should be of type number or string.'); + } + + if (key === 'constructor') { + throw new Error('illegal key: constructor'); + } + + if (key === '__proto__') { + throw new Error('illegal key: __proto__'); + } + + var nextKey = path[idx + 1]; + var nextTarget = currentTarget[key]; + + if (isDefined(nextKey) && isNil(nextTarget)) { + nextTarget = currentTarget[key] = isNaN(+nextKey) ? {} : []; + } + + if (isUndefined(nextKey)) { + if (isUndefined(value)) { + delete currentTarget[key]; + } else { + currentTarget[key] = value; + } + } else { + currentTarget = nextTarget; + } + }); + return target; +} +/** + * Gets a nested property of a given object. + * + * @param {Object} target The target of the get operation. + * @param {(string|number)[]} path The path to the nested value. + * @param {any} [defaultValue] The value to return if no value exists. + */ + +function get(target, path, defaultValue) { + var currentTarget = target; + forEach(path, function(key) { + // accessing nil property yields + if (isNil(currentTarget)) { + currentTarget = undefined; + return false; + } + + currentTarget = currentTarget[key]; + }); + return isUndefined(currentTarget) ? defaultValue : currentTarget; +} +/** + * Pick given properties from the target object. + * + * @param {Object} target + * @param {Array} properties + * + * @return {Object} target + */ + +function pick(target, properties) { + var result = {}; + var obj = Object(target); + forEach(properties, function(prop) { + if (prop in obj) { + result[prop] = target[prop]; + } + }); + return result; +} +/** + * Pick all target properties, excluding the given ones. + * + * @param {Object} target + * @param {Array} properties + * + * @return {Object} target + */ + +function omit(target, properties) { + var result = {}; + var obj = Object(target); + forEach(obj, function(prop, key) { + if (properties.indexOf(key) === -1) { + result[key] = prop; + } + }); + return result; +} +/** + * Recursively merge `...sources` into given target. + * + * Does support merging objects; does not support merging arrays. + * + * @param {Object} target + * @param {...Object} sources + * + * @return {Object} the target + */ + +function merge(target) { + for (var _len2 = arguments.length, sources = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + sources[_key2 - 1] = arguments[_key2]; + } + + if (!sources.length) { + return target; + } + + forEach(sources, function(source) { + // skip non-obj sources, i.e. null + if (!source || !isObject(source)) { + return; + } + + forEach(source, function(sourceVal, key) { + if (key === '__proto__') { + return; + } + + var targetVal = target[key]; + + if (isObject(sourceVal)) { + if (!isObject(targetVal)) { + // override target[key] with object + targetVal = {}; + } + + target[key] = merge(targetVal, sourceVal); + } else { + target[key] = sourceVal; + } + }); + }); + return target; +} + +export { assign, bind, debounce, ensureArray, every, filter, find, findIndex, flatten, forEach, get, groupBy, has, isArray, isDefined, isFunction, isNil, isNumber, isObject, isString, isUndefined, keys, map, matchPattern, merge, omit, pick, reduce, set, size, some, sortBy, throttle, unionBy, uniqueBy, values, without }; diff --git a/yanzhu-ui-vue3/src/views/flowable/model/index.vue b/yanzhu-ui-vue3/src/views/flowable/model/index.vue index ee082187..d37efe27 100644 --- a/yanzhu-ui-vue3/src/views/flowable/model/index.vue +++ b/yanzhu-ui-vue3/src/views/flowable/model/index.vue @@ -12,20 +12,10 @@ - - - - - - + v-for="item in sys_flow_category" + :key="dict.value" + :label="dict.label" + :value="dict.value"> @@ -63,7 +53,11 @@ - + + +