Commit 78175db2 by 无尘

fix: 打印角色

parent be53ebbf
.nav-wrap[data-v-2c2a2724]{padding:12px 20px}.el-breadcrumb__inner.is-link[data-v-2c2a2724]:hover,.el-breadcrumb__inner a[data-v-2c2a2724]:hover{color:#2f54eb}.el-breadcrumb__item:last-child .el-breadcrumb__inner[data-v-2c2a2724],.el-breadcrumb__item:last-child .el-breadcrumb__inner[data-v-2c2a2724]:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner a[data-v-2c2a2724],.el-breadcrumb__item:last-child .el-breadcrumb__inner a[data-v-2c2a2724]:hover{font-weight:700;text-decoration:none;cursor:pointer;color:#303133}.menu-tree[data-v-67e08250]{width:510px;min-height:460px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border:1px solid #e4e7ed}.menu-tree .first-menu[data-v-67e08250]{-ms-flex-negative:0;flex-shrink:0;width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:#f5f7fa}.menu-tree .first-menu .first-menu-item[data-v-67e08250]{padding:0 10px 0 20px;width:100%;height:40px;font-size:14px;font-weight:400;color:#606266;line-height:40px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.menu-tree .first-menu .first-menu-item.active[data-v-67e08250],.menu-tree .first-menu .first-menu-item[data-v-67e08250]:hover{background-color:#fff}.menu-tree .first-menu .no-data[data-v-67e08250]{padding-top:20px;text-align:center;font-size:14px;color:#909399;line-height:60px}.menu-tree .all-menu[data-v-67e08250]{padding:20px 0 0 20px;width:calc(100% - 140px)}.menu-tree .all-menu[data-v-67e08250] .el-checkbox.is-disabled+.el-tree-node__label{color:#909399}.edit-store-role-body .nav-wrap[data-v-2a49a8f4]{padding-left:0}.edit-role[data-v-2a49a8f4]{padding:20px;background-color:#fff;height:100%}.resource-list[data-v-2a49a8f4]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.resource-list .resource-item[data-v-2a49a8f4]{padding:10px 20px;width:236px;height:72px;background:#f5f7fa}.resource-list .resource-item .app-name[data-v-2a49a8f4]{font-size:14px;font-weight:700;color:#303133;line-height:20px}.type-title[data-v-2a49a8f4]{font-size:14px;font-weight:400;color:#606266}.type-label[data-v-2a49a8f4]{margin-right:30px;font-size:14px;font-weight:700;color:#303133}
\ No newline at end of file
.nav-wrap[data-v-2c2a2724]{padding:12px 20px}.el-breadcrumb__inner.is-link[data-v-2c2a2724]:hover,.el-breadcrumb__inner a[data-v-2c2a2724]:hover{color:#2f54eb}.el-breadcrumb__item:last-child .el-breadcrumb__inner[data-v-2c2a2724],.el-breadcrumb__item:last-child .el-breadcrumb__inner[data-v-2c2a2724]:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner a[data-v-2c2a2724],.el-breadcrumb__item:last-child .el-breadcrumb__inner a[data-v-2c2a2724]:hover{font-weight:700;text-decoration:none;cursor:pointer;color:#303133}.menu-tree[data-v-67e08250]{width:510px;min-height:460px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border:1px solid #e4e7ed}.menu-tree .first-menu[data-v-67e08250]{-ms-flex-negative:0;flex-shrink:0;width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:#f5f7fa}.menu-tree .first-menu .first-menu-item[data-v-67e08250]{padding:0 10px 0 20px;width:100%;height:40px;font-size:14px;font-weight:400;color:#606266;line-height:40px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.menu-tree .first-menu .first-menu-item.active[data-v-67e08250],.menu-tree .first-menu .first-menu-item[data-v-67e08250]:hover{background-color:#fff}.menu-tree .first-menu .no-data[data-v-67e08250]{padding-top:20px;text-align:center;font-size:14px;color:#909399;line-height:60px}.menu-tree .all-menu[data-v-67e08250]{padding:20px 0 0 20px;width:calc(100% - 140px)}.menu-tree .all-menu[data-v-67e08250] .el-checkbox.is-disabled+.el-tree-node__label{color:#909399}.edit-store-role-body .nav-wrap[data-v-6f49966a]{padding-left:0}.edit-role[data-v-6f49966a]{padding:20px;background-color:#fff;height:100%}.resource-list[data-v-6f49966a]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.resource-list .resource-item[data-v-6f49966a]{padding:10px 20px;width:236px;height:72px;background:#f5f7fa}.resource-list .resource-item .app-name[data-v-6f49966a]{font-size:14px;font-weight:700;color:#303133;line-height:20px}.type-title[data-v-6f49966a]{font-size:14px;font-weight:400;color:#606266}.type-label[data-v-6f49966a]{margin-right:30px;font-size:14px;font-weight:700;color:#303133}
\ No newline at end of file
......@@ -123,16 +123,14 @@ export default {
that.tabList.forEach(el => {
// appType 1好办后台2应用后台3好办小程序4小程序应用
// roleType 1管理员角色 2门店角色
prom.push(menuList({ wxEnterpriseId: that.wxEnterpriseId, roleType: 2, appType: el.appType }).then( async res => {
prom.push(menuList({ wxEnterpriseId: that.wxEnterpriseId, roleType: 2, appType: el.appType }).then( res => {
el.flatMenu = res.result || [];
el.menuList = that.flatDataToTree(res.result || []);
console.log(el.menuList);
el.menuList.forEach(item => {
that.$set(el.checkedId, item.menuId, []);
});
}));
});
console.log('1:', prom);
return Promise.all(prom);
},
/**
......@@ -149,6 +147,7 @@ export default {
// tabList中存一份不包含父节点的menuId
Object.assign(this.roleData, { roleId, roleName });
// 将menuIds分配到相应同的tab下的checkedId中
console.log('1:', this.tabList);
this.tabList.forEach(el => {
let checkedId = [];
el.menuList.forEach(item => {
......@@ -157,7 +156,7 @@ export default {
});
this.roleData.menuIds.push({ appType: el.appType, menuIds: checkedId });
});
console.log('4:', this.tabList);
console.log('4:', this.tabList, this.roleData);
});
// 获取门店导购范围数据
findStoreRange({ roleId, wxEnterpriseId: this.wxEnterpriseId }).then(res => {
......@@ -179,6 +178,7 @@ export default {
function getAllMenuId(menuList, allMenuIds) {
let result = [];
console.log('getAllMenuId:', menuList, allMenuIds);
menuList.forEach(el => {
if (allMenuIds.some(item => item == el.menuId)) {
result.push(el.menuId);
......@@ -193,10 +193,12 @@ export default {
function getLeafMenuId(menuList, allMenuIds) {
let result = [];
// 所有子节点被选中,才算父节点被选中
console.log('getLeafMenuId:', menuList, allMenuIds);
menuList.map(el => {
if (allMenuIds.some(item => item == el.menuId)) {
let allSubId = [];
if (Array.isArray(el.children)) {
console.log('getLeafMenuId:', el.children);
allSubId = getAllSubMenuIds(el.children);
}
// 如果el的allSubId都在allMenuIds中,则认为el需要被勾选,需要把el.menuId放入result中
......@@ -215,6 +217,7 @@ export default {
let result = [];
menuList.forEach(el => {
result.push(el.menuId);
console.log('getAllSubMenuIds:', el.children);
if (Array.isArray(el.children)) {
result = result.concat(getAllSubMenuIds(el.children));
}
......
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