[代码优化]AI: 写作更改样式

pull/482/head
hhhero 2024-07-12 01:39:53 +08:00
parent c76b622722
commit bb17651915
3 changed files with 45 additions and 29 deletions

View File

@ -24,10 +24,11 @@
</h3> </h3>
</DefineLabel> </DefineLabel>
<div class="relative" v-bind="$attrs"> <div class="flex flex-col" v-bind="$attrs">
<!-- tab --> <!-- tab -->
<div class="w-full pt-2 bg-[#f5f7f9] flex justify-center">
<div <div
class="absolute left-1/2 top-2 -translate-x-1/2 w-[303px] rounded-full bg-[#DDDFE3] p-1 z-10" class="w-[303px] rounded-full bg-[#DDDFE3] p-1 z-10"
> >
<div <div
class="flex items-center relative after:content-[''] after:block after:bg-white after:h-[30px] after:w-1/2 after:absolute after:top-0 after:left-0 after:transition-transform after:rounded-full" class="flex items-center relative after:content-[''] after:block after:bg-white after:h-[30px] after:w-1/2 after:absolute after:top-0 after:left-0 after:transition-transform after:rounded-full"
@ -42,8 +43,9 @@
/> />
</div> </div>
</div> </div>
</div>
<div <div
class="px-7 pb-2 pt-[46px] overflow-y-auto lg:block w-[380px] box-border bg-[#ECEDEF] h-full" class="px-7 pb-2 flex-grow overflow-y-auto lg:block w-[380px] box-border bg-[#f5f7f9] h-full"
> >
<div> <div>
<template v-if="selectedTab === 1"> <template v-if="selectedTab === 1">

View File

@ -1,6 +1,7 @@
<template> <template>
<div class="h-full box-border flex flex-col px-7"> <el-card class="my-card h-full">
<h3 class="m-0 h-14 -mx-7 px-7 shrink-0 flex items-center justify-between bg-[#ecedef]"> <template #header
><h3 class="m-0 px-7 shrink-0 flex items-center justify-between">
<span>预览</span> <span>预览</span>
<!-- 展示在右上角 --> <!-- 展示在右上角 -->
<el-button color="#846af7" v-show="showCopy" @click="copyContent" size="small"> <el-button color="#846af7" v-show="showCopy" @click="copyContent" size="small">
@ -9,9 +10,10 @@
</template> </template>
复制 复制
</el-button> </el-button>
</h3> </h3></template
>
<div ref="contentRef" class="hide-scroll-bar flex-grow box-border overflow-y-auto"> <div ref="contentRef" class="hide-scroll-bar h-full box-border overflow-y-auto">
<div class="w-full min-h-full relative flex-grow bg-white box-border p-3 sm:p-7"> <div class="w-full min-h-full relative flex-grow bg-white box-border p-3 sm:p-7">
<!-- 终止生成内容的按钮 --> <!-- 终止生成内容的按钮 -->
<el-button <el-button
@ -36,7 +38,7 @@
/> />
</div> </div>
</div> </div>
</div> </el-card>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -102,4 +104,17 @@ watch(copied, (val) => {
height: 0; height: 0;
} }
} }
.my-card{
display: flex;
flex-direction: column;
:deep(.el-card__body) {
box-sizing: border-box;
flex-grow: 1;
overflow-y: auto;
padding: 0;
@extend .hide-scroll-bar;
}
}
</style> </style>

View File

@ -1,6 +1,5 @@
<template> <template>
<!-- TODO @hhhero整体没啥问题了感觉整体框框的样子可以优化下可以参考下绘图界面例如说1写作的预览和绘图的绘图任务 header2左右的边界有个竖线之类的 --> <div class="absolute top-0 left-0 right-0 bottom-0 flex">
<div class="h-[calc(100vh-var(--top-tool-height)-var(--app-footer-height)-40px)] -m-5 flex">
<Left <Left
:is-writing="isWriting" :is-writing="isWriting"
class="h-full" class="h-full"