Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3d2d48b6
authored
Dec 03, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐛
修复 user 在 IDEA 报错的问题
parent
fa421d08
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
36 deletions
+25
-36
src/api/system/user/index.ts
+1
-1
src/api/system/user/profile.ts
+12
-24
src/views/Profile/components/ProfileUser.vue
+2
-2
src/views/system/user/UserAssignRoleForm.vue
+3
-3
src/views/system/user/UserForm.vue
+5
-4
src/views/system/user/index.vue
+2
-2
No files found.
src/api/system/user/index.ts
View file @
3d2d48b6
...
...
@@ -77,5 +77,5 @@ export const updateUserStatus = (id: number, status: number) => {
// 获取用户精简信息列表
export
const
getSimpleUserList
=
():
Promise
<
UserVO
[]
>
=>
{
return
request
.
get
({
url
:
'/system/user/
list-all-simple
'
})
return
request
.
get
({
url
:
'/system/user/
simple-list
'
})
}
src/api/system/user/profile.ts
View file @
3d2d48b6
import
request
from
'@/config/axios'
export
interface
Profile
Dept
{
export
interface
Profile
VO
{
id
:
number
name
:
string
}
export
interface
ProfileRole
{
user
name
:
string
nickname
:
string
dept
:
{
id
:
number
name
:
string
}
export
interface
ProfilePost
{
}
roles
:
{
id
:
number
name
:
string
}
export
interface
SocialUser
{
}[]
posts
:
{
id
:
number
name
:
string
}[]
socialUsers
:
{
type
:
number
openid
:
string
token
:
string
rawTokenInfo
:
string
nickname
:
string
avatar
:
string
rawUserInfo
:
string
code
:
string
state
:
string
}
export
interface
ProfileVO
{
id
:
number
username
:
string
nickname
:
string
dept
:
ProfileDept
roles
:
ProfileRole
[]
posts
:
ProfilePost
[]
socialUsers
:
SocialUser
[]
}[]
email
:
string
mobile
:
string
sex
:
number
...
...
src/views/Profile/components/ProfileUser.vue
View file @
3d2d48b6
...
...
@@ -41,7 +41,7 @@
<li
class=
"list-group-item"
>
<Icon
class=
"mr-5px"
icon=
"ep:calendar"
/>
{{
t
(
'profile.user.createTime'
)
}}
<div
class=
"pull-right"
>
{{
formatDate
(
userInfo
?
.
createTime
)
}}
</div>
<div
class=
"pull-right"
>
{{
formatDate
(
userInfo
.
createTime
)
}}
</div>
</li>
</ul>
</div>
...
...
@@ -55,7 +55,7 @@ import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
defineOptions
({
name
:
'ProfileUser'
})
const
{
t
}
=
useI18n
()
const
userInfo
=
ref
<
ProfileVO
>
(
)
const
userInfo
=
ref
({}
as
ProfileVO
)
const
getUserInfo
=
async
()
=>
{
const
users
=
await
getUserProfile
()
userInfo
.
value
=
users
...
...
src/views/system/user/UserAssignRoleForm.vue
View file @
3d2d48b6
...
...
@@ -32,13 +32,13 @@ const message = useMessage() // 消息弹窗
const
dialogVisible
=
ref
(
false
)
// 弹窗的是否展示
const
formLoading
=
ref
(
false
)
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
const
formData
=
ref
({
id
:
undefined
,
id
:
-
1
,
nickname
:
''
,
username
:
''
,
roleIds
:
[]
})
const
formRef
=
ref
()
// 表单 Ref
const
roleList
=
ref
([])
// 角色的列表
const
roleList
=
ref
([]
as
RoleApi
.
RoleVO
[]
)
// 角色的列表
/** 打开弹窗 */
const
open
=
async
(
row
:
UserApi
.
UserVO
)
=>
{
...
...
@@ -86,7 +86,7 @@ const submitForm = async () => {
/** 重置表单 */
const
resetForm
=
()
=>
{
formData
.
value
=
{
id
:
undefined
,
id
:
-
1
,
nickname
:
''
,
username
:
''
,
roleIds
:
[]
...
...
src/views/system/user/UserForm.vue
View file @
3d2d48b6
...
...
@@ -61,7 +61,7 @@
<el-select
v-model=
"formData.sex"
placeholder=
"请选择"
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.SYSTEM_USER_SEX)"
:key=
"dict.value"
:key=
"dict.value
as number
"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
@@ -75,7 +75,7 @@
v-for=
"item in postList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
:value=
"item.id
!
"
/>
</el-select>
</el-form-item>
...
...
@@ -102,6 +102,7 @@ import { defaultProps, handleTree } from '@/utils/tree'
import
*
as
PostApi
from
'@/api/system/post'
import
*
as
DeptApi
from
'@/api/system/dept'
import
*
as
UserApi
from
'@/api/system/user'
import
{
FormRules
}
from
'element-plus'
defineOptions
({
name
:
'SystemUserForm'
})
...
...
@@ -126,7 +127,7 @@ const formData = ref({
status
:
CommonStatusEnum
.
ENABLE
,
roleIds
:
[]
})
const
formRules
=
reactive
({
const
formRules
=
reactive
<
FormRules
>
({
username
:
[{
required
:
true
,
message
:
'用户名称不能为空'
,
trigger
:
'blur'
}],
nickname
:
[{
required
:
true
,
message
:
'用户昵称不能为空'
,
trigger
:
'blur'
}],
password
:
[{
required
:
true
,
message
:
'用户密码不能为空'
,
trigger
:
'blur'
}],
...
...
@@ -147,7 +148,7 @@ const formRules = reactive({
})
const
formRef
=
ref
()
// 表单 Ref
const
deptList
=
ref
<
Tree
[]
>
([])
// 树形结构
const
postList
=
ref
([])
// 岗位列表
const
postList
=
ref
([]
as
PostApi
.
PostVO
[]
)
// 岗位列表
/** 打开弹窗 */
const
open
=
async
(
type
:
string
,
id
?:
number
)
=>
{
...
...
src/views/system/user/index.vue
View file @
3d2d48b6
...
...
@@ -47,7 +47,7 @@
>
<el-option
v-for=
"dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key=
"dict.value"
:key=
"dict.value
as number
"
:label=
"dict.label"
:value=
"dict.value"
/>
...
...
@@ -113,7 +113,7 @@
label=
"部门"
align=
"center"
key=
"deptName"
prop=
"dept
.n
ame"
prop=
"dept
N
ame"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"手机号码"
align=
"center"
prop=
"mobile"
width=
"120"
/>
...
...
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