File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -34,18 +34,18 @@ export interface ImageDallReqVO {
34
34
export const ImageApi = {
35
35
// 获取 image 列表
36
36
getImageList : async ( params : ImagePageReqVO ) => {
37
- return await request . get ( { url : `/ai/image/list ` , params } )
37
+ return await request . get ( { url : `/ai/image/my-page ` , params } )
38
38
} ,
39
39
// 获取 image 详细信息
40
40
getImageDetail : async ( id : number ) => {
41
- return await request . get ( { url : `/ai/image/get?id=${ id } ` } )
41
+ return await request . get ( { url : `/ai/image/get-my ?id=${ id } ` } )
42
42
} ,
43
43
// dall2、dall3 调用
44
44
dall : async ( data : ImageDallReqVO ) => {
45
45
return await request . post ( { url : `/ai/image/dall` , data } )
46
46
} ,
47
47
// 删除
48
48
deleteImage : async ( id : number ) => {
49
- return await request . delete ( { url : `/ai/image/delete?id=${ id } ` } )
49
+ return await request . delete ( { url : `/ai/image/delete-my ?id=${ id } ` } )
50
50
} ,
51
51
}
Original file line number Diff line number Diff line change 2
2
<el-card body-class =" " class =" image-card" >
3
3
<div class =" image-operation" >
4
4
<div >
5
- <el-button type =" " text bg v-if =" imageDetail.status === 'in_progress '" >生成中</el-button >
6
- <el-button type =" " text bg v-else-if =" imageDetail.status === 'fail '" >已完成</el-button >
7
- <el-button type =" " text bg v-else-if =" imageDetail.status === 'complete '" >已完成</el-button >
5
+ <el-button type =" " text bg v-if =" imageDetail.status === '10 '" >生成中</el-button >
6
+ <el-button type =" " text bg v-else-if =" imageDetail.status === '20 '" >已完成</el-button >
7
+ <el-button type =" " text bg v-else-if =" imageDetail.status === '30 '" >已完成</el-button >
8
8
</div >
9
9
<div >
10
10
<el-button class =" btn" text :icon =" Download"
@@ -42,7 +42,7 @@ const handlerBtnClick = async (type, imageDetail: ImageDetailVO) => {
42
42
}
43
43
44
44
const handlerLoading = async (status : string ) => {
45
- if (status === ' in_progress ' ) {
45
+ if (status === ' 10 ' ) {
46
46
cardImageLoadingInstance .value = ElLoading .service ({
47
47
target: cardImageRef .value ,
48
48
text: ' 生成中...'
Original file line number Diff line number Diff line change @@ -110,6 +110,8 @@ interface ImageModelVO {
110
110
interface ImageSizeVO {
111
111
key: string
112
112
style: string ,
113
+ width: string ,
114
+ height: string ,
113
115
}
114
116
115
117
// 定义属性
@@ -152,16 +154,22 @@ const imageSizeList = ref<ImageSizeVO[]>([
152
154
{
153
155
key: ' 1024x1024' ,
154
156
name: ' 1:1' ,
157
+ width: ' 1024' ,
158
+ height: ' 1024' ,
155
159
style: ' width: 30px; height: 30px;background-color: #dcdcdc;' ,
156
160
},
157
161
{
158
162
key: ' 1024x1792' ,
159
163
name: ' 3:5' ,
164
+ width: ' 1024' ,
165
+ height: ' 1792' ,
160
166
style: ' width: 30px; height: 50px;background-color: #dcdcdc;' ,
161
167
},
162
168
{
163
169
key: ' 1792x1024' ,
164
170
name: ' 5:3' ,
171
+ width: ' 1792' ,
172
+ height: ' 1024' ,
165
173
style: ' width: 50px; height: 30px;background-color: #dcdcdc;' ,
166
174
}
167
175
]) // size
@@ -233,7 +241,8 @@ const handlerGenerateImage = async () => {
233
241
prompt: prompt .value , // 提示词
234
242
model: selectModel .value .key , // 模型
235
243
style: selectImageStyle .value .key , // 图像生成的风格
236
- size: selectImageSize .value .key , // size不能为空
244
+ width: selectImageSize .value .width , // size不能为空
245
+ height: selectImageSize .value .height , // size不能为空
237
246
} as ImageDallReqVO
238
247
// 发送请求
239
248
await ImageApi .dall (form )
You can’t perform that action at this time.
0 commit comments