修复前端无法编译的问题

This commit is contained in:
2026-03-27 13:04:02 +08:00
parent 1b8fadc0c9
commit d4a8f59fd8
7 changed files with 13 additions and 131 deletions
-1
View File
@@ -26,7 +26,6 @@ function handleToggle(event: MouseEvent) {
Math.max(y, innerHeight - y)
)
// @ts-expect-error: TypeScript 类型可能较旧,忽略 startViewTransition 报错
const transition = document.startViewTransition(() => {
themeStore.toggleTheme()
})
+7 -7
View File
@@ -88,8 +88,8 @@ const revisionChains = computed<RevisionChain[]>(() => {
// 组内按时间升序
items.sort((a, b) => safeParseTime(a.created_at) - safeParseTime(b.created_at))
const first = items[0]
const last = items[items.length - 1]
const first = items[0]!
const last = items[items.length - 1]!
// 拼接标题链,避免相邻记录重复
const titles: string[] = [first.previous_headline]
@@ -107,13 +107,13 @@ const revisionChains = computed<RevisionChain[]>(() => {
chains.push({
event_id,
source_name: first.source_name,
source_name: first.source_name!,
titles,
change_times,
first_at: first.created_at,
last_at: last.created_at,
first_at: first.created_at!,
last_at: last.created_at!,
change_count: items.length,
url: first.url,
url: first.url!,
})
}
@@ -242,7 +242,7 @@ onMounted(loadRevisions)
</span>
<p class="chain-title-text">{{ title }}</p>
<span v-if="idx < chain.change_times.length" class="chain-step-time">
{{ formatTime(chain.change_times[idx]) }}
{{ formatTime(chain.change_times[idx] ?? '') }}
</span>
</div>
<div v-if="idx < chain.titles.length - 1" class="chain-arrow">
+6 -5
View File
@@ -6,6 +6,7 @@ import { searchEventsTimeline } from '@/api/events'
import type { SearchTimelineResponse } from '@/types/event'
import UnifiedEventCard from '@/components/UnifiedEventCard.vue'
import CustomSelect from '@/components/CustomSelect.vue'
import type { ApexOptions } from 'apexcharts'
const keyword = ref('')
const searchResult = ref<SearchTimelineResponse | null>(null)
@@ -56,7 +57,7 @@ const filteredEvents = computed(() => {
})
// 热度时间线图表配置。
const chartOptions = ref({
const chartOptions = ref<ApexOptions>({
chart: {
type: 'area',
height: 350,
@@ -66,12 +67,12 @@ const chartOptions = ref({
},
animations: {
enabled: true,
easing: 'easeinout',
// easing: 'easeinout',
speed: 800,
},
// 点击图表数据点:切换选中时间,再次点击则取消筛选
events: {
markerClick: function(event: any, chartContext: any, { dataPointIndex }: any) {
markerClick: function(event: unknown, chartContext: unknown, { dataPointIndex }: never) {
if (searchResult.value && searchResult.value.timeline[dataPointIndex]) {
const clickedTime = searchResult.value.timeline[dataPointIndex].time_label
if (selectedTimeLabel.value === clickedTime) {
@@ -368,7 +369,7 @@ async function handleSearch() {
gap: 24px;
align-items: stretch;
position: relative;
z-index: 10;
z-index: 10;
}
.search-box {
@@ -378,7 +379,7 @@ async function handleSearch() {
flex-direction: column;
justify-content: center;
position: relative;
z-index: 2;
z-index: 2;
}
.tips-box {