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
5f2e23f4
authored
Nov 19, 2024
by
GoldenZqqq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 流程发起页面-右侧流程滚动到对应的分类区域左侧分类active响应式变化
parent
6304a8e9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
1 deletions
+38
-1
src/views/bpm/processInstance/create/index.vue
+38
-1
No files found.
src/views/bpm/processInstance/create/index.vue
View file @
5f2e23f4
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
</div>
</div>
</el-col>
</el-col>
<el-col
:span=
"19"
>
<el-col
:span=
"19"
>
<el-scrollbar
ref=
"scrollWrapper"
height=
"700"
>
<el-scrollbar
ref=
"scrollWrapper"
height=
"700"
@
scroll=
"handleScroll"
>
<div
<div
class=
"mb-20px pl-10px"
class=
"mb-20px pl-10px"
v-for=
"(definitions, categoryCode) in processDefinitionGroup"
v-for=
"(definitions, categoryCode) in processDefinitionGroup"
...
@@ -220,6 +220,43 @@ const handleSelect = async (row, formVariables?) => {
...
@@ -220,6 +220,43 @@ const handleSelect = async (row, formVariables?) => {
processDefinitionDetailRef
.
value
?.
initProcessInfo
(
row
,
formVariables
)
processDefinitionDetailRef
.
value
?.
initProcessInfo
(
row
,
formVariables
)
}
}
/** 处理滚动事件 */
const
handleScroll
=
(
e
)
=>
{
// 直接使用事件对象获取滚动位置
const
scrollTop
=
e
.
scrollTop
// 获取所有分类区域的位置信息
const
categoryPositions
=
categoryList
.
value
.
map
((
category
)
=>
{
const
categoryRef
=
proxy
.
$refs
[
`category-
${
category
.
code
}
`
]
if
(
categoryRef
?.[
0
])
{
return
{
code
:
category
.
code
,
offsetTop
:
categoryRef
[
0
].
offsetTop
,
height
:
categoryRef
[
0
].
offsetHeight
}
}
return
null
})
.
filter
(
Boolean
)
// 查找当前滚动位置对应的分类
let
currentCategory
=
categoryPositions
[
0
]
for
(
const
position
of
categoryPositions
)
{
// 为了更好的用户体验,可以添加一个缓冲区域(比如 50px)
if
(
scrollTop
>=
position
.
offsetTop
-
50
)
{
currentCategory
=
position
}
else
{
break
}
}
// 更新当前 active 的分类
if
(
currentCategory
&&
categoryActive
.
value
.
code
!==
currentCategory
.
code
)
{
categoryActive
.
value
=
categoryList
.
value
.
find
((
c
)
=>
c
.
code
===
currentCategory
.
code
)
}
}
/** 初始化 */
/** 初始化 */
onMounted
(()
=>
{
onMounted
(()
=>
{
getList
()
getList
()
...
...
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