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
b82391da
authored
May 29, 2024
by
cherishsince
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【解决todo】调整接口命名、和接口返回值
parent
ecc92430
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
src/api/ai/image/index.ts
+3
-3
src/views/ai/image/ImageTaskCard.vue
+4
-4
src/views/ai/image/dall3/index.vue
+10
-1
No files found.
src/api/ai/image/index.ts
View file @
b82391da
...
...
@@ -34,11 +34,11 @@ export interface ImageDallReqVO {
export
const
ImageApi
=
{
// 获取 image 列表
getImageList
:
async
(
params
:
ImagePageReqVO
)
=>
{
return
await
request
.
get
({
url
:
`/ai/image/
list
`
,
params
})
return
await
request
.
get
({
url
:
`/ai/image/
my-page
`
,
params
})
},
// 获取 image 详细信息
getImageDetail
:
async
(
id
:
number
)
=>
{
return
await
request
.
get
({
url
:
`/ai/image/get?id=
${
id
}
`
})
return
await
request
.
get
({
url
:
`/ai/image/get
-my
?id=
${
id
}
`
})
},
// dall2、dall3 调用
dall
:
async
(
data
:
ImageDallReqVO
)
=>
{
...
...
@@ -46,6 +46,6 @@ export const ImageApi = {
},
// 删除
deleteImage
:
async
(
id
:
number
)
=>
{
return
await
request
.
delete
({
url
:
`/ai/image/delete?id=
${
id
}
`
})
return
await
request
.
delete
({
url
:
`/ai/image/delete
-my
?id=
${
id
}
`
})
},
}
src/views/ai/image/ImageTaskCard.vue
View file @
b82391da
...
...
@@ -2,9 +2,9 @@
<el-card
body-class=
""
class=
"image-card"
>
<div
class=
"image-operation"
>
<div>
<el-button
type=
""
text
bg
v-if=
"imageDetail.status === '
in_progress
'"
>
生成中
</el-button>
<el-button
type=
""
text
bg
v-else-if=
"imageDetail.status === '
fail
'"
>
已完成
</el-button>
<el-button
type=
""
text
bg
v-else-if=
"imageDetail.status === '
complete
'"
>
已完成
</el-button>
<el-button
type=
""
text
bg
v-if=
"imageDetail.status === '
10
'"
>
生成中
</el-button>
<el-button
type=
""
text
bg
v-else-if=
"imageDetail.status === '
20
'"
>
已完成
</el-button>
<el-button
type=
""
text
bg
v-else-if=
"imageDetail.status === '
30
'"
>
已完成
</el-button>
</div>
<div>
<el-button
class=
"btn"
text
:icon=
"Download"
...
...
@@ -42,7 +42,7 @@ const handlerBtnClick = async (type, imageDetail: ImageDetailVO) => {
}
const
handlerLoading
=
async
(
status
:
string
)
=>
{
if
(
status
===
'
in_progress
'
)
{
if
(
status
===
'
10
'
)
{
cardImageLoadingInstance
.
value
=
ElLoading
.
service
({
target
:
cardImageRef
.
value
,
text
:
'生成中...'
...
...
src/views/ai/image/dall3/index.vue
View file @
b82391da
...
...
@@ -110,6 +110,8 @@ interface ImageModelVO {
interface
ImageSizeVO
{
key
:
string
style
:
string
,
width
:
string
,
height
:
string
,
}
// 定义属性
...
...
@@ -152,16 +154,22 @@ const imageSizeList = ref<ImageSizeVO[]>([
{
key
:
'1024x1024'
,
name
:
'1:1'
,
width
:
'1024'
,
height
:
'1024'
,
style
:
'width: 30px; height: 30px;background-color: #dcdcdc;'
,
},
{
key
:
'1024x1792'
,
name
:
'3:5'
,
width
:
'1024'
,
height
:
'1792'
,
style
:
'width: 30px; height: 50px;background-color: #dcdcdc;'
,
},
{
key
:
'1792x1024'
,
name
:
'5:3'
,
width
:
'1792'
,
height
:
'1024'
,
style
:
'width: 50px; height: 30px;background-color: #dcdcdc;'
,
}
])
// size
...
...
@@ -233,7 +241,8 @@ const handlerGenerateImage = async () => {
prompt
:
prompt
.
value
,
// 提示词
model
:
selectModel
.
value
.
key
,
// 模型
style
:
selectImageStyle
.
value
.
key
,
// 图像生成的风格
size
:
selectImageSize
.
value
.
key
,
// size不能为空
width
:
selectImageSize
.
value
.
width
,
// size不能为空
height
:
selectImageSize
.
value
.
height
,
// size不能为空
}
as
ImageDallReqVO
// 发送请求
await
ImageApi
.
dall
(
form
)
...
...
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