diff --git a/src/service/api/index.ts b/src/service/api/index.ts index c9d31d1..89f4e58 100644 --- a/src/service/api/index.ts +++ b/src/service/api/index.ts @@ -1,3 +1,2 @@ export * from './auth'; export * from './route'; -export * from './system-manage'; diff --git a/src/service/api/system-manage.ts b/src/service/api/system-manage.ts deleted file mode 100644 index cb975b2..0000000 --- a/src/service/api/system-manage.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { request } from '../request'; - -/** get role list */ -export function fetchGetRoleList(params?: Api.SystemManage.RoleSearchParams) { - return request({ - url: '/systemManage/getRoleList', - method: 'get', - params - }); -} - -/** - * get all roles - * - * these roles are all enabled - */ -export function fetchGetAllRoles() { - return request({ - url: '/systemManage/getAllRoles', - method: 'get' - }); -} - -/** get user list */ -export function fetchGetUserList(params?: Api.SystemManage.UserSearchParams) { - return request({ - url: '/systemManage/getUserList', - method: 'get', - params - }); -} - -/** get menu list */ -export function fetchGetMenuList() { - return request({ - url: '/systemManage/getMenuList/v2', - method: 'get' - }); -} - -/** get all pages */ -export function fetchGetAllPages() { - return request({ - url: '/systemManage/getAllPages', - method: 'get' - }); -} - -/** get menu tree */ -export function fetchGetMenuTree() { - return request({ - url: '/systemManage/getMenuTree', - method: 'get' - }); -} diff --git a/src/service/api/system.ts b/src/service/api/system.ts new file mode 100644 index 0000000..e700e2a --- /dev/null +++ b/src/service/api/system.ts @@ -0,0 +1,32 @@ +import { request } from '../request'; + +// 获取配置 +export function systemConfigApi() { + return request({ + url: '/api/system-config', + method: 'get', + }); +} +// 添加配置项 +export function addSystemConfigApi(data:{group_key:string, label:string,color:string,remark?:string,value:string}) { + return request({ + url: '/api/system-config', + method: 'post', + data, + }); +} +// 编辑配置项 +export function editSystemConfigApi(id:number, data:{group_key:string, label:string,color:string,remark?:string,value:string}) { + return request({ + url: `/api/system-config/${id}`, + method: 'put', + data, + }); +} +// 删除配置项 +export function deleteSystemConfigApi(id:number) { + return request({ + url: `/api/system-config/${id}`, + method: 'delete', + }); +} diff --git a/src/utils/common.ts b/src/utils/common.ts index c8843fa..1aba4a5 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -140,4 +140,18 @@ export function generateSecurePassword(passwordLength:number) { // 获取 token export const getToken = () => { return localStorage.getItem('token'); -}; \ No newline at end of file +}; + +// tag自定义样式颜色 +// 文字颜色 +export const tagTextColor = (color: string) => { + return color || '#333'; +} +// 背景颜色 +export const tagBgColor = (color: string) => { + return getColorWithOpacity((color || '#333'), 0.08); +} +// 边框颜色 +export const tagBorderColor = (color: string) => { + return getColorWithOpacity((color || '#333'), 0.3); +} \ No newline at end of file diff --git a/src/views/systemManage/setting/index.vue b/src/views/systemManage/setting/index.vue index 7cc706d..a434366 100644 --- a/src/views/systemManage/setting/index.vue +++ b/src/views/systemManage/setting/index.vue @@ -1,9 +1,10 @@