Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
罗鑫霖
/
vion-tools
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5b362a60
authored
May 07, 2024
by
Tianqing Liu
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: 批量操作功能,批量操作只有当前组的文字改变
1 parent
afdb080b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
7 deletions
src/views/SnapshotCluster/ClusterResult/ClusterResult.vue
src/views/SnapshotCluster/ClusterResult/ClusterResult.vue
View file @
5b362a6
...
@@ -142,7 +142,7 @@
...
@@ -142,7 +142,7 @@
<!--批量操作-->
<!--批量操作-->
<div
class=
"multiple-operation"
>
<div
class=
"multiple-operation"
>
<el-button
type=
"text"
@
click=
"handleMutipleOperation(person)"
>
<el-button
type=
"text"
@
click=
"handleMutipleOperation(person)"
>
{{
mutipleOperationText
}}
{{
mutipleOperationText
(
person
)
}}
<i
class=
"el-icon-arrow-right el-icon--right"
></i>
<i
class=
"el-icon-arrow-right el-icon--right"
></i>
</el-button>
</el-button>
<!--批量子操作-->
<!--批量子操作-->
...
@@ -609,19 +609,40 @@ export default {
...
@@ -609,19 +609,40 @@ export default {
const
isMultipleOperation
=
ref
(
false
)
const
isMultipleOperation
=
ref
(
false
)
const
currentMultipleGroupId
=
ref
(
''
)
// 当前批量操作的组id
const
currentMultipleGroupId
=
ref
(
''
)
// 当前批量操作的组id
const
handleMutipleOperation
=
(
person
)
=>
{
const
handleMutipleOperation
=
(
person
)
=>
{
isMultipleOperation
.
value
=
!
isMultipleOperation
.
value
if
(
currentMultipleGroupId
.
value
===
person
.
person_unid
)
{
if
(
!
isMultipleOperation
.
value
)
{
// 在当前组操作,批量按钮
if
(
isMultipleOperation
.
value
)
{
// 已经是多选状态
isMultipleOperation
.
value
=
false
selectedPersonList
.
value
=
[]
selectedPersonList
.
value
=
[]
currentMultipleGroupId
.
value
=
''
currentMultipleGroupId
.
value
=
''
}
else
{
}
else
{
// 非多选状态
currentMultipleGroupId
.
value
=
person
.
person_unid
currentMultipleGroupId
.
value
=
person
.
person_unid
isMultipleOperation
.
value
=
true
}
}
}
else
{
// 在其它组操作,批量按钮。此时,必定是非多选状态
isMultipleOperation
.
value
=
true
currentMultipleGroupId
.
value
=
person
.
person_unid
selectedPersonList
.
value
=
[]
}
}
const
mutipleOperationText
=
(
person
)
=>
{
if
(
isMultipleOperation
.
value
&&
isCurrentGroup
(
person
))
{
return
'取消操作'
}
else
{
return
'批量操作'
}
}
const
isCurrentGroup
=
(
data
)
=>
{
return
currentMultipleGroupId
.
value
===
data
.
person_unid
}
}
const
mutipleOperationText
=
computed
(()
=>
{
return
isMultipleOperation
.
value
?
'取消操作'
:
'批量操作'
})
const
mutipleOperationDisabled
=
computed
(()
=>
{
const
mutipleOperationDisabled
=
computed
(()
=>
{
return
!
(
isMultipleOperation
.
value
&&
selectedPersonList
.
value
.
length
>
0
)
return
!
(
isMultipleOperation
.
value
&&
selectedPersonList
.
value
.
length
>
0
)
})
})
const
isSelectedPerson
=
(
id
)
=>
{
const
isSelectedPerson
=
(
id
)
=>
{
return
selectedPersonList
.
value
.
some
(
item
=>
item
.
id
===
id
)
return
selectedPersonList
.
value
.
some
(
item
=>
item
.
id
===
id
)
...
@@ -933,6 +954,7 @@ export default {
...
@@ -933,6 +954,7 @@ export default {
mutipleOperationDisabled
,
mutipleOperationDisabled
,
deleteRealPersonRecord
,
deleteRealPersonRecord
,
currentMultipleGroupId
,
currentMultipleGroupId
,
isCurrentGroup
,
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment