Files
digital-psychology/apps/user-h5/src/components/ask/AskProfileBar.vue
T
jackyu66gitandCursor 00fc7f82b9
ci / h5 (push) Canceled after 0s
ci / api (push) Canceled after 0s
ci / ess-docs (push) Canceled after 0s
refactor(ECR-005): 再拆 Ask/Decode/Portrait 与 composable,补强 OpenAPI
压低贴线 SFC/composable;报告/档案/量表/意象卡 path 挂 Envelope $ref;CI ESS 门禁跟到 ECR-005。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 22:38:32 +08:00

88 lines
1.7 KiB
Vue

<template>
<div class="card controls">
<label class="lbl">档案</label>
<select
class="sel"
:value="profileId"
@change="
$emit('update:profileId', ($event.target as HTMLSelectElement).value);
$emit('profile-change')
"
>
<option v-for="p in profiles" :key="p.id" :value="p.id">
{{ p.relation === 'self' ? '我的档案' : `TA · ${p.display_name || '未命名'}` }}
</option>
</select>
<div class="quick">
<button
v-for="q in quickTools"
:key="q.to"
type="button"
class="q-btn"
@click="$emit('navigate', q.to)"
>
{{ q.label }}
</button>
</div>
</div>
</template>
<script setup lang="ts">
import type { Profile } from '@yuxingu/types'
import { askQuickTools } from '../../composables/useAskPage'
defineProps<{
profiles: Profile[]
profileId: string
}>()
defineEmits<{
'update:profileId': [v: string]
'profile-change': []
navigate: [to: string]
}>()
const quickTools = askQuickTools
</script>
<style scoped>
.card {
background: var(--color-surface);
border-radius: var(--radius-xl);
padding: 16px;
box-shadow: var(--shadow-hero);
margin-bottom: 12px;
}
.controls .lbl {
display: block;
font-size: 12px;
color: #999;
margin-bottom: 6px;
}
.sel {
width: 100%;
padding: 10px 12px;
border-radius: 12px;
border: 1.5px solid #eee;
background: var(--color-input-bg);
font-size: 14px;
outline: none;
}
.quick {
display: flex;
gap: 8px;
margin-top: 12px;
overflow-x: auto;
scrollbar-width: none;
}
.q-btn {
flex-shrink: 0;
padding: 7px 12px;
border-radius: var(--radius-pill);
border: 1px solid #f0ebe8;
background: #fff;
font-size: 12px;
color: #666;
}
</style>