refactor: 系统管理页面重构和ts类型声明优化

Former-commit-id: 40263bbb072596ada41ef33d9170841e7e66cd01
This commit is contained in:
郝先瑞
2022-06-15 00:48:17 +08:00
parent 928ba2dbd8
commit 321b584f9f
116 changed files with 1692 additions and 1485 deletions

View File

@@ -0,0 +1,33 @@
import { PageQueryParam ,PageResult} from '../base';
/**
* 优惠券查询参数类型
*/
export interface CouponQueryParam extends PageQueryParam {
status?: number;
}
/**
* 优惠券分页列表项
*/
export interface CouponItem {
id: string;
name: string;
type: string;
}
/**
*优惠券分页项类型
*/
export type CouponPageResult = PageResult<CouponItem[]>;
/**
* 广告表单类型声明
*/
export interface CouponFormData {
id?: number;
name: string;
type: string;
}

View File

@@ -1,17 +1,14 @@
import { PageQueryParam, PageResult } from '../base';
/**
* 客户端查询参数类型声明
* 客户端查询参数类型
*/
export interface ClientQueryParam extends PageQueryParam {
/**
* 客户端名称
*/
clientId: string | undefined;
keywords?: string;
}
/**
* 客户端分页列表项声明
* 客户端分页列表项
*/
export interface ClientItem {
clientId: string;
@@ -28,12 +25,12 @@ export interface ClientItem {
}
/**
* 客户端分页项类型声明
* 客户端分页项类型
*/
export type ClientPageResult = PageResult<ClientItem[]>;
/**
* 客户端表单类型声明
* 客户端表单类型
*/
export interface ClientFormData {
authorizedGrantTypes: string;

View File

@@ -29,7 +29,7 @@ export type DictPageResult = PageResult<Dict[]>;
/**
* 字典表单类型声明
*/
export interface DictFormData {
export interface DictFormTypeData {
id: number | undefined;
name: string;
code: string;
@@ -44,11 +44,11 @@ export interface DictItemQueryParam extends PageQueryParam {
/**
* 字典项名称
*/
name: string | undefined;
name?: string;
/**
* 字典编码
* 字典类型编码
*/
dictCode: string | undefined;
typeCode?: string;
}
/**
@@ -75,8 +75,8 @@ export type DictItemPageResult = PageResult<DictItem[]>;
*/
export interface DictItemFormData {
id?: number;
dictCode?: string;
dictName?: string;
typeCode?: string;
typeName?: string;
name: string;
code: string;
value: string;

View File

@@ -1,14 +1,14 @@
import { PageQueryParam, PageResult } from '../base';
/**
* 角色查询参数类型声明
* 角色查询参数类型
*/
export interface RoleQueryParam extends PageQueryParam {
name?: string;
}
/**
* 角色分页列表项声明
* 角色分页列表项
*/
export interface RoleItem {
id: string;
@@ -22,17 +22,25 @@ export interface RoleItem {
}
/**
* 角色分页项类型声明
* 角色分页项类型
*/
export type RolePageResult = PageResult<RoleItem[]>;
/**
* 角色表单类型声明
* 角色表单类型
*/
export interface RoleFormData {
id: number | undefined;
id: string | undefined;
name: string;
code: string;
sort: number;
status: number;
}
/**
*
*/
export interface RoleResourceData {
menuIds: string[];
permIds: string[];
}

View File

@@ -1,9 +1,5 @@
/**
* 组件类型声明
*/
/**
* 弹窗属性类型声明
* 弹窗类型
*/
export interface Dialog {
title: string;
@@ -11,10 +7,11 @@ export interface Dialog {
}
/**
* 通用组件选择项类型声明
* 通用组件选择项类型
*/
export interface Option {
value: string;
label: string;
checked?: boolean;
children?: Option[];
}

19
src/types/index.d.ts vendored
View File

@@ -1,19 +0,0 @@
export * from './api/system/login';
export * from './api/system/user';
export * from './api/system/role';
export * from './api/system/menu';
export * from './api/system/dept';
export * from './api/system/dict';
export * from './api/system/perm';
export * from './api/system/client';
export * from './api/pms/goods';
export * from './api/pms/brand';
export * from './api/sms/advert';
export * from './api/oms/order';
export * from './api/ums/member';
export * from './api/lab/seata';
export * from './store';
export * from './common';

55
src/types/store.d.ts vendored
View File

@@ -1,55 +0,0 @@
import { RouteRecordRaw, RouteLocationNormalized } from 'vue-router';
/**
* 用户状态类型声明
*/
export interface AppState {
device: string;
sidebar: {
opened: boolean;
withoutAnimation: boolean;
};
language: string;
size: string;
}
/**
* 权限类型声明
*/
export interface PermissionState {
routes: RouteRecordRaw[];
addRoutes: RouteRecordRaw[];
}
/**
* 设置状态类型声明
*/
export interface SettingState {
theme: string;
tagsView: boolean;
fixedHeader: boolean;
showSettings: boolean;
sidebarLogo: boolean;
}
/**
* 标签状态类型声明
*/
export interface TagView extends Partial<RouteLocationNormalized> {
title?: string;
}
export interface TagsViewState {
visitedViews: TagView[];
cachedViews: string[];
}
/**
* 用户状态类型声明
*/
export interface UserState {
token: string;
nickname: string;
avatar: string;
roles: string[];
perms: string[];
}

12
src/types/store/app.d.ts vendored Normal file
View File

@@ -0,0 +1,12 @@
/**
* 系统类型声明
*/
export interface AppState {
device: string;
sidebar: {
opened: boolean;
withoutAnimation: boolean;
};
language: string;
size: string;
}

7
src/types/store/permission.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
/**
* 权限类型声明
*/
export interface PermissionState {
routes: RouteRecordRaw[];
addRoutes: RouteRecordRaw[];
}

10
src/types/store/setting.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
/**
* 设置状态类型声明
*/
export interface SettingState {
theme: string;
tagsView: boolean;
fixedHeader: boolean;
showSettings: boolean;
sidebarLogo: boolean;
}

13
src/types/store/tagsview.d.ts vendored Normal file
View File

@@ -0,0 +1,13 @@
import { RouteLocationNormalized } from 'vue-router';
/**
* 标签状态类型声明
*/
export interface TagView extends Partial<RouteLocationNormalized> {
title?: string;
}
export interface TagsViewState {
visitedViews: TagView[];
cachedViews: string[];
}

7
src/types/store/user.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
export interface UserState {
token: string;
nickname: string;
avatar: string;
roles: string[];
perms: string[];
}