Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
华润手术跟台
admin
Commits
89ffb0ac
提交
89ffb0ac
authored
10月 31, 2022
作者:
leon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix用户管理
上级
2273b6e6
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
259 行增加
和
62 行删除
+259
-62
.env.production
.env.production
+2
-2
userApi.ts
src/api/system/userApi.ts
+1
-1
index.ts
src/commonSchemaProperty/index.ts
+8
-8
drawer.vue
src/views/system/doctor/drawer.vue
+4
-5
schema.ts
src/views/system/doctor/schema.ts
+6
-4
drawer.vue
src/views/system/receiver/drawer.vue
+1
-2
schema.ts
src/views/system/receiver/schema.ts
+6
-4
drawer.vue
src/views/system/user/drawer.vue
+58
-7
index.vue
src/views/system/user/index.vue
+104
-26
schema.ts
src/views/system/user/schema.ts
+69
-3
没有找到文件。
.env.production
浏览文件 @
89ffb0ac
...
@@ -16,11 +16,11 @@ VITE_BUILD_COMPRESS='none'
...
@@ -16,11 +16,11 @@ VITE_BUILD_COMPRESS='none'
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE=false
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE=false
# Basic interface address SPA
# Basic interface address SPA
VITE_GLOB_API_URL=http://
42.192.95.9
:8101
VITE_GLOB_API_URL=http://
101.34.156.75
:8101
# File upload address, optional
# File upload address, optional
# It can be forwarded by nginx or write the actual address directly
# It can be forwarded by nginx or write the actual address directly
VITE_GLOB_UPLOAD_URL=http://
42.192.95.9
:8101/v1/sys/upload
VITE_GLOB_UPLOAD_URL=http://
101.34.156.75
:8101/v1/sys/upload
# Interface prefix
# Interface prefix
VITE_GLOB_API_URL_PREFIX=
VITE_GLOB_API_URL_PREFIX=
...
...
src/api/system/userApi.ts
浏览文件 @
89ffb0ac
...
@@ -102,4 +102,4 @@ export const changePassword = (passwordInfo: any) =>
...
@@ -102,4 +102,4 @@ export const changePassword = (passwordInfo: any) =>
/**
/**
* 审核
* 审核
*/
*/
export
const
v
erify
=
(
data
:
any
)
=>
defHttp
.
post
<
User
>
({
url
:
`
${
baseApi
}
/batch/verify`
,
data
});
export
const
batchV
erify
=
(
data
:
any
)
=>
defHttp
.
post
<
User
>
({
url
:
`
${
baseApi
}
/batch/verify`
,
data
});
src/commonSchemaProperty/index.ts
浏览文件 @
89ffb0ac
...
@@ -5,6 +5,13 @@ import * as DistributorApi from '/@/api/system/distributorApi';
...
@@ -5,6 +5,13 @@ import * as DistributorApi from '/@/api/system/distributorApi';
import
get
from
'lodash.get'
;
import
get
from
'lodash.get'
;
import
*
as
HospitalApi
from
'/@/api/system/hospitalApi'
;
import
*
as
HospitalApi
from
'/@/api/system/hospitalApi'
;
export
const
getDistributorText
=
(
text
)
=>
{
if
(
text
===
0
)
{
return
'供应商创建'
;
}
else
{
return
'(已删除/不存在)'
;
}
};
const
getDistributorId
=
({
colProps
})
=>
{
const
getDistributorId
=
({
colProps
})
=>
{
return
{
return
{
field
:
'distributorId'
,
field
:
'distributorId'
,
...
@@ -32,14 +39,7 @@ const getDistributorId = ({ colProps }) => {
...
@@ -32,14 +39,7 @@ const getDistributorId = ({ colProps }) => {
},
},
table
:
{
table
:
{
customRender
:
({
text
,
record
})
=>
{
customRender
:
({
text
,
record
})
=>
{
const
getText
=
(
text
)
=>
{
return
get
(
record
,
'distributor.name'
)
||
getDistributorText
(
text
);
if
(
text
===
0
)
{
return
'供应商创建'
;
}
else
{
return
'(已删除/不存在)'
;
}
};
return
get
(
record
,
'distributor.name'
)
||
getText
(
text
);
},
},
},
},
};
};
...
...
src/views/system/doctor/drawer.vue
浏览文件 @
89ffb0ac
...
@@ -58,11 +58,10 @@
...
@@ -58,11 +58,10 @@
await
execute
();
await
execute
();
if
(
detail
.
value
)
{
if
(
detail
.
value
)
{
const
formData
:
any
=
{
...
detail
.
value
};
const
formData
:
any
=
{
...
detail
.
value
};
if
(
detail
.
value
.
hospital
)
{
formData
.
hospitalId
=
{
formData
.
hospitalId
=
{
label
:
detail
.
value
.
hospital
.
name
,
value
:
detail
.
value
.
hospital
.
id
};
label
:
detail
.
value
.
hospital
?.
name
||
'(已删除/不存在)'
,
}
else
{
value
:
detail
.
value
.
hospitaId
,
formData
.
hospitalId
=
{
label
:
'(已删除/不存在)'
,
value
:
detail
.
value
.
hospitaId
};
};
}
await
setFieldsValue
(
formData
);
await
setFieldsValue
(
formData
);
}
}
}
}
...
...
src/views/system/doctor/schema.ts
浏览文件 @
89ffb0ac
...
@@ -46,16 +46,18 @@ export enum StatusValEnum {
...
@@ -46,16 +46,18 @@ export enum StatusValEnum {
}
}
export
const
isShowHandlePassed
=
(
status
:
string
):
boolean
=>
{
export
const
isShowHandlePassed
=
(
status
:
string
):
boolean
=>
{
return
(
hasPermission
(
'AUTH_SYSTEM_DOCTOR:PASSED'
)
&&
status
===
'PENDING_REVIEW'
)
||
status
===
'FORBIDDEN'
;
return
(
(
hasPermission
(
'AUTH_SYSTEM_DOCTOR:PASSED'
)
&&
status
===
'PENDING_REVIEW'
)
||
status
===
StatusValEnum
.
FORBIDDEN
);
};
};
export
const
isShowHandleReject
=
(
status
:
string
):
boolean
=>
{
export
const
isShowHandleReject
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_DOCTOR:REJECT'
)
&&
status
===
'PENDING_REVIEW'
;
return
hasPermission
(
'AUTH_SYSTEM_DOCTOR:REJECT'
)
&&
status
===
StatusValEnum
.
PENDING_REVIEW
;
};
};
export
const
isShowHandleForbidden
=
(
status
:
string
):
boolean
=>
{
export
const
isShowHandleForbidden
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_DOCTOR:FORBIDDEN'
)
&&
status
===
'PASSED'
;
return
hasPermission
(
'AUTH_SYSTEM_DOCTOR:FORBIDDEN'
)
&&
status
===
StatusValEnum
.
PASSED
;
};
};
export
const
isShowHandleEdit
=
(
status
:
string
):
boolean
=>
{
export
const
isShowHandleEdit
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_DOCTOR:EDIT'
)
&&
status
!==
'FORBIDDEN'
;
return
hasPermission
(
'AUTH_SYSTEM_DOCTOR:EDIT'
)
&&
status
!==
StatusValEnum
.
FORBIDDEN
;
};
};
export
const
isShowHandleDelete
=
():
boolean
=>
{
export
const
isShowHandleDelete
=
():
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_DOCTOR:DELETE'
);
return
hasPermission
(
'AUTH_SYSTEM_DOCTOR:DELETE'
);
...
...
src/views/system/receiver/drawer.vue
浏览文件 @
89ffb0ac
...
@@ -16,10 +16,9 @@
...
@@ -16,10 +16,9 @@
<
script
lang=
"ts"
setup
name=
"ReceiverDrawer"
>
<
script
lang=
"ts"
setup
name=
"ReceiverDrawer"
>
import
{
defineEmits
,
ref
,
computed
,
unref
}
from
'vue'
;
import
{
defineEmits
,
ref
,
computed
,
unref
}
from
'vue'
;
import
{
BasicForm
,
useForm
}
from
'/@/components/Form/index'
;
import
{
BasicForm
,
useForm
}
from
'/@/components/Form/index'
;
import
{
formSchema
}
from
'./schema'
;
import
{
formSchema
,
StatusValEnum
}
from
'./schema'
;
import
{
BasicDrawer
,
useDrawerInner
}
from
'/@/components/Drawer'
;
import
{
BasicDrawer
,
useDrawerInner
}
from
'/@/components/Drawer'
;
import
*
as
ReceiverApi
from
'/@/api/system/receiverApi'
;
import
*
as
ReceiverApi
from
'/@/api/system/receiverApi'
;
import
{
StatusValEnum
}
from
'/@/views/system/doctor/schema'
;
import
{
useAsyncState
}
from
'@vueuse/core'
;
import
{
useAsyncState
}
from
'@vueuse/core'
;
import
{
Doctor
}
from
'/@/api/model/doctor'
;
import
{
Doctor
}
from
'/@/api/model/doctor'
;
...
...
src/views/system/receiver/schema.ts
浏览文件 @
89ffb0ac
...
@@ -55,16 +55,18 @@ for (const key in StatusEnum) {
...
@@ -55,16 +55,18 @@ for (const key in StatusEnum) {
}
}
export
const
isShowHandlePassed
=
(
status
:
string
):
boolean
=>
{
export
const
isShowHandlePassed
=
(
status
:
string
):
boolean
=>
{
return
(
hasPermission
(
'AUTH_SYSTEM_RECEIVER:PASSED'
)
&&
status
===
'PENDING_REVIEW'
)
||
status
===
'FORBIDDEN'
;
return
(
(
hasPermission
(
'AUTH_SYSTEM_RECEIVER:PASSED'
)
&&
status
===
'PENDING_REVIEW'
)
||
status
===
StatusValEnum
.
FORBIDDEN
);
};
};
export
const
isShowHandleReject
=
(
status
:
string
):
boolean
=>
{
export
const
isShowHandleReject
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_RECEIVER:REJECT'
)
&&
status
===
'PENDING_REVIEW'
;
return
hasPermission
(
'AUTH_SYSTEM_RECEIVER:REJECT'
)
&&
status
===
StatusValEnum
.
PENDING_REVIEW
;
};
};
export
const
isShowHandleForbidden
=
(
status
:
string
):
boolean
=>
{
export
const
isShowHandleForbidden
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_RECEIVER:FORBIDDEN'
)
&&
status
===
'PASSED'
;
return
hasPermission
(
'AUTH_SYSTEM_RECEIVER:FORBIDDEN'
)
&&
status
===
StatusValEnum
.
PASSED
;
};
};
export
const
isShowHandleEdit
=
(
status
:
string
):
boolean
=>
{
export
const
isShowHandleEdit
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_RECEIVER:EDIT'
)
&&
status
!==
'FORBIDDEN'
;
return
hasPermission
(
'AUTH_SYSTEM_RECEIVER:EDIT'
)
&&
status
!==
StatusValEnum
.
FORBIDDEN
;
};
};
export
const
isShowHandleDelete
=
():
boolean
=>
{
export
const
isShowHandleDelete
=
():
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_RECEIVER:DELETE'
);
return
hasPermission
(
'AUTH_SYSTEM_RECEIVER:DELETE'
);
...
...
src/views/system/user/drawer.vue
浏览文件 @
89ffb0ac
<
template
>
<
template
>
<BasicDrawer
v-bind=
"$attrs"
@
register=
"registerDrawer"
showFooter
:title=
"getTitle"
width=
"600px"
@
ok=
"handleSubmit"
>
<BasicDrawer
<BasicForm
@
register=
"registerForm"
/>
v-bind=
"$attrs"
@
register=
"registerDrawer"
showFooter
:confirmDisabled=
"getConfirmDisabled"
:title=
"getTitle"
width=
"600px"
@
ok=
"handleSubmit"
>
<a-spin
:spinning=
"isLoading"
>
<BasicForm
@
register=
"registerForm"
/>
</a-spin>
</BasicDrawer>
</BasicDrawer>
</
template
>
</
template
>
<
script
lang=
"ts"
setup
name=
"UserDrawer"
>
<
script
lang=
"ts"
setup
name=
"UserDrawer"
>
import
{
defineEmits
,
ref
,
computed
,
unref
}
from
'vue'
;
import
{
defineEmits
,
ref
,
computed
,
unref
}
from
'vue'
;
import
{
BasicForm
,
useForm
}
from
'/@/components/Form/index'
;
import
{
BasicForm
,
useForm
}
from
'/@/components/Form/index'
;
import
{
formSchema
}
from
'./schema'
;
import
{
formSchema
,
StatusValEnum
}
from
'./schema'
;
import
{
BasicDrawer
,
useDrawerInner
}
from
'/@/components/Drawer'
;
import
{
BasicDrawer
,
useDrawerInner
}
from
'/@/components/Drawer'
;
import
*
as
UserApi
from
'/@/api/system/userApi'
;
import
*
as
UserApi
from
'/@/api/system/userApi'
;
import
{
useAsyncState
}
from
'@vueuse/core'
;
import
{
User
}
from
'/@/api/model/user'
;
import
{
getDistributorText
}
from
'/@/commonSchemaProperty'
;
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
isUpdate
=
ref
(
true
);
const
isUpdate
=
ref
(
true
);
...
@@ -20,6 +33,22 @@
...
@@ -20,6 +33,22 @@
showActionButtonGroup
:
false
,
showActionButtonGroup
:
false
,
});
});
// id 查询
const
{
state
:
detail
,
isReady
:
isDetailReady
,
isLoading
,
execute
,
}
=
useAsyncState
(
()
=>
{
return
UserApi
.
getById
(
entityId
.
value
).
then
((
res
:
User
)
=>
res
);
},
null
,
{
immediate
:
false
,
},
);
const
[
registerDrawer
,
{
setDrawerProps
,
closeDrawer
}]
=
useDrawerInner
(
async
(
data
)
=>
{
const
[
registerDrawer
,
{
setDrawerProps
,
closeDrawer
}]
=
useDrawerInner
(
async
(
data
)
=>
{
await
resetFields
();
await
resetFields
();
setDrawerProps
({
confirmLoading
:
false
});
setDrawerProps
({
confirmLoading
:
false
});
...
@@ -27,10 +56,31 @@
...
@@ -27,10 +56,31 @@
entityId
.
value
=
data
?.
record
?.
id
;
entityId
.
value
=
data
?.
record
?.
id
;
if
(
unref
(
isUpdate
))
{
if
(
unref
(
isUpdate
))
{
await
setFieldsValue
({
await
execute
();
...
data
.
record
,
if
(
detail
.
value
)
{
distributorId
:
{
label
:
data
.
record
.
distributorName
,
value
:
data
.
record
.
distributorId
},
const
formData
:
any
=
{
...
detail
.
value
};
});
formData
.
distributorId
=
{
label
:
data
.
record
.
distributor
?.
name
||
getDistributorText
(
data
.
record
.
distributorId
),
value
:
data
.
record
.
distributorId
,
};
formData
.
roleList
=
formData
.
roleList
?.
map
((
item
:
any
)
=>
{
return
{
label
:
item
.
remark
,
value
:
item
.
id
,
};
})
||
[];
console
.
log
(
'formData'
,
formData
);
await
setFieldsValue
(
formData
);
}
}
});
const
getConfirmDisabled
=
computed
(()
=>
{
if
(
unref
(
isUpdate
))
{
return
!
unref
(
isDetailReady
);
}
else
{
return
false
;
}
}
});
});
...
@@ -55,6 +105,7 @@
...
@@ -55,6 +105,7 @@
id
:
unref
(
entityId
),
id
:
unref
(
entityId
),
distributorId
:
distributorId
.
value
,
distributorId
:
distributorId
.
value
,
distributorName
:
distributorId
.
label
,
distributorName
:
distributorId
.
label
,
status
:
StatusValEnum
.
PENDING_REVIEW
,
},
},
);
);
data
.
roleList
=
[{
id
:
data
.
roleList
.
value
}];
data
.
roleList
=
[{
id
:
data
.
roleList
.
value
}];
...
...
src/views/system/user/index.vue
浏览文件 @
89ffb0ac
<
template
>
<
template
>
<div>
<div>
<BasicTable
@
register=
"registerTable"
>
<BasicTable
@
register=
"registerTable"
>
<template
#
headerTop
>
<a-alert
type=
"info"
show-icon
>
<template
#
message
>
<template
v-if=
"checkedKeys.length > 0"
>
<span>
已选中
{{
checkedKeys
.
length
}}
条记录
</span>
<a-button
type=
"link"
@
click=
"checkedKeys = []"
size=
"small"
>
清空
</a-button>
<a-popconfirm
v-if=
"hasPermission('AUTH_SYSTEM_RECEIVER:PASSED')"
class=
"ml-4"
title=
"确定要全部通过审核吗?"
ok-text=
"是"
cancel-text=
"否"
@
confirm=
"handleBatchPassed"
>
<a
href=
"#"
class=
"text-green-500"
>
审核通过
</a>
</a-popconfirm>
</
template
>
<
template
v-else
>
<span>
未选中任何项目
</span>
</
template
>
</template>
</a-alert>
</template>
<
template
#
toolbar
>
<
template
#
toolbar
>
<a-button
v-auth=
"'AUTH_SYSTEM_USER:ADD'"
type=
"primary"
@
click=
"handleCreate"
>
新增
</a-button>
<a-button
v-auth=
"'AUTH_SYSTEM_USER:ADD'"
type=
"primary"
@
click=
"handleCreate"
>
新增
</a-button>
</
template
>
</
template
>
<
template
#
bodyCell=
"{ column, record, text }"
>
<
template
#
bodyCell=
"{ column, record, text }"
>
<template
v-if=
"column.dataIndex === 'id'"
>
<template
v-if=
"column.dataIndex === 'status'"
>
<a
@
click=
"handleView(record)"
>
{{
record
.
id
}}
</a>
<a-tag
:color=
"StatusColorEnum[text]"
>
{{
StatusEnum
[
text
]
}}
</a-tag>
</
template
>
<
template
v-if=
"[].includes(column.dataIndex)"
>
<img
:src=
"text"
class=
"photo"
alt=
"图片"
v-if=
"!!text"
/>
</
template
>
</
template
>
<
template
v-if=
"column.dataIndex === 'action'"
>
<
template
v-if=
"column.dataIndex === 'action'"
>
<TableAction
<TableAction
:actions=
"[
:actions=
"[
//待审核 才能 通过
{
label: '通过',
color: 'success',
popConfirm: {
title: '是否确认通过',
confirm: handleVerify.bind(null, record, StatusValEnum.PASSED),
},
ifShow: isShowHandlePassed(record.status),
},
//待审核 才能 拒绝
{
label: '拒绝',
color: 'error',
popConfirm: {
title: '是否确认拒绝',
confirm: handleVerify.bind(null, record, StatusValEnum.REJECT),
},
ifShow: isShowHandleReject(record.status),
},
//已通过才能禁用
{
label: '禁用',
color: 'error',
popConfirm: {
title: '是否确认禁用',
confirm: handleVerify.bind(null, record, StatusValEnum.FORBIDDEN),
},
ifShow: isShowHandleForbidden(record.status),
},
//禁用后不能再编辑
{
{
tooltip: '编辑',
tooltip: '编辑',
icon: 'clarity:note-edit-line',
icon: 'clarity:note-edit-line',
onClick: handleEdit.bind(null, record),
onClick: handleEdit.bind(null, record),
ifShow:
hasPermission('AUTH_SYSTEM_USER:EDIT'
),
ifShow:
isShowHandleEdit(record.status
),
},
},
{
{
tooltip: '审核',
tooltip: '详情',
icon: 'ant-design:highlight-outlined',
icon: 'ant-design:eye-outlined',
popConfirm: {
onClick: handleView.bind(null, record),
title: '是否通过审核',
ifShow: hasPermission('AUTH_SYSTEM_USER:QUERY'),
okText: '通过',
cancelText: '拒绝',
confirm: handleCheck.bind(null, record, 'PASSED'),
cancel: handleCheck.bind(null, record, 'FORBIDDEN'),
},
ifShow: hasPermission('AUTH_SYSTEM_USER:VERIFY')
&&
record.status === 'PENDING_REVIEW',
},
},
{
{
tooltip: '删除',
tooltip: '删除',
...
@@ -40,7 +85,7 @@
...
@@ -40,7 +85,7 @@
title: '是否确认删除',
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
confirm: handleDelete.bind(null, record),
},
},
ifShow:
hasPermission('AUTH_SYSTEM_USER:DELETE'
),
ifShow:
isShowHandleDelete(
),
},
},
]"
]"
/>
/>
...
@@ -51,6 +96,18 @@
...
@@ -51,6 +96,18 @@
</div>
</div>
</template>
</template>
<
script
lang=
"ts"
setup
name=
"DeviceIndex"
>
<
script
lang=
"ts"
setup
name=
"DeviceIndex"
>
import
{
isShowHandleEdit
,
isShowHandlePassed
,
isShowHandleForbidden
,
isShowHandleReject
,
isShowHandleDelete
,
getVerifyParams
,
StatusValEnum
,
StatusColorEnum
,
StatusEnum
,
BatchVerifyParams
,
}
from
'./schema'
;
import
{
ref
}
from
'vue'
;
import
{
ref
}
from
'vue'
;
import
{
useGo
}
from
'/@/hooks/web/usePage'
;
import
{
useGo
}
from
'/@/hooks/web/usePage'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
...
@@ -62,7 +119,6 @@
...
@@ -62,7 +119,6 @@
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
{
message
}
from
'ant-design-vue'
;
const
{
hasPermission
}
=
usePermission
();
const
{
hasPermission
}
=
usePermission
();
const
go
=
useGo
();
const
go
=
useGo
();
...
@@ -83,6 +139,11 @@
...
@@ -83,6 +139,11 @@
schemas
:
searchFormSchema
,
schemas
:
searchFormSchema
,
showAdvancedButton
:
false
,
showAdvancedButton
:
false
,
},
},
rowSelection
:
{
type
:
'checkbox'
,
selectedRowKeys
:
checkedKeys
,
onChange
:
onSelectChange
,
},
useSearchForm
:
true
,
useSearchForm
:
true
,
showTableSetting
,
showTableSetting
,
bordered
,
bordered
,
...
@@ -90,7 +151,7 @@
...
@@ -90,7 +151,7 @@
canResize
:
false
,
canResize
:
false
,
rowKey
:
(
record
:
any
)
=>
record
.
id
,
rowKey
:
(
record
:
any
)
=>
record
.
id
,
actionColumn
:
{
actionColumn
:
{
width
:
12
0
,
width
:
21
0
,
title
:
'操作'
,
title
:
'操作'
,
dataIndex
:
'action'
,
dataIndex
:
'action'
,
fixed
:
'right'
,
fixed
:
'right'
,
...
@@ -120,7 +181,31 @@
...
@@ -120,7 +181,31 @@
});
});
return
handledParams
;
return
handledParams
;
};
};
const
handleVerify
=
(
record
:
Recordable
,
status
:
string
)
=>
{
setLoading
(
true
);
UserApi
.
batchVerify
(
getVerifyParams
(
record
,
status
))
.
then
((
_
)
=>
{
reload
();
})
.
catch
(()
=>
{
setLoading
(
false
);
});
};
const
handleBatchPassed
=
()
=>
{
const
params
:
BatchVerifyParams
=
{
idList
:
checkedKeys
.
value
,
status
:
StatusValEnum
.
PASSED
,
};
setLoading
(
true
);
UserApi
.
batchVerify
(
params
)
.
then
((
_
)
=>
{
reload
();
})
.
catch
(()
=>
{
setLoading
(
false
);
});
};
const
handleCreate
=
()
=>
{
const
handleCreate
=
()
=>
{
openDrawer
(
true
,
{
openDrawer
(
true
,
{
isUpdate
:
false
,
isUpdate
:
false
,
...
@@ -145,13 +230,6 @@
...
@@ -145,13 +230,6 @@
});
});
};
};
const
handleCheck
=
(
record
:
any
,
status
:
string
)
=>
{
UserApi
.
verify
({
idList
:
[
record
.
id
],
status
:
status
}).
then
(()
=>
{
message
.
success
(
'审核成功'
);
reload
();
});
};
// 批量删除暂时不要
// 批量删除暂时不要
// const handleBatchDelete = () => {
// const handleBatchDelete = () => {
// setLoading(true);
// setLoading(true);
...
...
src/views/system/user/schema.ts
浏览文件 @
89ffb0ac
...
@@ -10,6 +10,31 @@ import { BasicColumn } from '/@/components/Table';
...
@@ -10,6 +10,31 @@ import { BasicColumn } from '/@/components/Table';
import
{
FormSchema
}
from
'/@/components/Table'
;
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'
;
const
{
hasPermission
}
=
usePermission
();
export
interface
BatchVerifyParams
{
/**
* id数组
*/
idList
:
Array
<
number
|
string
>
;
/**
* 状态
*/
status
:
string
;
}
/**
* @description: 返回审核所需参数
* @param record
* @param status
*/
export
const
getVerifyParams
=
(
record
:
Recordable
,
status
:
string
):
BatchVerifyParams
=>
{
const
params
:
BatchVerifyParams
=
{
idList
:
[
record
.
id
],
status
,
};
return
params
;
};
export
enum
StatusEnum
{
export
enum
StatusEnum
{
PENDING_REVIEW
=
'待审核'
,
PENDING_REVIEW
=
'待审核'
,
...
@@ -24,6 +49,38 @@ for (const key in StatusEnum) {
...
@@ -24,6 +49,38 @@ for (const key in StatusEnum) {
label
:
StatusEnum
[
key
],
label
:
StatusEnum
[
key
],
});
});
}
}
export
enum
StatusColorEnum
{
PENDING_REVIEW
=
'processing'
,
PASSED
=
'success'
,
REJECT
=
'error'
,
FORBIDDEN
=
'default'
,
}
export
enum
StatusValEnum
{
PENDING_REVIEW
=
'PENDING_REVIEW'
,
PASSED
=
'PASSED'
,
REJECT
=
'REJECT'
,
FORBIDDEN
=
'FORBIDDEN'
,
}
export
const
isShowHandlePassed
=
(
status
:
string
):
boolean
=>
{
return
(
(
hasPermission
(
'AUTH_SYSTEM_USER:PASSED'
)
&&
status
===
'PENDING_REVIEW'
)
||
status
===
StatusValEnum
.
FORBIDDEN
);
};
export
const
isShowHandleReject
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_USER:REJECT'
)
&&
status
===
StatusValEnum
.
PENDING_REVIEW
;
};
export
const
isShowHandleForbidden
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_USER:FORBIDDEN'
)
&&
status
===
StatusValEnum
.
PASSED
;
};
export
const
isShowHandleEdit
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_USER:EDIT'
)
&&
status
!==
StatusValEnum
.
FORBIDDEN
;
};
export
const
isShowHandleDelete
=
():
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_USER:DELETE'
);
};
export
enum
YesNoEnum
{
export
enum
YesNoEnum
{
YES
=
'是'
,
YES
=
'是'
,
NO
=
'否'
,
NO
=
'否'
,
...
@@ -122,6 +179,9 @@ export const schema = {
...
@@ -122,6 +179,9 @@ export const schema = {
label
:
'角色'
,
label
:
'角色'
,
defaultValue
:
undefined
,
defaultValue
:
undefined
,
form
:
{
form
:
{
itemProps
:
{
validateTrigger
:
'blur'
,
},
componentProps
:
{
componentProps
:
{
labelInValue
:
true
,
labelInValue
:
true
,
api
:
RoleApi
.
all
,
api
:
RoleApi
.
all
,
...
@@ -131,12 +191,17 @@ export const schema = {
...
@@ -131,12 +191,17 @@ export const schema = {
valueField
:
'id'
,
valueField
:
'id'
,
allowClear
:
false
,
allowClear
:
false
,
placeholder
:
'角色'
,
placeholder
:
'角色'
,
mode
:
'multiple'
,
},
},
colProps
,
colProps
,
component
:
'ApiSelect'
,
component
:
'ApiSelect'
,
rules
:
[{
required
:
true
,
type
:
'object'
,
message
:
'请选择角色'
}],
rules
:
[{
required
:
true
,
type
:
'array'
,
message
:
'请选择角色'
}],
},
table
:
{
customRender
:
({
text
})
=>
{
return
text
?.
map
((
item
:
any
)
=>
item
.
remark
).
join
(
','
);
},
},
},
table
:
{},
},
},
{
{
field
:
'status'
,
field
:
'status'
,
...
@@ -260,12 +325,13 @@ export const schema = {
...
@@ -260,12 +325,13 @@ export const schema = {
};
};
const
queryFields
=
[
'distributorId'
,
'username'
,
'realName'
,
'mobile'
,
'status'
,
'deleteStatus'
,
'createTime'
];
const
queryFields
=
[
'distributorId'
,
'username'
,
'realName'
,
'mobile'
,
'status'
,
'deleteStatus'
,
'createTime'
];
const
editFields
=
[
'distributorId'
,
'username'
,
'
password'
,
'
realName'
,
'mobile'
,
'roleList'
,
'deleteStatus'
];
const
editFields
=
[
'distributorId'
,
'username'
,
'realName'
,
'mobile'
,
'roleList'
,
'deleteStatus'
];
const
tableFields
=
[
const
tableFields
=
[
'distributorId'
,
'distributorId'
,
'username'
,
'username'
,
'realName'
,
'realName'
,
'mobile'
,
'mobile'
,
'roleList'
,
'status'
,
'status'
,
'deleteStatus'
,
'deleteStatus'
,
'editorName'
,
'editorName'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论