Commit a6dd5135 authored by renjintao's avatar renjintao

process

parent 4c322e84
......@@ -14,7 +14,7 @@
<span>导入到</span>
</FormItem>
<FormItem>
<dictionary code="import.im.page" style="width:160px"></dictionary>
<dictionary code="import.im.page" style="width:160px" @on-change="pageChange"></dictionary>
</FormItem>
<FormItem>
<div class="tip mr20">{{excelData.length}}条数据</div>
......@@ -56,6 +56,7 @@
<script>
import Api from "./api";
import XLSX from "xlsx";
import { Switch } from "view-design";
export default {
name: "Edit",
data() {
......@@ -289,7 +290,7 @@ export default {
},
},
],
columns1: [
columns1: [
{
key: "userName",
title: this.l("userName"),
......@@ -309,7 +310,7 @@ export default {
]);
},
},
{
key: "status",
title: this.l("status"),
......@@ -317,96 +318,6 @@ export default {
high: true,
code: "User.base.status",
},
{
key: "departmentId",
title: this.l("departmentId"),
align: "right",
easy: true,
high: true,
},
{
key: "departmentTitle",
title: this.l("departmentTitle"),
align: "left",
easy: true,
high: true,
},
{
key: "roleTitles",
title: this.l("roleTitles"),
align: "left",
easy: true,
high: true,
hide: true,
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: {
oprate: "detail",
class:
params.row.roleTitles == null ||
params.row.roleTitles == ""
? "empower"
: "detail",
},
on: { click: () => this.authorize(params.row.id) },
},
params.row.roleTitles == null || params.row.roleTitles == ""
? "授权"
: params.row.roleTitles
),
]);
},
},
{
key: "accountId",
title: this.l("accountId"),
hide: true,
align: "left",
},
// {
// key: 'userType',
// title: this.l('userType'),
// hide: true,
// align: 'left'
// },
{
key: "phone",
title: this.l("phone"),
align: "left",
easy: true,
high: true,
},
{
key: "email",
title: this.l("email"),
align: "left",
easy: true,
high: true,
},
{
key: "licensedToWork",
title: this.l("licensedToWork"),
align: "left",
},
{
key: "positionId",
title: this.l("positionId"),
align: "left",
high: true,
code: "User.base.position",
},
{
key: "titleId",
title: this.l("titleId"),
align: "left",
high: true,
code: "User.base.jobtitle",
},
],
excelData: [
{
......@@ -480,13 +391,7 @@ export default {
created() {
this.tdHeightExcel = window.innerHeight - 180;
//导出对列表头进行预加载start
let tempCol = this.$u.clone(this.columns);
tempCol.forEach((ele, index) => {
if (ele.key == "action") {
ele.hide = true;
}
});
this.columnsImport = tempCol;
this.loadColum(this.columns);
this.$api.get(`${systemUrl}/Department/GetDepartments`).then((r) => {
this.departArr = r.result.items;
});
......@@ -530,6 +435,16 @@ export default {
}
});
},
//重新处理colum
loadColum(columns) {
let tempCol = this.$u.clone(columns);
tempCol.forEach((ele, index) => {
if (ele.key == "action") {
ele.hide = true;
}
});
this.columnsImport = tempCol;
},
//导入excel文件
async beforeUpload(file) {
this.workBook = {};
......@@ -627,6 +542,18 @@ export default {
sheetClick(val) {
this.dealSheet(val);
},
pageChange(val) {
switch (val) {
case 0:
this.loadColum(this.columns);
break;
case 1:
this.loadColum(this.columns1);
break;
default:
this.loadColum(this.columns);
}
},
handleClose() {
this.$emit("on-close");
},
......
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