|
@@ -34,22 +34,26 @@ const props = defineProps({
|
|
|
const recentSearchType = useRecentSearchTypeStore();
|
|
const recentSearchType = useRecentSearchTypeStore();
|
|
|
|
|
|
|
|
const { api_status, api_message, list_agents, getAgentList } = useAgentList4History((agent_list) => {
|
|
const { api_status, api_message, list_agents, getAgentList } = useAgentList4History((agent_list) => {
|
|
|
- const cur_id = recentSearchType?.search_type?.id || '';
|
|
|
|
|
|
|
+ if (recentSearchType.search_type) {
|
|
|
|
|
+ const cur_id = recentSearchType.search_type?.id || '';
|
|
|
|
|
|
|
|
- let item = null;
|
|
|
|
|
|
|
+ let item = null;
|
|
|
|
|
|
|
|
- const len = agent_list.length;
|
|
|
|
|
- for (let i = 0; i < len; i++) {
|
|
|
|
|
- const agent = agent_list[i];
|
|
|
|
|
|
|
+ const len = agent_list.length;
|
|
|
|
|
+ for (let i = 0; i < len; i++) {
|
|
|
|
|
+ const agent = agent_list[i];
|
|
|
|
|
|
|
|
- if (agent.id === cur_id) {
|
|
|
|
|
- item = agent;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ if (agent.id === cur_id) {
|
|
|
|
|
+ item = agent;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- if (item) {
|
|
|
|
|
- handleChatTypeConfirm(item);
|
|
|
|
|
|
|
+ if (item) {
|
|
|
|
|
+ handleChatTypeConfirm(item);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ handleChatTypeConfirm(agent_list[0]);
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
handleChatTypeConfirm(agent_list[0]);
|
|
handleChatTypeConfirm(agent_list[0]);
|
|
|
}
|
|
}
|