diff --git a/src/api/modules/funding/fundDetail.ts b/src/api/modules/funding/fundDetail.ts index bd83a59..2aeabee 100644 --- a/src/api/modules/funding/fundDetail.ts +++ b/src/api/modules/funding/fundDetail.ts @@ -3,4 +3,9 @@ import { request } from '@/api'; //获取资金明细列表 export const getFundDetailListApi = (params: any) => { return request.get('/user/FundFlowRecords', {...params}) +} + +//获取枚举字典选项 +export const getEnumDicOptionsApi = () => { + return request.get('/user/getEnumDicOptions', {}) } \ No newline at end of file diff --git a/src/views/capital/fundFlow/index.vue b/src/views/capital/fundFlow/index.vue index 6aa8dff..bba9063 100644 --- a/src/views/capital/fundFlow/index.vue +++ b/src/views/capital/fundFlow/index.vue @@ -28,7 +28,7 @@ import { usePageLoading } from '@/composables/useLoading' // 配置以及表单验证 import { search, tableColumns } from './options' // 接口 -import { getFundDetailListApi } from '@/api/modules/funding/fundDetail' +import { getFundDetailListApi, getEnumDicOptionsApi } from '@/api/modules/funding/fundDetail' import { getRecentSevenDays, utcToUtc8 } from '@/utils/handleTime.ts' // 导出表格 @@ -41,9 +41,24 @@ const searchOptions = ref(search) const searchForm = ref({ username: '', subAccountId: '', + type: '', startTime: initTime.start, endTime: initTime.end, }) + +/** + * @description: 获取操作类型枚举选项 + */ +const getEnumDicOptions = async () => { + const res: any = await getEnumDicOptionsApi() + const typeIndex = searchOptions.value.findIndex((item: any) => item.prop === 'type') + if (typeIndex !== -1 && res) { + searchOptions.value[typeIndex].options = res.map((item: any) => ({ + label: item.value, + value: item.id + })) + } +} const { loading, startLoading, stopLoading } = usePageLoading() /** * @description: 定义表格数据 @@ -77,6 +92,7 @@ const getFundDetailList = async () => { : '2026-03-15 23:59:59', user_name: searchForm.value.username, account_id: searchForm.value.subAccountId, + type: searchForm.value.type, } // 调用接口获取数据 const data: any = await getFundDetailListApi(params) @@ -106,7 +122,8 @@ const getFundDetailList = async () => { /** * @description: 页面加载完成需要请求的数据 */ -onMounted(() => { +onMounted(async () => { + await getEnumDicOptions() getFundDetailList() }) /** @@ -119,6 +136,7 @@ const handleReset = () => { searchForm.value = { username: '', subAccountId: '', + type: '', startTime: initTime.start, endTime: initTime.end, } diff --git a/src/views/capital/fundFlow/options.ts b/src/views/capital/fundFlow/options.ts index 2068a3e..a2b5aec 100644 --- a/src/views/capital/fundFlow/options.ts +++ b/src/views/capital/fundFlow/options.ts @@ -21,10 +21,14 @@ export const search = [ width: '220px', }, //操作类型 - // { prop: 'type', label: '操作类型', type: 'select' as const, placeholder: '请选择操作类型', width: '140px', options: [ - // {label:"充值",value:"1"}, - // {label:"提现",value:"2"}, - // ] }, + { + prop: 'type', + label: '操作类型', + type: 'select' as const, + placeholder: '请选择操作类型', + width: '140px', + options: [] + }, //钱包 // { prop: 'wallet', label: '钱包', type: 'select' as const, placeholder: '请选择钱包', width: '140px', options: [ // {label:"主钱包",value:"1"},