yinbangzhong
2024-08-01 052dafe0b7678a85f5cc7af0c79491187daff7e3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import axios from "axios";
import { Pagination } from "@/types/global";
 
export interface User {
  userId: string;
  userName: string;
  nickName: string;
  email: string;
  phoneNumber: string;
  dept: any;
  resources: any;
  knowledges:any;
  createTime: string;
  status: string;
}
 
export interface Organization {
  deptId: string;
  deptName: string;
  email: string;
  leader: string;
  phone: string;
  orderNum: string;
  parentId: string;
  status: string;
  address: string;
  parentName: string;
}
 
export interface Resource {
  "menuId": string;
  "createTime": string;
  "updateTime": string;
  "menuName": string;
  "component": string;
  "description": string;
  "icon": string;
  "orderNum": string;
  "target": string;
  "parentId": string;
  "parentName": string;
  "children": any;
  "syesourcetype": string;
  "status": string;
  "path": string;
  "perms": string;
  "menuType": string;
}
 
export interface Knowledge {
  "id": string;
  "createTime": string;
  "updateTime": string;
  "name": string;
}
 
export interface Result<T> {
  code: number;
  msg: string;
  rows: T;
  total: number;
}
 
export function UserList(params: Pagination) {
  return axios.get<Result<User[]>>("/base/system/user/list", { params });
}
 
export function Userstatus(userID, status) {
  return axios.put("/base/system/user/changeStatus", { "userId": userID, "status": status });
}
 
export function UserChangePwd(userId) {
  return axios.put("/base/system/user/profile/updatePwd", { "userId": userId });
}
 
 
export function UserEdit(user) {
  return axios.put("/base/system/user", { user });
}
 
export function UserAdd(user) {
  return axios.post("/base/system/user", { user });
}
 
export function UserDelete(userId) {
  return axios.delete("/base/system/user/" + userId);
}
 
export function OrganizationList(key: string) {
  return axios.post<Result<Organization[]>>("/base/system/dept/list", { "deptName": key });
}
 
 
export function OrganizationAdd(organization) {
  return axios.post("/base/system/dept", { organization });
}
 
export function OrganizationDelete(id) {
  return axios.delete("/base/system/dept/" + id);
}
 
export function OrganizationUpdate(organization) {
  return axios.put("/base/system/dept", { organization });
}
 
 
export function OrganizationById(id) {
  return axios.get<Result<Organization>>("/base/system/dept/" + id);
}
 
 
export function ResourceList(key: string) {
  return axios.get<Result<Resource[]>>("/base/system/menu/treeselect");
}
 
 
export function ResourceAdd(resource) {
  return axios.post("/base/system/menu", { resource });
}
 
export function ResourceDelete(id) {
  return axios.delete("/base/system/menu/" + id);
}
 
export function ResourceUpdate(resource) {
  return axios.put("/base/system/menu", { resource });
}
 
 
export function ResourceById(id) {
  return axios.get<Result<Resource>>("/base/system/menu/" + id);
}
 
export function KnowledgeList() {
  return axios.get<Result<Knowledge>>("/base/system/knowledge/list");
}