<template>
|
<div class="user-manage">
|
<div class="top-card">
|
<CommonSearch
|
:show-add="false"
|
:amount-view="false"
|
placeholder="请输入用户名/手机号"
|
@searchClick="onFilterSearch"
|
>
|
<!-- <template slot="leftButton">
|
<el-button size="small" type="primary" @click="addBtnClick">新建</el-button>
|
</template> -->
|
</CommonSearch>
|
</div>
|
|
<div class="body">
|
<div class="body-card">
|
<div class="list-view">
|
<TableCommonView ref="tableListRef" :table-list="tableList" @selTableCol="selTableCol">
|
<template slot="tableButton">
|
<el-table-column label="操作" width="120">
|
<template slot-scope="scope">
|
<el-button @click="viewClick(scope.row)" type="text" size="small">查看</el-button>
|
<el-button @click="approveClick(scope.row)" type="text" size="small">审核</el-button>
|
<el-button @click="editClick(scope.row)" type="text" size="small">编辑</el-button>
|
</template>
|
</el-table-column>
|
</template>
|
</TableCommonView>
|
</div>
|
<div class="btn-pager">
|
<PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
|
</div>
|
</div>
|
</div>
|
<!-- 查看/编辑 -->
|
<EditUserInfo v-if="editConfig.visible" :edit-common-config="editConfig" />
|
<!-- 审核 -->
|
<ReviewDialog v-if="reviewConfig.visible" :edit-common-config="reviewConfig" />
|
</div>
|
</template>
|
|
<script>
|
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
|
import EditUserInfo from "@/views/unifiedManage/userManage/components/EditUserInfo"
|
import ReviewDialog from "@/views/unifiedManage/userManage/components/ReviewDialog"
|
export default {
|
name: "UserManage",
|
props: {},
|
mixins: [pageMixin],
|
components: { EditUserInfo, ReviewDialog },
|
computed: {},
|
data() {
|
return {
|
tableList: {},
|
tableColumn: [
|
{ label: "用户名", prop: "username", default: true },
|
{ label: "手机号", prop: "phone" },
|
{ label: "公司名称", prop: "company" },
|
{ label: "联系人姓名", prop: "contact" },
|
{ label: "邮箱", prop: "email" },
|
{ label: "行业", prop: "industry" },
|
{ label: "地区", prop: "region" },
|
{ label: "状态", prop: "status" }
|
],
|
showCol: ["用户名", "手机号", "公司名称", "联系人姓名", "邮箱", "行业", "地区", "状态"],
|
editConfig: {
|
visible: false,
|
title: "查看",
|
infomation: {}
|
},
|
reviewConfig: {
|
visible: false,
|
infomation: {}
|
}
|
}
|
},
|
created() {
|
this.setTable()
|
},
|
methods: {
|
// 搜索
|
onFilterSearch(val) {
|
console.log(val)
|
},
|
// 查看
|
viewClick(row) {
|
console.log(row)
|
this.editConfig.visible = true
|
this.editConfig.title = "查看"
|
this.editConfig.tableInfomation = { ...row }
|
},
|
// 审核
|
approveClick(row) {
|
console.log(row)
|
this.reviewConfig.visible = true
|
this.reviewConfig.title = "用户审核"
|
this.reviewConfig.tableInfomation = { ...row }
|
},
|
// 编辑
|
editClick(row) {
|
console.log(row)
|
this.editConfig.visible = true
|
this.editConfig.title = "编辑"
|
this.editConfig.tableInfomation = { ...row }
|
},
|
// 列表初始化
|
setTable() {
|
this.tableList = {
|
selectIndex: true,
|
tableInfomation: [
|
{
|
usename: "测试",
|
status: 1
|
}
|
],
|
allcol: [],
|
showcol: this.showCol,
|
tableColumn: this.setColumnVisible(this.showCol)
|
}
|
this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
|
this.searchOptions = []
|
for (let i = 0; i < this.tableList.tableColumn.length; i++) {
|
const label = this.tableList.tableColumn[i].label
|
const value = this.tableList.tableColumn[i].prop
|
this.searchOptions.push({ value: value, label: label })
|
}
|
},
|
setColumnVisible(showCol) {
|
return this.tableColumn.map((ele) => {
|
return {
|
...ele,
|
isShowColumn: showCol.includes(ele.label)
|
}
|
})
|
},
|
selTableCol(val) {
|
this.showcol = val
|
this.tableList.tableColumn = this.setColumnVisible(val)
|
}
|
}
|
}
|
</script>
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<style lang="scss" scoped>
|
.user-manage {
|
height: 100%;
|
.top-card {
|
height: 80px;
|
display: flex;
|
align-items: center;
|
margin: 12px 20px 0 20px;
|
border-radius: 12px;
|
background-color: #fff;
|
padding-left: 20px;
|
}
|
.body {
|
box-sizing: border-box;
|
padding: 10px 20px;
|
border-radius: 12px;
|
height: calc(100% - 92px);
|
.body-card {
|
background-color: #fff;
|
border-radius: 12px;
|
height: 100%;
|
overflow: hidden;
|
}
|
.list-view {
|
height: calc(100% - 60px);
|
overflow: hidden;
|
}
|
.btn-pager {
|
display: flex;
|
margin-top: 10px;
|
.page {
|
margin-left: auto;
|
}
|
}
|
}
|
}
|
|
::v-deep {
|
}
|
</style>
|