Browse Source

排序

zhangrenyuan/feature-20260326164720-日常优化3.0
zhangrenyuan 3 weeks ago
parent
commit
40cf8eb0f4
  1. 52
      src/views/usergold/gold/clientCountWallet.vue

52
src/views/usergold/gold/clientCountWallet.vue

@ -82,6 +82,7 @@ const getObj = ref({
// //
const sortField = ref('') const sortField = ref('')
const sortOrder = ref('') const sortOrder = ref('')
const sortWalletId = ref('')
// //
// =========================================================================== // ===========================================================================
@ -120,6 +121,18 @@ const get = async function (val) {
params.market = String(selectData.value.markets[0]) params.market = String(selectData.value.markets[0])
} }
if (sortField.value) {
params.sortField = sortField.value
}
if (sortOrder.value) {
params.sortOrder = sortOrder.value
}
if (sortWalletId.value !== '') {
params.sortWalletId = sortWalletId.value
}
console.log('最终请求参数', params) console.log('最终请求参数', params)
const result = await API({ const result = await API({
@ -185,6 +198,7 @@ const reset = function () {
} }
sortField.value = '' sortField.value = ''
sortOrder.value = '' sortOrder.value = ''
sortWalletId.value = ''
selectedMarketPath.value = [] selectedMarketPath.value = []
// //
getObj.value.pageNum = 1 getObj.value.pageNum = 1
@ -297,10 +311,23 @@ const handleWalletDetailCurrentChange = (val) => {
const handleSortChange = (column) => { const handleSortChange = (column) => {
console.log('排序字段:', column.prop) console.log('排序字段:', column.prop)
console.log('排序方式:', column.order) console.log('排序方式:', column.order)
if (column.prop) {
sortField.value = column.prop.replace(/([A-Z])/g, "_$1").toLowerCase();
if (!column.prop || !column.order) {
sortField.value = ''
sortOrder.value = ''
sortWalletId.value = ''
getObj.value.pageNum = 1
get()
return
}
if (propToWalletId[column.prop]) {
sortField.value = 'currentPermanentGold'
sortWalletId.value = propToWalletId[column.prop]
} }
sortOrder.value = column.order === 'ascending' ? 'ASC' : 'DESC' sortOrder.value = column.order === 'ascending' ? 'ASC' : 'DESC'
getObj.value.pageNum = 1
get() get()
} }
@ -388,8 +415,7 @@ const exportExcelOnlyOne = async function () {
pageNum: 1, // pageNum: 1, //
pageSize: 10000, // pageSize: 10000, //
userWalletRecord: { userWalletRecord: {
// id1walletId2+1
walletId: selectWalletForm.value.companyWalletId + 1,
walletId: selectWalletForm.value.companyWalletId,
jwcode: selectData.value.jwcode ? Number(selectData.value.jwcode) : null jwcode: selectData.value.jwcode ? Number(selectData.value.jwcode) : null
} }
} }
@ -434,39 +460,39 @@ const closeSelectWallet = () => {
const selectWalletForm = ref({}) const selectWalletForm = ref({})
const companyWalletList = ref([ const companyWalletList = ref([
{ {
id: 1,
id: 2,
name: t('clientCount.market.hkGold') + t('clientCount.wallet') name: t('clientCount.market.hkGold') + t('clientCount.wallet')
}, },
{ {
id: 2,
id: 3,
name: t('clientCount.market.sgHcGold') name: t('clientCount.market.sgHcGold')
}, },
{ {
id: 3,
id: 4,
name: t('clientCount.market.myGold') name: t('clientCount.market.myGold')
}, },
{ {
id: 4,
id: 5,
name: t('clientCount.market.sgCmGold') name: t('clientCount.market.sgCmGold')
}, },
{ {
id: 5,
id: 6,
name: t('clientCount.market.caGold') name: t('clientCount.market.caGold')
}, },
{ {
id: 6,
id: 7,
name: t('clientCount.market.thHsGold') name: t('clientCount.market.thHsGold')
}, },
{ {
id: 7,
id: 8,
name: t('clientCount.market.thHaGold') name: t('clientCount.market.thHaGold')
}, },
{ {
id: 8,
id: 9,
name: t('clientCount.market.vnGold') name: t('clientCount.market.vnGold')
}, },
{ {
id: 9,
id: 10,
name: t('clientCount.market.bjGold') name: t('clientCount.market.bjGold')
} }
]) ])

Loading…
Cancel
Save