Commit b8559d09 by 李长胜

修改横向问题

1 parent 0469d166
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<div id="secondmerchantName">{{ secondPageObj.merchantName }}</div> <div id="secondmerchantName">{{ secondPageObj.merchantName }}</div>
</el-tooltip> </el-tooltip>
<div> <div>
商户号: 商户号:
<span id="secondmerchantId">{{ secondPageObj.merchantNo }}</span> <span id="secondmerchantId">{{ secondPageObj.merchantNo }}</span>
</div> </div>
<div> <div>
...@@ -177,7 +177,6 @@ ...@@ -177,7 +177,6 @@
</span> </span>
</el-tree> </el-tree>
</div> </div>
</div> </div>
<div class="merchant-right"> <div class="merchant-right">
<div> <div>
...@@ -192,8 +191,8 @@ ...@@ -192,8 +191,8 @@
<el-button type="primary" id="tableSearch" size="small" @click="getSecondTable">查询</el-button> <el-button type="primary" id="tableSearch" size="small" @click="getSecondTable">查询</el-button>
</div> </div>
</div> </div>
<!-- :height="'350px'" --> <!-- :height="'350px'" -->
<GLTable ref="subMerchantTable" :tableTotal="subMerchantTableTotal" :hasPage="false" :tableData="subMerchantTableList" :hasNum="true" :pageConf="pageConf" :tableParams="secondtableParams" @refreshTable="getSecondTable"></GLTable> <GLTable ref="subMerchantTable" :tableTotal="subMerchantTableTotal" :hasPage="false" :tableData="subMerchantTableList" :hasNum="true" :pageConf="pageConf" :tableParams="secondtableParams" @refreshTable="getSecondTable"></GLTable>
</div> </div>
</div> </div>
</div> </div>
...@@ -229,7 +228,7 @@ export default { ...@@ -229,7 +228,7 @@ export default {
firstPageObj: {}, firstPageObj: {},
powerDataArray: [], powerDataArray: [],
merchantProTreeResponsesArray:[], merchantProTreeResponsesArray: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
...@@ -324,29 +323,32 @@ export default { ...@@ -324,29 +323,32 @@ export default {
return [] return []
} }
// let newTreeList=this.powerDataArray[this.currentIndex].products[this.subCurrentIndex].merchantProTreeResponses // let newTreeList=this.powerDataArray[this.currentIndex].products[this.subCurrentIndex].merchantProTreeResponses
return this.powerDataArray[this.currentIndex].products[this.subCurrentIndex].merchantProTreeResponses return this.powerDataArray[this.currentIndex].products[this.subCurrentIndex].merchantProTreeResponses
} }
}, },
// watch: { watch: {
// treeInputName(val) { merchantProTreeResponses: {
// this.$refs.tree.filter(val) // immediate: true,
// } handler(val) {
// }, this.handlerTreeDom()
},
deep: true
}
},
methods: { methods: {
// 处理树横向 // 处理树横向
renderContent(h, { node, data }) { renderContent(h, { node, data }) {
let className = '' let className = ''
if (data.perms&&data.count>this.maxval) { if (data.perms && data.count > this.maxval) {
className = 'especially' className = 'especially'
} }
return <div class={className}>{data.label}</div> return <div class={className}>{data.label}</div>
}, },
//将后台返回数据中数值为空的字段全部替换为“-” //将后台返回数据中数值为空的字段全部替换为“-”
formateNullFieldData(initialData) { formateNullFieldData(initialData) {
const isEmpty = function(val) { const isEmpty = function (val) {
if (!String(val) || String(val) === 'null') { if (!String(val) || String(val) === 'null') {
return '-' return '-'
} }
...@@ -354,7 +356,7 @@ export default { ...@@ -354,7 +356,7 @@ export default {
} }
var that = this var that = this
if (initialData instanceof Array) { if (initialData instanceof Array) {
initialData.forEach(function(val, key, array) { initialData.forEach(function (val, key, array) {
array[key] = that.formateNullFieldData(val) array[key] = that.formateNullFieldData(val)
}) })
} else if (initialData instanceof Object) { } else if (initialData instanceof Object) {
...@@ -404,11 +406,11 @@ export default { ...@@ -404,11 +406,11 @@ export default {
if (res) { if (res) {
console.log(res, '功能树的信息') console.log(res, '功能树的信息')
this.powerDataArray = res this.powerDataArray = res
this.handlerTreeDom() this.handlerTreeDom()
} }
}) })
}, },
// 递归:处理某个值 // 递归:处理某个值
traverse(arr = [], count = 0) { traverse(arr = [], count = 0) {
count++ count++
arr.map(item => { arr.map(item => {
...@@ -423,7 +425,7 @@ export default { ...@@ -423,7 +425,7 @@ export default {
}) })
return arr return arr
}, },
// 继续处理已经处理完的树 // 继续处理已经处理完的树
toContiuneTree(arr = [], count = 0, maxLevel = 0) { toContiuneTree(arr = [], count = 0, maxLevel = 0) {
count++ count++
arr.map(item => { arr.map(item => {
...@@ -438,7 +440,7 @@ export default { ...@@ -438,7 +440,7 @@ export default {
}) })
return arr return arr
}, },
// 调用此方法去重构树节点 // 调用此方法去重构树节点
handlerTreeDom() { handlerTreeDom() {
this.merchantProTreeResponsesArray = this.traverse(this.merchantProTreeResponses) this.merchantProTreeResponsesArray = this.traverse(this.merchantProTreeResponses)
let temp = this.flattenDeep(this.merchantProTreeResponsesArray) let temp = this.flattenDeep(this.merchantProTreeResponsesArray)
...@@ -449,15 +451,15 @@ export default { ...@@ -449,15 +451,15 @@ export default {
}) })
) )
this.merchantProTreeResponsesArray = this.toContiuneTree(this.merchantProTreeResponsesArray, 0, maxval) this.merchantProTreeResponsesArray = this.toContiuneTree(this.merchantProTreeResponsesArray, 0, maxval)
console.log(this.merchantProTreeResponsesArray); console.log(this.merchantProTreeResponsesArray)
this.maxval = maxval-1 this.maxval = maxval - 1
this.$nextTick(() => { this.$nextTick(() => {
this.changeTreeClass(maxval) this.changeTreeClass(maxval)
}) })
}, },
// 改变tree节点样式 // 改变tree节点样式
changeTreeClass(maxval) { changeTreeClass(maxval) {
let piefix = (maxval-1)*20 let piefix = (maxval - 1) * 20
var classDomList = document.getElementsByClassName('especially') var classDomList = document.getElementsByClassName('especially')
for (var i = 0; i < classDomList.length; i++) { for (var i = 0; i < classDomList.length; i++) {
classDomList[i].parentNode.style.cssText = 'float:left' classDomList[i].parentNode.style.cssText = 'float:left'
...@@ -465,7 +467,7 @@ export default { ...@@ -465,7 +467,7 @@ export default {
classDomList[i].parentNode.parentNode.parentNode.style.marginLeft = `${piefix}px` classDomList[i].parentNode.parentNode.parentNode.style.marginLeft = `${piefix}px`
} }
}, },
flattenDeep(arr = [], childs = 'children', pid = 0) { flattenDeep(arr = [], childs = 'children', pid = 0) {
return arr.reduce((flat, item) => { return arr.reduce((flat, item) => {
item.pid = pid item.pid = pid
return flat.concat(item, item[childs] ? this.flattenDeep(item[childs], childs, item.id) : []) return flat.concat(item, item[childs] ? this.flattenDeep(item[childs], childs, item.id) : [])
...@@ -501,11 +503,11 @@ export default { ...@@ -501,11 +503,11 @@ export default {
let data = this.formateNullFieldData(res) let data = this.formateNullFieldData(res)
this.subMerchantTableList = data this.subMerchantTableList = data
this.subMerchantTableTotal = res.length this.subMerchantTableTotal = res.length
} }
// total > 50?calc(100vh - '199px'): calc(100vh - '152px') // total > 50?calc(100vh - '199px'): calc(100vh - '152px')
this.$refs.subMerchantTable.tableHeightValues=`calc(100vh - 300px)` this.$refs.subMerchantTable.tableHeightValues = `calc(100vh - 300px)`
// if (res && res.length == 0) { // if (res && res.length == 0) {
// this.$refs.subMerchantTable.setTableHeightFun() // this.$refs.subMerchantTable.setTableHeightFun()
// } // }
...@@ -641,8 +643,8 @@ export default { ...@@ -641,8 +643,8 @@ export default {
// line-height: 20px; // line-height: 20px;
display: inline-block; display: inline-block;
width: calc(100% - 200px); width: calc(100% - 200px);
word-wrap:break-word; word-wrap: break-word;
line-height:initial; line-height: initial;
} }
.account-type-span { .account-type-span {
display: inline-block; display: inline-block;
...@@ -737,7 +739,7 @@ export default { ...@@ -737,7 +739,7 @@ export default {
padding-left: 20px; padding-left: 20px;
// min-height: calc(100vh - 200px); // min-height: calc(100vh - 200px);
// max-height: 100vh; // max-height: 100vh;
background-color: #fff; background-color: #fff;
width: 360px; width: 360px;
margin-right: 20px; margin-right: 20px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!