Commit 73114d49 by cwq0219

员工-查看

1 parent e2cf254a
<!-- 配置管理 -->
<template>
<div class="config-employee">
<!-- <div class="container">
<p class="edit-title">{{ title }}</p>
</div> -->
<div class="container">
<!-- <p class="edit-sub-title p-rl-20">员工基本信息</p>
<glsx-combi-form class="p-rl-20" ref="editFormRef" labelWidth="160px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="merchantId" slot-scope="item">
<select-page :form="editForm" width="300px" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page>
</template>
<template slot="visibleInferiorMer" slot-scope="item">
<el-input :style="{ width: item.width || '360px' }" placeholder="可见商户" v-model="filterText"></el-input>
<el-tree show-checkbox check-on-click-node check-strictly class="filter-tree" :data="baseData.merchantTree" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="tree" @check="handleClickNode"></el-tree>
</template>
</glsx-combi-form> -->
<div class="MsgWrap powerlimt">
<span class="content-title">功能权限</span>
<div class="powerTreeWrap">
<div class="mainTitleWrap">
<div class="mainTitle" :class="{ activeMainTitle: currentIndex == index }" v-for="(item, index) in powerDataArray" :key="index" @click="powerTabClick(index)">
{{ item.accounttypeName || 'null' }}
</div>
</div>
<div class="content">
<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)">
{{ ele.productName }}
</div>
</div>
<div class="contentTree">
<template v-if="merchantProTreeResponses.length > 0">
<el-tree default-expand-all :data="merchantProTreeResponses" :props="defaultProps"></el-tree>
</template>
<div v-else class="noDataContent">
<img src="../../../assets/img/empty.png" alt="" />
<div>暂无数据</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
......@@ -23,16 +37,61 @@
export default {
name: 'config',
data() {
return {}
return {
powerDataArray: [],
currentIndex: 0, //功能权限主标题的索引
subCurrentIndex: 0,
defaultProps: {
children: 'children',
label: 'label'
}
}
},
props: {
id: {
type: String,
default: ''
}
},
components: {},
computed: {
products() {
if (!this.powerDataArray.length) {
return []
}
return this.powerDataArray[this.currentIndex].products
},
//功能树的数据
merchantProTreeResponses() {
if (!this.powerDataArray.length) {
return []
} else if (this.powerDataArray.length > 0 && this.powerDataArray[this.currentIndex].products.length == 0) {
return []
}
computed: {},
return this.powerDataArray[this.currentIndex].products[this.subCurrentIndex].merchantProTreeResponses
}
},
mounted() {},
mounted() {
this.getInfo()
},
methods: {
getInfo() {
this.$apis.employee.getDetailInfoApi({ id: this.id }).then(res => {
this.powerDataArray = res.accountTypeTreeResponseList
})
},
powerTabClick(index) {
this.currentIndex = index
//每次切换将subCurrentIndex置为0
this.subCurrentIndex = 0
},
powerSubTabClick(index) {
this.subCurrentIndex = index
},
handleClose() {
this.$router.push({
name: 'Account2EmployeeIndex'
......@@ -41,7 +100,7 @@ export default {
}
}
</script>
<style>
<style lang="scss">
.config-employee {
margin-bottom: 64px;
}
......@@ -50,63 +109,88 @@ export default {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.config-employee .p-rl-20 {
padding: 0 20px;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-container {
margin-bottom: 84px;
}
.config-employee .footer {
position: fixed;
bottom: 0;
width: 100%;
height: 64px;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
.content-title {
display: inline-block;
position: relative;
height: 48px;
background-color: #fff;
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 48px;
padding-left: 20px;
}
.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;
display: flex;
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.mainTitle {
background-color: #f4f6fc;
height: 32px;
width: 180px;
line-height: 32px;
text-align: center;
border-radius: 2px;
cursor: pointer;
}
.activeMainTitle {
background-color: #fff;
color: #5850ff;
}
}
.content {
background-color: #fff;
.config-employee .edit-title {
font-size: 20px;
font-weight: bold;
color: #333333;
line-height: 38px;
height: 38px;
margin: 0 0;
}
margin: 20px 10px 0;
.subTitleWrap {
height: 40px;
display: flex;
background-color: #f4f6fc;
.subTitle {
background-color: #f4f6fc;
height: 40px;
width: 180px;
line-height: 40px;
text-align: center;
border-radius: 2px;
}
.acitveSubTitle {
background-color: #fff !important;
color: #5850ff;
}
}
.contentTree {
padding: 20px;
min-height: 250px;
height: 250px;
position: relative;
overflow: auto;
.config-employee .edit-sub-title {
height: 48px;
line-height: 48px;
font-size: 16px;
color: #333333;
font-weight: 600;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
}
.config-employee .filter-tree {
width: 360px;
max-height: 200px;
overflow: scroll;
}
.config-employee .el-checkbox:last-of-type {
margin-right: 8px;
}
.config-employee .filter-tree .el-tree-node__label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
.noDataContent {
width: 64px;
height: 64px;
position: absolute;
left: 50%;
top: 50%;
margin-top: -32px;
margin-left: -32px;
div {
margin-top: 12px;
}
}
}
}
}
}
}
</style>
......@@ -60,7 +60,6 @@ export default {
methods: {
getInfo() {
this.$apis.employee.getDetailInfoApi({ id: this.id }).then(res => {
console.log(res)
this.info = res
})
}
......
......@@ -6,7 +6,7 @@
</div>
<div class="container">
<p class="edit-sub-title p-rl-20">员工基本信息</p>
<glsx-combi-form class="p-rl-20" ref="editFormRef" labelWidth="160px" @handleImgDelete="handleImgDelete" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<glsx-combi-form class="p-tr-20" ref="editFormRef" labelWidth="160px" @handleImgDelete="handleImgDelete" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="merchantId" slot-scope="item">
<select-page :form="editForm" width="300px" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page>
</template>
......@@ -341,6 +341,9 @@ export default {
padding: 20px;
}
.config-employee .p-rl-20 {
padding: 0 20px;
}
.config-employee .p-tr-20 {
padding: 20px 20px 0;
}
.config-employee .flex {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!