Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xxx_phase2_web
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
夏敏伟
xxx_phase2_web
Commits
c1ef43c7
Commit
c1ef43c7
authored
Nov 20, 2023
by
夏敏伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加导出用户邮箱功能
parent
09eac4c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
183 additions
and
44 deletions
+183
-44
src/view/user/yhgl.vue
src/view/user/yhgl.vue
+183
-44
No files found.
src/view/user/yhgl.vue
View file @
c1ef43c7
...
...
@@ -6,11 +6,11 @@
<div
class=
"new-user"
@
click=
"addNew"
>
<img
:src=
"img3"
alt=
""
/>
新增
</div>
<div
class=
"button-search"
@
click=
"exportUserList"
>
导出邮箱
</div>
</div>
<div
class=
"management-content"
>
<div
class=
"yhlb"
>
<table>
<!--
<table>
<thead>
<tr>
<td>
序号
</td>
...
...
@@ -45,7 +45,33 @@
</td>
</tr>
</tbody>
</table>
</table>
-->
<el-table
class=
"myTable"
ref=
"multipleTable"
:data=
"data_table"
style=
"width: 100%"
stripe
height=
"100%"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
align=
"center"
:selectable=
"handleDisable"
></el-table-column>
<el-table-column
type=
"index"
label=
"序号"
width=
"80"
align=
"center"
></el-table-column>
<el-table-column
prop=
"account"
label=
"登录用户名"
align=
"center"
></el-table-column>
<el-table-column
prop=
"username"
label=
"真实姓名"
align=
"center"
></el-table-column>
<el-table-column
prop=
"mail"
label=
"邮箱"
show-overflow-tooltip
align=
"center"
></el-table-column>
<el-table-column
prop=
"role.name"
label=
"角色"
align=
"center"
></el-table-column>
<el-table-column
prop=
"telephone"
label=
"电话号码"
align=
"center"
></el-table-column>
<el-table-column
prop=
"createTime"
label=
"创建时间"
align=
"center"
></el-table-column>
<el-table-column
label=
"状态"
align=
"center"
>
<template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.state"
@
change=
"change_state(scope.row)"
active-color=
"#13ce66"
inactive-color=
"#ff4949"
active-value=
"1"
inactive-value=
"0"
active-text=
"启用"
inactive-text=
"停用"
>
>
</el-switch>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<i
class=
"el-icon-edit"
title=
"编辑用户信息"
@
click=
"edit(scope.row, scope.$index)"
></i>
 
<i
class=
"el-icon-delete-solid"
title=
"删除用户信息"
@
click=
"remove(scope.row, scope.$index)"
></i>
 
<i
class=
"el-icon-refresh-left"
title=
"重置用户密码"
@
click=
"resetPassword(scope.row.account)"
></i>
</
template
>
</el-table-column>
</el-table>
</div>
</div>
<el-dialog
title=
"提示"
:visible.sync=
"centerDialogVisible"
center
>
...
...
@@ -151,12 +177,15 @@
line-height
:
30px
;
float
:
left
;
margin-left
:
20px
;
font-size
:
15px
;
text-align
:
center
;
cursor
:
pointer
;
color
:
white
;
background-image
:
url(../../assets/img/yqjc/40.png)
;
background-repeat
:
no-repeat
;
background-size
:
100%
100%
;
// background-image: url(../../assets/img/yqjc/40.png);
// background-repeat: no-repeat;
// background-size: 100% 100%;
border
:
1px
solid
#3a5f94
c9
!
important
;
box-shadow
:
0
0
10px
#25365f
;
}
.new-user
{
...
...
@@ -166,10 +195,13 @@
text-align
:
center
;
float
:
left
;
margin-left
:
20px
;
font-size
:
14px
;
color
:
white
;
cursor
:
pointer
;
background
:
url(../../assets/img/yqjc/40.png)
no-repeat
;
background-size
:
100%
100%
;
// background: url(../../assets/img/yqjc/40.png) no-repeat;
// background-size: 100% 100%;
border
:
1px
solid
#3a5f94
c9
!
important
;
box-shadow
:
0
0
10px
#25365f
;
}
}
...
...
@@ -187,71 +219,137 @@
padding-top
:
40px
;
box-sizing
:
border-box
;
table
{
width
:
100%
;
height
:
calc
(
100%
-
10px
);
color
:
white
;
text-align
:
center
;
border-collapse
:
collapse
;
.myTable
{
background-color
:
transparent
!
important
;
tbody
{
display
:
block
;
height
:
calc
(
100%
-
50px
);
overflow-y
:
scroll
;
}
thead
,
tbody
tr
{
display
:
table
;
width
:
100%
;
table-layout
:
fixed
;
.el-table__body
tr
:hover
>
td
{
background-color
:
#18213a
!
important
;
}
/*滚动条默认宽度是16px 将thead的宽度减16px*/
table
thead
{
width
:
calc
(
100%
-
1em
);
&
:
:
before
{
display
:
none
!
important
;
}
thead
tr
{
height
:
40px
;
thead
{
color
:
white
;
background
:
url(../../assets/img/setting/tr1.png)
no-repeat
;
background-size
:
100%
100%
;
}
tbody
tr
{
border-bottom
:
1px
solid
#252631
;
th
{
background-color
:
transparent
!
important
;
}
th
.is-leaf
{
border-bottom
:
none
!
important
;
}
tr
{
background-color
:
transparent
!
important
;
}
tbody
tr
td
{
padding
:
10px
;
td
{
color
:
white
;
border-bottom
:
none
!
important
;
.el-switch__label
{
color
:
white
;
}
.el-switch__label.is-active
{
color
:
#409EFF
;
}
.el-icon-edit
{
font-size
:
2
4
px
;
font-size
:
2
0
px
;
color
:
#409eff
;
cursor
:
pointer
;
}
.el-icon-delete-solid
{
font-size
:
2
4
px
;
font-size
:
2
0
px
;
color
:
red
;
cursor
:
pointer
;
}
.el-icon-refresh-left
{
font-size
:
2
4
px
;
font-size
:
2
0
px
;
color
:
#12dc12
;
cursor
:
pointer
;
}
}
}
.el-switch__label
{
color
:
white
;
}
.el-switch__label.is-active
{
color
:
green
;
}
.myTable.el-table--striped
.el-table__body
tr
.el-table__row--striped
td
{
background-color
:
#18213a
!
important
;
}
// table {
// width: 100%;
// height: calc(100% - 10px);
// color: white;
// text-align: center;
// border-collapse: collapse;
// tbody {
// display: block;
// height: calc(100% - 50px);
// overflow-y: scroll;
// }
// thead,
// tbody tr {
// display: table;
// width: 100%;
// table-layout: fixed;
// }
// /*滚动条默认宽度是16px 将thead的宽度减16px*/
// table thead {
// width: calc(100% - 1em);
// }
// thead tr {
// height: 40px;
// background: url(../../assets/img/setting/tr1.png) no-repeat;
// background-size: 100% 100%;
// }
// tbody tr {
// border-bottom: 1px solid #252631;
// }
// tbody tr td {
// padding: 10px;
// .el-icon-edit {
// font-size: 24px;
// color: #409eff;
// cursor: pointer;
// }
// .el-icon-delete-solid {
// font-size: 24px;
// color: red;
// cursor: pointer;
// }
// .el-icon-refresh-left {
// font-size: 24px;
// color: #12dc12;
// cursor: pointer;
// }
// }
// .el-switch__label {
// color: white;
// }
// .el-switch__label.is-active {
// color: green;
// }
// }
}
}
...
...
@@ -328,10 +426,12 @@ import {
startLoading
,
endLoading
,
}
from
"
../../util/http_util
"
;
import
XLSX
from
"
xlsx
"
;
export
default
{
name
:
"
yhgl
"
,
data
()
{
return
{
multipleSelection
:
[],
rules
:
{
account
:
[
{
required
:
true
,
message
:
'
请输入账号
'
,
trigger
:
'
blur
'
},
...
...
@@ -429,6 +529,45 @@ export default {
};
},
methods
:
{
handleDisable
(
row
)
{
if
(
row
.
mail
)
{
return
true
;
}
else
{
return
false
;
}
},
exportUserList
()
{
if
(
this
.
multipleSelection
.
length
>
0
)
{
const
body
=
this
.
multipleSelection
.
filter
(
item
=>
item
.
mail
).
map
(
item
=>
([
''
,
''
,
''
,
''
,
item
.
account
,
item
.
username
,
''
,
''
,
''
,
''
,
item
.
mail
,
''
,
''
,
''
,
''
,
''
,
''
,
item
.
telephone
,
item
.
mail
,
''
,
''
,
''
,
''
,
''
,
''
,
''
,
''
,
''
,
''
,
''
,
''
,
''
,
''
,
''
]));
const
header
=
[[
'
Title
'
,
'
First Name
'
,
'
Middle Name
'
,
'
Last Name
'
,
'
Nick Name
'
,
'
Display Name
'
,
'
Company
'
,
'
Department
'
,
'
Job Title
'
,
'
Office Location
'
,
'
E-mail Address
'
,
'
Notes
'
,
'
Web Page
'
,
'
Birthday
'
,
'
Other Email
'
,
'
Other Phone
'
,
'
Other Mobile
'
,
'
Mobile Phone
'
,
'
Home Email
'
,
'
Home Phone
'
,
'
Home Fax
'
,
'
Home Street
'
,
'
Home City
'
,
'
Home State
'
,
'
Home Postal Code
'
,
'
Home Country
'
,
'
Business Email
'
,
'
Business Phone
'
,
'
Business Fax
'
,
'
Business Street
'
,
'
Business City
'
,
'
Business State
'
,
'
Business Postal Code
'
,
'
Business Country
'
]];
body
.
unshift
(...
header
);
const
workbook
=
XLSX
.
utils
.
book_new
();
const
sheet
=
XLSX
.
utils
.
aoa_to_sheet
(
body
);
XLSX
.
utils
.
book_append_sheet
(
workbook
,
sheet
,
'
contacts
'
);
// 向 workbook 中添加 sheet
XLSX
.
writeFile
(
workbook
,
'
contacts.csv
'
);
// 导出 workbook
}
else
{
this
.
$message
.
warning
(
'
请选择要导出的用户!
'
);
}
},
toggleSelection
(
rows
)
{
if
(
rows
)
{
rows
.
forEach
(
row
=>
{
this
.
$refs
.
multipleTable
.
toggleRowSelection
(
row
);
});
}
else
{
this
.
$refs
.
multipleTable
.
clearSelection
();
}
},
handleSelectionChange
(
val
)
{
// debugger
this
.
multipleSelection
=
val
;
},
queryUser
()
{
get
(
"
api/rest/system/user/queryUser
"
).
then
((
data
)
=>
{
this
.
data_table
=
data
;
...
...
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