核心功能
Univer Sheets 的核心由电子表格编辑器及其所需的组件组成,包括公式引擎、渲染引擎、数字格式化引擎、设计系统和 UI 组件库。这些部分共同支持多种电子表格格式,并处理实际工作簿中出现的复杂操作。
特性
这些核心功能包括:
- 电子表格渲染:绘制表格内容、光标和选区。
- 单元格样式:设置单元格的字体、颜色、边框和对齐方式。
- 公式计算:添加并计算公式,几乎覆盖所有 Excel 函数,包括数学、统计、文本和日期函数。
- 数字格式化:把数字格式化成货币、百分比、日期等样式。
- 网格线和冻结窗格:显示网格线和冻结窗格,便于查看和编辑大数据量的表格。
- 默认样式:设置电子表格的默认字体、字号、颜色等样式。
- 插件系统:支持添加自定义插件,例如公式插件、图片插件和图表插件。插件系统也是 Univer 的核心架构能力之一。
插件模式
安装
pnpm add @univerjs/core @univerjs/design @univerjs/engine-render @univerjs/engine-formula @univerjs/ui @univerjs/docs @univerjs/docs-ui @univerjs/sheets @univerjs/sheets-ui @univerjs/sheets-formula @univerjs/sheets-formula-ui @univerjs/sheets-numfmt @univerjs/sheets-numfmt-uinpm install @univerjs/core @univerjs/design @univerjs/engine-render @univerjs/engine-formula @univerjs/ui @univerjs/docs @univerjs/docs-ui @univerjs/sheets @univerjs/sheets-ui @univerjs/sheets-formula @univerjs/sheets-formula-ui @univerjs/sheets-numfmt @univerjs/sheets-numfmt-uiyarn add @univerjs/core @univerjs/design @univerjs/engine-render @univerjs/engine-formula @univerjs/ui @univerjs/docs @univerjs/docs-ui @univerjs/sheets @univerjs/sheets-ui @univerjs/sheets-formula @univerjs/sheets-formula-ui @univerjs/sheets-numfmt @univerjs/sheets-numfmt-uibun add @univerjs/core @univerjs/design @univerjs/engine-render @univerjs/engine-formula @univerjs/ui @univerjs/docs @univerjs/docs-ui @univerjs/sheets @univerjs/sheets-ui @univerjs/sheets-formula @univerjs/sheets-formula-ui @univerjs/sheets-numfmt @univerjs/sheets-numfmt-ui使用
import { LocaleType, mergeLocales, Univer } from '@univerjs/core'import DesignZhCN from '@univerjs/design/locale/zh-CN'import { UniverDocsPlugin } from '@univerjs/docs'import { UniverDocsUIPlugin } from '@univerjs/docs-ui'import DocsUIZhCN from '@univerjs/docs-ui/locale/zh-CN'import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula'import { UniverRenderEnginePlugin } from '@univerjs/engine-render'import { UniverSheetsPlugin } from '@univerjs/sheets'import { UniverSheetsFormulaPlugin } from '@univerjs/sheets-formula'import { UniverSheetsFormulaUIPlugin } from '@univerjs/sheets-formula-ui'import SheetsFormulaUIZhCN from '@univerjs/sheets-formula-ui/locale/zh-CN'import { UniverSheetsNumfmtPlugin } from '@univerjs/sheets-numfmt'import { UniverSheetsNumfmtUIPlugin } from '@univerjs/sheets-numfmt-ui'import SheetsNumfmtUIZhCN from '@univerjs/sheets-numfmt-ui/locale/zh-CN'import { UniverSheetsUIPlugin } from '@univerjs/sheets-ui'import SheetsUIZhCN from '@univerjs/sheets-ui/locale/zh-CN'import SheetsZhCN from '@univerjs/sheets/locale/zh-CN'import { UniverUIPlugin } from '@univerjs/ui'import UIZhCN from '@univerjs/ui/locale/zh-CN'import '@univerjs/design/lib/index.css'import '@univerjs/ui/lib/index.css'import '@univerjs/docs-ui/lib/index.css'import '@univerjs/sheets-ui/lib/index.css'import '@univerjs/sheets-formula-ui/lib/index.css'import '@univerjs/sheets-numfmt-ui/lib/index.css'import '@univerjs/engine-formula/facade'import '@univerjs/ui/facade'import '@univerjs/docs-ui/facade'import '@univerjs/sheets/facade'import '@univerjs/sheets-ui/facade'import '@univerjs/sheets-formula/facade'import '@univerjs/sheets-numfmt/facade'const univer = new Univer({ locale: LocaleType.ZH_CN, locales: { [LocaleType.ZH_CN]: mergeLocales( DesignZhCN, UIZhCN, DocsUIZhCN, SheetsZhCN, SheetsUIZhCN, SheetsFormulaUIZhCN, SheetsNumfmtUIZhCN, ), },})univer.registerPlugin(UniverRenderEnginePlugin)univer.registerPlugin(UniverFormulaEnginePlugin)univer.registerPlugin(UniverUIPlugin, { container: 'app',})univer.registerPlugin(UniverDocsPlugin)univer.registerPlugin(UniverDocsUIPlugin)univer.registerPlugin(UniverSheetsPlugin)univer.registerPlugin(UniverSheetsUIPlugin)univer.registerPlugin(UniverSheetsFormulaPlugin)univer.registerPlugin(UniverSheetsFormulaUIPlugin)univer.registerPlugin(UniverSheetsNumfmtPlugin)univer.registerPlugin(UniverSheetsNumfmtUIPlugin)插件配置
@univerjs/core
这是 Univer 的核心库,负责创建 Univer 实例,并管理主题、语言等基础功能。
themeTheme默认值:defaultTheme编辑器使用的主题。[palette]object[shade]string按颜色名和色阶组织的调色板,可参照defaultTheme。
darkModeboolean默认值:false启动时启用深色模式。localestring菜单和对话框使用的语言。regionstring默认值: 跟随locale地区格式使用的 BCP 47 标签,例如LocaleType.DE_DE。影响工具栏显示的货币符号。localesRecord<string, ILanguagePack>按语言提供翻译资源。[locale]ILanguagePack对应语言的翻译包,以该语言的值作为键。
logLevelLogLevel默认值:LogLevel.INFO运行时日志的详细程度。
参考:Univer
@univerjs/engine-render
这是 Univer 的渲染引擎,负责绘制表格内容、滚动条、光标和选区,并导出 UniverRenderEnginePlugin。
@univerjs/engine-formula
这是 Univer 的公式引擎,负责计算和处理公式,并导出 UniverFormulaEnginePlugin。
@univerjs/design
这是 Univer 的设计系统,提供全部基础组件和样式。
详见:UI 章节
@univerjs/ui
这是 Univer 的 UI 基座,导出 UniverUIPlugin。
UniverUIPlugin 接受一组用于基础布局的配置项。
containerstring | HTMLElement编辑器挂载的元素。headerboolean默认值:true显示顶部区域。toolbarboolean默认值:true显示工具栏。ribbonTypeRibbonType默认值:'classic'选择 Ribbon 布局。contextMenuboolean默认值:true启用右键菜单。disableAutoFocustrue启动时禁用自动聚焦。customFontFamilyIFontConfig[] | object在字体下拉列表中添加这些选项。listIFontConfig[]在字体下拉列表中添加这些选项。valuestringCSS 使用的字体名称。labelstring显示名称或翻译键。categoryFontCategory字体分组,可选sans-serif、serif、monospace、display或handwriting。
overrideboolean默认值:false用传入的列表替换内置字体选项。
override[DependencyIdentifier, Provider | null][]替换默认注入的依赖。[0]DependencyIdentifier要替换的依赖标识符。[1]Provider | null替代的提供者。传入null可移除该依赖。
用 menu 可以控制特定菜单项的显示或隐藏:
univer.registerPlugin(UniverUIPlugin, { menu: { 'sheet.command.set-range-bold': { hidden: true, }, 'sheet.command.set-range-italic': { hidden: true, disabled: true, }, },})这里的 'sheet.command.set-range-bold' 和 'sheet.command.set-range-italic' 都是菜单项 ID,完整列表见下方的 菜单项 ID 列表。
参考:@univerjs/ui
@univerjs/docs
这是 Univer Docs 的核心插件,导出 UniverDocsPlugin。
@univerjs/docs-ui
这是 Univer Docs 的 UI 插件,包含文档编辑器的 UI 组件和交互,并导出 UniverDocsUIPlugin。
@univerjs/sheets
这是 Univer Sheets 的核心插件,提供电子表格编辑器的核心功能,导出 UniverSheetsPlugin。
UniverSheetsPlugin 也接收几个编辑器配置项:
isRowStylePrecedeColumnStyleboolean默认值:false让行样式优先于列样式。autoHeightForMergedCellsboolean默认值:false为合并单元格自动调整行高。freezeSyncboolean默认值:true协同时同步冻结行列。textLineGapnumber默认值:0设置单元格文字的额外行距,单位为像素。
@univerjs/sheets-ui
这是 Univer Sheets 的 UI 插件,包含电子表格编辑器的 UI 组件和交互,并导出 UniverSheetsUIPlugin。
UniverSheetsUIPlugin 接收一组用于调整编辑器 UI 的配置项:
formulaBarboolean默认值:true显示公式栏。clipboardConfigobject粘贴后隐藏选项按钮。hidePasteOptionsboolean默认值:false粘贴后隐藏选项按钮。
scrollConfigobject设置滚动条样式和行为。mainSceneScene滚动条关联的场景。thumbMarginnumber默认值:2轨道和滑块之间的间距,单位为像素。thumbLengthRationumber默认值:1滑块长度的倍率。thumbBackgroundColorstring默认值:'gray.300'滑块颜色。thumbHoverBackgroundColorstring默认值:'gray.400'悬停时的滑块颜色。thumbActiveBackgroundColorstring默认值:'gray.500'拖动时的滑块颜色。trackBackgroundColorstring默认值:'gray.0'轨道的背景颜色。trackBorderColorstring默认值:'gray.0'轨道的边框颜色。barSizenumber默认值:10滚动轨道的厚度,单位为像素。barBordernumber默认值:1轨道边框的厚度,单位为像素。enableHorizontalboolean默认值:true显示横向滚动条。enableVerticalboolean默认值:true显示纵向滚动条。hideTrackWhenUnscrollableboolean默认值:false对应轴没有溢出时隐藏轨道。minThumbSizeHnumber默认值:17横向滑块的最小宽度,单位为像素。minThumbSizeVnumber默认值:17纵向滑块的最小高度,单位为像素。
protectedRangeShadowboolean | 'always' | 'non-editable' | 'non-viewable' | 'none'默认值:true选择在哪些受保护区域显示阴影。protectedRangeUserSelectorobject为保护范围配置自定义用户选择器。componentComponentType<IPermissionDetailUserPartProps>用于选择用户的组件。frameworkstring组件使用的框架,例如react。
disableForceStringAlertboolean默认值:false隐藏强制文本值的提示。disableForceStringMarkboolean默认值:false隐藏强制文本值的标记。maxAutoHeightCountnumber默认值:1000限制自动调整行高的行数。allowArrowKeyWrapOnSheetBoundaryboolean默认值:true方向键到达工作表边界后继续移到另一行或列。selectionAnimationboolean默认值:true桌面端点击另一个单元格时播放选区动画。遵循系统的动态效果设置。enableFillHandleboolean默认值:true显示桌面端填充柄。填充命令仍可用。warnBeforeDragOverwriteboolean默认值:true拖动选区覆盖已有内容前弹出确认。移动校验和撤销仍生效。
移动端适配
请先配置移动端编辑器。在本页插件模式的初始化代码中,把下面这些桌面端注册替换为同一个包导出的移动端插件,并且必须在打开文档前完成。模型插件、样式、语言包和 Facade 导入均需保留,不要同时注册两个版本。
| 来源包 | 桌面端注册 | 移动端注册 |
|---|---|---|
@univerjs/sheets-formula-ui | UniverSheetsFormulaUIPlugin | UniverSheetsFormulaMobileUIPlugin |
@univerjs/sheets-numfmt-ui | UniverSheetsNumfmtUIPlugin | UniverSheetsNumfmtMobileUIPlugin |
预设模式
安装
pnpm add @univerjs/presets @univerjs/preset-sheets-corenpm install @univerjs/presets @univerjs/preset-sheets-coreyarn add @univerjs/presets @univerjs/preset-sheets-corebun add @univerjs/presets @univerjs/preset-sheets-core使用
import { UniverSheetsCorePreset } from '@univerjs/preset-sheets-core'import UniverPresetSheetsCoreZhCN from '@univerjs/preset-sheets-core/locales/zh-CN'import { createUniver, LocaleType, mergeLocales } from '@univerjs/presets'import '@univerjs/preset-sheets-core/lib/index.css'const { univerAPI } = createUniver({ locale: LocaleType.ZH_CN, locales: { [LocaleType.ZH_CN]: mergeLocales(UniverPresetSheetsCoreZhCN), }, presets: [UniverSheetsCorePreset()],})univerAPI.createWorkbook({})预设配置
@univerjs/presets
本预设提供 createUniver,用于创建 Univer 应用,并重新导出 @univerjs/core 和 @univerjs/design 的全部方法和对象。
createUniver 接收一个配置对象,其中包含主题、语言、预设等选项。它返回 Univer 实例 univer 和 FUniver 实例 univerAPI,通过后者调用 Facade API。
themeTheme默认值:defaultTheme编辑器使用的主题。[palette]object[shade]string按颜色名和色阶组织的调色板,可参照defaultTheme。
darkModeboolean默认值:false启动时启用深色模式。localestring菜单和对话框使用的语言。regionstring默认值: 跟随locale地区格式使用的 BCP 47 标签,例如LocaleType.DE_DE。影响工具栏显示的货币符号。localesRecord<string, ILanguagePack>按语言提供翻译资源。[locale]ILanguagePack对应语言的翻译包,以该语言的值作为键。
logLevelLogLevel默认值:LogLevel.WARN运行时日志的详细程度。presets(IPreset | [IPreset, IPresetOptions])[]要注册的预设。[0]IPreset预设工厂返回的预设。[1]IPresetOptions延迟注册该预设的插件。lazyboolean延迟注册该预设的插件。
lazyboolean延迟注册该预设的插件。
plugins(PluginCtor | [PluginCtor, object])[]注册附加插件及其配置。[0]PluginCtor插件的构造函数。[1]object该插件构造函数接受的配置。
参考:createUniver
@univerjs/preset-sheets-core
这是 Univer Sheets 的核心预设,把电子表格所需的文档编辑器、公式引擎、渲染引擎等部分打包在一起。
containerstring | HTMLElement默认值:'app'编辑器挂载的元素。headerboolean默认值:true显示顶部区域。toolbarboolean默认值:true显示工具栏。ribbonTypeRibbonType默认值:'classic'选择 Ribbon 布局。contextMenuboolean默认值:true启用右键菜单。disableAutoFocustrue启动时禁用自动聚焦。customFontFamilyIFontConfig[] | object在字体下拉列表中添加这些选项。listIFontConfig[]在字体下拉列表中添加这些选项。valuestringCSS 使用的字体名称。labelstring显示名称或翻译键。categoryFontCategory字体分组,可选sans-serif、serif、monospace、display或handwriting。
overrideboolean默认值:false用传入的列表替换内置字体选项。
formulaBarboolean默认值:true显示公式栏。disableTextFormatAlertboolean默认值:false隐藏单元格文本格式警告。disableTextFormatMarkboolean默认值:false隐藏单元格文本格式标记。sheetsobject该功能的配置项。isRowStylePrecedeColumnStyleboolean默认值:false让行样式优先于列样式。autoHeightForMergedCellsboolean默认值:false为合并单元格自动调整行高。freezeSyncboolean默认值:true协同时同步冻结行列。textLineGapnumber默认值:0设置单元格文字的额外行距,单位为像素。clipboardConfigobject粘贴后隐藏选项按钮。hidePasteOptionsboolean默认值:false粘贴后隐藏选项按钮。
scrollConfigobject设置滚动条样式和行为。mainSceneScene滚动条关联的场景。thumbMarginnumber默认值:2轨道和滑块之间的间距,单位为像素。thumbLengthRationumber默认值:1滑块长度的倍率。thumbBackgroundColorstring默认值:'gray.300'滑块颜色。thumbHoverBackgroundColorstring默认值:'gray.400'悬停时的滑块颜色。thumbActiveBackgroundColorstring默认值:'gray.500'拖动时的滑块颜色。trackBackgroundColorstring默认值:'gray.0'轨道的背景颜色。trackBorderColorstring默认值:'gray.0'轨道的边框颜色。barSizenumber默认值:10滚动轨道的厚度,单位为像素。barBordernumber默认值:1轨道边框的厚度,单位为像素。enableHorizontalboolean默认值:true显示横向滚动条。enableVerticalboolean默认值:true显示纵向滚动条。hideTrackWhenUnscrollableboolean默认值:false对应轴没有溢出时隐藏轨道。minThumbSizeHnumber默认值:17横向滑块的最小宽度,单位为像素。minThumbSizeVnumber默认值:17纵向滑块的最小高度,单位为像素。
protectedRangeShadowboolean | 'always' | 'non-editable' | 'non-viewable' | 'none'默认值:true选择在哪些受保护区域显示阴影。protectedRangeUserSelectorobject为保护范围配置自定义用户选择器。componentComponentType<IPermissionDetailUserPartProps>用于选择用户的组件。frameworkstring组件使用的框架,例如react。
disableForceStringAlertboolean默认值:false隐藏强制文本值的提示。disableForceStringMarkboolean默认值:false隐藏强制文本值的标记。maxAutoHeightCountnumber默认值:1000限制自动调整行高的行数。allowArrowKeyWrapOnSheetBoundaryboolean默认值:true方向键到达工作表边界后继续移到另一行或列。selectionAnimationboolean默认值:true桌面端点击另一个单元格时播放选区动画。遵循系统的动态效果设置。enableFillHandleboolean默认值:true显示桌面端填充柄。填充命令仍可用。warnBeforeDragOverwriteboolean默认值:true拖动选区覆盖已有内容前弹出确认。移动校验和撤销仍生效。
docsobject该功能的配置项。hasScrollboolean显示 Docs 滚动条。
formulaobject配置公式函数、说明、计算模式和函数提示。function[Ctor<BaseFunction>, string][]自定义公式的实现类。[0]Ctor<BaseFunction>公式类。[1]string公式中使用的函数名。
descriptionobject[]在编辑器中显示的函数说明。functionNamestring函数名称。aliasFunctionNamestring函数别名。functionTypeFunctionType函数分类。descriptionstring详细说明。abstractstring简短摘要。functionParameterobject[]参数说明列表。namestring参数名称。detailstring参数详情。examplestring使用示例。require0 | 1是否必填,1表示必填,0表示可选。repeat0 | 1是否可重复,1表示可重复,0表示只出现一次。
initialFormulaComputingCalculationMode默认值:CalculationMode.WHEN_EMPTY工作簿打开时的公式计算方式。functionScreenTipsboolean默认值:true编辑公式时显示函数提示。
workerURLstring | URL | Worker在浏览器 Worker 中计算公式。
用 menu 可以控制特定菜单项的显示或隐藏:
UniverSheetsCorePreset({ menu: { 'sheet.command.set-range-bold': { hidden: true, }, 'sheet.command.set-range-italic': { hidden: true, disabled: true, }, },})这里的 'sheet.command.set-range-bold' 和 'sheet.command.set-range-italic' 都是菜单项 ID,完整列表见下方的 菜单项 ID 列表。
参考:@univerjs/preset-sheets-core
工具栏布局与 RibbonType
在 IUniverSheetsCorePresetConfig 或 IUniverUIConfig 中设置 ribbonType,即可选择工具栏布局。
共有四种模式:
classic:默认模式。分组位于上方,工具栏在其下方平铺,与使用者习惯的传统布局一致。grid:保留顶部标签页,每个分组的工具在下方按两行网格排列,适合需要在桌面端同时显示更多工具的场景。collapsed:分组和工具栏位于同一行,适合垂直空间有限的场景。simple:取消分组,所有工具排成一个平铺列表,适合已熟悉各按钮用途的用户。
grid Ribbon 宽度不足时,整组会移入“更多”菜单,并在其中改用紧凑布局;容器变宽后它们会恢复显示。这一切换随可用宽度自动发生,主工具栏仍使用已有的 gridLayout 配置。溢出菜单中的命令、禁用状态和权限检查与主工具栏保持一致。
菜单顺序与网格布局
menu 的键可以是 Ribbon 页签(如 ribbon.insert)、分组(如 ribbon.start.format)或菜单项 ID。
order 按数值从小到大排序同级节点:Ribbon 中的页签、页签中的分组、分组或子菜单中的菜单项。它不会把菜单项移到其他分组。键也可以不使用字符串,而使用 @univerjs/ui 导出的 RibbonPosition 和各分组枚举。
按所用的接入模式,把这些选项合并到现有的初始化配置中。其他插件、语言、主题和容器设置均需保留,同一个插件不要注册两次。
import type { MenuConfig } from '@univerjs/ui'const menu: MenuConfig = { 'ribbon.insert': { order: -1 }, 'ribbon.start.format': { order: -1 }, 'sheet.command.set-range-font-family': { order: 0, gridLayout: { row: 1, column: 1, width: 160 }, },}import { UniverUIPlugin } from '@univerjs/ui'univer.registerPlugin(UniverUIPlugin, { ribbonType: 'grid', menu,})import { UniverSheetsCorePreset } from '@univerjs/preset-sheets-core'import { createUniver } from '@univerjs/presets'const { univerAPI } = createUniver({ presets: [ UniverSheetsCorePreset({ ribbonType: 'grid', menu, }), ],})选区与拖动
工作表边界处的键盘导航
allowArrowKeyWrapOnSheetBoundary 决定方向键到达工作表边界后是否绕到下一行或下一列。默认值为 true,设为 false 时停在边界。选区内使用 Enter/Tab 循环切换不受影响。预设模式下放在 sheets 中,插件模式下直接传给 UniverSheetsUIPlugin。
selectionAnimation: false 关闭在单元格之间切换选区时的选区轮廓动画,系统的减少动态效果设置优先。enableFillHandle: false 隐藏填充柄,填充命令和 Facade API 仍然可用。warnBeforeDragOverwrite: false 跳过拖动覆盖已有内容前的确认提示,移动校验和撤销重做仍然生效。三个选项默认都是 true,可以放在 UniverSheetsCorePreset 的 sheets 中,也可以直接传给 UniverSheetsUIPlugin。
univer.registerPlugin(UniverSheetsUIPlugin, { allowArrowKeyWrapOnSheetBoundary: false, selectionAnimation: false, enableFillHandle: false, warnBeforeDragOverwrite: false,})createUniver({ presets: [ UniverSheetsCorePreset({ sheets: { allowArrowKeyWrapOnSheetBoundary: false, selectionAnimation: false, enableFillHandle: false, warnBeforeDragOverwrite: false, }, }), ],})用 Facade API 更新菜单
运行时更新
公开 Facade 会合并所做的修改并立即刷新 UI。未指定的属性沿用之前的值或 Schema 默认值,这些覆盖对之后注册的菜单同样生效。插件模式下需要先导入 @univerjs/ui/facade。
import '@univerjs/ui/facade'univerAPI.updateMenuConfig({ 'sheet.command.set-range-bold': { order: 0, gridLayout: { row: 2, column: 2 }, }, 'sheet.command.set-range-italic': { gridLayout: { row: 2, column: 1 }, },})gridLayout 仅在 ribbonType: 'grid' 时生效。每个分组固定两行,row 和 column 都从 1 开始。坐标是显式的,因此只修改 order 不会移动显式摆放的按钮。交换两个按钮的位置时,两个按钮都要修改,否则会重叠。可选字段包括 rowSpan、columnSpan、showLabel、width 和 iconSize,尺寸单位为像素。约束和默认值见 IRibbonGridLayout。
自定义菜单的位置
createMenu() 和 createSubmenu() 同样接受 order 和 gridLayout。子菜单中的这两个字段控制 Ribbon 上的触发按钮,而非弹层的内容。以下示例在历史操作分组的第三列添加一个按钮:
univerAPI .createMenu({ id: 'custom-action', title: 'Custom action', action: () => console.log('Custom action clicked'), order: 4, gridLayout: { row: 1, column: 3, showLabel: true, width: 96 }, }) .appendTo('ribbon.start.history')菜单项 ID 列表
以下各表按桌面端菜单的出现位置整理。同一个菜单项可能出现在多个位置,行标题和列标题菜单也复用了一部分单元格右键菜单。功能菜单需要先注册对应插件,是否显示还取决于权限和当前选中的内容。仅在移动端出现的 ID 单独列在最后。
data-u-command 属性即为该菜单项的 ID。配置 menu 时使用的就是这个菜单项 ID,它可能与菜单项执行的命令 ID 不同。工具栏菜单项
| 菜单项 ID | 菜单项名称 |
|---|---|
| univer.command.undo | 撤销 |
| univer.command.redo | 重做 |
| ui.operation.activate-format-painter | 格式刷 |
| sheet.command.set-range-bold | 加粗 |
| sheet.command.set-range-italic | 斜体 |
| sheet.command.set-range-underline | 下划线 |
| sheet.command.set-range-stroke | 删除线 |
| sheet.command.set-range-font-family | 字体 |
| sheet.command.set-range-fontsize | 字号 |
| sheet.command.set-range-text-color | 文本颜色 |
| sheet.command.set-background-color | 单元格颜色 |
| sheet.command.set-border-basic | 边框 |
| sheet.command.set-horizontal-text-align | 水平对齐 |
| sheet.command.set-vertical-text-align | 垂直对齐 |
| sheet.command.set-text-wrap | 文本换行 |
| sheet.command.set-text-rotation | 文本旋转 |
| sheet.command.add-worksheet-merge | 合并单元格 |
| sheet.command.add-worksheet-merge-all | 合并单元格 - 全部合并 |
| sheet.command.add-worksheet-merge-vertical | 合并单元格 - 垂直合并 |
| sheet.command.add-worksheet-merge-horizontal | 合并单元格 - 水平合并 |
| sheet.command.remove-worksheet-merge | 合并单元格 - 取消合并 |
| sheet.operation.open.conditional.formatting.panel | 条件格式 |
| formula-ui.operation.insert-function.common | 常用函数 |
| formula-ui.operation.more-functions | 函数 - 更多函数 |
| sheet.menu.sheets-sort | 排序 |
| sheet.command.sort-range-asc | 排序 - 当前区域升序 |
| sheet.command.sort-range-asc-ext | 排序 - 拓展区域升序 |
| sheet.command.sort-range-desc | 排序 - 当前区域降序 |
| sheet.command.sort-range-desc-ext | 排序 - 拓展区域降序 |
| sheet.command.sort-range-custom | 排序 - 自定义排序 |
| sheet.menu.image | 图片 |
| sheet.command.insert-float-image | 图片 - 浮动图片 |
| sheet.command.insert-cell-image | 图片 - 单元格图片 |
| sheet.command.numfmt.set.currency | 货币 |
| sheet.command.numfmt.add.decimal.command | 增加小数位 |
| sheet.command.numfmt.subtract.decimal.command | 减少小数位 |
| sheet.command.numfmt.set.percent | 百分比 |
| sheet.operation.open.numfmt.panel | 数字格式 |
| sheet.menu.data-validation | 数据验证 |
| data-validation.operation.open-validation-panel | 数据验证 - 管理数据验证 |
| data-validation.command.addRuleAndOpen | 数据验证 - 新建规则 |
| sheet.command.smart-toggle-filter | 筛选 |
| sheet.command.clear-filter-criteria | 筛选 - 清除筛选条件 |
| sheet.command.re-calc-filter | 筛选 - 重新计算 |
| sheet.operation.open-pivot-table-range-selector-panel | 数据透视表 |
| sheet.menu.print | 打印 |
| sheet.operation.print-open | 打印 - 打印 |
| sheet.operation.open-print-grid-sidebar | 打印 - 打印布局 |
| sheet.command.menu-insert-chart | 插入图表 |
| sheet.command.add-range-protection-from-toolbar | 保护 |
| univer.operation.toggle-edit-history | 历史记录 |
| sheet.operation.open-sparkline-selector | 迷你图 |
| sheet.operation.toggle-comment-panel | 评论管理 |
| sheet.operation.insert-hyper-link-toolbar | 插入链接 |
| ui.operation.open-find-dialog | 查找替换 |
| base-ui.operation.toggle-shortcut-panel | 打开收起快捷键面板 |
| sheet.command.add-data-bar-conditional-rule | 数据条 |
| sheet.command.add-icon-set-conditional-rule | 图标集 |
| sheet.operation.toggle-crosshair-highlight | 十字高亮 |
| data-validation.command.insert-quick-rule | 复选框 |
| sheet.menu.quick-dropdown | 下拉菜单 |
| sheet.menu.quick-date | 日期 |
| sheet.menu.worksheet-background-image | 背景图片 |
| sheet.command.add-worksheet-background-image | 添加背景图片 |
| sheet.command.delete-worksheet-background-image | 删除背景图片 |
| formula-ui.operation.insert-function.financial | 财务 |
| formula-ui.operation.insert-function.logical | 逻辑 |
| formula-ui.operation.insert-function.text | 文本 |
| formula-ui.operation.insert-function.date | 日期与时间 |
| formula-ui.operation.insert-function.lookup | 查找与引用 |
| formula-ui.operation.insert-function.math | 数学与三角函数 |
| formula-ui.operation.insert-function.statistical | 统计 |
| formula-ui.operation.insert-function.engineering | 工程 |
| formula-ui.operation.insert-function.information | 信息 |
| formula-ui.operation.insert-function.database | 数据库 |
| sheets-formula-ui.operation.calculation-options | 计算选项 |
| sheet.operation.open-table-selector | 表格 |
| sheet.menu.paste | 粘贴 |
| sheet.command.set-range-font-increase | 增大字号 |
| sheet.command.set-range-font-decrease | 减小字号 |
| sheet.command.reset-range-text-color | 文本颜色 - 重置颜色 |
| sheet.command.reset-background-color | 单元格颜色 - 重置颜色 |
| sheet.command.set-shrink-to-fit | 缩小字体填充 |
| sheet.toolbar.sheet-frozen | 冻结 |
| sheet.menu.zoom-ratio | 缩放 |
| sheet.command.toggle-gridlines | 切换网格线 |
| base-ui.operation.toggle-fullscreen | 全屏 |
| ui.command.clear-formatting | 清除格式 |
| ui.operation.open-feature-search | 搜索功能 |
| sheet.toolbar.dimension-outline.group | 分组 |
| sheet.command.menu-insert-pivot-chart | 数据透视图 |
| sheet.pivot-chart.insert | 数据透视图 |
| sheet.command.menu-insert-shape | 插入形状 |
| sheet.operation.open-shape-object-list-panel | 图层 |
| sheet.operation.open-slicer-insert-dialog | 插入切片器 |
| sheet.menu.insert-timeline | 插入日程表 |
右键菜单项
| 菜单项 ID | 菜单项名称 |
|---|---|
| sheet.command.copy | 复制 |
| sheet.command.cut | 剪切 |
| sheet.command.paste | 粘贴 |
| sheet.menu.copy-special | 选择性复制 |
| sheet.command.copy-formula-only | 选择性复制 - 仅复制公式 |
| sheet.menu.paste-special | 选择性粘贴 |
| sheet.command.paste-value | 选择性粘贴 - 仅粘贴值 |
| sheet.command.paste-format | 选择性粘贴 - 仅粘贴格式 |
| sheet.command.paste-col-width | 选择性粘贴 - 仅粘贴列宽 |
| sheet.command.paste-besides-border | 选择性粘贴 - 仅粘贴边框以外内容 |
| sheet.command.paste-formula | 选择性粘贴 - 仅粘贴公式 |
| sheet.menu.clear-selection | 清除 |
| sheet.command.clear-selection-content | 清除 - 清除内容 |
| sheet.command.clear-selection-format | 清除 - 清除格式 |
| sheet.command.clear-selection-all | 清除 - 清除全部 |
| sheet.contextMenu.text-to-number | 文本转数字 |
| sheet.menu.cell-insert | 插入 |
| sheet.command.insert-row-before | 插入 - 在上方插入行 |
| sheet.command.insert-col-before | 插入 - 在左侧插入列 |
| sheet.command.insert-range-move-right-confirm | 插入 - 右移 |
| sheet.command.insert-range-move-down-confirm | 插入 - 下移 |
| sheet.menu.delete | 删除 |
| sheet.command.remove-row-confirm | 删除选中行 |
| sheet.command.remove-col-confirm | 删除选中列 |
| sheet.command.delete-range-move-left-confirm | 删除 - 左移 |
| sheet.command.delete-range-move-up-confirm | 删除 - 上移 |
| sheet.menu.sheet-frozen | 冻结 |
| sheet.command.set-selection-frozen | 冻结 - 冻结 |
| sheet.command.set-row-frozen | 冻结 - 冻结行 |
| sheet.command.set-col-frozen | 冻结 - 冻结列 |
| sheet.command.cancel-frozen | 冻结 - 取消冻结 |
| sheet.contextMenu.permission | 保护行列 |
| sheet.command.add-range-protection-from-context-menu | 保护行列 - 新增保护范围 |
| sheet.command.set-range-protection-from-context-menu | 保护行列 - 设置保护范围 |
| sheet.command.delete-range-protection-from-context-menu | 保护行列 - 移除保护范围 |
| sheet.command.view-sheet-permission-from-context-menu | 保护行列 - 查看所有保护范围 |
| sheet.menu.sheets-sort-ctx | 排序 |
| sheet.command.sort-range-asc-ctx | 排序 - 当前区域升序 |
| sheet.command.sort-range-asc-ext-ctx | 排序 - 拓展区域升序 |
| sheet.command.sort-range-desc-ctx | 排序 - 当前区域降序 |
| sheet.command.sort-range-desc-ext-ctx | 排序 - 拓展区域降序 |
| sheet.command.sort-range-custom-ctx | 排序 - 自定义排序 |
| sheet.operation.show-comment-modal | 添加评论 |
| sheet.operation.insert-hyper-link | 添加链接 |
| sheet.operation.screenshot | 复制为截图 |
| sheet.command.save-cell-images | 保存单元格图片 |
| sheet.operation.add-note-popup | 添加批注 |
| sheet.command.delete-note | 删除批注 |
| sheet.command.toggle-note-popup | 显示/隐藏批注 |
| sheet.table.context-insert_menu-id | 表格插入 |
| sheet.command.table-insert-row | 插入表格行 |
| sheet.command.table-insert-col | 插入表格列 |
| sheet.table.context-remove_menu-id | 表格删除 |
| sheet.command.table-remove-row | 删除表格行 |
| sheet.command.table-remove-col | 删除表格列 |
| sheet.command.set-first-row-frozen | 冻结首行 |
| sheet.command.set-first-column-frozen | 冻结首列 |
| sheet.sparkline.context-menu-id | 迷你图 |
| sheet.operation.open-sparkline-panel | 编辑迷你图 |
| sheet.command.remove-sparkline | 删除迷你图 |
右键菜单项 - 行标题
| 菜单项 ID | 菜单项名称 |
|---|---|
| sheet.command.insert-multi-rows-above | 在上方插入行 |
| sheet.command.insert-multi-rows-after | 在下方插入行 |
| sheet.command.hide-row-confirm | 隐藏选中行 |
| sheet.command.set-selected-rows-visible | 显示隐藏行 |
| sheet.command.set-row-height | 行高 |
| sheet.command.set-row-is-auto-height | 适合数据 |
| sheet.row-header-menu.sheet-frozen | 冻结 |
| sheet.contextMenu.dimension-outline | 分组 |
右键菜单项 - 列标题
| 菜单项 ID | 菜单项名称 |
|---|---|
| sheet.command.insert-multi-cols-before | 在左侧插入列 |
| sheet.command.insert-multi-cols-right | 在右侧插入列 |
| sheet.command.hide-col-confirm | 隐藏选中列 |
| sheet.command.set-selected-cols-visible | 显示隐藏列 |
| sheet.command.set-worksheet-col-width | 列宽 |
| sheet.command.set-col-auto-width | 适合数据 |
| sheet.column-header-menu.sheet-frozen | 冻结 |
| sheet.contextMenu.dimension-outline | 分组 |
右键菜单项 - 工作表标签
| 菜单项 ID | 菜单项名称 |
|---|---|
| sheet.command.remove-sheet-confirm | 删除 |
| sheet.command.copy-sheet | 复制 |
| sheet.operation.rename-sheet | 重命名 |
| sheet.command.set-tab-color | 更改颜色 |
| sheet.command.set-worksheet-hidden | 隐藏 |
| ui-sheet.command.show-menu-list | 取消隐藏 |
| sheet.command.add-range-protection-from-sheet-bar | 保护工作表 |
| sheet.command.delete-worksheet-protection-from-sheet-bar | 取消保护工作表 |
| sheet.command.change-sheet-protection-from-sheet-bar | 更改工作表权限 |
| sheet.command.view-sheet-permission-from-sheet-bar | 查看所有保护范围 |
数据透视表与透视图右键菜单项
| 菜单项 ID | 菜单项名称 |
|---|---|
| sheet.pivot-chart.expand-collapse | 展开/折叠 |
| sheet.pivot.context-menu.date-group | 日期分组 |
| sheet.pivot.context-menu.excel-date-group | 日期分组 |
| sheet.pivot.context-menu.number-group | 数值分组 |
| sheet.pivot.context-menu.manual-group | 组合项目 |
| sheet.pivot.context-menu.manual-rename | 重命名组 |
| sheet.pivot.context-menu.manual-ungroup | 取消组合 |
| sheet.pivot.context-menu.show-data-as | 值显示方式 |
| sheet.pivot.context-menu.value-filter | 值筛选 |
| sheet.pivot.context-menu.date-group.year | 日期分组 - 年 |
| sheet.pivot.context-menu.date-group.year-quarter | 日期分组 - 年-季度 |
| sheet.pivot.context-menu.date-group.quarter | 日期分组 - 季度 |
| sheet.pivot.context-menu.date-group.year-month | 日期分组 - 年-月 |
| sheet.pivot.context-menu.date-group.month | 日期分组 - 月 |
| sheet.pivot.context-menu.date-group.month-date | 日期分组 - 月-日 |
| sheet.pivot.context-menu.date-group.year-month-date | 日期分组 - 年-月-日 |
| sheet.pivot.context-menu.date-group.date | 日期分组 - 日 |
| sheet.pivot.context-menu.date-group.hour | 日期分组 - 小时 |
| sheet.pivot.context-menu.date-group.minute | 日期分组 - 分钟 |
| sheet.pivot.context-menu.date-group.hour-minute | 日期分组 - 小时-分钟 |
| sheet.pivot.context-menu.show-data-as.1 | 值显示方式 - 无计算 |
| sheet.pivot.context-menu.show-data-as.4 | 值显示方式 - 总计的百分比 |
| sheet.pivot.context-menu.show-data-as.3 | 值显示方式 - 行汇总的百分比 |
| sheet.pivot.context-menu.show-data-as.2 | 值显示方式 - 列汇总的百分比 |
| sheet.pivot.context-menu.show-data-as.6 | 值显示方式 - 父行汇总的百分比 |
| sheet.pivot.context-menu.show-data-as.5 | 值显示方式 - 父列汇总的百分比 |
| sheet.pivot.context-menu.show-data-as.8 | 值显示方式 - 指数 |
| sheet.pivot.context-menu.show-data-as.14 | 值显示方式 - 父级汇总的百分比 |
| sheet.pivot.context-menu.show-data-as.13 | 值显示方式 - 百分比 |
| sheet.pivot.context-menu.show-data-as.9 | 值显示方式 - 差异值 |
| sheet.pivot.context-menu.show-data-as.10 | 值显示方式 - 差异百分比 |
| sheet.pivot.context-menu.show-data-as.11 | 值显示方式 - 按某一字段汇总 |
| sheet.pivot.context-menu.show-data-as.12 | 值显示方式 - 按某一字段汇总的百分比 |
| sheet.pivot.context-menu.show-data-as.15 | 值显示方式 - 升序排列 |
| sheet.pivot.context-menu.show-data-as.16 | 值显示方式 - 降序排列 |
绘图与图表菜单项
| 菜单项 ID | 菜单项名称 |
|---|---|
| contextMenu.drawing-group | 组合 |
| drawing.operation.set-drawing-group | 组合 |
| drawing.operation.cancel-drawing-group | 取消组合 |
| contextMenu.drawing-arrange | 排列 |
| drawing.operation.set-drawing-arrange-front | 置于顶层 |
| drawing.operation.set-drawing-arrange-forward | 上移一层 |
| drawing.operation.set-drawing-arrange-back | 置于底层 |
| drawing.operation.set-drawing-arrange-backward | 下移一层 |
| contextMenu.drawing-align | 对齐方式 |
| sheet.operation.set-drawing-align-left | 左对齐 |
| sheet.operation.set-drawing-align-center | 水平居中 |
| sheet.operation.set-drawing-align-right | 右对齐 |
| sheet.operation.set-drawing-align-top | 顶部对齐 |
| sheet.operation.set-drawing-align-middle | 垂直居中 |
| sheet.operation.set-drawing-align-bottom | 底部对齐 |
| sheet.operation.set-drawing-align-horizon | 水平分布 |
| sheet.operation.set-drawing-align-vertical | 垂直分布 |
| sheet.operation.add-drawing-comment | 添加评论 |
| sheet.command.chart.open-focused-panel | 编辑图表 |
| sheet.command.chart.copy-focused-chart | 复制 |
| sheet.command.chart.export-focused-image | 导出图片 |
| sheet.command.chart.delete-focused-chart | 删除图表 |
上下文工具栏菜单项
选中对应的形状、切片器或时间线时,这些控件才会显示。
| 菜单项 ID | 菜单项名称 |
|---|---|
| sheet.operation.apply-shape-quick-style | 快捷样式 |
| sheet.operation.update-shape-type | 更改形状 |
| sheets-shape-ui.ribbon.shape-format.style-control | 形状样式控件 |
| sheets-shape-ui.ribbon.shape-format.text-control | 形状文本控件 |
| sheet.menu.shape.flip-horizontal | 水平翻转 |
| sheet.menu.shape.flip-vertical | 垂直翻转 |
| sheets-shape-ui.ribbon.shape-format.arrange-forward | 上移一层 |
| sheets-shape-ui.ribbon.shape-format.arrange-backward | 下移一层 |
| sheets-shape-ui.ribbon.shape-format.arrange-front | 置于顶层 |
| sheets-shape-ui.ribbon.shape-format.arrange-back | 置于底层 |
| sheets-shape-ui.ribbon.shape-format.formula-control | 公式形状控件 |
| sheet.operation.open-sheet-shape-format-panel | 格式化形状 |
| shape-editor-ui.operation.toggle-floating-toolbar | 浮动工具栏 |
| sheet.menu.slicer-quick-style | 快速样式 |
| sheet.menu.slicer-settings | 切片器设置 |
| sheet.menu.timeline-settings | 日程表设置 |
| sheet.menu.slicer-connections | 报表连接 |
移动端专用菜单项
| 菜单项 ID | 菜单项名称 |
|---|---|
| sheet.menu.mobile.crosshair-highlight | 十字高亮 |
| sheet.menu.mobile.numfmt | 数字格式 |
| sheet.command.set-once-format-painter | 格式刷 |
你觉得这篇文档如何?