发布移动端代码调整

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 pageLimit = 10;
// 数据记录
var newTemp;
var changeTemp;
var stopTemp;
/** /**
* 初始移动端明细数据 * 初始移动端明细数据
*/ */
function initMobileData() { function initMobileData() {
$("table[id^='AWS-MobileGrid-Zone']").empty(); $("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 = ''; 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 +='<tr>';
newHtml +='<td style="padding:0px;">'; newHtml +='<td style="padding:0px;">';
newHtml +='<table border="0" cellspacing="0" cellpadding="0" heightType="auto" widthType="fixed" style="width:100%;">'; newHtml +='<table border="0" cellspacing="0" cellpadding="0" heightType="auto" widthType="fixed" style="width:100%;">';
@ -19,12 +27,65 @@ function initMobileData() {
newHtml +='<tr>'; newHtml +='<tr>';
newHtml +='<td>'; newHtml +='<td>';
newHtml +='<table class="" style="width:100%;">'; 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(); 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() { function initContentData() {
var param = { var param = {
@ -46,12 +107,16 @@ function initContentData() {
} }
closeFormPage = r.data.closeFormPage; closeFormPage = r.data.closeFormPage;
var newData = r.data.newData; var newData = r.data.newData;
newTemp = newData;
var changeData = r.data.changeData; var changeData = r.data.changeData;
changeTemp = changeData;
var stopData = r.data.stopData; var stopData = r.data.stopData;
stopTemp = stopData;
var checkImg = '../apps/_bpm.portal/img/icheck_checkbox_check.png'; var checkImg = '../apps/_bpm.portal/img/icheck_checkbox_check.png';
var uncheckImg = '../apps/_bpm.portal/img/icheck_checkbox_uncheck.png'; var uncheckImg = '../apps/_bpm.portal/img/icheck_checkbox_uncheck.png';
if (!$.isEmptyObject(newData)) { if (!$.isEmptyObject(newData)) {
$('#OPTIONTYPE_0').prev('img').attr('src', checkImg); $('#OPTIONTYPE_0').prev('img').attr('src', checkImg);
dealPublishCheck(true, 'new');// 显示
// 更新数据 // 更新数据
$("#OPTIONTYPE_0").check("option","checked", true); $("#OPTIONTYPE_0").check("option","checked", true);
initPublishData(newData, 'new', 1, 1); initPublishData(newData, 'new', 1, 1);
@ -61,6 +126,7 @@ function initContentData() {
} }
if (!$.isEmptyObject(changeData)) { if (!$.isEmptyObject(changeData)) {
$('#OPTIONTYPE_1').prev('img').attr('src', checkImg); $('#OPTIONTYPE_1').prev('img').attr('src', checkImg);
dealPublishCheck(true, 'change');
$("#OPTIONTYPE_1").check("option","checked", true); $("#OPTIONTYPE_1").check("option","checked", true);
initPublishData(changeData, 'change', 1, 1); initPublishData(changeData, 'change', 1, 1);
} else { } else {
@ -69,6 +135,7 @@ function initContentData() {
} }
if (!$.isEmptyObject(stopData)) { if (!$.isEmptyObject(stopData)) {
$('#OPTIONTYPE_2').prev('img').attr('src', checkImg); $('#OPTIONTYPE_2').prev('img').attr('src', checkImg);
dealPublishCheck(true, 'stop');
$("#OPTIONTYPE_2").check("option","checked", true); $("#OPTIONTYPE_2").check("option","checked", true);
initPublishData(stopData, 'stop', 1, 1); initPublishData(stopData, 'stop', 1, 1);
} else { } else {
@ -78,6 +145,8 @@ function initContentData() {
} }
}); });
} }
function initPublishData(data, type, pageNumber, start){ function initPublishData(data, type, pageNumber, start){
showlist(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;"'; var tableTdCss = 'style="padding-top: 0;padding-bottom: 0;"';
if (type == 'new') { if (type == 'new') {
$('#new_check_all').check("option", "checked", false); $('#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 = ''; var html = '';
for (var i = 0, s = start; i < pageLimit; i++, s++) { for (var i = 0, s = start; i < pageLimit; i++, s++) {
debugger;
var curr; var curr;
if ((curr = data[s - 1]) != undefined) { 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); var outputName = getOutputName(curr.category, curr.methodId);
html +='<tr>';
html +='<td class="form-grid-mobile-common-row" width=100%>'; html += '<tr>';
html +='<span class="form-grid-mobile-common-tap" onclick="openReportFile(\'' + curr.taskId +'\');return false" >' + fileName + "-" + outputName + '</span>'; html += '<td class="form-grid-mobile-common-row" width=100%>';
html +='</td>'; html += '<span class="form-grid-mobile-common-tap" onclick="openReportFile(\'' + curr.taskId + '\');return false" >' + targetFileName + "-" + outputName + '</span>';
html +='</tr>'; 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"); $.simpleAlert("文件正在处理", "loading");
awsui.ajax.request({ awsui.ajax.request({
type: "POST", type: "POST",
@ -134,11 +251,7 @@ function openReportFile(taskId) {
ok: function(msg) { ok: function(msg) {
$.simpleAlert("close"); $.simpleAlert("close");
var url = msg.data.url; var url = msg.data.url;
if (msg.data.noSupport) { window.location.href = url;
window.location.href = url;
} else {
window.open(url);
}
}, },
err: function(msg) { err: function(msg) {
$.simpleAlert("close"); $.simpleAlert("close");