Merge branch 'origin/feature/GFRS-1469【0630】nbsapp' into dev

This commit is contained in:
anbbukn
2020-07-01 14:23:47 +08:00
2 changed files with 51 additions and 20 deletions

View File

@@ -56,6 +56,8 @@ export default {
},
routerInfo: { path: `${this.url}?name=${name}` }
})
console.log(this.$parent)
if (this.$parent.watchUrlChange) this.$parent.watchUrlChange(String(parseInt(this.level) + 1))
}
}
}

View File

@@ -26,26 +26,26 @@ export default {
[InternalList.name]: InternalList
},
watch: {
$route: {
deep: true,
handler(n) {
console.log(n)
if (n.path.indexOf('/nbs/internalItem_2') !== -1) {
console.log(33333333)
this.level = '3'
this.titleArr.push(this.$route.query.name)
} else {
this.level = '2'
if (this.titleArr.length === 2) this.titleArr.pop()
console.log(222)
}
this.tableData = {}
this.searchVal = ''
this.searchList = []
this.getDataList()
this.changeKey = this.changeKey === 1 ? 2 : 1
}
},
// $route: {
// deep: true,
// handler(n) {
// console.log(n)
// if (n.path.indexOf('/nbs/internalItem_2') !== -1) {
// console.log(33333333)
// this.level = '3'
// this.titleArr.push(this.$route.query.name)
// } else {
// this.level = '2'
// if (this.titleArr.length === 2) this.titleArr.pop()
// console.log(222)
// }
// this.tableData = {}
// this.searchVal = ''
// this.searchList = []
// this.getDataList()
// this.changeKey = this.changeKey === 1 ? 2 : 1
// }
// },
searchVal(n) {
if (this.tableData.list)
this.searchList = this.tableData.list.filter(item => {
@@ -66,6 +66,34 @@ export default {
}
},
methods: {
appCallBack(data) {
if (data.trigger == 'left_button_click') {
this.level = '2'
if (this.titleArr.length === 2) this.titleArr.pop()
this.tableData = {}
this.searchVal = ''
this.searchList = []
this.getDataList()
this.changeKey = this.changeKey === 1 ? 2 : 1
}
},
watchUrlChange(level) {
console.log(level)
this.level = level
console.log(33333333)
if (this.level === '3') {
this.titleArr.push(this.$route.query.name)
} else {
if (this.titleArr.length === 2) this.titleArr.pop()
console.log(222)
}
this.tableData = {}
this.searchVal = ''
this.searchList = []
this.getDataList()
this.changeKey = this.changeKey === 1 ? 2 : 1
},
async getDataList() {
const data = {
pageSize: 0,
@@ -94,6 +122,7 @@ export default {
created() {
this.getDataList()
this.titleArr = [decodeURIComponent(this.$route.query.name)]
window.appCallback = this.appCallBack
}
}
</script>