Browse Source

docs(config): update config

1.remove enablePage 2.change columeHeaderWidth to columnHeaderWidth
master
mengshukeji 5 years ago
parent
commit
8e82e7570f
  1. 2
      docs/guide/FAQ.md
  2. 11
      docs/guide/config.md
  3. 2
      docs/zh/guide/FAQ.md
  4. 0
      docs/zh/guide/case.md
  5. 11
      docs/zh/guide/config.md
  6. 4
      src/config.js
  7. 20
      src/controllers/freezen.js
  8. 19
      src/controllers/handler.js
  9. 4
      src/controllers/imageCtrl.js
  10. 8
      src/controllers/menuButton.js
  11. 8
      src/controllers/resize.js
  12. 4
      src/controllers/sheetmanage.js
  13. 8
      src/controllers/updateCell.js
  14. 2
      src/core.js
  15. 8
      src/global/api.js
  16. 6
      src/global/createdom.js
  17. 36
      src/global/draw.js
  18. 4
      src/global/extend.js
  19. 2
      src/global/location.js
  20. 3
      src/global/method.js
  21. 18
      src/global/refresh.js
  22. 6
      src/global/rhchInit.js
  23. 2
      src/store/index.js

2
docs/guide/FAQ.md

@ -197,7 +197,7 @@ if you want to get the position of the picture, you can overlap the picture with
**<span style="font-size:20px;">A</span>** Configuration is open
- The width of the row header area [rowHeaderWidth](/guide/config.html#rowheaderwidth)
- The height of the column header area [columeHeaderHeight](/guide/config.html#columeheaderheight)
- The height of the column header area [columnHeaderHeight](/guide/config.html#columnHeaderHeight)
------------

11
docs/guide/config.md

@ -67,12 +67,11 @@ The following are all supported setting parameters
- Ratio [devicePixelRatio](#devicePixelRatio)
- Function Button [functionButton](#functionButton)
- Auto-indent interface [showConfigWindowResize](#showConfigWindowResize)
- Load the next page [enablePage](#enablePage)
- Refresh formula [forceCalculation](#forceCalculation)
- Custom cell right-click menu [cellRightClickConfig](#cellRightClickConfig)
- Customize the right-click menu of the bottom sheet bar [sheetRightClickConfig](#sheetRightClickConfig)
- The width of the row header area [rowHeaderWidth](#rowHeaderWidth)
- The height of the column header area [columeHeaderHeight](#columeHeaderHeight)
- The height of the column header area [columnHeaderHeight](#columnHeaderHeight)
- Whether to show the formula bar [sheetFormulaBar](#sheetFormulaBar)
- Initialize the default font size [defaultFontSize](#defaultFontSize)
@ -401,12 +400,6 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
- Default: true
- Usage: The configuration of the chart or pivot table will pop up on the right, set whether the workbook will be automatically indented after popping up
------------
### enablePage
- Type: Boolean
- Default: false
- Usage: Allow to load next page
------------
### forceCalculation
- Type: Boolean
@ -502,7 +495,7 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
- Usage: The width of the row header area, if set to 0, it means to hide the row header
------------
### columeHeaderHeight
### columnHeaderHeight
- Type: Number
- Default: 20
- Usage: The height of the column header area, if set to 0, it means hide the column header

2
docs/zh/guide/FAQ.md

@ -198,7 +198,7 @@ Luckyexcel是excel导入导出库,项目采用了gulp作为打包工具,旧
**<span style="font-size:20px;">A</span>** 已开放配置
- 行标题区域的宽度 [rowHeaderWidth](/zh/guide/config.html#rowheaderwidth)
- 列标题区域的高度 [columeHeaderHeight](/zh/guide/config.html#columeheaderheight)
- 列标题区域的高度 [columnHeaderHeight](/zh/guide/config.html#columnHeaderHeight)
------------

0
docs/zh/guide/case.md

11
docs/zh/guide/config.md

@ -68,12 +68,11 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- 比例 [devicePixelRatio](#devicePixelRatio)
- 功能按钮 [functionButton](#functionButton)
- 自动缩进界面 [showConfigWindowResize](#showConfigWindowResize)
- 加载下一页 [enablePage](#enablePage)
- 刷新公式 [forceCalculation](#forceCalculation)
- 自定义单元格右键菜单 [cellRightClickConfig](#cellRightClickConfig)
- 自定义sheet页右击菜单 [sheetRightClickConfig](#sheetRightClickConfig)
- 行标题区域的宽度 [rowHeaderWidth](#rowHeaderWidth)
- 列标题区域的高度 [columeHeaderHeight](#columeHeaderHeight)
- 列标题区域的高度 [columnHeaderHeight](#columnHeaderHeight)
- 是否显示公式栏 [sheetFormulaBar](#sheetFormulaBar)
- 初始化默认字体大小 [defaultFontSize](#defaultFontSize)
@ -490,12 +489,6 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- 默认值:true
- 作用:图表或数据透视表的配置会在右侧弹出,设置弹出后表格是否会自动缩进
------------
### enablePage
- 类型:Boolean
- 默认值:false
- 作用:允许加载下一页
------------
### forceCalculation
- 类型:Boolean
@ -592,7 +585,7 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- 作用:行标题区域的宽度,如果设置为0,则表示隐藏行标题
------------
### columeHeaderHeight
### columnHeaderHeight
- 类型:Number
- 默认值:20

4
src/config.js

@ -33,7 +33,7 @@ export default {
showConfigWindowResize: true, //图表和数据透视表的配置会在右侧弹出,设置弹出后表格是否会自动缩进
enableAddRow: true,//允许添加行
enableAddBackTop: true,//允许回到顶部
enablePage: false,//允许加载下一页
// enablePage: false,//允许加载下一页
autoFormatw: false, //自动格式化超过4位数的数字为 亿万格式 例:true or "true" or "TRUE"
accuracy: undefined, //设置传输来的数值的精确位数,小数点后n位 传参数为数字或数字字符串,例: "0" 或 0
pageInfo:{
@ -53,7 +53,7 @@ export default {
plugins: [], //plugins, e.g. ['chart']
forceCalculation:false,//强制刷新公式,公式较多会有性能问题,慎用
rowHeaderWidth: 46,
columeHeaderHeight: 20,
columnHeaderHeight: 20,
defaultColWidth:73,
defaultRowHeight:19,
defaultFontSize:10,

20
src/controllers/freezen.js

@ -377,7 +377,7 @@ const luckysheetFreezen = {
dataset_row_st = 0;
}
top = Store.visibledatarow[dataset_row_st] - 2 - scrollTop + Store.columeHeaderHeight;
top = Store.visibledatarow[dataset_row_st] - 2 - scrollTop + Store.columnHeaderHeight;
freezenhorizontaldata = [
Store.visibledatarow[dataset_row_st],
dataset_row_st + 1,
@ -437,11 +437,11 @@ const luckysheetFreezen = {
freezen_vertical_scrollTop = _this.freezenverticaldata[2];
//3
_this.createCanvas("freezen_3", freezen_vertical_px - freezen_vertical_scrollTop, freezen_horizon_px - freezen_horizon_scrollTop + 1, Store.rowHeaderWidth - 1, Store.columeHeaderHeight - 1);
_this.createCanvas("freezen_3", freezen_vertical_px - freezen_vertical_scrollTop, freezen_horizon_px - freezen_horizon_scrollTop + 1, Store.rowHeaderWidth - 1, Store.columnHeaderHeight - 1);
//4
_this.createCanvas("freezen_4", drawWidth - freezen_vertical_px + freezen_vertical_scrollTop, freezen_horizon_px - freezen_horizon_scrollTop + 1, freezen_vertical_px - freezen_vertical_scrollTop + Store.rowHeaderWidth - 1, Store.columeHeaderHeight - 1);
_this.createCanvas("freezen_4", drawWidth - freezen_vertical_px + freezen_vertical_scrollTop, freezen_horizon_px - freezen_horizon_scrollTop + 1, freezen_vertical_px - freezen_vertical_scrollTop + Store.rowHeaderWidth - 1, Store.columnHeaderHeight - 1);
//7
_this.createCanvas("freezen_7", freezen_vertical_px - freezen_vertical_scrollTop, drawHeight - freezen_horizon_px + freezen_horizon_scrollTop - Store.columeHeaderHeight, Store.rowHeaderWidth - 1, freezen_horizon_px - freezen_horizon_scrollTop + Store.columeHeaderHeight - 1);
_this.createCanvas("freezen_7", freezen_vertical_px - freezen_vertical_scrollTop, drawHeight - freezen_horizon_px + freezen_horizon_scrollTop - Store.columnHeaderHeight, Store.rowHeaderWidth - 1, freezen_horizon_px - freezen_horizon_scrollTop + Store.columnHeaderHeight - 1);
}
//水平freezen
else if (_this.freezenhorizontaldata != null) {
@ -449,7 +449,7 @@ const luckysheetFreezen = {
freezen_horizon_ed = _this.freezenhorizontaldata[1];
freezen_horizon_scrollTop = _this.freezenhorizontaldata[2];
_this.createCanvas("freezen_h", drawWidth, freezen_horizon_px - freezen_horizon_scrollTop + 1, Store.rowHeaderWidth - 1, Store.columeHeaderHeight - 1);
_this.createCanvas("freezen_h", drawWidth, freezen_horizon_px - freezen_horizon_scrollTop + 1, Store.rowHeaderWidth - 1, Store.columnHeaderHeight - 1);
}
//垂直freezen
else if (_this.freezenverticaldata != null) {
@ -457,7 +457,7 @@ const luckysheetFreezen = {
freezen_vertical_ed = _this.freezenverticaldata[1];
freezen_vertical_scrollTop = _this.freezenverticaldata[2];
_this.createCanvas("freezen_v", freezen_vertical_px - freezen_vertical_scrollTop, drawHeight, Store.rowHeaderWidth - 1, Store.columeHeaderHeight - 1);
_this.createCanvas("freezen_v", freezen_vertical_px - freezen_vertical_scrollTop, drawHeight, Store.rowHeaderWidth - 1, Store.columnHeaderHeight - 1);
}
_this.scrollAdapt();
@ -1672,7 +1672,7 @@ const luckysheetFreezen = {
if(row_st == -1){
row_st = 0;
}
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columeHeaderHeight;
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight;
let freezenhorizontaldata = [Store.visibledatarow[row_st], row_st + 1, scrollTop, luckysheetFreezen.cutVolumn(Store.visibledatarow, row_st + 1), top];
freezen = {
@ -1705,7 +1705,7 @@ const luckysheetFreezen = {
if(row_st == -1){
row_st = 0;
}
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columeHeaderHeight;
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight;
let freezenhorizontaldata = [Store.visibledatarow[row_st], row_st + 1, scrollTop, luckysheetFreezen.cutVolumn(Store.visibledatarow, row_st + 1), top];
let scrollLeft = 0;
@ -1742,7 +1742,7 @@ const luckysheetFreezen = {
row_st = 0;
}
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columeHeaderHeight;
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight;
let freezenhorizontaldata = [Store.visibledatarow[row_st], row_st + 1, scrollTop, luckysheetFreezen.cutVolumn(Store.visibledatarow, row_st + 1), top];
freezen = {
@ -1792,7 +1792,7 @@ const luckysheetFreezen = {
row_st = 0;
}
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columeHeaderHeight;
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight;
let freezenhorizontaldata = [Store.visibledatarow[row_st], row_st + 1, scrollTop, luckysheetFreezen.cutVolumn(Store.visibledatarow, row_st + 1), top];
let scrollLeft = 0;

19
src/controllers/handler.js

@ -1585,10 +1585,10 @@ export default function luckysheetHandler() {
row = row_location[1],
row_pre = row_location[0],
row_index = row_location[2];
let top = mouse[1] + Store.columeHeaderHeight;
let top = mouse[1] + Store.columnHeaderHeight;
if (top < Store.columeHeaderHeight) {
top = Store.columeHeaderHeight;
if (top < Store.columnHeaderHeight) {
top = Store.columnHeaderHeight;
}
if (top > luckysheetFreezen.windowHeight - 4) {
@ -1597,12 +1597,12 @@ export default function luckysheetHandler() {
$("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-handle").css({ "top": top });
if (top + scrollTop - Store.columeHeaderHeight >= row_pre + (row - row_pre) / 2) {
top = row - 2 - scrollTop + Store.columeHeaderHeight;
if (top + scrollTop - Store.columnHeaderHeight >= row_pre + (row - row_pre) / 2) {
top = row - 2 - scrollTop + Store.columnHeaderHeight;
luckysheetFreezen.freezenhorizontaldata = [row, row_index + 1, scrollTop, luckysheetFreezen.cutVolumn(Store.visibledatarow, row_index + 1), top];
}
else {
top = row_pre - 2 - scrollTop + Store.columeHeaderHeight;
top = row_pre - 2 - scrollTop + Store.columnHeaderHeight;
luckysheetFreezen.freezenhorizontaldata = [row_pre, row_index, scrollTop, luckysheetFreezen.cutVolumn(Store.visibledatarow, row_index), top];
}
@ -2498,7 +2498,7 @@ export default function luckysheetHandler() {
maxLeft = imageCtrl.currentWinW - myw - 22 - 36;
if(imgItem.isFixedPos){
minTop = Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columeHeaderHeight;
minTop = Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight;
maxTop = minTop + Store.cellmainHeight - Store.cellMainSrollBarSize - myh;
minLeft = Store.rowHeaderWidth;
maxLeft = minLeft + Store.cellmainWidth - Store.cellMainSrollBarSize - myw;
@ -2548,7 +2548,7 @@ export default function luckysheetHandler() {
let imgItem = imageCtrl.images[imageCtrl.currentImgId];
if(imgItem.isFixedPos){
let minTop = Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columeHeaderHeight;
let minTop = Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight;
let minLeft = Store.rowHeaderWidth;
if(resize == 'lt'){//左上
@ -3361,7 +3361,7 @@ export default function luckysheetHandler() {
luckysheetFreezen.horizontalmovestate = false;
$("#luckysheet-freezebar-horizontal").removeClass("luckysheet-freezebar-active");
$("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-handle").css("cursor", "-webkit-grab");
if (luckysheetFreezen.freezenhorizontaldata[4] <= Store.columeHeaderHeight) {
if (luckysheetFreezen.freezenhorizontaldata[4] <= Store.columnHeaderHeight) {
luckysheetFreezen.cancelFreezenHorizontal();
}
luckysheetFreezen.createAssistCanvas();
@ -5515,7 +5515,6 @@ export default function luckysheetHandler() {
//是否允许加载下一页
if (luckysheetConfigsetting.enablePage) {
$("#luckysheet-bottom-page-next").click(function () {
// rptapp
let queryExps = luckysheetConfigsetting.pageInfo.queryExps;
let reportId = luckysheetConfigsetting.pageInfo.reportId;
let fields = luckysheetConfigsetting.pageInfo.fields;

4
src/controllers/imageCtrl.js

@ -657,7 +657,7 @@ const imageCtrl = {
scrollLeft = $("#luckysheet-cell-main").scrollLeft();
imgItem.fixedLeft = img.left - scrollLeft + Store.rowHeaderWidth;
imgItem.fixedTop = img.top - scrollTop + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columeHeaderHeight;
imgItem.fixedTop = img.top - scrollTop + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight;
let id = _this.generateRandomId();
let modelHtml = _this.modelHtml(id, imgItem);
@ -908,7 +908,7 @@ const imageCtrl = {
scrollLeft = $("#luckysheet-cell-main").scrollLeft();
img.fixedLeft = img.default.left - scrollLeft + Store.rowHeaderWidth;
img.fixedTop = img.default.top - scrollTop + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columeHeaderHeight;
img.fixedTop = img.default.top - scrollTop + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight;
let id = _this.generateRandomId();
let modelHtml = _this.modelHtml(id, img);

8
src/controllers/menuButton.js

@ -1624,7 +1624,7 @@ const menuButton = {
if(row_st == -1){
row_st = 0;
}
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columeHeaderHeight;
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight;
let freezenhorizontaldata = [Store.visibledatarow[row_st], row_st + 1, scrollTop, luckysheetFreezen.cutVolumn(Store.visibledatarow, row_st + 1), top];
luckysheetFreezen.saveFreezen(freezenhorizontaldata, top, null, null);
@ -1664,7 +1664,7 @@ const menuButton = {
if(row_st == -1){
row_st = 0;
}
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columeHeaderHeight;
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight;
let freezenhorizontaldata = [Store.visibledatarow[row_st], row_st + 1, scrollTop, luckysheetFreezen.cutVolumn(Store.visibledatarow, row_st + 1), top];
luckysheetFreezen.saveFreezen(freezenhorizontaldata, top, null, null);
@ -1710,7 +1710,7 @@ const menuButton = {
row_st = 0;
}
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columeHeaderHeight;
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight;
let freezenhorizontaldata = [Store.visibledatarow[row_st], row_st + 1, scrollTop, luckysheetFreezen.cutVolumn(Store.visibledatarow, row_st + 1), top];
luckysheetFreezen.saveFreezen(freezenhorizontaldata, top, null, null);
@ -1790,7 +1790,7 @@ const menuButton = {
row_st = 0;
}
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columeHeaderHeight;
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight;
let freezenhorizontaldata = [Store.visibledatarow[row_st], row_st + 1, scrollTop, luckysheetFreezen.cutVolumn(Store.visibledatarow, row_st + 1), top];
luckysheetFreezen.saveFreezen(freezenhorizontaldata, top, null, null);

8
src/controllers/resize.js

@ -20,7 +20,7 @@ export default function luckysheetsizeauto(isRefreshCanvas=true) {
Store.infobarHeight = document.querySelector('#luckysheet_info_detail').offsetHeight;
}
if (Store.toobarObject.toobarElements.length === 0) {
if (!!Store.toobarObject && !!Store.toobarObject.toobarElements && Store.toobarObject.toobarElements.length === 0) {
$("#" + Store.container).find(".luckysheet-wa-editor").hide();
Store.toolbarHeight = 0;
}
@ -241,14 +241,14 @@ export function changeSheetContainerSize(gridW, gridH){
if(gridH==null){
gridH = $("#" + Store.container).height();
}
Store.cellmainHeight = gridH - (Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columeHeaderHeight + Store.sheetBarHeight + Store.statisticBarHeight);
Store.cellmainHeight = gridH - (Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight + Store.sheetBarHeight + Store.statisticBarHeight);
Store.cellmainWidth = gridW - Store.rowHeaderWidth;
$("#luckysheet-cols-h-c, #luckysheet-cell-main").width(Store.cellmainWidth);
$("#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.columnHeaderHeight - Store.cellMainSrollBarSize - 3);
$("#luckysheet-scrollbar-x").height(Store.cellMainSrollBarSize);
$("#luckysheet-scrollbar-y").width(Store.cellMainSrollBarSize);
@ -256,7 +256,7 @@ export function changeSheetContainerSize(gridW, gridH){
Store.luckysheetTableContentHW = [
Store.cellmainWidth + Store.rowHeaderWidth - Store.cellMainSrollBarSize,
Store.cellmainHeight + Store.columeHeaderHeight - Store.cellMainSrollBarSize
Store.cellmainHeight + Store.columnHeaderHeight - Store.cellMainSrollBarSize
];
$("#luckysheetTableContent, #luckysheetTableContentF").attr({

4
src/controllers/sheetmanage.js

@ -724,7 +724,7 @@ const sheetmanage = {
Store.luckysheetTableContentHW = [
$("#luckysheet-cell-main").width() + Store.rowHeaderWidth - Store.cellMainSrollBarSize,
$("#luckysheet-cell-main").height() + Store.columeHeaderHeight - Store.cellMainSrollBarSize
$("#luckysheet-cell-main").height() + Store.columnHeaderHeight - Store.cellMainSrollBarSize
];
$("#luckysheetTableContent, #luckysheetTableContentF").attr({
width: Math.ceil(Store.luckysheetTableContentHW[0] * Store.devicePixelRatio),
@ -1341,7 +1341,7 @@ 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.columnHeaderHeight - Store.cellMainSrollBarSize - 3);
//等待滚动条dom宽高计算完成后 初始化该表格滚动位置
let index = this.getSheetIndex(Store.currentSheetIndex);

8
src/controllers/updateCell.js

@ -63,9 +63,9 @@ export function luckysheetupdateCell(row_index1, col_index1, d, cover, isnotfocu
left = col_pre + container_offset.left + Store.rowHeaderWidth - 2;
}
let top = row_pre + container_offset.top + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columeHeaderHeight - scrollTop - 2;
let top = row_pre + container_offset.top + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight - scrollTop - 2;
if(luckysheetFreezen.freezenhorizontaldata != null && row_index1 <= luckysheetFreezen.freezenhorizontaldata[1]){
top = row_pre + container_offset.top + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columeHeaderHeight - 2;
top = row_pre + container_offset.top + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight - 2;
}
let input_postition = {
@ -122,7 +122,7 @@ export function luckysheetupdateCell(row_index1, col_index1, d, cover, isnotfocu
"max-width": winW*2/3,
"max-height": winH + scrollTop - row_pre - 20 - 15 - Store.toolbarHeight - Store.infobarHeight - Store.calculatebarHeight - Store.sheetBarHeight - Store.statisticBarHeight,
"left": col_pre + container_offset.left + Store.rowHeaderWidth - scrollLeft - 2,
"top": row_pre + container_offset.top + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columeHeaderHeight - scrollTop - 2,
"top": row_pre + container_offset.top + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight - scrollTop - 2,
}
if(Store.zoomRatio<1){
@ -140,7 +140,7 @@ export function luckysheetupdateCell(row_index1, col_index1, d, cover, isnotfocu
"max-width": col + container_offset.left - scrollLeft - 8,
"max-height": winH + scrollTop - row_pre - 20 - 15 - Store.toolbarHeight - Store.infobarHeight - Store.calculatebarHeight - Store.sheetBarHeight - Store.statisticBarHeight,
"right": winW - (container_offset.left + (Store.rowHeaderWidth-1) - scrollLeft) - col,
"top": row_pre + container_offset.top + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columeHeaderHeight - scrollTop - 2,
"top": row_pre + container_offset.top + Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columnHeaderHeight - scrollTop - 2,
}
if(Store.zoomRatio<1){

2
src/core.js

@ -119,7 +119,7 @@ luckysheet.create = function (setting) {
luckysheetConfigsetting.plugins = extendsetting.plugins;
luckysheetConfigsetting.rowHeaderWidth = extendsetting.rowHeaderWidth;
luckysheetConfigsetting.columeHeaderHeight = extendsetting.columeHeaderHeight;
luckysheetConfigsetting.columnHeaderHeight = extendsetting.columnHeaderHeight;
luckysheetConfigsetting.defaultColWidth = extendsetting.defaultColWidth;
luckysheetConfigsetting.defaultRowHeight = extendsetting.defaultRowHeight;

8
src/global/api.js

@ -470,7 +470,7 @@ export function frozenFirstRow(order) {
row_st = 0;
}
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columeHeaderHeight;
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight;
let freezenhorizontaldata = [
Store.visibledatarow[row_st],
row_st + 1,
@ -571,7 +571,7 @@ export function frozenRowRange(range, order) {
row_st = 0;
}
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columeHeaderHeight;
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight;
let freezenhorizontaldata = [
Store.visibledatarow[row_st],
row_st + 1,
@ -769,7 +769,7 @@ export function setBothFrozen(isRange, options = {}) {
if(row_st == -1){
row_st = 0;
}
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columeHeaderHeight;
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight;
let freezenhorizontaldata = [
Store.visibledatarow[row_st],
row_st + 1,
@ -837,7 +837,7 @@ export function setBothFrozen(isRange, options = {}) {
row_st = 0;
}
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columeHeaderHeight;
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight;
let freezenhorizontaldata = [
Store.visibledatarow[row_st],
row_st + 1,

6
src/global/createdom.js

@ -101,7 +101,7 @@ export default function luckysheetcreatedom(colwidth, rowheight, data, menu, tit
$("#" + Store.container).append(gh);
$("#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.columnHeaderHeight - Store.cellMainSrollBarSize - 3);
//新建行菜单
$("body").append(maskHTML);
@ -113,8 +113,8 @@ export default function luckysheetcreatedom(colwidth, rowheight, data, menu, tit
$("body").append(sheetconfigHTML());
$("#luckysheet-rows-h").width((Store.rowHeaderWidth-1.5));
$("#luckysheet-cols-h-c").height((Store.columeHeaderHeight-1.5));
$("#luckysheet-left-top").css({width:Store.rowHeaderWidth-1.5, height:Store.columeHeaderHeight-1.5});
$("#luckysheet-cols-h-c").height((Store.columnHeaderHeight-1.5));
$("#luckysheet-left-top").css({width:Store.rowHeaderWidth-1.5, height:Store.columnHeaderHeight-1.5});
// //批注
// luckysheetPostil.buildAllPs(Store.flowdata);

36
src/global/draw.js

@ -30,7 +30,7 @@ function luckysheetDrawgridRowTitle(scrollHeight, drawHeight, offsetTop) {
}
if (offsetTop == null) {
offsetTop = Store.columeHeaderHeight;
offsetTop = Store.columnHeaderHeight;
}
let luckysheetTableContent = $("#luckysheetTableContent").get(0).getContext("2d");
@ -210,7 +210,7 @@ function luckysheetDrawgridRowTitle(scrollHeight, drawHeight, offsetTop) {
//清除canvas左上角区域 防止列标题栏序列号溢出显示
// luckysheetTableContent.clearRect(0, 0, Store.rowHeaderWidth , Store.columeHeaderHeight );
// luckysheetTableContent.clearRect(0, 0, Store.rowHeaderWidth , Store.columnHeaderHeight );
luckysheetTableContent.restore();
@ -237,7 +237,7 @@ function luckysheetDrawgridColumnTitle(scrollWidth, drawWidth, offsetLeft) {
offsetLeft ,
0,
drawWidth ,
(Store.columeHeaderHeight - 1)
(Store.columnHeaderHeight - 1)
);
@ -258,10 +258,10 @@ function luckysheetDrawgridColumnTitle(scrollWidth, drawWidth, offsetLeft) {
luckysheetTableContent.save();
luckysheetTableContent.beginPath();
luckysheetTableContent.rect(offsetLeft-1, 0, drawWidth, Store.columeHeaderHeight -1);
luckysheetTableContent.rect(offsetLeft-1, 0, drawWidth, Store.columnHeaderHeight -1);
luckysheetTableContent.clip();
// console.log(offsetLeft, 0, drawWidth, Store.columeHeaderHeight -1);
// console.log(offsetLeft, 0, drawWidth, Store.columnHeaderHeight -1);
let end_c, start_c;
let bodrder05 = 0.5;//Default 0.5
@ -285,7 +285,7 @@ function luckysheetDrawgridColumnTitle(scrollWidth, drawWidth, offsetLeft) {
c:c,
left:(start_c + offsetLeft - 1),
width:(end_c - start_c),
height:Store.columeHeaderHeight -1
height:Store.columnHeaderHeight -1
}, luckysheetTableContent)){ continue; }
if (Store.config["colhidden"] != null && Store.config["colhidden"][c] != null) {
@ -297,7 +297,7 @@ function luckysheetDrawgridColumnTitle(scrollWidth, drawWidth, offsetLeft) {
(start_c + offsetLeft - 1) ,
0,
(end_c - start_c) ,
Store.columeHeaderHeight -1
Store.columnHeaderHeight -1
)
luckysheetTableContent.fillStyle = "#000000";
@ -309,7 +309,7 @@ function luckysheetDrawgridColumnTitle(scrollWidth, drawWidth, offsetLeft) {
//luckysheetTableContent.measureText(abc);
let horizonAlignPos = Math.round((start_c + (end_c - start_c) / 2 + offsetLeft) - textMetrics.width / 2);
let verticalAlignPos = Math.round(Store.columeHeaderHeight / 2 );
let verticalAlignPos = Math.round(Store.columnHeaderHeight / 2 );
luckysheetTableContent.fillText(abc, horizonAlignPos/Store.zoomRatio, verticalAlignPos/Store.zoomRatio);
luckysheetTableContent.restore();//restore scale after draw text
@ -324,7 +324,7 @@ function luckysheetDrawgridColumnTitle(scrollWidth, drawWidth, offsetLeft) {
);
luckysheetTableContent.lineTo(
(end_c + offsetLeft - 4 + bodrder05) ,
(Store.columeHeaderHeight - 2)
(Store.columnHeaderHeight - 2)
);
luckysheetTableContent.lineWidth = 1;
luckysheetTableContent.strokeStyle = luckysheetdefaultstyle.strokeStyle;
@ -339,7 +339,7 @@ function luckysheetDrawgridColumnTitle(scrollWidth, drawWidth, offsetLeft) {
);
luckysheetTableContent.lineTo(
(end_c + offsetLeft - 2 + bodrder05) ,
(Store.columeHeaderHeight - 2)
(Store.columnHeaderHeight - 2)
);
luckysheetTableContent.lineWidth = 1;
@ -356,7 +356,7 @@ function luckysheetDrawgridColumnTitle(scrollWidth, drawWidth, offsetLeft) {
);
luckysheetTableContent.lineTo(
(preEndC + offsetLeft + bodrder05) ,
(Store.columeHeaderHeight - 2)
(Store.columnHeaderHeight - 2)
);
// luckysheetTableContent.lineWidth = 1;
// luckysheetTableContent.strokeStyle = luckysheetdefaultstyle.strokeStyle;
@ -369,11 +369,11 @@ function luckysheetDrawgridColumnTitle(scrollWidth, drawWidth, offsetLeft) {
luckysheetTableContent.beginPath();
luckysheetTableContent.moveTo(
(start_c + offsetLeft - 1),
(Store.columeHeaderHeight - 2 + bodrder05)
(Store.columnHeaderHeight - 2 + bodrder05)
);
luckysheetTableContent.lineTo(
(end_c + offsetLeft - 1),
(Store.columeHeaderHeight - 2 + bodrder05)
(Store.columnHeaderHeight - 2 + bodrder05)
);
// luckysheetTableContent.lineWidth = 1;
@ -387,7 +387,7 @@ function luckysheetDrawgridColumnTitle(scrollWidth, drawWidth, offsetLeft) {
c:c,
left:(start_c + offsetLeft - 1),
width:(end_c - start_c),
height:Store.columeHeaderHeight -1
height:Store.columnHeaderHeight -1
}, luckysheetTableContent)
}
@ -395,11 +395,11 @@ function luckysheetDrawgridColumnTitle(scrollWidth, drawWidth, offsetLeft) {
// luckysheetTableContent.beginPath();
// luckysheetTableContent.moveTo(
// (offsetLeft - 1) ,
// (Store.columeHeaderHeight - 2 + 0.5)
// (Store.columnHeaderHeight - 2 + 0.5)
// );
// luckysheetTableContent.lineTo(
// (Store.ch_width + offsetLeft - 2) ,
// (Store.columeHeaderHeight - 2 + 0.5)
// (Store.columnHeaderHeight - 2 + 0.5)
// );
// luckysheetTableContent.lineWidth = 1;
// luckysheetTableContent.strokeStyle = luckysheetdefaultstyle.strokeStyle;
@ -407,7 +407,7 @@ function luckysheetDrawgridColumnTitle(scrollWidth, drawWidth, offsetLeft) {
// luckysheetTableContent.stroke();
//清除canvas左上角区域 防止列标题栏序列号溢出显示
// luckysheetTableContent.clearRect(0, 0, Store.rowHeaderWidth , Store.columeHeaderHeight );
// luckysheetTableContent.clearRect(0, 0, Store.rowHeaderWidth , Store.columnHeaderHeight );
luckysheetTableContent.restore();
luckysheetTableContent.restore();
@ -443,7 +443,7 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of
offsetLeft = Store.rowHeaderWidth;
}
if (offsetTop == null) {
offsetTop = Store.columeHeaderHeight;
offsetTop = Store.columnHeaderHeight;
}
if (columnOffsetCell == null) {

4
src/global/extend.js

@ -427,7 +427,7 @@ function luckysheetextendtable(type, index, value, direction, sheetIndex) {
freezen_row_st += value;
}
let freezen_top = Store.visibledatarow[freezen_row_st] - 2 - freezen_scrollTop + Store.columeHeaderHeight;
let freezen_top = Store.visibledatarow[freezen_row_st] - 2 - freezen_scrollTop + Store.columnHeaderHeight;
newFreezen.freezenhorizontaldata = [
Store.visibledatarow[freezen_row_st],
@ -1418,7 +1418,7 @@ function luckysheetdeletetable(type, st, ed, sheetIndex) {
freezen_row_st = freezen_st;
}
let freezen_top = Store.visibledatarow[freezen_row_st] - 2 - freezen_scrollTop + Store.columeHeaderHeight;
let freezen_top = Store.visibledatarow[freezen_row_st] - 2 - freezen_scrollTop + Store.columnHeaderHeight;
newFreezen.freezenhorizontaldata = [
Store.visibledatarow[freezen_row_st],

2
src/global/location.js

@ -59,7 +59,7 @@ function mouseposition(x, y) {
let container_offset = $("#" + Store.container).offset();
let newX = x - container_offset.left - Store.rowHeaderWidth,
newY = y - container_offset.top - Store.infobarHeight - Store.toolbarHeight - Store.calculatebarHeight - Store.columeHeaderHeight;
newY = y - container_offset.top - Store.infobarHeight - Store.toolbarHeight - Store.calculatebarHeight - Store.columnHeaderHeight;
return [newX, newY];
}

3
src/global/method.js

@ -38,7 +38,7 @@ const defaultConfig = {
infobarHeight: 0,
calculatebarHeight: 0,
rowHeaderWidth: 46,
columeHeaderHeight: 20,
columnHeaderHeight: 20,
cellMainSrollBarSize: 12,
sheetBarHeight: 31,
statisticBarHeight: 23,
@ -321,7 +321,6 @@ const method = {
let dataset = d.data;
// rptapp
let newData = dataset.celldata;
luckysheetextendData(dataset["row"], newData);

18
src/global/refresh.js

@ -970,7 +970,7 @@ function jfrefreshgrid_rhcw(rowheight, colwidth, isRefreshCanvas=true){
let scrollTop = luckysheetFreezen.freezenhorizontaldata[2];
let scrollLeft = luckysheetFreezen.freezenverticaldata[2];
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columeHeaderHeight;
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight;
let freezenhorizontaldata = [
Store.visibledatarow[row_st],
row_st + 1,
@ -996,7 +996,7 @@ function jfrefreshgrid_rhcw(rowheight, colwidth, isRefreshCanvas=true){
let row_st = luckysheetFreezen.freezenhorizontaldata[1] - 1;
let scrollTop = luckysheetFreezen.freezenhorizontaldata[2];
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columeHeaderHeight;
let top = Store.visibledatarow[row_st] - 2 - scrollTop + Store.columnHeaderHeight;
let freezenhorizontaldata = [
Store.visibledatarow[row_st],
row_st + 1,
@ -1142,7 +1142,7 @@ function luckysheetrefreshgrid(scrollWidth, scrollHeight) {
drawWidth - freezen_vertical_px + freezen_vertical_scrollTop,
drawHeight - freezen_horizon_px + freezen_horizon_scrollTop,
freezen_vertical_px - freezen_vertical_scrollTop + Store.rowHeaderWidth,
freezen_horizon_px - freezen_horizon_scrollTop + Store.columeHeaderHeight
freezen_horizon_px - freezen_horizon_scrollTop + Store.columnHeaderHeight
);
//标题
@ -1153,11 +1153,11 @@ function luckysheetrefreshgrid(scrollWidth, scrollHeight) {
freezen_vertical_px - freezen_vertical_scrollTop + Store.rowHeaderWidth
);
luckysheetDrawgridRowTitle(freezen_horizon_scrollTop, freezen_horizon_px, Store.columeHeaderHeight);
luckysheetDrawgridRowTitle(freezen_horizon_scrollTop, freezen_horizon_px, Store.columnHeaderHeight);
luckysheetDrawgridRowTitle(
scrollHeight + freezen_horizon_px - freezen_horizon_scrollTop,
drawHeight - freezen_horizon_px + freezen_horizon_scrollTop,
freezen_horizon_px - freezen_horizon_scrollTop + Store.columeHeaderHeight
freezen_horizon_px - freezen_horizon_scrollTop + Store.columnHeaderHeight
);
}
@ -1183,16 +1183,16 @@ function luckysheetrefreshgrid(scrollWidth, scrollHeight) {
drawWidth,
drawHeight - freezen_horizon_px + freezen_horizon_scrollTop,
null,
freezen_horizon_px - freezen_horizon_scrollTop + Store.columeHeaderHeight
freezen_horizon_px - freezen_horizon_scrollTop + Store.columnHeaderHeight
);
luckysheetDrawgridColumnTitle(scrollWidth, drawWidth, null);
luckysheetDrawgridRowTitle(freezen_horizon_scrollTop, freezen_horizon_px, Store.columeHeaderHeight);
luckysheetDrawgridRowTitle(freezen_horizon_scrollTop, freezen_horizon_px, Store.columnHeaderHeight);
luckysheetDrawgridRowTitle(
scrollHeight + freezen_horizon_px - freezen_horizon_scrollTop,
drawHeight - freezen_horizon_px + freezen_horizon_scrollTop,
freezen_horizon_px - freezen_horizon_scrollTop + Store.columeHeaderHeight
freezen_horizon_px - freezen_horizon_scrollTop + Store.columnHeaderHeight
);
}
@ -1246,7 +1246,7 @@ function luckysheetrefreshgrid(scrollWidth, scrollHeight) {
//清除canvas左上角区域 防止列标题栏序列号溢出显示
luckysheetTableContent.clearRect(0, 0, (Store.rowHeaderWidth* Store.devicePixelRatio-1) , (Store.columeHeaderHeight* Store.devicePixelRatio-1) );
luckysheetTableContent.clearRect(0, 0, (Store.rowHeaderWidth* Store.devicePixelRatio-1) , (Store.columnHeaderHeight* Store.devicePixelRatio-1) );
}
}

6
src/global/rhchInit.js

@ -83,8 +83,8 @@ export default function rhchInit(rowheight, colwidth) {
export function zoomSetting(){
//zoom
Store.rowHeaderWidth = luckysheetConfigsetting.rowHeaderWidth * Store.zoomRatio;
Store.columeHeaderHeight = luckysheetConfigsetting.columeHeaderHeight *Store.zoomRatio;
Store.columnHeaderHeight = luckysheetConfigsetting.columnHeaderHeight *Store.zoomRatio;
$("#luckysheet-rows-h").width((Store.rowHeaderWidth-1.5));
$("#luckysheet-cols-h-c").height((Store.columeHeaderHeight-1.5));
$("#luckysheet-left-top").css({width:Store.rowHeaderWidth-1.5, height:Store.columeHeaderHeight-1.5});
$("#luckysheet-cols-h-c").height((Store.columnHeaderHeight-1.5));
$("#luckysheet-left-top").css({width:Store.rowHeaderWidth-1.5, height:Store.columnHeaderHeight-1.5});
}

2
src/store/index.js

@ -22,7 +22,7 @@ const Store = {
infobarHeight: 0,
calculatebarHeight: 0,
rowHeaderWidth: 46,
columeHeaderHeight: 20,
columnHeaderHeight: 20,
cellMainSrollBarSize: 12,
sheetBarHeight: 31,
statisticBarHeight: 23,

Loading…
Cancel
Save