Commit a6dd5135 authored by renjintao's avatar renjintao

process

parent 4c322e84
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<span>导入到</span> <span>导入到</span>
</FormItem> </FormItem>
<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>
<FormItem> <FormItem>
<div class="tip mr20">{{excelData.length}}条数据</div> <div class="tip mr20">{{excelData.length}}条数据</div>
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
<script> <script>
import Api from "./api"; import Api from "./api";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { Switch } from "view-design";
export default { export default {
name: "Edit", name: "Edit",
data() { data() {
...@@ -289,7 +290,7 @@ export default { ...@@ -289,7 +290,7 @@ export default {
}, },
}, },
], ],
columns1: [ columns1: [
{ {
key: "userName", key: "userName",
title: this.l("userName"), title: this.l("userName"),
...@@ -309,7 +310,7 @@ export default { ...@@ -309,7 +310,7 @@ export default {
]); ]);
}, },
}, },
{ {
key: "status", key: "status",
title: this.l("status"), title: this.l("status"),
...@@ -317,96 +318,6 @@ export default { ...@@ -317,96 +318,6 @@ export default {
high: true, high: true,
code: "User.base.status", 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: [ excelData: [
{ {
...@@ -480,13 +391,7 @@ export default { ...@@ -480,13 +391,7 @@ export default {
created() { created() {
this.tdHeightExcel = window.innerHeight - 180; this.tdHeightExcel = window.innerHeight - 180;
//导出对列表头进行预加载start //导出对列表头进行预加载start
let tempCol = this.$u.clone(this.columns); this.loadColum(this.columns);
tempCol.forEach((ele, index) => {
if (ele.key == "action") {
ele.hide = true;
}
});
this.columnsImport = tempCol;
this.$api.get(`${systemUrl}/Department/GetDepartments`).then((r) => { this.$api.get(`${systemUrl}/Department/GetDepartments`).then((r) => {
this.departArr = r.result.items; this.departArr = r.result.items;
}); });
...@@ -530,6 +435,16 @@ export default { ...@@ -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文件 //导入excel文件
async beforeUpload(file) { async beforeUpload(file) {
this.workBook = {}; this.workBook = {};
...@@ -627,6 +542,18 @@ export default { ...@@ -627,6 +542,18 @@ export default {
sheetClick(val) { sheetClick(val) {
this.dealSheet(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() { handleClose() {
this.$emit("on-close"); 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