refactor: 重构系统逻辑
This commit is contained in:
parent
cc209888f6
commit
ec3fd8a480
|
@ -25,7 +25,7 @@ const { $storage } = useNav();
|
|||
* * 设置多语言内容
|
||||
*/
|
||||
const setI18n = async () => {
|
||||
await i18nStore.fetchI18n();
|
||||
await i18nStore.loadI18nMap();
|
||||
const languageData = JSON.parse(localStorage.getItem('i18nStore') as any);
|
||||
// 初始化设置多语言内容
|
||||
const locale = $storage.locale.locale;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { http } from '@/api/service/request';
|
||||
import type { BaseResult } from '@/api/service/types';
|
||||
|
||||
/** 获取修改前端配置文件 */
|
||||
/** 读取web配置文件并返回给前端 */
|
||||
export const getWebConfig = () => {
|
||||
return http.request<BaseResult<any>>('get', '/config');
|
||||
return http.request<any>('get', '/config/public/webConfig');
|
||||
};
|
||||
|
||||
/** 更新web配置文件 */
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
import { http } from '@/api/service/request';
|
||||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 邮件模板表---获取邮件模板表列表 */
|
||||
/** 邮件模板表---分页查询邮件模板 */
|
||||
export const getEmailTemplatePage = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `emailTemplate/query/page/${data.currentPage}/${data.pageSize}`, {
|
||||
return http.request<BaseResult<ResultTable>>('get', `emailTemplate/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 邮件模板表---获取模板类型字段 */
|
||||
/** 邮件模板表---添加邮件模板 */
|
||||
export const createEmailTemplate = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'emailTemplate', { data });
|
||||
};
|
||||
|
||||
/** 邮件模板表---更新邮件模板 */
|
||||
export const updateEmailTemplate = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'emailTemplate', { data });
|
||||
};
|
||||
|
||||
/** 邮件模板表---删除邮件模板 */
|
||||
export const deleteEmailTemplate = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'emailTemplate', { data });
|
||||
};
|
||||
|
||||
/** 邮件模板表---获取全部邮件类型列表 */
|
||||
export const getEmailTypeList = () => {
|
||||
return http.request<BaseResult<any>>('get', 'emailTemplate/query/emailTypes');
|
||||
};
|
||||
|
||||
/** 邮件模板表---添加邮件模板表 */
|
||||
export const addEmailTemplate = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'emailTemplate/add/emailTemplate', { data });
|
||||
};
|
||||
|
||||
/** 邮件模板表---更新邮件模板表 */
|
||||
export const fetchUpdateEmailTemplate = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'emailTemplate/updateEmailTemplate', { data });
|
||||
};
|
||||
|
||||
/** 邮件模板表---删除邮件模板表 */
|
||||
export const fetchDeleteEmailTemplate = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'emailTemplate/deleteEmailTemplate', { data });
|
||||
return http.request<BaseResult<any>>('get', 'emailTemplate/public');
|
||||
};
|
||||
|
|
|
@ -1,36 +1,29 @@
|
|||
import { http } from '@/api/service/request';
|
||||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 邮箱用户发送配置管理---获取邮箱用户发送配置管理列表 */
|
||||
export const fetchGetEmailUsersList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>(
|
||||
'get',
|
||||
`emailUsers/getEmailUsersList/${data.currentPage}/${data.pageSize}`,
|
||||
{ params: data }
|
||||
);
|
||||
/** 邮箱用户发送配置管理---分页查询邮箱用户发送配置 */
|
||||
export const getEmailUserPage = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `emailUsers/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 邮箱用户发送配置管理---获取所有邮箱配置用户 */
|
||||
export const fetchGetAllMailboxConfigurationUsers = () => {
|
||||
return http.request<BaseResult<any>>('get', 'emailUsers/noManage/getAllMailboxConfigurationUsers');
|
||||
/** 邮箱用户发送配置管理---添加邮箱用户发送配置 */
|
||||
export const createEmailUsers = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'emailUsers', { data });
|
||||
};
|
||||
|
||||
/** 邮箱用户发送配置管理---添加邮箱用户发送配置管理 */
|
||||
export const fetchAddEmailUsers = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'emailUsers/addEmailUsers', { data });
|
||||
/** 邮箱用户发送配置管理---更新邮箱用户发送配置 */
|
||||
export const updateEmailUsers = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'emailUsers', { data });
|
||||
};
|
||||
|
||||
/** 邮箱用户发送配置管理---更新邮箱用户发送配置管理 */
|
||||
export const fetchUpdateEmailUsers = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'emailUsers/updateEmailUsers', { data });
|
||||
/** 邮箱用户发送配置管理---删除邮箱用户 */
|
||||
export const deleteEmailUsers = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'emailUsers', { data });
|
||||
};
|
||||
|
||||
/** 邮箱用户发送配置管理---更新邮箱用户状态 */
|
||||
export const fetchUpdateEmailUserStatus = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'emailUsers/updateEmailUserStatus', { data });
|
||||
};
|
||||
|
||||
/** 邮箱用户发送配置管理---删除邮箱用户发送配置管理 */
|
||||
export const fetchDeleteEmailUsers = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'emailUsers/deleteEmailUsers', { data });
|
||||
/** 邮箱用户发送配置管理---获取全部邮件用户配置 */
|
||||
export const getEmailUserList = () => {
|
||||
return http.request<BaseResult<any>>('get', 'emailUsers/private');
|
||||
};
|
||||
|
|
|
@ -2,53 +2,47 @@ import { http } from '@/api/service/request';
|
|||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 系统文件管理---获取系统文件管理列表 */
|
||||
export const fetchGetFilesList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `files/getFilesList/${data.currentPage}/${data.pageSize}`, {
|
||||
export const getFilesPage = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `files/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 系统文件管理---根据Id下载系统文件 */
|
||||
export const downloadFilesByFileId = (data: any) => {
|
||||
return http.request<any>('get', `files/downloadFilesByFileId/${data.id}`, { responseType: 'blob' });
|
||||
};
|
||||
|
||||
/** 系统文件管理---批量下载系统文件 */
|
||||
export const downloadFilesByFilepath = (data: any) => {
|
||||
return http.request<any>('get', `files/downloadFilesByFilepath`, { params: data }, { responseType: 'blob' });
|
||||
};
|
||||
|
||||
/** 系统文件管理---获取所有文件类型 */
|
||||
export const fetchGetAllMediaTypes = () => {
|
||||
return http.request<BaseResult<any>>('get', `files/noManage/getAllMediaTypes`);
|
||||
};
|
||||
|
||||
/** 系统文件管理---获取所有文件存储基础路径 */
|
||||
export const fetchGetAllFilesStoragePath = () => {
|
||||
return http.request<BaseResult<any>>('get', `files/noManage/getAllFilesStoragePath`);
|
||||
};
|
||||
|
||||
/** 系统文件管理---添加系统文件管理 */
|
||||
/** 系统文件管理---添加系统文件 */
|
||||
export const fetchAddFiles = (data: any) => {
|
||||
return http.request<BaseResult<any>>(
|
||||
'post',
|
||||
'files/addFiles',
|
||||
'files',
|
||||
{ data },
|
||||
{ headers: { 'Content-Type': 'multipart/form-data' } }
|
||||
);
|
||||
};
|
||||
|
||||
/** 系统文件管理---更新系统文件管理 */
|
||||
export const fetchUpdateFiles = (data: any) => {
|
||||
/** 系统文件管理---更新系统文件 */
|
||||
export const updateFiles = (data: any) => {
|
||||
return http.request<BaseResult<object>>(
|
||||
'put',
|
||||
'files/updateFiles',
|
||||
'files',
|
||||
{ data },
|
||||
{ headers: { 'Content-Type': 'multipart/form-data' } }
|
||||
);
|
||||
};
|
||||
|
||||
/** 系统文件管理---删除系统文件管理 */
|
||||
export const fetchDeleteFiles = (data: any) => {
|
||||
return http.request<BaseResult<any>>('delete', 'files/deleteFiles', { data });
|
||||
/** 系统文件管理---删除系统文件 */
|
||||
export const deleteFiles = (data: any) => {
|
||||
return http.request<BaseResult<any>>('delete', 'files', { data });
|
||||
};
|
||||
|
||||
/** 系统文件管理---根据文件id下载文件 */
|
||||
export const downloadFilesByFileId = (data: any) => {
|
||||
return http.request<any>('get', `files/file/${data.id}`, { responseType: 'blob' });
|
||||
};
|
||||
|
||||
/** 系统文件管理---获取所有文件类型 */
|
||||
export const getMediaTypeList = () => {
|
||||
return http.request<BaseResult<any>>('get', `files/private/getMediaTypeList`);
|
||||
};
|
||||
|
||||
/** 系统文件管理---获取所有文件存储基础路径 */
|
||||
export const getFilesStoragePath = () => {
|
||||
return http.request<BaseResult<any>>('get', `files/private/getAllFilesStoragePath`);
|
||||
};
|
||||
|
|
|
@ -1,66 +1,70 @@
|
|||
import { http } from '@/api/service/request';
|
||||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 多语言类型管理---获取多语言内容 */
|
||||
export const fetchGetI18n = () => {
|
||||
return http.request<BaseResult<object>>('get', 'i18n/getI18n');
|
||||
/** 多语言管理---获取多语言内容 */
|
||||
export const getI18nMap = () => {
|
||||
return http.request<BaseResult<object>>('get', 'i18n/public');
|
||||
};
|
||||
|
||||
/** 多语言类型管理---下载多语言配置 */
|
||||
export const fetchDownloadI18nSetting = (params: object) => {
|
||||
return http.request<any>('get', 'i18n/downloadI18n', { params }, { responseType: 'blob' });
|
||||
};
|
||||
|
||||
/** 多语言类型管理---获取多语言列表 */
|
||||
export const fetchGetI18nList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `i18n/getI18nList/${data.currentPage}/${data.pageSize}`, {
|
||||
/** 多语言管理---分页查询多语言 */
|
||||
export const getI18nPage = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `i18n/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 多语言类型管理---添加多语言 */
|
||||
export const fetchAddI18n = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'i18n/addI18n', { data });
|
||||
/** 多语言管理---添加多语言 */
|
||||
export const createI18n = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'i18n', { data });
|
||||
};
|
||||
|
||||
/** 多语言类型管理---更新多语言 */
|
||||
export const fetchUpdateI18n = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'i18n/updateI18n', { data });
|
||||
/** 多语言管理---更新多语言 */
|
||||
export const updateI18n = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'i18n', { data });
|
||||
};
|
||||
|
||||
/** 多语言类型管理---用文件更新多语言 */
|
||||
export const updateI18nByFile = (data: any) => {
|
||||
/** 多语言管理---删除多语言 */
|
||||
export const deleteI18n = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'i18n', { data });
|
||||
};
|
||||
|
||||
/** 多语言管理---文件导出并下载多语言 */
|
||||
export const downloadI18n = (params: object) => {
|
||||
return http.request<any>('get', 'i18n/file', { params }, { responseType: 'blob' });
|
||||
};
|
||||
|
||||
/** 多语言管理---文件更新多语言可以是JSON、Excel */
|
||||
export const uploadI18nFile = (data: any) => {
|
||||
return http.request<BaseResult<object>>(
|
||||
'put',
|
||||
'i18n/updateI18nByFile',
|
||||
'i18n/file',
|
||||
{ data },
|
||||
{ headers: { 'Content-Type': 'multipart/form-data' } }
|
||||
);
|
||||
};
|
||||
|
||||
/** 多语言类型管理---删除多语言 */
|
||||
export const fetchDeleteI18n = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'i18n/deleteI18n', { data });
|
||||
};
|
||||
|
||||
/** 多语言类型管理---获取多语言类型列表 */
|
||||
export const fetchGetI18nTypeList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', 'i18nType/noAuth/getI18nTypeList', {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
// ------------------------------------------------
|
||||
// 多语言类型管理
|
||||
// ------------------------------------------------
|
||||
|
||||
/** 多语言类型管理---添加多语言类型 */
|
||||
export const fetchAddI18nType = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'i18nType/addI18nType', { data });
|
||||
export const createI18Type = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'i18nType', { data });
|
||||
};
|
||||
|
||||
/** 多语言类型管理---更新多语言类型 */
|
||||
export const fetchUpdateI18nType = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'i18nType/updateI18nType', { data });
|
||||
export const updateI18nType = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'i18nType', { data });
|
||||
};
|
||||
|
||||
/** 多语言类型管理---删除多语言类型 */
|
||||
export const fetchDeleteI18nType = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'i18nType/deleteI18nType', { data });
|
||||
export const deleteI18nType = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'i18nType', { data });
|
||||
};
|
||||
|
||||
/** 多语言类型管理---获取全部多语言类型列表 */
|
||||
export const getI18nTypeList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', 'i18nType/public', {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
import { http } from '@/api/service/request';
|
||||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 调度任务执行日志---获取调度任务执行日志列表 */
|
||||
export const fetchGetQuartzExecuteLogList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>(
|
||||
'get',
|
||||
`quartzExecuteLog/getQuartzExecuteLogList/${data.currentPage}/${data.pageSize}`,
|
||||
{ params: data }
|
||||
);
|
||||
};
|
||||
|
||||
/** 调度任务执行日志---删除调度任务执行日志 */
|
||||
export const fetchDeleteQuartzExecuteLog = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'quartzExecuteLog/deleteQuartzExecuteLog', { data });
|
||||
};
|
|
@ -0,0 +1,14 @@
|
|||
import { http } from '@/api/service/request';
|
||||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 调度任务执行日志---分页查询调度任务执行日志 */
|
||||
export const getScheduleExecuteLogPage = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `scheduleExecuteLog/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 调度任务执行日志---删除调度任务执行日志 */
|
||||
export const deleteScheduleExecuteLog = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'scheduleExecuteLog', { data });
|
||||
};
|
|
@ -2,23 +2,18 @@ import { http } from '@/api/service/request';
|
|||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 用户登录日志---获取用户登录日志列表 */
|
||||
export const fetchGetUserLoginLogList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>(
|
||||
'get',
|
||||
`userLoginLog/getUserLoginLogList/${data.currentPage}/${data.pageSize}`,
|
||||
{ params: data }
|
||||
);
|
||||
};
|
||||
|
||||
/** 用户登录日志---获取用户登录日志列表 */
|
||||
export const fetchGetUserLoginLogListByLocalUser = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>(
|
||||
'get',
|
||||
`userLoginLog/noManage/getUserLoginLogListByLocalUser/${data.currentPage}/${data.pageSize}`
|
||||
);
|
||||
export const getUserLoginLogPageByAdmin = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `userLoginLog/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 用户登录日志---删除用户登录日志 */
|
||||
export const fetchDeleteUserLoginLog = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'userLoginLog/deleteUserLoginLog', { data });
|
||||
export const deleteUserLoginLog = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'userLoginLog', { data });
|
||||
};
|
||||
|
||||
/** 用户登录日志---获取用户登录日志列表 */
|
||||
export const getUserLoginLogPageByUser = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `userLoginLog/private/${data.currentPage}/${data.pageSize}`);
|
||||
};
|
||||
|
|
|
@ -2,33 +2,31 @@ import { http } from '@/api/service/request';
|
|||
import type { BaseResult } from '@/api/service/types';
|
||||
|
||||
/** 菜单管理-列表 */
|
||||
export const fetchMenuList = () => {
|
||||
return http.request<BaseResult<any>>('get', `router/menuList`);
|
||||
export const getRouterList = () => {
|
||||
return http.request<BaseResult<any>>('get', `router/routerList`);
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据路由id获取所有角色
|
||||
*/
|
||||
export const fetchGetRoleListByRouterId = (data) => {
|
||||
return http.request<BaseResult<any>>('get', `routerRole/getRoleListByRouterId`, { params: data });
|
||||
/* 根据路由id获取所有角色 */
|
||||
export const getRoleListByRouterId = (data: any) => {
|
||||
return http.request<BaseResult<any>>('get', `routerRole/private/getRoleListByRouterId`, { params: data });
|
||||
};
|
||||
|
||||
/** 菜单管理-添加菜单 */
|
||||
export const fetchAddMenu = (data?: any) => {
|
||||
return http.request<BaseResult<any>>('post', `router/addMenu`, { data });
|
||||
export const createRouter = (data?: any) => {
|
||||
return http.request<BaseResult<any>>('post', `router`, { data });
|
||||
};
|
||||
|
||||
/** 菜单管理-清除选中菜单所有角色 */
|
||||
export const fetchClearAllRolesSelect = (data: any) => {
|
||||
return http.request<BaseResult<any>>('delete', `routerRole/clearAllRolesSelect`, { data });
|
||||
export const clearRouterRole = (data: any) => {
|
||||
return http.request<BaseResult<any>>('delete', `routerRole/clearRouterRole`, { data });
|
||||
};
|
||||
|
||||
/** 菜单管理-更新菜单 */
|
||||
export const fetchUpdateMenu = (data?: any) => {
|
||||
return http.request<BaseResult<any>>('put', `router/updateMenu`, { data });
|
||||
export const updateRouter = (data?: any) => {
|
||||
return http.request<BaseResult<any>>('put', `router`, { data });
|
||||
};
|
||||
|
||||
/** 菜单管理-删除菜单 */
|
||||
export const fetchDeletedMenuByIds = (data?: any) => {
|
||||
return http.request<BaseResult<any>>('delete', `router/deletedMenuByIds`, { data });
|
||||
export const deletedRouterByIds = (data?: any) => {
|
||||
return http.request<BaseResult<any>>('delete', `router`, { data });
|
||||
};
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
import { http } from '@/api/service/request';
|
||||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 系统菜单图标---获取多语言列表 */
|
||||
export const fetchMenuIconList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `menuIcon/menuIconList/${data.currentPage}/${data.pageSize}`, {
|
||||
/** 系统菜单图标---分页查询系统菜单图标 */
|
||||
export const getMenuIconPage = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `menuIcon/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 系统菜单图标---添加多语言 */
|
||||
export const fetchAddMenuIcon = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'menuIcon/addMenuIcon', { data });
|
||||
/** 系统菜单图标---添加系统菜单图标 */
|
||||
export const createMenuIcon = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'menuIcon', { data });
|
||||
};
|
||||
|
||||
/** 系统菜单图标---更新多语言 */
|
||||
export const fetchUpdateMenuIcon = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'menuIcon/updateMenuIcon', { data });
|
||||
/** 系统菜单图标---更新系统菜单图标 */
|
||||
export const updateMenuIcon = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'menuIcon', { data });
|
||||
};
|
||||
|
||||
/** 系统菜单图标---删除多语言 */
|
||||
export const fetchDeleteMenuIcon = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'menuIcon/deleteMenuIcon', { data });
|
||||
/** 系统菜单图标---删除系统菜单图标 */
|
||||
export const deleteMenuIcon = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'menuIcon', { data });
|
||||
};
|
||||
|
||||
/** 系统菜单图标---根据iconName搜索menuIcon */
|
||||
export const fetchGetIconNameList = (data: any) => {
|
||||
return http.request<BaseResult<object>>('get', 'menuIcon/noManage/getIconNameList', { params: data });
|
||||
/** 系统菜单图标---根据名称搜索图标 */
|
||||
export const getIconNameListByIconName = (data: any) => {
|
||||
return http.request<BaseResult<object>>('get', 'menuIcon/public', { params: data });
|
||||
};
|
||||
|
|
|
@ -1,21 +1,36 @@
|
|||
import { http } from '@/api/service/request';
|
||||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 管理员操作用户消息---获取系统管理消息列表 */
|
||||
export const fetchGetMessageReceivedList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>(
|
||||
'get',
|
||||
`messageReceived/getMessageReceivedList/${data.currentPage}/${data.pageSize}`,
|
||||
{ params: data }
|
||||
);
|
||||
/** 管理员操作用户消息---管理员分页查询用户消息 */
|
||||
export const getMessageReceivedPage = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `messageReceived/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 管理员操作用户消息---将用户消息标为已读 */
|
||||
export const fetchUpdateMarkMessageReceived = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'messageReceived/updateMarkMessageReceived', { data });
|
||||
/** 管理员操作用户消息---管理员将用户消息标为已读 */
|
||||
export const updateMessageReceivedByAdmin = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'messageReceived', { data });
|
||||
};
|
||||
|
||||
/** 管理员操作用户消息---管理删除用户消息 */
|
||||
export const fetchDeleteMessageReceivedByIds = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'messageReceived/deleteMessageReceivedByIds', { data });
|
||||
export const deleteMessageReceivedByAdmin = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'messageReceived', { data });
|
||||
};
|
||||
|
||||
/** 用户系统消息---用户获取系统消息列表 */
|
||||
export const getMessageReceivedPageByUser = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `messageReceived/private/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 系统消息---用户将消息标为已读 */
|
||||
export const updateMessageByUser = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'messageReceived/private/markAsRead', { data });
|
||||
};
|
||||
|
||||
/** 系统消息---用户删除系统消息 */
|
||||
export const deleteMessageReceivedByUser = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'messageReceived/private/deleteMessage', { data });
|
||||
};
|
||||
|
|
|
@ -1,29 +1,34 @@
|
|||
import { http } from '@/api/service/request';
|
||||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 系统消息---获取系统管理消息列表 */
|
||||
export const fetchGetMessageList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `message/getMessageList/${data.currentPage}/${data.pageSize}`, {
|
||||
/** 系统消息---分页查询发送消息 */
|
||||
export const getMessagePage = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `message/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 系统消息---根据消息id获取接收人信息 */
|
||||
export const fetchGetReceivedUserinfoByMessageId = (data: any) => {
|
||||
return http.request<BaseResult<any>>('get', `message/noManage/getReceivedUserinfoByMessageId`, { params: data });
|
||||
};
|
||||
|
||||
/** 系统消息---添加系统消息 */
|
||||
export const fetchAddMessage = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'message/addMessage', { data });
|
||||
export const createMessage = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'message', { data });
|
||||
};
|
||||
|
||||
/** 系统消息---更新系统消息 */
|
||||
export const fetchUpdateMessage = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'message/updateMessage', { data });
|
||||
export const updateMessage = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'message', { data });
|
||||
};
|
||||
|
||||
/** 系统消息---删除系统消息 */
|
||||
export const fetchDeleteMessage = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'message/deleteMessage', { data });
|
||||
export const deleteMessage = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'message', { data });
|
||||
};
|
||||
|
||||
/** 用户系统消息---根据消息id查询消息详情 */
|
||||
export const getMessageDetailById = (data: any) => {
|
||||
return http.request<BaseResult<any>>('get', `message/private/getMessageDetailById`, { params: data });
|
||||
};
|
||||
|
||||
/** 系统消息---根据消息id获取接收人信息 */
|
||||
export const getReceivedUserinfoByMessageId = (data: any) => {
|
||||
return http.request<BaseResult<any>>('get', `message/private/getReceivedUserinfoByMessageId`, { params: data });
|
||||
};
|
||||
|
|
|
@ -1,31 +1,29 @@
|
|||
import { http } from '@/api/service/request';
|
||||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 系统消息类型---获取系统消息类型列表 */
|
||||
export const fetchGetMessageTypeList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>(
|
||||
'get',
|
||||
`messageType/getMessageTypeList/${data.currentPage}/${data.pageSize}`,
|
||||
{ params: data }
|
||||
);
|
||||
};
|
||||
|
||||
/** 系统消息类型---获取系统消息类型列表 */
|
||||
export const fetchGetAllMessageTypes = () => {
|
||||
return http.request<BaseResult<ResultTable>>('get', '/messageType/noManage/getAllMessageTypes');
|
||||
/** 系统消息类型---分页查询系统消息类型 */
|
||||
export const getMessageTypePage = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `messageType/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 系统消息类型---添加系统消息类型 */
|
||||
export const fetchAddMessageType = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'messageType/addMessageType', { data });
|
||||
export const createMessageType = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'messageType', { data });
|
||||
};
|
||||
|
||||
/** 系统消息类型---更新系统消息类型 */
|
||||
export const fetchUpdateMessageType = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'messageType/updateMessageType', { data });
|
||||
export const updateMessageType = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'messageType', { data });
|
||||
};
|
||||
|
||||
/** 系统消息类型---删除系统消息类型 */
|
||||
export const fetchDeleteMessageType = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'messageType/deleteMessageType', { data });
|
||||
export const deleteMessageType = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'messageType', { data });
|
||||
};
|
||||
|
||||
/** 系统消息类型---获取所有消息列表 */
|
||||
export const getMessageTypeList = () => {
|
||||
return http.request<BaseResult<ResultTable>>('get', '/messageType/private/getMessageList');
|
||||
};
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
import { http } from '@/api/service/request';
|
||||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 用户系统消息---用户获取系统消息列表 */
|
||||
export const fetchGetUserMessageList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>(
|
||||
'get',
|
||||
`messageReceived/noManage/getUserMessageList/${data.currentPage}/${data.pageSize}`,
|
||||
{ params: data }
|
||||
);
|
||||
};
|
||||
|
||||
/** 用户系统消息---根据消息id查询消息详情 */
|
||||
export const fetchGetMessageDetailById = (data: any) => {
|
||||
return http.request<BaseResult<any>>('get', `message/noManage/getMessageDetailById`, { params: data });
|
||||
};
|
||||
|
||||
/** 系统消息---用户将消息标为已读 */
|
||||
export const fetchUpdateUserMarkAsRead = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'messageReceived/noManage/userMarkAsRead', { data });
|
||||
};
|
||||
|
||||
/** 系统消息---用户删除系统消息 */
|
||||
export const fetchDeleteUserMessageByIds = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'messageReceived/noManage/deleteUserMessageByIds', { data });
|
||||
};
|
|
@ -1,41 +1,39 @@
|
|||
import { http } from '@/api/service/request';
|
||||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** Schedulers视图---获取Schedulers视图列表 */
|
||||
export const fetchGetSchedulersList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>(
|
||||
'get',
|
||||
`schedulers/getSchedulersList/${data.currentPage}/${data.pageSize}`,
|
||||
{ params: data }
|
||||
);
|
||||
};
|
||||
|
||||
/** Schedulers视图---获取所有可用调度任务 */
|
||||
export const fetchGetAllScheduleJobList = () => {
|
||||
return http.request<BaseResult<ResultTable>>('get', 'schedulers/noManage/getAllScheduleJobList');
|
||||
/** Schedulers视图---分页查询任务执行 */
|
||||
export const getSchedulersPage = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `schedulers/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** Schedulers视图---添加Schedulers视图 */
|
||||
export const fetchAddSchedulers = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'schedulers/addSchedulers', { data });
|
||||
export const createSchedulers = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'schedulers', { data });
|
||||
};
|
||||
|
||||
/** Schedulers视图---更新Schedulers视图 */
|
||||
export const fetchUpdateSchedulers = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'schedulers/updateSchedulers', { data });
|
||||
};
|
||||
|
||||
/** Schedulers视图---暂停任务 */
|
||||
export const fetchPauseSchedulers = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'schedulers/pauseSchedulers', { data });
|
||||
};
|
||||
|
||||
/** Schedulers视图---恢复任务 */
|
||||
export const fetchResumeSchedulers = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'schedulers/resumeSchedulers', { data });
|
||||
export const updateSchedulers = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'schedulers', { data });
|
||||
};
|
||||
|
||||
/** Schedulers视图---删除Schedulers视图 */
|
||||
export const fetchDeleteSchedulers = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'schedulers/deleteSchedulers', { data });
|
||||
export const deleteSchedulers = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'schedulers', { data });
|
||||
};
|
||||
|
||||
/** Schedulers视图---获取所有可用调度任务 */
|
||||
export const getScheduleJobList = () => {
|
||||
return http.request<BaseResult<ResultTable>>('get', 'schedulers/private');
|
||||
};
|
||||
|
||||
/** Schedulers视图---暂停任务 */
|
||||
export const updateSchedulersByPause = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'schedulers/pause', { data });
|
||||
};
|
||||
|
||||
/** Schedulers视图---恢复任务 */
|
||||
export const updateSchedulersByResume = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'schedulers/resume', { data });
|
||||
};
|
||||
|
|
|
@ -1,31 +1,29 @@
|
|||
import { http } from '@/api/service/request';
|
||||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 任务调度分组---获取任务调度分组列表 */
|
||||
export const fetchGetSchedulersGroupList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>(
|
||||
'get',
|
||||
`schedulersGroup/getSchedulersGroupList/${data.currentPage}/${data.pageSize}`,
|
||||
{ params: data }
|
||||
);
|
||||
};
|
||||
|
||||
/** 任务调度分组---获取所有任务调度分组 */
|
||||
export const fetchGetAllSchedulersGroup = () => {
|
||||
return http.request<BaseResult<ResultTable>>('get', 'schedulersGroup/getAllSchedulersGroup');
|
||||
/** 任务调度分组---分页查询任务调度分组 */
|
||||
export const getSchedulersGroupPage = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `schedulersGroup/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 任务调度分组---添加任务调度分组 */
|
||||
export const fetchAddSchedulersGroup = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'schedulersGroup/addSchedulersGroup', { data });
|
||||
export const createSchedulersGroup = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'schedulersGroup', { data });
|
||||
};
|
||||
|
||||
/** 任务调度分组---更新任务调度分组 */
|
||||
export const fetchUpdateSchedulersGroup = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'schedulersGroup/updateSchedulersGroup', { data });
|
||||
export const updateSchedulersGroup = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'schedulersGroup', { data });
|
||||
};
|
||||
|
||||
/** 任务调度分组---删除任务调度分组 */
|
||||
export const fetchDeleteSchedulersGroup = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'schedulersGroup/deleteSchedulersGroup', { data });
|
||||
export const deleteSchedulersGroup = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'schedulersGroup', { data });
|
||||
};
|
||||
|
||||
/** 任务调度分组---获取所有任务调度分组 */
|
||||
export const getSchedulersGroupList = () => {
|
||||
return http.request<BaseResult<ResultTable>>('get', 'schedulersGroup/getSchedulersGroupList');
|
||||
};
|
||||
|
|
|
@ -29,109 +29,97 @@ export interface RefreshTokenResult {
|
|||
expires: Date;
|
||||
}
|
||||
|
||||
/** 登录 */
|
||||
export const fetchLogin = (data?: object) => {
|
||||
return http.request<BaseResult<UserResult>>('post', '/user/login', { data });
|
||||
};
|
||||
// -----------------------------------------
|
||||
// 管理用户CURD
|
||||
// -----------------------------------------
|
||||
|
||||
/** 发送邮件 */
|
||||
export const fetchPostEmailCode = (data: any) => {
|
||||
return http.request<BaseResult<any>>(
|
||||
'post',
|
||||
'/user/noAuth/sendLoginEmail',
|
||||
{ data },
|
||||
{ headers: { 'Content-Type': 'multipart/form-data' } }
|
||||
);
|
||||
};
|
||||
|
||||
/** 刷新`token` */
|
||||
export const refreshTokenApi = (data?: object) => {
|
||||
return http.request<BaseResult<RefreshTokenResult>>('post', 'user/noAuth/refreshToken', { data });
|
||||
};
|
||||
|
||||
/** 退出账户 */
|
||||
export const fetchLogout = (data?: object) => {
|
||||
return http.request<BaseResult<any>>('post', 'user/noManage/logout', { data });
|
||||
};
|
||||
|
||||
/** 获取用户信息,根据当前token获取 */
|
||||
export const fetchUserinfo = () => {
|
||||
return http.request<BaseResult<any>>('get', 'user/noManage/userinfo');
|
||||
};
|
||||
|
||||
/** 用户信息---获取用户信息列表 */
|
||||
export const fetchGetAdminUserList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `user/getAdminUserList/${data.currentPage}/${data.pageSize}`, {
|
||||
/** 用户信息---分页查询用户信息 */
|
||||
export const getUserPageByAdmin = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `user/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 用户信息---查询用户 */
|
||||
export const fetchQueryUser = (data: any) => {
|
||||
return http.request<BaseResult<object>>('get', 'user/noManage/queryUser', { params: data });
|
||||
/** 用户信息---添加用户信息 */
|
||||
export const createUserByAdmin = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'user', { data });
|
||||
};
|
||||
|
||||
/** 用户信息---更新用户信息 */
|
||||
export const fetchUpdateAdminUser = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'user/updateAdminUser', { data });
|
||||
};
|
||||
|
||||
/** 用户信息---更新本地用户信息 */
|
||||
export const fetchUpdateAdminUserByLocalUser = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'user/noManage/updateAdminUserByLocalUser', { data });
|
||||
};
|
||||
|
||||
/** 用户信息---更新本地用户密码 */
|
||||
export const fetchUpdateUserPasswordByLocalUser = (data: any) => {
|
||||
export const updateUserByAdmin = (data: any) => {
|
||||
return http.request<BaseResult<object>>(
|
||||
'put',
|
||||
'user/noManage/updateUserPasswordByLocalUser',
|
||||
'user',
|
||||
{ data },
|
||||
{ headers: { 'Content-Type': 'multipart/form-data' } }
|
||||
);
|
||||
};
|
||||
|
||||
/** 用户信息---添加用户信息 */
|
||||
export const fetchAddAdminUser = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'user/addAdminUser', { data });
|
||||
};
|
||||
|
||||
/** 用户信息---删除用户信息 */
|
||||
export const fetchDeleteAdminUser = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'user/deleteAdminUser', { data });
|
||||
export const deleteUserByAdmin = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'user', { data });
|
||||
};
|
||||
|
||||
/** 用户管理---获取用户信息 */
|
||||
export const fetchGetUserinfoById = (data?: object) => {
|
||||
return http.request<BaseResult<UserResult>>('get', 'user/getUserinfoById', { params: data });
|
||||
/** 用户管理---根据用户id查询 */
|
||||
export const loadUserinfoById = (data?: object) => {
|
||||
return http.request<BaseResult<UserResult>>('get', 'user/private/getUserinfoById', { params: data });
|
||||
};
|
||||
|
||||
/** 用户管理---修改用户状态 */
|
||||
export const fetchUpdateUserStatusByAdmin = (data?: object) => {
|
||||
return http.request<BaseResult<UserResult>>('put', 'user/updateUserStatusByAdmin', { data });
|
||||
/** 用户信息---根据用户名查询用户列表 */
|
||||
export const getUserListByKeyword = (data: any) => {
|
||||
return http.request<BaseResult<object>>('get', 'user/private/getUserListByKeyword', { params: data });
|
||||
};
|
||||
|
||||
/** 用户管理---管理员修改管理员用户密码 */
|
||||
export const fetchUpdateUserPasswordByAdmin = (data: any) => {
|
||||
return http.request<BaseResult<UserResult>>('put', 'user/updateUserPasswordByAdmin', { data });
|
||||
/** 用户管理---强制用户下线 */
|
||||
export const forcedOfflineByAdmin = (data: any) => {
|
||||
return http.request<BaseResult<UserResult>>('put', 'user/forcedOffline', { data });
|
||||
};
|
||||
|
||||
/** 用户管理---管理员修改管理员用户头像 */
|
||||
export const fetchUploadAvatarByAdmin = (data: any) => {
|
||||
return http.request<BaseResult<UserResult>>(
|
||||
'put',
|
||||
'user/uploadAvatarByAdmin',
|
||||
// -----------------------------------------
|
||||
// 普通用户
|
||||
// -----------------------------------------
|
||||
|
||||
/** 登录 */
|
||||
export const userLogin = (data?: object) => {
|
||||
return http.request<BaseResult<UserResult>>('post', '/user/login', { data });
|
||||
};
|
||||
|
||||
/** 刷新`token` */
|
||||
export const refreshTokenApi = (data?: object) => {
|
||||
return http.request<BaseResult<RefreshTokenResult>>('post', 'user/public/refreshToken', { data });
|
||||
};
|
||||
|
||||
/** 发送邮件 */
|
||||
export const sendLoginEmail = (data: any) => {
|
||||
return http.request<BaseResult<any>>(
|
||||
'post',
|
||||
'/user/public/sendLoginEmail',
|
||||
{ data },
|
||||
{ headers: { 'Content-Type': 'multipart/form-data' } }
|
||||
);
|
||||
};
|
||||
|
||||
/** 用户管理---强制用户下线 */
|
||||
export const fetchForcedOffline = (data: any) => {
|
||||
return http.request<BaseResult<UserResult>>('put', 'user/forcedOffline', { data });
|
||||
/** 获取用户信息,根据当前token获取 */
|
||||
export const getUserinfo = () => {
|
||||
return http.request<BaseResult<any>>('get', 'user/private/userinfo');
|
||||
};
|
||||
|
||||
/** 用户管理---为用户分配角色 */
|
||||
export const fetchAssignRolesToUsers = (data: object) => {
|
||||
return http.request<BaseResult<any>>('post', 'userRole/assignRolesToUsers', { data });
|
||||
/** 退出账户 */
|
||||
export const logout = (data?: object) => {
|
||||
return http.request<BaseResult<any>>('post', 'user/private/logout', { data });
|
||||
};
|
||||
|
||||
/** 用户信息---更新用户信息 */
|
||||
export const updateUserinfo = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'user/private/update/userinfo', { data });
|
||||
};
|
||||
|
||||
/** 用户信息---更新用户密码 */
|
||||
export const updateUserPassword = (data: any) => {
|
||||
return http.request<BaseResult<object>>(
|
||||
'put',
|
||||
'user/private/update/password',
|
||||
{ data },
|
||||
{ headers: { 'Content-Type': 'multipart/form-data' } }
|
||||
);
|
||||
};
|
||||
|
|
|
@ -2,28 +2,28 @@ import { http } from '@/api/service/request';
|
|||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 部门管理---获取部门管理列表 */
|
||||
export const fetchGetDeptList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `dept/getDeptList/${data.currentPage}/${data.pageSize}`, {
|
||||
export const getDeptPage = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `dept/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 部门管理---获取所有部门管理列表 */
|
||||
export const fetchGetAllDeptList = () => {
|
||||
return http.request<BaseResult<object>>('get', 'dept/noManage/allDeptList');
|
||||
};
|
||||
|
||||
/** 部门管理---添加部门管理 */
|
||||
export const fetchAddDept = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'dept/addDept', { data });
|
||||
export const createDept = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'dept', { data });
|
||||
};
|
||||
|
||||
/** 部门管理---更新部门管理 */
|
||||
export const fetchUpdateDept = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'dept/updateDept', { data });
|
||||
export const updateDept = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'dept', { data });
|
||||
};
|
||||
|
||||
/** 部门管理---删除部门管理 */
|
||||
export const fetchDeleteDept = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'dept/deleteDept', { data });
|
||||
export const deleteDept = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'dept', { data });
|
||||
};
|
||||
|
||||
/** 部门管理---获取所有部门管理列表 */
|
||||
export const getDeptList = () => {
|
||||
return http.request<BaseResult<object>>('get', 'dept/private/getDeptList');
|
||||
};
|
||||
|
|
|
@ -2,38 +2,40 @@ import { http } from '@/api/service/request';
|
|||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 权限---获取权限列表 */
|
||||
export const fetchGetPowerList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `power/getPowerList/${data.currentPage}/${data.pageSize}`, {
|
||||
export const getPermissionPage = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `permission/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 权限---根据角色id获取权限内容 */
|
||||
export const fetchGetPowerListByRoleId = (data: any) => {
|
||||
return http.request<BaseResult<object>>('get', 'rolePower/noManage/getPowerListByRoleId', { params: data });
|
||||
};
|
||||
|
||||
/** 权限---获取所有权限 */
|
||||
export const fetchGetAllPowers = () => {
|
||||
return http.request<BaseResult<any>>('get', `power/getAllPowers`);
|
||||
};
|
||||
|
||||
/** 权限---添加权限 */
|
||||
export const fetchAddPower = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'power/addPower', { data });
|
||||
export const createPermission = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'permission', { data });
|
||||
};
|
||||
|
||||
/** 权限---更新权限 */
|
||||
export const fetchUpdatePower = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'power/updatePower', { data });
|
||||
};
|
||||
|
||||
/** 权限---更新权限 */
|
||||
export const fetchUpdateBatchByPowerWithParentId = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'power/updateBatchByPowerWithParentId', { data });
|
||||
export const updatePermission = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'permission', { data });
|
||||
};
|
||||
|
||||
/** 权限---删除权限 */
|
||||
export const fetchDeletePower = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'power/deletePower', { data });
|
||||
export const deletePermission = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'permission', { data });
|
||||
};
|
||||
|
||||
/** 权限---获取所有权限 */
|
||||
export const getPermissionList = () => {
|
||||
return http.request<BaseResult<any>>('get', `permission/getPermissionList`);
|
||||
};
|
||||
|
||||
/** 权限---更新权限 */
|
||||
export const updatePermissionListByParentId = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'permission/update/permissionListByParentId', { data });
|
||||
};
|
||||
|
||||
/** 角色和权限---根据角色id获取权限内容 */
|
||||
export const getPowerListByRoleId = (data: any) => {
|
||||
return http.request<BaseResult<object>>('get', 'rolePermission/private/getPermissionListByRoleId', {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
|
|
@ -2,53 +2,57 @@ import { http } from '@/api/service/request';
|
|||
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||
|
||||
/** 角色---获取角色列表 */
|
||||
export const fetchGetRoleList = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `role/getRoleList/${data.currentPage}/${data.pageSize}`, {
|
||||
export const getRolePage = (data: any) => {
|
||||
return http.request<BaseResult<ResultTable>>('get', `role/${data.currentPage}/${data.pageSize}`, {
|
||||
params: data,
|
||||
});
|
||||
};
|
||||
|
||||
/** 角色---获取所有角色 */
|
||||
export const fetchAllRoles = () => {
|
||||
return http.request<BaseResult<any>>('get', `role/noManage/allRoles`);
|
||||
/** 角色---添加角色 */
|
||||
export const crateRole = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'role', { data });
|
||||
};
|
||||
|
||||
/** 角色---根据用户id获取所有角色 */
|
||||
export const fetchGetRoleListByUserId = (data) => {
|
||||
return http.request<BaseResult<any>>('get', `userRole/getRoleListByUserId`, { params: data });
|
||||
/** 角色---更新角色 */
|
||||
export const updateRole = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'role', { data });
|
||||
};
|
||||
|
||||
/** 角色---删除角色 */
|
||||
export const deleteRole = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'role', { data });
|
||||
};
|
||||
|
||||
/** 角色---获取所有角色 */
|
||||
export const getRoleList = () => {
|
||||
return http.request<BaseResult<any>>('get', `role/private/roleList`);
|
||||
};
|
||||
|
||||
/** 角色---使用Excel导出导出角色列表 */
|
||||
export const fetchExportByExcel = () => {
|
||||
return http.request<BaseResult<any>>('get', `role/exportByExcel`, { responseType: 'blob' });
|
||||
export const exportRoleList = () => {
|
||||
return http.request<BaseResult<any>>('get', `role/file/export`, { responseType: 'blob' });
|
||||
};
|
||||
|
||||
/* 角色---使用Excel更新角色列表 */
|
||||
export const fetchUpdateRoleByFile = (data: any) => {
|
||||
export const updateRoleByFile = (data: any) => {
|
||||
return http.request<BaseResult<any>>(
|
||||
'put',
|
||||
`/role/update/roleByFile`,
|
||||
`/role/file/import`,
|
||||
{ data },
|
||||
{ headers: { 'Content-Type': 'multipart/form-data' } }
|
||||
);
|
||||
};
|
||||
|
||||
/** 角色---添加角色 */
|
||||
export const fetchAddRole = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'role/addRole', { data });
|
||||
/** 为用户分配角色---根据用户id获取所有角色 */
|
||||
export const getRoleListByUserId = (data: any) => {
|
||||
return http.request<BaseResult<any>>('get', `userRole/private/getRoleListByUserId`, { params: data });
|
||||
};
|
||||
|
||||
/** 角色---为角色分配权限 */
|
||||
export const fetchAssignPowersToRole = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'rolePower/assignPowersToRole', { data });
|
||||
/** 为用户分配角色---为用户分配角色 */
|
||||
export const createUserRole = (data: object) => {
|
||||
return http.request<BaseResult<any>>('post', 'userRole', { data });
|
||||
};
|
||||
|
||||
/** 角色---更新角色 */
|
||||
export const fetchUpdateRole = (data: any) => {
|
||||
return http.request<BaseResult<object>>('put', 'role/updateRole', { data });
|
||||
};
|
||||
|
||||
/** 角色---删除角色 */
|
||||
export const fetchDeleteRole = (data: any) => {
|
||||
return http.request<BaseResult<object>>('delete', 'role/deleteRole', { data });
|
||||
/** 角色和权限---为角色分配权限 */
|
||||
export const createRolePermission = (data: any) => {
|
||||
return http.request<BaseResult<object>>('post', 'rolePermission', { data });
|
||||
};
|
||||
|
|
|
@ -3,14 +3,14 @@ import type { BaseResult } from '@/api/service/types';
|
|||
|
||||
/** 系统管理-用户路由获取 */
|
||||
export const fetchRouterAsync = () => {
|
||||
return http.request<BaseResult<any>>('get', 'router/noManage/routerAsync');
|
||||
return http.request<BaseResult<any>>('get', 'router/private/routerAsync');
|
||||
};
|
||||
|
||||
/** 上传文件 */
|
||||
export const fetchUploadFile = (data: any) => {
|
||||
export const uploadFile = (data: any) => {
|
||||
return http.request<BaseResult<any>>(
|
||||
'post',
|
||||
'/files/upload',
|
||||
'/files/private/upload',
|
||||
{ data },
|
||||
{ headers: { 'Content-Type': 'multipart/form-data' } }
|
||||
);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { fetchMenuIconList } from '@/api/v1/menu/menuIcon';
|
||||
import { getMenuIconPage } from '@/api/v1/menu/menuIcon';
|
||||
import { FormProps } from './types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
|
||||
|
@ -25,7 +25,7 @@ const onSearch = async () => {
|
|||
const { currentPage, pageSize } = innerForm;
|
||||
|
||||
// 获取数据
|
||||
const baseResult = await fetchMenuIconList({ currentPage, pageSize });
|
||||
const baseResult = await getMenuIconPage({ currentPage, pageSize });
|
||||
if (baseResult.code !== 200) return;
|
||||
const data = baseResult.data;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { fetchGetUserinfoById } from '@/api/v1/system/adminUser';
|
||||
import { loadUserinfoById } from '@/api/v1/system/adminUser';
|
||||
import userAvatarIcon from '@/assets/svg/user_avatar.svg?component';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
|
||||
|
@ -10,9 +10,7 @@ const props = defineProps({
|
|||
const userinfo = ref();
|
||||
const loading = ref(false);
|
||||
|
||||
/**
|
||||
* * 获取用户信息
|
||||
*/
|
||||
/* 获取用户信息 */
|
||||
const getUserInfo = async () => {
|
||||
loading.value = true;
|
||||
// 如果没有传入用户ID直接返回
|
||||
|
@ -22,7 +20,7 @@ const getUserInfo = async () => {
|
|||
}
|
||||
|
||||
// 判断是否是web端
|
||||
const result = await fetchGetUserinfoById({ id: props.userId });
|
||||
const result = await loadUserinfoById({ id: props.userId });
|
||||
if (result.code === 200) {
|
||||
userinfo.value = result.data;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import { Plus } from '@element-plus/icons-vue';
|
|||
import { ElMessage, UploadRawFile, UploadRequestOptions } from 'element-plus';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { SystemEnum } from '@/enums/upload';
|
||||
import { fetchUploadFile } from '@/api/v1/system/system';
|
||||
import { uploadFile } from '@/api/v1/system/system';
|
||||
import ImageLoading from '@/components/Upload/ImageLoading.vue';
|
||||
|
||||
const props = defineProps({
|
||||
|
@ -46,7 +46,7 @@ const onUpload = async (options: UploadRequestOptions) => {
|
|||
const data = { file, type };
|
||||
|
||||
// 上传文件并返回文件地址
|
||||
const result: any = await fetchUploadFile(data);
|
||||
const result: any = await uploadFile(data);
|
||||
imageSrc.value = result.data.url;
|
||||
emits('uploadCallback', result);
|
||||
};
|
||||
|
|
|
@ -31,7 +31,7 @@ export const getPlatformConfig = async (app: App): Promise<undefined> => {
|
|||
app.config.globalProperties.$config = getConfig();
|
||||
return axios({
|
||||
method: 'get',
|
||||
url: `${VITE_BASE_API}/config/noAuth/webConfig`,
|
||||
url: `${VITE_BASE_API}/config/public/webConfig`,
|
||||
})
|
||||
.then(({ data: config }) => {
|
||||
let $config = app.config.globalProperties.$config;
|
||||
|
|
|
@ -51,4 +51,4 @@ export const tableSelectButtonClass = computed(() => [
|
|||
export const UserAvatar =
|
||||
'https://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83eoj0hHXhgJNOTSOFsS4uZs8x1ConecaVOB8eIl115xmJZcT4oCicvia7wMEufibKtTLqiaJeanU2Lpg3w/132';
|
||||
|
||||
export const RequestMethod = ['GET', 'PUT', 'POST', 'DELETE', 'HEAD', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'];
|
||||
export const RequestMethod = ['', 'GET', 'PUT', 'POST', 'DELETE', 'HEAD', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'];
|
||||
|
|
|
@ -35,7 +35,7 @@ const { locale, translation } = useTranslationLang();
|
|||
const i18nTypeStore = userI18nTypeStore();
|
||||
|
||||
onMounted(() => {
|
||||
i18nTypeStore.getI18nTypeList();
|
||||
i18nTypeStore.loadI18nTypeList();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { $t } from '@/plugins/i18n';
|
||||
import { computed, ref } from 'vue';
|
||||
import { fetchGetUserMessageList } from '@/api/v1/message/messageUser';
|
||||
import { throttle } from '@pureadmin/utils';
|
||||
import { ElNotification, ElTag } from 'element-plus';
|
||||
import { getMessageReceivedPageByUser } from '@/api/v1/message/messageReceived';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
|
||||
export interface ListItem {
|
||||
messageId: string;
|
||||
|
@ -37,7 +37,7 @@ export const getLabel = computed(() => (item) => item.name + (item.list.length >
|
|||
|
||||
/** 获取所有消息 */
|
||||
export const getAllMessageList = async () => {
|
||||
const baseResult = await fetchGetUserMessageList(form);
|
||||
const baseResult = await getMessageReceivedPageByUser(form);
|
||||
const datalist = baseResult?.data?.list;
|
||||
|
||||
// 通知消息
|
||||
|
@ -51,7 +51,7 @@ export const getAllMessageList = async () => {
|
|||
description: message.summary,
|
||||
messageType: message.messageType,
|
||||
type: '1',
|
||||
status: message.level,
|
||||
status: message.level ? message.level : 'info',
|
||||
extra: message.extra,
|
||||
})) as ListItem[];
|
||||
|
||||
|
@ -66,7 +66,7 @@ export const getAllMessageList = async () => {
|
|||
title: message.title,
|
||||
datetime: message.createTime,
|
||||
type: '2',
|
||||
status: message.level,
|
||||
status: message.level ? message.level : 'info',
|
||||
extra: message.extra,
|
||||
})) as ListItem[];
|
||||
|
||||
|
@ -81,7 +81,7 @@ export const getAllMessageList = async () => {
|
|||
title: message.title,
|
||||
datetime: message.createTime,
|
||||
type: '3',
|
||||
status: message.level,
|
||||
status: message.level ? message.level : 'info',
|
||||
extra: message.extra,
|
||||
})) as ListItem[];
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ const { t } = useI18n();
|
|||
const messageTypeStore = useMessageTypeStore();
|
||||
|
||||
onMounted(() => {
|
||||
messageTypeStore.getAllMessageTypeList();
|
||||
messageTypeStore.loadMessageTypeList();
|
||||
computedNoticesNum();
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -107,7 +107,7 @@ useResizeObserver(appWrapperRef, (entries) => {
|
|||
onMounted(() => {
|
||||
if (isMobile) toggle('mobile', false);
|
||||
// 获取用户信息
|
||||
userStore.getUserinfo();
|
||||
userStore.loadUserinfo();
|
||||
});
|
||||
|
||||
onBeforeMount(() => {
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
addEmailTemplate,
|
||||
fetchDeleteEmailTemplate,
|
||||
fetchUpdateEmailTemplate,
|
||||
createEmailTemplate,
|
||||
deleteEmailTemplate,
|
||||
getEmailTemplatePage,
|
||||
getEmailTypeList,
|
||||
updateEmailTemplate,
|
||||
} from '@/api/v1/email/emailTemplate';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
import { storePagination } from '@/store/useStorePagination';
|
||||
import { fetchGetAllMailboxConfigurationUsers } from '@/api/v1/email/emailUsers';
|
||||
|
||||
/**
|
||||
* 邮件模板表 Store
|
||||
|
@ -19,8 +18,6 @@ export const useEmailTemplateStore = defineStore('emailTemplateStore', {
|
|||
return {
|
||||
// 邮件模板表列表
|
||||
datalist: [],
|
||||
// 邮件模板用户列表
|
||||
emailUserList: [],
|
||||
// 邮件类型枚举
|
||||
allEmailTypes: [],
|
||||
// 查询表单
|
||||
|
@ -45,13 +42,7 @@ export const useEmailTemplateStore = defineStore('emailTemplateStore', {
|
|||
loading: false,
|
||||
};
|
||||
},
|
||||
getters: {
|
||||
getMailboxConfigurationUser(state) {
|
||||
const map = {};
|
||||
state.emailUserList.forEach((user) => (map[user.value] = user.key));
|
||||
return map;
|
||||
},
|
||||
},
|
||||
getters: {},
|
||||
actions: {
|
||||
/** 获取邮件模板表 */
|
||||
async fetchEmailTemplatePage() {
|
||||
|
@ -69,14 +60,6 @@ export const useEmailTemplateStore = defineStore('emailTemplateStore', {
|
|||
return pagination(result);
|
||||
},
|
||||
|
||||
/** 获取所有邮箱配置用户 */
|
||||
async getAllMailboxConfigurationUsers() {
|
||||
const result = await fetchGetAllMailboxConfigurationUsers();
|
||||
if (result.code !== 200) return;
|
||||
|
||||
this.emailUserList = result.data;
|
||||
},
|
||||
|
||||
/** 获取模板类型字段 */
|
||||
async loadEmailTypeList() {
|
||||
const result = await getEmailTypeList();
|
||||
|
@ -86,19 +69,19 @@ export const useEmailTemplateStore = defineStore('emailTemplateStore', {
|
|||
|
||||
/** 添加邮件模板表 */
|
||||
async addEmailTemplate(data: any) {
|
||||
const result = await addEmailTemplate(data);
|
||||
const result = await createEmailTemplate(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 修改邮件模板表 */
|
||||
async updateEmailTemplate(data: any) {
|
||||
const result = await fetchUpdateEmailTemplate(data);
|
||||
async editEmailTemplate(data: any) {
|
||||
const result = await updateEmailTemplate(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除邮件模板表 */
|
||||
async deleteEmailTemplate(data: any) {
|
||||
const result = await fetchDeleteEmailTemplate(data);
|
||||
async removeEmailTemplate(data: any) {
|
||||
const result = await deleteEmailTemplate(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
fetchAddEmailUsers,
|
||||
fetchDeleteEmailUsers,
|
||||
fetchGetEmailUsersList,
|
||||
fetchUpdateEmailUsers,
|
||||
fetchUpdateEmailUserStatus,
|
||||
createEmailUsers,
|
||||
deleteEmailUsers,
|
||||
getEmailUserList,
|
||||
getEmailUserPage,
|
||||
updateEmailUsers,
|
||||
} from '@/api/v1/email/emailUsers';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
|
@ -18,6 +18,8 @@ export const useEmailUsersStore = defineStore('emailUsersStore', {
|
|||
return {
|
||||
// 邮箱用户发送配置列表
|
||||
datalist: [],
|
||||
// 邮件模板用户列表
|
||||
emailUserList: [],
|
||||
// 查询表单
|
||||
form: {
|
||||
// 邮箱
|
||||
|
@ -42,12 +44,16 @@ export const useEmailUsersStore = defineStore('emailUsersStore', {
|
|||
loading: false,
|
||||
};
|
||||
},
|
||||
getters: {},
|
||||
getters: {
|
||||
getMailboxConfigurationUser(state) {
|
||||
const map = {};
|
||||
state.emailUserList.forEach((user) => (map[user.value] = user.key));
|
||||
return map;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
/**
|
||||
* * 获取邮箱用户发送配置
|
||||
*/
|
||||
async getEmailUsersList() {
|
||||
/* 获取邮箱用户发送配置 */
|
||||
async fetchEmailUserPage() {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
|
@ -55,34 +61,36 @@ export const useEmailUsersStore = defineStore('emailUsersStore', {
|
|||
delete data.background;
|
||||
|
||||
// 获取邮箱用户发送配置列表
|
||||
const result = await fetchGetEmailUsersList(data);
|
||||
const result = await getEmailUserPage(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
return pagination(result);
|
||||
},
|
||||
|
||||
/** 获取所有邮箱配置用户 */
|
||||
async loadEmailUserList() {
|
||||
const result = await getEmailUserList();
|
||||
if (result.code !== 200) return;
|
||||
|
||||
this.emailUserList = result.data;
|
||||
},
|
||||
|
||||
/** 添加邮箱用户发送配置 */
|
||||
async addEmailUsers(data: any) {
|
||||
const result = await fetchAddEmailUsers(data);
|
||||
const result = await createEmailUsers(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 修改邮箱用户发送配置 */
|
||||
async updateEmailUsers(data: any) {
|
||||
const result = await fetchUpdateEmailUsers(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 更新邮箱用户状态 */
|
||||
async updateEmailUserStatus(data: any) {
|
||||
const result = await fetchUpdateEmailUserStatus(data);
|
||||
async editEmailUsers(data: any) {
|
||||
const result = await updateEmailUsers(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除邮箱用户发送配置 */
|
||||
async deleteEmailUsers(data: any) {
|
||||
const result = await fetchDeleteEmailUsers(data);
|
||||
async removeEmailUsers(data: any) {
|
||||
const result = await deleteEmailUsers(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
fetchAddMenuIcon,
|
||||
fetchDeleteMenuIcon,
|
||||
fetchGetIconNameList,
|
||||
fetchMenuIconList,
|
||||
fetchUpdateMenuIcon,
|
||||
createMenuIcon,
|
||||
deleteMenuIcon,
|
||||
getIconNameListByIconName,
|
||||
getMenuIconPage,
|
||||
updateMenuIcon,
|
||||
} from '@/api/v1/menu/menuIcon';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
|
@ -41,12 +41,12 @@ export const useMenuIconStore = defineStore('menuIconStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 获取系统菜单图标 */
|
||||
async getMenuIconList() {
|
||||
async fetchMenuIconListPage() {
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
delete data.total;
|
||||
delete data.background;
|
||||
const response = await fetchMenuIconList(data);
|
||||
const response = await getMenuIconPage(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
|
@ -54,26 +54,26 @@ export const useMenuIconStore = defineStore('menuIconStore', {
|
|||
},
|
||||
|
||||
/** 根据iconName搜索menuIcon */
|
||||
async getIconNameList(data: any) {
|
||||
const result = await fetchGetIconNameList(data);
|
||||
async getIconNameListByIconName(data: any) {
|
||||
const result = await getIconNameListByIconName(data);
|
||||
this.iconNameList = result.data;
|
||||
},
|
||||
|
||||
/** 添加系统菜单图标 */
|
||||
async addMenuIcon(data: any) {
|
||||
const result = await fetchAddMenuIcon(data);
|
||||
const result = await createMenuIcon(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 修改系统菜单图标 */
|
||||
async updateMenuIcon(data: any) {
|
||||
const result = await fetchUpdateMenuIcon(data);
|
||||
async editMenuIcon(data: any) {
|
||||
const result = await updateMenuIcon(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除系统菜单图标 */
|
||||
async deleteMenuIcon(data: any) {
|
||||
const result = await fetchDeleteMenuIcon(data);
|
||||
async removeMenuIcon(data: any) {
|
||||
const result = await deleteMenuIcon(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import {
|
||||
fetchAddI18n,
|
||||
fetchDeleteI18n,
|
||||
fetchDownloadI18nSetting,
|
||||
fetchGetI18n,
|
||||
fetchGetI18nList,
|
||||
fetchUpdateI18n,
|
||||
updateI18nByFile,
|
||||
createI18n,
|
||||
deleteI18n,
|
||||
downloadI18n,
|
||||
getI18nMap,
|
||||
getI18nPage,
|
||||
updateI18n,
|
||||
uploadI18nFile,
|
||||
} from '@/api/v1/i18n';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storePagination } from '@/store/useStorePagination';
|
||||
|
@ -39,8 +39,8 @@ export const userI18nStore = defineStore('i18nStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 获取多语言 */
|
||||
async fetchI18n() {
|
||||
const result = await fetchGetI18n();
|
||||
async loadI18nMap() {
|
||||
const result = await getI18nMap();
|
||||
|
||||
if (result.code === 200) {
|
||||
localStorage.removeItem('i18nStore');
|
||||
|
@ -54,47 +54,48 @@ export const userI18nStore = defineStore('i18nStore', {
|
|||
}
|
||||
},
|
||||
|
||||
/* 下载多语言配置 */
|
||||
async downloadI18nSetting(params: object) {
|
||||
const result = await fetchDownloadI18nSetting(params);
|
||||
|
||||
downloadBlob(result, 'i18n.zip');
|
||||
},
|
||||
|
||||
/** 获取多语言列表 */
|
||||
async getI18nMangeList() {
|
||||
async fetchI18nPage() {
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
delete data.total;
|
||||
delete data.background;
|
||||
const result = await fetchGetI18nList(data);
|
||||
const result = await getI18nPage(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
return pagination(result);
|
||||
},
|
||||
|
||||
/* 下载多语言配置 */
|
||||
async downloadI18nFile(params: object) {
|
||||
const result = await downloadI18n(params);
|
||||
|
||||
downloadBlob(result, 'i18n.zip');
|
||||
},
|
||||
|
||||
/** 添加多语言 */
|
||||
async addI18n(data: any) {
|
||||
const result = await fetchAddI18n(data);
|
||||
const result = await createI18n(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/* 用文件更新多语言 */
|
||||
async updateI18nByFile(data: any) {
|
||||
const result = await updateI18nByFile(data);
|
||||
async editI18nByFile(data: any) {
|
||||
console.log(data);
|
||||
const result = await uploadI18nFile(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 更新多语言 */
|
||||
async updateI18n(data: any) {
|
||||
const result = await fetchUpdateI18n(data);
|
||||
async editI18n(data: any) {
|
||||
const result = await updateI18n(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除多语言 */
|
||||
async deleteI18n(data: any) {
|
||||
const result = await fetchDeleteI18n(data);
|
||||
async removeI18n(data: any) {
|
||||
const result = await deleteI18n(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import { fetchAddI18nType, fetchDeleteI18nType, fetchGetI18nTypeList, fetchUpdateI18nType } from '@/api/v1/i18n';
|
||||
import { createI18Type, deleteI18nType, getI18nTypeList, updateI18nType } from '@/api/v1/i18n';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
|
||||
|
@ -28,11 +28,9 @@ export const userI18nTypeStore = defineStore('i18nTypeStore', {
|
|||
},
|
||||
},
|
||||
actions: {
|
||||
/**
|
||||
* * 获取多语言类型
|
||||
*/
|
||||
async getI18nTypeList() {
|
||||
const result = await fetchGetI18nTypeList(this.form);
|
||||
/* 获取多语言类型 */
|
||||
async loadI18nTypeList() {
|
||||
const result = await getI18nTypeList(this.form);
|
||||
if (result.code === 200) {
|
||||
this.datalist = result.data;
|
||||
return true;
|
||||
|
@ -40,27 +38,21 @@ export const userI18nTypeStore = defineStore('i18nTypeStore', {
|
|||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* * 添加多语言类型
|
||||
*/
|
||||
/* 添加多语言类型 */
|
||||
async addI18nType(data: any) {
|
||||
const result = await fetchAddI18nType(data);
|
||||
const result = await createI18Type(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/**
|
||||
* * 修改多语言类型
|
||||
*/
|
||||
async updateI18nType(data: any) {
|
||||
const result = await fetchUpdateI18nType(data);
|
||||
/* 修改多语言类型 */
|
||||
async editI18nType(data: any) {
|
||||
const result = await updateI18nType(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/**
|
||||
* * 删除多语言类型
|
||||
*/
|
||||
async deleteI18nType(data: any) {
|
||||
const result = await fetchDeleteI18nType(data);
|
||||
/* 删除多语言类型 */
|
||||
async removeI18nType(data: any) {
|
||||
const result = await deleteI18nType(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
fetchDeleteMessageReceivedByIds,
|
||||
fetchGetMessageReceivedList,
|
||||
fetchUpdateMarkMessageReceived,
|
||||
deleteMessageReceivedByAdmin,
|
||||
getMessageReceivedPage,
|
||||
updateMessageReceivedByAdmin,
|
||||
} from '@/api/v1/message/messageReceived';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
|
@ -47,7 +47,7 @@ export const useMessageReceivedStore = defineStore('messageReceivedStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 管理员操作用户消息---获取系统管理消息列表 */
|
||||
async getMessageReceivedList() {
|
||||
async fetchMessageReceivedPage() {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
|
@ -55,7 +55,7 @@ export const useMessageReceivedStore = defineStore('messageReceivedStore', {
|
|||
delete data.background;
|
||||
|
||||
// 获取系统消息列表
|
||||
const result = await fetchGetMessageReceivedList(data);
|
||||
const result = await getMessageReceivedPage(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
|
@ -63,14 +63,14 @@ export const useMessageReceivedStore = defineStore('messageReceivedStore', {
|
|||
},
|
||||
|
||||
/** 管理员操作用户消息---将用户消息标为已读 */
|
||||
async updateMarkMessageReceived(data: any) {
|
||||
const result = await fetchUpdateMarkMessageReceived(data);
|
||||
async editMessageReceived(data: any) {
|
||||
const result = await updateMessageReceivedByAdmin(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除系统消息 */
|
||||
async deleteMessageReceivedByIds(data: any) {
|
||||
const result = await fetchDeleteMessageReceivedByIds(data);
|
||||
async removeMessageReceivedByAdmin(data: any) {
|
||||
const result = await deleteMessageReceivedByAdmin(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import {
|
||||
fetchAddMessage,
|
||||
fetchDeleteMessage,
|
||||
fetchGetMessageList,
|
||||
fetchGetReceivedUserinfoByMessageId,
|
||||
fetchUpdateMessage,
|
||||
createMessage,
|
||||
deleteMessage,
|
||||
getMessagePage,
|
||||
getReceivedUserinfoByMessageId,
|
||||
updateMessage,
|
||||
} from '@/api/v1/message/messageSend';
|
||||
import { storePagination } from '@/store/useStorePagination';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
|
@ -48,7 +48,7 @@ export const useMessageSendStore = defineStore('messageSendStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 获取系统消息 */
|
||||
async getMessageList() {
|
||||
async fetchMessagePage() {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
|
@ -56,7 +56,7 @@ export const useMessageSendStore = defineStore('messageSendStore', {
|
|||
delete data.background;
|
||||
|
||||
// 获取系统消息列表
|
||||
const result = await fetchGetMessageList(data);
|
||||
const result = await getMessagePage(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
|
@ -64,8 +64,8 @@ export const useMessageSendStore = defineStore('messageSendStore', {
|
|||
},
|
||||
|
||||
/** 根据消息id获取接收人信息 */
|
||||
async getReceivedUserinfoByMessageId(data: any) {
|
||||
const result = await fetchGetReceivedUserinfoByMessageId(data);
|
||||
async loadReceivedUserinfoByMessageId(data: any) {
|
||||
const result = await getReceivedUserinfoByMessageId(data);
|
||||
if (result.code === 200) {
|
||||
this.receivedUserinfoList = result.data;
|
||||
}
|
||||
|
@ -73,19 +73,19 @@ export const useMessageSendStore = defineStore('messageSendStore', {
|
|||
|
||||
/** 添加系统消息 */
|
||||
async addMessage(data: any) {
|
||||
const result = await fetchAddMessage(data);
|
||||
const result = await createMessage(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 修改系统消息 */
|
||||
async updateMessage(data: any) {
|
||||
const result = await fetchUpdateMessage(data);
|
||||
async editMessage(data: any) {
|
||||
const result = await updateMessage(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除系统消息 */
|
||||
async deleteMessage(data: any) {
|
||||
const result = await fetchDeleteMessage(data);
|
||||
async removeMessage(data: any) {
|
||||
const result = await deleteMessage(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
fetchAddMessageType,
|
||||
fetchDeleteMessageType,
|
||||
fetchGetAllMessageTypes,
|
||||
fetchGetMessageTypeList,
|
||||
fetchUpdateMessageType,
|
||||
createMessageType,
|
||||
deleteMessageType,
|
||||
getMessageTypeList,
|
||||
getMessageTypePage,
|
||||
updateMessageType,
|
||||
} from '@/api/v1/message/messageType';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
|
@ -47,7 +47,7 @@ export const useMessageTypeStore = defineStore('messageTypeStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 获取系统消息类型 */
|
||||
async getMessageTypeList() {
|
||||
async fetchMessageTypePage() {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
|
@ -55,7 +55,7 @@ export const useMessageTypeStore = defineStore('messageTypeStore', {
|
|||
delete data.background;
|
||||
|
||||
// 获取系统消息类型列表
|
||||
const result = await fetchGetMessageTypeList(data);
|
||||
const result = await getMessageTypePage(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
|
@ -63,26 +63,26 @@ export const useMessageTypeStore = defineStore('messageTypeStore', {
|
|||
},
|
||||
|
||||
/** 所有系统类型 */
|
||||
async getAllMessageTypeList() {
|
||||
const baseResult = await fetchGetAllMessageTypes();
|
||||
async loadMessageTypeList() {
|
||||
const baseResult = await getMessageTypeList();
|
||||
this.allMessageTypeList = baseResult.data;
|
||||
},
|
||||
|
||||
/** 添加系统消息类型 */
|
||||
async addMessageType(data: any) {
|
||||
const result = await fetchAddMessageType(data);
|
||||
const result = await createMessageType(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 修改系统消息类型 */
|
||||
async updateMessageType(data: any) {
|
||||
const result = await fetchUpdateMessageType(data);
|
||||
async editMessageType(data: any) {
|
||||
const result = await updateMessageType(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除系统消息类型 */
|
||||
async deleteMessageType(data: any) {
|
||||
const result = await fetchDeleteMessageType(data);
|
||||
async removeMessageType(data: any) {
|
||||
const result = await deleteMessageType(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
fetchDeleteUserMessageByIds,
|
||||
fetchGetMessageDetailById,
|
||||
fetchGetUserMessageList,
|
||||
fetchUpdateUserMarkAsRead,
|
||||
} from '@/api/v1/message/messageUser';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storePagination } from '@/store/useStorePagination';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
import { decode } from 'js-base64';
|
||||
import {
|
||||
deleteMessageReceivedByUser,
|
||||
getMessageReceivedPageByUser,
|
||||
updateMessageByUser,
|
||||
} from '@/api/v1/message/messageReceived';
|
||||
import { getMessageDetailById } from '@/api/v1/message/messageSend';
|
||||
|
||||
/**
|
||||
* 系统消息 Store
|
||||
|
@ -43,7 +43,7 @@ export const useMessageUserStore = defineStore('messageUserStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 获取系统消息 */
|
||||
async getMessageList() {
|
||||
async fetchMessageReceivedPageByUser() {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
|
@ -51,7 +51,7 @@ export const useMessageUserStore = defineStore('messageUserStore', {
|
|||
delete data.background;
|
||||
|
||||
// 获取系统消息列表
|
||||
const result = await fetchGetUserMessageList(data);
|
||||
const result = await getMessageReceivedPageByUser(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
|
@ -59,8 +59,8 @@ export const useMessageUserStore = defineStore('messageUserStore', {
|
|||
},
|
||||
|
||||
/** 根据消息id获取消息详情 */
|
||||
async getMessageDetailById(id: string) {
|
||||
const result = await fetchGetMessageDetailById({ id });
|
||||
async loadMessageDetailById(id: string) {
|
||||
const result = await getMessageDetailById({ id });
|
||||
|
||||
if (result.code === 200) {
|
||||
this.messageDetail = result.data;
|
||||
|
@ -71,14 +71,14 @@ export const useMessageUserStore = defineStore('messageUserStore', {
|
|||
},
|
||||
|
||||
/** 用户将消息标为已读 */
|
||||
async updateUserMarkAsRead(data: any) {
|
||||
const result = await fetchUpdateUserMarkAsRead(data);
|
||||
async editeMessageByUser(data: any) {
|
||||
const result = await updateMessageByUser(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 用户删除系统消息 */
|
||||
async deleteUserMessageByIds(data: any) {
|
||||
const result = await fetchDeleteUserMessageByIds(data);
|
||||
async removeMessageReceivedByUser(data: any) {
|
||||
const result = await deleteMessageReceivedByUser(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
deleteFiles,
|
||||
fetchAddFiles,
|
||||
fetchDeleteFiles,
|
||||
fetchGetAllFilesStoragePath,
|
||||
fetchGetAllMediaTypes,
|
||||
fetchGetFilesList,
|
||||
fetchUpdateFiles,
|
||||
getFilesPage,
|
||||
getFilesStoragePath,
|
||||
getMediaTypeList,
|
||||
updateFiles,
|
||||
} from '@/api/v1/files';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
|
@ -48,7 +48,7 @@ export const useFilesStore = defineStore('filesStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 获取系统文件表 */
|
||||
async getFilesList() {
|
||||
async fetchFilesPage() {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
|
@ -56,29 +56,13 @@ export const useFilesStore = defineStore('filesStore', {
|
|||
delete data.background;
|
||||
|
||||
// 获取系统文件表列表
|
||||
const result = await fetchGetFilesList(data);
|
||||
const result = await getFilesPage(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
return pagination(result);
|
||||
},
|
||||
|
||||
/** 获取所有文件类型 */
|
||||
async getAllMediaTypes() {
|
||||
const result = await fetchGetAllMediaTypes();
|
||||
if (result.code === 200) {
|
||||
this.allMediaTypes = result.data;
|
||||
}
|
||||
},
|
||||
|
||||
/** 获取所有文件类型 */
|
||||
async getAllFilesStoragePath() {
|
||||
const result = await fetchGetAllFilesStoragePath();
|
||||
if (result.code === 200) {
|
||||
this.allFilesStoragePath = result.data;
|
||||
}
|
||||
},
|
||||
|
||||
/** 添加系统文件表 */
|
||||
async addFiles(data: any) {
|
||||
const result = await fetchAddFiles(data);
|
||||
|
@ -86,15 +70,31 @@ export const useFilesStore = defineStore('filesStore', {
|
|||
},
|
||||
|
||||
/** 修改系统文件表 */
|
||||
async updateFiles(data: any) {
|
||||
const result = await fetchUpdateFiles(data);
|
||||
async editFiles(data: any) {
|
||||
const result = await updateFiles(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除系统文件表 */
|
||||
async deleteFiles(data: any) {
|
||||
const result = await fetchDeleteFiles(data);
|
||||
async removeFiles(data: any) {
|
||||
const result = await deleteFiles(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 获取所有文件类型 */
|
||||
async loadMediaTypeList() {
|
||||
const result = await getMediaTypeList();
|
||||
if (result.code === 200) {
|
||||
this.allMediaTypes = result.data;
|
||||
}
|
||||
},
|
||||
|
||||
/** 获取所有文件类型 */
|
||||
async loadFilesStoragePath() {
|
||||
const result = await getFilesStoragePath();
|
||||
if (result.code === 200) {
|
||||
this.allFilesStoragePath = result.data;
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import { fetchDeleteQuartzExecuteLog, fetchGetQuartzExecuteLogList } from '@/api/v1/log/quartzExecuteLog';
|
||||
import { deleteScheduleExecuteLog, getScheduleExecuteLogPage } from '@/api/v1/log/scheduleExecuteLog';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
import { storePagination } from '@/store/useStorePagination';
|
||||
|
@ -41,7 +41,7 @@ export const useQuartzExecuteLogStore = defineStore('quartzExecuteLogStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 获取调度任务执行日志 */
|
||||
async getQuartzExecuteLogList() {
|
||||
async fetchScheduleExecuteLogPage() {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
|
@ -49,7 +49,7 @@ export const useQuartzExecuteLogStore = defineStore('quartzExecuteLogStore', {
|
|||
delete data.background;
|
||||
|
||||
// 获取调度任务执行日志列表
|
||||
const result = await fetchGetQuartzExecuteLogList(data);
|
||||
const result = await getScheduleExecuteLogPage(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
|
@ -57,8 +57,8 @@ export const useQuartzExecuteLogStore = defineStore('quartzExecuteLogStore', {
|
|||
},
|
||||
|
||||
/** 删除调度任务执行日志 */
|
||||
async deleteQuartzExecuteLog(data: any) {
|
||||
const result = await fetchDeleteQuartzExecuteLog(data);
|
||||
async removeScheduleExecuteLog(data: any) {
|
||||
const result = await deleteScheduleExecuteLog(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
fetchDeleteUserLoginLog,
|
||||
fetchGetUserLoginLogList,
|
||||
fetchGetUserLoginLogListByLocalUser,
|
||||
} from '@/api/v1/log/userLoginLog';
|
||||
import { deleteUserLoginLog, getUserLoginLogPageByAdmin, getUserLoginLogPageByUser } from '@/api/v1/log/userLoginLog';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
import { storePagination } from '@/store/useStorePagination';
|
||||
|
@ -45,7 +41,7 @@ export const useUserLoginLogStore = defineStore('userLoginLogStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 获取用户登录日志 */
|
||||
async getUserLoginLogList() {
|
||||
async fetchUserLoginLogPageByAdmin() {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
|
@ -53,7 +49,7 @@ export const useUserLoginLogStore = defineStore('userLoginLogStore', {
|
|||
delete data.background;
|
||||
|
||||
// 获取用户登录日志列表
|
||||
const result = await fetchGetUserLoginLogList(data);
|
||||
const result = await getUserLoginLogPageByAdmin(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
|
@ -61,16 +57,16 @@ export const useUserLoginLogStore = defineStore('userLoginLogStore', {
|
|||
},
|
||||
|
||||
/** 分页查询根据用户Id用户登录日志内容 */
|
||||
async getUserLoginLogListByLocalUser(data: any) {
|
||||
const baseResult = await fetchGetUserLoginLogListByLocalUser(data);
|
||||
async fetchUserLoginLogPageByUser(data: any) {
|
||||
const baseResult = await getUserLoginLogPageByUser(data);
|
||||
if (baseResult.code === 200) {
|
||||
return baseResult.data;
|
||||
}
|
||||
},
|
||||
|
||||
/** 删除用户登录日志 */
|
||||
async deleteUserLoginLog(data: any) {
|
||||
const result = await fetchDeleteUserLoginLog(data);
|
||||
async removeUserLoginLog(data: any) {
|
||||
const result = await deleteUserLoginLog(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
fetchAddSchedulers,
|
||||
fetchDeleteSchedulers,
|
||||
fetchGetAllScheduleJobList,
|
||||
fetchGetSchedulersList,
|
||||
fetchPauseSchedulers,
|
||||
fetchResumeSchedulers,
|
||||
fetchUpdateSchedulers,
|
||||
createSchedulers,
|
||||
deleteSchedulers,
|
||||
getScheduleJobList,
|
||||
getSchedulersPage,
|
||||
updateSchedulers,
|
||||
updateSchedulersByPause,
|
||||
updateSchedulersByResume,
|
||||
} from '@/api/v1/schedulers/schedulers';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
|
@ -53,7 +53,7 @@ export const useSchedulersStore = defineStore('schedulersStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 获取Schedulers视图 */
|
||||
async getSchedulersList() {
|
||||
async fetchSchedulersPage() {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
|
@ -61,7 +61,7 @@ export const useSchedulersStore = defineStore('schedulersStore', {
|
|||
delete data.background;
|
||||
|
||||
// 获取Schedulers视图列表
|
||||
const result = await fetchGetSchedulersList(data);
|
||||
const result = await getSchedulersPage(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
|
@ -69,39 +69,39 @@ export const useSchedulersStore = defineStore('schedulersStore', {
|
|||
},
|
||||
|
||||
/** 获取所有可用调度任务 */
|
||||
async getAllScheduleJobList() {
|
||||
const result = await fetchGetAllScheduleJobList();
|
||||
async loadScheduleJobList() {
|
||||
const result = await getScheduleJobList();
|
||||
if (result.code !== 200) return;
|
||||
this.allScheduleJobList = result.data;
|
||||
},
|
||||
|
||||
/** 添加Schedulers视图 */
|
||||
async addSchedulers(data: any) {
|
||||
const result = await fetchAddSchedulers(data);
|
||||
const result = await createSchedulers(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 修改Schedulers视图 */
|
||||
async updateSchedulers(data: any) {
|
||||
const result = await fetchUpdateSchedulers(data);
|
||||
async editSchedulers(data: any) {
|
||||
const result = await updateSchedulers(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除Schedulers视图 */
|
||||
async deleteSchedulers(data: any) {
|
||||
const result = await fetchDeleteSchedulers(data);
|
||||
async removeSchedulers(data: any) {
|
||||
const result = await deleteSchedulers(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 暂停任务 */
|
||||
async pauseSchedulers(data: any) {
|
||||
const result = await fetchPauseSchedulers(data);
|
||||
const result = await updateSchedulersByPause(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 恢复任务 */
|
||||
async resumeSchedulers(data: any) {
|
||||
const result = await fetchResumeSchedulers(data);
|
||||
const result = await updateSchedulersByResume(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
fetchAddSchedulersGroup,
|
||||
fetchDeleteSchedulersGroup,
|
||||
fetchGetAllSchedulersGroup,
|
||||
fetchGetSchedulersGroupList,
|
||||
fetchUpdateSchedulersGroup,
|
||||
createSchedulersGroup,
|
||||
deleteSchedulersGroup,
|
||||
getSchedulersGroupList,
|
||||
getSchedulersGroupPage,
|
||||
updateSchedulersGroup,
|
||||
} from '@/api/v1/schedulers/schedulersGroup';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
|
@ -41,7 +41,7 @@ export const useSchedulersGroupStore = defineStore('schedulersGroupStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 获取任务调度分组 */
|
||||
async getSchedulersGroupList() {
|
||||
async fetchSchedulersGroupPage() {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
|
@ -49,7 +49,7 @@ export const useSchedulersGroupStore = defineStore('schedulersGroupStore', {
|
|||
delete data.background;
|
||||
|
||||
// 获取任务调度分组列表
|
||||
const result = await fetchGetSchedulersGroupList(data);
|
||||
const result = await getSchedulersGroupPage(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
|
@ -57,27 +57,27 @@ export const useSchedulersGroupStore = defineStore('schedulersGroupStore', {
|
|||
},
|
||||
|
||||
/** 获取所有任务调度分组 */
|
||||
async getAllSchedulersGroup() {
|
||||
const result = await fetchGetAllSchedulersGroup();
|
||||
async loadSchedulersGroupList() {
|
||||
const result = await getSchedulersGroupList();
|
||||
if (result.code !== 200) return;
|
||||
this.allSchedulersGroup = result.data;
|
||||
},
|
||||
|
||||
/** 添加任务调度分组 */
|
||||
async addSchedulersGroup(data: any) {
|
||||
const result = await fetchAddSchedulersGroup(data);
|
||||
const result = await createSchedulersGroup(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 修改任务调度分组 */
|
||||
async updateSchedulersGroup(data: any) {
|
||||
const result = await fetchUpdateSchedulersGroup(data);
|
||||
async editSchedulersGroup(data: any) {
|
||||
const result = await updateSchedulersGroup(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除任务调度分组 */
|
||||
async deleteSchedulersGroup(data: any) {
|
||||
const result = await fetchDeleteSchedulersGroup(data);
|
||||
async removeSchedulersGroup(data: any) {
|
||||
const result = await deleteSchedulersGroup(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -3,16 +3,14 @@ import { pageSizes } from '@/enums/baseConstant';
|
|||
import { storeMessage } from '@/utils/message';
|
||||
import { storePagination } from '@/store/useStorePagination';
|
||||
import {
|
||||
fetchAddAdminUser,
|
||||
fetchDeleteAdminUser,
|
||||
fetchForcedOffline,
|
||||
fetchGetAdminUserList,
|
||||
fetchQueryUser,
|
||||
fetchUpdateAdminUser,
|
||||
fetchUpdateAdminUserByLocalUser,
|
||||
fetchUpdateUserPasswordByAdmin,
|
||||
fetchUpdateUserPasswordByLocalUser,
|
||||
fetchUpdateUserStatusByAdmin,
|
||||
createUserByAdmin,
|
||||
deleteUserByAdmin,
|
||||
forcedOfflineByAdmin,
|
||||
getUserListByKeyword,
|
||||
getUserPageByAdmin,
|
||||
updateUserByAdmin,
|
||||
updateUserinfo,
|
||||
updateUserPassword,
|
||||
} from '@/api/v1/system/adminUser';
|
||||
|
||||
/**
|
||||
|
@ -55,8 +53,12 @@ export const useAdminUserStore = defineStore('adminUserStore', {
|
|||
},
|
||||
getters: {},
|
||||
actions: {
|
||||
// -----------------------------------------
|
||||
// 管理用户CURD
|
||||
// -----------------------------------------
|
||||
|
||||
/** 获取用户信息 */
|
||||
getAdminUserList: async function () {
|
||||
fetchUserPageByAdmin: async function () {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
|
@ -64,65 +66,57 @@ export const useAdminUserStore = defineStore('adminUserStore', {
|
|||
delete data.background;
|
||||
|
||||
// 获取用户信息列表
|
||||
const result = await fetchGetAdminUserList(data);
|
||||
const result = await getUserPageByAdmin(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
return pagination(result);
|
||||
},
|
||||
|
||||
/** 查询用户 */
|
||||
async queryUser(data: any) {
|
||||
const result = await fetchQueryUser(data);
|
||||
if (result.code !== 200) return [];
|
||||
return result.data;
|
||||
/** 修改用户信息 */
|
||||
async updateUserByAdmin(data: any) {
|
||||
const result = await updateUserByAdmin(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 添加用户信息 */
|
||||
async addAdminUser(data: any) {
|
||||
const result = await fetchAddAdminUser(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 修改本地用户信息 */
|
||||
async updateAdminUserByLocalUser(data: any) {
|
||||
const result = await fetchUpdateAdminUserByLocalUser(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 修改用户信息 */
|
||||
async updateAdminUser(data: any) {
|
||||
const result = await fetchUpdateAdminUser(data);
|
||||
async addUserByAdmin(data: any) {
|
||||
const result = await createUserByAdmin(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除用户信息 */
|
||||
async deleteAdminUser(data: any) {
|
||||
const result = await fetchDeleteAdminUser(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 更新本地用户密码 */
|
||||
async updateUserPasswordByLocalUser(data: any) {
|
||||
const result: any = await fetchUpdateUserPasswordByLocalUser(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 更新用户密码 */
|
||||
async updateAdminUserPasswordByManager(data: any) {
|
||||
const result: any = await fetchUpdateUserPasswordByAdmin(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 修改用户状态 */
|
||||
async updateUserStatusByAdmin(data: any) {
|
||||
const result = await fetchUpdateUserStatusByAdmin(data);
|
||||
async removeUserByAdmin(data: any) {
|
||||
const result = await deleteUserByAdmin(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 强制用户下线 */
|
||||
async forcedOffline(data: any) {
|
||||
const result = await fetchForcedOffline(data);
|
||||
const result = await forcedOfflineByAdmin(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 查询用户 */
|
||||
async queryUser(data: any) {
|
||||
const result = await getUserListByKeyword(data);
|
||||
if (result.code !== 200) return [];
|
||||
return result.data;
|
||||
},
|
||||
|
||||
// -----------------------------------------
|
||||
// 普通用户
|
||||
// -----------------------------------------
|
||||
|
||||
/** 修改本地用户信息 */
|
||||
async editUserinfo(data: any) {
|
||||
const result = await updateUserinfo(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 更新本地用户密码 */
|
||||
async editUserPassword(data: any) {
|
||||
const result: any = await updateUserPassword(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
fetchAddDept,
|
||||
fetchDeleteDept,
|
||||
fetchGetAllDeptList,
|
||||
fetchGetDeptList,
|
||||
fetchUpdateDept,
|
||||
} from '@/api/v1/system/dept';
|
||||
import { createDept, deleteDept, getDeptList, getDeptPage, updateDept } from '@/api/v1/system/dept';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
import { storePagination } from '@/store/useStorePagination';
|
||||
|
@ -43,7 +37,7 @@ export const useDeptStore = defineStore('deptStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 获取部门 */
|
||||
async getDeptList() {
|
||||
async fetchDeptPage() {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
|
@ -51,36 +45,36 @@ export const useDeptStore = defineStore('deptStore', {
|
|||
delete data.background;
|
||||
|
||||
// 获取部门列表
|
||||
const result = await fetchGetDeptList(data);
|
||||
const result = await getDeptPage(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
return pagination(result);
|
||||
},
|
||||
|
||||
/** 获取所有部门列表 */
|
||||
async getAllDeptList() {
|
||||
const result = await fetchGetAllDeptList();
|
||||
if (result.code !== 200) return;
|
||||
this.allDeptList = result.data;
|
||||
},
|
||||
|
||||
/** 添加部门 */
|
||||
async addDept(data: any) {
|
||||
const result = await fetchAddDept(data);
|
||||
const result = await createDept(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 修改部门 */
|
||||
async updateDept(data: any) {
|
||||
const result = await fetchUpdateDept(data);
|
||||
async editDept(data: any) {
|
||||
const result = await updateDept(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除部门 */
|
||||
async deleteDept(data: any) {
|
||||
const result = await fetchDeleteDept(data);
|
||||
async removeDept(data: any) {
|
||||
const result = await deleteDept(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 获取所有部门列表 */
|
||||
async loadDeptList() {
|
||||
const result = await getDeptList();
|
||||
if (result.code !== 200) return;
|
||||
this.allDeptList = result.data;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import {
|
||||
fetchAddMenu,
|
||||
fetchClearAllRolesSelect,
|
||||
fetchDeletedMenuByIds,
|
||||
fetchGetRoleListByRouterId,
|
||||
fetchMenuList,
|
||||
fetchUpdateMenu,
|
||||
clearRouterRole,
|
||||
createRouter,
|
||||
deletedRouterByIds,
|
||||
getRoleListByRouterId,
|
||||
getRouterList,
|
||||
updateRouter,
|
||||
} from '@/api/v1/menu/menu';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
|
@ -23,8 +23,8 @@ export const userMenuStore = defineStore('menuStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 获取菜单列表 */
|
||||
async getMenuList() {
|
||||
const result = await fetchMenuList();
|
||||
async loadRouterList() {
|
||||
const result = await getRouterList();
|
||||
if (result.code !== 200) return false;
|
||||
|
||||
// 前端搜索菜单名称
|
||||
|
@ -40,33 +40,33 @@ export const userMenuStore = defineStore('menuStore', {
|
|||
},
|
||||
|
||||
/** 添加菜单 */
|
||||
async addMenu(data: object) {
|
||||
const result = await fetchAddMenu(data);
|
||||
async addRouter(data: object) {
|
||||
const result = await createRouter(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 更新菜单 */
|
||||
async updateMenu(data: object) {
|
||||
const result = await fetchUpdateMenu(data);
|
||||
async editRouter(data: object) {
|
||||
const result = await updateRouter(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除菜单 */
|
||||
async deletedMenuByIds(data: object) {
|
||||
const result = await fetchDeletedMenuByIds(data);
|
||||
async removeRouterByIds(data: object) {
|
||||
const result = await deletedRouterByIds(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 根据路由id获取角色列表 */
|
||||
async getRoleListByRouterId(data: any) {
|
||||
const result = await fetchGetRoleListByRouterId(data);
|
||||
async loadRoleListByRouterId(data: any) {
|
||||
const result = await getRoleListByRouterId(data);
|
||||
if (result.code !== 200) return;
|
||||
return result.data;
|
||||
},
|
||||
|
||||
/** 清除选中菜单所有角色 */
|
||||
async clearAllRolesSelect(data: any) {
|
||||
const result = await fetchClearAllRolesSelect(data);
|
||||
async clearSelectRouterRole(data: any) {
|
||||
const result = await clearRouterRole(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
fetchAddPower,
|
||||
fetchDeletePower,
|
||||
fetchGetAllPowers,
|
||||
fetchGetPowerList,
|
||||
fetchUpdateBatchByPowerWithParentId,
|
||||
fetchUpdatePower,
|
||||
createPermission,
|
||||
deletePermission,
|
||||
getPermissionList,
|
||||
getPermissionPage,
|
||||
updatePermission,
|
||||
updatePermissionListByParentId,
|
||||
} from '@/api/v1/system/power';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
|
@ -14,7 +14,7 @@ import { storePagination } from '@/store/useStorePagination';
|
|||
/**
|
||||
* 权限 Store
|
||||
*/
|
||||
export const usePowerStore = defineStore('powerStore', {
|
||||
export const usePermissionStore = defineStore('PermissionStore', {
|
||||
state() {
|
||||
return {
|
||||
// 权限列表
|
||||
|
@ -46,7 +46,7 @@ export const usePowerStore = defineStore('powerStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 获取权限 */
|
||||
async getPowerList() {
|
||||
async fetchPermissionPage() {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
|
@ -54,7 +54,7 @@ export const usePowerStore = defineStore('powerStore', {
|
|||
delete data.background;
|
||||
|
||||
// 获取权限列表
|
||||
const result = await fetchGetPowerList(data);
|
||||
const result = await getPermissionPage(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
|
@ -62,32 +62,32 @@ export const usePowerStore = defineStore('powerStore', {
|
|||
},
|
||||
|
||||
/** 添加权限 */
|
||||
async addPower(data: any) {
|
||||
const result = await fetchAddPower(data);
|
||||
async addPermission(data: any) {
|
||||
const result = await createPermission(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 修改权限 */
|
||||
async updatePower(data: any) {
|
||||
const result = await fetchUpdatePower(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 批量修改权限父级 */
|
||||
async updateBatchByPowerWithParentId(data: any) {
|
||||
const result = await fetchUpdateBatchByPowerWithParentId(data);
|
||||
async editPermission(data: any) {
|
||||
const result = await updatePermission(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除权限 */
|
||||
async deletePower(data: any) {
|
||||
const result = await fetchDeletePower(data);
|
||||
async removePermission(data: any) {
|
||||
const result = await deletePermission(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 批量修改权限父级 */
|
||||
async updatePermissionListByParentId(data: any) {
|
||||
const result = await updatePermissionListByParentId(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 获取所有权限 */
|
||||
async getAllPowers() {
|
||||
const result = await fetchGetAllPowers();
|
||||
async loadPermissionList() {
|
||||
const result = await getPermissionList();
|
||||
if (result.code !== 200) return;
|
||||
this.allPowerList = result.data;
|
||||
},
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import {
|
||||
fetchAddRole,
|
||||
fetchAllRoles,
|
||||
fetchAssignPowersToRole,
|
||||
fetchDeleteRole,
|
||||
fetchGetRoleList,
|
||||
fetchUpdateRole,
|
||||
fetchUpdateRoleByFile,
|
||||
crateRole,
|
||||
createRolePermission,
|
||||
deleteRole,
|
||||
getRoleList,
|
||||
getRolePage,
|
||||
updateRole,
|
||||
updateRoleByFile,
|
||||
} from '@/api/v1/system/role';
|
||||
import { pageSizes } from '@/enums/baseConstant';
|
||||
import { storeMessage } from '@/utils/message';
|
||||
|
@ -43,7 +43,7 @@ export const useRoleStore = defineStore('roleStore', {
|
|||
getters: {},
|
||||
actions: {
|
||||
/** 获取角色 */
|
||||
async getRoleList() {
|
||||
async fetchRolePage() {
|
||||
// 整理请求参数
|
||||
const data = { ...this.pagination, ...this.form };
|
||||
delete data.pageSizes;
|
||||
|
@ -51,7 +51,7 @@ export const useRoleStore = defineStore('roleStore', {
|
|||
delete data.background;
|
||||
|
||||
// 获取角色列表
|
||||
const result = await fetchGetRoleList(data);
|
||||
const result = await getRolePage(data);
|
||||
|
||||
// 公共页面函数hook
|
||||
const pagination = storePagination.bind(this);
|
||||
|
@ -59,8 +59,8 @@ export const useRoleStore = defineStore('roleStore', {
|
|||
},
|
||||
|
||||
/** 获取所有角色 */
|
||||
async allRoles() {
|
||||
const result = await fetchAllRoles();
|
||||
async loadRoleList() {
|
||||
const result = await getRoleList();
|
||||
if (result.code !== 200) return;
|
||||
|
||||
this.allRoleList = result.data.map((role) => ({ key: role.id, label: role.description }));
|
||||
|
@ -68,31 +68,31 @@ export const useRoleStore = defineStore('roleStore', {
|
|||
|
||||
/** 添加角色 */
|
||||
async addRole(data: any) {
|
||||
const result = await fetchAddRole(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/* 使用Excel更新角色列表 */
|
||||
async updateRoleByFile(data: any) {
|
||||
const result = await fetchUpdateRoleByFile(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 为角色分配权限 */
|
||||
async assignPowersToRole(data: any) {
|
||||
const result = await fetchAssignPowersToRole(data);
|
||||
const result = await crateRole(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 修改角色 */
|
||||
async updateRole(data: any) {
|
||||
const result = await fetchUpdateRole(data);
|
||||
async editRole(data: any) {
|
||||
const result = await updateRole(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 删除角色 */
|
||||
async deleteRole(data: any) {
|
||||
const result = await fetchDeleteRole(data);
|
||||
async removeRole(data: any) {
|
||||
const result = await deleteRole(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/* 使用Excel更新角色列表 */
|
||||
async editRoleByFile(data: any) {
|
||||
const result = await updateRoleByFile(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
|
||||
/** 为角色分配权限 */
|
||||
async addRolePermission(data: any) {
|
||||
const result = await createRolePermission(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,17 +1,10 @@
|
|||
import { defineStore } from 'pinia';
|
||||
import { resetRouter, router, routerArrays, storageLocal, store, type userType } from '../utils';
|
||||
import {
|
||||
fetchAssignRolesToUsers,
|
||||
fetchLogin,
|
||||
fetchLogout,
|
||||
fetchPostEmailCode,
|
||||
fetchUserinfo,
|
||||
refreshTokenApi,
|
||||
} from '@/api/v1/system/adminUser';
|
||||
import { getUserinfo, logout, refreshTokenApi, sendLoginEmail, userLogin } from '@/api/v1/system/adminUser';
|
||||
import { useMultiTagsStoreHook } from '../multiTags';
|
||||
import { type DataInfo, removeToken, setToken, userKey } from '@/utils/auth';
|
||||
import { message, storeMessage } from '@/utils/message';
|
||||
import { fetchGetRoleListByUserId } from '@/api/v1/system/role';
|
||||
import { createUserRole, getRoleListByUserId } from '@/api/v1/system/role';
|
||||
|
||||
export const useUserStore = defineStore({
|
||||
id: 'system-user',
|
||||
|
@ -35,7 +28,7 @@ export const useUserStore = defineStore({
|
|||
/** 登入 */
|
||||
async loginByUsername(data: any) {
|
||||
data = this.isRemembered ? { ...data, readMeDay: this.readMeDay } : data;
|
||||
const result = await fetchLogin(data);
|
||||
const result = await userLogin(data);
|
||||
|
||||
if (result.code === 200) {
|
||||
setToken(result.data);
|
||||
|
@ -44,9 +37,9 @@ export const useUserStore = defineStore({
|
|||
return false;
|
||||
},
|
||||
|
||||
/** 发送邮箱验证码 */
|
||||
async postEmailCode(email: string) {
|
||||
const response = await fetchPostEmailCode({ email });
|
||||
/** 发送登录邮箱验证码 */
|
||||
async sendLoginEmailCode(email: string) {
|
||||
const response = await sendLoginEmail({ email });
|
||||
if (response.code === 200) {
|
||||
message(response.message, { type: 'success' });
|
||||
return true;
|
||||
|
@ -58,7 +51,7 @@ export const useUserStore = defineStore({
|
|||
|
||||
/** 前端登出 */
|
||||
async logOut() {
|
||||
const result = await fetchLogout();
|
||||
const result = await logout();
|
||||
if (result.code == 200) {
|
||||
this.username = '';
|
||||
this.roles = [];
|
||||
|
@ -85,8 +78,8 @@ export const useUserStore = defineStore({
|
|||
},
|
||||
|
||||
/** 获取用户信息 */
|
||||
async getUserinfo() {
|
||||
const result = await fetchUserinfo();
|
||||
async loadUserinfo() {
|
||||
const result = await getUserinfo();
|
||||
if (result.code === 200) {
|
||||
const data = result.data;
|
||||
setToken(data);
|
||||
|
@ -96,15 +89,15 @@ export const useUserStore = defineStore({
|
|||
},
|
||||
|
||||
/** 根据用户id获取角色列表 */
|
||||
async getRoleListByUserId(data: any) {
|
||||
const result = await fetchGetRoleListByUserId(data);
|
||||
async loadRoleListByUserId(data: any) {
|
||||
const result = await getRoleListByUserId(data);
|
||||
if (result.code !== 200) return;
|
||||
return result.data;
|
||||
},
|
||||
|
||||
/** 为用户分配角色 */
|
||||
async assignRolesToUsers(data: any) {
|
||||
const result = await fetchAssignRolesToUsers(data);
|
||||
async addUserRole(data: any) {
|
||||
const result = await createUserRole(data);
|
||||
return storeMessage(result);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -75,10 +75,7 @@ export const message = (message: string | VNode | (() => VNode), params?: Messag
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 仓库消息展示
|
||||
* @param result
|
||||
*/
|
||||
/* 仓库消息展示 */
|
||||
export const storeMessage = (result: BaseResult<any>) => {
|
||||
if (result.code !== 200) {
|
||||
return false;
|
||||
|
@ -95,11 +92,7 @@ const defaultBoxOption: any = {
|
|||
cancelMessage: undefined,
|
||||
};
|
||||
|
||||
/**
|
||||
* 消息弹窗确认
|
||||
* @param type
|
||||
* @param option
|
||||
*/
|
||||
/* 消息弹窗确认 */
|
||||
export const messageBox = async (option: any = defaultBoxOption, type: any = 'warning') => {
|
||||
return ElMessageBox.confirm(option.message, option.title, {
|
||||
confirmButtonText: '确认',
|
||||
|
|
|
@ -34,7 +34,7 @@ function onResetPassword() {
|
|||
if (valid) {
|
||||
// 更新用户密码
|
||||
const data = { password: restPasswordForm.password };
|
||||
const result = await adminUserStore.updateUserPasswordByLocalUser(data);
|
||||
const result = await adminUserStore.editUserPassword(data);
|
||||
|
||||
// 更新成功关闭弹窗
|
||||
if (!result) return;
|
||||
|
|
|
@ -58,7 +58,7 @@ const onSubmit = async (formEl: FormInstance) => {
|
|||
if (avatar) userInfos.avatar = avatar;
|
||||
|
||||
// 更新用户信息
|
||||
const result = await adminUserStore.updateAdminUserByLocalUser(userInfos);
|
||||
const result = await adminUserStore.editUserinfo(userInfos);
|
||||
if (!result) return;
|
||||
|
||||
// 重新加载用户信息
|
||||
|
|
|
@ -21,7 +21,7 @@ const userLoginLogs = reactive({
|
|||
const onSearchByLoginLog = async () => {
|
||||
userLoginLogs.loading = true;
|
||||
|
||||
const data = await userLoginLogStore.getUserLoginLogListByLocalUser(userLoginLogs);
|
||||
const data = await userLoginLogStore.fetchUserLoginLogPageByUser(userLoginLogs);
|
||||
userLoginLogs.datalist = data.list;
|
||||
userLoginLogs.currentPage = data.pageNo;
|
||||
userLoginLogs.pageSize = data.pageSize;
|
||||
|
|
|
@ -18,7 +18,7 @@ export const columns: TableColumnList = [
|
|||
// 登录Ip归属地
|
||||
{ label: $t('userLoginLog_ipRegion'), prop: 'ipRegion' },
|
||||
// 登录时代理
|
||||
{ label: $t('userLoginLog_userAgent'), prop: 'userAgent' },
|
||||
// { label: $t('userLoginLog_userAgent'), prop: 'userAgent' },
|
||||
// 操作类型
|
||||
{ label: $t('userLoginLog_type'), prop: 'type' },
|
||||
// 标识客户端是否是通过Ajax发送请求的
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { useUserStore } from '@/store/system/user';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { createFormData } from '@pureadmin/utils';
|
||||
import { fetchUploadFile } from '@/api/v1/system/system';
|
||||
import { uploadFile } from '@/api/v1/system/system';
|
||||
import { message } from '@/utils/message';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
|
||||
|
@ -29,7 +29,7 @@ export const userInfos = reactive({
|
|||
|
||||
/** 获取用户信息内容 */
|
||||
export const onSearchByUserinfo = async () => {
|
||||
const data = await userStore.getUserinfo();
|
||||
const data = await userStore.loadUserinfo();
|
||||
userInfos.summary = data.personDescription;
|
||||
userInfos.avatar = data.avatar;
|
||||
userInfos.username = data.username;
|
||||
|
@ -50,7 +50,7 @@ export const handleSubmitImage = async () => {
|
|||
});
|
||||
|
||||
// 上传头像
|
||||
const result = await fetchUploadFile(formData);
|
||||
const result = await uploadFile(formData);
|
||||
|
||||
// 上传成功后关闭弹窗
|
||||
if (result.code === 200) {
|
||||
|
|
|
@ -5,6 +5,7 @@ import { FormProps, rules } from '@/views/configuration/email-template/utils';
|
|||
import { $t } from '@/plugins/i18n';
|
||||
import { useEmailTemplateStore } from '@/store/configuration/emailTemplate';
|
||||
import { usePublicHooks } from '@/views/hooks';
|
||||
import { useEmailUsersStore } from '@/store/configuration/emailUsers';
|
||||
|
||||
const props = withDefaults(defineProps<FormProps>(), {
|
||||
formInline: () => ({
|
||||
|
@ -24,6 +25,7 @@ const props = withDefaults(defineProps<FormProps>(), {
|
|||
});
|
||||
|
||||
const emailTemplateStore = useEmailTemplateStore();
|
||||
const emailUsersStore = useEmailUsersStore();
|
||||
|
||||
// 用户是否停用样式
|
||||
const { switchStyle } = usePublicHooks();
|
||||
|
@ -48,7 +50,7 @@ defineExpose({ formRef });
|
|||
<el-form-item :label="$t('emailTemplate_emailUser')" prop="emailUser">
|
||||
<el-select v-model="form.emailUser" :placeholder="$t('emailTemplate_emailUser')" clearable filterable>
|
||||
<el-option
|
||||
v-for="(item, index) in emailTemplateStore.emailUserList"
|
||||
v-for="(item, index) in emailUsersStore.emailUserList"
|
||||
:key="index"
|
||||
:label="item.key"
|
||||
:navigationBar="false"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<script lang="ts" setup>
|
||||
<script lang="tsx" setup>
|
||||
import ReAuth from '@/components/ReAuth/src/auth';
|
||||
import { useRenderIcon } from '@/components/ReIcon/src/hooks';
|
||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||
|
@ -15,7 +15,6 @@ import {
|
|||
onSearch,
|
||||
onUpdate,
|
||||
selectRows,
|
||||
viewTemplate,
|
||||
} from '@/views/configuration/email-template/utils';
|
||||
import Delete from '@iconify-icons/ep/delete';
|
||||
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||
|
@ -24,12 +23,16 @@ import View from '@iconify-icons/ep/view';
|
|||
import AddFill from '@iconify-icons/ri/add-circle-line';
|
||||
import PureTable from '@pureadmin/table';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useEmailUsersStore } from '@/store/configuration/emailUsers';
|
||||
import { addDialog } from '@/components/ReDialog/index';
|
||||
|
||||
defineOptions({ name: 'EmailTemplate' });
|
||||
|
||||
const emailTemplateStore = useEmailTemplateStore();
|
||||
const emailUsersStore = useEmailUsersStore();
|
||||
|
||||
const tableRef = ref();
|
||||
const formRef = ref();
|
||||
const emailTemplateStore = useEmailTemplateStore();
|
||||
|
||||
/** 当前页改变时 */
|
||||
const onCurrentPageChange = async (value: number) => {
|
||||
|
@ -55,15 +58,26 @@ const onSelectionChange = (rows: Array<any>) => {
|
|||
selectRows.value = rows;
|
||||
};
|
||||
|
||||
/** 查看模板 */
|
||||
const viewTemplate = (template: string) => {
|
||||
addDialog({
|
||||
title: $t('view'),
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => <div v-html={template} />,
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
emailTemplateStore.getAllMailboxConfigurationUsers();
|
||||
emailUsersStore.loadEmailUserList();
|
||||
onSearch();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.search">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:inline="true"
|
||||
|
@ -129,7 +143,7 @@ onMounted(() => {
|
|||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button
|
||||
v-if="hasAuth(auth.deleted)"
|
||||
v-if="hasAuth(auth.delete)"
|
||||
:disabled="!(selectRows.length > 0)"
|
||||
:icon="useRenderIcon(Delete)"
|
||||
plain
|
||||
|
@ -162,15 +176,17 @@ onMounted(() => {
|
|||
@page-current-change="onCurrentPageChange"
|
||||
>
|
||||
<template #emailUser="{ row }">
|
||||
{{ emailTemplateStore.getMailboxConfigurationUser[row.emailUser] }}
|
||||
{{ emailUsersStore.getMailboxConfigurationUser[row.emailUser] }}
|
||||
</template>
|
||||
|
||||
<!-- 插槽-创建用户 -->
|
||||
<template #createUser="{ row }">
|
||||
<el-button v-show="row.createUser" link type="primary" @click="selectUserinfo(row.createUser)">
|
||||
{{ row.createUsername }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<!-- 插槽-更新用户 -->
|
||||
<template #updateUser="{ row }">
|
||||
<el-button v-show="row.updateUser" link type="primary" @click="selectUserinfo(row.updateUser)">
|
||||
{{ row.updateUsername }}
|
||||
|
@ -178,6 +194,7 @@ onMounted(() => {
|
|||
</template>
|
||||
|
||||
<template #operation="{ row }">
|
||||
<!--查看模板-->
|
||||
<el-button
|
||||
:icon="useRenderIcon(View)"
|
||||
:size="size"
|
||||
|
@ -188,6 +205,8 @@ onMounted(() => {
|
|||
>
|
||||
{{ $t('view') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 修改 -->
|
||||
<el-button
|
||||
v-if="hasAuth(auth.update)"
|
||||
:icon="useRenderIcon(EditPen)"
|
||||
|
@ -199,8 +218,10 @@ onMounted(() => {
|
|||
>
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
|
||||
<!-- 删除 -->
|
||||
<el-popconfirm
|
||||
v-if="hasAuth(auth.deleted)"
|
||||
v-if="hasAuth(auth.delete)"
|
||||
:title="`${$t('delete')} ${row.templateName}?`"
|
||||
@confirm="onDelete(row)"
|
||||
>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
search: ['emailTemplate::getEmailTemplateList'],
|
||||
query: ['emailTemplate::query', 'emailTemplate::queryPage'],
|
||||
// 添加操作
|
||||
add: ['emailTemplate::addEmailTemplate'],
|
||||
add: ['emailTemplate::add'],
|
||||
// 更新操作
|
||||
update: ['emailTemplate::updateEmailTemplate'],
|
||||
update: ['emailTemplate::update'],
|
||||
// 删除操作
|
||||
deleted: ['emailTemplate::deleteEmailTemplate'],
|
||||
delete: ['emailTemplate::delete'],
|
||||
};
|
||||
|
|
|
@ -24,9 +24,7 @@ export const columns: TableColumnList = [
|
|||
return isDefault ? (
|
||||
<ElTag type={'success'}>{$t('default')}</ElTag>
|
||||
) : (
|
||||
<ElTag size={'large'} type={'danger'}>
|
||||
{$t('no_default')}
|
||||
</ElTag>
|
||||
<ElTag type={'danger'}>{$t('no_default')}</ElTag>
|
||||
);
|
||||
},
|
||||
minWidth: 100,
|
||||
|
|
|
@ -2,10 +2,9 @@ import { addDialog } from '@/components/ReDialog/index';
|
|||
import EmailTemplateDialog from '@/views/configuration/email-template/components/email-template-dialog.vue';
|
||||
import { useEmailTemplateStore } from '@/store/configuration/emailTemplate';
|
||||
import { h, ref } from 'vue';
|
||||
import { message, messageBox } from '@/utils/message';
|
||||
import { messageBox } from '@/utils/message';
|
||||
import type { FormItemProps } from '@/views/configuration/email-template/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||
|
||||
const emailTemplateStore = useEmailTemplateStore();
|
||||
|
||||
|
@ -31,7 +30,7 @@ export function onAdd() {
|
|||
templateName: undefined,
|
||||
emailUser: undefined,
|
||||
subject: undefined,
|
||||
isDefault: undefined,
|
||||
isDefault: false,
|
||||
body: undefined,
|
||||
type: undefined,
|
||||
},
|
||||
|
@ -54,10 +53,7 @@ export function onAdd() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* * 更新邮件模板表
|
||||
* @param row
|
||||
*/
|
||||
/* 更新邮件模板表 */
|
||||
export function onUpdate(row: any) {
|
||||
const formRef = ref();
|
||||
|
||||
|
@ -85,7 +81,7 @@ export function onUpdate(row: any) {
|
|||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
|
||||
const result = await emailTemplateStore.updateEmailTemplate({ ...form, id: row.id });
|
||||
const result = await emailTemplateStore.editEmailTemplate({ ...form, id: row.id });
|
||||
if (!result) return;
|
||||
done();
|
||||
await onSearch();
|
||||
|
@ -108,47 +104,23 @@ export const onDelete = async (row: any) => {
|
|||
if (!result) return;
|
||||
|
||||
// 删除数据
|
||||
await emailTemplateStore.deleteEmailTemplate([id]);
|
||||
await emailTemplateStore.removeEmailTemplate([id]);
|
||||
await onSearch();
|
||||
};
|
||||
|
||||
/** 批量删除 */
|
||||
export const onDeleteBatch = async () => {
|
||||
// 是否确认删除
|
||||
const result = await messageBox({
|
||||
title: $t('confirmDelete'),
|
||||
showMessage: false,
|
||||
confirmMessage: undefined,
|
||||
cancelMessage: $t('cancel_delete'),
|
||||
});
|
||||
if (!result) return;
|
||||
|
||||
// 删除数据
|
||||
const ids = selectRows.value.map((row: any) => row.id);
|
||||
const formDeletedBatchRef = ref();
|
||||
|
||||
addDialog({
|
||||
title: $t('deleteBatchTip'),
|
||||
width: '30%',
|
||||
props: { formInline: { confirmText: '' } },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(DeleteBatchDialog, { ref: formDeletedBatchRef }),
|
||||
beforeSure: (done, { options }) => {
|
||||
formDeletedBatchRef.value.formDeletedBatchRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
|
||||
const text = options.props.formInline.confirmText.toLowerCase();
|
||||
if (text === 'yes' || text === 'y') {
|
||||
// 删除数据
|
||||
await emailTemplateStore.deleteEmailTemplate(ids);
|
||||
await onSearch();
|
||||
|
||||
done();
|
||||
} else message($t('deleteBatchTip'), { type: 'warning' });
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/** 查看模板 */
|
||||
export const viewTemplate = (template: string) => {
|
||||
addDialog({
|
||||
title: $t('view'),
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => <div v-html={template} />,
|
||||
});
|
||||
await emailTemplateStore.removeEmailTemplate(ids);
|
||||
await onSearch();
|
||||
};
|
||||
|
|
|
@ -67,7 +67,7 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.search">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:inline="true"
|
||||
|
@ -157,7 +157,7 @@ onMounted(() => {
|
|||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button
|
||||
v-if="hasAuth(auth.deleted)"
|
||||
v-if="hasAuth(auth.delete)"
|
||||
:disabled="!(deleteIds.length > 0)"
|
||||
:icon="useRenderIcon(Delete)"
|
||||
plain
|
||||
|
@ -208,14 +208,22 @@ onMounted(() => {
|
|||
/>
|
||||
</template>
|
||||
|
||||
<!-- 插槽-创建用户 -->
|
||||
<template #createUser="{ row }">
|
||||
<el-button v-show="row.createUser" link type="primary" @click="selectUserinfo(row.createUser)">
|
||||
{{ row.createUsername }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<!-- 插槽-更新用户 -->
|
||||
<template #updateUser="{ row }">
|
||||
<el-button v-show="row.updateUser" link type="primary" @click="selectUserinfo(row.updateUser)">
|
||||
<el-button
|
||||
v-if="hasAuth(auth.update)"
|
||||
v-show="row.updateUser"
|
||||
link
|
||||
type="primary"
|
||||
@click="selectUserinfo(row.updateUser)"
|
||||
>
|
||||
{{ row.updateUsername }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -232,11 +240,7 @@ onMounted(() => {
|
|||
>
|
||||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
<el-popconfirm
|
||||
v-if="hasAuth(auth.deleted)"
|
||||
:title="`${$t('delete')}${row.email}?`"
|
||||
@confirm="onDelete(row)"
|
||||
>
|
||||
<el-popconfirm v-if="hasAuth(auth.delete)" :title="`${$t('delete')}${row.email}?`" @confirm="onDelete(row)">
|
||||
<template #reference>
|
||||
<el-button :icon="useRenderIcon(Delete)" :size="size" class="reset-margin" link type="primary">
|
||||
{{ $t('delete') }}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
search: ['emailUsers::getEmailUsersList'],
|
||||
query: ['emailUsers::query', 'emailUsers::queryPage'],
|
||||
// 添加操作
|
||||
add: ['emailUsers::addEmailUsers'],
|
||||
add: ['emailUsers::add'],
|
||||
// 更新操作
|
||||
update: ['emailUsers::updateEmailUsers'],
|
||||
update: ['emailUsers::update'],
|
||||
// 删除操作
|
||||
deleted: ['emailUsers::deleteEmailUsers'],
|
||||
delete: ['emailUsers::delete'],
|
||||
};
|
||||
|
|
|
@ -23,7 +23,7 @@ export const columns: TableColumnList = [
|
|||
{ label: $t('table.createTime'), prop: 'createTime', sortable: true, minWidth: 160 },
|
||||
{ label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', minWidth: 130 },
|
||||
{ label: $t('table.updateUser'), prop: 'updateUser', slot: 'updateUser', minWidth: 130 },
|
||||
{ label: $t('table.operation'), fixed: 'right', minWidth: 210, slot: 'operation' },
|
||||
{ label: $t('table.operation'), fixed: 'right', minWidth: 160, slot: 'operation' },
|
||||
];
|
||||
|
||||
// 添加规则
|
||||
|
|
|
@ -2,10 +2,9 @@ import { addDialog } from '@/components/ReDialog/index';
|
|||
import EmailUsersDialog from '@/views/configuration/email-user/components/email-users-dialog.vue';
|
||||
import { useEmailUsersStore } from '@/store/configuration/emailUsers';
|
||||
import { h, ref } from 'vue';
|
||||
import { message, messageBox } from '@/utils/message';
|
||||
import { messageBox } from '@/utils/message';
|
||||
import type { FormItemProps } from '@/views/configuration/email-user/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||
|
||||
export const formRef = ref();
|
||||
// 用户是否停用加载集合
|
||||
|
@ -17,7 +16,7 @@ const emailUsersStore = useEmailUsersStore();
|
|||
/** 搜索初始化邮箱用户发送配置 */
|
||||
export async function onSearch() {
|
||||
emailUsersStore.loading = true;
|
||||
await emailUsersStore.getEmailUsersList();
|
||||
await emailUsersStore.fetchEmailUserPage();
|
||||
emailUsersStore.loading = false;
|
||||
}
|
||||
|
||||
|
@ -55,10 +54,7 @@ export function onAdd() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* * 更新邮箱用户发送配置
|
||||
* @param row
|
||||
*/
|
||||
/* 更新邮箱用户发送配置 */
|
||||
export function onUpdate(row: any) {
|
||||
addDialog({
|
||||
title: `${$t('modify')}${$t('emailUsers')}`,
|
||||
|
@ -83,7 +79,7 @@ export function onUpdate(row: any) {
|
|||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
|
||||
const result = await emailUsersStore.updateEmailUsers({ ...form, id: row.id });
|
||||
const result = await emailUsersStore.editEmailUsers({ ...form, id: row.id });
|
||||
if (!result) return;
|
||||
done();
|
||||
await onSearch();
|
||||
|
@ -94,8 +90,6 @@ export function onUpdate(row: any) {
|
|||
|
||||
/** 删除邮箱用户发送配置 */
|
||||
export const onDelete = async (row: any) => {
|
||||
const id = row.id;
|
||||
|
||||
// 是否确认删除
|
||||
const result = await messageBox({
|
||||
title: $t('confirmDelete'),
|
||||
|
@ -106,45 +100,29 @@ export const onDelete = async (row: any) => {
|
|||
if (!result) return;
|
||||
|
||||
// 删除数据
|
||||
await emailUsersStore.deleteEmailUsers([id]);
|
||||
const id = row.id;
|
||||
await emailUsersStore.removeEmailUsers([id]);
|
||||
await onSearch();
|
||||
};
|
||||
|
||||
/** 批量删除 */
|
||||
export const onDeleteBatch = async () => {
|
||||
const ids = deleteIds.value;
|
||||
const formDeletedBatchRef = ref();
|
||||
|
||||
addDialog({
|
||||
title: $t('deleteBatchTip'),
|
||||
width: '30%',
|
||||
props: { formInline: { confirmText: '' } },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(DeleteBatchDialog, { ref: formDeletedBatchRef }),
|
||||
beforeSure: (done, { options }) => {
|
||||
formDeletedBatchRef.value.formDeletedBatchRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
|
||||
const text = options.props.formInline.confirmText.toLowerCase();
|
||||
if (text === 'yes' || text === 'y') {
|
||||
// 删除数据
|
||||
await emailUsersStore.deleteEmailUsers(ids);
|
||||
await onSearch();
|
||||
|
||||
done();
|
||||
} else message($t('deleteBatchTip'), { type: 'warning' });
|
||||
});
|
||||
},
|
||||
// 是否确认删除
|
||||
const result = await messageBox({
|
||||
title: $t('confirmDelete'),
|
||||
showMessage: false,
|
||||
confirmMessage: undefined,
|
||||
cancelMessage: $t('cancel_delete'),
|
||||
});
|
||||
if (!result) return;
|
||||
|
||||
// 删除数据
|
||||
const ids = deleteIds.value;
|
||||
await emailUsersStore.removeEmailUsers(ids);
|
||||
await onSearch();
|
||||
};
|
||||
|
||||
/**
|
||||
* * 修改是否默认
|
||||
* @param row
|
||||
* @param index
|
||||
*/
|
||||
/* 修改是否默认 */
|
||||
export const onChangeDefault = async (row: any, index: number) => {
|
||||
// 点击时开始loading加载
|
||||
switchLoadMap.value[index] = Object.assign({}, switchLoadMap.value[index], {
|
||||
|
@ -160,25 +138,10 @@ export const onChangeDefault = async (row: any, index: number) => {
|
|||
});
|
||||
|
||||
// 如果不修改将值恢复到之前状态
|
||||
if (!confirm) {
|
||||
row.isDefault = !row.isDefault;
|
||||
switchLoadMap.value[index] = Object.assign({}, switchLoadMap.value[index], {
|
||||
loading: false,
|
||||
});
|
||||
return;
|
||||
if (confirm) {
|
||||
const result = await emailUsersStore.editEmailUsers(row);
|
||||
result && (await onSearch());
|
||||
}
|
||||
|
||||
// 修改用户状态
|
||||
const result = await emailUsersStore.updateEmailUserStatus({ id: row.id, isDefault: row.isDefault });
|
||||
if (!result) {
|
||||
row.isDefault = !row.isDefault;
|
||||
switchLoadMap.value[index] = Object.assign({}, switchLoadMap.value[index], {
|
||||
loading: false,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await onSearch();
|
||||
switchLoadMap.value[index] = Object.assign({}, switchLoadMap.value[index], {
|
||||
loading: false,
|
||||
});
|
||||
|
|
|
@ -22,7 +22,7 @@ const onRequestIconName = async (iconName: string) => {
|
|||
loading.value = true;
|
||||
|
||||
if (iconName) {
|
||||
await menuIconStore.getIconNameList(data);
|
||||
await menuIconStore.getIconNameListByIconName(data);
|
||||
} else menuIconStore.iconNameList = [];
|
||||
|
||||
loading.value = false;
|
||||
|
|
|
@ -60,7 +60,7 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.search">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:inline="true"
|
||||
|
@ -100,7 +100,7 @@ onMounted(() => {
|
|||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button
|
||||
v-if="hasAuth(auth.deleted)"
|
||||
v-if="hasAuth(auth.delete)"
|
||||
:disabled="!(deleteIds.length > 0)"
|
||||
:icon="useRenderIcon(Delete)"
|
||||
plain
|
||||
|
@ -163,7 +163,7 @@ onMounted(() => {
|
|||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
<el-popconfirm
|
||||
v-if="hasAuth(auth.deleted)"
|
||||
v-if="hasAuth(auth.delete)"
|
||||
:title="`${$t('delete')}${row.iconName}?`"
|
||||
@confirm="onDelete(row)"
|
||||
>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
search: ['menuIcon::getMenuIconList'],
|
||||
query: ['menuIcon::query', 'menuIcon::queryPage'],
|
||||
// 添加操作
|
||||
add: ['menuIcon::addMenuIcon'],
|
||||
add: ['menuIcon::add'],
|
||||
// 更新操作
|
||||
update: ['menuIcon::updateMenuIcon'],
|
||||
update: ['menuIcon::update'],
|
||||
// 删除操作
|
||||
deleted: ['menuIcon::deleteMenuIcon'],
|
||||
delete: ['menuIcon::delete'],
|
||||
};
|
||||
|
|
|
@ -2,10 +2,9 @@ import { addDialog } from '@/components/ReDialog/index';
|
|||
import MenuIconDialog from '@/views/configuration/menu-icon/components/menu-icon-dialog.vue';
|
||||
import { useMenuIconStore } from '@/store/configuration/menuIcon';
|
||||
import { h, ref } from 'vue';
|
||||
import { message, messageBox } from '@/utils/message';
|
||||
import { messageBox } from '@/utils/message';
|
||||
import type { FormItemProps } from '@/views/configuration/menu-icon/utils/types';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||
|
||||
export const formRef = ref();
|
||||
const menuIconStore = useMenuIconStore();
|
||||
|
@ -14,7 +13,7 @@ export const deleteIds = ref([]);
|
|||
/** 搜索初始化系统菜单图标 */
|
||||
export async function onSearch() {
|
||||
menuIconStore.loading = true;
|
||||
await menuIconStore.getMenuIconList();
|
||||
await menuIconStore.fetchMenuIconListPage();
|
||||
menuIconStore.loading = false;
|
||||
}
|
||||
|
||||
|
@ -23,12 +22,7 @@ export function onAdd() {
|
|||
addDialog({
|
||||
title: `${$t('addNew')} ${$t('menuIcon')}`,
|
||||
width: '30%',
|
||||
props: {
|
||||
formInline: {
|
||||
iconCode: undefined,
|
||||
iconName: undefined,
|
||||
},
|
||||
},
|
||||
props: { formInline: { confirmText: '' } },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
|
@ -47,10 +41,7 @@ export function onAdd() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* * 更新系统菜单图标
|
||||
* @param row
|
||||
*/
|
||||
/* 更新系统菜单图标 */
|
||||
export function onUpdate(row: any) {
|
||||
addDialog({
|
||||
title: `${$t('modify')} ${$t('menuIcon')}`,
|
||||
|
@ -70,7 +61,7 @@ export function onUpdate(row: any) {
|
|||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
|
||||
const result = await menuIconStore.updateMenuIcon({ ...form, id: row.id });
|
||||
const result = await menuIconStore.editMenuIcon({ ...form, id: row.id });
|
||||
if (!result) return;
|
||||
done();
|
||||
await onSearch();
|
||||
|
@ -81,8 +72,6 @@ export function onUpdate(row: any) {
|
|||
|
||||
/** 删除系统菜单图标 */
|
||||
export const onDelete = async (row: any) => {
|
||||
const id = row.id;
|
||||
|
||||
// 是否确认删除
|
||||
const result = await messageBox({
|
||||
title: $t('confirmDelete'),
|
||||
|
@ -93,36 +82,24 @@ export const onDelete = async (row: any) => {
|
|||
if (!result) return;
|
||||
|
||||
// 删除数据
|
||||
await menuIconStore.deleteMenuIcon([id]);
|
||||
const id = row.id;
|
||||
await menuIconStore.removeMenuIcon([id]);
|
||||
await onSearch();
|
||||
};
|
||||
|
||||
/** 批量删除 */
|
||||
export const onDeleteBatch = async () => {
|
||||
const ids = deleteIds.value;
|
||||
const formDeletedBatchRef = ref();
|
||||
|
||||
addDialog({
|
||||
title: $t('deleteBatchTip'),
|
||||
width: '30%',
|
||||
props: { formInline: { confirmText: '' } },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(DeleteBatchDialog, { ref: formDeletedBatchRef }),
|
||||
beforeSure: (done, { options }) => {
|
||||
formDeletedBatchRef.value.formDeletedBatchRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
|
||||
const text = options.props.formInline.confirmText.toLowerCase();
|
||||
if (text === 'yes' || text === 'y') {
|
||||
// 删除数据
|
||||
await menuIconStore.deleteMenuIcon(ids);
|
||||
await onSearch();
|
||||
|
||||
done();
|
||||
} else message($t('deleteBatchTip'), { type: 'warning' });
|
||||
});
|
||||
},
|
||||
// 是否确认删除
|
||||
const result = await messageBox({
|
||||
title: $t('confirmDelete'),
|
||||
showMessage: false,
|
||||
confirmMessage: undefined,
|
||||
cancelMessage: $t('cancel_delete'),
|
||||
});
|
||||
if (!result) return;
|
||||
|
||||
// 删除数据
|
||||
const ids = deleteIds.value;
|
||||
await menuIconStore.removeMenuIcon(ids);
|
||||
await onSearch();
|
||||
};
|
||||
|
|
|
@ -10,13 +10,15 @@ import { hasAuth } from '@/router/utils';
|
|||
|
||||
defineOptions({ name: 'WebConfiguration' });
|
||||
|
||||
const ruleFormRef = ref<FormInstance>();
|
||||
const i18nTypeStore = userI18nTypeStore();
|
||||
// 用户是否停用样式
|
||||
const { switchStyle } = usePublicHooks();
|
||||
const theme = ['dark', 'light', 'system'];
|
||||
const layout = ['vertical', 'horizontal', 'mix'];
|
||||
|
||||
// 用户是否停用样式
|
||||
const { switchStyle } = usePublicHooks();
|
||||
|
||||
const ruleFormRef = ref<FormInstance>();
|
||||
const i18nTypeStore = userI18nTypeStore();
|
||||
|
||||
onMounted(() => {
|
||||
onSearch();
|
||||
});
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export const auth = {
|
||||
// 更新操作
|
||||
update: ['config::updateWebConfiguration'],
|
||||
update: ['config::update'],
|
||||
};
|
||||
|
|
|
@ -35,9 +35,8 @@ export const form = ref({
|
|||
|
||||
/** 获取前端配置文件 */
|
||||
export const onSearch = async () => {
|
||||
const result = await getWebConfig();
|
||||
if (result.code !== 200) return;
|
||||
const data = result.data;
|
||||
const data = await getWebConfig();
|
||||
if (!data) return;
|
||||
|
||||
form.value.version = data.Version;
|
||||
form.value.title = data.Title;
|
||||
|
|
|
@ -18,7 +18,7 @@ const form = ref(props.formInline);
|
|||
const i18nTypeStore = userI18nTypeStore();
|
||||
|
||||
onMounted(() => {
|
||||
i18nTypeStore.getI18nTypeList();
|
||||
i18nTypeStore.loadI18nTypeList();
|
||||
});
|
||||
defineExpose({ ruleFormRef });
|
||||
</script>
|
||||
|
|
|
@ -52,10 +52,7 @@ const onPageSizeChange = async (value: number) => {
|
|||
await onSearch();
|
||||
};
|
||||
|
||||
/**
|
||||
* * 选择多行
|
||||
* @param rows
|
||||
*/
|
||||
/* 选择多行 */
|
||||
const onSelectionChange = (rows: Array<any>) => {
|
||||
deleteIds.value = rows.map((row: any) => row.id);
|
||||
};
|
||||
|
@ -67,7 +64,7 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.search">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form
|
||||
ref="pageFormRef"
|
||||
:inline="true"
|
||||
|
@ -134,7 +131,7 @@ onMounted(() => {
|
|||
</template>
|
||||
</el-dropdown>
|
||||
|
||||
<!-- 下载多语言配置 -->
|
||||
<!-- 更新多语言配置 -->
|
||||
<el-dropdown v-if="hasAuth(auth.update)" class="mr-1" type="primary">
|
||||
<el-button :icon="useRenderIcon(Upload)" plain type="primary">{{ $t('file_import') }}</el-button>
|
||||
<template #dropdown>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
search: ['i18n::getI18nList'],
|
||||
query: ['i18n::query', 'i18n::queryPage'],
|
||||
// 添加操作
|
||||
add: ['i18n::addI18n'],
|
||||
add: ['i18n::add'],
|
||||
// 更新操作
|
||||
update: ['i18n::updateI18n', 'i18n::updateI18nByFile'],
|
||||
update: ['i18n::update'],
|
||||
// 删除操作
|
||||
deleted: ['i18n::deleteI18n'],
|
||||
deleted: ['i18n::delete'],
|
||||
// 下载多语言配置
|
||||
download: ['i18n::downloadI18n'],
|
||||
download: ['i18n::update', 'i18n::download'],
|
||||
};
|
||||
|
|
|
@ -14,13 +14,13 @@ export const deleteIds = ref([]);
|
|||
/* 查询内容 */
|
||||
export const onSearch = async () => {
|
||||
i18nStore.loading = true;
|
||||
await i18nStore.getI18nMangeList();
|
||||
await i18nStore.fetchI18nPage();
|
||||
i18nStore.loading = false;
|
||||
};
|
||||
|
||||
/* 下载多语言配置 */
|
||||
export const downloadI18nSetting = (type: string) => {
|
||||
i18nStore.downloadI18nSetting({ type });
|
||||
i18nStore.downloadI18nFile({ type });
|
||||
};
|
||||
|
||||
/* 下载多语言配置 */
|
||||
|
@ -39,7 +39,7 @@ export const updateI18nSetting = (fileType: string) => {
|
|||
i18nUseFileUploadRef.value.formRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
const { type, file, fileType } = options.props.form;
|
||||
await i18nStore.updateI18nByFile({ type, file: file[0].raw, fileType });
|
||||
await i18nStore.editI18nByFile({ type, file: file[0].raw, fileType });
|
||||
done();
|
||||
await onSearch();
|
||||
});
|
||||
|
@ -121,7 +121,7 @@ export const onUpdate = (row: any) => {
|
|||
formRef.value.ruleFormRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
|
||||
const result = await i18nStore.updateI18n({ ...form, id });
|
||||
const result = await i18nStore.editI18n({ ...form, id });
|
||||
if (!result) return;
|
||||
done();
|
||||
await onSearch();
|
||||
|
@ -141,7 +141,7 @@ export const onDelete = async (row: any) => {
|
|||
});
|
||||
|
||||
if (isConfirm) {
|
||||
await i18nStore.deleteI18n([row.id]);
|
||||
await i18nStore.removeI18n([row.id]);
|
||||
await onSearch();
|
||||
}
|
||||
};
|
||||
|
@ -157,7 +157,7 @@ export const onDeleteBatch = async () => {
|
|||
});
|
||||
|
||||
if (isConfirm) {
|
||||
await i18nStore.deleteI18n(deleteIds.value);
|
||||
await i18nStore.removeI18n(deleteIds.value);
|
||||
await onSearch();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -121,7 +121,7 @@ onMounted(() => {
|
|||
{{ $t('modify') }}
|
||||
</el-button>
|
||||
<el-popconfirm
|
||||
v-if="hasAuth(auth.deleted)"
|
||||
v-if="hasAuth(auth.delete)"
|
||||
:title="`${$t('delete')} ${row.typeName}?`"
|
||||
@confirm="onDelete(row)"
|
||||
>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
export const auth = {
|
||||
// 添加操作
|
||||
add: ['i18nType::addI18nType'],
|
||||
add: ['i18nType::add'],
|
||||
// 更新操作
|
||||
update: ['i18nType::updateI18nType'],
|
||||
update: ['i18nType::update'],
|
||||
// 删除操作
|
||||
deleted: ['i18nType::deleteI18nType'],
|
||||
delete: ['i18nType::delete'],
|
||||
};
|
||||
|
|
|
@ -8,18 +8,14 @@ import type { FormItemProps } from '@/views/i18n/i18n-type-setting/utils/types';
|
|||
export const formRef = ref();
|
||||
const i18nTypeStore = userI18nTypeStore();
|
||||
|
||||
/**
|
||||
* * 搜索初始化多语言类型
|
||||
*/
|
||||
/* 搜索初始化多语言类型 */
|
||||
export async function onSearch() {
|
||||
i18nTypeStore.loading = true;
|
||||
await i18nTypeStore.getI18nTypeList();
|
||||
await i18nTypeStore.loadI18nTypeList();
|
||||
i18nTypeStore.loading = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* * 添加多语言
|
||||
*/
|
||||
/* 添加多语言 */
|
||||
export function onAdd() {
|
||||
addDialog({
|
||||
title: `添加多语言类型`,
|
||||
|
@ -45,10 +41,7 @@ export function onAdd() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* * 更新内容
|
||||
* @param row
|
||||
*/
|
||||
/* 更新内容 */
|
||||
export function onUpdate(row: any) {
|
||||
addDialog({
|
||||
title: `修改多语言类型`,
|
||||
|
@ -63,7 +56,7 @@ export function onUpdate(row: any) {
|
|||
formRef.value.formRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
|
||||
const result = await i18nTypeStore.updateI18nType({ ...form, id: row.id });
|
||||
const result = await i18nTypeStore.editI18nType({ ...form, id: row.id });
|
||||
if (!result) return;
|
||||
done();
|
||||
await onSearch();
|
||||
|
@ -72,9 +65,7 @@ export function onUpdate(row: any) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* * 删除多语言类容
|
||||
*/
|
||||
/* 删除多语言类容 */
|
||||
export const onDelete = async (row: any) => {
|
||||
const id = row.id;
|
||||
|
||||
|
@ -89,6 +80,6 @@ export const onDelete = async (row: any) => {
|
|||
if (!result) return;
|
||||
|
||||
// 删除数据
|
||||
await i18nTypeStore.deleteI18nType([id]);
|
||||
await i18nTypeStore.removeI18nType([id]);
|
||||
await onSearch();
|
||||
};
|
||||
|
|
|
@ -36,7 +36,7 @@ const onSendEmailCode = async () => {
|
|||
message('请先填写邮箱地址', { type: 'warning' });
|
||||
return false;
|
||||
}
|
||||
const result = await userStore.postEmailCode(ruleForm.username);
|
||||
const result = await userStore.sendLoginEmailCode(ruleForm.username);
|
||||
if (result) {
|
||||
// 开始倒计时,之后发送邮箱验证码
|
||||
onSendEmailTimer();
|
||||
|
|
|
@ -26,7 +26,7 @@ const { locale, translation } = useTranslationLang();
|
|||
const i18nTypeStore = userI18nTypeStore();
|
||||
|
||||
onMounted(() => {
|
||||
i18nTypeStore.getI18nTypeList();
|
||||
i18nTypeStore.loadI18nTypeList();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ const getMessageDetail = async () => {
|
|||
const messageId = route.params.messageId.toString();
|
||||
|
||||
// 获取消息详情
|
||||
await messageUserStore.getMessageDetailById(messageId);
|
||||
await messageUserStore.loadMessageDetailById(messageId);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
|
|
|
@ -29,16 +29,13 @@ const router = useRouter();
|
|||
/** 当前页改变时 */
|
||||
const onCurrentPageChange = (value: number) => {
|
||||
messageUserStore.pagination.currentPage = value;
|
||||
onSearch(route.params.messageType);
|
||||
onSearch((route.params as any)?.messageType);
|
||||
};
|
||||
|
||||
/**
|
||||
* * 当分页发生变化
|
||||
* @param value
|
||||
*/
|
||||
/* 当分页发生变化 */
|
||||
const onPageSizeChange = (value: number) => {
|
||||
messageUserStore.pagination.pageSize = value;
|
||||
onSearch(route.params.messageType);
|
||||
onSearch((route.params as any).messageType);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -50,24 +47,34 @@ const onSelectionChange = (rows: Array<any>) => {
|
|||
};
|
||||
|
||||
onMounted(() => {
|
||||
onSearch(route.params.messageType);
|
||||
onSearch((route.params as any).messageType);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="main">
|
||||
<PureTableBar :columns="columns" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch(route.params.messageType)">
|
||||
<PureTableBar
|
||||
:columns="columns"
|
||||
@fullscreen="tableRef.setAdaptive()"
|
||||
@refresh="onSearch((route.params as any).messageType)"
|
||||
>
|
||||
<template #title>
|
||||
<el-segmented
|
||||
v-model="messageUserStore.form.status"
|
||||
:options="isReadStatus"
|
||||
@change="onSearch(route.params.messageType)"
|
||||
@change="onSearch((route.params as any).messageType)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template #buttons>
|
||||
<!-- 删除按钮 -->
|
||||
<el-button :disabled="!(selectIds.length > 0)" :icon="useRenderIcon(Delete)" type="danger" @click="onDelete">
|
||||
<el-button
|
||||
:disabled="!(selectIds.length > 0)"
|
||||
:icon="useRenderIcon(Delete)"
|
||||
plain
|
||||
type="danger"
|
||||
@click="onDelete"
|
||||
>
|
||||
{{ $t('delete') }}
|
||||
</el-button>
|
||||
|
||||
|
@ -75,6 +82,7 @@ onMounted(() => {
|
|||
<el-button
|
||||
:disabled="!(selectIds.length > 0)"
|
||||
:icon="useRenderIcon('octicon:read-24')"
|
||||
plain
|
||||
type="primary"
|
||||
@click="markAsRead"
|
||||
>
|
||||
|
@ -82,7 +90,7 @@ onMounted(() => {
|
|||
</el-button>
|
||||
|
||||
<!-- 全部标为已读 -->
|
||||
<el-button :icon="useRenderIcon('octicon:read-24')" type="primary" @click="markAsAllRead">
|
||||
<el-button :icon="useRenderIcon('octicon:read-24')" plain type="primary" @click="markAsAllRead">
|
||||
{{ $t('allMarkAsRead') }}
|
||||
</el-button>
|
||||
|
||||
|
@ -92,7 +100,7 @@ onMounted(() => {
|
|||
:placeholder="`${$t('input')}${$t('title')}`"
|
||||
class="!w-[180px] ml-3"
|
||||
clearable
|
||||
@input="onSearch(route.params.messageType)"
|
||||
@input="onSearch((route.params as any).messageType)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ const onMenuClick = (item: any) => {
|
|||
|
||||
onBeforeMount(() => {
|
||||
// 获取所有消息类型
|
||||
messageTypeStore.getAllMessageTypeList();
|
||||
messageTypeStore.loadMessageTypeList();
|
||||
|
||||
// 设置路由消息类型
|
||||
messageTypeStore.form.messageType = route.params.messageType as string;
|
||||
|
@ -39,12 +39,15 @@ onBeforeMount(() => {
|
|||
class="pure-account-settings overflow-hidden px-2 dark:!bg-[var(--el-bg-color)] border-r-[1px] border-[var(--pure-border-color)]"
|
||||
>
|
||||
<el-menu :default-active="messageTypeStore.form.messageType" class="pure-account-settings-menu">
|
||||
<el-menu-item class="!h-[50px]" @click="router.go(-1)">
|
||||
<div class="flex items-center hover:!transition-all hover:!duration-200 hover:!text-base">
|
||||
<IconifyIconOffline :icon="leftLine" />
|
||||
<span>{{ $t('back') }}</span>
|
||||
<el-menu-item class="!h-[50px]">
|
||||
<div class="flex items-center">
|
||||
<el-button link type="primary" @click="router.push('/')">
|
||||
<template #icon>
|
||||
<IconifyIconOffline :icon="leftLine" />
|
||||
</template>
|
||||
{{ $t('returnToHomepage') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button class="ml-2" link type="primary" @click="router.push('/')">{{ $t('returnToHomepage') }}</el-button>
|
||||
</el-menu-item>
|
||||
<el-menu-item
|
||||
v-for="item in messageTypeStore.allMessageTypeList"
|
||||
|
|
|
@ -13,7 +13,7 @@ export const onSearch = async (messageType?: string) => {
|
|||
if (messageType) {
|
||||
messageUserStore.form.messageType = messageType;
|
||||
}
|
||||
await messageUserStore.getMessageList();
|
||||
await messageUserStore.fetchMessageReceivedPageByUser();
|
||||
messageUserStore.loading = false;
|
||||
};
|
||||
|
||||
|
@ -31,7 +31,7 @@ export const onDelete = async () => {
|
|||
if (!result) return;
|
||||
|
||||
// 删除数据
|
||||
await messageUserStore.deleteUserMessageByIds(ids);
|
||||
await messageUserStore.removeMessageReceivedByUser(ids);
|
||||
await onSearch();
|
||||
};
|
||||
|
||||
|
@ -49,7 +49,7 @@ export const markAsRead = async () => {
|
|||
if (!result) return;
|
||||
|
||||
// 标为已读
|
||||
await messageUserStore.updateUserMarkAsRead(ids);
|
||||
await messageUserStore.editeMessageByUser(ids);
|
||||
await onSearch();
|
||||
};
|
||||
|
||||
|
@ -67,6 +67,6 @@ export const markAsAllRead = async () => {
|
|||
if (!result) return;
|
||||
|
||||
// 标为已读
|
||||
await messageUserStore.updateUserMarkAsRead(ids);
|
||||
await messageUserStore.editeMessageByUser(ids);
|
||||
await onSearch();
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { MdEditor } from 'md-editor-v3';
|
||||
import 'md-editor-v3/lib/style.css';
|
||||
import { fetchUploadFile } from '@/api/v1/system/system';
|
||||
import { uploadFile } from '@/api/v1/system/system';
|
||||
import { formState } from '@/views/message-manger/message-editing/utils';
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@ const onUploadImg = async (files: any, callback: any) => {
|
|||
const form = new FormData();
|
||||
form.append('file', file);
|
||||
form.append('type', 'message');
|
||||
resolve(await fetchUploadFile(form));
|
||||
resolve(await uploadFile(form));
|
||||
});
|
||||
})
|
||||
);
|
||||
|
|
|
@ -66,7 +66,7 @@ const resetForm = (formEl: FormInstance | undefined) => {
|
|||
};
|
||||
|
||||
onMounted(() => {
|
||||
messageTypeStore.getAllMessageTypeList();
|
||||
messageTypeStore.loadMessageTypeList();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -175,7 +175,14 @@ onMounted(() => {
|
|||
|
||||
<!-- 消息等级 -->
|
||||
<el-form-item :label="$t('level')" prop="level">
|
||||
<el-select v-model="formState.level" :placeholder="$t('level')" clearable filterable remote remote-show-suffix>
|
||||
<el-select
|
||||
v-model="formState.level"
|
||||
:placeholder="$t('select') + $t('level')"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
remote-show-suffix
|
||||
>
|
||||
<el-option v-for="item in messageLevel" :key="item" :label="$t(item)" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
|
@ -15,7 +15,7 @@ const token = ref(getToken().token);
|
|||
|
||||
editorConfig.MENU_CONF['uploadImage'] = {
|
||||
// 服务端上传地址,根据实际业务改写
|
||||
server: `${defaultConfig.baseURL}/files/upload`,
|
||||
server: `${defaultConfig.baseURL}/files/private/upload`,
|
||||
// form-data 的 fieldName,根据实际业务改写
|
||||
fieldName: 'file',
|
||||
// 选择文件时的类型限制,根据实际业务改写
|
||||
|
|
|
@ -6,7 +6,7 @@ import { formState, settingLR } from '@/views/message-manger/message-editing/uti
|
|||
import MarkdownEditor from '@/views/message-manger/message-editing/components/markdown-editor.vue';
|
||||
import { onMounted } from 'vue';
|
||||
|
||||
defineOptions({ name: 'MessageEditer' });
|
||||
defineOptions({ name: 'MessageEdite' });
|
||||
|
||||
/** 退出提醒 */
|
||||
const exitAlter = () => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export const auth = {
|
||||
// 添加操作
|
||||
add: ['message::addMessage'],
|
||||
add: ['message::add'],
|
||||
};
|
||||
|
|
|
@ -13,6 +13,8 @@ export const rules = {
|
|||
editorType: [{ required: true, message: `${$t('input')}${$t('editorType')}`, trigger: 'blur' }],
|
||||
// 消息简介
|
||||
summary: [{ required: true, message: `${$t('input')}${$t('summary')}`, trigger: 'blur' }],
|
||||
// 消息简介
|
||||
level: [{ required: true, message: `${$t('select')}${$t('level')}`, trigger: 'blur' }],
|
||||
};
|
||||
|
||||
export const messageLevel = ['primary', 'success', 'warning', 'info', 'danger'];
|
||||
|
|
|
@ -2,7 +2,7 @@ import { reactive, ref } from 'vue';
|
|||
import type { UploadRawFile, UploadRequestOptions } from 'element-plus';
|
||||
import { SystemEnum } from '@/enums/upload';
|
||||
import { message } from '@/utils/message';
|
||||
import { fetchUploadFile } from '@/api/v1/system/system';
|
||||
import { uploadFile } from '@/api/v1/system/system';
|
||||
import { useAdminUserStore } from '@/store/system/adminUser';
|
||||
|
||||
// 用户信息列表
|
||||
|
@ -36,7 +36,7 @@ export const onSearchUserinfo = async (keyword: string) => {
|
|||
/** 上传时 */
|
||||
export const onUpload = async (options: UploadRequestOptions) => {
|
||||
const data = { file: options.file, type: 'message' };
|
||||
const result: any = await fetchUploadFile(data);
|
||||
const result: any = await uploadFile(data);
|
||||
coverUrl.value = result.data.url;
|
||||
formState.cover = result.data.filepath;
|
||||
};
|
||||
|
|
|
@ -62,7 +62,7 @@ onMounted(() => {
|
|||
|
||||
<template>
|
||||
<div class="main">
|
||||
<ReAuth :value="auth.search">
|
||||
<ReAuth :value="auth.query">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:inline="true"
|
||||
|
@ -211,7 +211,7 @@ onMounted(() => {
|
|||
|
||||
<!-- 批量删除按钮 -->
|
||||
<el-button
|
||||
v-if="hasAuth(auth.deleted)"
|
||||
v-if="hasAuth(auth.delete)"
|
||||
:disabled="!(selectIds.length > 0)"
|
||||
:icon="useRenderIcon(Delete)"
|
||||
plain
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
export const auth = {
|
||||
// 分页查询
|
||||
search: ['messageReceived::getMessageReceivedList'],
|
||||
query: ['messageReceived::query', 'messageReceived::queryPage'],
|
||||
// 更新操作
|
||||
update: ['messageReceived::updateMarkMessageReceived'],
|
||||
update: ['messageReceived::update'],
|
||||
// 删除操作
|
||||
deleted: ['messageReceived::deleteMessageReceivedByIds'],
|
||||
delete: ['messageReceived::delete'],
|
||||
};
|
||||
|
|
|
@ -36,9 +36,11 @@ export const columns: TableColumnList = [
|
|||
prop: 'level',
|
||||
formatter({ level }) {
|
||||
return (
|
||||
<ElTag type={level} effect={'plain'} round>
|
||||
{$t(level)}
|
||||
</ElTag>
|
||||
level && (
|
||||
<ElTag type={level} effect={'plain'} round>
|
||||
{$t(level)}
|
||||
</ElTag>
|
||||
)
|
||||
);
|
||||
},
|
||||
minWidth: 130,
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import { addDialog } from '@/components/ReDialog/index';
|
||||
import { h, ref } from 'vue';
|
||||
import { message, messageBox } from '@/utils/message';
|
||||
import { ref } from 'vue';
|
||||
import { messageBox } from '@/utils/message';
|
||||
import { $t } from '@/plugins/i18n';
|
||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||
import { useMessageReceivedStore } from '@/store/message/messageReceived';
|
||||
|
||||
// 删除ids
|
||||
|
@ -12,7 +10,7 @@ const messageReceivedStore = useMessageReceivedStore();
|
|||
/** 搜索初始化系统消息 */
|
||||
export async function onSearch() {
|
||||
messageReceivedStore.loading = true;
|
||||
await messageReceivedStore.getMessageReceivedList();
|
||||
await messageReceivedStore.fetchMessageReceivedPage();
|
||||
messageReceivedStore.loading = false;
|
||||
}
|
||||
|
||||
|
@ -27,38 +25,24 @@ export const updateMarkMessageReceived = async (status: boolean) => {
|
|||
});
|
||||
if (!result) return;
|
||||
|
||||
result = await messageReceivedStore.updateMarkMessageReceived({ ids: selectIds.value, status });
|
||||
result = await messageReceivedStore.editMessageReceived({ ids: selectIds.value, status });
|
||||
if (!result) return;
|
||||
await onSearch();
|
||||
};
|
||||
|
||||
/** 批量删除 */
|
||||
export const onDeleteBatch = async () => {
|
||||
const ids = selectIds.value;
|
||||
const formDeletedBatchRef = ref();
|
||||
|
||||
addDialog({
|
||||
title: $t('deleteBatchTip'),
|
||||
width: '30%',
|
||||
props: { formInline: { confirmText: '' } },
|
||||
draggable: true,
|
||||
fullscreenIcon: true,
|
||||
closeOnClickModal: false,
|
||||
contentRenderer: () => h(DeleteBatchDialog, { ref: formDeletedBatchRef }),
|
||||
beforeSure: (done, { options }) => {
|
||||
formDeletedBatchRef.value.formDeletedBatchRef.validate(async (valid: any) => {
|
||||
if (!valid) return;
|
||||
|
||||
const text = options.props.formInline.confirmText.toLowerCase();
|
||||
if (text === 'yes' || text === 'y') {
|
||||
// 删除数据
|
||||
const result = await messageReceivedStore.deleteMessageReceivedByIds(ids);
|
||||
if (!result) return;
|
||||
|
||||
await onSearch();
|
||||
done();
|
||||
} else message($t('deleteBatchTip'), { type: 'warning' });
|
||||
});
|
||||
},
|
||||
// 是否确认删除
|
||||
const result = await messageBox({
|
||||
title: $t('confirmDelete'),
|
||||
showMessage: false,
|
||||
confirmMessage: undefined,
|
||||
cancelMessage: $t('cancel_delete'),
|
||||
});
|
||||
if (!result) return;
|
||||
|
||||
// 删除数据
|
||||
const ids = selectIds.value;
|
||||
await messageReceivedStore.removeMessageReceivedByAdmin(ids);
|
||||
await onSearch();
|
||||
};
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
import { MdEditor } from 'md-editor-v3';
|
||||
import 'md-editor-v3/lib/style.css';
|
||||
import { fetchUploadFile } from '@/api/v1/system/system';
|
||||
import { uploadFile } from '@/api/v1/system/system';
|
||||
import { updateMessage } from '@/views/message-manger/message-send/utils';
|
||||
|
||||
/**
|
||||
* * 上传图片
|
||||
* @param files
|
||||
* @param callback
|
||||
*/
|
||||
/* 上传图片 */
|
||||
const onUploadImg = async (files: any, callback: any) => {
|
||||
// 上传图片等待结果
|
||||
const res = await Promise.all(
|
||||
|
@ -17,7 +13,7 @@ const onUploadImg = async (files: any, callback: any) => {
|
|||
const form = new FormData();
|
||||
form.append('file', file);
|
||||
form.append('type', 'message');
|
||||
resolve(await fetchUploadFile(form));
|
||||
resolve(await uploadFile(form));
|
||||
});
|
||||
})
|
||||
);
|
||||
|
|
|
@ -28,7 +28,7 @@ const formRef = ref<FormInstance>();
|
|||
const messageTypeStore = useMessageTypeStore();
|
||||
|
||||
onMounted(() => {
|
||||
messageTypeStore.getAllMessageTypeList();
|
||||
messageTypeStore.loadMessageTypeList();
|
||||
});
|
||||
|
||||
defineExpose({ formRef });
|
||||
|
|
|
@ -14,7 +14,7 @@ const token = ref(getToken().token);
|
|||
|
||||
editorConfig.MENU_CONF['uploadImage'] = {
|
||||
// 服务端上传地址,根据实际业务改写
|
||||
server: '/api/files/upload',
|
||||
server: '/api/files/private/upload',
|
||||
// form-data 的 fieldName,根据实际业务改写
|
||||
fieldName: 'file',
|
||||
// 选择文件时的类型限制,根据实际业务改写
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue