正在加载图片
diff --git a/src/components/dense/RadarSingle.vue b/src/components/dense/RadarSingle.vue
index c0ed661..1cea481 100644
--- a/src/components/dense/RadarSingle.vue
+++ b/src/components/dense/RadarSingle.vue
@@ -48,7 +48,7 @@ const queryUrl = computed(() => {
const queryDay = `${selectedDate.value.slice(0, 4)}-${selectedDate.value.slice(4, 6)}-${selectedDate.value.slice(6, 8)}`
query.set('day', queryDay)
}
- else if (selectedDateType.value === 'month') {
+ if (selectedDateType.value === 'month') {
query.set('month', selectedMonth.value)
}
// const query = `?station=${station}&year=${year}&model_name=${mode}&wind_type=${windType}&H=${selectedH.value}`
@@ -65,7 +65,7 @@ onMounted(async () => {
const data = await resp.data.value
// use regex to extract the year from the path,
// ./radar/data\\武汉左岭镇站\\2017\\ZLT_MET01_DLL_L21_01D_20170316.txt
- const station_pattern = /data\/(.*?)\//
+ const station_pattern = /data\/radar\/(.*?)\//
const year_pattern = /(\d{4})\/ZLT_/
const date_pattern = /01D_(\d{8})\.txt/
const pairs = data.map((source_text: string) => {
diff --git a/src/components/dense/saber/utils.ts b/src/components/dense/saber/utils.ts
index 1a80d0b..af7e0f4 100644
--- a/src/components/dense/saber/utils.ts
+++ b/src/components/dense/saber/utils.ts
@@ -17,7 +17,7 @@ async function refreshCurrentSaberDays(path: string) {
currentSaberDays.value = data!
}
function renderPath(path: string) {
- const yearPattern = /\/data\/(\d{4})/
+ const yearPattern = /\/data\/saber\/(\d{4})/
const year = path.match(yearPattern)?.[1]
const monthPattern = /Temp_O3_(.*)(\d{4})/
const month_mapping = {
diff --git a/src/pages/balloon/single.vue b/src/pages/balloon/single.vue
index 750816f..1ac543b 100644
--- a/src/pages/balloon/single.vue
+++ b/src/pages/balloon/single.vue
@@ -53,6 +53,8 @@ const queryUrl = computed(() => {
return `${API_BASE_URL}/balloon/render/single?mode=${encodeURIComponent(selectedMode)}&path=${encodeURIComponent(selectedDate)}`
})
+const metadata = ref({} as Record
)
+
async function customHandle(resp: Response) {
if (resp.status === 204) {
const res: ImageResult = {
@@ -60,12 +62,15 @@ async function customHandle(resp: Response) {
result: 'error',
resourceId: '',
}
+ metadata.value = {}
return res
}
if (resp.status === 200) {
- const blob = await resp.blob()
+ const data = await resp.json()
+ const blob = await fetch(`data:image/png;base64,${data.image}`).then(r => r.blob())
const url = URL.createObjectURL(blob)
+ metadata.value = data.metadata
const res: ImageResult = {
message: '成功',
result: 'success',
@@ -83,6 +88,11 @@ async function customHandle(resp: Response) {
+
+
+ {{ k }}: {{ v }}
+
+
diff --git a/src/pages/tidi/month_stats.vue b/src/pages/tidi/month_stats.vue
index 66da552..2563877 100644
--- a/src/pages/tidi/month_stats.vue
+++ b/src/pages/tidi/month_stats.vue
@@ -29,7 +29,7 @@ const queryUrl = computed(() => {
onMounted(async () => {
const resp = await baseFetch(`/tidi/metadata`).json()
allYears.value = Array.from(new Set(resp.data.value.path.map((a: string) => {
- const year_pattern = /data\/(\d{4})\//
+ const year_pattern = /data\/tidi\/(\d{4})\//
return a.match(year_pattern)?.[1]
})))
})
diff --git a/src/pages/tidi/waves.vue b/src/pages/tidi/waves.vue
index f6eaeba..3571768 100644
--- a/src/pages/tidi/waves.vue
+++ b/src/pages/tidi/waves.vue
@@ -34,7 +34,7 @@ const queryUrl = computed(() => {
onMounted(async () => {
const metas = await baseFetch<{ path: string [] }>(`${API_BASE_URL}/tidi/metadata`).json()
const _years = metas.data.value.path.map((a: string) => {
- const year_pattern = /data\/(\d{4})\//
+ const year_pattern = /data\/tidi\/(\d{4})\//
return a.match(year_pattern)?.[1]
})
_years.sort()