refactor(card-c-trip-info): 重构携程卡相关组件和接口
- 更新导入的接口类型,确保类型定义正确 - 修改组件名称,使其与业务场景更贴切 - 更新 UI 文案,将沃尔玛相关文本替换为携程 - 调整订单列表获取接口和相关参数
This commit is contained in:
@@ -97,8 +97,8 @@ import { ref, PropType, watch, reactive } from 'vue';
|
||||
import { isNull } from '@/utils/is.ts';
|
||||
import { notification } from './component.tsx';
|
||||
import {
|
||||
type KamiApiCardInfoCTripV1AccountCreateReq,
|
||||
KamiApiCardInfoWalmartV1AccountListRecord
|
||||
KamiApiCardInfoCTripV1AccountListRecord,
|
||||
type KamiApiCardInfoCTripV1AccountCreateReq
|
||||
} from '@/api/generated/index.ts';
|
||||
import { apiClient } from '@/api';
|
||||
|
||||
@@ -112,9 +112,7 @@ const props = defineProps({
|
||||
default: ''
|
||||
},
|
||||
account: {
|
||||
type: Object as PropType<
|
||||
Required<KamiApiCardInfoWalmartV1AccountListRecord>
|
||||
>,
|
||||
type: Object as PropType<Required<KamiApiCardInfoCTripV1AccountListRecord>>,
|
||||
default: null
|
||||
}
|
||||
});
|
||||
|
||||
@@ -150,7 +150,7 @@ const downloadDataList = async () => {
|
||||
};
|
||||
|
||||
export const batchImportModel = defineComponent({
|
||||
name: 'batchImportWalmartAccountModel',
|
||||
name: 'batchImportCtripAccountModel',
|
||||
emits: {
|
||||
close: () => {}
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<Breadcrumb :items="['充值账户管理', '沃尔玛Cookie']" />
|
||||
<a-card class="general-card" title="沃尔玛Cookie管理">
|
||||
<Breadcrumb :items="['充值账户管理', '携程Cookie']" />
|
||||
<a-card class="general-card" title="携程Cookie管理">
|
||||
<a-row>
|
||||
<a-col :flex="1">
|
||||
<a-form
|
||||
@@ -25,10 +25,10 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item field="nickname" label="沃尔玛昵称">
|
||||
<a-form-item field="nickname" label="携程昵称">
|
||||
<a-input
|
||||
v-model="formModel.nickname"
|
||||
placeholder="请输入沃尔玛账户昵称"
|
||||
placeholder="请输入携程账户昵称"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -340,7 +340,7 @@ const deleteOne = async (id: string) => {
|
||||
} catch {
|
||||
Notification.error({
|
||||
id: 'walmartAccountNotice',
|
||||
content: '删除沃尔玛卡失败',
|
||||
content: '删除携程卡失败',
|
||||
closable: true
|
||||
});
|
||||
} finally {
|
||||
@@ -410,7 +410,7 @@ onMounted(() => {
|
||||
});
|
||||
const download = () => {
|
||||
apiClient.apiCardInfoCTripAccountDownloadGet().then(res => {
|
||||
handleDownLoadFile(res.data as any, '沃尔玛卡列表.xlsx');
|
||||
handleDownLoadFile(res.data as any, '携程卡列表.xlsx');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -174,10 +174,9 @@ import config from './components/config.tsx';
|
||||
import OrderHistory from './components/history.vue';
|
||||
import { checkTokenFromIframe } from '@/utils/auth';
|
||||
import {
|
||||
queryWalmartCardOrderList,
|
||||
walmartCardOrderParams
|
||||
} from '@/api/card-walmart-order.ts';
|
||||
import { KamiInternalModelEntityV1CardRedeemOrderInfo } from '@/api/generated/index.ts';
|
||||
ApiCardInfoCTripOrderListGetPageSizeEnum,
|
||||
KamiInternalModelEntityV1CardRedeemOrderInfo
|
||||
} from '@/api/generated/index.ts';
|
||||
import { apiClient } from '@/api/index.ts';
|
||||
|
||||
const basePagination: Pagination = {
|
||||
@@ -287,7 +286,7 @@ const formModel = ref<{
|
||||
}>(generateFormModel());
|
||||
|
||||
const fetchData = async (
|
||||
params: walmartCardOrderParams = {
|
||||
params: Pagination = {
|
||||
current: 1,
|
||||
pageSize: 50
|
||||
}
|
||||
@@ -296,7 +295,10 @@ const fetchData = async (
|
||||
try {
|
||||
const {
|
||||
data: { list, total }
|
||||
} = await queryWalmartCardOrderList(params);
|
||||
} = await apiClient.apiCardInfoCTripOrderListGet(
|
||||
params.current,
|
||||
params.pageSize as ApiCardInfoCTripOrderListGetPageSizeEnum
|
||||
);
|
||||
renderData.value = list;
|
||||
pagination.current = params.current;
|
||||
pagination.pageSize = params.pageSize;
|
||||
@@ -384,7 +386,7 @@ onMounted(() => {
|
||||
});
|
||||
const callback = async (orderNo: string) => {
|
||||
try {
|
||||
await apiClient.apiCardInfoWalmartOrderCallbackGet(orderNo);
|
||||
await apiClient.apiCardInfoCTripOrderCallbackGet(orderNo);
|
||||
Notification.success({
|
||||
title: '成功',
|
||||
content: '等待回调'
|
||||
|
||||
Reference in New Issue
Block a user