被覆盖文件还原

This commit is contained in:
446052889@qq.com 2022-07-27 18:25:35 +08:00
parent 2e1f6cb992
commit d8b5450ad8
2 changed files with 1371 additions and 1320 deletions

View File

@ -22,20 +22,20 @@ $(document).ready(function(){
var resizeWaiter = false;
$(window).resize(function() {
if(!resizeWaiter){
setTimeout(function(){
resizeWaiter = true;
if (!$("#publisher_new_tr").is(':hidden')) {
initWidth(true, 'new');
}
setTimeout(function(){
resizeWaiter = true;
if (!$("#publisher_new_tr").is(':hidden')) {
initWidth(true, 'new');
}
if (!$("#publisher_change_tr").is(':hidden')) {
initWidth(true, 'change');
}
if (!$("#publisher_stop_tr").is(':hidden')) {
initWidth(true, 'stop');
}
resizeWaiter = false;
}, 500);
}
resizeWaiter = false;
}, 500);
}
});
// 初始化自定义内容不能写到html 文件中,表单会被平台自动调整的不成样子
@ -50,11 +50,11 @@ function initHtml() {
dialogHtml += '</div>';
dialogHtml += '</div>';
$('body').append(dialogHtml);
$('#publisher_new_div').html('<div id="contentDiv1" class="" border="0"></div>');
$('#publisher_change_div').html('<div id="contentDiv2" class="" border="0"></div>');
$('#publisher_stop_div').html('<div id="contentDiv3" class="" border="0"></div>');
var newHtml = '';
newHtml += '<!-- 流程文件发布-->';
newHtml += '<div id="publisher_new" border="1">';
@ -83,7 +83,7 @@ function initHtml() {
newHtml += '</tbody>';
newHtml += '</table>';
newHtml += '</div>';
var changeHtml = '';
changeHtml += '<!-- 流程文件变更 -->';
changeHtml += '<div id="publisher_change" border="1">';
@ -115,7 +115,7 @@ function initHtml() {
changeHtml += '</tbody>';
changeHtml += '</table>';
changeHtml += '</div>';
var stopHtml = '';
stopHtml += '<!-- 流程文件废止-->';
stopHtml += '<div id="publisher_stop" border="1">';
@ -144,7 +144,7 @@ function initHtml() {
stopHtml += '</tbody>';
stopHtml += '</table>';
stopHtml += '</div>';
$('#contentDiv1').append(newHtml);
$('#contentDiv2').append(changeHtml);
$('#contentDiv3').append(stopHtml);
@ -161,11 +161,11 @@ function initParam() {
// 初始化内容数据
function initContentData() {
var param = {
cmd: 'com.actionsoft.apps.coe.pal.publisher_data_query',
processInstId: processInstId,
wsId : wsId,
sid: sid
};
cmd: 'com.actionsoft.apps.coe.pal.publisher_data_query',
processInstId: processInstId,
wsId : wsId,
sid: sid
};
$.ajax({
url : "./jd",
type : "POST",
@ -212,7 +212,7 @@ function initContentData() {
$('#OPTIONTYPE_2').prev('img').attr('src', uncheckImg);
}
}
});
}
@ -228,7 +228,7 @@ var changeOption;
*/
function initPublishData(data, type, isEnd, proNumber) {
if (type == 'new') {
var fileName = data.publishFileName + ' V' + data.fileVersion + '.0';
var fileName = data.publishFileName + ' V' + data.fileVersion;
var aHtml = '<a class="link" href="javascript:void(0);" onclick="openPortalPage(\'' + data.publishFileId + '\', \'' + data.taskId + '\')">' + fileName + '</a>';
$('#publisher_new_file_name').children('span.file_name').html(aHtml);
$('#publisher_new_file_id').val(data.publishFileId);
@ -250,14 +250,14 @@ function initPublishData(data, type, isEnd, proNumber) {
if (type == 'change') {
changeData = data;
// 变更文件处理
var sourceFileName = data.changeFileName + ' V' + data.fileVersion + '.0';
var sourceFileName = data.changeFileName + ' V' + data.fileVersion;
$('#publisher_change_source_file_name').children('span.file_name').html(sourceFileName);
$('#publisher_change_source_file_id').val(data.changeFileId);
// 变更目标文件处理
var targetFileName = "";
if (data.changedFileNameNew != undefined && data.changedFileNameNew != '') {
targetFileName = data.changedFileNameNew + ' V' + data.targetFileVersion + '.0';
targetFileName = data.changedFileNameNew + ' V' + data.targetFileVersion;
}
var targetId = "";
if (data.changedFileIdNew != undefined && data.changedFileIdNew != '') {
@ -274,7 +274,7 @@ function initPublishData(data, type, isEnd, proNumber) {
$('#publisher_change_report_name').html('无流程手册');
}
$('#publisher_change_report_id').text(data.taskId);
// 下选框处理
if (!proNumber) {
var tempHtml = '<span class="file_name" style="display:inline-block;text-align:left;"><a class="link" href="javascript:void(0);" onclick="openPortalPage(\'' + data.changedFileIdNew + '\', \'' + data.taskId + '\')">' + targetFileName + '</a></span>';
@ -283,12 +283,12 @@ function initPublishData(data, type, isEnd, proNumber) {
$('#select').html('<select id="publisher_change_target_file"></select>');
if (data.targetFiles.length > 0) {
var opt1 = {
data : []
data : []
};
var flag = false;
for (var i = 0; i < data.targetFiles.length; i++) {
var temp = data.targetFiles[i];
var name = temp.text + ' V' + temp.version + '.0';
var name = temp.text + ' V' + temp.version;
var obj = {id:temp.id, text:name};
opt1.data.push(obj);
if (targetId == temp.id) {
@ -324,7 +324,7 @@ function initPublishData(data, type, isEnd, proNumber) {
}
}
if (type == 'stop') {
var fileName = data.stopFileName + ' V' + data.fileVersion + '.0';
var fileName = data.stopFileName + ' V' + data.fileVersion;
var aHtml = '<a class="link" href="javascript:void(0);" onclick="openPortalPage(\'' + data.stopFileId + '\', \'' + data.taskId + '\')">' + fileName + '</a>';
$('#publisher_stop_file_name').children('span.file_name').html(aHtml);
$('#publisher_stop_file_id').val(data.stopFileId);
@ -366,15 +366,15 @@ function initChangedData(data, opt1) {
$('#publisher_change_report_name').html('无流程手册');
}
$('#publisher_change_report_id').text(selectedTaskId);
}
// 打开流程文件查看页面
function openPortalPage(uuid, taskId) {
var param = {
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_publish_repository_method_check",
uuid : uuid
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_publish_repository_method_check",
uuid : uuid
}
$.ajax({
url : "./jd",
@ -383,7 +383,7 @@ function openPortalPage(uuid, taskId) {
data : param,
success : function(r) {
if (r.result == 'ok') {
window.open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + uuid + "&sid=" + sid + "&taskId=" + taskId);// open Windows
window.open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + uuid + "&sid=" + sid + "&taskId=" + taskId);// open Windows
} else {
$.simpleAlert(r.msg);
}
@ -397,40 +397,40 @@ function openQueryDataDialog(type) {
$('#treeDataDiv').html('<div id="loadImg" style="width:100%;height:100%;text-align:center;vertical-align: middle;margin: auto;"></div>');
$('#searchData').html('<input id="processName" style="width:700px;" type="text" class="awsui-txt" placeholder="快速查询">');
$("#loadImg").loading({
description:"加载中",
size:'large',
color:'#000'
description:"加载中",
size:'large',
color:'#000'
});
$('.awsui-loading').css('position', 'relative');
$('.awsui-loading').css('top', '60px');
$("#loading-demo-basic").loading();
$("#treeDialog").dialog({
buttons:[
{text:'确定',cls:"blue",handler:function(){
if (type == 'new') {
getNewPublishResult(type);
} else if( type == 'change'){
getChangeResult(type);
} else {// stop
getStopResult(type);
}
}},
{text:'关闭',handler:function(){
closeDialog();// 关闭窗口
}}
],
onClose:function(){
$('#autoSearchProcessDiv').empty();
$('#autoSearchProcessDiv').hide();
$('#treeDataDiv').empty();
$('#searchData').empty();
}
});
buttons:[
{text:'确定',cls:"blue",handler:function(){
if (type == 'new') {
getNewPublishResult(type);
} else if( type == 'change'){
getChangeResult(type);
} else {// stop
getStopResult(type);
}
}},
{text:'关闭',handler:function(){
closeDialog();// 关闭窗口
}}
],
onClose:function(){
$('#autoSearchProcessDiv').empty();
$('#autoSearchProcessDiv').hide();
$('#treeDataDiv').empty();
$('#searchData').empty();
}
});
if (type == 'new') {
initPublishSearch(type);// 绑定搜索事件
initPublishSearch(type);// 绑定搜索事件
getNotPublishTreeData(type);
} else {// stop
initPublishSearch(type);// 绑定搜索事件
initPublishSearch(type);// 绑定搜索事件
getPublishedTreeData(type);
}
}
@ -438,12 +438,12 @@ function openQueryDataDialog(type) {
// 获取未发布文件数据结构
function getNotPublishTreeData(type) {
var param = {
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query",
teamId: teamId,
wsId: wsId,
type: type,
flag : true
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query",
teamId: teamId,
wsId: wsId,
type: type,
flag : true
}
$.ajax({
url : "./jd",
@ -452,19 +452,19 @@ function getNotPublishTreeData(type) {
data : param,
success : function(r) {
var data = r.data.data;
var setting = {
checkbox: false,
checkInherit: false,
event : {
beforeExpand : loadNewData
},
dataModel : {
data: data
}
};
$("#treeDataDiv").empty();
$('#treeDataDiv').html('<ul id="tree" style="width: 100%;"></ul>');
initTree = awsui.tree.init($("#tree"), setting);
var setting = {
checkbox: false,
checkInherit: false,
event : {
beforeExpand : loadNewData
},
dataModel : {
data: data
}
};
$("#treeDataDiv").empty();
$('#treeDataDiv').html('<ul id="tree" style="width: 100%;"></ul>');
initTree = awsui.tree.init($("#tree"), setting);
}
});
}
@ -472,16 +472,16 @@ function getNotPublishTreeData(type) {
function loadNewData(treeNode) {
// 如果是父节点并且存在子节点执行加载
if (treeNode) {
var pid;
if (typeof(treeNode) == "string") {
pid = treeNode;
} else {
pid = treeNode.id;
}
var pid;
if (typeof(treeNode) == "string") {
pid = treeNode;
} else {
pid = treeNode.id;
}
var dataModel = {
url : "./w?sid=" + jQuery("#sid").val()
+ "&cmd=com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query&flag=" + false + "&pid=" + pid
+ "&wsId=" + wsId + "&type=" + "new" + "&teamId=" + teamId,
+ "&cmd=com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query&flag=" + false + "&pid=" + pid
+ "&wsId=" + wsId + "&type=" + "new" + "&teamId=" + teamId,
method : "POST",
dataType : "json"
}
@ -492,40 +492,40 @@ function loadNewData(treeNode) {
var data = initTree.getChildrenByPid(pid);
var newData = [];
for (var i=0;i<data.length;i++){
if (data[i].pid != pid) {
continue;
}
var v = data[i].nocheck;
if (v && data[i].id.length <= 36){
data[i].name = data[i].name + ' (已发布)';
}
// 流程名称连接责任部门和责任人
data[i].tempName = data[i].name;
var hasDutyDept = false;
var hasDutyUser = false;
if (data[i].dutyDeptName != undefined && data[i].dutyDeptName != '') {
hasDutyDept = true;
}
if (data[i].dutyUserName != undefined && data[i].dutyUserName != '') {
hasDutyUser = true;
}
if (hasDutyDept && hasDutyUser) {
var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ' ' + varDutyUser + ':' + data[i].dutyUserName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
} else if (hasDutyDept) {
var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
} else if (hasDutyUser) {
var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
}
newData.push(data[i]);
//initTree.refreshNodeById(data[i]);
}
initTree.refreshNode({
id : pid,
data : newData
});
if (data[i].pid != pid) {
continue;
}
var v = data[i].nocheck;
if (v && data[i].id.length <= 36){
data[i].name = data[i].name + ' (已发布)';
}
// 流程名称连接责任部门和责任人
data[i].tempName = data[i].name;
var hasDutyDept = false;
var hasDutyUser = false;
if (data[i].dutyDeptName != undefined && data[i].dutyDeptName != '') {
hasDutyDept = true;
}
if (data[i].dutyUserName != undefined && data[i].dutyUserName != '') {
hasDutyUser = true;
}
if (hasDutyDept && hasDutyUser) {
var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ' ' + varDutyUser + ':' + data[i].dutyUserName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
} else if (hasDutyDept) {
var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
} else if (hasDutyUser) {
var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
}
newData.push(data[i]);
//initTree.refreshNodeById(data[i]);
}
initTree.refreshNode({
id : pid,
data : newData
});
}
}
@ -548,14 +548,14 @@ function getNewPublishResult(type) {
// 创建流程手册
taskId = createReport(node.category, node.method, node.id, taskId);
var data = {
category : node.category,
fileVersion : node.version,
methodId : node.method,
publishDesc : "",
publishFileId : node.id,
// publishFileName : node.name,
publishFileName : node.tempName,
taskId : taskId
category : node.category,
fileVersion : node.version,
methodId : node.method,
publishDesc : "",
publishFileId : node.id,
// publishFileName : node.name,
publishFileName : node.tempName,
taskId : taskId
}
clearData(type);// 清空
closeDialog();// 关闭窗口
@ -565,12 +565,12 @@ function getNewPublishResult(type) {
//获取已发布文件数据结构
function getPublishedTreeData(type) {
var param = {
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query",
teamId: teamId,
wsId: wsId,
type: type,
flag : true
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query",
teamId: teamId,
wsId: wsId,
type: type,
flag : true
}
$.ajax({
url : "./jd",
@ -580,37 +580,37 @@ function getPublishedTreeData(type) {
success : function(r) {
var data = r.data.data;
var setting = {
checkbox: false,
checkInherit: false,
dataModel : {
data: data
}
};
for (var i=0;i<data.length;i++){
// 流程名称连接责任部门和责任人
data[i].tempName = data[i].name;
var hasDutyDept = false;
var hasDutyUser = false;
if (data[i].dutyDeptName != undefined && data[i].dutyDeptName != '') {
hasDutyDept = true;
}
if (data[i].dutyUserName != undefined && data[i].dutyUserName != '') {
hasDutyUser = true;
}
if (hasDutyDept && hasDutyUser) {
var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ' ' + varDutyUser + ':' + data[i].dutyUserName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
} else if (hasDutyDept) {
var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
} else if (hasDutyUser) {
var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
}
}
$("#treeDataDiv").empty();
$('#treeDataDiv').html('<ul id="tree" style="width: 100%;"></ul>');
initTree = awsui.tree.init($("#tree"), setting);
checkbox: false,
checkInherit: false,
dataModel : {
data: data
}
};
for (var i=0;i<data.length;i++){
// 流程名称连接责任部门和责任人
data[i].tempName = data[i].name;
var hasDutyDept = false;
var hasDutyUser = false;
if (data[i].dutyDeptName != undefined && data[i].dutyDeptName != '') {
hasDutyDept = true;
}
if (data[i].dutyUserName != undefined && data[i].dutyUserName != '') {
hasDutyUser = true;
}
if (hasDutyDept && hasDutyUser) {
var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ' ' + varDutyUser + ':' + data[i].dutyUserName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
} else if (hasDutyDept) {
var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
} else if (hasDutyUser) {
var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']';
data[i].name += '<span style="color:#ddd">&nbsp;&nbsp&nbsp' + tempText + '</span>';
}
}
$("#treeDataDiv").empty();
$('#treeDataDiv').html('<ul id="tree" style="width: 100%;"></ul>');
initTree = awsui.tree.init($("#tree"), setting);
}
});
}
@ -637,11 +637,11 @@ function getChangeResult(type) {
var notPublishData = [];
// 查询其他未版本
var param = {
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_not_publish_version_query",
teamId: teamId,
wsId: wsId,
uuid: node.id
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_not_publish_version_query",
teamId: teamId,
wsId: wsId,
uuid: node.id
}
$.ajax({
url : "./jd",
@ -657,19 +657,19 @@ function getChangeResult(type) {
var changeFileNewName = "";
var changeFileNewVersion = 1;
var data = {
category : node.category,
changeFileId : node.id,
// changeFileName : node.name,
changeFileName : node.tempName,
changedDesc : "",
changedFileIdNew : changeFileNewId,
changedFileNameNew : changeFileNewName,
fileVersion : node.version,
methodId : node.method,
targetCategory: node.category,
targetFileVersion: changeFileNewVersion,
targetFiles: notPublishData,
targetMethodId: node.method
category : node.category,
changeFileId : node.id,
// changeFileName : node.name,
changeFileName : node.tempName,
changedDesc : "",
changedFileIdNew : changeFileNewId,
changedFileNameNew : changeFileNewName,
fileVersion : node.version,
methodId : node.method,
targetCategory: node.category,
targetFileVersion: changeFileNewVersion,
targetFiles: notPublishData,
targetMethodId: node.method
}
clearData(type);// 清空
closeDialog();// 关闭窗口
@ -695,11 +695,11 @@ function getStopResult(type) {
if (node.category == 'process' && node.method != "process.evc" && node.method != 'default') {
// 获取流程手册id
var param = {
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_query",
teamId: teamId,
wsId: wsId,
uuid: node.id
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_query",
teamId: teamId,
wsId: wsId,
uuid: node.id
}
$.ajax({
url : "./jd",
@ -713,14 +713,14 @@ function getStopResult(type) {
});
}
var data = {
category : node.category,
fileVersion : node.version,
methodId : node.method,
stopDesc : "",
stopFileId : node.id,
// stopFileName : node.name,
stopFileName : node.tempName,
taskId : taskId
category : node.category,
fileVersion : node.version,
methodId : node.method,
stopDesc : "",
stopFileId : node.id,
// stopFileName : node.name,
stopFileName : node.tempName,
taskId : taskId
}
clearData(type);// 清空
closeDialog();// 关闭窗口
@ -731,11 +731,11 @@ function getStopResult(type) {
function createReport(category, method, uuid, taskId) {
if (category == 'process' && method != "process.evc" && method != 'default') {
var param = {
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_create",
teamId: teamId,
wsId: wsId,
uuid: uuid
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_create",
teamId: teamId,
wsId: wsId,
uuid: uuid
}
$.ajax({
url : "./jd",
@ -745,7 +745,7 @@ function createReport(category, method, uuid, taskId) {
data : param,
success : function(r) {
if (r.result == 'ok') {
taskId = r.data.taskId;
taskId = r.data.taskId;
}
}
});
@ -772,41 +772,41 @@ function closeDialog() {
function openReportFile(taskId) {
$.simpleAlert("文件正在处理", "loading");
awsui.ajax.request({
type: "POST",
url: "./jd?sid=" + sid + "&cmd=com.actionsoft.apps.coe.pal.publisher_publish_output_file_open",
data: {taskId: taskId},
ok: function(msg) {
$.simpleAlert("close");
var url = msg.data.url;
if (msg.data.noSupport) {
window.location.href = url;
} else {
window.open(url);
}
},
err: function(msg) {
$.simpleAlert("close");
}
});
type: "POST",
url: "./jd?sid=" + sid + "&cmd=com.actionsoft.apps.coe.pal.publisher_publish_output_file_open",
data: {taskId: taskId},
ok: function(msg) {
$.simpleAlert("close");
var url = msg.data.url;
if (msg.data.noSupport) {
window.location.href = url;
} else {
window.open(url);
}
},
err: function(msg) {
$.simpleAlert("close");
}
});
}
// 点击checkbox
function onCheckboxClickEvent(boItemName, $checkbox, val) {
var isCheck = !$checkbox.closest('div').hasClass('checked');
if (val == '流程文件发布') {
dealPublishCheck(isCheck, 'new');
} else if (val == '流程文件版本更新') {
dealPublishCheck(isCheck, 'change');
} else if (val == '流程文件废止') {
dealPublishCheck(isCheck, 'stop');
}
var isCheck = !$checkbox.closest('div').hasClass('checked');
if (val == '流程文件发布') {
dealPublishCheck(isCheck, 'new');
} else if (val == '流程文件版本更新') {
dealPublishCheck(isCheck, 'change');
} else if (val == '流程文件废止') {
dealPublishCheck(isCheck, 'stop');
}
}
// 主体内容显示与隐藏
function dealPublishCheck(isCheck, type) {
if (type == 'new') {
clearData(type); //清空
isCheck ? $('#publisher_new_tr').show() : $('#publisher_new_tr').hide();
isCheck ? $('#publisher_new_tr').show() : $('#publisher_new_tr').hide();
} else if (type == 'change') {
clearData(type);
isCheck ? $('#publisher_change_tr').show() : $('#publisher_change_tr').hide();
@ -821,9 +821,9 @@ function dealPublishCheck(isCheck, type) {
// 初始化宽度
function initWidth(isCheck, type) {
if (type == 'new' && isCheck) {
$('#publisher_new_file_name').width($('#publisher_new_file_name').closest('td').width());
$('#publisher_new_file_name').children('span.file_name').width($('#publisher_new_file_name').width() - 20);
$('#publisher_new_desc').width('86%');
$('#publisher_new_file_name').width($('#publisher_new_file_name').closest('td').width());
$('#publisher_new_file_name').children('span.file_name').width($('#publisher_new_file_name').width() - 20);
$('#publisher_new_desc').width('86%');
}
if (type == 'change' && isCheck) {
$('#publisher_change_source_file_name').width($('#publisher_change_source_file_name').closest('td').width());
@ -833,7 +833,7 @@ function initWidth(isCheck, type) {
}
if (type == 'stop' && isCheck) {
$('#publisher_stop_file_name').width($('#publisher_stop_file_name').closest('td').width());
$('#publisher_stop_file_name').children('span.file_name').width($('#publisher_stop_file_name').width() - 20);
$('#publisher_stop_file_name').children('span.file_name').width($('#publisher_stop_file_name').width() - 20);
$('#publisher_stop_desc').width('86%');
}
}
@ -915,34 +915,34 @@ function formSave(isTransact){
var publishStopFileId = $('#publisher_stop_file_id').val();
var publishStopTaskId = $('#publisher_stop_report_id').text();
var publishStopDesc = $('#publisher_stop_desc').val();
var saveData = {};
var newObj = {
uuid : publishNewFileId,
taskId : publishNewTaskId,
desc : publishNewDesc
uuid : publishNewFileId,
taskId : publishNewTaskId,
desc : publishNewDesc
};
var changeObj = {
uuid : publishChangeFileId,
targetId : publishChangeTargetFileId,
taskId : publishChangeTaskId,
desc : publishChangeDesc
uuid : publishChangeFileId,
targetId : publishChangeTargetFileId,
taskId : publishChangeTaskId,
desc : publishChangeDesc
};
var stopObj = {
uuid : publishStopFileId,
taskId : publishStopTaskId,
desc : publishStopDesc
uuid : publishStopFileId,
taskId : publishStopTaskId,
desc : publishStopDesc
};
saveData.newObj = newObj;
saveData.changeObj = changeObj;
saveData.stopObj = stopObj;
var param = {
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_save_before",
teamId: teamId,
wsId: wsId,
processInstId : processInstId,
data: JSON.stringify(saveData)
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_save_before",
teamId: teamId,
wsId: wsId,
processInstId : processInstId,
data: JSON.stringify(saveData)
}
var flag = false;
@ -957,11 +957,11 @@ function formSave(isTransact){
if (r.result == 'error') {
flag = true;
var data = r.data.data;
var name = data.name + ' V' + data.version + '.0';
var name = data.name + ' V' + data.version;
console.log(data);
tempName = name;
}
},
},
error : function(XMLHttpRequest, textStatus, errorThrown) {
$.simpleAlert("表单信息错误,请联系管理员!", 'error');
}
@ -998,11 +998,11 @@ function initPublishSearch(type) {
searchProcess(type);
}
});
$("#autoSearchProcessDiv").off("mouseenter").on("mouseenter", function () {
$('#autoSearchProcessDiv').show();
}).off("autoSearchProcessDiv").on("mouseleave", function () {
$('#autoSearchProcessDiv').hide();
});
$("#autoSearchProcessDiv").off("mouseenter").on("mouseenter", function () {
$('#autoSearchProcessDiv').show();
}).off("autoSearchProcessDiv").on("mouseleave", function () {
$('#autoSearchProcessDiv').hide();
});
}
// 搜索
@ -1012,107 +1012,107 @@ function searchProcess(type) {
return;
}
var name = $("#processName").val().trim().toLowerCase();
var html = '';
var html = '';
//先向后台请求完整tree数据
if (type == 'new') {
var data = getAllTreeData();
for (var i = 0; i < data.length; i++) {
var text = data[i].name;
if (text.indexOf(name) > -1) {
var id = data[i].id;
var path = getSearchTreeNodePath(data[i], text, data, 1);
var pids = getSearchTreeNodePath(data[i], text, data, 2);
html += '<div class="auto_divcontenr" onmouseover="auto_move($(this))" onmouseout="auto_out($(this)) " onclick="auto_click($(this))">';
html += '<span plId="' + id + '" data-type="' + type +'" data-pids="' + pids + '" style="cursor:pointer; display:inline-block;margin-left:5px;">';
html += '<div style="height:100%">' + path + '</div>';
html += '<div style="float:right;height:100%"></div>';
html += '</span>';
html += '</div>';
}
}
var data = getAllTreeData();
for (var i = 0; i < data.length; i++) {
var text = data[i].name;
if (text.indexOf(name) > -1) {
var id = data[i].id;
var path = getSearchTreeNodePath(data[i], text, data, 1);
var pids = getSearchTreeNodePath(data[i], text, data, 2);
html += '<div class="auto_divcontenr" onmouseover="auto_move($(this))" onmouseout="auto_out($(this)) " onclick="auto_click($(this))">';
html += '<span plId="' + id + '" data-type="' + type +'" data-pids="' + pids + '" style="cursor:pointer; display:inline-block;margin-left:5px;">';
html += '<div style="height:100%">' + path + '</div>';
html += '<div style="float:right;height:100%"></div>';
html += '</span>';
html += '</div>';
}
}
} else {
$('span.tree-items-title').each(function() {
var text = $(this).text().toLowerCase();
if (text.indexOf(name) > -1) {// found
var id = $(this).attr('id').substring(10);
if (id.length <= 36) {
var node = initTree.getNodeById(id);
var path = getFilePath(node, text);
html += '<div class="auto_divcontenr" onmouseover="auto_move($(this))" onmouseout="auto_out($(this)) " onclick="auto_click($(this))">';
html += '<span plId="' + id + '" style="cursor:pointer; display:inline-block;margin-left:5px;">';
html += '<div style="height:100%">' + path + '</div>';
html += '<div style="float:right;height:100%"></div>';
html += '</span>';
html += '</div>';
}
}
});
$('span.tree-items-title').each(function() {
var text = $(this).text().toLowerCase();
if (text.indexOf(name) > -1) {// found
var id = $(this).attr('id').substring(10);
if (id.length <= 36) {
var node = initTree.getNodeById(id);
var path = getFilePath(node, text);
html += '<div class="auto_divcontenr" onmouseover="auto_move($(this))" onmouseout="auto_out($(this)) " onclick="auto_click($(this))">';
html += '<span plId="' + id + '" style="cursor:pointer; display:inline-block;margin-left:5px;">';
html += '<div style="height:100%">' + path + '</div>';
html += '<div style="float:right;height:100%"></div>';
html += '</span>';
html += '</div>';
}
}
});
}
if (html.length > 0) {
$("#autoSearchProcessDiv").html(html).show();
$("#autoSearchProcessDiv").html(html).show();
// $("#processName").val('');
}
}
function getAllTreeData() {
var param = {
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query_search",
teamId: teamId,
wsId: wsId
}
var data;
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
data : param,
async : false,
success : function(d) {
data = d;
}
});
return data;
var param = {
sid : sid,
cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query_search",
teamId: teamId,
wsId: wsId
}
var data;
$.ajax({
url : "./jd",
type : "POST",
dataType : "JSON",
data : param,
async : false,
success : function(d) {
data = d;
}
});
return data;
}
function getSearchTreeNodePath(node, text, data, isPid) {
var name = text;
var pids = node.pid;
do {
var p = undefined;
for (var i = 0; i < data.length; i++) {
if (data[i].id == node.pid) {
p = data[i];
break;
}
}
if (p == undefined) {
if (node.pid == "process") {
name = "流程>" + name;
}
if (node.pid == "org") {
name = "组织>" + name;
}
if (node.pid == "data") {
name = "数据>" + name;
}
if (node.pid == "itsystem") {
name = "IT系统>" + name;
}
if (node.pid == "control") {
name = "控制>" + name;
}
break;
}
name = p.name + ">" + name;
pids = p.pid + "." + pids;
node = p;
} while(true);
if (isPid == 2) {
return pids;
} else {
return name;
}
var name = text;
var pids = node.pid;
do {
var p = undefined;
for (var i = 0; i < data.length; i++) {
if (data[i].id == node.pid) {
p = data[i];
break;
}
}
if (p == undefined) {
if (node.pid == "process") {
name = "流程>" + name;
}
if (node.pid == "org") {
name = "组织>" + name;
}
if (node.pid == "data") {
name = "数据>" + name;
}
if (node.pid == "itsystem") {
name = "IT系统>" + name;
}
if (node.pid == "control") {
name = "控制>" + name;
}
break;
}
name = p.name + ">" + name;
pids = p.pid + "." + pids;
node = p;
} while(true);
if (isPid == 2) {
return pids;
} else {
return name;
}
}
function getFilePath(node, text) {
@ -1141,16 +1141,16 @@ function auto_click(obj, type) {
var type = obj.find("span").data("type");
var dom = initTree.getNodeDomById(plId)
if (type == 'new') {
//预先去加载initTree
var pids = obj.find("span").data("pids");
var pidList = pids.split('.');
for (var i = 0; i < pidList.length; i++) {
loadNewData(pidList[i]);
dom = initTree.getNodeDomById(pidList[i]);
initTree.expandNodes(dom, true, true, true);
}
//预先去加载initTree
var pids = obj.find("span").data("pids");
var pidList = pids.split('.');
for (var i = 0; i < pidList.length; i++) {
loadNewData(pidList[i]);
dom = initTree.getNodeDomById(pidList[i]);
initTree.expandNodes(dom, true, true, true);
}
} else {
initTree.expandNodes(dom, true, true, true);
initTree.expandNodes(dom, true, true, true);
}
// 偏移至可见区域
var ele = document.getElementById('tree_span_' + plId);
@ -1182,7 +1182,7 @@ function listenCloseEvent() {
}
});
}
//在弹出“是否离开”的提示框后选择离开则触发onunload事件
window.onunload = function(){
// 查询bo表数据是否保存过未保存过离开页面则删除该实例