Skip to content

Commit 1be7713

Browse files
committed
【增加】Image midjourney 增加操作按钮
1 parent 5876fdc commit 1be7713

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

src/views/ai/image/ImageTaskCard.vue

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,19 @@
1919
<img class="image" :src="imageDetail?.picUrl"/>
2020
<div v-if="imageDetail?.status === 30">{{imageDetail?.errorMessage}}</div>
2121
</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>
2230
</el-card>
2331
</template>
2432
<script setup lang="ts">
2533
import {Delete, Download, More} from "@element-plus/icons-vue";
26-
import {ImageDetailVO} from "@/api/ai/image";
34+
import {ImageDetailVO, ImageMjButtonsVO} from "@/api/ai/image";
2735
import {PropType} from "vue";
2836
import {ElLoading} from "element-plus";
2937
@@ -56,14 +64,20 @@ const handlerLoading = async (status: number) => {
5664
}
5765
}
5866
}
67+
68+
/** mj 按钮 click */
69+
const handlerMjBtnClick = async (button: ImageMjButtonsVO) => {
70+
emits('onMjBtnClick', button)
71+
}
72+
5973
// watch
6074
const { imageDetail } = toRefs(props)
6175
watch(imageDetail, async (newVal, oldVal) => {
6276
await handlerLoading(newVal.status as string)
6377
})
6478
6579
// emits
66-
const emits = defineEmits(['onBtnClick'])
80+
const emits = defineEmits(['onBtnClick', 'onMjBtnClick'])
6781
6882
//
6983
onMounted(async () => {
@@ -104,6 +118,15 @@ onMounted(async () => {
104118
border-radius: 10px;
105119
}
106120
}
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+
}
107130
}
108131
109132
</style>

0 commit comments

Comments
 (0)