File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -52,4 +52,8 @@ export const ImageApi = {
52
52
dall : async ( data : ImageDallReqVO ) => {
53
53
return await request . post ( { url : `/ai/image/dall` , data } )
54
54
} ,
55
+ // 删除
56
+ deleteImage : async ( id : number ) => {
57
+ return await request . delete ( { url : `/ai/image/delete?id=${ id } ` } )
58
+ } ,
55
59
}
Original file line number Diff line number Diff line change 2
2
<template >
3
3
<el-card class =" dr-task" body-class =" task-card" shadow =" never" >
4
4
<template #header >绘画任务</template >
5
- <ImageTaskCard v-for =" image in imageList" :key =" image" :image-detail =" image" @on-btn-click =" handlerImageBtnClick" />
5
+ <ImageTaskCard
6
+ v-for =" image in imageList"
7
+ :key =" image"
8
+ :image-detail =" image"
9
+ @on-btn-click =" handlerImageBtnClick" />
6
10
</el-card >
7
11
<!-- 图片 detail 抽屉 -->
8
12
<ImageDetailDrawer
@@ -16,6 +20,8 @@ import ImageDetailDrawer from './ImageDetailDrawer.vue'
16
20
import ImageTaskCard from ' ./ImageTaskCard.vue'
17
21
import {bool } from " vue-types" ;
18
22
23
+ const message = useMessage () // 消息弹窗
24
+
19
25
const imageList = ref <ImageDetailVO []>([]) // image 列表
20
26
const imageListInterval = ref <any >() // image 列表定时器,刷新列表
21
27
const showTaskDetail = ref <bool >(false ) // 是否显示 task 详情
@@ -55,6 +61,11 @@ const getImageList = async () => {
55
61
const handlerImageBtnClick = async (type , imageDetail : ImageDetailVO ) => {
56
62
if (type === ' more' ) {
57
63
await handlerDrawerOpen ()
64
+ } else if (type === ' delete' ) {
65
+ await message .confirm (` 是否删除照片? ` )
66
+ await ImageApi .deleteImage (imageDetail .id )
67
+ await getImageList ()
68
+ await message .success (" 删除成功!" )
58
69
}
59
70
}
60
71
//
Original file line number Diff line number Diff line change 6
6
<el-segmented v-model =" selectModel" :options =" modelOptions" />
7
7
</div >
8
8
<div class =" modal-switch-container" >
9
- <Dall3 v-if =" selectModel === 'DALL3绘画'" @on-draw-start =" handlerDrawStart" @on-draw-complete =" handlerDrawComplete" />
9
+ <Dall3 v-if =" selectModel === 'DALL3绘画'"
10
+ @on-draw-start =" handlerDrawStart"
11
+ @on-draw-complete =" handlerDrawComplete" />
10
12
<Midjourney v-if =" selectModel === 'MJ绘画'" />
11
13
</div >
12
14
</div >
You can’t perform that action at this time.
0 commit comments