From 68e78bdc7b87aaa838d06126f6a93013d6cde34b Mon Sep 17 00:00:00 2001 From: xjs <1294405880@qq.com> Date: Sat, 15 Jan 2022 14:24:02 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E9=A2=84=E8=AD=A6=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=B8=80=E9=94=AE=E6=A0=87=E8=AE=B0=E5=B7=B2=E8=AF=BB=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=202=E3=80=81=E5=89=8D=E7=AB=AF=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=80=BB=E7=BA=BF=E8=BF=9B=E8=A1=8C=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=B9=8B=E9=97=B4=E4=BC=A0=E5=80=BC=EF=BC=8C=E6=AF=94?= =?UTF-8?q?=E5=A6=82=E9=A2=84=E8=AD=A6=E4=BF=A1=E6=81=AF=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E5=A4=84=E7=90=86=E5=90=8E=EF=BC=8C=E5=8F=B3?= =?UTF-8?q?=E4=B8=8A=E8=A7=92=E7=9A=84=E7=BB=84=E4=BB=B6=E8=AE=A1=E6=95=B0?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=B8=85=E9=9B=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/business/warning/apiwarning.js | 8 +++++++ ruoyi-ui/src/layout/components/Navbar.vue | 15 ++++++++---- ruoyi-ui/src/main.js | 5 ++++ .../business/warning/apiwarning/index.vue | 24 ++++++++++++++++++- .../main/java/com/xjs/enums/WarnTypeEnum.java | 2 +- .../java/com/xjs/common/aop/ApiLogAspect.java | 4 +++- .../xjs/controller/ApiWarningController.java | 12 +++++++--- .../java/com/xjs/mapper/ApiWarningMapper.java | 7 ++++++ .../com/xjs/service/ApiWarningService.java | 6 +++++ .../service/impl/ApiWarningServiceImpl.java | 5 ++++ .../mapper/apiwarning/ApiWarningMapper.xml | 6 +++++ 11 files changed, 83 insertions(+), 11 deletions(-) diff --git a/ruoyi-ui/src/api/business/warning/apiwarning.js b/ruoyi-ui/src/api/business/warning/apiwarning.js index d8ee9597..4a71aa49 100644 --- a/ruoyi-ui/src/api/business/warning/apiwarning.js +++ b/ruoyi-ui/src/api/business/warning/apiwarning.js @@ -52,3 +52,11 @@ export function clearAll() { method: 'delete', }) } + +// 全部标记已读 +export function AllHaveRead() { + return request({ + url: '/warning/apiwarning/handleAll', + method: 'put', + }) +} diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue index de5ec376..1d70a328 100644 --- a/ruoyi-ui/src/layout/components/Navbar.vue +++ b/ruoyi-ui/src/layout/components/Navbar.vue @@ -122,9 +122,17 @@ export default { "apiWarning", this.getData ); + + this.$bus.$on('clearCount', this.clearCount) }, methods: { + //小红点清零 + clearCount(data) { + if (data) { + this.warnData.count = 0 + } + }, //已读操作 haveRead() { @@ -143,18 +151,15 @@ export default { } } } - - }, append() { let str = this.warnData.data; if (str != null) { var json = eval("(" + str + ")"); - if (json.apiName !== undefined && json.warningMessage !== undefined) { - let data = json.apiName + "-" + json.warningMessage; + if (json.warningMessage !== undefined) { // this.visible = true - return data + return json.warningMessage } } }, diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index a8f845e0..e91ccca0 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -86,5 +86,10 @@ new Vue({ el: '#app', router, store, + + beforeCreate() { + Vue.prototype.$bus = this //安装全局事件总线,$bus就是当前应用的vm + }, + render: h => h(App) }) diff --git a/ruoyi-ui/src/views/business/warning/apiwarning/index.vue b/ruoyi-ui/src/views/business/warning/apiwarning/index.vue index 87be68f0..481d9042 100644 --- a/ruoyi-ui/src/views/business/warning/apiwarning/index.vue +++ b/ruoyi-ui/src/views/business/warning/apiwarning/index.vue @@ -35,10 +35,22 @@ icon="el-icon-delete-solid" size="mini" @click="clearAll" + v-hasPermi="['warning:warning:remove']" >清空 + + 全部标记已读 + + @@ -84,7 +96,7 @@