Commit 19ca5715 by 前端

Merge branch 'v2.5.0' into 'develop'

V2.5.0

See merge request !68
2 parents f37e5094 ffd1dc76
...@@ -58,7 +58,8 @@ const createRole = params => { ...@@ -58,7 +58,8 @@ const createRole = params => {
url: '/rop-merchants/router', url: '/rop-merchants/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true,
returnAll: true
}) })
} }
const updateRole = params => { const updateRole = params => {
...@@ -88,4 +89,4 @@ export default { ...@@ -88,4 +89,4 @@ export default {
createRole, createRole,
updateRole, updateRole,
deleteRole deleteRole
}
\ No newline at end of file \ No newline at end of file
}
@import './demo.scss'; @import './demo.scss';
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
vertical-align: top; vertical-align: top;
} }
.text-hide { .text-hide {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.text-hide-2 { .text-hide-2 {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
} }
.scrm-textRight { .scrm-textRight {
position: relative; position: relative;
text-align: right; text-align: right;
} }
.scrm-textCenter { .scrm-textCenter {
text-align: center; text-align: center;
} }
.scrm-c3 { .scrm-c3 {
color: #333333; color: #333333;
} }
.scrm-f12 { .scrm-f12 {
font-size: 12px; font-size: 12px;
} }
.scrm-f13 { .scrm-f13 {
font-size: 13px; font-size: 13px;
} }
.scrm-f14 { .scrm-f14 {
font-size: 14px; font-size: 14px;
} }
.scrm-f15 { .scrm-f15 {
font-size: 15px; font-size: 15px;
} }
.scrm-f16 { .scrm-f16 {
font-size: 16px; font-size: 16px;
} }
.scrm-f18 { .scrm-f18 {
font-size: 18px; font-size: 18px;
} }
.scrm-f20 { .scrm-f20 {
font-size: 20px; font-size: 20px;
} }
.scrm-f22 { .scrm-f22 {
font-size: 22px; font-size: 22px;
} }
.scrm-f24 { .scrm-f24 {
font-size: 24px; font-size: 24px;
} }
.scrm-m10 { .scrm-m10 {
margin: 10px; margin: 10px;
} }
.scrm-m20 { .scrm-m20 {
margin: 20px; margin: 20px;
} }
.scrm-ml10 { .scrm-ml10 {
margin-left: 10px; margin-left: 10px;
} }
.scrm-ml20 { .scrm-ml20 {
margin-left: 20px; margin-left: 20px;
} }
.scrm-mr10 { .scrm-mr10 {
margin-right: 10px; margin-right: 10px;
} }
.scrm-mr20 { .scrm-mr20 {
margin-right: 20px; margin-right: 20px;
} }
.scrm-p10 { .scrm-p10 {
padding: 10px; padding: 10px;
} }
.scrm-p20 { .scrm-p20 {
padding: 20px; padding: 20px;
} }
.scrm-box-f { .scrm-box-f {
background: #FFFFFF; background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.10); box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
} }
.scrm-flex { .scrm-flex {
display: flex; display: flex;
} }
.scrm-grid { .scrm-grid {
display: grid; display: grid;
} }
.scrm-flex-center { .scrm-flex-center {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.scrm-flex-between { .scrm-flex-between {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.el-checkbox:last-of-type { .el-checkbox:last-of-type {
margin-right: 0px; margin-right: 0px;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
/*滚动条整体样式*/ /*滚动条整体样式*/
width: 6px; width: 6px;
height: 4px; height: 4px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/ /*滚动条里面小方块*/
border-radius: 4px; border-radius: 4px;
background-color: rgba(144, 147, 153, .3); background-color: rgba(144, 147, 153, 0.3);
} }
.el-message--info { .el-message--info {
height: 40px; height: 40px;
background: #e6e9ff; background: #e6e9ff;
border: 1px solid #5850ff; border: 1px solid #5850ff;
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 14px;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
} }
.el-message .el-icon-info { .el-message .el-icon-info {
color: #5850ff; color: #5850ff;
font-size: 16px; font-size: 16px;
} }
.el-cascader-menu { .el-cascader-menu {
max-height: 500px; max-height: 500px;
} }
.footer-panel { .footer-panel {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: fixed; position: fixed;
width: 100%; width: 100%;
bottom: 0px; bottom: 0px;
height: 64px; height: 64px;
background: #ffffff; background: #ffffff;
z-index: 999; z-index: 999;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1); box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
} }
.dot { .dot {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
span { span {
display: inline-block; display: inline-block;
width: 6px; width: 6px;
height: 6px; height: 6px;
border-radius: 50%; border-radius: 50%;
margin-right: 8px; margin-right: 8px;
} }
.normal { .normal {
background-color: #2CCA74; background-color: #2cca74;
} }
.draft { .draft {
background-color: #FDB757; background-color: #fdb757;
} }
.dot1 { .dot1 {
background-color: #FDB757; background-color: #fdb757;
} }
.dot2 { .dot2 {
background-color: #2CCA74; background-color: #2cca74;
} }
.dot3 { .dot3 {
background-color: #999999; background-color: #999999;
} }
.dot4 { .dot4 {
background-color: #EB4E4E; background-color: #eb4e4e;
} }
.dot5 { .dot5 {
background-color: #FDB757; background-color: #fdb757;
} }
} }
.m-r-md { .m-r-md {
margin-right: 20px;
}
\ No newline at end of file \ No newline at end of file
margin-right: 20px;
}
// 顶部按钮
.top_widget {
padding-bottom: 16px;
.el-button {
span {
margin-left: 10px;
}
}
}
.role-border {
border: 1px solid #e5e5e5;
}
.role-border-b {
border-bottom: 1px solid #e5e5e5;
}
...@@ -34,4 +34,8 @@ ...@@ -34,4 +34,8 @@
img { img {
width: 64px; width: 64px;
} }
}
.message-z {
z-index: 9999 !important;
} }
\ No newline at end of file \ No newline at end of file
...@@ -17,8 +17,8 @@ export const fetchConfig = function(isEnv = false) { ...@@ -17,8 +17,8 @@ export const fetchConfig = function(isEnv = false) {
Object.assign(request, { timeout }) Object.assign(request, { timeout })
return Promise.resolve(cfg) return Promise.resolve(cfg)
} }
return new Http().get('https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config') // return new Http().get('https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
// return new Http().get('http://oss-config.dev.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config') return new Http().get('http://config-center-backend.test.glsx.com/glsxAdmin/config?moduleUrl=setting-kyq').then(res => res.data)
} }
export const config = { export const config = {
install(vue, cfg) { install(vue, cfg) {
......
...@@ -302,8 +302,8 @@ export default { ...@@ -302,8 +302,8 @@ export default {
if (this.$refs.mapForm.geocoderAddress.addressComponent) { if (this.$refs.mapForm.geocoderAddress.addressComponent) {
fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent
provincecode = this.$refs.mapForm.geocoderAddress.adcode provincecode = this.$refs.mapForm.geocoderAddress.adcode
this.addressData.fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent this.addressData.fullAddress = fullAddress
this.addressData.provincecode = this.$refs.mapForm.geocoderAddress.adcode this.addressData.provincecode = provincecode
} else { } else {
fullAddress = this.addressData.fullAddress fullAddress = this.addressData.fullAddress
provincecode = this.addressData.provincecode provincecode = this.addressData.provincecode
...@@ -330,7 +330,7 @@ export default { ...@@ -330,7 +330,7 @@ export default {
} }
// 判断省市是否匹配 // 判断省市是否匹配
if (this.accountAddForm.provinceName) { if (this.accountAddForm.provinceName) {
if (this.accountAddForm.provinceName !== province || this.accountAddForm.cityName !== city) { if (this.accountAddForm.provinceName !== province && this.accountAddForm.cityName !== city) {
this.$message.error('您选择的地址错误,请重新选择') this.$message.error('您选择的地址错误,请重新选择')
this.accountAddForm.merchantAddress = '' this.accountAddForm.merchantAddress = ''
return return
......
<template> <template>
<div class="account-body scrm-box-f" v-loading="loading"> <div class="account-body scrm-box-f" v-loading="loading">
<div class="account-title">{{ title }}</div> <div class="account-title">{{ title }}</div>
<el-tabs v-if="tabMenu.length != 0" v-model="tabName" type="card" @tab-click="handleClik"> <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-tab-pane :label="item.accounttypeName" :name="item.accounttypeId + ''" v-for="(item, index) in tabMenu" :key="index"></el-tab-pane>
</el-tabs> </el-tabs>
<div class="account-select-pro" v-for="(item, index) in tabMenu" :key="index" v-show="tabName == item.accounttypeId"> <div class="role-border">
<label>选择产品</label> <div class="account-select-pro" v-for="(item, index) in tabMenu" :key="index" v-show="tabName == item.accounttypeId">
<el-checkbox-group v-model="item.productsArr" @change="selectPro"> <label>选择产品</label>
<el-checkbox v-for="(itm, idx) in item.products" :label="itm" :key="idx">{{ itm.productName }}</el-checkbox> <el-checkbox-group v-model="item.productsArr" @change="selectPro">
</el-checkbox-group> <el-checkbox v-for="(itm, idx) in item.products" :label="itm" :key="idx">{{ itm.productName }}</el-checkbox>
</div> </el-checkbox-group>
<div class="account-select-menu">请选择产品权限</div> </div>
<div class="menu-box"> <div class="account-select-menu">选择产品权限</div>
<div class="menu-box-panel"> <div class="menu-box">
<div :key="index" v-for="(item, index) in tabMenu"> <div class="menu-box-panel">
<div class="menu-box-tab" v-show="tabName == item.accounttypeId"> <div :key="index" v-for="(item, index) in tabMenu">
<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 class="menu-box-tab" v-show="tabName == item.accounttypeId">
{{ itm.productName }} <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> <div v-show="tabName == item.accounttypeId" class="menu-box-tree role-border" v-if="item.products" :style="{ 'min-height': treeHeight + 'px' }">
<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 v-for="(itm, idx) in item.products" :key="idx"> <div class="nodata" v-if="item.productsArr.length == 0 || itm.merchantProTreeResponses.length == 0">
<div class="nodata" v-if="item.productsArr.length == 0 || itm.merchantProTreeResponses.length == 0"> <img src="../../../assets/img/empty.png" alt="" />
<img src="../../../assets/img/empty.png" alt="" /> <div>
<div> {{ item.productsArr.length == 0 ? '请先选择产品' : '暂无菜单权限' }}
{{ 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>
<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> </div>
</div> </div>
...@@ -172,7 +174,7 @@ export default { ...@@ -172,7 +174,7 @@ export default {
}) })
}) })
this.loading = false 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 : '' this.productTab = this.tabMenu[0].productsArr[0] ? this.tabMenu[0].productsArr[0].productId : ''
// const arr = res.map(i => i.accounttypeId) // const arr = res.map(i => i.accounttypeId)
// this.tabMenu.map(i => arr.includes(i.accounttypeId)) // this.tabMenu.map(i => arr.includes(i.accounttypeId))
...@@ -393,21 +395,20 @@ export default { ...@@ -393,21 +395,20 @@ export default {
.el-checkbox:last-of-type { .el-checkbox:last-of-type {
margin-right: 8px; margin-right: 8px;
} }
.el-tabs--card > .el-tabs__header .el-tabs__nav { .el-tabs {
border: 0; height: 48px;
border: 1px solid #e5e5e5;
border-bottom: none;
} }
.el-tabs--card > .el-tabs__header { .el-tabs__header {
border: 0; line-height: 48px;
background-color: #f4f6fc; padding: 0 30px;
} }
.el-tabs--card > .el-tabs__header .el-tabs__item { .el-tabs__nav-wrap::after {
border: none; content: none;
width: 180px;
margin: 2px;
text-align: center;
} }
.el-tabs__item.is-active { .el-form-item {
background-color: #fff; margin-bottom: 0 !important;
} }
} }
.account-title { .account-title {
...@@ -419,54 +420,55 @@ export default { ...@@ -419,54 +420,55 @@ export default {
margin-bottom: 30px; margin-bottom: 30px;
} }
.account-select-pro { .account-select-pro {
padding-left: 30px; padding-left: 20px;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
line-height: 20px; line-height: 20px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 12px; margin-top: 20px;
label { label {
margin-right: 20px; margin-right: 20px;
} }
} }
.account-select-menu { .account-select-menu {
padding-left: 20px;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
line-height: 20px; line-height: 20px;
margin-top: 20px; margin-top: 10px;
} }
.menu-box { .menu-box {
position: relative; position: relative;
margin-top: 10px; margin: 10px;
background: #f4f6fc;
border-radius: 4px; border-radius: 4px;
padding: 10px;
.tab-item { .tab-item {
width: 180px; height: 40px;
background: #ffffff; background: #fafafa;
border-radius: 4px 0px 0px 0px; border-bottom: none;
border: 1px solid #f4f6fc; border-radius: 4px 4px 0px 0px;
font-size: 14px; font-size: 14px;
line-height: 14px; line-height: 40px;
font-weight: 400; font-weight: 400;
color: #37383a; color: #37383a;
text-align: center; text-align: center;
padding: 12px 0px; padding: 0 20px;
margin-right: 2px;
cursor: pointer; cursor: pointer;
&.select-checked { &.select-checked {
background: #ffffff;
color: #322ad9; color: #322ad9;
// font-weight: 700;
border-bottom: none;
} }
} }
.menu-box-tab { .menu-box-tab {
display: flex; display: flex;
} }
.menu-box-tree { .menu-box-tree {
background: #ffffff; border-radius: 0px 4px 4px 4px;
height: 640px;
overflow: auto;
} }
} }
} }
......
...@@ -53,19 +53,20 @@ ...@@ -53,19 +53,20 @@
<div class="MsgWrap powerlimt"> <div class="MsgWrap powerlimt">
<span class="content-title">功能权限</span> <span class="content-title">功能权限</span>
<div class="powerTreeWrap"> <div class="powerTreeWrap role-border">
<div class="mainTitleWrap"> <div class="mainTitleWrap role-border-b">
<div class="mainTitle" :class="{ activeMainTitle: currentIndex == index }" v-for="(item, index) in powerDataArray" :key="index" @click="powerTabClick(index)"> <div class="mainTitle" :class="{ activeMainTitle: currentIndex == index }" v-for="(item, index) in powerDataArray" :key="index" @click="powerTabClick(index)">
{{ item.accounttypeName || 'null' }} {{ item.accounttypeName || 'null' }}
<div class="tab_line" v-show="currentIndex == index"></div>
</div> </div>
</div> </div>
<div class="content"> <div class="content">
<div class="subTitleWrap" v-if="products.length > 0"> <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 }} {{ ele.productName }}
</div> </div>
</div> </div>
<div class="contentTree"> <div class="contentTree role-border">
<!-- powerDataArray.length > 0 && powerDataArray[currentIndex].products[subCurrentIndex]. --> <!-- powerDataArray.length > 0 && powerDataArray[currentIndex].products[subCurrentIndex]. -->
<!-- powerDataArray[currentIndex].products[subCurrentIndex].merchantProTreeResponses这是树的数据 --> <!-- powerDataArray[currentIndex].products[subCurrentIndex].merchantProTreeResponses这是树的数据 -->
<template v-if="merchantProTreeResponses.length > 0"> <template v-if="merchantProTreeResponses.length > 0">
...@@ -557,6 +558,16 @@ export default { ...@@ -557,6 +558,16 @@ export default {
</script> </script>
<style lang="scss" scoped> <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 { .merchantDetail {
padding-bottom: 60px; padding-bottom: 60px;
.titles { .titles {
...@@ -656,46 +667,41 @@ export default { ...@@ -656,46 +667,41 @@ export default {
.powerlimt { .powerlimt {
padding-bottom: 30px; padding-bottom: 30px;
.powerTreeWrap { .powerTreeWrap {
background-color: #f4f6fc;
margin: 0 20px; margin: 0 20px;
border-radius: 4px; border-radius: 4px;
min-height: 300px; min-height: 300px;
padding-top: 2px; padding-top: 2px;
padding-left: 2px; padding-left: 2px;
padding-bottom: 10px;
.mainTitleWrap { .mainTitleWrap {
// height: 32px; height: 48px;
display: flex; display: flex;
padding: 0 10px;
.mainTitle { .mainTitle {
background-color: #f4f6fc; position: relative;
height: 32px; margin: 0 20px;
width: 180px; line-height: 48px;
line-height: 32px;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
} }
.activeMainTitle { .activeMainTitle {
background-color: #fff;
color: #5850ff; color: #5850ff;
} }
} }
.content { .content {
background-color: #fff; margin: 20px;
border-radius: 0px 4px 4px 4px;
margin: 20px 10px 0;
.subTitleWrap { .subTitleWrap {
// height: 40px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
background-color: #f4f6fc;
.subTitle { .subTitle {
padding: 0px 5px; background: #fafafa;
background-color: #f4f6fc; padding: 0px 20px;
height: 40px; height: 40px;
width: 180px;
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 4px 4px 0px 0px;
border-bottom: none;
margin-right: 2px;
} }
.acitveSubTitle { .acitveSubTitle {
background-color: #fff !important; background-color: #fff !important;
...@@ -707,7 +713,7 @@ export default { ...@@ -707,7 +713,7 @@ export default {
height: 250px; height: 250px;
position: relative; position: relative;
overflow: auto; overflow: auto;
border-radius: 0px 4px 4px 4px;
.noDataContent { .noDataContent {
width: 64px; width: 64px;
height: 64px; height: 64px;
......
<template> <template>
<div class="scrm-main"> <div class="scrm-main">
<div class="form-header" v-if="$globalState.session.accountLevel == 1 && $globalState.session.merchantModel == 1"> <div class="form-header" v-if="$globalState.session.accountLevel == 1 && $globalState.session.merchantModel == 1">
<!-- <GLButton @click="handleContact" icon="el-icon-link" fn="门店账户关联企微" type="primary" size="small" mode="el-button">门店账户关联企微</GLButton> --> <GLButton @click="handleContact" icon="el-icon-link" fn="门店账户关联企微" type="primary" size="small" mode="el-button">门店账户关联企微</GLButton>
<el-button type="primary" @click="handleContact" size="small" icon="el-icon-link">门店账户关联企微</el-button> <!-- <el-button type="primary" @click="handleContact" size="small" icon="el-icon-link">门店账户关联企微</el-button> -->
</div> </div>
<div class="follow-form"> <div class="follow-form">
<GLCombiForm :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
......
...@@ -187,8 +187,10 @@ export default { ...@@ -187,8 +187,10 @@ export default {
if (this.$refs.mapForm.geocoderAddress.addressComponent) { if (this.$refs.mapForm.geocoderAddress.addressComponent) {
fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent
provincecode = this.$refs.mapForm.geocoderAddress.adcode provincecode = this.$refs.mapForm.geocoderAddress.adcode
this.addressData.fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent this.addressData.fullAddress = fullAddress
this.addressData.provincecode = this.$refs.mapForm.geocoderAddress.adcode this.addressData.provincecode = provincecode
// this.addressData.fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent
// this.addressData.provincecode = this.$refs.mapForm.geocoderAddress.adcode
} else { } else {
fullAddress = this.addressData.fullAddress fullAddress = this.addressData.fullAddress
provincecode = this.addressData.provincecode provincecode = this.addressData.provincecode
...@@ -215,7 +217,7 @@ export default { ...@@ -215,7 +217,7 @@ export default {
} }
// 判断省市是否匹配 // 判断省市是否匹配
if (this.infoForm.provinceName) { if (this.infoForm.provinceName) {
if (this.infoForm.provinceName !== province || this.infoForm.cityName !== city) { if (this.infoForm.provinceName !== province && this.infoForm.cityName !== city) {
this.$message.error('您选择的地址错误,请重新选择') this.$message.error('您选择的地址错误,请重新选择')
this.infoForm.merchantAddress = '' this.infoForm.merchantAddress = ''
return return
......
<!--
* @Description:
* @Author: huyue
* @Date: 2022-06-10 15:36:06
* @LastEditors: huyue
* @LastEditTime: 2022-06-22 17:22:54
-->
<template>
<div>
<GLDialog :width="'1080px'" :visible="roleVisible" :close-on-click-modal="false" @close="handleClose" title="创建角色" :showClose="true">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="154px" class="demo-ruleForm">
<el-form-item class="aa" v-if="$globalState.session.accountLevel != 4" label="所属商户" prop="merchantId">
<el-select :size="size" style="width: 40%" v-model="ruleForm.merchantId" clearable filterable placeholder="请选择" @change="merchantChange">
<el-option v-for="item in merchantList" :key="item.id" :label="item.merchantName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属商户:" prop="merchantName" v-else>
<span>{{ $globalState.session.merchantName }}</span>
</el-form-item>
<el-form-item label="角色名称:" prop="roleName">
<el-input :size="size" maxlength="20" style="width: 40%; padding-right: 50px" @input="changeInput" v-model="ruleForm.roleName" placeholder="请输入角色名称"></el-input>
</el-form-item>
<el-form-item label="角色说明:" prop="roleDesc">
<el-input :size="size" maxlength="50" style="width: 40%; padding-right: 50px" @input="changeInput" v-model="ruleForm.roleDesc" placeholder="请输入角色说明"></el-input>
</el-form-item>
<el-form-item label="角色权限:" prop="roleAuth">
<el-checkbox-group v-model="ruleForm.roleAuth">
<el-checkbox v-for="(itm, idx) in accountListSelect" :label="itm.accounttypeName" @change="selectCurAccount(itm, idx)" :key="idx">{{ itm.accounttypeName }}</el-checkbox>
</el-checkbox-group>
<SelectProduct v-if="roleVisible" ref="productFrom" :roleType="true" title="角色权限"></SelectProduct>
</el-form-item>
</el-form>
<div slot="footer">
<el-button :size="size" @click="handleClose">取消</el-button>
<el-button :size="size" type="primary" @click="toCreateRole">提交</el-button>
</div>
</GLDialog>
</div>
</template>
<script>
import SelectProduct from './selectProduct'
export default {
name: 'CreateRole',
components: {
SelectProduct
},
data() {
return {
roleVisible: false,
ruleForm: {
merchantId: '',
roleName: '',
roleDesc: '',
roleAuth: []
},
rules: {
roleName: [{ required: true, message: '请输入角色名称', trigger: 'blur' }],
merchantId: [{ required: true, message: '请选择所属商户', trigger: 'change' }],
roleAuth: [{ required: true, message: '请选择角色权限', trigger: 'change' }]
},
//商户下拉框
merchantList: [],
accountListSelect: [],
rootList: []
}
},
methods: {
init() {
this.roleVisible = true
if (this.$refs.ruleForm) this.$refs.ruleForm.resetFields()
this.getMerchantName()
},
handleClose() {
this.roleVisible = false
},
getMerchantName() {
this.$apis.role.merchantDataList({ source: 'glsx' }).then(res => {
this.merchantList = res
if (this.$globalState.session.accountLevel == 4) {
this.ruleForm.merchantId = this.merchantList[0].id
this.selectMerchant(this.merchantList[0].id)
}
// this.filterList()
})
},
// 选择商户----获取权限
async selectMerchant(id, list) {
let res = await this.$refs.productFrom.findMenuFunTreeByMerId({ id })
this.accountListSelect = res.map(item => {
item.select = false
return item
})
},
// 选择商户权限
selectCurAccount(item, index) {
this.isChangeEdit = true
this.roleRootRules = false
this.accountListSelect[index].select = !item.select
this.curRootIndex = 0
if (this.accountListSelect[index].select) {
this.rootList.push(item)
} else {
let arr = this.rootList.filter(el => {
return item.accounttypeId != el.accounttypeId
})
this.rootList = arr
}
let accounttypeId = []
this.rootList.forEach(item => {
accounttypeId.push(item.accounttypeId)
})
this.accounttypeIds = accounttypeId
this.$refs.productFrom.findMenuFunTree(item.accounttypeId, item.select)
},
toCreateRole() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let { merchantId, roleDesc, roleName } = this.ruleForm
let product = this.$refs.productFrom.getSelectInfo()
if (product && product.every(item => item.productList.length == 0)) {
this.$message({
type: 'error',
message: '请至少选择一个产品',
customClass: 'message-z'
})
return
}
let accountTypes = JSON.stringify(this.$refs.productFrom.getSelectInfo())
let para = {
merchantId: merchantId,
roleName: roleName,
roleDescription: roleDesc,
delFlag: 0,
requestList: accountTypes
}
this.$apis.role.createRole(para).then(res => {
if (res.code == -1) {
this.$message.error(res.message)
return
}
this.$message.success('操作成功')
this.$emit('updataRole', true)
this.roleVisible = !res
this.ruleForm = {
merchantId: '',
roleName: '',
roleDesc: '',
roleAuth: ''
}
})
} else {
return false
}
})
}
}
}
</script>
<style scoped lang="scss">
/deep/ {
.el-dialog__body {
padding: 20px;
}
.el-form-item {
display: inline-block;
width: 50%;
vertical-align: text-top;
margin-bottom: 20px !important;
.el-input {
width: 360px !important;
}
&:last-child {
width: 100%;
}
.el-form-item__label,
.el-form-item__content {
line-height: 32px;
}
}
}
</style>
...@@ -5,19 +5,20 @@ ...@@ -5,19 +5,20 @@
<div class="MsgWrap powerlimt"> <div class="MsgWrap powerlimt">
<span class="content-title">产品功能权限</span> <span class="content-title">产品功能权限</span>
<div class="powerTreeWrap"> <div class="powerTreeWrap role-border">
<div class="mainTitleWrap"> <div class="mainTitleWrap role-border-b">
<div class="mainTitle" :class="{ activeMainTitle: currentIndex == index }" v-for="(item, index) in powerDataArray" :key="index" @click="powerTabClick(index)"> <div class="mainTitle" :class="{ activeMainTitle: currentIndex == index }" v-for="(item, index) in powerDataArray" :key="index" @click="powerTabClick(index)">
{{ item.accounttypeName || 'null' }} {{ item.accounttypeName || 'null' }}
<div class="tab_line" v-show="currentIndex == index"></div>
</div> </div>
</div> </div>
<div class="content"> <div class="content">
<div class="subTitleWrap" v-if="products.length > 0"> <div class="subTitleWrap" v-if="products.length > 0">
<div class="subTitle" :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 }} {{ ele.productName }}
</div> </div>
</div> </div>
<div class="contentTree"> <div class="contentTree role-border">
<template v-if="merchantProTreeResponses.length > 0"> <template v-if="merchantProTreeResponses.length > 0">
<el-tree default-expand-all :data="merchantProTreeResponses" :render-content="renderContent" :props="defaultProps"></el-tree> <el-tree default-expand-all :data="merchantProTreeResponses" :render-content="renderContent" :props="defaultProps"></el-tree>
</template> </template>
...@@ -141,6 +142,16 @@ export default { ...@@ -141,6 +142,16 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.tab_line {
width: 100%;
height: 2px;
background: #5850ff;
border-radius: 4px;
position: absolute;
left: 50%;
top: 48px;
transform: translate(-50%, 0);
}
.config-employee { .config-employee {
margin-bottom: 64px; margin-bottom: 64px;
} }
...@@ -163,8 +174,6 @@ export default { ...@@ -163,8 +174,6 @@ export default {
.powerlimt { .powerlimt {
padding-bottom: 30px; padding-bottom: 30px;
.powerTreeWrap { .powerTreeWrap {
background-color: #f4f6fc;
// margin: 0 20px;
border-radius: 4px; border-radius: 4px;
min-height: 300px; min-height: 300px;
padding-top: 2px; padding-top: 2px;
...@@ -176,12 +185,12 @@ export default { ...@@ -176,12 +185,12 @@ export default {
flex-wrap: wrap; flex-wrap: wrap;
.mainTitle { .mainTitle {
background-color: #f4f6fc; height: 48px;
height: 32px; line-height: 48px;
width: 180px;
line-height: 32px;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
position: relative;
margin: 0 20px;
cursor: pointer; cursor: pointer;
} }
.activeMainTitle { .activeMainTitle {
...@@ -197,14 +206,14 @@ export default { ...@@ -197,14 +206,14 @@ export default {
// height: 40px; // height: 40px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
background-color: #f4f6fc;
.subTitle { .subTitle {
background-color: #f4f6fc; background-color: #fafafa;
height: 40px; height: 40px;
width: 180px; width: 180px;
font-size: 14px; font-size: 14px;
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
border-bottom: none;
border-radius: 2px; border-radius: 2px;
} }
.acitveSubTitle { .acitveSubTitle {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</template> </template>
<template v-if="userInfo.accountLevel == 4 && routeInfo.addOrEdit == 1" slot="roleIdsSlot"> <template v-if="userInfo.accountLevel == 4 && routeInfo.addOrEdit == 1" slot="roleIdsSlot">
<el-button class="m-l-10" type="primary" @click="handleJumpRole">创建角色</el-button> <el-button class="m-l-10" type="primary" @click="handleJumpRole">创建角色</el-button>
<el-button class="m-l-10 el-icon-refresh" type="primary" @click="handleRefresh">刷新</el-button> <!-- <el-button class="m-l-10 el-icon-refresh" type="primary" @click="handleRefresh">刷新</el-button> -->
</template> </template>
<template slot="visibleInferiorMer" slot-scope="item"> <template slot="visibleInferiorMer" slot-scope="item">
<el-input :style="{ width: item.width || '320px' }" placeholder="可见商户" v-model="filterText"></el-input> <el-input :style="{ width: item.width || '320px' }" placeholder="可见商户" v-model="filterText"></el-input>
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
</template> </template>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<CreateRole ref="createRole" @updataRole="updataRole"></CreateRole>
<GLFooter> <GLFooter>
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button> <el-button type="default" @click="handleCancel">取消</el-button>
...@@ -35,6 +37,7 @@ ...@@ -35,6 +37,7 @@
</template> </template>
<script> <script>
import CreateRole from './components/createRole'
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
// import selectPage from './components/selectPage' // import selectPage from './components/selectPage'
import glsxCombiForm from './glsx-combi-form' import glsxCombiForm from './glsx-combi-form'
...@@ -42,7 +45,8 @@ export default { ...@@ -42,7 +45,8 @@ export default {
name: 'editEmployee', name: 'editEmployee',
components: { components: {
glsxCombiForm glsxCombiForm,
CreateRole
// selectPage // selectPage
}, },
...@@ -103,8 +107,25 @@ export default { ...@@ -103,8 +107,25 @@ export default {
} }
], ],
visibleInferiorMer: [{ required: true, message: '请选择可见商户', trigger: 'change' }], visibleInferiorMer: [{ required: true, message: '请选择可见商户', trigger: 'change' }],
roleIds: [{ required: true, message: '请选择角色权限', trigger: 'change' }] roleIds: [{ required: true, message: '请选择角色权限', trigger: 'change' }],
// staffEmail: [{ required: false, validator: (rule, value, callback) => {}, trigger: 'change' }] staffEmail: [
{
required: false,
validator: (rule, value, callback) => {
var reg = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
if (value) {
if (!reg.test(value)) {
return callback(new Error('请输入正确格式的邮箱'))
} else {
return callback()
}
} else {
return callback()
}
},
trigger: 'change'
}
]
}, },
isBlock: true, isBlock: true,
editFormData: [ editFormData: [
...@@ -321,8 +342,10 @@ export default { ...@@ -321,8 +342,10 @@ export default {
this.editForm.password = '' this.editForm.password = ''
}, },
handleJumpRole() { handleJumpRole() {
let path = document.location.pathname.split('/')[1] console.log('创建角色', this.$refs.createRole)
this.$history.push('/' + path + '/role/create') // let path = document.location.pathname.split('/')[1]
// this.$history.push('/' + path + '/role/create')
this.$refs.createRole.init()
}, },
handleRefresh() { handleRefresh() {
this.editForm.merchantId this.editForm.merchantId
...@@ -404,6 +427,9 @@ export default { ...@@ -404,6 +427,9 @@ export default {
this.$refs.tree.setCheckedKeys(allId) this.$refs.tree.setCheckedKeys(allId)
} }
this.isCheckAll = !this.isCheckAll this.isCheckAll = !this.isCheckAll
},
updataRole() {
this.getRoleList(this.editForm.merchantId)
} }
}, },
...@@ -418,7 +444,7 @@ export default { ...@@ -418,7 +444,7 @@ export default {
this.routeInfo.addOrEdit != 1 ? this.getInfo() : '' this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
} }
} }
</script> </script>
<style> <style>
.config-employee { .config-employee {
......
<!-- 员工管理 --> <!-- 员工管理 -->
<template> <template>
<div class="config-employee employee-list"> <div class="config-employee employee-list">
<div style="margin-bottom: 10px"> <div class="top_widget">
<GLButton @click="handleEdit(1)" :size="size" class="el-icon-plus" fn="创建员工" type="primary" mode="el-button">创建员工</GLButton> <GLButton @click="handleEdit(1)" :size="size" icon="el-icon-plus" fn="创建员工" type="primary" mode="el-button">创建员工</GLButton>
<!-- <el-button :size="size" type="primary" class="el-icon-plus" >创建员工</el-button> --> <!-- <el-button :size="size" type="primary" class="el-icon-plus" >创建员工</el-button> -->
</div> </div>
<div class="container"> <div class="container">
...@@ -555,34 +555,35 @@ export default { ...@@ -555,34 +555,35 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { })
const list = selectArr.map(item => { .then(() => {
return { const list = selectArr.map(item => {
staffId: item.id, return {
status: 0 staffId: item.id,
status: 0
}
})
const param = {
list
} }
this.$apis.employee.updateStatusBatch(param).then(res => {
if (res) {
this.$message.success('操作成功')
this.$refs.employeeRef.refreshTable(false)
} else {
this.$message.error('操作失败')
}
})
}) })
const param = { .catch(() => {
list console.log('点击了取消')
}
this.$apis.employee.updateStatusBatch(param).then(res => {
if(res) {
this.$message.success('操作成功')
this.$refs.employeeRef.refreshTable(false)
} else {
this.$message.error('操作失败')
}
}) })
}).catch(() => {
console.log('点击了取消')
})
} }
} }
}, },
// 批量分配角色,确定按钮 // 批量分配角色,确定按钮
handleAssign() { handleAssign() {
this.$refs.roleForm.validate((valid) => { this.$refs.roleForm.validate(valid => {
if (valid) { if (valid) {
const { roleId } = this.roleForm const { roleId } = this.roleForm
let staffIds = this.$refs.employeeRef.mutiSelectArr[this.tableParams1.mutiSelectName] let staffIds = this.$refs.employeeRef.mutiSelectArr[this.tableParams1.mutiSelectName]
......
<template> <template>
<div class="account-body scrm-box-f" v-loading="loading" v-if="tabMenuStatus"> <div class="account-body scrm-box-f role-border" v-loading="loading" v-if="tabMenuStatus">
<div class="account-title">{{ title }}</div> <!-- <div class="account-title">{{ title }}</div> -->
<el-tabs v-if="tabMenu.length != 0" v-model="tabName" type="card" @tab-click="handleClik"> <el-tabs v-if="tabMenu.length != 0" v-model="tabName" @tab-click="handleClik">
<template v-for="(item, index) in tabMenu"> <template v-for="(item, index) in tabMenu">
<el-tab-pane v-show="item && item.accounttypeId" :label="item.accounttypeName" :name="item.accounttypeId" v-if="item" :key="index"></el-tab-pane> <el-tab-pane :label="item.accounttypeName" :name="item.accounttypeId + ''" v-if="item && item.accounttypeId" :key="index"></el-tab-pane>
</template> </template>
</el-tabs> </el-tabs>
<div class="account-select-pro" v-for="(item, index) in tabMenu" :key="index" v-show="tabName == item.accounttypeId"> <div class="account-select-pro" v-for="(item, index) in tabMenu" :key="index" v-show="tabName == item.accounttypeId">
<label>选择产品</label> <label>产品权限:</label>
<el-checkbox-group v-model="item.productsArr" @change="selectPro"> <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 v-for="(itm, idx) in item.products" :label="itm" :key="idx">{{ itm.productName }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
<div class="account-select-menu">请选择产品权限</div> <!-- <div class="account-select-menu">请选择产品权限</div> -->
<div class="menu-box"> <div class="menu-box">
<div class="menu-box-panel"> <div class="menu-box-panel">
<div :key="index" v-for="(item, index) in tabMenu"> <div :key="index" v-for="(item, index) in tabMenu">
<div class="menu-box-tab" v-show="tabName == item.accounttypeId"> <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 }} {{ itm.productName }}
</div> </div>
</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 v-for="(itm, idx) in item.products" :key="idx">
<div class="nodata" v-if="item.productsArr.length == 0 || itm.merchantProTreeResponses.length == 0"> <div class="nodata" v-if="item.productsArr.length == 0 || itm.merchantProTreeResponses.length == 0">
<img src="../../../assets/img/empty.png" alt="" /> <img src="../../../assets/img/empty.png" alt="" />
...@@ -84,7 +84,6 @@ export default { ...@@ -84,7 +84,6 @@ export default {
}, },
methods: { methods: {
handleClik(tab, event) { handleClik(tab, event) {
console.log(tab, event)
const tabId = tab.name const tabId = tab.name
const productTab = this.tabMenu.find(i => i.accounttypeId == tabId) const productTab = this.tabMenu.find(i => i.accounttypeId == tabId)
this.productTab = productTab.productsArr[0] ? productTab.productsArr[0].productId : '' this.productTab = productTab.productsArr[0] ? productTab.productsArr[0].productId : ''
...@@ -94,7 +93,6 @@ export default { ...@@ -94,7 +93,6 @@ export default {
this.$parent.editStatus = true this.$parent.editStatus = true
this.productTab = data.length != 0 ? data[data.length - 1].productId : '' this.productTab = data.length != 0 ? data[data.length - 1].productId : ''
const { tabName, tabMenu, productTab } = this const { tabName, tabMenu, productTab } = this
console.log(tabName, data, productTab, '选中')
// 设置全选 // 设置全选
var merchantProTreeResponses = tabMenu.find(i => i.accounttypeId == tabName).products.find(j => j.productId == productTab) var merchantProTreeResponses = tabMenu.find(i => i.accounttypeId == tabName).products.find(j => j.productId == productTab)
var arr = merchantProTreeResponses ? merchantProTreeResponses.merchantProTreeResponses : '' var arr = merchantProTreeResponses ? merchantProTreeResponses.merchantProTreeResponses : ''
...@@ -131,13 +129,12 @@ export default { ...@@ -131,13 +129,12 @@ export default {
}) })
if (status) { if (status) {
this.$set(this.tabMenu, idx, menuSelect[0]) this.$set(this.tabMenu, idx, menuSelect[0])
this.tabName = this.tabMenu[idx] ? this.tabMenu[idx].accounttypeId : '' this.tabName = this.tabMenu[idx] ? this.tabMenu[idx].accounttypeId + '' : ''
} else { } else {
this.$set(this.tabMenu, idx, '') this.$set(this.tabMenu, idx, '')
let accounttypeId = this.tabMenu.find(item => item) let accounttypeId = this.tabMenu.find(item => item)
this.tabName = accounttypeId ? accounttypeId.accounttypeId : '' this.tabName = accounttypeId ? accounttypeId.accounttypeId + '' : ''
} }
console.log(this.tabMenu)
this.tabMenuStatus = this.tabMenu.some(item => item) this.tabMenuStatus = this.tabMenu.some(item => item)
}, },
// 获取当前的所有权限 // 获取当前的所有权限
...@@ -158,7 +155,7 @@ export default { ...@@ -158,7 +155,7 @@ export default {
accounttypeId: item.accounttypeId accounttypeId: item.accounttypeId
} }
}) })
this.tabName = this.tabMenu_r[0].accounttypeId this.tabName = this.tabMenu_r[0].accounttypeId + ''
return this.tabMenu_r return this.tabMenu_r
}, },
// 获取当前的所有权限 // 获取当前的所有权限
...@@ -192,7 +189,6 @@ export default { ...@@ -192,7 +189,6 @@ export default {
}, },
// 获取已选择的权限 // 获取已选择的权限
findPermissionsByMerId(arr) { findPermissionsByMerId(arr) {
console.log(arr)
let accounttypeId = [] let accounttypeId = []
arr.forEach(item => { arr.forEach(item => {
accounttypeId.push(item.accounttypeId) accounttypeId.push(item.accounttypeId)
...@@ -209,7 +205,7 @@ export default { ...@@ -209,7 +205,7 @@ export default {
itm.productsArr.push(j) itm.productsArr.push(j)
this.$nextTick(() => { this.$nextTick(() => {
setTimeout(() => { setTimeout(() => {
this.addStyle() this.addStyle()
this.$refs[`tree_${itm.accounttypeId}_${j.productId}`] ? this.$refs[`tree_${itm.accounttypeId}_${j.productId}`][0].setCheckedKeys(i.idList) : '' this.$refs[`tree_${itm.accounttypeId}_${j.productId}`] ? this.$refs[`tree_${itm.accounttypeId}_${j.productId}`][0].setCheckedKeys(i.idList) : ''
}, 300) }, 300)
}) })
...@@ -222,12 +218,12 @@ export default { ...@@ -222,12 +218,12 @@ export default {
}) })
}) })
this.tabMenuStatus = this.tabMenu.some(item => item) this.tabMenuStatus = this.tabMenu.some(item => item)
let tabMenu = this.tabMenu.filter((item, index) => { let tabMenu = this.tabMenu.filter((item, index) => {
return item && item.accounttypeId && this.tabMenu[index].productsArr.length>0 return item && item.accounttypeId && this.tabMenu[index].productsArr.length > 0
}) })
setTimeout(() => { setTimeout(() => {
this.tabName = tabMenu[0].accounttypeId this.tabName = tabMenu[0].accounttypeId + ''
this.productTab = tabMenu[0].productsArr[0].productId this.productTab = tabMenu[0].productsArr[0].productId
}, 100) }, 100)
}, },
resetView() { resetView() {
...@@ -333,7 +329,6 @@ export default { ...@@ -333,7 +329,6 @@ export default {
uniteChildSame(treeList, isSelected) { uniteChildSame(treeList, isSelected) {
const tree_ref = `tree_${this.tabName}_${this.productTab}` const tree_ref = `tree_${this.tabName}_${this.productTab}`
this.$refs[tree_ref][0].setChecked(treeList.id, isSelected) this.$refs[tree_ref][0].setChecked(treeList.id, isSelected)
console.log(treeList)
if (treeList.children !== null) { if (treeList.children !== null) {
for (let i = 0; i < treeList.children.length; i++) { for (let i = 0; i < treeList.children.length; i++) {
this.uniteChildSame(treeList.children[i], isSelected) this.uniteChildSame(treeList.children[i], isSelected)
...@@ -371,7 +366,6 @@ export default { ...@@ -371,7 +366,6 @@ export default {
let productList = [] let productList = []
item.productsArr.forEach(itm => { item.productsArr.forEach(itm => {
const checkedNodes = this.$refs[`tree_${item.accounttypeId}_${itm.productId}`] ? this.$refs[`tree_${item.accounttypeId}_${itm.productId}`][0].getCheckedNodes() : [] const checkedNodes = this.$refs[`tree_${item.accounttypeId}_${itm.productId}`] ? this.$refs[`tree_${item.accounttypeId}_${itm.productId}`][0].getCheckedNodes() : []
console.log(checkedNodes)
const menuIdList = checkedNodes const menuIdList = checkedNodes
// .filter((item) => item.logo === "menu") // .filter((item) => item.logo === "menu")
.filter(item => item.logo !== 'function' && item.logo !== 'functionValue' && item.logo !== 'neglect') .filter(item => item.logo !== 'function' && item.logo !== 'functionValue' && item.logo !== 'neglect')
...@@ -432,7 +426,6 @@ export default { ...@@ -432,7 +426,6 @@ export default {
} }
} }
}) })
console.log(this.accountTypes, ' =-=-=-=-==')
return this.accountTypes return this.accountTypes
} }
}, },
...@@ -441,41 +434,27 @@ export default { ...@@ -441,41 +434,27 @@ export default {
// this.findPermissionsByMerId() // this.findPermissionsByMerId()
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.account-body { .account-body {
padding: 20px; // border: 1px solid #e5e5e5;
margin-bottom: 50px; border-radius: 2px;
/deep/ { /deep/ {
.el-checkbox:last-of-type { .el-tabs {
margin-right: 8px; border-bottom: 1px solid #e5e5e5;
}
.el-tabs--card > .el-tabs__header .el-tabs__nav {
border: 0;
} }
.el-tabs--card > .el-tabs__header { .el-tabs__header {
border: 0; margin: 0;
background-color: #f4f6fc; padding: 0 30px;
} }
.el-tabs--card > .el-tabs__header .el-tabs__item { .el-checkbox:last-of-type {
border: none; margin-right: 8px;
width: 180px;
margin: 2px;
text-align: center;
} }
.el-tabs__item.is-active { .el-tabs__nav-wrap::after {
background-color: #fff; content: none;
} }
} }
.account-title {
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 16px;
letter-spacing: 1px;
margin-bottom: 30px;
}
.account-select-pro { .account-select-pro {
padding-left: 30px; padding-left: 30px;
font-size: 14px; font-size: 14px;
...@@ -484,40 +463,30 @@ export default { ...@@ -484,40 +463,30 @@ export default {
line-height: 20px; line-height: 20px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 12px; margin-top: 28px;
label { label {
margin-right: 20px; margin-right: 20px;
} }
} }
.account-select-menu {
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
margin-top: 20px;
}
.menu-box { .menu-box {
position: relative; position: relative;
margin-top: 10px; padding: 20px;
background: #f4f6fc; border-radius: 0px 4px 4px 4px;
border-radius: 4px;
padding: 10px;
.tab-item { .tab-item {
width: 180px; background: #fafafa;
background: #ffffff; border-radius: 4px 4px 0px 0px;
border-radius: 4px 0px 0px 0px; margin-right: 2px;
border: 1px solid #f4f6fc;
font-size: 14px; font-size: 14px;
line-height: 14px; line-height: 14px;
font-weight: 400; font-weight: 400;
color: #37383a; color: #37383a;
text-align: center; text-align: center;
padding: 12px 0px; padding: 12px 20px;
border-bottom: none;
cursor: pointer; cursor: pointer;
&.select-checked { &.select-checked {
background: #ffffff;
color: #322ad9; color: #322ad9;
// font-weight: 700;
border-bottom: none;
} }
} }
.menu-box-tab { .menu-box-tab {
...@@ -540,4 +509,8 @@ export default { ...@@ -540,4 +509,8 @@ export default {
margin-bottom: 12px; margin-bottom: 12px;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
/deep/ .el-tree {
height: 640px;
overflow: auto;
}
</style>
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<el-option v-for="item in merchantList" :key="item.id" :label="item.merchantName" :value="item.id"></el-option> <el-option v-for="item in merchantList" :key="item.id" :label="item.merchantName" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="所属商户" prop="merchantName" v-if="pageType == 'create' && accountLevel == 4"> <el-form-item label="所属商户" prop="merchantName" v-if="pageType == 'create' && accountLevel == 4">
<el-input size="small" disabled style="width: 40%" v-model="ruleForm.merchantName"></el-input> <el-input size="small" disabled style="width: 40%" v-model="ruleForm.merchantName"></el-input>
</el-form-item> --> </el-form-item>
<el-form-item label="所属商户" prop="merchantName" v-if="pageType == 'edit'"> <el-form-item label="所属商户" prop="merchantName" v-if="pageType == 'edit'">
<el-input size="small" disabled style="width: 40%" v-model="ruleForm.merchantName"></el-input> <el-input size="small" disabled style="width: 40%" v-model="ruleForm.merchantName"></el-input>
</el-form-item> </el-form-item>
...@@ -32,39 +32,40 @@ ...@@ -32,39 +32,40 @@
</template> </template>
</div> </div>
</el-form-item> --> </el-form-item> -->
<el-row> </el-form>
<el-col :span="16"> </div>
<div data-v-995a4ff0="" class="el-form-item is-required"> </div>
<label for="roleName" class="el-form-item__label" style="width: 100px">角色权限</label> <div class="role_widget">
<div class="el-form-item__content" style="margin-left: 100px"> <div class="top_title_widget">
<!-- <div data-v-995a4ff0="" class="el-input el-input--small"> <span class="title">角色权限</span>
</div>
<el-row>
<el-col :span="16">
<div data-v-995a4ff0="" class="role-list">
<label for="roleName" class="el-form-item__label" style="width: 100px">角色权限</label>
<div class="el-form-item__content" style="margin-left: 100px">
<!-- <div data-v-995a4ff0="" class="el-input el-input--small">
<auto-button v-for="(item, index) in accountDetail.accountTypes" :key="index" :btnLabel="item.accounttypeName" :btnValue="item.accounttypeId" :stopClick="nextStatus" @getBtnStatus="getBtnStatus"></auto-button> <auto-button v-for="(item, index) in accountDetail.accountTypes" :key="index" :btnLabel="item.accounttypeName" :btnValue="item.accounttypeId" :stopClick="nextStatus" @getBtnStatus="getBtnStatus"></auto-button>
</div> --> </div> -->
<div class="custom_element"> <div class="custom_element">
<template v-for="(item, index) in accountListSelect"> <template v-for="(item, index) in accountListSelect">
<div :key="index" class="wrap"> <div :key="index" class="wrap">
<AutoButton @getBtnStatus="selectCurAccount(item, index)" :typeStatus="item.select" :btnLabel="item.accounttypeName"></AutoButton> <AutoButton @getBtnStatus="selectCurAccount(item, index)" :typeStatus="item.select" :btnLabel="item.accounttypeName"></AutoButton>
</div>
</template>
</div> </div>
<div class="el-form-item__error" v-if="roleRootRules">请选择角色权限</div> </template>
</div>
</div> </div>
</el-col> <div class="el-form-item__error" v-if="roleRootRules">请选择角色权限</div>
</el-row> </div>
</el-form> </div>
</div> </el-col>
</div> </el-row>
<div class="scrm-box-f" style="margin-top: 10px"> <SelectProduct class="role-detail" ref="productFrom" :roleType="true"></SelectProduct>
<SelectProduct ref="productFrom" :roleType="true" title="角色权限"></SelectProduct>
<!-- <div style="height: 84px"></div> -->
<GLFooter style="z-index: 1">
<el-button v-if="pageType == 'create'" type="primary" plain @click="toCreateRole(1)">草稿</el-button>
<el-button type="primary" @click="toCreateRole(0)">确定</el-button>
<el-button @click="toBack">取消</el-button>
</GLFooter>
</div> </div>
<GLFooter style="z-index: 1">
<el-button @click="toBack">取消</el-button>
<el-button v-if="pageType == 'create'" type="primary" plain @click="toCreateRole(1)">存为草稿</el-button>
<el-button type="primary" @click="toCreateRole(0)">提交</el-button>
</GLFooter>
</div> </div>
</template> </template>
<script> <script>
...@@ -139,7 +140,6 @@ export default { ...@@ -139,7 +140,6 @@ export default {
// 获取商户树 // 获取商户树
getMerchantTree(id, list) { getMerchantTree(id, list) {
this.$apis.role.roleTreeDataById({ id }).then(res => { this.$apis.role.roleTreeDataById({ id }).then(res => {
console.log(res)
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
for (let j = 0; j < res.length; j++) { for (let j = 0; j < res.length; j++) {
if (res[j].accounttypeId == list[i].accounttypeId) { if (res[j].accounttypeId == list[i].accounttypeId) {
...@@ -148,7 +148,6 @@ export default { ...@@ -148,7 +148,6 @@ export default {
} }
} }
this.accountListSelect = res this.accountListSelect = res
console.log(this.accountListSelect)
}) })
}, },
getMerchantName() { getMerchantName() {
...@@ -209,7 +208,6 @@ export default { ...@@ -209,7 +208,6 @@ export default {
this.rootList.forEach(item => { this.rootList.forEach(item => {
accounttypeId.push(item.accounttypeId) accounttypeId.push(item.accounttypeId)
}) })
console.log(this.rootList, accounttypeId, '99999')
this.accounttypeIds = accounttypeId this.accounttypeIds = accounttypeId
this.$refs.productFrom.findMenuFunTree(item.accounttypeId, item.select) this.$refs.productFrom.findMenuFunTree(item.accounttypeId, item.select)
}, },
...@@ -349,13 +347,26 @@ export default { ...@@ -349,13 +347,26 @@ export default {
// } // }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.role_widget {
margin-top: 16px;
background: #ffffff;
margin-bottom: 80px;
// padding-bottom: 32px;
overflow: hidden;
}
.role-detail {
margin: 0 20px 32px 20px;
}
.role-create-page { .role-create-page {
height: 100%; height: 100%;
width: 100%; width: 100%;
background: #ffffff; background: #ffffff;
} }
.role-list {
padding: 40px 0 20px 104px;
}
.top_title_widget { .top_title_widget {
width: 100%; width: 100%;
height: 58px; height: 58px;
...@@ -402,4 +413,4 @@ export default { ...@@ -402,4 +413,4 @@ export default {
margin-right: 15px; margin-right: 15px;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template> <template>
<div class="role-home-page"> <div class="role-home-page">
<div class="top_widget"> <div class="top_widget">
<GLButton size="small" fn="创建角色" icon="el-icon-plus" type="primary" @click="toCreatePage">创建角色</GLButton> <!-- <GLButton :size="size" fn="创建角色" icon="el-icon-plus" type="primary" @click="toCreatePage" mode="el-button">创建角色</GLButton> -->
<!-- <el-button size="small" icon="el-icon-plus" type="primary" @click="toCreatePage">创建角色</el-button> --> <el-button size="small" icon="el-icon-plus" type="primary" @click="toCreatePage">创建角色</el-button>
</div> </div>
<div class="table_widget"> <div class="table_widget">
<div> <div>
...@@ -144,7 +144,7 @@ export default { ...@@ -144,7 +144,7 @@ export default {
{ {
type: 'GLButton', type: 'GLButton',
name: row => { name: row => {
return '修改' return '编辑'
}, },
condition: row => { condition: row => {
return !row.defalutRole return !row.defalutRole
...@@ -318,13 +318,7 @@ export default { ...@@ -318,13 +318,7 @@ export default {
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
} }
.top_widget {
width: 100%;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 0 20px 10px 0;
}
.table_widget { .table_widget {
width: 100%; width: 100%;
// height: calc(100% - 138px); // height: calc(100% - 138px);
......
...@@ -19,18 +19,19 @@ ...@@ -19,18 +19,19 @@
</div> </div>
</div> </div>
<div class="main_widget"> <div class="main_widget">
<div class="main_title">角色权限</div> <div class="main_title role-border-b">角色权限</div>
<div class="wrapper"> <div class="wrapper role-border">
<div class="menu_line_one" :style="rootList.length ? '' : 'padding:0'"> <div class="menu_line_one role-border-b" :style="rootList.length ? '' : 'padding:0'">
<div v-for="(item, index) in rootList" :key="index" class="line_element" :class="curRootIndex == index ? 'line_element_active' : ''" @click="selectRootItem(index)">{{ item.accounttypeName }}</div> <div v-for="(item, index) in rootList" :key="index" class="line_element" :class="curRootIndex == index ? 'line_element_active' : ''" @click="selectRootItem(index)">
{{ item.accounttypeName }}
<div class="tab_line" v-show="curRootIndex == index"></div>
</div>
</div> </div>
</div>
<div class="wrapper">
<div class="main_body"> <div class="main_body">
<div class="menu_line_two"> <div class="menu_line_two">
<div v-for="(item, index) in productList" :key="index" class="line_element_two" :class="curProductIndex == index ? 'line_element_two_active' : ''" @click="selectProductItem(index)">{{ item.productName }}</div> <div v-for="(item, index) in productList" :key="index" class="line_element_two role-border" :class="curProductIndex == index ? 'line_element_two_active' : ''" @click="selectProductItem(index)">{{ item.productName }}</div>
</div> </div>
<div class="tree_widget"> <div class="tree_widget role-border">
<el-tree :render-content="renderContent" v-if="productList.length" default-expand-all :data="newTreeList" :props="defaultProps"></el-tree> <el-tree :render-content="renderContent" v-if="productList.length" default-expand-all :data="newTreeList" :props="defaultProps"></el-tree>
<div v-if="productList.length == 0" class="no_data_icon"> <div v-if="productList.length == 0" class="no_data_icon">
<div class="nodata_wrap"> <div class="nodata_wrap">
...@@ -154,7 +155,6 @@ export default { ...@@ -154,7 +155,6 @@ export default {
}) })
) )
this.newTreeList = this.toContiuneTree(this.newTreeList, 0, maxval) this.newTreeList = this.toContiuneTree(this.newTreeList, 0, maxval)
console.log(this.newTreeList)
this.maxval = maxval - 1 this.maxval = maxval - 1
this.$nextTick(() => { this.$nextTick(() => {
this.changeTreeClass(maxval) this.changeTreeClass(maxval)
...@@ -188,6 +188,16 @@ export default { ...@@ -188,6 +188,16 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.tab_line {
width: 100%;
height: 2px;
background: #5850ff;
border-radius: 4px;
position: absolute;
left: 50%;
top: 38px;
transform: translate(-50%, 0);
}
.role-create-page { .role-create-page {
height: 100%; height: 100%;
width: 100%; width: 100%;
...@@ -243,6 +253,7 @@ export default { ...@@ -243,6 +253,7 @@ export default {
min-height: calc(100% - 300px); min-height: calc(100% - 300px);
background: #ffffff; background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1); box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
padding-bottom: 20px;
.main_title { .main_title {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
...@@ -250,29 +261,29 @@ export default { ...@@ -250,29 +261,29 @@ export default {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: #333333; color: #333333;
// border-bottom: 1px solid #e5e5e5;
} }
.wrapper { .wrapper {
// border: 1px solid #e5e5e5;
box-sizing: border-box; box-sizing: border-box;
padding: 0 20px; margin: 20px 20px;
padding-bottom: 20px;
.menu_line_one { .menu_line_one {
width: 100%; width: 100%;
// height: 36px; height: 48px;
background: #f4f6fc;
border-radius: 4px;
display: flex; display: flex;
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
padding: 2px; padding: 0px 10px;
// border-bottom: 1px solid #e5e5e5;
.line_element { .line_element {
// width: 180px; position: relative;
padding: 0 55px;
height: 32px; height: 32px;
text-align: center; text-align: center;
line-height: 32px; line-height: 32px;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
margin: 0 20px;
cursor: pointer; cursor: pointer;
} }
.line_element_active { .line_element_active {
...@@ -282,12 +293,9 @@ export default { ...@@ -282,12 +293,9 @@ export default {
} }
} }
.main_body { .main_body {
width: 100%; border-radius: 0 0 4px 4px;
// height: calc(100% - 36px);
background: #f4f6fc;
border-radius: 4px;
box-sizing: border-box; box-sizing: border-box;
padding: 10px; margin: 20px;
.menu_line_two { .menu_line_two {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
...@@ -298,9 +306,11 @@ export default { ...@@ -298,9 +306,11 @@ export default {
height: 40px; height: 40px;
text-align: center; text-align: center;
line-height: 40px; line-height: 40px;
background: #ffffff; background: #fafafa;
border-radius: 4px 0px 0px 0px; border-radius: 4px 4px 0px 0px;
border: 1px solid #f4f6fc; // border: 1px solid #e5e5e5;
border-bottom: none;
margin-right: 2px;
color: #37383a; color: #37383a;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
...@@ -308,12 +318,14 @@ export default { ...@@ -308,12 +318,14 @@ export default {
} }
.line_element_two_active { .line_element_two_active {
color: #322ad9; color: #322ad9;
background-color: #ffffff;
} }
} }
.tree_widget { .tree_widget {
width: 100%; width: 100%;
// height: calc(100% - 40px); // height: calc(100% - 40px);
background: #ffffff; background: #ffffff;
// border: 1px solid #e5e5e5;
border-radius: 0px 4px 4px 4px; border-radius: 0px 4px 4px 4px;
// height: 200px; // height: 200px;
// overflow: auto; // overflow: auto;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!