|
@@ -44,6 +44,7 @@ layui.define(function(exports) {
|
|
|
_this.checkReport({
|
|
|
row,
|
|
|
column,
|
|
|
+ direction: itemForm.valType,
|
|
|
error: () => {
|
|
|
error()
|
|
|
},
|
|
@@ -188,7 +189,6 @@ layui.define(function(exports) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- //console.log(cellsData)
|
|
|
luckysheet.setRangeValue(cellsData, {range: {
|
|
|
row: [json.r, json.r + cellsData.length - 1],
|
|
|
column: [json.c, json.c + cellsData[0].length - 1],
|
|
@@ -223,6 +223,7 @@ layui.define(function(exports) {
|
|
|
_this.checkReport({
|
|
|
row,
|
|
|
column,
|
|
|
+ direction: itemForm.valType,
|
|
|
error: () => {
|
|
|
error()
|
|
|
},
|
|
@@ -231,7 +232,6 @@ layui.define(function(exports) {
|
|
|
const cs = json.cs || 0
|
|
|
let cellsData = _this.plugCell(json)
|
|
|
let cdata = {}
|
|
|
- //console.log(json)
|
|
|
for (let i = 0; i < row; i++) {
|
|
|
let ri = rs > 0 ? (i == 0 ? 0 : i * rs) : i
|
|
|
for (let j = 0; j < column; j++) {
|
|
@@ -338,7 +338,6 @@ layui.define(function(exports) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- //console.log(cellsData)
|
|
|
luckysheet.setRangeValue(cellsData, {range: {
|
|
|
row: [json.r, json.r + cellsData.length - 1],
|
|
|
column: [json.c, json.c + cellsData[0].length - 1],
|
|
@@ -358,6 +357,7 @@ layui.define(function(exports) {
|
|
|
_this.checkReport({
|
|
|
row,
|
|
|
column,
|
|
|
+ direction: 1,
|
|
|
error: () => {
|
|
|
error()
|
|
|
},
|
|
@@ -494,10 +494,18 @@ layui.define(function(exports) {
|
|
|
break
|
|
|
}
|
|
|
if (sheetData[i][j] && sheetData[i][j].m && sheetData[i][j].tableId != layui.itemListTable.data.tableId) {
|
|
|
- if (rr == -1 && cc == -1) {
|
|
|
- rr = i
|
|
|
- cc = j
|
|
|
+ if (i < endRow && j < endColumn) {
|
|
|
+ const ar = endRow - i
|
|
|
+ const ac = endColumn - j
|
|
|
+
|
|
|
+ if (ar < ac && rr == -1) {
|
|
|
+ rr = ar
|
|
|
+ }
|
|
|
+ if (ac < ar && cc == -1) {
|
|
|
+ cc = ac
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
if (sheetData[i][j].tableId) {
|
|
|
params.error()
|
|
|
return
|
|
@@ -510,19 +518,20 @@ layui.define(function(exports) {
|
|
|
// 补足差的列数
|
|
|
let columnNum = 0
|
|
|
if (rr > 0) {
|
|
|
- rowNum = endRow - rr + 1
|
|
|
+ rowNum = rr
|
|
|
} else {
|
|
|
if (sheetData.length < endRow) {
|
|
|
rowNum = endRow - sheetData.length + 1
|
|
|
}
|
|
|
}
|
|
|
if (cc > 0) {
|
|
|
- columnNum = endColumn - cc + 1
|
|
|
+ columnNum = cc
|
|
|
} else {
|
|
|
if (sheetData[0].length < endColumn) {
|
|
|
columnNum = endColumn - sheetData[0].length + 1
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (rowNum > 0) {
|
|
|
while(rowNum > 100) {
|
|
|
luckysheet.insertRow(position.r, {
|