feat: 添加资金流水操作类型搜索条件下拉框

This commit is contained in:
2026-05-22 11:10:33 +08:00
parent b2d7073a63
commit b0b6c3055e
3 changed files with 33 additions and 6 deletions

View File

@ -3,4 +3,9 @@ import { request } from '@/api';
//获取资金明细列表 //获取资金明细列表
export const getFundDetailListApi = (params: any) => { export const getFundDetailListApi = (params: any) => {
return request.get('/user/FundFlowRecords', {...params}) return request.get('/user/FundFlowRecords', {...params})
}
//获取枚举字典选项
export const getEnumDicOptionsApi = () => {
return request.get('/user/getEnumDicOptions', {})
} }

View File

@ -28,7 +28,7 @@ import { usePageLoading } from '@/composables/useLoading'
// //
import { search, tableColumns } from './options' 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' import { getRecentSevenDays, utcToUtc8 } from '@/utils/handleTime.ts'
// //
@ -41,9 +41,24 @@ const searchOptions = ref(search)
const searchForm = ref({ const searchForm = ref({
username: '', username: '',
subAccountId: '', subAccountId: '',
type: '',
startTime: initTime.start, startTime: initTime.start,
endTime: initTime.end, 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() const { loading, startLoading, stopLoading } = usePageLoading()
/** /**
* @description: 定义表格数据 * @description: 定义表格数据
@ -77,6 +92,7 @@ const getFundDetailList = async () => {
: '2026-03-15 23:59:59', : '2026-03-15 23:59:59',
user_name: searchForm.value.username, user_name: searchForm.value.username,
account_id: searchForm.value.subAccountId, account_id: searchForm.value.subAccountId,
type: searchForm.value.type,
} }
// //
const data: any = await getFundDetailListApi(params) const data: any = await getFundDetailListApi(params)
@ -106,7 +122,8 @@ const getFundDetailList = async () => {
/** /**
* @description: 页面加载完成需要请求的数据 * @description: 页面加载完成需要请求的数据
*/ */
onMounted(() => { onMounted(async () => {
await getEnumDicOptions()
getFundDetailList() getFundDetailList()
}) })
/** /**
@ -119,6 +136,7 @@ const handleReset = () => {
searchForm.value = { searchForm.value = {
username: '', username: '',
subAccountId: '', subAccountId: '',
type: '',
startTime: initTime.start, startTime: initTime.start,
endTime: initTime.end, endTime: initTime.end,
} }

View File

@ -21,10 +21,14 @@ export const search = [
width: '220px', width: '220px',
}, },
//操作类型 //操作类型
// { prop: 'type', label: '操作类型', type: 'select' as const, placeholder: '请选择操作类型', width: '140px', options: [ {
// {label:"充值",value:"1"}, prop: 'type',
// {label:"提现",value:"2"}, label: '操作类型',
// ] }, type: 'select' as const,
placeholder: '请选择操作类型',
width: '140px',
options: []
},
//钱包 //钱包
// { prop: 'wallet', label: '钱包', type: 'select' as const, placeholder: '请选择钱包', width: '140px', options: [ // { prop: 'wallet', label: '钱包', type: 'select' as const, placeholder: '请选择钱包', width: '140px', options: [
// {label:"主钱包",value:"1"}, // {label:"主钱包",value:"1"},