发布移动端代码调整

This commit is contained in:
zhal 2022-08-21 21:01:34 +08:00
parent a0cfb4bd64
commit f27ee6601e

View File

@ -1,11 +1,19 @@
var pageLimit = 10;
// 数据记录
var newTemp;
var changeTemp;
var stopTemp;
/**
* 初始移动端明细数据
*/
function initMobileData() {
$("table[id^='AWS-MobileGrid-Zone']").empty();
$("table[id^='AWS-MobileGrid-Zone']").html('<div id="contentDiv1" style="display: none;" border="0"></div><div id="contentDiv2" style="display: none;" border="0"></div><div id="contentDiv3" style="display: none;" border="0"></div>');
//新增版本
var newHtml = '';
newHtml +='<table id="AWS-MobileGrid-Zone-b6fa1d41-0e4a-49a8-9f7f-7007b5b321fe" style="width: 100% !important;">';
newHtml +='<table id="AWS-MobileGrid-Zone-new" style="width: 100% !important;">';
newHtml +='<tr>';
newHtml +='<td style="padding:0px;">';
newHtml +='<table border="0" cellspacing="0" cellpadding="0" heightType="auto" widthType="fixed" style="width:100%;">';
@ -19,12 +27,65 @@ function initMobileData() {
newHtml +='<tr>';
newHtml +='<td>';
newHtml +='<table class="" style="width:100%;">';
newHtml +='<tbody id="appendBody">';
newHtml +='<tbody id="appendNewBody">';
$("#contentDiv1").append(newHtml);
//更新版本
$("table[id='AWS-MobileGrid-Zone-change']").empty();
var changeHtml = '';
changeHtml +='<table id="AWS-MobileGrid-Zone-change" style="width: 100% !important;">';
changeHtml +='<tr>';
changeHtml +='<td style="padding:0px;">';
changeHtml +='<table border="0" cellspacing="0" cellpadding="0" heightType="auto" widthType="fixed" style="width:100%;">';
changeHtml +='<tbody>';
changeHtml +='<tr class="form-grid-mobile-common-toolbar">';
changeHtml +='<td>';
changeHtml +='<div class="form-grid-mobile-common-toolbar"></div>';
changeHtml +='</div>';
changeHtml +='</td>';
changeHtml +='</tr>';
changeHtml +='<tr>';
changeHtml +='<td>';
changeHtml +='<table class="" style="width:100%;">';
changeHtml +='<tbody id="appendChangeBody">';
$("#contentDiv2").append(changeHtml);
//废止
$("table[id='AWS-MobileGrid-Zone-stop']").empty();
var stopHtml = '';
stopHtml +='<table id="AWS-MobileGrid-Zone-stop" style="width: 100% !important;">';
stopHtml +='<tr>';
stopHtml +='<td style="padding:0px;">';
stopHtml +='<table border="0" cellspacing="0" cellpadding="0" heightType="auto" widthType="fixed" style="width:100%;">';
stopHtml +='<tbody>';
stopHtml +='<tr class="form-grid-mobile-common-toolbar">';
stopHtml +='<td>';
stopHtml +='<div class="form-grid-mobile-common-toolbar"></div>';
stopHtml +='</div>';
stopHtml +='</td>';
stopHtml +='</tr>';
stopHtml +='<tr>';
stopHtml +='<td>';
stopHtml +='<table class="" style="width:100%;">';
stopHtml +='<tbody id="appendStopBody">';
$("#contentDiv3").append(stopHtml);
//渲染数据
initContentData();
$("table[id^='AWS-MobileGrid-Zone']").append(newHtml);
}
// 主体内容显示与隐藏
function dealPublishCheck(isCheck, type) {
if (type == 'new') {
isCheck ? $('#contentDiv1').show() : $('#contentDiv1').hide();
} else if (type == 'change') {
isCheck ? $('#contentDiv2').show() : $('#contentDiv2').hide();
} else if (type == 'stop') {
isCheck ? $('#contentDiv3').show() : $('#contentDiv3').hide();
}
}
// 初始化内容数据
function initContentData() {
var param = {
@ -46,12 +107,16 @@ function initContentData() {
}
closeFormPage = r.data.closeFormPage;
var newData = r.data.newData;
newTemp = newData;
var changeData = r.data.changeData;
changeTemp = changeData;
var stopData = r.data.stopData;
stopTemp = stopData;
var checkImg = '../apps/_bpm.portal/img/icheck_checkbox_check.png';
var uncheckImg = '../apps/_bpm.portal/img/icheck_checkbox_uncheck.png';
if (!$.isEmptyObject(newData)) {
$('#OPTIONTYPE_0').prev('img').attr('src', checkImg);
dealPublishCheck(true, 'new');// 显示
// 更新数据
$("#OPTIONTYPE_0").check("option","checked", true);
initPublishData(newData, 'new', 1, 1);
@ -61,6 +126,7 @@ function initContentData() {
}
if (!$.isEmptyObject(changeData)) {
$('#OPTIONTYPE_1').prev('img').attr('src', checkImg);
dealPublishCheck(true, 'change');
$("#OPTIONTYPE_1").check("option","checked", true);
initPublishData(changeData, 'change', 1, 1);
} else {
@ -69,6 +135,7 @@ function initContentData() {
}
if (!$.isEmptyObject(stopData)) {
$('#OPTIONTYPE_2').prev('img').attr('src', checkImg);
dealPublishCheck(true, 'stop');
$("#OPTIONTYPE_2").check("option","checked", true);
initPublishData(stopData, 'stop', 1, 1);
} else {
@ -78,6 +145,8 @@ function initContentData() {
}
});
}
function initPublishData(data, type, pageNumber, start){
showlist(data, type, pageNumber, start);
}
@ -101,31 +170,79 @@ function showlist(data, type, pageNumber, start){
var tableTdCss = 'style="padding-top: 0;padding-bottom: 0;"';
if (type == 'new') {
$('#new_check_all').check("option", "checked", false);
if (data.length > pageLimit) {// 显示分页
$('#new_pagination').show();
}
// 加载数据
var html = '';
for (var i = 0, s = start; i < pageLimit; i++, s++) {
var curr;
if ((curr = data[s - 1]) != undefined) {
var fileName = curr.publishFileName + ' V' + curr.fileVersion;
var outputName = getOutputName(curr.category, curr.methodId);
html +='<tr>';
html +='<td class="form-grid-mobile-common-row" width=100%>';
html +='<span class="form-grid-mobile-common-tap" onclick="openReportFile(\'' + curr.taskId +'\');return false" >' + fileName + "-" + outputName + '</span>';
html +='</td>';
html +='</tr>';
}
}
$("#appendNewBody").empty().html(html);
}
if(type=="change"){
debugger;
// 加载数据
var html = '';
for (var i = 0, s = start; i < pageLimit; i++, s++) {
debugger;
var curr;
if ((curr = data[s - 1]) != undefined) {
var fileName = curr.publishFileName + ' V' + curr.fileVersion;
var sourceFileName = curr.changeFileName + ' V' + curr.fileVersion;
// 变更目标文件处理
var targetFileName = "";
if (curr.changedFileNameNew != undefined && curr.changedFileNameNew != '') {
targetFileName = curr.changedFileNameNew + ' V' + curr.targetFileVersion;
}
var targetId = "";
if (curr.changedFileIdNew != undefined && curr.changedFileIdNew != '') {
targetId = curr.changedFileIdNew;
}
var outputName = getOutputName(curr.category, curr.methodId);
html +='<tr>';
html +='<td class="form-grid-mobile-common-row" width=100%>';
html +='<span class="form-grid-mobile-common-tap" onclick="openReportFile(\'' + curr.taskId +'\');return false" >' + fileName + "-" + outputName + '</span>';
html +='</td>';
html +='</tr>';
html += '<tr>';
html += '<td class="form-grid-mobile-common-row" width=100%>';
html += '<span class="form-grid-mobile-common-tap" onclick="openReportFile(\'' + curr.taskId + '\');return false" >' + targetFileName + "-" + outputName + '</span>';
html += '</td>';
html += '</tr>';
}
}
$("#appendBody").empty().html(html);
$("#appendChangeBody").empty().html(html);
}
if (type == 'stop') {
// 加载数据
var html = '';
for (var i = 0, s = start; i < pageLimit; i++, s++) {
var curr;
if ((curr = data[s - 1]) != undefined) {
var fileName = curr.stopFileName + ' V' + curr.fileVersion;
var outputName = getOutputName(curr.category, curr.methodId);
html += '<tr>';
html += '<td class="form-grid-mobile-common-row" width=100%>';
html += '<span class="form-grid-mobile-common-tap" onclick="openReportFile(\'' + curr.taskId + '\');return false" >' + fileName + "-" + outputName + '</span>';
html += '</td>';
html += '</tr>';
}
}
$("#appendStopBody").empty().html(html);
}
}
// 打开流程手册
function openReportFile(taskId) {
function openReportFile(taskId,appendid) {
$.simpleAlert("文件正在处理", "loading");
awsui.ajax.request({
type: "POST",
@ -134,11 +251,7 @@ function openReportFile(taskId) {
ok: function(msg) {
$.simpleAlert("close");
var url = msg.data.url;
if (msg.data.noSupport) {
window.location.href = url;
} else {
window.open(url);
}
window.location.href = url;
},
err: function(msg) {
$.simpleAlert("close");