feat: 首页调整
This commit is contained in:
@ -5,9 +5,11 @@ import Conversations from '@/components/xt-chat/conversations';
|
||||
import SvgIcon from '@/components/svg-icon';
|
||||
import { Button, Flex, Input } from 'ant-design-vue';
|
||||
import DeleteChatModal from './delete-chat-modal.vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
export default {
|
||||
setup(props, { emit, expose }) {
|
||||
const router = useRouter();
|
||||
const open = ref(false);
|
||||
const dataSource = ref([]);
|
||||
const activeKey = ref('');
|
||||
@ -19,6 +21,7 @@ export default {
|
||||
};
|
||||
const getData = () => {
|
||||
dataSource.value = Array.from({ length: 4 }).map((conversation, index) => ({
|
||||
id: `${index + 1}`,
|
||||
key: `item${index + 1}`,
|
||||
label: `Conversation Item ${index + 1}Conversation Item 1`,
|
||||
}));
|
||||
@ -43,6 +46,15 @@ export default {
|
||||
const handleRename = (item) => {
|
||||
console.log('handleRename', item);
|
||||
};
|
||||
const handleActiveChange = (item) => {
|
||||
const { id } = item;
|
||||
router.push({
|
||||
name: 'Home',
|
||||
params: {
|
||||
conversationId: id,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
expose({
|
||||
showDrawer,
|
||||
@ -60,6 +72,7 @@ export default {
|
||||
dataSource={dataSource.value}
|
||||
onMenuClick={handleMenuClick}
|
||||
onRename={handleRename}
|
||||
onActiveChange={handleActiveChange}
|
||||
/>
|
||||
</section>
|
||||
<DeleteChatModal ref={deleteChatModalRef} />
|
||||
|
||||
Reference in New Issue
Block a user