|
|
@ -180,10 +180,28 @@ class OutlineService { |
|
|
|
) async { |
|
|
|
) async { |
|
|
|
if (fieldName == null || fieldName.isEmpty) return; |
|
|
|
if (fieldName == null || fieldName.isEmpty) return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final matches = await _matchComponent(rootPath, fieldName); |
|
|
|
|
|
|
|
matches.forEach( |
|
|
|
|
|
|
|
(key, value) => parentNode.children.add( |
|
|
|
|
|
|
|
OutlineNode( |
|
|
|
|
|
|
|
name: key, |
|
|
|
|
|
|
|
title: value, |
|
|
|
|
|
|
|
value: 'Component', |
|
|
|
|
|
|
|
frequency: 0, |
|
|
|
|
|
|
|
isDirectory: false, |
|
|
|
|
|
|
|
depth: 4, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//组合匹配 |
|
|
|
|
|
|
|
static Future<Map<String, String>> _matchComponent(String rootPath, String fieldName) async { |
|
|
|
|
|
|
|
Map<String, String> matchComponents = {}; |
|
|
|
final componentFile = File('$rootPath/metadata/component.xml'); |
|
|
|
final componentFile = File('$rootPath/metadata/component.xml'); |
|
|
|
if (!await componentFile.exists()) { |
|
|
|
if (!await componentFile.exists()) { |
|
|
|
Logger().error('component.xml文件不存在'); |
|
|
|
Logger().error('component.xml文件不存在'); |
|
|
|
return; |
|
|
|
return matchComponents; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
@ -202,27 +220,15 @@ class OutlineService { |
|
|
|
final parentChineseName = parentElement.getAttribute('chineseName'); |
|
|
|
final parentChineseName = parentElement.getAttribute('chineseName'); |
|
|
|
|
|
|
|
|
|
|
|
if (parentName != null && parentChineseName != null) { |
|
|
|
if (parentName != null && parentChineseName != null) { |
|
|
|
// 创建并添加子节点 |
|
|
|
matchComponents[parentName] = parentChineseName; |
|
|
|
parentNode.children.add( |
|
|
|
|
|
|
|
OutlineNode( |
|
|
|
|
|
|
|
name: parentName, |
|
|
|
|
|
|
|
title: parentChineseName, |
|
|
|
|
|
|
|
value: 'Component', |
|
|
|
|
|
|
|
frequency: 0, |
|
|
|
|
|
|
|
isDirectory: false, |
|
|
|
|
|
|
|
depth: 4, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Logger().info('为 $fieldName 找到 ${parentNode.children.length} 个匹配项'); |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
Logger().error('加载Component失败: $e'); |
|
|
|
Logger().error('加载Component失败: $e'); |
|
|
|
rethrow; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return matchComponents; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//加载原子逻辑层 |
|
|
|
//加载原子逻辑层 |
|
|
@ -236,6 +242,9 @@ class OutlineService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
//获取对应组合 |
|
|
|
|
|
|
|
final matchComponents = await _matchComponent(rootPath, fieldName); |
|
|
|
|
|
|
|
|
|
|
|
// 遍历所有.uftstructure文件 |
|
|
|
// 遍历所有.uftstructure文件 |
|
|
|
final uftatomFiles = |
|
|
|
final uftatomFiles = |
|
|
|
await uftatomDir |
|
|
|
await uftatomDir |
|
|
@ -258,27 +267,46 @@ class OutlineService { |
|
|
|
final List<XmlElement> matchingProperties = |
|
|
|
final List<XmlElement> matchingProperties = |
|
|
|
document |
|
|
|
document |
|
|
|
.findAllElements('inputParameters') |
|
|
|
.findAllElements('inputParameters') |
|
|
|
.where((element) => element.getAttribute('id') == fieldName) |
|
|
|
.where( |
|
|
|
|
|
|
|
(element) => |
|
|
|
|
|
|
|
element.getAttribute('id') == fieldName || |
|
|
|
|
|
|
|
element.getAttribute("paramType") == "COMPONENT" && |
|
|
|
|
|
|
|
matchComponents.containsKey(element.getAttribute('id')), |
|
|
|
|
|
|
|
) |
|
|
|
.toList(); |
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//匹配出参 |
|
|
|
if (matchingProperties.isEmpty) { |
|
|
|
if (matchingProperties.isEmpty) { |
|
|
|
matchingProperties.addAll( |
|
|
|
matchingProperties.addAll( |
|
|
|
document |
|
|
|
document |
|
|
|
.findAllElements('outputParameters') |
|
|
|
.findAllElements('outputParameters') |
|
|
|
.where((element) => element.getAttribute('id') == fieldName), |
|
|
|
.where( |
|
|
|
|
|
|
|
(element) => |
|
|
|
|
|
|
|
element.getAttribute('id') == fieldName || |
|
|
|
|
|
|
|
element.getAttribute("paramType") == "COMPONENT" && |
|
|
|
|
|
|
|
matchComponents.containsKey(element.getAttribute('id')), |
|
|
|
|
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
matchType = "O"; |
|
|
|
matchType = "O"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//匹配内部变量 |
|
|
|
if (matchingProperties.isEmpty) { |
|
|
|
if (matchingProperties.isEmpty) { |
|
|
|
matchingProperties.addAll( |
|
|
|
matchingProperties.addAll( |
|
|
|
document |
|
|
|
document |
|
|
|
.findAllElements('internalParams') |
|
|
|
.findAllElements('internalParams') |
|
|
|
.where((element) => element.getAttribute('id') == fieldName), |
|
|
|
.where( |
|
|
|
|
|
|
|
(element) => |
|
|
|
|
|
|
|
element.getAttribute('id') == fieldName || |
|
|
|
|
|
|
|
element.getAttribute("paramType") == "COMPONENT" && |
|
|
|
|
|
|
|
matchComponents.containsKey(element.getAttribute('id')), |
|
|
|
|
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
matchType = "X"; |
|
|
|
matchType = "X"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//匹配组合 |
|
|
|
|
|
|
|
|
|
|
|
if (matchingProperties.isNotEmpty) { |
|
|
|
if (matchingProperties.isNotEmpty) { |
|
|
|
// 获取structure:Structure节点的chineseName |
|
|
|
// 获取structure:Structure节点的chineseName |
|
|
|
final businessNode = document.findAllElements('business:Function').firstOrNull; |
|
|
|
final businessNode = document.findAllElements('business:Function').firstOrNull; |
|
|
@ -326,6 +354,8 @@ class OutlineService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
final matchComponents = await _matchComponent(rootPath, fieldName); |
|
|
|
|
|
|
|
|
|
|
|
// 遍历所有.uftstructure文件 |
|
|
|
// 遍历所有.uftstructure文件 |
|
|
|
final uftbusinessFiles = |
|
|
|
final uftbusinessFiles = |
|
|
|
await uftbusinessDir |
|
|
|
await uftbusinessDir |
|
|
@ -344,14 +374,24 @@ class OutlineService { |
|
|
|
final List<XmlElement> matchingProperties = |
|
|
|
final List<XmlElement> matchingProperties = |
|
|
|
document |
|
|
|
document |
|
|
|
.findAllElements('inputParameters') |
|
|
|
.findAllElements('inputParameters') |
|
|
|
.where((element) => element.getAttribute('id') == fieldName) |
|
|
|
.where( |
|
|
|
|
|
|
|
(element) => |
|
|
|
|
|
|
|
element.getAttribute('id') == fieldName || |
|
|
|
|
|
|
|
element.getAttribute("paramType") == "COMPONENT" && |
|
|
|
|
|
|
|
matchComponents.containsKey(element.getAttribute('id')), |
|
|
|
|
|
|
|
) |
|
|
|
.toList(); |
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
|
|
|
if (matchingProperties.isEmpty) { |
|
|
|
if (matchingProperties.isEmpty) { |
|
|
|
matchingProperties.addAll( |
|
|
|
matchingProperties.addAll( |
|
|
|
document |
|
|
|
document |
|
|
|
.findAllElements('outputParameters') |
|
|
|
.findAllElements('outputParameters') |
|
|
|
.where((element) => element.getAttribute('id') == fieldName), |
|
|
|
.where( |
|
|
|
|
|
|
|
(element) => |
|
|
|
|
|
|
|
element.getAttribute('id') == fieldName || |
|
|
|
|
|
|
|
element.getAttribute("paramType") == "COMPONENT" && |
|
|
|
|
|
|
|
matchComponents.containsKey(element.getAttribute('id')), |
|
|
|
|
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
matchType = "O"; |
|
|
|
matchType = "O"; |
|
|
|
} |
|
|
|
} |
|
|
@ -360,7 +400,12 @@ class OutlineService { |
|
|
|
matchingProperties.addAll( |
|
|
|
matchingProperties.addAll( |
|
|
|
document |
|
|
|
document |
|
|
|
.findAllElements('internalParams') |
|
|
|
.findAllElements('internalParams') |
|
|
|
.where((element) => element.getAttribute('id') == fieldName), |
|
|
|
.where( |
|
|
|
|
|
|
|
(element) => |
|
|
|
|
|
|
|
element.getAttribute('id') == fieldName || |
|
|
|
|
|
|
|
element.getAttribute("paramType") == "COMPONENT" && |
|
|
|
|
|
|
|
matchComponents.containsKey(element.getAttribute('id')), |
|
|
|
|
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
matchType = "X"; |
|
|
|
matchType = "X"; |
|
|
|
} |
|
|
|
} |
|
|
|