Commit 1db7e6e3 authored by zhengke's avatar zhengke

增加页面

parent a49cc722
<template>
<div class="EmployeList">
<template v-if="empIsShowAdd">
<div class="head-title">
用户列表
<el-button @click="empIsShowAdd=false,clearInfo()" style="float:right;margin-top: -5px;" size="small"
type="primary">
添加用户
</el-button>
</div>
<div class="content">
<div>
<el-alert title="员工登录入口链接:" :closable='false' type="info" style="margin-bottom:20px;">
<span>http://wx.weibaoge.cn/web/index.php?r=admin/passport/login&mall_id=MTI4NQ==</span>
<el-button size="mini" style="margin-left:20px;">复制链接</el-button>
</el-alert>
<div class="searchInput">
<el-input style="display:inline-block;width:225px;height:30px" placeholder="请输入用户昵称"
v-model="msg.NavIconName" size="small" clearable @keyup.enter.native="msg.pageIndex=1,getList()">
</el-input>
<span class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"
@click="msg.pageIndex=1,getList()"> </span>
</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>
<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>
<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="">
</template>
</el-table-column>
</el-table>
<el-pagination style="text-align:right" background @current-change="handleCurrentChange"
:page-size="msg.pageSize" layout="prev, pager, next" :total="total">
</el-pagination>
</div>
</template>
<template v-else>
<div class="head-title">
<span @click="empIsShowAdd=true" style="color:rgb(64, 158, 255);cursor:pointer;">用户管理</span><span
style="margin:0 9px;color:#C0C4CC">/</span><span>用户编辑</span>
</div>
<div class="content">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="120px" style="padding:0 20px;">
<el-form-item label="用户名" prop="EmpAccount">
<el-input v-model="addMsg.EmpAccount" class="w400" size="small" maxlength="20" />
</el-form-item>
<el-form-item label="密码" prop="EmpPwd">
<el-input type="text" v-model="addMsg.EmpPwd" size="small" class="w400" />
</el-form-item>
<el-form-item label="昵称" prop="EmpName">
<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>
<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-group>
</el-form-item>
</el-form>
</div>
<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-dialog>
</div>
</template>
<script>
const cityOptions = ['上海', '北京', '广州', '深圳'];
export default {
data() {
return {
loading: false,
//修改密码弹窗
upPwddialog:false,
checkAll: false,
isIndeterminate: true,
checkedCities: ['上海', '北京'],
cities: cityOptions,
dataList: [{
ID:699,
EmpName:'李四',
EmpAccount:'ck',
CreateTime:'2020-10-25'
}],
msg: {
pageIndex: 1,
pageSize: 15,
},
pwdMsg:{
password:''
},
total: 0,
empIsShowAdd: true,
addMsg: {
EmpAccount: '', //用户名
EmpPwd: '', //密码
EmpName: '', //昵称
RoleAuth: '' //角色
},
rules: {
RoleName: [{
required: true,
message: "请输入用户名",
trigger: "blur"
}],
EmpPwd: [{
required: true,
message: "请输入密码",
trigger: "blur"
}],
EmpName: [{
required: true,
message: "请输入昵称",
trigger: "blur"
}]
},
};
},
created() {
},
methods: {
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
getList() {
this.apipost("/api/Employee/GetRolePageList", this.msg, res => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
} else {
this.Info(res.data.message);
}
})
},
submitform(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate(valid => {
if (valid) {
this.saveMsg();
} else {
return false;
}
});
},
//保存
saveMsg() {
var ckedKeys = this.$refs.tree.getCheckedKeys();
this.addMsg.RoleAuth = ckedKeys.join(',');
this.apipost("/api/Employee/SetRole", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.getList();
this.clearInfo();
this.empIsShowAdd = true;
} else {
this.Info(res.data.message);
}
})
},
//清空
clearInfo() {
this.addMsg.RoleId = 0;
this.addMsg.RoleName = '';
this.addMsg.RoleIntro = '';
this.addMsg.RoleAuth = '';
},
//修改
EditRole(item) {
this.apipost("/api/Employee/GetRole", {
RoleId: item.RoleId
}, res => {
if (res.data.resultCode == 1) {
this.addMsg = res.data.data;
this.empIsShowAdd = false;
let newArr = this.addMsg.RoleAuth.split(',');
setTimeout(() => {
this.$refs.tree.setCheckedKeys(newArr);
}, 10)
} else {
this.Info(res.data.message);
}
})
},
//删除
RemmoveRole(item) {
var that = this;
that.Confirm("是否要删除?", function () {
that.apipost("/api/Employee/RemoveRole", {
RoleId: item.RoleId
}, res => {
if (res.data.resultCode == 1) {
that.getList();
} else {
that.Info(res.data.message);
}
})
})
},
//全选
handleCheckAllChange(val) {
this.checkedCities = val ? cityOptions : [];
this.isIndeterminate = false;
},
handleCheckedCitiesChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.cities.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
}
},
mounted() {
//this.getList();
}
};
</script>
<style>
.EmployeList .content .searchInput {
border: 1px solid #DCDFE6;
border-radius: 4px;
}
.EmployeList .content .searchInput .el-input__inner {
border: none;
outline: none;
height: 30px;
line-height: 30px;
}
.EmployeList .content .searchInput {
line-height: normal;
display: inline-table;
width: 100%;
border-collapse: separate;
border-spacing: 0;
width: 250px;
margin-right: 20px;
}
.EmployeList .content {
background: #fff;
margin-top: 10px;
padding: 20px;
box-sizing: border-box;
}
.EmployeList .el-alert__content{
display: flex;
align-items:center;
}
.EmployeList .el-alert{
padding:0 0 5px 5px;
}
.EmployeList .el-alert__title{
margin-top:5px;
}
</style>
<template>
<div class="Infrastruture">
<template v-if="InfrasShowAdd">
<div class="head-title">
基础设置
</div>
<div class="content">
<div>
<el-form label-width="130px">
<el-tabs v-model="activeName">
<el-tab-pane label="基础设置" name="first">
<el-form-item label="修改密码状态">
<el-switch v-model="msg.IsUpdatePwd" :active-value="1" :inactive-value="0" active-color="#409EFF"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
</el-tab-pane>
<el-tab-pane label="员工登录页设置" name="second">
<el-row>
<div class="el-col el-col-12">
<el-form-item label="员工页面LOGO" size="small">
<el-input v-model="msg.Logo">
<el-tooltip slot="append" class="item" effect="dark" content="建议尺寸:325 * 325"
placement="top-start">
<el-button @click="choicImg=true">上传图片</el-button>
</el-tooltip>
</el-input>
<div v-if="msg.Logo==''">建议尺寸98*36</div>
<img v-else :src="getIconLink(msg.Logo)" style="height:36px;" alt=""/>
</el-form-item>
<el-form-item label="员工页面版权信息" size="small">
<el-input v-model="msg.Copyright"></el-input>
</el-form-item>
<el-form-item label="员工页面版权链接" size="small">
<el-input placeholder="例如:https://www.baidu.com" v-model="msg.CopyrightLink"></el-input>
</el-form-item>
</div>
</el-row>
</el-tab-pane>
</el-tabs>
</el-form>
</div>
</div>
<el-button style="margin-top:20px;padding:9px 25px;" type="primary" @click="saveMsg()" size="small">保存
</el-button>
</template>
<!-- 选择图片文件 -->
<el-dialog title="选择文件" :visible.sync="choicImg" width="1240px">
<ChooseImg @SelectId="SelectId"></ChooseImg>
</el-dialog>
</div>
</template>
<script>
import ChooseImg from "@/components/global/ChooseImg.vue";
export default {
data() {
return {
msg: {
IsUpdatePwd: 1, //0不能修改 1可以修改
Logo: '', //员工页面LOGO
Copyright: "", //员工页面版权信息
CopyrightLink: '' //员工页面版权链接
},
activeName: 'first',
InfrasShowAdd: true,
//选择图片弹窗
choicImg: false,
};
},
components: {
ChooseImg
},
created() {
},
methods: {
//获取信息
GetEmpConfigList(){
this.apipost("/api/Employee/GetEmpConfigList", {
ConfigId:0
}, res => {
console.log(res,'resdsss');
if (res.data.resultCode == 1) {
} else {
this.Info(res.data.message);
}
})
},
//保存信息
saveMsg() {
// this.apipost("/api/MContent/GetInfrastruturePageList", this.msg, res => {
// if (res.data.resultCode == 1) {
// this.dataList = res.data.data.pageData;
// this.total = res.data.data.count;
// } else {
// this.Info(res.data.message);
// }
// })
},
//选择图片
SelectId(msg) {
this.msg.Logo = this.getIconLink(msg.url);
this.choicImg = false;
},
},
mounted() {
this.GetEmpConfigList();
}
};
</script>
<style>
.Infrastruture .content {
background: #fff;
margin-top: 10px;
padding: 20px;
box-sizing: border-box;
}
</style>
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="info" plain @click="EditNavIcon(scope.row)">编辑 </el-button> <img @click="EditNavIcon(scope.row)" src="../../assets/img/userman/edit.png" alt="">
<el-button size="mini" type="info" plain @click="RemmoveNavIcon(scope.row)">删除</el-button> <img @click="RemmoveNavIcon(scope.row)" style="margin-left:10px;" src="../../assets/img/userman/del.png" alt="">
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
<template>
<div class="roleList">
<template v-if="roleIsShowAdd">
<div class="head-title">
角色列表
<el-button @click="roleIsShowAdd=false,clearInfo()" style="float:right;margin-top: -5px;" size="small" type="primary">
添加角色
</el-button>
</div>
<div class="content">
<div>
<div class="searchInput">
<el-input style="display:inline-block;width:225px;height:30px" placeholder="请输入角色名称"
v-model="msg.NavIconName" size="small" clearable @keyup.enter.native="msg.pageIndex=1,getList()">
</el-input>
<span class="el-icon-search" style="color:#979dad;font-size:14px;position:relative;top:1px"
@click="msg.pageIndex=1,getList()"> </span>
</div>
</div>
<el-table :data="dataList" v-loading="loading" border style="width: 100%;margin:20px 0">
<el-table-column prop="RoleId" label="ID" width="80">
</el-table-column>
<el-table-column prop="RoleName" label="角色名称" width="120">
</el-table-column>
<el-table-column prop="RoleIntro" label="备注/描述">
</el-table-column>
<el-table-column prop="Creater" label="创建者" width="150">
</el-table-column>
<el-table-column prop="CreateTime" 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="RemmoveRole(scope.row)" style="margin-left:10px;" src="../../assets/img/userman/del.png" alt="">
</template>
</el-table-column>
</el-table>
<el-pagination style="text-align:right" background @current-change="handleCurrentChange"
:page-size="msg.pageSize" layout="prev, pager, next" :total="total">
</el-pagination>
</div>
</template>
<template v-else>
<div class="head-title">
<span @click="roleIsShowAdd=true" style="color:rgb(64, 158, 255);cursor:pointer;">角色管理</span><span
style="margin:0 9px;color:#C0C4CC">/</span><span>角色编辑</span>
</div>
<div class="content">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="120px" style="padding:0 20px;">
<el-form-item label="角色名称" prop="RoleName">
<el-input v-model="addMsg.RoleName" class="w400" size="small" maxlength="20" />
</el-form-item>
<el-form-item label="备注/描述">
<el-input type="text" v-model="addMsg.RoleIntro" size="small" class="w400"/>
</el-form-item>
<el-form-item label="角色权限">
<el-tree
:data="MenuList"
node-key="MenuId"
ref="tree"
show-checkbox>
</el-tree>
</el-form-item>
</el-form>
</div>
<el-button size="small" style="margin-top:20px;padding:9px 25px;" type="primary" @click="submitform('addMsg')">保存
</el-button>
</template>
</div>
</template>
<script>
export default {
data() {
return {
loading: false,
dataList: [],
msg: {
pageIndex: 1,
pageSize: 15,
},
total: 0,
roleIsShowAdd: true,
MenuList: [], //菜单列表
addMsg: {
RoleName: '', //角色名称
RoleIntro: '', //备注/描述
RoleAuth: '', //角色权限
},
rules: {
RoleName: [{
required: true,
message: "请输入角色名称",
trigger: "blur"
}]
},
};
},
created() {
},
methods: {
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
getList() {
this.apipost("/api/Employee/GetRolePageList", this.msg, res => {
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
} else {
this.Info(res.data.message);
}
})
},
submitform(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate(valid => {
if (valid) {
this.saveMsg();
} else {
return false;
}
});
},
//保存
saveMsg() {
var ckedKeys = this.$refs.tree.getCheckedKeys();
this.addMsg.RoleAuth=ckedKeys.join(',');
this.apipost("/api/Employee/SetRole", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.getList();
this.clearInfo();
this.roleIsShowAdd = true;
} else {
this.Info(res.data.message);
}
})
},
//清空
clearInfo(){
this.addMsg.RoleId = 0;
this.addMsg.RoleName = '';
this.addMsg.RoleIntro = '';
this.addMsg.RoleAuth = '';
},
//修改
EditRole(item) {
this.apipost("/api/Employee/GetRole", {
RoleId: item.RoleId
}, res => {
if (res.data.resultCode == 1) {
this.addMsg = res.data.data;
this.roleIsShowAdd = false;
let newArr = this.addMsg.RoleAuth.split(',');
setTimeout(()=>{
this.$refs.tree.setCheckedKeys(newArr);
},10)
} else {
this.Info(res.data.message);
}
})
},
//删除
RemmoveRole(item) {
var that = this;
that.Confirm("是否要删除?", function () {
that.apipost("/api/Employee/RemoveRole", {
RoleId: item.RoleId
}, res => {
if (res.data.resultCode == 1) {
that.getList();
} else {
that.Info(res.data.message);
}
})
})
},
//获取菜单列表
getMenuList() {
this.apipost("/api/Tenant/GetMenuList", {}, res => {
if (res.data.resultCode == 1) {
this.MenuList = res.data.data;
this.MenuList.forEach(x=>{
x.children=x.SubList;
x.label=x.MenuName
if(x.children.length>0){
x.children.forEach(y=>{
y.children=y.ThirdList;
y.label=y.MenuName
if(y.children.length>0){
y.children.forEach(z=>{
z.label=z.MenuName;
})
}
})
}
})
} else {
this.Info(res.data.message);
}
})
},
},
mounted() {
this.getList();
this.getMenuList();
}
};
</script>
<style>
.roleList .content .searchInput {
border: 1px solid #DCDFE6;
border-radius: 4px;
}
.roleList .content .searchInput .el-input__inner {
border: none;
outline: none;
height: 30px;
line-height: 30px;
}
.roleList .content .searchInput {
line-height: normal;
display: inline-table;
width: 100%;
border-collapse: separate;
border-spacing: 0;
width: 250px;
margin-right: 20px;
}
.roleList .content {
background: #fff;
margin-top: 10px;
padding: 20px;
box-sizing: border-box;
}
</style>
...@@ -346,6 +346,24 @@ export default new Router({ ...@@ -346,6 +346,24 @@ export default new Router({
name: 'liveManage', name: 'liveManage',
component: resolve => require(['@/components/StoreDesign/liveManage'], resolve), component: resolve => require(['@/components/StoreDesign/liveManage'], resolve),
}, },
//店铺管理 员工管理 基础设置
{
path: '/Infrastructure',
name: 'Infrastructure',
component: resolve => require(['@/components/StoreDesign/Infrastructure'], resolve),
},
//店铺管理 员工管理 角色列表
{
path: '/roleList',
name: 'roleList',
component: resolve => require(['@/components/StoreDesign/roleList'], resolve),
},
//店铺管理 员工管理 员工列表
{
path: '/EmployeesList',
name: 'EmployeesList',
component: resolve => require(['@/components/StoreDesign/EmployeesList'], resolve),
},
//店铺管理 小程序页面标题 //店铺管理 小程序页面标题
{ {
path: '/minititle', path: '/minititle',
......
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