【优化】调整 ai Image 方法注释

This commit is contained in:
cherishsince 2024-06-03 10:16:56 +08:00
parent 9bd8d8e9cb
commit 8e821445c2
6 changed files with 20 additions and 60 deletions

View File

@ -85,24 +85,18 @@ const props = defineProps({
} }
}) })
/** /** 抽屉 - close */
* 抽屉 - close
*/
const handlerDrawerClose = async () => { const handlerDrawerClose = async () => {
emits('handlerDrawerClose') emits('handlerDrawerClose')
} }
/** /** 获取 - 图片 detail */
* 获取 - 图片 detail
*/
const getImageDetail = async (id) => { const getImageDetail = async (id) => {
// //
imageDetail.value = await ImageApi.getImageDetail(id) imageDetail.value = await ImageApi.getImageDetail(id)
} }
/** /** 任务 - detail */
* 任务 - detail
*/
const handlerTaskDetail = async () => { const handlerTaskDetail = async () => {
showDrawer.value = true showDrawer.value = true
} }

View File

@ -28,16 +28,12 @@ const showImageDetailId = ref<number>(0) // 是否显示 task 详情
// TODO @fan /** */~ // TODO @fan /** */~
/** /** 抽屉 - close */
* 抽屉 - close
*/
const handlerDrawerClose = async () => { const handlerDrawerClose = async () => {
isShowImageDetail.value = false isShowImageDetail.value = false
} }
/** /** 任务 - detail */
* 任务 - detail
*/
const handlerDrawerOpen = async () => { const handlerDrawerOpen = async () => {
isShowImageDetail.value = true isShowImageDetail.value = true
} }
@ -50,9 +46,7 @@ const getImageList = async () => {
imageList.value = list imageList.value = list
} }
/** /** 图片 - btn click */
* 图片 - btn click
*/
const handlerImageBtnClick = async (type, imageDetail: ImageDetailVO) => { const handlerImageBtnClick = async (type, imageDetail: ImageDetailVO) => {
// image detail id // image detail id
showImageDetailId.value = imageDetail.id showImageDetailId.value = imageDetail.id
@ -69,9 +63,7 @@ const handlerImageBtnClick = async (type, imageDetail: ImageDetailVO) => {
} }
} }
/** /** 下载 - image */
* 下载 - image
*/
// TODO @fan download // TODO @fan download
const downloadImage = async (imageUrl) => { const downloadImage = async (imageUrl) => {
const image = new Image() const image = new Image()

View File

@ -37,9 +37,7 @@ const props = defineProps({
} }
}) })
/** /** 按钮 - 点击事件 */
* 按钮 - 点击事件
*/
const handlerBtnClick = async (type, imageDetail: ImageDetailVO) => { const handlerBtnClick = async (type, imageDetail: ImageDetailVO) => {
emits('onBtnClick', type, imageDetail) emits('onBtnClick', type, imageDetail)
} }

View File

@ -186,9 +186,7 @@ const emits = defineEmits(['onDrawStart', 'onDrawComplete'])
// TODO @fan /** */~ // TODO @fan /** */~
// TODO @fanhandler handle // TODO @fanhandler handle
/** /** 热词 - click */
* 热词 - click
*/
const handlerHotWordClick = async (hotWord: string) => { const handlerHotWordClick = async (hotWord: string) => {
// //
if (selectHotWord.value == hotWord) { if (selectHotWord.value == hotWord) {
@ -201,9 +199,7 @@ const handlerHotWordClick = async (hotWord: string) => {
prompt.value = hotWord prompt.value = hotWord
} }
/** /** 模型 - click */
* 模型 - click
*/
const handlerModelClick = async (model: ImageModelVO) => { const handlerModelClick = async (model: ImageModelVO) => {
if (selectModel.value === model) { if (selectModel.value === model) {
selectModel.value = {} as ImageModelVO selectModel.value = {} as ImageModelVO
@ -212,9 +208,7 @@ const handlerModelClick = async (model: ImageModelVO) => {
selectModel.value = model selectModel.value = model
} }
/** /** 样式 - click */
* 样式 - click
*/
const handlerStyleClick = async (imageStyle: ImageModelVO) => { const handlerStyleClick = async (imageStyle: ImageModelVO) => {
if (selectImageStyle.value === imageStyle) { if (selectImageStyle.value === imageStyle) {
selectImageStyle.value = {} as ImageModelVO selectImageStyle.value = {} as ImageModelVO
@ -223,9 +217,7 @@ const handlerStyleClick = async (imageStyle: ImageModelVO) => {
selectImageStyle.value = imageStyle selectImageStyle.value = imageStyle
} }
/** /** size - click */
* size - click
*/
const handlerSizeClick = async (imageSize: ImageSizeVO) => { const handlerSizeClick = async (imageSize: ImageSizeVO) => {
if (selectImageSize.value === imageSize) { if (selectImageSize.value === imageSize) {
selectImageSize.value = {} as ImageSizeVO selectImageSize.value = {} as ImageSizeVO
@ -234,9 +226,7 @@ const handlerSizeClick = async (imageSize: ImageSizeVO) => {
selectImageSize.value = imageSize selectImageSize.value = imageSize
} }
/** /** 图片生产 */
* 图片生产
*/
const handlerGenerateImage = async () => { const handlerGenerateImage = async () => {
try { try {
// //

View File

@ -33,17 +33,13 @@ const selectModel = ref('DALL3绘画')
const modelOptions = ['DALL3绘画', 'MJ绘画'] const modelOptions = ['DALL3绘画', 'MJ绘画']
const drawIn = ref<boolean>(false) // const drawIn = ref<boolean>(false) //
/** /** 绘画 - start */
* 绘画 - start
*/
const handlerDrawStart = async (type) => { const handlerDrawStart = async (type) => {
// todo // todo
drawIn.value = true drawIn.value = true
} }
/** /** 绘画 - complete */
* 绘画 - complete
*/
const handlerDrawComplete = async (type) => { const handlerDrawComplete = async (type) => {
drawIn.value = false drawIn.value = false
// todo // todo

View File

@ -198,9 +198,7 @@ const selectVersion = ref<any>('6.0') // 选中的 version
// Props // Props
const props = defineProps({}) const props = defineProps({})
/** /** 热词 - click */
* 热词 - click
*/
const handlerHotWordClick = async (hotWord: string) => { const handlerHotWordClick = async (hotWord: string) => {
// //
if (selectHotWord.value == hotWord) { if (selectHotWord.value == hotWord) {
@ -213,9 +211,7 @@ const handlerHotWordClick = async (hotWord: string) => {
prompt.value = hotWord prompt.value = hotWord
} }
/** /** size - click */
* size - click
*/
const handlerSizeClick = async (imageSize: ImageSizeVO) => { const handlerSizeClick = async (imageSize: ImageSizeVO) => {
if (selectImageSize.value === imageSize) { if (selectImageSize.value === imageSize) {
selectImageSize.value = {} as ImageSizeVO selectImageSize.value = {} as ImageSizeVO
@ -224,23 +220,17 @@ const handlerSizeClick = async (imageSize: ImageSizeVO) => {
selectImageSize.value = imageSize selectImageSize.value = imageSize
} }
/** /** 模型 - click */
* 模型 - click
*/
const handlerModelClick = async (model: ImageModelVO) => { const handlerModelClick = async (model: ImageModelVO) => {
selectModel.value = model selectModel.value = model
} }
/** /** version - click */
* version - click
*/
const handlerChangeVersion = async (version) => { const handlerChangeVersion = async (version) => {
console.log('version', version) console.log('version', version)
} }
/** /** 图片生产 */
* 图片生产
*/
const handlerGenerateImage = async () => { const handlerGenerateImage = async () => {
// todo @ // todo @
try { try {