diff --git a/.vscode/settings.json b/.vscode/settings.json index 1081f23..8ad1100 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -184,5 +184,8 @@ ".eslintrc.cjs": ".eslintignore,.prettierignore,.stylelintignore,.commitlintrc.*,.prettierrc.*,.stylelintrc.*" }, "terminal.integrated.scrollback": 10000, - "nuxt.isNuxtApp": false + "nuxt.isNuxtApp": false, + "[javascript]": { + "editor.defaultFormatter": "vscode.typescript-language-features" + } } diff --git a/package.json b/package.json index e429ec1..eff83b9 100644 --- a/package.json +++ b/package.json @@ -79,17 +79,23 @@ "@zxcvbn-ts/core": "^3.0.4", "ant-design-vue": "^4.0.8", "axios": "^1.6.4", + "bpmn-js": "^17.0.2", + "bpmn-js-properties-panel": "^5.13.0", + "bpmn-js-token-simulation": "^0.33.1", "codemirror": "^5.65.16", "cropperjs": "^1.6.1", "crypto-js": "^4.2.0", "dayjs": "^1.11.10", + "diagram-js": "^14.1.0", "driver.js": "^1.3.1", "echarts": "^5.4.3", "exceljs": "^4.4.0", + "highlight.js": "^11.9.0", "lodash": "^4.17.21", "lodash-es": "^4.17.21", "mars3d": "^3.7.0", "mars3d-cesium": "^1.113.0", + "min-dash": "^4.2.1", "mockjs": "^1.1.0", "nprogress": "^0.2.0", "path-to-regexp": "^6.2.1", @@ -116,7 +122,8 @@ "vxe-table": "^4.5.17", "vxe-table-plugin-export-xlsx": "^3.1.0", "xe-utils": "^3.5.14", - "xlsx": "^0.18.5" + "xlsx": "^0.18.5", + "xml-js": "^1.6.11" }, "devDependencies": { "@commitlint/cli": "^18.4.4", diff --git a/src/api/sys/user.ts b/src/api/sys/user.ts index e012d85..4a6253f 100644 --- a/src/api/sys/user.ts +++ b/src/api/sys/user.ts @@ -3,7 +3,6 @@ * @Date: 2024-01-13 13:04:15 * @LastEditors: Do not edit * @LastEditTime: 2024-02-05 16:06:58 - * @FilePath: \费县天空地大屏正式代码e:\新架构\vue-vben-admin\src\api\sys\user.ts * @Description: */ import { defHttp } from '@/utils/http/axios'; diff --git a/src/components/Bwflow/index.ts b/src/components/Bwflow/index.ts new file mode 100644 index 0000000..4d6ee65 --- /dev/null +++ b/src/components/Bwflow/index.ts @@ -0,0 +1,13 @@ +/* + * @Author: 刘妍 + * @Date: 2024-03-01 15:55:24 + * @LastEditors: Do not edit + * @LastEditTime: 2024-03-02 16:08:00 + * @Description: + */ +import { withInstall } from '@/utils'; + +import bWflowViewer from './src/bWflowViewer.vue' + +export const BWflowViewer = withInstall(bWflowViewer); + diff --git a/src/components/Bwflow/src/bWflowViewer.vue b/src/components/Bwflow/src/bWflowViewer.vue new file mode 100644 index 0000000..7bb1375 --- /dev/null +++ b/src/components/Bwflow/src/bWflowViewer.vue @@ -0,0 +1,130 @@ + + + + + \ No newline at end of file diff --git a/src/components/Bwflow/src/js/camunda.json b/src/components/Bwflow/src/js/camunda.json new file mode 100644 index 0000000..9c98363 --- /dev/null +++ b/src/components/Bwflow/src/js/camunda.json @@ -0,0 +1,1121 @@ +{ + "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" + ] + } + }, + { + "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": "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": "variableEvent", + "isAttr": true, + "type": "String" + } + ] + } + ], + "emumerations": [] +} diff --git a/src/components/Bwflow/src/js/customTranslate.js b/src/components/Bwflow/src/js/customTranslate.js new file mode 100644 index 0000000..e268404 --- /dev/null +++ b/src/components/Bwflow/src/js/customTranslate.js @@ -0,0 +1,14 @@ +import translations from './translations'; + + +export default function customTranslate(template, replacements) { + replacements = replacements || {}; + + // Translate + template = translations[template] || template; + + // Replace + return template.replace(/{([^}]+)}/g, function(_, key) { + return replacements[key] || '{' + key + '}'; + }); +} diff --git a/src/components/Bwflow/src/js/translations.js b/src/components/Bwflow/src/js/translations.js new file mode 100644 index 0000000..70f4d93 --- /dev/null +++ b/src/components/Bwflow/src/js/translations.js @@ -0,0 +1,240 @@ +export default { + // hong + // Labels + 'Activate the global connect tool' : '激活全局连接工具', + 'Append {type}': '追加 {type}', + 'Append EndEvent': '追加 结束事件 ', + 'Append Task':'追加 任务', + 'Append Gateway':'追加 网关', + 'Append Intermediate/Boundary Event':'追加 中间/边界 事件', + '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}', + 'Create Task':'创建任务', + 'Create StartEvent':'创建开始事件', + 'Create EndEvent':'创建结束事件', + 'Create Group':'创建组', + '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 Gateway': '创建网关', + 'GateWay':'网关', + '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':'默认值', + 'Validation':'校验', + 'Add Constraint':'添加约束', + 'Config':'配置', + 'Properties':'属性', + 'Add Property':'添加属性', + 'Value':'值', + 'Add':'添加', + 'Values':'值', + 'Add 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':'候选开始配置', + 'Task Listener':'任务监听器', + 'Candidate Starter Groups':'候选开始组', + 'Candidate Starter Users':'候选开始用户', + 'Tasklist Configuration':'任务列表配置', + 'Startable':'启动', + 'Specify more than one group as a comma separated list.':'指定多个组,用逗号分隔', + 'Specify more than one user as a comma separated list.':'指定多个用户,用逗号分隔', + 'This maps to the process definition key.':'这会映射为流程定义的键', + 'CallActivity Type':'调用活动类型', + 'Condition Type':'条件类型', + 'Create UserTask':'创建用户任务', + 'Create CallActivity':'创建调用活动', + 'Called Element':'调用元素', + 'Create DataObjectReference':'创建数据对象引用', + 'Create DataStoreReference':'创建数据存储引用', + 'Multi Instance':'多实例', + 'Loop Cardinality':'实例数量', + 'Collection':'任务参与人列表', + 'Element Variable':'元素变量', + 'Completion Condition':'完成条件' +}; diff --git a/src/components/Bwflow/src/utils/EventEmitter.d.ts b/src/components/Bwflow/src/utils/EventEmitter.d.ts new file mode 100644 index 0000000..d2101f7 --- /dev/null +++ b/src/components/Bwflow/src/utils/EventEmitter.d.ts @@ -0,0 +1,21 @@ +declare class EventEmitter { + private _events; + private static _instance; + static instance(): EventEmitter; + constructor(); + private _addListener; + addListener(type: string, fn: any, context?: any): this; + on(type: string, fn: any, context?: any): this; + once(type: string, fn: any, context?: any): this; + emit(type: any, ...rest: any[]): boolean; + removeListener(type: any, fn: any): this; + removeAllListeners(type: any): this; + listeners(type: any): Function[]; + listenerCount(type: any): number; + eventNames(): string[]; +} +declare const _default: { + EventEmitter: typeof EventEmitter; + instance: EventEmitter; +}; +export default _default; diff --git a/src/components/Bwflow/src/utils/EventEmitter.js b/src/components/Bwflow/src/utils/EventEmitter.js new file mode 100644 index 0000000..c6bfe1a --- /dev/null +++ b/src/components/Bwflow/src/utils/EventEmitter.js @@ -0,0 +1,141 @@ +import { getRawType, notNull } from './tools'; +const isArray = (obj) => getRawType(obj) === 'array'; +const isNullOrUndefined = (obj) => !notNull(obj); +class EventEmitter { + _events = {}; + static _instance = null; + static instance() { + // 单例模式 + if (!this._instance) { + this._instance = new EventEmitter(); + } + return this._instance; + } + constructor() { + if (this._events === undefined) { + this._events = Object.create(null); + } + } + _addListener(type, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('fn must be a function'); + } + fn.context = context; + fn.once = !!once; + const event = this._events[type]; + // only one, let `this._events[type]` to be a function + if (isNullOrUndefined(event)) { + this._events[type] = fn; + } + else if (typeof event === 'function') { + // already has one function, `this._events[type]` must be a function before + this._events[type] = [event, fn]; + } + else if (isArray(event)) { + // already has more than one function, just push + this._events[type].push(fn); + } + return this; + } + addListener(type, fn, context) { + return this._addListener(type, fn, context); + } + on(type, fn, context) { + return this.addListener(type, fn, context); + } + once(type, fn, context) { + return this._addListener(type, fn, context, true); + } + emit(type, ...rest) { + if (isNullOrUndefined(type)) { + throw new Error('emit must receive at lease one argument'); + } + const event = this._events[type]; + if (isNullOrUndefined(event)) + return false; + if (typeof event === 'function') { + event.call(event.context || null, ...rest); + if (event.once) { + this.removeListener(type, event); + } + } + else if (isArray(event)) { + event.map((e) => { + e.call(e.context || null, ...rest); + if (e.once) { + this.removeListener(type, e); + } + }); + } + return true; + } + removeListener(type, fn) { + if (isNullOrUndefined(this._events)) + return this; + // if type is undefined or null, nothing to do, just return this + if (isNullOrUndefined(type)) + return this; + if (typeof fn !== 'function') { + throw new Error('fn must be a function'); + } + const events = this._events[type]; + if (typeof events === 'function') { + events === fn && delete this._events[type]; + } + else { + const findIndex = events.findIndex((e) => e === fn); + if (findIndex === -1) + return this; + // match the first one, shift faster than splice + if (findIndex === 0) { + events.shift(); + } + else { + events.splice(findIndex, 1); + } + // just left one listener, change Array to Function + if (events.length === 1) { + // @ts-ignore + this._events[type] = events[0]; + } + } + return this; + } + removeAllListeners(type) { + if (isNullOrUndefined(this._events)) + return this; + // if not provide type, remove all + if (isNullOrUndefined(type)) + this._events = Object.create(null); + const events = this._events[type]; + if (!isNullOrUndefined(events)) { + // check if `type` is the last one + if (Object.keys(this._events).length === 1) { + this._events = Object.create(null); + } + else { + delete this._events[type]; + } + } + return this; + } + listeners(type) { + if (isNullOrUndefined(this._events)) + return []; + const events = this._events[type]; + // use `map` because we need to return a new array + return isNullOrUndefined(events) ? [] : typeof events === 'function' ? [events] : events.map((o) => o); + } + listenerCount(type) { + if (isNullOrUndefined(this._events)) + return 0; + const events = this._events[type]; + return isNullOrUndefined(events) ? 0 : typeof events === 'function' ? 1 : events.length; + } + eventNames() { + if (isNullOrUndefined(this._events)) + return []; + return Object.keys(this._events); + } +} +export default { EventEmitter, instance: EventEmitter.instance() }; diff --git a/src/components/Bwflow/src/utils/EventEmitter.ts b/src/components/Bwflow/src/utils/EventEmitter.ts new file mode 100644 index 0000000..f5b1097 --- /dev/null +++ b/src/components/Bwflow/src/utils/EventEmitter.ts @@ -0,0 +1,163 @@ +import { getRawType, notNull } from './tools' + +const isArray = (obj) => getRawType(obj) === 'array' +const isNullOrUndefined = (obj) => !notNull(obj) + +class EventEmitter { + private _events: { [key: string]: Function[] } = {} + private static _instance: null | EventEmitter = null + + static instance(): EventEmitter { + // 单例模式 + if (!this._instance) { + this._instance = new EventEmitter() + } + return this._instance + } + + constructor() { + if (this._events === undefined) { + this._events = Object.create(null) + } + } + + private _addListener(type: string, fn: any, context?: any, once?) { + if (typeof fn !== 'function') { + throw new TypeError('fn must be a function') + } + + fn.context = context + fn.once = !!once + + const event = this._events[type] + // only one, let `this._events[type]` to be a function + if (isNullOrUndefined(event)) { + this._events[type] = fn + } else if (typeof event === 'function') { + // already has one function, `this._events[type]` must be a function before + this._events[type] = [event, fn] + } else if (isArray(event)) { + // already has more than one function, just push + this._events[type].push(fn) + } + + return this + } + + addListener(type: string, fn: any, context?: any) { + return this._addListener(type, fn, context) + } + + on(type: string, fn: any, context?: any) { + return this.addListener(type, fn, context) + } + + once(type: string, fn: any, context?: any) { + return this._addListener(type, fn, context, true) + } + + emit(type, ...rest) { + if (isNullOrUndefined(type)) { + throw new Error('emit must receive at lease one argument') + } + + const event: any = this._events[type] + + if (isNullOrUndefined(event)) return false + + if (typeof event === 'function') { + event.call(event.context || null, ...rest) + if (event.once) { + this.removeListener(type, event) + } + } else if (isArray(event)) { + event.map((e) => { + e.call(e.context || null, ...rest) + if (e.once) { + this.removeListener(type, e) + } + }) + } + + return true + } + + removeListener(type, fn) { + if (isNullOrUndefined(this._events)) return this + + // if type is undefined or null, nothing to do, just return this + if (isNullOrUndefined(type)) return this + + if (typeof fn !== 'function') { + throw new Error('fn must be a function') + } + + const events = this._events[type] + + if (typeof events === 'function') { + events === fn && delete this._events[type] + } else { + const findIndex = events.findIndex((e) => e === fn) + + if (findIndex === -1) return this + + // match the first one, shift faster than splice + if (findIndex === 0) { + events.shift() + } else { + events.splice(findIndex, 1) + } + + // just left one listener, change Array to Function + if (events.length === 1) { + // @ts-ignore + this._events[type] = events[0] + } + } + + return this + } + + removeAllListeners(type) { + if (isNullOrUndefined(this._events)) return this + + // if not provide type, remove all + if (isNullOrUndefined(type)) this._events = Object.create(null) + + const events = this._events[type] + if (!isNullOrUndefined(events)) { + // check if `type` is the last one + if (Object.keys(this._events).length === 1) { + this._events = Object.create(null) + } else { + delete this._events[type] + } + } + + return this + } + + listeners(type) { + if (isNullOrUndefined(this._events)) return [] + + const events = this._events[type] + // use `map` because we need to return a new array + return isNullOrUndefined(events) ? [] : typeof events === 'function' ? [events] : events.map((o) => o) + } + + listenerCount(type) { + if (isNullOrUndefined(this._events)) return 0 + + const events = this._events[type] + + return isNullOrUndefined(events) ? 0 : typeof events === 'function' ? 1 : events.length + } + + eventNames() { + if (isNullOrUndefined(this._events)) return [] + + return Object.keys(this._events) + } +} + +export default { EventEmitter, instance: EventEmitter.instance() } diff --git a/src/components/Bwflow/src/utils/emptyXML.d.ts b/src/components/Bwflow/src/utils/emptyXML.d.ts new file mode 100644 index 0000000..1a6b80b --- /dev/null +++ b/src/components/Bwflow/src/utils/emptyXML.d.ts @@ -0,0 +1,2 @@ +declare const _default: (key: string, name: string, type?: string | undefined) => string; +export default _default; diff --git a/src/components/Bwflow/src/utils/emptyXML.js b/src/components/Bwflow/src/utils/emptyXML.js new file mode 100644 index 0000000..3dee2d4 --- /dev/null +++ b/src/components/Bwflow/src/utils/emptyXML.js @@ -0,0 +1,25 @@ +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/src/components/Bwflow/src/utils/emptyXML.ts b/src/components/Bwflow/src/utils/emptyXML.ts new file mode 100644 index 0000000..847ea3c --- /dev/null +++ b/src/components/Bwflow/src/utils/emptyXML.ts @@ -0,0 +1,24 @@ +export default (key: string, name: string, type?: string): string => { + 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/src/components/Bwflow/src/utils/storage.d.ts b/src/components/Bwflow/src/utils/storage.d.ts new file mode 100644 index 0000000..a7dd4af --- /dev/null +++ b/src/components/Bwflow/src/utils/storage.d.ts @@ -0,0 +1,7 @@ +declare function setLocal(key: string, value: any): void; +declare function getLocal(key: string): any; +declare const _default: { + setLocal: typeof setLocal; + getLocal: typeof getLocal; +}; +export default _default; diff --git a/src/components/Bwflow/src/utils/storage.js b/src/components/Bwflow/src/utils/storage.js new file mode 100644 index 0000000..26a64be --- /dev/null +++ b/src/components/Bwflow/src/utils/storage.js @@ -0,0 +1,10 @@ +function setLocal(key, value) { + localStorage.setItem(key, JSON.stringify(value)); +} +function getLocal(key) { + return JSON.parse(localStorage.getItem(key) || ''); +} +export default { + setLocal, + getLocal +}; diff --git a/src/components/Bwflow/src/utils/storage.ts b/src/components/Bwflow/src/utils/storage.ts new file mode 100644 index 0000000..508af19 --- /dev/null +++ b/src/components/Bwflow/src/utils/storage.ts @@ -0,0 +1,12 @@ +function setLocal(key: string, value: any) { + localStorage.setItem(key, JSON.stringify(value)) +} + +function getLocal(key: string) { + return JSON.parse(localStorage.getItem(key) || '') +} + +export default { + setLocal, + getLocal +} diff --git a/src/components/Bwflow/src/utils/tools.d.ts b/src/components/Bwflow/src/utils/tools.d.ts new file mode 100644 index 0000000..d31839c --- /dev/null +++ b/src/components/Bwflow/src/utils/tools.d.ts @@ -0,0 +1,14 @@ +export declare function noop(): void; +/** + * 校验非空 + * @param {*} val + * @return boolean + */ +export declare function notEmpty(val: any): any; +export declare function notNull(val: any): boolean; +/** + * 返回数据原始类型 + * @param value + * @return { 'string' | 'array' | 'boolean' | 'number' | 'object' | 'function' } type + */ +export declare function getRawType(value: any): string; diff --git a/src/components/Bwflow/src/utils/tools.js b/src/components/Bwflow/src/utils/tools.js new file mode 100644 index 0000000..1b9eb29 --- /dev/null +++ b/src/components/Bwflow/src/utils/tools.js @@ -0,0 +1,30 @@ +/* 空函数 */ +export function noop() { } +/** + * 校验非空 + * @param {*} val + * @return boolean + */ +export function notEmpty(val) { + if (!notNull(val)) { + return false; + } + if (getRawType(val) === 'array') { + return val.length; + } + if (getRawType(val) === 'object') { + return Reflect.ownKeys(val).length; + } + return true; +} +export function notNull(val) { + return val !== undefined && val !== null; +} +/** + * 返回数据原始类型 + * @param value + * @return { 'string' | 'array' | 'boolean' | 'number' | 'object' | 'function' } type + */ +export function getRawType(value) { + return Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); +} diff --git a/src/components/Bwflow/src/utils/tools.ts b/src/components/Bwflow/src/utils/tools.ts new file mode 100644 index 0000000..0004ee8 --- /dev/null +++ b/src/components/Bwflow/src/utils/tools.ts @@ -0,0 +1,32 @@ +/* 空函数 */ +export function noop() {} + +/** + * 校验非空 + * @param {*} val + * @return boolean + */ +export function notEmpty(val) { + if (!notNull(val)) { + return false + } + if (getRawType(val) === 'array') { + return val.length + } + if (getRawType(val) === 'object') { + return Reflect.ownKeys(val).length + } + return true +} +export function notNull(val) { + return val !== undefined && val !== null +} + +/** + * 返回数据原始类型 + * @param value + * @return { 'string' | 'array' | 'boolean' | 'number' | 'object' | 'function' } type + */ +export function getRawType(value) { + return Object.prototype.toString.call(value).slice(8, -1).toLowerCase() +} diff --git a/src/components/PermissionBtn/index.vue b/src/components/PermissionBtn/index.vue index d6ccc57..257c0a6 100644 --- a/src/components/PermissionBtn/index.vue +++ b/src/components/PermissionBtn/index.vue @@ -3,7 +3,6 @@ * @Date: 2024-01-25 10:05:50 * @LastEditors: Do not edit * @LastEditTime: 2024-01-26 09:52:37 - * @FilePath: \费县天空地大屏正式代码e:\新架构\vue-vben-admin\src\components\PermissionBtn\index.vue * @Description: -->