<script setup lang="ts">
/**
* AttentionList:应用概览的「需关注事项ã€ï¼Œ2026-10-29 åœç‚¹ 19 第 7 æ¥ã€‚
* 纯 UIï¼šåªæ”¶ buildAttention 算好的 items,点按钮åªå‘ go(tab),跳转由页é¢å†³å®šã€‚
* è¯æ°”æ˜ å°„ï¼šok 绿点ã€warn 黄点(详情用è¦å‘Šè‰²ï¼‰ã€info ç°ç‚¹ã€pending ç©ºå¿ƒåœˆåŠ ã€Œå¾…æŽ¥å…¥ã€æ ‡ç¾ã€‚
* å–ä¸åˆ°æ•°æ®æ—¶æ˜¾ç¤ºã€Œå¾…接入ã€ï¼Œä¸å½“作æ£å¸¸ï¼Œä¹Ÿä¸å†™æˆæ²¡æœ‰è®°å½•。
*/
import Btn from './Btn.vue';
import Card from './Card.vue';
import Dot from './Dot.vue';
import Tag from './Tag.vue';
import type { AttentionItem, AttentionTone } from './overview.logic.ts';
import type { AppTab } from './palette.items.ts';
defineProps<{ items: AttentionItem[] }>();
const emit = defineEmits<{ go: [tab: AppTab] }>();
type DotTone = 'default' | 'ok' | 'err' | 'warn' | 'off';
const DOT: Record<AttentionTone, DotTone> = {
ok: 'ok',
warn: 'warn',
info: 'default',
pending: 'off',
};
// 详情文å—è‰²ï¼šåªæœ‰ warn 用è¦å‘Šè‰²ï¼Œå…¶ä½™ç”¨æ¬¡è¦æ–‡å—色
const DETAIL: Record<AttentionTone, string> = {
ok: 'text-[var(--el-text-color-secondary)]',
warn: 'text-[var(--el-color-warning)]',
info: 'text-[var(--el-text-color-secondary)]',
pending: 'text-[var(--el-text-color-secondary)]',
};
</script>
<template>
<Card
padding="none"
data-spec="attention-list"
>
<div
class="border-b border-[var(--el-border-color-light)] px-[14px] py-[10px] text-[13px] font-semibold text-[var(--el-text-color-primary)]"
>
需关注事项
</div>
<ul class="m-0 list-none p-0">
<li
v-for="it in items"
:key="it.key"
data-spec="attention-item"
:data-key="it.key"
:data-tone="it.tone"
class="flex items-center gap-3 border-b border-[var(--el-border-color-light)] px-[14px] py-[10px] last:border-b-0"
>
<Dot :tone="DOT[it.tone]" />
<span class="w-[72px] shrink-0 text-[12.5px] font-medium text-[var(--el-text-color-primary)]">{{ it.title }}</span>
<span
data-spec="attention-detail"
class="min-w-0 flex-1 break-words text-[12.5px]"
:class="DETAIL[it.tone]"
>
{{ it.detail }}
</span>
<Tag
v-if="it.tone === 'pending'"
data-spec="attention-pending"
>
待接入
</Tag>
<Btn
size="sm"
data-spec="attention-go"
@click="emit('go', it.tab)"
>
{{ it.actionLabel }}
</Btn>
</li>
</ul>
</Card>
</template>
|