Commit af33400b by 匡雅琴

角色权限UI调整

1 parent cbb65622
<template>
<div class="account-body scrm-box-f" v-loading="loading">
<div class="account-title">{{ title }}</div>
<el-tabs v-if="tabMenu.length != 0" v-model="tabName" type="card" @tab-click="handleClik">
<el-tab-pane :label="item.accounttypeName" :name="item.accounttypeId" v-for="(item, index) in tabMenu" :key="index"></el-tab-pane>
<el-tabs v-if="tabMenu.length != 0" v-model="tabName" @tab-click="handleClik">
<el-tab-pane :label="item.accounttypeName" :name="item.accounttypeId + ''" v-for="(item, index) in tabMenu" :key="index"></el-tab-pane>
</el-tabs>
<div class="account-select-pro" v-for="(item, index) in tabMenu" :key="index" v-show="tabName == item.accounttypeId">
<label>选择产品</label>
<el-checkbox-group v-model="item.productsArr" @change="selectPro">
<el-checkbox v-for="(itm, idx) in item.products" :label="itm" :key="idx">{{ itm.productName }}</el-checkbox>
</el-checkbox-group>
</div>
<div class="account-select-menu">请选择产品权限</div>
<div class="menu-box">
<div class="menu-box-panel">
<div :key="index" v-for="(item, index) in tabMenu">
<div class="menu-box-tab" v-show="tabName == item.accounttypeId">
<div v-show="item.productsArr.indexOf(itm) != -1" class="tab-item text-hide" :class="{ 'select-checked': productTab == itm.productId }" @click="productClick(itm.productId)" v-for="(itm, idx) in item.products" :key="idx">
{{ itm.productName }}
<div class="role-border">
<div class="account-select-pro" v-for="(item, index) in tabMenu" :key="index" v-show="tabName == item.accounttypeId">
<label>选择产品</label>
<el-checkbox-group v-model="item.productsArr" @change="selectPro">
<el-checkbox v-for="(itm, idx) in item.products" :label="itm" :key="idx">{{ itm.productName }}</el-checkbox>
</el-checkbox-group>
</div>
<div class="account-select-menu">选择产品权限</div>
<div class="menu-box">
<div class="menu-box-panel">
<div :key="index" v-for="(item, index) in tabMenu">
<div class="menu-box-tab" v-show="tabName == item.accounttypeId">
<div v-show="item.productsArr.indexOf(itm) != -1" class="tab-item role-border" :class="{ 'select-checked': productTab == itm.productId }" @click="productClick(itm.productId)" v-for="(itm, idx) in item.products" :key="idx">
{{ itm.productName }}
</div>
</div>
</div>
<div v-show="tabName == item.accounttypeId" class="menu-box-tree" v-if="item.products" :style="{ 'min-height': treeHeight + 'px' }">
<div v-for="(itm, idx) in item.products" :key="idx">
<div class="nodata" v-if="item.productsArr.length == 0 || itm.merchantProTreeResponses.length == 0">
<img src="../../../assets/img/empty.png" alt="" />
<div>
{{ item.productsArr.length == 0 ? '请先选择产品' : '暂无菜单权限' }}
<div v-show="tabName == item.accounttypeId" class="menu-box-tree role-border" v-if="item.products" :style="{ 'min-height': treeHeight + 'px' }">
<div v-for="(itm, idx) in item.products" :key="idx">
<div class="nodata" v-if="item.productsArr.length == 0 || itm.merchantProTreeResponses.length == 0">
<img src="../../../assets/img/empty.png" alt="" />
<div>
{{ item.productsArr.length == 0 ? '请先选择产品' : '暂无菜单权限' }}
</div>
</div>
<div v-else>
<el-tree v-show="productTab == itm.productId" :data="itm.merchantProTreeResponses" show-checkbox check-strictly check-on-click-node :expand-on-click-node="false" default-expand-all node-key="id" :class="'tree_' + item.accounttypeId + '_' + itm.productId" :ref="`tree_${item.accounttypeId}_${itm.productId}`" highlight-current :render-content="renderContent" :props="defaultProps" @check="clickDeal"></el-tree>
</div>
</div>
<div v-else>
<el-tree v-show="productTab == itm.productId" :data="itm.merchantProTreeResponses" show-checkbox check-strictly check-on-click-node :expand-on-click-node="false" default-expand-all node-key="id" :class="'tree_' + item.accounttypeId + '_' + itm.productId" :ref="`tree_${item.accounttypeId}_${itm.productId}`" highlight-current :render-content="renderContent" :props="defaultProps" @check="clickDeal"></el-tree>
</div>
</div>
</div>
......@@ -172,7 +174,7 @@ export default {
})
})
this.loading = false
this.tabName = this.tabMenu[0].accounttypeId
this.tabName = this.tabMenu[0].accounttypeId + ''
this.productTab = this.tabMenu[0].productsArr[0] ? this.tabMenu[0].productsArr[0].productId : ''
// const arr = res.map(i => i.accounttypeId)
// this.tabMenu.map(i => arr.includes(i.accounttypeId))
......@@ -393,21 +395,20 @@ export default {
.el-checkbox:last-of-type {
margin-right: 8px;
}
.el-tabs--card > .el-tabs__header .el-tabs__nav {
border: 0;
.el-tabs {
height: 48px;
border: 1px solid #e5e5e5;
border-bottom: none;
}
.el-tabs--card > .el-tabs__header {
border: 0;
background-color: #f4f6fc;
.el-tabs__header {
line-height: 48px;
padding: 0 30px;
}
.el-tabs--card > .el-tabs__header .el-tabs__item {
border: none;
width: 180px;
margin: 2px;
text-align: center;
.el-tabs__nav-wrap::after {
content: none;
}
.el-tabs__item.is-active {
background-color: #fff;
.el-form-item {
margin-bottom: 0 !important;
}
}
.account-title {
......@@ -419,54 +420,55 @@ export default {
margin-bottom: 30px;
}
.account-select-pro {
padding-left: 30px;
padding-left: 20px;
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
display: flex;
flex-wrap: wrap;
margin-top: 12px;
margin-top: 20px;
label {
margin-right: 20px;
}
}
.account-select-menu {
padding-left: 20px;
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
margin-top: 20px;
margin-top: 10px;
}
.menu-box {
position: relative;
margin-top: 10px;
background: #f4f6fc;
margin: 10px;
border-radius: 4px;
padding: 10px;
.tab-item {
width: 180px;
background: #ffffff;
border-radius: 4px 0px 0px 0px;
border: 1px solid #f4f6fc;
height: 40px;
background: #fafafa;
border-bottom: none;
border-radius: 4px 4px 0px 0px;
font-size: 14px;
line-height: 14px;
line-height: 40px;
font-weight: 400;
color: #37383a;
text-align: center;
padding: 12px 0px;
padding: 0 20px;
margin-right: 2px;
cursor: pointer;
&.select-checked {
background: #ffffff;
color: #322ad9;
// font-weight: 700;
border-bottom: none;
}
}
.menu-box-tab {
display: flex;
}
.menu-box-tree {
background: #ffffff;
border-radius: 0px 4px 4px 4px;
height: 640px;
overflow: auto;
}
}
}
......
......@@ -53,19 +53,20 @@
<div class="MsgWrap powerlimt">
<span class="content-title">功能权限</span>
<div class="powerTreeWrap">
<div class="mainTitleWrap">
<div class="powerTreeWrap role-border">
<div class="mainTitleWrap role-border-b">
<div class="mainTitle" :class="{ activeMainTitle: currentIndex == index }" v-for="(item, index) in powerDataArray" :key="index" @click="powerTabClick(index)">
{{ item.accounttypeName || 'null' }}
<div class="tab_line" v-show="currentIndex == index"></div>
</div>
</div>
<div class="content">
<div class="subTitleWrap" v-if="products.length > 0">
<div class="subTitle text-hide" :class="{ acitveSubTitle: subCurrentIndex == sindex }" v-for="(ele, sindex) in products" :key="sindex" @click="powerSubTabClick(sindex)">
<div class="subTitle role-border" :class="{ acitveSubTitle: subCurrentIndex == sindex }" v-for="(ele, sindex) in products" :key="sindex" @click="powerSubTabClick(sindex)">
{{ ele.productName }}
</div>
</div>
<div class="contentTree">
<div class="contentTree role-border">
<!-- powerDataArray.length > 0 && powerDataArray[currentIndex].products[subCurrentIndex]. -->
<!-- powerDataArray[currentIndex].products[subCurrentIndex].merchantProTreeResponses这是树的数据 -->
<template v-if="merchantProTreeResponses.length > 0">
......@@ -557,6 +558,16 @@ export default {
</script>
<style lang="scss" scoped>
.tab_line {
width: 100%;
height: 2px;
background: #5850ff;
border-radius: 4px;
position: absolute;
left: 50%;
top: 48px;
transform: translate(-50%, 0);
}
.merchantDetail {
padding-bottom: 60px;
.titles {
......@@ -656,46 +667,41 @@ export default {
.powerlimt {
padding-bottom: 30px;
.powerTreeWrap {
background-color: #f4f6fc;
margin: 0 20px;
border-radius: 4px;
min-height: 300px;
padding-top: 2px;
padding-left: 2px;
padding-bottom: 10px;
.mainTitleWrap {
// height: 32px;
height: 48px;
display: flex;
padding: 0 10px;
.mainTitle {
background-color: #f4f6fc;
height: 32px;
width: 180px;
line-height: 32px;
position: relative;
margin: 0 20px;
line-height: 48px;
text-align: center;
border-radius: 2px;
}
.activeMainTitle {
background-color: #fff;
color: #5850ff;
}
}
.content {
background-color: #fff;
margin: 20px 10px 0;
margin: 20px;
border-radius: 0px 4px 4px 4px;
.subTitleWrap {
// height: 40px;
display: flex;
flex-wrap: wrap;
background-color: #f4f6fc;
.subTitle {
padding: 0px 5px;
background-color: #f4f6fc;
background: #fafafa;
padding: 0px 20px;
height: 40px;
width: 180px;
line-height: 40px;
text-align: center;
border-radius: 2px;
border-radius: 4px 4px 0px 0px;
border-bottom: none;
margin-right: 2px;
}
.acitveSubTitle {
background-color: #fff !important;
......@@ -707,7 +713,7 @@ export default {
height: 250px;
position: relative;
overflow: auto;
border-radius: 0px 4px 4px 4px;
.noDataContent {
width: 64px;
height: 64px;
......
......@@ -462,34 +462,6 @@ export default {
.el-tabs__nav-wrap::after {
content: none;
}
// .el-tabs--card > .el-tabs__header .el-tabs__nav {
// border: 0;
// }
// .el-tabs--card > .el-tabs__header {
// border: 0;
// border-bottom: 1px solid #e5e5e5;
// // background-color: #f4f6fc;
// }
// .el-tabs--card > .el-tabs__header .el-tabs__item {
// position: relative;
// border: none;
// // width: 180px;
// margin: 2px;
// text-align: center;
// &::after {
// content: '';
// display: inline-block;
// width: calc(100% - 40px);
// height: 2px;
// background-color: #5850ff;
// position: absolute;
// bottom: -2px;
// left: 20px;
// }
// }
// .el-tabs__item.is-active {
// background-color: #fff;
// }
.el-form-item {
margin-bottom: 0 !important;
}
......
......@@ -17,11 +17,11 @@
<div class="menu-box-panel">
<div :key="index" v-for="(item, index) in tabMenu">
<div class="menu-box-tab" v-show="tabName == item.accounttypeId">
<div v-show="item.productsArr.indexOf(itm) != -1" class="tab-item text-hide" :class="{ 'select-checked': productTab == itm.productId }" @click="productClick(itm.productId)" v-for="(itm, idx) in item.products" :key="idx">
<div v-show="item.productsArr.indexOf(itm) != -1" class="tab-item role-border text-hide" :class="{ 'select-checked': productTab == itm.productId }" @click="productClick(itm.productId)" v-for="(itm, idx) in item.products" :key="idx">
{{ itm.productName }}
</div>
</div>
<div v-show="tabName == item.accounttypeId" class="menu-box-tree" v-if="item.products" :style="{ 'min-height': treeHeight + 'px' }">
<div v-show="tabName == item.accounttypeId" class="menu-box-tree role-border" v-if="item.products" :style="{ 'min-height': treeHeight + 'px' }">
<div v-for="(itm, idx) in item.products" :key="idx">
<div class="nodata" v-if="item.productsArr.length == 0 || itm.merchantProTreeResponses.length == 0">
<img src="../../../assets/img/empty.png" alt="" />
......@@ -158,7 +158,7 @@ export default {
accounttypeId: item.accounttypeId
}
})
this.tabName = this.tabMenu_r[0].accounttypeId
this.tabName = this.tabMenu_r[0].accounttypeId + ''
return this.tabMenu_r
},
// 获取当前的所有权限
......@@ -226,7 +226,7 @@ export default {
return item && item.accounttypeId && this.tabMenu[index].productsArr.length > 0
})
setTimeout(() => {
this.tabName = tabMenu[0].accounttypeId
this.tabName = tabMenu[0].accounttypeId + ''
this.productTab = tabMenu[0].productsArr[0].productId
}, 100)
},
......@@ -470,7 +470,7 @@ export default {
line-height: 20px;
display: flex;
flex-wrap: wrap;
margin-top: 12px;
margin-top: 28px;
label {
margin-right: 20px;
}
......@@ -482,7 +482,6 @@ export default {
.tab-item {
background: #fafafa;
border-radius: 4px 4px 0px 0px;
border: 1px solid #f4f6fc;
margin-right: 2px;
font-size: 14px;
line-height: 14px;
......@@ -502,7 +501,6 @@ export default {
}
.menu-box-tree {
background: #ffffff;
border: 1px solid #f4f6fc;
}
}
}
......@@ -518,4 +516,8 @@ export default {
margin-bottom: 12px;
}
}
/deep/ .el-tree {
height: 640px;
overflow: auto;
}
</style>
......@@ -274,7 +274,7 @@ export default {
display: flex;
align-items: center;
box-sizing: border-box;
padding: 0px 32px;
padding: 0px 10px;
// border-bottom: 1px solid #e5e5e5;
.line_element {
position: relative;
......@@ -284,6 +284,7 @@ export default {
font-size: 14px;
font-weight: 400;
color: #333333;
margin: 0 20px;
cursor: pointer;
}
.line_element_active {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!