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
cb7c5b74
authored
May 26, 2024
by
cherishsince
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【优化】Image 抽屉,使用 Card 组件
parent
c06dd8e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
2 deletions
+64
-2
src/views/ai/image/ImageDetailDrawer.vue
+64
-2
No files found.
src/views/ai/image/ImageDetailDrawer.vue
View file @
cb7c5b74
...
@@ -4,13 +4,35 @@
...
@@ -4,13 +4,35 @@
title=
"图片详细"
title=
"图片详细"
@
close=
"handlerDrawerClose"
@
close=
"handlerDrawerClose"
>
>
<span>
Hi, there!
</span>
<div
class=
"item"
>
<div
class=
"header"
>
<div>
图片
</div>
<div>
<el-button
class=
"btn"
text
:icon=
"Download"
/>
<el-button
class=
"btn"
text
:icon=
"Delete"
/>
<el-button
class=
"btn"
text
:icon=
"More"
@
click=
"handlerTaskDetail"
/>
</div>
</div>
<div
class=
"body"
>
<ImageTaskCard
:image-detail=
"imageDetail"
/>
</div>
</div>
<div
class=
"item"
>
<div
class=
"tip"
>
提示词
</div>
<div
class=
"body"
>
{{
imageDetail
.
prompt
}}
</div>
</div>
</el-drawer>
</el-drawer>
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ImageApi
,
ImageDetailVO
}
from
'@/api/ai/image'
;
import
ImageTaskCard
from
'./ImageTaskCard.vue'
;
import
{
Delete
,
Download
,
More
}
from
"@element-plus/icons-vue"
;
const
showDrawer
=
ref
<
boolean
>
(
false
)
// 是否显示
const
showDrawer
=
ref
<
boolean
>
(
false
)
// 是否显示
const
imageDetail
=
ref
<
ImageDetailVO
>
({}
as
ImageDetailVO
)
// 图片详细信息
const
props
=
defineProps
({
const
props
=
defineProps
({
show
:
{
show
:
{
...
@@ -20,7 +42,6 @@ const props = defineProps({
...
@@ -20,7 +42,6 @@ const props = defineProps({
}
}
})
})
/**
/**
* 抽屉 - close
* 抽屉 - close
*/
*/
...
@@ -28,6 +49,21 @@ const handlerDrawerClose = async () => {
...
@@ -28,6 +49,21 @@ const handlerDrawerClose = async () => {
emits
(
'handlerDrawerClose'
)
emits
(
'handlerDrawerClose'
)
}
}
/**
* 获取 - 图片 detail
*/
const
getImageDetail
=
async
(
id
)
=>
{
// 获取图片详细
imageDetail
.
value
=
await
ImageApi
.
getImageDetail
(
id
)
}
/**
* 任务 - detail
*/
const
handlerTaskDetail
=
async
()
=>
{
showDrawer
.
value
=
true
}
// watch
// watch
const
{
show
}
=
toRefs
(
props
)
const
{
show
}
=
toRefs
(
props
)
watch
(
show
,
async
(
newValue
,
oldValue
)
=>
{
watch
(
show
,
async
(
newValue
,
oldValue
)
=>
{
...
@@ -36,7 +72,33 @@ watch(show, async (newValue, oldValue) => {
...
@@ -36,7 +72,33 @@ watch(show, async (newValue, oldValue) => {
//
//
const
emits
=
defineEmits
([
'handlerDrawerClose'
])
const
emits
=
defineEmits
([
'handlerDrawerClose'
])
//
onMounted
(
async
()
=>
{
await
getImageDetail
(
1
)
})
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.item
{
margin-bottom
:
20px
;
.header
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-between
;
font-size
:
16px
;
font-weight
:
bold
;
}
.body
{
margin-top
:
10px
;
color
:
#616161
;
}
}
.taskImage
{
border-radius
:
10px
;
}
</
style
>
</
style
>
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