Commit 6829d0af by 匡雅琴

角色权限样式调整

1 parent 8ca77f39
......@@ -94,7 +94,6 @@ export default {
},
// 选择商户权限
selectCurAccount(item, index) {
console.log(item, index)
this.isChangeEdit = true
this.roleRootRules = false
this.accountListSelect[index].select = !item.select
......@@ -111,12 +110,10 @@ export default {
this.rootList.forEach(item => {
accounttypeId.push(item.accounttypeId)
})
console.log(this.rootList, accounttypeId, '99999')
this.accounttypeIds = accounttypeId
this.$refs.productFrom.findMenuFunTree(item.accounttypeId, item.select)
},
toCreateRole() {
console.log(this.ruleForm, this.$refs.productFrom.getSelectInfo())
this.$refs.ruleForm.validate(valid => {
if (valid) {
let { merchantId, roleDesc, roleName } = this.ruleForm
......@@ -137,8 +134,8 @@ export default {
delFlag: 0,
requestList: accountTypes
}
console.log(para)
this.$apis.role.createRole(para).then(res => {
console.log(res, '====')
res ? this.$message.success('操作成功') : this.$message.error('操作失败')
this.$emit('updataRole', true)
this.roleVisible = !res
......
......@@ -113,9 +113,12 @@ export default {
required: false,
validator: (rule, value, callback) => {
var reg = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
console.log(reg.test(value))
if (!reg.test(value)) {
return callback(new Error('请输入正确格式的邮箱'))
if (value) {
if (!reg.test(value)) {
return callback(new Error('请输入正确格式的邮箱'))
} else {
return callback()
}
} else {
return callback()
}
......
<template>
<div class="account-body scrm-box-f" v-loading="loading" v-if="tabMenuStatus">
<div class="account-title">{{ title }}</div>
<el-tabs v-if="tabMenu.length != 0" v-model="tabName" type="card" @tab-click="handleClik">
<!-- <div class="account-title">{{ title }}</div> -->
<el-tabs v-if="tabMenu.length != 0" v-model="tabName" @tab-click="handleClik">
<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>
</template>
</el-tabs>
<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 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="account-select-menu">请选择产品权限</div> -->
<div class="menu-box">
<div class="menu-box-panel">
<div :key="index" v-for="(item, index) in tabMenu">
......@@ -84,7 +84,7 @@ export default {
},
methods: {
handleClik(tab, event) {
console.log(tab, event)
console.log(tab)
const tabId = tab.name
const productTab = this.tabMenu.find(i => i.accounttypeId == tabId)
this.productTab = productTab.productsArr[0] ? productTab.productsArr[0].productId : ''
......@@ -209,7 +209,7 @@ export default {
itm.productsArr.push(j)
this.$nextTick(() => {
setTimeout(() => {
this.addStyle()
this.addStyle()
this.$refs[`tree_${itm.accounttypeId}_${j.productId}`] ? this.$refs[`tree_${itm.accounttypeId}_${j.productId}`][0].setCheckedKeys(i.idList) : ''
}, 300)
})
......@@ -222,12 +222,12 @@ export default {
})
})
this.tabMenuStatus = this.tabMenu.some(item => item)
let tabMenu = this.tabMenu.filter((item, index) => {
return item && item.accounttypeId && this.tabMenu[index].productsArr.length>0
let tabMenu = this.tabMenu.filter((item, index) => {
return item && item.accounttypeId && this.tabMenu[index].productsArr.length > 0
})
setTimeout(() => {
this.tabName = tabMenu[0].accounttypeId
this.productTab = tabMenu[0].productsArr[0].productId
this.tabName = tabMenu[0].accounttypeId
this.productTab = tabMenu[0].productsArr[0].productId
}, 100)
},
resetView() {
......@@ -441,41 +441,30 @@ export default {
// this.findPermissionsByMerId()
}
}
</script>
</script>
<style scoped lang="scss">
.account-body {
padding: 20px;
margin-bottom: 50px;
border: 1px solid #e5e5e5;
border-radius: 2px;
/deep/ {
.el-checkbox:last-of-type {
margin-right: 8px;
.el-tabs {
border-bottom: 1px solid #e5e5e5;
}
.el-tabs--card > .el-tabs__header .el-tabs__nav {
border: 0;
.el-tabs__header {
margin: 0;
padding: 0 30px;
}
.el-tabs--card > .el-tabs__header {
border: 0;
background-color: #f4f6fc;
.el-checkbox:last-of-type {
margin-right: 8px;
}
.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-tabs__active-bar {
width: 100%;
}
}
.account-title {
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 16px;
letter-spacing: 1px;
margin-bottom: 30px;
}
.account-select-pro {
padding-left: 30px;
font-size: 14px;
......@@ -489,35 +478,26 @@ export default {
margin-right: 20px;
}
}
.account-select-menu {
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
margin-top: 20px;
}
.menu-box {
position: relative;
margin-top: 10px;
background: #f4f6fc;
border-radius: 4px;
padding: 10px;
padding: 20px;
border-radius: 0px 4px 4px 4px;
.tab-item {
width: 180px;
background: #ffffff;
border-radius: 4px 0px 0px 0px;
background: #fafafa;
border-radius: 4px 4px 0px 0px;
border: 1px solid #f4f6fc;
margin-right: 2px;
font-size: 14px;
line-height: 14px;
font-weight: 400;
color: #37383a;
text-align: center;
padding: 12px 0px;
padding: 12px 20px;
border-bottom: none;
cursor: pointer;
&.select-checked {
background: #ffffff;
color: #322ad9;
// font-weight: 700;
border-bottom: none;
}
}
.menu-box-tab {
......@@ -525,6 +505,7 @@ export default {
}
.menu-box-tree {
background: #ffffff;
border: 1px solid #f4f6fc;
}
}
}
......@@ -540,4 +521,4 @@ export default {
margin-bottom: 12px;
}
}
</style>
\ No newline at end of file
</style>
......@@ -32,39 +32,43 @@
</template>
</div>
</el-form-item> -->
<el-row>
<el-col :span="16">
<div data-v-995a4ff0="" class="el-form-item is-required">
<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">
</el-form>
</div>
</div>
<div class="role_widget">
<div class="top_title_widget">
<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>
</div> -->
<div class="custom_element">
<template v-for="(item, index) in accountListSelect">
<div :key="index" class="wrap">
<AutoButton @getBtnStatus="selectCurAccount(item, index)" :typeStatus="item.select" :btnLabel="item.accounttypeName"></AutoButton>
</div>
</template>
<div class="custom_element">
<template v-for="(item, index) in accountListSelect">
<div :key="index" class="wrap">
<AutoButton @getBtnStatus="selectCurAccount(item, index)" :typeStatus="item.select" :btnLabel="item.accounttypeName"></AutoButton>
</div>
<div class="el-form-item__error" v-if="roleRootRules">请选择角色权限</div>
</div>
</template>
</div>
</el-col>
</el-row>
</el-form>
<div class="el-form-item__error" v-if="roleRootRules">请选择角色权限</div>
</div>
</div>
</el-col>
</el-row>
<div class="role-detail">
<SelectProduct ref="productFrom" :roleType="true"></SelectProduct>
</div>
</div>
<div class="scrm-box-f" style="margin-top: 10px">
<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>
<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>
<script>
......@@ -351,11 +355,23 @@ export default {
}
</script>
<style lang="scss" scoped>
.role_widget {
margin-top: 16px;
background: #ffffff;
margin-bottom: 80px;
padding-bottom: 32px;
}
.role-detail {
padding: 0 20px;
}
.role-create-page {
height: 100%;
width: 100%;
background: #ffffff;
}
.role-list {
padding: 40px 0 0 104px;
}
.top_title_widget {
width: 100%;
height: 58px;
......
<template>
<div class="role-home-page">
<div class="top_widget">
<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> -->
<!-- <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>
</div>
<div class="table_widget">
<div>
......@@ -14,10 +14,10 @@
{{ scope.scope.statusName }}
</div>
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope.scope"></GLTableButton>
<!-- <el-button type="text" @click="toLookPage(scope.scope)">查看</el-button>
<!-- <GLTableButton :buttonList="buttonList" :buttonItem="scope.scope"></GLTableButton> -->
<el-button type="text" @click="toLookPage(scope.scope)">查看</el-button>
<el-button v-if="scope.scope.roleName != '超级管理员'" type="text" @click="toEditPage(scope.scope)">修改</el-button>
<el-button v-if="scope.scope.delFlag" type="text" @click="todelete(scope.scope)">删除</el-button> -->
<el-button v-if="scope.scope.delFlag" type="text" @click="todelete(scope.scope)">删除</el-button>
</template>
</GLTable>
</div>
......
......@@ -22,10 +22,11 @@
<div class="main_title">角色权限</div>
<div class="wrapper">
<div class="menu_line_one" :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 class="wrapper">
<div class="main_body">
<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>
......@@ -188,6 +189,15 @@ export default {
}
</script>
<style lang="scss" scoped>
.tab_line {
width: 100%;
height: 2px;
background: #5850ff;
border-radius: 4px;
position: absolute;
left: 50%;
transform: translate(-50%, 0);
}
.role-create-page {
height: 100%;
width: 100%;
......@@ -250,23 +260,21 @@ export default {
font-size: 16px;
font-weight: 600;
color: #333333;
border-bottom: 1px solid #e5e5e5;
}
.wrapper {
box-sizing: border-box;
padding: 0 20px;
padding: 20px 20px;
padding-bottom: 20px;
.menu_line_one {
width: 100%;
// height: 36px;
background: #f4f6fc;
border-radius: 4px;
height: 48px;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 2px;
padding: 0px 32px;
.line_element {
// width: 180px;
padding: 0 55px;
position: relative;
height: 32px;
text-align: center;
line-height: 32px;
......@@ -283,11 +291,10 @@ export default {
}
.main_body {
width: 100%;
// height: calc(100% - 36px);
background: #f4f6fc;
border-radius: 4px;
box-sizing: border-box;
padding: 10px;
border: 1px solid #e5e5e5;
margin: 10px;
.menu_line_two {
display: flex;
flex-wrap: wrap;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!