Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/dev-yunai

# Conflicts:
#	yudao-ui-admin-vue3/pnpm-lock.yaml
This commit is contained in:
YunaiV 2023-02-07 22:56:49 +08:00
commit 0d5daa69fb
64 changed files with 3276 additions and 1699 deletions

View File

@ -262,11 +262,11 @@ ps核心功能已经实现正在对接微信小程序中...
| 框架 | 说明 | 版本 |
|----------------------------------------------------------------------|:------------:|:------:|
| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.45 |
| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.0.4 |
| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.28 |
| [TypeScript](https://www.typescriptlang.org/docs/) | TypeScript | 4.9.4 |
| [pinia](https://pinia.vuejs.org/) | vuex5 | 2.0.28 |
| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.47 |
| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.1.1 |
| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.29 |
| [TypeScript](https://www.typescriptlang.org/docs/) | TypeScript | 4.9.5 |
| [pinia](https://pinia.vuejs.org/) | vuex5 | 2.0.30 |
| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 |
| [vxe-table](https://vxetable.cn/) | vue最强表单 | 4.3.9 |

View File

@ -28,12 +28,12 @@
| 框架 | 说明 | 版本 |
| --- | --- |--------|
| [Vue](https://staging-cn.vuejs.org/) | vue 框架 | 3.2.45 |
| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.0.4 |
| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.28 |
| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 4.9.4 |
| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.28 |
| [vueuse](https://vueuse.org/) | 常用工具集 | 9.10.0 |
| [Vue](https://staging-cn.vuejs.org/) | vue 框架 | 3.2.47 |
| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.1.1 |
| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.29 |
| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 4.9.5 |
| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.30 |
| [vueuse](https://vueuse.org/) | 常用工具集 | 9.12.0 |
| [vxe-table](https://vxetable.cn/) | vue 最强表单 | 4.3.9 |
| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 |
| [vue-router](https://router.vuejs.org/) | vue 路由 | 4.1.6 |

View File

@ -14,6 +14,7 @@ const include = [
'vue-i18n',
'xe-utils',
'crypto-js',
'cropperjs',
'lodash-es',
'vxe-table',
'nprogress',

View File

@ -1,6 +1,6 @@
{
"name": "yudao-ui-admin-vue3",
"version": "1.7.0-snapshot.1925",
"version": "1.7.0-snapshot.1921",
"description": "基于vue3、vite4、element-plus、typesScript",
"author": "xingyu",
"private": false,
@ -27,12 +27,12 @@
"@form-create/designer": "^3.1.0",
"@form-create/element-ui": "^3.1.17",
"@iconify/iconify": "^3.1.0",
"@vueuse/core": "^9.11.1",
"@vueuse/core": "^9.12.0",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.10",
"@zxcvbn-ts/core": "^2.2.0",
"animate.css": "^4.1.1",
"axios": "^1.2.5",
"axios": "^1.3.2",
"bpmn-js-token-simulation": "^0.10.0",
"camunda-bpmn-moddle": "^7.0.1",
"cropperjs": "^1.5.13",
@ -41,7 +41,7 @@
"diagram-js": "^11.6.0",
"echarts": "^5.4.1",
"echarts-wordcloud": "^2.1.0",
"element-plus": "2.2.28",
"element-plus": "2.2.29",
"fast-xml-parser": "^4.0.13",
"highlight.js": "^11.7.0",
"intro.js": "^6.0.0",
@ -50,16 +50,15 @@
"min-dash": "^4.0.0",
"mitt": "^3.0.0",
"nprogress": "^0.2.0",
"pinia": "^2.0.29",
"pinia": "^2.0.30",
"qrcode": "^1.5.1",
"qs": "^6.11.0",
"steady-xml": "^0.1.0",
"url": "^0.11.0",
"vue": "3.2.45",
"vue": "3.2.47",
"vue-i18n": "9.2.2",
"vue-router": "^4.1.6",
"vue-types": "^5.0.2",
"vue3-treeselect": "^0.1.10",
"vuedraggable": "^4.1.0",
"vxe-table": "^4.3.9",
"web-storage-cache": "^1.1.1",
@ -69,27 +68,27 @@
"devDependencies": {
"@commitlint/cli": "^17.4.2",
"@commitlint/config-conventional": "^17.4.2",
"@iconify/json": "^2.2.13",
"@iconify/json": "^2.2.16",
"@intlify/unplugin-vue-i18n": "^0.8.1",
"@purge-icons/generated": "^0.9.0",
"@types/intro.js": "^5.1.0",
"@types/lodash-es": "^4.17.6",
"@types/node": "^18.11.18",
"@types/node": "^18.11.19",
"@types/nprogress": "^0.2.0",
"@types/qrcode": "^1.5.0",
"@types/qs": "^6.9.7",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
"@vitejs/plugin-legacy": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^5.50.0",
"@typescript-eslint/parser": "^5.50.0",
"@vitejs/plugin-legacy": "^4.0.1",
"@vitejs/plugin-vue": "^4.0.0",
"@vitejs/plugin-vue-jsx": "^3.0.0",
"autoprefixer": "^10.4.13",
"bpmn-js": "^8.9.0",
"bpmn-js-properties-panel": "^0.46.0",
"consola": "^2.15.3",
"eslint": "^8.32.0",
"eslint": "^8.33.0",
"eslint-config-prettier": "^8.6.0",
"eslint-define-config": "^1.14.0",
"eslint-define-config": "^1.15.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.9.0",
"lint-staged": "^13.1.0",
@ -98,20 +97,20 @@
"postcss-scss": "^4.0.6",
"prettier": "^2.8.3",
"rimraf": "^4.1.2",
"rollup": "^3.11.0",
"sass": "^1.57.1",
"rollup": "^3.14.0",
"sass": "^1.58.0",
"stylelint": "^14.16.1",
"stylelint-config-html": "^1.1.0",
"stylelint-config-prettier": "^9.0.4",
"stylelint-config-recommended": "^9.0.0",
"stylelint-config-standard": "^29.0.0",
"stylelint-order": "^6.0.1",
"terser": "^5.16.1",
"typescript": "4.9.4",
"unplugin-auto-import": "^0.12.2",
"unplugin-element-plus": "^0.4.1",
"unplugin-vue-components": "^0.22.12",
"vite": "4.0.4",
"terser": "^5.16.3",
"typescript": "4.9.5",
"unplugin-auto-import": "^0.13.0",
"unplugin-element-plus": "^0.6.0",
"unplugin-vue-components": "^0.23.0",
"vite": "4.1.1",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-ejs": "^1.6.4",
"vite-plugin-eslint": "^1.8.1",
@ -135,4 +134,4 @@
"url": "https://gitee.com/zhijiantianya/ruoyi-vue-pro/issues"
},
"homepage": "https://gitee.com/zhijiantianya/ruoyi-vue-pro"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -119,6 +119,7 @@ import { dataURLtoBlob } from '@/utils/filt'
import { useI18n } from 'vue-i18n'
import type { CropendResult, Cropper } from './types'
import { propTypes } from '@/utils/propTypes'
import { CropperImage } from '@/components/Cropper'
const props = defineProps({
srcValue: propTypes.string.def(''),

View File

@ -209,8 +209,7 @@
// import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css'
// import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css'
// import 'bpmn-js-properties-panel/dist/assets/bpmn-js-properties-panel.css' //
import { ElTooltip, ElButtonGroup, ElButton, ElMessage, ElMessageBox } from 'element-plus'
import { computed, onBeforeMount, onBeforeUnmount, onMounted, provide, ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import BpmnModeler from 'bpmn-js/lib/Modeler'
import DefaultEmptyXML from './plugins/defaultEmpty'
//
@ -262,9 +261,17 @@ const props = defineProps({
processId: String, // key
processName: String, // name
formId: Number, // form
translations: Object, //
translations: {
//
type: Object,
default: () => {}
},
additionalModel: [Object, Array], // model
moddleExtension: Object, // moddle
moddleExtension: {
// moddle
type: Object,
default: () => {}
},
onlyCustomizeAddi: {
type: Boolean,
default: false
@ -292,18 +299,18 @@ const props = defineProps({
headerButtonSize: {
type: String,
default: 'small',
validator: (value) => ['default', 'medium', 'small', 'mini'].indexOf(value) !== -1
validator: (value: string) => ['default', 'medium', 'small', 'mini'].indexOf(value) !== -1
},
headerButtonType: {
type: String,
default: 'primary',
validator: (value) =>
validator: (value: string) =>
['default', 'primary', 'success', 'warning', 'danger', 'info'].indexOf(value) !== -1
}
})
provide('configGlobal', props)
let bpmnModeler = null
let bpmnModeler: any = null
const defaultZoom = ref(1)
const previewModelVisible = ref(false)
const simulationStatus = ref(false)
@ -313,7 +320,7 @@ const recoverable = ref(false)
const revocable = ref(false)
const additionalModules = computed(() => {
console.log(props.additionalModel, 'additionalModel')
const Modules = []
const Modules: any[] = []
//
if (props.onlyCustomizeAddi) {
if (Object.prototype.toString.call(props.additionalModel) == '[object Array]') {
@ -361,7 +368,7 @@ const moddleExtensions = computed(() => {
console.log(props.onlyCustomizeModdle, 'props.onlyCustomizeModdle')
console.log(props.moddleExtension, 'props.moddleExtension')
console.log(props.prefix, 'props.prefix')
const Extensions = {}
const Extensions: any = {}
// 使
if (props.onlyCustomizeModdle) {
return props.moddleExtension || null
@ -432,7 +439,7 @@ const initModelListeners = () => {
const EventBus = bpmnModeler.get('eventBus')
console.log(EventBus, 'EventBus')
// , . - ,
props.events.forEach((event) => {
props.events.forEach((event: any) => {
EventBus.on(event, function (eventObj) {
let eventName = event.replace(/\./g, '-')
// eventName.name = eventName
@ -452,7 +459,7 @@ const initModelListeners = () => {
emit('commandStack-changed', event)
emit('input', xml)
emit('change', xml)
} catch (e) {
} catch (e: any) {
console.error(`[Process Designer Warn]: ${e.message || e}`)
}
})
@ -478,13 +485,13 @@ const createNewDiagram = async (xml) => {
if (warnings && warnings.length) {
warnings.forEach((warn) => console.warn(warn))
}
} catch (e) {
console.error(`[Process Designer Warn]: ${e?.message || e}`)
} catch (e: any) {
console.error(`[Process Designer Warn]: ${e.message || e}`)
}
}
//
const downloadProcess = async (type, name) => {
const downloadProcess = async (type) => {
try {
//
if (type === 'xml' || type === 'bpmn') {
@ -493,7 +500,7 @@ const downloadProcess = async (type, name) => {
if (err) {
console.error(`[Process Designer Warn ]: ${err.message || err}`)
}
let { href, filename } = setEncoded(type.toUpperCase(), name, xml)
let { href, filename } = setEncoded(type.toUpperCase(), xml)
downloadFunc(href, filename)
} else {
const { err, svg } = await bpmnModeler.saveSVG()
@ -501,10 +508,10 @@ const downloadProcess = async (type, name) => {
if (err) {
return console.error(err)
}
let { href, filename } = setEncoded('SVG', name, svg)
let { href, filename } = setEncoded('SVG', svg)
downloadFunc(href, filename)
}
} catch (e) {
} catch (e: any) {
console.error(`[Process Designer Warn ]: ${e.message || e}`)
}
//
@ -520,7 +527,8 @@ const downloadProcess = async (type, name) => {
}
//
const setEncoded = (type, filename = 'diagram', data) => {
const setEncoded = (type, data) => {
const filename = 'diagram'
const encodedData = encodeURIComponent(data)
return {
filename: `${filename}.${type}`,
@ -643,7 +651,7 @@ const previewProcessJson = () => {
// const xmlContent = builder
// console.log(xmlContent, 'xmlContent')
// console.log(xml2js, 'convertconvertconvert')
previewResult.value = rootNodes.parent.toJSON()
previewResult.value = rootNodes.parent?.toJSON() as unknown as string
// previewResult.value = jObj
// previewResult.value = convert.xml2json(xml, {explicitArray : false},{ spaces: 2 })
previewType.value = 'json'

View File

@ -9,12 +9,12 @@
<script setup lang="ts" name="MyProcessViewer">
import BpmnViewer from 'bpmn-js/lib/Viewer'
import DefaultEmptyXML from './plugins/defaultEmpty'
import { onMounted, onBeforeUnmount, provide, ref, watch, toRaw } from 'vue'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
const props = defineProps({
value: {
// BPMN XML
type: String
type: String,
default: ''
},
prefix: {
// 使
@ -28,7 +28,8 @@ const props = defineProps({
},
processInstanceData: {
//
type: Object
type: Object,
default: () => {}
},
taskData: {
// UserTask
@ -44,13 +45,13 @@ const emit = defineEmits(['destroy'])
let bpmnModeler
const xml = ref('')
const activityLists = ref([])
const processInstance = ref(undefined)
const taskList = ref([])
const activityLists = ref<any[]>([])
const processInstance = ref<any>(undefined)
const taskList = ref<any[]>([])
const bpmnCanvas = ref()
// const element = ref()
const elementOverlayIds = ref(null)
const overlays = ref(null)
const elementOverlayIds = ref<any>(null)
const overlays = ref<any>(null)
const initBpmnModeler = () => {
if (bpmnModeler) return
@ -90,18 +91,18 @@ const highlightDiagram = async () => {
// https://gitee.com/tony2y/RuoYi-flowable/blob/master/ruoyi-ui/src/components/Process/index.vue#L222
//
let canvas = bpmnModeler.get('canvas')
let todoActivity = activityList.find((m) => !m.endTime) //
let endActivity = activityList[activityList.length - 1] //
let todoActivity: any = activityList.find((m: any) => !m.endTime) //
let endActivity: any = activityList[activityList.length - 1] //
// debugger
bpmnModeler.getDefinitions().rootElements[0].flowElements?.forEach((n) => {
let activity = activityList.find((m) => m.key === n.id) //
bpmnModeler.getDefinitions().rootElements[0].flowElements?.forEach((n: any) => {
let activity: any = activityList.find((m: any) => m.key === n.id) //
if (!activity) {
return
}
if (n.$type === 'bpmn:UserTask') {
//
//
const task = taskList.value.find((m) => m.id === activity.taskId) // taskId
const task: any = taskList.value.find((m: any) => m.id === activity.taskId) // taskId
if (!task) {
return
}
@ -114,9 +115,9 @@ const highlightDiagram = async () => {
}
// outgoing 线
const outgoing = getActivityOutgoing(activity)
outgoing?.forEach((nn) => {
outgoing?.forEach((nn: any) => {
// debugger
let targetActivity = activityList.find((m) => m.key === nn.targetRef.id)
let targetActivity: any = activityList.find((m: any) => m.key === nn.targetRef.id)
// bpmn:SequenceFlow线
if (targetActivity) {
canvas.addMarker(nn.id, targetActivity.endTime ? 'highlight' : 'highlight-todo')
@ -141,10 +142,10 @@ const highlightDiagram = async () => {
// bpmn:ExclusiveGateway
canvas.addMarker(n.id, getActivityHighlightCss(activity))
// 线
let matchNN = undefined
let matchActivity = undefined
n.outgoing?.forEach((nn) => {
let targetActivity = activityList.find((m) => m.key === nn.targetRef.id)
let matchNN: any = undefined
let matchActivity: any = undefined
n.outgoing?.forEach((nn: any) => {
let targetActivity = activityList.find((m: any) => m.key === nn.targetRef.id)
if (!targetActivity) {
return
}
@ -165,9 +166,9 @@ const highlightDiagram = async () => {
//
// bpmn:ParallelGateway
canvas.addMarker(n.id, getActivityHighlightCss(activity))
n.outgoing?.forEach((nn) => {
n.outgoing?.forEach((nn: any) => {
// 线
const targetActivity = activityList.find((m) => m.key === nn.targetRef.id)
const targetActivity = activityList.find((m: any) => m.key === nn.targetRef.id)
if (targetActivity) {
canvas.addMarker(nn.id, getActivityHighlightCss(targetActivity)) // bpmn:SequenceFlow线
// ... ... bpm:UserTask bpm:UserTask
@ -179,7 +180,7 @@ const highlightDiagram = async () => {
n.outgoing?.forEach((nn) => {
// outgoing bpmn:SequenceFlow线
// 线
let targetActivity = activityList.find((m) => m.key === nn.targetRef.id)
let targetActivity = activityList.find((m: any) => m.key === nn.targetRef.id)
if (targetActivity) {
canvas.addMarker(nn.id, 'highlight') // bpmn:SequenceFlow线
canvas.addMarker(n.id, 'highlight') // bpmn:StartEvent
@ -235,8 +236,8 @@ const getActivityOutgoing = (activity) => {
}
// bpmn:SequenceFlowbpmn-js UserTask outgoing
const flowElements = bpmnModeler.getDefinitions().rootElements[0].flowElements
const outgoing = []
flowElements.forEach((item) => {
const outgoing: any[] = []
flowElements.forEach((item: any) => {
if (item.$type !== 'bpmn:SequenceFlow') {
return
}

View File

@ -1,19 +1,19 @@
import { assign, forEach, isArray } from 'min-dash'
import { is } from "bpmn-js/lib/util/ModelUtil"
import { is } from 'bpmn-js/lib/util/ModelUtil'
import { isExpanded, isEventSubProcess } from "bpmn-js/lib/util/DiUtil"
import { isExpanded, isEventSubProcess } from 'bpmn-js/lib/util/DiUtil'
import { isAny } from "bpmn-js/lib/features/modeling/util/ModelingUtil"
import { isAny } from 'bpmn-js/lib/features/modeling/util/ModelingUtil'
import { getChildLanes } from "bpmn-js/lib/features/modeling/util/LaneUtil"
import { getChildLanes } from 'bpmn-js/lib/features/modeling/util/LaneUtil'
import { hasPrimaryModifier } from "diagram-js/lib/util/Mouse"
import { hasPrimaryModifier } from 'diagram-js/lib/util/Mouse'
/**
* A provider for BPMN 2.0 elements context pad
*/
export default function ContextPadProvider (
export default function ContextPadProvider(
config,
injector,
eventBus,
@ -25,8 +25,7 @@ export default function ContextPadProvider (
popupMenu,
canvas,
rules,
translate,
elementRegistry
translate
) {
config = config || {}
@ -45,10 +44,10 @@ export default function ContextPadProvider (
this._translate = translate
if (config.autoPlace !== false) {
this._autoPlace = injector.get("autoPlace", false)
this._autoPlace = injector.get('autoPlace', false)
}
eventBus.on("create.end", 250, function (event) {
eventBus.on('create.end', 250, function (event) {
const context = event.context,
shape = context.shape
@ -65,19 +64,19 @@ export default function ContextPadProvider (
}
ContextPadProvider.$inject = [
"config.contextPad",
"injector",
"eventBus",
"contextPad",
"modeling",
"elementFactory",
"connect",
"create",
"popupMenu",
"canvas",
"rules",
"translate",
"elementRegistry"
'config.contextPad',
'injector',
'eventBus',
'contextPad',
'modeling',
'elementFactory',
'connect',
'create',
'popupMenu',
'canvas',
'rules',
'translate',
'elementRegistry'
]
ContextPadProvider.prototype.getContextPadEntries = function (element) {
@ -94,21 +93,21 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) {
const actions = {}
if (element.type === "label") {
if (element.type === 'label') {
return actions
}
const businessObject = element.businessObject
function startConnect (event, element) {
function startConnect(event, element) {
connect.start(event, element)
}
function removeElement () {
function removeElement() {
modeling.removeElements([element])
}
function getReplaceMenuPosition (element) {
function getReplaceMenuPosition(element) {
const Y_OFFSET = 5
const diagramContainer = canvas.getContainer(),
@ -138,13 +137,13 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) {
*
* @return {Object} descriptor
*/
function appendAction (type, className, title, options) {
if (typeof title !== "string") {
function appendAction(type, className, title, options) {
if (typeof title !== 'string') {
options = title
title = translate("Append {type}", { type: type.replace(/^bpmn:/, "") })
title = translate('Append {type}', { type: type.replace(/^bpmn:/, '') })
}
function appendStart (event, element) {
function appendStart(event, element) {
const shape = elementFactory.createShape(assign({ type: type }, options))
create.start(event, shape, {
source: element
@ -153,14 +152,14 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) {
const append = autoPlace
? function (event, element) {
const shape = elementFactory.createShape(assign({ type: type }, options))
const shape = elementFactory.createShape(assign({ type: type }, options))
autoPlace.append(element, shape)
}
autoPlace.append(element, shape)
}
: appendStart
return {
group: "model",
group: 'model',
className: className,
title: title,
action: {
@ -170,7 +169,7 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) {
}
}
function splitLaneHandler (count) {
function splitLaneHandler(count) {
return function (event, element) {
// actual split
modeling.splitLane(element, count)
@ -181,17 +180,17 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) {
}
}
if (isAny(businessObject, ["bpmn:Lane", "bpmn:Participant"]) && isExpanded(businessObject)) {
if (isAny(businessObject, ['bpmn:Lane', 'bpmn:Participant']) && isExpanded(businessObject)) {
const childLanes = getChildLanes(element)
assign(actions, {
"lane-insert-above": {
group: "lane-insert-above",
className: "bpmn-icon-lane-insert-above",
title: translate("Add Lane above"),
'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")
modeling.addLane(element, 'top')
}
}
}
@ -200,10 +199,10 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) {
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"),
'lane-divide-two': {
group: 'lane-divide',
className: 'bpmn-icon-lane-divide-two',
title: translate('Divide into two Lanes'),
action: {
click: splitLaneHandler(2)
}
@ -213,10 +212,10 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) {
if (element.height >= 180) {
assign(actions, {
"lane-divide-three": {
group: "lane-divide",
className: "bpmn-icon-lane-divide-three",
title: translate("Divide into three Lanes"),
'lane-divide-three': {
group: 'lane-divide',
className: 'bpmn-icon-lane-divide-three',
title: translate('Divide into three Lanes'),
action: {
click: splitLaneHandler(3)
}
@ -226,79 +225,102 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) {
}
assign(actions, {
"lane-insert-below": {
group: "lane-insert-below",
className: "bpmn-icon-lane-insert-below",
title: translate("Add Lane below"),
'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")
modeling.addLane(element, 'bottom')
}
}
}
})
}
if (is(businessObject, "bpmn:FlowNode")) {
if (is(businessObject, "bpmn:EventBasedGateway")) {
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.receive-task': appendAction(
'bpmn:ReceiveTask',
'bpmn-icon-receive-task',
translate('Append ReceiveTask')
),
"append.timer-intermediate-event": appendAction(
"bpmn:IntermediateCatchEvent",
"bpmn-icon-intermediate-event-catch-timer",
translate("Append TimerIntermediateCatchEvent"),
{ eventDefinitionType: "bpmn:TimerEventDefinition" }
'append.message-intermediate-event': appendAction(
'bpmn:IntermediateCatchEvent',
'bpmn-icon-intermediate-event-catch-message',
translate('Append MessageIntermediateCatchEvent'),
{ eventDefinitionType: 'bpmn:MessageEventDefinition' }
),
"append.condition-intermediate-event": appendAction(
"bpmn:IntermediateCatchEvent",
"bpmn-icon-intermediate-event-catch-condition",
translate("Append ConditionIntermediateCatchEvent"),
{ eventDefinitionType: "bpmn:ConditionalEventDefinition" }
'append.timer-intermediate-event': appendAction(
'bpmn:IntermediateCatchEvent',
'bpmn-icon-intermediate-event-catch-timer',
translate('Append TimerIntermediateCatchEvent'),
{ eventDefinitionType: 'bpmn:TimerEventDefinition' }
),
"append.signal-intermediate-event": appendAction(
"bpmn:IntermediateCatchEvent",
"bpmn-icon-intermediate-event-catch-signal",
translate("Append SignalIntermediateCatchEvent"),
{ eventDefinitionType: "bpmn:SignalEventDefinition" }
'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")) {
} 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
})
'append.compensation-activity': appendAction(
'bpmn:Task',
'bpmn-icon-task',
translate('Append compensation activity'),
{
isForCompensation: true
}
)
})
} else if (
!is(businessObject, "bpmn:EndEvent") &&
!is(businessObject, 'bpmn:EndEvent') &&
!businessObject.isForCompensation &&
!isEventType(businessObject, "bpmn:IntermediateThrowEvent", "bpmn:LinkEventDefinition") &&
!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")
'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")) {
if (!popupMenu.isEmpty(element, 'bpmn-replace')) {
// Replace menu entry
assign(actions, {
replace: {
group: "edit",
className: "bpmn-icon-screw-wrench",
group: 'edit',
className: 'bpmn-icon-screw-wrench',
title: '修改类型',
action: {
click: function (event, element) {
@ -306,21 +328,32 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) {
cursor: { x: event.x, y: event.y }
})
popupMenu.open(element, "bpmn-replace", position)
popupMenu.open(element, 'bpmn-replace', position)
}
}
}
})
}
if (isAny(businessObject, ["bpmn:FlowNode", "bpmn:InteractionNode", "bpmn:DataObjectReference", "bpmn:DataStoreReference"])) {
if (
isAny(businessObject, [
'bpmn:FlowNode',
'bpmn:InteractionNode',
'bpmn:DataObjectReference',
'bpmn:DataStoreReference'
])
) {
assign(actions, {
"append.text-annotation": appendAction("bpmn:TextAnnotation", "bpmn-icon-text-annotation"),
'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"),
group: 'connect',
className: 'bpmn-icon-connection-multi',
title: translate(
'Connect using ' +
(businessObject.isForCompensation ? '' : 'Sequence/MessageFlow or ') +
'Association'
),
action: {
click: startConnect,
dragstart: startConnect
@ -329,12 +362,12 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) {
})
}
if (isAny(businessObject, ["bpmn:DataObjectReference", "bpmn:DataStoreReference"])) {
if (isAny(businessObject, ['bpmn:DataObjectReference', 'bpmn:DataStoreReference'])) {
assign(actions, {
connect: {
group: "connect",
className: "bpmn-icon-connection-multi",
title: translate("Connect using DataInputAssociation"),
group: 'connect',
className: 'bpmn-icon-connection-multi',
title: translate('Connect using DataInputAssociation'),
action: {
click: startConnect,
dragstart: startConnect
@ -343,9 +376,9 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) {
})
}
if (is(businessObject, "bpmn:Group")) {
if (is(businessObject, 'bpmn:Group')) {
assign(actions, {
"append.text-annotation": appendAction("bpmn:TextAnnotation", "bpmn-icon-text-annotation")
'append.text-annotation': appendAction('bpmn:TextAnnotation', 'bpmn-icon-text-annotation')
})
}
@ -360,9 +393,9 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) {
if (deleteAllowed) {
assign(actions, {
delete: {
group: "edit",
className: "bpmn-icon-trash",
title: translate("Remove"),
group: 'edit',
className: 'bpmn-icon-trash',
title: translate('Remove'),
action: {
click: removeElement
}
@ -375,7 +408,7 @@ ContextPadProvider.prototype.getContextPadEntries = function (element) {
// helpers /////////
function isEventType (eventBo, type, definition) {
function isEventType(eventBo, type, definition) {
const isType = eventBo.$instanceOf(type)
let isDefinition = false

View File

@ -1,6 +1,6 @@
import CustomContextPadProvider from "./contentPadProvider";
import CustomContextPadProvider from './contentPadProvider'
export default {
__init__: ["contextPadProvider"],
contextPadProvider: ["type", CustomContextPadProvider]
};
__init__: ['contextPadProvider'],
contextPadProvider: ['type', CustomContextPadProvider]
}

View File

@ -1,10 +1,10 @@
export default (key, name, type) => {
if (!type) type = "camunda";
if (!type) type = 'camunda'
const TYPE_TARGET = {
activiti: "http://activiti.org/bpmn",
camunda: "http://bpmn.io/schema/bpmn",
flowable: "http://flowable.org/bpmn"
};
activiti: 'http://activiti.org/bpmn',
camunda: 'http://bpmn.io/schema/bpmn',
flowable: 'http://flowable.org/bpmn'
}
return `<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@ -20,5 +20,5 @@ export default (key, name, type) => {
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${key}">
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>`;
};
</bpmn2:definitions>`
}

View File

@ -10,9 +10,7 @@
{
"name": "Definitions",
"isAbstract": true,
"extends": [
"bpmn:Definitions"
],
"extends": ["bpmn:Definitions"],
"properties": [
{
"name": "diagramRelationId",
@ -23,9 +21,7 @@
},
{
"name": "InOutBinding",
"superClass": [
"Element"
],
"superClass": ["Element"],
"isAbstract": true,
"properties": [
{
@ -63,34 +59,22 @@
},
{
"name": "In",
"superClass": [
"InOutBinding"
],
"superClass": ["InOutBinding"],
"meta": {
"allowedIn": [
"bpmn:CallActivity"
]
"allowedIn": ["bpmn:CallActivity"]
}
},
{
"name": "Out",
"superClass": [
"InOutBinding"
],
"superClass": ["InOutBinding"],
"meta": {
"allowedIn": [
"bpmn:CallActivity"
]
"allowedIn": ["bpmn:CallActivity"]
}
},
{
"name": "AsyncCapable",
"isAbstract": true,
"extends": [
"bpmn:Activity",
"bpmn:Gateway",
"bpmn:Event"
],
"extends": ["bpmn:Activity", "bpmn:Gateway", "bpmn:Event"],
"properties": [
{
"name": "async",
@ -121,10 +105,7 @@
{
"name": "JobPriorized",
"isAbstract": true,
"extends": [
"bpmn:Process",
"activiti:AsyncCapable"
],
"extends": ["bpmn:Process", "activiti:AsyncCapable"],
"properties": [
{
"name": "jobPriority",
@ -136,9 +117,7 @@
{
"name": "SignalEventDefinition",
"isAbstract": true,
"extends": [
"bpmn:SignalEventDefinition"
],
"extends": ["bpmn:SignalEventDefinition"],
"properties": [
{
"name": "async",
@ -151,9 +130,7 @@
{
"name": "ErrorEventDefinition",
"isAbstract": true,
"extends": [
"bpmn:ErrorEventDefinition"
],
"extends": ["bpmn:ErrorEventDefinition"],
"properties": [
{
"name": "errorCodeVariable",
@ -170,9 +147,7 @@
{
"name": "Error",
"isAbstract": true,
"extends": [
"bpmn:Error"
],
"extends": ["bpmn:Error"],
"properties": [
{
"name": "activiti:errorMessage",
@ -183,9 +158,7 @@
},
{
"name": "PotentialStarter",
"superClass": [
"Element"
],
"superClass": ["Element"],
"properties": [
{
"name": "resourceAssignmentExpression",
@ -196,10 +169,7 @@
{
"name": "FormSupported",
"isAbstract": true,
"extends": [
"bpmn:StartEvent",
"bpmn:UserTask"
],
"extends": ["bpmn:StartEvent", "bpmn:UserTask"],
"properties": [
{
"name": "formHandlerClass",
@ -216,10 +186,7 @@
{
"name": "TemplateSupported",
"isAbstract": true,
"extends": [
"bpmn:Process",
"bpmn:FlowElement"
],
"extends": ["bpmn:Process", "bpmn:FlowElement"],
"properties": [
{
"name": "modelerTemplate",
@ -231,7 +198,7 @@
{
"name": "Initiator",
"isAbstract": true,
"extends": [ "bpmn:StartEvent" ],
"extends": ["bpmn:StartEvent"],
"properties": [
{
"name": "initiator",
@ -243,9 +210,7 @@
{
"name": "ScriptTask",
"isAbstract": true,
"extends": [
"bpmn:ScriptTask"
],
"extends": ["bpmn:ScriptTask"],
"properties": [
{
"name": "resultVariable",
@ -262,9 +227,7 @@
{
"name": "Process",
"isAbstract": true,
"extends": [
"bpmn:Process"
],
"extends": ["bpmn:Process"],
"properties": [
{
"name": "candidateStarterGroups",
@ -293,18 +256,16 @@
"default": true
},
{
"name":"executionListener",
"name": "executionListener",
"isAbstract": true,
"type":"Expression"
"type": "Expression"
}
]
},
{
"name": "EscalationEventDefinition",
"isAbstract": true,
"extends": [
"bpmn:EscalationEventDefinition"
],
"extends": ["bpmn:EscalationEventDefinition"],
"properties": [
{
"name": "escalationCodeVariable",
@ -316,9 +277,7 @@
{
"name": "FormalExpression",
"isAbstract": true,
"extends": [
"bpmn:FormalExpression"
],
"extends": ["bpmn:FormalExpression"],
"properties": [
{
"name": "resource",
@ -329,19 +288,15 @@
},
{
"name": "multiinstance_type",
"superClass":[
"Element"
]
"superClass": ["Element"]
},
{
"name": "multiinstance_condition",
"superClass":[
"Element"
]
"superClass": ["Element"]
},
{
"name": "Assignable",
"extends": [ "bpmn:UserTask" ],
"extends": ["bpmn:UserTask"],
"properties": [
{
"name": "assignee",
@ -382,7 +337,7 @@
},
{
"name": "CallActivity",
"extends": [ "bpmn:CallActivity" ],
"extends": ["bpmn:CallActivity"],
"properties": [
{
"name": "calledElementBinding",
@ -471,9 +426,7 @@
},
{
"name": "DmnCapable",
"extends": [
"bpmn:BusinessRuleTask"
],
"extends": ["bpmn:BusinessRuleTask"],
"properties": [
{
"name": "decisionRef",
@ -506,9 +459,7 @@
},
{
"name": "ExternalCapable",
"extends": [
"activiti:ServiceTaskLike"
],
"extends": ["activiti:ServiceTaskLike"],
"properties": [
{
"name": "type",
@ -524,10 +475,7 @@
},
{
"name": "TaskPriorized",
"extends": [
"bpmn:Process",
"activiti:ExternalCapable"
],
"extends": ["bpmn:Process", "activiti:ExternalCapable"],
"properties": [
{
"name": "taskPriority",
@ -538,11 +486,9 @@
},
{
"name": "Properties",
"superClass": [
"Element"
],
"superClass": ["Element"],
"meta": {
"allowedIn": [ "*" ]
"allowedIn": ["*"]
},
"properties": [
{
@ -554,9 +500,7 @@
},
{
"name": "Property",
"superClass": [
"Element"
],
"superClass": ["Element"],
"properties": [
{
"name": "id",
@ -577,13 +521,9 @@
},
{
"name": "Connector",
"superClass": [
"Element"
],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"activiti:ServiceTaskLike"
]
"allowedIn": ["activiti:ServiceTaskLike"]
},
"properties": [
{
@ -598,14 +538,9 @@
},
{
"name": "InputOutput",
"superClass": [
"Element"
],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"bpmn:FlowNode",
"activiti:Connector"
]
"allowedIn": ["bpmn:FlowNode", "activiti:Connector"]
},
"properties": [
{
@ -653,7 +588,7 @@
},
{
"name": "List",
"superClass": [ "InputOutputParameterDefinition" ],
"superClass": ["InputOutputParameterDefinition"],
"properties": [
{
"name": "items",
@ -664,7 +599,7 @@
},
{
"name": "Map",
"superClass": [ "InputOutputParameterDefinition" ],
"superClass": ["InputOutputParameterDefinition"],
"properties": [
{
"name": "entries",
@ -694,9 +629,7 @@
},
{
"name": "Value",
"superClass": [
"InputOutputParameterDefinition"
],
"superClass": ["InputOutputParameterDefinition"],
"properties": [
{
"name": "id",
@ -717,7 +650,7 @@
},
{
"name": "Script",
"superClass": [ "InputOutputParameterDefinition" ],
"superClass": ["InputOutputParameterDefinition"],
"properties": [
{
"name": "scriptFormat",
@ -738,7 +671,7 @@
},
{
"name": "Field",
"superClass": [ "Element" ],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"activiti:ServiceTaskLike",
@ -769,17 +702,17 @@
},
{
"name": "InputParameter",
"superClass": [ "InputOutputParameter" ]
"superClass": ["InputOutputParameter"]
},
{
"name": "OutputParameter",
"superClass": [ "InputOutputParameter" ]
"superClass": ["InputOutputParameter"]
},
{
"name": "Collectable",
"isAbstract": true,
"extends": [ "bpmn:MultiInstanceLoopCharacteristics" ],
"superClass": [ "activiti:AsyncCapable" ],
"extends": ["bpmn:MultiInstanceLoopCharacteristics"],
"superClass": ["activiti:AsyncCapable"],
"properties": [
{
"name": "collection",
@ -795,12 +728,9 @@
},
{
"name": "FailedJobRetryTimeCycle",
"superClass": [ "Element" ],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"activiti:AsyncCapable",
"bpmn:MultiInstanceLoopCharacteristics"
]
"allowedIn": ["activiti:AsyncCapable", "bpmn:MultiInstanceLoopCharacteristics"]
},
"properties": [
{
@ -812,7 +742,7 @@
},
{
"name": "ExecutionListener",
"superClass": [ "Element" ],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"bpmn:Task",
@ -871,11 +801,9 @@
},
{
"name": "TaskListener",
"superClass": [ "Element" ],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"bpmn:UserTask"
]
"allowedIn": ["bpmn:UserTask"]
},
"properties": [
{
@ -911,12 +839,9 @@
},
{
"name": "FormProperty",
"superClass": [ "Element" ],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"bpmn:StartEvent",
"bpmn:UserTask"
]
"allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"]
},
"properties": [
{
@ -978,7 +903,7 @@
},
{
"name": "FormProperty",
"superClass": [ "Element" ],
"superClass": ["Element"],
"properties": [
{
"name": "id",
@ -1022,7 +947,7 @@
},
{
"name": "Validation",
"superClass": [ "Element" ],
"superClass": ["Element"],
"properties": [
{
"name": "constraints",
@ -1033,7 +958,7 @@
},
{
"name": "Constraint",
"superClass": [ "Element" ],
"superClass": ["Element"],
"properties": [
{
"name": "name",
@ -1050,9 +975,7 @@
{
"name": "ConditionalEventDefinition",
"isAbstract": true,
"extends": [
"bpmn:ConditionalEventDefinition"
],
"extends": ["bpmn:ConditionalEventDefinition"],
"properties": [
{
"name": "variableName",
@ -1067,5 +990,5 @@
]
}
],
"emumerations": [ ]
"emumerations": []
}

View File

@ -10,9 +10,7 @@
{
"name": "Definitions",
"isAbstract": true,
"extends": [
"bpmn:Definitions"
],
"extends": ["bpmn:Definitions"],
"properties": [
{
"name": "diagramRelationId",
@ -23,9 +21,7 @@
},
{
"name": "InOutBinding",
"superClass": [
"Element"
],
"superClass": ["Element"],
"isAbstract": true,
"properties": [
{
@ -63,35 +59,22 @@
},
{
"name": "In",
"superClass": [
"InOutBinding"
],
"superClass": ["InOutBinding"],
"meta": {
"allowedIn": [
"bpmn:CallActivity",
"bpmn:SignalEventDefinition"
]
"allowedIn": ["bpmn:CallActivity", "bpmn:SignalEventDefinition"]
}
},
{
"name": "Out",
"superClass": [
"InOutBinding"
],
"superClass": ["InOutBinding"],
"meta": {
"allowedIn": [
"bpmn:CallActivity"
]
"allowedIn": ["bpmn:CallActivity"]
}
},
{
"name": "AsyncCapable",
"isAbstract": true,
"extends": [
"bpmn:Activity",
"bpmn:Gateway",
"bpmn:Event"
],
"extends": ["bpmn:Activity", "bpmn:Gateway", "bpmn:Event"],
"properties": [
{
"name": "async",
@ -122,10 +105,7 @@
{
"name": "JobPriorized",
"isAbstract": true,
"extends": [
"bpmn:Process",
"camunda:AsyncCapable"
],
"extends": ["bpmn:Process", "camunda:AsyncCapable"],
"properties": [
{
"name": "jobPriority",
@ -137,9 +117,7 @@
{
"name": "SignalEventDefinition",
"isAbstract": true,
"extends": [
"bpmn:SignalEventDefinition"
],
"extends": ["bpmn:SignalEventDefinition"],
"properties": [
{
"name": "async",
@ -152,9 +130,7 @@
{
"name": "ErrorEventDefinition",
"isAbstract": true,
"extends": [
"bpmn:ErrorEventDefinition"
],
"extends": ["bpmn:ErrorEventDefinition"],
"properties": [
{
"name": "errorCodeVariable",
@ -171,9 +147,7 @@
{
"name": "Error",
"isAbstract": true,
"extends": [
"bpmn:Error"
],
"extends": ["bpmn:Error"],
"properties": [
{
"name": "camunda:errorMessage",
@ -184,9 +158,7 @@
},
{
"name": "PotentialStarter",
"superClass": [
"Element"
],
"superClass": ["Element"],
"properties": [
{
"name": "resourceAssignmentExpression",
@ -197,10 +169,7 @@
{
"name": "FormSupported",
"isAbstract": true,
"extends": [
"bpmn:StartEvent",
"bpmn:UserTask"
],
"extends": ["bpmn:StartEvent", "bpmn:UserTask"],
"properties": [
{
"name": "formHandlerClass",
@ -217,10 +186,7 @@
{
"name": "TemplateSupported",
"isAbstract": true,
"extends": [
"bpmn:Process",
"bpmn:FlowElement"
],
"extends": ["bpmn:Process", "bpmn:FlowElement"],
"properties": [
{
"name": "modelerTemplate",
@ -237,7 +203,7 @@
{
"name": "Initiator",
"isAbstract": true,
"extends": [ "bpmn:StartEvent" ],
"extends": ["bpmn:StartEvent"],
"properties": [
{
"name": "initiator",
@ -249,9 +215,7 @@
{
"name": "ScriptTask",
"isAbstract": true,
"extends": [
"bpmn:ScriptTask"
],
"extends": ["bpmn:ScriptTask"],
"properties": [
{
"name": "resultVariable",
@ -268,9 +232,7 @@
{
"name": "Process",
"isAbstract": true,
"extends": [
"bpmn:Process"
],
"extends": ["bpmn:Process"],
"properties": [
{
"name": "candidateStarterGroups",
@ -303,9 +265,7 @@
{
"name": "EscalationEventDefinition",
"isAbstract": true,
"extends": [
"bpmn:EscalationEventDefinition"
],
"extends": ["bpmn:EscalationEventDefinition"],
"properties": [
{
"name": "escalationCodeVariable",
@ -317,9 +277,7 @@
{
"name": "FormalExpression",
"isAbstract": true,
"extends": [
"bpmn:FormalExpression"
],
"extends": ["bpmn:FormalExpression"],
"properties": [
{
"name": "resource",
@ -330,7 +288,7 @@
},
{
"name": "Assignable",
"extends": [ "bpmn:UserTask" ],
"extends": ["bpmn:UserTask"],
"properties": [
{
"name": "assignee",
@ -366,7 +324,7 @@
},
{
"name": "CallActivity",
"extends": [ "bpmn:CallActivity" ],
"extends": ["bpmn:CallActivity"],
"properties": [
{
"name": "calledElementBinding",
@ -455,9 +413,7 @@
},
{
"name": "DmnCapable",
"extends": [
"bpmn:BusinessRuleTask"
],
"extends": ["bpmn:BusinessRuleTask"],
"properties": [
{
"name": "decisionRef",
@ -490,9 +446,7 @@
},
{
"name": "ExternalCapable",
"extends": [
"camunda:ServiceTaskLike"
],
"extends": ["camunda:ServiceTaskLike"],
"properties": [
{
"name": "type",
@ -508,10 +462,7 @@
},
{
"name": "TaskPriorized",
"extends": [
"bpmn:Process",
"camunda:ExternalCapable"
],
"extends": ["bpmn:Process", "camunda:ExternalCapable"],
"properties": [
{
"name": "taskPriority",
@ -522,11 +473,9 @@
},
{
"name": "Properties",
"superClass": [
"Element"
],
"superClass": ["Element"],
"meta": {
"allowedIn": [ "*" ]
"allowedIn": ["*"]
},
"properties": [
{
@ -538,9 +487,7 @@
},
{
"name": "Property",
"superClass": [
"Element"
],
"superClass": ["Element"],
"properties": [
{
"name": "id",
@ -561,13 +508,9 @@
},
{
"name": "Connector",
"superClass": [
"Element"
],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"camunda:ServiceTaskLike"
]
"allowedIn": ["camunda:ServiceTaskLike"]
},
"properties": [
{
@ -582,14 +525,9 @@
},
{
"name": "InputOutput",
"superClass": [
"Element"
],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"bpmn:FlowNode",
"camunda:Connector"
]
"allowedIn": ["bpmn:FlowNode", "camunda:Connector"]
},
"properties": [
{
@ -637,7 +575,7 @@
},
{
"name": "List",
"superClass": [ "InputOutputParameterDefinition" ],
"superClass": ["InputOutputParameterDefinition"],
"properties": [
{
"name": "items",
@ -648,7 +586,7 @@
},
{
"name": "Map",
"superClass": [ "InputOutputParameterDefinition" ],
"superClass": ["InputOutputParameterDefinition"],
"properties": [
{
"name": "entries",
@ -678,9 +616,7 @@
},
{
"name": "Value",
"superClass": [
"InputOutputParameterDefinition"
],
"superClass": ["InputOutputParameterDefinition"],
"properties": [
{
"name": "id",
@ -701,7 +637,7 @@
},
{
"name": "Script",
"superClass": [ "InputOutputParameterDefinition" ],
"superClass": ["InputOutputParameterDefinition"],
"properties": [
{
"name": "scriptFormat",
@ -722,7 +658,7 @@
},
{
"name": "Field",
"superClass": [ "Element" ],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"camunda:ServiceTaskLike",
@ -753,17 +689,17 @@
},
{
"name": "InputParameter",
"superClass": [ "InputOutputParameter" ]
"superClass": ["InputOutputParameter"]
},
{
"name": "OutputParameter",
"superClass": [ "InputOutputParameter" ]
"superClass": ["InputOutputParameter"]
},
{
"name": "Collectable",
"isAbstract": true,
"extends": [ "bpmn:MultiInstanceLoopCharacteristics" ],
"superClass": [ "camunda:AsyncCapable" ],
"extends": ["bpmn:MultiInstanceLoopCharacteristics"],
"superClass": ["camunda:AsyncCapable"],
"properties": [
{
"name": "collection",
@ -779,12 +715,9 @@
},
{
"name": "FailedJobRetryTimeCycle",
"superClass": [ "Element" ],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"camunda:AsyncCapable",
"bpmn:MultiInstanceLoopCharacteristics"
]
"allowedIn": ["camunda:AsyncCapable", "bpmn:MultiInstanceLoopCharacteristics"]
},
"properties": [
{
@ -796,7 +729,7 @@
},
{
"name": "ExecutionListener",
"superClass": [ "Element" ],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"bpmn:Task",
@ -855,11 +788,9 @@
},
{
"name": "TaskListener",
"superClass": [ "Element" ],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"bpmn:UserTask"
]
"allowedIn": ["bpmn:UserTask"]
},
"properties": [
{
@ -905,12 +836,9 @@
},
{
"name": "FormProperty",
"superClass": [ "Element" ],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"bpmn:StartEvent",
"bpmn:UserTask"
]
"allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"]
},
"properties": [
{
@ -972,12 +900,9 @@
},
{
"name": "FormData",
"superClass": [ "Element" ],
"superClass": ["Element"],
"meta": {
"allowedIn": [
"bpmn:StartEvent",
"bpmn:UserTask"
]
"allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"]
},
"properties": [
{
@ -994,7 +919,7 @@
},
{
"name": "FormField",
"superClass": [ "Element" ],
"superClass": ["Element"],
"properties": [
{
"name": "id",
@ -1038,7 +963,7 @@
},
{
"name": "Validation",
"superClass": [ "Element" ],
"superClass": ["Element"],
"properties": [
{
"name": "constraints",
@ -1049,7 +974,7 @@
},
{
"name": "Constraint",
"superClass": [ "Element" ],
"superClass": ["Element"],
"properties": [
{
"name": "name",
@ -1066,9 +991,7 @@
{
"name": "ConditionalEventDefinition",
"isAbstract": true,
"extends": [
"bpmn:ConditionalEventDefinition"
],
"extends": ["bpmn:ConditionalEventDefinition"],
"properties": [
{
"name": "variableName",
@ -1083,5 +1006,5 @@
]
}
],
"emumerations": [ ]
"emumerations": []
}

View File

@ -875,10 +875,7 @@
"name": "FailedJobRetryTimeCycle",
"superClass": ["Element"],
"meta": {
"allowedIn": [
"flowable:AsyncCapable",
"bpmn:MultiInstanceLoopCharacteristics"
]
"allowedIn": ["flowable:AsyncCapable", "bpmn:MultiInstanceLoopCharacteristics"]
},
"properties": [
{

View File

@ -1,4 +1,4 @@
"use strict"
'use strict'
import { some } from 'min-dash'
@ -6,20 +6,25 @@ import { some } from 'min-dash'
// const some = some
const ALLOWED_TYPES = {
FailedJobRetryTimeCycle: ['bpmn:StartEvent', 'bpmn:BoundaryEvent', 'bpmn:IntermediateCatchEvent', 'bpmn:Activity'],
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 is(element, type) {
return element && typeof element.$instanceOf === 'function' && element.$instanceOf(type)
}
function exists (element) {
function exists(element) {
return element && element.length
}
function includesType (collection, type) {
function includesType(collection, type) {
return (
exists(collection) &&
some(collection, function (element) {
@ -28,22 +33,22 @@ function includesType (collection, type) {
)
}
function anyType (element, types) {
function anyType(element, types) {
return some(types, function (type) {
return is(element, type)
})
}
function isAllowed (propName, propDescriptor, newElement) {
function isAllowed(propName, propDescriptor, newElement) {
const name = propDescriptor.name,
types = ALLOWED_TYPES[name.replace(/activiti:/, '')]
return name === propName && anyType(newElement, types)
}
function ActivitiModdleExtension (eventBus) {
function ActivitiModdleExtension(eventBus) {
eventBus.on(
"property.clone",
'property.clone',
function (context) {
const newElement = context.newElement,
propDescriptor = context.propertyDescriptor
@ -54,26 +59,25 @@ function ActivitiModdleExtension (eventBus) {
)
}
ActivitiModdleExtension.$inject = ["eventBus"]
ActivitiModdleExtension.$inject = ['eventBus']
ActivitiModdleExtension.prototype.canCloneProperty = function (newElement, propDescriptor) {
if (isAllowed("activiti:FailedJobRetryTimeCycle", propDescriptor, newElement)) {
if (isAllowed('activiti:FailedJobRetryTimeCycle', propDescriptor, newElement)) {
return (
includesType(newElement.eventDefinitions, "bpmn:TimerEventDefinition") ||
includesType(newElement.eventDefinitions, "bpmn:SignalEventDefinition") ||
is(newElement.loopCharacteristics, "bpmn:MultiInstanceLoopCharacteristics")
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:Connector', propDescriptor, newElement)) {
return includesType(newElement.eventDefinitions, 'bpmn:MessageEventDefinition')
}
if (isAllowed("activiti:Field", propDescriptor, newElement)) {
return includesType(newElement.eventDefinitions, "bpmn:MessageEventDefinition")
if (isAllowed('activiti:Field', propDescriptor, newElement)) {
return includesType(newElement.eventDefinitions, 'bpmn:MessageEventDefinition')
}
}
// module.exports = ActivitiModdleExtension;
export default ActivitiModdleExtension

View File

@ -3,9 +3,9 @@
* address https://github.com/igdianov/activiti-bpmn-moddle
* */
import activitiExtension from "./activitiExtension"
import activitiExtension from './activitiExtension'
export default {
__init__: ["ActivitiModdleExtension"],
ActivitiModdleExtension: ["type", activitiExtension]
__init__: ['ActivitiModdleExtension'],
ActivitiModdleExtension: ['type', activitiExtension]
}

View File

@ -1,11 +1,6 @@
"use strict"
'use strict'
import {
isFunction,
isObject,
some
} from 'min-dash'
import { isFunction, isObject, some } from 'min-dash'
// const isFunction = isFunction,
// isObject = isObject,
@ -16,10 +11,11 @@ import {
const WILDCARD = '*'
function CamundaModdleExtension (eventBus) {
function CamundaModdleExtension(eventBus) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const self = this
eventBus.on("moddleCopy.canCopyProperty", function (context) {
eventBus.on('moddleCopy.canCopyProperty', function (context) {
const property = context.property,
parent = context.parent
@ -27,7 +23,7 @@ function CamundaModdleExtension (eventBus) {
})
}
CamundaModdleExtension.$inject = ["eventBus"]
CamundaModdleExtension.$inject = ['eventBus']
/**
* Check wether to disallow copying property.
@ -40,15 +36,15 @@ CamundaModdleExtension.prototype.canCopyProperty = function (property, parent) {
// (2) check more complex scenarios
if (is(property, "camunda:InputOutput") && !this.canHostInputOutput(parent)) {
if (is(property, 'camunda:InputOutput') && !this.canHostInputOutput(parent)) {
return false
}
if (isAny(property, ["camunda:Connector", "camunda:Field"]) && !this.canHostConnector(parent)) {
if (isAny(property, ['camunda:Connector', 'camunda:Field']) && !this.canHostConnector(parent)) {
return false
}
if (is(property, "camunda:In") && !this.canHostIn(parent)) {
if (is(property, 'camunda:In') && !this.canHostIn(parent)) {
return false
}
}
@ -68,21 +64,19 @@ CamundaModdleExtension.prototype.canHostInputOutput = function (parent) {
return false
}
if (isAny(flowNode, ["bpmn:StartEvent", "bpmn:Gateway", "bpmn:BoundaryEvent"])) {
if (isAny(flowNode, ['bpmn:StartEvent', 'bpmn:Gateway', 'bpmn:BoundaryEvent'])) {
return false
}
return !(is(flowNode, "bpmn:SubProcess") && flowNode.get("triggeredByEvent"))
return !(is(flowNode, 'bpmn:SubProcess') && flowNode.get('triggeredByEvent'))
}
CamundaModdleExtension.prototype.canHostConnector = function (parent) {
const serviceTaskLike = getParent(parent, 'camunda:ServiceTaskLike')
if (is(serviceTaskLike, "bpmn:MessageEventDefinition")) {
if (is(serviceTaskLike, 'bpmn:MessageEventDefinition')) {
// only allow on throw and end events
return getParent(parent, "bpmn:IntermediateThrowEvent") || getParent(parent, "bpmn:EndEvent")
return getParent(parent, 'bpmn:IntermediateThrowEvent') || getParent(parent, 'bpmn:EndEvent')
}
return true
@ -99,7 +93,7 @@ CamundaModdleExtension.prototype.canHostIn = function (parent) {
if (signalEventDefinition) {
// only allow on throw and end events
return getParent(parent, "bpmn:IntermediateThrowEvent") || getParent(parent, "bpmn:EndEvent")
return getParent(parent, 'bpmn:IntermediateThrowEvent') || getParent(parent, 'bpmn:EndEvent')
}
return true
@ -110,17 +104,17 @@ export default CamundaModdleExtension
// helpers //////////
function is (element, type) {
function is(element, type) {
return element && isFunction(element.$instanceOf) && element.$instanceOf(type)
}
function isAny (element, types) {
function isAny(element, types) {
return some(types, function (t) {
return is(element, t)
})
}
function getParent (element, type) {
function getParent(element, type) {
if (!type) {
return element.$parent
}
@ -136,7 +130,7 @@ function getParent (element, type) {
return getParent(element.$parent, type)
}
function isAllowedInParent (property, parent) {
function isAllowedInParent(property, parent) {
// (1) find property descriptor
const descriptor = property.$type && property.$model.getTypeDescriptor(property.$type)
@ -152,6 +146,6 @@ function isAllowedInParent (property, parent) {
})
}
function isWildcard (allowedIn) {
function isWildcard(allowedIn) {
return allowedIn.indexOf(WILDCARD) !== -1
}

View File

@ -1,8 +1,8 @@
"use strict"
'use strict'
import extension from "./extension"
import extension from './extension'
export default {
__init__: ["camundaModdleExtension"],
camundaModdleExtension: ["type", extension]
__init__: ['camundaModdleExtension'],
camundaModdleExtension: ['type', extension]
}

View File

@ -1,27 +1,30 @@
"use strict"
'use strict'
import { some } from 'min-dash'
// const some = some
// const some = require('min-dash').some
const ALLOWED_TYPES = {
FailedJobRetryTimeCycle: ['bpmn:StartEvent', 'bpmn:BoundaryEvent', 'bpmn:IntermediateCatchEvent', 'bpmn:Activity'],
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 is(element, type) {
return element && typeof element.$instanceOf === 'function' && element.$instanceOf(type)
}
function exists (element) {
function exists(element) {
return element && element.length
}
function includesType (collection, type) {
function includesType(collection, type) {
return (
exists(collection) &&
some(collection, function (element) {
@ -30,22 +33,22 @@ function includesType (collection, type) {
)
}
function anyType (element, types) {
function anyType(element, types) {
return some(types, function (type) {
return is(element, type)
})
}
function isAllowed (propName, propDescriptor, newElement) {
function isAllowed(propName, propDescriptor, newElement) {
const name = propDescriptor.name,
types = ALLOWED_TYPES[name.replace(/flowable:/, '')]
return name === propName && anyType(newElement, types)
}
function FlowableModdleExtension (eventBus) {
function FlowableModdleExtension(eventBus) {
eventBus.on(
"property.clone",
'property.clone',
function (context) {
const newElement = context.newElement,
propDescriptor = context.propertyDescriptor
@ -56,23 +59,23 @@ function FlowableModdleExtension (eventBus) {
)
}
FlowableModdleExtension.$inject = ["eventBus"]
FlowableModdleExtension.$inject = ['eventBus']
FlowableModdleExtension.prototype.canCloneProperty = function (newElement, propDescriptor) {
if (isAllowed("flowable:FailedJobRetryTimeCycle", propDescriptor, newElement)) {
if (isAllowed('flowable:FailedJobRetryTimeCycle', propDescriptor, newElement)) {
return (
includesType(newElement.eventDefinitions, "bpmn:TimerEventDefinition") ||
includesType(newElement.eventDefinitions, "bpmn:SignalEventDefinition") ||
is(newElement.loopCharacteristics, "bpmn:MultiInstanceLoopCharacteristics")
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:Connector', propDescriptor, newElement)) {
return includesType(newElement.eventDefinitions, 'bpmn:MessageEventDefinition')
}
if (isAllowed("flowable:Field", propDescriptor, newElement)) {
return includesType(newElement.eventDefinitions, "bpmn:MessageEventDefinition")
if (isAllowed('flowable:Field', propDescriptor, newElement)) {
return includesType(newElement.eventDefinitions, 'bpmn:MessageEventDefinition')
}
}

View File

@ -2,9 +2,9 @@
* @author igdianov
* address https://github.com/igdianov/activiti-bpmn-moddle
* */
import flowableExtension from "./flowableExtension"
import flowableExtension from './flowableExtension'
export default {
__init__: ["FlowableModdleExtension"],
FlowableModdleExtension: ["type", flowableExtension]
__init__: ['FlowableModdleExtension'],
FlowableModdleExtension: ['type', flowableExtension]
}

View File

@ -1,11 +1,31 @@
import PaletteProvider from 'bpmn-js/lib/features/palette/PaletteProvider'
import { assign } from "min-dash"
import { assign } from 'min-dash'
export default function CustomPalette (palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate) {
PaletteProvider.call(this, palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate, 2000)
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 () { } // 核心,利用空对象作为中介;
const F = function () {} // 核心,利用空对象作为中介;
F.prototype = PaletteProvider.prototype // 核心将父类的原型赋值给空对象F
// 利用中介函数重写原型链方法
@ -19,8 +39,8 @@ F.prototype.getPaletteEntries = function () {
globalConnect = this._globalConnect,
translate = this._translate
function createAction (type, group, className, title, options) {
function createListener (event) {
function createAction(type, group, className, title, options) {
function createListener(event) {
const shape = elementFactory.createShape(assign({ type: type }, options))
if (options) {
@ -35,7 +55,7 @@ F.prototype.getPaletteEntries = function () {
return {
group: group,
className: className,
title: title || translate("Create {type}", { type: shortType }),
title: title || translate('Create {type}', { type: shortType }),
action: {
dragstart: createListener,
click: createListener
@ -43,7 +63,7 @@ F.prototype.getPaletteEntries = function () {
}
}
function createSubprocess (event) {
function createSubprocess(event) {
const subProcess = elementFactory.createShape({
type: 'bpmn:SubProcess',
x: 0,
@ -65,14 +85,14 @@ F.prototype.getPaletteEntries = function () {
})
}
function createParticipant (event) {
function createParticipant(event) {
create.start(event, elementFactory.createParticipantShape())
}
assign(actions, {
"hand-tool": {
group: "tools",
className: "bpmn-icon-hand-tool",
'hand-tool': {
group: 'tools',
className: 'bpmn-icon-hand-tool',
title: '激活抓手工具',
// title: translate("Activate the hand tool"),
action: {
@ -81,77 +101,121 @@ F.prototype.getPaletteEntries = function () {
}
}
},
"lasso-tool": {
group: "tools",
className: "bpmn-icon-lasso-tool",
title: translate("Activate the lasso tool"),
'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"),
'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"),
'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",
'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.start-event': createAction(
'bpmn:StartEvent',
'event',
'bpmn-icon-start-event-none',
translate('Create StartEvent')
),
"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"),
'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"),
'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"))
'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.$inject = [
'palette',
'create',
'elementFactory',
'spaceTool',
'lassoTool',
'handTool',
'globalConnect',
'translate'
]
CustomPalette.prototype = new F() // 核心,将 F的实例赋值给子类
CustomPalette.prototype.constructor = CustomPalette // 修复子类CustomPalette的构造器指向防止原型链的混乱

View File

@ -14,9 +14,9 @@
// paletteProvider: ["type", PaletteProvider]
// };
import CustomPalette from "./CustomPalette";
import CustomPalette from './CustomPalette'
export default {
__init__: ["paletteProvider"],
paletteProvider: ["type", CustomPalette]
};
__init__: ['paletteProvider'],
paletteProvider: ['type', CustomPalette]
}

View File

@ -1,9 +1,18 @@
import { assign } from "min-dash"
import { assign } from 'min-dash'
/**
* A palette provider for BPMN 2.0 elements.
*/
export default function PaletteProvider (palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate) {
export default function PaletteProvider(
palette,
create,
elementFactory,
spaceTool,
lassoTool,
handTool,
globalConnect,
translate
) {
this._palette = palette
this._create = create
this._elementFactory = elementFactory
@ -16,7 +25,16 @@ export default function PaletteProvider (palette, create, elementFactory, spaceT
palette.registerProvider(this)
}
PaletteProvider.$inject = ["palette", "create", "elementFactory", "spaceTool", "lassoTool", "handTool", "globalConnect", "translate"]
PaletteProvider.$inject = [
'palette',
'create',
'elementFactory',
'spaceTool',
'lassoTool',
'handTool',
'globalConnect',
'translate'
]
PaletteProvider.prototype.getPaletteEntries = function () {
const actions = {},
@ -28,8 +46,8 @@ PaletteProvider.prototype.getPaletteEntries = function () {
globalConnect = this._globalConnect,
translate = this._translate
function createAction (type, group, className, title, options) {
function createListener (event) {
function createAction(type, group, className, title, options) {
function createListener(event) {
const shape = elementFactory.createShape(assign({ type: type }, options))
if (options) {
@ -44,7 +62,7 @@ PaletteProvider.prototype.getPaletteEntries = function () {
return {
group: group,
className: className,
title: title || translate("Create {type}", { type: shortType }),
title: title || translate('Create {type}', { type: shortType }),
action: {
dragstart: createListener,
click: createListener
@ -52,7 +70,7 @@ PaletteProvider.prototype.getPaletteEntries = function () {
}
}
function createSubprocess (event) {
function createSubprocess(event) {
const subProcess = elementFactory.createShape({
type: 'bpmn:SubProcess',
x: 0,
@ -74,86 +92,121 @@ PaletteProvider.prototype.getPaletteEntries = function () {
})
}
function createParticipant (event) {
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"),
'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"),
'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"),
'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"),
'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",
'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.start-event': createAction(
'bpmn:StartEvent',
'event',
'bpmn-icon-start-event-none',
translate('Create StartEvent')
),
"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"),
'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"),
'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"))
'create.group': createAction(
'bpmn:Group',
'artifact',
'bpmn-icon-group',
translate('Create Group')
)
})
return actions

View File

@ -22,20 +22,23 @@
// }
export default function customTranslate(translations) {
return function(template, replacements) {
replacements = replacements || {};
return function (template, replacements) {
replacements = replacements || {}
// Translate
template = translations[template] || template;
template = translations[template] || template
// Replace
return template.replace(/{([^}]+)}/g, function(_, key) {
let str = replacements[key];
if (translations[replacements[key]] !== null && translations[replacements[key]] !== undefined) {
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]];
str = translations[replacements[key]]
// eslint-disable-next-line no-mixed-spaces-and-tabs
}
return str || "{" + key + "}";
});
};
return str || '{' + key + '}'
})
}
}

View File

@ -6,233 +6,235 @@
*/
export default {
// 添加部分
"Append EndEvent": "追加结束事件",
"Append Gateway": "追加网关",
"Append Task": "追加任务",
"Append Intermediate/Boundary Event": "追加中间抛出事件/边界事件",
'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": "展开池",
'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}失败",
'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.": "指定多个组作为逗号分隔的列表。"
};
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.': '指定多个组作为逗号分隔的列表。'
}

View File

@ -73,8 +73,6 @@ import ElementListeners from './listeners/ElementListeners.vue'
import ElementProperties from './properties/ElementProperties.vue'
// import ElementForm from './form/ElementForm.vue'
import UserTaskListeners from './listeners/UserTaskListeners.vue'
import { provide, ref, watch, onBeforeUnmount, onMounted } from 'vue'
import { ElCollapse, ElCollapseItem, ElLink } from 'element-plus'
/**
* 侧边栏
* @Author MiyueFE
@ -82,7 +80,10 @@ import { ElCollapse, ElCollapseItem, ElLink } from 'element-plus'
* @Date 2021年3月31日18:57:51
*/
const props = defineProps({
bpmnModeler: Object,
bpmnModeler: {
type: Object,
default: () => {}
},
prefix: {
type: String,
default: 'camunda'
@ -101,7 +102,7 @@ const props = defineProps({
const activeTab = ref('base')
const elementId = ref('')
const elementType = ref('')
const elementBusinessObject = ref({}) // businessObject 使
const elementBusinessObject = ref<any>({}) // businessObject 使
const conditionFormVisible = ref(false) //
const formVisible = ref(false) //
const bpmnElement = ref()

View File

@ -38,15 +38,19 @@
</div>
</template>
<script setup lang="ts" name="ElementBaseInfo">
import { ref, reactive, watch, onMounted, onBeforeUnmount, toRaw } from 'vue'
import { ElLink, ElForm, ElFormItem, ElInput } from 'element-plus'
const props = defineProps({
businessObject: Object,
model: Object //
businessObject: {
type: Object,
default: () => {}
},
model: {
type: Object,
default: () => {}
}
})
const needProps = ref({})
const needProps = ref<any>({})
const bpmnElement = ref()
const elementBaseInfo = ref({})
const elementBaseInfo = ref<any>({})
//
// const forms = ref([])
//

View File

@ -63,14 +63,11 @@
</template>
<script setup lang="ts" name="FlowCondition">
import { ref, nextTick, watch, onBeforeUnmount, toRaw } from 'vue'
import { ElSelect, ElForm, ElFormItem, ElInput, ElOption } from 'element-plus'
const props = defineProps({
businessObject: Object,
type: String
})
const flowConditionForm = ref({})
const flowConditionForm = ref<any>({})
const bpmnElement = ref()
const bpmnElementSource = ref()
const bpmnElementSourceRef = ref()

View File

@ -205,20 +205,6 @@
</template>
<script setup lang="ts" name="ElementForm">
import { ref, inject, watch, nextTick, toRaw } from 'vue'
import {
ElDialog,
ElForm,
ElFormItem,
ElSelect,
ElOption,
ElDivider,
ElTable,
ElTableColumn,
ElButton,
ElDrawer,
ElInput
} from 'element-plus'
const props = defineProps({
id: String,
type: String
@ -229,8 +215,8 @@ const width = inject('width')
const formKey = ref('')
const businessKey = ref('')
const optionModelTitle = ref('')
const fieldList = ref([])
const formFieldForm = ref({})
const fieldList = ref<any[]>([])
const formFieldForm = ref<any>({})
const fieldType = ref({
long: '长整型',
string: '字符串',
@ -243,11 +229,11 @@ const formFieldIndex = ref(-1) // 编辑中的字段, -1 为新增
const formFieldOptionIndex = ref(-1) // -1
const fieldModelVisible = ref(false)
const fieldOptionModelVisible = ref(false)
const fieldOptionForm = ref({}) //
const fieldOptionForm = ref<any>({}) //
const fieldOptionType = ref('') //
const fieldEnumList = ref([]) //
const fieldConstraintsList = ref([]) //
const fieldPropertiesList = ref([]) //
const fieldEnumList = ref<any[]>([]) //
const fieldConstraintsList = ref<any[]>([]) //
const fieldPropertiesList = ref<any[]>([]) //
const bpmnELement = ref()
const elExtensionElements = ref()
const formData = ref()

View File

@ -1,7 +1,7 @@
import MyPropertiesPanel from "./PropertiesPanel.vue";
import MyPropertiesPanel from './PropertiesPanel.vue'
MyPropertiesPanel.install = function(Vue) {
Vue.component(MyPropertiesPanel.name, MyPropertiesPanel);
};
MyPropertiesPanel.install = function (Vue) {
Vue.component(MyPropertiesPanel.name, MyPropertiesPanel)
}
export default MyPropertiesPanel;
export default MyPropertiesPanel

View File

@ -15,11 +15,7 @@
>编辑</el-button
>
<el-divider direction="vertical" />
<el-button
size="small"
link
style="color: #ff4d4f"
@click="removeListener(scope.row, scope.$index)"
<el-button size="small" link style="color: #ff4d4f" @click="removeListener(scope.$index)"
>移除</el-button
>
</template>
@ -171,7 +167,7 @@
size="small"
link
style="color: #ff4d4f"
@click="removeListenerField(scope.row, scope.$index)"
@click="removeListenerField(scope.$index)"
>移除</el-button
>
</template>
@ -268,11 +264,11 @@ const props = defineProps({
})
const prefix = inject('prefix')
const width = inject('width')
const elementListenersList = ref([]) //
const listenerForm = ref({}) //
const elementListenersList = ref<any[]>([]) //
const listenerForm = ref<any>({}) //
const listenerFormModelVisible = ref(false) //
const fieldsListOfListener = ref([])
const listenerFieldForm = ref({}) //
const fieldsListOfListener = ref<any[]>([])
const listenerFieldForm = ref<any>({}) //
const listenerFieldFormModelVisible = ref(false) //
const editingListenerIndex = ref(-1) // -1
const editingListenerFieldIndex = ref(-1) // -1
@ -296,7 +292,7 @@ const resetListenersList = () => {
)
}
//
const openListenerForm = (listener, index) => {
const openListenerForm = (listener, index?) => {
if (listener) {
listenerForm.value = initListenerForm(listener)
editingListenerIndex.value = index
@ -322,7 +318,7 @@ const openListenerForm = (listener, index) => {
})
}
//
const openListenerFieldForm = (field, index) => {
const openListenerFieldForm = (field, index?) => {
listenerFieldForm.value = field ? JSON.parse(JSON.stringify(field)) : {}
editingListenerFieldIndex.value = field ? index : -1
listenerFieldFormModelVisible.value = true

View File

@ -288,20 +288,7 @@
</div>
</template>
<script lang="ts" setup name="UserTaskListeners">
import { ref, inject, watch, nextTick } from 'vue'
import {
ElDialog,
ElForm,
ElFormItem,
ElSelect,
ElOption,
ElDivider,
ElTable,
ElTableColumn,
ElMessageBox,
ElButton,
ElDrawer
} from 'element-plus'
import { ElMessageBox } from 'element-plus'
import { createListenerObject, updateElementExtensions } from '../../utils'
import { initListenerForm, initListenerType, eventType, listenerType, fieldType } from './utilSelf'
const props = defineProps({
@ -310,17 +297,17 @@ const props = defineProps({
})
const prefix = inject('prefix')
const width = inject('width')
const elementListenersList = ref([])
const elementListenersList = ref<any[]>([])
const listenerEventTypeObject = ref(eventType)
const listenerTypeObject = ref(listenerType)
const listenerFormModelVisible = ref(false)
const listenerForm = ref({})
const listenerForm = ref<any>({})
const fieldTypeObject = ref(fieldType)
const fieldsListOfListener = ref([])
const fieldsListOfListener = ref<any[]>([])
const listenerFieldFormModelVisible = ref(false) //
const editingListenerIndex = ref(-1) // -1
const editingListenerFieldIndex = ref(-1) // -1
const listenerFieldForm = ref({}) //
const listenerFieldForm = ref<any>({}) //
const bpmnElement = ref()
const bpmnElementListeners = ref()
const otherExtensionList = ref()
@ -342,7 +329,7 @@ const resetListenersList = () => {
initListenerType(listener)
)
}
const openListenerForm = (listener, index) => {
const openListenerForm = (listener, index?) => {
if (listener) {
listenerForm.value = initListenerForm(listener)
editingListenerIndex.value = index
@ -366,7 +353,7 @@ const openListenerForm = (listener, index) => {
})
}
//
const removeListener = (listener, index) => {
const removeListener = (listener, index?) => {
console.log(listener, 'listener')
ElMessageBox.confirm('确认移除该监听器吗?', '提示', {
confirmButtonText: '确 认',
@ -408,7 +395,7 @@ const saveListenerConfig = async () => {
listenerForm.value = {}
}
//
const openListenerFieldForm = (field, index) => {
const openListenerFieldForm = (field, index?) => {
listenerFieldForm.value = field ? JSON.parse(JSON.stringify(field)) : {}
editingListenerFieldIndex.value = field ? index : -1
listenerFieldFormModelVisible.value = true

View File

@ -1,4 +1,4 @@
export const template = isTaskListener => {
export const template = (isTaskListener) => {
return `
<div class="panel-tab__content">
<el-table :data="elementListenersList" size="small" border>
@ -97,20 +97,21 @@ export const template = isTaskListener => {
<el-input v-model="listenerForm.resource" clearable />
</el-form-item>
</template>
${isTaskListener
? "<el-form-item label='定时器类型' prop='eventDefinitionType' key='eventDefinitionType'>" +
"<el-select v-model='listenerForm.eventDefinitionType'>" +
"<el-option label='日期' value='date' />" +
"<el-option label='持续时长' value='duration' />" +
"<el-option label='循环' value='cycle' />" +
"<el-option label='无' value='' />" +
"</el-select>" +
"</el-form-item>" +
"<el-form-item v-if='!!listenerForm.eventDefinitionType' label='定时器' prop='eventDefinitions' key='eventDefinitions'>" +
"<el-input v-model='listenerForm.eventDefinitions' clearable />" +
"</el-form-item>"
: ""
}
${
isTaskListener
? "<el-form-item label='定时器类型' prop='eventDefinitionType' key='eventDefinitionType'>" +
"<el-select v-model='listenerForm.eventDefinitionType'>" +
"<el-option label='日期' value='date' />" +
"<el-option label='持续时长' value='duration' />" +
"<el-option label='循环' value='cycle' />" +
"<el-option label='无' value='' />" +
'</el-select>' +
'</el-form-item>' +
"<el-form-item v-if='!!listenerForm.eventDefinitionType' label='定时器' prop='eventDefinitions' key='eventDefinitions'>" +
"<el-input v-model='listenerForm.eventDefinitions' clearable />" +
'</el-form-item>'
: ''
}
</el-form>
<el-divider />
<p class="listener-filed__title">

View File

@ -69,8 +69,6 @@
</template>
<script setup lang="ts" name="ElementMultiInstance">
import { inject, ref, onBeforeUnmount, watch, toRaw } from 'vue'
import { ElForm, ElFormItem, ElSelect, ElOption, ElCheckbox, ElInput } from 'element-plus'
const props = defineProps({
businessObject: Object,
type: String
@ -86,7 +84,7 @@ const defaultLoopInstanceForm = ref({
asyncBefore: false,
exclusive: false
})
const loopInstanceForm = ref({})
const loopInstanceForm = ref<any>({})
const bpmnElement = ref(null)
const multiLoopInstance = ref(null)

View File

@ -17,8 +17,6 @@
</template>
<script setup lang="ts" name="ElementOtherConfig">
import { ref, watch, nextTick, onBeforeUnmount, toRaw } from 'vue'
import { ElInput } from 'element-plus'
const props = defineProps({
id: String
})

View File

@ -53,18 +53,7 @@
</template>
<script setup lang="ts" name="ElementProperties">
import { ref, inject, nextTick, watch, toRaw } from 'vue'
import {
ElMessageBox,
ElDialog,
ElButton,
ElForm,
ElFormItem,
ElTable,
ElTableColumn,
ElDivider,
ElInput
} from 'element-plus'
import { ElMessageBox } from 'element-plus'
const props = defineProps({
id: String,
type: String
@ -72,8 +61,8 @@ const props = defineProps({
const prefix = inject('prefix')
// const width = inject('width')
const elementPropertyList = ref([])
const propertyForm = ref({})
const elementPropertyList = ref<any[]>([])
const propertyForm = ref<any>({})
const editingPropertyIndex = ref(-1)
const propertyFormModelVisible = ref(false)
const bpmnElement = ref()

View File

@ -57,11 +57,11 @@ import {
ElInput
} from 'element-plus'
import { ref, computed, onMounted } from 'vue'
const signalList = ref([])
const messageList = ref([])
const signalList = ref<any[]>([])
const messageList = ref<any[]>([])
const modelVisible = ref(false)
const modelType = ref('')
const modelObjectForm = ref({})
const modelObjectForm = ref<any>({})
const rootElements = ref()
const messageIdMap = ref()
const signalIdMap = ref()

View File

@ -21,8 +21,6 @@
</template>
<script setup lang="ts" name="ElementTaskConfig">
import { ref, watch } from 'vue'
import { ElForm, ElFormItem, ElCheckbox } from 'element-plus'
import UserTask from './task-components/UserTask.vue'
import ScriptTask from './task-components/ScriptTask.vue'
import ReceiveTask from './task-components/ReceiveTask.vue'

View File

@ -49,19 +49,20 @@
</template>
<script setup lang="ts" name="ReceiveTask">
import { ref, watch, onBeforeUnmount, onMounted, nextTick, toRaw } from 'vue'
import { ElMessage, ElFormItem, ElDialog, ElForm, ElSelect, ElOption } from 'element-plus'
const props = defineProps({
id: String,
type: String
})
const message = useMessage()
const bindMessageId = ref('')
const newMessageForm = ref({})
const messageMap = ref({})
const newMessageForm = ref<any>({})
const messageMap = ref<any>({})
const messageModelVisible = ref(false)
const bpmnElement = ref()
const bpmnMessageRefsMap = ref()
const bpmnRootElements = ref()
const bpmnElement = ref<any>()
const bpmnMessageRefsMap = ref<any>()
const bpmnRootElements = ref<any>()
const getBindMessage = () => {
bpmnElement.value = window.bpmnInstances.bpmnElement
@ -73,7 +74,7 @@ const openMessageModel = () => {
}
const createNewMessage = () => {
if (messageMap.value[newMessageForm.value.id]) {
ElMessage.error('该消息已存在请修改id后重新保存')
message.error('该消息已存在请修改id后重新保存')
return
}
const newMessage = window.bpmnInstances.moddle.create('bpmn:Message', newMessageForm.value)

View File

@ -57,7 +57,7 @@ const defaultTaskForm = ref({
resource: '',
resultVariable: ''
})
const scriptTaskForm = ref({})
const scriptTaskForm = ref<any>({})
const bpmnElement = ref()
const resetTaskForm = () => {

View File

@ -38,8 +38,6 @@
</template>
<script setup lang="ts" name="UserTask">
import { ref, watch, nextTick, onBeforeUnmount, toRaw } from 'vue'
import { ElLink, ElFormItem, ElInput } from 'element-plus'
const props = defineProps({
id: String,
type: String
@ -52,7 +50,7 @@ const defaultTaskForm = ref({
followUpDate: '',
priority: ''
})
const userTaskForm = ref({})
const userTaskForm = ref<any>({})
// const mockData=ref([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
const bpmnElement = ref()
const resetTaskForm = () => {

View File

@ -5,7 +5,7 @@ $--color-danger: #ff4d4f;
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
@import "~element-ui/packages/theme-chalk/src/index";
@import '~element-ui/packages/theme-chalk/src/index';
.el-table td,
.el-table th {
@ -20,7 +20,7 @@ $--font-path: '~element-ui/lib/theme-chalk/fonts';
box-sizing: border-box;
border-bottom: 1px solid #e8e8e8;
}
div[class^="el-drawer"]:focus,
div[class^='el-drawer']:focus,
span:focus {
outline: none;
}
@ -63,7 +63,7 @@ span:focus {
width: 100%;
}
.el-divider:not(.el-divider--horizontal) {
margin: 0 8px ;
margin: 0 8px;
}
.el-divider.el-divider--horizontal {
margin: 16px 0;

View File

@ -1,2 +1,2 @@
@import "./process-designer.scss";
@import "./process-panel.scss";
@import './process-designer.scss';
@import './process-panel.scss';

View File

@ -1,5 +1,5 @@
const hljs = require("highlight.js/lib/core");
hljs.registerLanguage("xml", require("highlight.js/lib/languages/xml"));
hljs.registerLanguage("json", require("highlight.js/lib/languages/json"));
const hljs = require('highlight.js/lib/core')
hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml'))
hljs.registerLanguage('json', require('highlight.js/lib/languages/json'))
module.exports = hljs;
module.exports = hljs

View File

@ -1,14 +1,14 @@
import BpmnRenderer from "bpmn-js/lib/draw/BpmnRenderer";
import BpmnRenderer from 'bpmn-js/lib/draw/BpmnRenderer'
export default function CustomRenderer(config, eventBus, styles, pathMap, canvas, textRenderer) {
BpmnRenderer.call(this, config, eventBus, styles, pathMap, canvas, textRenderer, 2000);
BpmnRenderer.call(this, config, eventBus, styles, pathMap, canvas, textRenderer, 2000)
this.handlers["label"] = function() {
return null;
};
this.handlers['label'] = function () {
return null
}
}
const F = function() {}; // 核心,利用空对象作为中介;
F.prototype = BpmnRenderer.prototype; // 核心将父类的原型赋值给空对象F
CustomRenderer.prototype = new F(); // 核心,将 F的实例赋值给子类
CustomRenderer.prototype.constructor = CustomRenderer; // 修复子类CustomRenderer的构造器指向防止原型链的混乱
const F = function () {} // 核心,利用空对象作为中介;
F.prototype = BpmnRenderer.prototype // 核心将父类的原型赋值给空对象F
CustomRenderer.prototype = new F() // 核心,将 F的实例赋值给子类
CustomRenderer.prototype.constructor = CustomRenderer // 修复子类CustomRenderer的构造器指向防止原型链的混乱

View File

@ -1,6 +1,6 @@
import CustomRenderer from "./CustomRenderer";
import CustomRenderer from './CustomRenderer'
export default {
__init__: ["customRenderer"],
customRenderer: ["type", CustomRenderer]
};
__init__: ['customRenderer'],
customRenderer: ['type', CustomRenderer]
}

View File

@ -1,16 +1,16 @@
import BpmnRules from "bpmn-js/lib/features/rules/BpmnRules";
import inherits from "inherits";
import BpmnRules from 'bpmn-js/lib/features/rules/BpmnRules'
import inherits from 'inherits'
export default function CustomRules(eventBus) {
BpmnRules.call(this, eventBus);
BpmnRules.call(this, eventBus)
}
inherits(CustomRules, BpmnRules);
inherits(CustomRules, BpmnRules)
CustomRules.prototype.canDrop = function() {
return false;
};
CustomRules.prototype.canDrop = function () {
return false
}
CustomRules.prototype.canMove = function() {
return false;
};
CustomRules.prototype.canMove = function () {
return false
}

View File

@ -1,6 +1,6 @@
import CustomRules from "./CustomRules";
import CustomRules from './CustomRules'
export default {
__init__: ["customRules"],
customRules: ["type", CustomRules]
};
__init__: ['customRules'],
customRules: ['type', CustomRules]
}

View File

@ -1,39 +1,39 @@
//outside.js
const ctx = "@@clickoutsideContext";
const ctx = '@@clickoutsideContext'
export default {
bind(el, binding, vnode) {
const ele = el;
const documentHandler = e => {
const ele = el
const documentHandler = (e) => {
if (!vnode.context || ele.contains(e.target)) {
return false;
return false
}
// 调用指令回调
if (binding.expression) {
vnode.context[el[ctx].methodName](e);
vnode.context[el[ctx].methodName](e)
} else {
el[ctx].bindingFn(e);
el[ctx].bindingFn(e)
}
};
}
// 将方法添加到ele
ele[ctx] = {
documentHandler,
methodName: binding.expression,
bindingFn: binding.value
};
}
setTimeout(() => {
document.addEventListener("touchstart", documentHandler); // 为document绑定事件
});
document.addEventListener('touchstart', documentHandler) // 为document绑定事件
})
},
update(el, binding) {
const ele = el;
ele[ctx].methodName = binding.expression;
ele[ctx].bindingFn = binding.value;
const ele = el
ele[ctx].methodName = binding.expression
ele[ctx].bindingFn = binding.value
},
unbind(el) {
document.removeEventListener("touchstart", el[ctx].documentHandler); // 解绑
delete el[ctx];
document.removeEventListener('touchstart', el[ctx].documentHandler) // 解绑
delete el[ctx]
}
};
}

View File

@ -1,10 +1,10 @@
export function debounce(fn, delay = 500) {
let timer;
return function(...args) {
let timer
return function (...args) {
if (timer) {
clearTimeout(timer);
timer = null;
clearTimeout(timer)
timer = null
}
timer = setTimeout(fn.bind(this, ...args), delay);
};
timer = setTimeout(fn.bind(this, ...args), delay)
}
}

View File

@ -1,63 +0,0 @@
class Log {
static type = ["primary", "success", "warn", "error", "info"];
static typeColor(type = "default") {
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;
case "default":
color = "#35495E";
break;
default:
color = type;
break;
}
return color;
}
static print(text, type = "default", back = false) {
if (typeof text === "object") {
// 如果是對象則調用打印對象方式
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} `, `color: ${this.typeColor(type)};`);
}
}
static pretty(title, text, type = "primary") {
if (typeof text === "object") {
console.log(
`%c ${title} %c`,
`background:${this.typeColor(type)};border:1px solid ${this.typeColor(type)}; padding: 1px; border-radius: 4px 0 0 4px; color: #fff;`
);
console.dir(text);
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"
);
}
}
export default Log;

View File

@ -1,50 +1,50 @@
function xmlStr2XmlObj(xmlStr) {
let xmlObj = {};
let xmlObj = {}
if (document.all) {
const xmlDom = new window.ActiveXObject("Microsoft.XMLDOM");
xmlDom.loadXML(xmlStr);
xmlObj = xmlDom;
const xmlDom = new window.ActiveXObject('Microsoft.XMLDOM')
xmlDom.loadXML(xmlStr)
xmlObj = xmlDom
} else {
xmlObj = new DOMParser().parseFromString(xmlStr, "text/xml");
xmlObj = new DOMParser().parseFromString(xmlStr, 'text/xml')
}
return xmlObj;
return xmlObj
}
function xml2json(xml) {
try {
let obj = {};
let obj = {}
if (xml.children.length > 0) {
for (let i = 0; i < xml.children.length; i++) {
const item = xml.children.item(i);
const nodeName = item.nodeName;
if (typeof obj[nodeName] == "undefined") {
obj[nodeName] = xml2json(item);
const item = xml.children.item(i)
const nodeName = item.nodeName
if (typeof obj[nodeName] == 'undefined') {
obj[nodeName] = xml2json(item)
} else {
if (typeof obj[nodeName].push == "undefined") {
const old = obj[nodeName];
obj[nodeName] = [];
obj[nodeName].push(old);
if (typeof obj[nodeName].push == 'undefined') {
const old = obj[nodeName]
obj[nodeName] = []
obj[nodeName].push(old)
}
obj[nodeName].push(xml2json(item));
obj[nodeName].push(xml2json(item))
}
}
} else {
obj = xml.textContent;
obj = xml.textContent
}
return obj;
return obj
} catch (e) {
console.log(e.message);
console.log(e.message)
}
}
function xmlObj2json(xml) {
const xmlObj = xmlStr2XmlObj(xml);
console.log(xmlObj);
let jsonObj = {};
const xmlObj = xmlStr2XmlObj(xml)
console.log(xmlObj)
let jsonObj = {}
if (xmlObj.childNodes.length > 0) {
jsonObj = xml2json(xmlObj);
jsonObj = xml2json(xmlObj)
}
return jsonObj;
return jsonObj
}
export default xmlObj2json;
export default xmlObj2json

View File

@ -1,10 +1,4 @@
import axios, {
AxiosInstance,
AxiosRequestConfig,
AxiosRequestHeaders,
AxiosResponse,
AxiosError
} from 'axios'
import axios, { AxiosInstance, AxiosRequestHeaders, AxiosResponse, AxiosError } from 'axios'
import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
import qs from 'qs'
import { config } from '@/config/axios/config'
@ -41,7 +35,7 @@ const service: AxiosInstance = axios.create({
// request拦截器
service.interceptors.request.use(
(config: AxiosRequestConfig) => {
(config) => {
// 是否需要设置 token
let isToken = (config!.headers || {}).isToken === false
whiteList.some((v) => {

View File

@ -5,7 +5,7 @@ import * as NotifyMessageApi from '@/api/system/notify/message'
const { push } = useRouter()
const activeName = ref('notice')
const unreadCount = ref(0) //
const list = ref([]) //
const list = ref<any[]>([]) //
//
const getList = async () => {

View File

@ -52,9 +52,10 @@ import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css'
import hljs from 'highlight.js' //导入代码高亮文件
import 'highlight.js/styles/github.css' //导入代码高亮样式 新版
import Logger from '@/utils/Logger'
// 本地开发模式 全局引入 element-plus 样式,加快第一次进入速度
if (isDevMode()) {
console.info(isDevMode())
if (isDevMode() == true) {
import('element-plus/dist/index.css')
}
@ -94,3 +95,5 @@ const setupAll = async () => {
}
setupAll()
Logger.prettyPrimary(`欢迎使用`, import.meta.env.VITE_APP_TITLE)

View File

@ -23,13 +23,17 @@ declare module '@vue/runtime-core' {
Editor: typeof import('./../components/Editor/src/Editor.vue')['default']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElButton: typeof import('element-plus/es')['ElButton']
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
ElCard: typeof import('element-plus/es')['ElCard']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol']
ElCollapse: typeof import('element-plus/es')['ElCollapse']
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
ElCollapseTransition: typeof import('element-plus/es')['ElCollapseTransition']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
@ -47,26 +51,21 @@ declare module '@vue/runtime-core' {
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElLink: typeof import('element-plus/es')['ElLink']
ElOption: typeof import('element-plus/es')['ElOption']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElUpload: typeof import('element-plus/es')['ElUpload']
Error: typeof import('./../components/Error/src/Error.vue')['default']
FlowCondition: typeof import('./../components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue')['default']

View File

@ -0,0 +1,100 @@
const isArray = function (obj: any): boolean {
return Object.prototype.toString.call(obj) === '[object Array]'
}
const Logger = () => {}
Logger.typeColor = function (type: string) {
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
}
Logger.print = function (type = 'default', text: any, back = false) {
if (typeof text === 'object') {
// 如果是對象則調用打印對象方式
isArray(text) ? console.table(text) : console.dir(text)
return
}
if (back) {
// 如果是打印帶背景圖的
console.log(
`%c ${text} `,
`background:${Logger.typeColor(type)}; padding: 2px; border-radius: 4px; color: #fff;`
)
} else {
console.log(
`%c ${text} `,
`border: 1px solid ${Logger.typeColor(type)};
padding: 2px; border-radius: 4px;
color: ${Logger.typeColor(type)};`
)
}
}
Logger.printBack = function (type = 'primary', text) {
this.print(type, text, true)
}
Logger.pretty = function (type = 'primary', title, text) {
if (typeof text === 'object') {
console.group('Console Group', title)
console.log(
`%c ${title}`,
`background:${Logger.typeColor(type)};border:1px solid ${Logger.typeColor(type)};
padding: 1px; border-radius: 4px; color: #fff;`
)
isArray(text) ? console.table(text) : console.dir(text)
console.groupEnd()
return
}
console.log(
`%c ${title} %c ${text} %c`,
`background:${Logger.typeColor(type)};border:1px solid ${Logger.typeColor(type)};
padding: 1px; border-radius: 4px 0 0 4px; color: #fff;`,
`border:1px solid ${Logger.typeColor(type)};
padding: 1px; border-radius: 0 4px 4px 0; color: ${Logger.typeColor(type)};`,
'background:transparent'
)
}
Logger.prettyPrimary = function (title, ...text) {
text.forEach((t) => this.pretty('primary', title, t))
}
Logger.prettySuccess = function (title, ...text) {
text.forEach((t) => this.pretty('success', title, t))
}
Logger.prettyWarn = function (title, ...text) {
text.forEach((t) => this.pretty('warn', title, t))
}
Logger.prettyError = function (title, ...text) {
text.forEach((t) => this.pretty('error', title, t))
}
Logger.prettyInfo = function (title, ...text) {
text.forEach((t) => this.pretty('info', title, t))
}
export default Logger

View File

@ -212,9 +212,9 @@ const { proxy } = getCurrentInstance()
// ========== ==========
const id = query.id as unknown as number
const processInstanceLoading = ref(false) //
const processInstance = ref({}) //
const runningTasks = ref([]) //
const auditForms = ref([]) //
const processInstance = ref<any>({}) //
const runningTasks = ref<any[]>([]) //
const auditForms = ref<any[]>([]) //
const auditRule = reactive({
reason: [{ required: true, message: '审批建议不能为空', trigger: 'blur' }]
})
@ -260,7 +260,7 @@ const detailForm = ref({
// ========== ==========
const tasksLoad = ref(true)
const tasks = ref([])
const tasks = ref<any[]>([])
const getTimelineItemIcon = (item) => {
if (item.result === 1) {
@ -304,7 +304,7 @@ const updateAssigneeRules = ref({
assigneeUserId: [{ required: true, message: '新审批人不能为空', trigger: 'change' }]
})
const updateAssigneeFormRef = ref()
const userOptions = ref([])
const userOptions = ref<any[]>([])
//
const handleUpdateAssignee = (task) => {

View File

@ -16,7 +16,7 @@
<template #toMail_default="{ row }">
<div>{{ row.toMail }}</div>
<div v-if="row.userType && row.userId">
<dict-tag :type="DICT_TYPE.USER_TYPE" :value="row.userType" />{{ '(' + row.userId + ')' }}
<DictTag :type="DICT_TYPE.USER_TYPE" :value="row.userType" />{{ '(' + row.userId + ')' }}
</div>
</template>
<template #actionbtns_default="{ row }">
@ -46,6 +46,7 @@
</template>
<script setup lang="ts" name="MailLog">
// import
import { DICT_TYPE } from '@/utils/dict'
import { allSchemas } from './log.data'
import * as MailLogApi from '@/api/system/mail/log'
import * as MailAccountApi from '@/api/system/mail/account'
@ -61,7 +62,7 @@ const [registerTable] = useXTable({
params: queryParams,
getListApi: MailLogApi.getMailLogPageApi
})
const accountOptions = ref([]) //
const accountOptions = ref<any[]>([]) //
//
const modelVisible = ref(false) //

View File

@ -152,7 +152,7 @@ const [registerTable, { reload, deleteData }] = useXTable({
getListApi: MailTemplateApi.getMailTemplatePageApi,
deleteApi: MailTemplateApi.deleteMailTemplateApi
})
const accountOptions = ref([]) //
const accountOptions = ref<any[]>([]) //
//
const modelVisible = ref(false) //

View File

@ -202,7 +202,7 @@ const submitForm = async () => {
const sendForm = ref({
content: '',
params: {},
userId: undefined,
userId: 0,
templateCode: '',
templateParams: {}
})

View File

@ -0,0 +1,93 @@
<template>
<!-- 弹窗 -->
<XModal id="PostForm" :loading="modelLoading" v-model="modelVisible" :title="modelTitle">
<!-- 表单添加/修改 -->
<Form
ref="formRef"
v-if="['create', 'update'].includes(actionType)"
:schema="allSchemas.formSchema"
:rules="rules"
/>
<!-- 表单详情 -->
<Descriptions
v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema"
:data="detailData"
/>
<template #footer>
<!-- 按钮保存 -->
<XButton
v-if="['create', 'update'].includes(actionType)"
type="primary"
:title="t('action.save')"
:loading="actionLoading"
@click="submitForm()"
/>
<!-- 按钮关闭 -->
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="modelVisible = false" />
</template>
</XModal>
</template>
<script setup lang="ts">
import type { FormExpose } from '@/components/Form'
import * as PostApi from '@/api/system/post'
import { rules, allSchemas } from './post.data'
const { t } = useI18n() //
const message = useMessage() //
const emit = defineEmits(['success'])
//
const modelVisible = ref(false) //
const modelTitle = ref('edit') //
const modelLoading = ref(false) // loading
const actionType = ref('') //
const actionLoading = ref(false) // Loading
const formRef = ref<FormExpose>() // Ref
const detailData = ref() // Ref
const openModal = async (type: string, rowId?: number) => {
modelLoading.value = true
modelTitle.value = t('action.' + type)
actionType.value = type
modelVisible.value = true
//
if (rowId) {
const res = await PostApi.getPostApi(rowId)
if (type === 'update') {
unref(formRef)?.setValues(res)
} else if (type === 'detail') {
detailData.value = res
}
}
modelLoading.value = false
}
// /
const submitForm = async () => {
const elForm = unref(formRef)?.getElFormRef()
if (!elForm) return
elForm.validate(async (valid) => {
if (valid) {
actionLoading.value = true
//
try {
const data = unref(formRef)?.formModel as PostApi.PostVO
if (actionType.value === 'create') {
await PostApi.createPostApi(data)
message.success(t('common.createSuccess'))
} else {
await PostApi.updatePostApi(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
emit('success')
} finally {
actionLoading.value = false
}
}
})
}
defineExpose({ openModal: openModal })
</script>

View File

@ -9,7 +9,7 @@
preIcon="ep:zoom-in"
:title="t('action.add')"
v-hasPermi="['system:post:create']"
@click="openModel('create')"
@click="openModal('create')"
/>
<!-- 操作导出 -->
<XButton
@ -25,13 +25,13 @@
<XTextButton
preIcon="ep:edit"
v-hasPermi="['system:post:update']"
@click="openModel('update', row.id)"
@click="openModal('update', row.id)"
/>
<!-- 操作详情 -->
<XTextButton
preIcon="ep:view"
v-hasPermi="['system:post:query']"
@click="openModel('detail', row.id)"
@click="openModal('detail', row.id)"
/>
<!-- 操作删除 -->
<XTextButton
@ -42,43 +42,16 @@
</template>
</XTable>
</ContentWrap>
<!-- 弹窗 -->
<XModal id="postModel" :loading="modelLoading" v-model="modelVisible" :title="modelTitle">
<!-- 表单添加/修改 -->
<Form
ref="formRef"
v-if="['create', 'update'].includes(actionType)"
:schema="allSchemas.formSchema"
:rules="rules"
/>
<!-- 表单详情 -->
<Descriptions
v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema"
:data="detailData"
/>
<template #footer>
<!-- 按钮保存 -->
<XButton
v-if="['create', 'update'].includes(actionType)"
type="primary"
:title="t('action.save')"
:loading="actionLoading"
@click="submitForm()"
/>
<!-- 按钮关闭 -->
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="modelVisible = false" />
</template>
</XModal>
<PostForm ref="modalRef" @success="reload()" />
</template>
<script setup lang="ts" name="Post">
import type { FormExpose } from '@/components/Form'
// import
import * as PostApi from '@/api/system/post'
import { rules, allSchemas } from './post.data'
import { allSchemas } from './post.data'
import PostForm from './PostForm.vue'
const { t } = useI18n() //
const message = useMessage() //
const modalRef = ref()
//
const [registerTable, { reload, deleteData, exportList }] = useXTable({
allSchemas: allSchemas,
@ -86,56 +59,8 @@ const [registerTable, { reload, deleteData, exportList }] = useXTable({
deleteApi: PostApi.deletePostApi,
exportListApi: PostApi.exportPostApi
})
//
const modelVisible = ref(false) //
const modelTitle = ref('edit') //
const modelLoading = ref(false) // loading
const actionType = ref('') //
const actionLoading = ref(false) // Loading
const formRef = ref<FormExpose>() // Ref
const detailData = ref() // Ref
const openModel = async (type: string, rowId?: number) => {
modelLoading.value = true
modelTitle.value = t('action.' + type)
actionType.value = type
modelVisible.value = true
//
if (rowId) {
const res = await PostApi.getPostApi(rowId)
if (type === 'update') {
unref(formRef)?.setValues(res)
} else if (type === 'detail') {
detailData.value = res
}
}
modelLoading.value = false
}
// /
const submitForm = async () => {
const elForm = unref(formRef)?.getElFormRef()
if (!elForm) return
elForm.validate(async (valid) => {
if (valid) {
actionLoading.value = true
//
try {
const data = unref(formRef)?.formModel as PostApi.PostVO
if (actionType.value === 'create') {
await PostApi.createPostApi(data)
message.success(t('common.createSuccess'))
} else {
await PostApi.updatePostApi(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
} finally {
actionLoading.value = false
//
reload()
}
}
})
const openModal = (type: string, rowId?: number) => {
modalRef.value.openModal(type, rowId)
}
</script>

View File

@ -29,7 +29,8 @@
"element-plus/global",
"@types/intro.js",
"@types/qrcode",
"vite-plugin-svg-icons/client"
"vite-plugin-svg-icons/client",
"@form-create/element-ui/types"
],
"typeRoots": ["./node_modules/@types/", "./types"]
},