From ccdf3b458ff37294bbcbc2e380113f34548132f2 Mon Sep 17 00:00:00 2001 From: wenlong Date: Sun, 18 Aug 2024 11:48:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=82=E5=86=B5=E6=B1=87=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 2 + src/api/daikin/base.ts | 9 +- src/router/index.ts | 1 + src/types/auto-import.d.ts | 1 - src/views/home/Home.vue | 25 +- src/views/home/{Home.vue.bak => Home.vue-b} | 0 src/views/home/cd/CD.vue | 10 +- src/views/home/cd/chartData.ts | 32 ++- src/views/home/market/MarketData-new.ts | 288 ++++++++++++++++++-- src/views/home/market/Market_new.vue | 151 +++++++--- 10 files changed, 437 insertions(+), 82 deletions(-) rename src/views/home/{Home.vue.bak => Home.vue-b} (100%) diff --git a/components.d.ts b/components.d.ts index 0ffb117..f5452d0 100644 --- a/components.d.ts +++ b/components.d.ts @@ -33,8 +33,10 @@ declare module 'vue' { ElOption: typeof import('element-plus/es')['ElOption'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm'] + ElPopover: typeof import('element-plus/es')['ElPopover'] ElProgress: typeof import('element-plus/es')['ElProgress'] ElRadio: typeof import('element-plus/es')['ElRadio'] + ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] diff --git a/src/api/daikin/base.ts b/src/api/daikin/base.ts index 8b84f05..7898e98 100755 --- a/src/api/daikin/base.ts +++ b/src/api/daikin/base.ts @@ -1459,9 +1459,14 @@ export async function fetchExchangeInfo(params?: any) { // 获取分时数据 --沪铜主连 export async function fetchTimeFuturecenterCu(params?: any) { - return http.get(`/marketPre/getTimeFuturecenter/cu0000`, { params }) + return http.get(`/marketPre/getTimeFuturecenter/${params.type}`) } // 获取分时数据 --沪铜主连 export async function fetchTimeFuturecenterAl(params?: any) { - return http.get(`/marketPre/getTimeFuturecenter/al0000`, { params }) + return http.get(`/marketPre/getTimeFuturecenter/${params.type}`) +} + +// 获取SMM/LEM 更新时间 +export async function fetchMarketUpdateTime(params?: any) { + return http.get(`/marketPre/getLastTime`, { params }) } diff --git a/src/router/index.ts b/src/router/index.ts index 52301fc..a612c34 100755 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -261,6 +261,7 @@ const router = createRouter({ path: '', name: 'Market', component: () => import('@/views/home/market/Market_new.vue') + // component: () => import('@/views/home/market/Market.vue') }, { path: 'MarketDataModify', diff --git a/src/types/auto-import.d.ts b/src/types/auto-import.d.ts index 64ff13c..c313e4d 100755 --- a/src/types/auto-import.d.ts +++ b/src/types/auto-import.d.ts @@ -5,7 +5,6 @@ export {} declare global { const EffectScope: typeof import('vue')['EffectScope'] - const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] const asyncComputed: typeof import('@vueuse/core')['asyncComputed'] const autoResetRef: typeof import('@vueuse/core')['autoResetRef'] const computed: typeof import('vue')['computed'] diff --git a/src/views/home/Home.vue b/src/views/home/Home.vue index 44dc417..4e894c0 100755 --- a/src/views/home/Home.vue +++ b/src/views/home/Home.vue @@ -12,7 +12,8 @@ import { getHomeList, amountList, fetchHomeSmmExInfo, - fetchExchangeInfo + fetchExchangeInfo, + fetchMarketUpdateTime } from '@/api/daikin/base' import { useUserStore } from '@/stores/modules/user' import { groupBy } from 'lodash-es' @@ -262,7 +263,7 @@ function formatNumber(num = 0) { return `${wholePart}.${formattedDecimalPart}` } -const homeSmmExInfo = ref({}) +const homeSmmExInfo = ref({铜:[],铝:[]}) async function getHomeSmmExInfo() { const { data } = await fetchHomeSmmExInfo() console.log("🚀 ~ file: Home.vue:268 ~ data:", groupBy(data,'instrumentName')) @@ -275,6 +276,14 @@ async function getHomeExInfo() { homeExchangeInfo.value = data console.log('🚀 ~ file: Home.vue:252 ~ }):', data) } + +getLastTime() +const updateTime = ref({}) +async function getLastTime() { + const { data } = await fetchMarketUpdateTime() + // homeExchangeInfo.value = data + updateTime.value = data +}