发布流程大文件,生成文档样式优化
This commit is contained in:
parent
9941779e02
commit
403277ecef
@ -646,6 +646,14 @@ function queryapprove(){
|
||||
|
||||
}
|
||||
|
||||
var adaptregionname = r.data.ADAPT_REGION_NAME;
|
||||
if(adaptregionname!=''){
|
||||
ui("ADAPT_REGION_NAME",adaptregionname);
|
||||
}
|
||||
var applicableproduct = r.data.APPLICABLE_PRODUCT;
|
||||
if(applicableproduct!=''){
|
||||
ui("APPLICABLE_PRODUCT",applicableproduct);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1013,7 +1021,7 @@ function addProcess(type) {
|
||||
}
|
||||
// 生成流程手册taskId
|
||||
if (temps.length > 0) {
|
||||
temps = createBatchReport(temps, getReportCreateTime());
|
||||
temps = createBatchReport(temps, getReportCreateTime(),type);
|
||||
// 更新到最新数据中
|
||||
for (var i = 0; i < temps.length; i++) {
|
||||
temps[i].publishDesc = desc;
|
||||
@ -1754,6 +1762,56 @@ function createReport(category, method, uuid, taskId) {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
// 异步创建流程手册 by yujh
|
||||
function createReportAsync(category, method, uuid, taskId,object,obj,type) {
|
||||
if ((method == 'control.policy' || method == 'data.form' || method.indexOf('process.') > -1) && method != 'default') {
|
||||
var param = {
|
||||
sid : sid,
|
||||
cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_create",
|
||||
teamId: teamId,
|
||||
wsId: wsId,
|
||||
uuid: uuid
|
||||
}
|
||||
$.ajax({
|
||||
url : "./jd",
|
||||
type : "POST",
|
||||
dataType : "JSON",
|
||||
async : true,
|
||||
data : param,
|
||||
success : function(r) {
|
||||
$.simpleAlert('文件创建成功');
|
||||
if (r.result == 'ok') {
|
||||
//更新阻断参数
|
||||
bigFileCheck = false;
|
||||
//更新数据记录
|
||||
if (type == 'new') {
|
||||
var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category, method);
|
||||
$(object).text(fileName);
|
||||
for (var i = 0; i < newTemp.length; i++) {
|
||||
if (newTemp[i].publishFileId == uuid) {
|
||||
newTemp[i].taskId = taskId;
|
||||
}
|
||||
}
|
||||
} else if (type == 'change') {
|
||||
var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '-' + getOutputName(category, method);
|
||||
$(object).text(targetFileName);
|
||||
for (var i = 0; i < changeTemp.length; i++) {
|
||||
if (changeTemp[i].changedFileIdNew == uuid) {
|
||||
changeTemp[i].taskId = taskId;
|
||||
}
|
||||
}
|
||||
}
|
||||
$(object).prev().remove();//先删除加载图表元素
|
||||
$(object).after('<span id="download_output_' + uuid + '" style="cursor: pointer;" onclick="downloadReport(\'' + uuid + '\',\'' + taskId + '\')"><i class="awsui-iconfont" style="font-size: 12px;"></i></span>');
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.simpleAlert('不支持创建手册');
|
||||
}
|
||||
return taskId;
|
||||
}
|
||||
|
||||
// 批量创建流程手册
|
||||
function createBatchReport(data, createTime) {
|
||||
var ids = [];
|
||||
@ -1847,8 +1905,10 @@ function getOutputName(category, method) {
|
||||
}
|
||||
|
||||
//单个流程立即创建流程手册
|
||||
//增加大文件异步处理逻辑 by yujh
|
||||
function quickCreateReport(obj, object, type) {
|
||||
var taskId;
|
||||
var bigFile =false;
|
||||
var category = obj.category;
|
||||
var method = obj.methodId;
|
||||
var uuid = '';
|
||||
@ -1857,12 +1917,47 @@ function quickCreateReport(obj, object, type) {
|
||||
} else if (type == 'change') {
|
||||
uuid = obj.changedFileIdNew;
|
||||
}
|
||||
//先查询正文大小,如果超过设置值,则弹框提醒逻辑修改
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./jd?sid="
|
||||
+ sid
|
||||
+ "&cmd=com.awspaas.user.apps.yiliwps.checkFileSize",
|
||||
data: {
|
||||
palId: uuid
|
||||
},
|
||||
async : false,
|
||||
success: function (r) {
|
||||
debugger;
|
||||
if (r.result == "ok") {
|
||||
bigFile = r.data.state;
|
||||
}
|
||||
}
|
||||
});
|
||||
if(bigFile){
|
||||
//设置保存、提交阻断参数
|
||||
bigFileCheck = true;
|
||||
//修改 立即创建文字为创建中请稍后
|
||||
//异步执行
|
||||
$(object).text("正在创建中,请稍后");
|
||||
$(object).before('<div class="spinner" style="\n' +
|
||||
' margin-top: 4px;\n' +
|
||||
' border: 4px solid rgba(0, 0, 0, 0.1);\n' +
|
||||
' border-left-color: #007bff;\n' +
|
||||
' border-radius: 50%;\n' +
|
||||
' width: 15px;\n' +
|
||||
' height: 15px;\n' +
|
||||
' animation: spin 1s linear infinite;\n' +
|
||||
' display: inline-block;\n' +
|
||||
'"></div>');
|
||||
taskId = createReportAsync(category, method, uuid, taskId,object,obj,type);
|
||||
//
|
||||
}else{
|
||||
$.simpleAlert("正在创建", "loading");
|
||||
taskId = createReport(category, method, uuid, taskId);
|
||||
$.simpleAlert("close");
|
||||
//打开流程手册
|
||||
$(object).attr('onclick', "openReportFile(\'" + taskId + "\')");
|
||||
|
||||
//三员管理下,立即创建
|
||||
if(isHighSecurity){
|
||||
//更新数据记录
|
||||
@ -1893,7 +1988,9 @@ function quickCreateReport(obj, object, type) {
|
||||
}
|
||||
}
|
||||
}
|
||||
$(object).parent().append('<span id="download_output_' + uuid + '" style="cursor: pointer;" onclick="downloadReport(\'' + uuid + '\',\'' + taskId + '\')"><i class="awsui-iconfont" style="font-size: 12px;"></i></span>');
|
||||
$(object).after('<span id="download_output_' + uuid + '" style="cursor: pointer;" onclick="downloadReport(\'' + uuid + '\',\'' + taskId + '\')"><i class="awsui-iconfont" style="font-size: 12px;"></i></span>');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 清空树结构
|
||||
@ -2301,6 +2398,10 @@ function saveFormData(type) {
|
||||
|
||||
// 点击办理时的校验+保存字表
|
||||
function formSave(isTransact){
|
||||
if(bigFileCheck){
|
||||
$.simpleAlert("手册正在创建中,暂不支持操作");
|
||||
return false;
|
||||
}
|
||||
var userTaskDefName = $("#userTaskDefName").val();
|
||||
if(userTaskDefName == '发起人'){
|
||||
if(isTransact==true){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user