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}>←