Some checks failed
Build and Deploy Front / deploy (push) Has been cancelled
补仓储/操作指引与报错排查表,统一指引命名与同步排序;培训手册分角色强化;客户底栏改为 Workspace Switcher 式换仓 Popover。 Co-authored-by: Cursor <cursoragent@cursor.com>
109 lines
2.4 KiB
Vue
109 lines
2.4 KiB
Vue
<script lang="ts" setup>
|
||
import { computed } from 'vue'
|
||
import { useRouter } from 'vue-router'
|
||
import { useTrainingProgress } from './useTrainingProgress'
|
||
import { PRACTICE_CARDS } from './training-meta'
|
||
|
||
defineOptions({ name: 'TrainingPracticeCards' })
|
||
|
||
const router = useRouter()
|
||
const { role } = useTrainingProgress()
|
||
|
||
const cards = computed(() => {
|
||
const r = role.value
|
||
if (r === 'all') return PRACTICE_CARDS
|
||
return PRACTICE_CARDS.filter((c) => !c.roles || c.roles.includes(r))
|
||
})
|
||
|
||
function go(path: string) {
|
||
void router.push(path)
|
||
}
|
||
</script>
|
||
|
||
<template>
|
||
<div class="practice-cards">
|
||
<div class="practice-cards__head">
|
||
<div class="practice-cards__title">测服深链练习</div>
|
||
<div class="practice-cards__hint">点按钮直达页面;按当前岗位过滤场景</div>
|
||
</div>
|
||
<div class="practice-cards__grid">
|
||
<article v-for="card in cards" :key="card.id" class="practice-card">
|
||
<h4 class="practice-card__title">{{ card.title }}</h4>
|
||
<p class="practice-card__goal">{{ card.goal }}</p>
|
||
<div class="practice-card__links">
|
||
<a-button
|
||
v-for="link in card.links"
|
||
:key="link.path"
|
||
size="small"
|
||
class="app-btn-search"
|
||
@click="go(link.path)"
|
||
>
|
||
{{ link.label }}
|
||
</a-button>
|
||
</div>
|
||
</article>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<style lang="less" scoped>
|
||
.practice-cards {
|
||
margin: 0 0 20px;
|
||
}
|
||
|
||
.practice-cards__head {
|
||
margin-bottom: 10px;
|
||
}
|
||
|
||
.practice-cards__title {
|
||
font-size: 14px;
|
||
font-weight: 600;
|
||
color: var(--color-text-1);
|
||
}
|
||
|
||
.practice-cards__hint {
|
||
margin-top: 2px;
|
||
font-size: 12px;
|
||
color: var(--color-text-3);
|
||
}
|
||
|
||
.practice-cards__grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||
gap: 10px;
|
||
}
|
||
|
||
.practice-card {
|
||
padding: 12px 14px;
|
||
border: 1px solid var(--color-border-2);
|
||
border-radius: 8px;
|
||
background: var(--color-bg-2);
|
||
}
|
||
|
||
.practice-card__title {
|
||
margin: 0;
|
||
font-size: 14px;
|
||
font-weight: 600;
|
||
color: var(--color-text-1);
|
||
}
|
||
|
||
.practice-card__goal {
|
||
margin: 6px 0 10px;
|
||
font-size: 12px;
|
||
line-height: 1.5;
|
||
color: var(--color-text-3);
|
||
}
|
||
|
||
.practice-card__links {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 8px;
|
||
}
|
||
|
||
@media (max-width: 720px) {
|
||
.practice-cards__grid {
|
||
grid-template-columns: 1fr;
|
||
}
|
||
}
|
||
</style>
|