diff --git a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java index 26e97f8a72..b063082e99 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java @@ -87,7 +87,7 @@ public class PanelGroupService { String panelId = request.getId(); if (StringUtils.isEmpty(panelId)) { // 新建 - checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_INSERT, null); + checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_INSERT, null,request.getNodeType()); panelId = UUID.randomUUID().toString(); request.setId(panelId); request.setCreateTime(System.currentTimeMillis()); @@ -105,7 +105,7 @@ public class PanelGroupService { newDefaultPanel.setLevel(0); newDefaultPanel.setSource(request.getId()); newDefaultPanel.setCreateBy(AuthUtils.getUser().getUsername()); - checkPanelName(newDefaultPanel.getName(), newDefaultPanel.getPid(), PanelConstants.OPT_TYPE_INSERT, newDefaultPanel.getId()); + checkPanelName(newDefaultPanel.getName(), newDefaultPanel.getPid(), PanelConstants.OPT_TYPE_INSERT, newDefaultPanel.getId(),newDefaultPanel.getNodeType()); panelGroupMapper.insertSelective(newDefaultPanel); } else if ("copy".equals(request.getOptType())) { panelId = UUID.randomUUID().toString(); @@ -113,7 +113,7 @@ public class PanelGroupService { PanelGroupWithBLOBs newPanel = panelGroupMapper.selectByPrimaryKey(request.getId()); // 插入校验 if (StringUtils.isNotEmpty(request.getName())) { - checkPanelName(request.getName(), newPanel.getPid(), PanelConstants.OPT_TYPE_INSERT, request.getId()); + checkPanelName(request.getName(), newPanel.getPid(), PanelConstants.OPT_TYPE_INSERT, request.getId(),newPanel.getNodeType()); } newPanel.setName(request.getName()); newPanel.setId(panelId); @@ -133,7 +133,7 @@ public class PanelGroupService { } // 移动校验 if (StringUtils.isNotEmpty(request.getName())) { - checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_INSERT, request.getId()); + checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_INSERT, request.getId(),panelInfo.getNodeType()); } PanelGroupWithBLOBs record = new PanelGroupWithBLOBs(); record.setName(request.getName()); @@ -144,7 +144,7 @@ public class PanelGroupService { } else { // 更新 if (StringUtils.isNotEmpty(request.getName())) { - checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_UPDATE, request.getId()); + checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_UPDATE, request.getId(),request.getNodeType()); } panelGroupMapper.updateByPrimaryKeySelective(request); } @@ -161,12 +161,12 @@ public class PanelGroupService { } - private void checkPanelName(String name, String pid, String optType, String id) { + private void checkPanelName(String name, String pid, String optType, String id,String nodeType) { PanelGroupExample groupExample = new PanelGroupExample(); if (PanelConstants.OPT_TYPE_INSERT.equalsIgnoreCase(optType)) { - groupExample.createCriteria().andPidEqualTo(pid).andNameEqualTo(name); + groupExample.createCriteria().andPidEqualTo(pid).andNameEqualTo(name).andNodeTypeEqualTo(nodeType); } else if (PanelConstants.OPT_TYPE_UPDATE.equalsIgnoreCase(optType)) { - groupExample.createCriteria().andPidEqualTo(pid).andNameEqualTo(name).andIdNotEqualTo(id); + groupExample.createCriteria().andPidEqualTo(pid).andNameEqualTo(name).andIdNotEqualTo(id).andNodeTypeEqualTo(nodeType); } List checkResult = panelGroupMapper.selectByExample(groupExample); diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index a0b1ad9fe7..d4e5a700cf 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -236,7 +236,8 @@ export default { 'nowPanelJumpInfo', 'publicLinkStatus', 'previewCanvasScale', - 'mobileLayoutStatus' + 'mobileLayoutStatus', + 'componentData' ]) }, @@ -309,7 +310,8 @@ export default { created() { this.refId = uuid.v1 if (this.element && this.element.propValue && this.element.propValue.viewId) { - this.getData(this.element.propValue.viewId, false) + const hasFilter = this.componentData.filter(item => item.type === 'custom').some(item => item.options.value) + hasFilter || this.getData(this.element.propValue.viewId, false) } }, methods: { diff --git a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue index b2d842e3b7..ed0b1fbb1e 100644 --- a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue +++ b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue @@ -17,13 +17,13 @@ {{ $t('commons.all') }} - {{ item.id }} + {{ item.id }}
- + {{ item.id }} diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index 1af58c1307..6f1f47b855 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -392,6 +392,7 @@ export default { this.editPanel.visible = false if (panelInfo) { this.defaultTree() + this.tree() // 默认展开 同时点击 新增的节点 if (panelInfo && panelInfo.panelType === 'self' && this.lastActiveNodeData.id) { if (this.editPanel.optType === 'rename') { @@ -409,8 +410,6 @@ export default { this.lastActiveNode.expanded = true } this.activeNodeAndClick(panelInfo) - } else { - this.tree() } } }, @@ -449,7 +448,8 @@ export default { panelInfo: { id: param.data.id, pid: param.data.pid, - name: param.data.name + name: param.data.name, + nodeType: param.type } } break @@ -460,7 +460,8 @@ export default { panelInfo: { id: param.data.id, name: param.data.name, - optType: 'toDefaultPanel' + optType: 'toDefaultPanel', + nodeType: param.type } } break @@ -472,7 +473,8 @@ export default { panelInfo: { id: param.data.id, name: param.data.name, - optType: 'copy' + optType: 'copy', + nodeType: param.type } } break