- let designerConfig = JSON.parse(JSON.stringify(GC.Spread.Sheets.Designer.DefaultConfig));
- let CommandNames = GC.Spread.Sheets.Designer.getCommand();
- let MergeCenter = CommandNames.mergeCenter;
- let oldExecuteMergeCenter = MergeCenter.execute;
- MergeCenter.execute = function(context, propertyName) {
- let __this = this
- _this.$confirm(`是否确认合并?`, '提示', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- closeOnPressEscape: false,
- closeOnClickModal: false
- }).then(() => {
- console.log(222);
- oldExecuteMergeCenter.call(__this, context, propertyName);
- }).catch(() => {
- });
- console.log(111);
- };
- designerConfig.commandMap['mergeCenter'] = MergeCenter;
- const designer = new GC.Spread.Sheets.Designer.Designer(document.getElementById('gc-designer-container'), designerConfig);
复制代码 通过上面方式重定义命令没有生效,帮忙看下什么原因
|
|