feat(projects): page manage_role

This commit is contained in:
Soybean
2024-01-28 00:44:21 +08:00
parent 2724169eb6
commit 237c6d227e
23 changed files with 909 additions and 60 deletions

75
src/typings/api.d.ts vendored
View File

@ -4,10 +4,41 @@
* All backend api type
*/
declare namespace Api {
namespace Common {
/** common params of paginating */
interface PaginatingCommonParams {
/** current page number */
current: number;
/** page size */
size: number;
/** total count */
total: number;
}
/** common params of paginating query list data */
interface PaginatingQueryRecord<T extends NonNullable<unknown>> extends PaginatingCommonParams {
records: T[];
}
/** common record */
type CommonRecord<T extends NonNullable<unknown>> = {
/** record id */
id: number;
/** record creator */
createBy: string;
/** record create time */
createTime: string;
/** record updater */
updateBy: string;
/** record update time */
updateTime: string;
} & T;
}
/**
* Namespace Auth
* namespace Auth
*
* Backend api module: "auth"
* backend api module: "auth"
*/
namespace Auth {
interface LoginToken {
@ -23,9 +54,9 @@ declare namespace Api {
}
/**
* Namespace Route
* namespace Route
*
* Backend api module: "route"
* backend api module: "route"
*/
namespace Route {
type ElegantConstRoute = import('@elegant-router/types').ElegantConstRoute;
@ -39,4 +70,40 @@ declare namespace Api {
home: import('@elegant-router/types').LastLevelRouteKey;
}
}
/**
* namespace SystemManage
*
* backend api module: "systemManage"
*/
namespace SystemManage {
/**
* role status
*
* - "1": enabled
* - "2": disabled
*/
type RoleStatus = '1' | '2';
/** role */
type Role = Common.CommonRecord<{
/** role name */
roleName: string;
/** role code */
roleCode: string;
/** role description */
roleDesc: string;
/** role status */
roleStatus: RoleStatus | null;
}>;
/** role search params */
type RoleSearchParams = CommonType.RecordNullable<
Pick<Api.SystemManage.Role, 'roleName' | 'roleCode' | 'roleStatus'> &
Pick<Common.PaginatingCommonParams, 'current' | 'size'>
>;
/** role list */
type RoleList = Common.PaginatingQueryRecord<Role>;
}
}

55
src/typings/app.d.ts vendored
View File

@ -249,23 +249,34 @@ declare namespace App {
title: string;
};
common: {
tip: string;
action: string;
add: string;
addSuccess: string;
edit: string;
editSuccess: string;
backToHome: string;
batchDelete: string;
cancel: string;
check: string;
columnSetting: string;
confirm: string;
delete: string;
deleteSuccess: string;
batchDelete: string;
confirm: string;
cancel: string;
pleaseCheckValue: string;
action: string;
backToHome: string;
lookForward: string;
userCenter: string;
confirmDelete: string;
edit: string;
index: string;
logout: string;
logoutConfirm: string;
lookForward: string;
modify: string;
modifySuccess: string;
operate: string;
pleaseCheckValue: string;
refresh: string;
reset: string;
search: string;
tip: string;
update: string;
updateSuccess: string;
userCenter: string;
};
theme: {
themeSchema: { title: string } & Record<UnionKey.ThemeScheme, string>;
@ -428,8 +439,30 @@ declare namespace App {
backTab: string;
};
};
manage: {
role: {
title: string;
form: {
roleName: string;
roleCode: string;
roleStatus: string;
roleDesc: string;
};
roleName: string;
roleCode: string;
roleStatus: string;
roleDesc: string;
addRole: string;
editRole: string;
status: {
enable: string;
disable: string;
};
};
};
};
form: {
required: string;
userName: FormMsg;
phone: FormMsg;
pwd: FormMsg;

View File

@ -1,5 +1,5 @@
/** The common type namespace */
declare namespace Common {
declare namespace CommonType {
/** The strategic pattern */
interface StrategicPattern {
/** The condition */
@ -17,4 +17,9 @@ declare namespace Common {
type Option<K> = { value: K; label: string };
type YesOrNo = 'Y' | 'N';
/** add null to all properties */
type RecordNullable<T> = {
[K in keyof T]?: T[K] | null;
};
}

View File

@ -16,10 +16,18 @@ declare module 'vue' {
ExceptionBase: typeof import('./../components/common/exception-base.vue')['default']
FullScreen: typeof import('./../components/common/full-screen.vue')['default']
IconAntDesignReloadOutlined: typeof import('~icons/ant-design/reload-outlined')['default']
IconAntDesignSettingOutlined: typeof import('~icons/ant-design/setting-outlined')['default']
IconGridiconsFullscreen: typeof import('~icons/gridicons/fullscreen')['default']
IconGridiconsFullscreenExit: typeof import('~icons/gridicons/fullscreen-exit')['default']
IconIcRoundDelete: typeof import('~icons/ic/round-delete')['default']
IconIcRoundPlus: typeof import('~icons/ic/round-plus')['default']
IconIcRoundRefresh: typeof import('~icons/ic/round-refresh')['default']
IconIcRoundSearch: typeof import('~icons/ic/round-search')['default']
IconIcRoundSettings: typeof import('~icons/ic/round-settings')['default']
IconLocalBanner: typeof import('~icons/local/banner')['default']
IconLocalLogo: typeof import('~icons/local/logo')['default']
IconMdiDrag: typeof import('~icons/mdi/drag')['default']
IconMdiRefresh: typeof import('~icons/mdi/refresh')['default']
LangSwitch: typeof import('./../components/common/lang-switch.vue')['default']
LookForward: typeof import('./../components/custom/look-forward.vue')['default']
MenuToggler: typeof import('./../components/common/menu-toggler.vue')['default']
@ -30,6 +38,7 @@ declare module 'vue' {
NCard: typeof import('naive-ui')['NCard']
NCheckbox: typeof import('naive-ui')['NCheckbox']
NColorPicker: typeof import('naive-ui')['NColorPicker']
NDataTable: typeof import('naive-ui')['NDataTable']
NDescriptions: typeof import('naive-ui')['NDescriptions']
NDescriptionsItem: typeof import('naive-ui')['NDescriptionsItem']
NDialogProvider: typeof import('naive-ui')['NDialogProvider']
@ -39,6 +48,7 @@ declare module 'vue' {
NDropdown: typeof import('naive-ui')['NDropdown']
NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem']
NFormItemGi: typeof import('naive-ui')['NFormItemGi']
NGi: typeof import('naive-ui')['NGi']
NGrid: typeof import('naive-ui')['NGrid']
NGridItem: typeof import('naive-ui')['NGridItem']
@ -51,6 +61,7 @@ declare module 'vue' {
NMenu: typeof import('naive-ui')['NMenu']
NMessageProvider: typeof import('naive-ui')['NMessageProvider']
NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
NPopover: typeof import('naive-ui')['NPopover']
NSelect: typeof import('naive-ui')['NSelect']
NSpace: typeof import('naive-ui')['NSpace']
NStatistic: typeof import('naive-ui')['NStatistic']
@ -67,6 +78,8 @@ declare module 'vue' {
SoybeanAvatar: typeof import('./../components/custom/soybean-avatar.vue')['default']
SvgIcon: typeof import('./../components/custom/svg-icon.vue')['default']
SystemLogo: typeof import('./../components/common/system-logo.vue')['default']
TableColumnSetting: typeof import('./../components/advanced/table-column-setting.vue')['default']
TableColumnSettings: typeof import('./../components/advanced/table-column-settings.vue')['default']
ThemeSchemaSwitch: typeof import('./../components/common/theme-schema-switch.vue')['default']
WaveBg: typeof import('./../components/custom/wave-bg.vue')['default']
}

View File

@ -30,7 +30,7 @@ declare namespace Env {
*
* Only valid in the development environment
*/
readonly VITE_HTTP_PROXY?: Common.YesOrNo;
readonly VITE_HTTP_PROXY?: CommonType.YesOrNo;
/** The back service env */
readonly VITE_SERVICE_ENV?: App.Service.EnvType;
/**
@ -54,7 +54,7 @@ declare namespace Env {
*/
readonly VITE_MENU_ICON: string;
/** Whether to build with sourcemap */
readonly VITE_SOURCE_MAP?: Common.YesOrNo;
readonly VITE_SOURCE_MAP?: CommonType.YesOrNo;
/**
* Iconify api provider url
*