fix: designer edge order use InputNumber, drag-stop include config field
This commit is contained in:
parent
4742bec4f6
commit
0a177e7703
@ -3,7 +3,7 @@ import type { WorkflowEdgeDto, WorkflowNodeDto } from '#/api/core';
|
||||
|
||||
import { computed, ref, watch } from 'vue';
|
||||
|
||||
import { Drawer, Form, Input, message, Select } from 'ant-design-vue';
|
||||
import { Drawer, Form, Input, InputNumber, message, Select } from 'ant-design-vue';
|
||||
|
||||
import { deleteEdgeApi, EdgeType, NodeType, updateEdgeApi } from '#/api/core';
|
||||
|
||||
@ -114,10 +114,11 @@ async function handleDelete() {
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="排序">
|
||||
<Input
|
||||
<InputNumber
|
||||
v-model:value="formState.order"
|
||||
type="number"
|
||||
:min="0"
|
||||
placeholder="排序值"
|
||||
class="w-full"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
||||
@ -3,11 +3,10 @@ import type { WorkflowEdgeDto, WorkflowNodeDto } from '#/api/core';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { VueFlow, useVueFlow } from '@vue-flow/core';
|
||||
import { Background } from '@vue-flow/background';
|
||||
import { Controls } from '@vue-flow/controls';
|
||||
import { useVueFlow, VueFlow } from '@vue-flow/core';
|
||||
import { MiniMap } from '@vue-flow/minimap';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { EdgeType, NodeType, updateNodeApi } from '#/api/core';
|
||||
@ -104,8 +103,9 @@ onNodeDragStop(async ({ node }) => {
|
||||
if (!originalNode) return;
|
||||
await updateNodeApi(props.definitionId, node.id, {
|
||||
name: originalNode.name,
|
||||
positionX: node.position.x,
|
||||
positionY: node.position.y,
|
||||
config: originalNode.config ?? undefined,
|
||||
positionX: Math.round(node.position.x),
|
||||
positionY: Math.round(node.position.y),
|
||||
});
|
||||
} catch {
|
||||
message.error('保存节点位置失败');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user