From 15dca040840d228f6326d4eecad917df38e15f04 Mon Sep 17 00:00:00 2001 From: renxxing <74659302+renxxing@users.noreply.github.com> Date: Fri, 20 Nov 2020 17:19:23 +0800 Subject: [PATCH] fix(fix #219): checkout checkout keep highlight box --- src/controllers/handler.js | 2 +- src/controllers/imageCtrl.js | 2 +- src/controllers/server.js | 10 ++++++---- src/controllers/sheetBar.js | 3 +++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/controllers/handler.js b/src/controllers/handler.js index b4d7ccf0d..2af6e34ec 100644 --- a/src/controllers/handler.js +++ b/src/controllers/handler.js @@ -2356,7 +2356,7 @@ export default function luckysheetHandler() { col = col_location[1], col_pre = col_location[0], col_index = col_location[2]; - + if ((x + 3) - Store.luckysheet_cols_change_size_start[0] > 30 && x < winW + scrollLeft - 100) { $("#luckysheet-change-size-line").css({ "left": x }); $("#luckysheet-cols-change-size").css({ "left": x - 2 }); diff --git a/src/controllers/imageCtrl.js b/src/controllers/imageCtrl.js index b1f2c20b0..714d60dd9 100644 --- a/src/controllers/imageCtrl.js +++ b/src/controllers/imageCtrl.js @@ -51,7 +51,7 @@ const imageCtrl = { copyImgItemObj: null, inserImg: function(src){ let _this = this; - + let rowIndex = Store.luckysheet_select_save[0].row_focus || 0; let colIndex = Store.luckysheet_select_save[0].column_focus || 0; let left = colIndex == 0 ? 0 : Store.visibledatacolumn[colIndex - 1]; diff --git a/src/controllers/server.js b/src/controllers/server.js index 282c5c670..6075c489f 100644 --- a/src/controllers/server.js +++ b/src/controllers/server.js @@ -12,6 +12,7 @@ import { getSheetIndex } from '../methods/get'; import Store from '../store'; import locale from '../locale/locale'; import dayjs from "dayjs"; +import imageCtrl from './imageCtrl'; const server = { gridKey: null, @@ -163,9 +164,10 @@ const server = { //客户端接收服务端数据时触发 _this.websocket.onmessage = function(result){ - let data = eval('(' + result.data + ')'); - console.info(data); - let type = data.type; + Store.result = result + let data = eval('(' + result.data + ')'); + console.info(data); + let type = data.type; let {message,id} = data; // 用户退出时,关闭协同编辑时其提示框 if(message === '用户退出') { @@ -176,7 +178,7 @@ const server = { } else if(type == 2){ //更新数据 let item = JSON.parse(data.data); - _this.wsUpdateMsg(item); + _this.wsUpdateMsg(item); } else if(type == 3){ //多人操作不同选区("t": "mv")(用不同颜色显示其他人所操作的选区) let id = data.id; diff --git a/src/controllers/sheetBar.js b/src/controllers/sheetBar.js index bafd920fe..04d3bb1de 100644 --- a/src/controllers/sheetBar.js +++ b/src/controllers/sheetBar.js @@ -206,6 +206,8 @@ export function initialSheetBar(){ let $t = $(this), $cur = $(e.target); luckysheetsheetrightclick($t, $cur, e); + let result = Store.result + server.websocket.onmessage(result) }); let luckysheetsheetnameeditor = function ($t) { @@ -221,6 +223,7 @@ export function initialSheetBar(){ $("#luckysheet-sheet-area").on("dblclick", "span.luckysheet-sheets-item-name", function (e) { luckysheetsheetnameeditor($(this)); + console.log(123); }); $("#luckysheet-sheet-area").on("blur", "span.luckysheet-sheets-item-name", function (e) {