Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
flush
jerry0a4fa29bfc40
diff --git a/packages/base-sheets/src/Controller/CountBarController.ts b/packages/base-sheets/src/Controller/CountBarController.tsindex 494e21d92a..d8f5906835 100644--- a/packages/base-sheets/src/Controller/CountBarController.ts+++ b/packages/base-sheets/src/Controller/CountBarController.ts@@ -22,6 +22,7 @@ export class CountBarController {case 'changeZoom': {const workbook = this._plugin.getContext().getWorkBook();if (workbook) {+ console.log(value);workbook.getActiveSheet().setZoomRatio(value!);}break;diff --git a/packages/base-sheets/src/SheetPlugin.ts b/packages/base-sheets/src/SheetPlugin.tsindex ea1f127499..8a00af9286 100644--- a/packages/base-sheets/src/SheetPlugin.ts+++ b/packages/base-sheets/src/SheetPlugin.ts@@ -5,7 +5,7 @@ import { SheetPluginObserve, uninstall } from './Basics/Observer';import { en, zh } from './Locale';import { CANVAS_VIEW_KEY } from './View/Render/BaseView';import { CanvasView } from './View/Render/CanvasView';-import { RightMenuController, InfoBarController, SheetBarControl, CellEditorController, SheetContainerController, ToolbarController } from './Controller';+import { RightMenuController, InfoBarController, SheetBarControl, CellEditorController, SheetContainerController, ToolbarController, CountBarController } from './Controller';import { install, ISheetPluginConfig } from './Basics';import { FormulaBarController } from './Controller/FormulaBarController';import { NamedRangeActionExtensionFactory } from './Basics/Register/NamedRangeActionExtension';@@ -33,6 +33,8 @@ export class SheetPlugin extends Plugin<SheetPluginObserve, SheetContext> {private _cellEditorController: CellEditorController;+ private _countBarController: CountBarController;+private _sheetContainerController: SheetContainerController;private _namedRangeActionExtensionFactory: NamedRangeActionExtensionFactory;@@ -76,6 +78,7 @@ export class SheetPlugin extends Plugin<SheetPluginObserve, SheetContext> {this._sheetBarControl = new SheetBarControl(this);this._toolbarControl = new ToolbarController(this);this._rightMenuControl = new RightMenuController(this);+ this._countBarController = new CountBarController(this);}initCanvasView() {@@ -108,6 +111,8 @@ export class SheetPlugin extends Plugin<SheetPluginObserve, SheetContext> {listenEventManager() {// TODO: move to toolbarcontroller+ this._countBarController.listenEventManager();+ this._sheetBarControl.listenEventManager();this._sheetBarControl.listenEventManager();this._toolbarControl.listenEventManager();this._rightMenuControl.listenEventManager();@@ -192,4 +197,8 @@ export class SheetPlugin extends Plugin<SheetPluginObserve, SheetContext> {getSheetContainerControl() {return this._sheetContainerController;}++ getCountBarController() {+ return this._countBarController;+ }}diff --git a/packages/ui-plugin-sheets/src/Controller/CountBarUIController.ts b/packages/ui-plugin-sheets/src/Controller/CountBarUIController.tsindex ebc88ce371..a91e03e473 100644--- a/packages/ui-plugin-sheets/src/Controller/CountBarUIController.ts+++ b/packages/ui-plugin-sheets/src/Controller/CountBarUIController.ts@@ -10,7 +10,7 @@ export class CountBarUIController {let rectList = rangeList.getRangeList();let recList: string[] = [];let plugin = this._plugin;- let workbook = plugin.getUniver().getCurrentUniverSheetInstance().getWorkBook();+ let workbook = plugin.getContext().getUniver().getCurrentUniverSheetInstance().getWorkBook();let worksheet = workbook.getActiveSheet();let cellMatrix = worksheet.getCellMatrix();let avg = 0;@@ -63,7 +63,7 @@ export class CountBarUIController {const data = event.data;const workbook = action.getWorkBook();const unitId = workbook.getUnitId();- const currentWorkbook = this._plugin.getUniver().getCurrentUniverSheetInstance().getWorkBook();+ const currentWorkbook = this._plugin.getContext().getUniver().getCurrentUniverSheetInstance().getWorkBook();const currentUnitId = currentWorkbook.getUnitId();if (unitId === currentUnitId) {switch (data.actionName) {@@ -74,7 +74,7 @@ export class CountBarUIController {}}});- const manager = plugin+ const manager = plugin.getContext().getUniver().getCurrentUniverSheetInstance().context@@ -91,7 +91,7 @@ export class CountBarUIController {// changeRatioonChange = (v: string) => {- this._setUIObserve('onUIChangeObservable', { name: 'changeZoom', value: v });+ this._setUIObserve('onUIChangeObservable', { name: 'changeZoom', value: Tools.numberFixed(parseFloat(v) / 100, 2) });}// 刷新组件