diff --git a/vue/src/views/index.vue b/vue/src/views/index.vue index efc64b16..5bd3c664 100644 --- a/vue/src/views/index.vue +++ b/vue/src/views/index.vue @@ -327,11 +327,11 @@ - +
公告 信息 - {{notice.createTime}} + {{notice.createTime}}
@@ -385,8 +385,6 @@ export default { loading: true, // 是否显示弹出层 open: false, - // 弹出层标题 - title: "", // 信息列表 noticeList: [], // 信息详情 @@ -462,7 +460,6 @@ export default { getNotice(id).then(response => { this.notice = response.data; this.open = true; - this.title = this.notice.noticeTitle; this.loading=false; }); }, diff --git a/vue/src/views/iot/news/index.vue b/vue/src/views/iot/news/index.vue index d113ed93..eac1245a 100644 --- a/vue/src/views/iot/news/index.vue +++ b/vue/src/views/iot/news/index.vue @@ -83,6 +83,7 @@ @@ -144,6 +145,20 @@ 取 消
+ + + +
+ {{form.categoryName}} + {{form.createTime}} +
+
+
+
+ +
@@ -169,7 +184,11 @@ export default { data() { return { // 是否为管理员 - isAdmin:false, + isAdmin: false, + // 详情加载 + loadingDetail: false, + // 打开详情 + openDetail: false, // 遮罩层 loading: true, // 选中数组 @@ -231,15 +250,16 @@ export default { created() { this.getList(); this.init(); - // 获取分类列表 - listShortNewsCategory().then(response => { - this.categoryList = response.data; - }) + }, methods: { init() { - if (this.$store.state.user.roles.indexOf("tenant") === -1 || this.$store.state.user.roles.indexOf("tenant") === -1) { + if (this.$store.state.user.roles.indexOf("tenant") === -1 && this.$store.state.user.roles.indexOf("general") === -1) { this.isAdmin = true + // 获取分类列表 + listShortNewsCategory().then(response => { + this.categoryList = response.data; + }) } }, /** 查询新闻资讯列表 */ @@ -364,6 +384,22 @@ export default { } } }, + // 打开信息详情 + openDetailDialog(newsId ) { + this.openDetail = true; + this.loadingDetail = true; + getNews(newsId).then(response => { + this.form = response.data; + this.openDetail = true; + this.loadingDetail = false; + }); + }, + // 取消按钮 + closeDetail() { + this.titleDetail = "详情"; + this.openDetail = false; + this.reset(); + }, } }; diff --git a/vue/src/views/system/notice/index.vue b/vue/src/views/system/notice/index.vue index 10f9ff5c..2f5c1cbf 100644 --- a/vue/src/views/system/notice/index.vue +++ b/vue/src/views/system/notice/index.vue @@ -53,6 +53,7 @@ @@ -96,6 +97,21 @@ 取 消
+ + + +
+ 公告 + 信息 + {{form.createTime}} +
+
+
+
+ +
@@ -114,7 +130,11 @@ export default { data() { return { // 是否为管理员 - isAdmin:false, + isAdmin: false, + // 详情加载 + loadingDetail: false, + // 打开详情 + openDetail: false, // 遮罩层 loading: true, // 选中数组 @@ -164,7 +184,7 @@ export default { }, methods: { init() { - if (this.$store.state.user.roles.indexOf("tenant") === -1 || this.$store.state.user.roles.indexOf("tenant") === -1) { + if (this.$store.state.user.roles.indexOf("tenant") === -1 && this.$store.state.user.roles.indexOf("general") === -1) { this.isAdmin = true } }, @@ -254,7 +274,23 @@ export default { this.getList(); this.$modal.msgSuccess("删除成功"); }).catch(() => {}); - } + }, + // 打开信息详情 + openDetailDialog(id) { + this.openDetail = true; + this.loadingDetail = true; + getNotice(id).then(response => { + this.form = response.data; + this.openDetail = true; + this.loadingDetail = false; + }); + }, + // 取消按钮 + closeDetail() { + this.titleDetail = "详情"; + this.openDetail = false; + this.reset(); + }, } };