重构: 跨模块样式DRY收口+审批列表增强+灵感模块优化
- 全局样式收口: page-header/btn/modal/filter-bar/back-link/empty-state 等通用类从12个视图的scoped重复定义提取到global.css/components.css - 审批列表增强: 筛选栏(状态/风险/工具搜索)+行展开查看完整参数结果 +审批耗时显示+刷新spinner+硬编码颜色全部改用CSS变量 - 灵感模块: scoreTier统一评分阈值+score-bar/assessment-badge提取全局 +statusLabelKey消除重复+i18n状态文案对齐+eval-report--muted统一空态 - Dashboard: df-panel/df-link提取全局(修scoped不渗透)+统计卡可点击跳转 +活跃项目面板只显示active状态+灵感列表按分数排序+刷新spinner - 修复: intent.rs tool_type类型对齐(newtype)+ToolCardList补ai-btn定义 +SkillMention/ImageInput样式不渗透修复(提取全局)
This commit is contained in:
@@ -18,8 +18,100 @@
|
||||
← ProjectDetail.vue / TaskDetail.vue / TaskOutputCard.vue 三处复制
|
||||
- .panel / .panel-header ← ProjectDetail.vue / TaskDetail.vue 两处复制
|
||||
- .tech-tag / .card-tags ← ProjectCard.vue / Projects.vue 两处复制
|
||||
- .error-banner / .error-text / .error-dismiss ← Dashboard.vue / Knowledge.vue 两处复制
|
||||
═══════════════════════════════════════════════════════════ */
|
||||
|
||||
/* — Error Banner:页面级错误提示条(danger 底 + 关闭按钮) —
|
||||
原 Dashboard.vue / Knowledge.vue <style scoped> 两处逐字一致。
|
||||
margin-bottom 由各页自定义(全局不设,避免覆盖页面间距变量)。 */
|
||||
.error-banner {
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 12px;
|
||||
padding: 8px 12px;
|
||||
background: rgba(255,107,107,0.12); border: 0.5px solid var(--df-danger);
|
||||
border-radius: var(--df-radius-sm); color: var(--df-danger); font-size: 12px;
|
||||
}
|
||||
.error-text { word-break: break-word; }
|
||||
.error-dismiss {
|
||||
flex-shrink: 0; background: transparent; border: none; color: var(--df-danger);
|
||||
font-size: 14px; cursor: pointer; line-height: 1; padding: 0 2px;
|
||||
}
|
||||
.error-dismiss:hover { opacity: 0.7; }
|
||||
|
||||
/* — 灵感状态标签:ideas 列表(Ideas.vue) + 灵感详情(IdeaDetail.vue) 共享 —
|
||||
原 Ideas.vue / IdeaDetail.vue <style scoped> 两处逐字一致(灵感专属 5 态色系,
|
||||
与 Tasks/AuditLog 的 status-tag 语义不同,独立提取避免混淆)。 */
|
||||
.status-tag {
|
||||
font-size: 11px; font-weight: 500; padding: 2px 8px;
|
||||
border-radius: var(--df-radius-xs);
|
||||
}
|
||||
.status-draft { background: rgba(90,99,128,0.2); color: var(--df-text-dim); }
|
||||
.status-pending_review { background: rgba(100,181,246,0.2); color: var(--df-info); }
|
||||
.status-approved { background: rgba(100,255,218,0.15); color: var(--df-success); }
|
||||
.status-promoted { background: rgba(108,99,255,0.2); color: var(--df-accent); }
|
||||
.status-rejected { background: rgba(255,107,107,0.2); color: var(--df-danger); }
|
||||
|
||||
/* — 多维评分条:IdeaDetail.vue + ProjectDetail.vue 共享 —
|
||||
原 IdeaDetail.vue L770-808 / ProjectDetail.vue L678-692 两处逐字一致
|
||||
(ProjectDetail 注释自承认"复用 IdeaDetail score-bar-* 样式定义")。
|
||||
差异:score-bar-label min-width 72px(IdeaDetail) vs 64px(ProjectDetail),
|
||||
取 72px 保证较长维度名不换行;row gap 12px(IdeaDetail) vs 10px(ProjectDetail),取 12px 更透气。 */
|
||||
.score-bar-chart {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
.score-bar-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
.score-bar-label {
|
||||
font-size: 12px;
|
||||
color: var(--df-text-secondary);
|
||||
min-width: 72px;
|
||||
text-align: right;
|
||||
}
|
||||
.score-bar-track {
|
||||
flex: 1;
|
||||
height: 8px;
|
||||
background: var(--df-border);
|
||||
border-radius: var(--df-radius-xs);
|
||||
overflow: hidden;
|
||||
}
|
||||
.score-bar-fill {
|
||||
height: 100%;
|
||||
border-radius: var(--df-radius-xs);
|
||||
transition: width 0.4s;
|
||||
}
|
||||
.fill-high { background: var(--df-success); }
|
||||
.fill-mid { background: var(--df-warning); }
|
||||
.fill-low { background: var(--df-danger); }
|
||||
.score-bar-value {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
min-width: 28px;
|
||||
text-align: right;
|
||||
color: var(--df-text);
|
||||
}
|
||||
|
||||
/* — 评估徽章(assessment badge):IdeaDetail.vue + ProjectDetail.vue 共享 —
|
||||
recommendation → CSS 颜色类映射(对应 .immediate/.soon/.conditional/.revised/.defer/.cancel)。
|
||||
原 IdeaDetail.vue L589-606 / ProjectDetail.vue L657-671 两处逐字重复。 */
|
||||
.assessment-badge {
|
||||
display: inline-block;
|
||||
padding: 4px 12px;
|
||||
border-radius: 20px;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
.assessment-badge.immediate { background: var(--df-success-bg); color: var(--df-success); }
|
||||
.assessment-badge.soon { background: var(--df-info-bg); color: var(--df-info); }
|
||||
.assessment-badge.conditional { background: var(--df-warning-bg); color: var(--df-warning); }
|
||||
.assessment-badge.revised { background: var(--df-warning-bg); color: var(--df-warning); }
|
||||
.assessment-badge.defer { background: var(--df-danger-bg); color: var(--df-danger); }
|
||||
.assessment-badge.cancel { background: var(--df-danger-bg); color: var(--df-danger); }
|
||||
|
||||
/* — Info Item:字段同行布局(label 固定宽 + 值占余),描述字段 info-block 保持块状 —
|
||||
原 ProjectDetail.vue L439-456 / TaskDetail.vue L560-577 /
|
||||
TaskOutputCard.vue L93-110 三处逐字一致(后者注释说明 scoped 不渗透故复制)。 */
|
||||
@@ -78,6 +170,157 @@
|
||||
border: 0.5px solid var(--df-border);
|
||||
}
|
||||
|
||||
/* — Dashboard 面板基类:ActiveProjectsPanel / IdeasPanel 共享 —
|
||||
原 Dashboard.vue <style scoped> 定义,但 Vue scoped 不渗透到子组件根元素,
|
||||
导致两个子面板的 .df-panel/.df-panel-head/.df-panel-title/.df-link 实际裸奔
|
||||
(无背景/边框/padding/链接色),暗色主题下视觉割裂。提取全局根治。
|
||||
落地批:Dashboard 视觉一致性修复 */
|
||||
.df-panel {
|
||||
background: var(--df-bg-card);
|
||||
border: 0.5px solid var(--df-border);
|
||||
border-radius: var(--df-radius-md);
|
||||
padding: 14px 16px;
|
||||
animation: fadeInUp 0.5s var(--df-ease) both;
|
||||
}
|
||||
.df-panel-head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.df-panel-title {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--df-text);
|
||||
letter-spacing: -0.1px;
|
||||
}
|
||||
.df-link {
|
||||
font-size: 11px;
|
||||
color: var(--df-accent);
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
opacity: 0.8;
|
||||
transition: opacity 0.15s;
|
||||
cursor: pointer;
|
||||
}
|
||||
.df-link:hover { opacity: 1; text-decoration: underline; }
|
||||
|
||||
/* — AI 技能联想浮层 / chip:SkillMention.vue + MentionPopover.vue 共享 —
|
||||
原 ChatInput.vue <style scoped> 定义,但实际使用方是子组件 SkillMention.vue
|
||||
(无自带 style 块)和 MentionPopover.vue(自带 scoped 副本)。ChatInput.vue
|
||||
自身 template 未使用这些类,scoped 定义为死代码且不渗透子组件。
|
||||
提取全局根治,消除三份重复。 */
|
||||
.ai-skill-chip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-bottom: 6px;
|
||||
padding: 3px 8px;
|
||||
background: color-mix(in srgb, var(--df-accent) 16%, transparent);
|
||||
border: 0.5px solid color-mix(in srgb, var(--df-accent) 40%, transparent);
|
||||
border-radius: var(--df-radius);
|
||||
font-size: 12px;
|
||||
}
|
||||
.ai-skill-chip-name { color: var(--df-accent); font-weight: 600; flex-shrink: 0; }
|
||||
.ai-skill-chip-desc { color: var(--df-text-dim); flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.ai-skill-chip-main { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; }
|
||||
.ai-skill-chip-hint {
|
||||
color: var(--df-text-dim);
|
||||
font-family: var(--df-font-mono, ui-monospace, monospace);
|
||||
font-size: 11px;
|
||||
background: color-mix(in srgb, var(--df-text-dim) 14%, transparent);
|
||||
padding: 1px 5px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.ai-skill-chip-x { background: none; border: none; color: var(--df-text-dim); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; flex-shrink: 0; }
|
||||
.ai-skill-chip-x:hover { color: var(--df-text); }
|
||||
|
||||
.ai-skill-popover {
|
||||
position: absolute;
|
||||
bottom: calc(100% + 4px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
max-height: 240px;
|
||||
overflow-y: auto;
|
||||
background: var(--df-bg-card);
|
||||
border: 0.5px solid var(--df-border);
|
||||
border-radius: var(--df-radius);
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
|
||||
z-index: 20;
|
||||
}
|
||||
.ai-skill-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
padding: 6px 10px;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
}
|
||||
.ai-skill-item-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
|
||||
.ai-skill-item--active,
|
||||
.ai-skill-item:hover {
|
||||
background: color-mix(in srgb, var(--df-accent) 14%, transparent);
|
||||
}
|
||||
.ai-skill-item-name { color: var(--df-accent); font-weight: 600; min-width: 90px; }
|
||||
.ai-skill-item-desc { color: var(--df-text-dim); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.ai-skill-item-src { color: var(--df-text-dim); opacity: 0.6; font-size: 10px; text-transform: uppercase; }
|
||||
.ai-skill-item-hint {
|
||||
color: var(--df-text-dim);
|
||||
font-family: var(--df-font-mono, ui-monospace, monospace);
|
||||
font-size: 11px;
|
||||
opacity: 0.85;
|
||||
word-break: break-all;
|
||||
}
|
||||
.ai-skill-empty { padding: 8px 12px; color: var(--df-text-dim); opacity: 0.7; font-size: 12px; }
|
||||
|
||||
/* — AI 图片预览:ImageInput.vue 专用(原 ChatInput.vue scoped 死代码,子组件拿不到) — */
|
||||
.ai-img-preview-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
padding-bottom: 4px;
|
||||
border-bottom: 0.5px solid var(--df-border);
|
||||
}
|
||||
.ai-img-preview {
|
||||
position: relative;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
border-radius: var(--df-radius);
|
||||
overflow: hidden;
|
||||
border: 0.5px solid var(--df-border);
|
||||
background: var(--df-bg);
|
||||
}
|
||||
.ai-img-preview-thumb {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
.ai-img-preview-x {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
right: 2px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
background: color-mix(in srgb, var(--df-bg) 80%, transparent);
|
||||
color: var(--df-text-dim);
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
transition: background 0.15s, color 0.15s;
|
||||
}
|
||||
.ai-img-preview-x:hover {
|
||||
background: var(--df-danger);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* — AiChat 图标按钮(共享工具类):TopBar header-actions + ConversationSidebar 新建按钮 —
|
||||
原 AiChat.vue <style scoped> L1039-1072 抽取(非 scoped 全局,供两个 ai/ 子组件共享)。
|
||||
复用原因:跨 TopBar + ConversationSidebar,无法归属单一 scoped;
|
||||
@@ -123,4 +366,3 @@
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user