设计器表格类型换行显示

This commit is contained in:
mrs_12345@163.com 2022-07-07 20:22:59 +08:00
parent 54cc4495ae
commit b12595875c
2 changed files with 81 additions and 69 deletions

View File

@ -612,7 +612,7 @@ function saveDialogTableValue(tableValue,id,dom) {
}
function saveContent(obj) {
debugger;
// debugger;
var sid = $("#sid").val();
var uuid = $("#id").val();
var id = obj.attr("id");
@ -902,10 +902,10 @@ function showTableDialog(obj,value,id) {
let str =
'<tr id="' + tableList[i].id + '">'
+ '<td style="width: 100px;">'
+ '<input class="dialog_table_input_css" value="' + tableList[i].name + '"/>'
+ '<textarea type="textarea" rows="5" class="dialog_table_input_css" value="' + tableList[i].name + '">' + tableList[i].name + '</textarea>'
+ '</td>'
+ '<td style="width: 270px;">'
+ '<input class="dialog_table_input_css" value="' + tableList[i].desc + '"/>'
+ '<textarea type="textarea" rows="5" class="dialog_table_input_css" value="' + tableList[i].desc + '">' + tableList[i].name + '</textarea>'
+ '</td>'
+ '<td style="width: 80px;text-align: center;" class="dialogTableDelete" onclick="removeTr(this)">删除</td>'
+'</tr>'
@ -921,7 +921,7 @@ function showTableDialog(obj,value,id) {
handler : function() {
// let name = parent.$("#attribute-title-content1").val()
// $("#" + id).val(name)
let inputs = parent.$('#attribute-table-content1').find('input')
let inputs = parent.$('#attribute-table-content1').find('textarea')
for (let i = 1; i < parent.operateList.length; i++) {
parent.operateList[i].name = inputs[2*(i-1)].value
parent.operateList[i].desc = inputs[2*(i-1) + 1].value
@ -950,8 +950,8 @@ function addTr() {
let newTrId = Date.now().toString(36)
let defaultStr =
' <tr id="'+ newTrId + '">'
+ '<td style="width: 100px;"><input class="dialog_table_input_css" value=""/></td>'
+ '<td style="width: 270px;"><input class="dialog_table_input_css" value=""/></td>'
+ '<td style="width: 100px;"><textarea type="textarea" rows="5" class="dialog_table_input_css" value=""></textarea></td>'
+ '<td style="width: 270px;"><textarea type="textarea" rows="5" class="dialog_table_input_css" value=""></textarea></td>'
+ '<td style="width: 80px;text-align: center" class="dialogTableDelete" onclick="removeTr(this)">删除</td>'
+ '</tr>'
operateList.push({ id: newTrId ,name: '',desc: ''})

View File

@ -214,10 +214,10 @@ UI.showInsertLink = function() {
}
}
if (!addr) {
addr = [];
addr = new Array();
}
var links_file = [];
var links_custom = [];
var links_file = new Array();
var links_custom = new Array();
for (var i = 0; i < addr.length; i++) {
var link = addr[i];
if (link.type == "file") {
@ -278,7 +278,7 @@ UI.showRiskDlg = function(){
url:"./w?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.risk_pal_designer_risk",
data:{"plId":ruuid, "taskId": shape.id, "taskNum": number}
});
};
}
//流程节点的风险控制不为空重新渲染shape
function renderShapeRisks(risk, control) {
@ -330,7 +330,7 @@ UI.showImportDlg = function() {
{text:'取消',handler:function(){$("#visio_import_dlg").dialog("close");}}
]
});
};
}
//初始化visio导入的fileupload组件
function initVisioImportFileUpload() {
$("#visio_import_upfile").upfile({
@ -518,7 +518,7 @@ function openLinkUrlRewrite(type, url, target, uuid, obj, fileName, inspected) {
cmd: "com.actionsoft.apps.coe.pal_pl_repository_designer_viewer_link_perm",
uuids: uuid,
filePerms: filePerms
};
}
if (window.opener) {
params.modelType = "used";
} else if (openerAppId != undefined && openerAppId != "com.actionsoft.apps.coe.pal" && openerAppId != "") {
@ -667,7 +667,7 @@ UI.setLink = function() {
for (var i = 0; i < shape.dataAttributes.length; i++) {
var attr = shape.dataAttributes[i];
if (attr.linksArray) {
linkArr = [];
linkArr = new Array();
break;
}
}
@ -881,7 +881,7 @@ function openLink(obj) {
+ '" onclick="openLinkUrlRewrite(\''
+ array_element.type + '\',\'' + array_element.url
+ '\',\'' + array_element.target + '\',\''
+ array_element.uuid + '\',\'';
+ array_element.uuid + '\',\''
'\',\''
+ array_element.name
+ '\')">'
@ -1006,7 +1006,7 @@ function deleteTheLinkNode(str, index) {
function removeLinkHistoryByLink(obj) {
var linkType = $("#link_dialog div.awsui-simple-tab").find("a.active").attr("tit");
window.top.$.mask();
myshapeLink = Utils.getSelected()[0];
myshapeLink = Utils.getSelected()[0]
var options = {
title : "提示",
content : "确定删除所选链接吗?",
@ -1116,7 +1116,7 @@ function getLinkFileValue(treeNode) {
// 数属性tab页面效果js
function selectAttrTabTag2(showContent, selfObj) {
function selectAttrTabTag(showContent, selfObj) {
// 操作标签
var tag = $("#tabUlContainer li");
var taglength = tag.length;
@ -1261,7 +1261,7 @@ function showRelevanceShapesContent() {
var obj = {
id: shapesObj[i].fileId,
processDefId: ''
};
}
onclick = 'window.opener.openDesginer({id:\'' + shapesObj[i].fileId + '\', processDefId:\'\'})';
}else if (parent.openLinkUrl){
if (shapesObj[i].url){
@ -1342,7 +1342,7 @@ function attributeShowTabContent(currentShape) {
} else {
if (shape.text.length > 15) {
var tempText = shape.text;
tempText = tempText.substring(0, 15);
tempText = tempText.substring(0, 15)
$("span[name=attribute_desc_input]").text(shape.text).attr(
"awsui-qtip", shape.text);
} else {
@ -1361,7 +1361,7 @@ function attributeShowTabContent(currentShape) {
}
if (shape.text.length > 15) {
var tempText = shape.text;
tempText = tempText.substring(0, 15);
tempText = tempText.substring(0, 15)
$("span[name=attribute_desc_input]").text(shape.text).attr(
"awsui-qtip", shape.text);
} else {
@ -1374,7 +1374,7 @@ function attributeShowTabContent(currentShape) {
$("#dock_view_header_title").html("数据属性");
}
var dialogTableList = [];
var dialogTableList = []
function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) {
// 属性排序
var defaultMoreAttr = $('#defaultMoreAttrSort').val();
@ -1431,7 +1431,7 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) {
objReadonly = attr.readonly;
objRequired = attr.readonly;
}
var requiredSpan = '';
var requiredSpan = ''
if(obj.isRequired !== null && obj.isRequired) {
requiredSpan = '<span style="color: #f04134;float:right">*</span>'
}
@ -1532,9 +1532,8 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) {
+ ' <input type="text" id="dateTimePicker_' + obj.id + '" objid="' + obj.id + '" placeholder="请选择日期" onblur="saveInputContent(this);" value="' + obj.value + '" class="attribute_input_css" data-shapeId="' + shape.id + '"/>'
+ ' </td></tr>';
} else if (!objReadonly && objType == "table") {
let objRef = JSON.parse(obj.ref);
console.log('ref',objRef);
let objTableInput = obj.value.table !== undefined && obj.value.table.length > 1 ? '请查看' : '请输入';
let objRef = JSON.parse(obj.ref)
let objTableInput = obj.value.table !== undefined && obj.value.table.length > 1 ? '请查看' : '请输入'
dialogTableList = obj.value.table == undefined ? [ { id: Utils.newId() ,name: objRef.firstColumn, desc: objRef.secondColumn} ] : obj.value.table;
constr = '<tr ' + mouseout + mouseover + ' class="tagContentTableTr">'
+ ' <td>' + objName + requiredSpan + '</td>'
@ -1598,7 +1597,7 @@ Array.prototype.unique = function(){
}
}
return res;
};
}
// 得到不同属性值关联的形状
@ -1655,7 +1654,7 @@ Array.prototype.notDistinct = function() {
}
}
return newArr;
};
}
// 删除掉关联形状
function removeTrRelevanceShapes(obj) {
@ -1666,7 +1665,7 @@ function removeTrRelevanceShapes(obj) {
onConfirm : function() {
// 确定删除
var shape = Utils.getSelected()[0];
var tempArray = [];
var tempArray = new Array();
var count = 0;
if (shape) {
var relevanceShapes = [];
@ -1784,7 +1783,7 @@ function updateModelElementsAttribute(selectedShape, nodes) {
}
if (arrJsontemp.length != 0) {
var tempArr = removeShepeAttributeAndReturnDifferent(arrJsontemp, filterNotCheckedAttribute(nodes, arrJsontemp));
var tempArray = [];
var tempArray = new Array();
for (var e = 0; e < tempArr.length; e++) {
if (tempArr[e] != 0 && tempArr[e] != "0") {
removeNotCheckedAttribute(shape, tempArr[e]);
@ -1873,7 +1872,7 @@ function removeShepeAttributeAndReturnDifferent(exitObj, newObj1) {
// 删除没有选中的元素
function removeNotCheckedAttribute(shape, obj1) {
var tempArray = [];
var tempArray = new Array();
var attributesJsonArray1 = [];
for (var i = 0; i < shape.dataAttributes.length; i++) {
var attr = shape.dataAttributes[i];
@ -1949,7 +1948,7 @@ function saveInputContent(obj,value) {
return;
}
if(value !== undefined && value.isRequired && objValue == '') {
$(obj).attr('placeholder',value.name + '不能为空');
$(obj).attr('placeholder',value.name + '不能为空')
$(obj).addClass("required_input_css");
return;
}
@ -1991,7 +1990,7 @@ function showAttributedEditWindow(obj) {
var objId = $(obj).attr("objid");
var shape = Utils.getSelected()[0];
var windowTitle = '提示';
let objValue = {};
let objValue = {}
if (shape) {
var attributesJsonArray = [];
for (var i = 0; i < shape.dataAttributes.length; i++) {
@ -2004,7 +2003,7 @@ function showAttributedEditWindow(obj) {
for (var index = 0; index < attributesJsonArray.length; index++) {
var tempObj = attributesJsonArray[index];
if (tempObj.id == objId) {
objValue = tempObj;
objValue = tempObj
windowTitle = tempObj.name;
// $("#attribute-edit-title").text(tempObj.name);
$("#attribute-edit-content").val(tempObj.value);
@ -2026,7 +2025,7 @@ function showAttributedEditWindow(obj) {
return;
}
if(objValue.isRequired && str == '') {
$("#attribute-edit-content").attr('placeholder',objValue.name + '不能为空');
$("#attribute-edit-content").attr('placeholder',objValue.name + '不能为空')
$("#attribute-edit-content").addClass("required_input_css");
return
}
@ -2046,7 +2045,7 @@ function showAttributedEditWindow(obj) {
// table表格
function openTableDialog(obj,value) {
let tableName = '提示';
let tableName = '提示'
let objId = $(obj).attr("objid");
let shape = Utils.getSelected()[0];
if (shape) {
@ -2066,8 +2065,8 @@ function openTableDialog(obj,value) {
}
}
}
$('#attribute-table-content').empty();
$('#attribute-add-content').empty();
$('#attribute-table-content').empty()
$('#attribute-add-content').empty()
var thead =
'<tr id="' + dialogTableList[0].id + '">'
+ '<td style="width: 100px;" class="dialogTableHead">'
@ -2077,22 +2076,23 @@ function openTableDialog(obj,value) {
+ dialogTableList[0].desc
+ '</td>'
+ '<td style="width: 60px;" class="dialogTableHead">操作</td>'
+ '</tr>';
$('#attribute-table-content').append(thead);
+ '</tr>'
$('#attribute-table-content').append(thead)
for ( let i = 1; i < dialogTableList.length; i++) {
let str =
'<tr id="' + dialogTableList[i].id + '">'
+ '<td style="width: 100px;">'
+ '<input class="dialog_table_input_css" value="' + dialogTableList[i].name + '"/>'
+ '<textarea type="textarea" rows="5" class="dialog_table_input_css" value="' + dialogTableList[i].name + '">' + dialogTableList[i].name + '</textarea>'
+ '</td>'
+ '<td style="width: 270px;">'
+ '<input class="dialog_table_input_css" value="' + dialogTableList[i].desc + '"/>'
+ '<textarea type="textarea" rows="5" class="dialog_table_input_css" value="' + dialogTableList[i].desc + '">' + dialogTableList[i].desc + '</textarea>'
+ '</td>'
+ '<td style="width: 60px;text-align: center" class="dialogTableDelete" onclick="removeTableTr(this)">删除</td>'
+'</tr>';
+'</tr>'
$('#attribute-table-content').append(str)
}
$('#attribute-add-content').append('<button onclick="addTableTr(this)">新增</button>');
$('#attribute-add-content').append('<button onclick="addTableTr(this)">新增</button>')
// tableInputHeight()
$("#attribute-table-window").dialog({
draggable: true,
@ -2101,15 +2101,15 @@ function openTableDialog(obj,value) {
text : '确定',
cls : "blue",
handler : function() {
let inputs = $('#attribute-table-content').find('input');
let inputs = $('#attribute-table-content').find('textarea')
for (let i = 1; i < dialogTableList.length; i++) {
dialogTableList[i].name = inputs[2*(i-1)].value;
dialogTableList[i].name = inputs[2*(i-1)].value
dialogTableList[i].desc = inputs[2*(i-1) +1].value
}
let tableObj = {
name: tableName,
table: dialogTableList
};
}
updateAttributeById($(obj).attr("objid"), tableObj);
$("#attribute-table-window").dialog('close');
}
@ -2122,22 +2122,34 @@ function openTableDialog(obj,value) {
})
}
// function tableInputHeight() {
// var input = $("#attribute-table-content").find(".dialog_table_input_css");
// input.each(function () {
// $(this).on('input', function(){
// if(this.scrollHeight > $(this).height()) {
// var curRow = parseInt($(this).attr('rows'))
// $(this).attr('rows',curRow + 1)
// }
// });
// })
// }
function addTableTr(obj) {
let newTrId = Utils.newId();
let newTrId = Utils.newId()
let defaultStr =
' <tr id="'+ newTrId + '">'
+ '<td style="width: 100px;"><input class="dialog_table_input_css" value=""/></td>'
+ '<td style="width: 270px;"><input class="dialog_table_input_css" value=""/></td>'
+ '<td style="width: 100px;"><textarea type="textarea" rows="5" class="dialog_table_input_css" value=""></textarea></td>'
+ '<td style="width: 270px;"><textarea type="textarea" rows="5" class="dialog_table_input_css" value=""></textarea></td>'
+ '<td style="width: 60px;text-align: center" class="dialogTableDelete" onclick="removeTableTr(this)">删除</td>'
+ '</tr>';
dialogTableList.push({ id: newTrId ,name: '',desc: ''});
+ '</tr>'
dialogTableList.push({ id: newTrId ,name: '',desc: ''})
$('#attribute-table-content').append(defaultStr)
}
function removeTableTr(obj) {
let removeId = obj.parentNode.getAttribute('id');
dialogTableList.splice(dialogTableList.findIndex(item => item.id == removeId), 1);
let tr = obj.parentNode;
let removeId = obj.parentNode.getAttribute('id')
dialogTableList.splice(dialogTableList.findIndex(item => item.id == removeId), 1)
let tr = obj.parentNode
tr.remove()
}
@ -2151,7 +2163,7 @@ function updateAttributeById(objId, va, shapeId) {
shape = Utils.getSelected()[0];
selectShape = shape;
}
var tempArray = [];
var tempArray = new Array();
var count = 0;
if (shape) {
/*
@ -2208,7 +2220,7 @@ function removeTrAttribute(obj) {
onConfirm : function() {
// 确定删除
var shape = Utils.getSelected()[0];
var tempArray = [];
var tempArray = new Array();
var count = 0;
if (shape) {
// shape.attributesContent = $("#tagContentTable0").html();
@ -2365,8 +2377,8 @@ Designer.events.addEventListener("linkerCreated", function(linker) {
* 图形创建后重写
*/
Designer.events.addEventListener("created", function(shape) {
let shapePosition = shape.props;
let pageSize = Model.define.page;
let shapePosition = shape.props
let pageSize = Model.define.page
if (shapePosition.x + shapePosition.w > pageSize.width - pageSize.padding) {
Designer.setPageStyle({
width: shapePosition.x + shapePosition.w + pageSize.padding + 30,
@ -2778,10 +2790,10 @@ function changeArributeByShape() {
$("#dock_content_attribute").hide();
$("#attr_no_more_attribute_id").show();
var iframeDocument=$("#file_attribute")[0].contentWindow.document;
var body = $(iframeDocument).find('body');
var pickerNum = $(body).find('input[name="dateTimePicker"]').length;
var body = $(iframeDocument).find('body')
var pickerNum = $(body).find('input[name="dateTimePicker"]').length
if (pickerNum > 0) {
var height = $(body).find('#frmMain').height() + 300;
var height = $(body).find('#frmMain').height() + 300
$("#file_attribute").height(height)
}
} else {
@ -2835,7 +2847,7 @@ function changeArributeByShape() {
var newAttrArray = [];
newAttrArray = tempAttrArray.concat(attributesJsonArrayT).filter(function(v, i, arr) {
return arr.indexOf(v) === arr.lastIndexOf(v);
});
});;
attributesJsonArrayT = tempAttrArray.concat(newAttrArray);
}
}
@ -2859,7 +2871,7 @@ function changeArributeByShape() {
} else {
if (shape.text.length > 15) {
var tempText = shape.text;
tempText = tempText.substring(0, 15);
tempText = tempText.substring(0, 15)
$("span[name=attribute_desc_input]").text(shape.text).attr(
"awsui-qtip", shape.text);
} else {
@ -3108,7 +3120,7 @@ function getRelevanceShapeNameByShapeId(objIds, shapeId) {
var shapeNames = [];
var shapeRelationValue = [];
var ref = shapeRefObj[objId];
var relationType = ref.type;
var relationType = ref.type
for (var j = 0; j < list.length; j++) {
if (list[j].attrId == objId) {
shapeNames.push(list[j].relationShapeText);
@ -3260,7 +3272,7 @@ function getAwsOrgAttributeByAttrId(shape, objId, checkedOrgList) {
function saveRelevanceAwsOrgShapesTODB1(shapesObj, shapeId, shapeName, fileName, shapeGroupId, objId, shape,attributeValue) {
if (attributeValue.isRequired && shapesObj.length == 0) {
$("input[objid='" + objId + "']").val('');
$("input[objid='" + objId + "']").attr('placeholder',attributeValue.name + '不能为空');
$("input[objid='" + objId + "']").attr('placeholder',attributeValue.name + '不能为空')
$("input[objid='" + objId + "']").addClass("required_input_css");
return;
}
@ -3316,7 +3328,7 @@ function saveRelevanceAwsOrgShapesTODB1(shapesObj, shapeId, shapeName, fileName,
relationShapeIds = relationShapeIds.split(",");
}
//修改文件中保存的属性值
var tempArray = [];
var tempArray = new Array();
var count = 0;
var attributesJsonArray = [];
for (var i = 0; i < shape.dataAttributes.length; i++) {
@ -3682,7 +3694,7 @@ function saveRelevanceShapesTODB(shapesObj, shapeId, shapeName, fileName,
//添加关联属性时更新relationShapeModelObject的值
if (attributeValue.isRequired && shapesObj.length == 0) {
$("input[objid='" + objId + "']").val('');
$("input[objid='" + objId + "']").attr('placeholder',attributeValue.name + '不能为空');
$("input[objid='" + objId + "']").attr('placeholder',attributeValue.name + '不能为空')
$("input[objid='" + objId + "']").addClass("required_input_css");
return;
}
@ -3761,7 +3773,7 @@ function saveRelevanceShapesTODB(shapesObj, shapeId, shapeName, fileName,
// $("input[objid='" + objId + "']").val(shapeNames.join(","));
// }
//修改文件中保存的属性值
var tempArray = [];
var tempArray = new Array();
var count = 0;
var attributesJsonArray = [];
for (var i = 0; i < shape.dataAttributes.length; i++) {
@ -4039,7 +4051,7 @@ UI.doOutputProcess = function() {
}
}
});
};
}
//导出流程手册
function outputReport() {
@ -4105,7 +4117,7 @@ UI.showImportShapeDlg = function() {
],
onClose:delShapeFiles
});
};
}
var updatedShapeFileList = [];// 已上传的附件列表名称