From 39e7e78b3a148c8319d86d5559a42098a18365a0 Mon Sep 17 00:00:00 2001 From: kerwincui <164770707@qq.com> Date: Sun, 5 Jun 2022 15:57:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A=E5=92=8C?= =?UTF-8?q?=E6=96=B0=E9=97=BB=E5=92=A8=E8=AF=A2=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue/src/views/index.vue | 7 ++-- vue/src/views/iot/news/index.vue | 48 +++++++++++++++++++++++---- vue/src/views/system/notice/index.vue | 42 +++++++++++++++++++++-- 3 files changed, 83 insertions(+), 14 deletions(-) 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(); + }, } };