perf(加载): 排名、看板、班级 PK、智能分析第一次打开少下两百多 KB
这几页的 Markdown 只在点开抽屉 / 弹层、或 AI 报告出来时才用得上, 却连着整套代码高亮(CodeMirror 和三种语言的解析器)一起静态打进了页面。 改成用到才加载:排名 356→133KB、看板 380→157KB、PK 311→88KB、 智能分析 308→86KB(gzip 后)。 网站图标原来塞了 16 到 256 像素九张图共 192KB,只留标签页用得上的 16 到 48 像素四张(原图像素不变),17KB。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a814776fb9
commit
3bb74171c3
6 files changed
+15
-5
No files matched your search
@@ -3,7 +3,6 @@ import { Icon } from "@iconify/vue"
|
||||
import PageHeader from "admin/components/PageHeader.vue"
|
||||
import { useThemeVars } from "naive-ui"
|
||||
import { classLabel } from "oj/submission/utils"
|
||||
import Markdown from "shared/components/Markdown.vue"
|
||||
import { useBackClose } from "shared/composables/backClose"
|
||||
import { useBreakpoints } from "shared/composables/breakpoints"
|
||||
import Pagination from "shared/components/Pagination.vue"
|
||||
@@ -12,6 +11,9 @@ import { parseTime } from "utils/functions"
|
||||
import type { AdminAiReport, AdminAiReportListItem } from "utils/types"
|
||||
import { getAIReportDetail, getAIReportList, pinAIReport } from "../api"
|
||||
|
||||
// Markdown 连着整套代码高亮(两百多 KB),这里要等点开 / AI 写完才用得上,别让它拖慢页面
|
||||
const Markdown = defineAsyncComponent(() => import("shared/components/Markdown.vue"))
|
||||
|
||||
/**
|
||||
* 后台 AI 报告(设计稿「智能分析重设计」AiAdmin):左边一份一行(用户名、班级、时间、
|
||||
* 两行摘要),点哪份右边就是全文。原来是表格 + 弹框,看一份要点「查看」、关框、再点下一份。
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
import type { LearningPeriod } from "@oj2/contract"
|
||||
import { Icon } from "@iconify/vue"
|
||||
import { useThemeVars } from "naive-ui"
|
||||
import Markdown from "shared/components/Markdown.vue"
|
||||
import { parseTime } from "utils/functions"
|
||||
import { streamAI } from "utils/stream"
|
||||
import { getLatestAnalysis } from "../../api"
|
||||
|
||||
// Markdown 连着整套代码高亮(两百多 KB),这里要等点开 / AI 写完才用得上,别让它拖慢页面
|
||||
const Markdown = defineAsyncComponent(() => import("shared/components/Markdown.vue"))
|
||||
|
||||
/**
|
||||
* AI 小结。进来先拿这个时间段上次生成的那份(老师钉住的优先),没有才出按钮 ——
|
||||
* 一份小结要等十几秒、也要花钱,不在进页面时自动生成。
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { ClassBattleItem, ClassPk, ClassPkPeriod } from "@oj2/contract"
|
||||
import Markdown from "shared/components/Markdown.vue"
|
||||
import { useThemeVars } from "naive-ui"
|
||||
import { getClassBattle, getClassPk } from "oj/api"
|
||||
import { classLabel, groupClassOptions } from "oj/submission/utils"
|
||||
@@ -12,6 +11,9 @@ import PkGrid from "./components/PkGrid.vue"
|
||||
import PkRace from "./components/PkRace.vue"
|
||||
import { pkColor } from "./utils"
|
||||
|
||||
// Markdown 连着整套代码高亮(两百多 KB),这里要等点开 / AI 写完才用得上,别让它拖慢页面
|
||||
const Markdown = defineAsyncComponent(() => import("shared/components/Markdown.vue"))
|
||||
|
||||
/**
|
||||
* 班级 PK(设计稿「班级 PK 重设计」定稿)。用户定的:两个班按「同一批题」对决(B),
|
||||
* 三个班以上按题对照(C),学生也能看。原来的综合分、雷达图、十张柱状图、四分位数都去掉了。
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { isSqlProblem } from "@oj2/contract"
|
||||
import { getProblem } from "oj/api"
|
||||
import Markdown from "shared/components/Markdown.vue"
|
||||
import { errorMessage } from "utils/api"
|
||||
import type { ProblemDetail } from "utils/types"
|
||||
|
||||
// Markdown 连着整套代码高亮(两百多 KB),这里要等点开 / AI 写完才用得上,别让它拖慢页面
|
||||
const Markdown = defineAsyncComponent(() => import("shared/components/Markdown.vue"))
|
||||
|
||||
/**
|
||||
* 「讲错误」弹层左边的题目(用户要的:演示学生的错误时题目和代码要并排)。
|
||||
* 只摆讲题用得上的:描述、输入、输出、例子 —— 题目页的状态标签、流程图、相似题都不要。
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { ClassDetail } from "@oj2/contract"
|
||||
import Markdown from "shared/components/Markdown.vue"
|
||||
import { useThemeVars } from "naive-ui"
|
||||
import { getClassDetail } from "oj/api"
|
||||
import { classLabel } from "oj/submission/utils"
|
||||
@@ -12,6 +11,9 @@ import { parseTime } from "utils/functions"
|
||||
import { useRankPalette } from "../palette"
|
||||
import RankAvatar from "./RankAvatar.vue"
|
||||
|
||||
// Markdown 连着整套代码高亮(两百多 KB),这里要等点开 / AI 写完才用得上,别让它拖慢页面
|
||||
const Markdown = defineAsyncComponent(() => import("shared/components/Markdown.vue"))
|
||||
|
||||
/**
|
||||
* 班级详情(设计稿「班级详情 · 老师 / 学生」):从右边滑出的抽屉,代替原来那个满是
|
||||
* 四分位数、标准差、综合分的弹框。谁都能看;「要多关心的同学」和 AI 分析只给老师,
|
||||
|
||||
Reference in new issue
Block a user