|
19 | 19 | <img class="image" :src="imageDetail?.picUrl"/>
|
20 | 20 | <div v-if="imageDetail?.status === 30">{{imageDetail?.errorMessage}}</div>
|
21 | 21 | </div>
|
| 22 | + <div class="image-mj-btns"> |
| 23 | + <el-button size="small" v-for="button in imageDetail?.buttons" :key="button" |
| 24 | + style="width: 40px;margin-left: 0; margin-right: 10px; margin-top: 5px;" |
| 25 | + @click="handlerMjBtnClick(button)" |
| 26 | + > |
| 27 | + {{ button.label }}{{ button.emoji }} |
| 28 | + </el-button> |
| 29 | + </div> |
22 | 30 | </el-card>
|
23 | 31 | </template>
|
24 | 32 | <script setup lang="ts">
|
25 | 33 | import {Delete, Download, More} from "@element-plus/icons-vue";
|
26 |
| -import {ImageDetailVO} from "@/api/ai/image"; |
| 34 | +import {ImageDetailVO, ImageMjButtonsVO} from "@/api/ai/image"; |
27 | 35 | import {PropType} from "vue";
|
28 | 36 | import {ElLoading} from "element-plus";
|
29 | 37 |
|
@@ -56,14 +64,20 @@ const handlerLoading = async (status: number) => {
|
56 | 64 | }
|
57 | 65 | }
|
58 | 66 | }
|
| 67 | +
|
| 68 | +/** mj 按钮 click */ |
| 69 | +const handlerMjBtnClick = async (button: ImageMjButtonsVO) => { |
| 70 | + emits('onMjBtnClick', button) |
| 71 | +} |
| 72 | +
|
59 | 73 | // watch
|
60 | 74 | const { imageDetail } = toRefs(props)
|
61 | 75 | watch(imageDetail, async (newVal, oldVal) => {
|
62 | 76 | await handlerLoading(newVal.status as string)
|
63 | 77 | })
|
64 | 78 |
|
65 | 79 | // emits
|
66 |
| -const emits = defineEmits(['onBtnClick']) |
| 80 | +const emits = defineEmits(['onBtnClick', 'onMjBtnClick']) |
67 | 81 |
|
68 | 82 | //
|
69 | 83 | onMounted(async () => {
|
@@ -104,6 +118,15 @@ onMounted(async () => {
|
104 | 118 | border-radius: 10px;
|
105 | 119 | }
|
106 | 120 | }
|
| 121 | +
|
| 122 | + .image-mj-btns { |
| 123 | + margin-top: 5px; |
| 124 | + width: 100%; |
| 125 | + display: flex; |
| 126 | + flex-direction: row; |
| 127 | + flex-wrap: wrap; |
| 128 | + justify-content: flex-start; |
| 129 | + } |
107 | 130 | }
|
108 | 131 |
|
109 | 132 | </style>
|
0 commit comments