Browse Source

导出修改

黄琪勇 3 months ago
parent
commit
c57890018f

+ 0 - 47
src/utils/htmlParser/format.ts

@@ -1,47 +0,0 @@
-import type { HTMLNode, CommentOrTextAST, ElementAST, AST } from './types'
-
-export const splitHead = (str: string, sep: string) => {
-  const idx = str.indexOf(sep)
-  if (idx === -1) return [str]
-  return [str.slice(0, idx), str.slice(idx + sep.length)]
-}
-
-const unquote = (str: string) => {
-  const car = str.charAt(0)
-  const end = str.length - 1
-  const isQuoteStart = car === '"' || car === "'"
-  if (isQuoteStart && car === str.charAt(end)) {
-    return str.slice(1, end)
-  }
-  return str
-}
-
-const formatAttributes = (attributes: string[]) => {
-  return attributes.map(attribute => {
-    const parts = splitHead(attribute.trim(), '=')
-    const key = parts[0]
-    const value = typeof parts[1] === 'string' ? unquote(parts[1]) : null
-    return { key, value }
-  })
-}
-
-export const format = (nodes: HTMLNode[]): AST[] => {
-  return nodes.map(node => {   
-    if (node.type === 'element') {
-      const children = format(node.children)
-      const item: ElementAST = {
-        type: 'element',
-        tagName: node.tagName.toLowerCase(),
-        attributes: formatAttributes(node.attributes),
-        children,
-      }
-      return item
-    }
-
-    const item: CommentOrTextAST = {
-      type: node.type,
-      content: node.content,
-    }
-    return item
-  })
-}

+ 0 - 15
src/utils/htmlParser/index.ts

@@ -1,15 +0,0 @@
-// 参考:https://github.com/andrejewski/himalaya 用TypeScript重写并简化部分功能
-
-import { lexer } from './lexer'
-import { parser } from './parser'
-import { format } from './format'
-import { toHTML } from './stringify'
-export type { AST } from './types'
-
-export const toAST = (str: string) => {
-  const tokens = lexer(str)
-  const nodes = parser(tokens)
-  return format(nodes)
-}
-
-export { toHTML }

+ 0 - 275
src/utils/htmlParser/lexer.ts

@@ -1,275 +0,0 @@
-import { startsWith, endsWith } from 'lodash'
-import type { Token } from './types'
-import { childlessTags } from './tags'
-
-interface State {
-  str: string
-  position: number
-  tokens: Token[]
-}
-
-const jumpPosition = (state: State, end: number) => {
-  const len = end - state.position
-  movePositopn(state, len)
-}
-
-const movePositopn = (state: State, len: number) => {
-  state.position = state.position + len
-}
-
-const findTextEnd = (str: string, index: number) => {
-  const isEnd = false
-  while (!isEnd) {
-    const textEnd = str.indexOf('<', index)
-    if (textEnd === -1) {
-      return textEnd
-    }
-    const char = str.charAt(textEnd + 1)
-    if (char === '/' || char === '!' || /[A-Za-z0-9]/.test(char)) {
-      return textEnd
-    }
-    index = textEnd + 1
-  }
-  return -1
-}
-
-const lexText = (state: State) => {
-  const { str } = state
-  let textEnd = findTextEnd(str, state.position)
-  if (textEnd === state.position) return
-  if (textEnd === -1) {
-    textEnd = str.length
-  }
-
-  const content = str.slice(state.position, textEnd)
-  jumpPosition(state, textEnd)
-
-  state.tokens.push({
-    type: 'text', 
-    content, 
-  })
-}
-
-const lexComment = (state: State) => {
-  const { str } = state
-
-  movePositopn(state, 4)
-  let contentEnd = str.indexOf('-->', state.position)
-  let commentEnd = contentEnd + 3
-  if (contentEnd === -1) {
-    contentEnd = commentEnd = str.length
-  }
-
-  const content = str.slice(state.position, contentEnd)
-  jumpPosition(state, commentEnd)
-
-  state.tokens.push({
-    type: 'comment',
-    content,
-  })
-}
-
-const lexTagName = (state: State) => {
-  const { str } = state
-  const len = str.length
-  let start = state.position
-
-  while (start < len) {
-    const char = str.charAt(start)
-    const isTagChar = !(/\s/.test(char) || char === '/' || char === '>')
-    if (isTagChar) break
-    start++
-  }
-
-  let end = start + 1
-  while (end < len) {
-    const char = str.charAt(end)
-    const isTagChar = !(/\s/.test(char) || char === '/' || char === '>')
-    if (!isTagChar) break
-    end++
-  }
-
-  jumpPosition(state, end)
-  const tagName = str.slice(start, end)
-  state.tokens.push({
-    type: 'tag',
-    content: tagName
-  })
-  return tagName
-}
-
-const lexTagAttributes = (state: State) => {
-  const { str, tokens } = state
-  let cursor = state.position
-  let quote = null
-  let wordBegin = cursor
-  const words = []
-  const len = str.length
-  while (cursor < len) {
-    const char = str.charAt(cursor)
-    if (quote) {
-      const isQuoteEnd = char === quote
-      if (isQuoteEnd) quote = null
-      cursor++
-      continue
-    }
-
-    const isTagEnd = char === '/' || char === '>'
-    if (isTagEnd) {
-      if (cursor !== wordBegin) words.push(str.slice(wordBegin, cursor))
-      break
-    }
-
-    const isWordEnd = /\s/.test(char)
-    if (isWordEnd) {
-      if (cursor !== wordBegin) words.push(str.slice(wordBegin, cursor))
-      wordBegin = cursor + 1
-      cursor++
-      continue
-    }
-
-    const isQuoteStart = char === '\'' || char === '"'
-    if (isQuoteStart) {
-      quote = char
-      cursor++
-      continue
-    }
-
-    cursor++
-  }
-  jumpPosition(state, cursor)
-
-  const type = 'attribute'
-  for (let i = 0; i < words.length; i++) {
-    const word = words[i]
-
-    const isNotPair = word.indexOf('=') === -1
-    if (isNotPair) {
-      const secondWord = words[i + 1]
-      if (secondWord && startsWith(secondWord, '=')) {
-        if (secondWord.length > 1) {
-          const newWord = word + secondWord
-          tokens.push({ type, content: newWord })
-          i += 1
-          continue
-        }
-        const thirdWord = words[i + 2]
-        i += 1
-        if (thirdWord) {
-          const newWord = word + '=' + thirdWord
-          tokens.push({ type, content: newWord })
-          i += 1
-          continue
-        }
-      }
-    }
-    if (endsWith(word, '=')) {
-      const secondWord = words[i + 1]
-      if (secondWord && secondWord.indexOf('=') === -1) {
-        const newWord = word + secondWord
-        tokens.push({ type, content: newWord })
-        i += 1
-        continue
-      }
-
-      const newWord = word.slice(0, -1)
-      tokens.push({ type, content: newWord })
-      continue
-    }
-
-    tokens.push({ type, content: word })
-  }
-}
-
-const lexSkipTag = (tagName: string, state: State) => {
-  const { str, tokens } = state
-  const safeTagName = tagName.toLowerCase()
-  const len = str.length
-  let index = state.position
-  
-  while (index < len) {
-    const nextTag = str.indexOf('</', index)
-    if (nextTag === -1) {
-      lexText(state)
-      break
-    }
-
-    const tagState = {
-      str,
-      position: state.position,
-      tokens: [],
-    }
-    jumpPosition(tagState, nextTag)
-    const name = lexTag(tagState)
-    if (safeTagName !== name.toLowerCase()) {
-      index = tagState.position
-      continue
-    }
-
-    if (nextTag !== state.position) {
-      const textStart = state.position
-      jumpPosition(state, nextTag)
-      tokens.push({
-        type: 'text',
-        content: str.slice(textStart, nextTag),
-      })
-    }
-
-    tokens.push(...tagState.tokens)
-    jumpPosition(state, tagState.position)
-    break
-  }
-}
-
-const lexTag = (state: State) => {
-  const { str } = state
-  const secondChar = str.charAt(state.position + 1)
-  const tagStartClose = secondChar === '/'
-  movePositopn(state, tagStartClose ? 2 : 1)
-  state.tokens.push({
-    type: 'tag-start',
-    close: tagStartClose,
-  })
-
-  const tagName = lexTagName(state)
-  lexTagAttributes(state)
-
-  const firstChar = str.charAt(state.position)
-  const tagEndClose = firstChar === '/'
-  movePositopn(state, tagEndClose ? 2 : 1)
-  state.tokens.push({
-    type: 'tag-end',
-    close: tagEndClose,
-  })
-  return tagName
-}
-
-const lex = (state: State) => {
-  const str = state.str
-  const len = str.length
-
-  while (state.position < len) {
-    const start = state.position
-    lexText(state)
-
-    if (state.position === start) {
-      const isComment = startsWith(str, '!--', start + 1)
-      if (isComment) lexComment(state)
-      else {
-        const tagName = lexTag(state)
-        const safeTag = tagName.toLowerCase()
-        if (childlessTags.includes(safeTag)) lexSkipTag(tagName, state)
-      }
-    }
-  }
-}
-
-export const lexer = (str: string): Token[] => {
-  const state = {
-    str,
-    position: 0,
-    tokens: [],
-  }
-  lex(state)
-  return state.tokens
-}

+ 0 - 129
src/utils/htmlParser/parser.ts

@@ -1,129 +0,0 @@
-import type { Token, HTMLNode, TagToken, NormalElement, TagEndToken, AttributeToken, TextToken } from './types'
-import { closingTags, closingTagAncestorBreakers, voidTags } from './tags'
-
-interface StackItem {
-  tagName: string | null
-  children: HTMLNode[]
-}
-
-interface State {
-  stack: StackItem[]
-  cursor: number
-  tokens: Token[]
-}
-
-export const parser = (tokens: Token[]) => {
-  const root: StackItem = { tagName: null, children: [] }
-  const state: State = { tokens, cursor: 0, stack: [root] }
-  parse(state)
-  return root.children
-}
-
-export const hasTerminalParent = (tagName: string, stack: StackItem[]) => {
-  const tagParents = closingTagAncestorBreakers[tagName]
-  if (tagParents) {
-    let currentIndex = stack.length - 1
-    while (currentIndex >= 0) {
-      const parentTagName = stack[currentIndex].tagName
-      if (parentTagName === tagName) break
-      if (parentTagName && tagParents.includes(parentTagName)) return true
-      currentIndex--
-    }
-  }
-  return false
-}
-
-export const rewindStack = (stack: StackItem[], newLength: number) => {
-  stack.splice(newLength)
-}
-
-export const parse = (state: State) => {
-  const { stack, tokens } = state
-  let { cursor } = state
-  let nodes = stack[stack.length - 1].children
-  const len = tokens.length
-  
-  while (cursor < len) {
-    const token = tokens[cursor]
-    if (token.type !== 'tag-start') {
-      nodes.push(token as TextToken)
-      cursor++
-      continue
-    }
-
-    const tagToken = tokens[++cursor] as TagToken
-    cursor++
-    const tagName = tagToken.content.toLowerCase()
-    if (token.close) {
-      let index = stack.length
-      let shouldRewind = false
-      while (--index > -1) {
-        if (stack[index].tagName === tagName) {
-          shouldRewind = true
-          break
-        }
-      }
-      while (cursor < len) {
-        if (tokens[cursor].type !== 'tag-end') break
-        cursor++
-      }
-      if (shouldRewind) {
-        rewindStack(stack, index)
-        break
-      } 
-      else continue
-    }
-
-    const isClosingTag = closingTags.includes(tagName)
-    let shouldRewindToAutoClose = isClosingTag
-    if (shouldRewindToAutoClose) {
-      shouldRewindToAutoClose = !hasTerminalParent(tagName, stack)
-    }
-
-    if (shouldRewindToAutoClose) {
-      let currentIndex = stack.length - 1
-      while (currentIndex > 0) {
-        if (tagName === stack[currentIndex].tagName) {
-          rewindStack(stack, currentIndex)
-          const previousIndex = currentIndex - 1
-          nodes = stack[previousIndex].children
-          break
-        }
-        currentIndex = currentIndex - 1
-      }
-    }
-
-    const attributes = []
-    let tagEndToken: TagEndToken | undefined
-    while (cursor < len) {
-      const _token = tokens[cursor]
-      if (_token.type === 'tag-end') {
-        tagEndToken = _token
-        break
-      }
-      attributes.push((_token as AttributeToken).content)
-      cursor++
-    }
-
-    if (!tagEndToken) break
-
-    cursor++
-    const children: HTMLNode[] = []
-    const elementNode: NormalElement = {
-      type: 'element',
-      tagName: tagToken.content,
-      attributes,
-      children,
-    }
-    nodes.push(elementNode)
-
-    const hasChildren = !(tagEndToken.close || voidTags.includes(tagName))
-    if (hasChildren) {
-      stack.push({tagName, children})
-      const innerState = { tokens, cursor, stack }
-      parse(innerState)
-      cursor = innerState.cursor
-    }
-  }
-  state.cursor = cursor
-}

+ 0 - 28
src/utils/htmlParser/stringify.ts

@@ -1,28 +0,0 @@
-import type { AST, ElementAST, ElementAttribute } from './types'
-import { voidTags } from './tags'
-
-export const formatAttributes = (attributes: ElementAttribute[]) => {
-  return attributes.reduce((attrs, attribute) => {
-    const { key, value } = attribute
-    if (value === null) return `${attrs} ${key}`
-    if (key === 'style' && !value) return ''
-
-    const quoteEscape = value.indexOf('\'') !== -1
-    const quote = quoteEscape ? '"' : '\''
-    return `${attrs} ${key}=${quote}${value}${quote}`
-  }, '')
-}
-
-export const toHTML = (tree: AST[]) => {
-  const htmlStrings: string[] = tree.map(node => {
-    if (node.type === 'text') return node.content
-    if (node.type === 'comment') return `<!--${node.content}-->`
-
-    const { tagName, attributes, children } = node as ElementAST
-    const isSelfClosing = voidTags.includes(tagName.toLowerCase())
-
-    if (isSelfClosing) return `<${tagName}${formatAttributes(attributes)}>`
-    return `<${tagName}${formatAttributes(attributes)}>${toHTML(children)}</${tagName}>`
-  })
-  return htmlStrings.join('')
-}

+ 0 - 20
src/utils/htmlParser/tags.ts

@@ -1,20 +0,0 @@
-export const childlessTags = ['style', 'script', 'template']
-
-export const closingTags = ['html', 'head', 'body', 'p', 'dt', 'dd', 'li', 'option', 'thead', 'th', 'tbody', 'tr', 'td', 'tfoot', 'colgroup']
-
-interface ClosingTagAncestorBreakers {
-  [key: string]: string[]
-}
-
-export const closingTagAncestorBreakers: ClosingTagAncestorBreakers = {
-  li: ['ul', 'ol', 'menu'],
-  dt: ['dl'],
-  dd: ['dl'],
-  tbody: ['table'],
-  thead: ['table'],
-  tfoot: ['table'],
-  tr: ['table'],
-  td: ['table'],
-}
-
-export const voidTags = ['!doctype', 'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']

+ 0 - 69
src/utils/htmlParser/types.ts

@@ -1,69 +0,0 @@
-export interface ElementAttribute {
-  key: string
-  value: string | null
-}
-
-export interface CommentElement {
-  type: 'comment'
-  content: string
-}
-
-export interface TextElement {
-  type: 'text'
-  content: string
-}
-
-export interface NormalElement {
-  type: 'element'
-  tagName: string
-  children: HTMLNode[]
-  attributes: string[]
-}
-
-export type HTMLNode = CommentElement | TextElement | NormalElement
-
-export interface ElementAST {
-  type: 'element'
-  tagName: string
-  children: AST[]
-  attributes: ElementAttribute[]
-}
-
-export interface CommentOrTextAST {
-  type: 'comment' | 'text'
-  content: string
-}
-
-export type AST = CommentOrTextAST | ElementAST
-
-export interface TagStartToken {
-  type: 'tag-start'
-  close: boolean
-}
-
-export interface TagEndToken {
-  type: 'tag-end'
-  close: boolean
-}
-
-export interface TagToken {
-  type: 'tag'
-  content: string
-}
-
-export interface TextToken {
-  type: 'text'
-  content: string
-}
-
-export interface CommentToken {
-  type: 'comment'
-  content: string
-}
-
-export interface AttributeToken {
-  type: 'attribute'
-  content: string
-}
-
-export type Token = TagStartToken | TagEndToken | TagToken | TextToken | CommentToken | AttributeToken

+ 0 - 55
src/utils/svg2Base64.ts

@@ -1,55 +0,0 @@
-// svg转base64图片,参考:https://github.com/scriptex/svg64
-
-const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
-const PREFIX = 'data:image/svg+xml;base64,'
-
-const utf8Encode = (string: string) => {
-  string = string.replace(/\r\n/g, '\n')
-  let utftext = ''
-
-  for (let n = 0; n < string.length; n++) {
-    const c = string.charCodeAt(n)
-
-    if (c < 128) {
-      utftext += String.fromCharCode(c)
-    }
-    else if (c > 127 && c < 2048) {
-      utftext += String.fromCharCode((c >> 6) | 192)
-      utftext += String.fromCharCode((c & 63) | 128)
-    }
-    else {
-      utftext += String.fromCharCode((c >> 12) | 224)
-      utftext += String.fromCharCode(((c >> 6) & 63) | 128)
-      utftext += String.fromCharCode((c & 63) | 128)
-    }
-  }
-
-  return utftext
-}
-
-const encode = (input: string) => {
-  let output = ''
-  let chr1, chr2, chr3, enc1, enc2, enc3, enc4
-  let i = 0
-  input = utf8Encode(input)
-  while (i < input.length) {
-    chr1 = input.charCodeAt(i++)
-    chr2 = input.charCodeAt(i++)
-    chr3 = input.charCodeAt(i++)
-    enc1 = chr1 >> 2
-    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)
-    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)
-    enc4 = chr3 & 63
-    if (isNaN(chr2)) enc3 = enc4 = 64
-    else if (isNaN(chr3)) enc4 = 64
-    output = output + characters.charAt(enc1) + characters.charAt(enc2) + characters.charAt(enc3) + characters.charAt(enc4)
-  }
-  return output
-}
-
-export const svg2Base64 = (element: Element) => {
-  const XMLS = new XMLSerializer()
-  const svg = XMLS.serializeToString(element)
-
-  return PREFIX + encode(svg)
-}

+ 0 - 146
src/utils/svgPathParser.ts

@@ -1,146 +0,0 @@
-import { SVGPathData } from 'svg-pathdata'
-import arcToBezier from 'svg-arc-to-cubic-bezier'
-
-const typeMap = {
-  1: 'Z',
-  2: 'M',
-  4: 'H',
-  8: 'V',
-  16: 'L',
-  32: 'C',
-  64: 'S',
-  128: 'Q',
-  256: 'T',
-  512: 'A',
-}
-
-/**
- * 简单解析SVG路径
- * @param d SVG path d属性
- */
-export const parseSvgPath = (d: string) => {
-  const pathData = new SVGPathData(d)
-
-  const ret = pathData.commands.map(item => {
-    return { ...item, type: typeMap[item.type] }
-  })
-  return ret
-}
-
-export type SvgPath = ReturnType<typeof parseSvgPath>
-
-/**
- * 解析SVG路径,并将圆弧(A)类型的路径转为三次贝塞尔(C)类型的路径
- * @param d SVG path d属性
- */
-export const toPoints = (d: string) => {
-  const pathData = new SVGPathData(d)
-  
-  const points = []
-  for (const item of pathData.commands) {
-    const type = typeMap[item.type]
-
-    if (item.type === 2 || item.type === 16) {
-      points.push({
-        x: item.x,
-        y: item.y,
-        relative: item.relative,
-        type,
-      })
-    }
-    if (item.type === 32) {
-      points.push({
-        x: item.x, 
-        y: item.y,
-        curve: {
-          type: 'cubic',
-          x1: item.x1,
-          y1: item.y1,
-          x2: item.x2,
-          y2: item.y2,
-        },
-        relative: item.relative,
-        type,
-      })
-    }
-    else if (item.type === 128) {
-      points.push({
-        x: item.x, 
-        y: item.y,
-        curve: {
-          type: 'quadratic',
-          x1: item.x1,
-          y1: item.y1,
-        },
-        relative: item.relative,
-        type,
-      })
-    }
-    else if (item.type === 512) {
-      const lastPoint = points[points.length - 1]
-      if (!['M', 'L', 'Q', 'C'].includes(lastPoint.type)) continue
-
-      const cubicBezierPoints = arcToBezier({
-        px: lastPoint.x as number,
-        py: lastPoint.y as number,
-        cx: item.x,
-        cy: item.y,
-        rx: item.rX,
-        ry: item.rY,
-        xAxisRotation: item.xRot,
-        largeArcFlag: item.lArcFlag,
-        sweepFlag: item.sweepFlag,
-      })
-      for (const cbPoint of cubicBezierPoints) {
-        points.push({
-          x: cbPoint.x, 
-          y: cbPoint.y,
-          curve: {
-            type: 'cubic',
-            x1: cbPoint.x1,
-            y1: cbPoint.y1,
-            x2: cbPoint.x2,
-            y2: cbPoint.y2,
-          },
-          relative: false,
-          type: 'C',
-        })
-      }
-    }
-    else if (item.type === 1) {
-      points.push({ close: true, type })
-    }
-    else continue
-  }
-  return points
-}
-
-export const getSvgPathRange = (path: string) => {
-  try {
-    const pathData = new SVGPathData(path)
-    const xList = []
-    const yList = []
-    for (const item of pathData.commands) {
-      const x = ('x' in item) ? item.x : 0
-      const y = ('y' in item) ? item.y : 0
-      xList.push(x)
-      yList.push(y)
-    }
-    return {
-      minX: Math.min(...xList),
-      minY: Math.min(...yList),
-      maxX: Math.max(...xList),
-      maxY: Math.max(...yList),
-    }
-  }
-  catch {
-    return {
-      minX: 0,
-      minY: 0,
-      maxX: 0,
-      maxY: 0,
-    }
-  }
-}
-
-export type SvgPoints = ReturnType<typeof toPoints>

+ 6 - 105
src/views/Editor/ExportDialog/ExportPPTX.vue

@@ -1,47 +1,7 @@
 <template>
   <div class="export-pptx-dialog">
-    <div class="configs">
-      <div class="row">
-        <div class="title">导出范围:</div>
-        <RadioGroup
-          class="config-item"
-          v-model:value="rangeType"
-        >
-          <RadioButton style="width: 33.33%;" value="all">全部</RadioButton>
-          <RadioButton style="width: 33.33%;" value="current">当前页</RadioButton>
-          <RadioButton style="width: 33.33%;" value="custom">自定义</RadioButton>
-        </RadioGroup>
-      </div>
-      <div class="row" v-if="rangeType === 'custom'">
-        <div class="title" :data-range="`(${range[0]} ~ ${range[1]})`">自定义范围:</div>
-        <Slider
-          class="config-item"
-          range
-          :min="1"
-          :max="slides.length"
-          :step="1"
-          v-model:value="range"
-        />
-      </div>
-      <div class="row">
-        <div class="title">忽略音频/视频:</div>
-        <div class="config-item">
-          <Switch v-model:value="ignoreMedia" v-tooltip="'导出时默认忽略音视频,若您的幻灯片中存在音视频元素,且希望将其导出到PPTX文件中,可选择关闭【忽略音视频】选项,但要注意这将会大幅增加导出用时。'" />
-        </div>
-      </div>
-      <div class="row">
-        <div class="title">覆盖默认母版:</div>
-        <div class="config-item">
-          <Switch v-model:value="masterOverwrite" />
-        </div>
-      </div>
-
-      <div class="tip" v-if="!ignoreMedia">
-        提示:1. 支持导出格式:avi、mp4、mov、wmv、mp3、wav;2. 跨域资源无法导出。
-      </div>
-    </div>
     <div class="btns">
-      <Button class="btn export" type="primary" @click="exportPPTX(selectedSlides, masterOverwrite, ignoreMedia)">导出 PPTX</Button>
+      <Button class="btn export" type="primary" @click="exportPPTX()">导出 PPTX</Button>
       <Button class="btn close" @click="emit('close')">关闭</Button>
     </div>
 
@@ -50,39 +10,16 @@
 </template>
 
 <script lang="ts" setup>
-import { computed, ref } from 'vue'
-import { storeToRefs } from 'pinia'
-import { useSlidesStore } from '@/store'
-import useExport from '@/hooks/useExport'
+import useExport from "@/hooks/useExport"
 
-import FullscreenSpin from '@/components/FullscreenSpin.vue'
-import Switch from '@/components/Switch.vue'
-import Slider from '@/components/Slider.vue'
-import Button from '@/components/Button.vue'
-import RadioButton from '@/components/RadioButton.vue'
-import RadioGroup from '@/components/RadioGroup.vue'
+import FullscreenSpin from "@/components/FullscreenSpin.vue"
+import Button from "@/components/Button.vue"
 
 const emit = defineEmits<{
-  (event: 'close'): void
+  (event: "close"): void
 }>()
 
-const { slides, currentSlide } = storeToRefs(useSlidesStore())
-
 const { exportPPTX, exporting } = useExport()
-
-const rangeType = ref<'all' | 'current' | 'custom'>('all')
-const range = ref<[number, number]>([1, slides.value.length])
-const masterOverwrite = ref(true)
-const ignoreMedia = ref(true)
-
-const selectedSlides = computed(() => {
-  if (rangeType.value === 'all') return slides.value
-  if (rangeType.value === 'current') return [currentSlide.value]
-  return slides.value.filter((item, index) => {
-    const [min, max] = range.value
-    return index >= min - 1 && index <= max - 1
-  })
-})
 </script>
 
 <style lang="scss" scoped>
@@ -95,42 +32,6 @@ const selectedSlides = computed(() => {
   position: relative;
   overflow: hidden;
 }
-.configs {
-  width: 350px;
-  height: calc(100% - 100px);
-  display: flex;
-  flex-direction: column;
-  justify-content: center;
-
-  .row {
-    display: flex;
-    justify-content: center;
-    align-items: center;
-    margin-bottom: 25px;
-  }
-
-  .title {
-    width: 100px;
-    position: relative;
-
-    &::after {
-      content: attr(data-range);
-      position: absolute;
-      top: 20px;
-      left: 0;
-    }
-  }
-  .config-item {
-    flex: 1;
-  }
-
-  .tip {
-    font-size: 12px;
-    color: #aaa;
-    line-height: 1.8;
-    margin-top: 10px;
-  }
-}
 .btns {
   width: 300px;
   height: 100px;
@@ -146,4 +47,4 @@ const selectedSlides = computed(() => {
     margin-left: 10px;
   }
 }
-</style>
+</style>