-
-
+
+
+
+
+
+
+
@@ -122,8 +125,10 @@ export default {
},
dataForm: {
id: '',
- title: ''
+ title: '',
+ sectionCode: ''
},
+ sectionCodeList: [],
bannerOptions: [],
positionList: []
}
@@ -134,11 +139,22 @@ export default {
created () {
this.getListFromDict('bannerType')
this.getListFromDict('bannerPosition')
+ this.getsectionCodeList()
},
methods: {
bannerState: function (row, column) {
return row.state === '1' ? '已上架' : row.state === '0' ? '已下架' : '未知'
},
+ getsectionCodeList () {
+ this.$http.get(`/sys/dict/listSimple/function_section_article`)
+ .then(({ data: res }) => {
+ if (res.code !== 0) {
+ return this.$message.error(res.msg)
+ }
+ this.sectionCodeList = res.data
+ })
+ .catch(() => {})
+ },
soltOut (id) {
this.$confirm(this.$t('prompt.info', { 'handle': '下架' }), this.$t('下架'), {
confirmButtonText: this.$t('confirm'),
diff --git a/src/views/modules/news/news-safety.vue b/src/views/modules/news/news-safety.vue
index 06433ad..63a1a3e 100644
--- a/src/views/modules/news/news-safety.vue
+++ b/src/views/modules/news/news-safety.vue
@@ -115,6 +115,11 @@
type="text"
size="small"
@click="modifyOnLine(scope.row)">下线
+ 上banner
@@ -264,6 +269,27 @@ export default {
}).catch(() => {
this.dataListLoading = false
})
+ },
+ newsToBanner (row) {
+ this.$confirm(this.$t('prompt.info', { 'handle': '上banner' }), this.$t('上banner'), {
+ confirmButtonText: this.$t('confirm'),
+ cancelButtonText: this.$t('cancel'),
+ type: 'warning'
+ }).then(() => {
+ this.$http.post(`/news/news/newsToBanner/` + row.id).then(({ data: res }) => {
+ if (res.code !== 0) {
+ return this.$message.error(res.msg)
+ }
+ this.$message({
+ message: this.$t('prompt.success'),
+ type: 'success',
+ duration: 500,
+ onClose: () => {
+ }
+ })
+ this.getDataList()
+ }).catch(() => { })
+ }).catch(() => { })
}
},
components: {
diff --git a/src/views/modules/news/newscategory-add-or-update.vue b/src/views/modules/news/newscategory-add-or-update.vue
index ddd1e32..b52cdea 100644
--- a/src/views/modules/news/newscategory-add-or-update.vue
+++ b/src/views/modules/news/newscategory-add-or-update.vue
@@ -95,7 +95,6 @@ export default {
})
this.getsectionCodeList()
},
- // 获取信息
getsectionCodeList () {
this.$http.get(`/sys/dict/listSimple/function_section_article`)
.then(({ data: res }) => {