| | |
| | | .fetchProblemCountByArea(opt) |
| | | .then(async (res) => { |
| | | if (res.success) { |
| | | const data = res.data.sort((a, b) => b.ratio - a.ratio); |
| | | const data = res.data.sort((a, b) => b.proAvg - a.proAvg); |
| | | templateParam.townCount = data.length; |
| | | templateParam.topThree = |
| | | data |
| | | .slice(0, 3) |
| | | .map((item) => `${item.townName}(${item.ratio.toFixed(1)}个)`) |
| | | .map((item) => `${item.townName}(${item.proAvg.toFixed(1)}个)`) |
| | | .join('、') + '。'; |
| | | |
| | | const res2 = |
| | | await dataprodmiddleApi.fetchProblemCountByArea(compareOpt); |
| | | if (res2.success) { |
| | | const data2 = res2.data.sort((a, b) => b.ratio - a.ratio); |
| | | const data2 = res2.data.sort((a, b) => b.proAvg - a.proAvg); |
| | | const combineData = ProdProblemCountSummaryProxy.combineData( |
| | | data, |
| | | data2 |