|
@@ -6,26 +6,19 @@
|
|
<el-button class="delete" @click="batchDelete">批量删除</el-button>
|
|
<el-button class="delete" @click="batchDelete">批量删除</el-button>
|
|
</div>
|
|
</div>
|
|
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" :header-cell-style="{ textAlign: 'center' }"
|
|
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" :header-cell-style="{ textAlign: 'center' }"
|
|
- :cell-style="{ textAlign: 'center' }" height="405" style="width: 100%" @selection-change="handleSelectionChange">
|
|
|
|
- <el-table-column type="selection" width="50">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="username" label="用户名">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="phone_num" label="手机号">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="email" label="邮箱">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="role" label="角色">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="permission" label="权限">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="working_address" label="单位">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="register_time" label="注册时间">
|
|
|
|
- </el-table-column>
|
|
|
|
|
|
+ :cell-style="{ textAlign: 'center' }" height="405" style="width: 100%"
|
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
|
+ <el-table-column type="selection" width="50"> </el-table-column>
|
|
|
|
+ <el-table-column prop="username" label="用户名"> </el-table-column>
|
|
|
|
+ <el-table-column prop="phone" label="手机号"> </el-table-column>
|
|
|
|
+ <el-table-column prop="email" label="邮箱"> </el-table-column>
|
|
|
|
+ <el-table-column prop="role" label="角色"> </el-table-column>
|
|
|
|
+ <el-table-column prop="permission" label="权限"> </el-table-column>
|
|
|
|
+ <el-table-column prop="working_address" label="单位"> </el-table-column>
|
|
|
|
+ <el-table-column prop="register_time" label="注册时间"> </el-table-column>
|
|
<el-table-column prop="status" label="状态">
|
|
<el-table-column prop="status" label="状态">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-tag :color="scope.row.status == true ? '#06f77e' : '#757776'"></el-tag>
|
|
|
|
|
|
+ <el-tag :color="scope.row.status !== null || undefined ? '#06f77e' : '#757776'"></el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="operation" label="操作">
|
|
<el-table-column prop="operation" label="操作">
|
|
@@ -64,7 +57,7 @@ export default {
|
|
pagerCount: 5,
|
|
pagerCount: 5,
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
pageSizes: [5, 10, 20, 30],
|
|
pageSizes: [5, 10, 20, 30],
|
|
- total: 0,
|
|
|
|
|
|
+ total: 30,
|
|
currentChange: (val) => {
|
|
currentChange: (val) => {
|
|
this.getTableData(val);
|
|
this.getTableData(val);
|
|
},
|
|
},
|
|
@@ -72,7 +65,7 @@ export default {
|
|
this.handleSizeChange(val);
|
|
this.handleSizeChange(val);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- }
|
|
|
|
|
|
+ };
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.initData();
|
|
this.initData();
|
|
@@ -89,27 +82,32 @@ export default {
|
|
},
|
|
},
|
|
getTableData(page) {
|
|
getTableData(page) {
|
|
this.tableData = [];
|
|
this.tableData = [];
|
|
- getUserList(
|
|
|
|
- 0,
|
|
|
|
- page,
|
|
|
|
- this.currentPageSize
|
|
|
|
- ).then((res) => {
|
|
|
|
|
|
+ getUserList(0, page, this.currentPageSize).then((res) => {
|
|
if (res.data.code === 0 && res.data.data.length > 0) {
|
|
if (res.data.code === 0 && res.data.data.length > 0) {
|
|
this.paginationData.total = res.data.total;
|
|
this.paginationData.total = res.data.total;
|
|
this.tableData = res.data.data.map((e) => {
|
|
this.tableData = res.data.data.map((e) => {
|
|
return {
|
|
return {
|
|
username: e.name,
|
|
username: e.name,
|
|
- phone: e.phone,
|
|
|
|
- email: e.email,
|
|
|
|
- role: e.role,
|
|
|
|
- permission: e.permission,
|
|
|
|
- working_address: e.company,
|
|
|
|
- register_time: e.register_time,
|
|
|
|
- status: e.on_job_status
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ phone: e.phone == "undefined" || !e.phone ? "--" : e.phone,
|
|
|
|
+ email: e.email == "undefined" || !e.email ? "--" : e.email,
|
|
|
|
+ role: e.role == "undefined" || !e.role ? "--" : e.role,
|
|
|
|
+ permission:
|
|
|
|
+ e.permission == "undefined" || !e.permission
|
|
|
|
+ ? e.permission
|
|
|
|
+ : "--",
|
|
|
|
+ working_address:
|
|
|
|
+ e.company == "undefined" || !e.company ? "--" : e.company,
|
|
|
|
+ register_time: this.$dayjs(e.register_time).format(
|
|
|
|
+ "YYYY-MM-DD HH:mm:ss"
|
|
|
|
+ ),
|
|
|
|
+ status:
|
|
|
|
+ e.on_job_status == "undefined" || !e.on_job_status
|
|
|
|
+ ? "--"
|
|
|
|
+ : e.on_job_status,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
handleSizeChange(val) {
|
|
handleSizeChange(val) {
|
|
this.currentPageSize = val;
|
|
this.currentPageSize = val;
|
|
@@ -125,38 +123,28 @@ export default {
|
|
let options = {
|
|
let options = {
|
|
id: data.id,
|
|
id: data.id,
|
|
username: data.username,
|
|
username: data.username,
|
|
- password: data.password
|
|
|
|
|
|
+ password: data.password,
|
|
};
|
|
};
|
|
deleteSingleUser(options).then((res) => {
|
|
deleteSingleUser(options).then((res) => {
|
|
if (res.data.code === 0) {
|
|
if (res.data.code === 0) {
|
|
- this.$message.success('删除成功');
|
|
|
|
|
|
+ this.$message.success("删除成功");
|
|
this.getTableData(1);
|
|
this.getTableData(1);
|
|
}
|
|
}
|
|
- })
|
|
|
|
- },
|
|
|
|
- userDetail(data) {
|
|
|
|
-
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
+ userDetail(data) { },
|
|
userInfoEdit(data) {
|
|
userInfoEdit(data) {
|
|
let options = {
|
|
let options = {
|
|
id: data.id,
|
|
id: data.id,
|
|
-
|
|
|
|
};
|
|
};
|
|
- updateUserDetail(options).then((res) => {
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- batchActivate() {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- batchDelete() {
|
|
|
|
-
|
|
|
|
|
|
+ updateUserDetail(options).then((res) => { });
|
|
},
|
|
},
|
|
- exportData() {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ batchActivate() { },
|
|
|
|
+ batchDelete() { },
|
|
|
|
+ exportData() { },
|
|
|
|
+ },
|
|
}
|
|
}
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
.el-tag {
|
|
.el-tag {
|