Commit f6942b12 authored by 黄奎's avatar 黄奎

页面修改

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