fix: 修复函数禁用后,在工作流中应该节点状态应该改为不可用
This commit is contained in:
parent
b95dc9b0c7
commit
b9e4080d03
@ -146,6 +146,13 @@ function publicHandle() {
|
|||||||
const obj = {
|
const obj = {
|
||||||
work_flow: getGraphData()
|
work_flow: getGraphData()
|
||||||
}
|
}
|
||||||
|
const workflow = new WorkFlowInstance(obj.work_flow)
|
||||||
|
try {
|
||||||
|
workflow.is_valid()
|
||||||
|
} catch (e: any) {
|
||||||
|
MsgError(e.toString())
|
||||||
|
return
|
||||||
|
}
|
||||||
applicationApi.putPublishApplication(id as String, obj, loading).then(() => {
|
applicationApi.putPublishApplication(id as String, obj, loading).then(() => {
|
||||||
getDetail()
|
getDetail()
|
||||||
MsgSuccess('发布成功')
|
MsgSuccess('发布成功')
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { WorkflowType } from '@/enums/workflow'
|
import { WorkflowType } from '@/enums/workflow'
|
||||||
|
|
||||||
const end_nodes = [
|
const end_nodes: Array<string> = [
|
||||||
WorkflowType.AiChat,
|
WorkflowType.AiChat,
|
||||||
WorkflowType.Reply,
|
WorkflowType.Reply,
|
||||||
WorkflowType.FunctionLib,
|
WorkflowType.FunctionLib,
|
||||||
@ -119,6 +119,9 @@ export class WorkFlowInstance {
|
|||||||
* @param node 节点
|
* @param node 节点
|
||||||
*/
|
*/
|
||||||
private is_valid_node(node: any) {
|
private is_valid_node(node: any) {
|
||||||
|
if (node.properties.status && node.properties.status === 500) {
|
||||||
|
throw `${node.properties.stepName} 节点不可用`
|
||||||
|
}
|
||||||
if (node.type === WorkflowType.Condition) {
|
if (node.type === WorkflowType.Condition) {
|
||||||
const branch_list = node.properties.node_data.branch
|
const branch_list = node.properties.node_data.branch
|
||||||
for (const branch of branch_list) {
|
for (const branch of branch_list) {
|
||||||
|
|||||||
@ -124,7 +124,7 @@ const update_field = () => {
|
|||||||
return { ...item, value: item.source == 'reference' ? [] : '' }
|
return { ...item, value: item.source == 'reference' ? [] : '' }
|
||||||
})
|
})
|
||||||
set(props.nodeModel.properties.node_data, 'input_field_list', merge_input_field_list)
|
set(props.nodeModel.properties.node_data, 'input_field_list', merge_input_field_list)
|
||||||
set(props.nodeModel.properties, 'status', 200)
|
set(props.nodeModel.properties, 'status', ok.data.is_active ? 200 : 500)
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
set(props.nodeModel.properties, 'status', 500)
|
set(props.nodeModel.properties, 'status', 500)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user