Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1a4c94b8
authored
Feb 19, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码评审】BPM:增加流程图 小手功能
parent
3906204b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
23 deletions
+13
-23
src/components/SimpleProcessDesignerV2/src/SimpleProcessModel.vue
+13
-23
No files found.
src/components/SimpleProcessDesignerV2/src/SimpleProcessModel.vue
View file @
1a4c94b8
...
@@ -98,49 +98,39 @@ const initialX = ref(0)
...
@@ -98,49 +98,39 @@ const initialX = ref(0)
const
initialY
=
ref
(
0
)
const
initialY
=
ref
(
0
)
const
setGrabCursor
=
()
=>
{
const
setGrabCursor
=
()
=>
{
document
.
body
.
style
.
cursor
=
'grab'
;
document
.
body
.
style
.
cursor
=
'grab'
}
}
const
resetCursor
=
()
=>
{
const
resetCursor
=
()
=>
{
document
.
body
.
style
.
cursor
=
'default'
;
document
.
body
.
style
.
cursor
=
'default'
}
}
const
startDrag
=
(
e
:
MouseEvent
)
=>
{
const
startDrag
=
(
e
:
MouseEvent
)
=>
{
isDragging
.
value
=
true
;
isDragging
.
value
=
true
startX
.
value
=
e
.
clientX
-
currentX
.
value
;
startX
.
value
=
e
.
clientX
-
currentX
.
value
startY
.
value
=
e
.
clientY
-
currentY
.
value
;
startY
.
value
=
e
.
clientY
-
currentY
.
value
setGrabCursor
()
;
// 设置小手光标
setGrabCursor
()
// 设置小手光标
}
}
const
onDrag
=
(
e
:
MouseEvent
)
=>
{
const
onDrag
=
(
e
:
MouseEvent
)
=>
{
if
(
!
isDragging
.
value
)
return
;
if
(
!
isDragging
.
value
)
return
e
.
preventDefault
()
;
// 禁用文本选择
e
.
preventDefault
()
// 禁用文本选择
// 使用 requestAnimationFrame 优化性能
// 使用 requestAnimationFrame 优化性能
requestAnimationFrame
(()
=>
{
requestAnimationFrame
(()
=>
{
currentX
.
value
=
e
.
clientX
-
startX
.
value
;
currentX
.
value
=
e
.
clientX
-
startX
.
value
currentY
.
value
=
e
.
clientY
-
startY
.
value
;
currentY
.
value
=
e
.
clientY
-
startY
.
value
})
;
})
}
}
const
stopDrag
=
()
=>
{
const
stopDrag
=
()
=>
{
isDragging
.
value
=
false
;
isDragging
.
value
=
false
resetCursor
()
;
// 重置光标
resetCursor
()
// 重置光标
}
}
const
errorDialogVisible
=
ref
(
false
)
const
errorDialogVisible
=
ref
(
false
)
let
errorNodes
:
SimpleFlowNode
[]
=
[]
let
errorNodes
:
SimpleFlowNode
[]
=
[]
const
saveSimpleFlowModel
=
async
()
=>
{
errorNodes
=
[]
validateNode
(
processNodeTree
.
value
,
errorNodes
)
if
(
errorNodes
.
length
>
0
)
{
errorDialogVisible
.
value
=
true
return
}
emits
(
'save'
,
processNodeTree
.
value
)
}
// 校验节点设置。 暂时以 showText 为空 未节点错误配置
// 校验节点设置。 暂时以 showText 为空 未节点错误配置
const
validateNode
=
(
node
:
SimpleFlowNode
|
undefined
,
errorNodes
:
SimpleFlowNode
[])
=>
{
const
validateNode
=
(
node
:
SimpleFlowNode
|
undefined
,
errorNodes
:
SimpleFlowNode
[])
=>
{
if
(
node
)
{
if
(
node
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment