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
d266b99e
authored
Jul 13, 2024
by
hhhero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[代码优化]AI: 回显写作类型切换之前的数据
parent
bb176519
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
src/views/ai/writer/index/components/Left.vue
+14
-6
No files found.
src/views/ai/writer/index/components/Left.vue
View file @
d266b99e
...
@@ -27,12 +27,12 @@
...
@@ -27,12 +27,12 @@
<div
class=
"flex flex-col"
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
class=
"w-full pt-2 bg-[#f5f7f9] flex justify-center"
>
<div
<div
class=
"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"
:class=
"selectedTab === AiWriteTypeEnum.REPLY && 'after:transform after:translate-x-[100%]'"
:class=
"
selectedTab === AiWriteTypeEnum.REPLY && 'after:transform after:translate-x-[100%]'
"
>
>
<ReuseTab
<ReuseTab
v-for=
"tab in tabs"
v-for=
"tab in tabs"
...
@@ -179,10 +179,18 @@ const initData: WriteVO = {
...
@@ -179,10 +179,18 @@ const initData: WriteVO = {
}
}
const
formData
=
ref
<
WriteVO
>
({
...
initData
})
const
formData
=
ref
<
WriteVO
>
({
...
initData
})
/** 用来记录切换之前所填写的数据,切换的时候给赋值回来 **/
const
recordFormData
=
{}
as
Record
<
AiWriteTypeEnum
,
WriteVO
>
/** 切换tab **/
/** 切换tab **/
const
switchTab
=
(
value
:
TabType
)
=>
{
const
switchTab
=
(
value
:
TabType
)
=>
{
selectedTab
.
value
=
value
if
(
value
!==
selectedTab
.
value
)
{
formData
.
value
=
{
...
initData
}
// 保存之前的久数据
recordFormData
[
selectedTab
.
value
]
=
formData
.
value
selectedTab
.
value
=
value
// 将之前的旧数据赋值回来
formData
.
value
=
{
...
initData
,
...
recordFormData
[
value
]
}
}
}
}
/** 提交写作 */
/** 提交写作 */
...
...
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