diff --git a/src/views/modules/news/banner-add-or-update.vue b/src/views/modules/news/banner-add-or-update.vue index 80ab50a0..f3350d7e 100644 --- a/src/views/modules/news/banner-add-or-update.vue +++ b/src/views/modules/news/banner-add-or-update.vue @@ -67,9 +67,9 @@ + :key="item.dictValue" + :label="item.dictName" + :value="item.dictValue"> @@ -122,10 +122,7 @@ export default { communityList: [], gridList: [], uploadUrl: '', - positionList: [ - { 'id': '0', 'name': '上面' }, - { 'id': '1', 'name': '中间' } - ] + positionList: [] } }, computed: { @@ -155,11 +152,12 @@ export default { created () { // 1169154711480528897 为市北区部门ID this.getDeptInfoList('street', '1169154711480528897') + this.getListFromDict('bannerType') + this.getListFromDict('bannerPosition') }, methods: { init () { this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` - this.getbannerType() this.visible = true this.$nextTick(() => { this.$refs['dataForm'].resetFields() @@ -217,12 +215,16 @@ export default { }, beforeAvatarUpload (file) { }, - getbannerType () { - this.$http.get(`/sys/dict/listSimple/` + 'bannerType').then(({ data: res }) => { + getListFromDict (dictType) { + this.$http.get(`/sys/dict/listSimple/` + dictType).then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) } - this.bannerOptions = res.data + if (dictType === 'bannerType') { + this.bannerOptions = res.data + } else if (dictType === 'bannerPosition') { + this.positionList = res.data + } }).catch(() => { }) }, // 获取部门列表 diff --git a/src/views/modules/news/notice-add-or-update.vue b/src/views/modules/news/notice-add-or-update.vue index befa8967..f5281b11 100644 --- a/src/views/modules/news/notice-add-or-update.vue +++ b/src/views/modules/news/notice-add-or-update.vue @@ -49,8 +49,11 @@ - -
+ + +
+
- diff --git a/src/views/modules/news/notice.vue b/src/views/modules/news/notice.vue index 62f8bc3c..e364e918 100644 --- a/src/views/modules/news/notice.vue +++ b/src/views/modules/news/notice.vue @@ -31,25 +31,22 @@ style="width: 100%;"> + align="center"> + align="center" + width="350"> - + align="center" + :formatter="showDeptNameFormatter"> + align="center" + width="100"> + + { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.$message({ - message: this.$t('prompt.success'), - type: 'success', - duration: 500, - onClose: () => { - this.getDataList() + this.$confirm(this.$t('prompt.info', { 'handle': '发布' }), this.$t('发布'), { + confirmButtonText: this.$t('confirm'), + cancelButtonText: this.$t('cancel'), + type: 'warning' + }).then(() => { + this.$http.post(`/news/notice/publish/${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(() => { }) }, showIsPublishFormatter: function (row, column) { @@ -139,6 +152,17 @@ export default { return '否' } return '是' + }, + showDeptNameFormatter: function (row, column) { + if (row.grid) { + return row.grid + } + if (row.community) { + return row.community + } + if (row.street) { + return row.street + } } } }