Commit dd72d35f by Lesan

feat: ConditionNodeConfig使用Condition组件

parent 96d1fced
...@@ -67,12 +67,13 @@ import { ...@@ -67,12 +67,13 @@ import {
ApproveMethodType, ApproveMethodType,
AssignEmptyHandlerType, AssignEmptyHandlerType,
AssignStartUserHandlerType, AssignStartUserHandlerType,
ConditionType,
NODE_DEFAULT_NAME, NODE_DEFAULT_NAME,
NodeType, NodeType,
RejectHandlerType, RejectHandlerType,
SimpleFlowNode SimpleFlowNode
} from './consts' } from './consts'
import { generateUUID } from '@/utils' import {generateUUID} from '@/utils'
defineOptions({ defineOptions({
name: 'NodeHandler' name: 'NodeHandler'
...@@ -163,7 +164,7 @@ const addNode = (type: number) => { ...@@ -163,7 +164,7 @@ const addNode = (type: number) => {
showText: '', showText: '',
type: NodeType.CONDITION_NODE, type: NodeType.CONDITION_NODE,
childNode: undefined, childNode: undefined,
conditionType: 1, conditionType: ConditionType.RULE,
defaultFlow: false defaultFlow: false
}, },
{ {
......
<!-- TODO @lesan:其它路由条件,可以使用这个哇? -->
<template> <template>
<el-form ref="formRef" :model="condition" :rules="formRules" label-position="top"> <el-form ref="formRef" :model="condition" :rules="formRules" label-position="top">
<el-form-item label="配置方式" prop="conditionType"> <el-form-item label="配置方式" prop="conditionType">
...@@ -118,13 +117,13 @@ ...@@ -118,13 +117,13 @@
<script setup lang="ts"> <script setup lang="ts">
import { import {
CONDITION_CONFIG_TYPES,
COMPARISON_OPERATORS, COMPARISON_OPERATORS,
CONDITION_CONFIG_TYPES,
ConditionType, ConditionType,
ProcessVariableEnum ProcessVariableEnum
} from '../../consts' } from '../../consts'
import { BpmModelFormType } from '@/utils/constants' import {BpmModelFormType} from '@/utils/constants'
import { useFormFields } from '../../node' import {useFormFields} from '../../node'
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {
...@@ -200,6 +199,13 @@ const addConditionGroup = (conditions) => { ...@@ -200,6 +199,13 @@ const addConditionGroup = (conditions) => {
} }
conditions.push(condition) conditions.push(condition)
} }
const validate = async () => {
if (!formRef) return false
return await formRef.value.validate();
}
defineExpose({validate})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment