cloud-web-corejs 1.0.54-dev.637 → 1.0.54-dev.638

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,69 +0,0 @@
1
- export const AGENT_STATE_MAP = {
2
- "-1": { label: "离线", className: "is-offline" },
3
- "0": { label: "忙碌", className: "is-busy" },
4
- "1": { label: "空闲", className: "is-idle" },
5
- "3": { label: "通话中", className: "is-talking" },
6
- "99": { label: "异常", className: "is-busy" },
7
- "114": { label: "小休", className: "is-rest" },
8
- "115": { label: "后处理", className: "is-busy" },
9
- "116": { label: "培训", className: "is-rest" },
10
- "117": { label: "会议", className: "is-rest" },
11
- "118": { label: "用餐", className: "is-rest" },
12
- "119": { label: "活动", className: "is-rest" },
13
- };
14
-
15
- export function getAgentStateMeta(state) {
16
- const key = state === undefined || state === null ? "-1" : String(state);
17
- return AGENT_STATE_MAP[key] || { label: "未知", className: "is-busy" };
18
- }
19
-
20
- /** 小休/用餐等置忙子状态,不应被 AgentStateBusy 无参推送覆盖为「忙碌」 */
21
- export const REST_AGENT_STATES = new Set([
22
- "114",
23
- "115",
24
- "116",
25
- "117",
26
- "118",
27
- "119",
28
- ]);
29
-
30
- export function isRestAgentState(state) {
31
- return REST_AGENT_STATES.has(String(state));
32
- }
33
-
34
- /** 允许外呼的座席状态(空闲、忙碌及小休/用餐等,见智齿文档 4.4 / 4.7) */
35
- export const DIALABLE_AGENT_STATES = new Set([
36
- "0",
37
- "1",
38
- "114",
39
- "116",
40
- "117",
41
- "118",
42
- "119",
43
- ]);
44
-
45
- export function canAgentDial(state) {
46
- return DIALABLE_AGENT_STATES.has(String(state));
47
- }
48
-
49
- /**
50
- * 从 queryAgentState / WebSocket 载荷解析展示用状态。
51
- * 小休、用餐等子状态时 agentState 常为 "0",实际子状态在 busyCause(与文档一致,与 agentState 同码)。
52
- */
53
- export function resolveAgentStateFromPayload(source) {
54
- if (!source) {
55
- return null;
56
- }
57
- const busyCause = source.busyCause ?? source.busycause;
58
- if (busyCause !== undefined && busyCause !== null && busyCause !== "") {
59
- const cause = String(busyCause);
60
- if (isRestAgentState(cause) || cause === "115") {
61
- return cause;
62
- }
63
- }
64
- const agentState = source.agentState ?? source.agentstate;
65
- if (agentState !== undefined && agentState !== null && agentState !== "") {
66
- return String(agentState);
67
- }
68
- return null;
69
- }
@@ -1,22 +0,0 @@
1
- /**
2
- * 智齿呼叫中心初始化参数,请在 .env 中配置或部署前修改。
3
- * client_id / client_secret 对应控制台 appId / app_key
4
- */
5
- const toNumber = (value, fallback) => {
6
- const num = Number(value);
7
- return Number.isNaN(num) ? fallback : num;
8
- };
9
-
10
- export default {
11
- client_id: process.env.VUE_APP_CALL_CENTER_CLIENT_ID || "",
12
- client_secret: process.env.VUE_APP_CALL_CENTER_CLIENT_SECRET || "",
13
- companyId: process.env.VUE_APP_CALL_CENTER_COMPANY_ID || "",
14
- appId: process.env.VUE_APP_CALL_CENTER_APP_ID || "",
15
-
16
- // agentId: process.env.VUE_APP_CALL_CENTER_AGENT_ID || "",
17
- // groupId: process.env.VUE_APP_CALL_CENTER_GROUP_ID || "",
18
- // voipAccount: process.env.VUE_APP_CALL_CENTER_VOIP_ACCOUNT || "",
19
- // callWay: toNumber(process.env.VUE_APP_CALL_CENTER_CALL_WAY, 1),
20
-
21
- displayNumber: process.env.VUE_APP_CALL_CENTER_DISPLAY_NUMBER || "",
22
- };