diff --git a/src/api/home.ts b/src/api/home.ts index 39cfd2e..eb4d3e7 100644 --- a/src/api/home.ts +++ b/src/api/home.ts @@ -12,10 +12,10 @@ type Data = { }; export const getHomeList = (params?: object) => { - return http.request("get", baseUrlApi(""), { params }); + return http.request("get", baseUrlApi("tps"), { params }); }; export const getEvents = (params?: object) => { - return http.request("get", baseUrlApi("events"), { params }); + return http.request("get", baseUrlApi("tps/events"), { params }); }; export const updateHomeList = (params?: object) => { return http.request("put", baseUrlApi(""), { params }); diff --git a/src/api/system.ts b/src/api/system.ts new file mode 100644 index 0000000..78d6973 --- /dev/null +++ b/src/api/system.ts @@ -0,0 +1,84 @@ +import { http } from "@/utils/http"; +import { baseUrlApi } from "./utils"; + +type deptResult = { + data: Array; +}; + +/** 部门列表查询 */ +export const getDeptList = (params?: object) => { + return http.request("get", baseUrlApi("departments/"), { + params + }); +}; + +type deptStatus = { + success: boolean; + msg: any; +}; + +/** 新增部门 */ +export const addDept = (data?: object) => { + return http.request("post", baseUrlApi("departments/"), { + data + }); +}; + +/** 更新部门 */ +export const updateDept = (data?: object | any) => { + return http.request( + "put", + baseUrlApi(`departments/${data.id}/`), + { + data + } + ); +}; + +/** 删除部门 */ +export const deleteDept = (data?: object | any) => { + return http.request( + "delete", + baseUrlApi(`departments/${data}/`), + { + data + } + ); +}; + +type userList = { + count: number; + next: any; + previous: any; + results?: Array; +}; + +/** 用户列表查询 */ +export const getUserList = (params?: object) => { + return http.request("get", baseUrlApi("user/"), { + params + }); +}; + +type userStatus = { + success: boolean; + msg: any; +}; +/** 新增用户 */ +export const addUser = (data?: object) => { + return http.request("post", baseUrlApi("user/"), { data }); +}; + +/** 更新用户 */ +export const updateUser = (data?: object | any) => { + return http.request("put", baseUrlApi(`user/${data.id}/`), { + data + }); +}; + +/** 删除用户 */ +export const deleteUser = (data?: object | any) => { + return http.request("delete", baseUrlApi(`user/${data}/`), { + data + }); +}; diff --git a/src/api/user.ts b/src/api/user.ts index 6aac1cc..9d8f964 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -37,7 +37,7 @@ export type RefreshTokenResult = { // return http.request("post", "/login", { data }); // }; export const getLogin = (data?: object) => { - return http.request("post", baseUrlApi("login"), { data }); + return http.request("post", baseUrlApi("user/login/"), { data }); }; // export const getLogin = (data?: object) => { diff --git a/src/router/modules/error.ts b/src/router/modules/error.ts index e60b17b..e074001 100644 --- a/src/router/modules/error.ts +++ b/src/router/modules/error.ts @@ -4,7 +4,7 @@ export default { meta: { icon: "informationLine", title: "异常页面", - // showLink: false, + showLink: false, rank: 9 }, children: [ diff --git a/src/router/modules/permission.ts b/src/router/modules/permission.ts index 9b5e851..441b99f 100644 --- a/src/router/modules/permission.ts +++ b/src/router/modules/permission.ts @@ -4,7 +4,7 @@ export default { meta: { icon: "lollipop", title: "权限管理", - // showLink: false, + showLink: false, rank: 2 }, children: [ diff --git a/src/views/system/dept/form.vue b/src/views/system/dept/form.vue index 39f4bd9..bc9b6f6 100644 --- a/src/views/system/dept/form.vue +++ b/src/views/system/dept/form.vue @@ -3,7 +3,7 @@ import { ref } from "vue"; import ReCol from "@/components/ReCol"; import { formRules } from "./utils/rule"; import { FormProps } from "./utils/types"; -import { usePublicHooks } from "../hooks"; +// import { usePublicHooks } from "../hooks"; const props = withDefaults(defineProps(), { formInline: () => ({ @@ -15,12 +15,13 @@ const props = withDefaults(defineProps(), { email: "", sort: 0, status: 1, - remark: "" + remark: "", + id: "" }) }); const ruleFormRef = ref(); -const { switchStyle } = usePublicHooks(); +// const { switchStyle } = usePublicHooks(); const newFormInline = ref(props.formInline); function getRef() { @@ -71,7 +72,7 @@ defineExpose({ getRef }); /> - + diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index ea77575..22c38b3 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -28,6 +28,7 @@ const { handleDelete, handleSelectionChange } = useDept(); +console.log(dataList);