From 5546174bc06605efe08437aa9346e0ab2f1a7448 Mon Sep 17 00:00:00 2001 From: PengXiaoPeng Date: Sun, 23 Jul 2023 21:56:10 +0800 Subject: [PATCH] code: update template --- src/api/home.ts | 2 ++ src/components/business/image-cutout/ImageCutout.vue | 8 +------- src/views/Draw.vue | 9 --------- src/views/Psd.vue | 9 +++++---- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/api/home.ts b/src/api/home.ts index 1c47110..f9b69b0 100644 --- a/src/api/home.ts +++ b/src/api/home.ts @@ -35,3 +35,5 @@ export const getWorks = (params: Type.Object = {}) => fetch('design/poster', par // 作品列表 export const getMyDesign = (params: Type.Object = {}) => fetch('design/my', params, 'get') + +export const test = (params: Type.Object = {}) => fetch('https://res.palxp.com/api/upload', params, 'post') diff --git a/src/components/business/image-cutout/ImageCutout.vue b/src/components/business/image-cutout/ImageCutout.vue index 4d39672..ed6987b 100644 --- a/src/components/business/image-cutout/ImageCutout.vue +++ b/src/components/business/image-cutout/ImageCutout.vue @@ -36,8 +36,6 @@ import { defineComponent, reactive, toRefs, onMounted, nextTick } from 'vue' import { useStore } from 'vuex' import { UploadFilled } from '@element-plus/icons-vue' -// import { client } from '@gradio/client' -// import * as api from '@/api/ai' import uploader from '@/components/common/Uploader/index.vue' import _dl from '@/common/methods/download' @@ -73,11 +71,7 @@ export default defineComponent({ state.rawImage = URL.createObjectURL(file) fileName = file.name // 返回抠图 - const result = await app.predict('/predict', [ - file, // blob in 'Input' Image component - 'u2netp', // string (Option from: ['isnet-anime', 'isnet-general-use', 'sam', 'silueta', 'u2net', 'u2net_cloth_seg', 'u2net_custom', 'u2net_human_seg', 'u2netp']) in 'Models' Dropdown component - '', - ]) + const result = await app.predict('/predict', [file, 'u2netp', '']) state.rawImage && (state.cutImage = result?.data[0]) requestAnimationFrame(run) } diff --git a/src/views/Draw.vue b/src/views/Draw.vue index d8f6307..db5ff08 100644 --- a/src/views/Draw.vue +++ b/src/views/Draw.vue @@ -49,7 +49,6 @@ export default defineComponent({ const content = JSON.parse(data) content.page.backgroundImage && content.page.backgroundImage.split('.')[1] === 'palxp' && (content.page.backgroundImage += '@small') - this.compressImages(content.widgets) this.$store.commit('setDPage', content.page) id ? this.$store.commit('setDWidgets', content.widgets) : this.setTemplate(content.widgets) await this.$nextTick() @@ -149,14 +148,6 @@ export default defineComponent({ }) }) }, - compressImages(widgets: any) { - // 自用 - for (const item of widgets) { - if (item.imgUrl && item.imgUrl.split('.')[item.imgUrl.split('.').length - 1] === 'png') { - item.imgUrl.split('.')[1] === 'palxp' && (item.imgUrl += '@small') - } - } - }, }, }) diff --git a/src/views/Psd.vue b/src/views/Psd.vue index ea1fbef..de89fbd 100644 --- a/src/views/Psd.vue +++ b/src/views/Psd.vue @@ -10,9 +10,9 @@
-
迅排在线PSD解析
+
在线PSD解析
-
查看模板规范文档
+
说明及PSD规范文档
清空模板内容
@@ -81,7 +81,7 @@ export default defineComponent({ function loadJS() { const link_element = document.createElement('script') - link_element.setAttribute('src', '/psd.js') // 'https://design.palxp.com/psd.js.gz' + link_element.setAttribute('src', '/psd.js') document.head.appendChild(link_element) } async function selectFile(file: any) { @@ -166,7 +166,8 @@ export default defineComponent({ }, 100) }, jump2word() { - window.open('https://kdocs.cn/l/clmBsIkhve8d') + window.open('https://xp.palxp.com/#/articles/1687855172725') + // window.open('https://kdocs.cn/l/clmBsIkhve8d') }, }, })