From c878167dc9b740b1163d4f1080ab7d930239330c Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 10 Nov 2023 23:16:05 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E9=94=80=E5=94=AE>=E4=B8=9A=E7=BB=A9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE:=20=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/SaleStore.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/stores/SaleStore.js b/src/stores/SaleStore.js index 29a27b9..bba182c 100644 --- a/src/stores/SaleStore.js +++ b/src/stores/SaleStore.js @@ -265,7 +265,7 @@ class SaleStore { sorter: (a, b) => b.WXNewGuestCount - a.WXNewGuestCount, }, ]; - result.dataSource = json.result1; + result.dataSource = json.result1.sort(comm.sortBy('PriceTime')).reverse(); } else if (this.active_tab_key === 'ResponseRateWhatsApp') { result.columns = [ { @@ -341,7 +341,7 @@ class SaleStore { sorter: (a, b) => b.COLI_ConfirmTimeAVG - a.COLI_ConfirmTimeAVG, }, ]; - result.dataSource = json.result1; + result.dataSource = json.result1.sort(comm.sortBy('COLI_ConfirmTimeAVG')).reverse(); } else { const diffDateFlagYes = !comm.isEmpty(date_moment.start_date_cp); // if (this.active_tab_key == "Country") @@ -419,13 +419,17 @@ class SaleStore { vs: comm.fixTo2Decimals(((total_data_value-total_data_value_diff)/total_data_value_diff)*100)+'%', }; result.columns.push({ - title: item.SubTypeName, + title: item.SubTypeName, _val: total_data_value, children: [{ title: diffDateFlagYes ? comm.show_vs_tag(columnDiff.vs, columnDiff.diff, total_data_value, total_data_value_diff) : total_data_value, dataIndex: data_index }], sorter: (a, b) => b[`TV_${item.SubTypeSN}`] - a[`TV_${item.SubTypeSN}`], }); return item; }); - result.dataSource = type_data_arr; + result.columns = [].concat( + comm.cloneDeep(result.columns).slice(0, 2), + comm.cloneDeep(result.columns).slice(2).sort(comm.sortBy('_val')).reverse() + ); + result.dataSource = type_data_arr.sort(comm.sortBy('T_total')).reverse(); } } runInAction(() => {