feat 完善注释

This commit is contained in:
Ironsp
2026-10-01 17:24:57 +08:00
parent 2b59f68fd7
commit 9f4a5c7cda
183 changed files with 485 additions and 3615 deletions

View File

@@ -31,11 +31,11 @@ const emit = defineEmits<{ download: [] }>()
<style lang="less" scoped>
.chat-file-card {
.flex(row, center);
gap: 8px; // 图标→文件名 11 × 0.77
min-width: 181px; // 设计 38 文件卡宽 235 × 0.77
gap: 8px;
min-width: 181px;
max-width: 320px;
padding: 10px 12px; // 卡内边距 13/15 × 0.77
border: 1px solid @project-divider; // 设计 38 卡描边 ≈ @project-divider
padding: 10px 12px;
border: 1px solid @project-divider;
border-radius: 6px;
background: @white;
@@ -52,7 +52,6 @@ const emit = defineEmits<{ download: [] }>()
min-width: 0;
}
// 设计 38:文件名 12 → 11 / 700 / #1F2937
&__name {
font-size: 11px;
font-weight: 700;
@@ -60,7 +59,6 @@ const emit = defineEmits<{ download: [] }>()
.ellipsis();
}
// 设计 38:大小 12 → 11 / #9CA3AF
&__size {
font-size: 11px;
color: @text-color-disabled;

View File

@@ -3,7 +3,6 @@ import { nextTick, ref } from 'vue'
import { ElMessage } from 'element-plus'
import { AppButton } from '@/components'
/** 单文件大小上限 1GB */
const MAX_FILE_SIZE = 1024 * 1024 * 1024
const content = ref('')
@@ -87,19 +86,18 @@ function onFileChange(event: Event): void {
<style lang="less" scoped>
.chat-input {
.flex(column, flex-start, stretch);
gap: 16px; // 输入框→提示行 23 × 0.77
padding: 12px 16px 24px; // 上 13 / 左右 21 / 下 36 × 0.77
border-top: 1px solid @project-divider; // 设计 38 分割线 @project-divider
gap: 16px;
padding: 12px 16px 24px;
border-top: 1px solid @project-divider;
background: @white;
// 设计 38:文本域灰底无描边,占位文案 #1F2937(13 → 11)
&__textarea {
width: 100%;
height: 57px; // 文本域高 74 × 0.77(覆盖 rows 固有高)
height: 57px;
padding: 11px 10px;
border: none;
border-radius: 6px;
background: @finance-row-bg; // 设计 38 实取 @finance-row-bg
background: @finance-row-bg;
color: @heading-color;
font-size: 11px;
line-height: 1.6;
@@ -114,7 +112,7 @@ function onFileChange(event: Event): void {
}
&::placeholder {
color: @heading-color; // 设计 38 占位即标注 @heading-color
color: @heading-color;
}
}
@@ -125,7 +123,6 @@ function onFileChange(event: Event): void {
width: 100%;
}
// 设计 38:提示 11 / #9CA3AF(覆盖 text-secondary)
&__hint {
font-size: 11px;
color: @text-color-disabled;
@@ -156,7 +153,6 @@ function onFileChange(event: Event): void {
display: none;
}
// 「发送」:设计 38 #024FFF 小按钮(12 → 11 / 500)
.app-button {
height: 24px; // 31 × 0.77
padding: 0 14px;

View File

@@ -38,10 +38,9 @@ const emit = defineEmits<{ download: [] }>()
<style lang="less" scoped>
.chat-message-item {
.flex(row, flex-start, flex-start); // 头像与气泡顶对齐(设计 38)
gap: 9px; // 头像→气泡 12 × 0.77
.flex(row, flex-start, flex-start);
gap: 9px;
// 设计 38:头像直径 36 × 0.77;客服 #024FFF,用户 #8D99AE
&__avatar {
flex-shrink: 0;
.flex(row, center);
@@ -62,13 +61,12 @@ const emit = defineEmits<{ download: [] }>()
&__main {
.flex(column, flex-start, flex-start);
gap: 4px;
max-width: 320px; // 气泡最宽 ≈ 设计 410 × 0.77
max-width: 320px;
}
// 设计 38:客服气泡白底轻影;13 → 11 / #1F2937
&__bubble {
position: relative;
padding: 9px 12px; // 内边距 12/15 × 0.77
padding: 9px 12px;
border-radius: 8px;
background: @white;
box-shadow: @shadow-base;
@@ -79,20 +77,17 @@ const emit = defineEmits<{ download: [] }>()
word-break: break-word;
}
// 文件消息:文件卡自身成卡,气泡去内边距/底色/影(设计 38 单层卡)
&__bubble:has(.chat-file-card) {
padding: 0;
background: transparent;
box-shadow: none;
}
// 设计 38:消息时间 11 / #9CA3AF
&__time {
font-size: 11px;
color: @text-color-disabled;
}
// 设计 38:「未读」挂在文件卡左下外侧,10 → 11 / #9CA3AF,无底色
&__unread {
position: absolute;
top: 100%;
@@ -113,7 +108,6 @@ const emit = defineEmits<{ download: [] }>()
align-items: flex-end;
}
// 设计 38:我方气泡 #024FFF 白字
.chat-message-item__bubble {
background: @primary-strong;
color: @white;

View File

@@ -18,7 +18,6 @@ const emit = defineEmits<{
const scrollRef = ref<HTMLElement | null>(null)
/** 首条 assistant 消息标记未读 */
function isUnread(index: number): boolean {
const first = props.messages[0]
return index === 0 && first?.role === 'assistant'
@@ -72,17 +71,15 @@ watch(
box-shadow: @shadow-base;
overflow: hidden;
// 设计 38:顶栏白底,高 60 × 0.77,下缘 #F0F1F3 分割线
&__header {
.flex(row, flex-start);
gap: 11px; // 头像→文字 14 × 0.77
gap: 11px;
height: 46px;
padding: 0 16px; // 21 × 0.77
border-bottom: 1px solid @project-divider;
background: @white;
}
// 设计 38:头像直径 36 × 0.77,实取 #024FFF
&__header-avatar {
flex-shrink: 0;
width: 28px;
@@ -91,7 +88,6 @@ watch(
background: @primary-strong;
}
// 设计 38:「专属客服」14 → 11 / 700 / #1F2937
&__header-name {
align-self: center;
font-size: 11px;
@@ -101,19 +97,18 @@ watch(
&__scroll {
.flex(column, flex-start, stretch);
gap: 56px; // 消息组纵向间距(设计 38 组间 69~82 × 0.77)
gap: 56px;
max-height: 60vh;
min-height: 347px; // 消息区高 451 × 0.77
padding: 22px 16px; // 上 29 / 左右 21 × 0.77
background: @bg-color-light; // 设计 38 消息区实取 #FAFBFC
min-height: 347px;
padding: 22px 16px;
background: @bg-color-light;
overflow-y: auto;
.scrollbar();
}
// 设计 38:时间分割文字 11 / #9CA3AF,短横已含在文案内,无两侧线
&__divider {
flex-shrink: 0;
margin-bottom: -42px; // 分割线→首条 14(抵消组间距 56)
margin-bottom: -42px;
font-size: 11px;
color: @text-color-disabled;
text-align: center;

View File

@@ -2,7 +2,6 @@
<script setup lang="ts">
import { onMounted } from 'vue'
import { storeToRefs } from 'pinia'
// 页面容器:只做组件引入、props 分发、事件中转,数据只经 store
import { useServiceStore } from '@/stores/modules/service'
import ChatWindow from './cpns/ChatWindow.vue'
@@ -44,28 +43,25 @@ onMounted(() => {
<style lang="less" scoped>
.service {
.flex(column, flex-start, stretch);
gap: @spacing-base; // 头部→聊天卡 19 × 0.77
gap: @spacing-base;
max-width: @container-width;
min-height: calc(100vh - @header-height);
margin: 0 auto;
padding: 25px @spacing-base @spacing-xxl; // 标题上留白 32 × 0.77
background: @white; // 设计 38 页面底色为纯白
padding: 25px @spacing-base @spacing-xxl;
background: @white;
// 设计 38:头部文案左缩进 42 × 0.77(标题 x112 相对内容边 x70)
&__head {
padding-left: 32px;
}
// 设计 38:大标题 36 → 28 / 700 / #121212
&__title {
font-size: @font-size-xxl;
font-weight: 700;
color: @home-ink;
}
// 设计 38:副标题 24 → 18 / 500 / #666666
&__subtitle {
margin-top: 12px; // 标题→副标题 15 × 0.77
margin-top: 12px;
font-size: 18px;
font-weight: 500;
line-height: 1.5;