feat:后台用户关系绑定
This commit is contained in:
1 parent
507bea5469
commit
f125d8d1bf
14 files changed
+2394
-295
No files matched your search
Executable
+97
@@ -0,0 +1,97 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export interface RelationGraphNode {
|
||||
nodeId: string
|
||||
parentNodeId?: string
|
||||
root: boolean
|
||||
repeated: boolean
|
||||
userId: string
|
||||
username?: string
|
||||
name?: string
|
||||
nickname?: string
|
||||
displayName: string
|
||||
avatar?: string
|
||||
gender?: number
|
||||
userCount?: number
|
||||
relationCount?: number
|
||||
relationId?: string
|
||||
subjectUserId?: string
|
||||
objectUserId?: string
|
||||
relationTypeId?: string
|
||||
relationCode?: string
|
||||
relationName?: string
|
||||
category?: string
|
||||
directedFlag?: string
|
||||
relationDirection?: "subject-to-object" | "object-to-subject"
|
||||
userRoleName?: string
|
||||
parentRoleName?: string
|
||||
relationDescription?: string
|
||||
effectiveTime?: string
|
||||
expireTime?: string
|
||||
remark?: string
|
||||
children?: RelationGraphNode[]
|
||||
}
|
||||
|
||||
export interface RelationCreateUserForm {
|
||||
subjectUserId?: string
|
||||
objectUserId?: string
|
||||
relationTypeId: string
|
||||
effectiveTime?: string
|
||||
expireTime?: string
|
||||
remark?: string
|
||||
username: string
|
||||
password: string
|
||||
phone?: string
|
||||
name: string
|
||||
nickname?: string
|
||||
email?: string
|
||||
avatar?: string
|
||||
deptId?: string
|
||||
role?: string[]
|
||||
post?: string[]
|
||||
gender?: number
|
||||
staffingType?: string
|
||||
lockFlag?: string
|
||||
identityTypes: string[]
|
||||
studentInfo?: {
|
||||
studentNo: string
|
||||
schoolName: string
|
||||
className: string
|
||||
extJson: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface RelationCreateForm {
|
||||
subjectUserId: string
|
||||
objectUserId: string
|
||||
relationTypeId: string
|
||||
effectiveTime?: string
|
||||
expireTime?: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
// 关系图谱
|
||||
export function getRelationGraph(userId?: string) {
|
||||
return request({
|
||||
url: "/admin/sysUserRelation/graph/" + userId,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
// 创建用户并建立关系
|
||||
export function createRelationUser(data: RelationCreateUserForm) {
|
||||
return request({
|
||||
url: "/admin/sysUserRelation/create-user",
|
||||
method: "post",
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 为两个已有用户建立关系
|
||||
export function createRelation(data: RelationCreateForm) {
|
||||
return request({
|
||||
url: "/admin/sysUserRelation/create",
|
||||
method: "post",
|
||||
data,
|
||||
})
|
||||
}
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: "/admin/sysUserRelationType/page",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/admin/sysUserRelationType",
|
||||
method: "post",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: "/admin/sysUserRelationType/" + id,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: "/admin/sysUserRelationType",
|
||||
method: "delete",
|
||||
data: ids,
|
||||
})
|
||||
}
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/admin/sysUserRelationType",
|
||||
method: "put",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user