diff --git a/pages/institutionalStructure/donationRecord.vue b/pages/institutionalStructure/donationRecord.vue index a32b480..62fa2ef 100644 --- a/pages/institutionalStructure/donationRecord.vue +++ b/pages/institutionalStructure/donationRecord.vue @@ -76,18 +76,18 @@ 由远及近 由近及远 @@ -191,10 +191,10 @@ export default { filter: { minAmount: "", maxAmount: "", - orderAmount: "desc", - orderTime: "desc", - sortAmount: "amount", - sortTime: "time", + orderAmount: "", + orderTime: "", + sortAmount: "", + sortTime: "", }, CommonEnum, @@ -214,11 +214,18 @@ export default { methods: { changeorderAmount(order) { this.filter.orderAmount = order; + + this.filter.orderTime = ""; + this.filter.sortTime = ""; + this.filter.sortAmount = "amount"; console.log("当前选择的排序方式:", order); // 触发排序操作 }, changeorderTime(order) { this.filter.orderTime = order; + this.filter.orderAmount = ""; + this.filter.sortAmount = ""; + this.filter.sortTime = "time"; console.log("当前选择的排序方式:", order); // 触发排序操作 }, diff --git a/pages/institutionalStructure/mixins/data-manager.js b/pages/institutionalStructure/mixins/data-manager.js index 69a22fe..a5c65b0 100644 --- a/pages/institutionalStructure/mixins/data-manager.js +++ b/pages/institutionalStructure/mixins/data-manager.js @@ -37,6 +37,7 @@ export const dataManagerMixin = { * @param {boolean} options.showError 是否显示错误提示 */ async fetchData(options = {}) { + console.log("@@@@@@@@@@@@@@@@@", options); const { isLoadMore = false, apiCall, @@ -72,7 +73,7 @@ export const dataManagerMixin = { // 构建请求参数 const requestParams = { - ...this.currentParams, + // ...this.currentParams, ...params, pageNum: this.pageNum, pageSize: this.pageSize, @@ -187,6 +188,9 @@ export const dataManagerMixin = { * @param {Object} options 配置选项 */ searchData(searchParams = {}, options = {}) { + console.log("@@@@@@@@@@@", searchParams); + console.log("@@@@@@@@@@@", options); + return this.fetchData({ // isLoadMore: false, diff --git a/pages/institutionalStructure/mixins/donation-mixin.js b/pages/institutionalStructure/mixins/donation-mixin.js index a83c6ad..1c2b1cd 100644 --- a/pages/institutionalStructure/mixins/donation-mixin.js +++ b/pages/institutionalStructure/mixins/donation-mixin.js @@ -22,8 +22,8 @@ export const donationMixin = { getBaseParams: { minAmount: 0, maxAmount: 10000, - sortAmount: "amount", - orderAmount: "asc", + // sortAmount: "amount", + // orderAmount: "asc", sortTime: "time", 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); await this.searchData( @@ -178,6 +189,7 @@ export const donationMixin = { }, }, ); + this.show = false; }, /**