fix(X-Pack): 阈值告警-告警内容中字段顺序与表单中选择字段顺序不一致
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -319,7 +319,7 @@ public class ChartViewThresholdManage {
|
||||
String result = sb.toString();
|
||||
|
||||
if (withThresholdData) {
|
||||
Set<Long> thresholdFieldIdSet = new HashSet<>();
|
||||
Set<Long> thresholdFieldIdSet = new LinkedHashSet<>();
|
||||
getThresholdFieldIdList(filterTreeObj, thresholdFieldIdSet);
|
||||
List<List<String>> thresholdTableList = rows.stream().map(row -> thresholdFieldIdSet.stream().map(fieldId -> {
|
||||
DatasetTableFieldDTO fieldDTO = fieldMap.get(fieldId);
|
||||
|
||||
@@ -570,24 +570,23 @@ const setDefaultContent = (thresholdRules?: string) => {
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
const stack = [...items];
|
||||
const matchFieldList = [];
|
||||
const quotoIdMap = {}
|
||||
while (stack.length) {
|
||||
const node = stack.pop();
|
||||
if (node.type === "item") {
|
||||
const fieldId = node.fieldId;
|
||||
const field = fieldMap[fieldId];
|
||||
if (!quotoIdMap[fieldId]) {
|
||||
matchFieldList.push(field);
|
||||
quotoIdMap[fieldId] = true
|
||||
const walk = (nodes) => {
|
||||
nodes.forEach((node) => {
|
||||
if (node.type === "item") {
|
||||
const fieldId = node.fieldId;
|
||||
const field = fieldMap[fieldId];
|
||||
if (!quotoIdMap[fieldId]) {
|
||||
matchFieldList.push(field);
|
||||
quotoIdMap[fieldId] = true
|
||||
}
|
||||
} else {
|
||||
walk(node.subTree.items);
|
||||
}
|
||||
|
||||
} else {
|
||||
const subTree = node.subTree;
|
||||
subTree.items.forEach((kid) => stack.push(kid));
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
walk(items);
|
||||
|
||||
if (matchFieldList.length && !formState.value.msgType) {
|
||||
const quota = matchFieldList
|
||||
|
||||
Reference in New Issue
Block a user