Step F2:项目列表 & 当前项目上下文

This commit is contained in:
Cheng Zhou
2025-12-16 20:31:20 +08:00
parent 78d13d077c
commit cc54d80b3a
19 changed files with 239 additions and 24 deletions
+32
View File
@@ -0,0 +1,32 @@
<template>
<el-dropdown>
<span class="el-dropdown-link">
<el-tag size="small" type="info">
{{ study.currentStudy?.name || "未选择项目" }}
</el-tag>
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="goSelect">切换项目</el-dropdown-item>
<el-dropdown-item @click="clearStudy">清除当前项目</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
<script setup lang="ts">
import { useRouter } from "vue-router";
import { useStudyStore } from "../store/study";
const router = useRouter();
const study = useStudyStore();
const goSelect = () => {
router.push("/studies");
};
const clearStudy = () => {
study.clearCurrentStudy();
router.push("/studies");
};
</script>