Browse Source

Merge pull request #302 from flowerField/master

Solve the problem  增加行不生效 #294
master
mengshukeji 5 years ago
committed by GitHub
parent
commit
6aacc1a766
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/controllers/server.js
  2. 6
      src/global/extend.js

3
src/controllers/server.js

@ -635,8 +635,7 @@ const server = {
for(let i = 0; i < len; i++){
arr.push(JSON.stringify(addData[i]));
}
eval('data.splice(' + st_i + ', 0, ' + arr.join(",") + ')');
new Function("data","return " + 'data.splice(' + st_i + ', 0, ' + arr.join(",") + ')')(data);
}
else{
file["column"] += len;

6
src/global/extend.js

@ -713,14 +713,14 @@ function luckysheetextendtable(type, index, value, direction, sheetIndex) {
if(direction == "lefttop"){
if(index == 0){
new Function("return " + 'd.unshift(' + arr.join(",") + ')')();
new Function("d","return " + 'd.unshift(' + arr.join(",") + ')')(d);
}
else{
new Function("return " + 'd.splice(' + index + ', 0, ' + arr.join(",") + ')')();
new Function("d","return " + 'd.splice(' + index + ', 0, ' + arr.join(",") + ')')(d);
}
}
else{
new Function("return " + 'd.splice(' + (index + 1) + ', 0, ' + arr.join(",") + ')')();
new Function("d","return " + 'd.splice(' + (index + 1) + ', 0, ' + arr.join(",") + ')')(d);
}
}
else {

Loading…
Cancel
Save