Browse Source

fix(bug): bug

bug
master
wpxp123456 5 years ago
parent
commit
726300811a
  1. 16
      src/controllers/filter.js
  2. 1
      src/controllers/handler.js
  3. 66
      src/controllers/rowColumnOperation.js
  4. 69
      src/controllers/sheetmanage.js
  5. 8
      src/global/draw.js
  6. 1
      src/locale/en.js
  7. 1
      src/locale/zh.js

16
src/controllers/filter.js

@ -100,11 +100,13 @@ function orderbydatafiler(str, stc, edr, edc, index, asc) {
}
if(hasMc){
const locale_filter = locale().filter;
if(isEditMode()){
alert("筛选选区有合并单元格,无法执行此操作!");
alert(locale_filter.mergeError);
}
else{
tooltip.info("筛选选区有合并单元格,无法执行此操作!", "");
tooltip.info(locale_filter.mergeError, "");
}
return;
@ -134,13 +136,15 @@ function createFilter() {
if(Store.luckysheet_select_save.length > 1){
$("#luckysheet-rightclick-menu").hide();
$("#luckysheet-filter-menu, #luckysheet-filter-submenu").hide();
$("#" + container).attr("tabindex", 0).focus();
$("#" + Store.container).attr("tabindex", 0).focus();
const locale_splitText = locale().splitText;
if(isEditMode()){
alert("不能对多重选择区域执行此操作,请选择单个区域,然后再试");
alert(locale_splitText.tipNoMulti);
}
else{
tooltip.info("不能对多重选择区域执行此操作,请选择单个区域,然后再试", "");
tooltip.info(locale_splitText.tipNoMulti, "");
}
return;
@ -277,8 +281,6 @@ function createFilterOptions(luckysheet_filter_save, filterObj) {
file.filter_select = luckysheet_filter_save;
}
function initialFilterHandler(){
//filter event handler
let hidefilersubmenu = null;

1
src/controllers/handler.js

@ -185,7 +185,6 @@ export default function luckysheetHandler() {
// setTimeout(function(){
luckysheetscrollevent();
// },10);
})
.mousewheel(function (event, delta) {
event.preventDefault();

66
src/controllers/rowColumnOperation.js

@ -35,12 +35,9 @@ import {getMeasureText} from '../global/getRowlen';
import { luckysheet_searcharray } from '../controllers/sheetSearch';
import Store from '../store';
export function rowColumnOperationInitial(){
//表格行标题 mouse事件
//表格行标题 mouse事件
$("#luckysheet-rows-h").mousedown(function (event) {
//有批注在编辑时
luckysheetPostil.removeActivePs();
@ -809,7 +806,6 @@ export function rowColumnOperationInitial(){
}
});
//表格行标题 改变行高按钮
$("#luckysheet-rows-change-size").mousedown(function (event) {
//有批注在编辑时
@ -915,6 +911,10 @@ export function rowColumnOperationInitial(){
$("#luckysheet-rightclick-menu").hide();
luckysheetContainerFocus();
const _locale = locale();
const locale_drag = _locale.drag;
const locale_info = _locale.info;
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
alert(locale_drag.noMulti);
@ -926,6 +926,8 @@ export function rowColumnOperationInitial(){
return;
}
let $t = $(this), value = $t.parent().find("input").val();
if (!isRealNum(value)) {
if(isEditMode()){
@ -957,6 +959,10 @@ export function rowColumnOperationInitial(){
$("#luckysheet-rightclick-menu").hide();
luckysheetContainerFocus();
const _locale = locale();
const locale_drag = _locale.drag;
const locale_info = _locale.info;
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
alert(locale_drag.noMulti);
@ -984,10 +990,10 @@ export function rowColumnOperationInitial(){
if (value < 1 || value > 100) {
if(isEditMode()){
alert(llocale_info.tipInputNumberLimit);
alert(locale_info.tipInputNumberLimit);
}
else{
tooltip.info(llocale_info.tipInputNumberLimit, "");
tooltip.info(locale_info.tipInputNumberLimit, "");
}
return;
}
@ -999,6 +1005,10 @@ export function rowColumnOperationInitial(){
$("#luckysheet-rightclick-menu").hide();
luckysheetContainerFocus();
const _locale = locale();
const locale_drag = _locale.drag;
const locale_info = _locale.info;
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
alert(locale_drag.noMulti);
@ -1026,10 +1036,10 @@ export function rowColumnOperationInitial(){
if (value < 1 || value > 100) {
if(isEditMode()){
alert(llocale_info.tipInputNumberLimit);
alert(locale_info.tipInputNumberLimit);
}
else{
tooltip.info(llocale_info.tipInputNumberLimit, "");
tooltip.info(locale_info.tipInputNumberLimit, "");
}
return;
}
@ -1043,6 +1053,10 @@ export function rowColumnOperationInitial(){
$("#luckysheet-rightclick-menu").hide();
luckysheetContainerFocus();
const _locale = locale();
const locale_drag = _locale.drag;
const locale_info = _locale.info;
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
alert(locale_drag.noMulti);
@ -1070,10 +1084,10 @@ export function rowColumnOperationInitial(){
if (value < 1 || value > 100) {
if(isEditMode()){
alert(llocale_info.tipInputNumberLimit);
alert(locale_info.tipInputNumberLimit);
}
else{
tooltip.info(llocale_info.tipInputNumberLimit, "");
tooltip.info(locale_info.tipInputNumberLimit, "");
}
return;
@ -1086,6 +1100,10 @@ export function rowColumnOperationInitial(){
$("#luckysheet-rightclick-menu").hide();
luckysheetContainerFocus();
const _locale = locale();
const locale_drag = _locale.drag;
const locale_info = _locale.info;
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
alert(locale_drag.noMulti);
@ -1113,10 +1131,10 @@ export function rowColumnOperationInitial(){
if (value < 1 || value > 100) {
if(isEditMode()){
alert(llocale_info.tipInputNumberLimit);
alert(locale_info.tipInputNumberLimit);
}
else{
tooltip.info(llocale_info.tipInputNumberLimit, "");
tooltip.info(locale_info.tipInputNumberLimit, "");
}
return;
@ -1129,6 +1147,10 @@ export function rowColumnOperationInitial(){
$("#luckysheet-rightclick-menu").hide();
luckysheetContainerFocus();
const _locale = locale();
const locale_drag = _locale.drag;
const locale_info = _locale.info;
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
alert(locale_drag.noMulti);
@ -1156,10 +1178,10 @@ export function rowColumnOperationInitial(){
if (value < 1 || value > 100) {
if(isEditMode()){
alert(llocale_info.tipInputNumberLimit);
alert(locale_info.tipInputNumberLimit);
}
else{
tooltip.info(llocale_info.tipInputNumberLimit, "");
tooltip.info(locale_info.tipInputNumberLimit, "");
}
return;
@ -1174,6 +1196,8 @@ export function rowColumnOperationInitial(){
$("#luckysheet-rightclick-menu").hide();
luckysheetContainerFocus();
const locale_drag = locale().drag;
if(Store.luckysheet_select_save.length > 1){
if(Store.luckysheetRightHeadClickIs == "row"){
if(isEditMode()){
@ -1202,6 +1226,8 @@ export function rowColumnOperationInitial(){
$("#luckysheet-rightclick-menu").hide();
luckysheetContainerFocus();
const locale_drag = locale().drag;
if(Store.luckysheet_select_save.length > 1){
if(Store.luckysheetRightHeadClickIs == "row"){
if(isEditMode()){
@ -1230,6 +1256,8 @@ export function rowColumnOperationInitial(){
$("#luckysheet-rightclick-menu").hide();
luckysheetContainerFocus();
const locale_drag = locale().drag;
if(Store.luckysheet_select_save.length > 1){
if(Store.luckysheetRightHeadClickIs == "row"){
if(isEditMode()){
@ -1366,6 +1394,8 @@ export function rowColumnOperationInitial(){
}
if(has_PartMC){
const locale_drag = locale().drag;
if(isEditMode()){
alert(locale_drag.noPartMerge);
}
@ -1418,11 +1448,13 @@ export function rowColumnOperationInitial(){
let size = parseInt($(this).siblings("input[type='number']").val().trim());
if(size < 0 || size > 255){
const locale_info = locale().info;
if(isEditMode()){
alert(llocale_info.tipRowHeightLimit);
alert(locale_info.tipRowHeightLimit);
}
else{
tooltip.info(llocale_info.tipRowHeightLimit, "");
tooltip.info(locale_info.tipRowHeightLimit, "");
}
return;

69
src/controllers/sheetmanage.js

@ -590,10 +590,16 @@ const sheetmanage = {
Store.luckysheet_select_save = file["luckysheet_select_save"];
if(Store.luckysheet_select_save == null || Store.luckysheet_select_save.length == 0){
if(data[0] != null && data[0][0] != null && data[0][0].mc != null){
Store.luckysheet_select_save = [{ "row": [0, data[0][0].mc.rs - 1], "column": [0, data[0][0].mc.cs - 1] }];
Store.luckysheet_select_save = [{
"row": [0, data[0][0].mc.rs - 1],
"column": [0, data[0][0].mc.cs - 1]
}];
}
else{
Store.luckysheet_select_save = [{ "row": [0, 0], "column": [0, 0] }];
Store.luckysheet_select_save = [{
"row": [0, 0],
"column": [0, 0]
}];
}
}
@ -687,6 +693,21 @@ const sheetmanage = {
Store.luckysheetcurrentisPivotTable = false;
$("#luckysheet-modal-dialog-slider-pivot").hide();
luckysheetsizeauto();
//等待滚动条dom宽高加载完成后 初始化滚动位置
if(file["scrollLeft"] != null && file["scrollLeft"] > 0){
$("#luckysheet-scrollbar-x").scrollLeft(file["scrollLeft"] * Store.zoomRatio);
}
else{
$("#luckysheet-scrollbar-x").scrollLeft(0);
}
if(file["scrollTop"] != null && file["scrollTop"] > 0){
$("#luckysheet-scrollbar-y").scrollTop(file["scrollTop"] * Store.zoomRatio);
}
else{
$("#luckysheet-scrollbar-y").scrollTop(0);
}
}
if(typeof luckysheetConfigsetting.beforeCreateDom == "function" ){
@ -758,8 +779,13 @@ const sheetmanage = {
file["luckysheet_select_save"] = $.extend(true, [], Store.luckysheet_select_save);
file["luckysheet_selection_range"] = $.extend(true, [], Store.luckysheet_selection_range);
file["scrollLeft"] = $("#luckysheet-scrollbar-x").scrollLeft();//列标题
file["scrollTop"] = $("#luckysheet-scrollbar-y").scrollTop();//行标题
if($("#luckysheet-scrollbar-x")[0].scrollWidth > $("#luckysheet-scrollbar-x")[0].offsetWidth){
file["scrollLeft"] = $("#luckysheet-scrollbar-x").scrollLeft(); //横向滚动条
}
if($("#luckysheet-scrollbar-y")[0].scrollHeight > $("#luckysheet-scrollbar-y")[0].offsetHeight){
file["scrollTop"] = $("#luckysheet-scrollbar-y").scrollTop(); //纵向滚动条
}
file["zoomRatio"] = Store.zoomRatio;
},
@ -777,7 +803,22 @@ const sheetmanage = {
Store.config = file["config"];
Store.luckysheet_select_save = file["luckysheet_select_save"] == null ? [] : file["luckysheet_select_save"];
Store.luckysheet_select_save = file["luckysheet_select_save"];
if(Store.luckysheet_select_save == null || Store.luckysheet_select_save.length == 0){
if(Store.flowdata[0] != null && Store.flowdata[0][0] != null && Store.flowdata[0][0].mc != null){
Store.luckysheet_select_save = [{
"row": [0, Store.flowdata[0][0].mc.rs - 1],
"column": [0, Store.flowdata[0][0].mc.cs - 1]
}];
}
else{
Store.luckysheet_select_save = [{
"row": [0, 0],
"column": [0, 0]
}];
}
}
Store.luckysheet_selection_range = file["luckysheet_selection_range"] == null ? [] : file["luckysheet_selection_range"];
if(file["freezen"] == null){
@ -789,7 +830,7 @@ const sheetmanage = {
luckysheetFreezen.freezenverticaldata = file["freezen"].vertical == null ? null : file["freezen"].vertical.freezenverticaldata;
}
if(file["zoomRatio"]!=null){
if(file["zoomRatio"] != null){
Store.zoomRatio = file["zoomRatio"];
}
else{
@ -799,15 +840,15 @@ const sheetmanage = {
createFilterOptions(file["filter_select"], file["filter"]);
Store.scrollRefreshSwitch = false;
if(file["scrollLeft"]!=null && file["scrollLeft"]>0){
$("#luckysheet-scrollbar-x").scrollLeft(file["scrollLeft"]*Store.zoomRatio);
if(file["scrollLeft"] != null && file["scrollLeft"] > 0){
$("#luckysheet-scrollbar-x").scrollLeft(file["scrollLeft"] * Store.zoomRatio);
}
else{
$("#luckysheet-scrollbar-x").scrollLeft(0);
}
if(file["scrollTop"]!=null && file["scrollTop"]>0){
$("#luckysheet-scrollbar-y").scrollTop(file["scrollTop"]*Store.zoomRatio);
if(file["scrollTop"] != null && file["scrollTop"] > 0){
$("#luckysheet-scrollbar-y").scrollTop(file["scrollTop"] * Store.zoomRatio);
}
else{
$("#luckysheet-scrollbar-y").scrollTop(0);
@ -816,8 +857,7 @@ const sheetmanage = {
Store.scrollRefreshSwitch = true;
}, 0);
jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length,false);
jfrefreshgrid_rhcw(Store.flowdata.length, Store.flowdata[0].length, false);
},
restoreselect: function() {
let index = this.getSheetIndex(Store.currentSheetIndex);
@ -879,14 +919,11 @@ const sheetmanage = {
pivotTable.changePivotTable(index);
}
}
else if($("#luckysheet-modal-dialog-slider-pivot").is(":visible")) {
else{
Store.luckysheetcurrentisPivotTable = false;
$("#luckysheet-modal-dialog-slider-pivot").hide();
luckysheetsizeauto(false);
}
else if(Store.luckysheetcurrentisPivotTable) {
Store.luckysheetcurrentisPivotTable = false;
}
let load = file["load"];
if (load != null) {

8
src/global/draw.js

@ -2068,6 +2068,14 @@ function getCellOverflowMap(canvas, col_st, col_ed, row_st, row_end){
let data = Store.flowdata;
if(row_st < 0){
row_st = 0;
}
if(row_end > data.length - 1){
row_end = data.length - 1;
}
for(let r = row_st; r <= row_end; r++){
for(let c = 0; c < data[r].length; c++){
let cell = data[r][c];

1
src/locale/en.js

@ -484,6 +484,7 @@ export default {
filterDateFormatTip:"Date format",
valueBlank:"(Null)",
mergeError:"There are merged cells in the filter selection, this operation cannot be performed!",
},
rightclick: {
copy: 'Copy',

1
src/locale/zh.js

@ -501,6 +501,7 @@ export default {
filterDateFormatTip:"日期格式",
valueBlank:"(空白)",
mergeError:"筛选选区有合并单元格,无法执行此操作!",
},
rightclick: {
copy: '复制',

Loading…
Cancel
Save