Commit ccf41188 authored by 仇晓婷's avatar 仇晓婷

Merge branch 'master' of http://git.mes123.com/zhouyx/mes-ui

parents b93bcd5e 79d5c600
...@@ -83,13 +83,13 @@ export default { ...@@ -83,13 +83,13 @@ export default {
tabData.forEach(ele => { tabData.forEach(ele => {
let objData = {} let objData = {}
tabColum.forEach(el => { tabColum.forEach(el => {
objData[el.title] = ele[el.key] objData[el.title] = ele[el.key].replace(/\s/g, "")
}) })
arrData.push(objData) arrData.push(objData)
}) })
//处理title和key一致 //处理title和key一致
tabColum.forEach(el => { tabColum.forEach(el => {
el.key = el.title el.key = el.title.replace(/\s/g, "")
}) })
this.columnsImport = tabColum; this.columnsImport = tabColum;
......
...@@ -374,8 +374,8 @@ export default { ...@@ -374,8 +374,8 @@ export default {
}); });
headers.forEach((elHead) => { headers.forEach((elHead) => {
let headObj = {}; let headObj = {};
headObj.title = elHead; headObj.title = elHead.replace(/\s/g, "");
headObj.key = elHead; headObj.key = elHead.replace(/\s/g, "");
headersNow.push(headObj); headersNow.push(headObj);
}); });
this.columnsImport = headersNow; this.columnsImport = headersNow;
...@@ -384,7 +384,7 @@ export default { ...@@ -384,7 +384,7 @@ export default {
var obj = {}; var obj = {};
var currentline = lines[i].split(","); var currentline = lines[i].split(",");
for (var j = 0; j < headers.length; j++) { for (var j = 0; j < headers.length; j++) {
obj[headers[j]] = currentline[j]; obj[headers[j]] = currentline[j].replace(/\s/g, "");
} }
result.push(obj); result.push(obj);
} }
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment