|
|
|
@ -1,9 +1,13 @@ |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
tabs: ['产业光源概况', '大事记', '机构设置', '地理位置'], |
|
|
|
|
active: +this.$route.query.id, |
|
|
|
|
tabs: [], |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.getColumn() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 获取文章详情
|
|
|
|
|
getInfo() { |
|
|
|
@ -19,35 +23,33 @@ export default { |
|
|
|
|
} |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
// tab回调
|
|
|
|
|
tabChange(i) { |
|
|
|
|
this.active = i |
|
|
|
|
// 跳转到固定的长页,这里的id不能变
|
|
|
|
|
let path = '/overviewIntro?id=220' |
|
|
|
|
if (i == 1) path = '/overviewDevHistory?id=214' |
|
|
|
|
if (i == 2) path = '/overviewTrailer?id=215' |
|
|
|
|
if (i == 3) path = '/overviewLocation?id=216' |
|
|
|
|
this.$router.push(path + '&siteId=3') |
|
|
|
|
// 获取所有栏目
|
|
|
|
|
getColumn() { |
|
|
|
|
this.$post(this.api.listWithTreeMenuVisible, { |
|
|
|
|
siteId: this.site, |
|
|
|
|
columnName: '', |
|
|
|
|
templateId: '', |
|
|
|
|
typeId: '', |
|
|
|
|
isSort: 1 |
|
|
|
|
}) |
|
|
|
|
.then(({ data }) => { |
|
|
|
|
this.getParent(data) |
|
|
|
|
}) |
|
|
|
|
.catch((err) => { }); |
|
|
|
|
}, |
|
|
|
|
tabChangeNewPage(i) { |
|
|
|
|
console.log("process.env.NODE_ENV === 'development'",) |
|
|
|
|
const devServer = process.env.NODE_ENV === 'development' |
|
|
|
|
let path |
|
|
|
|
if (devServer) { |
|
|
|
|
path = '/estate/survey?id=258' |
|
|
|
|
if (i == 1) path = '/estate/event?id=259' |
|
|
|
|
if (i == 2) path = '/estate/orgSetup?id=270' |
|
|
|
|
if (i == 3) path = '/estate/location?id=261' |
|
|
|
|
}else { |
|
|
|
|
path = '/estate/survey?id=233' |
|
|
|
|
if (i == 1) path = '/estate/event?id=234' |
|
|
|
|
if (i == 2) path = '/estate/orgSetup?id=235' |
|
|
|
|
if (i == 3) path = '/estate/location?id=236' |
|
|
|
|
// 获取父级
|
|
|
|
|
getParent(data, parent = {}) { |
|
|
|
|
for (const e of data) { |
|
|
|
|
if (e.id == this.id) { |
|
|
|
|
this.tabs = parent.children |
|
|
|
|
} else if (e.children.length) { |
|
|
|
|
this.getParent(e.children, e) |
|
|
|
|
} |
|
|
|
|
this.active = i |
|
|
|
|
// 跳转到固定的长页,这里的id不能变
|
|
|
|
|
console.log('path=>',path) |
|
|
|
|
this.$router.push(path + '&siteId=5') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// tab回调
|
|
|
|
|
tabChange(item) { |
|
|
|
|
this.$router.push(`/${item.path}?id=${item.id}&siteId=${item.siteId}`) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}; |