yangyin
2024-07-02 740f89d71cb52f2a30e91dcf6f164f10f44619a5
src/layout/component/sidebar/waterLeftAside/asideNew.vue
@@ -26,7 +26,7 @@
            </div>
         </div>
         <div class="flex-auto text-[#ccc] flex flex-col items-center mt-6 overflow-y-auto" ref="chatRoomRef">
         <div class="flex-auto text-[#ccc] flex flex-col items-center mt-6 overflow-y-auto set-scroll" ref="chatRoomRef">
            <div
               :class="{ 'bg-[#41424a]': item.id === activeRoomId }"
               class="group flex items-center w-full h-10 rounded-md cursor-pointer px-2 py-2 flex-0"
@@ -39,7 +39,7 @@
               <div class="text-gray-100 flex items-center space-x-2 ml-1">
                  <div class="ywicon invisible icon-bianji visible group-hover:visible !text-sm"></div>
                  <el-popconfirm title="确定删除这个聊天室?" @confirm.stop="confirmDeleteChatRoom(item)">
                  <el-popconfirm title="确定删除聊天记录?" @confirm.stop="confirmDeleteChatRoom(item)" width="180">
                     <template #reference>
                        <div class="ywicon invisible icon-shanchu3 visible group-hover:visible"></div>
                     </template>
@@ -53,11 +53,11 @@
<script setup lang="ts">
import { Search } from '@element-plus/icons-vue';
import { nextTick, onMounted, reactive, ref } from 'vue';
import { onMounted, reactive, ref } from 'vue';
import type { ChatRoomItem } from './types';
import router from '/@/router';
import { CreateHistoryGroup, DeleteHistoryGroups, GetHistoryGroups } from '/@/api/ai/chat';
import { chatRoomList, activeRoomId } from '/@/stores/chatRoom';
import router from '/@/router';
import { activeRoomId, chatRoomList } from '/@/stores/chatRoom';
let state = reactive({
   searchInput: '',
   selectDateOption: [
@@ -102,11 +102,7 @@
   }
   setTimeout(() => {
      activeRoomId.value = room.id;
   }, 0);
};
const newChatRoomClick = async () => {
@@ -131,13 +127,11 @@
   gotoAnswerPage(room);
};
const confirmDeleteChatRoom =async (room: ChatRoomItem) => {
const confirmDeleteChatRoom = async (room: ChatRoomItem) => {
   const res = await DeleteHistoryGroups({
      history_group_id:room.id
      history_group_id: room.id,
   });
   const foundIndex = chatRoomList.value.findIndex((item) => item === room);
   chatRoomList.value.splice(foundIndex, 1);
   if (chatRoomList.value.length === 0) {
@@ -188,4 +182,9 @@
      box-shadow: unset;
   }
}
::-webkit-scrollbar {
   height: 0;
   width: 0;
   color: transparent;
}
</style>