mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-14 10:55:06 +08:00
【增加】增加 action 操作
This commit is contained in:
@ -16,7 +16,7 @@
|
||||
/>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import {ImageApi, ImageDetailVO, ImageMjButtonsVO} from '@/api/ai/image';
|
||||
import {ImageApi, ImageDetailVO, ImageMjActionVO, ImageMjButtonsVO} from '@/api/ai/image';
|
||||
import ImageDetailDrawer from './ImageDetailDrawer.vue'
|
||||
import ImageTaskCard from './ImageTaskCard.vue'
|
||||
|
||||
@ -64,7 +64,15 @@ const handlerImageBtnClick = async (type, imageDetail: ImageDetailVO) => {
|
||||
|
||||
/** 图片 - mj btn click */
|
||||
const handlerImageMjBtnClick = async (button: ImageMjButtonsVO, imageDetail: ImageDetailVO) => {
|
||||
console.log('mj click', button, imageDetail)
|
||||
// 1、构建 params 参数
|
||||
const params = {
|
||||
id: imageDetail.id,
|
||||
customId: button.customId,
|
||||
} as ImageMjActionVO
|
||||
// 2、发送 action
|
||||
await ImageApi.midjourneyAction(params)
|
||||
// 3、刷新列表
|
||||
await getImageList()
|
||||
}
|
||||
|
||||
/** 下载 - image */
|
||||
|
@ -21,7 +21,7 @@
|
||||
</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;"
|
||||
style="min-width: 40px;margin-left: 0; margin-right: 10px; margin-top: 5px;"
|
||||
@click="handlerMjBtnClick(button)"
|
||||
>
|
||||
{{ button.label }}{{ button.emoji }}
|
||||
|
Reference in New Issue
Block a user