From 11e1cc89a9d516da2cccddf2a8e8c975eaff400d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 27 Apr 2023 10:01:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E5=85=AC=E5=BC=8F=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/components/excelEditor/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pc4mobx/hrmSalary/components/excelEditor/index.js b/pc4mobx/hrmSalary/components/excelEditor/index.js index 3801b878..0d38e51a 100644 --- a/pc4mobx/hrmSalary/components/excelEditor/index.js +++ b/pc4mobx/hrmSalary/components/excelEditor/index.js @@ -133,7 +133,9 @@ class ExcelEditor extends Component { handleFuncSelect = str => { const cursor = this.editorRef.getCursor(); this.editorRef.replaceRange(`${str}()`, cursor); - this.editorRef.goColumnLeft(); + console.log(this.editorRef); + console.log(this.editorRef.doc); + this.editorRef.doc.goColumnLeft(); }; handleEditorRedo = () => { const { ch, line } = this.editorRef.getCursor(); @@ -154,12 +156,10 @@ class ExcelEditor extends Component { const delStr = this.editorRef.getRange({ line, ch: ch - 1 }, { line, ch }); const codeValue = this.editorRef.getValue(); if (delStr === "}") { - console.log(ch); - console.log(codeValue.slice(0, ch).lastIndexOf("{")); if (codeValue.slice(0, ch).lastIndexOf("{") === -1) { this.editorRef.replaceRange("", { line, ch: ch - 1 }, { line, ch }); } else { - this.editorRef.replaceRange("", { line, ch: codeValue.slice(0, ch).lastIndexOf("{") }, { line, ch }); + this.editorRef.replaceRange("", { line, ch: codeValue.slice(0, ch).lastIndexOf("{") + 1 }, { line, ch }); } } }; @@ -200,7 +200,8 @@ class ExcelEditor extends Component { lint: false, indentUnit: 2, cursorHeight: 0.85, - placeholder: "" + placeholder: "", + showCursorWhenSelecting: true }} onKeyDown={(_, { keyCode }) => keyCode === 8 && this.handleBackSpaceRedo()} /> @@ -226,8 +227,7 @@ class ExcelEditor extends Component {
+ onClick={this.handleEditorRedo}>←