|
|
@@ -43,7 +43,7 @@
|
|
|
<script lang="ts" setup>
|
|
|
|
|
|
import { computed, onUnmounted, PropType } from 'vue'
|
|
|
-import { parsePercent, handleNumberValue } from '@/filters'
|
|
|
+import { parsePercent, handleNumberValue, formatDecimal } from '@/filters'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { queryQuoteGoodsList } from '@/services/api/swap'
|
|
|
@@ -84,23 +84,23 @@ const { dataList } = useRequest(queryQuoteGoodsList, {
|
|
|
const tableList = computed(() => {
|
|
|
return dataList.value.map((item) => {
|
|
|
const quote = futuresStore.getGoodsQuote(item.goodscode)
|
|
|
- const { lastColor, openedColor, lowestColor, highestColor, last, presettle, rise, change, amplitude, highest, lowest, opened, ask, bid, bidColor, askColor } = quote.value ?? {}
|
|
|
+ const { lastColor, openedColor, lowestColor, highestColor, last = 0, presettle = 0, rise = 0, change, amplitude, highest = 0, lowest = 0, opened = 0, ask = 0, bid = 0, bidColor, askColor, decimalplace } = quote.value ?? {}
|
|
|
return {
|
|
|
...item,
|
|
|
lastColor,
|
|
|
openedColor,
|
|
|
lowestColor,
|
|
|
highestColor,
|
|
|
- last: handleNumberValue(last),
|
|
|
- rise: handleNumberValue(rise?.toFixed(item.decimalplace)),
|
|
|
+ last: handleNumberValue(formatDecimal(last, decimalplace)),
|
|
|
+ rise: handleNumberValue(formatDecimal(rise, decimalplace)),
|
|
|
change: parsePercent(change),
|
|
|
- opened: handleNumberValue(opened),
|
|
|
- presettle: handleNumberValue(presettle),
|
|
|
- lowest: handleNumberValue(lowest),
|
|
|
- highest: handleNumberValue(highest),
|
|
|
+ opened: handleNumberValue(formatDecimal(opened, decimalplace)),
|
|
|
+ presettle: handleNumberValue(formatDecimal(presettle, decimalplace)),
|
|
|
+ lowest: handleNumberValue(formatDecimal(lowest, decimalplace)),
|
|
|
+ highest: handleNumberValue(formatDecimal(highest, decimalplace)),
|
|
|
amplitude: parsePercent(amplitude),
|
|
|
- ask: handleNumberValue(ask),
|
|
|
- bid: handleNumberValue(bid),
|
|
|
+ ask: handleNumberValue(formatDecimal(ask, decimalplace)),
|
|
|
+ bid: handleNumberValue(formatDecimal(bid, decimalplace)),
|
|
|
bidColor,
|
|
|
askColor
|
|
|
}
|