From ff0ae974a1c561eaf2915988dac63cd066af189f Mon Sep 17 00:00:00 2001 From: yinbangzhong <zhongbangyin@126.com> Date: 星期四, 12 九月 2024 09:23:44 +0800 Subject: [PATCH] bug fix --- src/views/sessionManager/components/historySession.vue | 103 ++++++++------------------------------------------- 1 files changed, 17 insertions(+), 86 deletions(-) diff --git a/src/views/sessionManager/components/historySession.vue b/src/views/sessionManager/components/historySession.vue index 243d7dc..a7b9018 100644 --- a/src/views/sessionManager/components/historySession.vue +++ b/src/views/sessionManager/components/historySession.vue @@ -32,15 +32,9 @@ <div class="historyTitle___F_iam">鍘嗗彶浼氳瘽</div> <div class="search"> - <!-- 鏌ヨ妗�--> - <div class="search-box"> - <icon-search /> - <a-input - placeholder="鎼滅储鍘嗗彶浼氳瘽" - v-model="searchValue" - style="width: 90%" - /> - </div> + <a-input-search @change="querySessionList('')" v-model="searchValue" class="search-box" placeholder="鎸変笅Enter閿紝鎼滅储浼氳瘽鍚嶇О"> + + </a-input-search> </div> <div class="historyCenter"> @@ -82,41 +76,17 @@ </div> </template> <script setup lang="ts"> - import { - IconClose, - IconSearch, - IconTiktokColor, - } from '@arco-design/web-vue/es/icon'; - import { useAppStore, useUserStore } from '@/store'; - import { - computed, - nextTick, - onMounted, - watch, - reactive, - ref, - onBeforeMount, - onBeforeUnmount, - } from 'vue'; +import { IconClose, IconSearch } from "@arco-design/web-vue/es/icon"; +import { nextTick, onBeforeMount, onBeforeUnmount, onMounted, reactive, ref } from "vue"; - import { Message, Modal } from '@arco-design/web-vue'; - import EventBus from '@/utils/EventBus'; - import moment from 'moment'; - import { - addSessionApi, - chatApi, - getDialogListApi, - getSessionDetailsApi, - deleteSessionApi, - sessionListApiPage, - } from '@/api/session'; +import { Message, Modal } from "@arco-design/web-vue"; +import EventBus from "@/utils/EventBus"; +import moment from "moment"; +import { deleteSessionApi, sessionListApiPage } from "@/api/session"; +import logo from "@/assets/images/model.png"; - import { queryCanvasList } from '@/api/Agent'; - const emit = defineEmits(['querySessionDetail', 'changeAgentType']); - import logo from '@/assets/images/model.png'; - import { deleteKnow } from '@/api/kbList'; - import { getAgentSessionDetailsApi } from '@/api/agentSession'; - const sessionList = ref([]); //浼氳瘽鍒楄〃 +const emit = defineEmits(['querySessionDetail', 'changeAgentType']); +const sessionList = ref([]); //浼氳瘽鍒楄〃 const activeSessionId = ref(''); const fieldNames = { value: 'id', label: 'name' }; const dialogs = ref([]); @@ -138,54 +108,12 @@ let sessionScrollList = ref([]); let isReached = ref(true); - const DialogList = async () => { - const { code, data } = await getDialogListApi(); - if (code === 200) { - if (data) { - selectValue.value = data[0].id; - dialogs.value = data.map((item) => { - return { - ...item, - type: 1, //鏅鸿兘浣� - }; - }); - // console.log(data, "dialogs"); - queryCanvas(); - } - } - }; - - const queryCanvas = async (params = {}) => { - try { - const { data } = await queryCanvasList(params); - console.log(data, 'agent'); - agentList.value = data.map((item) => { - return { - ...item, - name: item.title, - type: 2, //agent - }; - }); - // 鍚堝苟鏁扮粍 - dialogs.value = dialogs.value.concat(agentList.value); - - // 鍒ゆ柇褰撳墠鏄櫤鑳戒綋鎴朼gent - // console.log(val, 'val'); - // if (dialogs.value.length > 0) { - // dialogChange(dialogs.value[0].id); - // } - //鏂板缓浼氳瘽 - querySessionList(dialogs.value[0].id); - } catch (err) { - // you can report use errorHandler or other - } finally { - } - }; // 鏌ヨ浼氳瘽鍒楄〃 const querySessionList = async (id) => { const { code, data } = await sessionListApiPage({ dialog_id: id, + searchParam: searchValue.value, ...queryPage, }); if (code === 200) { @@ -281,6 +209,10 @@ ...queryPage, }); if (code === 200) { + if (data.length == 0) { + isReached.value = true; + return; + } sessionScrollList.value = data.map((item) => { return { ...item, @@ -313,7 +245,6 @@ console.log(httpUrl, '褰撳墠鍦板潃'); EventBus.on('history', () => { emit('changeAgentType', '3'); - // DialogList() queryPage.page = 1; querySessionList(''); }); -- Gitblit v1.8.0