From a7ff9a43baa2e8d07bc82b7d2da0460b7343a093 Mon Sep 17 00:00:00 2001 From: yujh Date: Sat, 8 Feb 2025 17:44:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=A3=8E=E6=8E=A7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=EF=BC=8C=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=85=B3=E9=94=AE=E6=8E=A7=E5=88=B6=E7=82=B9=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E5=80=BC=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extend/js/designer.extend.link.js | 2 +- .../js/designer.extend.link.view.portal.js | 85 ++++++++++++------- 2 files changed, 55 insertions(+), 32 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 80fb71ae..cc78e20f 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 @@ -2321,7 +2321,7 @@ function updateAttributeById(objId, va, shapeId) { } }); - }else if(isCriticalControlPoint === "否"){ + }else if(isCriticalControlPoint === "否" || isCriticalControlPoint === "请选择"){ shape.dataAttributes.forEach(function(attribute) { if(attribute.attributesJsonArray){ //在遍历角标,锁定到右下角的角标 diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.view.portal.js b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.view.portal.js index a6c9d7f8..482b61cb 100755 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.view.portal.js +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/extend/js/designer.extend.link.view.portal.js @@ -343,7 +343,7 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) { } else if (!obj.readonly && obj.type == "boolean") { constr = ''; /*constr += '' + obj.name + '';*/ - constr += '' + '【' + obj.name + '】'+' '+''; + constr += '' + '【' + obj.name + '】'+' '+ obj.value + ''; constr += ''; } else if (!obj.readonly && obj.type == "textarea") { constr = ''; @@ -433,44 +433,67 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) { } } -// table表格 function openDialog(obj) { - let tableName = obj.name - let dialogTable = obj.table - $("#attribute-table-content2").empty() - let thead = - '' - + '' + dialogTable[0].name + '' - + '' + dialogTable[0].desc + '' - +'' - $('#attribute-table-content2').append(thead) - for ( let i = 1; i < dialogTable.length; i++) { - let str = - '' - + '' + dialogTable[i].name + '' - + '' + dialogTable[i].desc + '' - +'' - $('#attribute-table-content2').append(str) - } + const { name: tableName, table: dialogTable } = obj; + const columns = dialogTable[0]; + //先判断是4列还是2列的,根据columns.threeColumn是否为空 + const columnCount = columns.threeColumn ? 4 : 2; + const columnNames = columnCount === 4 + ? ['firstColumn', 'secondColumn', 'threeColumn', 'fourColumn'] + : ['name', 'desc']; + const columnWidths = columnCount === 4 + ? ['18%', '33%', '33%', '16%'] + : ['30%', '70%']; + // 清空现有内容 + $("#attribute-table-content2").empty(); + + // 构建表头 + const thead = $('').attr('id', columns.id); + columnNames.forEach((name, index) => { + $('') + .addClass('dialogTableHead') + .css('width', columnWidths[index]) + .text(columns[name]) + .appendTo(thead); + }); + $('#attribute-table-content2').append(thead); + + // 构建表格内容 + dialogTable.slice(1).forEach(row => { + const tr = $('').attr('id', row.id); + columnNames.forEach((_, index) => { + $('') + .css('width', columnWidths[index]) + .text(row[columnNames[index]]) + .appendTo(tr); + }); + $('#attribute-table-content2').append(tr); + }); + + // 初始化对话框 $("#attribute-table-window2").dialog({ title: tableName, draggable: true, - buttons : [{ - text : '确定', - cls : "blue", - handler : function() { - $("#attribute-table-window2").dialog('close'); + buttons: [ + { + text: '确定', + cls: "blue", + handler: function() { + $("#attribute-table-window2").dialog('close'); + } + }, + { + text: '取消', + handler: function() { + $("#attribute-table-window2").dialog('close'); + } } - }, { - text : '取消', - handler : function() { - $("#attribute-table-window2").dialog('close'); - } - }] - }) + ] + }); } + Array.prototype.unique = function(){ var res = []; var json = {};