fix(X-Pack): 阈值告警-告警内容中字段顺序与表单中选择字段顺序不一致

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
fit2cloud-chenyw
2026-09-15 10:42:38 +08:00
parent bf5a600e05
commit 6e672d53de
2 changed files with 15 additions and 16 deletions

View File

@@ -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);

View File

@@ -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