feat(sj_map_reduce): 工作流新增上下文字段

This commit is contained in:
xlsea 2024-06-27 17:56:23 +08:00
parent 5657119c10
commit b622d3a217
4 changed files with 14 additions and 3 deletions

View File

@ -63,8 +63,11 @@ watch(
} else {
title = '请选择组';
}
if (val.wfContext) {
form.value.wfContext = JSON.parse(val.wfContext).init;
}
},
{ immediate: true, deep: true }
{ immediate: true }
);
const formRef = ref<FormInst>();
@ -78,6 +81,7 @@ const save = () => {
formRef.value
?.validate(errors => {
if (!errors) {
form.value.wfContext = JSON.stringify({ init: form.value.wfContext });
close();
emit('save', form.value);
}
@ -201,6 +205,9 @@ const rules: Record<RuleKey, FormItemRule> = {
</NFormItem>
</NGi>
</NGrid>
<NFormItem path="wfContext" label="工作流上下文">
<CodeMirror v-model="form.wfContext" lang="json" placeholder="请输入工作流上下文" />
</NFormItem>
<NFormItem path="workflowStatus" label="节点状态">
<NRadioGroup v-model:value="form.workflowStatus">
<NSpace>

View File

@ -119,7 +119,7 @@ const onDragstop = () => {
<template>
<div class="workflow">
<div class="workflow-affix">
<NAffix :trigger-top="0">
<NAffix :trigger-top="0" class="position-sticky z-2">
<div class="header">
<div>
<NTooltip>
@ -152,6 +152,7 @@ const onDragstop = () => {
class="vue-drag"
:is-draggable="true"
:is-resizable="false"
:z="1"
@dragging="onDragging"
@dragstop="onDragstop"
>

View File

@ -15,6 +15,8 @@ declare namespace Workflow {
blockStrategy?: Api.Common.BlockStrategy;
/** 执行超时时间 */
executorTimeout?: number;
/** 方法参数 */
wfContext?: string;
/** 工作流状态 */
workflowStatus?: Api.Common.WorkFlowNodeStatus;
/** 描述 */

View File

@ -19,7 +19,8 @@ const node = ref<Workflow.NodeDataType>({
workflowStatus: 1,
blockStrategy: 1,
description: undefined,
executorTimeout: 60
executorTimeout: 60,
wfContext: '{"init":""}'
});
const save = async () => {