From 36a327f81c3943055af465ea9a64a98826c79a05 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 27 May 2021 17:06:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20UI=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/service/sys/SysAuthService.java | 5 ++++- .../main/resources/db/migration/V5__auth.sql | 17 +++++++++++++++-- .../resources/i18n/messages_en_US.properties | 2 ++ .../resources/i18n/messages_zh_CN.properties | 1 + .../resources/i18n/messages_zh_TW.properties | 3 ++- frontend/src/api/panel/panel.js | 2 +- .../src/components/canvas/store/snapshot.js | 7 +++---- frontend/src/styles/index.scss | 3 +++ frontend/src/views/panel/list/PanelList.vue | 18 ++++++++++++++++++ 9 files changed, 49 insertions(+), 9 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/sys/SysAuthService.java b/backend/src/main/java/io/dataease/service/sys/SysAuthService.java index 9398b35bac..9c815d7624 100644 --- a/backend/src/main/java/io/dataease/service/sys/SysAuthService.java +++ b/backend/src/main/java/io/dataease/service/sys/SysAuthService.java @@ -15,6 +15,7 @@ import io.dataease.controller.request.SysAuthRequest; import io.dataease.dto.SysAuthDTO; import io.dataease.dto.SysDeptDTO; import io.dataease.dto.VAuthModelDTO; +import io.dataease.i18n.Translator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; @@ -80,7 +81,9 @@ public class SysAuthService { SysAuthDetail sysAuthDetail = request.getAuthDetail(); //TODO 获取需要授权的资源id(当前节点和所有权限的下级节点) List authSources = getAuthModels(request.getAuthSource(), request.getAuthSourceType()); - + if(CollectionUtils.isEmpty(authSources)){ + throw new RuntimeException(Translator.get("i18n_auth_source_be_canceled")); + } //TODO 获取需要被授权的目标id(部门当前节点和所有权限的下级节点) List authTargets =getAuthModels(request.getAuthTarget(), request.getAuthTargetType()); diff --git a/backend/src/main/resources/db/migration/V5__auth.sql b/backend/src/main/resources/db/migration/V5__auth.sql index f480627e2a..ecf4ae0910 100644 --- a/backend/src/main/resources/db/migration/V5__auth.sql +++ b/backend/src/main/resources/db/migration/V5__auth.sql @@ -1,4 +1,19 @@ +/* + Navicat Premium Data Transfer + + Source Server : A-LOCAL-本机数据库 + Source Server Type : MySQL + Source Server Version : 50726 + Source Host : localhost:3306 + Source Schema : data_ease + + Target Server Type : MySQL + Target Server Version : 50726 + File Encoding : 65001 + + Date: 27/05/2021 14:59:53 +*/ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; @@ -429,8 +444,6 @@ delimiter ; SET FOREIGN_KEY_CHECKS = 1; - - SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index a6a890db51..d60ce6279d 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -239,3 +239,5 @@ i18n_processing_data=Processing data now, Refresh later i18n_union_already_exists=Union relation already exists i18n_union_field_exists=The same field can't in two dataset i18n_cron_time_error=Start time can't greater then end time +i18n_auth_source_be_canceled=This Auth Resource Already Be Canceled + diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 501627314e..fee30d5e09 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -241,3 +241,4 @@ i18n_processing_data=正在处理数据,稍后刷新 i18n_union_already_exists=关联关系已存在 i18n_union_field_exists=两个数据集之间关联不能出现多次相同字段 i18n_cron_time_error=开始时间不能大于结束时间 +i18n_auth_source_be_canceled=当前资源授权权限已经被取消 diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 3d035b3bbe..e6c8738c4a 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -240,4 +240,5 @@ i18n_panel_list=仪表盘 i18n_processing_data=正在處理數據,稍後刷新 i18n_union_already_exists=關聯關系已存在 i18n_union_field_exists=兩個數據集之間關聯不能出現多次相同字段 -i18n_cron_time_error=開始時間不能大於結束時間 \ No newline at end of file +i18n_cron_time_error=開始時間不能大於結束時間 +i18n_auth_source_be_canceled=当前资源授权权限已经被取消 diff --git a/frontend/src/api/panel/panel.js b/frontend/src/api/panel/panel.js index f5c5f8c1c3..4f78878e39 100644 --- a/frontend/src/api/panel/panel.js +++ b/frontend/src/api/panel/panel.js @@ -30,7 +30,7 @@ export function querySubjectWithGroup(data) { return request({ url: '/panel/subject/querySubjectWithGroup', method: 'post', - loading: false, + loading: true, data }) } diff --git a/frontend/src/components/canvas/store/snapshot.js b/frontend/src/components/canvas/store/snapshot.js index a90f16025a..2d8508a23c 100644 --- a/frontend/src/components/canvas/store/snapshot.js +++ b/frontend/src/components/canvas/store/snapshot.js @@ -6,18 +6,18 @@ export default { snapshotData: [], // 编辑器快照数据 snapshotStyleData: [], // 样式改变也记录快照 snapshotIndex: -1 // 快照索引 - }, mutations: { undo(state) { - state.snapshotIndex-- - if (state.snapshotIndex >= 0) { + if (state.snapshotIndex > 0) { + state.snapshotIndex-- store.commit('setComponentData', deepCopy(state.snapshotData[state.snapshotIndex])) store.commit('setCanvasStyle', deepCopy(state.snapshotStyleData[state.snapshotIndex])) } }, redo(state) { + debugger if (state.snapshotIndex < state.snapshotData.length - 1) { state.snapshotIndex++ store.commit('setComponentData', deepCopy(state.snapshotData[state.snapshotIndex])) @@ -35,7 +35,6 @@ export default { state.snapshotStyleData = state.snapshotStyleData.slice(0, state.snapshotIndex + 1) } }, - refreshSnapshot(state) { // 刷新快照 state.snapshotData = [] diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss index 41d843c9bc..aa487b5151 100644 --- a/frontend/src/styles/index.scss +++ b/frontend/src/styles/index.scss @@ -234,3 +234,6 @@ div:focus { color: #23beef; margin: 0 2px 0 0; } +.el-popper{ + position: fixed!important; +} diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index 6b61ff9d27..ca8bc155da 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -341,6 +341,12 @@ export default { } }, watch: { + // 切换展示页面后 重新点击一下当前节点 + '$store.state.panel.mainActiveName': function(newVal, oldVal) { + if (newVal === 'PanelMain' && this.lastActiveNode && this.lastActiveNodeData) { + this.activeNodeAndClickOnly(this.lastActiveNodeData) + } + } }, mounted() { this.$store.commit('setComponentData', []) @@ -634,6 +640,18 @@ export default { }) }) } + }, + // 激活当前节点 + activeNodeAndClickOnly(panelInfo) { + if (panelInfo) { + this.$nextTick(() => { + // 延迟设置CurrentKey + this.$refs.panel_list_tree.setCurrentKey(panelInfo.id) + this.$nextTick(() => { + document.querySelector('.is-current').firstChild.click() + }) + }) + } } } }