feat(i18n + export + guide): locale-aware scenarios/debrief; CSV export; how-to-use page
Backend:
- SCENARIOS localized (th/en): scenario preamble + persona tone adaptation follow the
trainee's locale; start accepts {locale} and stores it on the session; send/auto-finish
use it so debrief text (why/coaching/turning points) is in the active language.
- /api/analytics/export returns per-trainee finished-session CSV (admin).
Frontend:
- Scenario picker labels localize by i18n.locale.
- New /guide page (non-IT how-to), linked from Training.
- Analytics: date-filter bar uses line icon + 'Download CSV' button (fetch w/ auth).
Rebuilt dist.
This commit is contained in:
@@ -111,3 +111,63 @@ def analytics():
|
|||||||
"trainee_count": len(users),
|
"trainee_count": len(users),
|
||||||
"hardest_personas": hardest,
|
"hardest_personas": hardest,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@analytics_bp.get("/export")
|
||||||
|
@require_auth
|
||||||
|
@require_roles("admin")
|
||||||
|
def export_csv():
|
||||||
|
"""Export per-trainee finished session results as CSV (for HR/offline review)."""
|
||||||
|
import csv
|
||||||
|
import io
|
||||||
|
|
||||||
|
from flask import Response, current_app
|
||||||
|
|
||||||
|
s = _stores()
|
||||||
|
users = {}
|
||||||
|
try:
|
||||||
|
user_store = current_app.extensions.get("user_store")
|
||||||
|
if user_store and hasattr(user_store, "list_users"):
|
||||||
|
for rec in user_store.list_users():
|
||||||
|
users[rec.get("id") or rec.get("username")] = rec.get("username") or rec.get("id")
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
sessions = []
|
||||||
|
try:
|
||||||
|
grp_store = s["groups"]
|
||||||
|
sess_store = s["sessions"]
|
||||||
|
if hasattr(grp_store, "groups"):
|
||||||
|
group_ids = [g.get("id") for g in grp_store.groups.all()]
|
||||||
|
elif hasattr(grp_store, "all"):
|
||||||
|
group_ids = [g.get("id") for g in grp_store.all()]
|
||||||
|
else:
|
||||||
|
group_ids = []
|
||||||
|
for gid in group_ids:
|
||||||
|
try:
|
||||||
|
ss = sess_store.sessions.where(
|
||||||
|
lambda r, _gid=gid: r.get("group_id") == _gid and r.get("outcome")
|
||||||
|
)
|
||||||
|
sessions.extend(ss)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
buf = io.StringIO()
|
||||||
|
w = csv.writer(buf)
|
||||||
|
w.writerow(["username", "persona", "scenario", "outcome", "score", "created_at"])
|
||||||
|
for sess in sessions:
|
||||||
|
w.writerow([
|
||||||
|
users.get(sess.get("user_id"), sess.get("user_id", "")),
|
||||||
|
sess.get("persona_name", ""),
|
||||||
|
sess.get("scenario", ""),
|
||||||
|
sess.get("outcome", ""),
|
||||||
|
(sess.get("debrief") or {}).get("score", ""),
|
||||||
|
sess.get("created_at", ""),
|
||||||
|
])
|
||||||
|
return Response(
|
||||||
|
buf.getvalue(),
|
||||||
|
mimetype="text/csv",
|
||||||
|
headers={"Content-Disposition": "attachment; filename=sales-trainer-results.csv"},
|
||||||
|
)
|
||||||
|
|||||||
@@ -27,57 +27,92 @@ def _sim(group, persona):
|
|||||||
return Simulator(llm)
|
return Simulator(llm)
|
||||||
|
|
||||||
|
|
||||||
SCENARIOS = {
|
def _scenarios(locale: str = "th"):
|
||||||
"social": {
|
"""Scenario presets, localized. Returns {id: {label, init, adapt}}."""
|
||||||
"label": "Social Media",
|
t = locale != "en"
|
||||||
"init": "customer",
|
return {
|
||||||
"system_preamble": "💬 ช่องทาง ข้อความโซเชียล — ลูกค้าทักมาหาคุณก่อน (โทนสั้น ทักๆ ตามสไตล์แชท)",
|
"social": {
|
||||||
"adapt": "You are chatting on a social-messaging app (LINE-style). Keep replies SHORT, casual, and quick — one line to a few lines. The customer opened the chat.",
|
"label": "Social Media" if not t else "Social Media (แชท)",
|
||||||
},
|
"init": "customer",
|
||||||
"f2f_call": {
|
"preamble": "💬 Social messaging — the customer messaged you first." if not t else "💬 ช่องทางข้อความโซเชียล — ลูกค้าทักมาหาคุณก่อน (โทนสั้น ทักๆ)",
|
||||||
"label": "พบหน้า / โทรศัพท์",
|
"adapt": (
|
||||||
"init": "seller",
|
"Chat style: short, casual, quick social-messaging replies. The customer opened."
|
||||||
"system_preamble": "📞 สถานการณ์ พบหน้าหรือโทรศัพท์ — คุณต้องเป็นฝ่ายเปิดการสนทนาเชิงรุกกับลีด (lead)",
|
if not t
|
||||||
"adapt": "This is a face-to-face or phone sales situation. You must sound natural and conversational like a live talk. The seller will open — you are the lead they are reaching out to.",
|
else "ลูกค้าทักมาหาคุณก่อน — โทนสั้น ทักๆ ตามสไตล์แชทโซเชียล"
|
||||||
},
|
),
|
||||||
"recontact": {
|
},
|
||||||
"label": "ลูกค้ากลับมาติดต่อ (เคยได้ข้อมูล 1-3 เดือน)",
|
"f2f_call": {
|
||||||
"init": "customer",
|
"label": "Face-to-face / Phone" if not t else "พบหน้า / โทรศัพท์",
|
||||||
"system_preamble": "⏳ 1-3 เดือนผ่านไป... ลูกค้าคนนี้เคยได้รับข้อมูลสินค้าไปแล้ว ตอนนี้กลับมาติดต่อคุณอีกครั้ง (พร้อมตัดสินใจมากขึ้น)",
|
"init": "seller",
|
||||||
"adapt": "This customer researched you 1-3 months ago. They have already read about the product and are now more ready to decide. They re-contacted you on a messaging channel. Keep replies natural and fairly concise.",
|
"preamble": "📞 Face-to-face / phone — you must proactively open with this lead." if not t else "📞 สถานการณ์ พบหน้าหรือโทรศัพท์ — คุณต้องเป็นฝ่ายเปิดการสนทนาเชิงรุกกับลีด",
|
||||||
},
|
"adapt": (
|
||||||
}
|
"Natural, conversational like a live face-to-face or phone sales talk. The seller opens."
|
||||||
|
if not t
|
||||||
|
else "คุณต้องเป็นฝ่ายเปิดการสนทนาเชิงรุกกับลีด (ผู้ฝึกทักก่อน) โทนเหมือนคุยสด"
|
||||||
|
),
|
||||||
|
},
|
||||||
|
"recontact": {
|
||||||
|
"label": "Re-contact (1-3 months later)" if not t else "ลูกค้ากลับมาติดต่อ (1-3 เดือน)",
|
||||||
|
"init": "customer",
|
||||||
|
"preamble": "⏳ 1-3 months passed... this customer previously got your info, now re-contacts, more ready to decide." if not t else "⏳ 1-3 เดือนผ่านไป... ลูกค้าคนนี้เคยได้รับข้อมูลสินค้าไปแล้ว ตอนนี้กลับมาติดต่อคุณอีกครั้ง (พร้อมตัดสินใจมากขึ้น)",
|
||||||
|
"adapt": (
|
||||||
|
"You researched this seller 1-3 months ago and now re-contact, more ready to decide."
|
||||||
|
if not t
|
||||||
|
else "เคยได้รับข้อมูลไปแล้ว ตอนนี้กลับมาติดต่อ พร้อมตัดสินใจมากขึ้น"
|
||||||
|
),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def _scenario_config(scenario: str, persona: dict):
|
def _scenario_config(scenario: str, persona: dict, locale: str = "th"):
|
||||||
cfg = SCENARIOS.get(scenario, SCENARIOS["social"])
|
cfg = _scenarios(locale).get(scenario, _scenarios(locale)["social"])
|
||||||
return cfg, cfg["init"]
|
return cfg, cfg["init"]
|
||||||
|
|
||||||
|
|
||||||
def _build_abbrev_debrief(outcome: str, persona: dict, internal: dict) -> dict:
|
def _build_abbrev_debrief(outcome: str, persona: dict, internal: dict, locale: str = "th") -> dict:
|
||||||
"""Build a lightweight debrief from the persona's own decision + per-turn signals
|
"""Build a lightweight debrief from the persona's own decision + per-turn signals."""
|
||||||
(no extra LLM judge call needed since the persona chose to buy/walk)."""
|
|
||||||
signals = internal.get("signals", [])
|
signals = internal.get("signals", [])
|
||||||
turning_points = [
|
en = locale == "en"
|
||||||
f"รอบที่ {sig['turn']}: ลูกค้า{'เริ่มใจขึ้น' if sig['mood'] > 0 else 'เริ่มหงุดหงิด/ลังเล'}"
|
turning_points = []
|
||||||
for sig in signals if sig.get("type") in ("annoy", "warm")
|
for sig in signals:
|
||||||
]
|
if sig.get("type") in ("annoy", "warm"):
|
||||||
|
turn = sig.get("turn", "?")
|
||||||
|
if sig.get("mood", 0) > 0:
|
||||||
|
turning_points.append(
|
||||||
|
f"Turn {turn}: customer warmed up" if en else f"รอบที่ {turn}: ลูกค้าเริ่มใจขึ้น"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
turning_points.append(
|
||||||
|
f"Turn {turn}: customer annoyed/hesitant" if en else f"รอบที่ {turn}: ลูกค้าเริ่มหงุดหงิด/ลังเล"
|
||||||
|
)
|
||||||
why = (
|
why = (
|
||||||
"ลูกค้าตัดสินใจซื้อ (แก้ปัญหาและยอมรับข้อเสนอแล้ว)"
|
("Customer decided to buy (pain resolved + offer accepted)" if en else "ลูกค้าตัดสินใจซื้อ (แก้ปัญหาและยอมรับข้อเสนอแล้ว)")
|
||||||
if outcome == "won"
|
if outcome == "won"
|
||||||
else "ลูกค้าตัดสินใจไม่ซื้อ — ยังไม่เห็นคุณค่าพอ หรือการตอบไม่ตรงความต้องการ"
|
else (
|
||||||
|
"Customer decided not to buy — value not enough, or responses missed the need"
|
||||||
|
if en
|
||||||
|
else "ลูกค้าตัดสินใจไม่ซื้อ — ยังไม่เห็นคุณค่าพอ หรือการตอบไม่ตรงความต้องการ"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
coaching = (
|
||||||
|
["Great job — the customer closed with you"] if en and outcome == "won"
|
||||||
|
else ["ทำได้ดีมาก — ลูกค้าปิดการขายกับคุณ"] if outcome == "won"
|
||||||
|
else (
|
||||||
|
turning_points + ["Ask deeper about the need", "Handle objections more directly"]
|
||||||
|
if en
|
||||||
|
else turning_points + ["ลองถามความต้องการให้ลึกกว่าเดิม", "รับมือข้อโต้แย้งให้ตรงจุด"]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
"outcome": outcome,
|
"outcome": outcome,
|
||||||
"score": 60 if outcome == "won" else 25,
|
"score": 60 if outcome == "won" else 25,
|
||||||
"pain": (persona.get("pains") or [{}])[0].get("description", "") if persona.get("pains") else "",
|
"pain": (persona.get("pains") or [{}])[0].get("description", "") if persona.get("pains") else "",
|
||||||
"why": why,
|
"why": why,
|
||||||
"failurePoints": [] if outcome == "won" else ["ปิดการขายไม่สำเร็จ", "ลูกค้าถอยก่อนตัดสินใจซื้อ"],
|
"failurePoints": [] if outcome == "won" else (
|
||||||
"coaching": (
|
["Failed to close the sale", "Customer walked away before deciding"]
|
||||||
["ทำได้ดีมาก — ลูกค้าปิดการขายกับคุณ"]
|
if en else ["ปิดการขายไม่สำเร็จ", "ลูกค้าถอยก่อนตัดสินใจซื้อ"]
|
||||||
if outcome == "won"
|
|
||||||
else turning_points + ["ลองถามความต้องการให้ลึกกว่าเดิม", "รับมือข้อโต้แย้งให้ตรงจุด"]
|
|
||||||
),
|
),
|
||||||
|
"coaching": coaching,
|
||||||
"turning_points": turning_points,
|
"turning_points": turning_points,
|
||||||
"signals": signals,
|
"signals": signals,
|
||||||
"revealed_persona": {
|
"revealed_persona": {
|
||||||
@@ -124,7 +159,10 @@ def start_session(gid: str, pid: str):
|
|||||||
scenario = (body.get("scenario") or "social").strip().lower()
|
scenario = (body.get("scenario") or "social").strip().lower()
|
||||||
if scenario not in ("social", "f2f_call", "recontact"):
|
if scenario not in ("social", "f2f_call", "recontact"):
|
||||||
scenario = "social"
|
scenario = "social"
|
||||||
scenario_meta, init_mode = _scenario_config(scenario, persona)
|
locale = (body.get("locale") or "th").strip().lower()
|
||||||
|
if locale not in ("en", "th"):
|
||||||
|
locale = "th"
|
||||||
|
scenario_meta, init_mode = _scenario_config(scenario, persona, locale)
|
||||||
# One-shot: reject if already finished this persona
|
# One-shot: reject if already finished this persona
|
||||||
try:
|
try:
|
||||||
session = s["sessions"].create(
|
session = s["sessions"].create(
|
||||||
@@ -135,6 +173,7 @@ def start_session(gid: str, pid: str):
|
|||||||
"initiation_mode": init_mode,
|
"initiation_mode": init_mode,
|
||||||
"channel": persona.get("channel"),
|
"channel": persona.get("channel"),
|
||||||
"scenario": scenario,
|
"scenario": scenario,
|
||||||
|
"locale": locale,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
except ValueError as exc:
|
except ValueError as exc:
|
||||||
@@ -143,13 +182,14 @@ def start_session(gid: str, pid: str):
|
|||||||
s["sessions"].update(
|
s["sessions"].update(
|
||||||
session["id"],
|
session["id"],
|
||||||
scenario=scenario,
|
scenario=scenario,
|
||||||
|
locale=locale,
|
||||||
internal={**(session.get("internal") or {}), "turns": 0, "score": 50, "signals": []},
|
internal={**(session.get("internal") or {}), "turns": 0, "score": 50, "signals": []},
|
||||||
)
|
)
|
||||||
sim = _sim(group, persona)
|
sim = _sim(group, persona)
|
||||||
# Seed messages: system note(s) then customer opener for customer-first scenarios.
|
# Seed messages: localized scenario preamble, then customer opener for customer-first scenarios.
|
||||||
seeded = list(session.get("messages", []))
|
seeded = list(session.get("messages", []))
|
||||||
if scenario_meta.get("system_preamble"):
|
if scenario_meta.get("preamble"):
|
||||||
seeded.append({"role": "system", "text": scenario_meta["system_preamble"]})
|
seeded.append({"role": "system", "text": scenario_meta["preamble"]})
|
||||||
if init_mode == "customer":
|
if init_mode == "customer":
|
||||||
opener = persona.get("opener") or "Hi, I saw your product and had a question."
|
opener = persona.get("opener") or "Hi, I saw your product and had a question."
|
||||||
seeded.append({"role": "customer", "text": opener})
|
seeded.append({"role": "customer", "text": opener})
|
||||||
@@ -187,7 +227,8 @@ def send_message(gid: str, pid: str):
|
|||||||
messages = list(session.get("messages", []))
|
messages = list(session.get("messages", []))
|
||||||
messages.append({"role": "seller", "text": text})
|
messages.append({"role": "seller", "text": text})
|
||||||
scenario = session.get("scenario", "social") or "social"
|
scenario = session.get("scenario", "social") or "social"
|
||||||
adapt = SCENARIOS.get(scenario, SCENARIOS["social"]).get("adapt", "")
|
slocale = session.get("locale", "th") or "th"
|
||||||
|
adapt = _scenarios(slocale).get(scenario, _scenarios(slocale)["social"]).get("adapt", "")
|
||||||
|
|
||||||
sim = _sim(group, persona)
|
sim = _sim(group, persona)
|
||||||
try:
|
try:
|
||||||
@@ -223,7 +264,7 @@ def send_message(gid: str, pid: str):
|
|||||||
decision = meta.get("decision")
|
decision = meta.get("decision")
|
||||||
if decision in ("buy", "walk"):
|
if decision in ("buy", "walk"):
|
||||||
outcome = "won" if decision == "buy" else "lost"
|
outcome = "won" if decision == "buy" else "lost"
|
||||||
debrief = _build_abbrev_debrief(outcome, persona, internal)
|
debrief = _build_abbrev_debrief(outcome, persona, internal, slocale)
|
||||||
s["sessions"].update(
|
s["sessions"].update(
|
||||||
session["id"],
|
session["id"],
|
||||||
status="finished",
|
status="finished",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import{k as w,_ as h,l as U,c as r,a as e,m,u as o,j as l,t as n,i as u,w as p,v,D as b,e as f,F as V,q as M,s as k,r as y,o as i,A as C}from"./index-Dv9XjhnS.js";import{U as z}from"./users-CFr5Kj99.js";/**
|
import{k as w,_ as h,l as U,c as r,a as e,m,u as o,j as l,t as n,i as u,w as p,v,E as b,e as f,F as V,q as M,s as k,r as y,o as i,A as C}from"./index-Dm2VwslH.js";import{U as z}from"./users-ksNXFlzl.js";/**
|
||||||
* @license lucide-vue-next v1.0.0 - ISC
|
* @license lucide-vue-next v1.0.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
@@ -8,4 +8,4 @@ import{k as w,_ as h,l as U,c as r,a as e,m,u as o,j as l,t as n,i as u,w as p,v
|
|||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
* See the LICENSE file in the root directory of this source tree.
|
* See the LICENSE file in the root directory of this source tree.
|
||||||
*/const N=w("user-plus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]),A={class:"card guide"},B={class:"card",style:{"margin-bottom":"16px"}},D={style:{"margin-top":"0"}},I={class:"row"},j={class:"row",style:{"margin-top":"10px"}},q=["disabled"],F={key:0,class:"error"},S={key:0,class:"card empty-state"},T={style:{flex:"1"}},E={class:"badge"},H={__name:"AdminUsers",setup(P){const c=y([]),d=y(""),t=y({username:"",name:"",password:"",role:"user"});async function g(){c.value=(await k.adminListUsers()).users}async function _(){d.value="";try{await k.adminCreateUser({...t.value}),t.value={username:"",name:"",password:"",role:"user"},await g()}catch(x){d.value=x.message}}return U(g),(x,s)=>(i(),r("div",null,[e("h2",null,[m(o(z),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),l(" "+n(o(u).t("users")),1)]),e("div",A,[e("strong",null,[m(o(L),{size:17,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),s[4]||(s[4]=l(" วิธีเพิ่มผู้ใช้งาน",-1))]),s[5]||(s[5]=e("ol",{style:{margin:"8px 0 0","padding-left":"20px","line-height":"1.8"}},[e("li",null,[l("กรอก "),e("strong",null,"ชื่อผู้ใช้ (สำหรับเข้าสู่ระบบ)"),l(", ชื่อ, และรหัสผ่านเริ่มต้น")]),e("li",null,[l("เลือกสิทธิ์: "),e("strong",null,"user"),l(" = ผู้เข้าฝึกขาย, "),e("strong",null,"admin"),l(" = จัดการระบบ")]),e("li",null,[l("กด "),e("strong",null,"สร้าง"),l(" — นำชื่อผู้ใช้ + รหัสผ่านไปแจ้งให้ผู้ใช้นั้นเข้าสู่ระบบได้เลย")])],-1))]),e("div",B,[e("h4",D,[m(o(N),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),l(" + "+n(o(u).t("create"))+" "+n(o(u).t("users").toLowerCase()),1)]),e("div",I,[p(e("input",{"onUpdate:modelValue":s[0]||(s[0]=a=>t.value.username=a),placeholder:"ชื่อผู้ใช้ (เข้าสู่ระบบ)",style:{flex:"1"}},null,512),[[v,t.value.username]]),p(e("input",{"onUpdate:modelValue":s[1]||(s[1]=a=>t.value.name=a),placeholder:"ชื่อจริง",style:{flex:"1"}},null,512),[[v,t.value.name]]),p(e("input",{"onUpdate:modelValue":s[2]||(s[2]=a=>t.value.password=a),type:"password",placeholder:"รหัสผ่านเริ่มต้น",style:{flex:"1"}},null,512),[[v,t.value.password]])]),e("div",j,[p(e("select",{"onUpdate:modelValue":s[3]||(s[3]=a=>t.value.role=a),style:{flex:"1"}},[...s[6]||(s[6]=[e("option",{value:"user"},"🙂 user — ผู้เข้าฝึก",-1),e("option",{value:"admin"},"🛠 admin — ผู้ดูแลระบบ",-1)])],512),[[b,t.value.role]]),e("button",{class:"primary",onClick:_,disabled:!t.value.username||!t.value.password},"+ "+n(o(u).t("create")),9,q)]),d.value?(i(),r("div",F,n(d.value),1)):f("",!0)]),c.value.length===0?(i(),r("div",S,[...s[7]||(s[7]=[e("strong",null,"ยังไม่มีผู้ใช้งาน",-1),e("span",null,"สร้างผู้ใช้งานคนแรกด้วยฟอร์มด้านบน",-1)])])):f("",!0),(i(!0),r(V,null,M(c.value,a=>(i(),r("div",{class:"card",key:a.id,style:{"margin-bottom":"8px",display:"flex","align-items":"center",gap:"12px"}},[e("strong",T,n(a.name)+" ("+n(a.username)+")",1),e("span",E,n(a.role),1),e("span",{class:C(["badge",a.active?"won":"lost"])},n(a.active?"active":"inactive"),3)]))),128))]))}},K=h(H,[["__scopeId","data-v-924406be"]]);export{K as default};
|
*/const N=w("user-plus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]),A={class:"card guide"},B={class:"card",style:{"margin-bottom":"16px"}},I={style:{"margin-top":"0"}},j={class:"row"},q={class:"row",style:{"margin-top":"10px"}},D=["disabled"],E={key:0,class:"error"},F={key:0,class:"card empty-state"},S={style:{flex:"1"}},T={class:"badge"},H={__name:"AdminUsers",setup(P){const c=y([]),d=y(""),t=y({username:"",name:"",password:"",role:"user"});async function g(){c.value=(await k.adminListUsers()).users}async function _(){d.value="";try{await k.adminCreateUser({...t.value}),t.value={username:"",name:"",password:"",role:"user"},await g()}catch(x){d.value=x.message}}return U(g),(x,s)=>(i(),r("div",null,[e("h2",null,[m(o(z),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),l(" "+n(o(u).t("users")),1)]),e("div",A,[e("strong",null,[m(o(L),{size:17,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),s[4]||(s[4]=l(" วิธีเพิ่มผู้ใช้งาน",-1))]),s[5]||(s[5]=e("ol",{style:{margin:"8px 0 0","padding-left":"20px","line-height":"1.8"}},[e("li",null,[l("กรอก "),e("strong",null,"ชื่อผู้ใช้ (สำหรับเข้าสู่ระบบ)"),l(", ชื่อ, และรหัสผ่านเริ่มต้น")]),e("li",null,[l("เลือกสิทธิ์: "),e("strong",null,"user"),l(" = ผู้เข้าฝึกขาย, "),e("strong",null,"admin"),l(" = จัดการระบบ")]),e("li",null,[l("กด "),e("strong",null,"สร้าง"),l(" — นำชื่อผู้ใช้ + รหัสผ่านไปแจ้งให้ผู้ใช้นั้นเข้าสู่ระบบได้เลย")])],-1))]),e("div",B,[e("h4",I,[m(o(N),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),l(" + "+n(o(u).t("create"))+" "+n(o(u).t("users").toLowerCase()),1)]),e("div",j,[p(e("input",{"onUpdate:modelValue":s[0]||(s[0]=a=>t.value.username=a),placeholder:"ชื่อผู้ใช้ (เข้าสู่ระบบ)",style:{flex:"1"}},null,512),[[v,t.value.username]]),p(e("input",{"onUpdate:modelValue":s[1]||(s[1]=a=>t.value.name=a),placeholder:"ชื่อจริง",style:{flex:"1"}},null,512),[[v,t.value.name]]),p(e("input",{"onUpdate:modelValue":s[2]||(s[2]=a=>t.value.password=a),type:"password",placeholder:"รหัสผ่านเริ่มต้น",style:{flex:"1"}},null,512),[[v,t.value.password]])]),e("div",q,[p(e("select",{"onUpdate:modelValue":s[3]||(s[3]=a=>t.value.role=a),style:{flex:"1"}},[...s[6]||(s[6]=[e("option",{value:"user"},"🙂 user — ผู้เข้าฝึก",-1),e("option",{value:"admin"},"🛠 admin — ผู้ดูแลระบบ",-1)])],512),[[b,t.value.role]]),e("button",{class:"primary",onClick:_,disabled:!t.value.username||!t.value.password},"+ "+n(o(u).t("create")),9,D)]),d.value?(i(),r("div",E,n(d.value),1)):f("",!0)]),c.value.length===0?(i(),r("div",F,[...s[7]||(s[7]=[e("strong",null,"ยังไม่มีผู้ใช้งาน",-1),e("span",null,"สร้างผู้ใช้งานคนแรกด้วยฟอร์มด้านบน",-1)])])):f("",!0),(i(!0),r(V,null,M(c.value,a=>(i(),r("div",{class:"card",key:a.id,style:{"margin-bottom":"8px",display:"flex","align-items":"center",gap:"12px"}},[e("strong",S,n(a.name)+" ("+n(a.username)+")",1),e("span",T,n(a.role),1),e("span",{class:C(["badge",a.active?"won":"lost"])},n(a.active?"active":"inactive"),3)]))),128))]))}},K=h(H,[["__scopeId","data-v-924406be"]]);export{K as default};
|
||||||
11
frontend/dist/assets/Analytics-BGRP-tme.js
vendored
Normal file
11
frontend/dist/assets/Analytics-BGRP-tme.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import{k as x,_ as L,l as M,c as p,a as s,m as i,u as a,j as c,t as e,i as n,n as w,w as f,v as b,p as U,e as N,F as R,q as j,s as A,x as B,r as m,f as E,o as y}from"./index-Dm2VwslH.js";import{U as P}from"./users-ksNXFlzl.js";import{P as S}from"./plus-CAyBY_kw.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 D=x("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
||||||
|
* @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 k=x("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),O={class:"row",style:{"align-items":"center","margin-bottom":"16px"}},T={style:{margin:"0"}},F={class:"row",style:{"margin-left":"auto",gap:"10px"}},I={class:"users-btn"},W={class:"primary"},q={class:"card filter-bar"},H={class:"muted"},$=["disabled"],G=["disabled"],J={class:"row",style:{gap:"16px",margin:"16px 0"}},K={class:"card stat"},Q={class:"card stat"},X={style:{color:"var(--green)"}},Y={class:"card stat"},Z={style:{color:"var(--red)"}},ss={class:"card stat"},ts={class:"card stat"},es={class:"card"},as={class:"row",style:{"justify-content":"space-between","align-items":"center"}},os={class:"bar"},ls={class:"muted",style:{"font-size":"12px","margin-top":"6px"}},ns={style:{"margin-top":"20px"}},is={key:0,class:"card empty-state"},rs={class:"grid"},ds={class:"row",style:{"justify-content":"space-between"}},cs={class:"muted"},us={class:"row",style:{"margin-top":"10px",gap:"8px"}},vs={class:"badge won"},_s={class:"badge lost"},ps={class:"badge not_tried"},ms={class:"muted",style:{"margin-top":"8px"}},ys={__name:"Analytics",setup(hs){const l=m({overall:{total_sessions:0,wins:0,losses:0,close_rate:0,avg_score:0},trainee_count:0,hardest_personas:[]}),u=m(""),v=m(""),_=m(!1);async function h(){_.value=!0;try{l.value=await A.analytics({from:u.value,to:v.value})}finally{_.value=!1}}function C(){h()}function V(){u.value="",v.value="",h()}async function z(){try{const r=await fetch("/api/analytics/export",{headers:{Authorization:`Bearer ${E.token}`}});if(!r.ok)throw new Error("export failed");const t=await r.blob(),d=URL.createObjectURL(t),o=document.createElement("a");o.href=d,o.download="sales-trainer-results.csv",o.click(),URL.revokeObjectURL(d)}catch(r){alert(r.message)}}return M(h),(r,t)=>{const d=B("router-link");return y(),p("div",null,[s("div",O,[s("div",null,[s("h2",T,[i(a(D),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),c(" "+e(a(n).t("adminOverview")),1)]),t[2]||(t[2]=s("div",{class:"muted",style:{"margin-top":"4px"}},"ภาพรวมผลการฝึกของทีมทั้งหมด — เลือกช่วงเวลาเพื่อดูสถิติ",-1))]),s("div",F,[i(d,{to:"/admin/users"},{default:w(()=>[s("button",I,[i(a(P),{size:18,"stroke-width":2}),c(" "+e(a(n).t("users")),1)])]),_:1}),i(d,{to:"/admin/new-group"},{default:w(()=>[s("button",W,[i(a(S),{size:18,"stroke-width":2}),c(" "+e(a(n).t("addProduct")),1)])]),_:1})])]),s("div",q,[s("span",H,[i(a(k),{size:15,"stroke-width":1.8,style:{"vertical-align":"-2px"}}),c(" "+e(a(n).t("dateRange")),1)]),f(s("input",{type:"date","onUpdate:modelValue":t[0]||(t[0]=o=>u.value=o)},null,512),[[b,u.value]]),t[4]||(t[4]=s("span",null,"–",-1)),f(s("input",{type:"date","onUpdate:modelValue":t[1]||(t[1]=o=>v.value=o)},null,512),[[b,v.value]]),s("button",{class:"primary",onClick:C,disabled:_.value},"→ "+e(a(n).t("apply")),9,$),s("button",{onClick:V,disabled:_.value},e(a(n).t("clear")),9,G),s("button",{class:"soft",onClick:z},[i(a(k),{size:16,"stroke-width":1.8}),t[3]||(t[3]=c(" CSV",-1))])]),s("div",J,[s("div",K,[t[5]||(t[5]=s("div",null,"Sessions",-1)),s("strong",null,e(l.value.overall.total_sessions),1)]),s("div",Q,[t[6]||(t[6]=s("div",null,"Wins",-1)),s("strong",X,e(l.value.overall.wins),1)]),s("div",Y,[t[7]||(t[7]=s("div",null,"Losses",-1)),s("strong",Z,e(l.value.overall.losses),1)]),s("div",ss,[t[8]||(t[8]=s("div",null,"Avg score",-1)),s("strong",null,e(l.value.overall.avg_score),1)]),s("div",ts,[t[9]||(t[9]=s("div",null,"Trainees",-1)),s("strong",null,e(l.value.trainee_count),1)])]),s("div",es,[s("div",as,[s("strong",null,e(a(n).t("closeRate")),1),s("strong",null,e(l.value.overall.close_rate)+"%",1)]),s("div",os,[s("div",{class:"bar-fill",style:U({width:(l.value.overall.close_rate||0)+"%"})},null,4)]),s("div",ls,e(l.value.overall.wins)+" "+e(a(n).t("won").toLowerCase())+" / "+e(l.value.overall.total_sessions)+" sessions ",1)]),s("h3",ns,e(a(n).t("hardestPersonas")),1),l.value.hardest_personas.length===0?(y(),p("div",is,[...t[10]||(t[10]=[s("strong",null,"No data",-1),s("span",null,"No sessions in this date range.",-1)])])):N("",!0),s("div",rs,[(y(!0),p(R,null,j(l.value.hardest_personas,(o,g)=>(y(),p("div",{key:g,class:"card lift tier-card"},[s("div",ds,[s("strong",null,e(o.persona_name),1),s("span",cs,"#"+e(g+1),1)]),s("div",us,[s("span",vs,e(o.wins)+"W",1),s("span",_s,e(o.losses)+"L",1),s("span",ps,e(o.plays)+" plays",1)]),s("div",ms,e(a(n).t("score"))+": "+e(o.avg_score),1)]))),128))])])}}},bs=L(ys,[["__scopeId","data-v-6eb0872b"]]);export{bs as default};
|
||||||
1
frontend/dist/assets/Analytics-CQgwlaXy.css
vendored
Normal file
1
frontend/dist/assets/Analytics-CQgwlaXy.css
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.stat[data-v-6eb0872b]{text-align:center;min-width:110px}.stat div[data-v-6eb0872b]{color:var(--muted);font-size:12px}.stat strong[data-v-6eb0872b]{font-size:20px}.filter-bar[data-v-6eb0872b]{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.filter-bar input[type=date][data-v-6eb0872b]{width:auto}.grid[data-v-6eb0872b]{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}.tier-card[data-v-6eb0872b]{display:flex;flex-direction:column}.badge.won[data-v-6eb0872b]{background:#dcfce7;color:#166534}.badge.lost[data-v-6eb0872b]{background:#fee2e2;color:#991b1b}.badge.not_tried[data-v-6eb0872b]{background:#eef2ff;color:#4338ca}.bar[data-v-6eb0872b]{background:#eef0f5;border-radius:999px;height:10px;overflow:hidden;margin-top:10px}.bar-fill[data-v-6eb0872b]{background:linear-gradient(90deg,var(--accent),var(--accent-2));height:100%;border-radius:999px;transition:width .4s ease}.users-btn[data-v-6eb0872b]{display:inline-flex;align-items:center;gap:6px;background:#0ea5e9;border-color:transparent;color:#fff;font-weight:600}.users-btn[data-v-6eb0872b]:not(:disabled):hover{background:#0284c7;box-shadow:0 6px 16px #0ea5e959}
|
||||||
1
frontend/dist/assets/Analytics-D5VrZMJ0.css
vendored
1
frontend/dist/assets/Analytics-D5VrZMJ0.css
vendored
@@ -1 +0,0 @@
|
|||||||
.stat[data-v-f2feb744]{text-align:center;min-width:110px}.stat div[data-v-f2feb744]{color:var(--muted);font-size:12px}.stat strong[data-v-f2feb744]{font-size:20px}.filter-bar[data-v-f2feb744]{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.filter-bar input[type=date][data-v-f2feb744]{width:auto}.grid[data-v-f2feb744]{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}.tier-card[data-v-f2feb744]{display:flex;flex-direction:column}.badge.won[data-v-f2feb744]{background:#dcfce7;color:#166534}.badge.lost[data-v-f2feb744]{background:#fee2e2;color:#991b1b}.badge.not_tried[data-v-f2feb744]{background:#eef2ff;color:#4338ca}.bar[data-v-f2feb744]{background:#eef0f5;border-radius:999px;height:10px;overflow:hidden;margin-top:10px}.bar-fill[data-v-f2feb744]{background:linear-gradient(90deg,var(--accent),var(--accent-2));height:100%;border-radius:999px;transition:width .4s ease}.users-btn[data-v-f2feb744]{display:inline-flex;align-items:center;gap:6px;background:#0ea5e9;border-color:transparent;color:#fff;font-weight:600}.users-btn[data-v-f2feb744]:not(:disabled):hover{background:#0284c7;box-shadow:0 6px 16px #0ea5e959}
|
|
||||||
6
frontend/dist/assets/Analytics-DpJ0uaAA.js
vendored
6
frontend/dist/assets/Analytics-DpJ0uaAA.js
vendored
@@ -1,6 +0,0 @@
|
|||||||
import{k,_ as C,l as V,c as u,a as s,m as i,u as a,j as m,t,i as l,n as h,w as f,v as w,p as z,e as M,F as N,q as L,s as P,x as U,r as v,o as _}from"./index-Dv9XjhnS.js";import{U as j}from"./users-CFr5Kj99.js";import{P as A}from"./plus-Dg6sDA5g.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 B=k("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]),S={class:"row",style:{"align-items":"center","margin-bottom":"16px"}},T={style:{margin:"0"}},D={class:"row",style:{"margin-left":"auto",gap:"10px"}},F={class:"users-btn"},I={class:"primary"},R={class:"card filter-bar"},W={class:"muted"},q=["disabled"],E=["disabled"],O={class:"row",style:{gap:"16px",margin:"16px 0"}},G={class:"card stat"},H={class:"card stat"},J={style:{color:"var(--green)"}},K={class:"card stat"},Q={style:{color:"var(--red)"}},X={class:"card stat"},Y={class:"card stat"},Z={class:"card"},$={class:"row",style:{"justify-content":"space-between","align-items":"center"}},ss={class:"bar"},ts={class:"muted",style:{"font-size":"12px","margin-top":"6px"}},es={style:{"margin-top":"20px"}},as={key:0,class:"card empty-state"},os={class:"grid"},ls={class:"row",style:{"justify-content":"space-between"}},ns={class:"muted"},is={class:"row",style:{"margin-top":"10px",gap:"8px"}},rs={class:"badge won"},ds={class:"badge lost"},cs={class:"badge not_tried"},us={class:"muted",style:{"margin-top":"8px"}},vs={__name:"Analytics",setup(_s){const o=v({overall:{total_sessions:0,wins:0,losses:0,close_rate:0,avg_score:0},trainee_count:0,hardest_personas:[]}),r=v(""),d=v(""),c=v(!1);async function p(){c.value=!0;try{o.value=await P.analytics({from:r.value,to:d.value})}finally{c.value=!1}}function b(){p()}function x(){r.value="",d.value="",p()}return V(p),(ps,e)=>{const g=U("router-link");return _(),u("div",null,[s("div",S,[s("div",null,[s("h2",T,[i(a(B),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),m(" "+t(a(l).t("adminOverview")),1)]),e[2]||(e[2]=s("div",{class:"muted",style:{"margin-top":"4px"}},"ภาพรวมผลการฝึกของทีมทั้งหมด — เลือกช่วงเวลาเพื่อดูสถิติ",-1))]),s("div",D,[i(g,{to:"/admin/users"},{default:h(()=>[s("button",F,[i(a(j),{size:18,"stroke-width":2}),m(" "+t(a(l).t("users")),1)])]),_:1}),i(g,{to:"/admin/new-group"},{default:h(()=>[s("button",I,[i(a(A),{size:18,"stroke-width":2}),m(" "+t(a(l).t("addProduct")),1)])]),_:1})])]),s("div",R,[s("span",W,"🗓 "+t(a(l).t("dateRange")),1),f(s("input",{type:"date","onUpdate:modelValue":e[0]||(e[0]=n=>r.value=n)},null,512),[[w,r.value]]),e[3]||(e[3]=s("span",null,"–",-1)),f(s("input",{type:"date","onUpdate:modelValue":e[1]||(e[1]=n=>d.value=n)},null,512),[[w,d.value]]),s("button",{class:"primary",onClick:b,disabled:c.value},"→ "+t(a(l).t("apply")),9,q),s("button",{onClick:x,disabled:c.value},t(a(l).t("clear")),9,E)]),s("div",O,[s("div",G,[e[4]||(e[4]=s("div",null,"Sessions",-1)),s("strong",null,t(o.value.overall.total_sessions),1)]),s("div",H,[e[5]||(e[5]=s("div",null,"Wins",-1)),s("strong",J,t(o.value.overall.wins),1)]),s("div",K,[e[6]||(e[6]=s("div",null,"Losses",-1)),s("strong",Q,t(o.value.overall.losses),1)]),s("div",X,[e[7]||(e[7]=s("div",null,"Avg score",-1)),s("strong",null,t(o.value.overall.avg_score),1)]),s("div",Y,[e[8]||(e[8]=s("div",null,"Trainees",-1)),s("strong",null,t(o.value.trainee_count),1)])]),s("div",Z,[s("div",$,[s("strong",null,t(a(l).t("closeRate")),1),s("strong",null,t(o.value.overall.close_rate)+"%",1)]),s("div",ss,[s("div",{class:"bar-fill",style:z({width:(o.value.overall.close_rate||0)+"%"})},null,4)]),s("div",ts,t(o.value.overall.wins)+" "+t(a(l).t("won").toLowerCase())+" / "+t(o.value.overall.total_sessions)+" sessions ",1)]),s("h3",es,t(a(l).t("hardestPersonas")),1),o.value.hardest_personas.length===0?(_(),u("div",as,[...e[9]||(e[9]=[s("strong",null,"No data",-1),s("span",null,"No sessions in this date range.",-1)])])):M("",!0),s("div",os,[(_(!0),u(N,null,L(o.value.hardest_personas,(n,y)=>(_(),u("div",{key:y,class:"card lift tier-card"},[s("div",ls,[s("strong",null,t(n.persona_name),1),s("span",ns,"#"+t(y+1),1)]),s("div",is,[s("span",rs,t(n.wins)+"W",1),s("span",ds,t(n.losses)+"L",1),s("span",cs,t(n.plays)+" plays",1)]),s("div",us,t(a(l).t("score"))+": "+t(n.avg_score),1)]))),128))])])}}},hs=C(vs,[["__scopeId","data-v-f2feb744"]]);export{hs as default};
|
|
||||||
6
frontend/dist/assets/Chat-C6Malw3d.js
vendored
Normal file
6
frontend/dist/assets/Chat-C6Malw3d.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
frontend/dist/assets/Chat-D8HchzhD.css
vendored
1
frontend/dist/assets/Chat-D8HchzhD.css
vendored
@@ -1 +0,0 @@
|
|||||||
.thread[data-v-4da228fb]{background:#eceff4;border:1px solid var(--border);border-radius:var(--radius);padding:16px;min-height:320px;max-height:52vh;overflow-y:auto;display:flex;flex-direction:column;gap:8px}.bubble[data-v-4da228fb]{max-width:72%;padding:10px 14px;white-space:pre-wrap;word-break:break-word}.msg-system[data-v-4da228fb]{align-self:center;background:#fef3c7;color:#92400e;font-size:12px;max-width:88%;border-radius:999px}.composer[data-v-4da228fb]{display:flex;gap:8px;margin-top:12px}.task[data-v-4da228fb]{margin-bottom:12px;background:#fff7ed;border-color:#fed7aa}.debrief[data-v-4da228fb]{margin-top:16px}button.danger[data-v-4da228fb]{background:var(--red);color:#fff;border:none}.guide[data-v-4da228fb]{background:#eef2ff;border-color:#c7d2fe;margin-bottom:12px}.scenario[data-v-4da228fb]{border:2px solid var(--border);border-radius:12px;padding:12px 14px;margin:10px 0;cursor:pointer;transition:border-color .15s ease,background .15s ease}.scenario[data-v-4da228fb]:hover{border-color:var(--accent)}.scenario.sel[data-v-4da228fb]{border-color:var(--accent);background:#eef2ff}.reveal-grid[data-v-4da228fb]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.rev[data-v-4da228fb]{display:flex;flex-direction:column;background:#f8fafc;border:1px solid var(--border);border-radius:8px;padding:8px 10px}.rk[data-v-4da228fb]{font-size:12px;color:var(--muted)}.rv[data-v-4da228fb]{font-size:13px;color:var(--ink);margin-top:2px}@media (max-width: 640px){.reveal-grid[data-v-4da228fb]{grid-template-columns:1fr}}
|
|
||||||
1
frontend/dist/assets/Chat-Dhsij-Zk.css
vendored
Normal file
1
frontend/dist/assets/Chat-Dhsij-Zk.css
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.thread[data-v-19840301]{background:#eceff4;border:1px solid var(--border);border-radius:var(--radius);padding:16px;min-height:320px;max-height:52vh;overflow-y:auto;display:flex;flex-direction:column;gap:8px}.bubble[data-v-19840301]{max-width:72%;padding:10px 14px;white-space:pre-wrap;word-break:break-word}.msg-system[data-v-19840301]{align-self:center;background:#fef3c7;color:#92400e;font-size:12px;max-width:88%;border-radius:999px}.composer[data-v-19840301]{display:flex;gap:8px;margin-top:12px}.task[data-v-19840301]{margin-bottom:12px;background:#fff7ed;border-color:#fed7aa}.debrief[data-v-19840301]{margin-top:16px}button.danger[data-v-19840301]{background:var(--red);color:#fff;border:none}.guide[data-v-19840301]{background:#eef2ff;border-color:#c7d2fe;margin-bottom:12px}.scenario[data-v-19840301]{border:2px solid var(--border);border-radius:12px;padding:12px 14px;margin:10px 0;cursor:pointer;transition:border-color .15s ease,background .15s ease}.scenario[data-v-19840301]:hover{border-color:var(--accent)}.scenario.sel[data-v-19840301]{border-color:var(--accent);background:#eef2ff}.reveal-grid[data-v-19840301]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.rev[data-v-19840301]{display:flex;flex-direction:column;background:#f8fafc;border:1px solid var(--border);border-radius:8px;padding:8px 10px}.rk[data-v-19840301]{font-size:12px;color:var(--muted)}.rv[data-v-19840301]{font-size:13px;color:var(--ink);margin-top:2px}@media (max-width: 640px){.reveal-grid[data-v-19840301]{grid-template-columns:1fr}}
|
||||||
6
frontend/dist/assets/Chat-o6rfEiwI.js
vendored
6
frontend/dist/assets/Chat-o6rfEiwI.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
|||||||
import{k as g,_ as M,c as f,m as d,n as V,a as e,u as l,j as r,t as s,i as o,w as u,v as y,D as k,e as C,x as z,r as v,s as B,g as A,o as x}from"./index-Dv9XjhnS.js";import{A as P}from"./arrow-left-haz-8IhO.js";/**
|
import{k as g,_ as M,c as f,m as d,n as V,a as e,u as l,j as r,t as s,i as o,w as u,v as y,E as k,e as C,x as z,r as v,s as B,g as A,o as x}from"./index-Dm2VwslH.js";import{A as P}from"./arrow-left-Cm4VHcqz.js";/**
|
||||||
* @license lucide-vue-next v1.0.0 - ISC
|
* @license lucide-vue-next v1.0.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
@@ -18,4 +18,4 @@ import{k as g,_ as M,c as f,m as d,n as V,a as e,u as l,j as r,t as s,i as o,w a
|
|||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
* See the LICENSE file in the root directory of this source tree.
|
* See the LICENSE file in the root directory of this source tree.
|
||||||
*/const D=g("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]),N={class:"card guide"},E={class:"card"},G={style:{"margin-top":"0"}},L={class:"row"},j={style:{flex:"1"}},F={value:"facebook"},I={value:"line"},O={style:{flex:"1"}},T={value:"th"},R={value:"en"},Z={key:0,class:"error"},$=["disabled"],H={__name:"GroupBuilder",setup(J){const _=A(),a=v({product:"",segment:"",description:"",channel:"facebook",language:"th"}),h=v([]),p=v(""),c=v(!1);function b(n){h.value=Array.from(n.target.files||[])}async function w(){c.value=!0,p.value="";try{const n=new FormData;n.append("product",a.value.product),n.append("segment",a.value.segment),n.append("description",a.value.description),n.append("channel",a.value.channel),n.append("language",a.value.language),h.value.forEach(i=>n.append("files",i));const m=(await B.createGroup(n)).group.id;_.push(`/admin/groups/${m}/edit`)}catch(n){p.value=n.message}finally{c.value=!1}}return(n,t)=>{const m=z("router-link");return x(),f("div",null,[d(m,{to:"/training",class:"btn-back"},{default:V(()=>[d(l(P),{size:16,"stroke-width":2}),r(" "+s(l(o).t("training")),1)]),_:1}),e("div",N,[e("strong",null,[d(l(q),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),t[5]||(t[5]=r(" วิธีสร้างกลุ่มบุคคลต้นแบบ",-1))]),t[6]||(t[6]=e("ol",{style:{margin:"8px 0 0","padding-left":"20px","line-height":"1.8"}},[e("li",null,[r("กรอก "),e("strong",null,"ชื่อ/รายละเอียดสินค้าหรือบริการ"),r(" ที่อยากให้ทีมฝึกขาย (ช่องด้านล่าง)")]),e("li",null,"(ไม่บังคับ) ระบุกลุ่มลูกค้าเป้าหมาย หรืออัปโหลดไฟล์เอกสารสินค้า .pdf/.md/.txt"),e("li",null,[r("กด "),e("strong",null,"สร้าง"),r(" — ระบบจะพาไปหน้าสร้างบุคคลต้นแบบ (ลูกค้าจำลอง)")])],-1))]),e("div",E,[e("h2",G,[d(l(S),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),r(" "+s(l(o).t("addProduct")),1)]),e("label",null,[r(s(l(o).t("product"))+" ",1),t[7]||(t[7]=e("span",{class:"req"},"*",-1))]),u(e("textarea",{"onUpdate:modelValue":t[0]||(t[0]=i=>a.value.product=i),rows:"3",placeholder:"เช่น ระบบ POS สำหรับร้านอาหาร Cloud POS for small restaurants"},null,512),[[y,a.value.product]]),e("label",null,s(l(o).t("segment")),1),u(e("input",{"onUpdate:modelValue":t[1]||(t[1]=i=>a.value.segment=i),placeholder:"เช่น SMEs ร้านอาหารในกรุงเทพ"},null,512),[[y,a.value.segment]]),e("label",null,s(l(o).t("description")),1),u(e("textarea",{"onUpdate:modelValue":t[2]||(t[2]=i=>a.value.description=i),rows:"3",placeholder:"รายละเอียดเพิ่มเติม เช่น จุดเด่นสินค้า ราคา ฯลฯ (ไม่บังคับ)"},null,512),[[y,a.value.description]]),e("div",L,[e("div",j,[e("label",null,s(l(o).t("channel")),1),u(e("select",{"onUpdate:modelValue":t[3]||(t[3]=i=>a.value.channel=i)},[e("option",F,s(l(o).t("facebook")),1),e("option",I,s(l(o).t("line")),1)],512),[[k,a.value.channel]])]),e("div",O,[e("label",null,s(l(o).t("language")),1),u(e("select",{"onUpdate:modelValue":t[4]||(t[4]=i=>a.value.language=i)},[e("option",T,s(l(o).t("thai")),1),e("option",R,s(l(o).t("english")),1)],512),[[k,a.value.language]])])]),e("label",null,[d(l(D),{size:15,"stroke-width":1.8,style:{"vertical-align":"-2px"}}),t[8]||(t[8]=r(" ไฟล์เอกสารสินค้า (.pdf/.md/.txt) — ใช้เป็นข้อมูลให้ระบบได้",-1))]),e("input",{type:"file",multiple:"",accept:".pdf,.md,.txt",onChange:b},null,32),p.value?(x(),f("div",Z,s(p.value),1)):C("",!0),e("button",{class:"primary",style:{"margin-top":"16px",display:"inline-flex","align-items":"center",gap:"6px"},disabled:c.value||!a.value.product&&!h.value.length,onClick:w},[d(l(U),{size:18,"stroke-width":2}),r(" "+s(c.value?"กำลังสร้าง…":l(o).t("create")),1)],8,$)])])}}},W=M(H,[["__scopeId","data-v-d513596d"]]);export{W as default};
|
*/const E=g("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]),N={class:"card guide"},D={class:"card"},G={style:{"margin-top":"0"}},L={class:"row"},j={style:{flex:"1"}},F={value:"facebook"},I={value:"line"},O={style:{flex:"1"}},T={value:"th"},R={value:"en"},Z={key:0,class:"error"},$=["disabled"],H={__name:"GroupBuilder",setup(J){const _=A(),a=v({product:"",segment:"",description:"",channel:"facebook",language:"th"}),h=v([]),p=v(""),c=v(!1);function b(n){h.value=Array.from(n.target.files||[])}async function w(){c.value=!0,p.value="";try{const n=new FormData;n.append("product",a.value.product),n.append("segment",a.value.segment),n.append("description",a.value.description),n.append("channel",a.value.channel),n.append("language",a.value.language),h.value.forEach(i=>n.append("files",i));const m=(await B.createGroup(n)).group.id;_.push(`/admin/groups/${m}/edit`)}catch(n){p.value=n.message}finally{c.value=!1}}return(n,t)=>{const m=z("router-link");return x(),f("div",null,[d(m,{to:"/training",class:"btn-back"},{default:V(()=>[d(l(P),{size:16,"stroke-width":2}),r(" "+s(l(o).t("training")),1)]),_:1}),e("div",N,[e("strong",null,[d(l(q),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),t[5]||(t[5]=r(" วิธีสร้างกลุ่มบุคคลต้นแบบ",-1))]),t[6]||(t[6]=e("ol",{style:{margin:"8px 0 0","padding-left":"20px","line-height":"1.8"}},[e("li",null,[r("กรอก "),e("strong",null,"ชื่อ/รายละเอียดสินค้าหรือบริการ"),r(" ที่อยากให้ทีมฝึกขาย (ช่องด้านล่าง)")]),e("li",null,"(ไม่บังคับ) ระบุกลุ่มลูกค้าเป้าหมาย หรืออัปโหลดไฟล์เอกสารสินค้า .pdf/.md/.txt"),e("li",null,[r("กด "),e("strong",null,"สร้าง"),r(" — ระบบจะพาไปหน้าสร้างบุคคลต้นแบบ (ลูกค้าจำลอง)")])],-1))]),e("div",D,[e("h2",G,[d(l(S),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),r(" "+s(l(o).t("addProduct")),1)]),e("label",null,[r(s(l(o).t("product"))+" ",1),t[7]||(t[7]=e("span",{class:"req"},"*",-1))]),u(e("textarea",{"onUpdate:modelValue":t[0]||(t[0]=i=>a.value.product=i),rows:"3",placeholder:"เช่น ระบบ POS สำหรับร้านอาหาร Cloud POS for small restaurants"},null,512),[[y,a.value.product]]),e("label",null,s(l(o).t("segment")),1),u(e("input",{"onUpdate:modelValue":t[1]||(t[1]=i=>a.value.segment=i),placeholder:"เช่น SMEs ร้านอาหารในกรุงเทพ"},null,512),[[y,a.value.segment]]),e("label",null,s(l(o).t("description")),1),u(e("textarea",{"onUpdate:modelValue":t[2]||(t[2]=i=>a.value.description=i),rows:"3",placeholder:"รายละเอียดเพิ่มเติม เช่น จุดเด่นสินค้า ราคา ฯลฯ (ไม่บังคับ)"},null,512),[[y,a.value.description]]),e("div",L,[e("div",j,[e("label",null,s(l(o).t("channel")),1),u(e("select",{"onUpdate:modelValue":t[3]||(t[3]=i=>a.value.channel=i)},[e("option",F,s(l(o).t("facebook")),1),e("option",I,s(l(o).t("line")),1)],512),[[k,a.value.channel]])]),e("div",O,[e("label",null,s(l(o).t("language")),1),u(e("select",{"onUpdate:modelValue":t[4]||(t[4]=i=>a.value.language=i)},[e("option",T,s(l(o).t("thai")),1),e("option",R,s(l(o).t("english")),1)],512),[[k,a.value.language]])])]),e("label",null,[d(l(E),{size:15,"stroke-width":1.8,style:{"vertical-align":"-2px"}}),t[8]||(t[8]=r(" ไฟล์เอกสารสินค้า (.pdf/.md/.txt) — ใช้เป็นข้อมูลให้ระบบได้",-1))]),e("input",{type:"file",multiple:"",accept:".pdf,.md,.txt",onChange:b},null,32),p.value?(x(),f("div",Z,s(p.value),1)):C("",!0),e("button",{class:"primary",style:{"margin-top":"16px",display:"inline-flex","align-items":"center",gap:"6px"},disabled:c.value||!a.value.product&&!h.value.length,onClick:w},[d(l(U),{size:18,"stroke-width":2}),r(" "+s(c.value?"กำลังสร้าง…":l(o).t("create")),1)],8,$)])])}}},W=M(H,[["__scopeId","data-v-d513596d"]]);export{W as default};
|
||||||
File diff suppressed because one or more lines are too long
6
frontend/dist/assets/Guide-B7hY6F8k.js
vendored
Normal file
6
frontend/dist/assets/Guide-B7hY6F8k.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import{k as e,c as o,a as l,m as n,u as i,j as s,t as r,i as a,D as u,o as d}from"./index-Dm2VwslH.js";import{B as g}from"./book-open-x8tSBc1t.js";import{L as p}from"./layout-dashboard-LQG3ldGP.js";import{T as m}from"./target-CliUY7kC.js";import{S as y}from"./sparkles-BXnC3-RA.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 h=e("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]),k={class:"card"},v={style:{"margin-top":"0"}},x={class:"card"},f={style:{"margin-top":"0"}},c={class:"card"},w={style:{"margin-top":"0"}},z={class:"card"},_={style:{"margin-top":"0"}},b={__name:"Guide",setup(B){return(S,t)=>(d(),o("div",null,[l("h2",null,[n(i(g),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),s(" "+r(i(a).t("guideTitle")),1)]),t[8]||(t[8]=l("p",{class:"muted"},"คู่มือสั้นๆ สำหรับพนักงานใหม่ — เข้าใจระบบได้ใน 5 นาที",-1)),l("div",k,[l("h3",v,[n(i(p),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),t[0]||(t[0]=s(" 1. หน้า 3 แท็บ (menu ด้านบน)",-1))]),t[1]||(t[1]=l("ul",{style:{"line-height":"1.9"}},[l("li",null,[l("strong",null,"ภาพรวมผู้ดูแล"),s(" — เฉพาะ admin ดูสถิติผลการฝึกของทีม + กรองตามช่วงเวลา")]),l("li",null,[l("strong",null,"ภาพรวมผลการฝึก"),s(" — ของตัวคุณเอง: ชนะ/แพ้/ยังไม่ได้ฝึก")]),l("li",null,[l("strong",null,"การฝึก"),s(" — เลือกสินค้า → เลือกลูกค้า (บุคคลต้นแบบ) → เริ่มแชท")]),l("li",null,[l("strong",null,"การตั้งค่า (⚙︎)"),s(" — แก้ชื่อ/อีเมล, เปลี่ยนรหัสผ่าน, เปลี่ยนภาษา")])],-1))]),l("div",x,[l("h3",f,[n(i(m),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),t[2]||(t[2]=s(" 2. วิธีฝึก (start a session)",-1))]),t[3]||(t[3]=l("ol",{style:{"line-height":"1.9","padding-left":"20px"}},[l("li",null,[s("เข้าแท็บ "),l("strong",null,"การฝึก"),s(" → เลือกสินค้าที่อยากฝึก")]),l("li",null,"เลือกลูกค้า (บุคคลต้นแบบ) — ระดับ A ง่ายสุด / C ยากสุด (ดูดาวความยาก)"),l("li",null,[s("เลือก "),l("strong",null,"สถานการณ์"),s(": โซเชียล (ลูกค้าทักก่อน) / พบหน้า-โทร (คุณทักก่อน) / กลับมาติดต่อ")]),l("li",null,"แชทกับลูกค้า — ฝึกปิดการขาย ลูกค้าจะตัดสินใจเองว่าซื้อหรือไม่ซื้อ"),l("li",null,"หลังจบ ดูผล + ข้อเสนอแนะ + ข้อมูลลูกค้าที่ถูกซ่อนไว้")],-1))]),l("div",c,[l("h3",w,[n(i(y),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),t[4]||(t[4]=s(" 3. เคล็ดลับ",-1))]),t[5]||(t[5]=l("ul",{style:{"line-height":"1.9"}},[l("li",null,[s('ลูกค้าแต่ละคน หรือ "บุคคลต้นแบบ" ฝึกได้ '),l("strong",null,"คนละครั้ง"),s(" (one-shot) — ฝึกจนจบแล้วลองคนอื่น")]),l("li",null,"ถ้าออกกลางคัน กลับมาได้ คุยต่อจากเดิม (ยังไม่นับว่าจบ)"),l("li",null,"ปิดการขาย = แก้ปัญหาจริงของลูกค้า + รับมือข้อโต้แย้ง + ปิดราคา")],-1))]),l("div",z,[l("h3",_,[n(i(h),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),t[6]||(t[6]=s(" 4. สำหรับ Admin",-1))]),t[7]||(t[7]=u('<ul style="line-height:1.9;"><li>ปุ่ม <strong>เพิ่มสินค้า</strong> (หน้า การฝึก) → สร้างกลุ่มบุคคลต้นแบบใหม่</li><li>หน้า <strong>จัดการบุคคลต้นแบบ</strong> → แก้ไขรายละเอียดลูกค้าแต่ละคน แล้วเปิดใช้งาน</li><li>หน้า <strong>ผู้ใช้งาน</strong> → สร้างบัญชีให้ทีม (username + รหัสผ่านเริ่มต้น)</li><li>ปุ่ม <strong>CSV</strong> (หน้า ภาพรวม) → ดาวน์โหลดผลการฝึกทั้งหมด</li></ul>',1))])]))}};export{b as default};
|
||||||
@@ -1 +1 @@
|
|||||||
import{_ as b,c as d,a as e,t as s,u as c,i as o,w as y,v as x,b as w,d as k,e as S,r as l,f,g as V,h as B,o as v}from"./index-Dv9XjhnS.js";const C={class:"login-wrap"},D={class:"card login-card"},K={class:"pw-wrap"},E=["type"],L=["aria-label"],M={key:0,class:"error",role:"alert"},N=["disabled"],R={key:0,class:"spinner"},U={key:1},q={__name:"Login",setup(H){const g=B(),_=V(),n=l(""),u=l(""),a=l(!1),r=l(""),i=l(!1);async function m(){r.value="",i.value=!0;try{await f.login(n.value.trim(),u.value),f.mustSetup?_.push({path:"/setup"}):_.push(g.query.redirect||"/")}catch{r.value=o.t("loginError")}finally{i.value=!1}}return(h,t)=>(v(),d("div",C,[e("div",D,[e("h1",null,"🎯 "+s(c(o).t("app")),1),t[3]||(t[3]=e("p",{class:"muted",style:{"margin-top":"-8px"}},"Sales training simulator",-1)),e("label",null,s(c(o).t("username")),1),y(e("input",{"onUpdate:modelValue":t[0]||(t[0]=p=>n.value=p),type:"text",autocomplete:"username",onKeyup:w(m,["enter"])},null,544),[[x,n.value]]),e("label",null,s(c(o).t("password")),1),e("div",K,[y(e("input",{"onUpdate:modelValue":t[1]||(t[1]=p=>u.value=p),type:a.value?"text":"password",autocomplete:"current-password",onKeyup:w(m,["enter"])},null,40,E),[[k,u.value]]),e("button",{type:"button",class:"pw-toggle",onClick:t[2]||(t[2]=p=>a.value=!a.value),"aria-label":a.value?"Hide password":"Show password"},s(a.value?"🙈":"👁"),9,L)]),r.value?(v(),d("div",M,s(r.value),1)):S("",!0),e("button",{class:"primary",style:{width:"100%","margin-top":"16px"},disabled:i.value||!n.value||!u.value,onClick:m},[i.value?(v(),d("span",R)):(v(),d("span",U,s(c(o).t("login")),1))],8,N)])]))}},P=b(q,[["__scopeId","data-v-f7904d9f"]]);export{P as default};
|
import{_ as b,c as d,a as e,t as s,u as c,i as o,w as y,v as x,b as w,d as k,e as S,r as l,f,g as V,h as B,o as v}from"./index-Dm2VwslH.js";const C={class:"login-wrap"},D={class:"card login-card"},K={class:"pw-wrap"},E=["type"],L=["aria-label"],M={key:0,class:"error",role:"alert"},N=["disabled"],R={key:0,class:"spinner"},U={key:1},q={__name:"Login",setup(H){const g=B(),_=V(),n=l(""),u=l(""),a=l(!1),r=l(""),i=l(!1);async function m(){r.value="",i.value=!0;try{await f.login(n.value.trim(),u.value),f.mustSetup?_.push({path:"/setup"}):_.push(g.query.redirect||"/")}catch{r.value=o.t("loginError")}finally{i.value=!1}}return(h,t)=>(v(),d("div",C,[e("div",D,[e("h1",null,"🎯 "+s(c(o).t("app")),1),t[3]||(t[3]=e("p",{class:"muted",style:{"margin-top":"-8px"}},"Sales training simulator",-1)),e("label",null,s(c(o).t("username")),1),y(e("input",{"onUpdate:modelValue":t[0]||(t[0]=p=>n.value=p),type:"text",autocomplete:"username",onKeyup:w(m,["enter"])},null,544),[[x,n.value]]),e("label",null,s(c(o).t("password")),1),e("div",K,[y(e("input",{"onUpdate:modelValue":t[1]||(t[1]=p=>u.value=p),type:a.value?"text":"password",autocomplete:"current-password",onKeyup:w(m,["enter"])},null,40,E),[[k,u.value]]),e("button",{type:"button",class:"pw-toggle",onClick:t[2]||(t[2]=p=>a.value=!a.value),"aria-label":a.value?"Hide password":"Show password"},s(a.value?"🙈":"👁"),9,L)]),r.value?(v(),d("div",M,s(r.value),1)):S("",!0),e("button",{class:"primary",style:{width:"100%","margin-top":"16px"},disabled:i.value||!n.value||!u.value,onClick:m},[i.value?(v(),d("span",R)):(v(),d("span",U,s(c(o).t("login")),1))],8,N)])]))}},P=b(q,[["__scopeId","data-v-f7904d9f"]]);export{P as default};
|
||||||
6
frontend/dist/assets/MyBoard-DnLYF8gv.js
vendored
6
frontend/dist/assets/MyBoard-DnLYF8gv.js
vendored
@@ -1,6 +0,0 @@
|
|||||||
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-Dv9XjhnS.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};
|
|
||||||
1
frontend/dist/assets/MyBoard-EoWaU1ds.js
vendored
Normal file
1
frontend/dist/assets/MyBoard-EoWaU1ds.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import{_ as f,l as x,s as v,c as r,a as t,m as b,u as e,j as k,t as s,i as a,e as _,w as B,y as N,F as D,q as S,r as p,z as c,o as i,A as T}from"./index-Dm2VwslH.js";import{L as V}from"./layout-dashboard-LQG3ldGP.js";const z={style:{margin:"0"}},L={key:0,class:"row stat-row"},M={class:"card stat"},j={class:"card stat won"},C={class:"card stat lost"},F={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"}},I={__name:"MyBoard",setup(H){const o=p([]),u=p([]),m=p(!0),y=c(()=>o.value.length),g=c(()=>o.value.filter(n=>n.my_outcome==="won").length),h=c(()=>o.value.filter(n=>n.my_outcome==="lost").length),w=c(()=>o.value.filter(n=>n.my_outcome==="not_tried").length);return x(async()=>{try{o.value=(await v.myBoard()).board||[],u.value=(await v.mySessions()).sessions||[]}finally{m.value=!1}}),(n,l)=>(i(),r("div",null,[t("div",null,[t("h2",z,[b(e(V),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),k(" "+s(e(a).t("myDashboard")),1)]),l[0]||(l[0]=t("div",{class:"muted",style:{"margin-top":"4px","margin-bottom":"16px"}},"สรุปผลการฝึกของตัวคุณเอง — ดูว่าปิดการขายได้กี่ครั้ง ยังฝึกกับใครบ้าง",-1))]),m.value?_("",!0):(i(),r("div",L,[t("div",M,[t("span",null,s(e(a).t("total")),1),t("strong",null,s(y.value),1)]),t("div",j,[t("span",null,s(e(a).t("won")),1),t("strong",null,s(g.value),1)]),t("div",C,[t("span",null,s(e(a).t("lost")),1),t("strong",null,s(h.value),1)]),t("div",F,[t("span",null,s(e(a).t("notTried")),1),t("strong",null,s(w.value),1)])])),m.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)])])):_("",!0),B(t("div",E,[t("h3",G,s(e(a).t("mySessions")),1),(i(!0),r(D,null,S(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:T(["badge",d.outcome])},s(d.outcome==="won"?e(a).t("won"):e(a).t("lost")),3)]))),128))],512),[[N,u.value.length]])]))}},O=f(I,[["__scopeId","data-v-6767b6b8"]]);export{O as default};
|
||||||
@@ -1 +1 @@
|
|||||||
import{_ as T,l as $,c as r,m as d,n as m,a as t,t as s,u as e,i as n,f as g,j as _,e as w,F as y,q as p,h as L,s as N,x as V,r as b,o as a,S as I,A as h,B as A}from"./index-Dv9XjhnS.js";import{T as S}from"./target-Do-370k4.js";import{A as j}from"./arrow-left-haz-8IhO.js";const F={class:"row",style:{"align-items":"center"}},q={style:{margin:"0"}},D={class:"muted",style:{"margin-left":"auto"}},E={key:0,class:"card guide"},M={key:1,class:"row",style:{margin:"12px 0",gap:"10px"}},R={class:"primary"},G={class:"grid"},H={class:"row",style:{"justify-content":"space-between"}},J={class:"diff"},K={class:"muted"},O={class:"muted"},Q={class:"muted"},U={class:"muted",style:{"margin-top":"6px"}},W={class:"primary",style:{width:"100%"}},X={class:"primary",style:{width:"100%"}},Y={key:1,class:"muted",style:{"margin-top":"auto","font-size":"12px"}},Z={__name:"Personas",setup(tt){const c=L().params.gid,k=b([]),B=b(!0);async function C(){try{k.value=(await N.listPersonas(c)).personas}finally{B.value=!1}}function z(l){return k.value.filter(i=>i.tier===l)}function P(l){return n.t(l==="A"?"tierA":l==="B"?"tierB":"tierC")}function v(l){return l==="won"?n.t("won"):l==="lost"?n.t("lost"):n.t("notTried")}return $(C),(l,i)=>{const u=V("router-link");return a(),r("div",null,[d(u,{to:"/training",class:"btn-back"},{default:m(()=>[d(e(j),{size:16,"stroke-width":2}),_(" "+s(e(n).t("training")),1)]),_:1}),t("div",F,[t("h2",q,s(e(n).t("personas")),1),t("span",D,s(e(n).t("selectPersona")),1)]),e(g).isAdmin?w("",!0):(a(),r("div",E,[t("strong",null,[d(e(S),{size:17,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),i[0]||(i[0]=_(" วิธีฝึก",-1))]),i[1]||(i[1]=t("ol",{style:{margin:"8px 0 0","padding-left":"20px","line-height":"1.8"}},[t("li",null,"เลือกลูกค้าจำลอง (บุคคลต้นแบบ) คนหนึ่งที่อยากฝึกด้วย"),t("li",null,"ระดับ A ง่ายสุด → ระดับ C ยากสุด (ดูจากดาว ★ ความยาก)"),t("li",null,"กดปุ่มสำหรับฝึกแชทกับลูกค้าคนนั้น (ฝึกได้คนละครั้งเท่านั้น)")],-1))])),e(g).isAdmin?(a(),r("div",M,[d(u,{to:`/admin/groups/${e(c)}/edit`},{default:m(()=>[t("button",R,[d(e(I),{size:18,"stroke-width":1.8}),_(" "+s(e(n).t("managePersonas")),1)])]),_:1},8,["to"]),i[2]||(i[2]=t("span",{class:"muted"},"Admin: จัดการรายละเอียดบุคคลต้นแบบได้ที่นี่",-1))])):w("",!0),(a(),r(y,null,p(["A","B","C"],f=>t("div",{key:f,style:{margin:"20px 0"}},[t("h4",null,s(P(f)),1),t("div",G,[(a(!0),r(y,null,p(z(f),o=>(a(),r("div",{key:o.id,class:"card pcard lift"},[t("div",H,[t("strong",null,s(o.name),1),t("span",{class:h(["badge",o.my_outcome])},s(v(o.my_outcome)),3)]),t("div",J,[(a(),r(y,null,p(5,x=>t("span",{key:x,class:h(["star",{on:x<=(o.difficulty||1)}])},"★",2)),64)),t("span",K,s(e(n).t("difficulty"))+" "+s(o.difficulty||1)+"/5",1)]),t("div",O,[_(s(o.profession)+" · "+s(o.age_group)+" · "+s(o.location),1),i[3]||(i[3]=t("br",null,null,-1)),t("span",{class:h(["badge",o.channel])},s(o.channel),3),t("span",Q," · "+s(o.initiation_mode==="seller"?e(n).t("sellerInitiated"):e(n).t("customerInitiated")),1)]),t("div",U,s(o.product_context),1),e(g).isAdmin?(a(),A(u,{key:0,to:`/groups/${e(c)}/chat/${o.id}`,style:{"margin-top":"auto"}},{default:m(()=>[t("button",W,s(e(n).t("chat")),1)]),_:1},8,["to"])):(a(),r(y,{key:1},[o.my_outcome==="not_tried"?(a(),A(u,{key:0,to:`/groups/${e(c)}/chat/${o.id}`,style:{"margin-top":"auto"}},{default:m(()=>[t("button",X,s(e(n).t("chat")),1)]),_:1},8,["to"])):(a(),r("div",Y,"✓ "+s(e(n).t("trained"))+" ("+s(v(o.my_outcome))+")",1))],64))]))),128))])])),64))])}}},at=T(Z,[["__scopeId","data-v-46d50c99"]]);export{at as default};
|
import{_ as T,l as $,c as r,m as d,n as m,a as t,t as s,u as e,i as n,f as g,j as _,e as w,F as y,q as p,h as L,s as N,x as V,r as b,o as a,S as I,A as h,B as A}from"./index-Dm2VwslH.js";import{T as S}from"./target-CliUY7kC.js";import{A as j}from"./arrow-left-Cm4VHcqz.js";const F={class:"row",style:{"align-items":"center"}},q={style:{margin:"0"}},D={class:"muted",style:{"margin-left":"auto"}},E={key:0,class:"card guide"},M={key:1,class:"row",style:{margin:"12px 0",gap:"10px"}},R={class:"primary"},G={class:"grid"},H={class:"row",style:{"justify-content":"space-between"}},J={class:"diff"},K={class:"muted"},O={class:"muted"},Q={class:"muted"},U={class:"muted",style:{"margin-top":"6px"}},W={class:"primary",style:{width:"100%"}},X={class:"primary",style:{width:"100%"}},Y={key:1,class:"muted",style:{"margin-top":"auto","font-size":"12px"}},Z={__name:"Personas",setup(tt){const c=L().params.gid,k=b([]),B=b(!0);async function C(){try{k.value=(await N.listPersonas(c)).personas}finally{B.value=!1}}function z(l){return k.value.filter(i=>i.tier===l)}function P(l){return n.t(l==="A"?"tierA":l==="B"?"tierB":"tierC")}function v(l){return l==="won"?n.t("won"):l==="lost"?n.t("lost"):n.t("notTried")}return $(C),(l,i)=>{const u=V("router-link");return a(),r("div",null,[d(u,{to:"/training",class:"btn-back"},{default:m(()=>[d(e(j),{size:16,"stroke-width":2}),_(" "+s(e(n).t("training")),1)]),_:1}),t("div",F,[t("h2",q,s(e(n).t("personas")),1),t("span",D,s(e(n).t("selectPersona")),1)]),e(g).isAdmin?w("",!0):(a(),r("div",E,[t("strong",null,[d(e(S),{size:17,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),i[0]||(i[0]=_(" วิธีฝึก",-1))]),i[1]||(i[1]=t("ol",{style:{margin:"8px 0 0","padding-left":"20px","line-height":"1.8"}},[t("li",null,"เลือกลูกค้าจำลอง (บุคคลต้นแบบ) คนหนึ่งที่อยากฝึกด้วย"),t("li",null,"ระดับ A ง่ายสุด → ระดับ C ยากสุด (ดูจากดาว ★ ความยาก)"),t("li",null,"กดปุ่มสำหรับฝึกแชทกับลูกค้าคนนั้น (ฝึกได้คนละครั้งเท่านั้น)")],-1))])),e(g).isAdmin?(a(),r("div",M,[d(u,{to:`/admin/groups/${e(c)}/edit`},{default:m(()=>[t("button",R,[d(e(I),{size:18,"stroke-width":1.8}),_(" "+s(e(n).t("managePersonas")),1)])]),_:1},8,["to"]),i[2]||(i[2]=t("span",{class:"muted"},"Admin: จัดการรายละเอียดบุคคลต้นแบบได้ที่นี่",-1))])):w("",!0),(a(),r(y,null,p(["A","B","C"],f=>t("div",{key:f,style:{margin:"20px 0"}},[t("h4",null,s(P(f)),1),t("div",G,[(a(!0),r(y,null,p(z(f),o=>(a(),r("div",{key:o.id,class:"card pcard lift"},[t("div",H,[t("strong",null,s(o.name),1),t("span",{class:h(["badge",o.my_outcome])},s(v(o.my_outcome)),3)]),t("div",J,[(a(),r(y,null,p(5,x=>t("span",{key:x,class:h(["star",{on:x<=(o.difficulty||1)}])},"★",2)),64)),t("span",K,s(e(n).t("difficulty"))+" "+s(o.difficulty||1)+"/5",1)]),t("div",O,[_(s(o.profession)+" · "+s(o.age_group)+" · "+s(o.location),1),i[3]||(i[3]=t("br",null,null,-1)),t("span",{class:h(["badge",o.channel])},s(o.channel),3),t("span",Q," · "+s(o.initiation_mode==="seller"?e(n).t("sellerInitiated"):e(n).t("customerInitiated")),1)]),t("div",U,s(o.product_context),1),e(g).isAdmin?(a(),A(u,{key:0,to:`/groups/${e(c)}/chat/${o.id}`,style:{"margin-top":"auto"}},{default:m(()=>[t("button",W,s(e(n).t("chat")),1)]),_:1},8,["to"])):(a(),r(y,{key:1},[o.my_outcome==="not_tried"?(a(),A(u,{key:0,to:`/groups/${e(c)}/chat/${o.id}`,style:{"margin-top":"auto"}},{default:m(()=>[t("button",X,s(e(n).t("chat")),1)]),_:1},8,["to"])):(a(),r("div",Y,"✓ "+s(e(n).t("trained"))+" ("+s(v(o.my_outcome))+")",1))],64))]))),128))])])),64))])}}},at=T(Z,[["__scopeId","data-v-46d50c99"]]);export{at as default};
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import{k as z,_ as T,r as c,f as i,c as h,a as e,m as k,u as a,S as $,j as v,t as o,i as s,w as x,v as b,e as V,A as S,s as U,o as w}from"./index-Dv9XjhnS.js";/**
|
import{k as z,_ as T,r as c,f as i,c as h,a as e,m as k,u as a,S as $,j as v,t as o,i as s,w as x,v as b,e as V,A as S,s as U,o as w}from"./index-Dm2VwslH.js";/**
|
||||||
* @license lucide-vue-next v1.0.0 - ISC
|
* @license lucide-vue-next v1.0.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
@@ -1 +1 @@
|
|||||||
import{_ as x,c as v,a as e,t,u as s,i as a,j as S,f as _,w,v as f,b as y,e as V,r,g as K,o as m}from"./index-Dv9XjhnS.js";const T={class:"setup-wrap"},B={class:"card setup-card"},N={class:"muted"},U={key:0,class:"error",role:"alert"},C=["disabled"],D={key:0,class:"spinner"},M={key:1},P={__name:"Setup",setup(j){const k=K(),i=r(""),l=r(""),p=r(""),o=r(""),d=r(!1);async function c(){if(o.value="",l.value.length<4){o.value=a.t("passwordTooShort");return}if(l.value!==p.value){o.value=a.t("passwordMismatch");return}d.value=!0;try{await _.finishSetup(i.value.trim(),l.value),k.push("/")}catch(h){o.value=h.message}finally{d.value=!1}}return(h,u)=>{var b,g;return m(),v("div",T,[e("div",B,[e("h1",null,"🔐 "+t(s(a).t("setupTitle")),1),e("p",N,[S(t(s(a).t("setupSubtitle"))+" ",1),e("strong",null,t(((b=s(_).user)==null?void 0:b.name)||((g=s(_).user)==null?void 0:g.username)),1)]),e("label",null,t(s(a).t("email")),1),w(e("input",{"onUpdate:modelValue":u[0]||(u[0]=n=>i.value=n),type:"email",autocomplete:"email",onKeyup:y(c,["enter"])},null,544),[[f,i.value]]),e("label",null,t(s(a).t("newPassword")),1),w(e("input",{"onUpdate:modelValue":u[1]||(u[1]=n=>l.value=n),type:"password",autocomplete:"new-password",onKeyup:y(c,["enter"])},null,544),[[f,l.value]]),e("label",null,t(s(a).t("confirmPassword")),1),w(e("input",{"onUpdate:modelValue":u[2]||(u[2]=n=>p.value=n),type:"password",autocomplete:"new-password",onKeyup:y(c,["enter"])},null,544),[[f,p.value]]),o.value?(m(),v("div",U,t(o.value),1)):V("",!0),e("button",{class:"primary",style:{width:"100%","margin-top":"16px"},disabled:d.value||!i.value||!l.value||l.value!==p.value,onClick:c},[d.value?(m(),v("span",D)):(m(),v("span",M,t(s(a).t("save")),1))],8,C)])])}}},I=x(P,[["__scopeId","data-v-f190e120"]]);export{I as default};
|
import{_ as x,c as v,a as e,t,u as s,i as a,j as S,f as _,w,v as f,b as y,e as V,r,g as K,o as m}from"./index-Dm2VwslH.js";const T={class:"setup-wrap"},B={class:"card setup-card"},N={class:"muted"},U={key:0,class:"error",role:"alert"},C=["disabled"],D={key:0,class:"spinner"},M={key:1},P={__name:"Setup",setup(j){const k=K(),i=r(""),l=r(""),p=r(""),o=r(""),d=r(!1);async function c(){if(o.value="",l.value.length<4){o.value=a.t("passwordTooShort");return}if(l.value!==p.value){o.value=a.t("passwordMismatch");return}d.value=!0;try{await _.finishSetup(i.value.trim(),l.value),k.push("/")}catch(h){o.value=h.message}finally{d.value=!1}}return(h,u)=>{var b,g;return m(),v("div",T,[e("div",B,[e("h1",null,"🔐 "+t(s(a).t("setupTitle")),1),e("p",N,[S(t(s(a).t("setupSubtitle"))+" ",1),e("strong",null,t(((b=s(_).user)==null?void 0:b.name)||((g=s(_).user)==null?void 0:g.username)),1)]),e("label",null,t(s(a).t("email")),1),w(e("input",{"onUpdate:modelValue":u[0]||(u[0]=n=>i.value=n),type:"email",autocomplete:"email",onKeyup:y(c,["enter"])},null,544),[[f,i.value]]),e("label",null,t(s(a).t("newPassword")),1),w(e("input",{"onUpdate:modelValue":u[1]||(u[1]=n=>l.value=n),type:"password",autocomplete:"new-password",onKeyup:y(c,["enter"])},null,544),[[f,l.value]]),e("label",null,t(s(a).t("confirmPassword")),1),w(e("input",{"onUpdate:modelValue":u[2]||(u[2]=n=>p.value=n),type:"password",autocomplete:"new-password",onKeyup:y(c,["enter"])},null,544),[[f,p.value]]),o.value?(m(),v("div",U,t(o.value),1)):V("",!0),e("button",{class:"primary",style:{width:"100%","margin-top":"16px"},disabled:d.value||!i.value||!l.value||l.value!==p.value,onClick:c},[d.value?(m(),v("span",D)):(m(),v("span",M,t(s(a).t("save")),1))],8,C)])])}}},I=x(P,[["__scopeId","data-v-f190e120"]]);export{I as default};
|
||||||
1
frontend/dist/assets/Training-B1zIgzFu.js
vendored
Normal file
1
frontend/dist/assets/Training-B1zIgzFu.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import{_ as w,l as b,s as A,f as d,c as l,a as t,m as c,u as s,j as _,t as e,i as n,n as m,B as h,e as f,F as B,q as C,r as g,x as N,o as i,A as k}from"./index-Dm2VwslH.js";import{T as P}from"./target-CliUY7kC.js";import{B as T}from"./book-open-x8tSBc1t.js";import{P as z}from"./plus-CAyBY_kw.js";const V={class:"row",style:{"align-items":"center","margin-bottom":"16px"}},j={style:{margin:"0"}},F={class:"row",style:{"margin-left":"auto",gap:"10px"}},L={class:"soft"},S={class:"primary"},$={class:"muted"},q={key:0,class:"card",style:{"min-height":"80px"}},D={key:1,class:"card empty-state"},E={key:0},G={key:1},I={class:"grid"},M={class:"card lift train-card"},O={class:"row",style:{"justify-content":"space-between"}},H={class:"muted",style:{margin:"6px 0 12px"}},J={class:"row",style:{gap:"8px"}},K={class:"muted"},Q={class:"primary",style:{width:"100%","margin-top":"12px"}},R={__name:"Training",setup(U){const u=g([]),y=g(!0);function v(a){return a.sales_kit&&a.sales_kit.productName||a.input&&a.input.product||""}function x(a){return a.personas||a.persona_count||0}return b(async()=>{try{const a=(await A.listGroups()).groups||[];u.value=d.isAdmin?a:a.filter(r=>r.status==="ready")}finally{y.value=!1}}),(a,r)=>{const p=N("router-link");return i(),l("div",null,[t("div",V,[t("h2",j,[c(s(P),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),_(" "+e(s(n).t("training")),1)]),t("div",F,[c(p,{to:"/guide"},{default:m(()=>[t("button",L,[c(s(T),{size:18,"stroke-width":1.8}),r[0]||(r[0]=_(" คู่มือ",-1))])]),_:1}),s(d).isAdmin?(i(),h(p,{key:0,to:"/admin/new-group"},{default:m(()=>[t("button",S,[c(s(z),{size:18,"stroke-width":2}),_(" "+e(s(n).t("addProduct")),1)])]),_:1})):f("",!0)])]),t("p",$,e(s(n).t("trainingSubtitle")),1),y.value?(i(),l("div",q,[...r[1]||(r[1]=[t("div",{class:"skeleton",style:{height:"50px"}},null,-1)])])):u.value.length===0?(i(),l("div",D,[t("strong",null,e(s(n).t("noTraining")),1),s(d).isAdmin?(i(),l("span",E,'Click "'+e(s(n).t("addProduct"))+'" to create a persona group.',1)):(i(),l("span",G,"Ask an admin to create a persona group first."))])):f("",!0),t("div",I,[(i(!0),l(B,null,C(u.value,o=>(i(),h(p,{key:o.id,to:s(d).isAdmin?`/admin/groups/${o.id}/edit`:`/groups/${o.id}/personas`,style:{"text-decoration":"none"}},{default:m(()=>[t("div",M,[t("div",O,[t("strong",null,e(o.title),1),t("span",{class:k(["badge",o.status==="ready"?"ready":"draft"])},e(o.status),3)]),t("div",H,e(v(o)),1),t("div",J,[t("span",{class:k(["badge",o.channel||"line"])},e(o.channel||"line"),3),t("span",K,e(x(o))+" "+e(s(n).t("personas").toLowerCase()),1)]),t("button",Q,e(s(d).isAdmin?o.status==="ready"?s(n).t("managePersonas"):s(n).t("analyze"):s(n).t("selectPersona")),1)])]),_:2},1032,["to"]))),128))])])}}},tt=w(R,[["__scopeId","data-v-e39df241"]]);export{tt as default};
|
||||||
1
frontend/dist/assets/Training-BYBkfggr.css
vendored
Normal file
1
frontend/dist/assets/Training-BYBkfggr.css
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.grid[data-v-e39df241]{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}.train-card[data-v-e39df241]{display:flex;flex-direction:column;height:100%}.badge.ready[data-v-e39df241]{background:#dcfce7;color:#166534}.badge.draft[data-v-e39df241]{background:#fef9c3;color:#854d0e}button.soft[data-v-e39df241]{background:#f1f3f9;border-color:transparent}.badge.facebook[data-v-e39df241]{background:#e0f2fe;color:#0369a1}.badge.line[data-v-e39df241]{background:#dcfce7;color:#15803d}
|
||||||
1
frontend/dist/assets/Training-CeWRER6W.css
vendored
1
frontend/dist/assets/Training-CeWRER6W.css
vendored
@@ -1 +0,0 @@
|
|||||||
.grid[data-v-1e5bd92b]{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}.train-card[data-v-1e5bd92b]{display:flex;flex-direction:column;height:100%}.badge.ready[data-v-1e5bd92b]{background:#dcfce7;color:#166534}.badge.draft[data-v-1e5bd92b]{background:#fef9c3;color:#854d0e}button.soft[data-v-1e5bd92b]{background:#f1f3f9;border-color:transparent}.badge.facebook[data-v-1e5bd92b]{background:#e0f2fe;color:#0369a1}.badge.line[data-v-1e5bd92b]{background:#dcfce7;color:#15803d}
|
|
||||||
1
frontend/dist/assets/Training-D4koaEpE.js
vendored
1
frontend/dist/assets/Training-D4koaEpE.js
vendored
@@ -1 +0,0 @@
|
|||||||
import{_ as w,l as b,s as A,f as l,c as r,a as t,m as _,u as s,j as m,t as e,i as o,B as y,n as h,e as f,F as C,q as N,r as g,x as P,o as i,A as v}from"./index-Dv9XjhnS.js";import{T}from"./target-Do-370k4.js";import{P as B}from"./plus-Dg6sDA5g.js";const z={class:"row",style:{"align-items":"center","margin-bottom":"16px"}},V={style:{margin:"0"}},j={style:{"margin-left":"auto"}},F={class:"primary"},L={class:"muted"},S={key:0,class:"card",style:{"min-height":"80px"}},$={key:1,class:"card empty-state"},q={key:0},D={key:1},E={class:"grid"},G={class:"card lift train-card"},I={class:"row",style:{"justify-content":"space-between"}},M={class:"muted",style:{margin:"6px 0 12px"}},H={class:"row",style:{gap:"8px"}},J={class:"muted"},K={class:"primary",style:{width:"100%","margin-top":"12px"}},O={__name:"Training",setup(Q){const c=g([]),u=g(!0);function k(a){return a.sales_kit&&a.sales_kit.productName||a.input&&a.input.product||""}function x(a){return a.personas||a.persona_count||0}return b(async()=>{try{const a=(await A.listGroups()).groups||[];c.value=l.isAdmin?a:a.filter(d=>d.status==="ready")}finally{u.value=!1}}),(a,d)=>{const p=P("router-link");return i(),r("div",null,[t("div",z,[t("h2",V,[_(s(T),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),m(" "+e(s(o).t("training")),1)]),t("div",j,[s(l).isAdmin?(i(),y(p,{key:0,to:"/admin/new-group"},{default:h(()=>[t("button",F,[_(s(B),{size:18,"stroke-width":2}),m(" "+e(s(o).t("addProduct")),1)])]),_:1})):f("",!0)])]),t("p",L,e(s(o).t("trainingSubtitle")),1),u.value?(i(),r("div",S,[...d[0]||(d[0]=[t("div",{class:"skeleton",style:{height:"50px"}},null,-1)])])):c.value.length===0?(i(),r("div",$,[t("strong",null,e(s(o).t("noTraining")),1),s(l).isAdmin?(i(),r("span",q,'Click "'+e(s(o).t("addProduct"))+'" to create a persona group.',1)):(i(),r("span",D,"Ask an admin to create a persona group first."))])):f("",!0),t("div",E,[(i(!0),r(C,null,N(c.value,n=>(i(),y(p,{key:n.id,to:s(l).isAdmin?`/admin/groups/${n.id}/edit`:`/groups/${n.id}/personas`,style:{"text-decoration":"none"}},{default:h(()=>[t("div",G,[t("div",I,[t("strong",null,e(n.title),1),t("span",{class:v(["badge",n.status==="ready"?"ready":"draft"])},e(n.status),3)]),t("div",M,e(k(n)),1),t("div",H,[t("span",{class:v(["badge",n.channel||"line"])},e(n.channel||"line"),3),t("span",J,e(x(n))+" "+e(s(o).t("personas").toLowerCase()),1)]),t("button",K,e(s(l).isAdmin?n.status==="ready"?s(o).t("managePersonas"):s(o).t("analyze"):s(o).t("selectPersona")),1)])]),_:2},1032,["to"]))),128))])])}}},X=w(O,[["__scopeId","data-v-1e5bd92b"]]);export{X as default};
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import{k as e}from"./index-Dv9XjhnS.js";/**
|
import{k as e}from"./index-Dm2VwslH.js";/**
|
||||||
* @license lucide-vue-next v1.0.0 - ISC
|
* @license lucide-vue-next v1.0.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
6
frontend/dist/assets/book-open-x8tSBc1t.js
vendored
Normal file
6
frontend/dist/assets/book-open-x8tSBc1t.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import{k as a}from"./index-Dm2VwslH.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 e=a("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);export{e as B};
|
||||||
File diff suppressed because one or more lines are too long
6
frontend/dist/assets/layout-dashboard-LQG3ldGP.js
vendored
Normal file
6
frontend/dist/assets/layout-dashboard-LQG3ldGP.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import{k as t}from"./index-Dm2VwslH.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 h=t("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"}]]);export{h as L};
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import{k as e}from"./index-Dv9XjhnS.js";/**
|
import{k as e}from"./index-Dm2VwslH.js";/**
|
||||||
* @license lucide-vue-next v1.0.0 - ISC
|
* @license lucide-vue-next v1.0.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
6
frontend/dist/assets/sparkles-BXnC3-RA.js
vendored
Normal file
6
frontend/dist/assets/sparkles-BXnC3-RA.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import{k as a}from"./index-Dm2VwslH.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 l=a("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);export{l as S};
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import{k as c}from"./index-Dv9XjhnS.js";/**
|
import{k as c}from"./index-Dm2VwslH.js";/**
|
||||||
* @license lucide-vue-next v1.0.0 - ISC
|
* @license lucide-vue-next v1.0.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import{k as e}from"./index-Dv9XjhnS.js";/**
|
import{k as e}from"./index-Dm2VwslH.js";/**
|
||||||
* @license lucide-vue-next v1.0.0 - ISC
|
* @license lucide-vue-next v1.0.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
2
frontend/dist/index.html
vendored
2
frontend/dist/index.html
vendored
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Sales Trainer</title>
|
<title>Sales Trainer</title>
|
||||||
<script type="module" crossorigin src="/assets/index-Dv9XjhnS.js"></script>
|
<script type="module" crossorigin src="/assets/index-Dm2VwslH.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-Bu7f-IE2.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-Bu7f-IE2.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export const api = {
|
|||||||
listPersonas: (gid) => request('GET', `/api/groups/${gid}/personas`),
|
listPersonas: (gid) => request('GET', `/api/groups/${gid}/personas`),
|
||||||
getPersona: (gid, pid) => request('GET', `/api/groups/${gid}/personas/${pid}`),
|
getPersona: (gid, pid) => request('GET', `/api/groups/${gid}/personas/${pid}`),
|
||||||
updatePersona: (gid, pid, b) => request('PUT', `/api/groups/${gid}/personas/${pid}`, b),
|
updatePersona: (gid, pid, b) => request('PUT', `/api/groups/${gid}/personas/${pid}`, b),
|
||||||
chatStart: (gid, pid, scenario) => request('POST', `/api/chat/${gid}/personas/${pid}/chat/start`, scenario || {}),
|
chatStart: (gid, pid, scenario, locale) => request('POST', `/api/chat/${gid}/personas/${pid}/chat/start`, { scenario, locale }),
|
||||||
chatResume: (gid, pid) => request('GET', `/api/chat/${gid}/personas/${pid}/chat/resume`),
|
chatResume: (gid, pid) => request('GET', `/api/chat/${gid}/personas/${pid}/chat/resume`),
|
||||||
chatSend: (gid, pid, text) => request('POST', `/api/chat/${gid}/personas/${pid}/chat/send`, { text }),
|
chatSend: (gid, pid, text) => request('POST', `/api/chat/${gid}/personas/${pid}/chat/send`, { text }),
|
||||||
chatFinish: (gid, pid) => request('POST', `/api/chat/${gid}/personas/${pid}/chat/finish`),
|
chatFinish: (gid, pid) => request('POST', `/api/chat/${gid}/personas/${pid}/chat/finish`),
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ const messages = {
|
|||||||
training: 'Training',
|
training: 'Training',
|
||||||
myDashboard: 'My dashboard',
|
myDashboard: 'My dashboard',
|
||||||
adminOverview: 'Admin overview',
|
adminOverview: 'Admin overview',
|
||||||
|
guideTitle: 'How to use / คู่มือใช้งาน',
|
||||||
settings: 'Settings',
|
settings: 'Settings',
|
||||||
account: 'Account',
|
account: 'Account',
|
||||||
profile: 'Profile',
|
profile: 'Profile',
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ const routes = [
|
|||||||
{ path: '/groups/:gid/chat/:pid', component: () => import('../views/Chat.vue') },
|
{ path: '/groups/:gid/chat/:pid', component: () => import('../views/Chat.vue') },
|
||||||
// Settings
|
// Settings
|
||||||
{ path: '/settings', component: () => import('../views/Settings.vue') },
|
{ path: '/settings', component: () => import('../views/Settings.vue') },
|
||||||
|
// Guide (how to use, non-IT friendly)
|
||||||
|
{ path: '/guide', component: () => import('../views/Guide.vue') },
|
||||||
// Admin management
|
// Admin management
|
||||||
{ path: '/admin/new-group', component: () => import('../views/GroupBuilder.vue'), meta: { admin: true } },
|
{ path: '/admin/new-group', component: () => import('../views/GroupBuilder.vue'), meta: { admin: true } },
|
||||||
{ path: '/admin/groups/:gid/edit', component: () => import('../views/GroupEdit.vue'), meta: { admin: true } },
|
{ path: '/admin/groups/:gid/edit', component: () => import('../views/GroupEdit.vue'), meta: { admin: true } },
|
||||||
|
|||||||
@@ -13,12 +13,13 @@
|
|||||||
|
|
||||||
<!-- Date filter -->
|
<!-- Date filter -->
|
||||||
<div class="card filter-bar">
|
<div class="card filter-bar">
|
||||||
<span class="muted">🗓 {{ i18n.t('dateRange') }}</span>
|
<span class="muted"><Download :size="15" :stroke-width="1.8" style="vertical-align:-2px" /> {{ i18n.t('dateRange') }}</span>
|
||||||
<input type="date" v-model="from" />
|
<input type="date" v-model="from" />
|
||||||
<span>–</span>
|
<span>–</span>
|
||||||
<input type="date" v-model="to" />
|
<input type="date" v-model="to" />
|
||||||
<button class="primary" @click="apply" :disabled="loading">→ {{ i18n.t('apply') }}</button>
|
<button class="primary" @click="apply" :disabled="loading">→ {{ i18n.t('apply') }}</button>
|
||||||
<button @click="clear" :disabled="loading">{{ i18n.t('clear') }}</button>
|
<button @click="clear" :disabled="loading">{{ i18n.t('clear') }}</button>
|
||||||
|
<button class="soft" @click="download"><Download :size="16" :stroke-width="1.8" /> CSV</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Headline metrics -->
|
<!-- Headline metrics -->
|
||||||
@@ -66,8 +67,9 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
import { BarChart3, Users as UsersIcon, Plus } from 'lucide-vue-next'
|
import { BarChart3, Users as UsersIcon, Plus, Download } from 'lucide-vue-next'
|
||||||
import { api } from '../api'
|
import { api } from '../api'
|
||||||
|
import { auth } from '../store/auth'
|
||||||
import { i18n } from '../i18n'
|
import { i18n } from '../i18n'
|
||||||
|
|
||||||
const a = ref({ overall: { total_sessions: 0, wins: 0, losses: 0, close_rate: 0, avg_score: 0 }, trainee_count: 0, hardest_personas: [] })
|
const a = ref({ overall: { total_sessions: 0, wins: 0, losses: 0, close_rate: 0, avg_score: 0 }, trainee_count: 0, hardest_personas: [] })
|
||||||
@@ -85,6 +87,21 @@ async function load() {
|
|||||||
}
|
}
|
||||||
function apply() { load() }
|
function apply() { load() }
|
||||||
function clear() { from.value = ''; to.value = ''; load() }
|
function clear() { from.value = ''; to.value = ''; load() }
|
||||||
|
async function download() {
|
||||||
|
try {
|
||||||
|
const resp = await fetch('/api/analytics/export', { headers: { Authorization: `Bearer ${auth.token}` } })
|
||||||
|
if (!resp.ok) throw new Error('export failed')
|
||||||
|
const blob = await resp.blob()
|
||||||
|
const url = URL.createObjectURL(blob)
|
||||||
|
const aEl = document.createElement('a')
|
||||||
|
aEl.href = url
|
||||||
|
aEl.download = 'sales-trainer-results.csv'
|
||||||
|
aEl.click()
|
||||||
|
URL.revokeObjectURL(url)
|
||||||
|
} catch (e) {
|
||||||
|
alert(e.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
onMounted(load)
|
onMounted(load)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, nextTick, ref } from 'vue'
|
import { computed, onMounted, nextTick, ref } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { Target, ArrowLeft, Search } from 'lucide-vue-next'
|
import { Target, ArrowLeft, Search } from 'lucide-vue-next'
|
||||||
import { api } from '../api'
|
import { api } from '../api'
|
||||||
@@ -105,11 +105,14 @@ const debrief = ref(null)
|
|||||||
const sessionId = ref(null)
|
const sessionId = ref(null)
|
||||||
const picked = ref('social')
|
const picked = ref('social')
|
||||||
|
|
||||||
const scenarios = [
|
const scenarios = computed(() => {
|
||||||
{ id: 'social', emoji: '💬', init: 'customer', label: 'Social Media (แชท)', desc: 'ลูกค้าทักมาหาคุณก่อน — โทนสั้น ทักๆ ตามสไตล์แชท' },
|
const en = i18n.locale === 'en'
|
||||||
{ id: 'f2f_call', emoji: '📞', init: 'seller', label: 'พบหน้า / โทรศัพท์', desc: 'คุณต้องเป็นฝ่ายเปิดการสนทนาเชิงรุกกับลีด (ผู้ฝึกทักก่อน)' },
|
return [
|
||||||
{ id: 'recontact', emoji: '⏳', init: 'customer', label: 'ลูกค้ากลับมาติดต่อ (1-3 เดือน)', desc: 'เคยได้รับข้อมูลไปแล้ว ตอนนี้กลับมาติดต่อ พร้อมตัดสินใจมากขึ้น' },
|
{ id: 'social', emoji: '💬', init: 'customer', label: en ? 'Social Media (chat)' : 'Social Media (แชท)', desc: en ? 'The customer messages you first — short, chat-style replies' : 'ลูกค้าทักมาหาคุณก่อน — โทนสั้น ทักๆ ตามสไตล์แชท' },
|
||||||
]
|
{ id: 'f2f_call', emoji: '📞', init: 'seller', label: en ? 'Face-to-face / Phone' : 'พบหน้า / โทรศัพท์', desc: en ? 'You must proactively open the conversation (seller starts)' : 'คุณต้องเป็นฝ่ายเปิดการสนทนาเชิงรุกกับลีด (ผู้ฝึกทักก่อน)' },
|
||||||
|
{ id: 'recontact', emoji: '⏳', init: 'customer', label: en ? 'Re-contact (1-3 months)' : 'ลูกค้ากลับมาติดต่อ (1-3 เดือน)', desc: en ? 'Customer contacted you before, now returns more ready to decide' : 'เคยได้รับข้อมูลไปแล้ว ตอนนี้กลับมาติดต่อ พร้อมตัดสินใจมากขึ้น' },
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
function scrollDown() {
|
function scrollDown() {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
@@ -120,7 +123,7 @@ const thread = ref(null)
|
|||||||
|
|
||||||
async function begin() {
|
async function begin() {
|
||||||
phase.value = 'chat'
|
phase.value = 'chat'
|
||||||
const res = await api.chatStart(gid, pid, { scenario: picked.value })
|
const res = await api.chatStart(gid, pid, picked.value, i18n.locale)
|
||||||
sessionId.value = res.session.id
|
sessionId.value = res.session.id
|
||||||
messages.value = res.session.messages || []
|
messages.value = res.session.messages || []
|
||||||
if (messages.value.length) scrollDown()
|
if (messages.value.length) scrollDown()
|
||||||
|
|||||||
51
frontend/src/views/Guide.vue
Normal file
51
frontend/src/views/Guide.vue
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<h2><BookOpen :size="22" :stroke-width="1.8" style="vertical-align:-4px" /> {{ i18n.t('guideTitle') }}</h2>
|
||||||
|
<p class="muted">คู่มือสั้นๆ สำหรับพนักงานใหม่ — เข้าใจระบบได้ใน 5 นาที</p>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<h3 style="margin-top:0"><LayoutDashboard :size="18" :stroke-width="1.8" style="vertical-align:-3px" /> 1. หน้า 3 แท็บ (menu ด้านบน)</h3>
|
||||||
|
<ul style="line-height:1.9">
|
||||||
|
<li><strong>ภาพรวมผู้ดูแล</strong> — เฉพาะ admin ดูสถิติผลการฝึกของทีม + กรองตามช่วงเวลา</li>
|
||||||
|
<li><strong>ภาพรวมผลการฝึก</strong> — ของตัวคุณเอง: ชนะ/แพ้/ยังไม่ได้ฝึก</li>
|
||||||
|
<li><strong>การฝึก</strong> — เลือกสินค้า → เลือกลูกค้า (บุคคลต้นแบบ) → เริ่มแชท</li>
|
||||||
|
<li><strong>การตั้งค่า (⚙︎)</strong> — แก้ชื่อ/อีเมล, เปลี่ยนรหัสผ่าน, เปลี่ยนภาษา</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<h3 style="margin-top:0"><Target :size="18" :stroke-width="1.8" style="vertical-align:-3px" /> 2. วิธีฝึก (start a session)</h3>
|
||||||
|
<ol style="line-height:1.9;padding-left:20px">
|
||||||
|
<li>เข้าแท็บ <strong>การฝึก</strong> → เลือกสินค้าที่อยากฝึก</li>
|
||||||
|
<li>เลือกลูกค้า (บุคคลต้นแบบ) — ระดับ A ง่ายสุด / C ยากสุด (ดูดาวความยาก)</li>
|
||||||
|
<li>เลือก <strong>สถานการณ์</strong>: โซเชียล (ลูกค้าทักก่อน) / พบหน้า-โทร (คุณทักก่อน) / กลับมาติดต่อ</li>
|
||||||
|
<li>แชทกับลูกค้า — ฝึกปิดการขาย ลูกค้าจะตัดสินใจเองว่าซื้อหรือไม่ซื้อ</li>
|
||||||
|
<li>หลังจบ ดูผล + ข้อเสนอแนะ + ข้อมูลลูกค้าที่ถูกซ่อนไว้</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<h3 style="margin-top:0"><Sparkles :size="18" :stroke-width="1.8" style="vertical-align:-3px" /> 3. เคล็ดลับ</h3>
|
||||||
|
<ul style="line-height:1.9">
|
||||||
|
<li>ลูกค้าแต่ละคน หรือ "บุคคลต้นแบบ" ฝึกได้ <strong>คนละครั้ง</strong> (one-shot) — ฝึกจนจบแล้วลองคนอื่น</li>
|
||||||
|
<li>ถ้าออกกลางคัน กลับมาได้ คุยต่อจากเดิม (ยังไม่นับว่าจบ)</li>
|
||||||
|
<li>ปิดการขาย = แก้ปัญหาจริงของลูกค้า + รับมือข้อโต้แย้ง + ปิดราคา</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<h3 style="margin-top:0"><Wrench :size="18" :stroke-width="1.8" style="vertical-align:-3px" /> 4. สำหรับ Admin</h3>
|
||||||
|
<ul style="line-height:1.9">
|
||||||
|
<li>ปุ่ม <strong>เพิ่มสินค้า</strong> (หน้า การฝึก) → สร้างกลุ่มบุคคลต้นแบบใหม่</li>
|
||||||
|
<li>หน้า <strong>จัดการบุคคลต้นแบบ</strong> → แก้ไขรายละเอียดลูกค้าแต่ละคน แล้วเปิดใช้งาน</li>
|
||||||
|
<li>หน้า <strong>ผู้ใช้งาน</strong> → สร้างบัญชีให้ทีม (username + รหัสผ่านเริ่มต้น)</li>
|
||||||
|
<li>ปุ่ม <strong>CSV</strong> (หน้า ภาพรวม) → ดาวน์โหลดผลการฝึกทั้งหมด</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { BookOpen, LayoutDashboard, Target, Sparkles, Wrench } from 'lucide-vue-next'
|
||||||
|
import { i18n } from '../i18n'
|
||||||
|
</script>
|
||||||
@@ -2,7 +2,8 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="row" style="align-items:center;margin-bottom:16px">
|
<div class="row" style="align-items:center;margin-bottom:16px">
|
||||||
<h2 style="margin:0"><Target :size="22" :stroke-width="1.8" style="vertical-align:-4px" /> {{ i18n.t('training') }}</h2>
|
<h2 style="margin:0"><Target :size="22" :stroke-width="1.8" style="vertical-align:-4px" /> {{ i18n.t('training') }}</h2>
|
||||||
<div style="margin-left:auto">
|
<div class="row" style="margin-left:auto;gap:10px">
|
||||||
|
<router-link to="/guide"><button class="soft"><BookOpen :size="18" :stroke-width="1.8" /> คู่มือ</button></router-link>
|
||||||
<router-link v-if="auth.isAdmin" to="/admin/new-group">
|
<router-link v-if="auth.isAdmin" to="/admin/new-group">
|
||||||
<button class="primary"><Plus :size="18" :stroke-width="2" /> {{ i18n.t('addProduct') }}</button>
|
<button class="primary"><Plus :size="18" :stroke-width="2" /> {{ i18n.t('addProduct') }}</button>
|
||||||
</router-link>
|
</router-link>
|
||||||
@@ -46,7 +47,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
import { Target, Plus, Settings as SettingsIcon } from 'lucide-vue-next'
|
import { Target, Plus, BookOpen } from 'lucide-vue-next'
|
||||||
import { api } from '../api'
|
import { api } from '../api'
|
||||||
import { auth } from '../store/auth'
|
import { auth } from '../store/auth'
|
||||||
import { i18n } from '../i18n'
|
import { i18n } from '../i18n'
|
||||||
|
|||||||
Reference in New Issue
Block a user