Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
华润手术跟台
admin
Commits
a829f479
提交
a829f479
authored
11月 01, 2022
作者:
leon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户管理-详情
上级
b4344dca
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
129 行增加
和
33 行删除
+129
-33
schema.ts
src/views/system/receiver/schema.ts
+2
-4
detail.vue
src/views/system/user/detail.vue
+118
-22
index.vue
src/views/system/user/index.vue
+4
-3
schema.ts
src/views/system/user/schema.ts
+5
-4
没有找到文件。
src/views/system/receiver/schema.ts
浏览文件 @
a829f479
...
@@ -13,6 +13,7 @@ import { getDistributorId } from '/@/commonSchemaProperty';
...
@@ -13,6 +13,7 @@ import { getDistributorId } from '/@/commonSchemaProperty';
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
{
BatchVerifyParams
}
from
'/@/api/model/receiver'
;
import
{
BatchVerifyParams
}
from
'/@/api/model/receiver'
;
import
{
useUserStore
}
from
'/@/store/modules/user'
;
import
{
useUserStore
}
from
'/@/store/modules/user'
;
import
{
phoneRule
}
from
'/@/commonSchemaProperty/formRules'
;
const
{
hasPermission
}
=
usePermission
();
const
{
hasPermission
}
=
usePermission
();
const
userStore
=
useUserStore
();
const
userStore
=
useUserStore
();
export
enum
YesNoEnum
{
export
enum
YesNoEnum
{
...
@@ -147,10 +148,7 @@ export const schema = {
...
@@ -147,10 +148,7 @@ export const schema = {
},
},
colProps
,
colProps
,
component
:
'Input'
,
component
:
'Input'
,
rules
:
[
rules
:
[{
required
:
true
,
message
:
'请输入电话!'
},
phoneRule
()],
{
required
:
true
,
message
:
'请输入电话!'
},
{
pattern
:
/^1
[
3456789
]\d{9}
$/
,
message
:
'请输入正确的手机号码!'
,
trigger
:
'blur'
},
],
},
},
table
:
{},
table
:
{},
},
},
...
...
src/views/system/user/detail.vue
浏览文件 @
a829f479
<
template
>
<
template
>
<Card
:bordered=
"false"
>
<div>
<Descriptions
bordered
:column=
"3"
>
<Card
:bordered=
"false"
:loading=
"!data.isOver"
>
<Descriptions
.
Item
<template
#
extra
v-if=
"data.isOver"
>
v-for=
"p in displayProps"
<a-button
type=
"primary"
v-if=
"isShowHandleEdit(data.detail.status)"
@
click=
"handleEdit"
>
:key=
"p.title"
<template
#
icon
>
<Icon
icon=
"clarity:note-edit-line"
/></
template
>
:label=
"p.title"
编辑
:span=
"['avatar'].includes(p.name) ? 3 : 1"
</a-button>
>
<a-popconfirm
<span
v-if=
"p.key === 'avatar'"
>
class=
"ml-4"
<img
:src=
"p.value"
style=
"width: 120px; height: 120px"
/>
title=
"确定通过吗"
</span>
ok-text=
"是"
<template
v-else
>
cancel-text=
"否"
{{
p
.
value
}}
@
confirm=
"handleVerify(StatusValEnum.PASSED)"
</
template
>
>
</Descriptions
.Item
>
<a-button
type=
"primary"
v-if=
"isShowHandlePassed(data.detail.status)"
>
通过
</a-button>
</Descriptions>
</a-popconfirm>
</Card>
<a-popconfirm
class=
"ml-4"
title=
"确定拒绝吗"
ok-text=
"是"
cancel-text=
"否"
@
confirm=
"handleVerify(StatusValEnum.PASSED)"
>
<a-button
type=
"danger"
v-if=
"isShowHandleReject(data.detail.status)"
>
拒绝
</a-button>
</a-popconfirm>
<a-popconfirm
class=
"ml-4"
title=
"确定禁用吗"
ok-text=
"是"
cancel-text=
"否"
@
confirm=
"handleVerify(StatusValEnum.FORBIDDEN)"
>
<a-button
type=
"danger"
v-if=
"isShowHandleForbidden(data.detail.status)"
>
禁用
</a-button>
</a-popconfirm>
<a-popconfirm
class=
"ml-4"
title=
"确定删除吗"
ok-text=
"是"
cancel-text=
"否"
@
confirm=
"handleDelete"
>
<a-button
type=
"danger"
v-if=
"isShowHandleDelete()"
>
删除
</a-button>
</a-popconfirm>
</template>
<Descriptions
bordered
:column=
"3"
>
<Descriptions
.
Item
v-for=
"p in displayProps"
:key=
"p.title"
:label=
"p.title"
:span=
"['avatar'].includes(p.name) ? 3 : 1"
>
<span
v-if=
"p.key === 'avatar'"
>
<img
:src=
"p.value"
style=
"width: 120px; height: 120px"
/>
</span>
<
template
v-else
>
{{
p
.
value
}}
</
template
>
</Descriptions
.Item
>
</Descriptions>
</Card>
<UserDrawer
@
register=
"registerDrawer"
@
success=
"handleSuccess"
/>
</div>
</template>
</template>
<
script
lang=
"ts"
setup
name=
"
Device
Detail"
>
<
script
lang=
"ts"
setup
name=
"
User
Detail"
>
import
{
onMounted
,
computed
,
ref
,
reactive
}
from
'vue'
;
import
{
onMounted
,
computed
,
ref
,
reactive
}
from
'vue'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
useRoute
,
useRouter
}
from
'vue-router'
;
import
{
ComputedRef
}
from
'@vue/reactivity'
;
import
{
ComputedRef
}
from
'@vue/reactivity'
;
import
{
Descriptions
,
Card
}
from
'ant-design-vue'
;
import
{
Descriptions
,
Card
}
from
'ant-design-vue'
;
import
{
descriptionColumns
}
from
'./schema'
;
import
{
descriptionColumns
}
from
'./schema'
;
import
*
as
UserApi
from
'/@/api/system/userApi'
;
import
*
as
UserApi
from
'/@/api/system/userApi'
;
import
{
Device
}
from
'/@/api/model/device'
;
import
{
Icon
}
from
'/@/components/Icon'
;
import
{
isShowHandleEdit
,
isShowHandlePassed
,
isShowHandleForbidden
,
isShowHandleReject
,
isShowHandleDelete
,
getVerifyParams
,
StatusValEnum
,
}
from
'./schema'
;
import
UserDrawer
from
'./drawer.vue'
;
import
{
useDrawer
}
from
'/@/components/Drawer'
;
import
{
User
}
from
'/@/api/model/user'
;
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
const
router
=
useRouter
();
const
route
=
useRoute
();
const
route
=
useRoute
();
const
id
=
ref
(
route
.
params
?.
id
);
const
id
=
ref
(
route
.
params
?.
id
);
let
data
=
reactive
({
let
data
=
reactive
({
...
@@ -33,7 +88,7 @@
...
@@ -33,7 +88,7 @@
isOver
:
false
,
isOver
:
false
,
});
});
const
getDetail
=
()
=>
{
const
getDetail
=
()
=>
{
UserApi
.
getById
(
id
.
value
).
then
((
res
:
Device
)
=>
{
UserApi
.
getById
(
id
.
value
).
then
((
res
:
User
)
=>
{
data
.
isOver
=
true
;
data
.
isOver
=
true
;
data
.
detail
=
res
;
data
.
detail
=
res
;
});
});
...
@@ -42,6 +97,47 @@
...
@@ -42,6 +97,47 @@
onMounted
(()
=>
{
onMounted
(()
=>
{
getDetail
();
getDetail
();
});
});
const
setLoading
=
(
flag
:
boolean
)
=>
{
data
.
isOver
=
!
flag
;
};
const
reload
=
()
=>
{
data
.
isOver
=
false
;
data
.
detail
=
{};
getDetail
();
};
const
handleSuccess
=
()
=>
{
reload
();
};
const
handleVerify
=
(
status
:
string
)
=>
{
setLoading
(
true
);
UserApi
.
batchVerify
(
getVerifyParams
(
data
.
detail
,
status
))
.
then
((
_
)
=>
{
reload
();
})
.
catch
(()
=>
{
setLoading
(
false
);
});
};
const
handleEdit
=
()
=>
{
openDrawer
(
true
,
{
record
:
data
.
detail
,
isUpdate
:
true
,
});
};
const
handleDelete
=
()
=>
{
setLoading
(
true
);
UserApi
.
remove
(
data
.
detail
.
id
)
.
then
((
_
)
=>
{
router
.
back
();
})
.
catch
(()
=>
{
setLoading
(
false
);
});
};
const
displayProps
:
ComputedRef
<
Array
<
any
>>
=
computed
(()
=>
{
const
displayProps
:
ComputedRef
<
Array
<
any
>>
=
computed
(()
=>
{
if
(
!
data
.
isOver
)
return
{};
if
(
!
data
.
isOver
)
return
{};
...
...
src/views/system/user/index.vue
浏览文件 @
a829f479
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
<UserDrawer
@
register=
"registerDrawer"
@
success=
"handleSuccess"
/>
<UserDrawer
@
register=
"registerDrawer"
@
success=
"handleSuccess"
/>
</div>
</div>
</template>
</template>
<
script
lang=
"ts"
setup
name=
"
DeviceIndex
"
>
<
script
lang=
"ts"
setup
name=
"
AUTH_SYSTEM_USER
"
>
import
{
import
{
isShowHandleEdit
,
isShowHandleEdit
,
isShowHandlePassed
,
isShowHandlePassed
,
...
@@ -119,6 +119,7 @@
...
@@ -119,6 +119,7 @@
import
componentSetting
from
'/@/settings/componentSetting'
;
import
componentSetting
from
'/@/settings/componentSetting'
;
import
UserDrawer
from
'./drawer.vue'
;
import
UserDrawer
from
'./drawer.vue'
;
import
{
columns
,
searchFormSchema
}
from
'./schema'
;
import
{
columns
,
searchFormSchema
}
from
'./schema'
;
import
{
useActivatedReload
}
from
'/@/hooks/myhooks/reLoadHook'
;
const
{
hasPermission
}
=
usePermission
();
const
{
hasPermission
}
=
usePermission
();
const
go
=
useGo
();
const
go
=
useGo
();
...
@@ -157,7 +158,7 @@
...
@@ -157,7 +158,7 @@
fixed
:
'right'
,
fixed
:
'right'
,
},
},
});
});
useActivatedReload
(
reload
);
const
handleParams
=
(
params
)
=>
{
const
handleParams
=
(
params
)
=>
{
const
{
pageNum
,
pageSize
}
=
params
;
const
{
pageNum
,
pageSize
}
=
params
;
const
handledParams
:
any
=
{
pageNum
,
pageSize
};
const
handledParams
:
any
=
{
pageNum
,
pageSize
};
...
@@ -247,6 +248,6 @@
...
@@ -247,6 +248,6 @@
};
};
const
handleView
=
(
record
)
=>
{
const
handleView
=
(
record
)
=>
{
go
(
'/system/user/'
+
record
.
id
);
go
(
'/
main/
system/user/'
+
record
.
id
);
};
};
</
script
>
</
script
>
src/views/system/user/schema.ts
浏览文件 @
a829f479
...
@@ -11,6 +11,7 @@ import { FormSchema } from '/@/components/Table';
...
@@ -11,6 +11,7 @@ import { FormSchema } from '/@/components/Table';
import
*
as
RoleApi
from
'/@/api/system/roleApi'
;
import
*
as
RoleApi
from
'/@/api/system/roleApi'
;
import
{
getDistributorId
}
from
'/@/commonSchemaProperty'
;
import
{
getDistributorId
}
from
'/@/commonSchemaProperty'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
{
phoneRule
}
from
'/@/commonSchemaProperty/formRules'
;
const
{
hasPermission
}
=
usePermission
();
const
{
hasPermission
}
=
usePermission
();
export
interface
BatchVerifyParams
{
export
interface
BatchVerifyParams
{
/**
/**
...
@@ -173,6 +174,7 @@ export const schema = {
...
@@ -173,6 +174,7 @@ export const schema = {
},
},
colProps
,
colProps
,
component
:
'Input'
,
component
:
'Input'
,
rules
:
[
phoneRule
()],
},
},
table
:
{},
table
:
{},
},
},
...
@@ -325,8 +327,8 @@ export const schema = {
...
@@ -325,8 +327,8 @@ export const schema = {
],
],
};
};
const
queryFields
=
[
'distributorId'
,
'username'
,
'realName'
,
'mobile'
,
'status'
,
'
deleteStatus'
,
'
createTime'
];
const
queryFields
=
[
'distributorId'
,
'username'
,
'realName'
,
'mobile'
,
'status'
,
'createTime'
];
const
editFields
=
[
'distributorId'
,
'username'
,
PASSWORD
,
'realName'
,
'mobile'
,
'roleList'
,
'deleteStatus'
];
const
editFields
=
[
'distributorId'
,
'username'
,
PASSWORD
,
'realName'
,
'mobile'
,
'roleList'
];
const
tableFields
=
[
const
tableFields
=
[
'distributorId'
,
'distributorId'
,
'username'
,
'username'
,
...
@@ -334,7 +336,6 @@ const tableFields = [
...
@@ -334,7 +336,6 @@ const tableFields = [
'mobile'
,
'mobile'
,
'roleList'
,
'roleList'
,
'status'
,
'status'
,
'deleteStatus'
,
'editorName'
,
'editorName'
,
'createTime'
,
'createTime'
,
];
];
...
@@ -346,7 +347,6 @@ const descriptionFields = [
...
@@ -346,7 +347,6 @@ const descriptionFields = [
'mobile'
,
'mobile'
,
'status'
,
'status'
,
'salePeopleId'
,
'salePeopleId'
,
'deleteStatus'
,
'editorId'
,
'editorId'
,
'editorName'
,
'editorName'
,
'createTime'
,
'createTime'
,
...
@@ -361,6 +361,7 @@ export const searchFormSchema: FormSchema[] = schema.properties
...
@@ -361,6 +361,7 @@ export const searchFormSchema: FormSchema[] = schema.properties
field
,
field
,
label
,
label
,
defaultValue
:
undefined
,
defaultValue
:
undefined
,
// @ts-ignore
rules
:
rules
.
filter
((
r
)
=>
!
r
.
required
),
rules
:
rules
.
filter
((
r
)
=>
!
r
.
required
),
...
formProps
,
...
formProps
,
}
as
FormSchema
),
}
as
FormSchema
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论