|
|
@@ -1,6 +1,7 @@
|
|
|
import APP from '@/services';
|
|
|
import { commonSearch_go } from '../index';
|
|
|
import * as type from './interface';
|
|
|
+import { mergeObj } from '@/utils/objHandle'
|
|
|
/**
|
|
|
* 查询行情历史数据
|
|
|
* @param param QueryHistoryDatas
|
|
|
@@ -25,8 +26,19 @@ export function QueryHistoryTikDatas(param: type.QueryHistoryTikDatas): Promise<
|
|
|
* @returns QueryQuoteDay
|
|
|
*/
|
|
|
export function QueryQuoteDay(goodsCodes: string): Promise<string> {
|
|
|
- return commonSearch_go('/Quote/QueryQuoteDay', { goodsCodes }).then(res => {
|
|
|
- APP.set('quoteDayInfo', res)
|
|
|
+ return commonSearch_go('/Quote/QueryQuoteDay', { goodsCodes }).then((res: type.QueryQuoteDayRsp[]) => {
|
|
|
+ console.log('获取商品盘面信息', res)
|
|
|
+ const quoteDayInfo = APP.getRef('quoteDayInfo');
|
|
|
+
|
|
|
+ res.forEach((item) => {
|
|
|
+ const quote = quoteDayInfo.value.find((e: type.QueryQuoteDayRsp) => e.goodscode === item.goodscode);
|
|
|
+ if (quote) {
|
|
|
+ mergeObj(quote, item);
|
|
|
+ } else {
|
|
|
+ quoteDayInfo.value.push(item);
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
return 'ok'
|
|
|
}).catch(err => { throw new Error(`获取商品盘面信息失败:${err}`) })
|
|
|
}
|