ImageTaskCard.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <el-card body-class="" class="image-card" >
  3. <div class="image-operation">
  4. <div>
  5. <el-button type="" text bg >已完成</el-button>
  6. </div>
  7. <div>
  8. <el-button class="btn" text :icon="Download" @click="handlerBtnClick('download', imageDetail)" />
  9. <el-button class="btn" text :icon="Delete" @click="handlerBtnClick('delete', imageDetail)" />
  10. <el-button class="btn" text :icon="More" @click="handlerBtnClick('more', imageDetail)" />
  11. </div>
  12. </div>
  13. <div class="image-wrapper">
  14. <img class="image" :src="imageDetail?.imageUrl" />
  15. </div>
  16. </el-card>
  17. </template>
  18. <script setup lang="ts">
  19. import {Delete, Download, More} from "@element-plus/icons-vue";
  20. import {ImageDetailVO} from "@/api/ai/image";
  21. import {PropType} from "vue";
  22. const props = defineProps({
  23. imageDetail: {
  24. type: Object as PropType<ImageDetailVO>,
  25. require: true
  26. }
  27. })
  28. /**
  29. * 按钮 - 点击事件
  30. */
  31. const handlerBtnClick = async (type, imageDetail: ImageDetailVO ) => {
  32. emits('handlerBtnClick', type, imageDetail)
  33. }
  34. // emits
  35. const emits = defineEmits(['handlerBtnClick'])
  36. </script>
  37. <style scoped lang="scss">
  38. .image-card {
  39. width: 360px;
  40. border-radius: 10px;
  41. .image-operation {
  42. display: flex;
  43. flex-direction: row;
  44. justify-content: space-between;
  45. .btn {
  46. //border: 1px solid red;
  47. padding: 10px;
  48. margin: 0;
  49. }
  50. }
  51. .image-wrapper {
  52. overflow: hidden;
  53. margin-top: 20px;
  54. .image {
  55. width: 100%;
  56. border-radius: 10px;
  57. }
  58. }
  59. }
  60. </style>