|
@@ -69,8 +69,11 @@ export function getBuyOrSellMarketPrice(record: QueryTjmdTradeOrderDetailRsp, se
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 价格排序
|
|
// 价格排序
|
|
|
-export function sortPirce(arr: QueryTjmdTradeOrderDetailRsp[], selectedRow: RefGoodsList) {
|
|
|
|
|
- return arr.sort((a, b) => getBuyOrSellMarketPrice(b, selectedRow) - getBuyOrSellMarketPrice(a, selectedRow))
|
|
|
|
|
|
|
+// true: 升序,false: 倒序
|
|
|
|
|
+export function sortPirce(arr: QueryTjmdTradeOrderDetailRsp[], selectedRow: RefGoodsList, isUp = true) {
|
|
|
|
|
+ return arr.sort((a, b) => {
|
|
|
|
|
+ return isUp ? getBuyOrSellMarketPrice(a, selectedRow) - getBuyOrSellMarketPrice(b, selectedRow) : getBuyOrSellMarketPrice(b, selectedRow) - getBuyOrSellMarketPrice(a, selectedRow)
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 是否有浮动价
|
|
// 是否有浮动价
|