流程阅览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) {
initShapeAttribute('0');
initUpfileData('0');
cc();
$('table[name=lastTable]').remove();
if($('#portalAttrDock').children('table').length > 0) {
// $('#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) {
$('#alertMessage').remove();
@ -1566,20 +1579,20 @@ function initUpfileData(obj) {
if(processFile.length > 0) {
t += '<table name="file" class="awsui-table">';
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++) {
var obj = processFile[i];
t += '<div class="tableContent"><a href="javascript:void(0);" onclick="readFile(\''+ obj.id +'\')">'+ obj.name +'</a></div>';
}
t += '</td></tr></table>';
}
//流程手册附件展示
/*//流程手册附件展示
t += '<table class="awsui-table">';
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 += '</td></tr>';
t += '</table>';
t += '</table>'*/;
var elements = Model.define.elements;
for(var e in elements) {
@ -1591,7 +1604,7 @@ function initUpfileData(obj) {
if(processShape != null && processShape.length > 0) {
t += '<table name="' + ele.id + '" class="awsui-table">';
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++) {
var obj = processShape[i];
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);
} else {
$('#portalFileDock table').hide();
$('#portalFileDock table').show();
$('#portalFileDock table[name=' + obj + ']').show();
}
var isHidden = true;
$('#portalFileDock table').each(function(){
console.log($(this).css('display'));
if ($(this).css('display') != 'none') {
isHidden = false;
}
@ -1652,7 +1664,7 @@ function sortModelByNumber() {
if (attrArr.attributesJsonArray && attrArr.attributesJsonArray.length > 0) {
for (var j = 0; j < attrArr.attributesJsonArray.length; 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;
if(typeof number == 'string') {
number = number.replace(/^\s+|\s+$/g,"")
@ -1666,10 +1678,31 @@ function sortModelByNumber() {
recordId.push(shapeId);
}
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;
}
}
}
// 有序号的元素升序排序
@ -1745,6 +1778,23 @@ function initShapeAttribute(obj) {
attributesJsonArrayT = tempAttrArray.concat(newAttrArray);
}
}
//流程阅览只显示线上审批、线下审批、系统任务、人工审批
if(shape.title=="线上审批" || shape.title=="线下审批" || shape.title=="系统任务" ||shape.title=="人工审批") {
var no = "";
for (var i = 0; i < attributesJsonArrayT.length; i++) {
var id = attributesJsonArrayT[i].id;
if (id == "activity_number") {
var numberValue = attributesJsonArrayT[i].value;
if (numberValue != "") {
no = numberValue;
}
}
}
var t = '';
t += '<div class="task-box">'
/*t += '<button type="button" class="awsui-btn awsui-btn-blue awsui-btn-sm" onclick="searchChange(\''+shape.id+'\')">';
@ -1754,7 +1804,7 @@ function initShapeAttribute(obj) {
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" >' + shape.text + '</td>';
t += '<td class="tableHeader" >' +no+"."+shape.text + '</td>';
t += '</tr>';
t += '<tr>';
/*t += '<td style="padding-left:20px;" class="tableContent"></td>';*/
@ -1780,6 +1830,7 @@ function initShapeAttribute(obj) {
}
}
}
}
} else {
$('#portalAttrDock table').hide();
$('#portalAttrDock table[name=' + obj + ']').show();