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

Commit

Permalink
fix(bug fix): #26 #91
Browse files Browse the repository at this point in the history
  • Loading branch information
javahuang committed Oct 21, 2020
1 parent 7ec99c2 commit a26ffd8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/controllers/controlHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
} from '../global/refresh';
import { getSheetIndex } from '../methods/get';
import Store from '../store';
import { selectHightlightShow } from './select';

function formulaHistoryHanddler(ctr, type="redo"){
if(ctr==null){
Expand Down Expand Up @@ -82,7 +83,6 @@ const controlHistory = {
"dataVerification": ctr.dataVerification,
"dynamicArray": ctr.dynamicArray
}

jfrefreshgrid(ctr.data, ctr.range, allParam);
// formula.execFunctionGroup(null, null, null, null, ctr.data);//取之前的数据
}
Expand Down Expand Up @@ -414,6 +414,10 @@ const controlHistory = {
}

cleargridelement(e);
if (ctr.range) {
Store.luckysheet_select_save = ctr.range;
selectHightlightShow();
}
Store.clearjfundo = true;
},
undo: function () {
Expand Down Expand Up @@ -713,7 +717,11 @@ const controlHistory = {
zoomNumberDomBind();
zoomRefreshView();
}


if (ctr.range) {
Store.luckysheet_select_save = ctr.range;
selectHightlightShow();
}
Store.clearjfundo = true;
}
};
Expand Down
28 changes: 26 additions & 2 deletions src/global/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,32 @@ export function setCellFormat(row, column, attr, value, options = {}) {
// 特殊格式
if (attr == 'ct' && (!value || !value.hasOwnProperty('fa') || !value.hasOwnProperty('t'))) {
return new TypeError('While set attribute \'ct\' to cell, the value must have property \'fa\' and \'t\'')
cellData.m = update(value.fa, cellData.v)
}

cellData[attr] = value;
if (attr == 'bd') {
let cfg = $.extend(true, {}, Store.config);
if(cfg["borderInfo"] == null){
cfg["borderInfo"] = [];
}

let borderInfo = {
rangeType: "range",
borderType: "border-all",
color: "#000",
style: "1",
range: [{
column: [column, column],
row: [row, row]
}],
...value,
}

cfg["borderInfo"].push(borderInfo);
Store.config = cfg;
} else {
cellData[attr] = value;
}

// refresh
jfrefreshgrid(targetSheetData, {
row: [row],
Expand Down Expand Up @@ -897,6 +919,8 @@ export function insertRowOrColumn(type, index = 0, options = {}) {
success
} = {...options}

let _locale = locale();
let locale_info = _locale.info;
if (!isRealNum(number)) {
if(isEditMode()){
alert(locale_info.tipInputNumber);
Expand Down

0 comments on commit a26ffd8

Please sign in to comment.