diff --git a/public/templates/depotRule.doc b/public/templates/depotRule.doc new file mode 100644 index 0000000..ee5031d Binary files /dev/null and b/public/templates/depotRule.doc differ diff --git a/src/api/index.js b/src/api/index.js index 0db5173..e4930aa 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -8,4 +8,6 @@ setupResponseInterceptors(instance) // 导出所有模块接口 export { adminApi } from './modules/admin' -export { invitationApi } from './modules/invitation' \ No newline at end of file +export { invitationApi } from './modules/invitation' +export { depotApi } from './modules/depot' +export { userApi } from './modules/user' \ No newline at end of file diff --git a/src/api/interceptors/request.js b/src/api/interceptors/request.js index a3757d3..1d8c8c0 100644 --- a/src/api/interceptors/request.js +++ b/src/api/interceptors/request.js @@ -7,7 +7,7 @@ export function setupRequestInterceptors(instance) { // 判断 token 是否存在 if (token) { // 如果存在,则将 token 添加到请求头中的 Authorization 字段 - config.headers.Authorization = `${token}` + config.headers.Authorization = token } // 返回修改后的请求配置,继续发送请求 return config diff --git a/src/api/interceptors/response.js b/src/api/interceptors/response.js index c31698f..38df3d4 100644 --- a/src/api/interceptors/response.js +++ b/src/api/interceptors/response.js @@ -42,8 +42,12 @@ export function setupResponseInterceptors(instance) { return Promise.reject(error); } + // 创建表单数据 + const formData = new FormData(); + formData.append('refreshToken', refreshToken); + // 调用刷新token接口 - const response = await axios.post('/admin/getAccessToken', { refreshToken }); + const response = await axios.post('/admin/getAccessToken', formData); // 获取新的token const { accessToken, refreshToken: newRefreshToken } = response.data.data; diff --git a/src/api/modules/admin.js b/src/api/modules/admin.js index d9f1024..6fb69ea 100644 --- a/src/api/modules/admin.js +++ b/src/api/modules/admin.js @@ -4,8 +4,7 @@ import instance from '../../utils/axios.js' const adminApi = { register: (data) => instance.post('/admin/register', data), login: (data) => instance.post('/admin/login', data), - getAdmin: (data) => instance.post('/admin/getAdmin', data), - + getAdmin: () => instance.get('/admin/getAdmin'), }; // 若需要模块导出 diff --git a/src/api/modules/baseInfo.js b/src/api/modules/baseInfo.js new file mode 100644 index 0000000..0fa8ae6 --- /dev/null +++ b/src/api/modules/baseInfo.js @@ -0,0 +1,21 @@ +import request from '@/utils/request' + +/** + * 分页查询书籍基础信息列表 + * @param {Object} query 查询参数 + * @returns {Promise} 请求Promise对象 + */ +export function getBaseInfoList(query) { + return request({ + url: '/baseInfo/list', + method: 'get', + params: { + pageNum: query.pageNum || 1, + pageSize: query.pageSize || 10, + bookName: query.bookName, + isbn: query.isbn, + author: query.author, + publisher: query.publisher + } + }) +} \ No newline at end of file diff --git a/src/api/modules/bookBaseInfo.js b/src/api/modules/bookBaseInfo.js new file mode 100644 index 0000000..aa79660 --- /dev/null +++ b/src/api/modules/bookBaseInfo.js @@ -0,0 +1,35 @@ +import instance from '../../utils/axios.js' + +const bookBaseInfoApi = { + // 获取图书基本信息列表 + getBookBaseInfoList: (params) => instance.get('/baseInfo/list', { params }), + + // 获取图书基本信息详情 + getBookBaseInfoDetail: (id) => instance.get(`/book/baseInfo/detail/${id}`), + + // 添加图书基本信息 + addBookBaseInfo: (data) => instance.post('/book/baseInfo/add', data), + + // 更新图书基本信息 + updateBookBaseInfo: (data) => instance.put('/book/baseInfo/update', data), + + // 删除图书基本信息 + deleteBookBaseInfo: (id) => instance.delete(`/book/baseInfo/delete/${id}`), + + // 批量删除图书基本信息 + batchDeleteBookBaseInfo: (ids) => instance.post('/book/baseInfo/batchDelete', { ids }), + + // 更新图书违规状态 + updateBookViolationStatus: (data) => instance.put('/book/baseInfo/updateViolation', data), + + // 批量设置违规信息 + updateViolationConfig: (data) => instance.put('/baseInfo/batchUpdateIll', data), + + // 图书价格调整 + adjustBookPrice: (data) => instance.put('/book/baseInfo/adjustPrice', data), + + // 统计图书数据 + getBookStatistics: () => instance.get('/book/baseInfo/statistics') +} + +export { bookBaseInfoApi } \ No newline at end of file diff --git a/src/api/modules/depot.js b/src/api/modules/depot.js new file mode 100644 index 0000000..7f98abe --- /dev/null +++ b/src/api/modules/depot.js @@ -0,0 +1,72 @@ +import instance from '../../utils/axios.js' + +/** + * 货区管理相关接口 + */ +const depotApi = { + /** + * 获取货区列表 + * @param {Object} params - 查询参数 + * @returns {Promise} - 请求Promise + */ + getDepotList: (params) => instance.get('/depot/list', { params }), + + /** + * 创建货区 + * @param {Object} data - 货区信息 + * @returns {Promise} - 请求Promise + */ + createDepot: (data) => instance.post('/depot/create', data), + + /** + * 更新货区 + * @param {Object} data - 货区信息 + * @returns {Promise} - 请求Promise + */ + updateDepot: (data) => instance.put('/depot/update', data), + + /** + * 删除货区 + * @param {Number|String} id - 货区ID + * @returns {Promise} - 请求Promise + */ + deleteDepot: (id) => instance.delete(`/depot/delete/${id}`), + + /** + * 获取货区详情 + * @param {Number|String} id - 货区ID + * @returns {Promise} - 请求Promise + */ + getDepotById: (id) => instance.get(`/depot/get/${id}`), + + /** + * 根据用户ID获取货区 + * @param {Number|String} userId - 用户ID + * @returns {Promise} - 请求Promise + */ + getDepotsByUserId: (userId) => instance.get(`/depot/user/${userId}`), + + /** + * 根据货区编码获取货区 + * @param {String} code - 货区编码 + * @returns {Promise} - 请求Promise + */ + getDepotByCode: (code) => instance.get(`/depot/code/${code}`), + + /** + * 根据一级货区ID获取二级货架信息 + * @param {Number|String} id - 一级货区ID + * @returns {Promise} - 请求Promise + */ + getShelvesByDepotId: (id) => instance.get(`/depot/shelves/${id}`), + + /** + * 根据二级货架ID获取三级货位信息 + * @param {Number|String} id - 二级货架ID + * @returns {Promise} - 请求Promise + */ + getFreightByShelveId: (id) => instance.get(`/depot/freight/${id}`) +} + +// 导出模块 +export { depotApi } \ No newline at end of file diff --git a/src/api/modules/user.js b/src/api/modules/user.js new file mode 100644 index 0000000..3d70d3e --- /dev/null +++ b/src/api/modules/user.js @@ -0,0 +1,23 @@ +import instance from '../../utils/axios.js' + +// 用户相关API +const userApi = { + // 获取用户列表 + getUserList: () => instance.get('/user/list'), + + // 获取单个用户信息 + getUserById: (id) => instance.get(`/user/get/${id}`), + + // 注册/添加用户 + register: (data) => instance.post('/user/register', data), + + // 更新用户信息 + updateUser: (data) => instance.put('/user/update', data), + + // 删除用户 + deleteUser: (id) => instance.delete(`/user/delete/${id}`), + +}; + +// 导出模块 +export { userApi }; \ No newline at end of file diff --git a/src/api/permission.js b/src/api/permission.js new file mode 100644 index 0000000..2d75805 --- /dev/null +++ b/src/api/permission.js @@ -0,0 +1,43 @@ +import axios from '@/utils/axios' + +/** + * 获取权限树 + */ +export function getPermissionTree() { + return axios({ + url: '/admin/permission/tree', + method: 'get' + }) +} + +/** + * 添加权限 + */ +export function addPermission(data) { + return axios({ + url: '/admin/permission/add', + method: 'post', + data + }) +} + +/** + * 更新权限 + */ +export function updatePermission(data) { + return axios({ + url: '/admin/permission/update', + method: 'put', + data + }) +} + +/** + * 删除权限 + */ +export function deletePermission(id) { + return axios({ + url: `/admin/permission/delete/${id}`, + method: 'delete' + }) +} \ No newline at end of file diff --git a/src/api/role.js b/src/api/role.js new file mode 100644 index 0000000..71c2877 --- /dev/null +++ b/src/api/role.js @@ -0,0 +1,64 @@ +import axios from '@/utils/axios' + +/** + * 获取角色列表 + */ +export function getRoleList() { + return axios({ + url: '/admin/role/list', + method: 'get' + }) +} + +/** + * 添加角色 + */ +export function addRole(data) { + return axios({ + url: '/admin/role/add', + method: 'post', + data + }) +} + +/** + * 更新角色 + */ +export function updateRole(data) { + return axios({ + url: '/admin/role/update', + method: 'put', + data + }) +} + +/** + * 删除角色 + */ +export function deleteRole(id) { + return axios({ + url: `/admin/role/delete/${id}`, + method: 'delete' + }) +} + +/** + * 获取角色权限 + */ +export function getRolePermissions(roleId) { + return axios({ + url: `/admin/role/permissions/${roleId}`, + method: 'get' + }) +} + +/** + * 更新角色权限 + */ +export function updateRolePermissions(roleId, permissionIds) { + return axios({ + url: `/admin/role/permissions/${roleId}`, + method: 'put', + data: permissionIds + }) +} \ No newline at end of file diff --git a/src/api/user.js b/src/api/user.js new file mode 100644 index 0000000..1a545ac --- /dev/null +++ b/src/api/user.js @@ -0,0 +1,33 @@ +import axios from '@/utils/axios' + +/** + * 获取管理员角色 + */ +export function getAdminRoles(adminId) { + return axios({ + url: `/admin/user/roles/${adminId}`, + method: 'get' + }) +} + +/** + * 更新管理员角色 + */ +export function updateAdminRoles(adminId, roleIds) { + return axios({ + url: `/admin/user/roles/${adminId}`, + method: 'put', + data: roleIds + }) +} + +/** + * 获取用户列表 + */ +export function getUserList(params) { + return axios({ + url: '/admin/user/list', + method: 'get', + params + }) +} \ No newline at end of file diff --git a/src/layout/Sidebar.vue b/src/layout/Sidebar.vue index f606da5..06f232c 100644 --- a/src/layout/Sidebar.vue +++ b/src/layout/Sidebar.vue @@ -24,7 +24,7 @@ \ No newline at end of file + diff --git a/src/views/User/Permission.vue b/src/views/User/Permission.vue new file mode 100644 index 0000000..cb7157e --- /dev/null +++ b/src/views/User/Permission.vue @@ -0,0 +1,324 @@ + + + + + \ No newline at end of file diff --git a/src/views/User/Role.vue b/src/views/User/Role.vue new file mode 100644 index 0000000..143e47d --- /dev/null +++ b/src/views/User/Role.vue @@ -0,0 +1,275 @@ + + + + + \ No newline at end of file diff --git a/src/views/User/UserRole.vue b/src/views/User/UserRole.vue new file mode 100644 index 0000000..70d2c87 --- /dev/null +++ b/src/views/User/UserRole.vue @@ -0,0 +1,208 @@ + + + + + \ No newline at end of file diff --git a/src/views/Warehouse/Depot/List.vue b/src/views/Warehouse/Depot/List.vue new file mode 100644 index 0000000..ea25137 --- /dev/null +++ b/src/views/Warehouse/Depot/List.vue @@ -0,0 +1,676 @@ + + + + + \ No newline at end of file diff --git a/src/views/baseInfo/index.vue b/src/views/baseInfo/index.vue new file mode 100644 index 0000000..f95dfed --- /dev/null +++ b/src/views/baseInfo/index.vue @@ -0,0 +1,1457 @@ + + + + + \ No newline at end of file