2024-05-26 21:50:59 +08:00
|
|
|
|
|
|
|
<template>
|
2024-05-28 10:04:44 +08:00
|
|
|
<el-card body-class="" class="image-card" v-loading="imageDetail.status === 'in_progress'" >
|
2024-05-26 21:50:59 +08:00
|
|
|
<div class="image-operation">
|
|
|
|
<div>
|
2024-05-28 10:04:44 +08:00
|
|
|
<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>
|
2024-05-26 21:50:59 +08:00
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<el-button class="btn" text :icon="Download" @click="handlerBtnClick('download', imageDetail)" />
|
|
|
|
<el-button class="btn" text :icon="Delete" @click="handlerBtnClick('delete', imageDetail)" />
|
|
|
|
<el-button class="btn" text :icon="More" @click="handlerBtnClick('more', imageDetail)" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="image-wrapper">
|
2024-05-27 17:14:03 +08:00
|
|
|
<img class="image" :src="imageDetail?.picUrl" />
|
2024-05-26 21:50:59 +08:00
|
|
|
</div>
|
|
|
|
</el-card>
|
|
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
|
|
import {Delete, Download, More} from "@element-plus/icons-vue";
|
|
|
|
import {ImageDetailVO} from "@/api/ai/image";
|
|
|
|
import {PropType} from "vue";
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
imageDetail: {
|
|
|
|
type: Object as PropType<ImageDetailVO>,
|
|
|
|
require: true
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 按钮 - 点击事件
|
|
|
|
*/
|
|
|
|
const handlerBtnClick = async (type, imageDetail: ImageDetailVO ) => {
|
2024-05-26 21:56:10 +08:00
|
|
|
emits('onBtnClick', type, imageDetail)
|
2024-05-26 21:50:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// emits
|
2024-05-26 21:56:10 +08:00
|
|
|
const emits = defineEmits(['onBtnClick'])
|
2024-05-26 21:50:59 +08:00
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
|
|
.image-card {
|
2024-05-27 10:47:43 +08:00
|
|
|
width: 320px;
|
2024-05-26 21:50:59 +08:00
|
|
|
border-radius: 10px;
|
|
|
|
|
|
|
|
.image-operation {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
//border: 1px solid red;
|
|
|
|
padding: 10px;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.image-wrapper {
|
|
|
|
overflow: hidden;
|
|
|
|
margin-top: 20px;
|
|
|
|
|
|
|
|
.image {
|
|
|
|
width: 100%;
|
|
|
|
border-radius: 10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|