Commit 7ca70bdf authored by renjintao's avatar renjintao

user 导出

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