Refactoring code module 08_KPI

This commit is contained in:
STW_TTTY\stwtt 2024-09-10 11:42:43 +07:00
parent 3636f380fb
commit 67d117dcfc
48 changed files with 989 additions and 1140 deletions

View file

@ -52,13 +52,11 @@ export const useSupportStore = defineStore("supportServiceStore", () => {
name: r.name,
role: r.role,
});
// console.log("online: ", userStatus.value);
});
socket.on("offline", (socketId: string) => {
if (socketId === socket.id) return;
userStatus.value = userStatus.value.filter((v) => v.socketId !== socketId);
// console.log("offline: ", userStatus.value);
});
socket.on("notify-message", (r) => {
@ -87,8 +85,6 @@ export const useSupportStore = defineStore("supportServiceStore", () => {
}
socket.emit("mark-read", { issueId: currentIssue.value });
scrollToEnd();
// console.log(r.id);
// console.log(message.value?.result.message);
});
socket.on("read", (r) => {
@ -97,7 +93,6 @@ export const useSupportStore = defineStore("supportServiceStore", () => {
if (v.fromUserId === r.fromUserId) return r;
return v;
});
// console.log("event(read):", messageStatus.value);
}
});
@ -108,8 +103,6 @@ export const useSupportStore = defineStore("supportServiceStore", () => {
}
function sendMessage(content: string, to: string) {
// console.log(content);
// console.log(to);
if (content.trim() !== "") {
socket.emit("message", { to, content });
scrollToEnd();
@ -128,7 +121,6 @@ export const useSupportStore = defineStore("supportServiceStore", () => {
});
if (res && res.data) {
messageStatus.value = res.data;
// console.log(messageStatus.value);
}
}
@ -165,7 +157,6 @@ export const useSupportStore = defineStore("supportServiceStore", () => {
if (res && res.data) {
issue.value = res.data;
// console.log(JSON.stringify(res.data, null, 2));
}
}
@ -183,7 +174,6 @@ export const useSupportStore = defineStore("supportServiceStore", () => {
if (res && res.data) {
issueCategory.value = res.data;
// console.log(JSON.stringify(res.data, null, 2));
}
}
@ -206,7 +196,6 @@ export const useSupportStore = defineStore("supportServiceStore", () => {
if (res) {
fetchIssue();
// console.log(JSON.stringify(res.data, null, 2));
}
}
@ -218,7 +207,6 @@ export const useSupportStore = defineStore("supportServiceStore", () => {
});
if (res && res.data) {
issue.value = res.data;
// console.log(issue.value);
}
}