+
@@ -171,7 +154,6 @@
startRange: [],
endRange: []
},
- hasMenu: false,
myHeight: 0,
stateObj: {},
total: 0,
@@ -181,9 +163,6 @@
label: 'name'
},
catalogList: [],
- catalogChildren: [], // 存储所有数据
- showChildren:[], // 目前显示
- lastChildren:[], // 上一级
areaList: [],
tagList: [],
nowDate: '',
@@ -265,47 +244,16 @@
this.select.endRange = [this.nowDate, this.nowDate]
this.select.status = 0
}
- // this.getCatalogList()
- if (this.$route.path) {
- let path = this.$route.path.split("_")
- this.select.catalog_id = path[1]
- console.log(this.$route.path.includes('menu'))
- if (this.$route.path.includes('menu')) {
- this.hasMenu = true
- // this.getCatalogChildren(path[1])
- this.getCatalogList(path[1])
- } else {
- this.getCatalogList()
- this.getAreaList()
- this.getTagList()
- this.getList()
- }
-
- }
- },
- watch: {
- '$route'(to, from) {
- this.$router.go(0);
- }
+ this.getCatalogList()
+ this.getAreaList()
+ this.getTagList()
+ this.getList()
},
methods: {
initHeight(e) {
console.log("e", e)
this.myHeight = e + 37
},
- toUrl(item) {
- let path = ''
- if (item.children && item.children.length > 0) {
- // path = '/record/menu_' + item.id + '?time=' + new Date()
- this.catalogChildren = item.children
- } else {
- path = '/record/index_' + item.id + '?time=' + new Date()
- this.$router.push({
- path: path
- })
- }
-
- },
async getCatalogList(pid) {
const res = await index({
page_size: 999,
@@ -317,31 +265,8 @@
})
if (res.data.length > 0) {
this.catalogList = this.base.buildTree(res.data)
- console.log("this.catalogList", this.catalogList)
- if (pid) {
- let pList = this.base.findNodesById(this.catalogList, pid)
- console.log("pList",pList)
- this.catalogChildren = pList[0].children
- }
- console.log("this.catalogChildren", this.catalogChildren)
}
},
- async getCatalogChildren(pid) {
- const res = await index({
- page_size: 999,
- page: 1,
- sort_type: 'ASC',
- sort_name: 'sort',
- table_name: 'catalogs',
- filter: [{
- key: 'pid',
- op: 'eq',
- value: pid
- }]
- // is_auth: 1,
- })
- this.catalogChildren = res.data
- },
async getAreaList() {
const res = await index({
page_size: 999,