Browse Source

docs(index.html): index.html

index.html
master
liurunze 5 years ago
parent
commit
817c194b9d
  1. 54
      src/controllers/handler.js
  2. 2
      src/controllers/ifFormulaGenerator.js
  3. 3
      src/controllers/locationCell.js
  4. 38
      src/controllers/matrixOperation.js
  5. 63
      src/controllers/menuButton.js
  6. 2
      src/controllers/mobile.js
  7. 29
      src/controllers/rowColumnOperation.js
  8. 5
      src/controllers/selection.js
  9. 8
      src/controllers/splitColumn.js
  10. 23
      src/global/scroll.js
  11. 2
      src/index.html
  12. 2
      src/locale/zh.js
  13. 10
      src/utils/util.js

54
src/controllers/handler.js

@ -20,6 +20,7 @@ import { selectHightlightShow, selectIsOverlap, selectionCopyShow, luckysheet_co
import selection from './selection';
import controlHistory from './controlHistory';
import splitColumn from './splitColumn';
import { luckysheetdefaultstyle } from './constant';
import {
replaceHtml,
@ -28,6 +29,7 @@ import {
ArrayUnique,
showrightclickmenu,
luckysheetactiveCell,
luckysheetContainerFocus,
} from '../utils/util';
import { getSheetIndex, getRangetxt } from '../methods/get';
import {
@ -867,7 +869,7 @@ export default function luckysheetHandler() {
//数据透视表
pivotTable.pivotclick(row_index, col_index, Store.currentSheetIndex);
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
//$("#luckysheet-cols-h-c .luckysheet-cols-h-cells-c .luckysheet-cols-h-cells-clip .luckysheet-cols-h-cell-sel").removeClass("luckysheet-cols-h-cell-sel").addClass("luckysheet-cols-h-cell-nosel");
@ -3074,7 +3076,7 @@ export default function luckysheetHandler() {
//底部添加行按钮
$("#luckysheet-bottom-add-row").on("click", function (e) {
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), value = $("#luckysheet-bottom-add-row-input").val();
@ -3259,7 +3261,7 @@ export default function luckysheetHandler() {
return;
}
//复制范围内包含部分合并单元格,提示
//截图范围内包含部分合并单元格,提示
if (Store.config["merge"] != null) {
let has_PartMC = false;
@ -3292,14 +3294,6 @@ export default function luckysheetHandler() {
let st_c = Store.luckysheet_select_save[0].column[0],
ed_c = Store.luckysheet_select_save[0].column[1];
let shotData = datagridgrowth([], ed_r + 1, ed_c + 1);
for (let r = st_r; r <= ed_r; r++) {
for (let c = st_c; c <= ed_c; c++) {
shotData[r][c] = Store.flowdata[r][c];
}
}
let scrollHeight, rh_height;
if (st_r - 1 < 0) {
scrollHeight = 0;
@ -3325,13 +3319,37 @@ export default function luckysheetHandler() {
height: Math.ceil(rh_height * devicePixelRatio)
}).css({ width: ch_width, height: rh_height });
let d = Store.flowdata;
Store.flowdata = shotData;
luckysheetDrawMain(scrollWidth, scrollHeight, ch_width, rh_height, 1, 1, null, null, newCanvas);
Store.flowdata = d;
editor.webWorkerFlowDataCache(Store.flowdata);//worker存数据
let ctx_newCanvas = newCanvas.get(0).getContext("2d");
//补上 左边框和上边框
ctx_newCanvas.beginPath();
ctx_newCanvas.moveTo(
0,
0
);
ctx_newCanvas.lineTo(
0,
Store.devicePixelRatio * rh_height
);
ctx_newCanvas.lineWidth = Store.devicePixelRatio * 2;
ctx_newCanvas.strokeStyle = luckysheetdefaultstyle.strokeStyle;
ctx_newCanvas.stroke();
ctx_newCanvas.closePath();
ctx_newCanvas.beginPath();
ctx_newCanvas.moveTo(
0,
0
);
ctx_newCanvas.lineTo(
Store.devicePixelRatio * ch_width,
0
);
ctx_newCanvas.lineWidth = Store.devicePixelRatio * 2;
ctx_newCanvas.strokeStyle = luckysheetdefaultstyle.strokeStyle;
ctx_newCanvas.stroke();
ctx_newCanvas.closePath();
let image = new Image();
let url = newCanvas.get(0).toDataURL("image/png");
@ -3549,7 +3567,7 @@ export default function luckysheetHandler() {
luckysheetMoveHighlightCell("down", 0, "rangeOfSelect");
}
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
});

2
src/controllers/ifFormulaGenerator.js

@ -472,6 +472,8 @@ const ifFormulaGenerator = {
$("#luckysheet-ifFormulaGenerator-multiRange-dialog").css({ "left": (winw + scrollLeft - myw) / 2, "top": (winh + scrollTop - myh) / 3 }).show();
},
getIfList: function(compareValue, smallRange, largeRange, method, methodVal){
const locale_formula = locale().formula;
$("#luckysheet-ifFormulaGenerator-dialog .ifList").empty();
smallRange = parseInt(smallRange);

3
src/controllers/locationCell.js

@ -108,6 +108,8 @@ const luckysheetLocationCell = {
init: function(){
let _this = this;
const locale_location = locale().findAndReplace;
$(document).on("click", "#luckysheet-locationCell-dialog .listItem input:radio", function(e){
$("#luckysheet-locationCell-dialog .listItem input:checkbox").prop("disabled", true);
$("#luckysheet-locationCell-dialog .listItem .subbox label").css("color", "#666");
@ -213,6 +215,7 @@ const luckysheetLocationCell = {
});
},
apply: function(range, type, value){
const locale_location = locale().findAndReplace;
let rangeArr = [];
if(type == "locationFormula" || type == "locationConstant" || type == "locationNull"){ //公式 常量 空值

38
src/controllers/matrixOperation.js

@ -1,6 +1,6 @@
import selection from './selection';
import {
numFormat,
numFormat,luckysheetContainerFocus,
} from '../utils/util';
import { hasPartMC, isEditMode } from '../global/validate';
import { getdatabyselection, getcellvalue } from '../global/getdata';
@ -13,7 +13,7 @@ export function initialMatrixOperation(){
//复制为json格式字符串,首行为标题
$("#luckysheet-copy-json-head").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -86,7 +86,7 @@ export function initialMatrixOperation(){
//复制为json格式字符串,无标题,采用ABCD作为标题
$("#luckysheet-copy-json-nohead").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
@ -147,7 +147,7 @@ export function initialMatrixOperation(){
//复制为一维数组
$("#luckysheet-copy-array1").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -204,7 +204,7 @@ export function initialMatrixOperation(){
//复制为二维数组
$("#luckysheet-copy-array2").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
@ -383,7 +383,7 @@ export function initialMatrixOperation(){
//复制为对角线
$("#luckysheet-copy-diagonal").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -443,7 +443,7 @@ export function initialMatrixOperation(){
//复制为反对角线
$("#luckysheet-copy-antidiagonal").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
@ -504,7 +504,7 @@ export function initialMatrixOperation(){
//复制为对角偏移n列
$("#luckysheet-copy-diagonaloffset").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -590,7 +590,7 @@ export function initialMatrixOperation(){
//复制为布尔值
$("#luckysheet-copy-boolvalue").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
@ -671,7 +671,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 翻转 上下
$("#luckysheet-matrix-turn-up").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -707,7 +707,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 翻转 左右
$("#luckysheet-matrix-turn-left").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -743,7 +743,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 翻转 顺时针
$("#luckysheet-matrix-turn-cw").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -779,7 +779,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 翻转 逆时针
$("#luckysheet-matrix-turn-anticw").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -815,7 +815,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 转置
$("#luckysheet-matrix-turn-trans").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -864,7 +864,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 矩阵计算
$("#luckysheet-matrix-cal-confirm").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -957,7 +957,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 删除两端0值 按行
$("#luckysheet-matrix-delezero-row").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -1025,7 +1025,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 删除两端0值 按列
$("#luckysheet-matrix-delezero-column").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -1106,7 +1106,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 删除重复值 按行
$("#luckysheet-matrix-delerpt-row").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -1167,7 +1167,7 @@ export function initialMatrixOperation(){
//矩阵操作选区 删除重复值 按列
$("#luckysheet-matrix-delerpt-column").click(function (event) {
$("body .luckysheet-cols-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){

63
src/controllers/menuButton.js

@ -29,7 +29,7 @@ import { setcellvalue } from '../global/setdata';
import { countfunc } from '../global/count';
import { getSheetIndex, getRangetxt, getluckysheetfile } from '../methods/get';
import { setluckysheetfile } from '../methods/set';
import { replaceHtml, getObjType, rgbTohex, mouseclickposition, luckysheetfontformat } from '../utils/util';
import { replaceHtml, getObjType, rgbTohex, mouseclickposition, luckysheetfontformat,luckysheetContainerFocus } from '../utils/util';
import Store from '../store';
import locale from '../locale/locale';
import { connect } from 'tls';
@ -418,7 +418,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
@ -436,7 +436,7 @@ const menuButton = {
$("#luckysheet-icon-fmtOtherSelf-menuButton").find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#luckysheet-icon-fmtOtherSelf-menuButton").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let itemvalue = $(this).attr("itemvalue");
@ -482,7 +482,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue"), itemname = $t.attr("itemname");
_this.focus($menuButton, itemvalue);
@ -581,13 +581,13 @@ const menuButton = {
_this.updateFormat(d, "fc", color);
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
},
});
$menuButton.find(".luckysheet-color-reset").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $input = $("#"+ menuButtonId).find(".luckysheet-color-selected");
$input.val("#000000");
@ -602,7 +602,7 @@ const menuButton = {
//交替颜色
$menuButton.find(".luckysheet-icon-alternateformat").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -719,13 +719,13 @@ const menuButton = {
_this.updateFormat(d, "bg", color);
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
}
});
$menuButton.find(".luckysheet-color-reset").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $input = $("#" + menuButtonId).find(".luckysheet-color-selected");
$input.val("#ffffff");
@ -740,7 +740,7 @@ const menuButton = {
//交替颜色
$menuButton.find(".luckysheet-icon-alternateformat").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -819,7 +819,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue"), $input = $("#luckysheet-icon-font-size input");
$("#luckysheet-icon-font-size").attr("itemvalue", itemvalue);
@ -1020,7 +1020,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
if(itemvalue == "borderColor" || itemvalue == "borderSize"){
@ -1220,7 +1220,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(selectIsOverlap()){
if(isEditMode()){
@ -1311,7 +1311,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
_this.focus($menuButton, itemvalue);
@ -1367,7 +1367,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
_this.focus($menuButton, itemvalue);
@ -1414,7 +1414,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
_this.focus($menuButton, itemvalue);
@ -1464,7 +1464,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
_this.focus($menuButton, itemvalue);
@ -1516,7 +1516,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
_this.focus($menuButton, itemvalue);
@ -1780,7 +1780,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
@ -1849,7 +1849,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
@ -1977,7 +1977,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
@ -2264,7 +2264,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
@ -2343,7 +2343,7 @@ const menuButton = {
$(document).off("click.CFhighlightCellRule").on("click.CFhighlightCellRule", "#luckysheet-icon-highlightCellRule-menuButton .luckysheet-cols-menuitem", function(){
$menuButton.hide();
$("#luckysheet-icon-highlightCellRule-menuButton").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
@ -2461,7 +2461,7 @@ const menuButton = {
$(document).off("click.CFprojectSelectRule").on("click.CFprojectSelectRule", "#luckysheet-icon-projectSelectRule-menuButton .luckysheet-cols-menuitem", function(){
$menuButton.hide();
$("#luckysheet-icon-projectSelectRule-menuButton").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
@ -2565,7 +2565,7 @@ const menuButton = {
$(document).off("click.CFdataBar").on("click.CFdataBar", "#luckysheet-icon-dataBar-menuButton .luckysheet-cols-menuitem", function(){
$menuButton.hide();
$("#luckysheet-icon-dataBar-menuButton").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
@ -2581,7 +2581,7 @@ const menuButton = {
$(document).off("click.CFcolorGradation").on("click.CFcolorGradation", "#luckysheet-icon-colorGradation-menuButton .luckysheet-cols-menuitem", function(){
$menuButton.hide();
$("#luckysheet-icon-colorGradation-menuButton").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
@ -2597,7 +2597,7 @@ const menuButton = {
$(document).off("click.CFdeleteRule").on("click.CFdeleteRule", "#luckysheet-icon-deleteRule-menuButton .luckysheet-cols-menuitem", function(){
$menuButton.hide();
$("#luckysheet-icon-deleteRule-menuButton").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
@ -2667,7 +2667,7 @@ const menuButton = {
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
@ -2736,8 +2736,10 @@ const menuButton = {
},
getQKBorder: function(width, type, color){
let bordertype = "";
if(width.indexOf("pt") > -1){
let width = parseFloat(width);
width = parseFloat(width);
if(width < 1){
}
@ -2749,7 +2751,8 @@ const menuButton = {
}
}
else{
let width = parseFloat(width);
width = parseFloat(width);
if(width < 2){
}

2
src/controllers/mobile.js

@ -227,7 +227,7 @@ export default function mobileinit(){
$(document).on("touchstart", ".luckysheet-cs-touchhandle", function(event){
luckysheet_touchhandle_status = true;
luckysheet_touchmove_status = false;
console.log(1111111111);
// console.log(1111111111);
event.stopPropagation();
})

29
src/controllers/rowColumnOperation.js

@ -6,7 +6,8 @@ import server from './server';
import { selectHightlightShow, luckysheet_count_show,selectHelpboxFill } from './select';
import {
getObjType,
showrightclickmenu,
showrightclickmenu,
luckysheetContainerFocus,
} from '../utils/util';
import { getSheetIndex, getRangetxt } from '../methods/get';
import {
@ -909,7 +910,7 @@ export function rowColumnOperationInitial(){
//向左增加列,向上增加行
$("#luckysheet-add-lefttop, #luckysheet-add-lefttop_t").click(function (event) {
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -951,7 +952,7 @@ export function rowColumnOperationInitial(){
});
$("#luckysheet-addTopRows").click(function (event) {
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -993,7 +994,7 @@ export function rowColumnOperationInitial(){
})
$("#luckysheet-addLeftCols").click(function (event) {
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -1037,7 +1038,7 @@ export function rowColumnOperationInitial(){
//向右增加列,向下增加行
$("#luckysheet-add-rightbottom, #luckysheet-add-rightbottom_t").click(function (event) {
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -1080,7 +1081,7 @@ export function rowColumnOperationInitial(){
});
$("#luckysheet-addBottomRows").click(function (event) {
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -1123,7 +1124,7 @@ export function rowColumnOperationInitial(){
});
$("#luckysheet-addRightCols").click(function (event) {
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
@ -1168,7 +1169,7 @@ export function rowColumnOperationInitial(){
//删除选中行列
$("#luckysheet-del-selected, #luckysheet-del-selected_t").click(function (event) {
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(Store.luckysheetRightHeadClickIs == "row"){
@ -1196,7 +1197,7 @@ export function rowColumnOperationInitial(){
});
$("#luckysheet-delRows").click(function (event) {
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(Store.luckysheetRightHeadClickIs == "row"){
@ -1224,7 +1225,7 @@ export function rowColumnOperationInitial(){
})
$("#luckysheet-delCols").click(function (event) {
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 1){
if(Store.luckysheetRightHeadClickIs == "row"){
@ -1254,7 +1255,7 @@ export function rowColumnOperationInitial(){
//隐藏、显示行
$("#luckysheet-hidRows").click(function (event) {
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let cfg = $.extend(true, {}, Store.config);
if(cfg["rowhidden"] == null){
@ -1295,7 +1296,7 @@ export function rowColumnOperationInitial(){
})
$("#luckysheet-showHidRows").click(function (event) {
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let cfg = $.extend(true, {}, Store.config);
if(cfg["rowhidden"] == null){
@ -1338,7 +1339,7 @@ export function rowColumnOperationInitial(){
//清除单元格内容
$("#luckysheet-delete-text").click(function(){
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
if(Store.luckysheet_select_save.length > 0){
let d = editor.deepCopyFlowData(Store.flowdata);
@ -1405,7 +1406,7 @@ export function rowColumnOperationInitial(){
//行高列宽设置
$("#luckysheet-rows-cols-changesize").click(function(){
$("#luckysheet-rightclick-menu").hide();
$("#" + Store.container).attr("tabindex", 0).focus();
luckysheetContainerFocus();
let size = parseInt($(this).siblings("input[type='number']").val().trim());

5
src/controllers/selection.js

@ -429,7 +429,7 @@ const selection = {
}
if(c_value == null){
c_value = "";
c_value = " ";
}
column += c_value;
@ -488,7 +488,8 @@ const selection = {
}
}
column = replaceHtml(column, {"style":style, "span":""});
column = replaceHtml(column, {"style": style, "span": ""});
column += " ";
}
column += '</td>';

8
src/controllers/splitColumn.js

@ -249,6 +249,10 @@ const luckysheetSplitColumn = {
value = getcellvalue(r, c, Store.flowdata);
}
if(value == null){
value = "";
}
rowArr = value.toString().split(reg);
dataArr.push(rowArr);
@ -287,6 +291,10 @@ const luckysheetSplitColumn = {
value = getcellvalue(r, c, Store.flowdata);
}
if(value == null){
value = "";
}
rowArr.push(value);
arr.push(rowArr);

23
src/global/scroll.js

@ -19,12 +19,12 @@ export default function luckysheetscrollevent(isadjust) {
let scrollLeft = $("#luckysheet-scrollbar-x").scrollLeft(),
scrollTop = $("#luckysheet-scrollbar-y").scrollTop();
clearTimeout(scrollTimeOutCancel);
// clearTimeout(scrollTimeOutCancel);
scrollTimeOutCancel = setTimeout(() => {
scrollRequestAnimationFrameIni = true;
window.cancelAnimationFrame(scrollRequestAnimationFrame);
}, 500);
// scrollTimeOutCancel = setTimeout(() => {
// scrollRequestAnimationFrameIni = true;
// window.cancelAnimationFrame(scrollRequestAnimationFrame);
// }, 500);
// if (!!isadjust) {
// let scrollHeight = $t.get(0).scrollHeight;
@ -92,13 +92,12 @@ export default function luckysheetscrollevent(isadjust) {
"z-index": $("#luckysheet-input-box").css("z-index")
}).show();
if(scrollRequestAnimationFrameIni && Store.scrollRefreshSwitch){
execScroll();
scrollRequestAnimationFrameIni = false;
}
// window.requestAnimationFrame(()=>{
// luckysheetrefreshgrid(scrollLeft, scrollTop);
// });
// if(scrollRequestAnimationFrameIni && Store.scrollRefreshSwitch){
// execScroll();
// scrollRequestAnimationFrameIni = false;
// }
luckysheetrefreshgrid(scrollLeft, scrollTop);
$("#luckysheet-bottom-controll-row").css("left", scrollLeft + 10);

2
src/index.html

@ -33,7 +33,7 @@
luckysheet.create({
container: 'luckysheet',
lang: 'zh',
lang: 'en',
allowEdit:true,
plugins: ['chart'],
data: [sheetCell,sheetFormula,sheetConditionFormat,sheetTable,sheetSparkline,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart]

2
src/locale/zh.js

@ -584,7 +584,7 @@ export default {
successTip:"已成功复制(如果粘贴失败,请在图片上右键点击'复制图片')",
},
splitText:{
splitSymbol:"分割符号",
splitDelimiters:"分割符号",
splitOther:"其它",
splitContinueSymbol:"连续分隔符号视为单个处理",
splitDataPreview:"数据预览",

10
src/utils/util.js

@ -383,6 +383,13 @@ function luckysheetactiveCell() {
}
}
//单元格编辑聚焦
function luckysheetContainerFocus() {
$("#" + Store.container).attr("tabindex", 0).focus({
preventScroll: true
});
}
//数字格式
function numFormat(num, type) {
if (num == null || isNaN(parseFloat(num)) || hasChinaword(num) || num == -Infinity || num == Infinity) {
@ -638,5 +645,6 @@ export {
$$,
seriesLoadScripts,
parallelLoadScripts,
loadLinks
loadLinks,
luckysheetContainerFocus
}
Loading…
Cancel
Save