fix
This commit is contained in:
@@ -109,6 +109,9 @@ function onUsernameChange() {
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
aiStore.fetchHeatmapData()
|
aiStore.fetchHeatmapData()
|
||||||
|
if (!aiStore.targetUsername) {
|
||||||
|
aiStore.fetchPinnedReport()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<template v-if="aiStore.pinnedReport">
|
<template v-if="aiStore.pinnedReport">
|
||||||
<MdPreview :model-value="aiStore.pinnedReport.analysis" />
|
<MdPreview :model-value="aiStore.pinnedReport.analysis" />
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else-if="!aiStore.loading.pinned">
|
||||||
<n-button
|
<n-button
|
||||||
v-if="!aiStore.mdContent && !aiStore.loading.ai"
|
v-if="!aiStore.mdContent && !aiStore.loading.ai"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -43,12 +43,6 @@ async function handleAnalyze() {
|
|||||||
}
|
}
|
||||||
await aiStore.fetchAIAnalysis()
|
await aiStore.fetchAIAnalysis()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
if (!aiStore.targetUsername) {
|
|
||||||
await aiStore.fetchPinnedReport()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.cool-title {
|
.cool-title {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export const useAIStore = defineStore("ai", () => {
|
|||||||
fetching: false, // 合并 details 和 duration 的 loading
|
fetching: false, // 合并 details 和 duration 的 loading
|
||||||
ai: false,
|
ai: false,
|
||||||
heatmap: false,
|
heatmap: false,
|
||||||
|
pinned: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
const mdContent = ref("")
|
const mdContent = ref("")
|
||||||
@@ -158,8 +159,13 @@ export const useAIStore = defineStore("ai", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function fetchPinnedReport() {
|
async function fetchPinnedReport() {
|
||||||
|
loading.pinned = true
|
||||||
|
try {
|
||||||
const res = await getAIPinnedReport()
|
const res = await getAIPinnedReport()
|
||||||
pinnedReport.value = res.data
|
pinnedReport.value = res.data
|
||||||
|
} finally {
|
||||||
|
loading.pinned = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user