Commit f6942b12 authored by 黄奎's avatar 黄奎

页面修改

parent b5fd127a
......@@ -23,20 +23,19 @@
</div>
</div>
<el-table :data="dataList" v-loading="loading" border style="width: 100%;margin:20px 0">
<el-table-column prop="ID" label="ID" width="80">
<el-table-column prop="EmpId" label="ID" width="80">
</el-table-column>
<el-table-column prop="EmpName" label="昵称">
</el-table-column>
<el-table-column prop="EmpAccount" label="用户名">
</el-table-column>
<el-table-column prop="CreateTime" label="添加日期" width="220">
<el-table-column prop="CreateDateStr" label="添加日期" width="220">
</el-table-column>
<el-table-column label="操作" width="260">
<template slot-scope="scope">
<img @click="EditRole(scope.row)" src="../../assets/img/userman/edit.png" alt="">
<img @click="upPwddialog=true" style="margin:0 10px;" src="../../assets/img/userman/change.png" alt="">
<img @click="RemmoveRole(scope.row)" src="../../assets/img/userman/del.png"
alt="">
<img @click="RemmoveRole(scope.row)" src="../../assets/img/userman/del.png" alt="">
</template>
</el-table-column>
</el-table>
......@@ -62,10 +61,12 @@
<el-input type="text" v-model="addMsg.EmpName" size="small" class="w400" />
</el-form-item>
<el-form-item label="角色">
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选
</el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
<el-checkbox v-for="city in cities" :label="city" :key="city">{{city}}</el-checkbox>
<el-checkbox v-for="item in RoleList" :label="item.RoleName" :key="item.RoleId">{{item.RoleName}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
......@@ -73,52 +74,47 @@
<el-button size="small" style="margin-top:20px;padding:9px 25px;" type="primary" @click="submitform('addMsg')">保存
</el-button>
</template>
<!-- 修改密码 -->
<!-- 修改密码 -->
<el-dialog title="提示" :visible.sync="upPwddialog" width="400px">
<el-form label-width="0">
<p style="padding:10px 0">请输入新密码</p>
<el-input type="text" v-model="pwdMsg.password"></el-input>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="upPwddialog = false">取 消</el-button>
<el-button size="small" type="primary">确 定</el-button>
</span>
<el-form label-width="0">
<p style="padding:10px 0">请输入新密码</p>
<el-input type="text" v-model="pwdMsg.password"></el-input>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="upPwddialog = false">取 消</el-button>
<el-button size="small" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
const cityOptions = ['上海', '北京', '广州', '深圳'];
export default {
data() {
return {
loading: false,
//修改密码弹窗
upPwddialog:false,
upPwddialog: false,
checkAll: false,
isIndeterminate: true,
checkedCities: ['上海', '北京'],
cities: cityOptions,
dataList: [{
ID:699,
EmpName:'李四',
EmpAccount:'ck',
CreateTime:'2020-10-25'
}],
checkedCities: [],
dataList: [],
msg: {
pageIndex: 1,
pageSize: 15,
},
pwdMsg:{
password:''
pwdMsg: {
password: ''
},
total: 0,
empIsShowAdd: true,
addMsg: {
EmpId: 0, //员工编号
EmpAccount: '', //用户名
EmpPwd: '', //密码
EmpName: '', //昵称
RoleAuth: '' //角色
},
RoleList: [], //角色列表
rules: {
RoleName: [{
required: true,
......@@ -147,9 +143,10 @@
this.getList();
},
getList() {
this.apipost("/api/Employee/GetRolePageList", this.msg, res => {
this.apipost("/api/Employee/GetEmployeePageList", this.msg, res => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
console.log("this.datalist", this.dataList);
this.total = res.data.data.count;
} else {
this.Info(res.data.message);
......@@ -168,9 +165,9 @@
},
//保存
saveMsg() {
var ckedKeys = this.$refs.tree.getCheckedKeys();
this.addMsg.RoleAuth = ckedKeys.join(',');
this.apipost("/api/Employee/SetRole", this.addMsg, res => {
// var ckedKeys = this.$refs.tree.getCheckedKeys();
// this.addMsg.RoleAuth = ckedKeys.join(',');
this.apipost("/api/Employee/SetEmployee", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.getList();
this.clearInfo();
......@@ -182,15 +179,16 @@
},
//清空
clearInfo() {
this.addMsg.RoleId = 0;
this.addMsg.RoleName = '';
this.addMsg.RoleIntro = '';
this.addMsg.EmpId = 0;
this.addMsg.EmpAccount = '';
this.addMsg.EmpPwd = '';
this.addMsg.EmpName = '';
this.addMsg.RoleAuth = '';
},
//修改
EditRole(item) {
this.apipost("/api/Employee/GetRole", {
RoleId: item.RoleId
this.apipost("/api/Employee/GetEmployee", {
EmpId: item.EmpId
}, res => {
if (res.data.resultCode == 1) {
this.addMsg = res.data.data;
......@@ -208,8 +206,8 @@
RemmoveRole(item) {
var that = this;
that.Confirm("是否要删除?", function () {
that.apipost("/api/Employee/RemoveRole", {
RoleId: item.RoleId
that.apipost("/api/Employee/RemoveEmployee", {
EmpId: item.EmpId
}, res => {
if (res.data.resultCode == 1) {
that.getList();
......@@ -221,27 +219,38 @@
},
//全选
handleCheckAllChange(val) {
this.checkedCities = val ? cityOptions : [];
this.checkedCities = val ? this.RoleList : [];
this.isIndeterminate = false;
},
handleCheckedCitiesChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.cities.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
this.checkAll = checkedCount === this.RoleList.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.RoleList.length;
},
//点击复制
copyCode(){
copyCode() {
var copycode = document.getElementById("my_Link").innerHTML;
    var input = document.createElement("input");   // 直接构建input
    input.value = copycode;  // 设置内容
    document.body.appendChild(input);    // 添加临时实例
    input.select();   // 选择实例内容
    document.execCommand("Copy");   // 执行复制
    document.body.removeChild(input); // 删除临时实例
var input = document.createElement("input"); // 直接构建input
input.value = copycode; // 设置内容
document.body.appendChild(input); // 添加临时实例
input.select(); // 选择实例内容
document.execCommand("Copy"); // 执行复制
document.body.removeChild(input); // 删除临时实例
},
//获取角色列表
getRoleList() {
this.apipost("/api/Employee/GetRoleList", {}, res => {
if (res.data.resultCode == 1) {
this.RoleList = res.data.data;
} else {
this.Info(res.data.message);
}
})
}
},
mounted() {
//this.getList();
this.getRoleList();
this.getList();
}
};
......@@ -275,14 +284,18 @@
padding: 20px;
box-sizing: border-box;
}
.EmployeList .el-alert__content{
.EmployeList .el-alert__content {
display: flex;
align-items:center;
align-items: center;
}
.EmployeList .el-alert{
padding:0 0 5px 5px;
.EmployeList .el-alert {
padding: 0 0 5px 5px;
}
.EmployeList .el-alert__title{
margin-top:5px;
.EmployeList .el-alert__title {
margin-top: 5px;
}
</style>
......@@ -24,9 +24,9 @@
</el-table-column>
<el-table-column prop="RoleIntro" label="备注/描述">
</el-table-column>
<el-table-column prop="Creater" label="创建者" width="150">
<el-table-column prop="CreateByName" label="创建者" width="150">
</el-table-column>
<el-table-column prop="CreateTime" label="添加日期" width="220">
<el-table-column prop="CreateDateStr" label="添加日期" width="220">
</el-table-column>
<el-table-column label="操作" width="260">
<template slot-scope="scope">
......
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