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
2211618a
authored
May 28, 2024
by
cherishsince
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【增加】AI Image 列表增加删除
parent
c87713f0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
src/api/ai/image/index.ts
+4
-0
src/views/ai/image/ImageTask.vue
+12
-1
src/views/ai/image/index.vue
+3
-1
No files found.
src/api/ai/image/index.ts
View file @
2211618a
...
@@ -52,4 +52,8 @@ export const ImageApi = {
...
@@ -52,4 +52,8 @@ export const ImageApi = {
dall
:
async
(
data
:
ImageDallReqVO
)
=>
{
dall
:
async
(
data
:
ImageDallReqVO
)
=>
{
return
await
request
.
post
({
url
:
`/ai/image/dall`
,
data
})
return
await
request
.
post
({
url
:
`/ai/image/dall`
,
data
})
},
},
// 删除
deleteImage
:
async
(
id
:
number
)
=>
{
return
await
request
.
delete
({
url
:
`/ai/image/delete?id=
${
id
}
`
})
},
}
}
src/views/ai/image/ImageTask.vue
View file @
2211618a
...
@@ -2,7 +2,11 @@
...
@@ -2,7 +2,11 @@
<
template
>
<
template
>
<el-card
class=
"dr-task"
body-class=
"task-card"
shadow=
"never"
>
<el-card
class=
"dr-task"
body-class=
"task-card"
shadow=
"never"
>
<template
#
header
>
绘画任务
</
template
>
<template
#
header
>
绘画任务
</
template
>
<ImageTaskCard
v-for=
"image in imageList"
:key=
"image"
:image-detail=
"image"
@
on-btn-click=
"handlerImageBtnClick"
/>
<ImageTaskCard
v-for=
"image in imageList"
:key=
"image"
:image-detail=
"image"
@
on-btn-click=
"handlerImageBtnClick"
/>
</el-card>
</el-card>
<!-- 图片 detail 抽屉 -->
<!-- 图片 detail 抽屉 -->
<ImageDetailDrawer
<ImageDetailDrawer
...
@@ -16,6 +20,8 @@ import ImageDetailDrawer from './ImageDetailDrawer.vue'
...
@@ -16,6 +20,8 @@ import ImageDetailDrawer from './ImageDetailDrawer.vue'
import
ImageTaskCard
from
'./ImageTaskCard.vue'
import
ImageTaskCard
from
'./ImageTaskCard.vue'
import
{
bool
}
from
"vue-types"
;
import
{
bool
}
from
"vue-types"
;
const
message
=
useMessage
()
// 消息弹窗
const
imageList
=
ref
<
ImageDetailVO
[]
>
([])
// image 列表
const
imageList
=
ref
<
ImageDetailVO
[]
>
([])
// image 列表
const
imageListInterval
=
ref
<
any
>
()
// image 列表定时器,刷新列表
const
imageListInterval
=
ref
<
any
>
()
// image 列表定时器,刷新列表
const
showTaskDetail
=
ref
<
bool
>
(
false
)
// 是否显示 task 详情
const
showTaskDetail
=
ref
<
bool
>
(
false
)
// 是否显示 task 详情
...
@@ -55,6 +61,11 @@ const getImageList = async () => {
...
@@ -55,6 +61,11 @@ const getImageList = async () => {
const
handlerImageBtnClick
=
async
(
type
,
imageDetail
:
ImageDetailVO
)
=>
{
const
handlerImageBtnClick
=
async
(
type
,
imageDetail
:
ImageDetailVO
)
=>
{
if
(
type
===
'more'
)
{
if
(
type
===
'more'
)
{
await
handlerDrawerOpen
()
await
handlerDrawerOpen
()
}
else
if
(
type
===
'delete'
)
{
await
message
.
confirm
(
`是否删除照片?`
)
await
ImageApi
.
deleteImage
(
imageDetail
.
id
)
await
getImageList
()
await
message
.
success
(
"删除成功!"
)
}
}
}
}
//
//
...
...
src/views/ai/image/index.vue
View file @
2211618a
...
@@ -6,7 +6,9 @@
...
@@ -6,7 +6,9 @@
<el-segmented
v-model=
"selectModel"
:options=
"modelOptions"
/>
<el-segmented
v-model=
"selectModel"
:options=
"modelOptions"
/>
</div>
</div>
<div
class=
"modal-switch-container"
>
<div
class=
"modal-switch-container"
>
<Dall3
v-if=
"selectModel === 'DALL3绘画'"
@
on-draw-start=
"handlerDrawStart"
@
on-draw-complete=
"handlerDrawComplete"
/>
<Dall3
v-if=
"selectModel === 'DALL3绘画'"
@
on-draw-start=
"handlerDrawStart"
@
on-draw-complete=
"handlerDrawComplete"
/>
<Midjourney
v-if=
"selectModel === 'MJ绘画'"
/>
<Midjourney
v-if=
"selectModel === 'MJ绘画'"
/>
</div>
</div>
</div>
</div>
...
...
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