Skip to content

Commit bb17651

Browse files
committed
[代码优化]AI: 写作更改样式
1 parent c76b622 commit bb17651

File tree

3 files changed

+45
-29
lines changed

3 files changed

+45
-29
lines changed

src/views/ai/writer/index/components/Left.vue

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,28 @@
2424
</h3>
2525
</DefineLabel>
2626

27-
<div class="relative" v-bind="$attrs">
27+
<div class="flex flex-col" v-bind="$attrs">
2828
<!-- tab -->
29-
<div
30-
class="absolute left-1/2 top-2 -translate-x-1/2 w-[303px] rounded-full bg-[#DDDFE3] p-1 z-10"
31-
>
29+
<div class="w-full pt-2 bg-[#f5f7f9] flex justify-center">
3230
<div
33-
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"
34-
:class="selectedTab === AiWriteTypeEnum.REPLY && 'after:transform after:translate-x-[100%]'"
31+
class="w-[303px] rounded-full bg-[#DDDFE3] p-1 z-10"
3532
>
36-
<ReuseTab
37-
v-for="tab in tabs"
38-
:key="tab.value"
39-
:text="tab.text"
40-
:active="tab.value === selectedTab"
41-
:itemClick="() => switchTab(tab.value)"
42-
/>
33+
<div
34+
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"
35+
:class="selectedTab === AiWriteTypeEnum.REPLY && 'after:transform after:translate-x-[100%]'"
36+
>
37+
<ReuseTab
38+
v-for="tab in tabs"
39+
:key="tab.value"
40+
:text="tab.text"
41+
:active="tab.value === selectedTab"
42+
:itemClick="() => switchTab(tab.value)"
43+
/>
44+
</div>
4345
</div>
4446
</div>
4547
<div
46-
class="px-7 pb-2 pt-[46px] overflow-y-auto lg:block w-[380px] box-border bg-[#ECEDEF] h-full"
48+
class="px-7 pb-2 flex-grow overflow-y-auto lg:block w-[380px] box-border bg-[#f5f7f9] h-full"
4749
>
4850
<div>
4951
<template v-if="selectedTab === 1">

src/views/ai/writer/index/components/Right.vue

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
<template>
2-
<div class="h-full box-border flex flex-col px-7">
3-
<h3 class="m-0 h-14 -mx-7 px-7 shrink-0 flex items-center justify-between bg-[#ecedef]">
4-
<span>预览</span>
5-
<!-- 展示在右上角 -->
6-
<el-button color="#846af7" v-show="showCopy" @click="copyContent" size="small">
7-
<template #icon>
8-
<Icon icon="ph:copy-bold" />
9-
</template>
10-
复制
11-
</el-button>
12-
</h3>
2+
<el-card class="my-card h-full">
3+
<template #header
4+
><h3 class="m-0 px-7 shrink-0 flex items-center justify-between">
5+
<span>预览</span>
6+
<!-- 展示在右上角 -->
7+
<el-button color="#846af7" v-show="showCopy" @click="copyContent" size="small">
8+
<template #icon>
9+
<Icon icon="ph:copy-bold" />
10+
</template>
11+
复制
12+
</el-button>
13+
</h3></template
14+
>
1315

14-
<div ref="contentRef" class="hide-scroll-bar flex-grow box-border overflow-y-auto">
16+
<div ref="contentRef" class="hide-scroll-bar h-full box-border overflow-y-auto">
1517
<div class="w-full min-h-full relative flex-grow bg-white box-border p-3 sm:p-7">
1618
<!-- 终止生成内容的按钮 -->
1719
<el-button
@@ -36,7 +38,7 @@
3638
/>
3739
</div>
3840
</div>
39-
</div>
41+
</el-card>
4042
</template>
4143

4244
<script setup lang="ts">
@@ -102,4 +104,17 @@ watch(copied, (val) => {
102104
height: 0;
103105
}
104106
}
107+
108+
.my-card{
109+
display: flex;
110+
flex-direction: column;
111+
112+
:deep(.el-card__body) {
113+
box-sizing: border-box;
114+
flex-grow: 1;
115+
overflow-y: auto;
116+
padding: 0;
117+
@extend .hide-scroll-bar;
118+
}
119+
}
105120
</style>

src/views/ai/writer/index/index.vue

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

0 commit comments

Comments
 (0)