From f5dddf8c659eec756f8d129ab20841c3665149a3 Mon Sep 17 00:00:00 2001 From: yujh Date: Mon, 6 Jan 2025 16:37:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=85=B3=E9=94=AE=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E5=A2=9E=E5=8A=A0=E8=A7=92=E6=A0=87=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E4=BB=A3=E7=A0=81=E4=BF=AE=E5=A4=8D=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=81=8D=E5=8E=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extend/js/designer.extend.link.js | 92 ++++++++++++++----- 1 file changed, 70 insertions(+), 22 deletions(-) diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js index 188c6030..08be638c 100755 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.js @@ -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 = "|#D81E06"; + flag = false; + break; + } + } + //没有此项配置,则增加 + if(flag){ + var dataObj = { + "horizontal": "right", + "verity": "bottom", + "showType": "icon", + "iconContent": "|#D81E06" + }; + configList.add(dataObj); + } + }else{ + var dataArray = [ + { + "horizontal": "right", + "verity": "bottom", + "showType": "icon", + "iconContent": "|#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); }