Commit b8559d09 by 李长胜

修改横向问题

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