Browse Source

feat(zoom gui): zoom plus and minus, restore origin, slider

master
liuyang 5 years ago
parent
commit
d70dab4938
  1. 334
      src/controllers/constant.js
  2. 28
      src/controllers/handler.js
  3. 95
      src/controllers/resize.js
  4. 2
      src/controllers/sheetmanage.js
  5. 152
      src/controllers/zoom.js
  6. 2
      src/core.js
  7. 7
      src/css/luckysheet-core.css
  8. 113
      src/css/luckysheet-zoom.css
  9. 20
      src/global/rhchInit.js

334
src/controllers/constant.js

@ -7,166 +7,180 @@ const gridHTML = function(){
const _locale = locale();
const locale_info = _locale.info;
return '<div class="luckysheet">' +
'<canvas id="luckysheetTableContentF" style="display:none;" class="luckysheetTableContent"></canvas>' +
'<div class="luckysheet-work-area luckysheet-noselected-text">' +
'<div class="luckysheet-share-logo" title="${logotitle}"></div>' +
'<div id ="luckysheet_info_detail" class="luckysheet_info_detail">' +
'<div data-tips="'+locale_info.return+'" id="luckysheet_info_detail_title" class="luckysheet_info_detail_title">' +
'<i style="margin-left: -2px;" class="fa fa-chevron-left" aria-hidden="true"></i>' +
'</div>' +
'<div>' +
'<input data-tips="'+locale_info.tips+'" id="luckysheet_info_detail_input" class="luckysheet_info_detail_input luckysheet-mousedown-cancel" value="'+locale_info.noName+'" tabindex="0" dir="ltr" aria-label="'+locale_info.rename+'" style="visibility: visible; width: 149px;" data-tooltip="'+locale_info.rename+'">' +
'</div>' +
'<div id="luckysheet_info_detail_update" class="luckysheet_info_detail_update"> '+locale_info.detailUpdate+' </div>' +
'<div id="luckysheet_info_detail_save" class="luckysheet_info_detail_save"> '+locale_info.wait+' </div>' +
'<div class="luckysheet_info_detail_user"> ${functionButton} <span id="luckysheet_info_detail_user"></span> </div>' +
'</div>' +
'<div id="luckysheet-wa-editor" class="luckysheet-wa-editor"> ${menu} </div>' +
'<div id="luckysheet-wa-calculate" class="luckysheet-wa-calculate">' +
'<div class="luckysheet-wa-calculate-size" id="luckysheet-wa-calculate-size"></div>' +
'<div class="luckysheet-wa-calculate-help">' +
'<div class="luckysheet-wa-calculate-help-box">' +
'<div spellcheck="false" aria-hidden="false" id="luckysheet-helpbox">' +
'<div id="luckysheet-helpbox-cell" class="luckysheet-helpbox-cell-input luckysheet-mousedown-cancel" tabindex="0" contenteditable="true" dir="ltr" aria-autocomplete="list"></div>' +
'</div>' +
'</div>' +
'<div class="luckysheet-wa-calculate-help-tool">' +
'<i class="fa fa-caret-down" aria-hidden="true" style="margin-top: 7px;"></i>' +
'</div>' +
'</div>' +
'<div id="luckysheet-wa-functionbox-cancel" class="luckysheet-wa-functionbox">' +
'<span><i class="fa fa-remove" aria-hidden="true"></i></span>' +
'</div>' +
'<div id="luckysheet-wa-functionbox-confirm" class="luckysheet-wa-functionbox">' +
'<span><i class="fa fa-check" aria-hidden="true"></i></span>' +
'</div>' +
'<div id="luckysheet-wa-functionbox-fx" class="luckysheet-wa-functionbox">' +
'<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfdBg4KFCeL2MAqAAACOUlEQVRYw+3Wy2+MURjH8U9Hp0VLVTTRUupWqfs9xEpE3ULSsLK0qVg0rJAgiD/A2kpCQkJC0rhEJMJampBSFYle0BYNMUNKTY+F0bi10zFjIZnvuzrPe57fc3mfnPeQI0eO/5+8tHaPVW22cn1aNYlnO5nlzmgzIAiazcm2/FoPBEHMY+2uKcqufKlGQcIt29RYYl6azU3JLh8E99VkuzHfKHZekHDw38hT5Zmg17L0XSMj2jVXGTq9+lcBZilAp1j6AfKHfVtmh1IDauWjQoPPIp64IpF+qD+xSKfw23PV6GxV0KdFHJWKJLwQR0SbgezkT1SFSivcE3SrM9U005WlIzF8Bf1eokAUMQ89T9oLjdWfPOwixssT1/9niZFMUakJ+Kg3uV7olKtOm4kx6jU6qzqTRq33VnBHIahy0z0dgmPy7NGjx23ThnIeSQUTlKA7OZrjNNvtHNaoc8hFm+33MpMK9giCU4PJFGKrz7o8dVnF8M6pK4iYDLoGh/MT2jw32TuHU+WeOkC+KQi/CPXqwA2PUueXigIz8UnnT9b5ZmF68sNnFKBEFbq9/sFW7bioLxYpzjzAamV4pAtElahwQtQRb1WaZ4rtxqVUGZLv/7IDyfVGl1zXbpOJmgTnXXBXZfrCk9RabKmTYoIWc5P2o2La1RslYr8OPe5a9zeZ7/TGMx0Sgvf2Dt4hamyxMnmCFVllgxl/15oGcUHwRYt9mdyBhrrdlFtgtkIvNGvN3vmfI0eO/5Ov+PeiZHME+tcAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTYtMDktMTdUMTU6MTk6MDcrMDg6MDARPBuqAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDEzLTA2LTE0VDEwOjIwOjM5KzA4OjAw59f0jAAAAE10RVh0c29mdHdhcmUASW1hZ2VNYWdpY2sgNy4wLjEtNiBRMTYgeDg2XzY0IDIwMTYtMDktMTcgaHR0cDovL3d3dy5pbWFnZW1hZ2ljay5vcmfd2aVOAAAAGHRFWHRUaHVtYjo6RG9jdW1lbnQ6OlBhZ2VzADGn/7svAAAAF3RFWHRUaHVtYjo6SW1hZ2U6OkhlaWdodAA3Nkv1+ekAAAAWdEVYdFRodW1iOjpJbWFnZTo6V2lkdGgANzazWjlkAAAAGXRFWHRUaHVtYjo6TWltZXR5cGUAaW1hZ2UvcG5nP7JWTgAAABd0RVh0VGh1bWI6Ok1UaW1lADEzNzExNzY0MzntxStTAAAAEHRFWHRUaHVtYjo6U2l6ZQA5OTdClByG1AAAAF90RVh0VGh1bWI6OlVSSQBmaWxlOi8vL2hvbWUvd3d3cm9vdC9zaXRlL3d3dy5lYXN5aWNvbi5uZXQvY2RuLWltZy5lYXN5aWNvbi5jbi9zcmMvMTExNTkvMTExNTkzNy5wbmeOkn0GAAAAAElFTkSuQmCC" alt="" style="vertical-align:middle"/>' +
'</div>' +
'<div id="luckysheet-functionbox-container" class="luckysheet-mousedown-cancel">' +
'<div class="luckysheet-mousedown-cancel" dir="ltr">' +
'<div spellcheck="false" aria-hidden="false" id="luckysheet-functionbox">' +
'<div id="luckysheet-functionbox-cell" class="luckysheet-functionbox-cell-input luckysheet-mousedown-cancel" tabindex="0" contenteditable="true" dir="ltr" aria-autocomplete="list" aria-label="D4"></div>' +
'</div>' +
'</div>' +
'</div>' +
'</div>' +
'</div>' +
'<div class="luckysheet-grid-container luckysheet-scrollbars-enabled">' +
'<div class="luckysheet-grid-window">' +
'<div class="luckysheet-help-sub"></div>' +
'<div class="luckysheet-grid-window-1" id="luckysheet-grid-window-1">' +
'<canvas id="luckysheetTableContent" class="luckysheetTableContent"></canvas>' +
'<table class="luckysheet-grid-window-2" cellspacing="0" cellpadding="0" dir="ltr" tabindex="-1" >' +
'<tbody>' +
'<tr>' +
'<td valign="top" class="luckysheet-paneswrapper">' +
'<div class="luckysheet-left-top" id="luckysheet-left-top"> </div>' +
'</td>' +
'<td valign="top" class="luckysheet-paneswrapper">' +
'<div id="luckysheet-cols-h-c" class="luckysheet-cols-h-c">' +
'<div class="luckysheet-cols-change-size" id="luckysheet-cols-change-size"></div>' +
'<div class="luckysheet-cols-menu-btn luckysheet-mousedown-cancel" id="luckysheet-cols-menu-btn"><i class="fa fa-caret-down luckysheet-mousedown-cancel" aria-hidden="true"></i></div>' +
'<div class="luckysheet-cols-h-hover" id="luckysheet-cols-h-hover"></div>' +
'<div id="luckysheet-cols-h-selected"></div>' +
'<div class="luckysheet-grdusedrange"></div>' +
'<div class="luckysheet-grdblkflowpush"></div> ${columnHeader}' +
'</div>' +
'</td>' +
'</tr>' +
'<tr>' +
'<td valign="top" class="luckysheet-paneswrapper">' +
'<div class="luckysheet-rows-h" id="luckysheet-rows-h">' +
'<div class="luckysheet-rows-change-size" id="luckysheet-rows-change-size"></div>' +
'<div class="luckysheet-rows-h-hover" id="luckysheet-rows-h-hover"></div>' +
'<div id="luckysheet-rows-h-selected"></div>' +
'<div class="luckysheet-grdusedrange"></div>' +
'<div class="luckysheet-grdblkflowpush"></div> ${rowHeader}' +
'</div>' +
'</td>' +
'<td valign="top" class="luckysheet-paneswrapper">' +
'<div class="luckysheet-cell-loading" id="luckysheet-cell-loading">' +
'<div class="luckysheet-cell-loading-inner">' +
'<i class="fa fa-circle-o-notch fa-spin"></i>' +
'<span></span>' +
'</div>' +
'</div>' +
'<div class="luckysheet-cell-freezen"></div>' +
'<div class="luckysheet-scrollbars luckysheet-scrollbar-ltr luckysheet-scrollbar-x" id="luckysheet-scrollbar-x"><div></div></div>' +
'<div class="luckysheet-scrollbars luckysheet-scrollbar-ltr luckysheet-scrollbar-y" id="luckysheet-scrollbar-y"><div></div></div>' +
'<div class="luckysheet-cell-main " id="luckysheet-cell-main">' +
'<div id="luckysheet-formula-functionrange"></div>' +
'<div id="luckysheet-formula-functionrange-select" class="luckysheet-selection-copy luckysheet-formula-functionrange-select">' +
'<div class="luckysheet-selection-copy-top luckysheet-copy"></div>' +
'<div class="luckysheet-selection-copy-right luckysheet-copy"></div>' +
'<div class="luckysheet-selection-copy-bottom luckysheet-copy"></div>' +
'<div class="luckysheet-selection-copy-left luckysheet-copy"></div>' +
'<div class="luckysheet-selection-copy-hc"></div>' +
'</div>' +
'<div class="luckysheet-row-count-show luckysheet-count-show" id="luckysheet-row-count-show"></div>' +
'<div class="luckysheet-column-count-show luckysheet-count-show" id="luckysheet-column-count-show"></div>' +
'<div class="luckysheet-change-size-line" id="luckysheet-change-size-line"></div>' +
'<div class="luckysheet-cell-selected-focus" id="luckysheet-cell-selected-focus"></div>' +
'<div id="luckysheet-selection-copy"></div>' +
'<div id="luckysheet-chart-rangeShow"></div>' +
'<div class="luckysheet-cell-selected-extend" id="luckysheet-cell-selected-extend"></div>' +
'<div class="luckysheet-cell-selected-move" id="luckysheet-cell-selected-move"></div>' +
'<div id="luckysheet-cell-selected-boxs">' +
'<div id="luckysheet-cell-selected" class="luckysheet-cell-selected">' +
'<div class="luckysheet-cs-inner-border"></div>' +
'<div class="luckysheet-cs-fillhandle"></div>' +
'<div class="luckysheet-cs-inner-border"></div>' +
'<div class="luckysheet-cs-draghandle-top luckysheet-cs-draghandle"></div>' +
'<div class="luckysheet-cs-draghandle-bottom luckysheet-cs-draghandle"></div>' +
'<div class="luckysheet-cs-draghandle-left luckysheet-cs-draghandle"></div>' +
'<div class="luckysheet-cs-draghandle-right luckysheet-cs-draghandle"></div>' +
'<div class="luckysheet-cs-touchhandle luckysheet-cs-touchhandle-lt"><div class="luckysheet-cs-touchhandle-btn"></div></div>' +
'<div class="luckysheet-cs-touchhandle luckysheet-cs-touchhandle-rb"><div class="luckysheet-cs-touchhandle-btn"></div></div>' +
'</div>' +
'</div>' +
'<div id="luckysheet-postil-showBoxs"></div>' +
'<div id="luckysheet-multipleRange-show"></div>' +
'<div id="luckysheet-dynamicArray-hightShow"></div>' +
'<div class="luckysheet-cell-copy"></div>' +
'<div class="luckysheet-grdblkflowpush"></div> ${flow}' +
'</div>' +
'</td>' +
'</tr>' +
'</tbody>' +
'</table>' +
'</div>' +
'<div class="luckysheet-sheet-area luckysheet-noselected-text" id="luckysheet-sheet-area">' +
'<div id="luckysheet-sheets-add" class="btn btn-default luckysheet-sheets-add"><i class="fa fa-plus"></i></div>' +
'<div id="luckysheet-sheets-m" class="btn btn-default luckysheet-sheets-m"><i class="fa fa-bars"></i></div>' +
'<div class="luckysheet-sheet-container" id="luckysheet-sheet-container">' +
'<div class="docs-sheet-fade docs-sheet-fade-left" style="display: none;">' +
'<div class="docs-sheet-fade3"></div>' +
'<div class="docs-sheet-fade2"></div>' +
'<div class="docs-sheet-fade1"></div>' +
'</div>' +
'<div class="docs-sheet-fade docs-sheet-fade-right" style="display: none;">' +
'<div class="docs-sheet-fade1"></div>' +
'<div class="docs-sheet-fade2"></div>' +
'<div class="docs-sheet-fade3"></div>' +
'</div>' +
'<div class="luckysheet-sheet-container-c" id="luckysheet-sheet-container-c"></div>' +
'</div>' +
'<div id="luckysheet-sheets-leftscroll" class="btn btn-default luckysheet-sheets-scroll"><i class="fa fa-caret-left"></i></div>' +
'<div id="luckysheet-sheets-rightscroll" class="btn btn-default luckysheet-sheets-scroll"><i class="fa fa-caret-right"></i></div>' +
'</div>' +
'</div>' +
'<div class="luckysheet-stat-area">' +
'<div class="luckysheet-sta-c">' +
'<div class="luckysheet-sta-content" id="luckysheet-sta-content"></div>' +
'<div class="luckysheet-bottom-content" id="luckysheet-bottom-content-show"></div>' +
'</div>' +
'</div>' +
'</div>' +
'<div id="luckysheet-copy-content" contenteditable="true"></div>' +
'<input id="luckysheet-copy-btn" type="button" data-clipboard-target="luckysheet-copy-content">' +
'<div id="testdpidiv" style="height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"></div>' +
'</div>';
return `<div class="luckysheet">
<canvas id="luckysheetTableContentF" style="display:none;" class="luckysheetTableContent"></canvas>
<div class="luckysheet-work-area luckysheet-noselected-text">
<div class="luckysheet-share-logo" title="\${logotitle}"></div>
<div id ="luckysheet_info_detail" class="luckysheet_info_detail">
<div data-tips="${locale_info.return}" id="luckysheet_info_detail_title" class="luckysheet_info_detail_title">
<i style="margin-left: -2px;" class="fa fa-chevron-left" aria-hidden="true"></i>
</div>
<div>
<input data-tips="${locale_info.tips}" id="luckysheet_info_detail_input" class="luckysheet_info_detail_input luckysheet-mousedown-cancel" value="${locale_info.noName}" tabindex="0" dir="ltr" aria-label="${locale_info.rename}" style="visibility: visible; width: 149px;" data-tooltip="${locale_info.rename}">
</div>
<div id="luckysheet_info_detail_update" class="luckysheet_info_detail_update"> ${locale_info.detailUpdate} </div>
<div id="luckysheet_info_detail_save" class="luckysheet_info_detail_save"> ${locale_info.wait} </div>
<div class="luckysheet_info_detail_user"> \${functionButton} <span id="luckysheet_info_detail_user"></span> </div>
</div>
<div id="luckysheet-wa-editor" class="luckysheet-wa-editor"> \${menu} </div>
<div id="luckysheet-wa-calculate" class="luckysheet-wa-calculate">
<div class="luckysheet-wa-calculate-size" id="luckysheet-wa-calculate-size"></div>
<div class="luckysheet-wa-calculate-help">
<div class="luckysheet-wa-calculate-help-box">
<div spellcheck="false" aria-hidden="false" id="luckysheet-helpbox">
<div id="luckysheet-helpbox-cell" class="luckysheet-helpbox-cell-input luckysheet-mousedown-cancel" tabindex="0" contenteditable="true" dir="ltr" aria-autocomplete="list"></div>
</div>
</div>
<div class="luckysheet-wa-calculate-help-tool">
<i class="fa fa-caret-down" aria-hidden="true" style="margin-top: 7px;"></i>
</div>
</div>
<div id="luckysheet-wa-functionbox-cancel" class="luckysheet-wa-functionbox">
<span><i class="fa fa-remove" aria-hidden="true"></i></span>
</div>
<div id="luckysheet-wa-functionbox-confirm" class="luckysheet-wa-functionbox">
<span><i class="fa fa-check" aria-hidden="true"></i></span>
</div>
<div id="luckysheet-wa-functionbox-fx" class="luckysheet-wa-functionbox">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfdBg4KFCeL2MAqAAACOUlEQVRYw+3Wy2+MURjH8U9Hp0VLVTTRUupWqfs9xEpE3ULSsLK0qVg0rJAgiD/A2kpCQkJC0rhEJMJampBSFYle0BYNMUNKTY+F0bi10zFjIZnvuzrPe57fc3mfnPeQI0eO/5+8tHaPVW22cn1aNYlnO5nlzmgzIAiazcm2/FoPBEHMY+2uKcqufKlGQcIt29RYYl6azU3JLh8E99VkuzHfKHZekHDw38hT5Zmg17L0XSMj2jVXGTq9+lcBZilAp1j6AfKHfVtmh1IDauWjQoPPIp64IpF+qD+xSKfw23PV6GxV0KdFHJWKJLwQR0SbgezkT1SFSivcE3SrM9U005WlIzF8Bf1eokAUMQ89T9oLjdWfPOwixssT1/9niZFMUakJ+Kg3uV7olKtOm4kx6jU6qzqTRq33VnBHIahy0z0dgmPy7NGjx23ThnIeSQUTlKA7OZrjNNvtHNaoc8hFm+33MpMK9giCU4PJFGKrz7o8dVnF8M6pK4iYDLoGh/MT2jw32TuHU+WeOkC+KQi/CPXqwA2PUueXigIz8UnnT9b5ZmF68sNnFKBEFbq9/sFW7bioLxYpzjzAamV4pAtElahwQtQRb1WaZ4rtxqVUGZLv/7IDyfVGl1zXbpOJmgTnXXBXZfrCk9RabKmTYoIWc5P2o2La1RslYr8OPe5a9zeZ7/TGMx0Sgvf2Dt4hamyxMnmCFVllgxl/15oGcUHwRYt9mdyBhrrdlFtgtkIvNGvN3vmfI0eO/5Ov+PeiZHME+tcAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTYtMDktMTdUMTU6MTk6MDcrMDg6MDARPBuqAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDEzLTA2LTE0VDEwOjIwOjM5KzA4OjAw59f0jAAAAE10RVh0c29mdHdhcmUASW1hZ2VNYWdpY2sgNy4wLjEtNiBRMTYgeDg2XzY0IDIwMTYtMDktMTcgaHR0cDovL3d3dy5pbWFnZW1hZ2ljay5vcmfd2aVOAAAAGHRFWHRUaHVtYjo6RG9jdW1lbnQ6OlBhZ2VzADGn/7svAAAAF3RFWHRUaHVtYjo6SW1hZ2U6OkhlaWdodAA3Nkv1+ekAAAAWdEVYdFRodW1iOjpJbWFnZTo6V2lkdGgANzazWjlkAAAAGXRFWHRUaHVtYjo6TWltZXR5cGUAaW1hZ2UvcG5nP7JWTgAAABd0RVh0VGh1bWI6Ok1UaW1lADEzNzExNzY0MzntxStTAAAAEHRFWHRUaHVtYjo6U2l6ZQA5OTdClByG1AAAAF90RVh0VGh1bWI6OlVSSQBmaWxlOi8vL2hvbWUvd3d3cm9vdC9zaXRlL3d3dy5lYXN5aWNvbi5uZXQvY2RuLWltZy5lYXN5aWNvbi5jbi9zcmMvMTExNTkvMTExNTkzNy5wbmeOkn0GAAAAAElFTkSuQmCC" alt="" style="vertical-align:middle"/>
</div>
<div id="luckysheet-functionbox-container" class="luckysheet-mousedown-cancel">
<div class="luckysheet-mousedown-cancel" dir="ltr">
<div spellcheck="false" aria-hidden="false" id="luckysheet-functionbox">
<div id="luckysheet-functionbox-cell" class="luckysheet-functionbox-cell-input luckysheet-mousedown-cancel" tabindex="0" contenteditable="true" dir="ltr" aria-autocomplete="list" aria-label="D4"></div>
</div>
</div>
</div>
</div>
</div>
<div class="luckysheet-grid-container luckysheet-scrollbars-enabled">
<div class="luckysheet-grid-window">
<div class="luckysheet-help-sub"></div>
<div class="luckysheet-grid-window-1" id="luckysheet-grid-window-1">
<canvas id="luckysheetTableContent" class="luckysheetTableContent"></canvas>
<table class="luckysheet-grid-window-2" cellspacing="0" cellpadding="0" dir="ltr" tabindex="-1" >
<tbody>
<tr>
<td valign="top" class="luckysheet-paneswrapper">
<div class="luckysheet-left-top" id="luckysheet-left-top"> </div>
</td>
<td valign="top" class="luckysheet-paneswrapper">
<div id="luckysheet-cols-h-c" class="luckysheet-cols-h-c">
<div class="luckysheet-cols-change-size" id="luckysheet-cols-change-size"></div>
<div class="luckysheet-cols-menu-btn luckysheet-mousedown-cancel" id="luckysheet-cols-menu-btn"><i class="fa fa-caret-down luckysheet-mousedown-cancel" aria-hidden="true"></i></div>
<div class="luckysheet-cols-h-hover" id="luckysheet-cols-h-hover"></div>
<div id="luckysheet-cols-h-selected"></div>
<div class="luckysheet-grdusedrange"></div>
<div class="luckysheet-grdblkflowpush"></div> \${columnHeader}
</div>
</td>
</tr>
<tr>
<td valign="top" class="luckysheet-paneswrapper">
<div class="luckysheet-rows-h" id="luckysheet-rows-h">
<div class="luckysheet-rows-change-size" id="luckysheet-rows-change-size"></div>
<div class="luckysheet-rows-h-hover" id="luckysheet-rows-h-hover"></div>
<div id="luckysheet-rows-h-selected"></div>
<div class="luckysheet-grdusedrange"></div>
<div class="luckysheet-grdblkflowpush"></div> \${rowHeader}
</div>
</td>
<td valign="top" class="luckysheet-paneswrapper">
<div class="luckysheet-cell-loading" id="luckysheet-cell-loading">
<div class="luckysheet-cell-loading-inner">
<i class="fa fa-circle-o-notch fa-spin"></i>
<span></span>
</div>
</div>
<div class="luckysheet-cell-freezen"></div>
<div class="luckysheet-scrollbars luckysheet-scrollbar-ltr luckysheet-scrollbar-x" id="luckysheet-scrollbar-x"><div></div></div>
<div class="luckysheet-scrollbars luckysheet-scrollbar-ltr luckysheet-scrollbar-y" id="luckysheet-scrollbar-y"><div></div></div>
<div class="luckysheet-cell-main " id="luckysheet-cell-main">
<div id="luckysheet-formula-functionrange"></div>
<div id="luckysheet-formula-functionrange-select" class="luckysheet-selection-copy luckysheet-formula-functionrange-select">
<div class="luckysheet-selection-copy-top luckysheet-copy"></div>
<div class="luckysheet-selection-copy-right luckysheet-copy"></div>
<div class="luckysheet-selection-copy-bottom luckysheet-copy"></div>
<div class="luckysheet-selection-copy-left luckysheet-copy"></div>
<div class="luckysheet-selection-copy-hc"></div>
</div>
<div class="luckysheet-row-count-show luckysheet-count-show" id="luckysheet-row-count-show"></div>
<div class="luckysheet-column-count-show luckysheet-count-show" id="luckysheet-column-count-show"></div>
<div class="luckysheet-change-size-line" id="luckysheet-change-size-line"></div>
<div class="luckysheet-cell-selected-focus" id="luckysheet-cell-selected-focus"></div>
<div id="luckysheet-selection-copy"></div>
<div id="luckysheet-chart-rangeShow"></div>
<div class="luckysheet-cell-selected-extend" id="luckysheet-cell-selected-extend"></div>
<div class="luckysheet-cell-selected-move" id="luckysheet-cell-selected-move"></div>
<div id="luckysheet-cell-selected-boxs">
<div id="luckysheet-cell-selected" class="luckysheet-cell-selected">
<div class="luckysheet-cs-inner-border"></div>
<div class="luckysheet-cs-fillhandle"></div>
<div class="luckysheet-cs-inner-border"></div>
<div class="luckysheet-cs-draghandle-top luckysheet-cs-draghandle"></div>
<div class="luckysheet-cs-draghandle-bottom luckysheet-cs-draghandle"></div>
<div class="luckysheet-cs-draghandle-left luckysheet-cs-draghandle"></div>
<div class="luckysheet-cs-draghandle-right luckysheet-cs-draghandle"></div>
<div class="luckysheet-cs-touchhandle luckysheet-cs-touchhandle-lt"><div class="luckysheet-cs-touchhandle-btn"></div></div>
<div class="luckysheet-cs-touchhandle luckysheet-cs-touchhandle-rb"><div class="luckysheet-cs-touchhandle-btn"></div></div>
</div>
</div>
<div id="luckysheet-postil-showBoxs"></div>
<div id="luckysheet-multipleRange-show"></div>
<div id="luckysheet-dynamicArray-hightShow"></div>
<div class="luckysheet-cell-copy"></div>
<div class="luckysheet-grdblkflowpush"></div> \${flow}
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="luckysheet-sheet-area luckysheet-noselected-text" id="luckysheet-sheet-area">
<div id="luckysheet-sheets-add" class="btn btn-default luckysheet-sheets-add"><i class="fa fa-plus"></i></div>
<div id="luckysheet-sheets-m" class="btn btn-default luckysheet-sheets-m"><i class="fa fa-bars"></i></div>
<div class="luckysheet-sheet-container" id="luckysheet-sheet-container">
<div class="docs-sheet-fade docs-sheet-fade-left" style="display: none;">
<div class="docs-sheet-fade3"></div>
<div class="docs-sheet-fade2"></div>
<div class="docs-sheet-fade1"></div>
</div>
<div class="docs-sheet-fade docs-sheet-fade-right" style="display: none;">
<div class="docs-sheet-fade1"></div>
<div class="docs-sheet-fade2"></div>
<div class="docs-sheet-fade3"></div>
</div>
<div class="luckysheet-sheet-container-c" id="luckysheet-sheet-container-c"></div>
</div>
<div id="luckysheet-sheets-leftscroll" class="btn btn-default luckysheet-sheets-scroll"><i class="fa fa-caret-left"></i></div>
<div id="luckysheet-sheets-rightscroll" class="btn btn-default luckysheet-sheets-scroll"><i class="fa fa-caret-right"></i></div>
</div>
</div>
<div class="luckysheet-stat-area">
<div class="luckysheet-sta-c">
<div class="luckysheet-zoom-content" id="uckysheet-zoom-content">
<div class="luckysheet-zoom-minus" id="luckysheet-zoom-minus">
<div class="luckysheet-zoom-minus-icon"></div>
</div>
<div class="luckysheet-zoom-slider" id="luckysheet-zoom-slider">
<div class="luckysheet-zoom-line"></div>
<div class="luckysheet-zoom-cursor" id="luckysheet-zoom-cursor"></div>
<div class="luckysheet-zoom-hundred"></div>
</div>
<div class="luckysheet-zoom-plus" id="luckysheet-zoom-plus">
<div class="luckysheet-zoom-plus-icon"></div>
</div>
<div class="luckysheet-zoom-ratioText" id="luckysheet-zoom-ratioText">100%</div>
</div>
<div class="luckysheet-sta-content" id="luckysheet-sta-content"></div>
<div class="luckysheet-bottom-content" id="luckysheet-bottom-content-show"></div>
</div>
</div>
</div>
<div id="luckysheet-copy-content" contenteditable="true"></div>
<input id="luckysheet-copy-btn" type="button" data-clipboard-target="luckysheet-copy-content">
<div id="testdpidiv" style="height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"></div>
</div>`;
}
const columeHeader_word = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],

28
src/controllers/handler.js

@ -135,17 +135,17 @@ export default function luckysheetHandler() {
let scrollNum = event.deltaFactor<40?1:(event.deltaFactor<80?2:3);
//一次滚动三行或三列
if(event.deltaY != 0){
let row_ed;
let row_ed,step=Math.round(scrollNum/Store.zoomRatio);
step = step<1?1:step;
if(event.deltaY < 0){
row_ed = row_st + scrollNum;
row_ed = row_st + step;
if(row_ed >= visibledatarow_c.length){
row_ed = visibledatarow_c.length - 1;
}
}
else{
row_ed = row_st - scrollNum;
row_ed = row_st - step;
if(row_ed < 0){
row_ed = 0;
@ -161,23 +161,23 @@ export default function luckysheetHandler() {
// if((isMac && event.deltaX >0 ) || (!isMac && event.deltaX < 0)){
if(event.deltaX >0){
col_ed = col_st + scrollNum;
scrollLeft = scrollLeft + 20*Store.zoomRatio;
if(col_ed >= visibledatacolumn_c.length){
col_ed = visibledatacolumn_c.length - 1;
}
// if(col_ed >= visibledatacolumn_c.length){
// col_ed = visibledatacolumn_c.length - 1;
// }
}
else{
col_ed = col_st - scrollNum;
scrollLeft = scrollLeft - 20*Store.zoomRatio;
if(col_ed < 0){
col_ed = 0;
}
// if(col_ed < 0){
// col_ed = 0;
// }
}
colscroll = col_ed == 0 ? 0 : visibledatacolumn_c[col_ed - 1];
// colscroll = col_ed == 0 ? 0 : visibledatacolumn_c[col_ed - 1];
$("#luckysheet-scrollbar-x").scrollLeft(colscroll);
$("#luckysheet-scrollbar-x").scrollLeft(scrollLeft);
}
});

95
src/controllers/resize.js

@ -63,47 +63,8 @@ export default function luckysheetsizeauto(isRefreshCanvas=true) {
$("#" + Store.container).find(".luckysheet").height(gridH - 2).width(gridW - 2);
Store.cellmainHeight = gridH - (Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columeHeaderHeight + Store.sheetBarHeight + Store.statisticBarHeight);
Store.cellmainWidth = gridW - Store.rowHeaderWidth;
$("#luckysheet-cols-h-c, #luckysheet-cell-main, #luckysheet-scrollbar-x").width(Store.cellmainWidth);
$("#luckysheet-cell-main").height(Store.cellmainHeight);
$("#luckysheet-rows-h").height(Store.cellmainHeight - Store.cellMainSrollBarSize);
$("#luckysheet-scrollbar-y").height(Store.cellmainHeight + 6);
$("#luckysheet-scrollbar-x").height(Store.cellMainSrollBarSize);
$("#luckysheet-scrollbar-y").width(Store.cellMainSrollBarSize);
Store.luckysheetTableContentHW = [
Store.cellmainWidth + Store.rowHeaderWidth - Store.cellMainSrollBarSize,
Store.cellmainHeight + Store.columeHeaderHeight - Store.cellMainSrollBarSize
];
$("#luckysheetTableContent, #luckysheetTableContentF").attr({
width: Math.ceil(Store.luckysheetTableContentHW[0] * Store.devicePixelRatio),
height: Math.ceil(Store.luckysheetTableContentHW[1] * Store.devicePixelRatio)
})
.css({ width: Store.luckysheetTableContentHW[0], height: Store.luckysheetTableContentHW[1] });
$("#" + Store.container).find("#luckysheet-grid-window-1").css("bottom", Store.sheetBarHeight);
$("#" + Store.container).find(".luckysheet-grid-window").css("bottom", Store.statisticBarHeight);
let gridwidth = $("#luckysheet-grid-window-1").width();
$("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-handle")
.css({ "width": gridwidth - 10 })
.end()
.find(".luckysheet-freezebar-horizontal-drop")
.css({ "width": gridwidth - 10 });
let gridheight = $("#luckysheet-grid-window-1").height();
$("#luckysheet-freezebar-vertical")
.find(".luckysheet-freezebar-vertical-handle")
.css({ "height": gridheight - 10 })
.end()
.find(".luckysheet-freezebar-vertical-drop")
.css({ "height": gridheight - 10 });
changeSheetContainerSize(gridW,gridH)
luckysheetFreezen.createAssistCanvas();
if(isRefreshCanvas){
luckysheetrefreshgrid($("#luckysheet-cell-main").scrollLeft(), $("#luckysheet-cell-main").scrollTop());
}
@ -173,4 +134,58 @@ export default function luckysheetsizeauto(isRefreshCanvas=true) {
sheetmanage.sheetArrowShowAndHide();
sheetmanage.sheetBarShowAndHide();
}
export function changeSheetContainerSize(gridW, gridH){
if(gridW==null){
gridW = $("#" + Store.container).width();
}
if(gridH==null){
gridH = $("#" + Store.container).height();
}
Store.cellmainHeight = gridH - (Store.infobarHeight + Store.toolbarHeight + Store.calculatebarHeight + Store.columeHeaderHeight + 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-x").height(Store.cellMainSrollBarSize);
$("#luckysheet-scrollbar-y").width(Store.cellMainSrollBarSize);
$("#luckysheet-scrollbar-x").width(Store.cellmainWidth).css("left",Store.rowHeaderWidth-1);
Store.luckysheetTableContentHW = [
Store.cellmainWidth + Store.rowHeaderWidth - Store.cellMainSrollBarSize,
Store.cellmainHeight + Store.columeHeaderHeight - Store.cellMainSrollBarSize
];
$("#luckysheetTableContent, #luckysheetTableContentF").attr({
width: Math.ceil(Store.luckysheetTableContentHW[0] * Store.devicePixelRatio),
height: Math.ceil(Store.luckysheetTableContentHW[1] * Store.devicePixelRatio)
})
.css({ width: Store.luckysheetTableContentHW[0], height: Store.luckysheetTableContentHW[1] });
$("#" + Store.container).find("#luckysheet-grid-window-1").css("bottom", Store.sheetBarHeight);
$("#" + Store.container).find(".luckysheet-grid-window").css("bottom", Store.statisticBarHeight);
let gridwidth = $("#luckysheet-grid-window-1").width();
$("#luckysheet-freezebar-horizontal").find(".luckysheet-freezebar-horizontal-handle")
.css({ "width": gridwidth - 10 })
.end()
.find(".luckysheet-freezebar-horizontal-drop")
.css({ "width": gridwidth - 10 });
let gridheight = $("#luckysheet-grid-window-1").height();
$("#luckysheet-freezebar-vertical")
.find(".luckysheet-freezebar-vertical-handle")
.css({ "height": gridheight - 10 })
.end()
.find(".luckysheet-freezebar-vertical-drop")
.css({ "height": gridheight - 10 });
luckysheetFreezen.createAssistCanvas();
}

2
src/controllers/sheetmanage.js

@ -1033,7 +1033,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 - 30);
$("#luckysheet-scrollbar-y div").height(Store.rh_height + Store.columeHeaderHeight-Store.cellMainSrollBarSize-3 );
},
setCurSheet: function(index) {
for (let i = 0; i < Store.luckysheetfile.length; i++) {

152
src/controllers/zoom.js

@ -1,19 +1,151 @@
import Store from '../store';
import locale from '../locale/locale';
import { replaceHtml } from '../utils/util';
import rhchInit from '../global/rhchInit';
import luckysheetConfigsetting from './luckysheetConfigsetting';
import {changeSheetContainerSize} from './resize';
import { jfrefreshgrid_rhcw } from '../global/refresh';
export function zoomChange(ratio){
if(Store.flowdata==null || Store.flowdata.length==0){
return;
}
Store.zoomRatio = ratio;
jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length);
changeSheetContainerSize();
}
export function zoomInitial(){
//zoom
Store.rowHeaderWidth = luckysheetConfigsetting.rowHeaderWidth * Store.zoomRatio;
Store.columeHeaderHeight = luckysheetConfigsetting.columeHeaderHeight *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-zoom-minus").click(function(){
let currentRatio;
if(Store.zoomRatio==null){
currentRatio = Store.zoomRatio = 1;
}
else{
currentRatio = Math.ceil(Store.zoomRatio*10)/10;
}
currentRatio = currentRatio-0.1;
if(currentRatio<=0.1){
currentRatio = 0.1;
}
Store.zoomRatio = currentRatio;
zoomChange(currentRatio);
zoomNumberDomBind(currentRatio);
});
$("#luckysheet-zoom-plus").click(function(){
let currentRatio;
if(Store.zoomRatio==null){
currentRatio = Store.zoomRatio = 1;
}
else{
currentRatio = Math.floor(Store.zoomRatio*10)/10;
}
currentRatio = currentRatio+0.1;
if(currentRatio>=4){
currentRatio = 4;
}
Store.zoomRatio = currentRatio;
zoomChange(currentRatio);
zoomNumberDomBind(currentRatio);
});
$("#luckysheet-zoom-slider").click(function(e){
let xoffset = $(this).offset().left, pageX = e.pageX;
let currentRatio = positionToRatio(pageX-xoffset);
Store.zoomRatio = currentRatio;
zoomChange(currentRatio);
zoomNumberDomBind(currentRatio);
});
$("#luckysheet-zoom-cursor").mousedown(function(e){
let curentX = e.pageX,cursorLeft = parseFloat($("#luckysheet-zoom-cursor").css("left"));
$(document).off("mousemove.zoomCursor").on("mousemove.zoomCursor",function(event){
let moveX = event.pageX;
let offsetX = moveX - curentX;
// console.log(moveX, curentX, offsetX);
// curentX = moveX;
// let left = parseFloat($("#luckysheet-zoom-cursor").css("left"));
let pos = cursorLeft + offsetX;
let currentRatio = positionToRatio(pos);
if(currentRatio>4){
currentRatio =4;
pos = 100;
}
if(currentRatio<0.1){
currentRatio =0.1;
pos = 0;
}
Store.zoomRatio = currentRatio;
zoomChange(currentRatio);
let r = Math.round(currentRatio*100) + "%";
$("#luckysheet-zoom-ratioText").html(r);
$("#luckysheet-zoom-cursor").css("left", pos-4);
});
$(document).off("mouseup.zoomCursor").on("mouseup.zoomCursor",function(event){
$(document).off(".zoomCursor");
});
e.stopPropagation();
}).click(function(e){
e.stopPropagation();
});
$("#luckysheet-zoom-ratioText").click(function(){
Store.zoomRatio = 1;
zoomChange(1);
zoomNumberDomBind(1);
});
zoomNumberDomBind(Store.zoomRatio);
}
export function zoomChange(){
}
function zoomSlierDown(){
}
function positionToRatio(pos){
let ratio = 1;
if(pos<50){
ratio = Math.round((pos*1.8/100 + 0.1)*100)/100;
}
else if(pos>50){
ratio = Math.round(((pos-50)*6/100 + 1)*100)/100;
}
return ratio;
}
function zoomSlierDomBind(ratio){
let domPos = 50;
if(ratio<1){
domPos = Math.round((ratio - 0.1)*100 / 0.18)/10;
}
else if(ratio>1){
domPos = Math.round((ratio - 1)*100 / 0.6)/10+50;
}
$("#luckysheet-zoom-cursor").css("left", domPos-4);
}
function zoomNumberDomBind(ratio){
let r = Math.round(ratio*100) + "%";
$("#luckysheet-zoom-ratioText").html(r);
zoomSlierDomBind(ratio);
}

2
src/core.js

@ -29,6 +29,7 @@ import { luckysheetlodingHTML } from './controllers/constant';
import { getcellvalue, getdatabyselection } from './global/getdata';
import { setcellvalue } from './global/setdata';
import { selectHightlightShow } from './controllers/select';
import {zoomInitial} from './controllers/zoom';
import method from './global/method';
let luckysheet = {};
@ -138,6 +139,7 @@ function initialWorkBook(){
rowColumnOperationInitial();//row and coloumn operate initialization
keyboardInitial();//Keyboard operate initialization
orderByInitial();//menu bar orderby function initialization
zoomInitial();//zoom method initialization
}
//获取所有表格数据

7
src/css/luckysheet-core.css

@ -940,11 +940,12 @@
}
.luckysheet-sta-c .luckysheet-sta-content {
position: relative;
position: absolute;
left: 0px;
right: 220px;
height: 22px;
line-height: 22px;
text-align: right;
padding-right: 10px;
white-space: nowrap;
overflow: hidden;
}
@ -1686,7 +1687,7 @@ body:not(.ewa-ipad) .luckysheet-cols-h-cell-nosel:hover, body:not(.ewa-ipad) .lu
height: 30px;
/*width: 400px;*/
/* background: #000; */
bottom: 68px;
bottom: 38px;
left: 0px;
z-index: 1000;
}

113
src/css/luckysheet-zoom.css

@ -0,0 +1,113 @@
.luckysheet-zoom-content{
position: absolute;
width:210px;
right: 0px;
height: 22px;
line-height: 22px;
text-align: right;
padding-right: 10px;
white-space: nowrap;
overflow: hidden;
display: flex;
align-items: center;
user-select: none;
}
.luckysheet-zoom-content .luckysheet-zoom-minus{
position: absolute;
left: 0px;
width: 20px;
height:20px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.luckysheet-zoom-content .luckysheet-zoom-minus-icon{
background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTRweCIgaGVpZ2h0PSIycHgiIHZpZXdCb3g9IjAgMCAxNCAyIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA2MyAoOTI0NDUpIC0gaHR0cHM6Ly9za2V0Y2guY29tIC0tPgogICAgPHRpdGxlPnJpcWlxdWppYW7lpIfku70gNDU8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZyBpZD0iMjAyMC8wOC8xNCIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IueUu+adv+Wkh+S7vS0yIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcwNC4wMDAwMDAsIC0xMDY0LjAwMDAwMCkiIGZpbGw9IiM0NDRENUEiPgogICAgICAgICAgICA8ZyBpZD0icmlxaXF1amlhbuWkh+S7vS0xMjYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE2OTkuMDAwMDAwLCAxMDUzLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPGcgaWQ9Iue8lue7hCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNS4wMDAwMDAsIDExLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIHg9IjAiIHk9IjAiIHdpZHRoPSIxNCIgaGVpZ2h0PSIyIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==');
width: 14px;
height: 2px;
}
.luckysheet-zoom-content .luckysheet-zoom-minus:hover{
background-color: #E1E4E8;
}
.luckysheet-zoom-content .luckysheet-zoom-slider{
position: absolute;
left: 25px;
width: 100px;
height: 100%;
display: flex;
align-items: center;
}
.luckysheet-zoom-content .luckysheet-zoom-slider .luckysheet-zoom-line{
position: absolute;
width: 100px;
height: 2px;
background: #E1E4E8;
}
.luckysheet-zoom-content .luckysheet-zoom-slider .luckysheet-zoom-cursor{
position: absolute;
width: 8px;
height: 8px;
border-radius: 8px;
background: #B5BDB8;
cursor: pointer;
z-index: 2;
transition: all 0.3s;
}
.luckysheet-zoom-content .luckysheet-zoom-slider .luckysheet-zoom-cursor:hover{
transform: scale(1.2);
transform-origin: center center;
background: rgb(160, 160, 160);
}
.luckysheet-zoom-content .luckysheet-zoom-slider .luckysheet-zoom-hundred{
position: absolute;
width: 2px;
height: 4px;
left: 49px;
background: #1E1E1F;
}
.luckysheet-zoom-content .luckysheet-zoom-plus{
position: absolute;
left: 130px;
width: 20px;
height:20px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.luckysheet-zoom-content .luckysheet-zoom-plus .luckysheet-zoom-plus-icon{
background-image:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTRweCIgaGVpZ2h0PSIxNHB4IiB2aWV3Qm94PSIwIDAgMTQgMTQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYzICg5MjQ0NSkgLSBodHRwczovL3NrZXRjaC5jb20gLS0+CiAgICA8dGl0bGU+cmlxaXF1amlhbuWkh+S7vSA0NjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxnIGlkPSIyMDIwLzA4LzE0IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0i55S75p2/5aSH5Lu9LTIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xODQ4LjAwMDAwMCwgLTEwNTguMDAwMDAwKSIgZmlsbD0iIzQ0NEQ1QSI+CiAgICAgICAgICAgIDxnIGlkPSJyaXFpcXVqaWFu5aSH5Lu9LTExOSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTg0My4wMDAwMDAsIDEwNTMuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8ZyBpZD0i57yW57uEIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1LjAwMDAwMCwgNS4wMDAwMDApIj4KICAgICAgICAgICAgICAgICAgICA8cmVjdCBpZD0i55+p5b2iIiB4PSIwIiB5PSI2IiB3aWR0aD0iMTQiIGhlaWdodD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70iIHRyYW5zZm9ybT0idHJhbnNsYXRlKDcuMDAwMDAwLCA3LjAwMDAwMCkgcm90YXRlKC0yNzAuMDAwMDAwKSB0cmFuc2xhdGUoLTcuMDAwMDAwLCAtNy4wMDAwMDApICIgeD0iMCIgeT0iNiIgd2lkdGg9IjE0IiBoZWlnaHQ9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+');
width: 14px;
height: 14px;
}
.luckysheet-zoom-content .luckysheet-zoom-plus:hover{
background-color: #E1E4E8;
}
.luckysheet-zoom-content .luckysheet-zoom-ratioText{
position: absolute;
left: 155px;
width: 60px;
color: #1E1E1F;
font-size: 12px;
text-align: left;
cursor: pointer;
}
.luckysheet-zoom-content .luckysheet-zoom-ratioText:hover{
background-color: #E1E4E8;
}

20
src/global/rhchInit.js

@ -1,8 +1,8 @@
import Store from '../store';
import {zoomInitial} from '../controllers/zoom';
import luckysheetConfigsetting from '../controllers/luckysheetConfigsetting';
export default function rhchInit(rowheight, colwidth) {
zoomInitial();//Zoom sheet on first load
zoomSetting();//Zoom sheet on first load
//行高
if(rowheight != null){
Store.visibledatarow = [];
@ -21,13 +21,13 @@ export default function rhchInit(rowheight, colwidth) {
continue;
}
else {
Store.rh_height += Math.round(rowlen*Store.zoomRatio) + 1;
Store.rh_height += Math.round((rowlen + 1)*Store.zoomRatio);
}
Store.visibledatarow.push(Store.rh_height); //行的临时长度分布
}
Store.rh_height += 110; //最底部增加空白
Store.rh_height += 80; //最底部增加空白
}
//列宽
@ -62,7 +62,7 @@ export default function rhchInit(rowheight, colwidth) {
}
}
Store.ch_width += Math.round(firstcolumnlen*Store.zoomRatio) + 1;
Store.ch_width += Math.round((firstcolumnlen + 1)*Store.zoomRatio);
Store.visibledatacolumn.push(Store.ch_width);//列的临时长度分布
@ -74,4 +74,14 @@ export default function rhchInit(rowheight, colwidth) {
// Store.ch_width += 120;
Store.ch_width += maxColumnlen;
}
}
export function zoomSetting(){
//zoom
Store.rowHeaderWidth = luckysheetConfigsetting.rowHeaderWidth * Store.zoomRatio;
Store.columeHeaderHeight = luckysheetConfigsetting.columeHeaderHeight *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});
}
Loading…
Cancel
Save