修复支持分页查找-时间金额姓名三组参数联查-筛选

This commit is contained in:
WindowBird 2025-09-17 18:00:23 +08:00
parent 41cae0db07
commit e408fad84d
3 changed files with 36 additions and 13 deletions

View File

@ -76,18 +76,18 @@
<view <view
:class="[ :class="[
'custom-radio-button', 'custom-radio-button',
filter.orderTime === 'desc' ? 'checked' : '', filter.orderTime === 'asc' ? 'checked' : '',
]" ]"
@click="changeorderTime('desc')" @click="changeorderTime('asc')"
> >
由远及近 由远及近
</view> </view>
<view <view
:class="[ :class="[
'custom-radio-button', 'custom-radio-button',
filter.orderTime === 'asc' ? 'checked' : '', filter.orderTime === 'desc' ? 'checked' : '',
]" ]"
@click="changeorderTime('asc')" @click="changeorderTime('desc')"
> >
由近及远 由近及远
</view> </view>
@ -191,10 +191,10 @@ export default {
filter: { filter: {
minAmount: "", minAmount: "",
maxAmount: "", maxAmount: "",
orderAmount: "desc", orderAmount: "",
orderTime: "desc", orderTime: "",
sortAmount: "amount", sortAmount: "",
sortTime: "time", sortTime: "",
}, },
CommonEnum, CommonEnum,
@ -214,11 +214,18 @@ export default {
methods: { methods: {
changeorderAmount(order) { changeorderAmount(order) {
this.filter.orderAmount = order; this.filter.orderAmount = order;
this.filter.orderTime = "";
this.filter.sortTime = "";
this.filter.sortAmount = "amount";
console.log("当前选择的排序方式:", order); console.log("当前选择的排序方式:", order);
// //
}, },
changeorderTime(order) { changeorderTime(order) {
this.filter.orderTime = order; this.filter.orderTime = order;
this.filter.orderAmount = "";
this.filter.sortAmount = "";
this.filter.sortTime = "time";
console.log("当前选择的排序方式:", order); console.log("当前选择的排序方式:", order);
// //
}, },

View File

@ -37,6 +37,7 @@ export const dataManagerMixin = {
* @param {boolean} options.showError 是否显示错误提示 * @param {boolean} options.showError 是否显示错误提示
*/ */
async fetchData(options = {}) { async fetchData(options = {}) {
console.log("@@@@@@@@@@@@@@@@@", options);
const { const {
isLoadMore = false, isLoadMore = false,
apiCall, apiCall,
@ -72,7 +73,7 @@ export const dataManagerMixin = {
// 构建请求参数 // 构建请求参数
const requestParams = { const requestParams = {
...this.currentParams, // ...this.currentParams,
...params, ...params,
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: this.pageSize, pageSize: this.pageSize,
@ -187,6 +188,9 @@ export const dataManagerMixin = {
* @param {Object} options 配置选项 * @param {Object} options 配置选项
*/ */
searchData(searchParams = {}, options = {}) { searchData(searchParams = {}, options = {}) {
console.log("@@@@@@@@@@@", searchParams);
console.log("@@@@@@@@@@@", options);
return this.fetchData({ return this.fetchData({
// isLoadMore: false, // isLoadMore: false,

View File

@ -22,8 +22,8 @@ export const donationMixin = {
getBaseParams: { getBaseParams: {
minAmount: 0, minAmount: 0,
maxAmount: 10000, maxAmount: 10000,
sortAmount: "amount", // sortAmount: "amount",
orderAmount: "asc", // orderAmount: "asc",
sortTime: "time", sortTime: "time",
orderTime: "desc", orderTime: "desc",
}, },
@ -157,9 +157,20 @@ export const donationMixin = {
/** /**
* 筛选功能 * 筛选功能
*/ */
async filterSearch(params) {
this.getBaseParams = params;
//过滤空参数
filterEmptyParams(obj) {
return Object.keys(obj).reduce((acc, key) => {
if (obj[key] !== "") {
acc[key] = obj[key];
}
return acc;
}, {});
},
async filterSearch(params) {
this.getBaseParams = this.filterEmptyParams(params);
console.log("@@@@@@@@@@@@@@", this.getBaseParams);
console.log("this.searchKeyword", this.searchKeyword); console.log("this.searchKeyword", this.searchKeyword);
await this.searchData( await this.searchData(
@ -178,6 +189,7 @@ export const donationMixin = {
}, },
}, },
); );
this.show = false;
}, },
/** /**