From b6ff9ede11107e22c27daf8f95f5939b30f8f2f3 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Thu, 4 Jul 2024 16:01:08 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E8=A7=A3=E5=86=B3todo=E3=80=91handle?= =?UTF-8?q?=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/image/ImageDetailDrawer.vue | 10 +++---- src/views/ai/image/ImageTask.vue | 20 +++++++------- src/views/ai/image/ImageTaskCard.vue | 20 +++++++------- src/views/ai/image/dall3/index.vue | 27 +++++++++---------- src/views/ai/image/index.vue | 14 +++++----- src/views/ai/image/midjourney/index.vue | 25 +++++++++-------- src/views/ai/image/stable-diffusion/index.vue | 2 +- 7 files changed, 57 insertions(+), 61 deletions(-) diff --git a/src/views/ai/image/ImageDetailDrawer.vue b/src/views/ai/image/ImageDetailDrawer.vue index fca087da..95ec146c 100644 --- a/src/views/ai/image/ImageDetailDrawer.vue +++ b/src/views/ai/image/ImageDetailDrawer.vue @@ -2,7 +2,7 @@ @@ -79,8 +79,8 @@ const props = defineProps({ }) /** 抽屉 - close */ -const handlerDrawerClose = async () => { - emits('handlerDrawerClose') +const handleDrawerClose = async () => { + emits('handleDrawerClose') } /** 获取 - 图片 detail */ @@ -90,7 +90,7 @@ const getImageDetail = async (id) => { } /** 任务 - detail */ -const handlerTaskDetail = async () => { +const handleTaskDetail = async () => { showDrawer.value = true } @@ -107,7 +107,7 @@ watch(id, async (newVal, oldVal) => { } }) // -const emits = defineEmits(['handlerDrawerClose']) +const emits = defineEmits(['handleDrawerClose']) // onMounted(async () => {}) diff --git a/src/views/ai/image/ImageTask.vue b/src/views/ai/image/ImageTask.vue index 9ddd7461..b4cbd253 100644 --- a/src/views/ai/image/ImageTask.vue +++ b/src/views/ai/image/ImageTask.vue @@ -6,8 +6,8 @@ v-for="image in imageList" :key="image" :image-detail="image" - @on-btn-click="handlerImageBtnClick" - @on-mj-btn-click="handlerImageMjBtnClick" + @on-btn-click="handleImageBtnClick" + @on-mj-btn-click="handleImageMjBtnClick" />
@@ -16,7 +16,7 @@ layout="prev, pager, next" :default-page-size="pageSize" :total="pageTotal" - @change="handlerPageChange" + @change="handlePageChange" />
@@ -24,7 +24,7 @@ diff --git a/src/views/ai/image/dall3/index.vue b/src/views/ai/image/dall3/index.vue index 69e767a3..1751eace 100644 --- a/src/views/ai/image/dall3/index.vue +++ b/src/views/ai/image/dall3/index.vue @@ -25,7 +25,7 @@ :type="(selectHotWord === hotWord ? 'primary' : 'default')" v-for="hotWord in hotWords" :key="hotWord" - @click="handlerHotWordClick(hotWord)" + @click="handleHotWordClick(hotWord)" > {{ hotWord }} @@ -45,7 +45,7 @@
{{model.name}}
@@ -64,7 +64,7 @@
{{imageStyle.name}}
@@ -78,7 +78,7 @@
+ @click="handleSizeClick(imageSize)">
@@ -91,7 +91,7 @@ size="large" round :loading="drawIn" - @click="handlerGenerateImage"> + @click="handleGenerateImage"> {{drawIn ? '生成中' : '生成内容'}}
@@ -183,10 +183,8 @@ const props = defineProps({}) // 定义 emits const emits = defineEmits(['onDrawStart', 'onDrawComplete']) -// TODO @fan:如果是简单注释,建议用 /** */,主要是现在项目里是这种风格哈,保持一致好点~ -// TODO @fan:handler 应该改成 handle 哈 /** 热词 - click */ -const handlerHotWordClick = async (hotWord: string) => { +const handleHotWordClick = async (hotWord: string) => { // 取消选中 if (selectHotWord.value == hotWord) { selectHotWord.value = '' @@ -199,22 +197,22 @@ const handlerHotWordClick = async (hotWord: string) => { } /** 模型 - click */ -const handlerModelClick = async (model: ImageModelVO) => { +const handleModelClick = async (model: ImageModelVO) => { selectModel.value = model.key } /** 样式 - click */ -const handlerStyleClick = async (imageStyle: ImageModelVO) => { +const handleStyleClick = async (imageStyle: ImageModelVO) => { selectImageStyle.value = imageStyle.key } /** size - click */ -const handlerSizeClick = async (imageSize: ImageSizeVO) => { +const handleSizeClick = async (imageSize: ImageSizeVO) => { selectImageSize.value = imageSize.key } /** 图片生产 */ -const handlerGenerateImage = async () => { +const handleGenerateImage = async () => { // 二次确认 await message.confirm(`确认生成内容?`) try { @@ -251,15 +249,14 @@ const settingValues = async (imageDetail: ImageVO) => { selectImageStyle.value = imageDetail.options?.style // const imageSize = imageSizeList.value.find(item => item.key === `${imageDetail.width}x${imageDetail.height}`) as ImageSizeVO - console.log('imageSize', imageSize) - await handlerSizeClick(imageSize) + await handleSizeClick(imageSize) } /** 暴露组件方法 */ defineExpose({ settingValues }) +