初始代码

This commit is contained in:
wangmingwei
2026-04-21 17:48:26 +08:00
parent d3631949e9
commit 7f9e424a5c
1822 changed files with 288292 additions and 0 deletions

54
types/axios.d.ts vendored Normal file
View File

@@ -0,0 +1,54 @@
export type ErrorMessageMode = 'none' | 'modal' | 'message' | undefined;
export interface RequestOptions {
// Splicing request parameters to url
joinParamsToUrl?: boolean;
// Format request parameter time
formatDate?: boolean;
// Whether to process the request result
isTransformResponse?: boolean;
// Whether to return native response headers
// For example: use this attribute when you need to get the response headers
isReturnNativeResponse?: boolean;
// Whether to join url
joinPrefix?: boolean;
// Interface address, use the default apiUrl if you leave it blank
apiUrl?: string;
// 请求拼接路径
urlPrefix?: string;
// Error message prompt type
errorMessageMode?: ErrorMessageMode;
// Whether to add a timestamp
joinTime?: boolean;
ignoreCancelToken?: boolean;
// Whether to send token in header
withToken?: boolean;
// 是否加密
useCipher?: boolean;
// 请求重试机制
retryRequest?: RetryRequest;
}
export interface RetryRequest {
isOpenRetry: boolean;
count: number;
waitTime: number;
}
export interface Result<T = any> {
code: number;
msg: string;
data?: T;
}
// multipart/form-data: upload file
export interface UploadFileParams {
// Other parameters
data?: Recordable;
// File parameter interface field name
name?: string;
// file name
file: File | Blob;
// file name
filename?: string;
[key: string]: any;
}

171
types/config.d.ts vendored Normal file
View File

@@ -0,0 +1,171 @@
import { MenuTypeEnum, MenuModeEnum, TriggerEnum, MixSidebarTriggerEnum } from '@/enums/menuEnum';
import { ContentEnum, ThemeEnum, RouterTransitionEnum, SettingButtonPositionEnum, SessionTimeoutProcessingEnum } from '@/enums/appEnum';
import { CacheTypeEnum } from '@/enums/cacheEnum';
export type LocaleType = 'zh_CN' | 'zh_TW' | 'en_US' | 'ru' | 'ja' | 'ko';
export interface MenuSetting {
bgColor: string;
fixed: boolean;
collapsed: boolean;
siderHidden: boolean;
canDrag: boolean;
show: boolean;
hidden: boolean;
split: boolean;
menuWidth: number;
mode: MenuModeEnum;
type: MenuTypeEnum;
theme: ThemeEnum;
topMenuAlign: 'start' | 'center' | 'end';
trigger: TriggerEnum;
accordion: boolean;
closeMixSidebarOnChange: boolean;
collapsedShowTitle: boolean;
mixSideTrigger: MixSidebarTriggerEnum;
mixSideFixed: boolean;
}
export interface MultiTabsSetting {
cache: boolean;
show: boolean;
showIcon: boolean;
showQuick: boolean;
canDrag: boolean;
showRedo: boolean;
showFold: boolean;
showIcon: boolean;
}
export interface HeaderSetting {
bgColor: string;
fixed: boolean;
show: boolean;
theme: ThemeEnum;
// Turn on full screen
showFullScreen: boolean;
// Whether to show the lock screen
useLockPage: boolean;
// Show document button
showDoc: boolean;
// Show message center button
showNotice: boolean;
showSearch: boolean;
}
export interface LocaleSetting {
showPicker: boolean;
// Current language
locale: LocaleType;
// default language
fallback: LocaleType;
// available Locales
availableLocales: LocaleType[];
}
export interface TransitionSetting {
// Whether to open the page switching animation
enable: boolean;
// Route basic switching animation
basicTransition: RouterTransitionEnum;
// Whether to open page switching loading
openPageLoading: boolean;
// Whether to open the top progress bar
openNProgress: boolean;
}
export interface ProjectConfig {
// Storage location of permission related information
permissionCacheType: CacheTypeEnum;
// Whether to show the configuration button
showSettingButton: boolean;
// Whether to show the theme switch button
showDarkModeToggle: boolean;
// Configure where the button is displayed
settingButtonPosition: SettingButtonPositionEnum;
// Session timeout processing
sessionTimeoutProcessing: SessionTimeoutProcessingEnum;
// Website gray mode, open for possible mourning dates
grayMode: boolean;
// Whether to turn on the color weak mode
colorWeak: boolean;
// Theme color
themeColor: string;
// 系统背景
sysBg: string;
// The main interface is displayed in full screen, the menu is not displayed, and the top
fullContent: boolean;
// content width
contentMode: ContentEnum;
// Whether to display the logo
showLogo: boolean;
// Whether to show the global footer
showFooter: boolean;
// menuType: MenuTypeEnum;
headerSetting: HeaderSetting;
// menuSetting
menuSetting: MenuSetting;
// Multi-tab settings
multiTabsSetting: MultiTabsSetting;
// Animation configuration
transitionSetting: TransitionSetting;
// pageLayout whether to enable keep-alive
openKeepAlive: boolean;
// Lock screen time
lockTime: number;
// Show breadcrumbs
showBreadCrumb: boolean;
// Show breadcrumb icon
showBreadCrumbIcon: boolean;
// Use error-handler-plugin
useErrorHandle: boolean;
// Whether to open back to top
useOpenBackTop: boolean;
// Is it possible to embed iframe pages
canEmbedIFramePage: boolean;
// Whether to delete unclosed messages and notify when switching the interface
closeMessageOnSwitch: boolean;
// Whether to cancel the http request that has been sent but not responded when switching the interface.
removeAllHttpPending: boolean;
sysConfigInfo: SysConfigInfo;
globalBorderRadius: number;
}
export interface GlobConfig {
// Site title
title: string;
// Service interface url
apiUrl: string;
// Report Service interface url
reportApiUrl: string;
// Upload url
uploadUrl?: string;
// Service interface url prefix
urlPrefix?: string;
// Project abbreviation
shortName: string;
webSocketUrl: string;
cipherKey: string;
aMapJsKey: string;
aMapWebKey: string;
aMapSecurityJsCode: string;
filePreviewServer: string;
dataVUrl: string;
reportServer: string;
report: string;
}
export interface GlobEnvConfig {
// Site title
VITE_GLOB_APP_TITLE: string;
// Service interface url
VITE_GLOB_API_URL: string;
// Report Service interface url
VITE_GLOB_REPORT_API_URL: string;
// Service interface url prefix
VITE_GLOB_API_URL_PREFIX?: string;
// Project abbreviation
VITE_GLOB_APP_SHORT_NAME: string;
VITE_GLOB_WEBSOCKET_URL: string;
}

90
types/global.d.ts vendored Normal file
View File

@@ -0,0 +1,90 @@
import type { ComponentRenderProxy, VNode, VNodeChild, ComponentPublicInstance, FunctionalComponent, PropType as VuePropType } from 'vue';
declare global {
const __APP_INFO__: {
pkg: {
name: string;
version: string;
dependencies: Recordable<string>;
devDependencies: Recordable<string>;
};
lastBuildTime: string;
};
// declare interface Window {
// // Global vue app instance
// __APP__: App<Element>;
// }
// vue
declare type PropType<T> = VuePropType<T>;
declare type VueNode = VNodeChild | JSX.Element;
export type Writable<T> = {
-readonly [P in keyof T]: T[P];
};
declare type Nullable<T> = T | null;
declare type NonNullable<T> = T extends null | undefined ? never : T;
declare type Recordable<T = any> = Record<string, T>;
declare type ReadonlyRecordable<T = any> = {
readonly [key: string]: T;
};
declare type Indexable<T = any> = {
[key: string]: T;
};
declare type DeepPartial<T> = {
[P in keyof T]?: DeepPartial<T[P]>;
};
declare type TimeoutHandle = ReturnType<typeof setTimeout>;
declare type IntervalHandle = ReturnType<typeof setInterval>;
declare interface ChangeEvent extends Event {
target: HTMLInputElement;
}
declare interface WheelEvent {
path?: EventTarget[];
}
interface ImportMetaEnv extends ViteEnv {
__: unknown;
}
declare interface ViteEnv {
VITE_PORT: number;
VITE_USE_PWA: boolean;
VITE_PUBLIC_PATH: string;
VITE_PROXY: [string, string][];
VITE_GLOB_APP_TITLE: string;
VITE_GLOB_APP_SHORT_NAME: string;
VITE_USE_CDN: boolean;
VITE_DROP_CONSOLE: boolean;
VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none';
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE: boolean;
VITE_GENERATE_UI: string;
VITE_CDN: string;
}
declare function parseInt(s: string | number, radix?: number): number;
declare function parseFloat(string: string | number): number;
namespace JSX {
// tslint:disable no-empty-interface
type Element = VNode;
// tslint:disable no-empty-interface
type ElementClass = ComponentRenderProxy;
interface ElementAttributesProperty {
$props: any;
}
interface IntrinsicElements {
[elem: string]: any;
}
interface IntrinsicAttributes {
[elem: string]: any;
}
}
}
declare module 'vue' {
export type JSXComponent<Props = any> = { new (): ComponentPublicInstance<Props> } | FunctionalComponent<Props>;
}

27
types/index.d.ts vendored Normal file
View File

@@ -0,0 +1,27 @@
declare interface Fn<T = any, R = T> {
(...arg: T[]): R;
}
declare interface PromiseFn<T = any, R = T> {
(...arg: T[]): Promise<R>;
}
declare type RefType<T> = T | null;
declare type LabelValueOptions = {
label: string;
value: any;
[key: string]: string | number | boolean;
}[];
declare type EmitType = (event: string, ...args: any[]) => void;
declare type TargetContext = '_self' | '_blank';
declare interface ComponentElRef<T extends HTMLElement = HTMLDivElement> {
$el: T;
}
declare type ComponentRef<T extends HTMLElement = HTMLDivElement> = ComponentElRef<T> | null;
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;

16
types/module.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
declare module '*.vue' {
import { DefineComponent } from 'vue';
const Component: DefineComponent<{}, {}, any>;
export default Component;
}
declare module 'ant-design-vue/es/locale/*' {
import { Locale } from 'ant-design-vue/types/locale-provider';
const locale: Locale & ReadonlyRecordable;
export default locale as Locale & ReadonlyRecordable;
}
declare module 'virtual:*' {
const result: any;
export default result;
}

115
types/store.d.ts vendored Normal file
View File

@@ -0,0 +1,115 @@
import { ErrorTypeEnum } from '@/enums/exceptionEnum';
import { MenuModeEnum, MenuTypeEnum } from '@/enums/menuEnum';
// Lock screen information
export interface LockInfo {
// Is it locked?
isLock?: boolean;
}
// Error-log information
export interface ErrorLogInfo {
// Type of error
type: ErrorTypeEnum;
// Error file
file: string;
// Error name
name?: string;
// Error message
message: string;
// Error stack
stack?: string;
// Error detail
detail: string;
// Error url
url: string;
// Error time
time?: string;
}
export interface PermissionChildItem {
id: string;
enCode: string;
fullName: string;
}
export interface PermissionInfo {
modelId: string;
moduleName: string;
button: PermissionChildItem[];
column: PermissionChildItem[];
form: PermissionChildItem[];
resource: PermissionChildItem[];
}
export interface SysConfigInfo {
appIcon: Nullable<string>;
companyName: Nullable<string>;
copyright: Nullable<string>;
loginIcon: Nullable<string>;
logoIcon: Nullable<string>;
navigationIcon: Nullable<string>;
workLogoIcon: Nullable<string>;
newUserDefaultPassword: Nullable<string>;
sysName: Nullable<string>;
sysVersion: Nullable<string>;
title: Nullable<string>;
yunzhupaasDomain: Nullable<string>;
defaultView: Nullable<string>;
showLunarCalendar: Nullable<boolean>;
firstDay: number;
duration: number;
flowSign: number;
flowTodo: number;
delegateScope: number;
delegateAck: number;
proxyScope: number;
proxyAck: number;
}
export interface SystemInfo {
id: string;
name: Nullable<string>;
icon: Nullable<string>;
currentSystem: boolean;
}
export interface UserInfo {
birthday: Nullable<number>;
departmentId: Nullable<string>;
departmentName: Nullable<string>;
email: Nullable<string>;
headIcon: Nullable<string>;
isAdministrator: boolean;
manager: Nullable<string>;
mobilePhone: Nullable<string>;
organizeId: Nullable<string>;
organizeIdList: Nullable<string[]>;
organizeName: Nullable<string>;
portalId: Nullable<string>;
positionId: Nullable<string>;
positionName: string;
positionIds: any[];
prevLogin: number;
prevLoginIPAddress: Nullable<string>;
prevLoginIPAddressName: Nullable<string>;
prevLoginTime: Nullable<number>;
roleName: Nullable<string>;
roleIds: string[];
groupIds: string[];
systemId: string;
systemIds: SystemInfo[];
userAccount: string;
userId: string;
userName: Nullable<string>;
signImg: string;
signId: string;
standingList: any[];
}
export interface BeforeMiniState {
menuCollapsed?: boolean;
menuSplit?: boolean;
menuMode?: MenuModeEnum;
menuType?: MenuTypeEnum;
}

5
types/utils.d.ts vendored Normal file
View File

@@ -0,0 +1,5 @@
import type { ComputedRef, Ref } from 'vue';
export type DynamicProps<T> = {
[P in keyof T]: Ref<T[P]> | T[P] | ComputedRef<T[P]>;
};

43
types/vue-router.d.ts vendored Normal file
View File

@@ -0,0 +1,43 @@
export {};
declare module 'vue-router' {
interface RouteMeta extends Record<string | number | symbol, unknown> {
orderNo?: number;
// title
title: string;
// dynamic router level.
dynamicLevel?: number;
// dynamic router real route path (For performance).
realPath?: string;
// Whether to ignore permissions
ignoreAuth?: boolean;
// Whether not to cache
ignoreKeepAlive?: boolean;
// Is it fixed on tab
affix?: boolean;
// icon on tab
icon?: string;
frameSrc?: string;
// current page transition
transitionName?: string;
// Whether the route has been dynamically added
hideBreadcrumb?: boolean;
// Hide submenu
hideChildrenInMenu?: boolean;
// Carrying parameters
carryParam?: boolean;
// Used internally to mark single-level menus
single?: boolean;
// Currently active menu
currentActiveMenu?: string;
// Never show in tab
hideTab?: boolean;
// Never show in menu
hideMenu?: boolean;
isLink?: boolean;
// only build for Menu
ignoreRoute?: boolean;
// Hide path for children
hidePathForChildren?: boolean;
}
}