Browse Source

fix(fix): fix

master
liuyang 5 years ago
parent
commit
194dea1767
  1. 6
      src/controllers/resize.js
  2. 49
      src/controllers/sheetmanage.js
  3. 4
      src/demoData/sheetCell.js

6
src/controllers/resize.js

@ -63,7 +63,7 @@ export default function luckysheetsizeauto(isRefreshCanvas=true) {
$("#" + Store.container).find(".luckysheet").height(gridH - 2).width(gridW - 2);
changeSheetContainerSize(gridW,gridH)
changeSheetContainerSize(gridW, gridH)
if(isRefreshCanvas){
luckysheetrefreshgrid($("#luckysheet-cell-main").scrollLeft(), $("#luckysheet-cell-main").scrollTop());
@ -152,11 +152,11 @@ export function changeSheetContainerSize(gridW, gridH){
$("#luckysheet-cell-main").height(Store.cellmainHeight);
$("#luckysheet-rows-h").height(Store.cellmainHeight - Store.cellMainSrollBarSize);
$("#luckysheet-scrollbar-y").height(Store.cellmainHeight + Store.columeHeaderHeight-Store.cellMainSrollBarSize-3);
$("#luckysheet-scrollbar-y").height(Store.cellmainHeight + Store.columeHeaderHeight - Store.cellMainSrollBarSize - 3);
$("#luckysheet-scrollbar-x").height(Store.cellMainSrollBarSize);
$("#luckysheet-scrollbar-y").width(Store.cellMainSrollBarSize);
$("#luckysheet-scrollbar-x").width(Store.cellmainWidth).css("left",Store.rowHeaderWidth-1);
$("#luckysheet-scrollbar-x").width(Store.cellmainWidth).css("left", Store.rowHeaderWidth - 1);
Store.luckysheetTableContentHW = [
Store.cellmainWidth + Store.rowHeaderWidth - Store.cellMainSrollBarSize,

49
src/controllers/sheetmanage.js

@ -6,6 +6,7 @@ import luckysheetcreatedom from '../global/createdom';
import tooltip from '../global/tooltip';
import formula from '../global/formula';
import { luckysheetrefreshgrid, jfrefreshgrid_rhcw } from '../global/refresh';
import rhchInit from '../global/rhchInit';
import editor from '../global/editor';
import { luckysheetextendtable, luckysheetdeletetable } from '../global/extend';
import { isRealNum } from '../global/validate';
@ -840,26 +841,8 @@ const sheetmanage = {
}
createFilterOptions(file["filter_select"], file["filter"]);
Store.scrollRefreshSwitch = false;
if(file["scrollLeft"] != null && file["scrollLeft"] > 0){
$("#luckysheet-scrollbar-x").scrollLeft(file["scrollLeft"]);
}
else{
$("#luckysheet-scrollbar-x").scrollLeft(0);
}
if(file["scrollTop"] != null && file["scrollTop"] > 0){
$("#luckysheet-scrollbar-y").scrollTop(file["scrollTop"]);
}
else{
$("#luckysheet-scrollbar-y").scrollTop(0);
}
setTimeout(() => {
Store.scrollRefreshSwitch = true;
}, 0);
jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length, false);
rhchInit(Store.flowdata.length, Store.flowdata[0].length);
},
restoreselect: function() {
let index = this.getSheetIndex(Store.currentSheetIndex);
@ -1073,7 +1056,33 @@ const sheetmanage = {
$("#luckysheet-cols-h-cells_0").css("width", Store.ch_width); //width更新
$("#luckysheet-scrollbar-x div").width(Store.ch_width);
$("#luckysheet-scrollbar-y div").height(Store.rh_height + Store.columeHeaderHeight-Store.cellMainSrollBarSize-3 );
$("#luckysheet-scrollbar-y div").height(Store.rh_height + Store.columeHeaderHeight - Store.cellMainSrollBarSize - 3);
//等待滚动条dom宽高计算完成后 初始化该表格滚动位置
let index = this.getSheetIndex(Store.currentSheetIndex);
let file = Store.luckysheetfile[index];
Store.scrollRefreshSwitch = false;
if(file["scrollLeft"] != null && file["scrollLeft"] > 0){
$("#luckysheet-scrollbar-x").scrollLeft(file["scrollLeft"] * Store.zoomRatio);
}
else{
$("#luckysheet-scrollbar-x").scrollLeft(0);
}
if(file["scrollTop"] != null && file["scrollTop"] > 0){
$("#luckysheet-scrollbar-y").scrollTop(file["scrollTop"] * Store.zoomRatio);
}
else{
$("#luckysheet-scrollbar-y").scrollTop(0);
}
setTimeout(() => {
Store.scrollRefreshSwitch = true;
}, 0);
zoomNumberDomBind(Store.zoomRatio);
},
setCurSheet: function(index) {

4
src/demoData/sheetCell.js

@ -5581,7 +5581,7 @@ const sheetCell = {
"column_focus": 0
}],
"luckysheet_selection_range": [],
"scrollLeft": 0,
"scrollTop": 0
"scrollLeft": 300,
"scrollTop": 500
}
export default sheetCell
Loading…
Cancel
Save