This commit is contained in:
DESKTOP-369JRHT\12997 2024-07-11 14:48:40 +08:00
commit b1c92b7bfc
3 changed files with 72 additions and 65 deletions

View File

@ -28,64 +28,64 @@
<template slot="title"> <template slot="title">
<div v-if="!isCollapse" > <div v-if="!isCollapse" >
<!-- <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />--> <!-- <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />-->
<span style="margin-right: 10px;" v-if="item.meta.title=='交接班'"> <span style="margin-right: 10px;" v-if="item.meta && item.meta.title=='交接班'">
<img src="@/assets/menu_icon/ren.png" v-if="!activeMenu.includes('/handover')" style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/ren.png" v-if="!activeMenu.includes('/handover')" style="width: 21px;height: 21px;"/>
<img src="@/assets/menu_icon/ren_b.png" v-else style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/ren_b.png" v-else style="width: 21px;height: 21px;"/>
</span> </span>
<span style="margin-right: 10px;" v-if="item.meta.title=='码牌管理'"> <span style="margin-right: 10px;" v-if="item.meta && item.meta.title=='码牌管理'">
<img src="@/assets/menu_icon/code.png" v-if="!activeMenu.includes(item.path)" style="width: 25px;height: 25px;"/> <img src="@/assets/menu_icon/code.png" v-if="!activeMenu.includes(item.path)" style="width: 25px;height: 25px;"/>
<img src="@/assets/menu_icon/code_b.png" v-else style="width: 25px;height: 25px;"/> <img src="@/assets/menu_icon/code_b.png" v-else style="width: 25px;height: 25px;"/>
</span> </span>
<span style="margin-right: 10px;" v-if="item.meta.title=='财务报表'"> <span style="margin-right: 10px;" v-if="item.meta && item.meta.title=='财务报表'">
<img src="@/assets/menu_icon/caiwu1.png" v-if="!activeMenu.includes('/financialStatement')" style="width: 25px;height: 25px;"/> <img src="@/assets/menu_icon/caiwu1.png" v-if="!activeMenu.includes('/financialStatement')" style="width: 25px;height: 25px;"/>
<img src="@/assets/menu_icon/caiwu1_b.png" v-else style="width: 25px;height: 25px;"/> <img src="@/assets/menu_icon/caiwu1_b.png" v-else style="width: 25px;height: 25px;"/>
</span> </span>
<span style="margin-right: 10px;" v-if="item.meta.title=='机构管理'"> <span style="margin-right: 10px;" v-if="item.meta && item.meta.title=='机构管理'">
<img src="@/assets/menu_icon/jigou.png" v-if="!activeMenu.includes('/Site') && !activeMenu.includes('/Service')" style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/jigou.png" v-if="!activeMenu.includes('/Site') && !activeMenu.includes('/Service')" style="width: 21px;height: 21px;"/>
<img src="@/assets/menu_icon/jigou_b.png" v-else style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/jigou_b.png" v-else style="width: 21px;height: 21px;"/>
</span> </span>
<span style="margin-right: 10px;" v-if="item.meta.title=='小程序设置'"> <span style="margin-right: 10px;" v-if="item.meta && item.meta.title=='小程序设置'">
<img src="@/assets/menu_icon/apple.png" v-if="!activeMenu.includes('/indexBanner')" style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/apple.png" v-if="!activeMenu.includes('/indexBanner')" style="width: 21px;height: 21px;"/>
<img src="@/assets/menu_icon/apple_b.png" v-else style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/apple_b.png" v-else style="width: 21px;height: 21px;"/>
</span> </span>
<span style="margin-right: 10px;" v-if="item.meta.title=='门店管理'"> <span style="margin-right: 10px;" v-if="item.meta && item.meta.title=='门店管理'">
<img src="@/assets/menu_icon/shouye.png" v-if="!activeMenu.includes(item.path) && !activeMenu.includes('/staff') && !activeMenu.includes('/feedBack') && !activeMenu.includes('/duty')" style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/shouye.png" v-if="!activeMenu.includes(item.path) && !activeMenu.includes('/staff') && !activeMenu.includes('/feedBack') && !activeMenu.includes('/duty')" style="width: 21px;height: 21px;"/>
<img src="@/assets/menu_icon/shouye_b.png" v-else style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/shouye_b.png" v-else style="width: 21px;height: 21px;"/>
</span> </span>
<span style="margin-right: 10px;" v-if="item.meta.title=='会员管理'"> <span style="margin-right: 10px;" v-if="item.meta && item.meta.title=='会员管理'">
<img src="@/assets/menu_icon/user.png" v-if="!activeMenu.includes(item.path) && !activeMenu.includes('/userGrade')" style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/user.png" v-if="!activeMenu.includes(item.path) && !activeMenu.includes('/userGrade')" style="width: 21px;height: 21px;"/>
<img src="@/assets/menu_icon/user_b.png" v-else style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/user_b.png" v-else style="width: 21px;height: 21px;"/>
</span> </span>
<span style="margin-right: 10px;" v-if="item.meta.title=='油站管理'"> <span style="margin-right: 10px;" v-if="item.meta && item.meta.title=='油站管理'">
<img src="@/assets/menu_icon/youqiang.png" v-if="!activeMenu.includes(item.path)" style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/youqiang.png" v-if="!activeMenu.includes(item.path)" style="width: 21px;height: 21px;"/>
<img src="@/assets/menu_icon/youqiang_b.png" v-else style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/youqiang_b.png" v-else style="width: 21px;height: 21px;"/>
</span> </span>
<span style="margin-right: 10px;" v-if="item.meta.title=='便利店'"> <span style="margin-right: 10px;" v-if="item.meta && item.meta.title=='便利店'">
<img src="@/assets/menu_icon/car.png" v-if="!activeMenu.includes('/convenience')" style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/car.png" v-if="!activeMenu.includes('/convenience')" style="width: 21px;height: 21px;"/>
<img src="@/assets/menu_icon/car_b.png" v-else style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/car_b.png" v-else style="width: 21px;height: 21px;"/>
</span> </span>
<span style="margin-right: 10px;" v-if="item.meta.title=='积分商城'"> <span style="margin-right: 10px;" v-if="item.meta && item.meta.title=='积分商城'">
<img src="@/assets/menu_icon/lihe.png" v-if="!activeMenu.includes('/integral')" style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/lihe.png" v-if="!activeMenu.includes('/integral')" style="width: 21px;height: 21px;"/>
<img src="@/assets/menu_icon/lihe_b.png" v-else style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/lihe_b.png" v-else style="width: 21px;height: 21px;"/>
</span> </span>
<span style="margin-right: 10px;" v-if="item.meta.title=='订单管理'"> <span style="margin-right: 10px;" v-if="item.meta && item.meta.title=='订单管理'">
<img src="@/assets/menu_icon/wendang.png" v-if="!activeMenu.includes(item.path)" style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/wendang.png" v-if="!activeMenu.includes(item.path)" style="width: 21px;height: 21px;"/>
<img src="@/assets/menu_icon/wendang_b.png" v-else style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/wendang_b.png" v-else style="width: 21px;height: 21px;"/>
</span> </span>
<span style="margin-right: 10px;" v-if="item.meta.title=='活动营销'"> <span style="margin-right: 10px;" v-if="item.meta && item.meta.title=='活动营销'">
<img src="@/assets/menu_icon/laba.png" v-if="!activeMenu.includes('/EventMarketing')" style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/laba.png" v-if="!activeMenu.includes('/EventMarketing')" style="width: 21px;height: 21px;"/>
<img src="@/assets/menu_icon/laba_b.png" v-else style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/laba_b.png" v-else style="width: 21px;height: 21px;"/>
</span> </span>
<span style="margin-right: 10px;" v-if="item.meta.title=='配置管理'"> <span style="margin-right: 10px;" v-if="item.meta && item.meta.title=='配置管理'">
<img src="@/assets/menu_icon/setting.png" v-if="!activeMenu.includes('/setting') && !activeMenu.includes('/power')" style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/setting.png" v-if="!activeMenu.includes('/setting') && !activeMenu.includes('/power')" style="width: 21px;height: 21px;"/>
<img src="@/assets/menu_icon/setting_b.png" v-else style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/setting_b.png" v-else style="width: 21px;height: 21px;"/>
</span> </span>
<span style="margin-right: 10px;" v-if="item.meta.title=='系统管理'"> <span style="margin-right: 10px;" v-if="item.meta && item.meta.title=='系统管理'">
<img src="@/assets/menu_icon/setting.png" v-if="!activeMenu.includes('/system')" style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/setting.png" v-if="!activeMenu.includes('/system')" style="width: 21px;height: 21px;"/>
<img src="@/assets/menu_icon/setting_b.png" v-else style="width: 21px;height: 21px;"/> <img src="@/assets/menu_icon/setting_b.png" v-else style="width: 21px;height: 21px;"/>
</span> </span>
<span>{{item.meta.title}}</span> <span v-if="item.meta">{{item.meta.title}}</span>
</div> </div>
<div v-if="isCollapse" style="text-align: center;"> <div v-if="isCollapse" style="text-align: center;">
<!-- <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />--> <!-- <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />-->
@ -228,7 +228,6 @@ export default {
return false return false
}, },
resolvePath(routePath, routeQuery) { resolvePath(routePath, routeQuery) {
console.log(routePath)
if (isExternal(routePath)) { if (isExternal(routePath)) {
return routePath return routePath
} }

View File

@ -14,8 +14,10 @@ export default {
resource: '', resource: '',
description: '', description: '',
dutyId: "", dutyId: "",
checkedKeys: [] checkedKeys: [],
roleCode:"",
}, },
checked:true,
rules: { rules: {
roleName: [ roleName: [
{required: true, message: '请输入角色名称', trigger: 'blur'}, {required: true, message: '请输入角色名称', trigger: 'blur'},
@ -23,7 +25,11 @@ export default {
storeId: [ storeId: [
{required: true, message: '请选择机构信息', trigger: 'change'} {required: true, message: '请选择机构信息', trigger: 'change'}
], ],
roleCode: [
{required: true, message: '请选择登录权限', trigger: 'change'}
],
}, },
dutyId:'',
tableData: [{ tableData: [{
id: 1, id: 1,
label: '系统首页', label: '系统首页',
@ -76,6 +82,7 @@ export default {
// this.merchantId = this.$route.query.merchantId // this.merchantId = this.$route.query.merchantId
// this.getMenuTreeselect() // this.getMenuTreeselect()
if (this.$route.query.dutyId) { if (this.$route.query.dutyId) {
this.dutyId = this.$route.query.dutyId
this.getRoleMune(this.$route.query.dutyId); this.getRoleMune(this.$route.query.dutyId);
} }
this.selectChildByDeptIdApi() this.selectChildByDeptIdApi()
@ -85,8 +92,16 @@ export default {
// //
getMenuTreeselect() { getMenuTreeselect() {
// merchantId deptType // merchantId deptType
this.tableData = []
menuTreeselect({merchantId: this.merchantId, roleId: this.ruleForm.dutyId}).then(response => { menuTreeselect({merchantId: this.merchantId, roleId: this.ruleForm.dutyId}).then(response => {
this.tableData = response.data; let data = {
id: 0,
label: '收银台',
childrens: [],
list: [{id: 0,show: false, name: '选中菜单'},]
}
this.tableData.push(data);
this.tableData.push(...response.data);
}); });
}, },
submitForm(formName) { submitForm(formName) {
@ -148,79 +163,54 @@ export default {
}) })
}, },
chooseImg(row, data) { chooseImg(row, data) {
if (row.id==0){
row.show = !row.show
return;
}
let ids = [] let ids = []
let show = false; let show = false;
this.tableData.forEach(item => { this.tableData.forEach(item => {
if (!row.show) show = true if (!row.show) show = true
item.list.forEach(item1 => {
if (item1.id == row.id) {
ids.push(item1.id)
item1.show = show;
return;
}
});
// ID // ID
if (item.id == row.id) { if (item.id == row.id) {
item.show = show; item.show = show;
ids.push(item.id) ids.push(item.id)
//
item.childrens.forEach(item1 => {
item1.show = show;
ids.push(item1.id)
item1.list.forEach(item2 => {
item2.show = show;
ids.push(item2.id)
});
});
item.list.forEach(item1 => {
ids.push(item1.id)
item1.show = show;
});
return; // return; //
} else {
item.list.forEach(item1 => {
if (item1.id == row.id) {
ids.push(item1.id)
item1.show = show;
}
if (!show) {
if (item1.name == '选中' && item1.id == data.id) {
item1.show = show;
}
}
});
} }
// //
item.childrens.forEach(item1 => { item.childrens.forEach(item1 => {
//
if (item1.id == row.id) {
ids.push(item1.id)
item1.show = show;
item1.list.forEach(item2 => {
ids.push(item2.id)
item2.show = show;
});
return; //
} else {
item1.list.forEach(item2 => { item1.list.forEach(item2 => {
if (item2.id == row.id) { if (item2.id == row.id) {
ids.push(item2.id) ids.push(item2.id)
item2.show = show; item2.show = show;
} }
if (!show) {
if (item2.name == '选中' && item2.id == data.id) {
item2.show = show;
}
}
}); });
//
if (item1.id == row.id) {
ids.push(item1.id)
item1.show = show;
return; //
} }
}); });
}); });
let uniqueArr = ids.filter((item, index) => ids.indexOf(item) === index); let uniqueArr = ids.filter((item, index) => ids.indexOf(item) === index);
if (show) { if (show) {
this.ruleForm.checkedKeys = [...uniqueArr, ...this.ruleForm.checkedKeys]; this.ruleForm.checkedKeys = [...uniqueArr, ...this.ruleForm.checkedKeys];
// this.ruleForm.checkedKeys = this.ruleForm.checkedKeys.filter((item, index) => this.ruleForm.checkedKeys.indexOf(item) === index); this.ruleForm.checkedKeys = this.ruleForm.checkedKeys.filter((item, index) => this.ruleForm.checkedKeys.indexOf(item) === index);
} else { } else {
this.ruleForm.checkedKeys = this.ruleForm.checkedKeys.filter(item => !uniqueArr.includes(item)); this.ruleForm.checkedKeys = this.ruleForm.checkedKeys.filter(item => !uniqueArr.includes(item));
} }
this.ruleForm.menuIds = this.ruleForm.checkedKeys; this.ruleForm.menuIds = this.ruleForm.checkedKeys;
console.log(ids, uniqueArr, this.ruleForm.checkedKeys, show);
// this.ruleForm.checkedKeys = this.ruleForm.checkedKeys.filter(item => item !== row.id); // this.ruleForm.checkedKeys = this.ruleForm.checkedKeys.filter(item => item !== row.id);
} }
} }
@ -239,6 +229,7 @@ export default {
<div> <div>
<el-form-item label="所属机构" prop="storeId"> <el-form-item label="所属机构" prop="storeId">
<el-select v-model="ruleForm.storeId" placeholder="请选择所属机构" <el-select v-model="ruleForm.storeId" placeholder="请选择所属机构"
:disabled="dutyId!=''"
@change="chooseRegion(ruleForm.storeId)"> @change="chooseRegion(ruleForm.storeId)">
<el-option <el-option
v-for="item in deptListSelect" v-for="item in deptListSelect"
@ -265,6 +256,21 @@ export default {
</el-form> </el-form>
</div> </div>
<div class="center-box"> <div class="center-box">
<div>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="110px" class="demo-ruleForm">
<!-- <el-form-item label="角色登录权限" prop="roleCode">-->
<!-- <el-radio-group v-model="ruleForm.roleCode">-->
<!-- <el-radio :label="0">都无</el-radio>-->
<!-- <el-radio :label="1">后台</el-radio>-->
<!-- <el-radio :label="2">收银台</el-radio>-->
<!-- <el-radio :label="3">全部</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-form-item label="菜单功能权限" prop="checkedKeys">
<el-checkbox v-model="checked">全选</el-checkbox>
</el-form-item>
</el-form>
</div>
<el-table <el-table
:data="tableData" :data="tableData"
style="width: 100%;margin-bottom: 20px;" style="width: 100%;margin-bottom: 20px;"

View File

@ -49,11 +49,13 @@ public class SourceServiceImpl extends ServiceImpl<TSourceMapper, TSource> imple
public List<TSource> getAvailableSources1(Integer merchantId) { public List<TSource> getAvailableSources1(Integer merchantId) {
List<TSource> byStatus1 = tSourceMapper.findByStatus1(merchantId, StatusEnum.ENABLED.getKey()); List<TSource> byStatus1 = tSourceMapper.findByStatus1(merchantId, StatusEnum.ENABLED.getKey());
for (TSource tSource : byStatus1) { for (TSource tSource : byStatus1) {
List<TSource> byStatusButton = tSourceMapper.findByStatusButton(tSource.getSourceId(), StatusEnum.ENABLED.getKey()); List<TSource> byStatusButton = new ArrayList<>();
List<TSource> byStatusButton1 = tSourceMapper.findByStatusButton(tSource.getSourceId(), StatusEnum.ENABLED.getKey());
TSource tSource1 = new TSource(); TSource tSource1 = new TSource();
tSource1.setSourceName("选中"); tSource1.setSourceName("选中菜单");
tSource1.setSourceId(tSource.getSourceId()); tSource1.setSourceId(tSource.getSourceId());
byStatusButton.add(tSource1); byStatusButton.add(tSource1);
byStatusButton.addAll(byStatusButton1);
tSource.setList(byStatusButton); tSource.setList(byStatusButton);
} }
return byStatus1; return byStatus1;