refactor(card): enhance type safety and add configuration option
- Improve type safety by using specific enum types for account status updates in Card C Trip Info and Card JD Info - Add redeemOrderScheduleStrategy configuration option in Card Walmart Info
This commit is contained in:
@@ -187,7 +187,8 @@ import { batchImportModel } from './components/component.tsx';
|
||||
import { apiClient } from '@/api';
|
||||
import {
|
||||
ApiCardInfoCTripAccountGetListGetPageSizeEnum,
|
||||
KamiApiCardInfoCTripV1AccountListRecord
|
||||
KamiApiCardInfoCTripV1AccountListRecord,
|
||||
KamiApiCardInfoCTripV1AccountUpdateStatusReqStatusEnum
|
||||
} from '@/api/generated';
|
||||
import { handleDownLoadFile } from '@/api/utils.ts';
|
||||
|
||||
@@ -370,7 +371,7 @@ const updateCurrentStatus = async (
|
||||
) => {
|
||||
await apiClient.apiCardInfoCTripAccountUpdateStatusPut({
|
||||
id: record.id,
|
||||
status: newValue as number
|
||||
status: newValue as KamiApiCardInfoCTripV1AccountUpdateStatusReqStatusEnum
|
||||
});
|
||||
record.status = newValue as number;
|
||||
};
|
||||
|
||||
@@ -186,7 +186,8 @@ import AccountDetail from './components/detail.vue';
|
||||
import { batchImportModel } from './components/component.tsx';
|
||||
import {
|
||||
ApiCardInfoJDCardAccountGetListGetPageSizeEnum,
|
||||
KamiApiCardInfoJdV1JDAccountListRecord
|
||||
KamiApiCardInfoJdV1JDAccountListRecord,
|
||||
KamiApiCardInfoJdV1JDAccountUpdateStatusReqStatusEnum
|
||||
} from '@/api/generated/index.ts';
|
||||
import { apiClient } from '@/api/index.ts';
|
||||
import { downloadDataList, JDCardParams } from '@/api/card-jd-account.ts';
|
||||
@@ -362,7 +363,7 @@ const updateCurrentStatus = async (
|
||||
) => {
|
||||
await apiClient.apiCardInfoJDCardAccountUpdateStatusPut({
|
||||
id: record.id,
|
||||
status: newValue as number
|
||||
status: newValue as KamiApiCardInfoJdV1JDAccountUpdateStatusReqStatusEnum
|
||||
});
|
||||
record.status = newValue as number;
|
||||
};
|
||||
|
||||
@@ -28,7 +28,8 @@ export default defineComponent({
|
||||
isAllowCompensatedCallback: true,
|
||||
redeemCardRate: 100,
|
||||
isCardAllowRepeated: false,
|
||||
maxAccountRedeemCount: 20
|
||||
maxAccountRedeemCount: 20,
|
||||
redeemOrderScheduleStrategy: 'normal'
|
||||
});
|
||||
const formRef = ref<FormInstance>();
|
||||
onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user