发布流程大文件,生成文档样式优化
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
|
// 生成流程手册taskId
|
||||||
if (temps.length > 0) {
|
if (temps.length > 0) {
|
||||||
temps = createBatchReport(temps, getReportCreateTime());
|
temps = createBatchReport(temps, getReportCreateTime(),type);
|
||||||
// 更新到最新数据中
|
// 更新到最新数据中
|
||||||
for (var i = 0; i < temps.length; i++) {
|
for (var i = 0; i < temps.length; i++) {
|
||||||
temps[i].publishDesc = desc;
|
temps[i].publishDesc = desc;
|
||||||
@ -1754,6 +1762,56 @@ function createReport(category, method, uuid, taskId) {
|
|||||||
return 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) {
|
function createBatchReport(data, createTime) {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
@ -1847,8 +1905,10 @@ function getOutputName(category, method) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//单个流程立即创建流程手册
|
//单个流程立即创建流程手册
|
||||||
|
//增加大文件异步处理逻辑 by yujh
|
||||||
function quickCreateReport(obj, object, type) {
|
function quickCreateReport(obj, object, type) {
|
||||||
var taskId;
|
var taskId;
|
||||||
|
var bigFile =false;
|
||||||
var category = obj.category;
|
var category = obj.category;
|
||||||
var method = obj.methodId;
|
var method = obj.methodId;
|
||||||
var uuid = '';
|
var uuid = '';
|
||||||
@ -1857,43 +1917,80 @@ function quickCreateReport(obj, object, type) {
|
|||||||
} else if (type == 'change') {
|
} else if (type == 'change') {
|
||||||
uuid = obj.changedFileIdNew;
|
uuid = obj.changedFileIdNew;
|
||||||
}
|
}
|
||||||
$.simpleAlert("正在创建", "loading");
|
//先查询正文大小,如果超过设置值,则弹框提醒逻辑修改
|
||||||
taskId = createReport(category, method, uuid, taskId);
|
$.ajax({
|
||||||
$.simpleAlert("close");
|
type: "POST",
|
||||||
//打开流程手册
|
url: "./jd?sid="
|
||||||
$(object).attr('onclick', "openReportFile(\'" + taskId + "\')");
|
+ sid
|
||||||
|
+ "&cmd=com.awspaas.user.apps.yiliwps.checkFileSize",
|
||||||
//三员管理下,立即创建
|
data: {
|
||||||
if(isHighSecurity){
|
palId: uuid
|
||||||
//更新数据记录
|
},
|
||||||
if (type == 'new') {
|
async : false,
|
||||||
var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category, method);
|
success: function (r) {
|
||||||
$(object).text(fileName);
|
debugger;
|
||||||
} else if (type == 'change') {
|
if (r.result == "ok") {
|
||||||
var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '-' + getOutputName(category, method);
|
bigFile = r.data.state;
|
||||||
$(object).text(targetFileName);
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
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{
|
}else{
|
||||||
//更新数据记录
|
$.simpleAlert("正在创建", "loading");
|
||||||
if (type == 'new') {
|
taskId = createReport(category, method, uuid, taskId);
|
||||||
var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category, method);
|
$.simpleAlert("close");
|
||||||
$(object).text(fileName);
|
//打开流程手册
|
||||||
for (var i = 0; i < newTemp.length; i++) {
|
$(object).attr('onclick', "openReportFile(\'" + taskId + "\')");
|
||||||
if (newTemp[i].publishFileId == uuid) {
|
//三员管理下,立即创建
|
||||||
newTemp[i].taskId = taskId;
|
if(isHighSecurity){
|
||||||
}
|
//更新数据记录
|
||||||
|
if (type == 'new') {
|
||||||
|
var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category, method);
|
||||||
|
$(object).text(fileName);
|
||||||
|
} else if (type == 'change') {
|
||||||
|
var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '-' + getOutputName(category, method);
|
||||||
|
$(object).text(targetFileName);
|
||||||
}
|
}
|
||||||
} else if (type == 'change') {
|
}else{
|
||||||
var targetFileName = obj.changedFileNameNew + ' V' + obj.targetFileVersion + '-' + getOutputName(category, method);
|
//更新数据记录
|
||||||
$(object).text(targetFileName);
|
if (type == 'new') {
|
||||||
for (var i = 0; i < changeTemp.length; i++) {
|
var fileName = obj.publishFileName + ' V' + obj.fileVersion + '-' + getOutputName(category, method);
|
||||||
if (changeTemp[i].changedFileIdNew == uuid) {
|
$(object).text(fileName);
|
||||||
changeTemp[i].taskId = taskId;
|
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).after('<span id="download_output_' + uuid + '" style="cursor: pointer;" onclick="downloadReport(\'' + uuid + '\',\'' + taskId + '\')"><i class="awsui-iconfont" style="font-size: 12px;"></i></span>');
|
||||||
}
|
}
|
||||||
$(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>');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清空树结构
|
// 清空树结构
|
||||||
@ -2301,6 +2398,10 @@ function saveFormData(type) {
|
|||||||
|
|
||||||
// 点击办理时的校验+保存字表
|
// 点击办理时的校验+保存字表
|
||||||
function formSave(isTransact){
|
function formSave(isTransact){
|
||||||
|
if(bigFileCheck){
|
||||||
|
$.simpleAlert("手册正在创建中,暂不支持操作");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
var userTaskDefName = $("#userTaskDefName").val();
|
var userTaskDefName = $("#userTaskDefName").val();
|
||||||
if(userTaskDefName == '发起人'){
|
if(userTaskDefName == '发起人'){
|
||||||
if(isTransact==true){
|
if(isTransact==true){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user