mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 10:36:31 +08:00
commit:支持服务、接收任务,支持串行会签,修复bug
This commit is contained in:
1512
OrangeFormsOpen-VUE3/package-lock.json
generated
1512
OrangeFormsOpen-VUE3/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -128,6 +128,16 @@ const SysFlowTaskOperationType = new DictionaryBase('任务操作类型', [
|
|||||||
name: '指定审批人',
|
name: '指定审批人',
|
||||||
symbol: 'SET_ASSIGNEE',
|
symbol: 'SET_ASSIGNEE',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'multi_before_consign',
|
||||||
|
name: '前加签(串行会签)',
|
||||||
|
symbol: 'BFORE_CONSIGN',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'multi_after_consign',
|
||||||
|
name: '后加签(串行会签)',
|
||||||
|
symbol: 'AFTER_CONSIGN',
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const SysFlowTaskType = new DictionaryBase('工作流任务类型', [
|
const SysFlowTaskType = new DictionaryBase('工作流任务类型', [
|
||||||
@@ -278,6 +288,21 @@ const FlowNodeType = new DictionaryBase('钉钉节点类型', [
|
|||||||
name: '并行分支',
|
name: '并行分支',
|
||||||
symbol: 'PARALLEL_BRANCH',
|
symbol: 'PARALLEL_BRANCH',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 6,
|
||||||
|
name: '服务任务',
|
||||||
|
symbol: 'SERVICE_TASK',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 7,
|
||||||
|
name: '接收任务',
|
||||||
|
symbol: 'RECEIVE_TASK',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 100,
|
||||||
|
name: '子流程',
|
||||||
|
symbol: 'SUB_PROCESS',
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const DiagramType = new DictionaryBase('', [
|
const DiagramType = new DictionaryBase('', [
|
||||||
|
|||||||
@@ -510,6 +510,7 @@ const getTablePictureList = (tableColumn: ANY_OBJECT, row: ANY_OBJECT) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const formatListData = (data: ANY_OBJECT) => {
|
const formatListData = (data: ANY_OBJECT) => {
|
||||||
|
if (data == null) return;
|
||||||
Object.keys(data).forEach(key => {
|
Object.keys(data).forEach(key => {
|
||||||
let subData = data[key];
|
let subData = data[key];
|
||||||
if (typeof subData === 'object' && key.indexOf('DictMap') === -1) {
|
if (typeof subData === 'object' && key.indexOf('DictMap') === -1) {
|
||||||
|
|||||||
@@ -390,6 +390,7 @@ const getPrintParamItem = (row: ANY_OBJECT, printParamList: ANY_OBJECT[]) => {
|
|||||||
return param;
|
return param;
|
||||||
};
|
};
|
||||||
const formatListData = (data: ANY_OBJECT) => {
|
const formatListData = (data: ANY_OBJECT) => {
|
||||||
|
if (data == null) return;
|
||||||
Object.keys(data).forEach(key => {
|
Object.keys(data).forEach(key => {
|
||||||
let subData = data[key];
|
let subData = data[key];
|
||||||
if (typeof subData === 'object' && key.indexOf('DictMap') === -1) {
|
if (typeof subData === 'object' && key.indexOf('DictMap') === -1) {
|
||||||
|
|||||||
@@ -256,6 +256,8 @@ const getButtonType = (type: string) => {
|
|||||||
case SysFlowTaskOperationType.TRANSFER:
|
case SysFlowTaskOperationType.TRANSFER:
|
||||||
case SysFlowTaskOperationType.CO_SIGN:
|
case SysFlowTaskOperationType.CO_SIGN:
|
||||||
case SysFlowTaskOperationType.SIGN_REDUCTION:
|
case SysFlowTaskOperationType.SIGN_REDUCTION:
|
||||||
|
case SysFlowTaskOperationType.BFORE_CONSIGN:
|
||||||
|
case SysFlowTaskOperationType.AFTER_CONSIGN:
|
||||||
case SysFlowTaskOperationType.MULTI_AGREE:
|
case SysFlowTaskOperationType.MULTI_AGREE:
|
||||||
case SysFlowTaskOperationType.MULTI_SIGN:
|
case SysFlowTaskOperationType.MULTI_SIGN:
|
||||||
case SysFlowTaskOperationType.SET_ASSIGNEE:
|
case SysFlowTaskOperationType.SET_ASSIGNEE:
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ watch(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
deep: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -108,9 +108,13 @@
|
|||||||
<el-col
|
<el-col
|
||||||
:span="24"
|
:span="24"
|
||||||
v-if="
|
v-if="
|
||||||
dialogParams.operation.type !== SysFlowTaskOperationType.CO_SIGN &&
|
[
|
||||||
dialogParams.operation.type !== SysFlowTaskOperationType.SIGN_REDUCTION &&
|
SysFlowTaskOperationType.CO_SIGN,
|
||||||
dialogParams.operation.type !== SysFlowTaskOperationType.MULTI_SIGN
|
SysFlowTaskOperationType.SIGN_REDUCTION,
|
||||||
|
SysFlowTaskOperationType.BFORE_CONSIGN,
|
||||||
|
SysFlowTaskOperationType.AFTER_CONSIGN,
|
||||||
|
SysFlowTaskOperationType.MULTI_SIGN,
|
||||||
|
].indexOf(dialogParams.operation.type) === -1
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<el-form-item label="审批意见" prop="message">
|
<el-form-item label="审批意见" prop="message">
|
||||||
@@ -206,7 +210,7 @@ const loadTaskWidgetDropdownData = (): Promise<ListData<ANY_OBJECT>> => {
|
|||||||
taskId: dialogParams.value.taskId,
|
taskId: dialogParams.value.taskId,
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
resolve({ dataList: res.data.dataList });
|
resolve({ dataList: res.data });
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
reject(e);
|
reject(e);
|
||||||
@@ -238,6 +242,8 @@ const showAssignSelect = computed(() => {
|
|||||||
[
|
[
|
||||||
SysFlowTaskOperationType.TRANSFER,
|
SysFlowTaskOperationType.TRANSFER,
|
||||||
SysFlowTaskOperationType.CO_SIGN,
|
SysFlowTaskOperationType.CO_SIGN,
|
||||||
|
SysFlowTaskOperationType.BFORE_CONSIGN,
|
||||||
|
SysFlowTaskOperationType.AFTER_CONSIGN,
|
||||||
SysFlowTaskOperationType.SET_ASSIGNEE,
|
SysFlowTaskOperationType.SET_ASSIGNEE,
|
||||||
].indexOf(dialogParams.value.operation.type) !== -1 || showAssignSelect
|
].indexOf(dialogParams.value.operation.type) !== -1 || showAssignSelect
|
||||||
);
|
);
|
||||||
@@ -248,6 +254,8 @@ const multiSelect = computed(() => {
|
|||||||
[
|
[
|
||||||
SysFlowTaskOperationType.CO_SIGN,
|
SysFlowTaskOperationType.CO_SIGN,
|
||||||
SysFlowTaskOperationType.MULTI_SIGN,
|
SysFlowTaskOperationType.MULTI_SIGN,
|
||||||
|
SysFlowTaskOperationType.BFORE_CONSIGN,
|
||||||
|
SysFlowTaskOperationType.AFTER_CONSIGN,
|
||||||
SysFlowTaskOperationType.TRANSFER,
|
SysFlowTaskOperationType.TRANSFER,
|
||||||
SysFlowTaskOperationType.SET_ASSIGNEE,
|
SysFlowTaskOperationType.SET_ASSIGNEE,
|
||||||
].indexOf(dialogParams.value.operation.type) !== -1
|
].indexOf(dialogParams.value.operation.type) !== -1
|
||||||
@@ -287,7 +295,9 @@ const onSelectAssignee = () => {
|
|||||||
showAssignee: false,
|
showAssignee: false,
|
||||||
showStartUser:
|
showStartUser:
|
||||||
dialogParams.value.operation.type !== SysFlowTaskOperationType.CO_SIGN &&
|
dialogParams.value.operation.type !== SysFlowTaskOperationType.CO_SIGN &&
|
||||||
dialogParams.value.operation.type !== SysFlowTaskOperationType.SIGN_REDUCTION,
|
dialogParams.value.operation.type !== SysFlowTaskOperationType.SIGN_REDUCTION &&
|
||||||
|
dialogParams.value.operation.type !== SysFlowTaskOperationType.BFORE_CONSIGN &&
|
||||||
|
dialogParams.value.operation.type !== SysFlowTaskOperationType.BFORE_CONSIGN,
|
||||||
multiple: multiSelect.value,
|
multiple: multiSelect.value,
|
||||||
usedUserIdList,
|
usedUserIdList,
|
||||||
filterObject: otherFilterObject,
|
filterObject: otherFilterObject,
|
||||||
|
|||||||
@@ -403,6 +403,7 @@ const onAddFlowEntryClick = () => {
|
|||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
refreshFormFlowEntry();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
@@ -430,6 +431,7 @@ const onEditFlowEntryClick = (row: ANY_OBJECT) => {
|
|||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
console.warn(e);
|
console.warn(e);
|
||||||
|
refreshFormFlowEntry();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -44,19 +44,23 @@ export const useFlowAction = (props: IProp) => {
|
|||||||
: props.variableList || thirdParams.value.variableList,
|
: props.variableList || thirdParams.value.variableList,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
// 加签
|
const submitConsign = (
|
||||||
const submitConsign = (assignee: Array<string> | string, isAdd = true) => {
|
assignee: Array<string> | string,
|
||||||
|
isAdd = true,
|
||||||
|
before: boolean | undefined = undefined,
|
||||||
|
) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const params = {
|
const params = {
|
||||||
taskId: dialogParams.value.taskId,
|
taskId: dialogParams.value.taskId,
|
||||||
processInstanceId: dialogParams.value.processInstanceId,
|
processInstanceId: dialogParams.value.processInstanceId,
|
||||||
newAssignees: Array.isArray(assignee) ? assignee : assignee.split(','),
|
newAssignees: Array.isArray(assignee) ? assignee : assignee.split(','),
|
||||||
isAdd,
|
isAdd,
|
||||||
|
before,
|
||||||
};
|
};
|
||||||
|
|
||||||
FlowOperationController.submitConsign(params)
|
FlowOperationController.submitConsign(params)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
ElMessage.success(isAdd ? '加签成功!' : '减签成功!');
|
ElMessage.success(before != null || isAdd ? '加签成功!' : '减签成功!');
|
||||||
resolve(true);
|
resolve(true);
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
@@ -102,6 +106,8 @@ export const useFlowAction = (props: IProp) => {
|
|||||||
switch (operation.type) {
|
switch (operation.type) {
|
||||||
case SysFlowTaskOperationType.CO_SIGN:
|
case SysFlowTaskOperationType.CO_SIGN:
|
||||||
case SysFlowTaskOperationType.SIGN_REDUCTION:
|
case SysFlowTaskOperationType.SIGN_REDUCTION:
|
||||||
|
case SysFlowTaskOperationType.BFORE_CONSIGN:
|
||||||
|
case SysFlowTaskOperationType.AFTER_CONSIGN:
|
||||||
title = SysFlowTaskOperationType.getValue(operation.type);
|
title = SysFlowTaskOperationType.getValue(operation.type);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -178,10 +178,22 @@ const preHandlerOperationThen = (
|
|||||||
) => {
|
) => {
|
||||||
// 加签、减签操作
|
// 加签、减签操作
|
||||||
if (
|
if (
|
||||||
operation.type === SysFlowTaskOperationType.CO_SIGN ||
|
[
|
||||||
operation.type === SysFlowTaskOperationType.SIGN_REDUCTION
|
SysFlowTaskOperationType.CO_SIGN,
|
||||||
|
SysFlowTaskOperationType.SIGN_REDUCTION,
|
||||||
|
SysFlowTaskOperationType.BFORE_CONSIGN,
|
||||||
|
SysFlowTaskOperationType.AFTER_CONSIGN,
|
||||||
|
].includes(operation.type)
|
||||||
) {
|
) {
|
||||||
submitConsign((res || {}).assignee, operation.type === SysFlowTaskOperationType.CO_SIGN)
|
// 串行会签前后加签参数
|
||||||
|
let before;
|
||||||
|
if (
|
||||||
|
operation.type === SysFlowTaskOperationType.BFORE_CONSIGN ||
|
||||||
|
operation.type === SysFlowTaskOperationType.AFTER_CONSIGN
|
||||||
|
) {
|
||||||
|
before = operation.type === SysFlowTaskOperationType.BFORE_CONSIGN;
|
||||||
|
}
|
||||||
|
submitConsign((res || {}).assignee, operation.type === SysFlowTaskOperationType.CO_SIGN, before)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
handlerClose();
|
handlerClose();
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ import camundaModdleDescriptor from './plugins/descriptor/camundaDescriptor.json
|
|||||||
import activitiModdleDescriptor from './plugins/descriptor/activitiDescriptor.json';
|
import activitiModdleDescriptor from './plugins/descriptor/activitiDescriptor.json';
|
||||||
import flowableModdleDescriptor from './plugins/descriptor/flowableDescriptor.json';
|
import flowableModdleDescriptor from './plugins/descriptor/flowableDescriptor.json';
|
||||||
// 标签解析 Extension
|
// 标签解析 Extension
|
||||||
import flowableModdleExtension from './plugins/extension-moddle/flowable/index';
|
import flowableModdleExtension from './plugins/extension-moddle/flowable/index.js';
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
[key: string]: [ANY_OBJECT | string | null, (ANY_OBJECT | null)?, (ANY_OBJECT | null)?];
|
[key: string]: [ANY_OBJECT | string | null, (ANY_OBJECT | null)?, (ANY_OBJECT | null)?];
|
||||||
@@ -553,7 +553,9 @@ const onSave = () => {
|
|||||||
emit('save', xml);
|
emit('save', xml);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {
|
||||||
|
console.log('取消保存');
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
bpmnModeler.saveXML({ format: true }).then(({ xml }: { xml: string }) => {
|
bpmnModeler.saveXML({ format: true }).then(({ xml }: { xml: string }) => {
|
||||||
emit('save', xml);
|
emit('save', xml);
|
||||||
|
|||||||
@@ -1169,6 +1169,23 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "TaskInfo",
|
||||||
|
"superClass": [ "Element" ],
|
||||||
|
"meta": {
|
||||||
|
"allowedIn": [
|
||||||
|
"bpmn:ServiceTask",
|
||||||
|
"bpmn:ReceiveTask"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "data",
|
||||||
|
"type": "String",
|
||||||
|
"isAttr": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "UserCandidateGroups",
|
"name": "UserCandidateGroups",
|
||||||
"superClass": ["Element"],
|
"superClass": ["Element"],
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
var some = require("min-dash").some;
|
||||||
|
|
||||||
|
var ALLOWED_TYPES = {
|
||||||
|
FailedJobRetryTimeCycle: ["bpmn:StartEvent", "bpmn:BoundaryEvent", "bpmn:IntermediateCatchEvent", "bpmn:Activity"],
|
||||||
|
Connector: ["bpmn:EndEvent", "bpmn:IntermediateThrowEvent"],
|
||||||
|
Field: ["bpmn:EndEvent", "bpmn:IntermediateThrowEvent"]
|
||||||
|
};
|
||||||
|
|
||||||
|
function is(element, type) {
|
||||||
|
return element && typeof element.$instanceOf === "function" && element.$instanceOf(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
function exists(element) {
|
||||||
|
return element && element.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
function includesType(collection, type) {
|
||||||
|
return (
|
||||||
|
exists(collection) &&
|
||||||
|
some(collection, function(element) {
|
||||||
|
return is(element, type);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function anyType(element, types) {
|
||||||
|
return some(types, function(type) {
|
||||||
|
return is(element, type);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function isAllowed(propName, propDescriptor, newElement) {
|
||||||
|
var name = propDescriptor.name,
|
||||||
|
types = ALLOWED_TYPES[name.replace(/flowable:/, "")];
|
||||||
|
|
||||||
|
return name === propName && anyType(newElement, types);
|
||||||
|
}
|
||||||
|
|
||||||
|
function FlowableModdleExtension(eventBus) {
|
||||||
|
eventBus.on(
|
||||||
|
"property.clone",
|
||||||
|
function(context) {
|
||||||
|
var newElement = context.newElement,
|
||||||
|
propDescriptor = context.propertyDescriptor;
|
||||||
|
|
||||||
|
this.canCloneProperty(newElement, propDescriptor);
|
||||||
|
},
|
||||||
|
this
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
FlowableModdleExtension.$inject = ["eventBus"];
|
||||||
|
|
||||||
|
FlowableModdleExtension.prototype.canCloneProperty = function(newElement, propDescriptor) {
|
||||||
|
if (isAllowed("flowable:FailedJobRetryTimeCycle", propDescriptor, newElement)) {
|
||||||
|
return (
|
||||||
|
includesType(newElement.eventDefinitions, "bpmn:TimerEventDefinition") ||
|
||||||
|
includesType(newElement.eventDefinitions, "bpmn:SignalEventDefinition") ||
|
||||||
|
is(newElement.loopCharacteristics, "bpmn:MultiInstanceLoopCharacteristics")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isAllowed("flowable:Connector", propDescriptor, newElement)) {
|
||||||
|
return includesType(newElement.eventDefinitions, "bpmn:MessageEventDefinition");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isAllowed("flowable:Field", propDescriptor, newElement)) {
|
||||||
|
return includesType(newElement.eventDefinitions, "bpmn:MessageEventDefinition");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = FlowableModdleExtension;
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
import { ANY_OBJECT } from '@/types/generic';
|
|
||||||
import { some } from 'min-dash';
|
|
||||||
|
|
||||||
const ALLOWED_TYPES: ANY_OBJECT = {
|
|
||||||
FailedJobRetryTimeCycle: [
|
|
||||||
'bpmn:StartEvent',
|
|
||||||
'bpmn:BoundaryEvent',
|
|
||||||
'bpmn:IntermediateCatchEvent',
|
|
||||||
'bpmn:Activity',
|
|
||||||
],
|
|
||||||
Connector: ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'],
|
|
||||||
Field: ['bpmn:EndEvent', 'bpmn:IntermediateThrowEvent'],
|
|
||||||
};
|
|
||||||
|
|
||||||
function is(element: ANY_OBJECT, type: string) {
|
|
||||||
return element && typeof element.$instanceOf === 'function' && element.$instanceOf(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
function exists(element: ANY_OBJECT[]) {
|
|
||||||
return element && element.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
function includesType(collection: ANY_OBJECT[], type: string) {
|
|
||||||
return (
|
|
||||||
exists(collection) &&
|
|
||||||
some(collection, function (element: ANY_OBJECT) {
|
|
||||||
return is(element, type);
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function anyType(element: ANY_OBJECT, types: string[]) {
|
|
||||||
return some(types, function (type: string) {
|
|
||||||
return is(element, type);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function isAllowed(propName: string, propDescriptor: ANY_OBJECT, newElement: ANY_OBJECT) {
|
|
||||||
var name = propDescriptor.name,
|
|
||||||
types = ALLOWED_TYPES[name.replace(/flowable:/, '')];
|
|
||||||
|
|
||||||
return name === propName && anyType(newElement, types);
|
|
||||||
}
|
|
||||||
|
|
||||||
class FlowableModdleExtension {
|
|
||||||
// 定义属性
|
|
||||||
$inject = ['eventBus'];
|
|
||||||
|
|
||||||
// 定义构造函数:为了将来实例化对象的时候,可以直接对属性的值进行初始化
|
|
||||||
constructor(eventBus: ANY_OBJECT) {
|
|
||||||
eventBus.on('property.clone', (context: ANY_OBJECT) => {
|
|
||||||
var newElement = context.newElement,
|
|
||||||
propDescriptor = context.propertyDescriptor;
|
|
||||||
|
|
||||||
this.canCloneProperty(newElement, propDescriptor);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
canCloneProperty(newElement: ANY_OBJECT, propDescriptor: ANY_OBJECT) {
|
|
||||||
if (isAllowed('flowable:FailedJobRetryTimeCycle', propDescriptor, newElement)) {
|
|
||||||
return (
|
|
||||||
includesType(newElement.eventDefinitions, 'bpmn:TimerEventDefinition') ||
|
|
||||||
includesType(newElement.eventDefinitions, 'bpmn:SignalEventDefinition') ||
|
|
||||||
is(newElement.loopCharacteristics, 'bpmn:MultiInstanceLoopCharacteristics')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isAllowed('flowable:Connector', propDescriptor, newElement)) {
|
|
||||||
return includesType(newElement.eventDefinitions, 'bpmn:MessageEventDefinition');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isAllowed('flowable:Field', propDescriptor, newElement)) {
|
|
||||||
return includesType(newElement.eventDefinitions, 'bpmn:MessageEventDefinition');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default FlowableModdleExtension;
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* @author igdianov
|
||||||
|
* address https://github.com/igdianov/activiti-bpmn-moddle
|
||||||
|
* */
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
__init__: ["FlowableModdleExtension"],
|
||||||
|
FlowableModdleExtension: ["type", require("./flowableExtension")]
|
||||||
|
};
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
* @author igdianov
|
|
||||||
* address https://github.com/igdianov/activiti-bpmn-moddle
|
|
||||||
* */
|
|
||||||
|
|
||||||
export default {
|
|
||||||
__init__: ['FlowableModdleExtension'],
|
|
||||||
FlowableModdleExtension: ['type', (await import('./flowableExtension')).default],
|
|
||||||
};
|
|
||||||
@@ -28,9 +28,21 @@
|
|||||||
:type="elementType"
|
:type="elementType"
|
||||||
:key="elementBusinessObject.id"
|
:key="elementBusinessObject.id"
|
||||||
v-if="
|
v-if="
|
||||||
elementType && (elementType.indexOf('Task') !== -1 || elementType === 'SubProcess')
|
formVisible &&
|
||||||
|
elementType &&
|
||||||
|
(elementType.indexOf('Task') !== -1 || elementType === 'SubProcess')
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
<service-task
|
||||||
|
:id="elementId"
|
||||||
|
:type="elementType"
|
||||||
|
:tabType="activeName"
|
||||||
|
v-if="elementType === 'ServiceTask' && activeName === 'baseInfo'"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="formVisible" key="goback">
|
||||||
|
<GoBack :id="elementId" :isCountersign="isCountersign" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="conditionFormVisible" key="condition">
|
<div v-if="conditionFormVisible" key="condition">
|
||||||
@@ -133,6 +145,7 @@
|
|||||||
* @Date 2021年3月31日18:57:51
|
* @Date 2021年3月31日18:57:51
|
||||||
*/
|
*/
|
||||||
import { ANY_OBJECT } from '@/types/generic';
|
import { ANY_OBJECT } from '@/types/generic';
|
||||||
|
import RightAddBtn from '@/components/Btns/RightAddBtn.vue';
|
||||||
import ElementBaseInfo from './base/ElementBaseInfo.vue';
|
import ElementBaseInfo from './base/ElementBaseInfo.vue';
|
||||||
import ElementTask from './task/ElementTask.vue';
|
import ElementTask from './task/ElementTask.vue';
|
||||||
import ElementMultiInstance from './multi-instance/ElementMultiInstance.vue';
|
import ElementMultiInstance from './multi-instance/ElementMultiInstance.vue';
|
||||||
@@ -142,12 +155,11 @@ import ElementListeners from './listeners/ElementListeners.vue';
|
|||||||
import ElementProperties from './properties/ElementProperties.vue';
|
import ElementProperties from './properties/ElementProperties.vue';
|
||||||
import SetApproveStatus from './properties/SetApproveStatus.vue';
|
import SetApproveStatus from './properties/SetApproveStatus.vue';
|
||||||
import ElementForm from './form/flowFormConfig.vue';
|
import ElementForm from './form/flowFormConfig.vue';
|
||||||
|
import ServiceTask from './form/ServiceTask';
|
||||||
import FormVariable from './form-variable/index.vue';
|
import FormVariable from './form-variable/index.vue';
|
||||||
import CopyForSelect from './copy-for/index.vue';
|
import CopyForSelect from './copy-for/index.vue';
|
||||||
import UserTaskListeners from './listeners/UserTaskListeners.vue';
|
import UserTaskListeners from './listeners/UserTaskListeners.vue';
|
||||||
import AutoAgree from './autoAgree/index.vue';
|
import AutoAgree from './autoAgree/index.vue';
|
||||||
import RightAddBtn from '@/components/Btns/RightAddBtn.vue';
|
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
bpmnModeler: ANY_OBJECT;
|
bpmnModeler: ANY_OBJECT;
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form
|
||||||
|
v-if="tabType === 'baseInfo'"
|
||||||
|
ref="form"
|
||||||
|
label-position="top"
|
||||||
|
:size="layoutStore.defaultFormItemSize"
|
||||||
|
:model="formData"
|
||||||
|
@submit.prevent
|
||||||
|
>
|
||||||
|
<el-form-item label="Java委托类">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.class"
|
||||||
|
clearable
|
||||||
|
placeholder="输入包含包名的完整委托类名"
|
||||||
|
@change="updateServiceTaskClass"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { defineProps, ref, inject, watch, nextTick } from 'vue';
|
||||||
|
import { ANY_OBJECT } from '@/types/generic';
|
||||||
|
import { useLayoutStore } from '@/store';
|
||||||
|
|
||||||
|
const layoutStore = useLayoutStore();
|
||||||
|
const props = defineProps<{
|
||||||
|
id: string;
|
||||||
|
type: string;
|
||||||
|
tabType: string;
|
||||||
|
}>();
|
||||||
|
const flowEntry = inject('flowEntry', () => {
|
||||||
|
return {} as ANY_OBJECT;
|
||||||
|
});
|
||||||
|
const prefix = inject('prefix');
|
||||||
|
const win: ANY_OBJECT = window;
|
||||||
|
|
||||||
|
type FormDataType = {
|
||||||
|
class: string;
|
||||||
|
};
|
||||||
|
const formData = ref<FormDataType>({
|
||||||
|
class: '',
|
||||||
|
});
|
||||||
|
const taskInfoElement = ref();
|
||||||
|
|
||||||
|
let bpmnELement = win.bpmnInstances.bpmnElement;
|
||||||
|
const resetTaskInfo = () => {
|
||||||
|
formData.value = {
|
||||||
|
class: bpmnELement.businessObject.class,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
const updateServiceTaskClass = () => {
|
||||||
|
win.bpmnInstances.modeling.updateProperties(bpmnELement, {
|
||||||
|
class: formData.value.class,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.id,
|
||||||
|
val => {
|
||||||
|
val && val.length && nextTick(() => resetTaskInfo());
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
@@ -354,7 +354,7 @@ const onEditOperation = (operation: ANY_OBJECT) => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
rowData: operation,
|
rowData: operation,
|
||||||
validStatusList: getFlowEntryValidStatus,
|
validStatusList: getFlowEntryValidStatus.value,
|
||||||
path: 'thirdEditOperation',
|
path: 'thirdEditOperation',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
>
|
>
|
||||||
<el-option label="不更新" :value="undefined" />
|
<el-option label="不更新" :value="undefined" />
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dialogParams.validStatusList.value"
|
v-for="item in dialogParams.validStatusList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
@@ -178,12 +178,12 @@ import { useLayoutStore } from '@/store';
|
|||||||
const layoutStore = useLayoutStore();
|
const layoutStore = useLayoutStore();
|
||||||
interface IProps extends ThirdProps {
|
interface IProps extends ThirdProps {
|
||||||
rowData?: ANY_OBJECT;
|
rowData?: ANY_OBJECT;
|
||||||
validStatusList?: Ref<ANY_OBJECT[]>;
|
validStatusList?: ANY_OBJECT[];
|
||||||
// 当使用Dialog.show弹出组件时,须定义该prop属性,以便对dialog进行回调
|
// 当使用Dialog.show弹出组件时,须定义该prop属性,以便对dialog进行回调
|
||||||
dialog?: DialogProp<ANY_OBJECT | ANY_OBJECT[] | undefined>;
|
dialog?: DialogProp<ANY_OBJECT | ANY_OBJECT[] | undefined>;
|
||||||
}
|
}
|
||||||
const props = withDefaults(defineProps<IProps>(), {
|
const props = withDefaults(defineProps<IProps>(), {
|
||||||
validStatusList: () => ref([]),
|
validStatusList: () => [],
|
||||||
});
|
});
|
||||||
const { thirdParams, onCloseThirdDialog } = useThirdParty(props);
|
const { thirdParams, onCloseThirdDialog } = useThirdParty(props);
|
||||||
|
|
||||||
@@ -215,7 +215,7 @@ const userName = ref<ANY_OBJECT[]>([]);
|
|||||||
const dialogParams = computed(() => {
|
const dialogParams = computed(() => {
|
||||||
return {
|
return {
|
||||||
rowData: props.rowData || thirdParams.value.rowData,
|
rowData: props.rowData || thirdParams.value.rowData,
|
||||||
validStatusList: props.validStatusList.value || thirdParams.value.validStatusList || [],
|
validStatusList: props.validStatusList || thirdParams.value.validStatusList || [],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
const multiSignGroupList = computed(() => {
|
const multiSignGroupList = computed(() => {
|
||||||
|
|||||||
@@ -11,6 +11,12 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item v-if="isCountersign" label="会签类型" style="margin-bottom: 4px">
|
||||||
|
<el-radio-group v-model="loopCharacteristics" @change="changeLoopCharacteristicsType">
|
||||||
|
<el-radio label="ParallelMultiInstance">并行会签</el-radio>
|
||||||
|
<el-radio label="SequentialMultiInstance">串行会签</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
<div v-if="isCountersign">
|
<div v-if="isCountersign">
|
||||||
<el-form-item label="内置变量" style="margin-bottom: 5px">
|
<el-form-item label="内置变量" style="margin-bottom: 5px">
|
||||||
<template #label>
|
<template #label>
|
||||||
@@ -57,6 +63,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="loopInstanceForm.completionCondition"
|
v-model="loopInstanceForm.completionCondition"
|
||||||
clearable
|
clearable
|
||||||
|
:disabled="loopCharacteristics === 'SequentialMultiInstance'"
|
||||||
@change="updateLoopCondition"
|
@change="updateLoopCondition"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -163,6 +170,7 @@ const defaultLoopInstanceForm = {
|
|||||||
const loopInstanceForm = ref<ANY_OBJECT>({
|
const loopInstanceForm = ref<ANY_OBJECT>({
|
||||||
collection: 'assigneeList',
|
collection: 'assigneeList',
|
||||||
elementVariable: 'assignee',
|
elementVariable: 'assignee',
|
||||||
|
completionCondition: '',
|
||||||
});
|
});
|
||||||
const variableList = [
|
const variableList = [
|
||||||
{
|
{
|
||||||
@@ -299,7 +307,10 @@ const getElementLoop = (businessObject: ANY_OBJECT) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const changeLoopCharacteristicsType = (type: string) => {
|
const changeLoopCharacteristicsType = (type: string) => {
|
||||||
// loopInstanceForm.value = { ...defaultLoopInstanceForm }; // 切换类型取消原表单配置
|
if (type === 'SequentialMultiInstance') {
|
||||||
|
// eslint-disable-next-line no-template-curly-in-string
|
||||||
|
loopInstanceForm.value.completionCondition = '${nrOfInstances == nrOfCompletedInstances}';
|
||||||
|
}
|
||||||
// 取消多实例配置
|
// 取消多实例配置
|
||||||
if (type === 'Null') {
|
if (type === 'Null') {
|
||||||
win.bpmnInstances.modeling.updateProperties(bpmnElement, {
|
win.bpmnInstances.modeling.updateProperties(bpmnElement, {
|
||||||
@@ -332,6 +343,7 @@ const changeLoopCharacteristicsType = (type: string) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
updateLoopBase();
|
updateLoopBase();
|
||||||
|
updateLoopCondition(loopInstanceForm.value.completionCondition);
|
||||||
};
|
};
|
||||||
// 循环基数
|
// 循环基数
|
||||||
|
|
||||||
|
|||||||
@@ -573,6 +573,7 @@ const loadUserInfo = (params: ANY_OBJECT) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
let bpmnElement: ANY_OBJECT = {};
|
||||||
const resetTaskForm = () => {
|
const resetTaskForm = () => {
|
||||||
userTaskForm.value = {
|
userTaskForm.value = {
|
||||||
assignee: '',
|
assignee: '',
|
||||||
@@ -585,16 +586,15 @@ const resetTaskForm = () => {
|
|||||||
};
|
};
|
||||||
candidateGroupIds.value = [];
|
candidateGroupIds.value = [];
|
||||||
sendMessageType.value = [];
|
sendMessageType.value = [];
|
||||||
let data =
|
bpmnElement = win.bpmnInstances.bpmnElement;
|
||||||
win.bpmnInstances.bpmnElement && win.bpmnInstances.bpmnElement.businessObject
|
let formKey = bpmnElement.businessObject.formKey;
|
||||||
? win.bpmnInstances.bpmnElement.businessObject.formKey
|
let formObj = formKey ? JSON.parse(formKey) : undefined;
|
||||||
: '';
|
|
||||||
let formObj = data ? JSON.parse(data) : {};
|
|
||||||
if (formObj) {
|
if (formObj) {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
formId: formObj.formId,
|
formId: formObj.formId,
|
||||||
routerName: formObj.routerName,
|
routerName: formObj.routerName,
|
||||||
editable: !formObj.readOnly,
|
editable: !formObj.readOnly,
|
||||||
|
formAuth: formObj.formAuth || {},
|
||||||
groupType: formObj.groupType || 'ASSIGNEE',
|
groupType: formObj.groupType || 'ASSIGNEE',
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
@@ -712,15 +712,16 @@ const updateFormKey = () => {
|
|||||||
if (formData.value == null) return;
|
if (formData.value == null) return;
|
||||||
let formKeyString = JSON.stringify({
|
let formKeyString = JSON.stringify({
|
||||||
formId:
|
formId:
|
||||||
flowEntry().bindFormType === SysFlowEntryBindFormType.ONLINE_FORM
|
flowEntry().value.bindFormType === SysFlowEntryBindFormType.ONLINE_FORM
|
||||||
? formData.value.formId
|
? formData.value.formId
|
||||||
: undefined,
|
: undefined,
|
||||||
routerName:
|
routerName:
|
||||||
flowEntry().bindFormType === SysFlowEntryBindFormType.ONLINE_FORM
|
flowEntry().value.bindFormType === SysFlowEntryBindFormType.ONLINE_FORM
|
||||||
? undefined
|
? undefined
|
||||||
: formData.value.routerName,
|
: formData.value.routerName,
|
||||||
readOnly: !formData.value.editable,
|
readOnly: !formData.value.editable,
|
||||||
groupType: formData.value.groupType || 'ASSIGNEE',
|
groupType: formData.value.groupType || 'ASSIGNEE',
|
||||||
|
formAuth: formData.value.formAuth,
|
||||||
});
|
});
|
||||||
win.bpmnInstances.modeling.updateProperties(win.bpmnInstances.bpmnElement, {
|
win.bpmnInstances.modeling.updateProperties(win.bpmnInstances.bpmnElement, {
|
||||||
formKey: formKeyString,
|
formKey: formKeyString,
|
||||||
|
|||||||
Reference in New Issue
Block a user