From 774a5f32f8dd98db3f31fd0db91ed7f53c7231ef Mon Sep 17 00:00:00 2001 From: YangFong Date: Wed, 10 Aug 2022 13:30:07 +0800 Subject: [PATCH 01/22] =?UTF-8?q?perf:=20=E5=8E=BB=E9=99=A4=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E5=8F=98=E9=87=8F=20=5Fthis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根据箭头函数特点,直接使用 this,无需创建临时变量 --- src/layout/components/tags.vue | 35 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/layout/components/tags.vue b/src/layout/components/tags.vue index 29a986e3..ae23c706 100644 --- a/src/layout/components/tags.vue +++ b/src/layout/components/tags.vue @@ -65,17 +65,16 @@ }) }, contextMenuVisible(value) { - var _this = this; - var cm = function(e){ - let sp = document.getElementById("contextmenu"); - if(sp&&!sp.contains(e.target)){ - _this.closeMenu() + const cm = (e) => { + const sp = document.getElementById("contextmenu"); + if (sp && !sp.contains(e.target)) { + this.closeMenu() } } if (value) { - document.body.addEventListener('click', e=>cm(e)) - }else{ - document.body.removeEventListener('click', e=>cm(e)) + document.body.addEventListener('click', e => cm(e)) + } else { + document.body.removeEventListener('click', e => cm(e)) } } }, @@ -160,24 +159,24 @@ this.contextMenuVisible = false }, //TAB 刷新 - refreshTab(){ - var nowTag = this.contextMenuItem; + refreshTab() { this.contextMenuVisible = false + const nowTag = this.contextMenuItem; //判断是否当前路由,否的话跳转 - if(this.$route.fullPath != nowTag.fullPath){ + if (this.$route.fullPath !== nowTag.fullPath) { this.$router.push({ path: nowTag.fullPath, query: nowTag.query }) } + this.$store.commit("refreshIframe", nowTag) - var _this = this; - setTimeout(function() { - _this.$store.commit("removeKeepLive", nowTag.name) - _this.$store.commit("setRouteShow", false) - _this.$nextTick(() => { - _this.$store.commit("pushKeepLive",nowTag.name) - _this.$store.commit("setRouteShow", true) + setTimeout(() => { + this.$store.commit("removeKeepLive", nowTag.name) + this.$store.commit("setRouteShow", false) + this.$nextTick(() => { + this.$store.commit("pushKeepLive", nowTag.name) + this.$store.commit("setRouteShow", true) }) }, 0); }, From f367b3ad1aa66831a2459d0a45fe4b0144d965c8 Mon Sep 17 00:00:00 2001 From: sc Date: Sat, 13 Aug 2022 10:48:53 +0800 Subject: [PATCH 02/22] =?UTF-8?q?FIX=20Editor=20=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E8=87=AA=E5=8A=A8=E8=BD=AC=E6=8D=A2=E7=9B=B8?= =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84=EF=BC=8C=E5=B9=B6=E4=B8=94=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0props=20options?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/scEditor/index.vue | 8 +++++++- src/views/vab/editor.vue | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/scEditor/index.vue b/src/components/scEditor/index.vue index 7719035d..9d771811 100644 --- a/src/components/scEditor/index.vue +++ b/src/components/scEditor/index.vue @@ -59,6 +59,10 @@ templates: { type: Array, default: () => [] + }, + options: { + type: Object, + default: () => {} } }, data() { @@ -86,6 +90,7 @@ quickbars_insert_toolbar: false, image_caption: true, image_advtab: true, + convert_urls: false, images_upload_handler: function(blobInfo) { return new Promise((resolve, reject) => { const data = new FormData(); @@ -113,7 +118,8 @@ },0) } }) - } + }, + ...this.options }, contentValue: this.modelValue } diff --git a/src/views/vab/editor.vue b/src/views/vab/editor.vue index 4a5eb62b..d056c0d3 100644 --- a/src/views/vab/editor.vue +++ b/src/views/vab/editor.vue @@ -13,6 +13,7 @@ 自定义工具栏,使用"|"竖杠分割,使用"\"斜杠分组,默认:'undo redo | forecolor backcolor bold italic underline strikethrough link | blocks fontfamily fontsize | \ alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | pagebreak | \ image media table template preview | code selectall' + 支持tinymce的其他配置项 From 530390f9d4fa37a70d297802c47d2a866ed2a2b6 Mon Sep 17 00:00:00 2001 From: sc Date: Fri, 26 Aug 2022 14:58:10 +0800 Subject: [PATCH 03/22] =?UTF-8?q?FIX=20API=E5=90=8C=E6=97=B6=E8=BF=94?= =?UTF-8?q?=E5=9B=9E401=E6=97=B6=E5=A4=9A=E6=AC=A1=E6=89=A7=E8=A1=8Cconfir?= =?UTF-8?q?m=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index a5a8dd6c..1edf628c 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -27,6 +27,9 @@ axios.interceptors.request.use( } ); +//FIX 多个API同时401时疯狂弹窗BUG +let MessageBox_401_show = false + // HTTP response 拦截器 axios.interceptors.response.use( (response) => { @@ -45,14 +48,21 @@ axios.interceptors.response.use( message: error.response.data.message || "Status:500,服务器发生错误!" }); } else if (error.response.status == 401) { - ElMessageBox.confirm('当前用户已被登出或无权限访问当前资源,请尝试重新登录后再操作。', '无权限访问', { - type: 'error', - closeOnClickModal: false, - center: true, - confirmButtonText: '重新登录' - }).then(() => { - router.replace({path: '/login'}); - }).catch(() => {}) + if(!MessageBox_401_show){ + MessageBox_401_show = true + ElMessageBox.confirm('当前用户已被登出或无权限访问当前资源,请尝试重新登录后再操作。', '无权限访问', { + type: 'error', + closeOnClickModal: false, + center: true, + confirmButtonText: '重新登录', + beforeClose: (action, instance, done) => { + MessageBox_401_show = false + done() + } + }).then(() => { + router.replace({path: '/login'}); + }).catch(() => {}) + } } else { ElNotification.error({ title: '请求错误', From 625a7303d0be93e73eab400f92747506a20f6b04 Mon Sep 17 00:00:00 2001 From: sc Date: Wed, 26 Oct 2022 15:11:11 +0800 Subject: [PATCH 04/22] =?UTF-8?q?UP=20=E6=8E=A7=E5=88=B6=E5=8F=B0=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=9D=83=E9=99=90=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/widgets/index.vue | 3 +- src/views/login/components/passwordForm.vue | 1 + src/views/login/index.vue | 1 + src/views/setting/role/permission.vue | 43 +++++++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/views/home/widgets/index.vue b/src/views/home/widgets/index.vue index 8931ffe9..5908c19c 100644 --- a/src/views/home/widgets/index.vue +++ b/src/views/home/widgets/index.vue @@ -133,7 +133,8 @@ return allCompsList }, myCompsList(){ - return this.allCompsList.filter(item => !item.disabled ) + var myGrid = this.$TOOL.data.get("DASHBOARDGRID") + return this.allCompsList.filter(item => !item.disabled && myGrid.includes(item.key)) }, nowCompsList(){ return this.grid.copmsList.reduce(function(a, b){return a.concat(b)}) diff --git a/src/views/login/components/passwordForm.vue b/src/views/login/components/passwordForm.vue index db827088..2fdf6a7a 100644 --- a/src/views/login/components/passwordForm.vue +++ b/src/views/login/components/passwordForm.vue @@ -106,6 +106,7 @@ } this.$TOOL.data.set("MENU", menu.data.menu) this.$TOOL.data.set("PERMISSIONS", menu.data.permissions) + this.$TOOL.data.set("DASHBOARDGRID", menu.data.dashboardGrid) }else{ this.islogin = false this.$message.warning(menu.message) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 9ae30177..2fa9a63e 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -121,6 +121,7 @@ this.$TOOL.data.remove("USER_INFO") this.$TOOL.data.remove("MENU") this.$TOOL.data.remove("PERMISSIONS") + this.$TOOL.data.remove("DASHBOARDGRID") this.$TOOL.data.remove("grid") this.$store.commit("clearViewTags") this.$store.commit("clearKeepLive") diff --git a/src/views/setting/role/permission.vue b/src/views/setting/role/permission.vue index c8f2b8c0..0a2773a0 100644 --- a/src/views/setting/role/permission.vue +++ b/src/views/setting/role/permission.vue @@ -28,6 +28,11 @@ + +
+ +
+
@@ -65,6 +70,15 @@ } } }, + grid: { + list: [], + checked: ["welcome", "ver", "time", "progress", "echarts", "about"], + props: { + label: (data)=>{ + return data.title + } + } + }, data: { dataType :"1", list: [], @@ -91,6 +105,7 @@ mounted() { this.getMenu() this.getDept() + this.getGrid() }, methods: { open(){ @@ -132,6 +147,34 @@ let filterKeys = this.data.checked.filter(key => this.$refs.dept.getNode(key).isLeaf) this.$refs.dept.setCheckedKeys(filterKeys, true) }) + }, + getGrid(){ + this.grid.list = [ + { + key: "welcome", + title: "欢迎" + }, + { + key: "ver", + title: "版本信息" + }, + { + key: "time", + title: "时钟" + }, + { + key: "progress", + title: "进度环" + }, + { + key: "echarts", + title: "实时收入" + }, + { + key: "about", + title: "关于项目" + } + ] } } } From f3b553c690c9345e72ba27b15ff41cc5ada4bb4f Mon Sep 17 00:00:00 2001 From: sc Date: Thu, 27 Oct 2022 14:05:36 +0800 Subject: [PATCH 05/22] =?UTF-8?q?FIX=20=E8=B0=83=E6=95=B4=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E9=A2=9C=E8=89=B2=E6=97=B6=E6=B8=85=E7=A9=BA=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/setting.vue | 4 ++++ src/views/userCenter/user/seting.vue | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/layout/components/setting.vue b/src/layout/components/setting.vue index 9366c506..e8ef2e13 100644 --- a/src/layout/components/setting.vue +++ b/src/layout/components/setting.vue @@ -73,6 +73,10 @@ this.$TOOL.data.set("APP_LANG", val); }, colorPrimary(val){ + if(!val){ + val = '#409EFF' + this.colorPrimary = '#409EFF' + } document.documentElement.style.setProperty('--el-color-primary', val); for (let i = 1; i <= 9; i++) { document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, colorTool.lighten(val,i/10)); diff --git a/src/views/userCenter/user/seting.vue b/src/views/userCenter/user/seting.vue index a93b21e3..47b8e64d 100644 --- a/src/views/userCenter/user/seting.vue +++ b/src/views/userCenter/user/seting.vue @@ -48,6 +48,10 @@ this.$TOOL.data.set("APP_LANG", val); }, 'config.colorPrimary'(val){ + if(!val){ + val = '#409EFF' + this.config.colorPrimary = '#409EFF' + } document.documentElement.style.setProperty('--el-color-primary', val); for (let i = 1; i <= 9; i++) { document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, colorTool.lighten(val,i/10)); From b66f9a46dab438ce6921cbec6b0fe9a4f756e3ec Mon Sep 17 00:00:00 2001 From: sc Date: Thu, 27 Oct 2022 14:28:25 +0800 Subject: [PATCH 06/22] =?UTF-8?q?FIX=20=E5=85=A8=E5=B1=80=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E6=9D=A1=E6=A0=B7=E5=BC=8F=E5=9C=A8=E9=BB=91=E5=A4=9C?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E8=83=BD=E8=A7=81=E5=BA=A6=E5=A4=AA?= =?UTF-8?q?=E4=BD=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/style/dark.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/style/dark.scss b/src/style/dark.scss index fca73ef5..bc0d3feb 100644 --- a/src/style/dark.scss +++ b/src/style/dark.scss @@ -28,6 +28,10 @@ html.dark { .drawerBG {background: var(--el-bg-color);} .adminui-header-menu .el-menu {--el-menu-bg-color:var(--el-bg-color-overlay) !important;--el-menu-hover-bg-color: #171819 !important;} + //全局滚动条样式 + ::-webkit-scrollbar-thumb {background-color: rgba(163, 166, 173, 0.3);} + ::-webkit-scrollbar-thumb:hover {background-color: rgba(163, 166, 173, 0.5);} + //组件 .el-header, .el-main.nopadding, .el-footer {background: var(--el-bg-color-overlay);border-color: var(--el-border-color-light);} .el-main {background: var(--el-bg-color);} From c6c1aa703606f9984f6a31e4bd7dcff4b6ed5f86 Mon Sep 17 00:00:00 2001 From: sc Date: Thu, 27 Oct 2022 14:51:18 +0800 Subject: [PATCH 07/22] =?UTF-8?q?UP=20=E6=8E=A7=E5=88=B6=E5=8F=B0=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=9D=83=E9=99=90=E5=8C=96=E5=90=8E=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/setting/role/permission.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/views/setting/role/permission.vue b/src/views/setting/role/permission.vue index 0a2773a0..f80f9f03 100644 --- a/src/views/setting/role/permission.vue +++ b/src/views/setting/role/permission.vue @@ -76,6 +76,9 @@ props: { label: (data)=>{ return data.title + }, + disabled: (data)=>{ + return data.isFixed } } }, @@ -152,11 +155,13 @@ this.grid.list = [ { key: "welcome", - title: "欢迎" + title: "欢迎", + isFixed: true }, { key: "ver", - title: "版本信息" + title: "版本信息", + isFixed: true }, { key: "time", From 43219b8402ff1235a4ce0151ebe5aa29556fd695 Mon Sep 17 00:00:00 2001 From: sc Date: Thu, 3 Nov 2022 09:38:02 +0800 Subject: [PATCH 08/22] =?UTF-8?q?UP=20=E7=99=BB=E5=BD=95=E9=A1=B5=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=9B=9E=E8=BD=A6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/components/passwordForm.vue | 2 +- src/views/login/components/phoneForm.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/login/components/passwordForm.vue b/src/views/login/components/passwordForm.vue index 2fdf6a7a..db1b9664 100644 --- a/src/views/login/components/passwordForm.vue +++ b/src/views/login/components/passwordForm.vue @@ -1,5 +1,5 @@