vue-office icon indicating copy to clipboard operation
vue-office copied to clipboard

excel在线预览文件,带有文字和图片的文件,选中文字,图片会丢失;或者按下上下左右键,也会时隐时现。

Open ghost opened this issue 1 year ago • 3 comments

1、"@vue-office/excel": "^1.4.7" 2、运行环境: 浏览器:谷歌浏览器 vue版本:"vue": "^3.2.45" 打包工具及版本:"vite": "^4.1.0" 3、问题描述:控制台无报错,能正常渲染在线文档。只是选中或按下上下左右键,图片会时隐时现 选中前: image 选中后: image

ghost avatar Dec 26 '23 06:12 ghost

右键单击选中文字图片不会消失

ghost avatar Dec 26 '23 06:12 ghost

改成跟table一起绘制,效果目前还行,大概类似:

        let swapFunc = grid.bottombar.swapFunc;
        grid.bottombar.swapFunc = function (index) {
            that.sheetIndex = index;
            swapFunc.call(grid.bottombar, index);
            // setTimeout(() => {
            //     grid.reRender();
            //     renderImage(that.ctx, that.mediasSource, that.workbookDataSource._worksheets[that.sheetIndex], that.offset);
            // });

        };
        // let clear = grid.sheet.editor.clear;
        // grid.sheet.editor.clear = function (...args) {
        //     clear.apply(grid.sheet.editor, args);
        //     setTimeout(() => {
        //         renderImage(that.ctx, that.mediasSource, that.workbookDataSource._worksheets[that.sheetIndex], that.offset);
        //     });
        // };
        let setOffset = grid.sheet.editor.setOffset;
        grid.sheet.editor.setOffset = function (...args) {
            setOffset.apply(grid.sheet.editor, args);
            that.offset = args[0];
            // renderImage(that.ctx, that.mediasSource, that.workbookDataSource._worksheets[that.sheetIndex], that.offset);
        };

        let renderFunc = grid.sheet.table.render;
        grid.sheet.table.render = function (...args) {
            renderFunc.call(grid.sheet.table, args);
            renderImage(that.ctx, that.mediasSource, that.workbookDataSource._worksheets[that.sheetIndex], that.offset);
        }

akof1314 avatar Jan 16 '24 14:01 akof1314

请问如何希望excel图片点击或者能跟着行或者列宽变换应该如何操作呢

just5even avatar Mar 29 '24 01:03 just5even