Files
yunke/yunkes/src/style.css
T
浅念 6c4cd92ae6 feat: vue3 frontend scaffold + org tree + customer list + chat timeline
M5b viewing frontend for the yunke data-mirror, under yunkes/.

- Scaffold: Vite + Vue 3 + TS, with element-plus, @element-plus/icons-vue,
  pinia, vue-router@4, axios. Dev server on :5173 with /api and /api/media
  proxied to the FastAPI backend on :8000.
- API client (src/api/): axios instance (baseURL '/api') whose response
  interceptor unwraps the axios envelope; typed wrappers (getCustomers,
  getMessages, getDepartments, getStaff) returning Page<T> / arrays; types
  mirroring the backend *Out schemas (Message typed as a permissive superset
  so file_th_url/duration/transcription_text degrade gracefully today and
  light up once MessageOut exposes them).
- Layout: el-header top bar (title + channel switch) + el-aside department
  tree (built from the flat parent_id list via useOrgStore, with search
  filter) + el-main router-view.
- CustomerList (/customers): el-table with channel filter, department filter
  driven by the tree selection (route query), pagination, and row-click into
  the chat timeline (channel + owner_account_id + talker_id).
- ChatTimeline (/chat/:channel/:ownerId/:talkerId): asc-ordered message
  bubbles keyed by is_send (direction) and type (text/image/video/voice/file/
  divider/system/unknown); lands on the most-recent page and prepends older
  pages via load-more with scroll anchoring.
- Home '/' redirects to '/customers'.

npm run build (vue-tsc -b + vite build) is clean.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-01 16:27:22 +08:00

250 lines
3.8 KiB
CSS

/* App-level layout + resets. Element Plus ships its own component styles. */
:root {
--yk-header-height: 56px;
--yk-aside-width: 260px;
--yk-bg: #f5f7fa;
--yk-border: #e4e7ed;
}
* {
box-sizing: border-box;
}
html,
body,
#app {
height: 100%;
margin: 0;
}
body {
font-family:
'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB',
'Microsoft YaHei', Arial, sans-serif;
font-size: 14px;
color: #303133;
background: var(--yk-bg);
-webkit-font-smoothing: antialiased;
}
a {
color: var(--el-color-primary, #409eff);
text-decoration: none;
}
/* Layout shell ----------------------------------------------------------- */
.yk-app {
height: 100%;
}
.yk-header {
display: flex;
align-items: center;
gap: 16px;
height: var(--yk-header-height);
padding: 0 20px;
background: #fff;
border-bottom: 1px solid var(--yk-border);
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.yk-header__title {
font-size: 18px;
font-weight: 600;
margin: 0;
white-space: nowrap;
}
.yk-header__spacer {
flex: 1;
}
.yk-aside {
background: #fff;
border-right: 1px solid var(--yk-border);
overflow: auto;
}
.yk-aside__search {
padding: 10px 12px 6px;
}
.yk-aside__tree {
padding: 4px 6px 16px;
}
.yk-main {
padding: 16px;
background: var(--yk-bg);
overflow: auto;
}
/* Empty / loading placeholders */
.yk-empty {
padding: 40px 0;
color: #909399;
text-align: center;
}
/* Chat timeline ---------------------------------------------------------- */
.yk-chat {
display: flex;
flex-direction: column;
gap: 16px;
}
.yk-chat__header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
flex-wrap: wrap;
}
.yk-chat__title {
font-size: 16px;
font-weight: 600;
margin: 0;
}
.yk-chat__sub {
color: #909399;
font-size: 13px;
}
.yk-chat__stream {
display: flex;
flex-direction: column;
gap: 4px;
background: #fff;
border: 1px solid var(--yk-border);
border-radius: 8px;
padding: 16px;
}
.yk-chat__load {
display: flex;
justify-content: center;
padding: 8px 0 12px;
}
.yk-chat__end {
text-align: center;
color: #c0c4cc;
font-size: 12px;
padding: 6px 0 2px;
}
/* Message bubble */
.yk-msg {
display: flex;
width: 100%;
padding: 6px 0;
}
.yk-msg--send {
flex-direction: row-reverse;
}
.yk-msg__row {
display: flex;
flex-direction: column;
max-width: 70%;
}
.yk-msg--send .yk-msg__row {
align-items: flex-end;
}
.yk-msg__meta {
display: flex;
gap: 8px;
align-items: center;
font-size: 12px;
color: #909399;
padding: 0 4px 2px;
}
.yk-msg--send .yk-msg__meta {
flex-direction: row-reverse;
}
.yk-msg__bubble {
padding: 8px 12px;
border-radius: 10px;
background: #f4f4f5;
color: #303133;
line-height: 1.5;
word-break: break-word;
white-space: pre-wrap;
}
.yk-msg--send .yk-msg__bubble {
background: var(--el-color-primary-light-8, #d9ecff);
color: #1d2129;
}
.yk-msg__image {
max-width: 220px;
max-height: 220px;
border-radius: 8px;
display: block;
cursor: zoom-in;
}
.yk-msg__video {
max-width: 280px;
max-height: 280px;
border-radius: 8px;
display: block;
}
.yk-msg__chip {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 12px;
border-radius: 16px;
background: #ecf5ff;
color: var(--el-color-primary, #409eff);
font-size: 13px;
cursor: default;
}
.yk-msg__chip--download {
cursor: pointer;
text-decoration: none;
}
.yk-msg__transcript {
margin-top: 4px;
font-size: 12px;
color: #909399;
font-style: italic;
padding: 0 4px;
}
/* Centered faint row for divider / system messages */
.yk-msg--center {
justify-content: center;
}
.yk-msg__divider {
font-size: 12px;
color: #909399;
background: transparent;
text-align: center;
padding: 2px 8px;
}
.yk-clickable-row {
cursor: pointer;
}
.yk-channel-tag {
margin-right: 4px;
}