Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
ty_patentSys
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hanxiao
ty_patentSys
Commits
09fbb075
Commit
09fbb075
authored
Sep 18, 2023
by
hanxiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加批量添加账号、上传文件功能
parent
53f163c0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
10 deletions
+78
-10
public/templates/批量添加账号.xlsx
+0
-0
src/utils/loginAPI.js
+5
-0
src/utils/userAPI.js
+1
-0
src/views/adminset/index.vue
+5
-4
src/views/adminset/userInfo.vue
+67
-6
No files found.
public/templates/批量添加账号.xlsx
0 → 100644
View file @
09fbb075
File added
src/utils/loginAPI.js
View file @
09fbb075
...
...
@@ -13,6 +13,11 @@ export const users = p => get('/api/backup/users?page=' + p.page + '&size=' + p.
export
const
changeStatus
=
p
=>
put
(
'/api/backup/users/'
+
p
.
id
,
{
status
:
p
.
status
});
export
const
addusers
=
p
=>
post
(
'/api/backup/users'
,
p
);
export
const
deleusers
=
p
=>
Delete
(
'/api/backup/users'
,
p
);
//下载模板
export
const
downloads
=
p
=>
get
(
'/api/backup/downloads/批量添加账号.xlsx'
);
//上传文件
export
const
batchAdd
=
p
=>
post
(
'/api/backup/users/batchAdd'
,
p
);
...
...
src/utils/userAPI.js
View file @
09fbb075
...
...
@@ -22,3 +22,4 @@ export const sendEmail = p => post('/api/common/sendEmail', p);
src/views/adminset/index.vue
View file @
09fbb075
...
...
@@ -67,11 +67,12 @@ export default {
<
style
lang=
"less"
scoped
>
.user
{
width
:
calc
(
100%
);
//
height
:
100%
;
min-height
:
900px
;
height
:
100%
;
//
min-height
:
900px
;
.user_main
{
min-height
:
800px
;
//
height
:
calc
(
100%
-
65px
);
height
:
100%
;
min-height
:
900px
;
//
height
:
100%
;
width
:
100%
;
background-color
:
#ebebeb
;
display
:
flex
;
...
...
src/views/adminset/userInfo.vue
View file @
09fbb075
...
...
@@ -13,12 +13,28 @@
<a-button
type=
"primary"
size=
"large"
danger
@
click=
"opendeleteModal"
>
<img
src=
"../../static/login/icon-delete.png"
alt=
""
class=
"img"
/>
删除
</a-button
>
<a-button
type=
"primary"
size=
"large"
@
click=
"downLoad"
>
<!--
<img
src=
"../../static/login/icon-add.png"
alt=
""
class=
"img"
/>
-->
批量添加账号模板
</a-button
>
<a-upload
accept=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
v-model:file-list=
"fileList"
name=
"file"
:show-upload-list=
"false"
:customRequest=
"imageUpload"
>
<a-button
type=
"primary"
size=
"large"
>
上传账号文件
</a-button>
</a-upload>
<br
/><br
/>
<a-table
:row-selection=
"rowSelection"
:columns=
"columns"
:data-source=
"data"
:pagination=
"false"
:rowKey=
"
(row) =>
{
return row.id;
...
...
@@ -46,6 +62,13 @@
</
template
>
</template>
</a-table>
<br
/>
<a-pagination
@
change=
"changePage"
:total=
"total"
v-model:current=
"currentPage"
:showSizeChanger=
"false"
/>
</div>
</div>
<a-modal
...
...
@@ -75,18 +98,25 @@
<
script
>
// import { AES_Encrypt, AES_Decrypt } from "@/utils/aes_util.js";
import
{
message
}
from
"ant-design-vue"
;
import
{
users
,
changeStatus
,
addusers
,
deleusers
}
from
"@/utils/loginAPI"
;
import
{
users
,
changeStatus
,
addusers
,
deleusers
,
batchAdd
,
}
from
"@/utils/loginAPI"
;
export
default
{
name
:
"userInfo"
,
data
()
{
return
{
visible
:
false
,
username
:
""
,
fileList
:
[],
visibleDelete
:
false
,
columns
:
[
{
title
:
"序号"
,
dataIndex
:
"i
d
"
,
dataIndex
:
"i
ndex
"
,
align
:
"center"
,
},
{
...
...
@@ -123,6 +153,7 @@ export default {
selectedRowKeys
:
[],
data
:
[],
checked
:
true
,
currentPage
:
1
,
};
},
created
()
{
...
...
@@ -146,10 +177,30 @@ export default {
mounted
()
{},
methods
:
{
imageUpload
(
file
)
{
let
data
=
new
FormData
();
data
.
append
(
"file"
,
file
.
file
);
batchAdd
(
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
message
.
success
(
res
.
msg
);
// console.log( this.img)
}
else
{
message
.
error
(
res
.
msg
);
}
});
},
//调用删除用户接口
deleteUser
()
{
this
.
visibleDelete
=
false
;
},
//下载模板
downLoad
()
{
window
.
location
.
href
=
"https://zlcgzyzhzntjxt.industrychain.online/templates/批量添加账号.xlsx"
;
},
//上传文件
uploadFile
()
{},
//打开删除用户弹窗
opendeleteModal
()
{
this
.
visibleDelete
=
true
;
...
...
@@ -178,30 +229,35 @@ export default {
this
.
getList
();
},
//获取用户列表
getList
(
page
)
{
getList
()
{
users
({
page
:
page
||
1
,
page
:
this
.
currentPage
,
size
:
10
,
}).
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
this
.
data
=
res
.
data
;
this
.
data
.
forEach
((
item
,
index
)
=>
{
item
.
index
=
(
this
.
currentPage
-
1
)
*
10
+
index
+
1
;
});
this
.
total
=
res
.
total
}
else
{
message
.
error
(
res
.
msg
);
}
});
},
changePage
(){
this
.
getList
();
},
// 勾选表格复选框
selectedTableRows
(
selectedRowKeys
,
selectedRows
)
{
// 批量选中的key
this
.
selectedRowKeys
=
selectedRowKeys
;
console
.
log
(
selectedRowKeys
);
},
//删除用户
deleteUser
()
{
let
parma
=
{
user_ids
:
[...
this
.
selectedRowKeys
],
};
console
.
log
(
parma
);
deleusers
(
parma
).
then
((
res
)
=>
{
// console.log(res)
if
(
res
.
code
==
0
)
{
...
...
@@ -238,6 +294,11 @@ export default {
width
:
calc
(
100%
-
80px
);
//
text-align
:
center
;
flex
:
1
;
.table{
height
:
90%
;
background-color
:
#fff
;
padding
:
15px
25px
;
}
.img
{
width
:
15px
;
height
:
15px
;
...
...
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