[代码优化]AI: 写作更改样式
parent
c76b622722
commit
bb17651915
|
@ -24,26 +24,28 @@
|
||||||
</h3>
|
</h3>
|
||||||
</DefineLabel>
|
</DefineLabel>
|
||||||
|
|
||||||
<div class="relative" v-bind="$attrs">
|
<div class="flex flex-col" v-bind="$attrs">
|
||||||
<!-- tab -->
|
<!-- tab -->
|
||||||
<div
|
<div class="w-full pt-2 bg-[#f5f7f9] flex justify-center">
|
||||||
class="absolute left-1/2 top-2 -translate-x-1/2 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="w-[303px] rounded-full bg-[#DDDFE3] p-1 z-10"
|
||||||
:class="selectedTab === AiWriteTypeEnum.REPLY && 'after:transform after:translate-x-[100%]'"
|
|
||||||
>
|
>
|
||||||
<ReuseTab
|
<div
|
||||||
v-for="tab in tabs"
|
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"
|
||||||
:key="tab.value"
|
:class="selectedTab === AiWriteTypeEnum.REPLY && 'after:transform after:translate-x-[100%]'"
|
||||||
:text="tab.text"
|
>
|
||||||
:active="tab.value === selectedTab"
|
<ReuseTab
|
||||||
:itemClick="() => switchTab(tab.value)"
|
v-for="tab in tabs"
|
||||||
/>
|
:key="tab.value"
|
||||||
|
:text="tab.text"
|
||||||
|
:active="tab.value === selectedTab"
|
||||||
|
:itemClick="() => switchTab(tab.value)"
|
||||||
|
/>
|
||||||
|
</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">
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
<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
|
||||||
<span>预览</span>
|
><h3 class="m-0 px-7 shrink-0 flex items-center justify-between">
|
||||||
<!-- 展示在右上角 -->
|
<span>预览</span>
|
||||||
<el-button color="#846af7" v-show="showCopy" @click="copyContent" size="small">
|
<!-- 展示在右上角 -->
|
||||||
<template #icon>
|
<el-button color="#846af7" v-show="showCopy" @click="copyContent" size="small">
|
||||||
<Icon icon="ph:copy-bold" />
|
<template #icon>
|
||||||
</template>
|
<Icon icon="ph:copy-bold" />
|
||||||
复制
|
</template>
|
||||||
</el-button>
|
复制
|
||||||
</h3>
|
</el-button>
|
||||||
|
</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>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- TODO @hhhero:整体没啥问题了。感觉整体框框的样子可以优化下,可以参考下绘图界面。例如说:1)写作的“预览”和绘图的“绘图任务”的 header;2)左右的边界,有个竖线之类的。 -->
|
<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"
|
||||||
|
|
Loading…
Reference in New Issue