| | |
| | | </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" |
| | |
| | | <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> |
| | |
| | | |
| | | <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: [ |
| | |
| | | } |
| | | setTimeout(() => { |
| | | activeRoomId.value = room.id; |
| | | |
| | | }, 0); |
| | | |
| | | |
| | | |
| | | }; |
| | | |
| | | const newChatRoomClick = async () => { |
| | |
| | | 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) { |
| | |
| | | box-shadow: unset; |
| | | } |
| | | } |
| | | ::-webkit-scrollbar { |
| | | height: 0; |
| | | width: 0; |
| | | color: transparent; |
| | | } |
| | | </style> |