Files
sales-trainer/frontend/dist/assets/MyBoard-CdXG-0Ii.js
Macky bd6a7ffa32 feat(chat): scenario-based training — choice of channel/Situation + realistic per-turn evaluation
Backend:
- Channel/initiation now driven by a SCENARIO chosen at chat start, not baked into the
  persona: social (customer opens), f2f_call (seller must open, proactive), recontact
  (customer re-contacts after 1-3 months).
- /chat/start accepts {scenario}; session stores scenario + internal{turns,score}.
- persona_reply takes scenario + adapts tone; system-role transcript entries are fed to
  the persona as hidden scene notes.
- JUDGE updated for realism: good response can WIN even in hard/tough-text scenarios;
  long/no-close chats (turns >~12) lose; pushy/ignoring-need loses. Efficiency rewarded.

Frontend:
- Scenario picker before chat (choose Social / Face-to-face-call / Re-contact).
- Chat thread renders role=system as a centered time-lapse/scene note.
- Choose-scenario i18n (EN+TH).
Rebuilt dist.
2026-08-08 11:27:05 +07:00

7 lines
2.8 KiB
JavaScript

import{k as x,_ as f,l as k,s as p,c as r,a as t,m as b,u as e,j as B,t as s,i as a,e as v,w as N,y as D,F as S,q as T,r as h,z as c,o as i,A as V}from"./index-tI5UDFg-.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const z=x("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),L={style:{margin:"0"}},M={key:0,class:"row stat-row"},j={class:"card stat"},C={class:"card stat won"},F={class:"card stat lost"},I={class:"card stat"},q={key:1,class:"card"},A={key:2,class:"card empty-state"},E={class:"card",style:{"margin-top":"20px"}},G={style:{"margin-top":"0"}},H={__name:"MyBoard",setup(J){const o=h([]),u=h([]),y=h(!0),m=c(()=>o.value.length),_=c(()=>o.value.filter(n=>n.my_outcome==="won").length),g=c(()=>o.value.filter(n=>n.my_outcome==="lost").length),w=c(()=>o.value.filter(n=>n.my_outcome==="not_tried").length);return k(async()=>{try{o.value=(await p.myBoard()).board||[],u.value=(await p.mySessions()).sessions||[]}finally{y.value=!1}}),(n,l)=>(i(),r("div",null,[t("div",null,[t("h2",L,[b(e(z),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),B(" "+s(e(a).t("myDashboard")),1)]),l[0]||(l[0]=t("div",{class:"muted",style:{"margin-top":"4px","margin-bottom":"16px"}},"สรุปผลการฝึกของตัวคุณเอง — ดูว่าปิดการขายได้กี่ครั้ง ยังฝึกกับใครบ้าง",-1))]),y.value?v("",!0):(i(),r("div",M,[t("div",j,[t("span",null,s(e(a).t("total")),1),t("strong",null,s(m.value),1)]),t("div",C,[t("span",null,s(e(a).t("won")),1),t("strong",null,s(_.value),1)]),t("div",F,[t("span",null,s(e(a).t("lost")),1),t("strong",null,s(g.value),1)]),t("div",I,[t("span",null,s(e(a).t("notTried")),1),t("strong",null,s(w.value),1)])])),y.value?(i(),r("div",q,[...l[1]||(l[1]=[t("div",{class:"skeleton",style:{height:"50px"}},null,-1)])])):o.value.length===0?(i(),r("div",A,[...l[2]||(l[2]=[t("strong",null,"No practice yet",-1),t("span",null,"Go to Training and try closing a sale with a persona.",-1)])])):v("",!0),N(t("div",E,[t("h3",G,s(e(a).t("mySessions")),1),(i(!0),r(S,null,T(u.value,d=>(i(),r("div",{key:d.id,style:{display:"flex","justify-content":"space-between",padding:"8px 0","border-bottom":"1px solid var(--border)"}},[t("span",null,s(d.persona_name),1),t("span",{class:V(["badge",d.outcome])},s(d.outcome==="won"?e(a).t("won"):e(a).t("lost")),3)]))),128))],512),[[D,u.value.length]])]))}},O=f(H,[["__scopeId","data-v-6767b6b8"]]);export{O as default};