feat(user): 更新用户审核管理功能
- 修改组件名称从 List为 UserVerifyAdmin - 移除 addUserRole 导入,保留 listUserRole 和 updateUserRole - 新增导入 listOrganizations 接口- 更新查询逻辑以支持 organizationIds 过滤 - 注释掉原有的组织权限判断代码 - 调整 SERVER_API_URL 地址为本地开发地址 - 在 model 中增加 organizationIds 字段定义
This commit is contained in:
@@ -61,5 +61,6 @@ export interface UserVerifyParam extends PageParam {
|
|||||||
id?: number;
|
id?: number;
|
||||||
status?: number;
|
status?: number;
|
||||||
organizationId?: number;
|
organizationId?: number;
|
||||||
|
organizationIds?: any[];
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,13 +11,14 @@ import {Search, Calendar, Truck, File} from '@nutui/icons-react-taro'
|
|||||||
import Taro from '@tarojs/taro'
|
import Taro from '@tarojs/taro'
|
||||||
import {UserVerify} from "@/api/system/userVerify/model";
|
import {UserVerify} from "@/api/system/userVerify/model";
|
||||||
import {pageUserVerify, updateUserVerify} from "@/api/system/userVerify";
|
import {pageUserVerify, updateUserVerify} from "@/api/system/userVerify";
|
||||||
import {addUserRole, listUserRole, updateUserRole} from "@/api/system/userRole";
|
import {listUserRole, updateUserRole} from "@/api/system/userRole";
|
||||||
|
import {listOrganizations} from "@/api/system/organization";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报险记录列表页面
|
* 报险记录列表页面
|
||||||
*/
|
*/
|
||||||
const List: React.FC = () => {
|
const UserVerifyAdmin: React.FC = () => {
|
||||||
const [list, setList] = useState<UserVerify[]>([])
|
const [list, setList] = useState<UserVerify[]>([])
|
||||||
const [loading, setLoading] = useState<boolean>(false)
|
const [loading, setLoading] = useState<boolean>(false)
|
||||||
const [keywords, setKeywords] = useState<string>('')
|
const [keywords, setKeywords] = useState<string>('')
|
||||||
@@ -44,17 +45,29 @@ const List: React.FC = () => {
|
|||||||
setRefreshing(true)
|
setRefreshing(true)
|
||||||
|
|
||||||
const where = {
|
const where = {
|
||||||
|
organizationIds: undefined,
|
||||||
keywords: keywords.trim(),
|
keywords: keywords.trim(),
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Taro.getStorageSync('RoleCode') == 'zhandian') {
|
// if (Taro.getStorageSync('RoleCode') == 'zhandian') {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
where.organizationId = Taro.getStorageSync('OrganizationId')
|
// where.organizationId = Taro.getStorageSync('OrganizationId')
|
||||||
}
|
// }
|
||||||
if (Taro.getStorageSync('RoleCode') == 'kuaidi') {
|
// if (Taro.getStorageSync('RoleCode') == 'kuaidi') {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
where.OrganizationParentId = Taro.getStorageSync('OrganizationParentId')
|
// where.OrganizationParentId = Taro.getStorageSync('OrganizationParentId')
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
const organizations = await listOrganizations({
|
||||||
|
parentId: Taro.getStorageSync('OrganizationId')
|
||||||
|
})
|
||||||
|
const organizationIds = organizations.map(item => item.organizationId)
|
||||||
|
// 把Taro.getStorageSync('OrganizationId')也放入数组
|
||||||
|
organizationIds.push(Taro.getStorageSync('OrganizationId'))
|
||||||
|
|
||||||
|
console.log(organizationIds,'organizationIds')
|
||||||
|
// @ts-ignore
|
||||||
|
where.organizationIds = organizationIds;
|
||||||
|
|
||||||
const res = await pageUserVerify(where)
|
const res = await pageUserVerify(where)
|
||||||
|
|
||||||
@@ -316,4 +329,4 @@ const List: React.FC = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default List
|
export default UserVerifyAdmin
|
||||||
|
|||||||
Reference in New Issue
Block a user