diff --git a/src/types/api/base.d.ts b/src/types/api/base.d.ts new file mode 100644 index 00000000..d934383c --- /dev/null +++ b/src/types/api/base.d.ts @@ -0,0 +1,11 @@ + +export interface PageQueryParam { + pageNum: number, + pageSize: number +} + +export interface PageResult { + list: T, + total: number +} + diff --git a/src/types/api/lab/seata.d.ts b/src/types/api/lab/seata.d.ts new file mode 100644 index 00000000..e3d555a7 --- /dev/null +++ b/src/types/api/lab/seata.d.ts @@ -0,0 +1,9 @@ +/** + * Seata表单类型声明 + */ +export interface SeataFormData { + openTx: boolean; + stockEx: boolean; + accountEx: boolean; + orderEx: boolean; +} \ No newline at end of file diff --git a/src/types/api/oms/order.d.ts b/src/types/api/oms/order.d.ts new file mode 100644 index 00000000..f4b941d5 --- /dev/null +++ b/src/types/api/oms/order.d.ts @@ -0,0 +1,56 @@ +import { PageQueryParam, PageResult } from "../base" + +/** + * 订单查询参数类型声明 + */ +export interface OrderQueryParam extends PageQueryParam { + orderSn: string | undefined; + status: number | undefined; +} + +/** + * 订单分页列表项声明 + */ +export interface Order { + id: string; + orderSn: string; + totalAmount: string; + payAmount: string; + payType: number; + status: number; + totalQuantity: number; + gmtCreate: string; + memberId: string; + sourceType: number; + orderItems: OrderItem[]; +} +export interface OrderItem { + id: string; + orderId: string; + skuId: string; + skuName: string; + picUrl: string; + price: string; + count: number; + totalAmount: number; +} + +/** + * 订单分页项类型声明 + */ +export type OrderPageResult = PageResult + +/** + * 订单表单类型声明 + */ +export interface OrderDetail { + id: number | undefined; + title: string; + picUrl: string; + beginTime: string; + endTime: string; + status: number; + sort: number; + url: string; + remark: string; +} \ No newline at end of file diff --git a/src/types/api/pms/brand.d.ts b/src/types/api/pms/brand.d.ts new file mode 100644 index 00000000..8d0dda67 --- /dev/null +++ b/src/types/api/pms/brand.d.ts @@ -0,0 +1,34 @@ +import { PageQueryParam, PageResult } from "../base" + +/** + * 品牌查询参数类型声明 + */ +export interface BrandQueryParam extends PageQueryParam { + name?: string +} + + +/** + * 品牌分页列表项声明 + */ +export interface BrandItem { + id: string; + name: string; + logoUrl: string; + sort: number; +} + +/** + * 品牌分页项类型声明 + */ +export type BrandPageResult = PageResult + +/** + * 品牌表单类型声明 + */ +export interface BrandFormData { + id: number | undefined, + name: string, + logoUrl: string, + sort: number +} \ No newline at end of file diff --git a/src/types/api/pms/goods.d.ts b/src/types/api/pms/goods.d.ts new file mode 100644 index 00000000..9493cb64 --- /dev/null +++ b/src/types/api/pms/goods.d.ts @@ -0,0 +1,72 @@ +import { PageQueryParam, PageResult } from "../base" + +/** + * 商品查询参数类型声明 + */ +export interface GoodsQueryParam extends PageQueryParam { + name?: stirng, + categoryId?: number +} + +/** + * 商品列表项类型声明 + */ +export interface GoodsItem { + id: string; + name: string; + categoryId?: any; + brandId?: any; + originPrice: string; + price: string; + sales: number; + picUrl?: any; + album?: any; + unit?: any; + description: string; + detail: string; + status?: any; + categoryName: string; + brandName: string; + skuList: SkuItem[]; +} + +/** + * 商品规格项类型声明 + */ +export interface SkuItem { + id: string; + skuSn?: any; + name: string; + spuId?: any; + specIds: string; + price: string; + stockNum: number; + lockedStockNum?: any; + picUrl?: any; +} + +/** + * 商品分页项类型声明 + */ +export type GoodsPageResult = PageResult + +/** + * 商品表单数据类型声明 + */ +export interface GoodsDetail { + id?: string, + name?: string, + categoryId?: string, + brandId?: string, + originPrice?: number, + price?: number, + picUrl?: string, + album: string[], + description?: string, + detail?: string, + attrList: any[], + specList: any[], + skuList: any[] +} + + diff --git a/src/types/api/sms/advert.d.ts b/src/types/api/sms/advert.d.ts new file mode 100644 index 00000000..99a3185f --- /dev/null +++ b/src/types/api/sms/advert.d.ts @@ -0,0 +1,38 @@ +import { PageQueryParam, PageResult } from "../base" + +/** + * 广告查询参数类型声明 + */ +export interface AdvertQueryParam extends PageQueryParam { + title?: string +} + +/** + * 广告分页列表项声明 + */ +export interface AdvertItem { + id: string; + name: string; + logoUrl: string; + sort: number; +} + +/** + * 广告分页项类型声明 + */ +export type AdvertPageResult = PageResult + +/** + * 广告表单类型声明 + */ +export interface AdvertFormData { + id?: number; + title: string; + picUrl: string; + beginTime: string; + endTime: string; + status: number; + sort: number; + url: string; + remark: string; +} \ No newline at end of file diff --git a/src/types/api/system/client.d.ts b/src/types/api/system/client.d.ts new file mode 100644 index 00000000..e9bcaabe --- /dev/null +++ b/src/types/api/system/client.d.ts @@ -0,0 +1,50 @@ +import { PageQueryParam, PageResult } from "../base" + +/** + * 客户端查询参数类型声明 + */ +export interface ClientQueryParam extends PageQueryParam { + /** + * 客户端名称 + */ + clientId: string | undefined +} + + +/** + * 客户端分页列表项声明 + */ +export interface ClientItem { + clientId: string; + clientSecret: string; + resourceIds: string; + scope: string; + authorizedGrantTypes: string; + webServerRedirectUri?: any; + authorities?: any; + accessTokenValidity: number; + refreshTokenValidity: number; + additionalInformation?: any; + autoapprove: string; +} + +/** + * 客户端分页项类型声明 + */ +export type ClientPageResult = PageResult + +/** + * 客户端表单类型声明 + */ +export interface ClientFormData { + authorizedGrantTypes: string; + clientId: string; + clientSecret: string; + accessTokenValidity: string; + refreshTokenValidity: string; + webServerRedirectUri: string; + authorities: string; + additionalInformation: string; + autoapprove: string; + scope:string; +} \ No newline at end of file diff --git a/src/types/api/system/dept.d.ts b/src/types/api/system/dept.d.ts new file mode 100644 index 00000000..1f78f3d4 --- /dev/null +++ b/src/types/api/system/dept.d.ts @@ -0,0 +1,36 @@ + +/** + * 部门查询参数类型声明 + */ +export interface DeptQueryParam { + name: string | undefined, + status: number | undefined +} + +/** + * 部门列表项声明 + */ + +export interface DeptItem { + id: string; + name: string; + parentId: string; + treePath: string; + sort: number; + status: number; + leader?: string; + mobile?: string; + email?: string; + children: DeptItem[]; +} + +/** + * 部门表单类型声明 + */ +export interface DeptFormData { + id?: string, + parentId: string, + name: string, + sort: number, + status: number +} \ No newline at end of file diff --git a/src/types/api/system/dict.d.ts b/src/types/api/system/dict.d.ts new file mode 100644 index 00000000..f749fa9d --- /dev/null +++ b/src/types/api/system/dict.d.ts @@ -0,0 +1,87 @@ +import { PageQueryParam, PageResult } from "../base" + +/** + * 字典查询参数类型声明 + */ +export interface DictQueryParam extends PageQueryParam { + /** + * 字典名称 + */ + name: string | undefined +} + + +/** + * 字典分页列表项声明 + */ +export interface Dict { + id: number; + code: string; + name: string; + status: number; + remark: string; +} + +/** + * 字典分页项类型声明 + */ +export type DictPageResult = PageResult + +/** + * 字典表单类型声明 + */ +export interface DictFormData { + id: number | undefined, + name: string, + code: string, + status: number, + remark: string +} + +/** + * 字典项查询参数类型声明 + */ +export interface DictItemQueryParam extends PageQueryParam { + /** + * 字典项名称 + */ + name: string | undefined; + /** + * 字典编码 + */ + dictCode: string | undefined; +} + +/** + * 字典分页列表项声明 + */ +export interface DictItem { + id: number; + name: string; + value: string; + dictCode: string; + sort: number; + status: number; + defaulted: number; + remark?: string; +} + +/** + * 字典分页项类型声明 + */ +export type DictItemPageResult = PageResult + +/** + * 字典表单类型声明 + */ +export interface DictItemFormData { + id?: number; + dictCode?:string, + dictName?:string; + name: string; + code: string; + value: string; + status: number; + sort: number; + remark: string; +} \ No newline at end of file diff --git a/src/types/api/system/login.d.ts b/src/types/api/system/login.d.ts new file mode 100644 index 00000000..bbc3a33c --- /dev/null +++ b/src/types/api/system/login.d.ts @@ -0,0 +1,27 @@ +/** + * 登录表单类型声明 + */ +export interface LoginFormData { + username: string, + password: string, + grant_type: string, + code: string, + uuid: string, +} + +/** + * 登录响应类型声明 + */ +export interface LoginResponseData { + access_token: string, + token_type: string +} + +/** + * 验证码类型声明 + */ +export interface Captcha { + img: string, + uuid: string +} + diff --git a/src/types/api/system/menu.d.ts b/src/types/api/system/menu.d.ts new file mode 100644 index 00000000..18229de2 --- /dev/null +++ b/src/types/api/system/menu.d.ts @@ -0,0 +1,68 @@ + +/** + * 菜单查询参数类型声明 + */ +export interface MenuQueryParam { + name?: string +} + +/** + * 菜单分页列表项声明 + */ + +export interface MenuItem { + id: number; + parentId: number; + gmtCreate: string; + gmtModified: string; + name: string; + icon: string; + component: string; + sort: number; + visible: number; + children: MenuItem[]; +} + +/** + * 菜单表单类型声明 + */ +export interface MenuFormData { + /** + * 菜单ID + */ + id?: string, + /** + * 父菜单ID + */ + parentId: string, + /** + * 菜单名称 + */ + name: string, + /** + * 菜单是否可见(1:是;0:否;) + */ + visible: number, + icon?: string, + /** + * 排序 + */ + sort: number, + /** + * 组件路径 + */ + component?: string, + /** + * 路由路径 + */ + path: string, + /** + * 跳转路由路径 + */ + redirect?: string, + + /** + * 菜单类型(1:菜单;2:目录;3:外链) + */ + type: string +} \ No newline at end of file diff --git a/src/types/api/system/perm.d.ts b/src/types/api/system/perm.d.ts new file mode 100644 index 00000000..370d2c51 --- /dev/null +++ b/src/types/api/system/perm.d.ts @@ -0,0 +1,37 @@ +import { PageQueryParam, PageResult } from "../base" + +/** + * 权限查询参数类型声明 + */ +export interface PermQueryParam extends PageQueryParam { + menuId: any; + name: string | undefined; +} + +/** + * 权限分页列表项声明 + */ +export interface PermItem { + id: number; + name: string; + menuId: string; + urlPerm: string; + btnPerm: string; + roles?: string[]; +} + +/** + * 权限分页项类型声明 + */ +export type PermPageResult = PageResult + +/** + * 权限表单类型声明 + */ +export interface PermFormData { + id: number|undefined, + name: string, + urlPerm: string, + btnPerm: string, + menuId: string +} \ No newline at end of file diff --git a/src/types/api/system/role.d.ts b/src/types/api/system/role.d.ts new file mode 100644 index 00000000..f1b3a35b --- /dev/null +++ b/src/types/api/system/role.d.ts @@ -0,0 +1,39 @@ +import { PageQueryParam, PageResult } from "../base" + +/** + * 角色查询参数类型声明 + */ +export interface RoleQueryParam extends PageQueryParam { + name?: string +} + +/** + * 角色分页列表项声明 + */ +export interface RoleItem { + id: string; + name: string; + code: string; + sort: number; + status: number; + deleted: number; + menuIds?: any; + permissionIds?: any; +} + + +/** + * 角色分页项类型声明 + */ +export type RolePageResult = PageResult + +/** + * 角色表单类型声明 + */ +export interface RoleFormData { + id: number|undefined, + name: string, + code: string, + sort: number, + status: number +} \ No newline at end of file diff --git a/src/types/api/system/user.d.ts b/src/types/api/system/user.d.ts new file mode 100644 index 00000000..1ad18007 --- /dev/null +++ b/src/types/api/system/user.d.ts @@ -0,0 +1,67 @@ +import { PageQueryParam, PageResult } from "../base" + +/** + * 登录用户类型声明 + */ +export interface UserInfo { + nickname: string, + avatar: string, + roles: string[], + perms: string[] +} + +/** + * 用户查询参数类型声明 + */ +export interface UserQueryParam extends PageQueryParam { + keywords: string, + status: number, + deptId: number +} + +/** + * 用户分页列表项声明 + */ +export interface UserItem { + id: string; + username: string; + nickname: string; + mobile: string; + gender: number; + avatar: string; + email: string; + status: number; + deptName: string; + roleNames: string; + gmtCreate: string; +} + +/** + * 用户分页项类型声明 + */ +export type UserPageResult = PageResult + +/** + * 用户表单类型声明 + */ +export interface UserFormData { + id: number | undefined, + deptId: number, + username: string, + nickname: string, + password: string, + mobile: string, + email: string, + gender: number, + status: number, + remark: string, + roleIds: number[] +} + +/** + * 用户导入表单类型声明 + */ +export interface UserImportFormData { + deptId: number, + roleIds: number[] +} \ No newline at end of file diff --git a/src/types/api/ums/member.d.ts b/src/types/api/ums/member.d.ts new file mode 100644 index 00000000..cc846603 --- /dev/null +++ b/src/types/api/ums/member.d.ts @@ -0,0 +1,64 @@ +import { PageQueryParam, PageResult } from "../base" + +/** + * 会员查询参数类型声明 + */ +export interface MemberQueryParam extends PageQueryParam { + nickName?: string +} + +/** + * 会员分页列表项声明 + */ +export interface MemberItem { + id: string; + gender: number; + nickName: string; + mobile: string; + birthday?: any; + avatarUrl: string; + openid: string; + sessionKey?: any; + city: string; + country: string; + language: string; + province: string; + status: number; + balance: string; + deleted: number; + point: number; + addressList: AddressItem[]; +} + +export interface AddressItem { + id: string; + memberId: string; + consigneeName: string; + consigneeMobile: string; + province: string; + city: string; + area: string; + detailAddress: string; + zipCode?: any; + defaulted: number; +} + +/** + * 会员分页项类型声明 + */ +export type MemberPageResult = PageResult + +/** + * 会员表单类型声明 + */ +export interface MemberFormData { + id: number | undefined; + title: string; + picUrl: string; + beginTime: string; + endTime: string; + status: number; + sort: number; + url: string; + remark: string; +} \ No newline at end of file diff --git a/src/types/common.d.ts b/src/types/common.d.ts new file mode 100644 index 00000000..1aeff93f --- /dev/null +++ b/src/types/common.d.ts @@ -0,0 +1,21 @@ +/** + * 组件类型声明 + */ + +/** + * 弹窗属性类型声明 + */ +export interface Dialog { + title: string, + visible: boolean +} + +/** + * 通用组件选择项类型声明 + */ +export interface Option { + value: string, + label: string + children?: Option[] +} + diff --git a/src/types/index.d.ts b/src/types/index.d.ts new file mode 100644 index 00000000..03e864f9 --- /dev/null +++ b/src/types/index.d.ts @@ -0,0 +1,22 @@ + +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' + diff --git a/src/types/store.d.ts b/src/types/store.d.ts new file mode 100644 index 00000000..3c94d5cc --- /dev/null +++ b/src/types/store.d.ts @@ -0,0 +1,57 @@ + +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 { + title?: string +} + +export interface TagsViewState { + visitedViews: TagView[], + cachedViews: string[] +} + +/** + * 用户状态类型声明 + */ +export interface UserState { + token: string, + nickname: string, + avatar: string, + roles: string[], + perms: string[] +}