Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yongxinda-admin
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
yongxinda-admin
Commits
3f03c869
提交
3f03c869
authored
12月 08, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
fd34fd18
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
33 行增加
和
1 行删除
+33
-1
userAPI.ts
src/services/api/user/userAPI.ts
+11
-0
auxiliary.vue
src/views/marketManage/auxiliary.vue
+4
-0
userManage.vue
src/views/system/userManage.vue
+18
-1
没有找到文件。
src/services/api/user/userAPI.ts
浏览文件 @
3f03c869
...
@@ -2,6 +2,7 @@ import httpRequest from "@/services/common";
...
@@ -2,6 +2,7 @@ import httpRequest from "@/services/common";
import
{
userUrlConfig
,
authUrlConfig
}
from
'@/services/config'
;
import
{
userUrlConfig
,
authUrlConfig
}
from
'@/services/config'
;
import
{
store
}
from
'@/store/index'
import
{
store
}
from
'@/store/index'
import
{
LoginParm
,
LoginResult
,
UserInfo
}
from
"@/services/types/user/userModel"
;
import
{
LoginParm
,
LoginResult
,
UserInfo
}
from
"@/services/types/user/userModel"
;
import
{
request
}
from
'../config'
;
export
async
function
getImagApi
()
{
export
async
function
getImagApi
()
{
//获取验证码接口
//获取验证码接口
...
@@ -47,3 +48,13 @@ export const getAllRole = async () => {
...
@@ -47,3 +48,13 @@ export const getAllRole = async () => {
export
const
findRoleByUser
=
async
(
params
:
any
)
=>
{
export
const
findRoleByUser
=
async
(
params
:
any
)
=>
{
return
await
httpRequest
.
get
(
authUrlConfig
[
'findRoleByUser'
],
params
)
return
await
httpRequest
.
get
(
authUrlConfig
[
'findRoleByUser'
],
params
)
}
}
// 启用与禁用
export
const
userEnabled
=
(
userId
:
number
)
=>
{
return
request
({
url
:
'/userAccount/enabled'
,
method
:
'post'
,
data
:
{
userId
}
})
}
src/views/marketManage/auxiliary.vue
浏览文件 @
3f03c869
...
@@ -88,6 +88,8 @@ let rules = ref({
...
@@ -88,6 +88,8 @@ let rules = ref({
let
dictRef
=
ref
()
let
dictRef
=
ref
()
let
handleFilter
=
()
=>
{
let
handleFilter
=
()
=>
{
if
(
dictQuery
.
value
.
dictName
)
dictQuery
.
value
.
dictName
=
','
+
dictQuery
.
value
.
dictName
+
','
init
(
dictQuery
.
value
)
init
(
dictQuery
.
value
)
}
}
...
@@ -196,6 +198,8 @@ let init = (params?: any) => {
...
@@ -196,6 +198,8 @@ let init = (params?: any) => {
getDictList
(
params
).
then
((
res
:
any
)
=>
{
getDictList
(
params
).
then
((
res
:
any
)
=>
{
dictData
.
value
=
res
.
data
.
records
dictData
.
value
=
res
.
data
.
records
total
.
value
=
res
.
data
.
total
total
.
value
=
res
.
data
.
total
let
reg
=
new
RegExp
(
','
,
"g"
)
dictQuery
.
value
.
dictName
=
dictQuery
.
value
.
dictName
.
replace
(
reg
,
''
)
console
.
log
(
res
,
'字典数据'
);
console
.
log
(
res
,
'字典数据'
);
})
})
}
}
...
...
src/views/system/userManage.vue
浏览文件 @
3f03c869
...
@@ -15,6 +15,12 @@
...
@@ -15,6 +15,12 @@
{{
moment
(
scope
.
row
.
fdate
).
format
(
"YYYY-MM-DD hh:mm:ss"
)
}}
{{
moment
(
scope
.
row
.
fdate
).
format
(
"YYYY-MM-DD hh:mm:ss"
)
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<!-- 设置启用禁用 -->
<el-table-column
label=
"是否启用"
align=
"center"
>
<
template
#
default=
"scope"
>
<el-switch
v-model=
"scope.row.enabled"
@
change=
"switchChange($event, scope.row.userId)"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"135"
align=
"center"
>
<el-table-column
label=
"操作"
width=
"135"
align=
"center"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-link
type=
"primary"
:underline=
"false"
@
click=
"handleEdit(scope)"
>
编辑
</el-link>
<el-link
type=
"primary"
:underline=
"false"
@
click=
"handleEdit(scope)"
>
编辑
</el-link>
...
@@ -62,7 +68,7 @@
...
@@ -62,7 +68,7 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
reactive
,
ref
,
watch
,
computed
}
from
'vue'
import
{
reactive
,
ref
,
watch
,
computed
}
from
'vue'
import
{
ElMessageBox
}
from
'element-plus'
;
import
{
ElMessageBox
}
from
'element-plus'
;
import
{
addUser
,
getUserInfo
,
editUser
,
deleteUser
,
getAllRole
,
findRoleByUser
}
from
'@/services/api/user/userAPI'
import
{
addUser
,
getUserInfo
,
editUser
,
deleteUser
,
getAllRole
,
findRoleByUser
,
userEnabled
}
from
'@/services/api/user/userAPI'
import
{
uploadPath
}
from
"@/services/api/storage"
;
import
{
uploadPath
}
from
"@/services/api/storage"
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
pagination
from
'@/components/pagination/index.vue'
import
pagination
from
'@/components/pagination/index.vue'
...
@@ -239,6 +245,17 @@ function init() {
...
@@ -239,6 +245,17 @@ function init() {
})
})
}
}
// 是否启用
const
switchChange
=
(
value
:
boolean
,
userId
:
any
)
=>
{
// console.log(value, userId);
userEnabled
(
userId
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
200
)
{
init
()
}
})
}
// 上传头像
let
uploadPicUrl
=
(
res
:
any
)
=>
{
let
uploadPicUrl
=
(
res
:
any
)
=>
{
console
.
log
(
res
);
console
.
log
(
res
);
avatarUrl
.
value
=
res
.
data
.
url
;
avatarUrl
.
value
=
res
.
data
.
url
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论