yujialong 2 years ago
parent ab7d6de9fd
commit 11e903d5e5
  1. 2
      src/App.vue
  2. 2
      src/layouts/navbar/index.vue
  3. 3
      src/mixins/article/index.js
  4. 60
      src/mixins/estate/index.js
  5. 61
      src/mixins/overview/index.js
  6. 12
      src/mixins/page/index.js
  7. 5
      src/pages/column/index.vue
  8. 3
      src/pages/estate/event/index.vue
  9. 4
      src/pages/estate/location/index.vue
  10. 4
      src/pages/estate/orgSetup/index.vue
  11. 4
      src/pages/estate/survey/index.vue
  12. 2
      src/pages/news/index.vue
  13. 3
      src/pages/overviewDevHistory/index.vue
  14. 4
      src/pages/overviewIntro/index.vue
  15. 4
      src/pages/overviewLocation/index.vue
  16. 4
      src/pages/overviewSetup/index.vue
  17. 4
      src/pages/overviewTrailer/index.vue
  18. 11
      src/pages/publication/index.vue
  19. 28
      src/pages/publication/single.vue
  20. 4
      src/pages/publish/index.vue

@ -10,7 +10,6 @@ import util from '@/libs/util';
export default { export default {
name: 'App', name: 'App',
created() { created() {
console.log('i18n=>',this.$i18n.locale)
//localStorage //localStorage
if (util.local.get(Setting.storeKey)) { if (util.local.get(Setting.storeKey)) {
this.$store.replaceState(Object.assign({}, this.$store.state, util.local.get(Setting.storeKey))); this.$store.replaceState(Object.assign({}, this.$store.state, util.local.get(Setting.storeKey)));
@ -91,7 +90,6 @@ export default {
window.onbeforeunload = function(){ window.onbeforeunload = function(){
sessionStorage.removeItem('navPageSize') sessionStorage.removeItem('navPageSize')
} }
console.log('document.body.clientWidth=>', document.body.clientWidth)
if(document.body.clientWidth > 1600 ) { if(document.body.clientWidth > 1600 ) {
sessionStorage.setItem('navPageSize', 10) sessionStorage.setItem('navPageSize', 10)
}else if(document.body.clientWidth > 1500 && document.body.clientWidth <= 1600) { }else if(document.body.clientWidth > 1500 && document.body.clientWidth <= 1600) {

@ -71,7 +71,7 @@ export default {
// //
getColumn() { getColumn() {
this.$post(this.api.listWithTree, { this.$post(this.api.listWithTree, {
siteId: this.$route.query.siteId || this.site, siteId: this.site,
columnName: '', columnName: '',
templateId: '', templateId: '',
typeId : '', typeId : '',

@ -18,9 +18,6 @@ export default {
// 点击栏目回调 // 点击栏目回调
columnTo(to) { columnTo(to) {
const { typeId,menuVisible } = to const { typeId,menuVisible } = to
console.log('typeId=>' ,typeId)
console.log('to=>' ,to)
console.log('menuVisible=>' ,menuVisible)
// 跳转链接 // 跳转链接
if (typeId === 2) { if (typeId === 2) {
if ( menuVisible === 1 && to.children.find(i=>i.menuVisible ===1)) return if ( menuVisible === 1 && to.children.find(i=>i.menuVisible ===1)) return

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

@ -1,9 +1,13 @@
export default { export default {
data() { data() {
return { return {
tabs: ['S³FEL介绍', '发展历程', 'S³FEL宣传片', '地理位置', '机构设置'], active: +this.$route.query.id,
tabs: [],
} }
}, },
mounted() {
this.getColumn()
},
methods: { methods: {
// 获取文章详情 // 获取文章详情
getInfo() { getInfo() {
@ -14,41 +18,38 @@ export default {
const json = JSON.parse(this.preview ? const json = JSON.parse(this.preview ?
data : data :
data[data.length - 1][data[data.length - 1].state ? 'theEditedJson' : 'jsonBeforeEditing']) data[data.length - 1][data[data.length - 1].state ? 'theEditedJson' : 'jsonBeforeEditing'])
console.log('json=》',json)
this.modules = json this.modules = json
console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json) console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json)
} }
}).catch(err => {}) }).catch(err => {})
}, },
// 获取所有栏目
getColumn() {
this.$post(this.api.listWithTreeMenuVisible, {
siteId: this.site,
columnName: '',
templateId: '',
typeId: '',
isSort: 1
})
.then(({ data }) => {
this.getParent(data)
})
.catch((err) => { });
},
// 获取父级
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)
}
}
},
// tab回调 // tab回调
tabChange(i) { tabChange(item) {
this.active = i this.$router.push(`/${item.path}?id=${item.id}&siteId=${item.siteId}`)
// 跳转到固定的长页,这里的id不能变
let path = '/overviewIntro?id=378'
if (i == 1) path = '/overviewDevHistory?id=379'
if (i == 2) path = '/overviewTrailer?id=380'
if (i == 3) path = '/overviewLocation?id=381'
if (i == 4) path = '/overviewSetup?id=382'
this.$router.push(path + '&siteId=4')
}, },
}, },
filters: {
i18nName(name,type) {
switch (name) {
case 'S³FEL介绍':
return type.t('column.sfeLintroduce')
case '发展历程':
return type.t('column.develHistory')
case 'S³FEL宣传片':
return type.t('column.sfeltrailer')
case '地理位置':
return type.t('column.geographicLocation')
case '机构设置':
return type.t('column.organization')
default:
return name
}
}
}
}; };

@ -3,13 +3,17 @@ import Util from '@/libs/util'
export default { export default {
data() { data() {
return { return {
site: this.$store.state.content.site,
id: this.$route.query.id, id: this.$route.query.id,
preview: this.$route.query.preview, preview: this.$route.query.preview,
modules: [], modules: [],
articles: [] articles: []
} }
}, },
computed: {
site() {
return this.$route.query.siteId || this.$store.state.content.site
}
},
mounted() { mounted() {
this.getInfo && this.id && this.getInfo() this.getInfo && this.id && this.getInfo()
}, },
@ -32,7 +36,7 @@ export default {
} else { // 栏目 } else { // 栏目
href = '/column?id=' + link.columnId[link.columnId.length - 1] href = '/column?id=' + link.columnId[link.columnId.length - 1]
} }
href += '&siteId=' + (this.$route.query.siteId || this.site) href += '&siteId=' + (this.site)
if (!link.articleId) href = this.$router.resolve(href).href if (!link.articleId) href = this.$router.resolve(href).href
} else if (type === 3) { // 站外链接 } else if (type === 3) { // 站外链接
if (link.otherArticleId) { // 文章 if (link.otherArticleId) { // 文章
@ -83,7 +87,7 @@ export default {
const ids = href.split('-') // 栏目文章是用-分割的,栏目是必选,文章不是必选。选择了文章则跳转到文章页,否则跳转到栏目页 const ids = href.split('-') // 栏目文章是用-分割的,栏目是必选,文章不是必选。选择了文章则跳转到文章页,否则跳转到栏目页
// 站点id:站内链接取当前站点,其他站点链接取siteSelection // 站点id:站内链接取当前站点,其他站点链接取siteSelection
const site = cType === 1 ? const site = cType === 1 ?
(this.$route.query.siteId || this.site) : (this.site) :
item.siteSelection item.siteSelection
if (ids[1]) { // 文章 if (ids[1]) { // 文章
href = '/article?articleId=' + ids[1] href = '/article?articleId=' + ids[1]
@ -95,7 +99,7 @@ export default {
} }
this.toHref(item.isOpen, href) this.toHref(item.isOpen, href)
} else { } else {
this.$router.push(`/article?articleId=${item.id}&siteId=${this.$route.query.siteId || this.site}&id=${this.id}&columnName=${form.columnTitle === 2 ? form.columnTitleCustom : form.columnName}&path=${this.$route.path.replace('/', '')}`) this.$router.push(`/article?articleId=${item.id}&siteId=${this.site}&id=${this.id}&columnName=${form.columnTitle === 2 ? form.columnTitleCustom : form.columnName}&path=${this.$route.path.replace('/', '')}`)
} }
}, },
// 关联栏目的查看全部跳转 // 关联栏目的查看全部跳转

@ -473,10 +473,8 @@ export default {
if (typeId === 4 && !fromColumn) { if (typeId === 4 && !fromColumn) {
id = [this.deepestId]; id = [this.deepestId];
} }
console.log('id=>',id)
this.getAllId = id this.getAllId = id
this.getArticle(id); this.getArticle(id);
console.log('data=>',data)
this.columns = data; this.columns = data;
// banner // banner
if (!this.info.columnBanner) { if (!this.info.columnBanner) {
@ -518,7 +516,6 @@ export default {
siteId: this.site siteId: this.site
}) })
.then(({ data }) => { .then(({ data }) => {
console.log(99122)
this.news = Util.removeTag(data.records); this.news = Util.removeTag(data.records);
}) })
.catch((res) => { }); .catch((res) => { });
@ -592,7 +589,6 @@ export default {
this.labels.map((e) => { this.labels.map((e) => {
if (this.lableId.includes(e.id)) labelName.push(e.labelName); if (this.lableId.includes(e.id)) labelName.push(e.labelName);
}); });
console.log('====>',columnIds)
this.$post(this.api.newlyPublishedArticles, { this.$post(this.api.newlyPublishedArticles, {
siteId: this.site, siteId: this.site,
columnIds, columnIds,
@ -629,7 +625,6 @@ export default {
filter() { filter() {
this.page = 1; this.page = 1;
this.isFilter = !!(this.form.classificationId || this.form.title || this.form.convokeType || this.lableId.length); // this.isFilter = !!(this.form.classificationId || this.form.title || this.form.convokeType || this.lableId.length); //
console.log('this.isFilter=>' ,this.isFilter)
let id = []; let id = [];
if (this.isFilter) { if (this.isFilter) {
this.getIds(this.columns, id); this.getIds(this.columns, id);

@ -10,7 +10,7 @@
<ul class="tabs wow fadeInLeft"> <ul class="tabs wow fadeInLeft">
<template v-for="(item, i) in tabs"> <template v-for="(item, i) in tabs">
<li :class="{active: i == active}" :key="i" @click="tabChangeNewPage(i)">{{ item }}</li> <li :class="{active: item.id == active}" :key="i" @click="tabChange(item)">{{ item.columnName }}</li>
</template> </template>
</ul> </ul>
@ -53,7 +53,6 @@ export default {
mixins: [mixins, overview], mixins: [mixins, overview],
data() { data() {
return { return {
active: 1,
curYear: 0 curYear: 0
} }
}, },

@ -10,7 +10,7 @@
<ul class="tabs wow fadeInLeft"> <ul class="tabs wow fadeInLeft">
<template v-for="(item, i) in tabs"> <template v-for="(item, i) in tabs">
<li :class="{active: i == active}" :key="i" @click="tabChangeNewPage(i)">{{ item }}</li> <li :class="{active: item.id == active}" :key="i" @click="tabChange(item)">{{ item.columnName }}</li>
</template> </template>
</ul> </ul>
@ -54,7 +54,7 @@ export default {
mixins: [mixins, overview], mixins: [mixins, overview],
data() { data() {
return { return {
active: 3
} }
}, },
mounted() { mounted() {

@ -10,7 +10,7 @@
<ul class="tabs wow fadeInLeft"> <ul class="tabs wow fadeInLeft">
<template v-for="(item, i) in tabs"> <template v-for="(item, i) in tabs">
<li :class="{active: i == active}" :key="i" @click="tabChangeNewPage(i)">{{ item }}</li> <li :class="{active: item.id == active}" :key="i" @click="tabChange(item)">{{ item.columnName }}</li>
</template> </template>
</ul> </ul>
@ -37,7 +37,7 @@ export default {
mixins: [mixins, overview], mixins: [mixins, overview],
data() { data() {
return { return {
active: 2
} }
}, },
mounted() { mounted() {

@ -10,7 +10,7 @@
<ul class="tabs wow fadeInLeft"> <ul class="tabs wow fadeInLeft">
<template v-for="(item, i) in tabs"> <template v-for="(item, i) in tabs">
<li :class="{active: i == active}" :key="i" @click="tabChangeNewPage(i)">{{ item }}</li> <li :class="{active: item.id == active}" :key="i" @click="tabChange(item)">{{ item.columnName }}</li>
</template> </template>
</ul> </ul>
@ -37,7 +37,7 @@ export default {
mixins: [mixins, overview], mixins: [mixins, overview],
data() { data() {
return { return {
active: 0
} }
}, },
mounted() { mounted() {

@ -250,7 +250,7 @@ export default {
const ids = href.split('-') // - const ids = href.split('-') // -
// idsiteSelection // idsiteSelection
const site = cType === 1 ? const site = cType === 1 ?
(this.$route.query.siteId || this.site) : (this.site) :
data.siteSelection data.siteSelection
if (ids[1]) { // if (ids[1]) { //
href = '/article?id=' + ids[1] href = '/article?id=' + ids[1]

@ -9,7 +9,7 @@
<ul class="tabs wow fadeInLeft"> <ul class="tabs wow fadeInLeft">
<template v-for="(item, i) in tabs"> <template v-for="(item, i) in tabs">
<li :class="{active: i == active}" :key="i" @click="tabChange(i)">{{ item | i18nName($i18n) }}</li> <li :class="{active: item.id == active}" :key="i" @click="tabChange(item)">{{ item.columnName }}</li>
</template> </template>
</ul> </ul>
@ -72,7 +72,6 @@ export default {
mixins: [mixins, overview], mixins: [mixins, overview],
data() { data() {
return { return {
active: 1,
curYear: 0 curYear: 0
} }
}, },

@ -9,7 +9,7 @@
<ul class="tabs wow fadeInLeft"> <ul class="tabs wow fadeInLeft">
<template v-for="(item, i) in tabs"> <template v-for="(item, i) in tabs">
<li :class="{active: i == active}" :key="i" @click="tabChange(i)">{{ item | i18nName($i18n) }}</li> <li :class="{active: item.id == active}" :key="i" @click="tabChange(item)">{{ item.columnName }}</li>
</template> </template>
</ul> </ul>
@ -43,7 +43,7 @@ export default {
mixins: [mixins, overview], mixins: [mixins, overview],
data() { data() {
return { return {
active: 0,
} }
}, },
mounted() { mounted() {

@ -9,7 +9,7 @@
<ul class="tabs wow fadeInLeft"> <ul class="tabs wow fadeInLeft">
<template v-for="(item, i) in tabs"> <template v-for="(item, i) in tabs">
<li :class="{active: i == active}" :key="i" @click="tabChange(i)">{{ item | i18nName($i18n) }}</li> <li :class="{active: item.id == active}" :key="i" @click="tabChange(item)">{{ item.columnName }}</li>
</template> </template>
</ul> </ul>
@ -27,7 +27,7 @@ export default {
mixins: [mixins, overview], mixins: [mixins, overview],
data() { data() {
return { return {
active: 3
} }
}, },
mounted() { mounted() {

@ -9,7 +9,7 @@
<ul class="tabs wow fadeInLeft"> <ul class="tabs wow fadeInLeft">
<template v-for="(item, i) in tabs"> <template v-for="(item, i) in tabs">
<li :class="{active: i == active}" :key="i" @click="tabChange(i)">{{ item | i18nName($i18n) }}</li> <li :class="{active: item.id == active}" :key="i" @click="tabChange(item)">{{ item.columnName }}</li>
</template> </template>
</ul> </ul>
@ -37,7 +37,7 @@ export default {
mixins: [mixins, overview], mixins: [mixins, overview],
data() { data() {
return { return {
active: 4
} }
}, },
mounted() { mounted() {

@ -9,7 +9,7 @@
<ul class="tabs wow fadeInLeft"> <ul class="tabs wow fadeInLeft">
<template v-for="(item, i) in tabs"> <template v-for="(item, i) in tabs">
<li :class="{active: i == active}" :key="i" @click="tabChange(i)">{{ item | i18nName($i18n) }}</li> <li :class="{active: item.id == active}" :key="i" @click="tabChange(item)">{{ item.columnName }}</li>
</template> </template>
</ul> </ul>
@ -33,7 +33,7 @@ export default {
mixins: [mixins, overview], mixins: [mixins, overview],
data() { data() {
return { return {
active: 2
} }
}, },
mounted() { mounted() {

@ -37,6 +37,7 @@ export default {
info: {}, info: {},
active: 0, active: 0,
curId: '', curId: '',
tab: this.$route.query.tab,
tabs: [] tabs: []
} }
}, },
@ -63,8 +64,14 @@ export default {
// //
getColumn() { getColumn() {
this.$post(`${this.api.getsSublevelColumnsUnderALevel}?id=${this.id}&siteId=${this.site}`).then(({ data }) => { this.$post(`${this.api.getsSublevelColumnsUnderALevel}?id=${this.id}&siteId=${this.site}`).then(({ data }) => {
if (data.length) { this.tabs = data
this.tabs = data // urltabtabtabid
if (this.tab) {
const id = +this.tab
const item = data.find(e => e.id == id)
this.active = item ? item.listStyleId : ''
this.curId = id
} else if (data.length) {
this.active = data[0].listStyleId this.active = data[0].listStyleId
this.curId = data[0].id this.curId = data[0].id
} }

@ -40,6 +40,7 @@ export default {
], ],
info: {}, info: {},
type: +this.$route.query.type, // listStyleId type: +this.$route.query.type, // listStyleId
parent: null
} }
}, },
components: { components: {
@ -49,6 +50,7 @@ export default {
Monograph Monograph
}, },
mounted() { mounted() {
this.getColumn()
this.getInfo() this.getInfo()
}, },
methods: { methods: {
@ -61,6 +63,32 @@ export default {
}) })
.catch((res) => { }) .catch((res) => { })
}, },
//
getColumn() {
this.$post(this.api.listWithTreeMenuVisible, {
siteId: this.site,
columnName: '',
templateId: '',
typeId: '',
isSort: 1
})
.then(({ data }) => {
this.getParent(data)
const list = this.parent.children
list && list.length && list.every(e => e.templateId == 11) && this.$router.push(`/publication?siteId=${this.site}&id=${this.parent.id}&tab=${this.id}`) //
})
.catch((err) => { });
},
//
getParent(data, parent = {}) {
for (const e of data) {
if (e.id == this.id) {
this.parent = parent
} else if (e.children.length) {
this.getParent(e.children, e)
}
}
},
} }
}; };
</script> </script>

@ -57,9 +57,7 @@ export default {
// //
getArticle() { getArticle() {
this.$post(this.api.newlyPublishedArticles, { this.$post(this.api.newlyPublishedArticles, {
siteId: this.site,
siteId: this.$route.query.siteId || this.site,
columnIds: [this.id], columnIds: [this.id],
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,

Loading…
Cancel
Save