// 解析出来的表格数据
let sheetData = [
[
"id",
"name",
"gender",
"age",
"idCard",
"email",
"address",
"createdDate"
],
[
"1",
"郑文强",
"male",
"26",
"510322198809163412",
"mtbtwgpuktmu@qq.com",
"安徽合肥",
"2022-07-20 16:05:54"
],
[
"2",
"王琪可乐",
"female",
"17",
"12312312313123123",
"gu@example.com",
"安徽滁州全椒县",
"2022-07-19 17:10:38"
],
[
"4",
"ikun",
"female",
"18",
"7771298100238123",
"123913182@qq.com",
"律师函警告⚠️",
"2022-07-19 17:10:19"
],
[
"5",
"小黑子",
"male",
"24",
"80283042423",
"18723913@qq.com",
"键盘",
"2022-07-18 15:45:18"
],
[
"6",
"李无锋",
"male",
"19",
"371423198601191912",
"7880822@qq.com",
"山东省德州市庆云县",
"2022-07-19 14:51:42"
],
[
"7",
"测试",
"female",
"18",
"11111",
"11111",
"111",
"2022-07-20 18:53:34"
],
[
"8",
"猪头少年",
"male",
"23",
"额鹅鹅鹅",
"的地方都",
"的三分大赛",
"2022-07-20 18:56:52"
]
]
// 建立空数组,用于放置数据
let testList = []
// testTitle也是个数组,用于读取标题行
let testTitle = sheetData[0]
sheetData.forEach((item, index) =>
{
//整一个新对象
var NewVot = {}
if (index == 0) return
else
{
for(var i = 0 ; i < testTitle.length ; i++ )
{
NewVot[testTitle[i]] = item[i]
}
testList.push(NewVot)
}
})
//看看效果
console.log(testList)
console