forked from fanruan/design
Browse Source
* commit '298c614eb00055b9aa5e84d418e6db8847b2a77c': REPORT-53157 【智能联动】组件拖入时,单元格位置引用数据集的地方未修改 REPORT-53156 【智能联动】组件拖入时,控件引用模板数据集的地方没有发生替换 REPORT-52928 埋点只统计有特殊配置的组件persist/11.0
superman
3 years ago
15 changed files with 236 additions and 33 deletions
@ -0,0 +1,34 @@
|
||||
package com.fr.design.mod.impl.change; |
||||
|
||||
import com.fr.design.mod.ContentChange; |
||||
import com.fr.design.mod.ContentReplacer; |
||||
import com.fr.design.mod.bean.ChangeItem; |
||||
import com.fr.design.mod.impl.repalce.DSColumnContentReplacer; |
||||
import com.fr.report.cell.cellattr.core.group.DSColumn; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/6/2 |
||||
*/ |
||||
public class DSColumnContentChange implements ContentChange<DSColumn> { |
||||
|
||||
private final Map<ChangeItem, ContentReplacer<DSColumn>> map; |
||||
|
||||
public DSColumnContentChange() { |
||||
map = new HashMap<>(); |
||||
map.put(ChangeItem.TABLE_DATA_NAME, new DSColumnContentReplacer()); |
||||
} |
||||
|
||||
@Override |
||||
public String type() { |
||||
return DSColumn.class.getName(); |
||||
} |
||||
|
||||
@Override |
||||
public Map<ChangeItem, ContentReplacer<DSColumn>> changeInfo() { |
||||
return map; |
||||
} |
||||
} |
@ -0,0 +1,34 @@
|
||||
package com.fr.design.mod.impl.change; |
||||
|
||||
import com.fr.data.impl.NameTableData; |
||||
import com.fr.design.mod.ContentChange; |
||||
import com.fr.design.mod.ContentReplacer; |
||||
import com.fr.design.mod.bean.ChangeItem; |
||||
import com.fr.design.mod.impl.repalce.NameTableDataContentReplacer; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/6/2 |
||||
*/ |
||||
public class NameTableDataContentChange implements ContentChange<NameTableData> { |
||||
|
||||
private final Map<ChangeItem, ContentReplacer<NameTableData>> map; |
||||
|
||||
public NameTableDataContentChange() { |
||||
map = new HashMap<>(); |
||||
map.put(ChangeItem.TABLE_DATA_NAME, new NameTableDataContentReplacer()); |
||||
} |
||||
|
||||
@Override |
||||
public String type() { |
||||
return NameTableData.class.getName(); |
||||
} |
||||
|
||||
@Override |
||||
public Map<ChangeItem, ContentReplacer<NameTableData>> changeInfo() { |
||||
return map; |
||||
} |
||||
} |
@ -0,0 +1,34 @@
|
||||
package com.fr.design.mod.impl.change; |
||||
|
||||
import com.fr.data.SimpleDSColumn; |
||||
import com.fr.design.mod.ContentChange; |
||||
import com.fr.design.mod.ContentReplacer; |
||||
import com.fr.design.mod.bean.ChangeItem; |
||||
import com.fr.design.mod.impl.repalce.SimpleDSColumnContentReplacer; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/6/2 |
||||
*/ |
||||
public class SimpleDSColumnContentChange implements ContentChange<SimpleDSColumn> { |
||||
|
||||
private Map<ChangeItem, ContentReplacer<SimpleDSColumn>> map; |
||||
|
||||
public SimpleDSColumnContentChange() { |
||||
map = new HashMap<>(); |
||||
map.put(ChangeItem.TABLE_DATA_NAME, new SimpleDSColumnContentReplacer()); |
||||
} |
||||
|
||||
@Override |
||||
public String type() { |
||||
return SimpleDSColumn.class.getName(); |
||||
} |
||||
|
||||
@Override |
||||
public Map<ChangeItem, ContentReplacer<SimpleDSColumn>> changeInfo() { |
||||
return map; |
||||
} |
||||
} |
@ -0,0 +1,20 @@
|
||||
package com.fr.design.mod.impl.repalce; |
||||
|
||||
import com.fr.design.mod.ContentReplacer; |
||||
import com.fr.general.ComparatorUtils; |
||||
import com.fr.report.cell.cellattr.core.group.DSColumn; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/6/2 |
||||
*/ |
||||
public class DSColumnContentReplacer implements ContentReplacer<DSColumn> { |
||||
|
||||
@Override |
||||
public void replace(DSColumn dsColumn, String oldName, String newName) { |
||||
if (ComparatorUtils.equals(dsColumn.getDSName(), oldName)) { |
||||
dsColumn.setDSName(newName); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.fr.design.mod.impl.repalce; |
||||
|
||||
import com.fr.data.impl.NameTableData; |
||||
import com.fr.design.mod.ContentReplacer; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/6/2 |
||||
*/ |
||||
public class NameTableDataContentReplacer implements ContentReplacer<NameTableData> { |
||||
|
||||
@Override |
||||
public void replace(NameTableData nameTableData, String oldName, String newName) { |
||||
nameTableData.rename(oldName, newName); |
||||
} |
||||
} |
@ -0,0 +1,20 @@
|
||||
package com.fr.design.mod.impl.repalce; |
||||
|
||||
import com.fr.data.SimpleDSColumn; |
||||
import com.fr.design.mod.ContentReplacer; |
||||
import com.fr.general.ComparatorUtils; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/6/2 |
||||
*/ |
||||
public class SimpleDSColumnContentReplacer implements ContentReplacer<SimpleDSColumn> { |
||||
|
||||
@Override |
||||
public void replace(SimpleDSColumn simpleDSColumn, String oldName, String newName) { |
||||
if (ComparatorUtils.equals(simpleDSColumn.getDsName(), oldName)) { |
||||
simpleDSColumn.setDsName(newName); |
||||
} |
||||
} |
||||
} |
@ -1,16 +0,0 @@
|
||||
package com.fr.design.share; |
||||
|
||||
import com.fr.design.base.clipboard.ClipboardFilter; |
||||
import com.fr.design.mainframe.share.collect.SharableCollectorManager; |
||||
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler; |
||||
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler; |
||||
import com.fr.design.mainframe.share.util.SharableXMLUtils; |
||||
|
||||
public class SharableInitManager { |
||||
public static void start() { |
||||
SharableXMLUtils.registerSharableReadHelper(); |
||||
SharableCollectorManager.getInstance().execute(); |
||||
ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance()); |
||||
ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance()); |
||||
} |
||||
} |
@ -0,0 +1,49 @@
|
||||
package com.fr.design.share; |
||||
|
||||
import com.fr.design.base.clipboard.ClipboardFilter; |
||||
import com.fr.design.designer.creator.XCreator; |
||||
import com.fr.design.designer.creator.XLayoutContainer; |
||||
import com.fr.design.mainframe.JForm; |
||||
import com.fr.design.mainframe.JTemplate; |
||||
import com.fr.design.mainframe.share.collect.ComponentCollector; |
||||
import com.fr.design.mainframe.share.collect.SharableCollectorManager; |
||||
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler; |
||||
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler; |
||||
import com.fr.design.mainframe.share.util.SharableXMLUtils; |
||||
import com.fr.design.mainframe.share.util.ShareComponentUtils; |
||||
import com.fr.design.share.utils.EffectItemUtils; |
||||
import com.fr.json.JSONArray; |
||||
|
||||
import java.util.List; |
||||
|
||||
public class SharableManager { |
||||
public static void start() { |
||||
SharableXMLUtils.registerSharableReadHelper(); |
||||
SharableCollectorManager.getInstance().execute(); |
||||
ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance()); |
||||
ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance()); |
||||
} |
||||
|
||||
public static void saveTemplate(JTemplate jt) { |
||||
if (jt instanceof JForm) { |
||||
int showCount = 0; |
||||
int useCount = 0; |
||||
if (!jt.getProcessInfo().isTestTemplate()) { |
||||
JForm jForm = (JForm) jt; |
||||
XLayoutContainer root = jForm.getFormDesign().getRootComponent(); |
||||
List<XCreator> xCreators = ShareComponentUtils.getHelpConfigXCreatorList(root); |
||||
JSONArray helpConfigUseInfo = ComponentCollector.getInstance().getHelpConfigUseInfoWithTemplate(jForm.getTarget().getTemplateID()); |
||||
for (XCreator xCreator : xCreators) { |
||||
if (EffectItemUtils.hasEffectItem(xCreator.toData())) { |
||||
showCount ++; |
||||
if (helpConfigUseInfo.contains(ShareComponentUtils.getWidgetId(xCreator.toData()))) { |
||||
useCount++; |
||||
} |
||||
} |
||||
} |
||||
|
||||
ComponentCollector.getInstance().collectHelpConfigInfo(jForm.getTarget().getTemplateID(), showCount, useCount); |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue