|
@@ -1,21 +1,18 @@
|
|
|
<template>
|
|
|
<div class="container">
|
|
|
<div class="header">
|
|
|
- <el-button ref="buttonFocus" class="onlineUser" @click="activeShow">
|
|
|
- <i class="el-icon-user-solid"></i>在用账户
|
|
|
- </el-button>
|
|
|
- <el-button class="disableUser" @click="deactiveShow">
|
|
|
- <i class="el-icon-user"></i>停用账户
|
|
|
- </el-button>
|
|
|
-
|
|
|
- <el-input class="searchBox" v-model="query.name" placeholder="用户名" suffix-icon="el-icon-search" @change="searchEvent"></el-input>
|
|
|
- <el-button class="addUser" @click="addUser">
|
|
|
- <i class="el-icon-user"></i>添加用户
|
|
|
- </el-button>
|
|
|
+ <Tags :tags.sync="tags" @selectChange="handleTagChange"></Tags>
|
|
|
</div>
|
|
|
+ <el-divider style="background-color: #f4f4f4"/>
|
|
|
<div class="showTable">
|
|
|
- <activeuser :name="show == true ? query.name : ''" ref="activeuser" v-show="show"></activeuser>
|
|
|
- <deactiveuser :name="show1 == true ? query.name : ''" ref="deactiveuser" v-show="show1"/>
|
|
|
+ <div class="opr-btn">
|
|
|
+ <el-button type="primary" @click="exportData">导出数据</el-button>
|
|
|
+ <el-button type="primary" @click="batchActivate">批量禁用</el-button>
|
|
|
+ <el-button type="primary" @click="batchDelete">批量删除</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="table-data">
|
|
|
+ <userTableData ref="activeuser" ></userTableData>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<!--弹窗-->
|
|
|
<userinfo ref="addUser" @confirmEvent="confirmEvent"></userinfo>
|
|
@@ -23,27 +20,40 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import activeuser from './tables/activeUser'
|
|
|
-import deactiveuser from './tables/deactiveUser'
|
|
|
+import userTableData from './tables/userTableData.vue'
|
|
|
import userinfo from './messageDialog/addUser'
|
|
|
-import { addUser } from '@/api/user/user';
|
|
|
+import Tags from "@/components/tags/index.vue";
|
|
|
+import {addUser} from '@/api/user/user';
|
|
|
|
|
|
export default {
|
|
|
name: "personManagement",
|
|
|
- components: { activeuser, deactiveuser, userinfo, },
|
|
|
+ components: {userTableData, userinfo, Tags,},
|
|
|
data() {
|
|
|
return {
|
|
|
- show: true,
|
|
|
- show1: false,
|
|
|
+ tags: [
|
|
|
+ {
|
|
|
+ label: '在用账户',
|
|
|
+ value: '1',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '停用账户',
|
|
|
+ value: '2',
|
|
|
+ show: false,
|
|
|
+ }
|
|
|
+ ],
|
|
|
query: {
|
|
|
- name:''
|
|
|
- }
|
|
|
+ name: ''
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
- mounted(){
|
|
|
- this.$refs.buttonFocus.$el.focus();
|
|
|
+ mounted() {
|
|
|
+ //this.$refs.buttonFocus.$el.focus();
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleTagChange(val) {
|
|
|
+ console.log(this.tags)
|
|
|
+ },
|
|
|
activeShow() {
|
|
|
this.show = true;
|
|
|
this.show1 = false;
|
|
@@ -61,7 +71,7 @@ export default {
|
|
|
}, 100)
|
|
|
},
|
|
|
confirmEvent(data) {
|
|
|
- if (this.$refs.addUser.popTitle ==='用户详情') {
|
|
|
+ if (this.$refs.addUser.popTitle === '用户详情') {
|
|
|
let options = {
|
|
|
username: data.username,
|
|
|
password: data.password,
|
|
@@ -89,11 +99,11 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- searchEvent(){
|
|
|
- if(this.show){
|
|
|
+ searchEvent() {
|
|
|
+ if (this.show) {
|
|
|
this.$refs.activeuser.getTableData(this.$refs.activeuser.currentPage);
|
|
|
}
|
|
|
- if(this.show1){
|
|
|
+ if (this.show1) {
|
|
|
this.$refs.deactiveuser.getTableData(this.$refs.deactiveuser.currentPage);
|
|
|
}
|
|
|
}
|
|
@@ -103,101 +113,7 @@ export default {
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
.container {
|
|
|
- position: relative;
|
|
|
- height: 100%;
|
|
|
- line-height: 20px;
|
|
|
- background-color: rgba(255, 255, 255, 1);
|
|
|
- color: rgba(16, 16, 16, 1);
|
|
|
- font-size: 14px;
|
|
|
- text-align: center;
|
|
|
- box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.15);
|
|
|
-
|
|
|
- .header {
|
|
|
- height: 59px;
|
|
|
- left: 218px;
|
|
|
- top: 125px;
|
|
|
- right: 16px;
|
|
|
-
|
|
|
- .onlineUser {
|
|
|
- position: absolute;
|
|
|
- top: 15px;
|
|
|
- left: 20px;
|
|
|
- bottom: 4px;
|
|
|
- width: 100px;
|
|
|
- height: 35px;
|
|
|
- line-height: 20px;
|
|
|
- border-radius: 20px;
|
|
|
- background-color: #FFFFFF;
|
|
|
- color: #C8C8C8;
|
|
|
- font-size: 14px;
|
|
|
- text-align: center;
|
|
|
- padding: 5px;
|
|
|
- }
|
|
|
-
|
|
|
- .onlineUser:focus {
|
|
|
- background-color: #2EA8E6;
|
|
|
- color: #FFFFFF;
|
|
|
- }
|
|
|
-
|
|
|
- .disableUser {
|
|
|
- position: absolute;
|
|
|
- top: 15px;
|
|
|
- left: 135px;
|
|
|
- bottom: 4px;
|
|
|
- width: 100px;
|
|
|
- height: 35px;
|
|
|
- line-height: 20px;
|
|
|
- border-radius: 20px;
|
|
|
- background-color: #FFFFFF;
|
|
|
- color: #C8C8C8;
|
|
|
- font-size: 14px;
|
|
|
- text-align: center;
|
|
|
- padding: 5px;
|
|
|
- }
|
|
|
|
|
|
- .disableUser:focus {
|
|
|
- background-color: #2EA8E6;
|
|
|
- color: #FFFFFF;
|
|
|
- }
|
|
|
-
|
|
|
- .searchBox {
|
|
|
- position: absolute;
|
|
|
- top: 15px;
|
|
|
- right: 141px;
|
|
|
- bottom: 11px;
|
|
|
- width: 350px;
|
|
|
- height: 35px;
|
|
|
- line-height: 20px;
|
|
|
- border-radius: 3px;
|
|
|
- background-color: #F7F9FA;
|
|
|
- color: #D7D8D8;
|
|
|
- font-size: 14px;
|
|
|
- text-align: center;
|
|
|
-
|
|
|
- /deep/.el-input__inner {
|
|
|
- height: 35px;
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- .addUser {
|
|
|
- position: absolute;
|
|
|
- right: 16px;
|
|
|
- top: 15px;
|
|
|
- width: 100px;
|
|
|
- height: 35px;
|
|
|
- background-color: #2EA8E6;
|
|
|
- color: #FFFFFF;
|
|
|
- font-size: 14px;
|
|
|
- text-align: center;
|
|
|
- padding: 5px;
|
|
|
- border-radius: 5px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .showTable {
|
|
|
- padding: 10px 16px 0 20px;
|
|
|
- height: calc(100% - 60px);
|
|
|
- //box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.15);
|
|
|
- }
|
|
|
}
|
|
|
</style>
|