diff --git a/README.md b/README.md index 4d307f10..f37c45a8 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ npm run dev - Straight lines, polylines, curves - Color - Width -- Style +- Style (solid, dashed, dotted) - Endpoint style #### Charts (bar, column, line, area, scatter, pie, donut, radar) - Chart type conversion @@ -192,7 +192,7 @@ If you wish to use this project for commercial gain, I hope you will respect ope - 你的代码被本项目作为依赖引用; - 你给本项目提交过重要的 PR 并且被合并; - 你长期参与到本项目的维护工作中; - 3. [邮件联系作者](mailto:pipipi_pikachu@163.com)付费获取商业授权。(注:仅授权,不存在额外商业化版本和技术支持) + 3. [邮件联系作者](mailto:pipipi_pikachu@163.com)付费获取商业授权。(注:仅授权,无其他版本和技术支持) # 👎👎👎 耻辱柱 🤮🤮🤮 > 👎桌案(西安)信息科技有限公司、西安即刻易用网络科技有限公司
diff --git a/README_zh.md b/README_zh.md index f3d29d63..6f0909a7 100644 --- a/README_zh.md +++ b/README_zh.md @@ -111,7 +111,7 @@ npm run dev - 直线、基础折线/曲线 - 颜色 - 宽度 -- 样式 +- 样式(实线、虚线、点线) - 端点样式 #### 图表(柱状图、条形图、折线图、面积图、散点图、饼图、环形图、雷达图) - 图表类型转换 diff --git a/src/hooks/useExport.ts b/src/hooks/useExport.ts index 2d8a4961..0f2e038e 100644 --- a/src/hooks/useExport.ts +++ b/src/hooks/useExport.ts @@ -333,14 +333,21 @@ export default () => { } } + const dashTypeMap = { + 'solid': 'solid', + 'dashed': 'dash', + 'dotted': 'sysDot', + } + // 获取边框配置 const getOutlineOption = (outline: PPTElementOutline): pptxgen.ShapeLineProps => { const c = formatColor(outline?.color || '#000000') + return { color: c.color, transparency: (1 - c.alpha) * 100, width: (outline.width || 1) / ratioPx2Pt.value, - dashType: outline.style === 'solid' ? 'solid' : 'dash', + dashType: outline.style ? dashTypeMap[outline.style] as 'solid' | 'dash' | 'sysDot' : 'solid', } } @@ -588,7 +595,7 @@ export default () => { color: c.color, transparency: (1 - c.alpha) * 100, width: el.width / ratioPx2Pt.value, - dashType: el.style === 'solid' ? 'solid' : 'dash', + dashType: dashTypeMap[el.style] as 'solid' | 'dash' | 'sysDot', beginArrowType: el.points[0] ? 'arrow' : 'none', endArrowType: el.points[1] ? 'arrow' : 'none', }, diff --git a/src/hooks/useImport.ts b/src/hooks/useImport.ts index 054ec27e..c85adb5d 100644 --- a/src/hooks/useImport.ts +++ b/src/hooks/useImport.ts @@ -88,7 +88,7 @@ export default () => { top: el.top, start, end, - style: el.borderType === 'solid' ? 'solid' : 'dashed', + style: el.borderType, color: el.borderColor, points: ['', /straightConnector/.test(el.shapType) ? 'arrow' : ''] } @@ -190,7 +190,7 @@ export default () => { outline: { color: el.borderColor, width: el.borderWidth, - style: el.borderType === 'solid' ? 'solid' : 'dashed', + style: el.borderType, }, fill: el.fillColor, vertical: el.isVertical, @@ -278,7 +278,7 @@ export default () => { outline: { color: el.borderColor, width: el.borderWidth, - style: el.borderType === 'solid' ? 'solid' : 'dashed', + style: el.borderType, }, text: { content: convertFontSizePtToPx(el.content, ratio), @@ -386,7 +386,7 @@ export default () => { data, outline: { width: el.borderWidth || 2, - style: el.borderType === 'solid' ? 'solid' : 'dashed', + style: el.borderType, color: el.borderColor || '#eeece1', }, cellMinHeight: 36, diff --git a/src/types/slides.ts b/src/types/slides.ts index 284d4248..b9364991 100644 --- a/src/types/slides.ts +++ b/src/types/slides.ts @@ -80,7 +80,7 @@ export interface PPTElementShadow { * color?: 边框颜色 */ export interface PPTElementOutline { - style?: 'dashed' | 'solid' + style?: 'dashed' | 'solid' | 'dotted' width?: number color?: string } @@ -362,7 +362,7 @@ export type LinePoint = '' | 'arrow' | 'dot' * * end: 终点位置([x, y]) * - * style: 线条样式(实线、虚线) + * style: 线条样式(实线、虚线、点线) * * color: 线条颜色 * @@ -382,7 +382,7 @@ export interface PPTLineElement extends Omit diff --git a/src/views/Editor/Toolbar/ElementStylePanel/MultiStylePanel.vue b/src/views/Editor/Toolbar/ElementStylePanel/MultiStylePanel.vue index 9a3ecc0b..8b38e016 100644 --- a/src/views/Editor/Toolbar/ElementStylePanel/MultiStylePanel.vue +++ b/src/views/Editor/Toolbar/ElementStylePanel/MultiStylePanel.vue @@ -20,10 +20,11 @@ diff --git a/src/views/Editor/Toolbar/common/ElementOutline.vue b/src/views/Editor/Toolbar/common/ElementOutline.vue index 02228157..4f15394c 100644 --- a/src/views/Editor/Toolbar/common/ElementOutline.vue +++ b/src/views/Editor/Toolbar/common/ElementOutline.vue @@ -15,10 +15,11 @@