@@ -98,49 +98,39 @@ const initialX = ref(0)
98
98
const initialY = ref (0 )
99
99
100
100
const setGrabCursor = () => {
101
- document .body .style .cursor = ' grab' ;
101
+ document .body .style .cursor = ' grab'
102
102
}
103
103
104
104
const resetCursor = () => {
105
- document .body .style .cursor = ' default' ;
105
+ document .body .style .cursor = ' default'
106
106
}
107
107
108
108
const startDrag = (e : MouseEvent ) => {
109
- isDragging .value = true ;
110
- startX .value = e .clientX - currentX .value ;
111
- startY .value = e .clientY - currentY .value ;
112
- setGrabCursor (); // 设置小手光标
109
+ isDragging .value = true
110
+ startX .value = e .clientX - currentX .value
111
+ startY .value = e .clientY - currentY .value
112
+ setGrabCursor () // 设置小手光标
113
113
}
114
114
115
115
const onDrag = (e : MouseEvent ) => {
116
- if (! isDragging .value ) return ;
117
- e .preventDefault (); // 禁用文本选择
118
-
116
+ if (! isDragging .value ) return
117
+ e .preventDefault () // 禁用文本选择
118
+
119
119
// 使用 requestAnimationFrame 优化性能
120
120
requestAnimationFrame (() => {
121
- currentX .value = e .clientX - startX .value ;
122
- currentY .value = e .clientY - startY .value ;
123
- });
121
+ currentX .value = e .clientX - startX .value
122
+ currentY .value = e .clientY - startY .value
123
+ })
124
124
}
125
125
126
126
const stopDrag = () => {
127
- isDragging .value = false ;
128
- resetCursor (); // 重置光标
127
+ isDragging .value = false
128
+ resetCursor () // 重置光标
129
129
}
130
130
131
131
const errorDialogVisible = ref (false )
132
132
let errorNodes: SimpleFlowNode [] = []
133
133
134
- const saveSimpleFlowModel = async () => {
135
- errorNodes = []
136
- validateNode (processNodeTree .value , errorNodes )
137
- if (errorNodes .length > 0 ) {
138
- errorDialogVisible .value = true
139
- return
140
- }
141
- emits (' save' , processNodeTree .value )
142
- }
143
-
144
134
// 校验节点设置。 暂时以 showText 为空 未节点错误配置
145
135
const validateNode = (node : SimpleFlowNode | undefined , errorNodes : SimpleFlowNode []) => {
146
136
if (node ) {
0 commit comments