Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
bug修改
Browse files Browse the repository at this point in the history
  • Loading branch information
wpxp123456 committed Jul 17, 2020
1 parent 25eb44d commit 91b935f
Show file tree
Hide file tree
Showing 18 changed files with 165 additions and 129 deletions.
2 changes: 1 addition & 1 deletion src/controllers/alternateformat.js
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ const alternateformat = {
let rangeMap = _this.getRangeMap(range["row"], range["column"]);

//遍历
for(x in rangeMap){
for(let x in rangeMap){
if(isExists){
break;
}
Expand Down
17 changes: 9 additions & 8 deletions src/controllers/conditionformat.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ const conditionformat = {

rule = {
"type": "dataBar",
"cellrange": $.extend(true, [], luckysheet_select_save),
"cellrange": $.extend(true, [], Store.luckysheet_select_save),
"format": format
};
}
Expand All @@ -227,7 +227,7 @@ const conditionformat = {

rule = {
"type": "colorGradation",
"cellrange": $.extend(true, [], luckysheet_select_save),
"cellrange": $.extend(true, [], Store.luckysheet_select_save),
"format": format
};
}
Expand All @@ -244,7 +244,7 @@ const conditionformat = {

rule = {
"type": "icons",
"cellrange": $.extend(true, [], luckysheet_select_save),
"cellrange": $.extend(true, [], Store.luckysheet_select_save),
"format": format
};
}
Expand Down Expand Up @@ -476,7 +476,7 @@ const conditionformat = {

rule = {
"type": "default",
"cellrange": $.extend(true, [], luckysheet_select_save),
"cellrange": $.extend(true, [], Store.luckysheet_select_save),
"format": format,
"conditionName": conditionName,
"conditionRange": conditionRange,
Expand Down Expand Up @@ -3375,7 +3375,7 @@ const conditionformat = {
}
//循环应用范围计算
if(conditionValue0 == "0"){//重复值
for(x in dmap){
for(let x in dmap){
if(x != "null" && x != "undefined" && dmap[x].length > 1){
for(let j = 0; j < dmap[x].length; j++){
if((dmap[x][j].r + "_" + dmap[x][j].c) in computeMap){
Expand All @@ -3390,7 +3390,7 @@ const conditionformat = {
}
}
if(conditionValue0 == "1"){//唯一值
for(x in dmap){
for(let x in dmap){
if(x != "null" && x != "undefined" && dmap[x].length == 1){
if((dmap[x][0].r + "_" + dmap[x][0].c) in computeMap){
computeMap[dmap[x][0].r + "_" + dmap[x][0].c]["textColor"] = textColor;
Expand Down Expand Up @@ -3536,16 +3536,17 @@ const conditionformat = {
let historyRules = _this.getHistoryRules(fileH);

//保存当前的规则
let ruleArr;
if(type == "delSheet"){
let ruleArr = [];
ruleArr = [];
}
else{
let rule = {
"type": type,
"cellrange": cellrange,
"format": format
};
let ruleArr = Store.luckysheetfile[index]["luckysheet_conditionformat_save"] == null ? [] : Store.luckysheetfile[index]["luckysheet_conditionformat_save"];
ruleArr = Store.luckysheetfile[index]["luckysheet_conditionformat_save"] == null ? [] : Store.luckysheetfile[index]["luckysheet_conditionformat_save"];
ruleArr.push(rule);
}

Expand Down
1 change: 1 addition & 0 deletions src/controllers/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { rowlenByRange } from '../global/getRowlen';
import { jfrefreshgrid } from '../global/refresh';
import { selectHightlightShow } from './select';
import { luckysheetMoveEndCell } from './sheetMove';
import server from './server';
import Store from '../store';

//筛选配置状态
Expand Down
63 changes: 39 additions & 24 deletions src/controllers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import splitColumn from './splitColumn';
import { labelFilterOptionState, orderbydatafiler, createFilter, createFilterOptions } from './filter';
import insertFormula from './insertFormula';
import {
replaceHtml,
getObjType,
chatatABC,
ArrayUnique,
Expand Down Expand Up @@ -60,7 +61,7 @@ import {
jfrefreshgrid_rhcw,
luckysheetrefreshgrid,
} from '../global/refresh';
import { getdatabyselection, getcellvalue } from '../global/getdata';
import { getdatabyselection, getcellvalue, datagridgrowth } from '../global/getdata';
import { orderbydata, orderbydata1D, sortColumnSeletion } from '../global/sort';
import tooltip from '../global/tooltip';
import editor from '../global/editor';
Expand All @@ -69,6 +70,7 @@ import json from '../global/json';
import { update, genarate } from '../global/format';
import method from '../global/method';
import { getBorderInfoCompute } from '../global/border';
import { luckysheetDrawMain } from '../global/draw';
import Store from '../store';

//, columeflowset, rowflowset
Expand Down Expand Up @@ -111,14 +113,18 @@ export default function luckysheetHandler() {

//一次滚动三行或三列
if(event.deltaX != 0){
let col_ed;

if(event.deltaX < 0){
let col_ed = col_st + 3;
col_ed = col_st + 3;

if(col_ed >= visibledatacolumn_c.length){
col_ed = visibledatacolumn_c.length - 1;
}
}
else{
let col_ed = col_st - 3;
col_ed = col_st - 3;

if(col_ed < 0){
col_ed = 0;
}
Expand All @@ -130,14 +136,18 @@ export default function luckysheetHandler() {
}

if(event.deltaY != 0){
let row_ed;

if(event.deltaY < 0){
let row_ed = row_st + 3;
row_ed = row_st + 3;

if(row_ed >= visibledatarow_c.length){
row_ed = visibledatarow_c.length - 1;
}
}
else{
let row_ed = row_st - 3;
row_ed = row_st - 3;

if(row_ed < 0){
row_ed = 0;
}
Expand Down Expand Up @@ -640,8 +650,9 @@ export default function luckysheetHandler() {
let currSelection = window.getSelection();
let anchorOffset = currSelection.anchorNode;

let $editor;
if($("#luckysheet-search-formula-parm").is(":visible") || $("#luckysheet-search-formula-parm-select").is(":visible")){
$editor=$("#luckysheet-rich-text-editor");
$editor = $("#luckysheet-rich-text-editor");
formula.rangechangeindex = formula.data_parm_index;
}
else{
Expand Down Expand Up @@ -3574,7 +3585,7 @@ export default function luckysheetHandler() {

cfg["rowlen"][Store.luckysheet_rows_change_size_start[1]] = Math.ceil(size);

if (clearjfundo) {
if (Store.clearjfundo) {
Store.jfundo = [];

Store.jfredo.push({
Expand Down Expand Up @@ -3642,7 +3653,7 @@ export default function luckysheetHandler() {

cfg["columlen"][Store.luckysheet_cols_change_size_start[1]] = Math.ceil(size);

if (clearjfundo) {
if (Store.clearjfundo) {
Store.jfundo = [];

Store.jfredo.push({
Expand Down Expand Up @@ -4304,13 +4315,16 @@ export default function luckysheetHandler() {
setTimeout(function(){
let currSelection = window.getSelection();
let anchorOffset = currSelection.anchorNode;

let $editor;
if($("#luckysheet-search-formula-parm").is(":visible")||$("#luckysheet-search-formula-parm-select").is(":visible")){
$editor = $("#luckysheet-rich-text-editor");
formula.rangechangeindex = formula.data_parm_index;
}
else{
$editor = $(anchorOffset).closest("div");
}

let $span = $editor.find("span[rangeindex='" + formula.rangechangeindex + "']");

formula.setCaretPosition($span.get(0), 0, $span.html().length);
Expand Down Expand Up @@ -6402,7 +6416,7 @@ export default function luckysheetHandler() {
Store.luckysheetfile[index].color = color;
server.saveParam("all", Store.currentSheetIndex, color, { "k": "color" });

if (clearjfundo) {
if (Store.clearjfundo) {
let redo = {};
redo["type"] = "sheetColor";
redo["sheetIndex"] = Store.currentSheetIndex;
Expand All @@ -6427,7 +6441,7 @@ export default function luckysheetHandler() {
Store.luckysheetfile[index].color = null;
server.saveParam("all", Store.currentSheetIndex, null, { "k": "color" } );

if (clearjfundo) {
if (Store.clearjfundo) {
let redo = {};
redo["type"] = "sheetColor";
redo["sheetIndex"] = Store.currentSheetIndex;
Expand Down Expand Up @@ -6590,7 +6604,7 @@ export default function luckysheetHandler() {

$t.attr("contenteditable", "false").removeClass("luckysheet-mousedown-cancel");

if (clearjfundo) {
if (Store.clearjfundo) {
let redo = {};
redo["type"] = "sheetName";
redo["sheetIndex"] = Store.currentSheetIndex;
Expand Down Expand Up @@ -6780,7 +6794,7 @@ export default function luckysheetHandler() {
$("#luckysheet-sheet-list").html(item);
}

$t = $("#luckysheet-sheet-list");
let $t = $("#luckysheet-sheet-list");

mouseclickposition($t, $(this).offset().left, $(this).offset().top - 12, "leftbottom");
$("#luckysheet-input-box").removeAttr("style");
Expand Down Expand Up @@ -7025,7 +7039,7 @@ export default function luckysheetHandler() {
}
}

if (clearjfundo) {
if (Store.clearjfundo) {
Store.jfundo = [];
Store.jfredo.push({
"type": "resize",
Expand Down Expand Up @@ -7191,11 +7205,12 @@ export default function luckysheetHandler() {
//数据具有标题行
let t = $("#luckysheet-sort-haveheader").is(':checked');

let str;
if(t){
let str = r1 + 1;
str = r1 + 1;
}
else{
let str = r1;
str = r1;
}

let hasMc = false; //排序选区是否有合并单元格
Expand Down Expand Up @@ -7553,11 +7568,11 @@ export default function luckysheetHandler() {
let ysum = 0;
let monthHtml = '';

for(m in dvmap[y]){
for(let m in dvmap[y]){
let msum = 0;
let dayHtml = '';

for(d in dvmap[y][m]){
for(let d in dvmap[y][m]){
let dayL = dvmap[y][m][d];
msum += dayL;

Expand Down Expand Up @@ -7668,7 +7683,7 @@ export default function luckysheetHandler() {
for(let i = 0; i < vmapKeys.length; i++){
let v = vmapKeys[i];

for(x in vmap[v]){
for(let x in vmap[v]){
let text;
if((v + "#$$$#" + x) == "null#$$$#null"){
text = "(空白)";
Expand Down Expand Up @@ -7767,7 +7782,7 @@ export default function luckysheetHandler() {
fc = fc.substr(0, 1) + fc.substr(1, 1).repeat(2) + fc.substr(2, 1).repeat(2) + fc.substr(3, 1).repeat(2);
}

if(config != null && config["rowhidden"] != null && r in config["rowhidden"]){
if(Store.config != null && Store.config["rowhidden"] != null && r in Store.config["rowhidden"]){
bgMap[bg] = 1;

if(cell != null && !isRealNull(cell.v)){
Expand All @@ -7786,7 +7801,7 @@ export default function luckysheetHandler() {
let filterBgColorHtml = '';
if(JSON.stringify(bgMap).length > 2 && Object.keys(bgMap).length > 1){
let bgColorItemHtml = '';
for(b in bgMap){
for(let b in bgMap){
if(bgMap[b] == 0){
bgColorItemHtml += '<div class="item luckysheet-mousedown-cancel"><label class="luckysheet-mousedown-cancel" style="background-color: ' + b + '" title="' + b + '"></label><input class="luckysheet-mousedown-cancel" type="checkbox" checked="checked"/></div>';
}
Expand All @@ -7800,7 +7815,7 @@ export default function luckysheetHandler() {
let filterFcColorHtml = '';
if(JSON.stringify(fcMap).length > 2 && Object.keys(fcMap).length > 1){
let fcColorItemHtml = '';
for(f in fcMap){
for(let f in fcMap){
if(fcMap[f] == 0){
fcColorItemHtml += '<div class="item luckysheet-mousedown-cancel"><label class="luckysheet-mousedown-cancel" style="background-color: ' + f + '" title="' + f + '"></label><input class="luckysheet-mousedown-cancel" type="checkbox" checked="checked"/></div>';
}
Expand Down Expand Up @@ -7996,11 +8011,11 @@ export default function luckysheetHandler() {

labelFilterOptionState($top, optionstate, rowhidden, caljs, true, st_r, ed_r, cindex, st_c, ed_c);

let cfg = $.extend(true, {}, config);
let cfg = $.extend(true, {}, Store.config);
cfg["rowhidden"] = rowhiddenall;

//保存撤销
if(clearjfundo){
if(Store.clearjfundo){
let redo = {};
redo["type"] = "datachangeAll_filter";
redo["sheetIndex"] = Store.currentSheetIndex;
Expand Down Expand Up @@ -8718,7 +8733,7 @@ export default function luckysheetHandler() {
cfg["rowhidden"] = rowhiddenall;

//保存撤销
if(clearjfundo){
if(Store.clearjfundo){
let redo = {};
redo["type"] = "datachangeAll_filter";
redo["sheetIndex"] = Store.currentSheetIndex;
Expand Down
6 changes: 3 additions & 3 deletions src/controllers/ifFormulaGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,9 @@ const ifFormulaGenerator = {
getIfList: function(compareValue, smallRange, largeRange, method, methodVal){
$("#luckysheet-ifFormulaGenerator-dialog .ifList").empty();

let smallRange = parseInt(smallRange);
let largeRange = parseInt(largeRange);
let methodVal = parseInt(methodVal);
smallRange = parseInt(smallRange);
largeRange = parseInt(largeRange);
methodVal = parseInt(methodVal);

let arr = [];

Expand Down
4 changes: 2 additions & 2 deletions src/controllers/insertFormula.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,13 @@ const insertFormula = {

$("#formulaTypeList .listBox:first-child").addClass("on"); //默认公式列表第一个为选中状态
},
formulaParmDialog: function(formula, parm){ //参数弹出框
formulaParmDialog: function(formulaTxt, parm){ //参数弹出框
let parm_title = '',
parm_content = '',
parm_list_content = '';

for(let i = 0; i < functionlist.length; i++){
if(functionlist[i].n == formula.toUpperCase()){
if(functionlist[i].n == formulaTxt.toUpperCase()){
parm_title = functionlist[i].n;

for(let j = 0; j < functionlist[i].p.length; j++){
Expand Down
8 changes: 4 additions & 4 deletions src/controllers/locationCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ const luckysheetLocationCell = {
if(st_r == ed_r){
let stack_stc = null, stack_edc = null;

let r = st_r;
for(let c = st_c; c <= ed_c; c++){
var r = st_r; //r, c var定义,否则eval报错
for(var c = st_c; c <= ed_c; c++){
if(c == st_c){
if(eval(str)){
stack_stc = c;
Expand Down Expand Up @@ -313,11 +313,11 @@ const luckysheetLocationCell = {
else{
let stack = {};

for(let r = st_r; r <= ed_r; r++){
for(var r = st_r; r <= ed_r; r++){
stack[r] = [];
let stack_stc = null, stack_edc = null;

for(let c = st_c; c <= ed_c; c++){
for(var c = st_c; c <= ed_c; c++){
if(c == ed_c){
if(eval(str)){
if(stack_stc == null){
Expand Down
Loading

0 comments on commit 91b935f

Please sign in to comment.