又出现问题了,按flag那种方法,跳转路由后拿不到Spread反回的不是对象是一个字符串
GC.Spread.Sheets.Designer.registerTemplate(
GC.Spread.Sheets.Designer.TemplateNames.FileMenuPanelTemplate,
fileMenuPanelTemplate
);
let fileMenuPanelCommand = GC.Spread.Sheets.Designer.getCommand(
GC.Spread.Sheets.Designer.CommandNames.FileMenuPanel
);
let that = this;
if (!fileMenuPanelCommand.flag) {
let oldFileMenuPanelCommand = fileMenuPanelCommand.execute;
fileMenuPanelCommand.execute = async function (
comtext,
propertyName,
newValue
) {
oldFileMenuPanelCommand.apply(this, arguments);
switch (propertyName) {
case "button_import_excel_1m": {
console.log("触发了几次");
console.log(that.designer.getWorkbook());
break;
}
default:
break;
}
};
this.config.commandMap = {
fileMenuPanel: fileMenuPanelCommand,
};
this.designer.setConfig(this.config);
fileMenuPanelCommand.flag = true;
}
|