diff --git a/src/api/system/client.ts b/src/api/system/client.ts index af8417ea..e1266fb1 100644 --- a/src/api/system/client.ts +++ b/src/api/system/client.ts @@ -1,4 +1,4 @@ -import { ClientFormData, ClientPageResult, ClientQueryParam } from '@/types/api/client' +import { ClientFormData, ClientPageResult, ClientQueryParam } from '@/types/api/system/client' import request from '@/utils/request' import { AxiosPromise } from 'axios' diff --git a/src/api/system/file.ts b/src/api/system/file.ts index ec58138f..eae58f3c 100644 --- a/src/api/system/file.ts +++ b/src/api/system/file.ts @@ -5,7 +5,7 @@ import request from '@/utils/request' * * @param file */ -export function uploadFile(file: any) { +export function uploadFile(file: File) { let formData = new FormData() formData.append('file', file) return request( @@ -24,7 +24,7 @@ export function uploadFile(file: any) { * * @param path */ -export function deleteFile(path: string) { +export function deleteFile(path?: string) { return request({ url: '/youlai-admin/api/v1/files', method: 'delete', diff --git a/src/api/system/perm.ts b/src/api/system/perm.ts index 3dd6520a..3b7a9ea3 100644 --- a/src/api/system/perm.ts +++ b/src/api/system/perm.ts @@ -1,6 +1,6 @@ import { PermFormData, PermItem, PermPageResult, PermQueryParam } from '@/types' import request from '@/utils/request' -import { Axios, AxiosPromise } from 'axios' +import { AxiosPromise } from 'axios' /** * 获取权限分页列表 diff --git a/src/api/ums/member.ts b/src/api/ums/member.ts index 5957cb58..a997a3fd 100644 --- a/src/api/ums/member.ts +++ b/src/api/ums/member.ts @@ -1,11 +1,13 @@ +import { MemberPageResult, MemberQueryParam } from '@/types' import request from '@/utils/request' +import { AxiosPromise } from 'axios' /** * 获取会员分页列表 * * @param queryParams */ -export function listMembersWithPage(queryParams:object) { +export function listMemeberPages(queryParams: MemberQueryParam): AxiosPromise { return request({ url: '/mall-ums/api/v1/members', method: 'get', @@ -18,7 +20,7 @@ export function listMembersWithPage(queryParams:object) { * * @param id */ -export function getMemberDetail(id:number) { +export function getMemberFormDetail(id: number) { return request({ url: '/mall-ums/api/v1/members/' + id, method: 'get' @@ -30,7 +32,7 @@ export function getMemberDetail(id:number) { * * @param data */ -export function addMember(data:object) { +export function addMember(data: object) { return request({ url: '/mall-ums/api/v1/members', method: 'post', @@ -44,7 +46,7 @@ export function addMember(data:object) { * @param id * @param data */ -export function updateMember(id:number, data:object) { +export function updateMember(id: number, data: object) { return request({ url: '/mall-ums/api/v1/members/' + id, method: 'put', diff --git a/src/components/Upload/SingleUpload.vue b/src/components/Upload/SingleUpload.vue index 4b4858f2..38b82b0c 100644 --- a/src/components/Upload/SingleUpload.vue +++ b/src/components/Upload/SingleUpload.vue @@ -1,61 +1,70 @@ diff --git a/src/types/api/index.d.ts b/src/types/api/index.d.ts new file mode 100644 index 00000000..2de09730 --- /dev/null +++ b/src/types/api/index.d.ts @@ -0,0 +1,6 @@ + +export * from './system' +export * from './pms' +export * from './sms' +export * from './ums' +export * from './oms' diff --git a/src/types/api/oms/order.d.ts b/src/types/api/oms/order.d.ts new file mode 100644 index 00000000..98432373 --- /dev/null +++ b/src/types/api/oms/order.d.ts @@ -0,0 +1,58 @@ +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 interface OrderPageResult extends 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..d9730cad --- /dev/null +++ b/src/types/api/pms/brand.d.ts @@ -0,0 +1,36 @@ +import { PageQueryParam, PageResult } from "../base" + +/** + * 品牌查询参数类型声明 + */ +export interface BrandQueryParam extends PageQueryParam { + name: String | undefined +} + + +/** + * 品牌分页列表项声明 + */ +export interface BrandItem { + id: string; + name: string; + logoUrl: string; + sort: number; +} + +/** + * 品牌分页项类型声明 + */ +export interface BrandPageResult extends 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..39ef7501 --- /dev/null +++ b/src/types/api/pms/goods.d.ts @@ -0,0 +1,73 @@ +import { PageQueryParam, PageResult } from "../base" + + +/** + * 商品查询参数类型声明 + */ +export interface GoodsQueryParam extends PageQueryParam { + name: stirng | undefined, + categoryId: number | undefined +} + +/** + * 商品列表项类型声明 + */ +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 interface GoodsPageResult extends PageResult { + +} + +/** + * 商品表单数据类型声明 + */ +export interface GoodsFormData { + id: number|undefined, + deptId: number, + username: string, + nickname: string, + password: string, + mobile: string, + email: string, + gender: number, + status: number, + remark: string, + roleIds: number[] +} + + diff --git a/src/types/api/sms/advert.d.ts b/src/types/api/sms/advert.d.ts new file mode 100644 index 00000000..6120f0c8 --- /dev/null +++ b/src/types/api/sms/advert.d.ts @@ -0,0 +1,40 @@ +import { PageQueryParam, PageResult } from "../base" + +/** + * 广告查询参数类型声明 + */ +export interface AdvertQueryParam extends PageQueryParam { + name: String | undefined +} + +/** + * 广告分页列表项声明 + */ +export interface AdvertItem { + id: string; + name: string; + logoUrl: string; + sort: number; +} + +/** + * 广告分页项类型声明 + */ +export interface AdvertPageResult extends PageResult { + +} + +/** + * 广告表单类型声明 + */ +export interface AdvertFormData { + 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/client.ts b/src/types/api/system/client.d.ts similarity index 95% rename from src/types/api/client.ts rename to src/types/api/system/client.d.ts index df45a3a9..efd4ca0c 100644 --- a/src/types/api/client.ts +++ b/src/types/api/system/client.d.ts @@ -1,4 +1,4 @@ -import { PageQueryParam, PageResult } from "./base" +import { PageQueryParam, PageResult } from "../base" /** * 客户端查询参数类型声明 diff --git a/src/types/api/dept.d.ts b/src/types/api/system/dept.d.ts similarity index 95% rename from src/types/api/dept.d.ts rename to src/types/api/system/dept.d.ts index 589e643f..ae0bf3e3 100644 --- a/src/types/api/dept.d.ts +++ b/src/types/api/system/dept.d.ts @@ -28,7 +28,7 @@ export interface DeptItem { * 部门表单类型声明 */ export interface DeptFormData { - id: number, + id: number|undefined, parentId: number, name: string, sort: number, diff --git a/src/types/api/dict.d.ts b/src/types/api/system/dict.d.ts similarity index 96% rename from src/types/api/dict.d.ts rename to src/types/api/system/dict.d.ts index 5acab7d1..e5b48e79 100644 --- a/src/types/api/dict.d.ts +++ b/src/types/api/system/dict.d.ts @@ -1,4 +1,4 @@ -import { PageQueryParam, PageResult } from "./base" +import { PageQueryParam, PageResult } from "../base" /** * 字典查询参数类型声明 diff --git a/src/types/api/login.d.ts b/src/types/api/system/login.d.ts similarity index 100% rename from src/types/api/login.d.ts rename to src/types/api/system/login.d.ts diff --git a/src/types/api/menu.ts b/src/types/api/system/menu.ts similarity index 100% rename from src/types/api/menu.ts rename to src/types/api/system/menu.ts diff --git a/src/types/api/perm.d.ts b/src/types/api/system/perm.d.ts similarity index 88% rename from src/types/api/perm.d.ts rename to src/types/api/system/perm.d.ts index 743bfd32..36d5da6f 100644 --- a/src/types/api/perm.d.ts +++ b/src/types/api/system/perm.d.ts @@ -1,4 +1,4 @@ -import { PageQueryParam, PageResult } from "./base" +import { PageQueryParam, PageResult } from "../base" /** * 权限查询参数类型声明 @@ -31,7 +31,7 @@ export interface PermPageResult extends PageResult { * 权限表单类型声明 */ export interface PermFormData { - id: number, + id: number|undefined, name: string, urlPerm: string, btnPerm: string, diff --git a/src/types/api/role.d.ts b/src/types/api/system/role.d.ts similarity index 88% rename from src/types/api/role.d.ts rename to src/types/api/system/role.d.ts index e990ab8f..8585628e 100644 --- a/src/types/api/role.d.ts +++ b/src/types/api/system/role.d.ts @@ -1,4 +1,4 @@ -import { PageQueryParam, PageResult } from "./base" +import { PageQueryParam, PageResult } from "../base" /** * 角色查询参数类型声明 @@ -33,7 +33,7 @@ export interface RolePageResult extends PageResult { * 角色表单类型声明 */ export interface RoleFormData { - id: number, + id: number|undefined, name: string, code: string, sort: number, diff --git a/src/types/api/user.d.ts b/src/types/api/system/user.d.ts similarity index 92% rename from src/types/api/user.d.ts rename to src/types/api/system/user.d.ts index 1cad9d13..ee15a793 100644 --- a/src/types/api/user.d.ts +++ b/src/types/api/system/user.d.ts @@ -1,4 +1,4 @@ -import { PageQueryParam, PageResult } from "./base" +import { PageQueryParam, PageResult } from "../base" /** * 用户信息类型声明 @@ -48,7 +48,7 @@ export interface UserPageResult extends PageResult { * 用户表单类型声明 */ export interface UserFormData { - id: number, + id: number | undefined, deptId: number, username: string, nickname: string, diff --git a/src/types/api/ums/index.d.ts b/src/types/api/ums/index.d.ts new file mode 100644 index 00000000..0584ab1c --- /dev/null +++ b/src/types/api/ums/index.d.ts @@ -0,0 +1 @@ +export * from './member' diff --git a/src/types/api/ums/member.d.ts b/src/types/api/ums/member.d.ts new file mode 100644 index 00000000..dc1ca6ce --- /dev/null +++ b/src/types/api/ums/member.d.ts @@ -0,0 +1,66 @@ +import { PageQueryParam, PageResult } from "../base" + +/** + * 会员查询参数类型声明 + */ +export interface MemberQueryParam extends PageQueryParam { + nickName: String | undefined +} + +/** + * 会员分页列表项声明 + */ +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 interface MemberPageResult extends 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/component/index.d.ts b/src/types/common/index.d.ts similarity index 100% rename from src/types/component/index.d.ts rename to src/types/common/index.d.ts diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 81829613..6df48ee2 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -1,12 +1,21 @@ -export * from './api/login' -export * from './api/user' -export * from './api/role' -export * from './api/menu' -export * from './api/dept' -export * from './api/dict' -export * from './api/perm' -export * from './api/client' + +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 './component' +export * from './api/pms/goods' +export * from './api/pms/goods' + +export * from './api/sms/advert' + +export * from './api/oms/order' + + +export * from './common' diff --git a/src/views/oms/order/index.vue b/src/views/oms/order/index.vue index 5d05a247..eec64229 100644 --- a/src/views/oms/order/index.vue +++ b/src/views/oms/order/index.vue @@ -1,79 +1,70 @@