Commit 503b59cd by 杨北旺

Merge branch 'master' of 192.168.3.233:yangming/scrm-micro-config

2 parents 82baf40a 18ec2e71
...@@ -62,6 +62,16 @@ const getSecondInfo = params => { ...@@ -62,6 +62,16 @@ const getSecondInfo = params => {
sign: true sign: true
}) })
} }
const getSecondTree = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMerchantTree'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getSecondTable = params => { const getSecondTable = params => {
params.method = 'cn.com.glsx.merchants.staff.findMerchantStaffList' params.method = 'cn.com.glsx.merchants.staff.findMerchantStaffList'
...@@ -76,7 +86,9 @@ const getSecondTable = params => { ...@@ -76,7 +86,9 @@ const getSecondTable = params => {
export default { export default {
// getThirdTable, // getThirdTable,
getFirstInfo, getFirstInfo,
findMenuFunTreeByMerId,
getSecondInfo, getSecondInfo,
getSecondTree,
getSecondTable getSecondTable
} }
...@@ -25,6 +25,7 @@ export default { ...@@ -25,6 +25,7 @@ export default {
return { return {
input: "", input: "",
address: "", address: "",
lnglat: [],
}; };
}, },
...@@ -60,6 +61,7 @@ export default { ...@@ -60,6 +61,7 @@ export default {
AMap.plugin("AMap.Geocoder", () => { AMap.plugin("AMap.Geocoder", () => {
const geocoder = new AMap.Geocoder(); const geocoder = new AMap.Geocoder();
geocoder.getAddress(lnglat, (status, result) => { geocoder.getAddress(lnglat, (status, result) => {
self.lnglat = lnglat;
self.address = result.regeocode.formattedAddress; self.address = result.regeocode.formattedAddress;
}); });
}); });
...@@ -74,7 +76,7 @@ export default { ...@@ -74,7 +76,7 @@ export default {
selectAddress(e) { selectAddress(e) {
//这里获得点选地点的经纬度 //这里获得点选地点的经纬度
this.getAddress(); this.getAddress();
}, }
}, },
mounted() { mounted() {
......
...@@ -54,11 +54,29 @@ ...@@ -54,11 +54,29 @@
<span class="content-title">功能权限</span> <span class="content-title">功能权限</span>
<div class="powerTreeWrap"> <div class="powerTreeWrap">
<div class="manTitleWrap"> <div class="mainTitleWrap">
<div class="mainTitle" :class="{ activeMainTitle: currentIndex == index }" v-for="(item, index) in firstPageObj.accountTypes" :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> </div>
</div> </div>
<div class="content">
<div class="subTitleWrap">
<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">
<!-- powerDataArray.length > 0 && powerDataArray[currentIndex].products[subCurrentIndex]. -->
<!-- powerDataArray[currentIndex].products[subCurrentIndex].merchantProTreeResponses这是树的数据 -->
<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>
<div class="MsgWrap companyMsg"> <div class="MsgWrap companyMsg">
...@@ -143,7 +161,10 @@ ...@@ -143,7 +161,10 @@
</div> </div>
<div class="searchTreeInputWrap"> <div class="searchTreeInputWrap">
<el-input v-model="treeInputName" placeholder="请输入" size="small"></el-input> <el-input v-model="treeInputName" placeholder="请输入" size="small"></el-input>
<el-button type="primary" size="small">查询</el-button> <el-button type="primary" size="small" @click="filterTreeListFun">查询</el-button>
</div>
<div class="secondTreeWrap">
<el-tree ref="tree" :default-expanded-keys="expandedIds" :data="secondTreeList" node-key="id" :filter-node-method="filterNode"></el-tree>
</div> </div>
<!-- <form class="layui-form" action=""> <!-- <form class="layui-form" action="">
<div class="layui-inline"> <div class="layui-inline">
...@@ -191,10 +212,19 @@ export default { ...@@ -191,10 +212,19 @@ export default {
titles: ['商户信息', '上级/下级商户', '修改记录'], titles: ['商户信息', '上级/下级商户', '修改记录'],
curIndex: 0, curIndex: 0,
currentIndex: 0, //功能权限主标题的索引 currentIndex: 0, //功能权限主标题的索引
subCurrentIndex: 0,
firstPageObj: {}, firstPageObj: {},
powerDataArray: [],
defaultProps: {
children: 'children',
label: 'label'
},
//第二页表 //第二页表
secondPageObj: {}, secondPageObj: {},
secondTreeList: [],
expandedIds: [],
treeInputName: '', treeInputName: '',
secondInputName: '', secondInputName: '',
subMerchantTableList: [], //第二页的后台给表数据 subMerchantTableList: [], //第二页的后台给表数据
...@@ -262,9 +292,32 @@ export default { ...@@ -262,9 +292,32 @@ export default {
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
// layout: 'sizes, prev, pager, next, jumper, ->, total', // layout: 'sizes, prev, pager, next, jumper, ->, total',
tableTotal: 0, tableTotal: 0,
merchantId: this.$route.params.id //需要从外面传进来 merchantId: 58 //this.$route.params.id //需要从外面传进来
} }
}, },
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 []
}
return this.powerDataArray[this.currentIndex].products[this.subCurrentIndex].merchantProTreeResponses
}
},
// watch: {
// treeInputName(val) {
// this.$refs.tree.filter(val)
// }
// },
methods: { methods: {
tabClick(index) { tabClick(index) {
...@@ -283,6 +336,11 @@ export default { ...@@ -283,6 +336,11 @@ export default {
}, },
powerTabClick(index) { powerTabClick(index) {
this.currentIndex = index this.currentIndex = index
//每次切换将subCurrentIndex置为0
this.subCurrentIndex = 0
},
powerSubTabClick(index) {
this.subCurrentIndex = index
}, },
getFirstInfo() { getFirstInfo() {
this.$apis.merchant.getFirstInfo({ id: this.merchantId }).then(res => { this.$apis.merchant.getFirstInfo({ id: this.merchantId }).then(res => {
...@@ -291,14 +349,30 @@ export default { ...@@ -291,14 +349,30 @@ export default {
} }
}) })
}, },
findMenuFunTreeByMerId() {
this.$apis.merchant.findMenuFunTreeByMerId({ id: this.merchantId }).then(res => {
if (res) {
console.log(res, '功能树的信息')
this.powerDataArray = res
}
})
},
getSecondInfo() { getSecondInfo() {
this.$apis.merchant.getSecondInfo({ id: this.merchantId }).then(res => { this.$apis.merchant.getSecondInfo({ id: this.merchantId }).then(res => {
if (res) { if (res) {
console.log('二页', res)
this.secondPageObj = res this.secondPageObj = res
} }
}) })
}, },
getSecondTree() {
this.$apis.merchant.getSecondTree({ id: this.merchantId }).then(res => {
if (res) {
console.log('二页的树', res)
this.secondTreeList = res
this.expandedIds = res.map(item => item.id)
}
})
},
getSecondTable() { getSecondTable() {
var param = {} var param = {}
param.keyword = this.secondInputName param.keyword = this.secondInputName
...@@ -335,6 +409,13 @@ export default { ...@@ -335,6 +409,13 @@ export default {
this.$refs.updateRecord.setTableHeightFun() this.$refs.updateRecord.setTableHeightFun()
} }
}) })
},
filterNode(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
},
filterTreeListFun() {
this.$refs.tree.filter(this.treeInputName)
} }
}, },
...@@ -345,9 +426,10 @@ export default { ...@@ -345,9 +426,10 @@ export default {
moduleName: '商户模块' moduleName: '商户模块'
} }
this.getFirstInfo() this.getFirstInfo()
// this.findMenuFunTreeByMerId() this.findMenuFunTreeByMerId()
this.getSecondInfo() this.getSecondInfo()
// this.getSecondTree()
this.getSecondTree()
}, },
mounted() { mounted() {
...@@ -454,7 +536,8 @@ export default { ...@@ -454,7 +536,8 @@ export default {
min-height: 300px; min-height: 300px;
padding-top: 2px; padding-top: 2px;
padding-left: 2px; padding-left: 2px;
.manTitleWrap { padding-bottom: 10px;
.mainTitleWrap {
height: 32px; height: 32px;
display: flex; display: flex;
...@@ -471,6 +554,45 @@ export default { ...@@ -471,6 +554,45 @@ export default {
color: #5850ff; color: #5850ff;
} }
} }
.content {
background-color: #fff;
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;
position: relative;
.noDataContent {
width: 64px;
height: 64px;
position: absolute;
left: 50%;
top: 50%;
margin-top: -32px;
margin-left: -32px;
div {
margin-top: 12px;
}
}
}
}
} }
} }
} }
...@@ -483,7 +605,7 @@ export default { ...@@ -483,7 +605,7 @@ export default {
padding-left: 20px; padding-left: 20px;
min-height: calc(100vh - 200px); min-height: calc(100vh - 200px);
background-color: #fff; background-color: #fff;
width: 340px; width: 360px;
margin-right: 20px; margin-right: 20px;
box-sizing: border-box; box-sizing: border-box;
overflow: auto; overflow: auto;
...@@ -531,6 +653,9 @@ export default { ...@@ -531,6 +653,9 @@ export default {
margin-left: 10px; margin-left: 10px;
} }
} }
.secondTreeWrap {
margin-top: 20px;
}
} }
// .ztree .wrapper-tree { // .ztree .wrapper-tree {
// overflow-y: auto; // overflow-y: auto;
...@@ -552,7 +677,7 @@ export default { ...@@ -552,7 +677,7 @@ export default {
.merchant-right { .merchant-right {
padding-top: 15px; padding-top: 15px;
padding-bottom: 20px; padding-bottom: 20px;
width: calc(100vw - 340px - 20px); width: calc(100vw - 360px - 20px);
overflow-x: auto; overflow-x: auto;
background-color: #fff; background-color: #fff;
padding-left: 20px; padding-left: 20px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!