feat: 添加下载 接口

This commit is contained in:
danial
2025-04-27 20:38:35 +08:00
parent c2cd419492
commit 23a76fad85
8 changed files with 383 additions and 7 deletions

View File

@@ -1,2 +1,2 @@
VITE_API_BASE_URL= 'http://127.0.0.1:12401'
# VITE_API_BASE_URL='http://partial2.kkknametrans.buzz'
# VITE_API_BASE_URL= 'http://127.0.0.1:12401'
VITE_API_BASE_URL='https://partial.kkknametrans.buzz'

View File

@@ -193,6 +193,7 @@ models/kami-api-card-info-walmart-v1-group-update-req.ts
models/kami-api-card-info-walmart-v1-list-req.ts
models/kami-api-card-info-walmart-v1-list-res.ts
models/kami-api-card-info-walmart-v1-order-callback-req.ts
models/kami-api-card-info-walmart-v1-order-export-req.ts
models/kami-api-card-info-walmart-v1-order-history-req.ts
models/kami-api-card-info-walmart-v1-order-history-res.ts
models/kami-api-card-info-walmart-v1-order-status-reset-req.ts

View File

@@ -5848,6 +5848,107 @@ export const DefaultApiAxiosParamCreator = function (
options: localVarRequestOptions
};
},
/**
*
* @summary 导出
* @param {number} current 页数
* @param {ApiCardInfoWalmartOrderExportGetPageSizeEnum} pageSize 页码
* @param {string} [giftCardPwd] 礼品卡密码
* @param {string} [merchantId] 商户ID
* @param {string} [attach] 附加信息
* @param {string} [accountNickName] 账户昵称
* @param {number} [groupId] 组ID
* @param {string} [accountCk] 账户cookie
* @param {Array<string>} [dateRange] 时间范围
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiCardInfoWalmartOrderExportGet: async (
current: number,
pageSize: ApiCardInfoWalmartOrderExportGetPageSizeEnum,
giftCardPwd?: string,
merchantId?: string,
attach?: string,
accountNickName?: string,
groupId?: number,
accountCk?: string,
dateRange?: Array<string>,
options: RawAxiosRequestConfig = {}
): Promise<RequestArgs> => {
// verify required parameter 'current' is not null or undefined
assertParamExists('apiCardInfoWalmartOrderExportGet', 'current', current);
// verify required parameter 'pageSize' is not null or undefined
assertParamExists(
'apiCardInfoWalmartOrderExportGet',
'pageSize',
pageSize
);
const localVarPath = `/api/cardInfo/walmart/order/export`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = {
method: 'GET',
...baseOptions,
...options
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (current !== undefined) {
localVarQueryParameter['current'] = current;
}
if (pageSize !== undefined) {
localVarQueryParameter['pageSize'] = pageSize;
}
if (giftCardPwd !== undefined) {
localVarQueryParameter['giftCardPwd'] = giftCardPwd;
}
if (merchantId !== undefined) {
localVarQueryParameter['merchantId'] = merchantId;
}
if (attach !== undefined) {
localVarQueryParameter['attach'] = attach;
}
if (accountNickName !== undefined) {
localVarQueryParameter['accountNickName'] = accountNickName;
}
if (groupId !== undefined) {
localVarQueryParameter['groupId'] = groupId;
}
if (accountCk !== undefined) {
localVarQueryParameter['accountCk'] = accountCk;
}
if (dateRange) {
localVarQueryParameter['dateRange'] = dateRange;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions
};
},
/**
*
* @summary 获取充值记录列表
@@ -13887,6 +13988,61 @@ export const DefaultApiFp = function (configuration?: Configuration) {
configuration
)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary 导出
* @param {number} current 页数
* @param {ApiCardInfoWalmartOrderExportGetPageSizeEnum} pageSize 页码
* @param {string} [giftCardPwd] 礼品卡密码
* @param {string} [merchantId] 商户ID
* @param {string} [attach] 附加信息
* @param {string} [accountNickName] 账户昵称
* @param {number} [groupId] 组ID
* @param {string} [accountCk] 账户cookie
* @param {Array<string>} [dateRange] 时间范围
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiCardInfoWalmartOrderExportGet(
current: number,
pageSize: ApiCardInfoWalmartOrderExportGetPageSizeEnum,
giftCardPwd?: string,
merchantId?: string,
attach?: string,
accountNickName?: string,
groupId?: number,
accountCk?: string,
dateRange?: Array<string>,
options?: RawAxiosRequestConfig
): Promise<
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>
> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.apiCardInfoWalmartOrderExportGet(
current,
pageSize,
giftCardPwd,
merchantId,
attach,
accountNickName,
groupId,
accountCk,
dateRange,
options
);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath =
operationServerMap['DefaultApi.apiCardInfoWalmartOrderExportGet']?.[
localVarOperationServerIndex
]?.url;
return (axios, basePath) =>
createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary 获取充值记录列表
@@ -18815,6 +18971,48 @@ export const DefaultApiFactory = function (
.apiCardInfoWalmartOrderCallbackGet(orderNo, options)
.then(request => request(axios, basePath));
},
/**
*
* @summary 导出
* @param {number} current 页数
* @param {ApiCardInfoWalmartOrderExportGetPageSizeEnum} pageSize 页码
* @param {string} [giftCardPwd] 礼品卡密码
* @param {string} [merchantId] 商户ID
* @param {string} [attach] 附加信息
* @param {string} [accountNickName] 账户昵称
* @param {number} [groupId] 组ID
* @param {string} [accountCk] 账户cookie
* @param {Array<string>} [dateRange] 时间范围
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiCardInfoWalmartOrderExportGet(
current: number,
pageSize: ApiCardInfoWalmartOrderExportGetPageSizeEnum,
giftCardPwd?: string,
merchantId?: string,
attach?: string,
accountNickName?: string,
groupId?: number,
accountCk?: string,
dateRange?: Array<string>,
options?: RawAxiosRequestConfig
): AxiosPromise<object> {
return localVarFp
.apiCardInfoWalmartOrderExportGet(
current,
pageSize,
giftCardPwd,
merchantId,
attach,
accountNickName,
groupId,
accountCk,
dateRange,
options
)
.then(request => request(axios, basePath));
},
/**
*
* @summary 获取充值记录列表
@@ -22519,6 +22717,50 @@ export class DefaultApi extends BaseAPI {
.then(request => request(this.axios, this.basePath));
}
/**
*
* @summary 导出
* @param {number} current 页数
* @param {ApiCardInfoWalmartOrderExportGetPageSizeEnum} pageSize 页码
* @param {string} [giftCardPwd] 礼品卡密码
* @param {string} [merchantId] 商户ID
* @param {string} [attach] 附加信息
* @param {string} [accountNickName] 账户昵称
* @param {number} [groupId] 组ID
* @param {string} [accountCk] 账户cookie
* @param {Array<string>} [dateRange] 时间范围
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DefaultApi
*/
public apiCardInfoWalmartOrderExportGet(
current: number,
pageSize: ApiCardInfoWalmartOrderExportGetPageSizeEnum,
giftCardPwd?: string,
merchantId?: string,
attach?: string,
accountNickName?: string,
groupId?: number,
accountCk?: string,
dateRange?: Array<string>,
options?: RawAxiosRequestConfig
) {
return DefaultApiFp(this.configuration)
.apiCardInfoWalmartOrderExportGet(
current,
pageSize,
giftCardPwd,
merchantId,
attach,
accountNickName,
groupId,
accountCk,
dateRange,
options
)
.then(request => request(this.axios, this.basePath));
}
/**
*
* @summary 获取充值记录列表
@@ -24445,6 +24687,19 @@ export type ApiCardInfoWalmartGroupStatGetPageSizeEnum =
/**
* @export
*/
export const ApiCardInfoWalmartOrderExportGetPageSizeEnum = {
NUMBER_5: 5,
NUMBER_10: 10,
NUMBER_15: 15,
NUMBER_20: 20,
NUMBER_50: 50,
NUMBER_100: 100
} as const;
export type ApiCardInfoWalmartOrderExportGetPageSizeEnum =
(typeof ApiCardInfoWalmartOrderExportGetPageSizeEnum)[keyof typeof ApiCardInfoWalmartOrderExportGetPageSizeEnum];
/**
* @export
*/
export const ApiCardInfoWalmartOrderListGetPageSizeEnum = {
NUMBER_5: 5,
NUMBER_10: 10,

View File

@@ -181,6 +181,7 @@ export * from './kami-api-card-info-walmart-v1-group-update-req';
export * from './kami-api-card-info-walmart-v1-list-req';
export * from './kami-api-card-info-walmart-v1-list-res';
export * from './kami-api-card-info-walmart-v1-order-callback-req';
export * from './kami-api-card-info-walmart-v1-order-export-req';
export * from './kami-api-card-info-walmart-v1-order-history-req';
export * from './kami-api-card-info-walmart-v1-order-history-res';
export * from './kami-api-card-info-walmart-v1-order-status-reset-req';

View File

@@ -0,0 +1,87 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface KamiApiCardInfoWalmartV1OrderExportReq
*/
export interface KamiApiCardInfoWalmartV1OrderExportReq {
/**
* 页数
* @type {number}
* @memberof KamiApiCardInfoWalmartV1OrderExportReq
*/
current: number;
/**
* 页码
* @type {number}
* @memberof KamiApiCardInfoWalmartV1OrderExportReq
*/
pageSize: KamiApiCardInfoWalmartV1OrderExportReqPageSizeEnum;
/**
* 礼品卡密码
* @type {string}
* @memberof KamiApiCardInfoWalmartV1OrderExportReq
*/
giftCardPwd?: string;
/**
* 商户ID
* @type {string}
* @memberof KamiApiCardInfoWalmartV1OrderExportReq
*/
merchantId?: string;
/**
* 附加信息
* @type {string}
* @memberof KamiApiCardInfoWalmartV1OrderExportReq
*/
attach?: string;
/**
* 账户昵称
* @type {string}
* @memberof KamiApiCardInfoWalmartV1OrderExportReq
*/
accountNickName?: string;
/**
* 组ID
* @type {number}
* @memberof KamiApiCardInfoWalmartV1OrderExportReq
*/
groupId?: number;
/**
* 账户cookie
* @type {string}
* @memberof KamiApiCardInfoWalmartV1OrderExportReq
*/
accountCk?: string;
/**
* 时间范围
* @type {Array<string>}
* @memberof KamiApiCardInfoWalmartV1OrderExportReq
*/
dateRange?: Array<string>;
}
export const KamiApiCardInfoWalmartV1OrderExportReqPageSizeEnum = {
NUMBER_5: 5,
NUMBER_10: 10,
NUMBER_15: 15,
NUMBER_20: 20,
NUMBER_50: 50,
NUMBER_100: 100
} as const;
export type KamiApiCardInfoWalmartV1OrderExportReqPageSizeEnum =
(typeof KamiApiCardInfoWalmartV1OrderExportReqPageSizeEnum)[keyof typeof KamiApiCardInfoWalmartV1OrderExportReqPageSizeEnum];

View File

@@ -428,16 +428,19 @@ const showAddModel = (record: walmartCardUpdateRecord) => {
state.account.groupId = null;
}
};
const showDetailModel = (record: walmartCardUpdateRecord) => {
state.accountDetailVisible = true;
state.accountId = record.id;
};
watchEffect(() => {
// 目标账户和存储用户不能相同
if (!state.addModalVisible) {
search();
}
});
const updateCurrentStatus = async (
record: walmartCardUpdateRecord,
newValue: string | number | boolean

View File

@@ -63,24 +63,26 @@ export default defineComponent({
{
title: '分组名称',
dataIndex: 'groupName',
render(data) {
return data.groupName || '未分组';
render({ record }) {
console.log(record.groupName);
return record.groupName || '未分组';
}
},
{
title: '账户情况',
render(data) {
dataIndex: 'account',
render({ record }) {
return (
<>
<span>
<Tag color='green' size='small'>
{data.account.normal}
{record.account.normal || 0}
</Tag>
<br />
<Tag color='red' size='small'>
{data.account.unnormal}
{record.account.unNormal || 0}
</Tag>
</span>
</>

View File

@@ -76,6 +76,14 @@
重置
</a-button>
</a-space>
<a-space direction="horizontal" :size="18">
<a-button type="primary" @click="exportData">
<template #icon>
<icon-download />
</template>
导出
</a-button>
</a-space>
</a-space>
</a-col>
</a-row>
@@ -207,6 +215,7 @@ import {
KamiInternalModelEntityV1CardRedeemOrderInfo
} from '@/api/generated/index.ts';
import { apiClient } from '@/api/index.ts';
import { handleDownLoadFile } from '@/api/utils.ts';
const basePagination: Pagination = {
current: 1,
@@ -455,4 +464,22 @@ const onChangeRadio = (value: string | number | boolean) => {
onMounted(() => {
getAllGroupList();
});
const exportData = () => {
apiClient
.apiCardInfoWalmartOrderExportGet(
pagination.current,
pagination.pageSize as ApiCardInfoWalmartOrderListGetPageSizeEnum,
formModel.value.giftCardPwd,
formModel.value.merchantId,
formModel.value.attach,
formModel.value.accountNickName,
formModel.value.groupId,
formModel.value.accountCk,
formModel.value.dateRange
)
.then(res => {
handleDownLoadFile(res.data as Blob, '沃尔玛账号下载数据.xlsx');
});
};
</script>