【增加】AI 对话增加置顶,和取消置顶

This commit is contained in:
cherishsince 2024-05-17 22:58:44 +08:00
parent 1c8bdc7e7e
commit d8dcc911b5

View File

@ -42,8 +42,9 @@
</div> </div>
<!-- TODO @fan缺一个置顶按钮效果改成 hover 上去展示 --> <!-- TODO @fan缺一个置顶按钮效果改成 hover 上去展示 -->
<div class="button-wrapper"> <div class="button-wrapper">
<el-button link> <el-button link @click="handlerTop(conversation)">
<el-icon title="置顶"><Top /></el-icon> <el-icon title="置顶" v-if="!conversation.pinned"><Top /></el-icon>
<el-icon title="置顶" v-if="conversation.pinned"><Bottom /></el-icon>
</el-button> </el-button>
<el-button link @click="updateConversationTitle(conversation)"> <el-button link @click="updateConversationTitle(conversation)">
<el-icon title="编辑" > <el-icon title="编辑" >
@ -89,7 +90,7 @@
import {ChatConversationApi, ChatConversationVO} from '@/api/ai/chat/conversation' import {ChatConversationApi, ChatConversationVO} from '@/api/ai/chat/conversation'
import {ref} from "vue"; import {ref} from "vue";
import Role from "@/views/ai/chat/role/index.vue"; import Role from "@/views/ai/chat/role/index.vue";
import {Top} from "@element-plus/icons-vue"; import {Bottom, Top} from "@element-plus/icons-vue";
const message = useMessage() // const message = useMessage() //
@ -259,6 +260,16 @@ const deleteChatConversation = async (conversation: ChatConversationVO) => {
} }
} }
/**
* 对话置顶
*/
const handlerTop = async (conversation: ChatConversationVO) => {
//
conversation.pinned = !conversation.pinned
await ChatConversationApi.updateChatConversationMy(conversation)
//
await getChatConversationList()
}
// ============ // ============