|
|
@@ -51,14 +51,17 @@ import { getFormPage, getForm, FormVO } from '../api/bpm/form';
|
|
|
import { setConfAndFields2, FormCreateData } from '../utils/formCreate';
|
|
|
import { generateIconPaths, getIconPathByFileName, getWorkflowNodeDescription } from '../utils/workflowNodePanelUi';
|
|
|
import {
|
|
|
+ isWorkflowCoLockFamilySubmitFormOptional,
|
|
|
isWorkflowCoLockType,
|
|
|
isWorkflowIsolationSchemePanelType,
|
|
|
+ isWorkflowJobFlowResponsibleRequired,
|
|
|
isWorkflowLockLikeValidationType,
|
|
|
isWorkflowLockSchemeType,
|
|
|
isWorkflowUnlockCoLockType,
|
|
|
isWorkflowUnlockLikeValidationType,
|
|
|
isWorkflowUnlockParentMatch,
|
|
|
isWorkflowUnlockSchemeType,
|
|
|
+ normalizeIsolationTypeForCoLockFamily,
|
|
|
resolveWorkflowPaletteType,
|
|
|
} from '../utils/workflowNodeTypes';
|
|
|
import './IsolationWorkListTable.css';
|
|
|
@@ -288,14 +291,8 @@ function validateWorkflowJobNodeConfig(config: any, nodeType: string): boolean {
|
|
|
if (formRequiredNodeTypes.includes(nodeType) && !config.submitForm) {
|
|
|
return false;
|
|
|
}
|
|
|
- if (
|
|
|
- nodeType !== 'createJob' &&
|
|
|
- !isWorkflowLockLikeValidationType(nodeType) &&
|
|
|
- !isWorkflowUnlockLikeValidationType(nodeType)
|
|
|
- ) {
|
|
|
- if (!config.responsible) {
|
|
|
- return false;
|
|
|
- }
|
|
|
+ if (isWorkflowJobFlowResponsibleRequired(nodeType) && !config.responsible) {
|
|
|
+ return false;
|
|
|
}
|
|
|
if (isWorkflowCoLockType(nodeType)) {
|
|
|
if (!config.isolationNodeUuid || config.isolationNodeUuid === '') {
|
|
|
@@ -1751,7 +1748,10 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
: undefined,
|
|
|
remark: nodeData.remark || '',
|
|
|
submitForm: nodeDO.formId ? (typeof nodeDO.formId === 'number' ? nodeDO.formId : Number(nodeDO.formId)) : (nodeData.submitForm ? (typeof nodeData.submitForm === 'number' ? nodeData.submitForm : Number(nodeData.submitForm)) : undefined),
|
|
|
- isolationType: (nodeDO.isolationType !== null && nodeDO.isolationType !== undefined) ? String(nodeDO.isolationType) : (nodeData.isolationType || ''),
|
|
|
+ isolationType: normalizeIsolationTypeForCoLockFamily(
|
|
|
+ nodeDO.type || nodeData.type,
|
|
|
+ (nodeDO.isolationType !== null && nodeDO.isolationType !== undefined) ? String(nodeDO.isolationType) : (nodeData.isolationType || '')
|
|
|
+ ),
|
|
|
isolationPoints: nodeDO.isolationPoints ? (typeof nodeDO.isolationPoints === 'string' ? JSON.parse(nodeDO.isolationPoints) : nodeDO.isolationPoints) : (nodeData.isolationPoints || []),
|
|
|
isolationNode: nodeData.isolationNode || [],
|
|
|
isolationNodeUuid: nodeDO.isolationNodeUuid || nodeData.isolationNodeUuid || '',
|
|
|
@@ -1969,7 +1969,10 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
: undefined,
|
|
|
remark: nodeData.remark || '',
|
|
|
submitForm: nodeDO.formId ? (typeof nodeDO.formId === 'number' ? nodeDO.formId : Number(nodeDO.formId)) : (nodeData.submitForm ? (typeof nodeData.submitForm === 'number' ? nodeData.submitForm : Number(nodeData.submitForm)) : undefined),
|
|
|
- isolationType: (nodeDO.isolationType !== null && nodeDO.isolationType !== undefined) ? String(nodeDO.isolationType) : (nodeData.isolationType || ''),
|
|
|
+ isolationType: normalizeIsolationTypeForCoLockFamily(
|
|
|
+ nodeDO.type || nodeData.type,
|
|
|
+ (nodeDO.isolationType !== null && nodeDO.isolationType !== undefined) ? String(nodeDO.isolationType) : (nodeData.isolationType || '')
|
|
|
+ ),
|
|
|
isolationPoints: nodeDO.isolationPoints ? (typeof nodeDO.isolationPoints === 'string' ? JSON.parse(nodeDO.isolationPoints) : nodeDO.isolationPoints) : (nodeData.isolationPoints || []),
|
|
|
isolationNode: nodeData.isolationNode || [],
|
|
|
isolationNodeUuid: nodeDO.isolationNodeUuid || nodeData.isolationNodeUuid || '',
|
|
|
@@ -2014,7 +2017,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
responsible: source.workerUserId ? (typeof source.workerUserId === 'number' ? source.workerUserId : Number(source.workerUserId)) : undefined,
|
|
|
remark: source.remark || '',
|
|
|
submitForm: source.submitForm ? (typeof source.submitForm === 'number' ? source.submitForm : Number(source.submitForm)) : undefined,
|
|
|
- isolationType: source.isolationType || '',
|
|
|
+ isolationType: normalizeIsolationTypeForCoLockFamily(source.type, source.isolationType || ''),
|
|
|
isolationPoints: source.isolationPoints || [],
|
|
|
isolationNode: source.isolationNode || [],
|
|
|
isolationNodeUuid: source.isolationNodeUuid || '',
|
|
|
@@ -2347,11 +2350,14 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
submitForm: fromIsolationOnly
|
|
|
? (nodeDO.formId != null && nodeDO.formId !== '' ? (typeof nodeDO.formId === 'number' ? nodeDO.formId : Number(nodeDO.formId)) : (releaseNodeData.submitForm != null ? (typeof releaseNodeData.submitForm === 'number' ? releaseNodeData.submitForm : Number(releaseNodeData.submitForm)) : undefined))
|
|
|
: (dataSource.formId ? (typeof dataSource.formId === 'number' ? dataSource.formId : Number(dataSource.formId)) : (source.submitForm ? (typeof source.submitForm === 'number' ? source.submitForm : Number(source.submitForm)) : undefined)),
|
|
|
- isolationType: fromIsolationOnly
|
|
|
- ? isolationTypeFromOwn || isolationTypeFromParent
|
|
|
- : dataSource.isolationType !== null && dataSource.isolationType !== undefined
|
|
|
- ? String(dataSource.isolationType)
|
|
|
- : source.isolationType || '',
|
|
|
+ isolationType: normalizeIsolationTypeForCoLockFamily(
|
|
|
+ node.data?.type || nodeDO?.type,
|
|
|
+ fromIsolationOnly
|
|
|
+ ? isolationTypeFromOwn || isolationTypeFromParent
|
|
|
+ : dataSource.isolationType !== null && dataSource.isolationType !== undefined
|
|
|
+ ? String(dataSource.isolationType)
|
|
|
+ : source.isolationType || ''
|
|
|
+ ),
|
|
|
isolationPoints: fromIsolationOnly ? isolationOnlyIsolationPoints : isolationPoints,
|
|
|
isolationNode: source.isolationNode || [],
|
|
|
isolationNodeUuid: nodeDO.isolationNodeUuid || source.isolationNodeUuid || '',
|
|
|
@@ -2414,7 +2420,7 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
responsible: source.workerUserId ? (typeof source.workerUserId === 'number' ? source.workerUserId : Number(source.workerUserId)) : undefined,
|
|
|
remark: source.remark || '',
|
|
|
submitForm: source.submitForm ? (typeof source.submitForm === 'number' ? source.submitForm : Number(source.submitForm)) : undefined,
|
|
|
- isolationType: source.isolationType || '',
|
|
|
+ isolationType: normalizeIsolationTypeForCoLockFamily(source.type, source.isolationType || ''),
|
|
|
isolationPoints: source.isolationPoints || [],
|
|
|
isolationNode: source.isolationNode || [],
|
|
|
isolationNodeUuid: source.isolationNodeUuid || '',
|
|
|
@@ -2462,7 +2468,10 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
responsible: workflowNodeConfig.responsible,
|
|
|
remark: workflowNodeConfig.remark,
|
|
|
submitForm: workflowNodeConfig.submitForm,
|
|
|
- isolationType: workflowNodeConfig.isolationType,
|
|
|
+ isolationType: normalizeIsolationTypeForCoLockFamily(
|
|
|
+ selectedWorkflowNode.data?.type,
|
|
|
+ workflowNodeConfig.isolationType || ''
|
|
|
+ ),
|
|
|
isolationPoints: workflowNodeConfig.isolationPoints,
|
|
|
isolationNode: workflowNodeConfig.isolationNode,
|
|
|
isolationNodeUuid: workflowNodeConfig.isolationNodeUuid,
|
|
|
@@ -5106,7 +5115,10 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
</div>
|
|
|
{selectedWorkflowNode.data?.type === 'confirm' && (
|
|
|
<div>
|
|
|
- <label className="block text-sm font-medium text-gray-700 mb-2">{t('isolationWork.responsible')}</label>
|
|
|
+ <label className="block text-sm font-medium text-gray-700 mb-2">
|
|
|
+ {t('isolationWork.responsible')}{' '}
|
|
|
+ <span className="text-red-500" style={{ color: '#ef4444' }}>*</span>
|
|
|
+ </label>
|
|
|
<Select
|
|
|
value={
|
|
|
workflowNodeConfig.responsible !== undefined && workflowNodeConfig.responsible !== null && workflowNodeConfig.responsible !== ''
|
|
|
@@ -5135,7 +5147,10 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
)}
|
|
|
{selectedWorkflowNode.data?.type === 'review' && (
|
|
|
<div>
|
|
|
- <label className="block text-sm font-medium text-gray-700 mb-2">{t('isolationWork.responsible')}</label>
|
|
|
+ <label className="block text-sm font-medium text-gray-700 mb-2">
|
|
|
+ {t('isolationWork.responsible')}{' '}
|
|
|
+ <span className="text-red-500" style={{ color: '#ef4444' }}>*</span>
|
|
|
+ </label>
|
|
|
<Select
|
|
|
value={
|
|
|
workflowNodeConfig.responsible !== undefined && workflowNodeConfig.responsible !== null && workflowNodeConfig.responsible !== ''
|
|
|
@@ -5167,7 +5182,10 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
selectedWorkflowNode.data?.type !== 'review' &&
|
|
|
!workflowSchemePanelOpen && (
|
|
|
<div>
|
|
|
- <label className="block text-sm font-medium text-gray-700 mb-2">{t('isolationWork.responsible')}</label>
|
|
|
+ <label className="block text-sm font-medium text-gray-700 mb-2">
|
|
|
+ {t('isolationWork.responsible')}{' '}
|
|
|
+ <span className="text-red-500" style={{ color: '#ef4444' }}>*</span>
|
|
|
+ </label>
|
|
|
<Select
|
|
|
value={
|
|
|
workflowNodeConfig.responsible !== undefined && workflowNodeConfig.responsible !== null && workflowNodeConfig.responsible !== ''
|
|
|
@@ -5228,9 +5246,12 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
<div>
|
|
|
<label className="block text-sm font-medium text-gray-700 mb-2">
|
|
|
{t('isolationWork.businessForm')}
|
|
|
- {['confirm', 'review', 'inputInfo'].includes(selectedWorkflowNode.data?.type || '') && (
|
|
|
- <span className="text-red-500" style={{ color: '#ef4444' }}>*</span>
|
|
|
- )}
|
|
|
+ {!isWorkflowCoLockFamilySubmitFormOptional(selectedWorkflowNode.data?.type || '') &&
|
|
|
+ ['confirm', 'review', 'inputInfo'].includes(
|
|
|
+ resolveWorkflowPaletteType(selectedWorkflowNode.data?.type || '')
|
|
|
+ ) && (
|
|
|
+ <span className="text-red-500" style={{ color: '#ef4444' }}>*</span>
|
|
|
+ )}
|
|
|
</label>
|
|
|
<div className="flex gap-2">
|
|
|
<Select
|
|
|
@@ -6165,7 +6186,13 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
nodeName: workflowNodeConfig.nodeName,
|
|
|
formId: formId,
|
|
|
workerUserId: workflowNodeConfig.responsible ? Number(workflowNodeConfig.responsible) : undefined,
|
|
|
- isolationType: workflowNodeConfig.isolationType || undefined,
|
|
|
+ isolationType: (() => {
|
|
|
+ const v = normalizeIsolationTypeForCoLockFamily(
|
|
|
+ selectedWorkflowNode.data?.type,
|
|
|
+ workflowNodeConfig.isolationType || ''
|
|
|
+ );
|
|
|
+ return v !== '' ? v : undefined;
|
|
|
+ })(),
|
|
|
isolationPoints: workflowNodeConfig.isolationPoints && Array.isArray(workflowNodeConfig.isolationPoints) && workflowNodeConfig.isolationPoints.length > 0
|
|
|
? JSON.stringify(workflowNodeConfig.isolationPoints)
|
|
|
: undefined,
|
|
|
@@ -6499,7 +6526,13 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
nodeName: workflowNodeConfig.nodeName,
|
|
|
formId: workflowNodeConfig.submitForm ? Number(workflowNodeConfig.submitForm) : undefined,
|
|
|
workerUserId: workflowNodeConfig.responsible ? Number(workflowNodeConfig.responsible) : undefined,
|
|
|
- isolationType: workflowNodeConfig.isolationType || undefined,
|
|
|
+ isolationType: (() => {
|
|
|
+ const v = normalizeIsolationTypeForCoLockFamily(
|
|
|
+ selectedWorkflowNode.data?.type,
|
|
|
+ workflowNodeConfig.isolationType || ''
|
|
|
+ );
|
|
|
+ return v !== '' ? v : undefined;
|
|
|
+ })(),
|
|
|
isolationPoints: workflowNodeConfig.isolationPoints && workflowNodeConfig.isolationPoints.length > 0
|
|
|
? JSON.stringify(workflowNodeConfig.isolationPoints)
|
|
|
: undefined,
|
|
|
@@ -6515,7 +6548,10 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
responsible: workflowNodeConfig.responsible ? String(workflowNodeConfig.responsible) : '',
|
|
|
remark: workflowNodeConfig.remark,
|
|
|
submitForm: workflowNodeConfig.submitForm ? String(workflowNodeConfig.submitForm) : '',
|
|
|
- isolationType: workflowNodeConfig.isolationType,
|
|
|
+ isolationType: normalizeIsolationTypeForCoLockFamily(
|
|
|
+ selectedWorkflowNode.data?.type,
|
|
|
+ workflowNodeConfig.isolationType || ''
|
|
|
+ ),
|
|
|
isolationPoints: workflowNodeConfig.isolationPoints,
|
|
|
isolationNode: workflowNodeConfig.isolationNode,
|
|
|
isolationNodeUuid: workflowNodeConfig.isolationNodeUuid,
|
|
|
@@ -6542,7 +6578,13 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
|
|
|
// 缓存当前节点配置
|
|
|
const newCache = new Map(workflowNodeConfigCache);
|
|
|
- newCache.set(selectedWorkflowNode.id, { ...workflowNodeConfig });
|
|
|
+ newCache.set(selectedWorkflowNode.id, {
|
|
|
+ ...workflowNodeConfig,
|
|
|
+ isolationType: normalizeIsolationTypeForCoLockFamily(
|
|
|
+ selectedWorkflowNode.data?.type,
|
|
|
+ workflowNodeConfig.isolationType || ''
|
|
|
+ ),
|
|
|
+ });
|
|
|
setWorkflowNodeConfigCache(newCache);
|
|
|
|
|
|
// 标记当前节点为已完成
|
|
|
@@ -6565,7 +6607,10 @@ export default function IsolationWork({ subMenu }: IsolationWorkProps) {
|
|
|
responsible: workflowNodeConfig.responsible,
|
|
|
remark: workflowNodeConfig.remark,
|
|
|
submitForm: workflowNodeConfig.submitForm,
|
|
|
- isolationType: workflowNodeConfig.isolationType,
|
|
|
+ isolationType: normalizeIsolationTypeForCoLockFamily(
|
|
|
+ selectedWorkflowNode.data?.type,
|
|
|
+ workflowNodeConfig.isolationType || ''
|
|
|
+ ),
|
|
|
isolationPoints: workflowNodeConfig.isolationPoints,
|
|
|
isolationNode: workflowNodeConfig.isolationNode,
|
|
|
isolationNodeUuid: workflowNodeConfig.isolationNodeUuid,
|