mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-12 13:43:49 +08:00
v1.0.4
This commit is contained in:
15
smart-admin-web/src/api/data-scope.js
Normal file
15
smart-admin-web/src/api/data-scope.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { postAxios, getAxios } from '@/lib/http';
|
||||
export const dataScopeApi = {
|
||||
// 批量设置某角色数据范围
|
||||
updateDataScope: data => {
|
||||
return postAxios('/dataScope/batchSet', data);
|
||||
},
|
||||
// 数据权限列表
|
||||
getDataScopeList: () => {
|
||||
return getAxios('/dataScope/list');
|
||||
},
|
||||
// 获取某角色所设置的数据范围
|
||||
getDataScopeByRoleId: roleId => {
|
||||
return getAxios('/dataScope/listByRole/' + roleId);
|
||||
}
|
||||
};
|
||||
47
smart-admin-web/src/api/department.js
Normal file
47
smart-admin-web/src/api/department.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import { postAxios, getAxios } from '@/lib/http';
|
||||
export const departmentApi = {
|
||||
// 加载所有的部门子部门
|
||||
getLoadDepartment: () => {
|
||||
return getAxios('/department/list');
|
||||
},
|
||||
// 查询部门及员工列表
|
||||
getDepartmentEmployeeList: () => {
|
||||
return getAxios('/department/listEmployee');
|
||||
},
|
||||
// 添加部门
|
||||
addDepartment: (data) => {
|
||||
return postAxios('/department/add', data);
|
||||
},
|
||||
// 编辑部门
|
||||
updateDepartment: (data) => {
|
||||
return postAxios('/department/update', data);
|
||||
},
|
||||
// 删除部门
|
||||
deleteDepartment: (data) => {
|
||||
return postAxios('/department/delete/' + data);
|
||||
},
|
||||
// 根据id获取部门信息
|
||||
getDepartmentById: (data) => {
|
||||
return getAxios('/department/query/' + data);
|
||||
},
|
||||
// 查询部门列表
|
||||
getDepartmentAll: () => {
|
||||
return getAxios('/department/listAll');
|
||||
},
|
||||
// 根据部门名称获取员工列表
|
||||
getListEmployeeByDepartmentName: (departmentName) => {
|
||||
return getAxios('/department/listEmployeeByDepartmentName?departmentName=' + departmentName);
|
||||
},
|
||||
// 上下移动
|
||||
upOrDown: (departmentId, swapId) => {
|
||||
return getAxios('/department/upOrDown/' + departmentId + '/' + swapId);
|
||||
},
|
||||
// 升级
|
||||
upGrade: (departmentId) => {
|
||||
return getAxios('/department/upgrade/' + departmentId);
|
||||
},
|
||||
// 降级
|
||||
downGrade: (departmentId, preId) => {
|
||||
return getAxios('/department/downgrade/' + departmentId + '/' + preId);
|
||||
}
|
||||
};
|
||||
27
smart-admin-web/src/api/email.js
Normal file
27
smart-admin-web/src/api/email.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import { postAxios, getAxios } from '@/lib/http';
|
||||
export const emailApi = {
|
||||
// 新增邮件
|
||||
addEmail: (data) => {
|
||||
return postAxios('/email/add', data);
|
||||
},
|
||||
// 分页查询邮件
|
||||
getEmail: (data) => {
|
||||
return postAxios('/email/page/query', data);
|
||||
},
|
||||
// 删除邮件
|
||||
deleteEmail: (id) => {
|
||||
return getAxios('/email/delete/' + id);
|
||||
},
|
||||
// 查看邮件详情
|
||||
getEmailDetails: (id) => {
|
||||
return getAxios('/email/detail/' + id);
|
||||
},
|
||||
// 发送邮件
|
||||
sendEmail: (id) => {
|
||||
return getAxios('/email/send/' + id);
|
||||
},
|
||||
// 更新编辑邮件
|
||||
updateEmail: (data) => {
|
||||
return postAxios('/email/update', data);
|
||||
}
|
||||
};
|
||||
43
smart-admin-web/src/api/employee.js
Normal file
43
smart-admin-web/src/api/employee.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import { postAxios, getAxios } from '@/lib/http';
|
||||
export const employeeApi = {
|
||||
// 员工管理查询
|
||||
getEmployeeList: (data) => {
|
||||
return postAxios('/employee/query', data);
|
||||
},
|
||||
// 添加员工
|
||||
addEmployee: (data) => {
|
||||
return postAxios('/employee/add', data);
|
||||
},
|
||||
// 更新员工信息
|
||||
updateEmployee: (data) => {
|
||||
return postAxios('/employee/update', data);
|
||||
},
|
||||
// 禁用启用单个员工
|
||||
updateStatus: (employeeId, status) => {
|
||||
return getAxios('/employee/updateStatus/' + employeeId + '/' + status);
|
||||
},
|
||||
// 批量禁用
|
||||
updateStatusBatch: (data) => {
|
||||
return postAxios('/employee/batchUpdateStatus', data);
|
||||
},
|
||||
// 单个员工角色授权
|
||||
updateRoles: (data) => {
|
||||
return postAxios('/employee/updateRoles', data);
|
||||
},
|
||||
// 修改密码
|
||||
updatePwd: (data) => {
|
||||
return postAxios('/employee/updatePwd', data);
|
||||
},
|
||||
// 重置密码
|
||||
resetPassword: (employeeId) => {
|
||||
return getAxios('/employee/resetPasswd/' + employeeId);
|
||||
},
|
||||
// 通过部门id获取当前部门的人员&没有部门的人
|
||||
getListEmployeeByDeptId: (departmentId) => {
|
||||
return getAxios('/employee/listEmployeeByDeptId/' + departmentId);
|
||||
},
|
||||
// 删除员工
|
||||
deleteEmployee: (employeeId) => {
|
||||
return postAxios('/employee/delete/' + employeeId);
|
||||
}
|
||||
};
|
||||
28
smart-admin-web/src/api/file.js
Normal file
28
smart-admin-web/src/api/file.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import { postAxios, getAxios } from '@/lib/http';
|
||||
import config from '@/config';
|
||||
const baseUrl = config.baseUrl.apiUrl;
|
||||
export const fileApi = {
|
||||
// 系统文件查询
|
||||
queryFileList: data => {
|
||||
return postAxios('/api/file/query', data);
|
||||
},
|
||||
// 系统文件下载通过接口
|
||||
downLoadFile: id => {
|
||||
return getAxios('/api/file/downLoad?id=' + id);
|
||||
},
|
||||
// 文件上传
|
||||
fileUpload: (type, data) => {
|
||||
// return postAxios('/api/file/localUpload/' + type, data);
|
||||
return this.fileUploadUrl;
|
||||
},
|
||||
// 文件保存
|
||||
addFile: data => {
|
||||
return postAxios('/api/file/save', data);
|
||||
},
|
||||
// 上传路径:本地
|
||||
fileUploadLocalUrl: baseUrl + '/api/file/localUpload/',
|
||||
// 上传路径:阿里OSS
|
||||
fileUploadAliUrl: baseUrl + '/api/file/aliYunUpload/',
|
||||
// 上传路径:七牛
|
||||
fileUploadQiNiuUrl: baseUrl + '/api/file/qiNiuUpload/'
|
||||
};
|
||||
7
smart-admin-web/src/api/heart-beat.js
Normal file
7
smart-admin-web/src/api/heart-beat.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import { postAxios, getAxios } from '@/lib/http';
|
||||
export const heartBeatApi = {
|
||||
// 分页查询所有岗位
|
||||
queryHeartBeatRecord: data => {
|
||||
return postAxios('/heartBeat/query', data);
|
||||
}
|
||||
};
|
||||
19
smart-admin-web/src/api/login.js
Normal file
19
smart-admin-web/src/api/login.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { postAxios, getAxios } from '@/lib/http';
|
||||
export const loginApi = {
|
||||
// 登录
|
||||
login: data => {
|
||||
return postAxios('/session/login', data);
|
||||
},
|
||||
// 根据token获取session
|
||||
getSession: () => {
|
||||
return getAxios('/session/get');
|
||||
},
|
||||
// 登出
|
||||
logout: (token) => {
|
||||
return getAxios(`/session/logOut?x-access-token=${token}`);
|
||||
},
|
||||
// 获取验证码
|
||||
getVerificationCode: () => {
|
||||
return getAxios('/session/verificationCode');
|
||||
}
|
||||
};
|
||||
43
smart-admin-web/src/api/notice.js
Normal file
43
smart-admin-web/src/api/notice.js
Normal file
@@ -0,0 +1,43 @@
|
||||
// 任务调度API
|
||||
import {
|
||||
postAxios,
|
||||
getAxios
|
||||
} from '@/lib/http';
|
||||
export const noticeApi = {
|
||||
// 查询消息列表
|
||||
getNoticeList: (data) => {
|
||||
return postAxios('/notice/page/query', data);
|
||||
},
|
||||
// 未读消息列表
|
||||
getNoticeUnreadList: (data) => {
|
||||
return postAxios('/notice/unread/page/query', data);
|
||||
},
|
||||
// 查询个人消息列表
|
||||
getPersonNoticeList: (data) => {
|
||||
return postAxios('/notice/receive/page/query', data);
|
||||
},
|
||||
// 添加消息
|
||||
addNotice: (data) => {
|
||||
return postAxios('/notice/add', data);
|
||||
},
|
||||
// 标记已读
|
||||
addNoticeRecord: (id) => {
|
||||
return getAxios(`/notice/read/${id}`);
|
||||
},
|
||||
// 修改消息
|
||||
updateNotice: (data) => {
|
||||
return postAxios('/notice/update', data);
|
||||
},
|
||||
// 删除消息
|
||||
deleteNotice: (id) => {
|
||||
return getAxios(`/notice/delete/${id}`);
|
||||
},
|
||||
// 获取通知详情
|
||||
getNoticeDetail: (id) => {
|
||||
return getAxios(`/notice/detail/${id}`);
|
||||
},
|
||||
// 发送消息
|
||||
sendNotice: (id) => {
|
||||
return getAxios(`/notice/send/${id}`);
|
||||
}
|
||||
};
|
||||
12
smart-admin-web/src/api/online-user.js
Normal file
12
smart-admin-web/src/api/online-user.js
Normal file
@@ -0,0 +1,12 @@
|
||||
// 任务调度API
|
||||
import {
|
||||
postAxios,
|
||||
getAxios
|
||||
} from '@/lib/http';
|
||||
export const onlineUserApi = {
|
||||
// 查询在线员工列表
|
||||
getOnlineUserList: (data) => {
|
||||
return postAxios('/userOnLine/query', data);
|
||||
}
|
||||
|
||||
};
|
||||
19
smart-admin-web/src/api/position.js
Normal file
19
smart-admin-web/src/api/position.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { postAxios, getAxios } from '@/lib/http';
|
||||
export const positionApi = {
|
||||
// 分页查询所有岗位
|
||||
getPositionListPage: data => {
|
||||
return postAxios('/position/getListPage', data);
|
||||
},
|
||||
// 更新岗位
|
||||
updatePosition: data => {
|
||||
return postAxios('/position/update', data);
|
||||
},
|
||||
// 添加岗位
|
||||
addPosition: data => {
|
||||
return postAxios('/position/add', data);
|
||||
},
|
||||
// 根据ID删除岗位
|
||||
deletePosition: id => {
|
||||
return getAxios('/position/remove/' + id);
|
||||
}
|
||||
};
|
||||
32
smart-admin-web/src/api/privilege.js
Normal file
32
smart-admin-web/src/api/privilege.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import { postAxios, getAxios } from '@/lib/http';
|
||||
|
||||
export const privilegeApi = {
|
||||
// 获取所有请求路径
|
||||
getAllUrl: data => {
|
||||
return getAxios('/privilege/getAllUrl');
|
||||
},
|
||||
// 获取全部菜单列表
|
||||
getMenuList: data => {
|
||||
return postAxios('/privilege/menu/queryAll');
|
||||
},
|
||||
// 菜单批量保存
|
||||
addBatchSaveMenu: data => {
|
||||
return postAxios('/privilege/menu/batchSaveMenu', data);
|
||||
},
|
||||
// 查询菜单功能点
|
||||
queryPrivilegeFunctionList: menuKey => {
|
||||
return postAxios('/privilege/function/query/' + menuKey);
|
||||
},
|
||||
// 保存更新功能点
|
||||
addOrUpdate: data => {
|
||||
return postAxios('/privilege/function/saveOrUpdate', data);
|
||||
},
|
||||
// 更新角色权限
|
||||
getRolePower: data => {
|
||||
return postAxios('/privilege/updateRolePrivilege', data);
|
||||
},
|
||||
// 获取角色可选的功能权限
|
||||
getListPrivilegeByRoleId: id => {
|
||||
return getAxios('/privilege/listPrivilegeByRoleId/' + id);
|
||||
}
|
||||
};
|
||||
58
smart-admin-web/src/api/role.js
Normal file
58
smart-admin-web/src/api/role.js
Normal file
@@ -0,0 +1,58 @@
|
||||
import { postAxios, getAxios } from '@/lib/http';
|
||||
export const roleApi = {
|
||||
// 添加角色
|
||||
addRole: (remark, roleName) => {
|
||||
const data = {
|
||||
remark: remark,
|
||||
roleName: roleName
|
||||
};
|
||||
return postAxios('/role/add', data);
|
||||
},
|
||||
// 删除角色
|
||||
deleteRole: id => {
|
||||
return getAxios('/role/delete/' + id);
|
||||
},
|
||||
// 修改角色
|
||||
updateRole: (id, remark, roleName) => {
|
||||
const data = {
|
||||
id: id,
|
||||
remark: remark,
|
||||
roleName: roleName
|
||||
};
|
||||
return postAxios('/role/update', data);
|
||||
},
|
||||
// 获取角色数据
|
||||
getRoleDetail: id => {
|
||||
return getAxios('/role/get/' + id);
|
||||
},
|
||||
// 加载角色列表
|
||||
getAllRole: () => {
|
||||
return getAxios('role/getAll');
|
||||
},
|
||||
// 根据角色名字获取对应成员列表
|
||||
getListEmployee: data => {
|
||||
return postAxios('/role/listEmployee', data);
|
||||
},
|
||||
// 根据角色id获取角色成员-员工列表
|
||||
getAllListEmployee: id => {
|
||||
return getAxios('/role/listAllEmployee/' + id);
|
||||
},
|
||||
// 从角色成员列表中移除员工
|
||||
deleteEmployeeRole: param => {
|
||||
return getAxios('/role/removeEmployee?employeeId=' + param.employeeId + '&roleId=' + param.roleId);
|
||||
},
|
||||
// 从角色成员列表中批量移除员工
|
||||
deleteEmployeeList: data => {
|
||||
return postAxios('/role/removeEmployeeList', data);
|
||||
},
|
||||
|
||||
// 添加角色成员方法
|
||||
addEmployeeListRole: data => {
|
||||
return postAxios('/role/addEmployeeList', data);
|
||||
},
|
||||
// 通过员工id获取所有角色以及员工具有的角色
|
||||
getRoles: id => {
|
||||
return getAxios('/role/getRoles/' + id);
|
||||
},
|
||||
|
||||
};
|
||||
20
smart-admin-web/src/api/smart-reload.js
Normal file
20
smart-admin-web/src/api/smart-reload.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// smartReloadAPI
|
||||
import {
|
||||
postAxios,
|
||||
getAxios
|
||||
} from '@/lib/http';
|
||||
export const smartReloadApi = {
|
||||
// 查询所有
|
||||
getSmartReloadList: () => {
|
||||
return getAxios('/smartReload/all');
|
||||
},
|
||||
// 更新单条数据
|
||||
updateSmartReloadData: (data) => {
|
||||
return postAxios('/smartReload/update', data);
|
||||
},
|
||||
// 获取执行结果
|
||||
getSmartReloadResult: (tag) => {
|
||||
return getAxios(`/smartReload/result/${tag}`);
|
||||
}
|
||||
|
||||
};
|
||||
31
smart-admin-web/src/api/system-config.js
Normal file
31
smart-admin-web/src/api/system-config.js
Normal file
@@ -0,0 +1,31 @@
|
||||
// 系统参数API
|
||||
import {
|
||||
postAxios,
|
||||
getAxios
|
||||
} from '@/lib/http';
|
||||
export const systemConfigApi = {
|
||||
// 查询系统参数列表
|
||||
getSystemConfigList: (data) => {
|
||||
return postAxios('/systemConfig/getListPage', data);
|
||||
},
|
||||
// 添加系统参数
|
||||
addSystemConfig: (data) => {
|
||||
return postAxios('/systemConfig/add', data);
|
||||
},
|
||||
// 更新单条系统参数
|
||||
updateSystemConfig: (data) => {
|
||||
return postAxios('/systemConfig/update', data);
|
||||
},
|
||||
// 通过key获取对应的信息
|
||||
getConfigListByKey: (key) => {
|
||||
return getAxios(`/systemConfig/selectByKey?configKey=${key}`);
|
||||
},
|
||||
// 根据分组查询所有系统配置
|
||||
getListByGroup: (group) => {
|
||||
return getAxios(`/systemConfig/getListByGroup?group=${group}`);
|
||||
},
|
||||
// 获取系统版本信息
|
||||
getCodeVersion: () => {
|
||||
return getAxios('/codeVersion');
|
||||
}
|
||||
};
|
||||
35
smart-admin-web/src/api/task-manage.js
Normal file
35
smart-admin-web/src/api/task-manage.js
Normal file
@@ -0,0 +1,35 @@
|
||||
// 任务调度API
|
||||
import {
|
||||
postAxios,
|
||||
getAxios
|
||||
} from '@/lib/http';
|
||||
export const taskApi = {
|
||||
// 查询任务列表
|
||||
getTaskList: (data) => {
|
||||
return postAxios('/quartz/task/query', data);
|
||||
},
|
||||
// 添加或更新任务
|
||||
addOrUpdateTask: (data) => {
|
||||
return postAxios('/quartz/task/saveOrUpdate', data);
|
||||
},
|
||||
// 查询任务日志
|
||||
getTaskLog: (data) => {
|
||||
return postAxios('/quartz/task/queryLog', data);
|
||||
},
|
||||
// 暂停任务
|
||||
updateTaskPause: (taskId) => {
|
||||
return getAxios(`/quartz/task/pause/${taskId}`);
|
||||
},
|
||||
// 运行任务
|
||||
updateTaskRun: (taskId) => {
|
||||
return getAxios(`/quartz/task/run/${taskId}`);
|
||||
},
|
||||
// 恢复任务
|
||||
updateTaskResume: (taskId) => {
|
||||
return getAxios(`/quartz/task/resume/${taskId}`);
|
||||
},
|
||||
// 删除任务
|
||||
deleteTasks: (taskId) => {
|
||||
return getAxios(`/quartz/task/delete/${taskId}`);
|
||||
}
|
||||
};
|
||||
28
smart-admin-web/src/api/user-log.js
Normal file
28
smart-admin-web/src/api/user-log.js
Normal file
@@ -0,0 +1,28 @@
|
||||
// 用户日志API
|
||||
import {
|
||||
postAxios,
|
||||
getAxios
|
||||
} from '@/lib/http.js';
|
||||
export const userLogApi = {
|
||||
// 查询用户操作日志
|
||||
getUserOperateLogPage: (data) => {
|
||||
return postAxios('/userOperateLog/page/query', data);
|
||||
},
|
||||
// 用户操作日志详情
|
||||
detailUserOperateLog: (data) => {
|
||||
return getAxios('/userOperateLog/detail/' + data);
|
||||
},
|
||||
// 删除用户操作日志
|
||||
deleteUserOperateLog: (data) => {
|
||||
return getAxios('/userOperateLog/delete/' + data);
|
||||
},
|
||||
// 查询用户登录日志
|
||||
getUserLoginLogPage: (data) => {
|
||||
return postAxios('/userLoginLog/page/query', data);
|
||||
},
|
||||
// 删除用户登录日志
|
||||
deleteUserLoginLog: (data) => {
|
||||
return getAxios('/userLoginLog/delete/' + data);
|
||||
}
|
||||
|
||||
};
|
||||
20
smart-admin-web/src/api/user.js
Normal file
20
smart-admin-web/src/api/user.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import { postAxios, getAxios } from '@/lib/http';
|
||||
|
||||
export const login = ({ userName, password }) => {
|
||||
const data = {
|
||||
userName,
|
||||
password
|
||||
};
|
||||
return postAxios('login', data);
|
||||
};
|
||||
|
||||
export const getUserInfo = (token) => {
|
||||
let params = {
|
||||
token
|
||||
};
|
||||
return getAxios('get_info', params);
|
||||
};
|
||||
|
||||
export const logout = (token) => {
|
||||
return postAxios('logout', {});
|
||||
};
|
||||
Reference in New Issue
Block a user