From e798f468767cc4518f8b30b8dad50d6b49565ede Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 24 Jul 2021 19:15:16 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E9=A1=B6=E9=83=A8=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=8E=92=E9=99=A4=E9=9A=90=E8=97=8F=E7=9A=84=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/components/TopNav/index.vue | 15 +++++++++++++-- ruoyi-ui/src/router/index.js | 2 -- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ruoyi-ui/src/components/TopNav/index.vue b/ruoyi-ui/src/components/TopNav/index.vue index c8837f2a..edb9c532 100644 --- a/ruoyi-ui/src/components/TopNav/index.vue +++ b/ruoyi-ui/src/components/TopNav/index.vue @@ -87,7 +87,7 @@ export default { // 默认激活的菜单 activeMenu() { const path = this.$route.path; - let activePath = this.routers[0].path; + let activePath = this.defaultRouter(); if (path.lastIndexOf("/") > 0) { const tmpPath = path.substring(1, path.length); activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/")); @@ -100,7 +100,7 @@ export default { } var routes = this.activeRoutes(activePath); if (routes.length === 0) { - activePath = this.currentIndex || this.routers[0].path + activePath = this.currentIndex || this.defaultRouter() this.activeRoutes(activePath); } return activePath; @@ -121,6 +121,17 @@ export default { const width = document.body.getBoundingClientRect().width / 3; this.visibleNumber = parseInt(width / 85); }, + // 默认激活的路由 + defaultRouter() { + let router; + Object.keys(this.routers).some((key) => { + if (!this.routers[key].hidden) { + router = this.routers[key].path; + return true; + } + }); + return router; + }, // 菜单选择事件 handleSelect(key, keyPath) { this.currentIndex = key; diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 7f0b1059..d0c4b0b0 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -5,8 +5,6 @@ Vue.use(Router) /* Layout */ import Layout from '@/layout' -import ParentView from '@/components/ParentView'; -import InnerLink from '@/layout/components/InnerLink' /** * Note: 路由配置项 From 9920957796f9b0b0e3e7319e3360112688e470c0 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 25 Jul 2021 11:36:31 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=A0=81401=E8=BF=94?= =?UTF-8?q?=E5=9B=9EPromise.reject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/utils/request.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index 14879eb0..46a593b6 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -66,6 +66,7 @@ service.interceptors.response.use(res => { location.href = '/index'; }) }).catch(() => {}); + return Promise.reject('error') } else if (code === 500) { Message({ message: msg, From 57c4910605933bfbb4596ac0da3386b2e9a763b5 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 25 Jul 2021 11:39:12 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/components/Editor/index.vue | 26 ++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/ruoyi-ui/src/components/Editor/index.vue b/ruoyi-ui/src/components/Editor/index.vue index 89a54331..89d49f32 100644 --- a/ruoyi-ui/src/components/Editor/index.vue +++ b/ruoyi-ui/src/components/Editor/index.vue @@ -2,6 +2,7 @@
{ - // this.uploadType = "video"; - // if (value) { - // this.$refs.upload.$children[0].$refs.input.click(); - // } else { - // this.quill.format("video", false); - // } - // }); } this.Quill.pasteHTML(this.currentValue); this.Quill.on("text-change", (delta, oldDelta, source) => { @@ -158,6 +156,18 @@ export default { this.$emit("on-editor-change", eventName, ...args); }); }, + // 上传前校检格式和大小 + handleBeforeUpload(file) { + // 校检文件大小 + if (this.fileSize) { + const isLt = file.size / 1024 / 1024 < this.fileSize; + if (!isLt) { + this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`); + return false; + } + } + return true; + }, handleUploadSuccess(res, file) { // 获取富文本组件实例 let quill = this.Quill; From e9621469b2f28b3d561d8edef3941fb1acf77464 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 25 Jul 2021 11:47:55 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=B7=BB=E5=8A=A0=E6=9D=83=E9=99=90=E6=8E=A7?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/monitor/job/index.vue | 4 ++-- ruoyi-ui/src/views/system/role/index.vue | 2 +- ruoyi-ui/src/views/system/user/index.vue | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ruoyi-ui/src/views/monitor/job/index.vue b/ruoyi-ui/src/views/monitor/job/index.vue index 81e64c60..41030f9f 100644 --- a/ruoyi-ui/src/views/monitor/job/index.vue +++ b/ruoyi-ui/src/views/monitor/job/index.vue @@ -125,7 +125,7 @@ @click="handleDelete(scope.row)" v-hasPermi="['monitor:job:remove']" >删除 - + 更多 @@ -498,7 +498,7 @@ export default { }).then(() => { this.getList(); this.msgSuccess("删除成功"); - }) + }).catch(() => {}); }, /** 导出按钮操作 */ handleExport() { diff --git a/ruoyi-ui/src/views/system/role/index.vue b/ruoyi-ui/src/views/system/role/index.vue index c29c8fe3..f36d9ba0 100644 --- a/ruoyi-ui/src/views/system/role/index.vue +++ b/ruoyi-ui/src/views/system/role/index.vue @@ -138,7 +138,7 @@ @click="handleDelete(scope.row)" v-hasPermi="['system:role:remove']" >删除 - + 更多 diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue index 20d465cd..cb7cff9a 100644 --- a/ruoyi-ui/src/views/system/user/index.vue +++ b/ruoyi-ui/src/views/system/user/index.vue @@ -181,7 +181,7 @@ @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']" >删除 - + 更多 From 1019aa58ce3bd21589940bb60eed40a4b155256e Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 26 Jul 2021 10:03:52 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E9=A1=B6=E9=83=A8=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/components/TopNav/index.vue | 30 +++++++++++++----------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/ruoyi-ui/src/components/TopNav/index.vue b/ruoyi-ui/src/components/TopNav/index.vue index edb9c532..1b7c4d9e 100644 --- a/ruoyi-ui/src/components/TopNav/index.vue +++ b/ruoyi-ui/src/components/TopNav/index.vue @@ -12,7 +12,7 @@ - +