是否关键节点增加角标逻辑,代码修复增加遍历逻辑

This commit is contained in:
yujh 2025-01-06 16:37:34 +08:00
parent 53e7b9c16c
commit f5dddf8c65

View File

@ -2281,38 +2281,86 @@ function updateAttributeById(objId, va, shapeId) {
}
});
if(isCriticalControlPoint === "是"){
//增加右下角图表显示
var dataArray = [
{
"horizontal": "right",
"verity": "bottom",
"showType": "icon",
"iconContent": "|#D81E06"
}
];
shape.dataAttributes.forEach(function(attribute) {
if(attribute.attributesJsonArray){
attribute["dataShowConfig"].config = dataArray;
//遍历角标,锁定到右下角的角标
var configList = attribute["dataShowConfig"].config;
var flag = true;
if(configList !== undefined){
for (var j = 0; j < configList.length; j++) {
var config = configList[j];
//有此项配置则更新
if (config.horizontal === "right" && config.verity === "bottom") {
config.showType = "icon";
config.iconContent = "&#xe63d;|#D81E06";
flag = false;
break;
}
}
//没有此项配置,则增加
if(flag){
var dataObj = {
"horizontal": "right",
"verity": "bottom",
"showType": "icon",
"iconContent": "&#xe63d;|#D81E06"
};
configList.add(dataObj);
}
}else{
var dataArray = [
{
"horizontal": "right",
"verity": "bottom",
"showType": "icon",
"iconContent": "&#xe63d;|#D81E06"
}
];
attribute["dataShowConfig"].config = dataArray;
}
}
});
}else if(isCriticalControlPoint === "否"){
var dataArray = [
{
"horizontal": "right",
"verity": "bottom",
"showType": "icon",
"iconContent": ""
}
];
shape.dataAttributes.forEach(function(attribute) {
if(attribute.attributesJsonArray){
attribute["dataShowConfig"].config = dataArray;
//在遍历角标,锁定到右下角的角标
var configList = attribute["dataShowConfig"].config;
var flag = true;
if(configList !== undefined){
for (var j = 0; j < configList.length; j++) {
var config = configList[j];
//有此项配置则更新
if (config.horizontal === "right" && config.verity === "bottom") {
config.showType = "icon";
config.iconContent = "";
flag = false;
break;
}
}
//没有此项配置,则增加
if(flag){
var dataObj = {
"horizontal": "right",
"verity": "bottom",
"showType": "icon",
"iconContent": ""
};
configList.add(dataObj);
}
}else{
var dataArray = [
{
"horizontal": "right",
"verity": "bottom",
"showType": "icon",
"iconContent": ""
}
];
attribute["dataShowConfig"].config = dataArray;
}
}
});
}
Model.update(shape);
}