方案图文件预览问题,js提交

This commit is contained in:
yujh 2025-02-10 15:20:56 +08:00
parent 6de16e6618
commit 2733e2ae0e

View File

@ -433,6 +433,7 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) {
} }
} }
// table表格
function openDialog(obj) { function openDialog(obj) {
const { name: tableName, table: dialogTable } = obj; const { name: tableName, table: dialogTable } = obj;
const columns = dialogTable[0]; const columns = dialogTable[0];
@ -1674,7 +1675,7 @@ function ProcessManual(obj) {
}else if(methodId=="control.kpi"){ }else if(methodId=="control.kpi"){
manualName="流程绩效文件 :"; manualName="流程绩效文件 :";
}else if(methodId=="process.scheme"){ }else if(methodId=="process.scheme"){
manualName="流程绩效文件 :"; manualName="方案文件 :";
}else if(methodId=="engineering.standard"){ }else if(methodId=="engineering.standard"){
manualName="工程技术标准文件 :"; manualName="工程技术标准文件 :";
} }
@ -1817,7 +1818,7 @@ function initUpfileData(obj) {
var t = ''; var t = '';
var splitId=''; var splitId='';
var processFile = upfileData['file']; var processFile = upfileData['file'];
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>';
@ -1856,7 +1857,7 @@ function initUpfileData(obj) {
splitId+=obj.id+','; splitId+=obj.id+',';
var spiltName=obj.name; var spiltName=obj.name;
if(spiltName.substring(0,spiltName.lastIndexOf("."))==fileName && appendFlag==true){ if(spiltName.substring(0,spiltName.lastIndexOf("."))==fileName && appendFlag==true){
appendFlag=false; appendFlag=false;
var s=''; var s='';
@ -1879,16 +1880,16 @@ function initUpfileData(obj) {
var countindex=0; var countindex=0;
var elements = Model.define.elements; var elements = Model.define.elements;
console.log('elements',elements) console.log('elements',elements)
if(methodId=="data.form"){ if(methodId=="data.form"){
var sortModelByName = sortModelByName1();; var sortModelByName = sortModelByName1();;
for(var sortIndex = 0; sortIndex < sortModelByName.length; sortIndex++) { for(var sortIndex = 0; sortIndex < sortModelByName.length; sortIndex++) {
var temp = sortModelByName[sortIndex]; var temp = sortModelByName[sortIndex];
var shape = elements[temp.id]; var shape = elements[temp.id];
if(shape.name == 'linker') { if(shape.name == 'linker') {
continue; continue;
} }
var processShape = upfileData[temp.id]; var processShape = upfileData[temp.id];
if(processShape != null && processShape.length > 0) { if(processShape != null && processShape.length > 0) {
var fileTile="表单/模板:"; var fileTile="表单/模板:";
t += '<div>'; t += '<div>';
@ -1911,21 +1912,53 @@ function initUpfileData(obj) {
} }
t += '</div>'; t += '</div>';
}
}else{
for(var e in elements) {
var ele = elements[e];
if(ele.name == 'linker') {
continue;
} }
var processShape = upfileData[ele.id]; }else{
if(methodId=="control.policy"){ for(var e in elements) {
//暂时去掉制度节点附件显示 20221208 lihongyu var ele = elements[e];
if(false){ if(ele.name == 'linker') {
//if(countindex!=0){ continue;
}
var processShape = upfileData[ele.id];
if(methodId=="control.policy" || methodId=="engineering.standard" || methodId=="process.scheme"){
//暂时去掉制度节点附件显示 20221208 lihongyu
if(false){
//if(countindex!=0){
if(processShape != null && processShape.length > 0) {
var fileTile="";
if(ele.category=="data_form"){
fileTile="表单/模板:";
}else{
fileTile="节点附件:";
}
t += '<div>';
t +='<strong>'+fileTile+'</strong>'+ele.text;
for(var i = 0; i < processShape.length; i++) {
t += '<table name="' + ele.id + '" class="awsui-table">';
t +='<tbody>';
t += '<tr>';
t += '<td>';
var obj = processShape[i];
t += '<div class="tablefileContent"><a href="javascript:void(0);" title="'+obj.name+'" onclick="readFile(\''+ obj.id +'\')">'+ obj.name +'</a>';
t +='</div>';
t += '</td>';
t += '</tr>';
t +='</tbody>';
t += '</table>';
splitId+=obj.id+',';
}
}
t += '</div>';
}
countindex++;
}else{
if(processShape != null && processShape.length > 0) { if(processShape != null && processShape.length > 0) {
var fileTile=""; var fileTile="";
if(ele.category=="data_form"){ if(ele.category=="data_form"){
fileTile="表单/模板:"; fileTile="表单/模板:";
@ -1934,6 +1967,7 @@ function initUpfileData(obj) {
} }
t += '<div>'; t += '<div>';
t +='<strong>'+fileTile+'</strong>'+ele.text; t +='<strong>'+fileTile+'</strong>'+ele.text;
for(var i = 0; i < processShape.length; i++) { for(var i = 0; i < processShape.length; i++) {
t += '<table name="' + ele.id + '" class="awsui-table">'; t += '<table name="' + ele.id + '" class="awsui-table">';
t +='<tbody>'; t +='<tbody>';
@ -1954,48 +1988,15 @@ function initUpfileData(obj) {
t += '</div>'; t += '</div>';
} }
countindex++;
}else{
if(processShape != null && processShape.length > 0) {
var fileTile="";
if(ele.category=="data_form"){
fileTile="表单/模板:";
}else{
fileTile="节点附件:";
}
t += '<div>';
t +='<strong>'+fileTile+'</strong>'+ele.text;
for(var i = 0; i < processShape.length; i++) {
t += '<table name="' + ele.id + '" class="awsui-table">';
t +='<tbody>';
t += '<tr>';
t += '<td>';
var obj = processShape[i];
t += '<div class="tablefileContent"><a href="javascript:void(0);" title="'+obj.name+'" onclick="readFile(\''+ obj.id +'\')">'+ obj.name +'</a>';
t +='</div>';
t += '</td>';
t += '</tr>';
t +='</tbody>';
t += '</table>';
splitId+=obj.id+',';
}
}
t += '</div>';
} }
} }
}
t += '<div id="dabao" style=" margin-top: -25px;"></div>'; t += '<div id="dabao" style=" margin-top: -25px;"></div>';
@ -2035,42 +2036,42 @@ function initUpfileData(obj) {
//根据节点名称排序 //根据节点名称排序
function sortModelByName1() { function sortModelByName1() {
var num = 0; var num = 0;
var recordId = []; var recordId = [];
var hasNumArr = []; var hasNumArr = [];
/*******************************排序方法重构***by zhaolei**********************************************/ /*******************************排序方法重构***by zhaolei**********************************************/
for (var shapeId in Model.define.elements) { for (var shapeId in Model.define.elements) {
var shape = Model.define.elements[shapeId]; var shape = Model.define.elements[shapeId];
var attr = shape.text; var attr = shape.text;
var category = shape.category; var category = shape.category;
console.log('节点名称',category); console.log('节点名称',category);
//根据活动名称排序 //根据活动名称排序
if (attr != null) { if (attr != null) {
if(category=="data_form"){ if(category=="data_form"){
if(attr.substr(0,2)=='附件') { if(attr.substr(0,2)=='附件') {
var obj = {}; var obj = {};
obj.text = shape.text; obj.text = shape.text;
obj.id = shapeId; obj.id = shapeId;
obj.orderIndex = attr.substr(2, 1); obj.orderIndex = attr.substr(2, 1);
hasNumArr.push(obj); hasNumArr.push(obj);
recordId.push(shapeId); recordId.push(shapeId);
}else{ }else{
var obj = {}; var obj = {};
obj.text = shape.text; obj.text = shape.text;
obj.id = shapeId; obj.id = shapeId;
obj.orderIndex = num; obj.orderIndex = num;
hasNumArr.push(obj); hasNumArr.push(obj);
recordId.push(shapeId); recordId.push(shapeId);
num++; num++;
} }
} }
} }
} }
// 按名称升序排序 // 按名称升序排序