Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sts网站
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyang
sts网站
Commits
d71ee5db
Commit
d71ee5db
authored
Dec 01, 2023
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
显隐列组件支持复选框弹出类型
parent
78b1ac4a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
5 deletions
+30
-5
index.vue
ruoyi-ui/src/components/RightToolbar/index.vue
+30
-5
No files found.
ruoyi-ui/src/components/RightToolbar/index.vue
View file @
d71ee5db
...
...
@@ -8,7 +8,17 @@
<el-button
size=
"mini"
circle
icon=
"el-icon-refresh"
@
click=
"refresh()"
/>
</el-tooltip>
<el-tooltip
class=
"item"
effect=
"dark"
content=
"显隐列"
placement=
"top"
v-if=
"columns"
>
<el-button
size=
"mini"
circle
icon=
"el-icon-menu"
@
click=
"showColumn()"
/>
<el-button
size=
"mini"
circle
icon=
"el-icon-menu"
@
click=
"showColumn()"
v-if=
"showColumnsType == 'transfer'"
/>
<el-dropdown
trigger=
"click"
:hide-on-click=
"false"
style=
"padding-left: 12px"
v-if=
"showColumnsType == 'checkbox'"
>
<el-button
size=
"mini"
circle
icon=
"el-icon-menu"
/>
<el-dropdown-menu
slot=
"dropdown"
>
<template
v-for=
"item in columns"
>
<el-dropdown-item
:key=
"item.key"
>
<el-checkbox
:checked=
"item.visible"
@
change=
"checkboxChange($event, item.label)"
:label=
"item.label"
/>
</el-dropdown-item>
</
template
>
</el-dropdown-menu>
</el-dropdown>
</el-tooltip>
</el-row>
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
append-to-body
>
...
...
@@ -35,17 +45,26 @@ export default {
};
},
props
:
{
/* 是否显示检索条件 */
showSearch
:
{
type
:
Boolean
,
default
:
true
,
},
/* 显隐列信息 */
columns
:
{
type
:
Array
,
},
/* 是否显示检索图标 */
search
:
{
type
:
Boolean
,
default
:
true
,
},
/* 显隐列类型(transfer穿梭框、checkbox复选框) */
showColumnsType
:
{
type
:
String
,
default
:
"checkbox"
,
},
/* 右外边距 */
gutter
:
{
type
:
Number
,
default
:
10
,
...
...
@@ -61,10 +80,12 @@ export default {
}
},
created
()
{
// 显隐列初始默认隐藏列
for
(
let
item
in
this
.
columns
)
{
if
(
this
.
columns
[
item
].
visible
===
false
)
{
this
.
value
.
push
(
parseInt
(
item
));
if
(
this
.
showColumnsType
==
'transfer'
)
{
// 显隐列初始默认隐藏列
for
(
let
item
in
this
.
columns
)
{
if
(
this
.
columns
[
item
].
visible
===
false
)
{
this
.
value
.
push
(
parseInt
(
item
));
}
}
}
},
...
...
@@ -88,6 +109,10 @@ export default {
showColumn
()
{
this
.
open
=
true
;
},
// 勾选
checkboxChange
(
event
,
label
)
{
this
.
columns
.
filter
(
item
=>
item
.
label
==
label
)[
0
].
visible
=
event
;
}
},
};
</
script
>
...
...
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