fix: [bpm][antd] bpmn 设计器流转条件问题修复
This commit is contained in:
@@ -191,7 +191,7 @@ const initFormOnChanged = (element: any) => {
|
|||||||
conditionFormVisible.value =
|
conditionFormVisible.value =
|
||||||
elementType.value === 'SequenceFlow' &&
|
elementType.value === 'SequenceFlow' &&
|
||||||
activatedElement.source &&
|
activatedElement.source &&
|
||||||
(activatedElement.source.type as string).includes('StartEvent');
|
!(activatedElement.source.type as string).includes('StartEvent');
|
||||||
formVisible.value =
|
formVisible.value =
|
||||||
elementType.value === 'UserTask' || elementType.value === 'StartEvent';
|
elementType.value === 'UserTask' || elementType.value === 'StartEvent';
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { nextTick, onBeforeUnmount, ref, toRaw, watch } from 'vue';
|
import { nextTick, onBeforeUnmount, ref, toRaw, watch } from 'vue';
|
||||||
|
|
||||||
import { Form, Input, Select } from 'ant-design-vue';
|
import { Form, FormItem, Input, Select, Textarea } from 'ant-design-vue';
|
||||||
|
|
||||||
defineOptions({ name: 'FlowCondition' });
|
defineOptions({ name: 'FlowCondition' });
|
||||||
|
|
||||||
@@ -16,8 +16,6 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { TextArea } = Input;
|
|
||||||
|
|
||||||
const flowConditionForm = ref<any>({});
|
const flowConditionForm = ref<any>({});
|
||||||
const bpmnElement = ref();
|
const bpmnElement = ref();
|
||||||
const bpmnElementSource = ref();
|
const bpmnElementSource = ref();
|
||||||
@@ -153,15 +151,19 @@ watch(
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="panel-tab__content">
|
<div class="panel-tab__content">
|
||||||
<Form :model="flowConditionForm">
|
<Form
|
||||||
<Form.Item label="流转类型">
|
:model="flowConditionForm"
|
||||||
|
:label-col="{ span: 6 }"
|
||||||
|
:wrapper-col="{ span: 18 }"
|
||||||
|
>
|
||||||
|
<FormItem label="流转类型">
|
||||||
<Select v-model:value="flowConditionForm.type" @change="updateFlowType">
|
<Select v-model:value="flowConditionForm.type" @change="updateFlowType">
|
||||||
<Select.Option value="normal">普通流转路径</Select.Option>
|
<Select.Option value="normal">普通流转路径</Select.Option>
|
||||||
<Select.Option value="default">默认流转路径</Select.Option>
|
<Select.Option value="default">默认流转路径</Select.Option>
|
||||||
<Select.Option value="condition">条件流转路径</Select.Option>
|
<Select.Option value="condition">条件流转路径</Select.Option>
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</FormItem>
|
||||||
<Form.Item
|
<FormItem
|
||||||
label="条件格式"
|
label="条件格式"
|
||||||
v-if="flowConditionForm.type === 'condition'"
|
v-if="flowConditionForm.type === 'condition'"
|
||||||
key="condition"
|
key="condition"
|
||||||
@@ -170,8 +172,8 @@ watch(
|
|||||||
<Select.Option value="expression">表达式</Select.Option>
|
<Select.Option value="expression">表达式</Select.Option>
|
||||||
<Select.Option value="script">脚本</Select.Option>
|
<Select.Option value="script">脚本</Select.Option>
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</FormItem>
|
||||||
<Form.Item
|
<FormItem
|
||||||
label="表达式"
|
label="表达式"
|
||||||
v-if="
|
v-if="
|
||||||
flowConditionForm.conditionType &&
|
flowConditionForm.conditionType &&
|
||||||
@@ -179,45 +181,45 @@ watch(
|
|||||||
"
|
"
|
||||||
key="express"
|
key="express"
|
||||||
>
|
>
|
||||||
<Input
|
<Textarea
|
||||||
v-model:value="flowConditionForm.body"
|
v-model:value="flowConditionForm.body"
|
||||||
style="width: 192px"
|
:auto-size="{ minRows: 2, maxRows: 6 }"
|
||||||
allow-clear
|
allow-clear
|
||||||
@change="updateFlowCondition"
|
@change="updateFlowCondition"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</FormItem>
|
||||||
<template
|
<template
|
||||||
v-if="
|
v-if="
|
||||||
flowConditionForm.conditionType &&
|
flowConditionForm.conditionType &&
|
||||||
flowConditionForm.conditionType === 'script'
|
flowConditionForm.conditionType === 'script'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<Form.Item label="脚本语言" key="language">
|
<FormItem label="脚本语言" key="language">
|
||||||
<Input
|
<Input
|
||||||
v-model:value="flowConditionForm.language"
|
v-model:value="flowConditionForm.language"
|
||||||
allow-clear
|
allow-clear
|
||||||
@change="updateFlowCondition"
|
@change="updateFlowCondition"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</FormItem>
|
||||||
<Form.Item label="脚本类型" key="scriptType">
|
<FormItem label="脚本类型" key="scriptType">
|
||||||
<Select v-model:value="flowConditionForm.scriptType">
|
<Select v-model:value="flowConditionForm.scriptType">
|
||||||
<Select.Option value="inlineScript">内联脚本</Select.Option>
|
<Select.Option value="inlineScript">内联脚本</Select.Option>
|
||||||
<Select.Option value="externalScript">外部脚本</Select.Option>
|
<Select.Option value="externalScript">外部脚本</Select.Option>
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</FormItem>
|
||||||
<Form.Item
|
<FormItem
|
||||||
label="脚本"
|
label="脚本"
|
||||||
v-if="flowConditionForm.scriptType === 'inlineScript'"
|
v-if="flowConditionForm.scriptType === 'inlineScript'"
|
||||||
key="body"
|
key="body"
|
||||||
>
|
>
|
||||||
<TextArea
|
<Textarea
|
||||||
v-model:value="flowConditionForm.body"
|
v-model:value="flowConditionForm.body"
|
||||||
:auto-size="{ minRows: 2, maxRows: 6 }"
|
:auto-size="{ minRows: 2, maxRows: 6 }"
|
||||||
allow-clear
|
allow-clear
|
||||||
@change="updateFlowCondition"
|
@change="updateFlowCondition"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</FormItem>
|
||||||
<Form.Item
|
<FormItem
|
||||||
label="资源地址"
|
label="资源地址"
|
||||||
v-if="flowConditionForm.scriptType === 'externalScript'"
|
v-if="flowConditionForm.scriptType === 'externalScript'"
|
||||||
key="resource"
|
key="resource"
|
||||||
@@ -227,7 +229,7 @@ watch(
|
|||||||
allow-clear
|
allow-clear
|
||||||
@change="updateFlowCondition"
|
@change="updateFlowCondition"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</FormItem>
|
||||||
</template>
|
</template>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user