Browse Source

fix(bug fix): #26 #91

master
javahuang 5 years ago
parent
commit
a26ffd8ac3
  1. 10
      src/controllers/controlHistory.js
  2. 26
      src/global/api.js

10
src/controllers/controlHistory.js

@ -22,6 +22,7 @@ import {
} from '../global/refresh'; } from '../global/refresh';
import { getSheetIndex } from '../methods/get'; import { getSheetIndex } from '../methods/get';
import Store from '../store'; import Store from '../store';
import { selectHightlightShow } from './select';
function formulaHistoryHanddler(ctr, type="redo"){ function formulaHistoryHanddler(ctr, type="redo"){
if(ctr==null){ if(ctr==null){
@ -82,7 +83,6 @@ const controlHistory = {
"dataVerification": ctr.dataVerification, "dataVerification": ctr.dataVerification,
"dynamicArray": ctr.dynamicArray "dynamicArray": ctr.dynamicArray
} }
jfrefreshgrid(ctr.data, ctr.range, allParam); jfrefreshgrid(ctr.data, ctr.range, allParam);
// formula.execFunctionGroup(null, null, null, null, ctr.data);//取之前的数据 // formula.execFunctionGroup(null, null, null, null, ctr.data);//取之前的数据
} }
@ -414,6 +414,10 @@ const controlHistory = {
} }
cleargridelement(e); cleargridelement(e);
if (ctr.range) {
Store.luckysheet_select_save = ctr.range;
selectHightlightShow();
}
Store.clearjfundo = true; Store.clearjfundo = true;
}, },
undo: function () { undo: function () {
@ -714,6 +718,10 @@ const controlHistory = {
zoomRefreshView(); zoomRefreshView();
} }
if (ctr.range) {
Store.luckysheet_select_save = ctr.range;
selectHightlightShow();
}
Store.clearjfundo = true; Store.clearjfundo = true;
} }
}; };

26
src/global/api.js

@ -323,10 +323,32 @@ export function setCellFormat(row, column, attr, value, options = {}) {
// 特殊格式 // 特殊格式
if (attr == 'ct' && (!value || !value.hasOwnProperty('fa') || !value.hasOwnProperty('t'))) { 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\'') return new TypeError('While set attribute \'ct\' to cell, the value must have property \'fa\' and \'t\'')
cellData.m = update(value.fa, cellData.v)
} }
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; cellData[attr] = value;
}
// refresh // refresh
jfrefreshgrid(targetSheetData, { jfrefreshgrid(targetSheetData, {
row: [row], row: [row],
@ -897,6 +919,8 @@ export function insertRowOrColumn(type, index = 0, options = {}) {
success success
} = {...options} } = {...options}
let _locale = locale();
let locale_info = _locale.info;
if (!isRealNum(number)) { if (!isRealNum(number)) {
if(isEditMode()){ if(isEditMode()){
alert(locale_info.tipInputNumber); alert(locale_info.tipInputNumber);

Loading…
Cancel
Save