@phonghq/go-chat 1.0.45 → 1.0.47
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.
- package/dist/assets/icons/global/IconSms.vue.d.ts +2 -0
- package/dist/assets/icons/global/IconUser.vue.d.ts +2 -0
- package/dist/chat/App.vue.d.ts +2 -9
- package/dist/chat/page/home/PhoneNumpad.vue.d.ts +11 -0
- package/dist/components/common/select/SelectBase.vue.d.ts +27 -1
- package/dist/components/layout/PageError.vue.d.ts +2 -0
- package/dist/components/ui/select/SelectItem.vue.d.ts +2 -2
- package/dist/composable/useListConversations.d.ts +1 -1
- package/dist/composable/useListentEvent.d.ts +1 -1
- package/dist/go-chat.es.js +11199 -10856
- package/dist/go-chat.umd.js +15 -15
- package/dist/plugins/sdk.d.ts +1 -2
- package/dist/style.css +1 -1
- package/dist/test/assets/icons/call/IconPhoneBase.vue.js +20 -0
- package/dist/test/assets/icons/global/IconBackspace.vue.js +28 -0
- package/dist/test/chat/App.vue.js +165 -127
- package/dist/test/chat/page/customer-appointment/CustomerAppointment.vue.js +1 -1
- package/dist/test/chat/page/customer-check-in/CustomerCheckIn.vue.js +1 -1
- package/dist/test/chat/page/customer-detail/CustomerDetail.vue.js +1 -1
- package/dist/test/chat/page/error/Error.vue.js +1 -1
- package/dist/test/chat/page/home/ChatList.vue.js +54 -39
- package/dist/test/chat/page/home/ChatMessage.vue.js +1 -1
- package/dist/test/chat/page/home/ChatMessageItem.vue.js +7 -5
- package/dist/test/chat/page/home/ChatMessageItem2.vue.js +1 -1
- package/dist/test/chat/page/home/Home.vue.js +42 -35
- package/dist/test/chat/page/home/HomeHeader.vue.js +6 -6
- package/dist/test/chat/page/home/InputChat.vue.js +3 -6
- package/dist/test/chat/page/home/PhoneNumpad.vue.js +127 -0
- package/dist/test/chat/page/setting/Setting.vue.js +1 -1
- package/dist/test/components/chat/ScrollEvent/ScrollEvent.vue.js +2 -0
- package/dist/test/components/chat/call/Calling.vue.js +5 -17
- package/dist/test/components/chat/common/input/InputSearch.vue.js +1 -1
- package/dist/test/components/chat/common/modal/Modal.vue.js +1 -1
- package/dist/test/components/chat/customer/Avatar.vue.js +1 -1
- package/dist/test/components/common/modal/ModalBase.vue.js +1 -1
- package/dist/test/components/common/select/SelectBase.vue.js +69 -106
- package/dist/test/components/layout/PageError.vue.js +91 -0
- package/dist/test/components/ui/select/SelectContent.vue.js +2 -2
- package/dist/test/components/ui/select/SelectItem.vue.js +9 -22
- package/dist/test/components/ui/select/SelectTrigger.vue.js +3 -30
- package/dist/test/composable/useInitData.js +2 -2
- package/dist/test/composable/useListConversations.js +5 -5
- package/dist/test/composable/useListentEvent.js +7 -4
- package/dist/test/composable/usePlivo.js +2 -5
- package/dist/test/plugins/axios.js +0 -2
- package/dist/test/plugins/mqtt.js +12 -4
- package/dist/test/plugins/pocketbase.js +1 -2
- package/dist/test/plugins/sdk.js +2 -12
- package/dist/test/plugins/websocket.js +1 -1
- package/dist/test/utils/chat/cache.js +1 -1
- package/dist/test/utils/chat/{auth.js → store/auth.js} +14 -5
- package/dist/test/utils/chat/{call.js → store/call.js} +3 -3
- package/dist/test/utils/chat/{conversation.js → store/conversation.js} +6 -6
- package/dist/test/utils/chat/{message.js → store/message.js} +25 -1
- package/dist/test/utils/chat/{user.js → store/user.js} +2 -2
- package/dist/test/views/home/phone-numpad/ConvercationList.vue.js +174 -0
- package/dist/test/views/home/phone-numpad/PhoneNumpad.vue.js +270 -0
- package/dist/types/chat/auth.d.ts +1 -0
- package/dist/utils/chat/{auth.d.ts → store/auth.d.ts} +4 -1
- package/dist/utils/chat/{call.d.ts → store/call.d.ts} +1 -1
- package/dist/utils/chat/{conversation.d.ts → store/conversation.d.ts} +3 -3
- package/dist/utils/chat/{message.d.ts → store/message.d.ts} +8 -2
- package/dist/utils/chat/{user.d.ts → store/user.d.ts} +2 -2
- package/dist/views/home/phone-numpad/ConvercationList.vue.d.ts +18 -0
- package/dist/views/home/phone-numpad/PhoneNumpad.vue.d.ts +26 -0
- package/package.json +1 -1
- package/dist/composable/useCallHelper.d.ts +0 -48
- package/dist/test/composable/data.json +0 -32
- package/dist/test/composable/useCallHelper.js +0 -339
- /package/dist/assets/icons/{IconAiCheck.vue.d.ts → call/IconPhoneBase.vue.d.ts} +0 -0
- /package/dist/assets/icons/{IconArrowLeft.vue.d.ts → global/IconAiCheck.vue.d.ts} +0 -0
- /package/dist/assets/icons/{IconCloseCircle.vue.d.ts → global/IconArrowLeft.vue.d.ts} +0 -0
- /package/dist/assets/icons/{IconPhone.vue.d.ts → global/IconBackspace.vue.d.ts} +0 -0
- /package/dist/assets/icons/{IconPlus.vue.d.ts → global/IconCloseCircle.vue.d.ts} +0 -0
- /package/dist/assets/icons/{IconSms.vue.d.ts → global/IconPhone.vue.d.ts} +0 -0
- /package/dist/assets/icons/{IconPlan.vue.d.ts → global/IconPlan.vue.d.ts} +0 -0
- /package/dist/assets/icons/{IconUser.vue.d.ts → global/IconPlus.vue.d.ts} +0 -0
- /package/dist/assets/icons/{IconSearch.vue.d.ts → global/IconSearch.vue.d.ts} +0 -0
- /package/dist/test/assets/icons/{IconAiCheck.vue.js → global/IconAiCheck.vue.js} +0 -0
- /package/dist/test/assets/icons/{IconArrowLeft.vue.js → global/IconArrowLeft.vue.js} +0 -0
- /package/dist/test/assets/icons/{IconCloseCircle.vue.js → global/IconCloseCircle.vue.js} +0 -0
- /package/dist/test/assets/icons/{IconPhone.vue.js → global/IconPhone.vue.js} +0 -0
- /package/dist/test/assets/icons/{IconPlan.vue.js → global/IconPlan.vue.js} +0 -0
- /package/dist/test/assets/icons/{IconPlus.vue.js → global/IconPlus.vue.js} +0 -0
- /package/dist/test/assets/icons/{IconSearch.vue.js → global/IconSearch.vue.js} +0 -0
- /package/dist/test/assets/icons/{IconSms.vue.js → global/IconSms.vue.js} +0 -0
- /package/dist/test/assets/icons/{IconUser.vue.js → global/IconUser.vue.js} +0 -0
|
@@ -2,6 +2,7 @@ import mqtt from 'mqtt/dist/mqtt.min';
|
|
|
2
2
|
const mqttOptions = { qos: 1, retain: false };
|
|
3
3
|
// const mqttClient = ref<MqttClient | null>(null)
|
|
4
4
|
let mqttClient = null;
|
|
5
|
+
let _isConnected = false;
|
|
5
6
|
const subscribedTopics = new Set();
|
|
6
7
|
let dataCallBack = [];
|
|
7
8
|
let reconnectCount = 0;
|
|
@@ -9,7 +10,7 @@ const MAX_RECONNECT = 5;
|
|
|
9
10
|
export const connectMqtt = () => {
|
|
10
11
|
return new Promise((resolve, reject) => {
|
|
11
12
|
reconnectCount = 0;
|
|
12
|
-
if (mqttClient &&
|
|
13
|
+
if (mqttClient && _isConnected) {
|
|
13
14
|
return resolve();
|
|
14
15
|
}
|
|
15
16
|
const userInfo = JSON.parse(localStorage.getItem('user') || '{}');
|
|
@@ -29,6 +30,7 @@ export const connectMqtt = () => {
|
|
|
29
30
|
const connectUrl = `wss://${host}:${port}${path}`;
|
|
30
31
|
mqttClient = mqtt.connect(connectUrl, options);
|
|
31
32
|
mqttClient?.on('connect', () => {
|
|
33
|
+
_isConnected = true;
|
|
32
34
|
subscribedTopics.forEach((topic) => mqttClient?.subscribe(topic));
|
|
33
35
|
mqttClient?.on('message', (topic, message) => {
|
|
34
36
|
try {
|
|
@@ -57,9 +59,15 @@ export const connectMqtt = () => {
|
|
|
57
59
|
resolve();
|
|
58
60
|
}
|
|
59
61
|
});
|
|
62
|
+
mqttClient?.on('offline', () => {
|
|
63
|
+
_isConnected = false;
|
|
64
|
+
});
|
|
60
65
|
mqttClient?.on('close', () => {
|
|
66
|
+
_isConnected = false;
|
|
61
67
|
});
|
|
62
68
|
mqttClient?.on('error', (err) => {
|
|
69
|
+
console.log('error', err);
|
|
70
|
+
_isConnected = false;
|
|
63
71
|
reject(err);
|
|
64
72
|
});
|
|
65
73
|
});
|
|
@@ -75,7 +83,7 @@ export const subscribeToTopic = (topic) => {
|
|
|
75
83
|
if (subscribedTopics.has(topic)) {
|
|
76
84
|
return;
|
|
77
85
|
}
|
|
78
|
-
if (
|
|
86
|
+
if (_isConnected) {
|
|
79
87
|
mqttClient?.subscribe(topic, mqttOptions, (err) => {
|
|
80
88
|
if (!err) {
|
|
81
89
|
subscribedTopics.add(topic);
|
|
@@ -88,7 +96,7 @@ export const subscribeToTopic = (topic) => {
|
|
|
88
96
|
}
|
|
89
97
|
};
|
|
90
98
|
export const unsubscribeFromTopic = (topic) => {
|
|
91
|
-
if (
|
|
99
|
+
if (_isConnected) {
|
|
92
100
|
mqttClient?.unsubscribe(topic, (err) => {
|
|
93
101
|
if (!err) {
|
|
94
102
|
subscribedTopics.delete(topic);
|
|
@@ -104,7 +112,7 @@ export const unsubscribeFromTopic = (topic) => {
|
|
|
104
112
|
}
|
|
105
113
|
};
|
|
106
114
|
export const publishMessage = (topic, payload) => {
|
|
107
|
-
if (
|
|
115
|
+
if (_isConnected && payload) {
|
|
108
116
|
const message = typeof payload !== 'string' ? JSON.stringify(payload) : payload;
|
|
109
117
|
mqttClient?.publish(topic, message, { qos: 1, retain: false }, (err) => {
|
|
110
118
|
if (!err) {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import PocketBase from 'pocketbase';
|
|
2
|
-
// const instance = new PocketBase("https://gap-calendar-data.srv01.dtsmart.dev");
|
|
3
2
|
const instance = new PocketBase("https://gap-calendar-log.gci-app.dtsmart.dev/");
|
|
4
3
|
export const createBusinessTenantPhone = async (data) => {
|
|
5
4
|
await instance.collection('go_chat_service').create(data);
|
|
6
5
|
};
|
|
7
6
|
export const checkHasBusinessTenantPhone = async (id) => {
|
|
8
7
|
try {
|
|
9
|
-
|
|
8
|
+
await instance.collection('go_chat_service').getFirstListItem(`tenant_id="${id}"`);
|
|
10
9
|
return true;
|
|
11
10
|
}
|
|
12
11
|
catch (e) {
|
package/dist/test/plugins/sdk.js
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import Gap, { GapApiVersion } from 'gap-nodejs-sdk';
|
|
2
1
|
import { GapMiniAppSdk } from 'gap-miniapp-sdk';
|
|
3
2
|
import logger from '../utils/logger';
|
|
4
|
-
import { loginTenant, setDataLogin } from '../utils/chat/auth';
|
|
3
|
+
import { loginTenant, setDataLogin } from '../utils/chat/store/auth';
|
|
5
4
|
import { setAxiosGciInstance } from '../plugins/axios-gci';
|
|
6
|
-
const baseSdk = new Gap.BaseApi(GapApiVersion.V1);
|
|
7
5
|
const gapMiniAppSdk = (function () {
|
|
8
6
|
let instance;
|
|
9
|
-
// let domain = '';
|
|
10
|
-
// let gClient = '';
|
|
11
|
-
// let token = '';
|
|
12
|
-
// if (process.env.NODE_ENV === "development") {
|
|
13
|
-
// domain = import.meta.env.VITE_DOMAIN;
|
|
14
|
-
// gClient = import.meta.env.VITE_GCLIENT_ID;
|
|
15
|
-
// token = import.meta.env.VITE_TOKEN;
|
|
16
|
-
// }
|
|
17
7
|
function createInstance() {
|
|
18
8
|
return new GapMiniAppSdk(logger);
|
|
19
9
|
}
|
|
@@ -80,4 +70,4 @@ const sdkInit = (data) => {
|
|
|
80
70
|
}
|
|
81
71
|
});
|
|
82
72
|
};
|
|
83
|
-
export { sdkInit, gapMiniAppSdk
|
|
73
|
+
export { sdkInit, gapMiniAppSdk };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import axios from '
|
|
2
|
-
import { gapMiniAppSdk } from '
|
|
1
|
+
import axios from '../../../plugins/axios';
|
|
2
|
+
import { gapMiniAppSdk } from '../../../plugins/sdk';
|
|
3
3
|
import { ref } from 'vue';
|
|
4
|
+
import axios_gci from '../../../plugins/axios-gci';
|
|
4
5
|
export const dataProfile = ref(null);
|
|
5
6
|
export const dataLoginLink = ref(null);
|
|
6
7
|
let dataLogin = {
|
|
@@ -41,13 +42,14 @@ export const getProfile = async () => {
|
|
|
41
42
|
export const checkTenantPhoneOnGapInsight = async () => {
|
|
42
43
|
const id = localStorage.getItem('chat_id');
|
|
43
44
|
const res = await axios.get(`/api/v1/message/tenant/get-info?tenant_name=${id}`);
|
|
44
|
-
if (res
|
|
45
|
+
if (res?.error || !res?.data)
|
|
45
46
|
throw new Error(res.error);
|
|
46
47
|
if (dataProfile.value)
|
|
47
48
|
dataProfile.value.tenant_phone = res?.data?.go_chat_phone ?? '';
|
|
48
|
-
// if(dataProfile.value) dataProfile.value.tenant_phone = ''
|
|
49
49
|
if (dataProfile.value)
|
|
50
50
|
dataProfile.value.tenant_phone_limit = Number(res?.data?.go_chat_phone_limit ?? 0);
|
|
51
|
+
if (dataProfile.value)
|
|
52
|
+
dataProfile.value.tenant_phone_forwarding = res?.data?.go_chat_phone_forwarding ?? '';
|
|
51
53
|
if (dataProfile.value?.phone != dataProfile.value?.tenant_phone &&
|
|
52
54
|
dataProfile.value?.tenant_phone) {
|
|
53
55
|
updateProfile({ phone: dataProfile.value?.tenant_phone });
|
|
@@ -60,11 +62,18 @@ export const submitTenantPhone = async (body) => {
|
|
|
60
62
|
return res;
|
|
61
63
|
};
|
|
62
64
|
export const updateProfile = async (body) => {
|
|
63
|
-
const res = await axios.post('/api/v1/message/tenant/update', {
|
|
65
|
+
const res = await axios.post('/api/v1/message/tenant/update', {
|
|
66
|
+
...body,
|
|
67
|
+
id: dataProfile.value?.id
|
|
68
|
+
});
|
|
64
69
|
console.log(res);
|
|
65
70
|
dataProfile.value = res;
|
|
66
71
|
return res;
|
|
67
72
|
};
|
|
73
|
+
export const getBusinessInfo = async () => {
|
|
74
|
+
const res = await axios_gci.get('/v1/pos/business/site/get-info');
|
|
75
|
+
return res;
|
|
76
|
+
};
|
|
68
77
|
export const logout = async () => {
|
|
69
78
|
dataLogin = { id: '', token: '', domain: '' };
|
|
70
79
|
dataProfile.value = null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import axios from '
|
|
2
|
-
import { dataProfile } from '
|
|
3
|
-
import { showPageError } from '
|
|
1
|
+
import axios from '../../../plugins/axios';
|
|
2
|
+
import { dataProfile } from './auth';
|
|
3
|
+
import { showPageError } from '../page-error';
|
|
4
4
|
const BARE_WEBSOCKET_URL = 'https://web-socket.dev01.dtsmart.dev';
|
|
5
5
|
// const BARE_WEBSOCKET_URL = 'https://web-socket-test.dev01.dtsmart.dev'
|
|
6
6
|
// const BARE_WEBSOCKET_URL = 'http://192.168.1.173:3000'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import axios from '
|
|
2
|
-
import { getCountUnread } from '
|
|
1
|
+
import axios from '../../../plugins/axios';
|
|
2
|
+
import { getCountUnread } from './message';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
|
-
import { DATE_FORMATS, TIME_ZONE_UTC } from '
|
|
5
|
-
import { dataProfile } from '
|
|
6
|
-
import { publishMessage } from '
|
|
7
|
-
import { TOPIC_HOME } from '
|
|
4
|
+
import { DATE_FORMATS, TIME_ZONE_UTC } from '../../../constant/datetime';
|
|
5
|
+
import { dataProfile } from './auth';
|
|
6
|
+
import { publishMessage } from '../../../plugins/mqtt';
|
|
7
|
+
import { TOPIC_HOME } from '../../../constant/mqtt';
|
|
8
8
|
export const getConversation = async (param) => {
|
|
9
9
|
const res = await axios.get('/api/v1/message/conversation/get-conversation', {
|
|
10
10
|
params: param
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import axios from '
|
|
1
|
+
import axios from '../../../plugins/axios';
|
|
2
2
|
export const getMessage = async (params) => {
|
|
3
3
|
const res = await axios.get('/api/v1/message/message/get-message', {
|
|
4
4
|
params
|
|
@@ -28,6 +28,30 @@ export const sendMessage = async (body) => {
|
|
|
28
28
|
});
|
|
29
29
|
return res;
|
|
30
30
|
};
|
|
31
|
+
export const sendMessageSmsTest = async (body) => {
|
|
32
|
+
const time = Date.now().toString(16); // timestamp hex
|
|
33
|
+
// const random = crypto.randomUUID().replace(/-/g, '').slice(0, 16)
|
|
34
|
+
const uuid = `${'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
|
35
|
+
const r = (Math.random() * 16) | 0;
|
|
36
|
+
const v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
37
|
+
return v.toString(16);
|
|
38
|
+
})}-${time}`;
|
|
39
|
+
for (let i = 1; i <= 7; i++) {
|
|
40
|
+
try {
|
|
41
|
+
const res = await axios.post('http://192.168.1.116:8081/api/v1/public/message/site/webhook-sms', { ...body, message_uuid: uuid, message_time: '2025-11-18 10:11:45.404027' }, {
|
|
42
|
+
headers: {
|
|
43
|
+
'Content-Type': 'multipart/form-data',
|
|
44
|
+
token: '7z62dhqbhfPIsw7hom1vZTOhmGiRz',
|
|
45
|
+
Authorization: ''
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return res;
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
console.log(err);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
31
55
|
export const getCountUnread = async (params) => {
|
|
32
56
|
const res = await axios.get('/api/v1/message/message/unread-count', { params });
|
|
33
57
|
return res;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref } from 'vue';
|
|
2
|
-
import axios_gci from '
|
|
3
|
-
import axios from '
|
|
2
|
+
import axios_gci from '../../../plugins/axios-gci';
|
|
3
|
+
import axios from '../../../plugins/axios';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
export const user = ref(null);
|
|
6
6
|
export const userHistory = ref(null);
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
|
|
2
|
+
import { phoneNumberFormat } from '../../../utils/string-helper';
|
|
3
|
+
import ScrollEvent from '../../../components/chat/ScrollEvent/ScrollEvent.vue';
|
|
4
|
+
import Avatar from '../../../components/chat/customer/Avatar.vue';
|
|
5
|
+
import { ref } from 'vue';
|
|
6
|
+
import { getConversation } from '../../../utils/chat/store/conversation';
|
|
7
|
+
import { useDebounce } from '../../../utils/debounce';
|
|
8
|
+
const emit = defineEmits();
|
|
9
|
+
const userList = ref([]);
|
|
10
|
+
let pageCount = 0;
|
|
11
|
+
const params = ref({
|
|
12
|
+
page: 1,
|
|
13
|
+
search: ''
|
|
14
|
+
});
|
|
15
|
+
const active = defineModel('active');
|
|
16
|
+
const scrollEventRef = ref(null);
|
|
17
|
+
const handleScroll = useDebounce(async () => {
|
|
18
|
+
if (params.value.page >= pageCount) {
|
|
19
|
+
scrollEventRef.value?.hideLoading();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
params.value.page = params.value.page + 1;
|
|
23
|
+
await getUserList();
|
|
24
|
+
}, 200);
|
|
25
|
+
const getUserList = async (phone, option) => {
|
|
26
|
+
try {
|
|
27
|
+
if (phone != undefined)
|
|
28
|
+
params.value.search = phone;
|
|
29
|
+
if ((params.value.search?.length ?? 0) < 4)
|
|
30
|
+
return (userList.value = []);
|
|
31
|
+
if (option?.reset) {
|
|
32
|
+
active.value = null;
|
|
33
|
+
params.value.page = 1;
|
|
34
|
+
}
|
|
35
|
+
const res = await getConversation(params.value);
|
|
36
|
+
if (option?.reset) {
|
|
37
|
+
userList.value = [];
|
|
38
|
+
}
|
|
39
|
+
userList.value.push(...(res?.items ?? []));
|
|
40
|
+
params.value.page = res?._meta?.currentPage || 1;
|
|
41
|
+
pageCount = res?._meta?.pageCount || 1;
|
|
42
|
+
checkActiveUserList();
|
|
43
|
+
if (option?.reset) {
|
|
44
|
+
getAllList();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
console.log(e);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const getAllList = async () => {
|
|
52
|
+
while (params.value.page < pageCount && !scrollEventRef.value?.canScroll()) {
|
|
53
|
+
params.value.page = params.value.page + 1;
|
|
54
|
+
await getUserList();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const handleSelectConversation = (item) => {
|
|
58
|
+
active.value = item;
|
|
59
|
+
emit('selectConversation', item);
|
|
60
|
+
};
|
|
61
|
+
const checkActiveUserList = () => {
|
|
62
|
+
if (params.value.search.length == 10) {
|
|
63
|
+
active.value = userList.value.find(item => item.phone === ('1' + params.value.search)) ?? null;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const __VLS_exposed = { getUserList, checkActiveUserList };
|
|
67
|
+
defineExpose(__VLS_exposed);
|
|
68
|
+
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
69
|
+
const __VLS_modelEmit = defineEmits();
|
|
70
|
+
const __VLS_ctx = {
|
|
71
|
+
...{},
|
|
72
|
+
...{},
|
|
73
|
+
...{},
|
|
74
|
+
...{},
|
|
75
|
+
...{},
|
|
76
|
+
};
|
|
77
|
+
let __VLS_elements;
|
|
78
|
+
let __VLS_components;
|
|
79
|
+
let __VLS_directives;
|
|
80
|
+
/** @type {[typeof ScrollEvent, typeof ScrollEvent, ]} */ ;
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
const __VLS_0 = __VLS_asFunctionalComponent(ScrollEvent, new ScrollEvent({
|
|
83
|
+
...{ 'onGetDataBottom': {} },
|
|
84
|
+
ref: "scrollEventRef",
|
|
85
|
+
...{ class: "h-full overflow-auto flex flex-col gap-y-2" },
|
|
86
|
+
bottom: true,
|
|
87
|
+
}));
|
|
88
|
+
const __VLS_1 = __VLS_0({
|
|
89
|
+
...{ 'onGetDataBottom': {} },
|
|
90
|
+
ref: "scrollEventRef",
|
|
91
|
+
...{ class: "h-full overflow-auto flex flex-col gap-y-2" },
|
|
92
|
+
bottom: true,
|
|
93
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_0));
|
|
94
|
+
let __VLS_3;
|
|
95
|
+
let __VLS_4;
|
|
96
|
+
const __VLS_5 = ({ getDataBottom: {} },
|
|
97
|
+
{ onGetDataBottom: (__VLS_ctx.handleScroll) });
|
|
98
|
+
/** @type {typeof __VLS_ctx.scrollEventRef} */ ;
|
|
99
|
+
var __VLS_6 = {};
|
|
100
|
+
const { default: __VLS_8 } = __VLS_2.slots;
|
|
101
|
+
// @ts-ignore
|
|
102
|
+
[handleScroll, scrollEventRef,];
|
|
103
|
+
for (const [user] of __VLS_getVForSourceType((__VLS_ctx.userList))) {
|
|
104
|
+
// @ts-ignore
|
|
105
|
+
[userList,];
|
|
106
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
|
|
107
|
+
...{ onClick: (...[$event]) => {
|
|
108
|
+
__VLS_ctx.handleSelectConversation(user);
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
[handleSelectConversation,];
|
|
111
|
+
} },
|
|
112
|
+
...{ class: "shrink-0 w-full overflow-hidden flex items-center gap-2 hover:bg-[#EDF5FF] cursor-pointer px-6 py-2" },
|
|
113
|
+
...{ class: ({ 'bg-[#EDF5FF]': __VLS_ctx.active && __VLS_ctx.active?.id == user.id }) },
|
|
114
|
+
key: (user.id),
|
|
115
|
+
});
|
|
116
|
+
// @ts-ignore
|
|
117
|
+
[active, active,];
|
|
118
|
+
/** @type {[typeof Avatar, ]} */ ;
|
|
119
|
+
// @ts-ignore
|
|
120
|
+
const __VLS_9 = __VLS_asFunctionalComponent(Avatar, new Avatar({
|
|
121
|
+
id: (user.id),
|
|
122
|
+
...{ class: "shrink-0" },
|
|
123
|
+
src: (''),
|
|
124
|
+
color: (user.color ?? ''),
|
|
125
|
+
name: (user.username ?? ''),
|
|
126
|
+
}));
|
|
127
|
+
const __VLS_10 = __VLS_9({
|
|
128
|
+
id: (user.id),
|
|
129
|
+
...{ class: "shrink-0" },
|
|
130
|
+
src: (''),
|
|
131
|
+
color: (user.color ?? ''),
|
|
132
|
+
name: (user.username ?? ''),
|
|
133
|
+
}, ...__VLS_functionalComponentArgsRest(__VLS_9));
|
|
134
|
+
__VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({});
|
|
135
|
+
__VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
|
|
136
|
+
...{ class: "truncate font-semibold" },
|
|
137
|
+
});
|
|
138
|
+
(user.username);
|
|
139
|
+
__VLS_asFunctionalElement(__VLS_elements.p, __VLS_elements.p)({
|
|
140
|
+
...{ class: "truncate" },
|
|
141
|
+
});
|
|
142
|
+
(__VLS_ctx.phoneNumberFormat(user.phone ?? ''));
|
|
143
|
+
// @ts-ignore
|
|
144
|
+
[phoneNumberFormat,];
|
|
145
|
+
}
|
|
146
|
+
var __VLS_2;
|
|
147
|
+
/** @type {__VLS_StyleScopedClasses['h-full']} */ ;
|
|
148
|
+
/** @type {__VLS_StyleScopedClasses['overflow-auto']} */ ;
|
|
149
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
150
|
+
/** @type {__VLS_StyleScopedClasses['flex-col']} */ ;
|
|
151
|
+
/** @type {__VLS_StyleScopedClasses['gap-y-2']} */ ;
|
|
152
|
+
/** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
|
|
153
|
+
/** @type {__VLS_StyleScopedClasses['w-full']} */ ;
|
|
154
|
+
/** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
|
|
155
|
+
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
156
|
+
/** @type {__VLS_StyleScopedClasses['items-center']} */ ;
|
|
157
|
+
/** @type {__VLS_StyleScopedClasses['gap-2']} */ ;
|
|
158
|
+
/** @type {__VLS_StyleScopedClasses['hover:bg-[#EDF5FF]']} */ ;
|
|
159
|
+
/** @type {__VLS_StyleScopedClasses['cursor-pointer']} */ ;
|
|
160
|
+
/** @type {__VLS_StyleScopedClasses['px-6']} */ ;
|
|
161
|
+
/** @type {__VLS_StyleScopedClasses['py-2']} */ ;
|
|
162
|
+
/** @type {__VLS_StyleScopedClasses['bg-[#EDF5FF]']} */ ;
|
|
163
|
+
/** @type {__VLS_StyleScopedClasses['shrink-0']} */ ;
|
|
164
|
+
/** @type {__VLS_StyleScopedClasses['truncate']} */ ;
|
|
165
|
+
/** @type {__VLS_StyleScopedClasses['font-semibold']} */ ;
|
|
166
|
+
/** @type {__VLS_StyleScopedClasses['truncate']} */ ;
|
|
167
|
+
// @ts-ignore
|
|
168
|
+
var __VLS_7 = __VLS_6;
|
|
169
|
+
const __VLS_export = (await import('vue')).defineComponent({
|
|
170
|
+
setup: () => (__VLS_exposed),
|
|
171
|
+
__typeEmits: {},
|
|
172
|
+
__typeProps: {},
|
|
173
|
+
});
|
|
174
|
+
export default {};
|