diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts new file mode 100644 index 0000000..e825628 --- /dev/null +++ b/src/api/system/dept.ts @@ -0,0 +1,59 @@ +import { http } from '@/utils/http/axios'; + +/** + * @description: 部门列表 + */ +export function getDeptList(params?) { + return http.request({ + url: '/dept/list', + method: 'GET', + params, + }); +} +/** + * @description: 根据ID获取详情 + */ +export function getDeptDetail(userId) { + return http.request({ + url: '/dept/detail/'+userId, + method: 'get', + }); +} +/** + * @description: 添加部门 + */ +export function deptAdd(data:any) { + return http.request({ + url: '/dept/add', + method: 'POST', + data, + }); +} +/** + * @description: 更新部门 + */ +export function deptpdate(data:any) { + return http.request({ + url: '/dept/update', + method: 'PUT', + data + }); +} +/** + * @description: 删除部门 + */ +export function deptDelete(userId) { + return http.request({ + url: '/dept/delete/'+userId, + method: 'DELETE', + }); +} +/** + * @description: 批量删除部门 + */ +export function deptBatchDelete(userId) { + return http.request({ + url: '/dept/batchDelete/'+userId, + method: 'DELETE', + }); +} \ No newline at end of file diff --git a/src/api/system/level.ts b/src/api/system/level.ts new file mode 100644 index 0000000..b46ff50 --- /dev/null +++ b/src/api/system/level.ts @@ -0,0 +1,66 @@ +import { http } from '@/utils/http/axios'; + +/** + * @description: 职级列表 + */ +export function getLevelList(params?) { + return http.request({ + url: '/level/page', + method: 'GET', + params, + }); +} +export function getLevelAllList(params?) { + return http.request({ + url: '/level/list', + method: 'GET', + params, + }); +} +/** + * @description: 根据ID获取详情 + */ +export function getLevelDetail(userId) { + return http.request({ + url: '/level/detail/'+userId, + method: 'get', + }); +} +/** + * @description: 添加职级 + */ +export function levelAdd(data:any) { + return http.request({ + url: '/level/add', + method: 'POST', + data, + }); +} +/** + * @description: 更新职级 + */ +export function levelUpdate(data:any) { + return http.request({ + url: '/level/update', + method: 'PUT', + data + }); +} +/** + * @description: 删除职级 + */ +export function levelDelete(userId) { + return http.request({ + url: '/level/delete/'+userId, + method: 'DELETE', + }); +} +/** + * @description: 批量删除职级 + */ +export function levelBatchDelete(userId) { + return http.request({ + url: '/level/batchDelete/'+userId, + method: 'DELETE', + }); +} \ No newline at end of file diff --git a/src/api/system/position.ts b/src/api/system/position.ts new file mode 100644 index 0000000..f064285 --- /dev/null +++ b/src/api/system/position.ts @@ -0,0 +1,66 @@ +import { http } from '@/utils/http/axios'; + +/** + * @description: 岗位列表 + */ +export function getPositionList(params?) { + return http.request({ + url: '/position/page', + method: 'GET', + params, + }); +} +export function getPositionAllList(params?) { + return http.request({ + url: '/position/list', + method: 'GET', + params, + }); +} +/** + * @description: 根据ID获取详情 + */ +export function getPositionDetail(userId) { + return http.request({ + url: '/position/detail/'+userId, + method: 'get', + }); +} +/** + * @description: 添加岗位 + */ +export function positionAdd(data:any) { + return http.request({ + url: '/position/add', + method: 'POST', + data, + }); +} +/** + * @description: 更新岗位 + */ +export function positionUpdate(data:any) { + return http.request({ + url: '/position/update', + method: 'PUT', + data + }); +} +/** + * @description: 删除岗位 + */ +export function positionDelete(userId) { + return http.request({ + url: '/position/delete/'+userId, + method: 'DELETE', + }); +} +/** + * @description: 批量删除岗位 + */ +export function positionBatchDelete(userId) { + return http.request({ + url: '/role/batchDelete/'+userId, + method: 'DELETE', + }); +} \ No newline at end of file diff --git a/src/api/system/user.ts b/src/api/system/user.ts index b8922f3..8b5e06e 100644 --- a/src/api/system/user.ts +++ b/src/api/system/user.ts @@ -133,4 +133,26 @@ export function userBatchDelete(userId) { url: '/user/batchDelete/'+userId, method: 'DELETE', }); +} +/** + * @description: 导出用户 + */ +export function userExport() { + return http.request({ + url: '/user/export', + method: 'GET', + responseType: 'blob' + }); +} +/** + * @description: 城市列表 + */ +export function getCityByList(params:any) { + return http.request({ + url: '/city/list', + method: 'get', + params:{ + ...params + } + }); } \ No newline at end of file diff --git a/src/components/ChinaArea/index.vue b/src/components/ChinaArea/index.vue new file mode 100644 index 0000000..4ece9a4 --- /dev/null +++ b/src/components/ChinaArea/index.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index 2f1508e..63ac051 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -41,7 +41,6 @@ const transform: AxiosTransform = { isTransformResponse, isReturnNativeResponse, } = options; - // 是否返回原生响应头 比如:需要获取响应头时使用该属性 if (isReturnNativeResponse) { return res; @@ -52,11 +51,13 @@ const transform: AxiosTransform = { return res.data; } - if (!res.data) { // return '[HTTP] Request has no return value'; throw new Error('请求出错,请稍候重试'); } + if(res.config.responseType=="blob"){ + return res.data + } // 这里 code,result,message为 后台统一的字段,需要修改为项目自己的接口返回格式 const { code, data, msg } = res.data; // 请求成功 diff --git a/src/views/system/user/edit.vue b/src/views/system/user/edit.vue index 3894640..a521235 100644 --- a/src/views/system/user/edit.vue +++ b/src/views/system/user/edit.vue @@ -2,7 +2,7 @@ @@ -11,9 +11,11 @@ :model="formData" label-width="84px" > + - - - + + + + + + 男 + 女 + 保密 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - + + + + + @@ -117,12 +247,22 @@