| | |
| | | <div class="ywifont ywicon-xiaoxi1 flex-0 mr-2.5"></div> |
| | | <div class="flex-auto text-ellipsis text-nowrap text-sm group-hover:text-[#0084ff]">{{ item.title }}</div> |
| | | <div class="text-gray-100 flex items-center space-x-2 ml-1"> |
| | | <div class="ywifont invisible ywicon-bianji group-hover:visible" @click.stop="editChat(item)"></div> |
| | | <el-popconfirm title="确定删除聊天记录?" @confirm.stop="confirmDeleteChatRoom(item)" width="180"> |
| | | <template #reference> |
| | | <div class="ywifont invisible ywicon-shanchu3 group-hover:visible"></div> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- <el-dialog v-model="userRenameVisible" title="重命名" width="500" :before-close="handleCloseRename" class="el-dialog-rename"> |
| | | <el-input v-model="userRenameText" :rows="8" type="textarea" /> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="handleCloseRename">取消</el-button> |
| | | <el-button type="primary" @click="confirmRename"> 确 定 </el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> --> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { onClickOutside } from '@vueuse/core'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus'; |
| | | import moment from 'moment'; |
| | | import { computed, onMounted, ref, watch, watchEffect } from 'vue'; |
| | | import type { ChatRoomItem } from './components/types'; |
| | |
| | | const queryParams = ref({ |
| | | title: '', |
| | | }); |
| | | const userRenameVisible = ref(false); |
| | | const userRenameText = ref(''); |
| | | const historyChatRoomClick = () => { |
| | | isShowHistoryChatRoom.value = true; |
| | | }; |
| | |
| | | roomClick(chatRoomList.value[0]); |
| | | chatRoomRef.value.firstElementChild?.scrollIntoView(); |
| | | }; |
| | | |
| | | onClickOutside(historyChatRoomRef, () => { |
| | | isShowHistoryChatRoom.value = false; |
| | | }); |
| | | const editChat = (room: ChatRoomItem) => { |
| | | ElMessageBox.prompt('', '重命名', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | inputPattern: /^[\s\S]*.*[^\s][\s\S]*$/, |
| | | inputValue: room.title, |
| | | inputErrorMessage: '请输入新的名称', |
| | | }) |
| | | .then((value) => { |
| | | const foundIndex = chatRoomList.value.findIndex((item) => item.id === activeRoomId.value); |
| | | chatRoomList.value[foundIndex].title = userRenameText.value; |
| | | userRenameVisible.value = false; |
| | | }) |
| | | .catch(({ value }) => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '取消修改', |
| | | }); |
| | | }); |
| | | }; |
| | | onClickOutside( |
| | | historyChatRoomRef, |
| | | () => { |
| | | isShowHistoryChatRoom.value = false; |
| | | }, |
| | | { |
| | | ignore: ['.el-message-box'], |
| | | } |
| | | ); |
| | | //#endregion |
| | | //#region ====================== 公司信息 ====================== |
| | | const companyClick = () => { |