feat: 自动学习按视频完成和五分钟刷新学时,代理仅 HTTP/SOCKS

This commit is contained in:
2026-11-15 01:10:39 +08:00
parent 9e85a4184c
commit 1141df17f7
6 changed files with 349 additions and 82 deletions
+20 -4
View File
@@ -30,7 +30,22 @@ const monthlyTarget = ref<number | null>(null);
const targetLoaded = ref(false);
let targetSaveTimer: ReturnType<typeof setTimeout> | undefined;
const studyStatus = ref<{ running: boolean; user: string; course: string; message: string } | null>(null);
interface StudyUserState {
state?: string;
course?: string;
}
const studyStatus = ref<{
running: boolean;
users?: Record<string, StudyUserState>;
message: string;
} | null>(null);
const myStudy = computed(() => {
const users = studyStatus.value?.users;
if (!users) return null;
return users[props.employeeId] ?? null;
});
function amount(value: string | number | null | undefined) {
if (value === null || value === undefined || value === "") return "—";
@@ -200,10 +215,11 @@ onMounted(() => { refresh(); loadTarget(); loadStudyStatus(); });
</div>
</div>
<div v-if="studyStatus" class="home-study-status">
<span class="study-indicator" :class="{ active: studyStatus.running }"></span>
<span v-if="studyStatus.running" class="study-text">
正在学习:{{ studyStatus.course || "准备中" }}
<span class="study-indicator" :class="{ active: Boolean(myStudy) || studyStatus.running }"></span>
<span v-if="myStudy" class="study-text">
{{ myStudy.state === "已达标" ? "本月目标已达到" : `正在学习:${myStudy.course || myStudy.state || "准备中"}` }}
</span>
<span v-else-if="studyStatus.running" class="study-text muted">自动学习进行中</span>
<span v-else-if="studyStatus.message" class="study-text muted">{{ studyStatus.message }}</span>
<span v-else class="study-text muted">自动学习未运行</span>
</div>