## 对话内图表(W29) 按「零新数字」路径实现:图只画答复正文里**已经写出来**的数字,不引入任何新数值 (新不变量 INV-8:图内每个数值必须能在同轮文字中找到)。 - E6 出口 data 增 trend_chart(纯增量,只搬运模板已写出的数字:最新净值 / 四个区间涨跌 / 区间首末净值 / 区间高低 / 数据日期) - 新增 trend-chart.js:**全 DOM API 构建**(widget.js 的 addMessage 一律 textContent, 图表若拼 HTML 串等于把那层 XSS 防护重新打开),涨红跌绿(中国市场惯例) - widget.js 从 result.tool_calls.data 取数 ⇒ **零后端读取改动** (result.data 只对 financial_nl2sql 暴露;走 tool_calls 这个已落库的 JSON 列免会签) 验证(真实净值数据 511810 / 160 个净值点、区间 -9.19/5.28/15.27/-6.53): - jsdom 渲染 11/11 通过;颜色序列 [绿,红,红,绿] - INV-8 独立断言:图上 18 个可见数字 **100% 命中答复正文**(extra_numbers=[]) - 空数据三态返回 null;label 里塞 <img onerror=...> 后 DOM 中 img 元素数 0 ## 客服业务层(W28 遗留,本次一并提交) - app/core/service_topic.py(新增):业务事项轴 —— 12 个 SVC-* 事项码 × 处理主体 × 留痕等级;只做留痕统计,不参与任何判定 - customer_service.py 的 E5b 双段话术(删掉「换个说法再问我一次」= 把问题推回客户)、 kb_miss 显式声明(不再靠文本比对,话术一变化比对就静默失效)、 意图漂移护栏(分类器判闲聊但含业务实质则不采信) - customer_service_rules.py:substantive_business_request 等判据 注:customer_service.py 同时承载 W29 的 trend_chart 与上述 W28 改动, 两者无法按文件切分,故同批提交。
31 lines
4.4 KiB
CSS
31 lines
4.4 KiB
CSS
.cs-widget { position: fixed; right: 24px; bottom: 24px; z-index: 90; font-family: inherit; }
|
|
.cs-widget__launcher { display: inline-flex; align-items: center; gap: 12px; min-width: 164px; padding: 10px 14px 10px 10px; color: #f5fffc; background: linear-gradient(135deg, #075f56, #118879); border: 1px solid rgba(255,255,255,.34); border-radius: 999px; box-shadow: 0 14px 32px rgba(7,95,86,.26), 0 2px 5px rgba(7,95,86,.14); cursor: pointer; transition: transform 180ms ease, box-shadow 180ms ease; }
|
|
.cs-widget__launcher:hover, .cs-widget__launcher:focus-visible { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(7,95,86,.31), 0 2px 5px rgba(7,95,86,.14); outline: none; }
|
|
.cs-widget__orb { width: 34px; height: 34px; display: grid; place-items: center; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.34); border-radius: 50%; }
|
|
.cs-widget__orb span { width: 10px; height: 10px; background: #b9f1df; border-radius: 50%; box-shadow: 0 0 0 5px rgba(185,241,223,.16); }
|
|
.cs-widget__launcher-copy { display: grid; gap: 2px; text-align: left; }
|
|
.cs-widget__launcher-copy strong { font-size: 13px; font-weight: 700; }
|
|
.cs-widget__launcher-copy small { color: rgba(245,255,252,.72); font-size: 11px; }
|
|
.cs-widget__panel { position: absolute; right: 0; bottom: calc(100% + 14px); width: min(380px, calc(100vw - 32px)); overflow: hidden; color: #172d29; background: #fbfefd; border: 1px solid #cfe1db; border-radius: 14px; box-shadow: 0 26px 70px rgba(20,58,50,.22); transform-origin: bottom right; animation: cs-pop 180ms ease both; }
|
|
.cs-widget__header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; color: #effbf7; background: linear-gradient(135deg, #0b514a, #167b70); }
|
|
.cs-widget__eyebrow { margin: 0 0 4px; color: rgba(239,251,247,.68); font-size: 11px; letter-spacing: .03em; }
|
|
.cs-widget__header h2 { margin: 0; font-size: 19px; font-weight: 680; }
|
|
.cs-widget__close { width: 30px; height: 30px; color: inherit; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; }
|
|
.cs-widget__notice { padding: 10px 20px; color: #5b716b; background: #eef6f3; border-bottom: 1px solid #dceae5; font-size: 12px; line-height: 1.55; }
|
|
.cs-widget__messages { height: 280px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; background: #f8fbfa; }
|
|
.cs-widget__message { max-width: 84%; padding: 10px 12px; color: #29423b; background: #e6f0ed; border-radius: 10px 10px 10px 3px; font-size: 13px; line-height: 1.62; white-space: pre-wrap; }
|
|
.cs-widget__message--user { align-self: flex-end; color: #f4fffb; background: #0a7568; border-radius: 10px 10px 3px 10px; }
|
|
.cs-widget__composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 14px; background: #fff; border-top: 1px solid #dceae5; }
|
|
.cs-widget__composer input { width: 100%; min-width: 0; height: 40px; padding: 0 12px; color: #172d29; background: #f7faf9; border: 1px solid #d2e1dc; border-radius: 8px; outline: none; }
|
|
.cs-widget__composer input:focus { border-color: #147f73; box-shadow: 0 0 0 3px rgba(20,127,115,.12); }
|
|
.cs-widget__composer button { min-width: 54px; color: #fff; background: #0a7568; border: 0; border-radius: 8px; cursor: pointer; }
|
|
.cs-widget__composer button:hover { background: #075f56; }
|
|
.cs-widget__footer { padding: 0 14px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #82938e; font-size: 10px; }
|
|
.cs-widget__footer button { padding: 0; color: #0a7568; background: transparent; border: 0; font-size: 11px; cursor: pointer; }
|
|
.cs-widget__chart { align-self: flex-start; max-width: 84%; margin: 0; padding: 10px 12px 8px; background: #fff; border: 1px solid #dceae5; border-radius: 10px 10px 10px 3px; }
|
|
.cs-widget__chart svg { display: block; width: 100%; height: auto; }
|
|
.cs-widget__chart-caption { margin-top: 6px; color: #82938e; font-size: 10px; line-height: 1.5; }
|
|
@keyframes cs-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
|
|
@media (max-width: 620px) { .cs-widget { right: 14px; bottom: 14px; } .cs-widget__launcher { min-width: 0; padding-right: 11px; } .cs-widget__launcher-copy { display: none; } .cs-widget__panel { right: -2px; width: min(380px, calc(100vw - 28px)); } }
|
|
@media (prefers-reduced-motion: reduce) { .cs-widget__panel { animation: none; } .cs-widget__launcher { transition: none; } }
|