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`,
siteSearchArticles: `iasf/sysContent/siteSearchArticles`,
oneLevelChecksThemAll: `iasf/sysColumn/oneLevelChecksThemAll`,
queryArticlesByColumnType: `iasf/sysColumn/queryArticlesByColumnType`,
}

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

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

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

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

@ -198,7 +198,7 @@ export default {
//
getInfo() {
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.columnBanner) data.columnBanner = require('@/assets/images/column-banner.png')
this.info = data
@ -313,9 +313,9 @@ export default {
} else if (typeId === 3) {
// path
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
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.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 => {})
},
// id

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

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

Loading…
Cancel
Save