fix aside

This commit is contained in:
ccmjga
2025-06-01 17:17:55 +08:00
parent 65c96abf9d
commit f030be9c92
4 changed files with 24 additions and 13 deletions

View File

@@ -3,8 +3,19 @@ import { http, HttpResponse } from "msw";
export default [
http.post("/ai/chat", () => {
const response = new HttpResponse(
`data: ${faker.lorem.sentence({ min: 10, max: 100 })}\n\n`,
{
headers: {
"Content-Type": "text/event-stream",
},
},
);
return response;
}),
http.post("/ai/action/chat", () => {
const response = HttpResponse.json({
message: faker.lorem.sentence({ min: 100, max: 300 }),
action: "CREATE_USER",
});
return response;
}),

View File

@@ -1,8 +1,7 @@
<template>
<div
class="flex flex-col box-border px-3 scroll-auto overflow-auto fixed top-0 right-0 w-64 border-gray-200 border-l min-h-screen"
<div class="h-[calc(100vh-3.5rem)] flex flex-col box-border p-3 overflow-y-auto w-72 border-gray-200 border-l"
ref="chatContainer">
<div class="flex flex-col gap-y-5 flex-1">
<div class="flex flex-col gap-y-5 flex-1 pb-2">
<li v-for="chatElement in messages" :key="chatElement.content"
:class="['flex items-start gap-2.5', chatElement.isUser ? 'flex-row-reverse' : 'flex-row']">
<img class="w-8 h-8 rounded-full" :src="chatElement.isUser ? '/java.svg' : '/trump.jpg'" alt="avatar">
@@ -143,10 +142,6 @@ const commandContentMap: Record<string, string> = {
DELETE_DEPARTMENT: "删除部门",
};
const toggleMode = () => {
isCommandMode.value = !isCommandMode.value;
};
marked.setOptions({
gfm: true,
breaks: true,

View File

@@ -9,8 +9,13 @@ import Assistant from "./Assistant.vue";
<Headbar></Headbar>
<Sidebar>
</Sidebar>
<article class="flex flex-row ml-44 mr-64 scroll-auto overflow-auto mt-14">
<RouterView></RouterView>
</article>
<Assistant></Assistant>
<!-- 主内容区域 -->
<div class="flex flex-row h-[calc(100vh-3.5rem)] mt-14"> <!-- 减去Headbar高度 -->
<!-- 文章内容区域 -->
<article class="flex-1 ml-44 overflow-y-auto">
<RouterView></RouterView>
</article>
<Assistant></Assistant>
</div>
</template>

View File

@@ -1,5 +1,5 @@
<template>
<div class="px-4 pt-6 xl:grid-cols-3 xl:gap-4 sm:rounded-lg">
<div class="px-4 pt-6 xl:grid-cols-3 xl:gap-4 sm:rounded-lg ">
<div class="mb-4 col-span-full">
<Breadcrumbs :names="['用户管理']" />
<h1 class="text-xl font-semibold text-gray-900 sm:text-2xl ">用户管理</h1>