From 1e46cf6e631b8e55f7c339151b355e1f9dd6e990 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Mon, 21 Apr 2025 15:04:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=A2=E6=9C=8D:=20=E4=B8=89?= =?UTF-8?q?=E5=B3=A1=E6=B8=B8=E8=88=B9:=20=E4=BA=BA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/HotelCruise.js | 2 +- src/views/Cruise.jsx | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/stores/HotelCruise.js b/src/stores/HotelCruise.js index 76b2b05..567f981 100644 --- a/src/stores/HotelCruise.js +++ b/src/stores/HotelCruise.js @@ -90,6 +90,7 @@ class HotelCruise { : (res || []).map((ele) => ({ ...ele, TotalNumPercent: ele.CPTotalNum ? fixTo2Decimals(((ele.TotalNum - ele.CPTotalNum) / ele.CPTotalNum) * 100) : '-', + TotalPersonNumPercent: ele.CPTotalPersonNum ? fixTo2Decimals(((ele.TotalPersonNum - ele.CPTotalPersonNum) / ele.CPTotalPersonNum) * 100) : '-', TotalProfitPercent: ele.CPTotalProfit ? fixTo2Decimals(((ele.TotalProfit - ele.CPTotalProfit) / ele.CPTotalProfit) * 100) : '-', })); runInAction(() => { @@ -120,7 +121,6 @@ class HotelCruise { RecommendRateDelta: fixTo2Decimals((ele.RecommendRate - (ele.CPRecommendRate || 0)) * 100), CPRecommendRate_100: fixTo2Decimals(ele.CPRecommendRate * 100) + '%', })); - console.log(resCP); runInAction(() => { this.hotel.loading = false; this.hotel.dataSource = resCP; diff --git a/src/views/Cruise.jsx b/src/views/Cruise.jsx index 589c79d..679f5d9 100644 --- a/src/views/Cruise.jsx +++ b/src/views/Cruise.jsx @@ -38,7 +38,19 @@ export default observer((props) => { ), }, - { title: '人数', dataIndex: 'TotalPersonNum', key: 'TotalPersonNum' }, + { title: '人数', dataIndex: 'TotalPersonNum', key: 'TotalPersonNum', + sorter: (a, b) => tableSorter(a, b, 'TotalPersonNum'), + render: (v, r) => ( + <> + + + {v} + {r.CPTotalPersonNum && VS {r.CPTotalPersonNum}} + + {r.CPTotalNum && } + + + ),}, { title: '总利润', dataIndex: 'TotalProfit', key: 'TotalProfit', sorter: (a, b) => tableSorter(a, b, 'TotalProfit'), render: (v, r) => (