yangyin
2024-11-26 ea24bd60c42e8284415e37e7992768a470abe777
增加重命名管理
已修改2个文件
56 ■■■■ 文件已修改
src/components/chat/Chat.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/component/sidebar/SidebarOther.vue 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chat/Chat.vue
@@ -275,15 +275,7 @@
            <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">
src/layout/component/sidebar/SidebarOther.vue
@@ -81,6 +81,7 @@
                        <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>
@@ -103,11 +104,21 @@
                </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';
@@ -144,6 +155,8 @@
const queryParams = ref({
    title: '',
});
const userRenameVisible = ref(false);
const userRenameText = ref('');
const historyChatRoomClick = () => {
    isShowHistoryChatRoom.value = true;
};
@@ -165,10 +178,35 @@
    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 = () => {