流程阅览js

This commit is contained in:
zhal 2022-07-16 00:11:53 +08:00
parent df1aa23f2f
commit bea273a029

View File

@ -1533,7 +1533,7 @@ function changeArributeByShape() {
if (Utils.getSelected()[0] == null) { if (Utils.getSelected()[0] == null) {
initShapeAttribute('0'); initShapeAttribute('0');
initUpfileData('0'); initUpfileData('0');
cc();
$('table[name=lastTable]').remove(); $('table[name=lastTable]').remove();
if($('#portalAttrDock').children('table').length > 0) { if($('#portalAttrDock').children('table').length > 0) {
// $('#portalAttrDock').append(lastTable); // $('#portalAttrDock').append(lastTable);
@ -1556,6 +1556,19 @@ function changeArributeByShape() {
} }
} }
function cc() {
$('#processFileDock').empty();
var t = '';
t += '<table class="awsui-table">';
t += '<tr><td>';
t += '<div class="filetableHeader"><i class="awsui-iconfont" style="color: #999999;margin-top: 2px;">&#xe7cf;</i> 流程手册:</div>';
t += '<div class="tableContent"><a href="javascript:void(0);" onclick="openOutputFile(\''+ ruuid +'\')">'+ fileName +'</a></div>';
t += '</td></tr>';
t += '</table>';
$('#processFileDock').append(t);
}
// 初始化上传附件 // 初始化上传附件
function initUpfileData(obj) { function initUpfileData(obj) {
$('#alertMessage').remove(); $('#alertMessage').remove();
@ -1566,20 +1579,20 @@ function initUpfileData(obj) {
if(processFile.length > 0) { if(processFile.length > 0) {
t += '<table name="file" class="awsui-table">'; t += '<table name="file" class="awsui-table">';
t += '<tr><td>'; t += '<tr><td>';
t += '<div class="filetableHeader">相关文件:</div>'; t += '<div class="filetableHeader"><i class="awsui-iconfont" style="color: #999999;margin-top: 2px;">&#xe7cf;</i> 相关文件:</div>';
for(var i = 0; i < processFile.length; i++) { for(var i = 0; i < processFile.length; i++) {
var obj = processFile[i]; var obj = processFile[i];
t += '<div class="tableContent"><a href="javascript:void(0);" onclick="readFile(\''+ obj.id +'\')">'+ obj.name +'</a></div>'; t += '<div class="tableContent"><a href="javascript:void(0);" onclick="readFile(\''+ obj.id +'\')">'+ obj.name +'</a></div>';
} }
t += '</td></tr></table>'; t += '</td></tr></table>';
} }
//流程手册附件展示 /*//流程手册附件展示
t += '<table class="awsui-table">'; t += '<table class="awsui-table">';
t += '<tr><td>'; t += '<tr><td>';
t += '<div class="filetableHeader">流程手册:</div>'; t += '<div class="filetableHeader"><i class="awsui-iconfont" style="color: #999999;margin-top: 2px;">&#xe7cf;</i> 流程手册:</div>';
t += '<div class="tableContent"><a href="javascript:void(0);" onclick="openOutputFile(\''+ ruuid +'\')">'+ fileName +'</a></div>'; t += '<div class="tableContent"><a href="javascript:void(0);" onclick="openOutputFile(\''+ ruuid +'\')">'+ fileName +'</a></div>';
t += '</td></tr>'; t += '</td></tr>';
t += '</table>'; t += '</table>'*/;
var elements = Model.define.elements; var elements = Model.define.elements;
for(var e in elements) { for(var e in elements) {
@ -1591,7 +1604,7 @@ function initUpfileData(obj) {
if(processShape != null && processShape.length > 0) { if(processShape != null && processShape.length > 0) {
t += '<table name="' + ele.id + '" class="awsui-table">'; t += '<table name="' + ele.id + '" class="awsui-table">';
t += '<tr><td>'; t += '<tr><td>';
t += '<div class="filetableHeader">' + ele.text + '</div>'; t += '<div class="filetableHeader"><i class="awsui-iconfont" style="color: #999999;margin-top: 2px;">&#xe7cf;</i>' + ele.text + '</div>';
for(var i = 0; i < processShape.length; i++) { for(var i = 0; i < processShape.length; i++) {
var obj = processShape[i]; var obj = processShape[i];
t += '<div class="tableContent"><a href="javascript:void(0);" onclick="readFile(\''+ obj.id +'\')">'+ obj.name +'</a></div>'; t += '<div class="tableContent"><a href="javascript:void(0);" onclick="readFile(\''+ obj.id +'\')">'+ obj.name +'</a></div>';
@ -1602,12 +1615,11 @@ function initUpfileData(obj) {
} }
$('#portalFileDock').append(t); $('#portalFileDock').append(t);
} else { } else {
$('#portalFileDock table').hide(); $('#portalFileDock table').show();
$('#portalFileDock table[name=' + obj + ']').show(); $('#portalFileDock table[name=' + obj + ']').show();
} }
var isHidden = true; var isHidden = true;
$('#portalFileDock table').each(function(){ $('#portalFileDock table').each(function(){
console.log($(this).css('display'));
if ($(this).css('display') != 'none') { if ($(this).css('display') != 'none') {
isHidden = false; isHidden = false;
} }
@ -1652,7 +1664,7 @@ function sortModelByNumber() {
if (attrArr.attributesJsonArray && attrArr.attributesJsonArray.length > 0) { if (attrArr.attributesJsonArray && attrArr.attributesJsonArray.length > 0) {
for (var j = 0; j < attrArr.attributesJsonArray.length; j++) { for (var j = 0; j < attrArr.attributesJsonArray.length; j++) {
var attr = attrArr.attributesJsonArray[j]; var attr = attrArr.attributesJsonArray[j];
if (attr != null && attr.id && attr.id == 'number') { /*if (attr != null && attr.id && attr.id == 'number') {
var number = attr.value; var number = attr.value;
if(typeof number == 'string') { if(typeof number == 'string') {
number = number.replace(/^\s+|\s+$/g,"") number = number.replace(/^\s+|\s+$/g,"")
@ -1666,7 +1678,28 @@ function sortModelByNumber() {
recordId.push(shapeId); recordId.push(shapeId);
} }
break; break;
}*/
//根据活动序号排序
if (attr != null && attr.id) {
var number = attr.value;
if(attr.id=="activity_number"){
if(typeof number == 'string') {
number = number.replace(/^\s+|\s+$/g,"")
};
if(number != undefined && number != null && number != "") {
var obj = {};
obj.text = shape.text;
obj.id = shapeId;
obj.orderIndex = number;
hasNumArr.push(obj);
recordId.push(shapeId);
}
}
break;
} }
} }
break; break;
} }
@ -1745,38 +1778,56 @@ function initShapeAttribute(obj) {
attributesJsonArrayT = tempAttrArray.concat(newAttrArray); attributesJsonArrayT = tempAttrArray.concat(newAttrArray);
} }
} }
var t = '';
t += '<div class="task-box">' //流程阅览只显示线上审批、线下审批、系统任务、人工审批
/*t += '<button type="button" class="awsui-btn awsui-btn-blue awsui-btn-sm" onclick="searchChange(\''+shape.id+'\')">'; if(shape.title=="线上审批" || shape.title=="线下审批" || shape.title=="系统任务" ||shape.title=="人工审批") {
t +='<i class="awsui-iconfont" id="searchChange'+shape.id+'">&#xe718;</i>';
t += '</button>';*/ var no = "";
t +='<i class="awsui-iconfont newadd_up" id="searchChange'+shape.id+'" onclick="searchChange(\''+shape.id+'\')">&#xe718;</i>'; for (var i = 0; i < attributesJsonArrayT.length; i++) {
t +='<input type="hidden" name="searchChangeFlg" id="searchChangeFlg'+shape.id+'" value="0" />'; var id = attributesJsonArrayT[i].id;
t += '<table class="awsui-table awsui-table-bordered" name="' + shape.id + '" id="' +shape.id+ 'change" >'; if (id == "activity_number") {
t += '<tr name="trHeader">'; var numberValue = attributesJsonArrayT[i].value;
t += '<td class="tableHeader" >' + shape.text + '</td>'; if (numberValue != "") {
t += '</tr>'; no = numberValue;
t += '<tr>'; }
/*t += '<td style="padding-left:20px;" class="tableContent"></td>';*/
t += '<td id="' + shape.id + 'type" class="tableContent"></td>';
t += '</tr>';
t += '</table></div>';
$('#portalAttrDock').append(t);
if (shape && attributesJsonArrayT) {
// {}函数,改为图形创建时增加私有属性
attributesJsonArray = attributesJsonArrayT;
var shapeTitle = shape.title == undefined ? "" : shape.title;
$("#" + shape.id + "type").text(shapeTitle);
for (var i = 0; i < shape.dataAttributes.length; i++) {
var attr = shape.dataAttributes[i];
if (attr.shapeDesc) {
$("#" + shape.id + "desc").html(attr.shapeDesc == undefined ? "" : attr.shapeDesc.replace(/\n/g,'<br>'));
break;
} }
} }
// 此处遍历attributesJsonArray输入 内容
if (attributesJsonArray.length != 0) { var t = '';
getPrivateAttributeHtml(attributesJsonArray, "portalAttrDock", shape); t += '<div class="task-box">'
/*t += '<button type="button" class="awsui-btn awsui-btn-blue awsui-btn-sm" onclick="searchChange(\''+shape.id+'\')">';
t +='<i class="awsui-iconfont" id="searchChange'+shape.id+'">&#xe718;</i>';
t += '</button>';*/
t += '<i class="awsui-iconfont newadd_up" id="searchChange' + shape.id + '" onclick="searchChange(\'' + shape.id + '\')">&#xe718;</i>';
t += '<input type="hidden" name="searchChangeFlg" id="searchChangeFlg' + shape.id + '" value="0" />';
t += '<table class="awsui-table awsui-table-bordered" name="' + shape.id + '" id="' + shape.id + 'change" >';
t += '<tr name="trHeader">';
t += '<td class="tableHeader" >' +no+"."+shape.text + '</td>';
t += '</tr>';
t += '<tr>';
/*t += '<td style="padding-left:20px;" class="tableContent"></td>';*/
t += '<td id="' + shape.id + 'type" class="tableContent"></td>';
t += '</tr>';
t += '</table></div>';
$('#portalAttrDock').append(t);
if (shape && attributesJsonArrayT) {
// {}函数,改为图形创建时增加私有属性
attributesJsonArray = attributesJsonArrayT;
var shapeTitle = shape.title == undefined ? "" : shape.title;
$("#" + shape.id + "type").text(shapeTitle);
for (var i = 0; i < shape.dataAttributes.length; i++) {
var attr = shape.dataAttributes[i];
if (attr.shapeDesc) {
$("#" + shape.id + "desc").html(attr.shapeDesc == undefined ? "" : attr.shapeDesc.replace(/\n/g, '<br>'));
break;
}
}
// 此处遍历attributesJsonArray输入 内容
if (attributesJsonArray.length != 0) {
getPrivateAttributeHtml(attributesJsonArray, "portalAttrDock", shape);
}
} }
} }
} }