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
ab86cb1f
authored
Feb 19, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码评审】BPM:增加流程图 小手功能
parent
1a4c94b8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
28 deletions
+27
-28
src/components/SimpleProcessDesignerV2/src/SimpleProcessModel.vue
+27
-28
No files found.
src/components/SimpleProcessDesignerV2/src/SimpleProcessModel.vue
View file @
ab86cb1f
...
...
@@ -85,10 +85,12 @@ const emits = defineEmits<{
const
processNodeTree
=
useWatchNode
(
props
)
provide
(
'readonly'
,
props
.
readonly
)
// TODO 可优化:拖拽有点卡顿
/** 拖拽、放大缩小等操作 */
let
scaleValue
=
ref
(
100
)
const
MAX_SCALE_VALUE
=
200
const
MIN_SCALE_VALUE
=
50
const
isDragging
=
ref
(
false
)
const
startX
=
ref
(
0
)
const
startY
=
ref
(
0
)
...
...
@@ -128,10 +130,33 @@ const stopDrag = () => {
resetCursor
()
// 重置光标
}
const
zoomIn
=
()
=>
{
if
(
scaleValue
.
value
==
MAX_SCALE_VALUE
)
{
return
}
scaleValue
.
value
+=
10
}
const
zoomOut
=
()
=>
{
if
(
scaleValue
.
value
==
MIN_SCALE_VALUE
)
{
return
}
scaleValue
.
value
-=
10
}
const
processReZoom
=
()
=>
{
scaleValue
.
value
=
100
}
const
resetPosition
=
()
=>
{
currentX
.
value
=
initialX
.
value
currentY
.
value
=
initialY
.
value
}
/** 校验节点设置 */
const
errorDialogVisible
=
ref
(
false
)
let
errorNodes
:
SimpleFlowNode
[]
=
[]
// 校验节点设置。 暂时以 showText 为空 未节点错误配置
const
validateNode
=
(
node
:
SimpleFlowNode
|
undefined
,
errorNodes
:
SimpleFlowNode
[])
=>
{
if
(
node
)
{
const
{
type
,
showText
,
conditionNodes
}
=
node
...
...
@@ -212,37 +237,11 @@ const importLocalFile = () => {
}
}
// 放大
const
zoomIn
=
()
=>
{
if
(
scaleValue
.
value
==
MAX_SCALE_VALUE
)
{
return
}
scaleValue
.
value
+=
10
}
// 缩小
const
zoomOut
=
()
=>
{
if
(
scaleValue
.
value
==
MIN_SCALE_VALUE
)
{
return
}
scaleValue
.
value
-=
10
}
const
processReZoom
=
()
=>
{
scaleValue
.
value
=
100
}
// 在组件初始化时记录初始位置
onMounted
(()
=>
{
initialX
.
value
=
currentX
.
value
initialY
.
value
=
currentY
.
value
})
// 重置位置的函数
const
resetPosition
=
()
=>
{
currentX
.
value
=
initialX
.
value
currentY
.
value
=
initialY
.
value
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
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