Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bb176519
authored
Jul 12, 2024
by
hhhero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[代码优化]AI: 写作更改样式
parent
c76b6227
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
29 deletions
+45
-29
src/views/ai/writer/index/components/Left.vue
+16
-14
src/views/ai/writer/index/components/Right.vue
+28
-13
src/views/ai/writer/index/index.vue
+1
-2
No files found.
src/views/ai/writer/index/components/Left.vue
View file @
bb176519
...
@@ -24,26 +24,28 @@
...
@@ -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"
>
...
...
src/views/ai/writer/index/components/Right.vue
View file @
bb176519
<
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 @@
...
@@ -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) => {
...
@@ -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
>
src/views/ai/writer/index/index.vue
View file @
bb176519
<
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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment