Commit 7ca70bdf authored by renjintao's avatar renjintao

user 导出

parent 25e010b1
...@@ -242,7 +242,6 @@ export default { ...@@ -242,7 +242,6 @@ export default {
title: this.l("birthday"), title: this.l("birthday"),
align: "center", align: "center",
high: true, high: true,
hide: true,
type: "date", type: "date",
}, },
{ {
...@@ -251,7 +250,6 @@ export default { ...@@ -251,7 +250,6 @@ export default {
align: "left", align: "left",
high: true, high: true,
code: "User.base.degree", code: "User.base.degree",
hide: true,
}, },
{ {
key: "status", key: "status",
...@@ -281,6 +279,7 @@ export default { ...@@ -281,6 +279,7 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide:true,
render: (h, params) => { render: (h, params) => {
return h("div", { class: "action" }, [ return h("div", { class: "action" }, [
h( h(
...@@ -306,25 +305,21 @@ export default { ...@@ -306,25 +305,21 @@ export default {
{ {
key: "creatorUserId", key: "creatorUserId",
title: this.l("creatorUserId"), title: this.l("creatorUserId"),
hide: true,
align: "left", align: "left",
}, },
{ {
key: "creationTime", key: "creationTime",
title: this.l("creationTime"), title: this.l("creationTime"),
hide: true,
align: "left", align: "left",
}, },
{ {
key: "lastModifierUserId", key: "lastModifierUserId",
title: this.l("lastModifierUserId"), title: this.l("lastModifierUserId"),
hide: true,
align: "left", align: "left",
}, },
{ {
key: "lastModificationTime", key: "lastModificationTime",
title: this.l("lastModificationTime"), title: this.l("lastModificationTime"),
hide: true,
align: "left", align: "left",
}, },
{ {
...@@ -352,13 +347,11 @@ export default { ...@@ -352,13 +347,11 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true,
}, },
{ {
key: "licensedToWork", key: "licensedToWork",
title: this.l("licensedToWork"), title: this.l("licensedToWork"),
align: "left", align: "left",
hide: true,
}, },
{ {
key: "positionId", key: "positionId",
...@@ -366,7 +359,6 @@ export default { ...@@ -366,7 +359,6 @@ export default {
align: "left", align: "left",
high: true, high: true,
code: "User.base.position", code: "User.base.position",
hide: true,
}, },
{ {
key: "titleId", key: "titleId",
...@@ -374,7 +366,6 @@ export default { ...@@ -374,7 +366,6 @@ export default {
align: "left", align: "left",
high: true, high: true,
code: "User.base.jobtitle", code: "User.base.jobtitle",
hide: true,
}, },
{ {
title: "操作", title: "操作",
...@@ -835,20 +826,22 @@ export default { ...@@ -835,20 +826,22 @@ export default {
this.searchs.pageIndex = 1; this.searchs.pageIndex = 1;
this.searchs.conditions = where; this.searchs.conditions = where;
this.searchs.pageSize = 1000; this.searchs.pageSize = 1000;
this.$api.post(this.action, this.searchs).then((r) => { this.$api.post(this.action, this.searchs).then((r) => {
this.list = r.result.items; this.list = r.result.items;
const tHeader = []; // 设置Excel的表格第一行的标题 const tHeader = []; // 设置Excel的表格第一行的标题
const filterVal = []; //list里对象的属性 const filterVal = []; //list里对象的属性
var tempCol = []; var tempCol = [];
var columnsCur = this.$refs.grid.columnsCur; //导出列信息 var columnsCur = this.columns; //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => { columnsCur.forEach((el) => {
if (!el.hide && el.key != "action") { if (!el.hide && el.key != "action") {
if (el.code) { if (el.code) {
tHeader.push(el.key + "DirName"); //tHeader.push(el.key + "DirName");
filterVal.push(el.key + "DirName"); //filterVal.push(el.key + "DirName");
tempCol.push({ key: el.key + "DirName", code: el.code }); //临时存放code数据字典的字段及对应的数据字典code //tempCol.push({ key: el.key + "DirName", code: el.code }); //临时存放code数据字典的字段及对应的数据字典code
tempCol.push({ key: el.key, code: el.code }); //临时存放code数据字典的字段及对应的数据字典code
} }
tHeader.push(el.key); tHeader.push(this.l(el.key));
filterVal.push(el.key); filterVal.push(el.key);
} }
}); });
...@@ -857,7 +850,7 @@ export default { ...@@ -857,7 +850,7 @@ export default {
tempCol.forEach((ele) => { tempCol.forEach((ele) => {
e[ele.key] = this.$u.dirName( e[ele.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(ele.code), this.$store.getters.dictionaryByKey(ele.code),
e[ele.key.substring(0, ele.key.length - 7)] e[ele.key]
); );
}); });
}); });
...@@ -880,6 +873,7 @@ export default { ...@@ -880,6 +873,7 @@ export default {
ApiDepart.getpaged().then((r) => { ApiDepart.getpaged().then((r) => {
this.departArr = r.result.items; this.departArr = r.result.items;
}); });
console.log(this.columnImport)
}, },
//导入excel文件 //导入excel文件
async beforeUpload(file) { async beforeUpload(file) {
...@@ -893,6 +887,7 @@ export default { ...@@ -893,6 +887,7 @@ export default {
sheet2JSONOpts sheet2JSONOpts
); );
this.$refs.uploadfile.clearFiles();//清除上一次上传文件列表 this.$refs.uploadfile.clearFiles();//清除上一次上传文件列表
//对读取的excel文件数据进行处理 //对读取的excel文件数据进行处理
var tempColums = tempList[0]; //必须保证excel第一行数据行DirName有数据值,否则取不到所有的标题 var tempColums = tempList[0]; //必须保证excel第一行数据行DirName有数据值,否则取不到所有的标题
var arrTitle = Object.keys(tempColums); var arrTitle = Object.keys(tempColums);
...@@ -948,8 +943,9 @@ export default { ...@@ -948,8 +943,9 @@ export default {
} }
}); });
}); });
this.excelData = tempList; this.excelData = tempList;
//console.log(workbook); console.log(workbook);
return false; return false;
}, },
//确定批量导入 //确定批量导入
......
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