From 0c6be90e78c1f02a6ba20f219e7b3985af4aca91 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期三, 08 一月 2025 10:45:27 +0800
Subject: [PATCH] 按钮设计树结构添加判空不展示图标&&角色管理分配成员修改为行内展示
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebIconServiceImpl.java | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebIconServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebIconServiceImpl.java
index 7e9ddda..75ca637 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebIconServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebIconServiceImpl.java
@@ -71,6 +71,11 @@
JSONObject jsonObject = jsonArray.getJSONObject(i);
String iconContent = jsonObject.getString("svg");
String iconName = jsonObject.getString("name").toLowerCase();
+ if(iconContent.contains("<use href")){
+ iconContent = iconContent.replace("svg\"", "svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"");
+ iconContent = iconContent.replace("<use href","<use xlink:href");
+ }
+
if(nameList.contains(iconName)){
PLIcon icon = iconMap.get(iconName);
icon.content = iconContent;
@@ -104,10 +109,16 @@
public void addIcon(PLIconDTO iconDTO) {
WebUtil.alertNotNull(iconDTO.getName(),"鍥炬爣鍚嶇О", iconDTO.getContent(),"鍥炬爣鍐呭");
+ String iconContent = iconDTO.getContent();
+ if(iconContent.contains("<use href")){
+ iconContent = iconContent.replace("svg\"", "svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"");
+ iconContent = iconContent.replace("<use href","<use xlink:href");
+ }
+
PLIcon plIcon = new PLIcon();
plIcon.oid = WebUtil.getPk();
plIcon.name = iconDTO.getName().toLowerCase();
- plIcon.content = iconDTO.getContent();
+ plIcon.content = iconContent;
plIcon.type = iconDTO.getType();
plIcon.groups = iconDTO.getGroups();
@@ -133,7 +144,14 @@
if(StringUtils.isBlank(plIcon.oid)){
throw new VciBaseException("鏈幏鍙栧埌銆�"+iconDTO.getName()+"銆戝浘鏍囦俊鎭紒");
}
- plIcon.content = iconDTO.getContent();
+
+ String iconContent = iconDTO.getContent();
+ if(iconContent.contains("<use href")){
+ iconContent = iconContent.replace("svg\"", "svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"");
+ iconContent = iconContent.replace("<use href","<use xlink:href");
+ }
+
+ plIcon.content = iconContent;
plIcon.type = iconDTO.getType();
plIcon.groups = iconDTO.getGroups();
portalServicePrx.updatePLIcon(plIcon);
--
Gitblit v1.9.3