Merge branch 'test' of http://47.103.154.90:83/r/WI/Web.V1.0 into test
| | |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | //修改对话分组列表标题 |
| | | export const setHistoryGroupTitle = async (params, req: any = request) => { |
| | | return req({ |
| | | url: 'history/set_history_group_title', |
| | |
| | | 'Content-Type': 'application/x-www-form-urlencoded', |
| | | }, |
| | | }); |
| | | |
| | | |
| | |
| | | <div class="sticky bottom-0 w-full p-6 bg-[rgb(247,248,250)] flex justify-center" v-if="isShareCheck"></div> |
| | | </div> |
| | | <CustomDrawer v-model:isShow="drawerIsShow" @updateChatInput="updateChatInput" /> |
| | | <el-dialog |
| | | title="分享链接" |
| | | v-model="shareCodeIsShow" |
| | | width="25%" |
| | | center |
| | | modal-append-to-body |
| | | lock-scroll |
| | | :before-close="closeShareClick" |
| | | > |
| | | <el-dialog title="分享链接" v-model="shareCodeIsShow" width="25%" modal-append-to-body lock-scroll :before-close="closeShareClick"> |
| | | <div class="w100 h100 flex justify-center items-center flex-col"> |
| | | <div class="qrcode h100" ref="qrcodeRef"></div> |
| | | <div class="h100 w100 flex flex-col justify-center items-center"> |
| | |
| | | <span class="use_name">登</span> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="agent_line"></div> |
| | | <div class="nav__chat" @click="newChatRoomClick()"> |
| | | <div class="nav__chat-icon"> |
| | | <span class="chat_img ywifont ywicon-weixin !text-[26px] text-[#fff]"></span> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | <div class="nav_history_list bg-[#1c1e1d]" v-show="isShowHistoryChatRoom" ref="historyChatRoomRef"> |
| | |
| | | <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 !text-sm" @click="editChat(item)"></div> |
| | | <el-popconfirm title="确定删除聊天记录?" @confirm.stop="confirmDeleteChatRoom(item)" width="180"> |
| | | <template #reference> |
| | | <div class="ywifont invisible ywicon-shanchu3 group-hover:visible"></div> |
| | |
| | | |
| | | <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'; |
| | | import { DeleteHistoryGroups } from '/@/api/ai/chat'; |
| | | import { DeleteHistoryGroups, setHistoryGroupTitle } from '/@/api/ai/chat'; |
| | | import { useSearch } from '/@/hooks/useSearch'; |
| | | import { DateFilter, dateFilterMap } from '/@/model/types/date'; |
| | | import { |
| | |
| | | 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(async (edit) => { |
| | | const res = await setHistoryGroupTitle({ |
| | | history_group_id: room.id, |
| | | title: edit.value, |
| | | }); |
| | | if (res.json_ok) { |
| | | const foundIndex = chatRoomList.value.findIndex((item) => item.id === activeRoomId.value); |
| | | chatRoomList.value[foundIndex].title = edit.value; |
| | | chatRoomRef.value.firstElementChild?.scrollIntoView(); |
| | | } |
| | | }) |
| | | .catch(({ value }) => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '取消修改', |
| | | }); |
| | | }); |
| | | }; |
| | | onClickOutside( |
| | | historyChatRoomRef, |
| | | () => { |
| | | isShowHistoryChatRoom.value = false; |
| | | }, |
| | | { |
| | | ignore: ['.el-message-box', '.el-popper'], |
| | | } |
| | | ); |
| | | //#endregion |
| | | //#region ====================== 公司信息 ====================== |
| | | const companyClick = () => { |
| | |
| | | <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 !text-sm"></div> --> |
| | | |
| | | <div class="ywifont invisible ywicon-bianji group-hover:visible !text-sm" @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> |
| | |
| | | |
| | | <script setup lang="ts"> |
| | | import { Search } from '@element-plus/icons-vue'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus'; |
| | | import moment from 'moment'; |
| | | import { computed, onMounted, ref, watch } from 'vue'; |
| | | import type { ChatRoomItem } from './types'; |
| | | import { DeleteHistoryGroups } from '/@/api/ai/chat'; |
| | | import { DeleteHistoryGroups, setHistoryGroupTitle } from '/@/api/ai/chat'; |
| | | import { useSearch } from '/@/hooks/useSearch'; |
| | | import { DateFilter, dateFilterMap } from '/@/model/types/date'; |
| | | import { activeRoomId, chatRoomList, gotoAnswerPage, newChatRoomClick } from '/@/stores/chatRoom'; |
| | | import { debounce, getRecentDateRange } from '/@/utils/util'; |
| | | |
| | | const chatRoomRef = ref<HTMLDivElement>(null); |
| | | const queryParams = ref({ |
| | | title: '', |
| | |
| | | roomClick(chatRoomList.value[0]); |
| | | chatRoomRef.value.firstElementChild?.scrollIntoView(); |
| | | }; |
| | | |
| | | const editChat = (room: ChatRoomItem) => { |
| | | ElMessageBox.prompt('', '重命名', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | inputPattern: /^[\s\S]*.*[^\s][\s\S]*$/, |
| | | inputValue: room.title, |
| | | inputErrorMessage: '请输入新的名称', |
| | | }) |
| | | .then(async (edit) => { |
| | | const res = await setHistoryGroupTitle({ |
| | | history_group_id: room.id, |
| | | title: edit.value, |
| | | }); |
| | | if (res.json_ok) { |
| | | const foundIndex = chatRoomList.value.findIndex((item) => item.id === room.id); |
| | | chatRoomList.value[foundIndex].title = edit.value; |
| | | chatRoomRef.value.firstElementChild?.scrollIntoView(); |
| | | } |
| | | }) |
| | | .catch(({ value }) => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: '取消修改', |
| | | }); |
| | | }); |
| | | }; |
| | | //#region ====================== 日期筛选 ====================== |
| | | |
| | | const activeDateFilter = ref<DateFilter>(DateFilter.All); |