diff --git a/README.md b/README.md index 4194996..4d24b43 100644 --- a/README.md +++ b/README.md @@ -109,18 +109,14 @@ A:考虑到服务端的开发语言、数据库类型都可能不尽相同, 或许你在工作中有类似的需求,或许你也对开发编辑器感兴趣,希望这个项目能给到你一些微薄帮助! -目前本项目也还在迭代中,有很多的不足,我也是一边学习一边成长。开源不易,希望看到这里的你可以给本项目点个 **Star** 支持一下~ +目前本项目也还在迭代中,有很多的不足,我也是一边学习一边成长。 + +[ -> 实时迭代计划文档](https://xp.palxp.cn/#/articles/1689319986889?id=%e8%bf%ad%e4%bb%a3%e8%ae%a1%e5%88%92) + +开源不易,别忘了给本项目点个 **Star** 支持一下~ [![Star History Chart](https://api.star-history.com/svg?repos=palxiao/poster-design&type=Date)](https://star-history.com/#palxiao/poster-design&Date) -#### 部分迭代计划: - -- [ ] P1: 文字特效属性编辑面板开发 -- [ ] P1:字体抽取功能 -- [ ] P1:PSD 解析重构(涉及基础库更换) - -[ -> 完整后续迭代计划文档](https://xp.palxp.cn/#/articles/1689319986889?id=%e8%bf%ad%e4%bb%a3%e8%ae%a1%e5%88%92) - ### LICENSE [MIT License](https://github.com/palxiao/poster-design/blob/main/LICENSE) diff --git a/src/api/ai.ts b/src/api/ai.ts index 560bc41..db7d7b7 100644 --- a/src/api/ai.ts +++ b/src/api/ai.ts @@ -3,7 +3,7 @@ * @Date: 2021-08-27 14:42:15 * @Description: AI相关接口 * @LastEditors: ShawnPhang - * @LastEditTime: 2023-09-30 12:08:01 + * @LastEditTime: 2023-10-13 00:07:19 */ import fetch from '@/utils/axios' diff --git a/src/api/material.ts b/src/api/material.ts index c90b58b..d22f62e 100644 --- a/src/api/material.ts +++ b/src/api/material.ts @@ -3,7 +3,7 @@ * @Date: 2021-08-27 14:42:15 * @Description: 媒体相关接口 * @LastEditors: ShawnPhang - * @LastEditTime: 2023-09-28 11:24:13 + * @LastEditTime: 2023-10-13 00:25:25 */ import fetch from '@/utils/axios' @@ -15,7 +15,7 @@ export const getList = (params: Type.Object = {}) => fetch('design/material', pa // 获取字体 export const getFonts = (params: Type.Object = {}) => fetch('design/fonts', params) -export const getFontSub = (params: Type.Object = {}) => fetch('design/font_sub', params) +export const getFontSub = (params: Type.Object = {}, extra: any = {}) => fetch('design/font_sub', params, 'get', {}, extra) // 图库列表 export const getImagesList = (params: Type.Object = {}) => fetch('design/imgs', params, 'get') diff --git a/src/assets/styles/main.less b/src/assets/styles/main.less index 44da0ef..8650ff0 100644 --- a/src/assets/styles/main.less +++ b/src/assets/styles/main.less @@ -15,6 +15,7 @@ body { -webkit-font-smoothing: antialiased; color: #333333; font-family: Hiragino Sans GB, Hiragino Sans GB W3, Arial, Microsoft Yahei, STHeiti, sans-serif; + overflow: hidden; } * { diff --git a/src/common/methods/fonts/index.ts b/src/common/methods/fonts/index.ts index 0ecbffd..8e38d12 100644 --- a/src/common/methods/fonts/index.ts +++ b/src/common/methods/fonts/index.ts @@ -2,12 +2,13 @@ * @Author: ShawnPhang * @Date: 2022-01-08 09:43:37 * @Description: 字体处理 - * @LastEditors: ShawnPhang - * @LastEditTime: 2023-07-25 11:13:01 + * @LastEditors: ShawnPhang + * @LastEditTime: 2023-10-13 01:30:33 */ // import { isSupportFontFamily, blob2Base64 } from './utils' import { getFonts } from '@/api/material' -// import store from '@/store' + +const nowVersion = '2' // 当前字体文件版本更新,将刷新前端缓存 const fontList: any = [] // const download: any = {} @@ -16,7 +17,7 @@ export const useFontStore = { // download, async init() { this.list = [] - localStorage.getItem('FONTS_VERSION') !== '1' && localStorage.removeItem('FONTS') + localStorage.getItem('FONTS_VERSION') !== nowVersion && localStorage.removeItem('FONTS') const localFonts: any = localStorage.getItem('FONTS') ? JSON.parse(localStorage.getItem('FONTS') || '') : [] if (localFonts.length > 0) { this.list.push(...localFonts) @@ -26,12 +27,12 @@ export const useFontStore = { const res = await getFonts({ pageSize: 400 }) this.list.unshift( ...res.list.map((x: any) => { - const { alias, oid, value, preview, woff, lang } = x - return { id: oid, value, preview, alias, url: woff, lang } + const { id, alias, oid, value, preview, woff, lang } = x + return { id, oid, value, preview, alias, url: woff, lang } }), ) localStorage.setItem('FONTS', JSON.stringify(this.list)) - localStorage.setItem('FONTS_VERSION', '1') + localStorage.setItem('FONTS_VERSION', nowVersion) } // store.dispatch('setFonts', this.list) }, diff --git a/src/common/methods/fonts/utils.ts b/src/common/methods/fonts/utils.ts index 655d3fb..b5fc953 100644 --- a/src/common/methods/fonts/utils.ts +++ b/src/common/methods/fonts/utils.ts @@ -77,7 +77,7 @@ export function filterSkyFonts() { // ); const textClouds: any = [] - ;((textClouds as unknown) as CloudText[]).forEach((cloud) => { + ;(textClouds as unknown as CloudText[]).forEach((cloud) => { // 找到文字组件字体 if (cloud.fontFamily && !fonts.includes(cloud.fontFamily)) { fonts.push(cloud.fontFamily) @@ -114,6 +114,10 @@ export function base642Blob(b64Data: string, contentType = '', sliceSize = 512) export async function blob2Base64(blob: Blob): Promise { return new Promise((resolve, reject) => { + if (blob.type === 'application/json') { + resolve('') + return + } const fileReader = new FileReader() fileReader.onload = () => { resolve(fileReader.result as string) diff --git a/src/components/modules/panel/wrap/ToolsListWrap.vue b/src/components/modules/panel/wrap/ToolsListWrap.vue index 7ee4506..99dbcc1 100644 --- a/src/components/modules/panel/wrap/ToolsListWrap.vue +++ b/src/components/modules/panel/wrap/ToolsListWrap.vue @@ -3,7 +3,7 @@ * @Date: 2022-02-11 18:48:23 * @Description: 组件列表 * @LastEditors: ShawnPhang - * @LastEditTime: 2023-10-08 22:57:34 + * @LastEditTime: 2023-10-13 18:48:25 -->