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
1be7713f
authored
Jun 04, 2024
by
cherishsince
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【增加】Image midjourney 增加操作按钮
parent
5876fdca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
src/views/ai/image/ImageTaskCard.vue
+25
-2
No files found.
src/views/ai/image/ImageTaskCard.vue
View file @
1be7713f
...
@@ -19,11 +19,19 @@
...
@@ -19,11 +19,19 @@
<img
class=
"image"
:src=
"imageDetail?.picUrl"
/>
<img
class=
"image"
:src=
"imageDetail?.picUrl"
/>
<div
v-if=
"imageDetail?.status === 30"
>
{{
imageDetail
?.
errorMessage
}}
</div>
<div
v-if=
"imageDetail?.status === 30"
>
{{
imageDetail
?.
errorMessage
}}
</div>
</div>
</div>
<div
class=
"image-mj-btns"
>
<el-button
size=
"small"
v-for=
"button in imageDetail?.buttons"
:key=
"button"
style=
"width: 40px;margin-left: 0; margin-right: 10px; margin-top: 5px;"
@
click=
"handlerMjBtnClick(button)"
>
{{
button
.
label
}}{{
button
.
emoji
}}
</el-button>
</div>
</el-card>
</el-card>
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
Delete
,
Download
,
More
}
from
"@element-plus/icons-vue"
;
import
{
Delete
,
Download
,
More
}
from
"@element-plus/icons-vue"
;
import
{
ImageDetailVO
}
from
"@/api/ai/image"
;
import
{
ImageDetailVO
,
ImageMjButtonsVO
}
from
"@/api/ai/image"
;
import
{
PropType
}
from
"vue"
;
import
{
PropType
}
from
"vue"
;
import
{
ElLoading
}
from
"element-plus"
;
import
{
ElLoading
}
from
"element-plus"
;
...
@@ -56,6 +64,12 @@ const handlerLoading = async (status: number) => {
...
@@ -56,6 +64,12 @@ const handlerLoading = async (status: number) => {
}
}
}
}
}
}
/** mj 按钮 click */
const
handlerMjBtnClick
=
async
(
button
:
ImageMjButtonsVO
)
=>
{
emits
(
'onMjBtnClick'
,
button
)
}
// watch
// watch
const
{
imageDetail
}
=
toRefs
(
props
)
const
{
imageDetail
}
=
toRefs
(
props
)
watch
(
imageDetail
,
async
(
newVal
,
oldVal
)
=>
{
watch
(
imageDetail
,
async
(
newVal
,
oldVal
)
=>
{
...
@@ -63,7 +77,7 @@ watch(imageDetail, async (newVal, oldVal) => {
...
@@ -63,7 +77,7 @@ watch(imageDetail, async (newVal, oldVal) => {
})
})
// emits
// emits
const
emits
=
defineEmits
([
'onBtnClick'
])
const
emits
=
defineEmits
([
'onBtnClick'
,
'onMjBtnClick'
])
//
//
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
...
@@ -104,6 +118,15 @@ onMounted(async () => {
...
@@ -104,6 +118,15 @@ onMounted(async () => {
border-radius
:
10px
;
border-radius
:
10px
;
}
}
}
}
.image-mj-btns
{
margin-top
:
5px
;
width
:
100%
;
display
:
flex
;
flex-direction
:
row
;
flex-wrap
:
wrap
;
justify-content
:
flex-start
;
}
}
}
</
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