diff --git a/src/types/slides.ts b/src/types/slides.ts
index 80987920..2dd6964d 100644
--- a/src/types/slides.ts
+++ b/src/types/slides.ts
@@ -452,7 +452,7 @@ export interface TableCellStyle {
backcolor?: string
fontsize?: string
fontname?: string
- align?: 'left' | 'center' | 'right'
+ align?: 'left' | 'center' | 'right' | 'justify'
}
diff --git a/src/views/Editor/Toolbar/ElementStylePanel/MultiStylePanel.vue b/src/views/Editor/Toolbar/ElementStylePanel/MultiStylePanel.vue
index 7242e6c5..5cffcc60 100644
--- a/src/views/Editor/Toolbar/ElementStylePanel/MultiStylePanel.vue
+++ b/src/views/Editor/Toolbar/ElementStylePanel/MultiStylePanel.vue
@@ -123,6 +123,7 @@
+
diff --git a/src/views/Editor/Toolbar/ElementStylePanel/ShapeStylePanel.vue b/src/views/Editor/Toolbar/ElementStylePanel/ShapeStylePanel.vue
index d6f65ce1..228a55ce 100644
--- a/src/views/Editor/Toolbar/ElementStylePanel/ShapeStylePanel.vue
+++ b/src/views/Editor/Toolbar/ElementStylePanel/ShapeStylePanel.vue
@@ -95,127 +95,8 @@
-
-
-
-
-
-
-
-
- emitRichTextCommand('color', value)"
- />
-
-
-
-
-
-
-
- emitRichTextCommand('backcolor', value)"
- />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- emitRichTextCommand('align', value)"
- >
-
-
-
-
+
+
-
+
@@ -255,11 +136,8 @@ import { type Ref, ref, watch } from 'vue'
import { storeToRefs } from 'pinia'
import { useMainStore, useSlidesStore } from '@/store'
import type { PPTShapeElement, ShapeGradient, ShapeText } from '@/types/slides'
-import { WEB_FONTS } from '@/configs/font'
import { type ShapePoolItem, SHAPE_LIST, SHAPE_PATH_FORMULAS } from '@/configs/shapes'
-import emitter, { EmitterEvents } from '@/utils/emitter'
import useHistorySnapshot from '@/hooks/useHistorySnapshot'
-import useTextFormatPainter from '@/hooks/useTextFormatPainter'
import useShapeFormatPainter from '@/hooks/useShapeFormatPainter'
import ElementOpacity from '../common/ElementOpacity.vue'
@@ -267,23 +145,20 @@ import ElementOutline from '../common/ElementOutline.vue'
import ElementShadow from '../common/ElementShadow.vue'
import ElementFlip from '../common/ElementFlip.vue'
import ColorButton from '../common/ColorButton.vue'
-import TextColorButton from '../common/TextColorButton.vue'
+import RichTextBase from '../common/RichTextBase.vue'
import ShapeItemThumbnail from '@/views/Editor/CanvasTool/ShapeItemThumbnail.vue'
import CheckboxButton from '@/components/CheckboxButton.vue'
import ColorPicker from '@/components/ColorPicker/index.vue'
import Divider from '@/components/Divider.vue'
import Slider from '@/components/Slider.vue'
-import Button from '@/components/Button.vue'
-import ButtonGroup from '@/components/ButtonGroup.vue'
import RadioButton from '@/components/RadioButton.vue'
import RadioGroup from '@/components/RadioGroup.vue'
import Select from '@/components/Select.vue'
-import SelectGroup from '@/components/SelectGroup.vue'
import Popover from '@/components/Popover.vue'
const mainStore = useMainStore()
const slidesStore = useSlidesStore()
-const { handleElement, handleElementId, richTextAttrs, availableFonts, textFormatPainter, shapeFormatPainter } = storeToRefs(mainStore)
+const { handleElement, handleElementId, shapeFormatPainter } = storeToRefs(mainStore)
const handleShapeElement = handleElement as Ref
@@ -306,7 +181,6 @@ watch(handleElement, () => {
}, { deep: true, immediate: true })
const { addHistorySnapshot } = useHistorySnapshot()
-const { toggleTextFormatPainter } = useTextFormatPainter()
const { toggleShapeFormatPainter } = useShapeFormatPainter()
const updateElement = (props: Partial) => {
@@ -373,16 +247,6 @@ const updateTextAlign = (align: 'top' | 'middle' | 'bottom') => {
const _text = _handleElement.text || defaultText
updateElement({ text: { ..._text, align } })
}
-
-const fontSizeOptions = [
- '12px', '14px', '16px', '18px', '20px', '22px', '24px', '28px', '32px',
- '36px', '40px', '44px', '48px', '54px', '60px', '66px', '72px', '76px',
- '80px', '88px', '96px', '104px', '112px', '120px',
-]
-
-const emitRichTextCommand = (command: string, value?: string) => {
- emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { action: { command, value } })
-}
\ No newline at end of file
diff --git a/src/views/Editor/Toolbar/common/RichTextBase.vue b/src/views/Editor/Toolbar/common/RichTextBase.vue
new file mode 100644
index 00000000..a5c51267
--- /dev/null
+++ b/src/views/Editor/Toolbar/common/RichTextBase.vue
@@ -0,0 +1,386 @@
+
+
+
+
+
+
+
+
+
+
+ emitRichTextCommand('color', value)"
+ />
+
+
+
+
+
+
+
+ emitRichTextCommand('backcolor', value)"
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A²
+ A₂
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
emitRichTextCommand('align', value)"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 减小首行缩进
+
+
+
+
+
+
+
+
+
+ 增大首行缩进
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file