Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tea-resources-web
Project
Project
Details
Activity
Releases
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
张伯涛
tea-resources-web
Commits
69105779
Commit
69105779
authored
Aug 21, 2024
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
c505617d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
5 deletions
+76
-5
user.js
src/api/system/user.js
+20
-0
index.vue
src/views/system/user/index.vue
+56
-5
No files found.
src/api/system/user.js
View file @
69105779
...
@@ -43,6 +43,18 @@ export function updateUser(data) {
...
@@ -43,6 +43,18 @@ export function updateUser(data) {
headers
:
{}
headers
:
{}
})
})
}
}
// 1.新增用户
export
function
addLectureByUser
(
data
)
{
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/pc/sysuser/addLectureByUser'
,
method
:
'post'
,
data
,
headers
:
{}
})
}
// 3.删除用户
// 3.删除用户
export
function
delUser
(
userId
)
{
export
function
delUser
(
userId
)
{
return
request
({
return
request
({
...
@@ -202,3 +214,11 @@ export function listByIdentity(query) {
...
@@ -202,3 +214,11 @@ export function listByIdentity(query) {
})
})
}
}
// 11.用户状态修改
export
function
updateLectureByUser
(
businessId
,
flag
)
{
return
request
({
url
:
'/cmslecturer/updateLecturerByUser/'
+
praseStrEmpty
(
businessId
),
method
:
'put'
})
}
src/views/system/user/index.vue
View file @
69105779
...
@@ -425,7 +425,7 @@ import {
...
@@ -425,7 +425,7 @@ import {
changeUserStatus
,
changeUserStatus
,
importExcel
,
importExcel
,
uploadFalseFile
,
uploadFalseFile
,
importTemplate
,
updatePassword
importTemplate
,
updatePassword
,
addLectureByUser
,
updateLectureByUser
}
from
'@/api/system/user'
}
from
'@/api/system/user'
import
{
getToken
}
from
'@/utils/auth'
import
{
getToken
}
from
'@/utils/auth'
import
{
treeSelect
}
from
'@/api/system/dept'
import
{
treeSelect
}
from
'@/api/system/dept'
...
@@ -918,6 +918,36 @@ export default {
...
@@ -918,6 +918,36 @@ export default {
this
.
open
=
false
this
.
open
=
false
this
.
getList
()
this
.
getList
()
})
})
console
.
log
(
'this.form.roleList:'
,
this
.
form
.
roleList
)
if
(
this
.
form
.
roleList
.
length
===
2
||
(
this
.
form
.
roleList
.
length
===
1
&&
this
.
form
.
roleList
[
0
]
===
9
))
{
const
params1
=
{
businessId
:
this
.
form
.
businessId
,
identity
:
this
.
form
.
identity
,
username
:
this
.
form
.
username
,
flag
:
1
,
name
:
this
.
form
.
name
,
phone
:
this
.
form
.
phone
,
remarks
:
this
.
form
.
remarks
}
addLectureByUser
(
params1
).
then
(
response
=>
{
this
.
$message
({
message
:
'修改成功'
,
type
:
'success'
})
this
.
open
=
false
this
.
getList
()
})
}
if
(
this
.
form
.
roleList
.
length
===
1
&&
this
.
form
.
roleList
[
0
]
===
3
)
{
updateLectureByUser
(
this
.
form
.
businessId
).
then
(
response
=>
{
this
.
$message
({
message
:
'修改成功'
,
type
:
'success'
})
this
.
open
=
false
this
.
getList
()
})
}
}
else
{
}
else
{
const
paramsAdd
=
{
const
paramsAdd
=
{
identity
:
this
.
form
.
identity
,
identity
:
this
.
form
.
identity
,
...
@@ -944,20 +974,41 @@ export default {
...
@@ -944,20 +974,41 @@ export default {
},
},
/** 删除按钮操作 */
/** 删除按钮操作 */
handleDelete
(
row
)
{
handleDelete
(
row
)
{
// 使用箭头函数来保持正确的 `this` 上下文
const
userId
=
row
.
businessId
||
this
.
ids
const
userId
=
row
.
businessId
||
this
.
ids
// 使用箭头函数来确保 `this` 的正确绑定
this
.
$confirm
(
'是否确认操作?'
,
'提示'
,
{
this
.
$confirm
(
'是否确认操作?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
type
:
'warning'
}).
then
(
function
()
{
}).
then
(()
=>
{
// 更新讲座信息
updateLectureByUser
(
userId
).
then
(()
=>
{
// 讲座更新成功后显示提示
this
.
$message
({
message
:
'修改成功'
,
type
:
'success'
})
})
// 删除用户
}).
then
(()
=>
{
return
delUser
(
userId
)
return
delUser
(
userId
)
}).
then
(()
=>
{
}).
then
(()
=>
{
this
.
getList
()
// 成功删除后重新获取列表并显示提示
this
.
getList
();
this
.
$message
({
this
.
$message
({
message
:
'
刪
除成功'
,
message
:
'
删
除成功'
,
type
:
'success'
type
:
'success'
});
}).
catch
((
error
)
=>
{
// 错误处理
console
.
error
(
error
)
this
.
$message
({
message
:
'操作失败,请稍后重试'
,
type
:
'error'
})
})
})
}).
catch
(
function
()
{})
},
},
/** 导出按钮操作 */
/** 导出按钮操作 */
handleExport
()
{
handleExport
()
{
...
...
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