|
@@ -39,7 +39,6 @@
|
|
|
:dataSource="dataSource"
|
|
|
:heightAuto="true"
|
|
|
:showPage="false"
|
|
|
- idField="pkId"
|
|
|
>
|
|
|
<template slot="name" slot-scope="{text}">
|
|
|
<div style="white-space: nowrap">{{ text }}</div>
|
|
@@ -258,22 +257,50 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
let that = this
|
|
|
- setInterval(() => {
|
|
|
+ document.onclick=function(element){
|
|
|
+ if(element.target.className.indexOf('ant-cascader-menu-item')>-1){
|
|
|
+ document.querySelector('.ant-cascader-menus').scrollLeft = 20480
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /*setTimeout(() => {
|
|
|
document.querySelectorAll('.ant-cascader-menu-item').forEach(el => {
|
|
|
el.onclick = function() {
|
|
|
- document.querySelector('.ant-cascader-menus').scrollLeft = 2048
|
|
|
+ document.querySelector('.ant-cascader-menus').scrollLeft = 20480
|
|
|
}
|
|
|
})
|
|
|
- }, 1000)
|
|
|
- setInterval(() => {
|
|
|
+ }, 1000)*/
|
|
|
+ let timer=setInterval(function(){
|
|
|
+ if(document.querySelectorAll('.ant-table-row-expand-icon').length>0){
|
|
|
+ that.$nextTick(() => {
|
|
|
+ clearInterval(timer)
|
|
|
+ timer=null
|
|
|
+ that.setDomClick()
|
|
|
+ document.querySelectorAll('.ant-table-row td:nth-child(2)').forEach(item => {
|
|
|
+ item.style.width = '233px'
|
|
|
+ })
|
|
|
+ document.querySelectorAll('.ant-table-thead tr th:nth-child(2)').forEach(item => {
|
|
|
+ item.style.width = '233px'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },1000)
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ setDomClick(){
|
|
|
+ let that = this
|
|
|
document.querySelectorAll('.ant-table-row-expand-icon').forEach(el => {
|
|
|
el.onclick = function() {
|
|
|
+ setTimeout(() => {
|
|
|
+ that.setDomClick()
|
|
|
+ }, 200)
|
|
|
// 前一个兄弟元素
|
|
|
let preElement = el.previousElementSibling
|
|
|
|
|
|
// 获取level
|
|
|
let className = preElement.getAttribute('class')
|
|
|
- let level = parseInt(className.charAt(className.length - 1))
|
|
|
+ console.log(className.replace("ant-table-row-indent indent-level-",""))
|
|
|
+ let level =parseInt(className.replace("ant-table-row-indent indent-level-",""))
|
|
|
+ //let level = parseInt(className.charAt(className.length - 1))
|
|
|
// preElement.parentNode.parentNode.nextSibling.firstElementChild.nextSibling.firstElementChild.style.paddingLeft = 30*(level+1) + 'px'
|
|
|
|
|
|
let maxLevel = that.maxLevel
|
|
@@ -291,9 +318,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- }, 1000)
|
|
|
- },
|
|
|
- methods: {
|
|
|
+ },
|
|
|
getClassifyData(flag) {
|
|
|
this.loading = true
|
|
|
api.findAllKnowledgeCategory(this.queryParam).then(res => {
|
|
@@ -316,6 +341,9 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
this.loading = false
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.setDomClick()
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -340,6 +368,11 @@ export default {
|
|
|
// return data
|
|
|
// },
|
|
|
// 搜索
|
|
|
+ handleResetClick(){
|
|
|
+ this.queryParam.params.name = ''
|
|
|
+ this.isShowButton = this.queryParam.params.name ? false : true
|
|
|
+ this.reloadTable()
|
|
|
+ },
|
|
|
handleSearchClick() {
|
|
|
this.isShowButton = this.queryParam.params.name ? false : true
|
|
|
this.reloadTable()
|