style(api): 更新 API 生成代码
- 将 tslint 替换为 eslint - 更新文件头部注释 - 添加空行以提高代码可读性
This commit is contained in:
@@ -60,6 +60,12 @@ export interface KamiInternalModelEntityV1MerchantHiddenRecord {
|
||||
* @memberof KamiInternalModelEntityV1MerchantHiddenRecord
|
||||
*/
|
||||
strategy?: number;
|
||||
/**
|
||||
* 延迟时间
|
||||
* @type {number}
|
||||
* @memberof KamiInternalModelEntityV1MerchantHiddenRecord
|
||||
*/
|
||||
delayDuration?: number;
|
||||
/**
|
||||
* 状态 1.成功 2.失败 3.准备开始
|
||||
* @type {number}
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
{{ isNull(props.rule) || props.rule.id === 0 ? '新增' : '编辑' }}规则
|
||||
</template>
|
||||
<a-form ref="formDataRef" :model="formData">
|
||||
<a-form-item field="name" label="名称" required>
|
||||
<a-input v-model="formData.name" />
|
||||
</a-form-item>
|
||||
<a-form-item field="roadUid" label="通道" required>
|
||||
<a-select v-model="formData.roadUid">
|
||||
<a-option
|
||||
@@ -36,13 +39,26 @@
|
||||
<a-form-item field="faceAmount" label="面额(元)" required>
|
||||
<a-input-number v-model="formData.faceAmount" />
|
||||
</a-form-item>
|
||||
<a-form-item field="delayDuration" label="延迟时间(秒)" required>
|
||||
<a-input-number v-model="formData.delayDuration" />
|
||||
<a-form-item field="amountRule" label="金额规则" required>
|
||||
<a-input-tag v-model="formData.amountRule" />
|
||||
</a-form-item>
|
||||
<a-form-item field="delayDurationMin" label="延迟时间(秒)" required>
|
||||
<a-space>
|
||||
<a-input-number
|
||||
v-model="formData.delayDurationMin"
|
||||
placeholder="最小延迟时间"
|
||||
/>
|
||||
<a-input-number
|
||||
v-model="formData.delayDurationMax"
|
||||
placeholder="最大延迟时间"
|
||||
/>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
<a-form-item field="strategy" label="策略" required>
|
||||
<a-select v-model="formData.strategy">
|
||||
<a-option :value="1" label="策略1:创建空白订单" />
|
||||
<a-option :value="2" label="策略2:创建延迟订单" />
|
||||
<a-option :value="3" label="策略3:随机" />
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item field="enable" label="是否启用" required>
|
||||
@@ -59,6 +75,9 @@
|
||||
</template>
|
||||
</a-switch>
|
||||
</a-form-item>
|
||||
<a-form-item field="extraReturnInfo" label="销卡信息">
|
||||
<a-input v-model="formData.extraReturnInfo" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
@@ -67,7 +86,7 @@
|
||||
import { apiClient } from '@/api';
|
||||
import {
|
||||
KamiApiMerchantV1StealCreateReq,
|
||||
KamiInternalModelEntityV1MerchantHiddenConfig,
|
||||
KamiApiMerchantV1MerchantHiddenConfigEntity,
|
||||
KamiApiRoadV1RoadSimpleInfo,
|
||||
KamiInternalModelEntityV1MerchantInfo
|
||||
} from '@/api/generated';
|
||||
@@ -79,7 +98,7 @@ import { onMounted, PropType, reactive, ref, watch } from 'vue';
|
||||
const props = defineProps({
|
||||
rule: {
|
||||
type: Object as PropType<
|
||||
Required<KamiInternalModelEntityV1MerchantHiddenConfig>
|
||||
Required<KamiApiMerchantV1MerchantHiddenConfigEntity>
|
||||
>,
|
||||
default: () => ({})
|
||||
}
|
||||
@@ -87,13 +106,17 @@ const props = defineProps({
|
||||
|
||||
const generateFormData = (): KamiApiMerchantV1StealCreateReq => {
|
||||
return {
|
||||
name: '',
|
||||
roadUid: null,
|
||||
merchantUid: null,
|
||||
amount: 0,
|
||||
faceAmount: 0,
|
||||
delayDuration: 0,
|
||||
delayDurationMin: 0,
|
||||
delayDurationMax: 0,
|
||||
enable: 0,
|
||||
strategy: null
|
||||
amountRule: [],
|
||||
strategy: null,
|
||||
extraReturnInfo: ''
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -52,6 +52,20 @@ const columns = [
|
||||
title: '偷卡金额(实际)',
|
||||
dataIndex: 'actualAmount'
|
||||
},
|
||||
{
|
||||
title: '规则',
|
||||
dataIndex: 'strategy',
|
||||
render: ({ record }) => {
|
||||
switch (record.strategy) {
|
||||
case 1:
|
||||
return '策略1:创建空白订单';
|
||||
case 2:
|
||||
return '策略2:创建延迟订单';
|
||||
default:
|
||||
return '未知';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
|
||||
@@ -96,10 +96,9 @@ import { apiClient } from '@/api';
|
||||
import {
|
||||
ApiMerchantConfigStealRuleListGetPageSizeEnum,
|
||||
KamiApiRoadV1RoadSimpleInfo,
|
||||
KamiInternalModelEntityV1MerchantHiddenConfig,
|
||||
KamiApiMerchantV1MerchantHiddenConfigEntity,
|
||||
KamiInternalModelEntityV1MerchantInfo
|
||||
} from '@/api/generated';
|
||||
import { number } from 'echarts';
|
||||
|
||||
const basePagination: Pagination = {
|
||||
current: 1,
|
||||
@@ -146,7 +145,9 @@ const columns: TableColumnData[] = [
|
||||
},
|
||||
{
|
||||
title: '延迟时间',
|
||||
dataIndex: 'delayDuration'
|
||||
render: ({ record }) => {
|
||||
return `${record.delayDurationMin}秒-${record.delayDurationMax}秒`;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '是否启用',
|
||||
@@ -177,13 +178,13 @@ const generateFormModel = () => {
|
||||
};
|
||||
};
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const renderData = ref<KamiInternalModelEntityV1MerchantHiddenConfig[]>([]);
|
||||
const renderData = ref<KamiApiMerchantV1MerchantHiddenConfigEntity[]>([]);
|
||||
const formModel = ref(generateFormModel());
|
||||
const state = reactive<{
|
||||
addModalVisible: boolean;
|
||||
deployModalVisible: boolean;
|
||||
accountDetailVisible: boolean;
|
||||
targetRule: Required<KamiInternalModelEntityV1MerchantHiddenConfig> | null;
|
||||
targetRule: Required<KamiApiMerchantV1MerchantHiddenConfigEntity> | null;
|
||||
switchValue: boolean;
|
||||
roadInfos: KamiApiRoadV1RoadSimpleInfo[];
|
||||
merchantInfos: KamiInternalModelEntityV1MerchantInfo[];
|
||||
@@ -232,7 +233,7 @@ const search = () => {
|
||||
};
|
||||
|
||||
const deleteAppleCardHandler = async (
|
||||
record: KamiInternalModelEntityV1MerchantHiddenConfig
|
||||
record: KamiApiMerchantV1MerchantHiddenConfigEntity
|
||||
) => {
|
||||
try {
|
||||
await apiClient.apiMerchantConfigStealRuleUpdateDelete(record.id);
|
||||
@@ -248,7 +249,7 @@ const deleteAppleCardHandler = async (
|
||||
};
|
||||
|
||||
const showAddModel = (
|
||||
record: Required<KamiInternalModelEntityV1MerchantHiddenConfig>
|
||||
record: Required<KamiApiMerchantV1MerchantHiddenConfigEntity>
|
||||
) => {
|
||||
state.addModalVisible = true;
|
||||
state.targetRule = record;
|
||||
@@ -302,7 +303,7 @@ watch(
|
||||
);
|
||||
|
||||
const setAppleCardStealRuleEnable = async (
|
||||
record: KamiInternalModelEntityV1MerchantHiddenConfig,
|
||||
record: KamiApiMerchantV1MerchantHiddenConfigEntity,
|
||||
enable: string | number | boolean
|
||||
) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user