|
@@ -239,15 +239,17 @@ var sheetCommonObj = {
|
|
itemObj = {};
|
|
itemObj = {};
|
|
}
|
|
}
|
|
} else if (pastedInfo.pasteData.text[i] === "\t" || pastedInfo.pasteData.text[i] === "\r") {
|
|
} else if (pastedInfo.pasteData.text[i] === "\t" || pastedInfo.pasteData.text[i] === "\r") {
|
|
- itemObj[setting.header[propId].dataCode] = pastedInfo.pasteData.text.slice(preStrIdx, i);
|
|
|
|
|
|
+ if (setting.header[propId]) {
|
|
|
|
+ itemObj[setting.header[propId].dataCode] = pastedInfo.pasteData.text.slice(preStrIdx, i);
|
|
|
|
+ }
|
|
propId++;
|
|
propId++;
|
|
preStrIdx = i + 1;
|
|
preStrIdx = i + 1;
|
|
//if the last copied-cell were empty, should check whether the end of text
|
|
//if the last copied-cell were empty, should check whether the end of text
|
|
- if (i == pastedInfo.pasteData.text.length - 1) {
|
|
|
|
|
|
+ if (i == pastedInfo.pasteData.text.length - 1 && setting.header[propId]) {
|
|
itemObj[setting.header[propId].dataCode] = pastedInfo.pasteData.text.slice(preStrIdx);
|
|
itemObj[setting.header[propId].dataCode] = pastedInfo.pasteData.text.slice(preStrIdx);
|
|
rst.push(itemObj);
|
|
rst.push(itemObj);
|
|
}
|
|
}
|
|
- } else if (i == pastedInfo.pasteData.text.length - 1) {
|
|
|
|
|
|
+ } else if (i == pastedInfo.pasteData.text.length - 1 && setting.header[propId]) {
|
|
itemObj[setting.header[propId].dataCode] = pastedInfo.pasteData.text.slice(preStrIdx);
|
|
itemObj[setting.header[propId].dataCode] = pastedInfo.pasteData.text.slice(preStrIdx);
|
|
rst.push(itemObj);
|
|
rst.push(itemObj);
|
|
}
|
|
}
|