diff --git a/README.md b/README.md
index f37c45a8..2813a951 100644
--- a/README.md
+++ b/README.md
@@ -57,6 +57,7 @@ npm run dev
- Transition animations
- Element animations (entrance, exit, emphasis)
- Selection panel (hide elements, layer sorting, element naming)
+- Labels for Page and Node Types (usable for template-related features)
- Find/replace
- Annotations
### Slide Element Editing
diff --git a/README_zh.md b/README_zh.md
index 6f0909a7..198bdad7 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -53,6 +53,7 @@ npm run dev
- 翻页动画
- 元素动画(入场、退场、强调)
- 选择面板(隐藏元素、层级排序、元素命名)
+- 页面和节点类型标注(可用于模板相关功能)
- 查找/替换
- 批注
### 幻灯片元素编辑
diff --git a/src/store/main.ts b/src/store/main.ts
index b71739e5..575f9d8e 100644
--- a/src/store/main.ts
+++ b/src/store/main.ts
@@ -38,6 +38,7 @@ export interface MainState {
showSelectPanel: boolean
showSearchPanel: boolean
showNotesPanel: boolean
+ showMarkupPanel: boolean
}
const nanoid = customAlphabet('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')
@@ -73,6 +74,7 @@ export const useMainStore = defineStore('main', {
showSelectPanel: false, // 打开选择面板
showSearchPanel: false, // 打开查找替换面板
showNotesPanel: false, // 打开批注面板
+ showMarkupPanel: false, // 打开类型标注面板
}),
getters: {
@@ -202,5 +204,9 @@ export const useMainStore = defineStore('main', {
setNotesPanelState(show: boolean) {
this.showNotesPanel = show
},
+
+ setMarkupPanelState(show: boolean) {
+ this.showMarkupPanel = show
+ },
},
})
\ No newline at end of file
diff --git a/src/types/slides.ts b/src/types/slides.ts
index b9364991..082b7a2f 100644
--- a/src/types/slides.ts
+++ b/src/types/slides.ts
@@ -137,6 +137,8 @@ interface PPTBaseElement {
}
+export type TextType = 'title' | 'subtitle' | 'content' | 'item' | 'notes' | 'header' | 'footer'
+
/**
* 文本元素
*
@@ -163,6 +165,8 @@ interface PPTBaseElement {
* paragraphSpace?: 段间距,默认 5px
*
* vertical?: 竖向文本
+ *
+ * textType?: 文本类型
*/
export interface PPTTextElement extends PPTBaseElement {
type: 'text'
@@ -177,6 +181,7 @@ export interface PPTTextElement extends PPTBaseElement {
shadow?: PPTElementShadow
paragraphSpace?: number
vertical?: boolean
+ textType?: TextType
}
@@ -289,12 +294,15 @@ export type ShapeTextAlign = 'top' | 'middle' | 'bottom'
* defaultColor: 默认颜色(会被文本内容中的HTML内联样式覆盖)
*
* align: 文本对齐方向(垂直方向)
+ *
+ * type: 文本类型
*/
export interface ShapeText {
content: string
defaultFontName: string
defaultColor: string
align: ShapeTextAlign
+ type?: TextType
}
/**
@@ -693,6 +701,8 @@ export interface SectionTag {
title?: string
}
+export type SlideType = 'cover' | 'contents' | 'transition' | 'content' | 'end'
+
/**
* 幻灯片页面
*
@@ -700,7 +710,7 @@ export interface SectionTag {
*
* elements: 元素集合
*
- * notes: 批注
+ * notes?: 批注
*
* remark?: 备注
*
@@ -709,6 +719,8 @@ export interface SectionTag {
* animations?: 元素动画集合
*
* turningMode?: 翻页方式
+ *
+ * slideType?: 页面类型
*/
export interface Slide {
id: string
@@ -719,6 +731,7 @@ export interface Slide {
animations?: PPTAnimation[]
turningMode?: TurningMode
sectionTag?: SectionTag
+ type?: SlideType
}
/**
diff --git a/src/views/Editor/EditorHeader/index.vue b/src/views/Editor/EditorHeader/index.vue
index b35912af..69a77a62 100644
--- a/src/views/Editor/EditorHeader/index.vue
+++ b/src/views/Editor/EditorHeader/index.vue
@@ -17,6 +17,7 @@
导出文件
重置幻灯片
+ 幻灯片类型标注
意见反馈
常见问题
快捷操作
@@ -125,6 +126,10 @@ const setDialogForExport = (type: DialogForExportTypes) => {
mainStore.setDialogForExport(type)
mainMenuVisible.value = false
}
+
+const openMarkupPanel = () => {
+ mainStore.setMarkupPanelState(true)
+}
\ No newline at end of file
diff --git a/src/views/Editor/index.vue b/src/views/Editor/index.vue
index 07849b9a..f9b0c19b 100644
--- a/src/views/Editor/index.vue
+++ b/src/views/Editor/index.vue
@@ -19,6 +19,7 @@
+
mainStore.setDialogForExport('')
const remarkHeight = ref(40)