Merge branch 'master' of http://192.168.31.244:3000/byx/oilSystem
This commit is contained in:
commit
b1c92b7bfc
@ -28,64 +28,64 @@
|
||||
<template slot="title">
|
||||
<div v-if="!isCollapse" >
|
||||
<!-- <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_b.png" v-else style="width: 21px;height: 21px;"/>
|
||||
</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_b.png" v-else style="width: 25px;height: 25px;"/>
|
||||
</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_b.png" v-else style="width: 25px;height: 25px;"/>
|
||||
</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_b.png" v-else style="width: 21px;height: 21px;"/>
|
||||
</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_b.png" v-else style="width: 21px;height: 21px;"/>
|
||||
</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_b.png" v-else style="width: 21px;height: 21px;"/>
|
||||
</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_b.png" v-else style="width: 21px;height: 21px;"/>
|
||||
</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_b.png" v-else style="width: 21px;height: 21px;"/>
|
||||
</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_b.png" v-else style="width: 21px;height: 21px;"/>
|
||||
</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_b.png" v-else style="width: 21px;height: 21px;"/>
|
||||
</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_b.png" v-else style="width: 21px;height: 21px;"/>
|
||||
</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_b.png" v-else style="width: 21px;height: 21px;"/>
|
||||
</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_b.png" v-else style="width: 21px;height: 21px;"/>
|
||||
</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_b.png" v-else style="width: 21px;height: 21px;"/>
|
||||
</span>
|
||||
|
||||
<span>{{item.meta.title}}</span>
|
||||
<span v-if="item.meta">{{item.meta.title}}</span>
|
||||
</div>
|
||||
<div v-if="isCollapse" style="text-align: center;">
|
||||
<!-- <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />-->
|
||||
@ -228,7 +228,6 @@ export default {
|
||||
return false
|
||||
},
|
||||
resolvePath(routePath, routeQuery) {
|
||||
console.log(routePath)
|
||||
if (isExternal(routePath)) {
|
||||
return routePath
|
||||
}
|
||||
|
@ -14,8 +14,10 @@ export default {
|
||||
resource: '',
|
||||
description: '',
|
||||
dutyId: "",
|
||||
checkedKeys: []
|
||||
checkedKeys: [],
|
||||
roleCode:"",
|
||||
},
|
||||
checked:true,
|
||||
rules: {
|
||||
roleName: [
|
||||
{required: true, message: '请输入角色名称', trigger: 'blur'},
|
||||
@ -23,7 +25,11 @@ export default {
|
||||
storeId: [
|
||||
{required: true, message: '请选择机构信息', trigger: 'change'}
|
||||
],
|
||||
roleCode: [
|
||||
{required: true, message: '请选择登录权限', trigger: 'change'}
|
||||
],
|
||||
},
|
||||
dutyId:'',
|
||||
tableData: [{
|
||||
id: 1,
|
||||
label: '系统首页',
|
||||
@ -76,6 +82,7 @@ export default {
|
||||
// this.merchantId = this.$route.query.merchantId
|
||||
// this.getMenuTreeselect()
|
||||
if (this.$route.query.dutyId) {
|
||||
this.dutyId = this.$route.query.dutyId
|
||||
this.getRoleMune(this.$route.query.dutyId);
|
||||
}
|
||||
this.selectChildByDeptIdApi()
|
||||
@ -85,8 +92,16 @@ export default {
|
||||
// 查询菜单树结构
|
||||
getMenuTreeselect() {
|
||||
// merchantId 代表deptType
|
||||
this.tableData = []
|
||||
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) {
|
||||
@ -148,79 +163,54 @@ export default {
|
||||
})
|
||||
},
|
||||
chooseImg(row, data) {
|
||||
if (row.id==0){
|
||||
row.show = !row.show
|
||||
return;
|
||||
}
|
||||
let ids = []
|
||||
let show = false;
|
||||
this.tableData.forEach(item => {
|
||||
if (!row.show) show = true
|
||||
item.list.forEach(item1 => {
|
||||
if (item1.id == row.id) {
|
||||
ids.push(item1.id)
|
||||
item1.show = show;
|
||||
return;
|
||||
}
|
||||
});
|
||||
// 尝试直接在顶级项目中找到匹配的 ID
|
||||
if (item.id == row.id) {
|
||||
item.show = show;
|
||||
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; // 如果找到,则直接返回,不再继续处理子项
|
||||
} 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 => {
|
||||
item1.list.forEach(item2 => {
|
||||
if (item2.id == row.id) {
|
||||
ids.push(item2.id)
|
||||
item2.show = show;
|
||||
}
|
||||
|
||||
});
|
||||
// 直接检查子项是否匹配
|
||||
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 => {
|
||||
if (item2.id == row.id) {
|
||||
ids.push(item2.id)
|
||||
item2.show = show;
|
||||
}
|
||||
|
||||
if (!show) {
|
||||
if (item2.name == '选中' && item2.id == data.id) {
|
||||
item2.show = show;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
let uniqueArr = ids.filter((item, index) => ids.indexOf(item) === index);
|
||||
if (show) {
|
||||
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 {
|
||||
this.ruleForm.checkedKeys = this.ruleForm.checkedKeys.filter(item => !uniqueArr.includes(item));
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -239,6 +229,7 @@ export default {
|
||||
<div>
|
||||
<el-form-item label="所属机构" prop="storeId">
|
||||
<el-select v-model="ruleForm.storeId" placeholder="请选择所属机构"
|
||||
:disabled="dutyId!=''"
|
||||
@change="chooseRegion(ruleForm.storeId)">
|
||||
<el-option
|
||||
v-for="item in deptListSelect"
|
||||
@ -265,6 +256,21 @@ export default {
|
||||
</el-form>
|
||||
</div>
|
||||
<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
|
||||
:data="tableData"
|
||||
style="width: 100%;margin-bottom: 20px;"
|
||||
|
@ -49,11 +49,13 @@ public class SourceServiceImpl extends ServiceImpl<TSourceMapper, TSource> imple
|
||||
public List<TSource> getAvailableSources1(Integer merchantId) {
|
||||
List<TSource> byStatus1 = tSourceMapper.findByStatus1(merchantId, StatusEnum.ENABLED.getKey());
|
||||
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();
|
||||
tSource1.setSourceName("选中");
|
||||
tSource1.setSourceName("选中菜单");
|
||||
tSource1.setSourceId(tSource.getSourceId());
|
||||
byStatusButton.add(tSource1);
|
||||
byStatusButton.addAll(byStatusButton1);
|
||||
tSource.setList(byStatusButton);
|
||||
}
|
||||
return byStatus1;
|
||||
|
Loading…
Reference in New Issue
Block a user