yujialong 2 years ago
parent 5afd3c602a
commit 291c811440
  1. 1
      src/api/index.js
  2. 9
      src/layouts/header/index.vue
  3. 4
      src/libs/util.js
  4. 5
      src/mixins/page/index.js
  5. 10
      src/pages/application/index.vue
  6. 8
      src/pages/column/index.vue
  7. 9
      src/pages/home/index.vue
  8. 27
      src/pages/news/index.vue

@ -17,4 +17,5 @@ export default {
hotContent: `iasf/sysContent/hotContent`, hotContent: `iasf/sysContent/hotContent`,
siteSearchArticles: `iasf/sysContent/siteSearchArticles`, siteSearchArticles: `iasf/sysContent/siteSearchArticles`,
oneLevelChecksThemAll: `iasf/sysColumn/oneLevelChecksThemAll`, oneLevelChecksThemAll: `iasf/sysColumn/oneLevelChecksThemAll`,
queryArticlesByColumnType: `iasf/sysColumn/queryArticlesByColumnType`,
} }

@ -127,13 +127,16 @@ $height: 90px;
outline: none; outline: none;
} }
} }
@media (max-width: 1500px) { @media (max-width: 1660px) {
.header { .header {
.logo { .logo {
left: 50px; left: 10px;
}
.search {
margin-right: 20px;
} }
.tools { .tools {
right: 50px right: 30px
} }
} }
} }

@ -163,10 +163,10 @@ const util = {
duration duration
}); });
}, },
// 去掉html里的标签 // 去掉html里的标签及空格
removeTag(list, prop = 'mainBody') { removeTag(list, prop = 'mainBody') {
list.map(e => { list.map(e => {
e.mainBody = e[prop].replace(/<[^>]+>/g , '') e.mainBody = e[prop].replace(/(<[^>]+>)|((&nbsp;)+)/g , '')
}) })
return list return list
} }

@ -18,7 +18,6 @@ export default {
async openLink(item) { async openLink(item) {
const { link } = item const { link } = item
if (link.linkName === '无') return false if (link.linkName === '无') return false
console.log("🚀 ~ file: index.js ~ line 19 ~ openLink ~ link", link)
let href = link.linkAddress let href = link.linkAddress
const type = link.connectionType const type = link.connectionType
if (type === 1) { // 站内链接 if (type === 1) { // 站内链接
@ -28,7 +27,7 @@ export default {
if (data.data.isDisable) { if (data.data.isDisable) {
return Util.errorMsg('该文章已禁用!') return Util.errorMsg('该文章已禁用!')
} else { } else {
href = '/article?id=' + link.articleId href = '/article?articleId=' + link.articleId + '&id=' + link.columnId[link.columnId.length - 1]
} }
} else { // 栏目 } else { // 栏目
href = '/column?id=' + link.columnId[link.columnId.length - 1] href = '/column?id=' + link.columnId[link.columnId.length - 1]
@ -41,7 +40,7 @@ export default {
if (data.data.isDisable) { if (data.data.isDisable) {
return Util.errorMsg('该文章已禁用!') return Util.errorMsg('该文章已禁用!')
} else { } else {
href = '/article?id=' + link.otherArticleId href = '/article?articleId=' + link.otherArticleId + '&id=' + link.otherColumnId[link.otherColumnId.length - 1]
} }
} else { // 栏目 } else { // 栏目
href = '/column?id=' + link.otherColumnId[link.otherColumnId.length - 1] href = '/column?id=' + link.otherColumnId[link.otherColumnId.length - 1]

@ -102,14 +102,8 @@ export default {
// //
const { column, site, articleNum } = json[7].form const { column, site, articleNum } = json[7].form
if (column.length) { if (column.length) {
this.$post(this.api.newlyPublishedArticles, { this.$post(`${this.api.queryArticlesByColumnType}?columnId=${column[column.length - 1]}`).then(({ data }) => {
siteId: site, this.articles = Util.removeTag(data.slice(0, articleNum || 6))
columnIds: [column[column.length - 1]],
pageNum: 1,
pageSize: articleNum || 6
}).then(({ data }) => {
this.articles = Util.removeTag(data.records)
}).catch(err => {}) }).catch(err => {})
} }
} }

@ -198,7 +198,7 @@ export default {
// //
getInfo() { getInfo() {
this.$post(`${this.api.findColumn}?id=${this.id}`).then(({ data }) => { this.$post(`${this.api.findColumn}?id=${this.id}`).then(({ data }) => {
this.columnTo(data) this.columnClick(data)
if (data.typeId !== 3) this.loaded = true // if (data.typeId !== 3) this.loaded = true //
if (!data.columnBanner) data.columnBanner = require('@/assets/images/column-banner.png') if (!data.columnBanner) data.columnBanner = require('@/assets/images/column-banner.png')
this.info = data this.info = data
@ -313,9 +313,9 @@ export default {
} else if (typeId === 3) { } else if (typeId === 3) {
// path // path
this.$router.push(`/${to.path}?id=${to.id}`).catch(err => {}) this.$router.push(`/${to.path}?id=${to.id}`).catch(err => {})
} else if (typeId === 1 || (typeId === 4 && !to.children.length)) { } else if (left && (typeId === 1 || (typeId === 4 && !to.children.length))) {
// column // column
this.$router.push(`/column?id=${to.id}&column=1`).catch(err => {}) this.$router.push(`/column?id=${to.id + (left ? '&column=1' : '')}`).catch(err => {})
} }
}, },
// //
@ -336,7 +336,7 @@ export default {
this.articles = Util.removeTag(data.records) this.articles = Util.removeTag(data.records)
this.total = +data.total this.total = +data.total
// //
this.total == 1 && this.info.showWithDetails && this.$router.push(`/article?articleId=${this.articles[0].id}&id=${this.articles[0].columnId}`) // this.total == 1 && this.info.showWithDetails && this.$router.push(`/article?articleId=${this.articles[0].id}&id=${this.articles[0].columnId}`)
}).catch(res => {}) }).catch(res => {})
}, },
// id // id

@ -142,13 +142,8 @@ export default {
// //
const { column, site, articleNum } = json[5].form const { column, site, articleNum } = json[5].form
if (column.length) { if (column.length) {
this.$post(this.api.newlyPublishedArticles, { this.$post(`${this.api.queryArticlesByColumnType}?columnId=${column[column.length - 1]}`).then(({ data }) => {
siteId: site, this.articles = Util.removeTag(data.slice(0, articleNum || 6))
columnIds: [column[column.length - 1]],
pageNum: 1,
pageSize: articleNum || 6
}).then(({ data }) => {
this.articles = Util.removeTag(data.records)
}).catch(err => {}) }).catch(err => {})
} }
} }

@ -172,13 +172,8 @@ export default {
const id = e.column[e.column.length - 1] const id = e.column[e.column.length - 1]
e.id = id e.id = id
if (e.columnTitle === 2) e.columnName = e.columnTitleCustom if (e.columnTitle === 2) e.columnName = e.columnTitleCustom
this.$post(this.api.newlyPublishedArticles, { this.$post(`${this.api.queryArticlesByColumnType}?columnId=${id}`).then(({ data }) => {
siteId: e.site, this.$set(e, 'articles', Util.removeTag(data.slice(0, e.articleNum || 6)))
columnIds: [id],
pageNum: 1,
pageSize: e.articleNum || 6
}).then(({ data }) => {
this.$set(e, 'articles', Util.removeTag(data.records))
}).catch(err => {}) }).catch(err => {})
} else { } else {
this.$set(e, 'articles', []) this.$set(e, 'articles', [])
@ -188,24 +183,14 @@ export default {
if (json[3].form.column.length) { if (json[3].form.column.length) {
const { column, site, articleNum } = json[3].form const { column, site, articleNum } = json[3].form
this.$post(this.api.newlyPublishedArticles, { this.$post(`${this.api.queryArticlesByColumnType}?columnId=${column[column.length - 1]}`).then(({ data }) => {
siteId: site, this.articles = Util.removeTag(data.slice(0, articleNum || 6))
columnIds: [column[column.length - 1]],
pageNum: 1,
pageSize: articleNum || 6
}).then(({ data }) => {
this.articles = Util.removeTag(data.records)
}).catch(err => {}) }).catch(err => {})
} }
if (json[5].form.column.length) { if (json[5].form.column.length) {
const { column, site, articleNum } = json[5].form const { column, site, articleNum } = json[5].form
this.$post(this.api.newlyPublishedArticles, { this.$post(`${this.api.queryArticlesByColumnType}?columnId=${column[column.length - 1]}`).then(({ data }) => {
siteId: site, this.articles1 = Util.removeTag(data.slice(0, articleNum || 5))
columnIds: [column[column.length - 1]],
pageNum: 1,
pageSize: articleNum || 5
}).then(({ data }) => {
this.articles1 = Util.removeTag(data.records)
}).catch(err => {}) }).catch(err => {})
} }

Loading…
Cancel
Save