Merge branch 'dev' of https://gitee.com/yudaocode/yudao-ui-admin-vben into reform-mp
This commit is contained in:
@@ -12,24 +12,24 @@ export namespace MallMemberStatisticsApi {
|
|||||||
times: Date[] | Dayjs[]; // 时间范围
|
times: Date[] | Dayjs[]; // 时间范围
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 会员分析 Response */
|
||||||
|
export interface AnalyseRespVO {
|
||||||
|
visitUserCount: number; // 访问用户数
|
||||||
|
orderUserCount: number; // 下单用户数
|
||||||
|
payUserCount: number; // 支付用户数
|
||||||
|
atv: number; // 平均客单价
|
||||||
|
comparison: DataComparisonRespVO<AnalyseDataRespVO>; // 对照数据
|
||||||
|
}
|
||||||
|
|
||||||
/** 会员分析对照数据 Response */
|
/** 会员分析对照数据 Response */
|
||||||
export interface AnalyseComparison {
|
export interface AnalyseDataRespVO {
|
||||||
registerUserCount: number; // 注册用户数
|
registerUserCount: number; // 注册用户数
|
||||||
visitUserCount: number; // 访问用户数
|
visitUserCount: number; // 访问用户数
|
||||||
rechargeUserCount: number; // 充值用户数
|
rechargeUserCount: number; // 充值用户数
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 会员分析 Response */
|
|
||||||
export interface Analyse {
|
|
||||||
visitUserCount: number; // 访问用户数
|
|
||||||
orderUserCount: number; // 下单用户数
|
|
||||||
payUserCount: number; // 支付用户数
|
|
||||||
atv: number; // 平均客单价
|
|
||||||
comparison: DataComparisonRespVO<AnalyseComparison>; // 对照数据
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 会员地区统计 Response */
|
/** 会员地区统计 Response */
|
||||||
export interface AreaStatistics {
|
export interface AreaStatisticsRespVO {
|
||||||
areaId: number; // 地区ID
|
areaId: number; // 地区ID
|
||||||
areaName: string; // 地区名称
|
areaName: string; // 地区名称
|
||||||
userCount: number; // 用户数
|
userCount: number; // 用户数
|
||||||
@@ -39,13 +39,13 @@ export namespace MallMemberStatisticsApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 会员性别统计 Response */
|
/** 会员性别统计 Response */
|
||||||
export interface SexStatistics {
|
export interface SexStatisticsRespVO {
|
||||||
sex: number; // 性别
|
sex: number; // 性别
|
||||||
userCount: number; // 用户数
|
userCount: number; // 用户数
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 会员统计 Response */
|
/** 会员统计 Response */
|
||||||
export interface Summary {
|
export interface SummaryRespVO {
|
||||||
userCount: number; // 用户数
|
userCount: number; // 用户数
|
||||||
rechargeUserCount: number; // 充值用户数
|
rechargeUserCount: number; // 充值用户数
|
||||||
rechargePrice: number; // 充值金额
|
rechargePrice: number; // 充值金额
|
||||||
@@ -53,7 +53,7 @@ export namespace MallMemberStatisticsApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 会员终端统计 Response */
|
/** 会员终端统计 Response */
|
||||||
export interface TerminalStatistics {
|
export interface TerminalStatisticsRespVO {
|
||||||
terminal: number; // 终端
|
terminal: number; // 终端
|
||||||
userCount: number; // 用户数
|
userCount: number; // 用户数
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ export namespace MallMemberStatisticsApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 会员注册数量 Response */
|
/** 会员注册数量 Response */
|
||||||
export interface RegisterCount {
|
export interface RegisterCountRespVO {
|
||||||
date: string; // 日期
|
date: string; // 日期
|
||||||
count: number; // 数量
|
count: number; // 数量
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ export namespace MallMemberStatisticsApi {
|
|||||||
|
|
||||||
/** 查询会员统计 */
|
/** 查询会员统计 */
|
||||||
export function getMemberSummary() {
|
export function getMemberSummary() {
|
||||||
return requestClient.get<MallMemberStatisticsApi.Summary>(
|
return requestClient.get<MallMemberStatisticsApi.SummaryRespVO>(
|
||||||
'/statistics/member/summary',
|
'/statistics/member/summary',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ export function getMemberSummary() {
|
|||||||
export function getMemberAnalyse(
|
export function getMemberAnalyse(
|
||||||
params: MallMemberStatisticsApi.MemberAnalyseReqVO,
|
params: MallMemberStatisticsApi.MemberAnalyseReqVO,
|
||||||
) {
|
) {
|
||||||
return requestClient.get<MallMemberStatisticsApi.Analyse>(
|
return requestClient.get<MallMemberStatisticsApi.AnalyseRespVO>(
|
||||||
'/statistics/member/analyse',
|
'/statistics/member/analyse',
|
||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
@@ -97,21 +97,21 @@ export function getMemberAnalyse(
|
|||||||
|
|
||||||
/** 按照省份,查询会员统计列表 */
|
/** 按照省份,查询会员统计列表 */
|
||||||
export function getMemberAreaStatisticsList() {
|
export function getMemberAreaStatisticsList() {
|
||||||
return requestClient.get<MallMemberStatisticsApi.AreaStatistics[]>(
|
return requestClient.get<MallMemberStatisticsApi.AreaStatisticsRespVO[]>(
|
||||||
'/statistics/member/area-statistics-list',
|
'/statistics/member/area-statistics-list',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 按照性别,查询会员统计列表 */
|
/** 按照性别,查询会员统计列表 */
|
||||||
export function getMemberSexStatisticsList() {
|
export function getMemberSexStatisticsList() {
|
||||||
return requestClient.get<MallMemberStatisticsApi.SexStatistics[]>(
|
return requestClient.get<MallMemberStatisticsApi.SexStatisticsRespVO[]>(
|
||||||
'/statistics/member/sex-statistics-list',
|
'/statistics/member/sex-statistics-list',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 按照终端,查询会员统计列表 */
|
/** 按照终端,查询会员统计列表 */
|
||||||
export function getMemberTerminalStatisticsList() {
|
export function getMemberTerminalStatisticsList() {
|
||||||
return requestClient.get<MallMemberStatisticsApi.TerminalStatistics[]>(
|
return requestClient.get<MallMemberStatisticsApi.TerminalStatisticsRespVO[]>(
|
||||||
'/statistics/member/terminal-statistics-list',
|
'/statistics/member/terminal-statistics-list',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -125,7 +125,7 @@ export function getUserCountComparison() {
|
|||||||
|
|
||||||
/** 获得会员注册数量列表 */
|
/** 获得会员注册数量列表 */
|
||||||
export function getMemberRegisterCountList(beginTime: Date, endTime: Date) {
|
export function getMemberRegisterCountList(beginTime: Date, endTime: Date) {
|
||||||
return requestClient.get<MallMemberStatisticsApi.RegisterCount[]>(
|
return requestClient.get<MallMemberStatisticsApi.RegisterCountRespVO[]>(
|
||||||
'/statistics/member/register-count-list',
|
'/statistics/member/register-count-list',
|
||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
|
|||||||
@@ -6,50 +6,35 @@ import { requestClient } from '#/api/request';
|
|||||||
|
|
||||||
export namespace MallProductStatisticsApi {
|
export namespace MallProductStatisticsApi {
|
||||||
/** 商品统计数据 */
|
/** 商品统计数据 */
|
||||||
export interface ProductStatistics {
|
export interface ProductStatisticsRespVO {
|
||||||
/** 编号 */
|
id: number; // 编号
|
||||||
id: number;
|
day: string; // 统计日期
|
||||||
/** 统计日期 */
|
spuId: number; // 商品 SPU 编号
|
||||||
day: string;
|
spuName: string; // 商品 SPU 名称
|
||||||
/** 商品 SPU 编号 */
|
spuPicUrl: string; // 商品 SPU 图片
|
||||||
spuId: number;
|
browseCount: number; // 浏览次数
|
||||||
/** 商品 SPU 名称 */
|
browseUserCount: number; // 浏览人数
|
||||||
spuName: string;
|
favoriteCount: number; // 收藏次数
|
||||||
/** 商品 SPU 图片 */
|
cartCount: number; // 加购次数
|
||||||
spuPicUrl: string;
|
orderCount: number; // 下单次数
|
||||||
/** 浏览次数 */
|
orderPayCount: number; // 支付次数
|
||||||
browseCount: number;
|
orderPayPrice: number; // 支付金额
|
||||||
/** 浏览人数 */
|
afterSaleCount: number; // 售后次数
|
||||||
browseUserCount: number;
|
afterSaleRefundPrice: number; // 退款金额
|
||||||
/** 收藏次数 */
|
browseConvertPercent: number; // 浏览转化率
|
||||||
favoriteCount: number;
|
|
||||||
/** 加购次数 */
|
|
||||||
cartCount: number;
|
|
||||||
/** 下单次数 */
|
|
||||||
orderCount: number;
|
|
||||||
/** 支付次数 */
|
|
||||||
orderPayCount: number;
|
|
||||||
/** 支付金额 */
|
|
||||||
orderPayPrice: number;
|
|
||||||
/** 售后次数 */
|
|
||||||
afterSaleCount: number;
|
|
||||||
/** 退款金额 */
|
|
||||||
afterSaleRefundPrice: number;
|
|
||||||
/** 浏览转化率 */
|
|
||||||
browseConvertPercent: number;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获得商品统计分析 */
|
/** 获得商品统计分析 */
|
||||||
export function getProductStatisticsAnalyse(params: any) {
|
export function getProductStatisticsAnalyse(params: any) {
|
||||||
return requestClient.get<
|
return requestClient.get<
|
||||||
DataComparisonRespVO<MallProductStatisticsApi.ProductStatistics>
|
DataComparisonRespVO<MallProductStatisticsApi.ProductStatisticsRespVO>
|
||||||
>('/statistics/product/analyse', { params });
|
>('/statistics/product/analyse', { params });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获得商品状况明细 */
|
/** 获得商品状况明细 */
|
||||||
export function getProductStatisticsList(params: any) {
|
export function getProductStatisticsList(params: any) {
|
||||||
return requestClient.get<MallProductStatisticsApi.ProductStatistics[]>(
|
return requestClient.get<MallProductStatisticsApi.ProductStatisticsRespVO[]>(
|
||||||
'/statistics/product/list',
|
'/statistics/product/list',
|
||||||
{ params },
|
{ params },
|
||||||
);
|
);
|
||||||
@@ -63,6 +48,6 @@ export function exportProductStatisticsExcel(params: any) {
|
|||||||
/** 获得商品排行榜分页 */
|
/** 获得商品排行榜分页 */
|
||||||
export function getProductStatisticsRankPage(params: PageParam) {
|
export function getProductStatisticsRankPage(params: PageParam) {
|
||||||
return requestClient.get<
|
return requestClient.get<
|
||||||
PageResult<MallProductStatisticsApi.ProductStatistics>
|
PageResult<MallProductStatisticsApi.ProductStatisticsRespVO>
|
||||||
>('/statistics/product/rank-page', { params });
|
>('/statistics/product/rank-page', { params });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
import type { DataComparisonRespVO } from './common';
|
import type { DataComparisonRespVO } from './common';
|
||||||
|
|
||||||
import { formatDate, formatDateTime } from '@vben/utils';
|
import { formatDateTime } from '@vben/utils';
|
||||||
|
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace MallTradeStatisticsApi {
|
export namespace MallTradeStatisticsApi {
|
||||||
|
/** 交易状况 Request */
|
||||||
|
export interface TradeTrendReqVO {
|
||||||
|
times: [Date, Date];
|
||||||
|
}
|
||||||
|
|
||||||
/** 交易统计 Response */
|
/** 交易统计 Response */
|
||||||
export interface TradeSummary {
|
export interface TradeSummaryRespVO {
|
||||||
yesterdayOrderCount: number;
|
yesterdayOrderCount: number;
|
||||||
monthOrderCount: number;
|
monthOrderCount: number;
|
||||||
yesterdayPayPrice: number;
|
yesterdayPayPrice: number;
|
||||||
monthPayPrice: number;
|
monthPayPrice: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 交易状况 Request */
|
|
||||||
export interface TradeTrendReq {
|
|
||||||
times: [Date, Date];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 交易状况统计 Response */
|
/** 交易状况统计 Response */
|
||||||
export interface TradeTrendSummary {
|
export interface TradeTrendSummaryRespVO {
|
||||||
time: string;
|
time: string;
|
||||||
turnoverPrice: number;
|
turnoverPrice: number;
|
||||||
orderPayPrice: number;
|
orderPayPrice: number;
|
||||||
@@ -31,60 +31,46 @@ export namespace MallTradeStatisticsApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 交易订单数量 Response */
|
/** 交易订单数量 Response */
|
||||||
export interface TradeOrderCount {
|
export interface TradeOrderCountRespVO {
|
||||||
/** 待发货 */
|
undelivered?: number; // 待发货
|
||||||
undelivered?: number;
|
pickUp?: number; // 待核销
|
||||||
/** 待核销 */
|
afterSaleApply?: number; // 退款中
|
||||||
pickUp?: number;
|
auditingWithdraw?: number; // 提现待审核
|
||||||
/** 退款中 */
|
|
||||||
afterSaleApply?: number;
|
|
||||||
/** 提现待审核 */
|
|
||||||
auditingWithdraw?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 交易订单统计 Response */
|
/** 交易订单统计 Response */
|
||||||
export interface TradeOrderSummaryRespVO {
|
export interface TradeOrderSummaryRespVO {
|
||||||
/** 支付订单商品数 */
|
orderPayCount?: number; // 支付订单商品数
|
||||||
orderPayCount?: number;
|
orderPayPrice?: number; // 总支付金额,单位:分
|
||||||
/** 总支付金额,单位:分 */
|
|
||||||
orderPayPrice?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单量趋势统计 Response */
|
/** 订单量趋势统计 Response */
|
||||||
export interface TradeOrderTrend {
|
export interface TradeOrderTrendRespVO {
|
||||||
/** 日期 */
|
date: string; // 日期
|
||||||
date: string;
|
orderPayCount: number; // 订单数量
|
||||||
/** 订单数量 */
|
orderPayPrice: number; // 订单支付金额
|
||||||
orderPayCount: number;
|
|
||||||
/** 订单支付金额 */
|
|
||||||
orderPayPrice: number;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 时间参数需要格式化, 确保接口能识别 */
|
|
||||||
const formatDateParam = (params: MallTradeStatisticsApi.TradeTrendReq) => {
|
|
||||||
return {
|
|
||||||
times: [formatDate(params.times[0]), formatDate(params.times[1])],
|
|
||||||
} as MallTradeStatisticsApi.TradeTrendReq;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 查询交易统计 */
|
/** 查询交易统计 */
|
||||||
export function getTradeStatisticsSummary() {
|
export function getTradeStatisticsSummary() {
|
||||||
return requestClient.get<
|
return requestClient.get<
|
||||||
DataComparisonRespVO<MallTradeStatisticsApi.TradeSummary>
|
DataComparisonRespVO<MallTradeStatisticsApi.TradeSummaryRespVO>
|
||||||
>('/statistics/trade/summary');
|
>('/statistics/trade/summary');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获得交易状况统计 */
|
/** 获得交易状况统计 */
|
||||||
export function getTradeStatisticsAnalyse(params: any) {
|
export function getTradeStatisticsAnalyse(
|
||||||
|
params: MallTradeStatisticsApi.TradeTrendReqVO,
|
||||||
|
) {
|
||||||
return requestClient.get<
|
return requestClient.get<
|
||||||
DataComparisonRespVO<MallTradeStatisticsApi.TradeTrendSummary>
|
DataComparisonRespVO<MallTradeStatisticsApi.TradeTrendSummaryRespVO>
|
||||||
>('/statistics/trade/analyse', { params });
|
>('/statistics/trade/analyse', { params });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获得交易状况明细 */
|
/** 获得交易状况明细 */
|
||||||
export function getTradeStatisticsList(params: any) {
|
export function getTradeStatisticsList(params: any) {
|
||||||
return requestClient.get<MallTradeStatisticsApi.TradeTrendSummary[]>(
|
return requestClient.get<MallTradeStatisticsApi.TradeTrendSummaryRespVO[]>(
|
||||||
'/statistics/trade/list',
|
'/statistics/trade/list',
|
||||||
{ params },
|
{ params },
|
||||||
);
|
);
|
||||||
@@ -97,7 +83,7 @@ export function exportTradeStatisticsExcel(params: any) {
|
|||||||
|
|
||||||
/** 获得交易订单数量 */
|
/** 获得交易订单数量 */
|
||||||
export function getOrderCount() {
|
export function getOrderCount() {
|
||||||
return requestClient.get<MallTradeStatisticsApi.TradeOrderCount>(
|
return requestClient.get<MallTradeStatisticsApi.TradeOrderCountRespVO>(
|
||||||
'/statistics/trade/order-count',
|
'/statistics/trade/order-count',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -116,7 +102,7 @@ export function getOrderCountTrendComparison(
|
|||||||
endTime: Date,
|
endTime: Date,
|
||||||
) {
|
) {
|
||||||
return requestClient.get<
|
return requestClient.get<
|
||||||
DataComparisonRespVO<MallTradeStatisticsApi.TradeOrderTrend>[]
|
DataComparisonRespVO<MallTradeStatisticsApi.TradeOrderTrendRespVO>[]
|
||||||
>('/statistics/trade/order-count-trend', {
|
>('/statistics/trade/order-count-trend', {
|
||||||
params: {
|
params: {
|
||||||
type,
|
type,
|
||||||
|
|||||||
@@ -5,85 +5,49 @@ import type { MallOrderApi } from '#/api/mall/trade/order';
|
|||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace MallAfterSaleApi {
|
export namespace MallAfterSaleApi {
|
||||||
/** 商品属性 */
|
|
||||||
export interface ProductProperty {
|
|
||||||
/** 属性的编号 */
|
|
||||||
propertyId?: null | number;
|
|
||||||
/** 属性的名称 */
|
|
||||||
propertyName?: string;
|
|
||||||
/** 属性值的编号 */
|
|
||||||
valueId?: null | number;
|
|
||||||
/** 属性值的名称 */
|
|
||||||
valueName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 交易售后 */
|
/** 交易售后 */
|
||||||
export interface AfterSale {
|
export interface AfterSale {
|
||||||
/** 售后编号,主键自增 */
|
id?: number; // 售后编号
|
||||||
id?: null | number;
|
no?: string; // 售后单号
|
||||||
/** 售后单号 */
|
status?: number; // 退款状态
|
||||||
no?: string;
|
way?: number; // 售后方式
|
||||||
/** 退款状态 */
|
type?: number; // 售后类型
|
||||||
status?: null | number;
|
userId?: number; // 用户编号
|
||||||
/** 售后方式 */
|
applyReason?: string; // 申请原因
|
||||||
way?: null | number;
|
applyDescription?: string; // 补充描述
|
||||||
/** 售后类型 */
|
applyPicUrls?: string[]; // 补充凭证图片
|
||||||
type?: null | number;
|
orderId?: number; // 交易订单编号
|
||||||
/** 用户编号 */
|
orderNo?: string; // 订单流水号
|
||||||
userId?: null | number;
|
orderItemId?: number; // 交易订单项编号
|
||||||
/** 申请原因 */
|
spuId?: number; // 商品 SPU 编号
|
||||||
applyReason?: string;
|
spuName?: string; // 商品 SPU 名称
|
||||||
/** 补充描述 */
|
skuId?: number; // 商品 SKU 编号
|
||||||
applyDescription?: string;
|
properties?: {
|
||||||
/** 补充凭证图片 */
|
propertyId?: number; // 属性的编号
|
||||||
applyPicUrls?: string[];
|
propertyName?: string; // 属性的名称
|
||||||
/** 交易订单编号 */
|
valueId?: number; // 属性值的编号
|
||||||
orderId?: null | number;
|
valueName?: string; // 属性值的名称
|
||||||
/** 订单流水号 */
|
}[]; // 属性数组
|
||||||
orderNo?: string;
|
picUrl?: string; // 商品图片
|
||||||
/** 交易订单项编号 */
|
count?: number; // 退货商品数量
|
||||||
orderItemId?: null | number;
|
auditTime?: Date; // 审批时间
|
||||||
/** 商品 SPU 编号 */
|
auditUserId?: number; // 审批人
|
||||||
spuId?: null | number;
|
auditReason?: string; // 审批备注
|
||||||
/** 商品 SPU 名称 */
|
refundPrice?: number; // 退款金额,单位:分
|
||||||
spuName?: string;
|
payRefundId?: number; // 支付退款编号
|
||||||
/** 商品 SKU 编号 */
|
refundTime?: Date; // 退款时间
|
||||||
skuId?: null | number;
|
logisticsId?: number; // 退货物流公司编号
|
||||||
/** 属性数组 */
|
logisticsNo?: string; // 退货物流单号
|
||||||
properties?: ProductProperty[];
|
deliveryTime?: Date; // 退货时间
|
||||||
/** 商品图片 */
|
receiveTime?: Date; // 收货时间
|
||||||
picUrl?: string;
|
receiveReason?: string; // 收货备注
|
||||||
/** 退货商品数量 */
|
|
||||||
count?: null | number;
|
|
||||||
/** 审批时间 */
|
|
||||||
auditTime?: Date;
|
|
||||||
/** 审批人 */
|
|
||||||
auditUserId?: null | number;
|
|
||||||
/** 审批备注 */
|
|
||||||
auditReason?: string;
|
|
||||||
/** 退款金额,单位:分 */
|
|
||||||
refundPrice?: null | number;
|
|
||||||
/** 支付退款编号 */
|
|
||||||
payRefundId?: null | number;
|
|
||||||
/** 退款时间 */
|
|
||||||
refundTime?: Date;
|
|
||||||
/** 退货物流公司编号 */
|
|
||||||
logisticsId?: null | number;
|
|
||||||
/** 退货物流单号 */
|
|
||||||
logisticsNo?: string;
|
|
||||||
/** 退货时间 */
|
|
||||||
deliveryTime?: Date;
|
|
||||||
/** 收货时间 */
|
|
||||||
receiveTime?: Date;
|
|
||||||
/** 收货备注 */
|
|
||||||
receiveReason?: string;
|
|
||||||
order?: MallOrderApi.Order; // 关联订单
|
order?: MallOrderApi.Order; // 关联订单
|
||||||
orderItem?: MallOrderApi.OrderItem; // 关联订单项
|
orderItem?: MallOrderApi.OrderItem; // 关联订单项
|
||||||
logs?: any[]; // 关联售后日志
|
logs?: any[]; // 关联售后日志
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 拒绝售后请求 */
|
/** 拒绝售后请求 */
|
||||||
export interface DisagreeRequest {
|
export interface AfterSaleDisagreeReqVO {
|
||||||
/** 售后编号 */
|
/** 售后编号 */
|
||||||
id: number;
|
id: number;
|
||||||
/** 拒绝原因 */
|
/** 拒绝原因 */
|
||||||
@@ -112,7 +76,9 @@ export function agreeAfterSale(id: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 拒绝售后 */
|
/** 拒绝售后 */
|
||||||
export function disagreeAfterSale(data: MallAfterSaleApi.DisagreeRequest) {
|
export function disagreeAfterSale(
|
||||||
|
data: MallAfterSaleApi.AfterSaleDisagreeReqVO,
|
||||||
|
) {
|
||||||
return requestClient.put('/trade/after-sale/disagree', data);
|
return requestClient.put('/trade/after-sale/disagree', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export namespace MallBrokerageWithdrawApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 驳回申请请求 */
|
/** 驳回申请请求 */
|
||||||
export interface RejectRequest {
|
export interface BrokerageWithdrawRejectReqVO {
|
||||||
id: number; // 编号
|
id: number; // 编号
|
||||||
auditReason: string; // 驳回原因
|
auditReason: string; // 驳回原因
|
||||||
}
|
}
|
||||||
@@ -40,13 +40,6 @@ export function getBrokerageWithdrawPage(params: PageParam) {
|
|||||||
>('/trade/brokerage-withdraw/page', { params });
|
>('/trade/brokerage-withdraw/page', { params });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询佣金提现详情 */
|
|
||||||
export function getBrokerageWithdraw(id: number) {
|
|
||||||
return requestClient.get<MallBrokerageWithdrawApi.BrokerageWithdraw>(
|
|
||||||
`/trade/brokerage-withdraw/get?id=${id}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 佣金提现 - 通过申请 */
|
/** 佣金提现 - 通过申请 */
|
||||||
export function approveBrokerageWithdraw(id: number) {
|
export function approveBrokerageWithdraw(id: number) {
|
||||||
return requestClient.put(`/trade/brokerage-withdraw/approve?id=${id}`);
|
return requestClient.put(`/trade/brokerage-withdraw/approve?id=${id}`);
|
||||||
@@ -54,7 +47,7 @@ export function approveBrokerageWithdraw(id: number) {
|
|||||||
|
|
||||||
/** 审核佣金提现 - 驳回申请 */
|
/** 审核佣金提现 - 驳回申请 */
|
||||||
export function rejectBrokerageWithdraw(
|
export function rejectBrokerageWithdraw(
|
||||||
data: MallBrokerageWithdrawApi.RejectRequest,
|
data: MallBrokerageWithdrawApi.BrokerageWithdrawRejectReqVO,
|
||||||
) {
|
) {
|
||||||
return requestClient.put('/trade/brokerage-withdraw/reject', data);
|
return requestClient.put('/trade/brokerage-withdraw/reject', data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,28 +5,12 @@ import { requestClient } from '#/api/request';
|
|||||||
export namespace MallDeliveryExpressApi {
|
export namespace MallDeliveryExpressApi {
|
||||||
/** 快递公司 */
|
/** 快递公司 */
|
||||||
export interface DeliveryExpress {
|
export interface DeliveryExpress {
|
||||||
/** 编号 */
|
id: number; // 编号
|
||||||
id: number;
|
code: string; // 快递公司编码
|
||||||
/** 快递公司编码 */
|
name: string; // 快递公司名称
|
||||||
code: string;
|
logo: string; // 快递公司 logo
|
||||||
/** 快递公司名称 */
|
sort: number; // 排序
|
||||||
name: string;
|
status: number; // 状态
|
||||||
/** 快递公司 logo */
|
|
||||||
logo: string;
|
|
||||||
/** 排序 */
|
|
||||||
sort: number;
|
|
||||||
/** 状态 */
|
|
||||||
status: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 快递公司精简信息 */
|
|
||||||
export interface SimpleDeliveryExpress {
|
|
||||||
/** 编号 */
|
|
||||||
id: number;
|
|
||||||
/** 快递公司编码 */
|
|
||||||
code: string;
|
|
||||||
/** 快递公司名称 */
|
|
||||||
name: string;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +31,7 @@ export function getDeliveryExpress(id: number) {
|
|||||||
|
|
||||||
/** 获得快递公司精简信息列表 */
|
/** 获得快递公司精简信息列表 */
|
||||||
export function getSimpleDeliveryExpressList() {
|
export function getSimpleDeliveryExpressList() {
|
||||||
return requestClient.get<MallDeliveryExpressApi.SimpleDeliveryExpress[]>(
|
return requestClient.get<MallDeliveryExpressApi.DeliveryExpress[]>(
|
||||||
'/trade/delivery/express/list-all-simple',
|
'/trade/delivery/express/list-all-simple',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,86 +3,64 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace MallDeliveryExpressTemplateApi {
|
export namespace MallDeliveryExpressTemplateApi {
|
||||||
|
/** 快递运费模板 */
|
||||||
|
export interface DeliveryExpressTemplate {
|
||||||
|
id: number; // 编号
|
||||||
|
name: string; // 模板名称
|
||||||
|
chargeMode: number; // 计费方式
|
||||||
|
sort: number; // 排序
|
||||||
|
charges: DeliveryExpressTemplateCharge[]; // 计费区域列表
|
||||||
|
frees: DeliveryExpressTemplateFree[]; // 包邮区域列表
|
||||||
|
}
|
||||||
|
|
||||||
/** 运费模板计费 */
|
/** 运费模板计费 */
|
||||||
export interface TemplateCharge {
|
export interface DeliveryExpressTemplateCharge {
|
||||||
/** 区域编号列表 */
|
areaIds: number[]; // 区域编号列表
|
||||||
areaIds: number[];
|
startCount: number; // 首件数量
|
||||||
/** 首件数量 */
|
startPrice: number; // 首件价格,单位:分
|
||||||
startCount: number;
|
extraCount: number; // 续件数量
|
||||||
/** 首件价格,单位:分 */
|
extraPrice: number; // 续件价格,单位:分
|
||||||
startPrice: number;
|
|
||||||
/** 续件数量 */
|
|
||||||
extraCount: number;
|
|
||||||
/** 续件价格,单位:分 */
|
|
||||||
extraPrice: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 运费模板包邮 */
|
/** 运费模板包邮 */
|
||||||
export interface TemplateFree {
|
export interface DeliveryExpressTemplateFree {
|
||||||
/** 区域编号列表 */
|
areaIds: number[]; // 区域编号列表
|
||||||
areaIds: number[];
|
freeCount: number; // 包邮件数
|
||||||
/** 包邮件数 */
|
freePrice: number; // 包邮金额,单位:分
|
||||||
freeCount: number;
|
|
||||||
/** 包邮金额,单位:分 */
|
|
||||||
freePrice: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 快递运费模板 */
|
|
||||||
export interface ExpressTemplate {
|
|
||||||
/** 编号 */
|
|
||||||
id: number;
|
|
||||||
/** 模板名称 */
|
|
||||||
name: string;
|
|
||||||
/** 计费方式 */
|
|
||||||
chargeMode: number;
|
|
||||||
/** 排序 */
|
|
||||||
sort: number;
|
|
||||||
/** 计费区域列表 */
|
|
||||||
charges: TemplateCharge[];
|
|
||||||
/** 包邮区域列表 */
|
|
||||||
frees: TemplateFree[];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 运费模板精简信息 */
|
|
||||||
export interface SimpleTemplate {
|
|
||||||
/** 编号 */
|
|
||||||
id: number;
|
|
||||||
/** 模板名称 */
|
|
||||||
name: string;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询快递运费模板列表 */
|
/** 查询快递运费模板列表 */
|
||||||
export function getDeliveryExpressTemplatePage(params: PageParam) {
|
export function getDeliveryExpressTemplatePage(params: PageParam) {
|
||||||
return requestClient.get<
|
return requestClient.get<
|
||||||
PageResult<MallDeliveryExpressTemplateApi.ExpressTemplate>
|
PageResult<MallDeliveryExpressTemplateApi.DeliveryExpressTemplate>
|
||||||
>('/trade/delivery/express-template/page', { params });
|
>('/trade/delivery/express-template/page', { params });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询快递运费模板详情 */
|
/** 查询快递运费模板详情 */
|
||||||
export function getDeliveryExpressTemplate(id: number) {
|
export function getDeliveryExpressTemplate(id: number) {
|
||||||
return requestClient.get<MallDeliveryExpressTemplateApi.ExpressTemplate>(
|
return requestClient.get<MallDeliveryExpressTemplateApi.DeliveryExpressTemplate>(
|
||||||
`/trade/delivery/express-template/get?id=${id}`,
|
`/trade/delivery/express-template/get?id=${id}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询快递运费模板详情 */
|
/** 查询快递运费模板详情 */
|
||||||
export function getSimpleTemplateList() {
|
export function getSimpleTemplateList() {
|
||||||
return requestClient.get<MallDeliveryExpressTemplateApi.SimpleTemplate[]>(
|
return requestClient.get<
|
||||||
'/trade/delivery/express-template/list-all-simple',
|
MallDeliveryExpressTemplateApi.DeliveryExpressTemplate[]
|
||||||
);
|
>('/trade/delivery/express-template/list-all-simple');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增快递运费模板 */
|
/** 新增快递运费模板 */
|
||||||
export function createDeliveryExpressTemplate(
|
export function createDeliveryExpressTemplate(
|
||||||
data: MallDeliveryExpressTemplateApi.ExpressTemplate,
|
data: MallDeliveryExpressTemplateApi.DeliveryExpressTemplate,
|
||||||
) {
|
) {
|
||||||
return requestClient.post('/trade/delivery/express-template/create', data);
|
return requestClient.post('/trade/delivery/express-template/create', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改快递运费模板 */
|
/** 修改快递运费模板 */
|
||||||
export function updateDeliveryExpressTemplate(
|
export function updateDeliveryExpressTemplate(
|
||||||
data: MallDeliveryExpressTemplateApi.ExpressTemplate,
|
data: MallDeliveryExpressTemplateApi.DeliveryExpressTemplate,
|
||||||
) {
|
) {
|
||||||
return requestClient.put('/trade/delivery/express-template/update', data);
|
return requestClient.put('/trade/delivery/express-template/update', data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,35 +4,21 @@ import { requestClient } from '#/api/request';
|
|||||||
|
|
||||||
export namespace MallDeliveryPickUpStoreApi {
|
export namespace MallDeliveryPickUpStoreApi {
|
||||||
/** 自提门店 */
|
/** 自提门店 */
|
||||||
export interface PickUpStore {
|
export interface DeliveryPickUpStore {
|
||||||
/** 编号 */
|
id: number; // 编号
|
||||||
id: number;
|
name: string; // 门店名称
|
||||||
/** 门店名称 */
|
introduction: string; // 门店简介
|
||||||
name: string;
|
phone: string; // 联系电话
|
||||||
/** 门店简介 */
|
areaId: number; // 区域编号
|
||||||
introduction: string;
|
detailAddress: string; // 详细地址
|
||||||
/** 联系电话 */
|
logo: string; // 门店 logo
|
||||||
phone: string;
|
openingTime: string; // 营业开始时间
|
||||||
/** 区域编号 */
|
closingTime: string; // 营业结束时间
|
||||||
areaId: number;
|
latitude: number; // 纬度
|
||||||
/** 详细地址 */
|
longitude: number; // 经度
|
||||||
detailAddress: string;
|
status: number; // 状态
|
||||||
/** 门店 logo */
|
rangeTime: any[]; // 营业时间,用于 fieldMappingTime
|
||||||
logo: string;
|
verifyUserIds?: number[]; // 绑定用户编号组数
|
||||||
/** 营业开始时间 */
|
|
||||||
openingTime: string;
|
|
||||||
/** 营业结束时间 */
|
|
||||||
closingTime: string;
|
|
||||||
/** 纬度 */
|
|
||||||
latitude: number;
|
|
||||||
/** 经度 */
|
|
||||||
longitude: number;
|
|
||||||
/** 状态 */
|
|
||||||
status: number;
|
|
||||||
/** 营业时间 用于fieldMappingTime */
|
|
||||||
rangeTime: any[];
|
|
||||||
/** 绑定用户编号组数 */
|
|
||||||
verifyUserIds?: number[];
|
|
||||||
verifyUsers?: any[];
|
verifyUsers?: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,36 +32,35 @@ export namespace MallDeliveryPickUpStoreApi {
|
|||||||
|
|
||||||
/** 查询自提门店列表 */
|
/** 查询自提门店列表 */
|
||||||
export function getDeliveryPickUpStorePage(params: PageParam) {
|
export function getDeliveryPickUpStorePage(params: PageParam) {
|
||||||
return requestClient.get<PageResult<MallDeliveryPickUpStoreApi.PickUpStore>>(
|
return requestClient.get<
|
||||||
'/trade/delivery/pick-up-store/page',
|
PageResult<MallDeliveryPickUpStoreApi.DeliveryPickUpStore>
|
||||||
{ params },
|
>('/trade/delivery/pick-up-store/page', { params });
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询自提门店详情 */
|
/** 查询自提门店详情 */
|
||||||
export function getDeliveryPickUpStore(id: number) {
|
export function getDeliveryPickUpStore(id: number) {
|
||||||
return requestClient.get<MallDeliveryPickUpStoreApi.PickUpStore>(
|
return requestClient.get<MallDeliveryPickUpStoreApi.DeliveryPickUpStore>(
|
||||||
`/trade/delivery/pick-up-store/get?id=${id}`,
|
`/trade/delivery/pick-up-store/get?id=${id}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询自提门店精简列表 */
|
/** 查询自提门店精简列表 */
|
||||||
export function getSimpleDeliveryPickUpStoreList() {
|
export function getSimpleDeliveryPickUpStoreList() {
|
||||||
return requestClient.get<MallDeliveryPickUpStoreApi.PickUpStore[]>(
|
return requestClient.get<MallDeliveryPickUpStoreApi.DeliveryPickUpStore[]>(
|
||||||
'/trade/delivery/pick-up-store/simple-list',
|
'/trade/delivery/pick-up-store/simple-list',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增自提门店 */
|
/** 新增自提门店 */
|
||||||
export function createDeliveryPickUpStore(
|
export function createDeliveryPickUpStore(
|
||||||
data: MallDeliveryPickUpStoreApi.PickUpStore,
|
data: MallDeliveryPickUpStoreApi.DeliveryPickUpStore,
|
||||||
) {
|
) {
|
||||||
return requestClient.post('/trade/delivery/pick-up-store/create', data);
|
return requestClient.post('/trade/delivery/pick-up-store/create', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改自提门店 */
|
/** 修改自提门店 */
|
||||||
export function updateDeliveryPickUpStore(
|
export function updateDeliveryPickUpStore(
|
||||||
data: MallDeliveryPickUpStoreApi.PickUpStore,
|
data: MallDeliveryPickUpStoreApi.DeliveryPickUpStore,
|
||||||
) {
|
) {
|
||||||
return requestClient.put('/trade/delivery/pick-up-store/update', data);
|
return requestClient.put('/trade/delivery/pick-up-store/update', data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,231 +3,136 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace MallOrderApi {
|
export namespace MallOrderApi {
|
||||||
/** 商品属性 */
|
/** 订单信息 */
|
||||||
export interface ProductProperty {
|
export interface Order {
|
||||||
/** 属性的编号 */
|
id?: number; // 订单编号
|
||||||
propertyId?: number;
|
no?: string; // 订单流水号
|
||||||
/** 属性的名称 */
|
createTime?: Date; // 下单时间
|
||||||
propertyName?: string;
|
type?: number; // 订单类型
|
||||||
/** 属性值的编号 */
|
terminal?: number; // 订单来源
|
||||||
valueId?: number;
|
userId?: number; // 用户编号
|
||||||
/** 属性值的名称 */
|
userIp?: string; // 用户 IP
|
||||||
valueName?: string;
|
userRemark?: string; // 用户备注
|
||||||
|
status?: number; // 订单状态
|
||||||
|
productCount?: number; // 购买的商品数量
|
||||||
|
finishTime?: Date; // 订单完成时间
|
||||||
|
cancelTime?: Date; // 订单取消时间
|
||||||
|
cancelType?: number; // 取消类型
|
||||||
|
remark?: string; // 商家备注
|
||||||
|
payOrderId?: number; // 支付订单编号
|
||||||
|
payStatus?: boolean; // 是否已支付
|
||||||
|
payTime?: Date; // 付款时间
|
||||||
|
payChannelCode?: string; // 支付渠道
|
||||||
|
totalPrice?: number; // 商品原价(总)
|
||||||
|
discountPrice?: number; // 订单优惠(总)
|
||||||
|
deliveryPrice?: number; // 运费金额
|
||||||
|
adjustPrice?: number; // 订单调价(总)
|
||||||
|
payPrice?: number; // 应付金额(总)
|
||||||
|
deliveryType?: number; // 发货方式
|
||||||
|
pickUpStoreId?: number; // 自提门店编号
|
||||||
|
pickUpVerifyCode?: string; // 自提核销码
|
||||||
|
deliveryTemplateId?: number; // 配送模板编号
|
||||||
|
logisticsId?: number; // 发货物流公司编号
|
||||||
|
logisticsNo?: string; // 发货物流单号
|
||||||
|
deliveryTime?: Date; // 发货时间
|
||||||
|
receiveTime?: Date; // 收货时间
|
||||||
|
receiverName?: string; // 收件人名称
|
||||||
|
receiverMobile?: string; // 收件人手机
|
||||||
|
receiverPostCode?: number; // 收件人邮编
|
||||||
|
receiverAreaId?: number; // 收件人地区编号
|
||||||
|
receiverAreaName?: string; // 收件人地区名字
|
||||||
|
receiverDetailAddress?: string; // 收件人详细地址
|
||||||
|
afterSaleStatus?: number; // 售后状态
|
||||||
|
refundPrice?: number; // 退款金额
|
||||||
|
couponId?: number; // 优惠劵编号
|
||||||
|
couponPrice?: number; // 优惠劵减免金额
|
||||||
|
pointPrice?: number; // 积分抵扣的金额
|
||||||
|
vipPrice?: number; // VIP 减免金额
|
||||||
|
items?: OrderItem[]; // 订单项列表
|
||||||
|
user?: {
|
||||||
|
// 下单用户信息
|
||||||
|
avatar?: string; // 用户头像
|
||||||
|
id?: number; // 用户编号
|
||||||
|
nickname?: string; // 用户昵称
|
||||||
|
};
|
||||||
|
brokerageUser?: {
|
||||||
|
// 推广用户信息
|
||||||
|
avatar?: string; // 用户头像
|
||||||
|
id?: number; // 用户编号
|
||||||
|
nickname?: string; // 用户昵称
|
||||||
|
}; // 推广用户信息
|
||||||
|
logs?: OrderLog[]; // 订单操作日志
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单项 */
|
/** 订单项 */
|
||||||
export interface OrderItem {
|
export interface OrderItem {
|
||||||
/** 编号 */
|
id?: number; // 编号
|
||||||
id?: number;
|
userId?: number; // 用户编号
|
||||||
/** 用户编号 */
|
orderId?: number; // 订单编号
|
||||||
userId?: number;
|
spuId?: number; // 商品 SPU 编号
|
||||||
/** 订单编号 */
|
spuName?: string; // 商品 SPU 名称
|
||||||
orderId?: number;
|
skuId?: number; // 商品 SKU 编号
|
||||||
/** 商品 SPU 编号 */
|
picUrl?: string; // 商品图片
|
||||||
spuId?: number;
|
count?: number; // 购买数量
|
||||||
/** 商品 SPU 名称 */
|
originalPrice?: number; // 商品原价(总)
|
||||||
spuName?: string;
|
originalUnitPrice?: number; // 商品原价(单)
|
||||||
/** 商品 SKU 编号 */
|
discountPrice?: number; // 商品优惠(总)
|
||||||
skuId?: number;
|
payPrice?: number; // 商品实付金额(总)
|
||||||
/** 商品图片 */
|
orderPartPrice?: number; // 子订单分摊金额(总)
|
||||||
picUrl?: string;
|
orderDividePrice?: number; // 分摊后子订单实付金额(总)
|
||||||
/** 购买数量 */
|
afterSaleStatus?: number; // 售后状态
|
||||||
count?: number;
|
properties?: {
|
||||||
/** 商品原价(总) */
|
propertyId?: number; // 属性的编号
|
||||||
originalPrice?: number;
|
propertyName?: string; // 属性的名称
|
||||||
/** 商品原价(单) */
|
valueId?: number; // 属性值的编号
|
||||||
originalUnitPrice?: number;
|
valueName?: string; // 属性值的名称
|
||||||
/** 商品优惠(总) */
|
}[]; // 属性数组
|
||||||
discountPrice?: number;
|
|
||||||
/** 商品实付金额(总) */
|
|
||||||
payPrice?: number;
|
|
||||||
/** 子订单分摊金额(总) */
|
|
||||||
orderPartPrice?: number;
|
|
||||||
/** 分摊后子订单实付金额(总) */
|
|
||||||
orderDividePrice?: number;
|
|
||||||
/** 售后状态 */
|
|
||||||
afterSaleStatus?: number;
|
|
||||||
/** 属性数组 */
|
|
||||||
properties?: ProductProperty[];
|
|
||||||
price?: number;
|
price?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单日志 */
|
/** 订单日志 */
|
||||||
export interface OrderLog {
|
export interface OrderLog {
|
||||||
/** 日志内容 */
|
content?: string; // 日志内容
|
||||||
content?: string;
|
createTime?: Date; // 创建时间
|
||||||
/** 创建时间 */
|
userType?: number; // 用户类型
|
||||||
createTime?: Date;
|
userId?: number; // 用户编号
|
||||||
/** 用户类型 */
|
|
||||||
userType?: number;
|
|
||||||
/** 用户编号 */
|
|
||||||
userId?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单 */
|
/** 交易订单统计响应 */
|
||||||
export interface Order {
|
export interface OrderSummaryRespVO {
|
||||||
/** 订单编号 */
|
orderCount: number; // 订单数量
|
||||||
id?: number;
|
orderPayPrice: number; // 订单金额
|
||||||
/** 订单流水号 */
|
afterSaleCount: number; // 退款单数
|
||||||
no?: string;
|
afterSalePrice: number; // 退款金额
|
||||||
/** 下单时间 */
|
|
||||||
createTime?: Date;
|
|
||||||
/** 订单类型 */
|
|
||||||
type?: number;
|
|
||||||
/** 订单来源 */
|
|
||||||
terminal?: number;
|
|
||||||
/** 用户编号 */
|
|
||||||
userId?: number;
|
|
||||||
/** 用户 IP */
|
|
||||||
userIp?: string;
|
|
||||||
/** 用户备注 */
|
|
||||||
userRemark?: string;
|
|
||||||
/** 订单状态 */
|
|
||||||
status?: number;
|
|
||||||
/** 购买的商品数量 */
|
|
||||||
productCount?: number;
|
|
||||||
/** 订单完成时间 */
|
|
||||||
finishTime?: Date;
|
|
||||||
/** 订单取消时间 */
|
|
||||||
cancelTime?: Date;
|
|
||||||
/** 取消类型 */
|
|
||||||
cancelType?: number;
|
|
||||||
/** 商家备注 */
|
|
||||||
remark?: string;
|
|
||||||
/** 支付订单编号 */
|
|
||||||
payOrderId?: number;
|
|
||||||
/** 是否已支付 */
|
|
||||||
payStatus?: boolean;
|
|
||||||
/** 付款时间 */
|
|
||||||
payTime?: Date;
|
|
||||||
/** 支付渠道 */
|
|
||||||
payChannelCode?: string;
|
|
||||||
/** 商品原价(总) */
|
|
||||||
totalPrice?: number;
|
|
||||||
/** 订单优惠(总) */
|
|
||||||
discountPrice?: number;
|
|
||||||
/** 运费金额 */
|
|
||||||
deliveryPrice?: number;
|
|
||||||
/** 订单调价(总) */
|
|
||||||
adjustPrice?: number;
|
|
||||||
/** 应付金额(总) */
|
|
||||||
payPrice?: number;
|
|
||||||
/** 发货方式 */
|
|
||||||
deliveryType?: number;
|
|
||||||
/** 自提门店编号 */
|
|
||||||
pickUpStoreId?: number;
|
|
||||||
/** 自提核销码 */
|
|
||||||
pickUpVerifyCode?: string;
|
|
||||||
/** 配送模板编号 */
|
|
||||||
deliveryTemplateId?: number;
|
|
||||||
/** 发货物流公司编号 */
|
|
||||||
logisticsId?: number;
|
|
||||||
/** 发货物流单号 */
|
|
||||||
logisticsNo?: string;
|
|
||||||
/** 发货时间 */
|
|
||||||
deliveryTime?: Date;
|
|
||||||
/** 收货时间 */
|
|
||||||
receiveTime?: Date;
|
|
||||||
/** 收件人名称 */
|
|
||||||
receiverName?: string;
|
|
||||||
/** 收件人手机 */
|
|
||||||
receiverMobile?: string;
|
|
||||||
/** 收件人邮编 */
|
|
||||||
receiverPostCode?: number;
|
|
||||||
/** 收件人地区编号 */
|
|
||||||
receiverAreaId?: number;
|
|
||||||
/** 收件人地区名字 */
|
|
||||||
receiverAreaName?: string;
|
|
||||||
/** 收件人详细地址 */
|
|
||||||
receiverDetailAddress?: string;
|
|
||||||
/** 售后状态 */
|
|
||||||
afterSaleStatus?: number;
|
|
||||||
/** 退款金额 */
|
|
||||||
refundPrice?: number;
|
|
||||||
/** 优惠劵编号 */
|
|
||||||
couponId?: number;
|
|
||||||
/** 优惠劵减免金额 */
|
|
||||||
couponPrice?: number;
|
|
||||||
/** 积分抵扣的金额 */
|
|
||||||
pointPrice?: number;
|
|
||||||
/** VIP 减免金额 */
|
|
||||||
vipPrice?: number;
|
|
||||||
/** 订单项列表 */
|
|
||||||
items?: OrderItem[];
|
|
||||||
/** 下单用户信息 */
|
|
||||||
user?: {
|
|
||||||
/** 用户头像 */
|
|
||||||
avatar?: string;
|
|
||||||
/** 用户编号 */
|
|
||||||
id?: number;
|
|
||||||
/** 用户昵称 */
|
|
||||||
nickname?: string;
|
|
||||||
};
|
|
||||||
/** 推广用户信息 */
|
|
||||||
brokerageUser?: {
|
|
||||||
/** 用户头像 */
|
|
||||||
avatar?: string;
|
|
||||||
/** 用户编号 */
|
|
||||||
id?: number;
|
|
||||||
/** 用户昵称 */
|
|
||||||
nickname?: string;
|
|
||||||
};
|
|
||||||
/** 订单操作日志 */
|
|
||||||
logs?: OrderLog[];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 交易订单统计 */
|
|
||||||
export interface OrderSummary {
|
|
||||||
/** 订单数量 */
|
|
||||||
orderCount: number;
|
|
||||||
/** 订单金额 */
|
|
||||||
orderPayPrice: number;
|
|
||||||
/** 退款单数 */
|
|
||||||
afterSaleCount: number;
|
|
||||||
/** 退款金额 */
|
|
||||||
afterSalePrice: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单发货请求 */
|
/** 订单发货请求 */
|
||||||
export interface DeliveryRequest {
|
export interface OrderUpdateDeliveryReqVO {
|
||||||
/** 订单编号 */
|
id?: number; // 订单编号
|
||||||
id?: number;
|
expressType: string; // 发货方式
|
||||||
/** 发货方式 */
|
logisticsId: number; // 物流公司编号
|
||||||
expressType: string;
|
logisticsNo: string; // 物流编号
|
||||||
/** 物流公司编号 */
|
|
||||||
logisticsId: number;
|
|
||||||
/** 物流编号 */
|
|
||||||
logisticsNo: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单备注请求 */
|
/** 订单备注请求 */
|
||||||
export interface RemarkRequest {
|
export interface OrderUpdateRemarkReqVO {
|
||||||
/** 订单编号 */
|
id: number; // 订单编号
|
||||||
id: number;
|
remark: string; // 备注
|
||||||
/** 备注 */
|
|
||||||
remark: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单调价请求 */
|
/** 订单调价请求 */
|
||||||
export interface PriceRequest {
|
export interface OrderUpdatePriceReqVO {
|
||||||
/** 订单编号 */
|
id: number; // 订单编号
|
||||||
id: number;
|
adjustPrice: number; // 调整金额,单位:分
|
||||||
/** 调整金额,单位:分 */
|
|
||||||
adjustPrice: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单地址请求 */
|
/** 订单地址请求 */
|
||||||
export interface AddressRequest {
|
export interface OrderUpdateAddressReqVO {
|
||||||
/** 订单编号 */
|
id: number; // 订单编号
|
||||||
id: number;
|
receiverName: string; // 收件人名称
|
||||||
/** 收件人名称 */
|
receiverMobile: string; // 收件人手机
|
||||||
receiverName: string;
|
receiverAreaId: number; // 收件人地区编号
|
||||||
/** 收件人手机 */
|
receiverDetailAddress: string; // 收件人详细地址
|
||||||
receiverMobile: string;
|
|
||||||
/** 收件人地区编号 */
|
|
||||||
receiverAreaId: number;
|
|
||||||
/** 收件人详细地址 */
|
|
||||||
receiverDetailAddress: string;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,9 +148,12 @@ export function getOrderPage(params: PageParam) {
|
|||||||
|
|
||||||
/** 查询交易订单统计 */
|
/** 查询交易订单统计 */
|
||||||
export function getOrderSummary(params: any) {
|
export function getOrderSummary(params: any) {
|
||||||
return requestClient.get<MallOrderApi.OrderSummary>('/trade/order/summary', {
|
return requestClient.get<MallOrderApi.OrderSummaryRespVO>(
|
||||||
|
'/trade/order/summary',
|
||||||
|
{
|
||||||
params,
|
params,
|
||||||
});
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询交易订单详情 */
|
/** 查询交易订单详情 */
|
||||||
@@ -261,22 +169,22 @@ export function getExpressTrackList(id: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 订单发货 */
|
/** 订单发货 */
|
||||||
export function deliveryOrder(data: MallOrderApi.DeliveryRequest) {
|
export function deliveryOrder(data: MallOrderApi.OrderUpdateDeliveryReqVO) {
|
||||||
return requestClient.put('/trade/order/delivery', data);
|
return requestClient.put('/trade/order/delivery', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单备注 */
|
/** 订单备注 */
|
||||||
export function updateOrderRemark(data: MallOrderApi.RemarkRequest) {
|
export function updateOrderRemark(data: MallOrderApi.OrderUpdateRemarkReqVO) {
|
||||||
return requestClient.put('/trade/order/update-remark', data);
|
return requestClient.put('/trade/order/update-remark', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单调价 */
|
/** 订单调价 */
|
||||||
export function updateOrderPrice(data: MallOrderApi.PriceRequest) {
|
export function updateOrderPrice(data: MallOrderApi.OrderUpdatePriceReqVO) {
|
||||||
return requestClient.put('/trade/order/update-price', data);
|
return requestClient.put('/trade/order/update-price', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改订单地址 */
|
/** 修改订单地址 */
|
||||||
export function updateOrderAddress(data: MallOrderApi.AddressRequest) {
|
export function updateOrderAddress(data: MallOrderApi.OrderUpdateAddressReqVO) {
|
||||||
return requestClient.put('/trade/order/update-address', data);
|
return requestClient.put('/trade/order/update-address', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -254,14 +254,13 @@ function open() {
|
|||||||
function set() {
|
function set() {
|
||||||
defaultValue.value = props.modelValue;
|
defaultValue.value = props.modelValue;
|
||||||
let arr = (props.modelValue || '* * * * * ?').split(' ');
|
let arr = (props.modelValue || '* * * * * ?').split(' ');
|
||||||
|
// 简单检查
|
||||||
/** 简单检查 */
|
|
||||||
if (arr.length < 6) {
|
if (arr.length < 6) {
|
||||||
message.warning('cron表达式错误,已转换为默认表达式');
|
message.warning('cron表达式错误,已转换为默认表达式');
|
||||||
arr = '* * * * * ?'.split(' ');
|
arr = '* * * * * ?'.split(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 秒 */
|
// 秒
|
||||||
if (arr[0] === '*') {
|
if (arr[0] === '*') {
|
||||||
cronValue.second.type = '0';
|
cronValue.second.type = '0';
|
||||||
} else if (arr[0]?.includes('-')) {
|
} else if (arr[0]?.includes('-')) {
|
||||||
@@ -277,7 +276,7 @@ function set() {
|
|||||||
cronValue.second.appoint = arr[0]?.split(',') || [];
|
cronValue.second.appoint = arr[0]?.split(',') || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 分 */
|
// 分
|
||||||
if (arr[1] === '*') {
|
if (arr[1] === '*') {
|
||||||
cronValue.minute.type = '0';
|
cronValue.minute.type = '0';
|
||||||
} else if (arr[1]?.includes('-')) {
|
} else if (arr[1]?.includes('-')) {
|
||||||
@@ -293,7 +292,7 @@ function set() {
|
|||||||
cronValue.minute.appoint = arr[1]?.split(',') || [];
|
cronValue.minute.appoint = arr[1]?.split(',') || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 小时 */
|
// 小时
|
||||||
if (arr[2] === '*') {
|
if (arr[2] === '*') {
|
||||||
cronValue.hour.type = '0';
|
cronValue.hour.type = '0';
|
||||||
} else if (arr[2]?.includes('-')) {
|
} else if (arr[2]?.includes('-')) {
|
||||||
@@ -309,21 +308,18 @@ function set() {
|
|||||||
cronValue.hour.appoint = arr[2]?.split(',') || [];
|
cronValue.hour.appoint = arr[2]?.split(',') || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 日 */
|
// 日
|
||||||
switch (arr[3]) {
|
switch (arr[3]) {
|
||||||
case '*': {
|
case '*': {
|
||||||
cronValue.day.type = '0';
|
cronValue.day.type = '0';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case '?': {
|
case '?': {
|
||||||
cronValue.day.type = '5';
|
cronValue.day.type = '5';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'L': {
|
case 'L': {
|
||||||
cronValue.day.type = '4';
|
cronValue.day.type = '4';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@@ -342,7 +338,7 @@ function set() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 月 */
|
// 月
|
||||||
if (arr[4] === '*') {
|
if (arr[4] === '*') {
|
||||||
cronValue.month.type = '0';
|
cronValue.month.type = '0';
|
||||||
} else if (arr[4]?.includes('-')) {
|
} else if (arr[4]?.includes('-')) {
|
||||||
@@ -358,7 +354,7 @@ function set() {
|
|||||||
cronValue.month.appoint = arr[4]?.split(',') || [];
|
cronValue.month.appoint = arr[4]?.split(',') || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 周 */
|
// 周
|
||||||
if (arr[5] === '*') {
|
if (arr[5] === '*') {
|
||||||
cronValue.week.type = '0';
|
cronValue.week.type = '0';
|
||||||
} else if (arr[5] === '?') {
|
} else if (arr[5] === '?') {
|
||||||
@@ -379,7 +375,7 @@ function set() {
|
|||||||
cronValue.week.appoint = arr[5]?.split(',') || [];
|
cronValue.week.appoint = arr[5]?.split(',') || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 年 */
|
// 年
|
||||||
if (!arr[6]) {
|
if (!arr[6]) {
|
||||||
cronValue.year.type = '-1';
|
cronValue.year.type = '-1';
|
||||||
} else if (arr[6] === '*') {
|
} else if (arr[6] === '*') {
|
||||||
|
|||||||
@@ -284,7 +284,6 @@ async function handleOk() {
|
|||||||
class="h-full w-full object-cover"
|
class="h-full w-full object-cover"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 头像组合预览 -->
|
<!-- 头像组合预览 -->
|
||||||
<template v-if="previewSource">
|
<template v-if="previewSource">
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -8,37 +8,24 @@ import type { Recordable } from '@vben/types';
|
|||||||
export interface DescriptionItemSchema {
|
export interface DescriptionItemSchema {
|
||||||
labelMinWidth?: number;
|
labelMinWidth?: number;
|
||||||
contentMinWidth?: number;
|
contentMinWidth?: number;
|
||||||
// 自定义标签样式
|
labelStyle?: CSSProperties; // 自定义标签样式
|
||||||
labelStyle?: CSSProperties;
|
field: string; // 对应 data 中的字段名
|
||||||
// 对应 data 中的字段名
|
label: JSX.Element | string | VNode; // 内容的描述
|
||||||
field: string;
|
span?: number; // 包含列的数量
|
||||||
// 内容的描述
|
show?: (...arg: any) => boolean; // 是否显示
|
||||||
label: JSX.Element | string | VNode;
|
slot?: string; // 插槽名称
|
||||||
// 包含列的数量
|
|
||||||
span?: number;
|
|
||||||
// 是否显示
|
|
||||||
show?: (...arg: any) => boolean;
|
|
||||||
// 插槽名称
|
|
||||||
slot?: string;
|
|
||||||
// 自定义需要展示的内容
|
|
||||||
render?: (
|
render?: (
|
||||||
val: any,
|
val: any,
|
||||||
data?: Recordable<any>,
|
data?: Recordable<any>,
|
||||||
) => Element | JSX.Element | number | string | undefined | VNode;
|
) => Element | JSX.Element | number | string | undefined | VNode; // 自定义需要展示的内容
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DescriptionProps extends DescriptionsProps {
|
export interface DescriptionProps extends DescriptionsProps {
|
||||||
// 是否包含卡片组件
|
useCard?: boolean; // 是否包含卡片组件
|
||||||
useCard?: boolean;
|
schema: DescriptionItemSchema[]; // 描述项配置
|
||||||
// 描述项配置
|
data: Recordable<any>; // 数据
|
||||||
schema: DescriptionItemSchema[];
|
title?: string; // 标题
|
||||||
// 数据
|
bordered?: boolean; // 是否包含边框
|
||||||
data: Recordable<any>;
|
|
||||||
// 标题
|
|
||||||
title?: string;
|
|
||||||
// 是否包含边框
|
|
||||||
bordered?: boolean;
|
|
||||||
// 列数
|
|
||||||
column?:
|
column?:
|
||||||
| number
|
| number
|
||||||
| {
|
| {
|
||||||
@@ -48,7 +35,7 @@ export interface DescriptionProps extends DescriptionsProps {
|
|||||||
xl: number;
|
xl: number;
|
||||||
xs: number;
|
xs: number;
|
||||||
xxl: number;
|
xxl: number;
|
||||||
};
|
}; // 列数
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DescInstance {
|
export interface DescInstance {
|
||||||
|
|||||||
@@ -7,18 +7,9 @@ import { isValidColor, TinyColor } from '@vben/utils';
|
|||||||
import { Tag } from 'ant-design-vue';
|
import { Tag } from 'ant-design-vue';
|
||||||
|
|
||||||
interface DictTagProps {
|
interface DictTagProps {
|
||||||
/**
|
type: string; // 字典类型
|
||||||
* 字典类型
|
value: any; // 字典值
|
||||||
*/
|
icon?: string; // 图标
|
||||||
type: string;
|
|
||||||
/**
|
|
||||||
* 字典值
|
|
||||||
*/
|
|
||||||
value: any;
|
|
||||||
/**
|
|
||||||
* 图标
|
|
||||||
*/
|
|
||||||
icon?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<DictTagProps>();
|
const props = defineProps<DictTagProps>();
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const props = withDefaults(defineProps<DictSelectProps>(), {
|
|||||||
|
|
||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
|
|
||||||
// 获得字典配置
|
/** 获得字典配置 */
|
||||||
const getDictOption = computed(() => {
|
const getDictOption = computed(() => {
|
||||||
switch (props.valueType) {
|
switch (props.valueType) {
|
||||||
case 'bool': {
|
case 'bool': {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export function useImagesUpload() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
// TODO: @dhb52 其实还是靠 props 默认参数起作用,没能从 formCreate 传递
|
// TODO: @puhui999:@dhb52 其实还是靠 props 默认参数起作用,没能从 formCreate 传递
|
||||||
return (props: { maxNumber?: number; multiple?: boolean }) => (
|
return (props: { maxNumber?: number; multiple?: boolean }) => (
|
||||||
<ImageUpload maxNumber={props.maxNumber} multiple={props.multiple} />
|
<ImageUpload maxNumber={props.maxNumber} multiple={props.multiple} />
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ import {
|
|||||||
useUploadImagesRule,
|
useUploadImagesRule,
|
||||||
} from './rules';
|
} from './rules';
|
||||||
|
|
||||||
// 编码表单 Conf
|
/** 编码表单 Conf */
|
||||||
export function encodeConf(designerRef: any) {
|
export function encodeConf(designerRef: any) {
|
||||||
return JSON.stringify(designerRef.value.getOption());
|
return JSON.stringify(designerRef.value.getOption());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编码表单 Fields
|
/** 编码表单 Fields */
|
||||||
export function encodeFields(designerRef: any) {
|
export function encodeFields(designerRef: any) {
|
||||||
const rule = JSON.parse(designerRef.value.getJson());
|
const rule = JSON.parse(designerRef.value.getJson());
|
||||||
const fields: string[] = [];
|
const fields: string[] = [];
|
||||||
@@ -34,7 +34,7 @@ export function encodeFields(designerRef: any) {
|
|||||||
return fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 解码表单 Fields
|
/** 解码表单 Fields */
|
||||||
export function decodeFields(fields: string[]) {
|
export function decodeFields(fields: string[]) {
|
||||||
const rule: Rule[] = [];
|
const rule: Rule[] = [];
|
||||||
fields.forEach((item) => {
|
fields.forEach((item) => {
|
||||||
@@ -43,7 +43,7 @@ export function decodeFields(fields: string[]) {
|
|||||||
return rule;
|
return rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置表单的 Conf 和 Fields,适用 FcDesigner 场景
|
/** 设置表单的 Conf 和 Fields,适用 FcDesigner 场景 */
|
||||||
export function setConfAndFields(
|
export function setConfAndFields(
|
||||||
designerRef: any,
|
designerRef: any,
|
||||||
conf: string,
|
conf: string,
|
||||||
@@ -55,7 +55,7 @@ export function setConfAndFields(
|
|||||||
designerRef.value.setRule(decodeFields(fieldsArray));
|
designerRef.value.setRule(decodeFields(fieldsArray));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置表单的 Conf 和 Fields,适用 form-create 场景
|
/** 设置表单的 Conf 和 Fields,适用 form-create 场景 */
|
||||||
export function setConfAndFields2(
|
export function setConfAndFields2(
|
||||||
detailPreview: any,
|
detailPreview: any,
|
||||||
conf: string,
|
conf: string,
|
||||||
@@ -155,9 +155,7 @@ export async function useFormCreateDesigner(designer: Ref) {
|
|||||||
const uploadImageRule = useUploadImageRule();
|
const uploadImageRule = useUploadImageRule();
|
||||||
const uploadImagesRule = useUploadImagesRule();
|
const uploadImagesRule = useUploadImagesRule();
|
||||||
|
|
||||||
/**
|
/** 构建表单组件 */
|
||||||
* 构建表单组件
|
|
||||||
*/
|
|
||||||
function buildFormComponents() {
|
function buildFormComponents() {
|
||||||
// 移除自带的上传组件规则,使用 uploadFileRule、uploadImgRule、uploadImgsRule 替代
|
// 移除自带的上传组件规则,使用 uploadFileRule、uploadImgRule、uploadImgsRule 替代
|
||||||
designer.value?.removeMenuItem('upload');
|
designer.value?.removeMenuItem('upload');
|
||||||
@@ -200,9 +198,7 @@ export async function useFormCreateDesigner(designer: Ref) {
|
|||||||
event: ['click', 'change', 'visibleChange', 'clear', 'blur', 'focus'],
|
event: ['click', 'change', 'visibleChange', 'clear', 'blur', 'focus'],
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** 构建系统字段菜单 */
|
||||||
* 构建系统字段菜单
|
|
||||||
*/
|
|
||||||
function buildSystemMenu() {
|
function buildSystemMenu() {
|
||||||
// 移除自带的下拉选择器组件,使用 currencySelectRule 替代
|
// 移除自带的下拉选择器组件,使用 currencySelectRule 替代
|
||||||
// designer.value?.removeMenuItem('select')
|
// designer.value?.removeMenuItem('select')
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ import {
|
|||||||
} from '#/components/form-create/helpers';
|
} from '#/components/form-create/helpers';
|
||||||
import { selectRule } from '#/components/form-create/rules/data';
|
import { selectRule } from '#/components/form-create/rules/data';
|
||||||
|
|
||||||
/**
|
/** 字典选择器规则,如果规则使用到动态数据则需要单独配置不能使用 useSelectRule */
|
||||||
* 字典选择器规则,如果规则使用到动态数据则需要单独配置不能使用 useSelectRule
|
|
||||||
*/
|
|
||||||
export function useDictSelectRule() {
|
export function useDictSelectRule() {
|
||||||
const label = '字典选择器';
|
const label = '字典选择器';
|
||||||
const name = 'DictSelect';
|
const name = 'DictSelect';
|
||||||
|
|||||||
@@ -17,10 +17,9 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
},
|
||||||
fullscreen: {
|
fullscreen: {
|
||||||
// 图片上传,是否放到全屏的位置
|
|
||||||
default: false,
|
default: false,
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
}, // 图片上传,是否放到全屏的位置
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['uploading', 'done', 'error']);
|
const emit = defineEmits(['uploading', 'done', 'error']);
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ function beforeUpload(file: FileType) {
|
|||||||
<Form class="mx-4">
|
<Form class="mx-4">
|
||||||
<template #file>
|
<template #file>
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
<!-- 上传区域 -->
|
|
||||||
<Upload.Dragger
|
<Upload.Dragger
|
||||||
name="file"
|
name="file"
|
||||||
:max-count="1"
|
:max-count="1"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import MemberTerminalCard from './modules/terminal-card.vue';
|
|||||||
defineOptions({ name: 'MemberStatistics' });
|
defineOptions({ name: 'MemberStatistics' });
|
||||||
|
|
||||||
const loading = ref(true); // 加载中
|
const loading = ref(true); // 加载中
|
||||||
const summary = ref<MallMemberStatisticsApi.Summary>(); // 会员统计数据
|
const summary = ref<MallMemberStatisticsApi.SummaryRespVO>(); // 会员统计数据
|
||||||
|
|
||||||
/** 查询会员统计 */
|
/** 查询会员统计 */
|
||||||
async function loadMemberSummary() {
|
async function loadMemberSummary() {
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ import { getAreaChartOptions, getAreaTableColumns } from './area-chart-options';
|
|||||||
defineOptions({ name: 'MemberAreaCard' });
|
defineOptions({ name: 'MemberAreaCard' });
|
||||||
|
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const areaStatisticsList = shallowRef<MallMemberStatisticsApi.AreaStatistics[]>(
|
const areaStatisticsList = shallowRef<
|
||||||
[],
|
MallMemberStatisticsApi.AreaStatisticsRespVO[]
|
||||||
);
|
>([]);
|
||||||
const chartRef = ref<EchartsUIType>();
|
const chartRef = ref<EchartsUIType>();
|
||||||
const { renderEcharts } = useEcharts(chartRef);
|
const { renderEcharts } = useEcharts(chartRef);
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ async function loadMemberAreaStatisticsList() {
|
|||||||
try {
|
try {
|
||||||
const list = await getMemberAreaStatisticsList();
|
const list = await getMemberAreaStatisticsList();
|
||||||
areaStatisticsList.value = list.map(
|
areaStatisticsList.value = list.map(
|
||||||
(item: MallMemberStatisticsApi.AreaStatistics) => ({
|
(item: MallMemberStatisticsApi.AreaStatisticsRespVO) => ({
|
||||||
...item,
|
...item,
|
||||||
areaName: areaReplace(item.areaName),
|
areaName: areaReplace(item.areaName),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { fenToYuan } from '@vben/utils';
|
|||||||
|
|
||||||
/** 会员地域分布图表配置 */
|
/** 会员地域分布图表配置 */
|
||||||
export function getAreaChartOptions(
|
export function getAreaChartOptions(
|
||||||
data: MallMemberStatisticsApi.AreaStatistics[],
|
data: MallMemberStatisticsApi.AreaStatisticsRespVO[],
|
||||||
): any {
|
): any {
|
||||||
if (!data || data.length === 0) {
|
if (!data || data.length === 0) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ async function loadMemberSexStatisticsList() {
|
|||||||
dictDataList.push({ label: '未知', value: null } as any);
|
dictDataList.push({ label: '未知', value: null } as any);
|
||||||
const chartData = dictDataList.map((dictData: any) => {
|
const chartData = dictDataList.map((dictData: any) => {
|
||||||
const userCount = list.find(
|
const userCount = list.find(
|
||||||
(item: MallMemberStatisticsApi.SexStatistics) =>
|
(item: MallMemberStatisticsApi.SexStatisticsRespVO) =>
|
||||||
item.sex === dictData.value,
|
item.sex === dictData.value,
|
||||||
)?.userCount;
|
)?.userCount;
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ defineOptions({ name: 'ProductSummaryCard' });
|
|||||||
const trendLoading = ref(true); // 商品状态加载中
|
const trendLoading = ref(true); // 商品状态加载中
|
||||||
const exportLoading = ref(false); // 导出的加载中
|
const exportLoading = ref(false); // 导出的加载中
|
||||||
const trendSummary =
|
const trendSummary =
|
||||||
ref<DataComparisonRespVO<MallProductStatisticsApi.ProductStatistics>>(); // 商品状况统计数据
|
ref<DataComparisonRespVO<MallProductStatisticsApi.ProductStatisticsRespVO>>(); // 商品状况统计数据
|
||||||
const searchTimes = ref<string[]>([]);
|
const searchTimes = ref<string[]>([]);
|
||||||
|
|
||||||
const chartRef = ref<EchartsUIType>();
|
const chartRef = ref<EchartsUIType>();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ defineOptions({ name: 'TradeStatistics' });
|
|||||||
|
|
||||||
const loading = ref(true); // 加载中
|
const loading = ref(true); // 加载中
|
||||||
const summary =
|
const summary =
|
||||||
ref<DataComparisonRespVO<MallTradeStatisticsApi.TradeSummary>>(); // 交易统计数据
|
ref<DataComparisonRespVO<MallTradeStatisticsApi.TradeSummaryRespVO>>(); // 交易统计数据
|
||||||
|
|
||||||
/** 计算环比百分比 */
|
/** 计算环比百分比 */
|
||||||
function calculateRelativeRate(value?: number, reference?: number): string {
|
function calculateRelativeRate(value?: number, reference?: number): string {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ defineOptions({ name: 'TradeTrendCard' });
|
|||||||
const trendLoading = ref(true); // 交易状态加载中
|
const trendLoading = ref(true); // 交易状态加载中
|
||||||
const exportLoading = ref(false); // 导出的加载中
|
const exportLoading = ref(false); // 导出的加载中
|
||||||
const trendSummary =
|
const trendSummary =
|
||||||
ref<DataComparisonRespVO<MallTradeStatisticsApi.TradeTrendSummary>>(); // 交易状况统计数据
|
ref<DataComparisonRespVO<MallTradeStatisticsApi.TradeTrendSummaryRespVO>>(); // 交易状况统计数据
|
||||||
const searchTimes = ref<string[]>([]);
|
const searchTimes = ref<string[]>([]);
|
||||||
|
|
||||||
const chartRef = ref<EchartsUIType>();
|
const chartRef = ref<EchartsUIType>();
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { fenToYuan } from '@vben/utils';
|
|||||||
|
|
||||||
/** 交易趋势折线图配置 */
|
/** 交易趋势折线图配置 */
|
||||||
export function getTradeTrendChartOptions(
|
export function getTradeTrendChartOptions(
|
||||||
data: MallTradeStatisticsApi.TradeTrendSummary[],
|
data: MallTradeStatisticsApi.TradeTrendSummaryRespVO[],
|
||||||
): any {
|
): any {
|
||||||
// 处理数据:将分转换为元
|
// 处理数据:将分转换为元
|
||||||
const processedData = data.map((item) => ({
|
const processedData = data.map((item) => ({
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
// 提交表单
|
// 提交表单
|
||||||
try {
|
try {
|
||||||
const data =
|
const data =
|
||||||
(await formApi.getValues()) as MallAfterSaleApi.DisagreeRequest;
|
(await formApi.getValues()) as MallAfterSaleApi.AfterSaleDisagreeReqVO;
|
||||||
await disagreeAfterSale(data);
|
await disagreeAfterSale(data);
|
||||||
// 关闭并提示
|
// 关闭并提示
|
||||||
await modalApi.close();
|
await modalApi.close();
|
||||||
|
|||||||
@@ -32,13 +32,15 @@ function handleCreate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 编辑快递模板 */
|
/** 编辑快递模板 */
|
||||||
function handleEdit(row: MallDeliveryExpressTemplateApi.ExpressTemplate) {
|
function handleEdit(
|
||||||
|
row: MallDeliveryExpressTemplateApi.DeliveryExpressTemplate,
|
||||||
|
) {
|
||||||
formModalApi.setData(row).open();
|
formModalApi.setData(row).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除快递模板 */
|
/** 删除快递模板 */
|
||||||
async function handleDelete(
|
async function handleDelete(
|
||||||
row: MallDeliveryExpressTemplateApi.ExpressTemplate,
|
row: MallDeliveryExpressTemplateApi.DeliveryExpressTemplate,
|
||||||
) {
|
) {
|
||||||
const hideLoading = message.loading({
|
const hideLoading = message.loading({
|
||||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||||
@@ -80,7 +82,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
refresh: true,
|
refresh: true,
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<MallDeliveryExpressTemplateApi.ExpressTemplate>,
|
} as VxeTableGridOptions<MallDeliveryExpressTemplateApi.DeliveryExpressTemplate>,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
|||||||
import { CHARGE_MODE_TITLE_MAP, useChargesColumns } from '../data';
|
import { CHARGE_MODE_TITLE_MAP, useChargesColumns } from '../data';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
items?: MallDeliveryExpressTemplateApi.TemplateCharge[];
|
items?: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateCharge[];
|
||||||
chargeMode?: number;
|
chargeMode?: number;
|
||||||
areaTree?: SystemAreaApi.Area[];
|
areaTree?: SystemAreaApi.Area[];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import ChargeItemForm from './charge-item-form.vue';
|
|||||||
import FreeItemForm from './free-item-form.vue';
|
import FreeItemForm from './free-item-form.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
const formData = ref<MallDeliveryExpressTemplateApi.ExpressTemplate>();
|
const formData = ref<MallDeliveryExpressTemplateApi.DeliveryExpressTemplate>();
|
||||||
const chargeItemFormRef = ref<InstanceType<typeof ChargeItemForm>>();
|
const chargeItemFormRef = ref<InstanceType<typeof ChargeItemForm>>();
|
||||||
const freeItemFormRef = ref<InstanceType<typeof FreeItemForm>>();
|
const freeItemFormRef = ref<InstanceType<typeof FreeItemForm>>();
|
||||||
const areaTree = ref<SystemAreaApi.Area[]>([]);
|
const areaTree = ref<SystemAreaApi.Area[]>([]);
|
||||||
@@ -55,10 +55,10 @@ const [Form, formApi] = useVbenForm({
|
|||||||
|
|
||||||
/** 更新运费设置 */
|
/** 更新运费设置 */
|
||||||
const handleUpdateCharges = async (
|
const handleUpdateCharges = async (
|
||||||
charges: MallDeliveryExpressTemplateApi.TemplateCharge[],
|
charges: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateCharge[],
|
||||||
) => {
|
) => {
|
||||||
formData.value =
|
formData.value =
|
||||||
await formApi.getValues<MallDeliveryExpressTemplateApi.ExpressTemplate>();
|
await formApi.getValues<MallDeliveryExpressTemplateApi.DeliveryExpressTemplate>();
|
||||||
formData.value.charges = charges;
|
formData.value.charges = charges;
|
||||||
await formApi.setValues({
|
await formApi.setValues({
|
||||||
charges,
|
charges,
|
||||||
@@ -67,10 +67,10 @@ const handleUpdateCharges = async (
|
|||||||
|
|
||||||
/** 更新包邮设置 */
|
/** 更新包邮设置 */
|
||||||
const handleUpdateFrees = async (
|
const handleUpdateFrees = async (
|
||||||
frees: MallDeliveryExpressTemplateApi.TemplateFree[],
|
frees: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateFree[],
|
||||||
) => {
|
) => {
|
||||||
formData.value =
|
formData.value =
|
||||||
await formApi.getValues<MallDeliveryExpressTemplateApi.ExpressTemplate>();
|
await formApi.getValues<MallDeliveryExpressTemplateApi.DeliveryExpressTemplate>();
|
||||||
formData.value.frees = frees;
|
formData.value.frees = frees;
|
||||||
await formApi.setValues({
|
await formApi.setValues({
|
||||||
frees,
|
frees,
|
||||||
@@ -102,17 +102,19 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
// 提交表单
|
// 提交表单
|
||||||
const data = cloneDeep(
|
const data = cloneDeep(
|
||||||
await formApi.getValues(),
|
await formApi.getValues(),
|
||||||
) as MallDeliveryExpressTemplateApi.ExpressTemplate;
|
) as MallDeliveryExpressTemplateApi.DeliveryExpressTemplate;
|
||||||
try {
|
try {
|
||||||
// 转换金额单位
|
// 转换金额单位
|
||||||
data.charges?.forEach(
|
data.charges?.forEach(
|
||||||
(item: MallDeliveryExpressTemplateApi.TemplateCharge) => {
|
(
|
||||||
|
item: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateCharge,
|
||||||
|
) => {
|
||||||
item.startPrice = yuanToFen(item.startPrice);
|
item.startPrice = yuanToFen(item.startPrice);
|
||||||
item.extraPrice = yuanToFen(item.extraPrice);
|
item.extraPrice = yuanToFen(item.extraPrice);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
data.frees?.forEach(
|
data.frees?.forEach(
|
||||||
(item: MallDeliveryExpressTemplateApi.TemplateFree) => {
|
(item: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateFree) => {
|
||||||
item.freePrice = yuanToFen(item.freePrice);
|
item.freePrice = yuanToFen(item.freePrice);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -134,7 +136,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
}
|
}
|
||||||
// 加载数据
|
// 加载数据
|
||||||
const data =
|
const data =
|
||||||
modalApi.getData<MallDeliveryExpressTemplateApi.ExpressTemplate>();
|
modalApi.getData<MallDeliveryExpressTemplateApi.DeliveryExpressTemplate>();
|
||||||
if (!data || !data.id) {
|
if (!data || !data.id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -143,13 +145,15 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
formData.value = await getDeliveryExpressTemplate(data.id);
|
formData.value = await getDeliveryExpressTemplate(data.id);
|
||||||
// 转换金额单位
|
// 转换金额单位
|
||||||
formData.value.charges?.forEach(
|
formData.value.charges?.forEach(
|
||||||
(item: MallDeliveryExpressTemplateApi.TemplateCharge) => {
|
(
|
||||||
|
item: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateCharge,
|
||||||
|
) => {
|
||||||
item.startPrice = Number.parseFloat(fenToYuan(item.startPrice));
|
item.startPrice = Number.parseFloat(fenToYuan(item.startPrice));
|
||||||
item.extraPrice = Number.parseFloat(fenToYuan(item.extraPrice));
|
item.extraPrice = Number.parseFloat(fenToYuan(item.extraPrice));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
formData.value.frees?.forEach(
|
formData.value.frees?.forEach(
|
||||||
(item: MallDeliveryExpressTemplateApi.TemplateFree) => {
|
(item: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateFree) => {
|
||||||
item.freePrice = Number.parseFloat(fenToYuan(item.freePrice));
|
item.freePrice = Number.parseFloat(fenToYuan(item.freePrice));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
|||||||
import { FREE_MODE_TITLE_MAP, useFreesColumns } from '../data';
|
import { FREE_MODE_TITLE_MAP, useFreesColumns } from '../data';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
items?: MallDeliveryExpressTemplateApi.TemplateFree[];
|
items?: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateFree[];
|
||||||
chargeMode?: number;
|
chargeMode?: number;
|
||||||
areaTree?: SystemAreaApi.Area[];
|
areaTree?: SystemAreaApi.Area[];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { getRangePickerDefaultProps } from '#/utils';
|
|||||||
|
|
||||||
/** 关联数据 */
|
/** 关联数据 */
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const pickUpStoreList = ref<MallDeliveryPickUpStoreApi.PickUpStore[]>([]);
|
const pickUpStoreList = ref<MallDeliveryPickUpStoreApi.DeliveryPickUpStore[]>([]);
|
||||||
getSimpleDeliveryPickUpStoreList().then((res) => {
|
getSimpleDeliveryPickUpStoreList().then((res) => {
|
||||||
pickUpStoreList.value = res;
|
pickUpStoreList.value = res;
|
||||||
// 移除自己无法核销的门店
|
// 移除自己无法核销的门店
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
|
|
||||||
import { useGridColumns, useGridFormSchema } from './data';
|
import { useGridColumns, useGridFormSchema } from './data';
|
||||||
|
|
||||||
const summary = ref<MallOrderApi.OrderSummary>();
|
const summary = ref<MallOrderApi.OrderSummaryRespVO>();
|
||||||
|
|
||||||
/** 刷新表格 */
|
/** 刷新表格 */
|
||||||
function handleRefresh() {
|
function handleRefresh() {
|
||||||
|
|||||||
@@ -38,17 +38,19 @@ function handleCreate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 编辑门店 */
|
/** 编辑门店 */
|
||||||
function handleEdit(row: MallDeliveryPickUpStoreApi.PickUpStore) {
|
function handleEdit(row: MallDeliveryPickUpStoreApi.DeliveryPickUpStore) {
|
||||||
formModalApi.setData(row).open();
|
formModalApi.setData(row).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 绑定店员 */
|
/** 绑定店员 */
|
||||||
function handleBind(row: MallDeliveryPickUpStoreApi.PickUpStore) {
|
function handleBind(row: MallDeliveryPickUpStoreApi.DeliveryPickUpStore) {
|
||||||
bindFormModalApi.setData(row).open();
|
bindFormModalApi.setData(row).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除门店 */
|
/** 删除门店 */
|
||||||
async function handleDelete(row: MallDeliveryPickUpStoreApi.PickUpStore) {
|
async function handleDelete(
|
||||||
|
row: MallDeliveryPickUpStoreApi.DeliveryPickUpStore,
|
||||||
|
) {
|
||||||
const hideLoading = message.loading({
|
const hideLoading = message.loading({
|
||||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||||
duration: 0,
|
duration: 0,
|
||||||
@@ -89,7 +91,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
refresh: true,
|
refresh: true,
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<MallDeliveryPickUpStoreApi.PickUpStore>,
|
} as VxeTableGridOptions<MallDeliveryPickUpStoreApi.DeliveryPickUpStore>,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { $t } from '#/locales';
|
|||||||
import { useBindFormSchema } from '../data';
|
import { useBindFormSchema } from '../data';
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
const formData = ref<MallDeliveryPickUpStoreApi.PickUpStore>();
|
const formData = ref<MallDeliveryPickUpStoreApi.DeliveryPickUpStore>();
|
||||||
|
|
||||||
const [Form, formApi] = useVbenForm({
|
const [Form, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { $t } from '#/locales';
|
|||||||
import { useFormSchema } from '../data';
|
import { useFormSchema } from '../data';
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
const formData = ref<MallDeliveryPickUpStoreApi.PickUpStore>();
|
const formData = ref<MallDeliveryPickUpStoreApi.DeliveryPickUpStore>();
|
||||||
const getTitle = computed(() => {
|
const getTitle = computed(() => {
|
||||||
return formData.value?.id
|
return formData.value?.id
|
||||||
? $t('ui.actionTitle.edit', ['门店'])
|
? $t('ui.actionTitle.edit', ['门店'])
|
||||||
@@ -94,7 +94,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
modalApi.lock();
|
modalApi.lock();
|
||||||
// 提交表单
|
// 提交表单
|
||||||
const data =
|
const data =
|
||||||
(await formApi.getValues()) as MallDeliveryPickUpStoreApi.PickUpStore;
|
(await formApi.getValues()) as MallDeliveryPickUpStoreApi.DeliveryPickUpStore;
|
||||||
try {
|
try {
|
||||||
await (formData.value?.id
|
await (formData.value?.id
|
||||||
? updateDeliveryPickUpStore(data)
|
? updateDeliveryPickUpStore(data)
|
||||||
@@ -113,7 +113,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 加载数据
|
// 加载数据
|
||||||
const data = modalApi.getData<MallDeliveryPickUpStoreApi.PickUpStore>();
|
const data = modalApi.getData<MallDeliveryPickUpStoreApi.DeliveryPickUpStore>();
|
||||||
if (!data || !data.id) {
|
if (!data || !data.id) {
|
||||||
// 初始化地图
|
// 初始化地图
|
||||||
await initTencentLbsMap();
|
await initTencentLbsMap();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { getAreaTree } from '#/api/system/area';
|
|||||||
import { getRangePickerDefaultProps } from '#/utils';
|
import { getRangePickerDefaultProps } from '#/utils';
|
||||||
|
|
||||||
/** 关联数据 */
|
/** 关联数据 */
|
||||||
let pickUpStoreList: MallDeliveryPickUpStoreApi.PickUpStore[] = [];
|
let pickUpStoreList: MallDeliveryPickUpStoreApi.DeliveryPickUpStore[] = [];
|
||||||
getSimpleDeliveryPickUpStoreList().then((data) => {
|
getSimpleDeliveryPickUpStoreList().then((data) => {
|
||||||
pickUpStoreList = data;
|
pickUpStoreList = data;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -54,11 +54,11 @@ const orderId = ref(0);
|
|||||||
const order = ref<MallOrderApi.Order>({
|
const order = ref<MallOrderApi.Order>({
|
||||||
logs: [],
|
logs: [],
|
||||||
});
|
});
|
||||||
const deliveryExpressList = ref<MallDeliveryExpressApi.SimpleDeliveryExpress[]>(
|
const deliveryExpressList = ref<MallDeliveryExpressApi.DeliveryExpress[]>([]);
|
||||||
[],
|
|
||||||
);
|
|
||||||
const expressTrackList = ref<any[]>([]);
|
const expressTrackList = ref<any[]>([]);
|
||||||
const pickUpStore = ref<MallDeliveryPickUpStoreApi.PickUpStore | undefined>();
|
const pickUpStore = ref<
|
||||||
|
MallDeliveryPickUpStoreApi.DeliveryPickUpStore | undefined
|
||||||
|
>();
|
||||||
|
|
||||||
const [OrderInfoDescriptions] = useDescription({
|
const [OrderInfoDescriptions] = useDescription({
|
||||||
title: '订单信息',
|
title: '订单信息',
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
// 提交表单
|
// 提交表单
|
||||||
const data = await formApi.getValues();
|
const data = await formApi.getValues();
|
||||||
try {
|
try {
|
||||||
await updateOrderAddress(data as MallOrderApi.AddressRequest);
|
await updateOrderAddress(data as MallOrderApi.OrderUpdateAddressReqVO);
|
||||||
// 关闭并提示
|
// 关闭并提示
|
||||||
await modalApi.close();
|
await modalApi.close();
|
||||||
emit('success');
|
emit('success');
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
data.logisticsNo = '';
|
data.logisticsNo = '';
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await deliveryOrder(data as MallOrderApi.DeliveryRequest);
|
await deliveryOrder(data as MallOrderApi.OrderUpdateDeliveryReqVO);
|
||||||
// 关闭并提示
|
// 关闭并提示
|
||||||
await modalApi.close();
|
await modalApi.close();
|
||||||
emit('success');
|
emit('success');
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { useRemarkFormSchema } from '../data';
|
|||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
|
|
||||||
const formData = ref<MallOrderApi.DeliveryRequest>();
|
const formData = ref<MallOrderApi.OrderUpdateDeliveryReqVO>();
|
||||||
|
|
||||||
const [Form, formApi] = useVbenForm({
|
const [Form, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
@@ -38,7 +38,8 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
}
|
}
|
||||||
modalApi.lock();
|
modalApi.lock();
|
||||||
// 提交表单
|
// 提交表单
|
||||||
const data = (await formApi.getValues()) as MallOrderApi.RemarkRequest;
|
const data =
|
||||||
|
(await formApi.getValues()) as MallOrderApi.OrderUpdateRemarkReqVO;
|
||||||
try {
|
try {
|
||||||
await updateOrderRemark(data);
|
await updateOrderRemark(data);
|
||||||
// 关闭并提示
|
// 关闭并提示
|
||||||
|
|||||||
@@ -12,24 +12,24 @@ export namespace MallMemberStatisticsApi {
|
|||||||
times: Date[] | Dayjs[]; // 时间范围
|
times: Date[] | Dayjs[]; // 时间范围
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 会员分析 Response */
|
||||||
|
export interface AnalyseRespVO {
|
||||||
|
visitUserCount: number; // 访问用户数
|
||||||
|
orderUserCount: number; // 下单用户数
|
||||||
|
payUserCount: number; // 支付用户数
|
||||||
|
atv: number; // 平均客单价
|
||||||
|
comparison: DataComparisonRespVO<AnalyseDataRespVO>; // 对照数据
|
||||||
|
}
|
||||||
|
|
||||||
/** 会员分析对照数据 Response */
|
/** 会员分析对照数据 Response */
|
||||||
export interface AnalyseComparison {
|
export interface AnalyseDataRespVO {
|
||||||
registerUserCount: number; // 注册用户数
|
registerUserCount: number; // 注册用户数
|
||||||
visitUserCount: number; // 访问用户数
|
visitUserCount: number; // 访问用户数
|
||||||
rechargeUserCount: number; // 充值用户数
|
rechargeUserCount: number; // 充值用户数
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 会员分析 Response */
|
|
||||||
export interface Analyse {
|
|
||||||
visitUserCount: number; // 访问用户数
|
|
||||||
orderUserCount: number; // 下单用户数
|
|
||||||
payUserCount: number; // 支付用户数
|
|
||||||
atv: number; // 平均客单价
|
|
||||||
comparison: DataComparisonRespVO<AnalyseComparison>; // 对照数据
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 会员地区统计 Response */
|
/** 会员地区统计 Response */
|
||||||
export interface AreaStatistics {
|
export interface AreaStatisticsRespVO {
|
||||||
areaId: number; // 地区ID
|
areaId: number; // 地区ID
|
||||||
areaName: string; // 地区名称
|
areaName: string; // 地区名称
|
||||||
userCount: number; // 用户数
|
userCount: number; // 用户数
|
||||||
@@ -39,13 +39,13 @@ export namespace MallMemberStatisticsApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 会员性别统计 Response */
|
/** 会员性别统计 Response */
|
||||||
export interface SexStatistics {
|
export interface SexStatisticsRespVO {
|
||||||
sex: number; // 性别
|
sex: number; // 性别
|
||||||
userCount: number; // 用户数
|
userCount: number; // 用户数
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 会员统计 Response */
|
/** 会员统计 Response */
|
||||||
export interface Summary {
|
export interface SummaryRespVO {
|
||||||
userCount: number; // 用户数
|
userCount: number; // 用户数
|
||||||
rechargeUserCount: number; // 充值用户数
|
rechargeUserCount: number; // 充值用户数
|
||||||
rechargePrice: number; // 充值金额
|
rechargePrice: number; // 充值金额
|
||||||
@@ -53,7 +53,7 @@ export namespace MallMemberStatisticsApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 会员终端统计 Response */
|
/** 会员终端统计 Response */
|
||||||
export interface TerminalStatistics {
|
export interface TerminalStatisticsRespVO {
|
||||||
terminal: number; // 终端
|
terminal: number; // 终端
|
||||||
userCount: number; // 用户数
|
userCount: number; // 用户数
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ export namespace MallMemberStatisticsApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 会员注册数量 Response */
|
/** 会员注册数量 Response */
|
||||||
export interface RegisterCount {
|
export interface RegisterCountRespVO {
|
||||||
date: string; // 日期
|
date: string; // 日期
|
||||||
count: number; // 数量
|
count: number; // 数量
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ export namespace MallMemberStatisticsApi {
|
|||||||
|
|
||||||
/** 查询会员统计 */
|
/** 查询会员统计 */
|
||||||
export function getMemberSummary() {
|
export function getMemberSummary() {
|
||||||
return requestClient.get<MallMemberStatisticsApi.Summary>(
|
return requestClient.get<MallMemberStatisticsApi.SummaryRespVO>(
|
||||||
'/statistics/member/summary',
|
'/statistics/member/summary',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ export function getMemberSummary() {
|
|||||||
export function getMemberAnalyse(
|
export function getMemberAnalyse(
|
||||||
params: MallMemberStatisticsApi.MemberAnalyseReqVO,
|
params: MallMemberStatisticsApi.MemberAnalyseReqVO,
|
||||||
) {
|
) {
|
||||||
return requestClient.get<MallMemberStatisticsApi.Analyse>(
|
return requestClient.get<MallMemberStatisticsApi.AnalyseRespVO>(
|
||||||
'/statistics/member/analyse',
|
'/statistics/member/analyse',
|
||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
@@ -97,21 +97,21 @@ export function getMemberAnalyse(
|
|||||||
|
|
||||||
/** 按照省份,查询会员统计列表 */
|
/** 按照省份,查询会员统计列表 */
|
||||||
export function getMemberAreaStatisticsList() {
|
export function getMemberAreaStatisticsList() {
|
||||||
return requestClient.get<MallMemberStatisticsApi.AreaStatistics[]>(
|
return requestClient.get<MallMemberStatisticsApi.AreaStatisticsRespVO[]>(
|
||||||
'/statistics/member/area-statistics-list',
|
'/statistics/member/area-statistics-list',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 按照性别,查询会员统计列表 */
|
/** 按照性别,查询会员统计列表 */
|
||||||
export function getMemberSexStatisticsList() {
|
export function getMemberSexStatisticsList() {
|
||||||
return requestClient.get<MallMemberStatisticsApi.SexStatistics[]>(
|
return requestClient.get<MallMemberStatisticsApi.SexStatisticsRespVO[]>(
|
||||||
'/statistics/member/sex-statistics-list',
|
'/statistics/member/sex-statistics-list',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 按照终端,查询会员统计列表 */
|
/** 按照终端,查询会员统计列表 */
|
||||||
export function getMemberTerminalStatisticsList() {
|
export function getMemberTerminalStatisticsList() {
|
||||||
return requestClient.get<MallMemberStatisticsApi.TerminalStatistics[]>(
|
return requestClient.get<MallMemberStatisticsApi.TerminalStatisticsRespVO[]>(
|
||||||
'/statistics/member/terminal-statistics-list',
|
'/statistics/member/terminal-statistics-list',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -125,7 +125,7 @@ export function getUserCountComparison() {
|
|||||||
|
|
||||||
/** 获得会员注册数量列表 */
|
/** 获得会员注册数量列表 */
|
||||||
export function getMemberRegisterCountList(beginTime: Date, endTime: Date) {
|
export function getMemberRegisterCountList(beginTime: Date, endTime: Date) {
|
||||||
return requestClient.get<MallMemberStatisticsApi.RegisterCount[]>(
|
return requestClient.get<MallMemberStatisticsApi.RegisterCountRespVO[]>(
|
||||||
'/statistics/member/register-count-list',
|
'/statistics/member/register-count-list',
|
||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
|
|||||||
@@ -6,50 +6,35 @@ import { requestClient } from '#/api/request';
|
|||||||
|
|
||||||
export namespace MallProductStatisticsApi {
|
export namespace MallProductStatisticsApi {
|
||||||
/** 商品统计数据 */
|
/** 商品统计数据 */
|
||||||
export interface ProductStatistics {
|
export interface ProductStatisticsRespVO {
|
||||||
/** 编号 */
|
id: number; // 编号
|
||||||
id: number;
|
day: string; // 统计日期
|
||||||
/** 统计日期 */
|
spuId: number; // 商品 SPU 编号
|
||||||
day: string;
|
spuName: string; // 商品 SPU 名称
|
||||||
/** 商品 SPU 编号 */
|
spuPicUrl: string; // 商品 SPU 图片
|
||||||
spuId: number;
|
browseCount: number; // 浏览次数
|
||||||
/** 商品 SPU 名称 */
|
browseUserCount: number; // 浏览人数
|
||||||
spuName: string;
|
favoriteCount: number; // 收藏次数
|
||||||
/** 商品 SPU 图片 */
|
cartCount: number; // 加购次数
|
||||||
spuPicUrl: string;
|
orderCount: number; // 下单次数
|
||||||
/** 浏览次数 */
|
orderPayCount: number; // 支付次数
|
||||||
browseCount: number;
|
orderPayPrice: number; // 支付金额
|
||||||
/** 浏览人数 */
|
afterSaleCount: number; // 售后次数
|
||||||
browseUserCount: number;
|
afterSaleRefundPrice: number; // 退款金额
|
||||||
/** 收藏次数 */
|
browseConvertPercent: number; // 浏览转化率
|
||||||
favoriteCount: number;
|
|
||||||
/** 加购次数 */
|
|
||||||
cartCount: number;
|
|
||||||
/** 下单次数 */
|
|
||||||
orderCount: number;
|
|
||||||
/** 支付次数 */
|
|
||||||
orderPayCount: number;
|
|
||||||
/** 支付金额 */
|
|
||||||
orderPayPrice: number;
|
|
||||||
/** 售后次数 */
|
|
||||||
afterSaleCount: number;
|
|
||||||
/** 退款金额 */
|
|
||||||
afterSaleRefundPrice: number;
|
|
||||||
/** 浏览转化率 */
|
|
||||||
browseConvertPercent: number;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获得商品统计分析 */
|
/** 获得商品统计分析 */
|
||||||
export function getProductStatisticsAnalyse(params: any) {
|
export function getProductStatisticsAnalyse(params: any) {
|
||||||
return requestClient.get<
|
return requestClient.get<
|
||||||
DataComparisonRespVO<MallProductStatisticsApi.ProductStatistics>
|
DataComparisonRespVO<MallProductStatisticsApi.ProductStatisticsRespVO>
|
||||||
>('/statistics/product/analyse', { params });
|
>('/statistics/product/analyse', { params });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获得商品状况明细 */
|
/** 获得商品状况明细 */
|
||||||
export function getProductStatisticsList(params: any) {
|
export function getProductStatisticsList(params: any) {
|
||||||
return requestClient.get<MallProductStatisticsApi.ProductStatistics[]>(
|
return requestClient.get<MallProductStatisticsApi.ProductStatisticsRespVO[]>(
|
||||||
'/statistics/product/list',
|
'/statistics/product/list',
|
||||||
{ params },
|
{ params },
|
||||||
);
|
);
|
||||||
@@ -63,6 +48,6 @@ export function exportProductStatisticsExcel(params: any) {
|
|||||||
/** 获得商品排行榜分页 */
|
/** 获得商品排行榜分页 */
|
||||||
export function getProductStatisticsRankPage(params: PageParam) {
|
export function getProductStatisticsRankPage(params: PageParam) {
|
||||||
return requestClient.get<
|
return requestClient.get<
|
||||||
PageResult<MallProductStatisticsApi.ProductStatistics>
|
PageResult<MallProductStatisticsApi.ProductStatisticsRespVO>
|
||||||
>('/statistics/product/rank-page', { params });
|
>('/statistics/product/rank-page', { params });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
import type { DataComparisonRespVO } from './common';
|
import type { DataComparisonRespVO } from './common';
|
||||||
|
|
||||||
import { formatDate, formatDateTime } from '@vben/utils';
|
import { formatDateTime } from '@vben/utils';
|
||||||
|
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace MallTradeStatisticsApi {
|
export namespace MallTradeStatisticsApi {
|
||||||
|
/** 交易状况 Request */
|
||||||
|
export interface TradeTrendReqVO {
|
||||||
|
times: [Date, Date];
|
||||||
|
}
|
||||||
|
|
||||||
/** 交易统计 Response */
|
/** 交易统计 Response */
|
||||||
export interface TradeSummary {
|
export interface TradeSummaryRespVO {
|
||||||
yesterdayOrderCount: number;
|
yesterdayOrderCount: number;
|
||||||
monthOrderCount: number;
|
monthOrderCount: number;
|
||||||
yesterdayPayPrice: number;
|
yesterdayPayPrice: number;
|
||||||
monthPayPrice: number;
|
monthPayPrice: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 交易状况 Request */
|
|
||||||
export interface TradeTrendReq {
|
|
||||||
times: [Date, Date];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 交易状况统计 Response */
|
/** 交易状况统计 Response */
|
||||||
export interface TradeTrendSummary {
|
export interface TradeTrendSummaryRespVO {
|
||||||
time: string;
|
time: string;
|
||||||
turnoverPrice: number;
|
turnoverPrice: number;
|
||||||
orderPayPrice: number;
|
orderPayPrice: number;
|
||||||
@@ -31,81 +31,59 @@ export namespace MallTradeStatisticsApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 交易订单数量 Response */
|
/** 交易订单数量 Response */
|
||||||
export interface TradeOrderCount {
|
export interface TradeOrderCountRespVO {
|
||||||
/** 待发货 */
|
undelivered?: number; // 待发货
|
||||||
undelivered?: number;
|
pickUp?: number; // 待核销
|
||||||
/** 待核销 */
|
afterSaleApply?: number; // 退款中
|
||||||
pickUp?: number;
|
auditingWithdraw?: number; // 提现待审核
|
||||||
/** 退款中 */
|
|
||||||
afterSaleApply?: number;
|
|
||||||
/** 提现待审核 */
|
|
||||||
auditingWithdraw?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 交易订单统计 Response */
|
/** 交易订单统计 Response */
|
||||||
export interface TradeOrderSummaryRespVO {
|
export interface TradeOrderSummaryRespVO {
|
||||||
/** 支付订单商品数 */
|
orderPayCount?: number; // 支付订单商品数
|
||||||
orderPayCount?: number;
|
orderPayPrice?: number; // 总支付金额,单位:分
|
||||||
/** 总支付金额,单位:分 */
|
|
||||||
orderPayPrice?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单量趋势统计 Response */
|
/** 订单量趋势统计 Response */
|
||||||
export interface TradeOrderTrend {
|
export interface TradeOrderTrendRespVO {
|
||||||
/** 日期 */
|
date: string; // 日期
|
||||||
date: string;
|
orderPayCount: number; // 订单数量
|
||||||
/** 订单数量 */
|
orderPayPrice: number; // 订单支付金额
|
||||||
orderPayCount: number;
|
|
||||||
/** 订单支付金额 */
|
|
||||||
orderPayPrice: number;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 时间参数需要格式化, 确保接口能识别 */
|
|
||||||
const formatDateParam = (params: MallTradeStatisticsApi.TradeTrendReq) => {
|
|
||||||
return {
|
|
||||||
times: [formatDate(params.times[0]), formatDate(params.times[1])],
|
|
||||||
} as MallTradeStatisticsApi.TradeTrendReq;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 查询交易统计 */
|
/** 查询交易统计 */
|
||||||
export function getTradeStatisticsSummary() {
|
export function getTradeStatisticsSummary() {
|
||||||
return requestClient.get<
|
return requestClient.get<
|
||||||
DataComparisonRespVO<MallTradeStatisticsApi.TradeSummary>
|
DataComparisonRespVO<MallTradeStatisticsApi.TradeSummaryRespVO>
|
||||||
>('/statistics/trade/summary');
|
>('/statistics/trade/summary');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获得交易状况统计 */
|
/** 获得交易状况统计 */
|
||||||
export function getTradeStatisticsAnalyse(
|
export function getTradeStatisticsAnalyse(
|
||||||
params: MallTradeStatisticsApi.TradeTrendReq,
|
params: MallTradeStatisticsApi.TradeTrendReqVO,
|
||||||
) {
|
) {
|
||||||
return requestClient.get<
|
return requestClient.get<
|
||||||
DataComparisonRespVO<MallTradeStatisticsApi.TradeTrendSummary>
|
DataComparisonRespVO<MallTradeStatisticsApi.TradeTrendSummaryRespVO>
|
||||||
>('/statistics/trade/analyse', { params: formatDateParam(params) });
|
>('/statistics/trade/analyse', { params });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获得交易状况明细 */
|
/** 获得交易状况明细 */
|
||||||
export function getTradeStatisticsList(
|
export function getTradeStatisticsList(params: any) {
|
||||||
params: MallTradeStatisticsApi.TradeTrendReq,
|
return requestClient.get<MallTradeStatisticsApi.TradeTrendSummaryRespVO[]>(
|
||||||
) {
|
|
||||||
return requestClient.get<MallTradeStatisticsApi.TradeTrendSummary[]>(
|
|
||||||
'/statistics/trade/list',
|
'/statistics/trade/list',
|
||||||
{ params: formatDateParam(params) },
|
{ params },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出交易状况明细 */
|
/** 导出交易状况明细 */
|
||||||
export function exportTradeStatisticsExcel(
|
export function exportTradeStatisticsExcel(params: any) {
|
||||||
params: MallTradeStatisticsApi.TradeTrendReq,
|
return requestClient.download('/statistics/trade/export-excel', { params });
|
||||||
) {
|
|
||||||
return requestClient.download('/statistics/trade/export-excel', {
|
|
||||||
params: formatDateParam(params),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获得交易订单数量 */
|
/** 获得交易订单数量 */
|
||||||
export function getOrderCount() {
|
export function getOrderCount() {
|
||||||
return requestClient.get<MallTradeStatisticsApi.TradeOrderCount>(
|
return requestClient.get<MallTradeStatisticsApi.TradeOrderCountRespVO>(
|
||||||
'/statistics/trade/order-count',
|
'/statistics/trade/order-count',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -124,7 +102,7 @@ export function getOrderCountTrendComparison(
|
|||||||
endTime: Date,
|
endTime: Date,
|
||||||
) {
|
) {
|
||||||
return requestClient.get<
|
return requestClient.get<
|
||||||
DataComparisonRespVO<MallTradeStatisticsApi.TradeOrderTrend>[]
|
DataComparisonRespVO<MallTradeStatisticsApi.TradeOrderTrendRespVO>[]
|
||||||
>('/statistics/trade/order-count-trend', {
|
>('/statistics/trade/order-count-trend', {
|
||||||
params: {
|
params: {
|
||||||
type,
|
type,
|
||||||
|
|||||||
@@ -5,85 +5,49 @@ import type { MallOrderApi } from '#/api/mall/trade/order';
|
|||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace MallAfterSaleApi {
|
export namespace MallAfterSaleApi {
|
||||||
/** 商品属性 */
|
|
||||||
export interface ProductProperty {
|
|
||||||
/** 属性的编号 */
|
|
||||||
propertyId?: null | number;
|
|
||||||
/** 属性的名称 */
|
|
||||||
propertyName?: string;
|
|
||||||
/** 属性值的编号 */
|
|
||||||
valueId?: null | number;
|
|
||||||
/** 属性值的名称 */
|
|
||||||
valueName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 交易售后 */
|
/** 交易售后 */
|
||||||
export interface AfterSale {
|
export interface AfterSale {
|
||||||
/** 售后编号,主键自增 */
|
id?: number; // 售后编号
|
||||||
id?: null | number;
|
no?: string; // 售后单号
|
||||||
/** 售后单号 */
|
status?: number; // 退款状态
|
||||||
no?: string;
|
way?: number; // 售后方式
|
||||||
/** 退款状态 */
|
type?: number; // 售后类型
|
||||||
status?: null | number;
|
userId?: number; // 用户编号
|
||||||
/** 售后方式 */
|
applyReason?: string; // 申请原因
|
||||||
way?: null | number;
|
applyDescription?: string; // 补充描述
|
||||||
/** 售后类型 */
|
applyPicUrls?: string[]; // 补充凭证图片
|
||||||
type?: null | number;
|
orderId?: number; // 交易订单编号
|
||||||
/** 用户编号 */
|
orderNo?: string; // 订单流水号
|
||||||
userId?: null | number;
|
orderItemId?: number; // 交易订单项编号
|
||||||
/** 申请原因 */
|
spuId?: number; // 商品 SPU 编号
|
||||||
applyReason?: string;
|
spuName?: string; // 商品 SPU 名称
|
||||||
/** 补充描述 */
|
skuId?: number; // 商品 SKU 编号
|
||||||
applyDescription?: string;
|
properties?: {
|
||||||
/** 补充凭证图片 */
|
propertyId?: number; // 属性的编号
|
||||||
applyPicUrls?: string[];
|
propertyName?: string; // 属性的名称
|
||||||
/** 交易订单编号 */
|
valueId?: number; // 属性值的编号
|
||||||
orderId?: null | number;
|
valueName?: string; // 属性值的名称
|
||||||
/** 订单流水号 */
|
}[]; // 属性数组
|
||||||
orderNo?: string;
|
picUrl?: string; // 商品图片
|
||||||
/** 交易订单项编号 */
|
count?: number; // 退货商品数量
|
||||||
orderItemId?: null | number;
|
auditTime?: Date; // 审批时间
|
||||||
/** 商品 SPU 编号 */
|
auditUserId?: number; // 审批人
|
||||||
spuId?: null | number;
|
auditReason?: string; // 审批备注
|
||||||
/** 商品 SPU 名称 */
|
refundPrice?: number; // 退款金额,单位:分
|
||||||
spuName?: string;
|
payRefundId?: number; // 支付退款编号
|
||||||
/** 商品 SKU 编号 */
|
refundTime?: Date; // 退款时间
|
||||||
skuId?: null | number;
|
logisticsId?: number; // 退货物流公司编号
|
||||||
/** 属性数组 */
|
logisticsNo?: string; // 退货物流单号
|
||||||
properties?: ProductProperty[];
|
deliveryTime?: Date; // 退货时间
|
||||||
/** 商品图片 */
|
receiveTime?: Date; // 收货时间
|
||||||
picUrl?: string;
|
receiveReason?: string; // 收货备注
|
||||||
/** 退货商品数量 */
|
|
||||||
count?: null | number;
|
|
||||||
/** 审批时间 */
|
|
||||||
auditTime?: Date;
|
|
||||||
/** 审批人 */
|
|
||||||
auditUserId?: null | number;
|
|
||||||
/** 审批备注 */
|
|
||||||
auditReason?: string;
|
|
||||||
/** 退款金额,单位:分 */
|
|
||||||
refundPrice?: null | number;
|
|
||||||
/** 支付退款编号 */
|
|
||||||
payRefundId?: null | number;
|
|
||||||
/** 退款时间 */
|
|
||||||
refundTime?: Date;
|
|
||||||
/** 退货物流公司编号 */
|
|
||||||
logisticsId?: null | number;
|
|
||||||
/** 退货物流单号 */
|
|
||||||
logisticsNo?: string;
|
|
||||||
/** 退货时间 */
|
|
||||||
deliveryTime?: Date;
|
|
||||||
/** 收货时间 */
|
|
||||||
receiveTime?: Date;
|
|
||||||
/** 收货备注 */
|
|
||||||
receiveReason?: string;
|
|
||||||
order?: MallOrderApi.Order; // 关联订单
|
order?: MallOrderApi.Order; // 关联订单
|
||||||
orderItem?: MallOrderApi.OrderItem; // 关联订单项
|
orderItem?: MallOrderApi.OrderItem; // 关联订单项
|
||||||
logs?: any[]; // 关联售后日志
|
logs?: any[]; // 关联售后日志
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 拒绝售后请求 */
|
/** 拒绝售后请求 */
|
||||||
export interface DisagreeRequest {
|
export interface AfterSaleDisagreeReqVO {
|
||||||
/** 售后编号 */
|
/** 售后编号 */
|
||||||
id: number;
|
id: number;
|
||||||
/** 拒绝原因 */
|
/** 拒绝原因 */
|
||||||
@@ -112,7 +76,9 @@ export function agreeAfterSale(id: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 拒绝售后 */
|
/** 拒绝售后 */
|
||||||
export function disagreeAfterSale(data: MallAfterSaleApi.DisagreeRequest) {
|
export function disagreeAfterSale(
|
||||||
|
data: MallAfterSaleApi.AfterSaleDisagreeReqVO,
|
||||||
|
) {
|
||||||
return requestClient.put('/trade/after-sale/disagree', data);
|
return requestClient.put('/trade/after-sale/disagree', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export namespace MallBrokerageWithdrawApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 驳回申请请求 */
|
/** 驳回申请请求 */
|
||||||
export interface RejectRequest {
|
export interface BrokerageWithdrawRejectReqVO {
|
||||||
id: number; // 编号
|
id: number; // 编号
|
||||||
auditReason: string; // 驳回原因
|
auditReason: string; // 驳回原因
|
||||||
}
|
}
|
||||||
@@ -40,13 +40,6 @@ export function getBrokerageWithdrawPage(params: PageParam) {
|
|||||||
>('/trade/brokerage-withdraw/page', { params });
|
>('/trade/brokerage-withdraw/page', { params });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询佣金提现详情 */
|
|
||||||
export function getBrokerageWithdraw(id: number) {
|
|
||||||
return requestClient.get<MallBrokerageWithdrawApi.BrokerageWithdraw>(
|
|
||||||
`/trade/brokerage-withdraw/get?id=${id}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 佣金提现 - 通过申请 */
|
/** 佣金提现 - 通过申请 */
|
||||||
export function approveBrokerageWithdraw(id: number) {
|
export function approveBrokerageWithdraw(id: number) {
|
||||||
return requestClient.put(`/trade/brokerage-withdraw/approve?id=${id}`);
|
return requestClient.put(`/trade/brokerage-withdraw/approve?id=${id}`);
|
||||||
@@ -54,7 +47,7 @@ export function approveBrokerageWithdraw(id: number) {
|
|||||||
|
|
||||||
/** 审核佣金提现 - 驳回申请 */
|
/** 审核佣金提现 - 驳回申请 */
|
||||||
export function rejectBrokerageWithdraw(
|
export function rejectBrokerageWithdraw(
|
||||||
data: MallBrokerageWithdrawApi.RejectRequest,
|
data: MallBrokerageWithdrawApi.BrokerageWithdrawRejectReqVO,
|
||||||
) {
|
) {
|
||||||
return requestClient.put('/trade/brokerage-withdraw/reject', data);
|
return requestClient.put('/trade/brokerage-withdraw/reject', data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,28 +5,12 @@ import { requestClient } from '#/api/request';
|
|||||||
export namespace MallDeliveryExpressApi {
|
export namespace MallDeliveryExpressApi {
|
||||||
/** 快递公司 */
|
/** 快递公司 */
|
||||||
export interface DeliveryExpress {
|
export interface DeliveryExpress {
|
||||||
/** 编号 */
|
id: number; // 编号
|
||||||
id: number;
|
code: string; // 快递公司编码
|
||||||
/** 快递公司编码 */
|
name: string; // 快递公司名称
|
||||||
code: string;
|
logo: string; // 快递公司 logo
|
||||||
/** 快递公司名称 */
|
sort: number; // 排序
|
||||||
name: string;
|
status: number; // 状态
|
||||||
/** 快递公司 logo */
|
|
||||||
logo: string;
|
|
||||||
/** 排序 */
|
|
||||||
sort: number;
|
|
||||||
/** 状态 */
|
|
||||||
status: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 快递公司精简信息 */
|
|
||||||
export interface SimpleDeliveryExpress {
|
|
||||||
/** 编号 */
|
|
||||||
id: number;
|
|
||||||
/** 快递公司编码 */
|
|
||||||
code: string;
|
|
||||||
/** 快递公司名称 */
|
|
||||||
name: string;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +31,7 @@ export function getDeliveryExpress(id: number) {
|
|||||||
|
|
||||||
/** 获得快递公司精简信息列表 */
|
/** 获得快递公司精简信息列表 */
|
||||||
export function getSimpleDeliveryExpressList() {
|
export function getSimpleDeliveryExpressList() {
|
||||||
return requestClient.get<MallDeliveryExpressApi.SimpleDeliveryExpress[]>(
|
return requestClient.get<MallDeliveryExpressApi.DeliveryExpress[]>(
|
||||||
'/trade/delivery/express/list-all-simple',
|
'/trade/delivery/express/list-all-simple',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,86 +3,64 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace MallDeliveryExpressTemplateApi {
|
export namespace MallDeliveryExpressTemplateApi {
|
||||||
|
/** 快递运费模板 */
|
||||||
|
export interface DeliveryExpressTemplate {
|
||||||
|
id: number; // 编号
|
||||||
|
name: string; // 模板名称
|
||||||
|
chargeMode: number; // 计费方式
|
||||||
|
sort: number; // 排序
|
||||||
|
charges: DeliveryExpressTemplateCharge[]; // 计费区域列表
|
||||||
|
frees: DeliveryExpressTemplateFree[]; // 包邮区域列表
|
||||||
|
}
|
||||||
|
|
||||||
/** 运费模板计费 */
|
/** 运费模板计费 */
|
||||||
export interface TemplateCharge {
|
export interface DeliveryExpressTemplateCharge {
|
||||||
/** 区域编号列表 */
|
areaIds: number[]; // 区域编号列表
|
||||||
areaIds: number[];
|
startCount: number; // 首件数量
|
||||||
/** 首件数量 */
|
startPrice: number; // 首件价格,单位:分
|
||||||
startCount: number;
|
extraCount: number; // 续件数量
|
||||||
/** 首件价格,单位:分 */
|
extraPrice: number; // 续件价格,单位:分
|
||||||
startPrice: number;
|
|
||||||
/** 续件数量 */
|
|
||||||
extraCount: number;
|
|
||||||
/** 续件价格,单位:分 */
|
|
||||||
extraPrice: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 运费模板包邮 */
|
/** 运费模板包邮 */
|
||||||
export interface TemplateFree {
|
export interface DeliveryExpressTemplateFree {
|
||||||
/** 区域编号列表 */
|
areaIds: number[]; // 区域编号列表
|
||||||
areaIds: number[];
|
freeCount: number; // 包邮件数
|
||||||
/** 包邮件数 */
|
freePrice: number; // 包邮金额,单位:分
|
||||||
freeCount: number;
|
|
||||||
/** 包邮金额,单位:分 */
|
|
||||||
freePrice: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 快递运费模板 */
|
|
||||||
export interface ExpressTemplate {
|
|
||||||
/** 编号 */
|
|
||||||
id: number;
|
|
||||||
/** 模板名称 */
|
|
||||||
name: string;
|
|
||||||
/** 计费方式 */
|
|
||||||
chargeMode: number;
|
|
||||||
/** 排序 */
|
|
||||||
sort: number;
|
|
||||||
/** 计费区域列表 */
|
|
||||||
charges: TemplateCharge[];
|
|
||||||
/** 包邮区域列表 */
|
|
||||||
frees: TemplateFree[];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 运费模板精简信息 */
|
|
||||||
export interface SimpleTemplate {
|
|
||||||
/** 编号 */
|
|
||||||
id: number;
|
|
||||||
/** 模板名称 */
|
|
||||||
name: string;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询快递运费模板列表 */
|
/** 查询快递运费模板列表 */
|
||||||
export function getDeliveryExpressTemplatePage(params: PageParam) {
|
export function getDeliveryExpressTemplatePage(params: PageParam) {
|
||||||
return requestClient.get<
|
return requestClient.get<
|
||||||
PageResult<MallDeliveryExpressTemplateApi.ExpressTemplate>
|
PageResult<MallDeliveryExpressTemplateApi.DeliveryExpressTemplate>
|
||||||
>('/trade/delivery/express-template/page', { params });
|
>('/trade/delivery/express-template/page', { params });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询快递运费模板详情 */
|
/** 查询快递运费模板详情 */
|
||||||
export function getDeliveryExpressTemplate(id: number) {
|
export function getDeliveryExpressTemplate(id: number) {
|
||||||
return requestClient.get<MallDeliveryExpressTemplateApi.ExpressTemplate>(
|
return requestClient.get<MallDeliveryExpressTemplateApi.DeliveryExpressTemplate>(
|
||||||
`/trade/delivery/express-template/get?id=${id}`,
|
`/trade/delivery/express-template/get?id=${id}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询快递运费模板详情 */
|
/** 查询快递运费模板详情 */
|
||||||
export function getSimpleTemplateList() {
|
export function getSimpleTemplateList() {
|
||||||
return requestClient.get<MallDeliveryExpressTemplateApi.SimpleTemplate[]>(
|
return requestClient.get<
|
||||||
'/trade/delivery/express-template/list-all-simple',
|
MallDeliveryExpressTemplateApi.DeliveryExpressTemplate[]
|
||||||
);
|
>('/trade/delivery/express-template/list-all-simple');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增快递运费模板 */
|
/** 新增快递运费模板 */
|
||||||
export function createDeliveryExpressTemplate(
|
export function createDeliveryExpressTemplate(
|
||||||
data: MallDeliveryExpressTemplateApi.ExpressTemplate,
|
data: MallDeliveryExpressTemplateApi.DeliveryExpressTemplate,
|
||||||
) {
|
) {
|
||||||
return requestClient.post('/trade/delivery/express-template/create', data);
|
return requestClient.post('/trade/delivery/express-template/create', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改快递运费模板 */
|
/** 修改快递运费模板 */
|
||||||
export function updateDeliveryExpressTemplate(
|
export function updateDeliveryExpressTemplate(
|
||||||
data: MallDeliveryExpressTemplateApi.ExpressTemplate,
|
data: MallDeliveryExpressTemplateApi.DeliveryExpressTemplate,
|
||||||
) {
|
) {
|
||||||
return requestClient.put('/trade/delivery/express-template/update', data);
|
return requestClient.put('/trade/delivery/express-template/update', data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,35 +4,21 @@ import { requestClient } from '#/api/request';
|
|||||||
|
|
||||||
export namespace MallDeliveryPickUpStoreApi {
|
export namespace MallDeliveryPickUpStoreApi {
|
||||||
/** 自提门店 */
|
/** 自提门店 */
|
||||||
export interface PickUpStore {
|
export interface DeliveryPickUpStore {
|
||||||
/** 编号 */
|
id: number; // 编号
|
||||||
id: number;
|
name: string; // 门店名称
|
||||||
/** 门店名称 */
|
introduction: string; // 门店简介
|
||||||
name: string;
|
phone: string; // 联系电话
|
||||||
/** 门店简介 */
|
areaId: number; // 区域编号
|
||||||
introduction: string;
|
detailAddress: string; // 详细地址
|
||||||
/** 联系电话 */
|
logo: string; // 门店 logo
|
||||||
phone: string;
|
openingTime: string; // 营业开始时间
|
||||||
/** 区域编号 */
|
closingTime: string; // 营业结束时间
|
||||||
areaId: number;
|
latitude: number; // 纬度
|
||||||
/** 详细地址 */
|
longitude: number; // 经度
|
||||||
detailAddress: string;
|
status: number; // 状态
|
||||||
/** 门店 logo */
|
rangeTime: any[]; // 营业时间,用于 fieldMappingTime
|
||||||
logo: string;
|
verifyUserIds?: number[]; // 绑定用户编号组数
|
||||||
/** 营业开始时间 */
|
|
||||||
openingTime: string;
|
|
||||||
/** 营业结束时间 */
|
|
||||||
closingTime: string;
|
|
||||||
/** 纬度 */
|
|
||||||
latitude: number;
|
|
||||||
/** 经度 */
|
|
||||||
longitude: number;
|
|
||||||
/** 状态 */
|
|
||||||
status: number;
|
|
||||||
/** 营业时间 用于fieldMappingTime */
|
|
||||||
rangeTime: any[];
|
|
||||||
/** 绑定用户编号组数 */
|
|
||||||
verifyUserIds?: number[];
|
|
||||||
verifyUsers?: any[];
|
verifyUsers?: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,36 +32,35 @@ export namespace MallDeliveryPickUpStoreApi {
|
|||||||
|
|
||||||
/** 查询自提门店列表 */
|
/** 查询自提门店列表 */
|
||||||
export function getDeliveryPickUpStorePage(params: PageParam) {
|
export function getDeliveryPickUpStorePage(params: PageParam) {
|
||||||
return requestClient.get<PageResult<MallDeliveryPickUpStoreApi.PickUpStore>>(
|
return requestClient.get<
|
||||||
'/trade/delivery/pick-up-store/page',
|
PageResult<MallDeliveryPickUpStoreApi.DeliveryPickUpStore>
|
||||||
{ params },
|
>('/trade/delivery/pick-up-store/page', { params });
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询自提门店详情 */
|
/** 查询自提门店详情 */
|
||||||
export function getDeliveryPickUpStore(id: number) {
|
export function getDeliveryPickUpStore(id: number) {
|
||||||
return requestClient.get<MallDeliveryPickUpStoreApi.PickUpStore>(
|
return requestClient.get<MallDeliveryPickUpStoreApi.DeliveryPickUpStore>(
|
||||||
`/trade/delivery/pick-up-store/get?id=${id}`,
|
`/trade/delivery/pick-up-store/get?id=${id}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询自提门店精简列表 */
|
/** 查询自提门店精简列表 */
|
||||||
export function getSimpleDeliveryPickUpStoreList() {
|
export function getSimpleDeliveryPickUpStoreList() {
|
||||||
return requestClient.get<MallDeliveryPickUpStoreApi.PickUpStore[]>(
|
return requestClient.get<MallDeliveryPickUpStoreApi.DeliveryPickUpStore[]>(
|
||||||
'/trade/delivery/pick-up-store/simple-list',
|
'/trade/delivery/pick-up-store/simple-list',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增自提门店 */
|
/** 新增自提门店 */
|
||||||
export function createDeliveryPickUpStore(
|
export function createDeliveryPickUpStore(
|
||||||
data: MallDeliveryPickUpStoreApi.PickUpStore,
|
data: MallDeliveryPickUpStoreApi.DeliveryPickUpStore,
|
||||||
) {
|
) {
|
||||||
return requestClient.post('/trade/delivery/pick-up-store/create', data);
|
return requestClient.post('/trade/delivery/pick-up-store/create', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改自提门店 */
|
/** 修改自提门店 */
|
||||||
export function updateDeliveryPickUpStore(
|
export function updateDeliveryPickUpStore(
|
||||||
data: MallDeliveryPickUpStoreApi.PickUpStore,
|
data: MallDeliveryPickUpStoreApi.DeliveryPickUpStore,
|
||||||
) {
|
) {
|
||||||
return requestClient.put('/trade/delivery/pick-up-store/update', data);
|
return requestClient.put('/trade/delivery/pick-up-store/update', data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,231 +3,136 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export namespace MallOrderApi {
|
export namespace MallOrderApi {
|
||||||
/** 商品属性 */
|
/** 订单信息 */
|
||||||
export interface ProductProperty {
|
export interface Order {
|
||||||
/** 属性的编号 */
|
id?: number; // 订单编号
|
||||||
propertyId?: number;
|
no?: string; // 订单流水号
|
||||||
/** 属性的名称 */
|
createTime?: Date; // 下单时间
|
||||||
propertyName?: string;
|
type?: number; // 订单类型
|
||||||
/** 属性值的编号 */
|
terminal?: number; // 订单来源
|
||||||
valueId?: number;
|
userId?: number; // 用户编号
|
||||||
/** 属性值的名称 */
|
userIp?: string; // 用户 IP
|
||||||
valueName?: string;
|
userRemark?: string; // 用户备注
|
||||||
|
status?: number; // 订单状态
|
||||||
|
productCount?: number; // 购买的商品数量
|
||||||
|
finishTime?: Date; // 订单完成时间
|
||||||
|
cancelTime?: Date; // 订单取消时间
|
||||||
|
cancelType?: number; // 取消类型
|
||||||
|
remark?: string; // 商家备注
|
||||||
|
payOrderId?: number; // 支付订单编号
|
||||||
|
payStatus?: boolean; // 是否已支付
|
||||||
|
payTime?: Date; // 付款时间
|
||||||
|
payChannelCode?: string; // 支付渠道
|
||||||
|
totalPrice?: number; // 商品原价(总)
|
||||||
|
discountPrice?: number; // 订单优惠(总)
|
||||||
|
deliveryPrice?: number; // 运费金额
|
||||||
|
adjustPrice?: number; // 订单调价(总)
|
||||||
|
payPrice?: number; // 应付金额(总)
|
||||||
|
deliveryType?: number; // 发货方式
|
||||||
|
pickUpStoreId?: number; // 自提门店编号
|
||||||
|
pickUpVerifyCode?: string; // 自提核销码
|
||||||
|
deliveryTemplateId?: number; // 配送模板编号
|
||||||
|
logisticsId?: number; // 发货物流公司编号
|
||||||
|
logisticsNo?: string; // 发货物流单号
|
||||||
|
deliveryTime?: Date; // 发货时间
|
||||||
|
receiveTime?: Date; // 收货时间
|
||||||
|
receiverName?: string; // 收件人名称
|
||||||
|
receiverMobile?: string; // 收件人手机
|
||||||
|
receiverPostCode?: number; // 收件人邮编
|
||||||
|
receiverAreaId?: number; // 收件人地区编号
|
||||||
|
receiverAreaName?: string; // 收件人地区名字
|
||||||
|
receiverDetailAddress?: string; // 收件人详细地址
|
||||||
|
afterSaleStatus?: number; // 售后状态
|
||||||
|
refundPrice?: number; // 退款金额
|
||||||
|
couponId?: number; // 优惠劵编号
|
||||||
|
couponPrice?: number; // 优惠劵减免金额
|
||||||
|
pointPrice?: number; // 积分抵扣的金额
|
||||||
|
vipPrice?: number; // VIP 减免金额
|
||||||
|
items?: OrderItem[]; // 订单项列表
|
||||||
|
user?: {
|
||||||
|
// 下单用户信息
|
||||||
|
avatar?: string; // 用户头像
|
||||||
|
id?: number; // 用户编号
|
||||||
|
nickname?: string; // 用户昵称
|
||||||
|
};
|
||||||
|
brokerageUser?: {
|
||||||
|
// 推广用户信息
|
||||||
|
avatar?: string; // 用户头像
|
||||||
|
id?: number; // 用户编号
|
||||||
|
nickname?: string; // 用户昵称
|
||||||
|
}; // 推广用户信息
|
||||||
|
logs?: OrderLog[]; // 订单操作日志
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单项 */
|
/** 订单项 */
|
||||||
export interface OrderItem {
|
export interface OrderItem {
|
||||||
/** 编号 */
|
id?: number; // 编号
|
||||||
id?: number;
|
userId?: number; // 用户编号
|
||||||
/** 用户编号 */
|
orderId?: number; // 订单编号
|
||||||
userId?: number;
|
spuId?: number; // 商品 SPU 编号
|
||||||
/** 订单编号 */
|
spuName?: string; // 商品 SPU 名称
|
||||||
orderId?: number;
|
skuId?: number; // 商品 SKU 编号
|
||||||
/** 商品 SPU 编号 */
|
picUrl?: string; // 商品图片
|
||||||
spuId?: number;
|
count?: number; // 购买数量
|
||||||
/** 商品 SPU 名称 */
|
originalPrice?: number; // 商品原价(总)
|
||||||
spuName?: string;
|
originalUnitPrice?: number; // 商品原价(单)
|
||||||
/** 商品 SKU 编号 */
|
discountPrice?: number; // 商品优惠(总)
|
||||||
skuId?: number;
|
payPrice?: number; // 商品实付金额(总)
|
||||||
/** 商品图片 */
|
orderPartPrice?: number; // 子订单分摊金额(总)
|
||||||
picUrl?: string;
|
orderDividePrice?: number; // 分摊后子订单实付金额(总)
|
||||||
/** 购买数量 */
|
afterSaleStatus?: number; // 售后状态
|
||||||
count?: number;
|
properties?: {
|
||||||
/** 商品原价(总) */
|
propertyId?: number; // 属性的编号
|
||||||
originalPrice?: number;
|
propertyName?: string; // 属性的名称
|
||||||
/** 商品原价(单) */
|
valueId?: number; // 属性值的编号
|
||||||
originalUnitPrice?: number;
|
valueName?: string; // 属性值的名称
|
||||||
/** 商品优惠(总) */
|
}[]; // 属性数组
|
||||||
discountPrice?: number;
|
|
||||||
/** 商品实付金额(总) */
|
|
||||||
payPrice?: number;
|
|
||||||
/** 子订单分摊金额(总) */
|
|
||||||
orderPartPrice?: number;
|
|
||||||
/** 分摊后子订单实付金额(总) */
|
|
||||||
orderDividePrice?: number;
|
|
||||||
/** 售后状态 */
|
|
||||||
afterSaleStatus?: number;
|
|
||||||
/** 属性数组 */
|
|
||||||
properties?: ProductProperty[];
|
|
||||||
price?: number;
|
price?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单日志 */
|
/** 订单日志 */
|
||||||
export interface OrderLog {
|
export interface OrderLog {
|
||||||
/** 日志内容 */
|
content?: string; // 日志内容
|
||||||
content?: string;
|
createTime?: Date; // 创建时间
|
||||||
/** 创建时间 */
|
userType?: number; // 用户类型
|
||||||
createTime?: Date;
|
userId?: number; // 用户编号
|
||||||
/** 用户类型 */
|
|
||||||
userType?: number;
|
|
||||||
/** 用户编号 */
|
|
||||||
userId?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单 */
|
/** 交易订单统计响应 */
|
||||||
export interface Order {
|
export interface OrderSummaryRespVO {
|
||||||
/** 订单编号 */
|
orderCount: number; // 订单数量
|
||||||
id?: number;
|
orderPayPrice: number; // 订单金额
|
||||||
/** 订单流水号 */
|
afterSaleCount: number; // 退款单数
|
||||||
no?: string;
|
afterSalePrice: number; // 退款金额
|
||||||
/** 下单时间 */
|
|
||||||
createTime?: Date;
|
|
||||||
/** 订单类型 */
|
|
||||||
type?: number;
|
|
||||||
/** 订单来源 */
|
|
||||||
terminal?: number;
|
|
||||||
/** 用户编号 */
|
|
||||||
userId?: number;
|
|
||||||
/** 用户 IP */
|
|
||||||
userIp?: string;
|
|
||||||
/** 用户备注 */
|
|
||||||
userRemark?: string;
|
|
||||||
/** 订单状态 */
|
|
||||||
status?: number;
|
|
||||||
/** 购买的商品数量 */
|
|
||||||
productCount?: number;
|
|
||||||
/** 订单完成时间 */
|
|
||||||
finishTime?: Date;
|
|
||||||
/** 订单取消时间 */
|
|
||||||
cancelTime?: Date;
|
|
||||||
/** 取消类型 */
|
|
||||||
cancelType?: number;
|
|
||||||
/** 商家备注 */
|
|
||||||
remark?: string;
|
|
||||||
/** 支付订单编号 */
|
|
||||||
payOrderId?: number;
|
|
||||||
/** 是否已支付 */
|
|
||||||
payStatus?: boolean;
|
|
||||||
/** 付款时间 */
|
|
||||||
payTime?: Date;
|
|
||||||
/** 支付渠道 */
|
|
||||||
payChannelCode?: string;
|
|
||||||
/** 商品原价(总) */
|
|
||||||
totalPrice?: number;
|
|
||||||
/** 订单优惠(总) */
|
|
||||||
discountPrice?: number;
|
|
||||||
/** 运费金额 */
|
|
||||||
deliveryPrice?: number;
|
|
||||||
/** 订单调价(总) */
|
|
||||||
adjustPrice?: number;
|
|
||||||
/** 应付金额(总) */
|
|
||||||
payPrice?: number;
|
|
||||||
/** 发货方式 */
|
|
||||||
deliveryType?: number;
|
|
||||||
/** 自提门店编号 */
|
|
||||||
pickUpStoreId?: number;
|
|
||||||
/** 自提核销码 */
|
|
||||||
pickUpVerifyCode?: string;
|
|
||||||
/** 配送模板编号 */
|
|
||||||
deliveryTemplateId?: number;
|
|
||||||
/** 发货物流公司编号 */
|
|
||||||
logisticsId?: number;
|
|
||||||
/** 发货物流单号 */
|
|
||||||
logisticsNo?: string;
|
|
||||||
/** 发货时间 */
|
|
||||||
deliveryTime?: Date;
|
|
||||||
/** 收货时间 */
|
|
||||||
receiveTime?: Date;
|
|
||||||
/** 收件人名称 */
|
|
||||||
receiverName?: string;
|
|
||||||
/** 收件人手机 */
|
|
||||||
receiverMobile?: string;
|
|
||||||
/** 收件人邮编 */
|
|
||||||
receiverPostCode?: number;
|
|
||||||
/** 收件人地区编号 */
|
|
||||||
receiverAreaId?: number;
|
|
||||||
/** 收件人地区名字 */
|
|
||||||
receiverAreaName?: string;
|
|
||||||
/** 收件人详细地址 */
|
|
||||||
receiverDetailAddress?: string;
|
|
||||||
/** 售后状态 */
|
|
||||||
afterSaleStatus?: number;
|
|
||||||
/** 退款金额 */
|
|
||||||
refundPrice?: number;
|
|
||||||
/** 优惠劵编号 */
|
|
||||||
couponId?: number;
|
|
||||||
/** 优惠劵减免金额 */
|
|
||||||
couponPrice?: number;
|
|
||||||
/** 积分抵扣的金额 */
|
|
||||||
pointPrice?: number;
|
|
||||||
/** VIP 减免金额 */
|
|
||||||
vipPrice?: number;
|
|
||||||
/** 订单项列表 */
|
|
||||||
items?: OrderItem[];
|
|
||||||
/** 下单用户信息 */
|
|
||||||
user?: {
|
|
||||||
/** 用户头像 */
|
|
||||||
avatar?: string;
|
|
||||||
/** 用户编号 */
|
|
||||||
id?: number;
|
|
||||||
/** 用户昵称 */
|
|
||||||
nickname?: string;
|
|
||||||
};
|
|
||||||
/** 推广用户信息 */
|
|
||||||
brokerageUser?: {
|
|
||||||
/** 用户头像 */
|
|
||||||
avatar?: string;
|
|
||||||
/** 用户编号 */
|
|
||||||
id?: number;
|
|
||||||
/** 用户昵称 */
|
|
||||||
nickname?: string;
|
|
||||||
};
|
|
||||||
/** 订单操作日志 */
|
|
||||||
logs?: OrderLog[];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 交易订单统计 */
|
|
||||||
export interface OrderSummary {
|
|
||||||
/** 订单数量 */
|
|
||||||
orderCount: number;
|
|
||||||
/** 订单金额 */
|
|
||||||
orderPayPrice: number;
|
|
||||||
/** 退款单数 */
|
|
||||||
afterSaleCount: number;
|
|
||||||
/** 退款金额 */
|
|
||||||
afterSalePrice: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单发货请求 */
|
/** 订单发货请求 */
|
||||||
export interface DeliveryRequest {
|
export interface OrderUpdateDeliveryReqVO {
|
||||||
/** 订单编号 */
|
id?: number; // 订单编号
|
||||||
id?: number;
|
expressType: string; // 发货方式
|
||||||
/** 发货方式 */
|
logisticsId: number; // 物流公司编号
|
||||||
expressType: string;
|
logisticsNo: string; // 物流编号
|
||||||
/** 物流公司编号 */
|
|
||||||
logisticsId: number;
|
|
||||||
/** 物流编号 */
|
|
||||||
logisticsNo: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单备注请求 */
|
/** 订单备注请求 */
|
||||||
export interface RemarkRequest {
|
export interface OrderUpdateRemarkReqVO {
|
||||||
/** 订单编号 */
|
id: number; // 订单编号
|
||||||
id: number;
|
remark: string; // 备注
|
||||||
/** 备注 */
|
|
||||||
remark: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单调价请求 */
|
/** 订单调价请求 */
|
||||||
export interface PriceRequest {
|
export interface OrderUpdatePriceReqVO {
|
||||||
/** 订单编号 */
|
id: number; // 订单编号
|
||||||
id: number;
|
adjustPrice: number; // 调整金额,单位:分
|
||||||
/** 调整金额,单位:分 */
|
|
||||||
adjustPrice: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单地址请求 */
|
/** 订单地址请求 */
|
||||||
export interface AddressRequest {
|
export interface OrderUpdateAddressReqVO {
|
||||||
/** 订单编号 */
|
id: number; // 订单编号
|
||||||
id: number;
|
receiverName: string; // 收件人名称
|
||||||
/** 收件人名称 */
|
receiverMobile: string; // 收件人手机
|
||||||
receiverName: string;
|
receiverAreaId: number; // 收件人地区编号
|
||||||
/** 收件人手机 */
|
receiverDetailAddress: string; // 收件人详细地址
|
||||||
receiverMobile: string;
|
|
||||||
/** 收件人地区编号 */
|
|
||||||
receiverAreaId: number;
|
|
||||||
/** 收件人详细地址 */
|
|
||||||
receiverDetailAddress: string;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,9 +148,12 @@ export function getOrderPage(params: PageParam) {
|
|||||||
|
|
||||||
/** 查询交易订单统计 */
|
/** 查询交易订单统计 */
|
||||||
export function getOrderSummary(params: any) {
|
export function getOrderSummary(params: any) {
|
||||||
return requestClient.get<MallOrderApi.OrderSummary>('/trade/order/summary', {
|
return requestClient.get<MallOrderApi.OrderSummaryRespVO>(
|
||||||
|
'/trade/order/summary',
|
||||||
|
{
|
||||||
params,
|
params,
|
||||||
});
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询交易订单详情 */
|
/** 查询交易订单详情 */
|
||||||
@@ -261,22 +169,22 @@ export function getExpressTrackList(id: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 订单发货 */
|
/** 订单发货 */
|
||||||
export function deliveryOrder(data: MallOrderApi.DeliveryRequest) {
|
export function deliveryOrder(data: MallOrderApi.OrderUpdateDeliveryReqVO) {
|
||||||
return requestClient.put('/trade/order/delivery', data);
|
return requestClient.put('/trade/order/delivery', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单备注 */
|
/** 订单备注 */
|
||||||
export function updateOrderRemark(data: MallOrderApi.RemarkRequest) {
|
export function updateOrderRemark(data: MallOrderApi.OrderUpdateRemarkReqVO) {
|
||||||
return requestClient.put('/trade/order/update-remark', data);
|
return requestClient.put('/trade/order/update-remark', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 订单调价 */
|
/** 订单调价 */
|
||||||
export function updateOrderPrice(data: MallOrderApi.PriceRequest) {
|
export function updateOrderPrice(data: MallOrderApi.OrderUpdatePriceReqVO) {
|
||||||
return requestClient.put('/trade/order/update-price', data);
|
return requestClient.put('/trade/order/update-price', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改订单地址 */
|
/** 修改订单地址 */
|
||||||
export function updateOrderAddress(data: MallOrderApi.AddressRequest) {
|
export function updateOrderAddress(data: MallOrderApi.OrderUpdateAddressReqVO) {
|
||||||
return requestClient.put('/trade/order/update-address', data);
|
return requestClient.put('/trade/order/update-address', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const emit = defineEmits(['update:modelValue']);
|
const emit = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
|
// TODO @puhui999:可以参考 apps/web-antd/src/components/cron-tab/cron-tab.vue 简化到 types;ps:可以用 idea 对比两个 ts 或者 vue 文件,看看差异的地方。差异的地方越少越好(容易维护)
|
||||||
interface shortcutsType {
|
interface shortcutsType {
|
||||||
text: string;
|
text: string;
|
||||||
value: string;
|
value: string;
|
||||||
@@ -46,6 +47,7 @@ const getYear = () => {
|
|||||||
}
|
}
|
||||||
return v;
|
return v;
|
||||||
};
|
};
|
||||||
|
// TODO @puhui999:可以参考 apps/web-antd/src/components/cron-tab/cron-tab.vue 简化到 types
|
||||||
const cronValue = reactive({
|
const cronValue = reactive({
|
||||||
second: {
|
second: {
|
||||||
type: '0',
|
type: '0',
|
||||||
@@ -275,6 +277,7 @@ const value_second = computed(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const value_minute = computed(() => {
|
const value_minute = computed(() => {
|
||||||
const v = cronValue.minute;
|
const v = cronValue.minute;
|
||||||
switch (v.type) {
|
switch (v.type) {
|
||||||
@@ -295,6 +298,7 @@ const value_minute = computed(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const value_hour = computed(() => {
|
const value_hour = computed(() => {
|
||||||
const v = cronValue.hour;
|
const v = cronValue.hour;
|
||||||
switch (v.type) {
|
switch (v.type) {
|
||||||
@@ -315,6 +319,7 @@ const value_hour = computed(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const value_day = computed(() => {
|
const value_day = computed(() => {
|
||||||
const v = cronValue.day;
|
const v = cronValue.day;
|
||||||
switch (v.type) {
|
switch (v.type) {
|
||||||
@@ -341,6 +346,7 @@ const value_day = computed(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const value_month = computed(() => {
|
const value_month = computed(() => {
|
||||||
const v = cronValue.month;
|
const v = cronValue.month;
|
||||||
switch (v.type) {
|
switch (v.type) {
|
||||||
@@ -361,6 +367,7 @@ const value_month = computed(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const value_week = computed(() => {
|
const value_week = computed(() => {
|
||||||
const v = cronValue.week;
|
const v = cronValue.week;
|
||||||
switch (v.type) {
|
switch (v.type) {
|
||||||
@@ -387,6 +394,7 @@ const value_week = computed(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const value_year = computed(() => {
|
const value_year = computed(() => {
|
||||||
const v = cronValue.year;
|
const v = cronValue.year;
|
||||||
switch (v.type) {
|
switch (v.type) {
|
||||||
@@ -410,48 +418,56 @@ const value_year = computed(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => cronValue.week.type,
|
() => cronValue.week.type,
|
||||||
(val) => {
|
(val: string) => {
|
||||||
if (val !== '5') {
|
if (val !== '5') {
|
||||||
cronValue.day.type = '5';
|
cronValue.day.type = '5';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => cronValue.day.type,
|
() => cronValue.day.type,
|
||||||
(val) => {
|
(val: string) => {
|
||||||
if (val !== '5') {
|
if (val !== '5') {
|
||||||
cronValue.week.type = '5';
|
cronValue.week.type = '5';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.modelValue,
|
() => props.modelValue,
|
||||||
() => {
|
() => {
|
||||||
defaultValue.value = props.modelValue;
|
defaultValue.value = props.modelValue;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
defaultValue.value = props.modelValue;
|
defaultValue.value = props.modelValue;
|
||||||
});
|
});
|
||||||
const select = ref();
|
|
||||||
|
const select = ref<string>();
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => select.value,
|
() => select.value,
|
||||||
() => {
|
() => {
|
||||||
if (select.value === 'custom') {
|
if (select.value === 'custom') {
|
||||||
open();
|
open();
|
||||||
} else {
|
} else {
|
||||||
defaultValue.value = select.value;
|
defaultValue.value = select.value || '';
|
||||||
emit('update:modelValue', defaultValue.value);
|
emit('update:modelValue', defaultValue.value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
const open = () => {
|
|
||||||
|
function open() {
|
||||||
set();
|
set();
|
||||||
dialogVisible.value = true;
|
dialogVisible.value = true;
|
||||||
};
|
}
|
||||||
const set = () => {
|
|
||||||
|
function set() {
|
||||||
defaultValue.value = props.modelValue;
|
defaultValue.value = props.modelValue;
|
||||||
let arr = (props.modelValue || '* * * * * ?').split(' ');
|
let arr = (props.modelValue || '* * * * * ?').split(' ');
|
||||||
// 简单检查
|
// 简单检查
|
||||||
@@ -463,145 +479,149 @@ const set = () => {
|
|||||||
// 秒
|
// 秒
|
||||||
if (arr[0] === '*') {
|
if (arr[0] === '*') {
|
||||||
cronValue.second.type = '0';
|
cronValue.second.type = '0';
|
||||||
} else if (arr[0]!.includes('-')) {
|
} else if (arr[0]?.includes('-')) {
|
||||||
cronValue.second.type = '1';
|
cronValue.second.type = '1';
|
||||||
cronValue.second.range.start = Number(arr[0]!.split('-')[0]);
|
cronValue.second.range.start = Number(arr[0].split('-')[0]);
|
||||||
cronValue.second.range.end = Number(arr[0]!.split('-')[1]);
|
cronValue.second.range.end = Number(arr[0].split('-')[1]);
|
||||||
} else if (arr[0]!.includes('/')) {
|
} else if (arr[0]?.includes('/')) {
|
||||||
cronValue.second.type = '2';
|
cronValue.second.type = '2';
|
||||||
cronValue.second.loop.start = Number(arr[0]!.split('/')[0]);
|
cronValue.second.loop.start = Number(arr[0].split('/')[0]);
|
||||||
cronValue.second.loop.end = Number(arr[0]!.split('/')[1]);
|
cronValue.second.loop.end = Number(arr[0].split('/')[1]);
|
||||||
} else {
|
} else {
|
||||||
cronValue.second.type = '3';
|
cronValue.second.type = '3';
|
||||||
cronValue.second.appoint = arr[0]!.split(',');
|
cronValue.second.appoint = arr[0]?.split(',') || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分
|
// 分
|
||||||
if (arr[1] === '*') {
|
if (arr[1] === '*') {
|
||||||
cronValue.minute.type = '0';
|
cronValue.minute.type = '0';
|
||||||
} else if (arr[1]!.includes('-')) {
|
} else if (arr[1]?.includes('-')) {
|
||||||
cronValue.minute.type = '1';
|
cronValue.minute.type = '1';
|
||||||
cronValue.minute.range.start = Number(arr[1]!.split('-')[0]);
|
cronValue.minute.range.start = Number(arr[1].split('-')[0]);
|
||||||
cronValue.minute.range.end = Number(arr[1]!.split('-')[1]);
|
cronValue.minute.range.end = Number(arr[1].split('-')[1]);
|
||||||
} else if (arr[1]!.includes('/')) {
|
} else if (arr[1]?.includes('/')) {
|
||||||
cronValue.minute.type = '2';
|
cronValue.minute.type = '2';
|
||||||
cronValue.minute.loop.start = Number(arr[1]!.split('/')[0]);
|
cronValue.minute.loop.start = Number(arr[1].split('/')[0]);
|
||||||
cronValue.minute.loop.end = Number(arr[1]!.split('/')[1]);
|
cronValue.minute.loop.end = Number(arr[1].split('/')[1]);
|
||||||
} else {
|
} else {
|
||||||
cronValue.minute.type = '3';
|
cronValue.minute.type = '3';
|
||||||
cronValue.minute.appoint = arr[1]!.split(',');
|
cronValue.minute.appoint = arr[1]?.split(',') || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 小时
|
// 小时
|
||||||
if (arr[2] === '*') {
|
if (arr[2] === '*') {
|
||||||
cronValue.hour.type = '0';
|
cronValue.hour.type = '0';
|
||||||
} else if (arr[2]!.includes('-')) {
|
} else if (arr[2]?.includes('-')) {
|
||||||
cronValue.hour.type = '1';
|
cronValue.hour.type = '1';
|
||||||
cronValue.hour.range.start = Number(arr[2]!.split('-')[0]);
|
cronValue.hour.range.start = Number(arr[2].split('-')[0]);
|
||||||
cronValue.hour.range.end = Number(arr[2]!.split('-')[1]);
|
cronValue.hour.range.end = Number(arr[2].split('-')[1]);
|
||||||
} else if (arr[2]!.includes('/')) {
|
} else if (arr[2]?.includes('/')) {
|
||||||
cronValue.hour.type = '2';
|
cronValue.hour.type = '2';
|
||||||
cronValue.hour.loop.start = Number(arr[2]!.split('/')[0]);
|
cronValue.hour.loop.start = Number(arr[2].split('/')[0]);
|
||||||
cronValue.hour.loop.end = Number(arr[2]!.split('/')[1]);
|
cronValue.hour.loop.end = Number(arr[2].split('/')[1]);
|
||||||
} else {
|
} else {
|
||||||
cronValue.hour.type = '3';
|
cronValue.hour.type = '3';
|
||||||
cronValue.hour.appoint = arr[2]!.split(',');
|
cronValue.hour.appoint = arr[2]?.split(',') || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 日
|
// 日
|
||||||
switch (arr[3]) {
|
switch (arr[3]) {
|
||||||
case '*': {
|
case '*': {
|
||||||
cronValue.day.type = '0';
|
cronValue.day.type = '0';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case '?': {
|
case '?': {
|
||||||
cronValue.day.type = '5';
|
cronValue.day.type = '5';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'L': {
|
case 'L': {
|
||||||
cronValue.day.type = '4';
|
cronValue.day.type = '4';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
if (arr[3]!.includes('-')) {
|
if (arr[3]?.includes('-')) {
|
||||||
cronValue.day.type = '1';
|
cronValue.day.type = '1';
|
||||||
cronValue.day.range.start = Number(arr[3]!.split('-')[0]);
|
cronValue.day.range.start = Number(arr[3].split('-')[0]);
|
||||||
cronValue.day.range.end = Number(arr[3]!.split('-')[1]);
|
cronValue.day.range.end = Number(arr[3].split('-')[1]);
|
||||||
} else if (arr[3]!.includes('/')) {
|
} else if (arr[3]?.includes('/')) {
|
||||||
cronValue.day.type = '2';
|
cronValue.day.type = '2';
|
||||||
cronValue.day.loop.start = Number(arr[3]!.split('/')[0]);
|
cronValue.day.loop.start = Number(arr[3].split('/')[0]);
|
||||||
cronValue.day.loop.end = Number(arr[3]!.split('/')[1]);
|
cronValue.day.loop.end = Number(arr[3].split('/')[1]);
|
||||||
} else {
|
} else {
|
||||||
cronValue.day.type = '3';
|
cronValue.day.type = '3';
|
||||||
cronValue.day.appoint = arr[3]!.split(',');
|
cronValue.day.appoint = arr[3]?.split(',') || [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 月
|
// 月
|
||||||
if (arr[4] === '*') {
|
if (arr[4] === '*') {
|
||||||
cronValue.month.type = '0';
|
cronValue.month.type = '0';
|
||||||
} else if (arr[4]!.includes('-')) {
|
} else if (arr[4]?.includes('-')) {
|
||||||
cronValue.month.type = '1';
|
cronValue.month.type = '1';
|
||||||
cronValue.month.range.start = Number(arr[4]!.split('-')[0]);
|
cronValue.month.range.start = Number(arr[4].split('-')[0]);
|
||||||
cronValue.month.range.end = Number(arr[4]!.split('-')[1]);
|
cronValue.month.range.end = Number(arr[4].split('-')[1]);
|
||||||
} else if (arr[4]!.includes('/')) {
|
} else if (arr[4]?.includes('/')) {
|
||||||
cronValue.month.type = '2';
|
cronValue.month.type = '2';
|
||||||
cronValue.month.loop.start = Number(arr[4]!.split('/')[0]);
|
cronValue.month.loop.start = Number(arr[4].split('/')[0]);
|
||||||
cronValue.month.loop.end = Number(arr[4]!.split('/')[1]);
|
cronValue.month.loop.end = Number(arr[4].split('/')[1]);
|
||||||
} else {
|
} else {
|
||||||
cronValue.month.type = '3';
|
cronValue.month.type = '3';
|
||||||
cronValue.month.appoint = arr[4]!.split(',');
|
cronValue.month.appoint = arr[4]?.split(',') || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 周
|
// 周
|
||||||
if (arr[5] === '*') {
|
if (arr[5] === '*') {
|
||||||
cronValue.week.type = '0';
|
cronValue.week.type = '0';
|
||||||
} else if (arr[5] === '?') {
|
} else if (arr[5] === '?') {
|
||||||
cronValue.week.type = '5';
|
cronValue.week.type = '5';
|
||||||
} else if (arr[5]!.includes('-')) {
|
} else if (arr[5]?.includes('-')) {
|
||||||
cronValue.week.type = '1';
|
cronValue.week.type = '1';
|
||||||
cronValue.week.range.start = arr[5]!.split('-')[0]!;
|
cronValue.week.range.start = arr[5].split('-')[0] || '';
|
||||||
cronValue.week.range.end = arr[5]!.split('-')[1]!;
|
cronValue.week.range.end = arr[5].split('-')[1] || '';
|
||||||
} else if (arr[5]!.includes('#')) {
|
} else if (arr[5]?.includes('#')) {
|
||||||
cronValue.week.type = '2';
|
cronValue.week.type = '2';
|
||||||
cronValue.week.loop.start = Number(arr[5]!.split('#')[1]);
|
cronValue.week.loop.start = Number(arr[5].split('#')[1]);
|
||||||
cronValue.week.loop.end = arr[5]!.split('#')[0]!;
|
cronValue.week.loop.end = arr[5].split('#')[0] || '';
|
||||||
} else if (arr[5]!.includes('L')) {
|
} else if (arr[5]?.includes('L')) {
|
||||||
cronValue.week.type = '4';
|
cronValue.week.type = '4';
|
||||||
cronValue.week.last = arr[5]!.split('L')[0]!;
|
cronValue.week.last = arr[5].split('L')[0] || '';
|
||||||
} else {
|
} else {
|
||||||
cronValue.week.type = '3';
|
cronValue.week.type = '3';
|
||||||
cronValue.week.appoint = arr[5]!.split(',');
|
cronValue.week.appoint = arr[5]?.split(',') || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 年
|
// 年
|
||||||
if (!arr[6]) {
|
if (!arr[6]) {
|
||||||
cronValue.year.type = '-1';
|
cronValue.year.type = '-1';
|
||||||
} else if (arr[6] === '*') {
|
} else if (arr[6] === '*') {
|
||||||
cronValue.year.type = '0';
|
cronValue.year.type = '0';
|
||||||
} else if (arr[6].includes('-')) {
|
} else if (arr[6]?.includes('-')) {
|
||||||
cronValue.year.type = '1';
|
cronValue.year.type = '1';
|
||||||
cronValue.year.range.start = Number(arr[6].split('-')[0]);
|
cronValue.year.range.start = Number(arr[6].split('-')[0]);
|
||||||
cronValue.year.range.end = Number(arr[6].split('-')[1]);
|
cronValue.year.range.end = Number(arr[6].split('-')[1]);
|
||||||
} else if (arr[6].includes('/')) {
|
} else if (arr[6]?.includes('/')) {
|
||||||
cronValue.year.type = '2';
|
cronValue.year.type = '2';
|
||||||
cronValue.year.loop.start = Number(arr[6].split('/')[1]);
|
cronValue.year.loop.start = Number(arr[6].split('/')[1]);
|
||||||
cronValue.year.loop.end = Number(arr[6].split('/')[0]);
|
cronValue.year.loop.end = Number(arr[6].split('/')[0]);
|
||||||
} else {
|
} else {
|
||||||
cronValue.year.type = '3';
|
cronValue.year.type = '3';
|
||||||
cronValue.year.appoint = arr[6].split(',');
|
cronValue.year.appoint = arr[6]?.split(',') || [];
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
const submit = () => {
|
|
||||||
|
function submit() {
|
||||||
const year = value_year.value ? ` ${value_year.value}` : '';
|
const year = value_year.value ? ` ${value_year.value}` : '';
|
||||||
defaultValue.value = `${value_second.value} ${value_minute.value} ${
|
defaultValue.value = `${value_second.value} ${value_minute.value} ${
|
||||||
value_hour.value
|
value_hour.value
|
||||||
} ${value_day.value} ${value_month.value} ${value_week.value}${year}`;
|
} ${value_day.value} ${value_month.value} ${value_week.value}${year}`;
|
||||||
emit('update:modelValue', defaultValue.value);
|
emit('update:modelValue', defaultValue.value);
|
||||||
dialogVisible.value = false;
|
dialogVisible.value = false;
|
||||||
};
|
}
|
||||||
|
|
||||||
const inputChange = () => {
|
function inputChange() {
|
||||||
emit('update:modelValue', defaultValue.value);
|
emit('update:modelValue', defaultValue.value);
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<ElInput
|
<ElInput
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ const props = withDefaults(defineProps<CropperAvatarProps>(), {
|
|||||||
const emit = defineEmits(['update:value', 'change']);
|
const emit = defineEmits(['update:value', 'change']);
|
||||||
|
|
||||||
const sourceValue = ref(props.value || '');
|
const sourceValue = ref(props.value || '');
|
||||||
|
// TODO @puhui999:这个有办法去掉么?
|
||||||
const prefixCls = 'cropper-avatar';
|
const prefixCls = 'cropper-avatar';
|
||||||
const [CropperModal, modalApi] = useVbenModal({
|
const [CropperModal, modalApi] = useVbenModal({
|
||||||
connectedComponent: cropperModal,
|
connectedComponent: cropperModal,
|
||||||
@@ -73,12 +74,16 @@ defineExpose({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<!-- TODO @puhui999:html 部分,看看有没办法和 web-antd/src/components/cropper/cropper-avatar.vue 风格更接近 -->
|
||||||
|
<!-- 头像容器 -->
|
||||||
<div :class="getClass" :style="getStyle">
|
<div :class="getClass" :style="getStyle">
|
||||||
|
<!-- 图片包装器 -->
|
||||||
<div
|
<div
|
||||||
:class="`${prefixCls}-image-wrapper`"
|
:class="`${prefixCls}-image-wrapper`"
|
||||||
:style="getImageWrapperStyle"
|
:style="getImageWrapperStyle"
|
||||||
@click="openModal"
|
@click="openModal"
|
||||||
>
|
>
|
||||||
|
<!-- 遮罩层 -->
|
||||||
<div :class="`${prefixCls}-image-mask`" :style="getImageWrapperStyle">
|
<div :class="`${prefixCls}-image-mask`" :style="getImageWrapperStyle">
|
||||||
<span
|
<span
|
||||||
:style="{
|
:style="{
|
||||||
@@ -90,8 +95,10 @@ defineExpose({
|
|||||||
class="icon-[ant-design--cloud-upload-outlined] text-[#d6d6d6]"
|
class="icon-[ant-design--cloud-upload-outlined] text-[#d6d6d6]"
|
||||||
></span>
|
></span>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 头像图片 -->
|
||||||
<img v-if="sourceValue" :src="sourceValue" alt="avatar" />
|
<img v-if="sourceValue" :src="sourceValue" alt="avatar" />
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 上传按钮 -->
|
||||||
<ElButton
|
<ElButton
|
||||||
v-if="showBtn"
|
v-if="showBtn"
|
||||||
:class="`${prefixCls}-upload-btn`"
|
:class="`${prefixCls}-upload-btn`"
|
||||||
@@ -111,6 +118,7 @@ defineExpose({
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
/* TODO @puhui999:要类似 web-antd/src/components/cropper/cropper-avatar.vue 减少 scss,通过 tindwind 么? */
|
||||||
.cropper-avatar {
|
.cropper-avatar {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
@@ -121,7 +121,9 @@ async function handleOk() {
|
|||||||
class="w-[800px]"
|
class="w-[800px]"
|
||||||
>
|
>
|
||||||
<div :class="prefixCls">
|
<div :class="prefixCls">
|
||||||
|
<!-- 左侧区域 -->
|
||||||
<div :class="`${prefixCls}-left`" class="w-full">
|
<div :class="`${prefixCls}-left`" class="w-full">
|
||||||
|
<!-- 裁剪器容器 -->
|
||||||
<div :class="`${prefixCls}-cropper`">
|
<div :class="`${prefixCls}-cropper`">
|
||||||
<CropperImage
|
<CropperImage
|
||||||
v-if="src"
|
v-if="src"
|
||||||
@@ -133,6 +135,7 @@ async function handleOk() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 工具栏 -->
|
||||||
<div :class="`${prefixCls}-toolbar`">
|
<div :class="`${prefixCls}-toolbar`">
|
||||||
<ElUpload
|
<ElUpload
|
||||||
:before-upload="handleBeforeUpload"
|
:before-upload="handleBeforeUpload"
|
||||||
@@ -276,7 +279,10 @@ async function handleOk() {
|
|||||||
</ElSpace>
|
</ElSpace>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 右侧区域 -->
|
||||||
<div :class="`${prefixCls}-right`">
|
<div :class="`${prefixCls}-right`">
|
||||||
|
<!-- 预览区域 -->
|
||||||
<div :class="`${prefixCls}-preview`">
|
<div :class="`${prefixCls}-preview`">
|
||||||
<img
|
<img
|
||||||
v-if="previewSource"
|
v-if="previewSource"
|
||||||
@@ -284,6 +290,7 @@ async function handleOk() {
|
|||||||
:src="previewSource"
|
:src="previewSource"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 头像组合预览 -->
|
||||||
<template v-if="previewSource">
|
<template v-if="previewSource">
|
||||||
<div :class="`${prefixCls}-group`">
|
<div :class="`${prefixCls}-group`">
|
||||||
<ElAvatar :src="previewSource" size="large" />
|
<ElAvatar :src="previewSource" size="large" />
|
||||||
@@ -298,6 +305,7 @@ async function handleOk() {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
/* TODO @puhui999:要类似 web-antd/src/components/cropper/cropper-avatar.vue 减少 scss,通过 tindwind 么? */
|
||||||
.cropper-am {
|
.cropper-am {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ const imgElRef = ref<ElRef<HTMLImageElement>>();
|
|||||||
const cropper = ref<Cropper | null>();
|
const cropper = ref<Cropper | null>();
|
||||||
const isReady = ref(false);
|
const isReady = ref(false);
|
||||||
|
|
||||||
|
// TODO @puhui999:这个有办法去掉么?
|
||||||
const prefixCls = 'cropper-image';
|
const prefixCls = 'cropper-image';
|
||||||
const debounceRealTimeCropped = useDebounceFn(realTimeCropped, 80);
|
const debounceRealTimeCropped = useDebounceFn(realTimeCropped, 80);
|
||||||
|
|
||||||
|
|||||||
@@ -8,30 +8,21 @@ import type { Recordable } from '@vben/types';
|
|||||||
export interface DescriptionItemSchema {
|
export interface DescriptionItemSchema {
|
||||||
labelMinWidth?: number;
|
labelMinWidth?: number;
|
||||||
contentMinWidth?: number;
|
contentMinWidth?: number;
|
||||||
// 自定义标签样式
|
labelStyle?: CSSProperties; // 自定义标签样式
|
||||||
labelStyle?: CSSProperties;
|
field: string; // 对应 data 中的字段名
|
||||||
// 对应 data 中的字段名
|
label: JSX.Element | string | VNode; // 内容的描述
|
||||||
field: string;
|
span?: number; // 包含列的数量
|
||||||
// 内容的描述
|
show?: (...arg: any) => boolean; // 是否显示
|
||||||
label: JSX.Element | string | VNode;
|
slot?: string; // 插槽名称
|
||||||
// 包含列的数量
|
|
||||||
span?: number;
|
|
||||||
// 是否显示
|
|
||||||
show?: (...arg: any) => boolean;
|
|
||||||
// 插槽名称
|
|
||||||
slot?: string;
|
|
||||||
// 自定义需要展示的内容
|
|
||||||
render?: (
|
render?: (
|
||||||
val: any,
|
val: any,
|
||||||
data?: Recordable<any>,
|
data?: Recordable<any>,
|
||||||
) => Element | JSX.Element | number | string | undefined | VNode;
|
) => Element | JSX.Element | number | string | undefined | VNode; // 自定义需要展示的内容
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DescriptionProps extends ElDescriptionProps {
|
export interface DescriptionProps extends ElDescriptionProps {
|
||||||
// 描述项配置
|
schema: DescriptionItemSchema[]; // 描述项配置
|
||||||
schema: DescriptionItemSchema[];
|
data: Recordable<any>; // 数据
|
||||||
// 数据
|
|
||||||
data: Recordable<any>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DescInstance {
|
export interface DescInstance {
|
||||||
|
|||||||
@@ -1,24 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
// import { isHexColor } from '@/utils/color' // TODO @芋艿:【可优化】增加 cssClass 的处理 https://gitee.com/yudaocode/yudao-ui-admin-vben/blob/v2.4.1/src/components/DictTag/src/DictTag.vue#L60
|
// import { isHexColor } from '@/utils/color' // TODO @芋艿:【可优化】增加 cssClass 的处理 https://gitee.com/yudaocode/yudao-ui-admin-vben/blob/v2.4.1/src/components/DictTag/src/DictTag.vue#L60 @xingyu:这个要适配掉 ele 版本里么?
|
||||||
import { getDictObj } from '@vben/hooks';
|
import { getDictObj } from '@vben/hooks';
|
||||||
|
|
||||||
import { ElTag } from 'element-plus';
|
import { ElTag } from 'element-plus';
|
||||||
|
|
||||||
interface DictTagProps {
|
interface DictTagProps {
|
||||||
/**
|
type: string; // 字典类型
|
||||||
* 字典类型
|
value: any; // 字典值
|
||||||
*/
|
icon?: string; // 图标
|
||||||
type: string;
|
|
||||||
/**
|
|
||||||
* 字典值
|
|
||||||
*/
|
|
||||||
value: any;
|
|
||||||
/**
|
|
||||||
* 图标
|
|
||||||
*/
|
|
||||||
icon?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<DictTagProps>();
|
const props = defineProps<DictTagProps>();
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ const props = withDefaults(defineProps<DictSelectProps>(), {
|
|||||||
|
|
||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
|
|
||||||
// 获得字典配置
|
/** 获得字典配置 */
|
||||||
const dictOptions = computed(() => {
|
const getDictOption = computed(() => {
|
||||||
switch (props.valueType) {
|
switch (props.valueType) {
|
||||||
case 'bool': {
|
case 'bool': {
|
||||||
return getDictOptions(props.dictType, 'boolean');
|
return getDictOptions(props.dictType, 'boolean');
|
||||||
@@ -46,7 +46,7 @@ const dictOptions = computed(() => {
|
|||||||
<template>
|
<template>
|
||||||
<ElSelect v-if="selectType === 'select'" class="w-1/1" v-bind="attrs">
|
<ElSelect v-if="selectType === 'select'" class="w-1/1" v-bind="attrs">
|
||||||
<ElOption
|
<ElOption
|
||||||
v-for="(dict, index) in dictOptions"
|
v-for="(dict, index) in getDictOption"
|
||||||
:key="index"
|
:key="index"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
@@ -54,7 +54,7 @@ const dictOptions = computed(() => {
|
|||||||
</ElSelect>
|
</ElSelect>
|
||||||
<ElRadioGroup v-if="selectType === 'radio'" class="w-1/1" v-bind="attrs">
|
<ElRadioGroup v-if="selectType === 'radio'" class="w-1/1" v-bind="attrs">
|
||||||
<ElRadio
|
<ElRadio
|
||||||
v-for="(dict, index) in dictOptions"
|
v-for="(dict, index) in getDictOption"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
>
|
>
|
||||||
@@ -67,7 +67,7 @@ const dictOptions = computed(() => {
|
|||||||
v-bind="attrs"
|
v-bind="attrs"
|
||||||
>
|
>
|
||||||
<ElCheckbox
|
<ElCheckbox
|
||||||
v-for="(dict, index) in dictOptions"
|
v-for="(dict, index) in getDictOption"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="dict.value"
|
:label="dict.value"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
|
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
export const useApiSelect = (option: ApiSelectProps) => {
|
export function useApiSelect(option: ApiSelectProps) {
|
||||||
return defineComponent({
|
return defineComponent({
|
||||||
name: option.name,
|
name: option.name,
|
||||||
props: {
|
props: {
|
||||||
@@ -285,4 +285,4 @@ export const useApiSelect = (option: ApiSelectProps) => {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { defineComponent } from 'vue';
|
|||||||
|
|
||||||
import ImageUpload from '#/components/upload/image-upload.vue';
|
import ImageUpload from '#/components/upload/image-upload.vue';
|
||||||
|
|
||||||
export const useImagesUpload = () => {
|
export function useImagesUpload() {
|
||||||
return defineComponent({
|
return defineComponent({
|
||||||
name: 'ImagesUpload',
|
name: 'ImagesUpload',
|
||||||
props: {
|
props: {
|
||||||
@@ -16,10 +16,10 @@ export const useImagesUpload = () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
// TODO: @dhb52 其实还是靠 props 默认参数起作用,没能从 formCreate 传递
|
// TODO: @puhui999:@dhb52 其实还是靠 props 默认参数起作用,没能从 formCreate 传递
|
||||||
return (props: { maxNumber?: number; multiple?: boolean }) => (
|
return (props: { maxNumber?: number; multiple?: boolean }) => (
|
||||||
<ImageUpload maxNumber={props.maxNumber} multiple={props.multiple} />
|
<ImageUpload maxNumber={props.maxNumber} multiple={props.multiple} />
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
|
import type { Rule } from '@form-create/element-ui';
|
||||||
|
|
||||||
import type { Ref } from 'vue';
|
import type { Ref } from 'vue';
|
||||||
|
|
||||||
import type { Menu } from '#/components/form-create/typing';
|
import type { Menu } from '#/components/form-create/typing';
|
||||||
|
|
||||||
import { isRef, nextTick, onMounted } from 'vue';
|
import { isRef, nextTick, onMounted } from 'vue';
|
||||||
|
|
||||||
|
import formCreate from '@form-create/element-ui';
|
||||||
|
|
||||||
import { apiSelectRule } from '#/components/form-create/rules/data';
|
import { apiSelectRule } from '#/components/form-create/rules/data';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -15,12 +19,12 @@ import {
|
|||||||
useUploadImagesRule,
|
useUploadImagesRule,
|
||||||
} from './rules';
|
} from './rules';
|
||||||
|
|
||||||
// 编码表单 Conf
|
/** 编码表单 Conf */
|
||||||
export function encodeConf(designerRef: any) {
|
export function encodeConf(designerRef: any) {
|
||||||
return JSON.stringify(designerRef.value.getOption());
|
return JSON.stringify(designerRef.value.getOption());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编码表单 Fields
|
/** 编码表单 Fields */
|
||||||
export function encodeFields(designerRef: any) {
|
export function encodeFields(designerRef: any) {
|
||||||
const rule = JSON.parse(designerRef.value.getJson());
|
const rule = JSON.parse(designerRef.value.getJson());
|
||||||
const fields: string[] = [];
|
const fields: string[] = [];
|
||||||
@@ -30,28 +34,28 @@ export function encodeFields(designerRef: any) {
|
|||||||
return fields;
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 解码表单 Fields
|
/** 解码表单 Fields */
|
||||||
export function decodeFields(fields: string[]) {
|
export function decodeFields(fields: string[]) {
|
||||||
const rule: object[] = [];
|
const rule: Rule[] = [];
|
||||||
fields.forEach((item) => {
|
fields.forEach((item) => {
|
||||||
rule.push(JSON.parse(item));
|
rule.push(formCreate.parseJson(item));
|
||||||
});
|
});
|
||||||
return rule;
|
return rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置表单的 Conf 和 Fields,适用 FcDesigner 场景
|
/** 设置表单的 Conf 和 Fields,适用 FcDesigner 场景 */
|
||||||
export function setConfAndFields(
|
export function setConfAndFields(
|
||||||
designerRef: any,
|
designerRef: any,
|
||||||
conf: string,
|
conf: string,
|
||||||
fields: string | string[],
|
fields: string | string[],
|
||||||
) {
|
) {
|
||||||
designerRef.value.setOption(JSON.parse(conf));
|
designerRef.value.setOption(formCreate.parseJson(conf));
|
||||||
// 处理 fields 参数类型,确保传入 decodeFields 的是 string[] 类型
|
// 处理 fields 参数类型,确保传入 decodeFields 的是 string[] 类型
|
||||||
const fieldsArray = Array.isArray(fields) ? fields : [fields];
|
const fieldsArray = Array.isArray(fields) ? fields : [fields];
|
||||||
designerRef.value.setRule(decodeFields(fieldsArray));
|
designerRef.value.setRule(decodeFields(fieldsArray));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置表单的 Conf 和 Fields,适用 form-create 场景
|
/** 设置表单的 Conf 和 Fields,适用 form-create 场景 */
|
||||||
export function setConfAndFields2(
|
export function setConfAndFields2(
|
||||||
detailPreview: any,
|
detailPreview: any,
|
||||||
conf: string,
|
conf: string,
|
||||||
@@ -61,7 +65,7 @@ export function setConfAndFields2(
|
|||||||
if (isRef(detailPreview)) {
|
if (isRef(detailPreview)) {
|
||||||
detailPreview = detailPreview.value;
|
detailPreview = detailPreview.value;
|
||||||
}
|
}
|
||||||
detailPreview.option = JSON.parse(conf);
|
detailPreview.option = formCreate.parseJson(conf);
|
||||||
detailPreview.rule = decodeFields(fields);
|
detailPreview.rule = decodeFields(fields);
|
||||||
if (value) {
|
if (value) {
|
||||||
detailPreview.value = value;
|
detailPreview.value = value;
|
||||||
@@ -151,9 +155,7 @@ export async function useFormCreateDesigner(designer: Ref) {
|
|||||||
const uploadImageRule = useUploadImageRule();
|
const uploadImageRule = useUploadImageRule();
|
||||||
const uploadImagesRule = useUploadImagesRule();
|
const uploadImagesRule = useUploadImagesRule();
|
||||||
|
|
||||||
/**
|
/** 构建表单组件 */
|
||||||
* 构建表单组件
|
|
||||||
*/
|
|
||||||
function buildFormComponents() {
|
function buildFormComponents() {
|
||||||
// 移除自带的上传组件规则,使用 uploadFileRule、uploadImgRule、uploadImgsRule 替代
|
// 移除自带的上传组件规则,使用 uploadFileRule、uploadImgRule、uploadImgsRule 替代
|
||||||
designer.value?.removeMenuItem('upload');
|
designer.value?.removeMenuItem('upload');
|
||||||
@@ -196,9 +198,7 @@ export async function useFormCreateDesigner(designer: Ref) {
|
|||||||
event: ['click', 'change', 'visibleChange', 'clear', 'blur', 'focus'],
|
event: ['click', 'change', 'visibleChange', 'clear', 'blur', 'focus'],
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** 构建系统字段菜单 */
|
||||||
* 构建系统字段菜单
|
|
||||||
*/
|
|
||||||
function buildSystemMenu() {
|
function buildSystemMenu() {
|
||||||
// 移除自带的下拉选择器组件,使用 currencySelectRule 替代
|
// 移除自带的下拉选择器组件,使用 currencySelectRule 替代
|
||||||
// designer.value?.removeMenuItem('select')
|
// designer.value?.removeMenuItem('select')
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ const apiSelectRule = [
|
|||||||
field: 'data',
|
field: 'data',
|
||||||
title: '请求参数 JSON 格式',
|
title: '请求参数 JSON 格式',
|
||||||
props: {
|
props: {
|
||||||
autosize: true,
|
autosize: true, // TODO @puhui999:这里时 autoSize 还是 autosize 哈?和 antd 不同
|
||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
placeholder: '{"type": 1}',
|
placeholder: '{"type": 1}',
|
||||||
},
|
},
|
||||||
@@ -155,7 +155,7 @@ const apiSelectRule = [
|
|||||||
info: `data 为接口返回值,需要写一个匿名函数解析返回值为选择器 options 列表
|
info: `data 为接口返回值,需要写一个匿名函数解析返回值为选择器 options 列表
|
||||||
(data: any)=>{ label: string; value: any }[]`,
|
(data: any)=>{ label: string; value: any }[]`,
|
||||||
props: {
|
props: {
|
||||||
autosize: true,
|
autosize: true, // TODO @puhui999:这里时 autoSize 还是 autosize 哈?和 antd 不同
|
||||||
rows: { minRows: 2, maxRows: 6 },
|
rows: { minRows: 2, maxRows: 6 },
|
||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
placeholder: `
|
placeholder: `
|
||||||
|
|||||||
@@ -11,10 +11,8 @@ import {
|
|||||||
} from '#/components/form-create/helpers';
|
} from '#/components/form-create/helpers';
|
||||||
import { selectRule } from '#/components/form-create/rules/data';
|
import { selectRule } from '#/components/form-create/rules/data';
|
||||||
|
|
||||||
/**
|
/** 字典选择器规则,如果规则使用到动态数据则需要单独配置不能使用 useSelectRule */
|
||||||
* 字典选择器规则,如果规则使用到动态数据则需要单独配置不能使用 useSelectRule
|
export function useDictSelectRule() {
|
||||||
*/
|
|
||||||
export const useDictSelectRule = () => {
|
|
||||||
const label = '字典选择器';
|
const label = '字典选择器';
|
||||||
const name = 'DictSelect';
|
const name = 'DictSelect';
|
||||||
const rules = cloneDeep(selectRule);
|
const rules = cloneDeep(selectRule);
|
||||||
@@ -41,6 +39,7 @@ export const useDictSelectRule = () => {
|
|||||||
title: label,
|
title: label,
|
||||||
info: '',
|
info: '',
|
||||||
$required: false,
|
$required: false,
|
||||||
|
// TODO @puhui999:vben 版本里,这里有个 modelField: 'value', 需要添加么?
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props(_: any, { t }: any) {
|
props(_: any, { t }: any) {
|
||||||
@@ -68,4 +67,4 @@ export const useDictSelectRule = () => {
|
|||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
makeRequiredRule,
|
makeRequiredRule,
|
||||||
} from '#/components/form-create/helpers';
|
} from '#/components/form-create/helpers';
|
||||||
|
|
||||||
export const useEditorRule = () => {
|
export function useEditorRule() {
|
||||||
const label = '富文本';
|
const label = '富文本';
|
||||||
const name = 'Tinymce';
|
const name = 'Tinymce';
|
||||||
return {
|
return {
|
||||||
@@ -33,4 +33,4 @@ export const useEditorRule = () => {
|
|||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { selectRule } from '#/components/form-create/rules/data';
|
|||||||
*
|
*
|
||||||
* @param option 规则配置
|
* @param option 规则配置
|
||||||
*/
|
*/
|
||||||
export const useSelectRule = (option: SelectRuleOption) => {
|
export function useSelectRule(option: SelectRuleOption) {
|
||||||
const label = option.label;
|
const label = option.label;
|
||||||
const name = option.name;
|
const name = option.name;
|
||||||
const rules = cloneDeep(selectRule);
|
const rules = cloneDeep(selectRule);
|
||||||
@@ -42,4 +42,4 @@ export const useSelectRule = (option: SelectRuleOption) => {
|
|||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
makeRequiredRule,
|
makeRequiredRule,
|
||||||
} from '#/components/form-create/helpers';
|
} from '#/components/form-create/helpers';
|
||||||
|
|
||||||
export const useUploadFileRule = () => {
|
export function useUploadFileRule() {
|
||||||
const label = '文件上传';
|
const label = '文件上传';
|
||||||
const name = 'FileUpload';
|
const name = 'FileUpload';
|
||||||
return {
|
return {
|
||||||
@@ -81,4 +81,4 @@ export const useUploadFileRule = () => {
|
|||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
makeRequiredRule,
|
makeRequiredRule,
|
||||||
} from '#/components/form-create/helpers';
|
} from '#/components/form-create/helpers';
|
||||||
|
|
||||||
export const useUploadImageRule = () => {
|
export function useUploadImageRule() {
|
||||||
const label = '单图上传';
|
const label = '单图上传';
|
||||||
const name = 'ImageUpload';
|
const name = 'ImageUpload';
|
||||||
return {
|
return {
|
||||||
@@ -90,4 +90,4 @@ export const useUploadImageRule = () => {
|
|||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
makeRequiredRule,
|
makeRequiredRule,
|
||||||
} from '#/components/form-create/helpers';
|
} from '#/components/form-create/helpers';
|
||||||
|
|
||||||
export const useUploadImagesRule = () => {
|
export function useUploadImagesRule() {
|
||||||
const label = '多图上传';
|
const label = '多图上传';
|
||||||
const name = 'ImagesUpload';
|
const name = 'ImagesUpload';
|
||||||
return {
|
return {
|
||||||
@@ -86,4 +86,4 @@ export const useUploadImagesRule = () => {
|
|||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|||||||
@@ -3,13 +3,14 @@ export const ACTION_ICON = {
|
|||||||
UPLOAD: 'lucide:upload',
|
UPLOAD: 'lucide:upload',
|
||||||
ADD: 'lucide:plus',
|
ADD: 'lucide:plus',
|
||||||
EDIT: 'lucide:edit',
|
EDIT: 'lucide:edit',
|
||||||
DELETE: 'lucide:trash',
|
DELETE: 'lucide:trash-2',
|
||||||
REFRESH: 'lucide:refresh-cw',
|
REFRESH: 'lucide:refresh-cw',
|
||||||
SEARCH: 'lucide:search',
|
SEARCH: 'lucide:search',
|
||||||
FILTER: 'lucide:filter',
|
FILTER: 'lucide:filter',
|
||||||
MORE: 'lucide:ellipsis-vertical',
|
MORE: 'lucide:ellipsis-vertical',
|
||||||
VIEW: 'lucide:eye',
|
VIEW: 'lucide:eye',
|
||||||
COPY: 'lucide:copy',
|
COPY: 'lucide:copy',
|
||||||
|
CLOSE: 'lucide:x',
|
||||||
BOOK: 'lucide:book',
|
BOOK: 'lucide:book',
|
||||||
AUDIT: 'lucide:file-check',
|
AUDIT: 'lucide:file-check',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<!-- add by 星语:参考 vben2 的方式,增加 TableAction 组件 -->
|
<!-- add by 星语:参考 vben2 的方式,增加 TableAction 组件 -->
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// TODO @xingyu:要不要和 apps/web-antd/src/components/table-action/table-action.vue 代码风格,进一步风格对齐?现在每个方法,会有一些差异
|
||||||
import type { PropType } from 'vue';
|
import type { PropType } from 'vue';
|
||||||
|
|
||||||
import type { ActionItem, PopConfirm } from './typing';
|
import type { ActionItem, PopConfirm } from './typing';
|
||||||
@@ -42,20 +43,24 @@ const props = defineProps({
|
|||||||
|
|
||||||
const { hasAccessByCodes } = useAccess();
|
const { hasAccessByCodes } = useAccess();
|
||||||
|
|
||||||
|
/** 检查是否显示 */
|
||||||
function isIfShow(action: ActionItem): boolean {
|
function isIfShow(action: ActionItem): boolean {
|
||||||
const ifShow = action.ifShow;
|
const ifShow = action.ifShow;
|
||||||
|
|
||||||
let isIfShow = true;
|
let isIfShow = true;
|
||||||
|
|
||||||
if (isBoolean(ifShow)) {
|
if (isBoolean(ifShow)) {
|
||||||
isIfShow = ifShow;
|
isIfShow = ifShow;
|
||||||
}
|
}
|
||||||
if (isFunction(ifShow)) {
|
if (isFunction(ifShow)) {
|
||||||
isIfShow = ifShow(action);
|
isIfShow = ifShow(action);
|
||||||
}
|
}
|
||||||
|
if (isIfShow) {
|
||||||
|
isIfShow =
|
||||||
|
hasAccessByCodes(action.auth || []) || (action.auth || []).length === 0;
|
||||||
|
}
|
||||||
return isIfShow;
|
return isIfShow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 处理按钮 actions */
|
||||||
const getActions = computed(() => {
|
const getActions = computed(() => {
|
||||||
return (toRaw(props.actions) || [])
|
return (toRaw(props.actions) || [])
|
||||||
.filter((action) => {
|
.filter((action) => {
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
import type { IPropTypes } from '@tinymce/tinymce-vue/lib/cjs/main/ts/components/EditorPropTypes';
|
import type { IPropTypes } from '@tinymce/tinymce-vue/lib/cjs/main/ts/components/EditorPropTypes';
|
||||||
import type { Editor as EditorType } from 'tinymce/tinymce';
|
import type { Editor as EditorType } from 'tinymce/tinymce';
|
||||||
|
|
||||||
import type { PropType } from 'vue';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
computed,
|
computed,
|
||||||
nextTick,
|
nextTick,
|
||||||
@@ -35,37 +33,26 @@ type InitOptions = IPropTypes['init'];
|
|||||||
|
|
||||||
defineOptions({ name: 'Tinymce', inheritAttrs: false });
|
defineOptions({ name: 'Tinymce', inheritAttrs: false });
|
||||||
|
|
||||||
const props = defineProps({
|
const props = withDefaults(defineProps<TinymacProps>(), {
|
||||||
options: {
|
height: 400,
|
||||||
type: Object as PropType<Partial<InitOptions>>,
|
width: 'auto',
|
||||||
default: () => ({}),
|
options: () => ({}),
|
||||||
},
|
plugins: defaultPlugins,
|
||||||
toolbar: {
|
toolbar: defaultToolbar,
|
||||||
type: String,
|
showImageUpload: true,
|
||||||
default: defaultToolbar,
|
|
||||||
},
|
|
||||||
plugins: {
|
|
||||||
type: String,
|
|
||||||
default: defaultPlugins,
|
|
||||||
},
|
|
||||||
height: {
|
|
||||||
type: [Number, String] as PropType<number | string>,
|
|
||||||
required: false,
|
|
||||||
default: 400,
|
|
||||||
},
|
|
||||||
width: {
|
|
||||||
type: [Number, String] as PropType<number | string>,
|
|
||||||
required: false,
|
|
||||||
default: 'auto',
|
|
||||||
},
|
|
||||||
showImageUpload: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['change']);
|
const emit = defineEmits(['change']);
|
||||||
|
|
||||||
|
interface TinymacProps {
|
||||||
|
options?: Partial<InitOptions>;
|
||||||
|
toolbar?: string;
|
||||||
|
plugins?: string;
|
||||||
|
height?: number | string;
|
||||||
|
width?: number | string;
|
||||||
|
showImageUpload?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
/** 外部使用 v-model 绑定值 */
|
/** 外部使用 v-model 绑定值 */
|
||||||
const modelValue = defineModel('modelValue', { default: '', type: String });
|
const modelValue = defineModel('modelValue', { default: '', type: String });
|
||||||
|
|
||||||
@@ -151,7 +138,7 @@ const initOptions = computed((): InitOptions => {
|
|||||||
'bold italic | quicklink h2 h3 blockquote quickimage quicktable',
|
'bold italic | quicklink h2 h3 blockquote quickimage quicktable',
|
||||||
toolbar_mode: 'sliding',
|
toolbar_mode: 'sliding',
|
||||||
...options,
|
...options,
|
||||||
images_upload_handler: (blobInfo) => {
|
images_upload_handler: (blobInfo: any) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const file = blobInfo.blob() as File;
|
const file = blobInfo.blob() as File;
|
||||||
const { httpRequest } = useUpload();
|
const { httpRequest } = useUpload();
|
||||||
@@ -165,9 +152,9 @@ const initOptions = computed((): InitOptions => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
setup: (editor) => {
|
setup: (editor: EditorType) => {
|
||||||
editorRef.value = editor;
|
editorRef.value = editor;
|
||||||
editor.on('init', (e) => initSetup(e));
|
editor.on('init', (e: any) => initSetup(e));
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,10 +17,9 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
},
|
||||||
fullscreen: {
|
fullscreen: {
|
||||||
// 图片上传,是否放到全屏的位置
|
|
||||||
default: false,
|
default: false,
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
}, // 图片上传,是否放到全屏的位置
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['uploading', 'done', 'error']);
|
const emit = defineEmits(['uploading', 'done', 'error']);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
|||||||
{
|
{
|
||||||
fieldName: 'file',
|
fieldName: 'file',
|
||||||
label: '文件上传',
|
label: '文件上传',
|
||||||
component: 'FileUpload',
|
component: 'Upload',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请选择要上传的文件',
|
placeholder: '请选择要上传的文件',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import type { UploadFile, UploadRawFile } from 'element-plus';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { isEmpty } from '@vben/utils';
|
|
||||||
|
import { ElMessage, ElUpload } from 'element-plus';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
|
import { useUpload } from '#/components/upload/use-upload';
|
||||||
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import { useFormSchema } from '../data';
|
import { useFormSchema } from '../data';
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
|
|
||||||
const [Modal, modalApi] = useVbenModal({
|
const [Form, formApi] = useVbenForm({
|
||||||
showConfirmButton: false,
|
|
||||||
showCancelButton: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
const [Form] = useVbenForm({
|
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
componentProps: {
|
componentProps: {
|
||||||
class: 'w-full',
|
class: 'w-full',
|
||||||
@@ -25,20 +25,77 @@ const [Form] = useVbenForm({
|
|||||||
layout: 'horizontal',
|
layout: 'horizontal',
|
||||||
schema: useFormSchema().map((item) => ({ ...item, label: '' })), // 去除label
|
schema: useFormSchema().map((item) => ({ ...item, label: '' })), // 去除label
|
||||||
showDefaultActions: false,
|
showDefaultActions: false,
|
||||||
handleValuesChange: (values) => {
|
});
|
||||||
if (isEmpty(values)) {
|
|
||||||
|
const [Modal, modalApi] = useVbenModal({
|
||||||
|
async onConfirm() {
|
||||||
|
const { valid } = await formApi.validate();
|
||||||
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 上传成功关闭 modal
|
modalApi.lock();
|
||||||
modalApi.close();
|
// 提交表单
|
||||||
|
const data = await formApi.getValues();
|
||||||
|
try {
|
||||||
|
await useUpload().httpRequest(data.file);
|
||||||
|
// 关闭并提示
|
||||||
|
await modalApi.close();
|
||||||
emit('success');
|
emit('success');
|
||||||
|
ElMessage.success($t('ui.actionMessage.operationSuccess'));
|
||||||
|
} finally {
|
||||||
|
modalApi.unlock();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** 文件变化处理 */
|
||||||
|
function handleChange(uploadFile: UploadFile) {
|
||||||
|
if (uploadFile.raw) {
|
||||||
|
formApi.setFieldValue('file', uploadFile.raw);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 文件数量超出限制 */
|
||||||
|
function handleExceed() {
|
||||||
|
ElMessage.warning('最多只能上传一个文件!');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 上传前校验:不自动上传,仅保存文件 */
|
||||||
|
function beforeUpload(_rawFile: UploadRawFile) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- TODO @puhui999:这个看看怎么和 antd 的 file/modules/form.vue 【UI】保持一致一点哈。 -->
|
<Modal title="上传图片">
|
||||||
<Modal title="上传文件">
|
<Form class="mx-4">
|
||||||
<Form class="mx-4" />
|
<template #file>
|
||||||
|
<div class="w-full">
|
||||||
|
<ElUpload
|
||||||
|
:auto-upload="false"
|
||||||
|
:limit="1"
|
||||||
|
:on-change="handleChange"
|
||||||
|
:on-exceed="handleExceed"
|
||||||
|
:before-upload="beforeUpload"
|
||||||
|
accept=".jpg,.png,.gif,.webp"
|
||||||
|
drag
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="flex min-h-[200px] flex-col items-center justify-center py-8"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="icon-[mdi--cloud-upload-outline] mb-4 text-6xl text-gray-400"
|
||||||
|
></span>
|
||||||
|
<div class="text-base text-gray-600">
|
||||||
|
点击或拖拽文件到此区域上传
|
||||||
|
</div>
|
||||||
|
<div class="mt-2 text-sm text-gray-400">
|
||||||
|
支持 .jpg、.png、.gif、.webp 格式图片文件
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ElUpload>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import MemberTerminalCard from './modules/terminal-card.vue';
|
|||||||
defineOptions({ name: 'MemberStatistics' });
|
defineOptions({ name: 'MemberStatistics' });
|
||||||
|
|
||||||
const loading = ref(true); // 加载中
|
const loading = ref(true); // 加载中
|
||||||
const summary = ref<MallMemberStatisticsApi.Summary>(); // 会员统计数据
|
const summary = ref<MallMemberStatisticsApi.SummaryRespVO>(); // 会员统计数据
|
||||||
|
|
||||||
/** 查询会员统计 */
|
/** 查询会员统计 */
|
||||||
async function loadMemberSummary() {
|
async function loadMemberSummary() {
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ import { getAreaChartOptions, getAreaTableColumns } from './area-chart-options';
|
|||||||
defineOptions({ name: 'MemberAreaCard' });
|
defineOptions({ name: 'MemberAreaCard' });
|
||||||
|
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const areaStatisticsList = shallowRef<MallMemberStatisticsApi.AreaStatistics[]>(
|
const areaStatisticsList = shallowRef<
|
||||||
[],
|
MallMemberStatisticsApi.AreaStatisticsRespVO[]
|
||||||
);
|
>([]);
|
||||||
const chartRef = ref<EchartsUIType>();
|
const chartRef = ref<EchartsUIType>();
|
||||||
const { renderEcharts } = useEcharts(chartRef);
|
const { renderEcharts } = useEcharts(chartRef);
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ async function loadMemberAreaStatisticsList() {
|
|||||||
try {
|
try {
|
||||||
const list = await getMemberAreaStatisticsList();
|
const list = await getMemberAreaStatisticsList();
|
||||||
areaStatisticsList.value = list.map(
|
areaStatisticsList.value = list.map(
|
||||||
(item: MallMemberStatisticsApi.AreaStatistics) => ({
|
(item: MallMemberStatisticsApi.AreaStatisticsRespVO) => ({
|
||||||
...item,
|
...item,
|
||||||
areaName: areaReplace(item.areaName),
|
areaName: areaReplace(item.areaName),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { fenToYuan } from '@vben/utils';
|
|||||||
|
|
||||||
/** 会员地域分布图表配置 */
|
/** 会员地域分布图表配置 */
|
||||||
export function getAreaChartOptions(
|
export function getAreaChartOptions(
|
||||||
data: MallMemberStatisticsApi.AreaStatistics[],
|
data: MallMemberStatisticsApi.AreaStatisticsRespVO[],
|
||||||
): any {
|
): any {
|
||||||
if (!data || data.length === 0) {
|
if (!data || data.length === 0) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ async function loadMemberSexStatisticsList() {
|
|||||||
dictDataList.push({ label: '未知', value: null } as any);
|
dictDataList.push({ label: '未知', value: null } as any);
|
||||||
const chartData = dictDataList.map((dictData: any) => {
|
const chartData = dictDataList.map((dictData: any) => {
|
||||||
const userCount = list.find(
|
const userCount = list.find(
|
||||||
(item: MallMemberStatisticsApi.SexStatistics) =>
|
(item: MallMemberStatisticsApi.SexStatisticsRespVO) =>
|
||||||
item.sex === dictData.value,
|
item.sex === dictData.value,
|
||||||
)?.userCount;
|
)?.userCount;
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ defineOptions({ name: 'ProductSummaryCard' });
|
|||||||
const trendLoading = ref(true); // 商品状态加载中
|
const trendLoading = ref(true); // 商品状态加载中
|
||||||
const exportLoading = ref(false); // 导出的加载中
|
const exportLoading = ref(false); // 导出的加载中
|
||||||
const trendSummary =
|
const trendSummary =
|
||||||
ref<DataComparisonRespVO<MallProductStatisticsApi.ProductStatistics>>(); // 商品状况统计数据
|
ref<DataComparisonRespVO<MallProductStatisticsApi.ProductStatisticsRespVO>>(); // 商品状况统计数据
|
||||||
const searchTimes = ref<string[]>([]);
|
const searchTimes = ref<string[]>([]);
|
||||||
|
|
||||||
const chartRef = ref<EchartsUIType>();
|
const chartRef = ref<EchartsUIType>();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ defineOptions({ name: 'TradeStatistics' });
|
|||||||
|
|
||||||
const loading = ref(true); // 加载中
|
const loading = ref(true); // 加载中
|
||||||
const summary =
|
const summary =
|
||||||
ref<DataComparisonRespVO<MallTradeStatisticsApi.TradeSummary>>(); // 交易统计数据
|
ref<DataComparisonRespVO<MallTradeStatisticsApi.TradeSummaryRespVO>>(); // 交易统计数据
|
||||||
|
|
||||||
/** 计算环比百分比 */
|
/** 计算环比百分比 */
|
||||||
function calculateRelativeRate(value?: number, reference?: number): string {
|
function calculateRelativeRate(value?: number, reference?: number): string {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ defineOptions({ name: 'TradeTrendCard' });
|
|||||||
const trendLoading = ref(true); // 交易状态加载中
|
const trendLoading = ref(true); // 交易状态加载中
|
||||||
const exportLoading = ref(false); // 导出的加载中
|
const exportLoading = ref(false); // 导出的加载中
|
||||||
const trendSummary =
|
const trendSummary =
|
||||||
ref<DataComparisonRespVO<MallTradeStatisticsApi.TradeTrendSummary>>(); // 交易状况统计数据
|
ref<DataComparisonRespVO<MallTradeStatisticsApi.TradeTrendSummaryRespVO>>(); // 交易状况统计数据
|
||||||
const searchTimes = ref<string[]>([]);
|
const searchTimes = ref<string[]>([]);
|
||||||
|
|
||||||
const chartRef = ref<EchartsUIType>();
|
const chartRef = ref<EchartsUIType>();
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { fenToYuan } from '@vben/utils';
|
|||||||
|
|
||||||
/** 交易趋势折线图配置 */
|
/** 交易趋势折线图配置 */
|
||||||
export function getTradeTrendChartOptions(
|
export function getTradeTrendChartOptions(
|
||||||
data: MallTradeStatisticsApi.TradeTrendSummary[],
|
data: MallTradeStatisticsApi.TradeTrendSummaryRespVO[],
|
||||||
): any {
|
): any {
|
||||||
// 处理数据:将分转换为元
|
// 处理数据:将分转换为元
|
||||||
const processedData = data.map((item) => ({
|
const processedData = data.map((item) => ({
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
// 提交表单
|
// 提交表单
|
||||||
try {
|
try {
|
||||||
const data =
|
const data =
|
||||||
(await formApi.getValues()) as MallAfterSaleApi.DisagreeRequest;
|
(await formApi.getValues()) as MallAfterSaleApi.AfterSaleDisagreeReqVO;
|
||||||
await disagreeAfterSale(data);
|
await disagreeAfterSale(data);
|
||||||
// 关闭并提示
|
// 关闭并提示
|
||||||
await modalApi.close();
|
await modalApi.close();
|
||||||
|
|||||||
@@ -32,13 +32,15 @@ function handleCreate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 编辑快递模板 */
|
/** 编辑快递模板 */
|
||||||
function handleEdit(row: MallDeliveryExpressTemplateApi.ExpressTemplate) {
|
function handleEdit(
|
||||||
|
row: MallDeliveryExpressTemplateApi.DeliveryExpressTemplate,
|
||||||
|
) {
|
||||||
formModalApi.setData(row).open();
|
formModalApi.setData(row).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除快递模板 */
|
/** 删除快递模板 */
|
||||||
async function handleDelete(
|
async function handleDelete(
|
||||||
row: MallDeliveryExpressTemplateApi.ExpressTemplate,
|
row: MallDeliveryExpressTemplateApi.DeliveryExpressTemplate,
|
||||||
) {
|
) {
|
||||||
const loadingInstance = ElLoading.service({
|
const loadingInstance = ElLoading.service({
|
||||||
text: $t('ui.actionMessage.deleting', [row.name]),
|
text: $t('ui.actionMessage.deleting', [row.name]),
|
||||||
@@ -79,7 +81,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
refresh: true,
|
refresh: true,
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<MallDeliveryExpressTemplateApi.ExpressTemplate>,
|
} as VxeTableGridOptions<MallDeliveryExpressTemplateApi.DeliveryExpressTemplate>,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
|||||||
import { CHARGE_MODE_TITLE_MAP, useChargesColumns } from '../data';
|
import { CHARGE_MODE_TITLE_MAP, useChargesColumns } from '../data';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
items?: MallDeliveryExpressTemplateApi.TemplateCharge[];
|
items?: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateCharge[];
|
||||||
chargeMode?: number;
|
chargeMode?: number;
|
||||||
areaTree?: SystemAreaApi.Area[];
|
areaTree?: SystemAreaApi.Area[];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import ChargeItemForm from './charge-item-form.vue';
|
|||||||
import FreeItemForm from './free-item-form.vue';
|
import FreeItemForm from './free-item-form.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
const formData = ref<MallDeliveryExpressTemplateApi.ExpressTemplate>();
|
const formData = ref<MallDeliveryExpressTemplateApi.DeliveryExpressTemplate>();
|
||||||
const chargeItemFormRef = ref<InstanceType<typeof ChargeItemForm>>();
|
const chargeItemFormRef = ref<InstanceType<typeof ChargeItemForm>>();
|
||||||
const freeItemFormRef = ref<InstanceType<typeof FreeItemForm>>();
|
const freeItemFormRef = ref<InstanceType<typeof FreeItemForm>>();
|
||||||
const areaTree = ref<SystemAreaApi.Area[]>([]);
|
const areaTree = ref<SystemAreaApi.Area[]>([]);
|
||||||
@@ -55,10 +55,10 @@ const [Form, formApi] = useVbenForm({
|
|||||||
|
|
||||||
/** 更新运费设置 */
|
/** 更新运费设置 */
|
||||||
const handleUpdateCharges = async (
|
const handleUpdateCharges = async (
|
||||||
charges: MallDeliveryExpressTemplateApi.TemplateCharge[],
|
charges: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateCharge[],
|
||||||
) => {
|
) => {
|
||||||
formData.value =
|
formData.value =
|
||||||
await formApi.getValues<MallDeliveryExpressTemplateApi.ExpressTemplate>();
|
await formApi.getValues<MallDeliveryExpressTemplateApi.DeliveryExpressTemplate>();
|
||||||
formData.value.charges = charges;
|
formData.value.charges = charges;
|
||||||
await formApi.setValues({
|
await formApi.setValues({
|
||||||
charges,
|
charges,
|
||||||
@@ -67,10 +67,10 @@ const handleUpdateCharges = async (
|
|||||||
|
|
||||||
/** 更新包邮设置 */
|
/** 更新包邮设置 */
|
||||||
const handleUpdateFrees = async (
|
const handleUpdateFrees = async (
|
||||||
frees: MallDeliveryExpressTemplateApi.TemplateFree[],
|
frees: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateFree[],
|
||||||
) => {
|
) => {
|
||||||
formData.value =
|
formData.value =
|
||||||
await formApi.getValues<MallDeliveryExpressTemplateApi.ExpressTemplate>();
|
await formApi.getValues<MallDeliveryExpressTemplateApi.DeliveryExpressTemplate>();
|
||||||
formData.value.frees = frees;
|
formData.value.frees = frees;
|
||||||
await formApi.setValues({
|
await formApi.setValues({
|
||||||
frees,
|
frees,
|
||||||
@@ -102,17 +102,19 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
// 提交表单
|
// 提交表单
|
||||||
const data = cloneDeep(
|
const data = cloneDeep(
|
||||||
await formApi.getValues(),
|
await formApi.getValues(),
|
||||||
) as MallDeliveryExpressTemplateApi.ExpressTemplate;
|
) as MallDeliveryExpressTemplateApi.DeliveryExpressTemplate;
|
||||||
try {
|
try {
|
||||||
// 转换金额单位
|
// 转换金额单位
|
||||||
data.charges?.forEach(
|
data.charges?.forEach(
|
||||||
(item: MallDeliveryExpressTemplateApi.TemplateCharge) => {
|
(
|
||||||
|
item: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateCharge,
|
||||||
|
) => {
|
||||||
item.startPrice = yuanToFen(item.startPrice);
|
item.startPrice = yuanToFen(item.startPrice);
|
||||||
item.extraPrice = yuanToFen(item.extraPrice);
|
item.extraPrice = yuanToFen(item.extraPrice);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
data.frees?.forEach(
|
data.frees?.forEach(
|
||||||
(item: MallDeliveryExpressTemplateApi.TemplateFree) => {
|
(item: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateFree) => {
|
||||||
item.freePrice = yuanToFen(item.freePrice);
|
item.freePrice = yuanToFen(item.freePrice);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -134,7 +136,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
}
|
}
|
||||||
// 加载数据
|
// 加载数据
|
||||||
const data =
|
const data =
|
||||||
modalApi.getData<MallDeliveryExpressTemplateApi.ExpressTemplate>();
|
modalApi.getData<MallDeliveryExpressTemplateApi.DeliveryExpressTemplate>();
|
||||||
if (!data || !data.id) {
|
if (!data || !data.id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -143,13 +145,15 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
formData.value = await getDeliveryExpressTemplate(data.id);
|
formData.value = await getDeliveryExpressTemplate(data.id);
|
||||||
// 转换金额单位
|
// 转换金额单位
|
||||||
formData.value.charges?.forEach(
|
formData.value.charges?.forEach(
|
||||||
(item: MallDeliveryExpressTemplateApi.TemplateCharge) => {
|
(
|
||||||
|
item: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateCharge,
|
||||||
|
) => {
|
||||||
item.startPrice = Number.parseFloat(fenToYuan(item.startPrice));
|
item.startPrice = Number.parseFloat(fenToYuan(item.startPrice));
|
||||||
item.extraPrice = Number.parseFloat(fenToYuan(item.extraPrice));
|
item.extraPrice = Number.parseFloat(fenToYuan(item.extraPrice));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
formData.value.frees?.forEach(
|
formData.value.frees?.forEach(
|
||||||
(item: MallDeliveryExpressTemplateApi.TemplateFree) => {
|
(item: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateFree) => {
|
||||||
item.freePrice = Number.parseFloat(fenToYuan(item.freePrice));
|
item.freePrice = Number.parseFloat(fenToYuan(item.freePrice));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
|||||||
import { FREE_MODE_TITLE_MAP, useFreesColumns } from '../data';
|
import { FREE_MODE_TITLE_MAP, useFreesColumns } from '../data';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
items?: MallDeliveryExpressTemplateApi.TemplateFree[];
|
items?: MallDeliveryExpressTemplateApi.DeliveryExpressTemplateFree[];
|
||||||
chargeMode?: number;
|
chargeMode?: number;
|
||||||
areaTree?: SystemAreaApi.Area[];
|
areaTree?: SystemAreaApi.Area[];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,17 +38,19 @@ function handleCreate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 编辑门店 */
|
/** 编辑门店 */
|
||||||
function handleEdit(row: MallDeliveryPickUpStoreApi.PickUpStore) {
|
function handleEdit(row: MallDeliveryPickUpStoreApi.DeliveryPickUpStore) {
|
||||||
formModalApi.setData(row).open();
|
formModalApi.setData(row).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 绑定店员 */
|
/** 绑定店员 */
|
||||||
function handleBind(row: MallDeliveryPickUpStoreApi.PickUpStore) {
|
function handleBind(row: MallDeliveryPickUpStoreApi.DeliveryPickUpStore) {
|
||||||
bindFormModalApi.setData(row).open();
|
bindFormModalApi.setData(row).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除门店 */
|
/** 删除门店 */
|
||||||
async function handleDelete(row: MallDeliveryPickUpStoreApi.PickUpStore) {
|
async function handleDelete(
|
||||||
|
row: MallDeliveryPickUpStoreApi.DeliveryPickUpStore,
|
||||||
|
) {
|
||||||
const loadingInstance = ElLoading.service({
|
const loadingInstance = ElLoading.service({
|
||||||
text: $t('ui.actionMessage.deleting', [row.name]),
|
text: $t('ui.actionMessage.deleting', [row.name]),
|
||||||
});
|
});
|
||||||
@@ -88,7 +90,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
refresh: true,
|
refresh: true,
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<MallDeliveryPickUpStoreApi.PickUpStore>,
|
} as VxeTableGridOptions<MallDeliveryPickUpStoreApi.DeliveryPickUpStore>,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { $t } from '#/locales';
|
|||||||
import { useBindFormSchema } from '../data';
|
import { useBindFormSchema } from '../data';
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
const formData = ref<MallDeliveryPickUpStoreApi.PickUpStore>();
|
const formData = ref<MallDeliveryPickUpStoreApi.DeliveryPickUpStore>();
|
||||||
|
|
||||||
const [Form, formApi] = useVbenForm({
|
const [Form, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { computed, ref } from 'vue';
|
|||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { ElButton, ElMessage } from 'element-plus';
|
import { ElButton, ElDialog, ElMessage } from 'element-plus';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { getTradeConfig } from '#/api/mall/trade/config';
|
import { getTradeConfig } from '#/api/mall/trade/config';
|
||||||
@@ -20,7 +20,7 @@ import { $t } from '#/locales';
|
|||||||
import { useFormSchema } from '../data';
|
import { useFormSchema } from '../data';
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
const formData = ref<MallDeliveryPickUpStoreApi.PickUpStore>();
|
const formData = ref<MallDeliveryPickUpStoreApi.DeliveryPickUpStore>();
|
||||||
const getTitle = computed(() => {
|
const getTitle = computed(() => {
|
||||||
return formData.value?.id
|
return formData.value?.id
|
||||||
? $t('ui.actionTitle.edit', ['门店'])
|
? $t('ui.actionTitle.edit', ['门店'])
|
||||||
@@ -94,7 +94,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
modalApi.lock();
|
modalApi.lock();
|
||||||
// 提交表单
|
// 提交表单
|
||||||
const data =
|
const data =
|
||||||
(await formApi.getValues()) as MallDeliveryPickUpStoreApi.PickUpStore;
|
(await formApi.getValues()) as MallDeliveryPickUpStoreApi.DeliveryPickUpStore;
|
||||||
try {
|
try {
|
||||||
await (formData.value?.id
|
await (formData.value?.id
|
||||||
? updateDeliveryPickUpStore(data)
|
? updateDeliveryPickUpStore(data)
|
||||||
@@ -113,7 +113,8 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 加载数据
|
// 加载数据
|
||||||
const data = modalApi.getData<MallDeliveryPickUpStoreApi.PickUpStore>();
|
const data =
|
||||||
|
modalApi.getData<MallDeliveryPickUpStoreApi.DeliveryPickUpStore>();
|
||||||
if (!data || !data.id) {
|
if (!data || !data.id) {
|
||||||
// 初始化地图
|
// 初始化地图
|
||||||
await initTencentLbsMap();
|
await initTencentLbsMap();
|
||||||
@@ -146,16 +147,11 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<!-- 地图弹窗 -->
|
<!-- 地图弹窗 -->
|
||||||
<el-dialog
|
<ElDialog v-model="mapVisible" title="获取经纬度" :width="800" :footer="null">
|
||||||
v-model="mapVisible"
|
|
||||||
title="获取经纬度"
|
|
||||||
:width="800"
|
|
||||||
:footer="null"
|
|
||||||
>
|
|
||||||
<iframe
|
<iframe
|
||||||
v-if="mapVisible && tencentLbsUrl"
|
v-if="mapVisible && tencentLbsUrl"
|
||||||
:src="tencentLbsUrl"
|
:src="tencentLbsUrl"
|
||||||
class="h-[600px] w-full border-0"
|
class="h-[600px] w-full border-0"
|
||||||
></iframe>
|
></iframe>
|
||||||
</el-dialog>
|
</ElDialog>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { getAreaTree } from '#/api/system/area';
|
|||||||
import { getRangePickerDefaultProps } from '#/utils';
|
import { getRangePickerDefaultProps } from '#/utils';
|
||||||
|
|
||||||
/** 关联数据 */
|
/** 关联数据 */
|
||||||
let pickUpStoreList: MallDeliveryPickUpStoreApi.PickUpStore[] = [];
|
let pickUpStoreList: MallDeliveryPickUpStoreApi.DeliveryPickUpStore[] = [];
|
||||||
getSimpleDeliveryPickUpStoreList().then((data) => {
|
getSimpleDeliveryPickUpStoreList().then((data) => {
|
||||||
pickUpStoreList = data;
|
pickUpStoreList = data;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -51,11 +51,11 @@ const orderId = ref(0);
|
|||||||
const order = ref<MallOrderApi.Order>({
|
const order = ref<MallOrderApi.Order>({
|
||||||
logs: [],
|
logs: [],
|
||||||
});
|
});
|
||||||
const deliveryExpressList = ref<MallDeliveryExpressApi.SimpleDeliveryExpress[]>(
|
const deliveryExpressList = ref<MallDeliveryExpressApi.DeliveryExpress[]>([]);
|
||||||
[],
|
|
||||||
);
|
|
||||||
const expressTrackList = ref<any[]>([]);
|
const expressTrackList = ref<any[]>([]);
|
||||||
const pickUpStore = ref<MallDeliveryPickUpStoreApi.PickUpStore | undefined>();
|
const pickUpStore = ref<
|
||||||
|
MallDeliveryPickUpStoreApi.DeliveryPickUpStore | undefined
|
||||||
|
>();
|
||||||
|
|
||||||
const [OrderInfoDescriptions] = useDescription({
|
const [OrderInfoDescriptions] = useDescription({
|
||||||
title: '订单信息',
|
title: '订单信息',
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
// 提交表单
|
// 提交表单
|
||||||
const data = await formApi.getValues();
|
const data = await formApi.getValues();
|
||||||
try {
|
try {
|
||||||
await updateOrderAddress(data as MallOrderApi.AddressRequest);
|
await updateOrderAddress(data as MallOrderApi.OrderUpdateAddressReqVO);
|
||||||
// 关闭并提示
|
// 关闭并提示
|
||||||
await modalApi.close();
|
await modalApi.close();
|
||||||
emit('success');
|
emit('success');
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
data.logisticsNo = '';
|
data.logisticsNo = '';
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await deliveryOrder(data as MallOrderApi.DeliveryRequest);
|
await deliveryOrder(data as MallOrderApi.OrderUpdateDeliveryReqVO);
|
||||||
// 关闭并提示
|
// 关闭并提示
|
||||||
await modalApi.close();
|
await modalApi.close();
|
||||||
emit('success');
|
emit('success');
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { useRemarkFormSchema } from '../data';
|
|||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
|
|
||||||
const formData = ref<MallOrderApi.DeliveryRequest>();
|
const formData = ref<MallOrderApi.OrderUpdateDeliveryReqVO>();
|
||||||
|
|
||||||
const [Form, formApi] = useVbenForm({
|
const [Form, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
@@ -38,7 +38,8 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
}
|
}
|
||||||
modalApi.lock();
|
modalApi.lock();
|
||||||
// 提交表单
|
// 提交表单
|
||||||
const data = (await formApi.getValues()) as MallOrderApi.RemarkRequest;
|
const data =
|
||||||
|
(await formApi.getValues()) as MallOrderApi.OrderUpdateRemarkReqVO;
|
||||||
try {
|
try {
|
||||||
await updateOrderRemark(data);
|
await updateOrderRemark(data);
|
||||||
// 关闭并提示
|
// 关闭并提示
|
||||||
|
|||||||
Reference in New Issue
Block a user