|
@@ -1,15 +1,14 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-table ref="multipleTable" border :data="tableData" tooltip-effect="dark"
|
|
|
- :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }" style="width: 100%"
|
|
|
- @selection-change="handleSelectionChange">
|
|
|
+ <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" :header-cell-style="{ textAlign: 'center' }"
|
|
|
+ :cell-style="{ textAlign: 'center' }" style="width: 98%" @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="e_mail" label="邮箱">
|
|
|
+ <el-table-column prop="email" label="邮箱">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="role" label="角色">
|
|
|
</el-table-column>
|
|
@@ -17,7 +16,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="working_address" label="单位">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="registed_time" label="注册时间">
|
|
|
+ <el-table-column prop="register_time" label="注册时间">
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="status" label="状态">
|
|
|
<template slot-scope="scope">
|
|
@@ -25,86 +24,100 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="operation" label="操作">
|
|
|
- <el-button size="mini" type="text">查看</el-button>
|
|
|
- <el-button size="mini" type="text">编辑</el-button>
|
|
|
+ <el-button size="mini" type="text" @click="userDetail">查看</el-button>
|
|
|
+ <el-button size="mini" type="text" @click="userInfoEdit">编辑</el-button>
|
|
|
<el-button size="mini" type="text">删除</el-button>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<div class="bottom">
|
|
|
- <div>
|
|
|
- <checkbox class="checkbox" :total="total"></checkbox>
|
|
|
- <el-button class="check-cancel" size="mini" type="text" @click="cancleChecked">取消</el-button>
|
|
|
- </div>
|
|
|
- <div class="bottom_button" v-show="show">
|
|
|
+ <div class="bottom_button">
|
|
|
<el-button class="delete" type="text">批量删除</el-button>
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
<el-button class="disabled" type="text">批量激活</el-button>
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
<el-button class="export" type="text">导出数据</el-button>
|
|
|
</div>
|
|
|
- <page></page>
|
|
|
+ <page class="page" :paginationData="paginationData"></page>
|
|
|
</div>
|
|
|
+ <!--弹窗-->
|
|
|
+ <user-detail ref="userDetail"></user-detail>
|
|
|
+ <userInfoEdit ref="userInfoEdit"></userInfoEdit>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import checkbox from '@/components/Checkbox/index'
|
|
|
-import page from '@/components/pagination/index'
|
|
|
+import page from '@/components/pagination/index';
|
|
|
+import { getUserList } from '@/api/user/user';
|
|
|
+import UserDetail from '../messageDialog/userInfoDetail';
|
|
|
+import userInfoEdit from '../messageDialog/userInfoEdit';
|
|
|
export default {
|
|
|
- components: { checkbox, page },
|
|
|
+ components: { page,UserDetail,userInfoEdit },
|
|
|
data() {
|
|
|
return {
|
|
|
- tableData: [{
|
|
|
- username: 'admin',
|
|
|
- phone_num: '12345678901',
|
|
|
- e_mail: 'admin@xxxx.com',
|
|
|
- role: '管理员',
|
|
|
- permission: '1级',
|
|
|
- working_address: '北京电信规划设计院',
|
|
|
- registed_time: '2022-08-09 19:00',
|
|
|
- status: true
|
|
|
- }, {
|
|
|
- username: 'admin',
|
|
|
- phone_num: '12345678901',
|
|
|
- e_mail: 'admin@xxxx.com',
|
|
|
- role: '管理员',
|
|
|
- permission: '1级',
|
|
|
- working_address: '北京电信规划设计院',
|
|
|
- registed_time: '2022-08-09 19:00',
|
|
|
- status: false
|
|
|
- }, {
|
|
|
- username: 'admin',
|
|
|
- phone_num: '12345678901',
|
|
|
- e_mail: 'admin@xxxx.com',
|
|
|
- role: '管理员',
|
|
|
- permission: '1级',
|
|
|
- working_address: '北京电信规划设计院',
|
|
|
- registed_time: '2022-08-09 19:00',
|
|
|
- status: true
|
|
|
- }, {
|
|
|
- username: 'admin',
|
|
|
- phone_num: '12345678901',
|
|
|
- e_mail: 'admin@xxxx.com',
|
|
|
- role: '管理员',
|
|
|
- permission: '1级',
|
|
|
- working_address: '北京电信规划设计院',
|
|
|
- registed_time: '2022-08-09 19:00',
|
|
|
- status: false
|
|
|
- },],
|
|
|
+ tableData: [],
|
|
|
multipleSelection: [],
|
|
|
- show: true,
|
|
|
- total:0
|
|
|
+ currentPageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ paginationData: {
|
|
|
+ pageSize: 10,
|
|
|
+ pagerCount: 5,
|
|
|
+ currentPage: 1,
|
|
|
+ pageSizes: [5, 10, 20, 30],
|
|
|
+ total: 30,
|
|
|
+ currentChange: (val) => {
|
|
|
+ this.getTableData(val);
|
|
|
+ },
|
|
|
+ handleSizeChange: (val) => {
|
|
|
+ this.handleSizeChange(val);
|
|
|
+ },
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.initData();
|
|
|
+ },
|
|
|
methods: {
|
|
|
- cancleChecked() {
|
|
|
- //
|
|
|
+ initData() {
|
|
|
+ this.getTableData(1);
|
|
|
},
|
|
|
- handleSelectionChange(){
|
|
|
-
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.multipleSelection = val;
|
|
|
},
|
|
|
handleClick() {
|
|
|
//
|
|
|
+ },
|
|
|
+ getTableData(page) {
|
|
|
+ this.tableData = [];
|
|
|
+ getUserList(
|
|
|
+ 0,
|
|
|
+ page
|
|
|
+ ).then((res) => {
|
|
|
+ if (res.data.code === 0 && res.data.data.length > 0) {
|
|
|
+ this.tableData = res.data.data.map((e) => {
|
|
|
+ return {
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ console.log(`每页 ${val} 条`);
|
|
|
+ this.currentPageSize = val;
|
|
|
+ this.getTableData(this.currentPage);
|
|
|
+ },
|
|
|
+ userDetail(){
|
|
|
+ this.$refs.userDetail.dialogVisible = true;
|
|
|
+ },
|
|
|
+ userInfoEdit(){
|
|
|
+ this.$refs.userInfoEdit.dialogVisible = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -117,35 +130,77 @@ export default {
|
|
|
padding: 0;
|
|
|
}
|
|
|
|
|
|
+.el-table {
|
|
|
+ position: absolute;
|
|
|
+ top: 60px;
|
|
|
+ left: 0;
|
|
|
+ margin-left: 1%;
|
|
|
+ height: 400px;
|
|
|
+ border: 1px solid #f0f2f2;
|
|
|
+ margin-top: 10px;
|
|
|
+ font-size: 0.95rem;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #b2b2b2;
|
|
|
+ background: rgba(255, 255, 255, 0.8);
|
|
|
+
|
|
|
+ /deep/th {
|
|
|
+ background: #f7fbff;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/.el-checkbox {
|
|
|
+ color: #b2b2b2;
|
|
|
+
|
|
|
+ .el-checkbox__input.is-checked+.el-checkbox__label {
|
|
|
+ color: #2ea8e6;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-checkbox__input.is-checked .el-checkbox__inner::after {
|
|
|
+ width: 70%;
|
|
|
+ height: 70%;
|
|
|
+ background: #2ea8e6;
|
|
|
+ border-radius: 0;
|
|
|
+ transform: rotate(0deg) scaleY(1);
|
|
|
+ position: static;
|
|
|
+ // border: 1px solid #8DD9FF;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-checkbox__inner {
|
|
|
+ border: 1px solid #8dd9ff;
|
|
|
+ background: rgba(0, 170, 255, 0);
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ position: static;
|
|
|
+
|
|
|
+ &::after {
|
|
|
+ transition: 0ms;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-checkbox__label {
|
|
|
+ padding-left: 0;
|
|
|
+ font-size: 15px;
|
|
|
+ position: absolute;
|
|
|
+ top: 1px;
|
|
|
+ left: 25px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.bottom {
|
|
|
position: absolute;
|
|
|
- left: 20px;
|
|
|
- right: 16px;
|
|
|
- bottom: 20px;
|
|
|
+ bottom: 10px;
|
|
|
+ left: 50px;
|
|
|
height: 50px;
|
|
|
+ width: 95%;
|
|
|
line-height: 20px;
|
|
|
background-color: rgba(255, 255, 255, 1);
|
|
|
text-align: center;
|
|
|
|
|
|
- .checkbox {
|
|
|
- position: absolute;
|
|
|
- left: 29px;
|
|
|
- top: 15px;
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
-
|
|
|
- .check-cancel {
|
|
|
- position: absolute;
|
|
|
- // line-height: 20px;
|
|
|
- font-size: 14px;
|
|
|
- text-align: center;
|
|
|
- left: 140px;
|
|
|
- top: 10px;
|
|
|
- }
|
|
|
-
|
|
|
.bottom_button {
|
|
|
position: absolute;
|
|
|
- left: 200px;
|
|
|
+ left: 20px;
|
|
|
margin-top: 15px;
|
|
|
|
|
|
.delete {
|