|
|
@@ -11,6 +11,7 @@ import { ref } from "vue"
|
|
|
import { RefGoodsList } from './interface'
|
|
|
|
|
|
const refGoods = ref<QueryQuoteGoodsListRsp[]>([])
|
|
|
+const allGoodsList = ref<RefGoodsList[]>([])
|
|
|
|
|
|
export function findItemGoods(goodscode: string) {
|
|
|
return refGoods.value.find(el => el.goodscode === goodscode)!
|
|
|
@@ -33,6 +34,7 @@ export const useSwapList = () => {
|
|
|
queryTable(queryQuoteGoodsList, param).then(res => {
|
|
|
refGoods.value = res
|
|
|
goodsList.value.length = 0
|
|
|
+ allGoodsList.value.length = 0
|
|
|
res.forEach(el => {
|
|
|
// 找到盘面数据
|
|
|
const quote = getQuoteDayInfoByCode(el.goodscode);
|
|
|
@@ -42,8 +44,10 @@ export const useSwapList = () => {
|
|
|
goodsname: el.goodsname, refgoodsname: el.refgoodsname
|
|
|
}
|
|
|
goodsList.value.push(result)
|
|
|
+ allGoodsList.value.push(result)
|
|
|
}
|
|
|
})
|
|
|
+ console.log(goodsList.value)
|
|
|
})
|
|
|
})
|
|
|
// 获取标记商品列表
|
|
|
@@ -56,13 +60,11 @@ export const useSwapList = () => {
|
|
|
}
|
|
|
// 过滤标的合约
|
|
|
function filterGoodsList(value: string) {
|
|
|
- const result = ref<RefGoodsList[]>([])
|
|
|
if (value === '全部标的合约') {
|
|
|
- result.value = goodsList.value
|
|
|
+ goodsList.value = allGoodsList.value
|
|
|
} else {
|
|
|
- result.value = goodsList.value.filter(goods => goods.refgoodsname === value)
|
|
|
+ goodsList.value = allGoodsList.value.filter(goods => goods.refgoodsname === value)
|
|
|
}
|
|
|
- return result
|
|
|
}
|
|
|
|
|
|
return { loading, goodsList, getRefGoodsList, filterGoodsList }
|