|
@ -8,6 +8,8 @@
|
|
|
|
|
|
/* *************************** 模块初始化 ***************************** */
|
|
|
var fileType;
|
|
|
var oldFileId;
|
|
|
var oldFlowClassList = [];
|
|
|
var editorFlow = {
|
|
|
//form
|
|
|
actionUrl: "${contextRoot}/flow/addFlow",
|
|
@ -35,7 +37,13 @@
|
|
|
} else {
|
|
|
iconUrl = "${model.chart}";
|
|
|
}
|
|
|
|
|
|
//旧的流程图ID
|
|
|
oldFileId = iconUrl;
|
|
|
<%--var flowArray = ${flowClass};--%>
|
|
|
<%--for(var index in flowArray){--%>
|
|
|
<%--var classPath = flowArray[index]['classPath'];--%>
|
|
|
<%--oldFlowClassList.push(classPath);--%>
|
|
|
<%--}--%>
|
|
|
|
|
|
var valid = "${model.valid}";
|
|
|
liger.get("valid").selectValue(valid);
|
|
@ -264,6 +272,8 @@
|
|
|
formObj.find("input[type=text]").attr("data-id", data)//设置已上传的文件的ID
|
|
|
formObj.find("input[type=text]").val(data)//设置已上传的文件的ID
|
|
|
formObj.closest("div").find("span").html("重新导入<i></i>");
|
|
|
// 上传成功后删除旧的
|
|
|
_deleteFileAfterUpdate(oldFileId);
|
|
|
},
|
|
|
error: function processJson(data) {
|
|
|
debugger
|
|
@ -276,7 +286,6 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
/* ===================== 文件预览 动态绑定事件========================== */
|
|
|
|
|
|
/* =====================上传文件 原数据绑定=========================== */
|
|
@ -350,7 +359,7 @@
|
|
|
html += ' <div class="m-form-group"><label>源代码' + index + ' : </label><div class="m-form-control">';
|
|
|
html += ' <input type="text" name="isUpdate" id="isUpdate' + index + '" class="isUpdate" hidden="hidden"/>';
|
|
|
|
|
|
html += ' <input type="text" id="classPath' + index + '" value="' + data.classPath + '" name="classPath" class="l-textbox btnGrayUp" style="width: 144px;" placeholder="点击选择源代码文件" readonly="readonly" data-id="">' +
|
|
|
html += ' <input type="text" id="classPath' + index + '" value="' + data.classPath + '" data-oldFile="'+data.classPath+'" name="classPath" class="l-textbox btnGrayUp" style="width: 144px;" placeholder="点击选择源代码文件" readonly="readonly" data-id="">' +
|
|
|
' <div style="float: right;">' +
|
|
|
' <div class="l-button l-button-no btnGrayDo' + index + '" data-id="' + index + '">' +
|
|
|
' <span style="background-color: rgb(240, 240, 240);">导入</span> </div>' +
|
|
@ -412,7 +421,14 @@
|
|
|
formsay.attr("class", "say true").html("上传成功");
|
|
|
formObj.find("input[type=text]").filter(".btnGrayUp").attr("data-id", data.data.path)//设置已上传的文件的ID
|
|
|
var inputVal = formObj.closest("div").find("input[type=text]").filter(".btnGrayUp");
|
|
|
// 设置值之前删除旧的
|
|
|
var oldFileId = $(inputVal).attr("data-oldFile");
|
|
|
if(oldFileId){
|
|
|
_deleteFileAfterUpdate(oldFileId);
|
|
|
}
|
|
|
// 设置值之前删除旧的
|
|
|
inputVal.val(data.data.path);
|
|
|
$(inputVal).attr("data-oldFile", data.data.path);
|
|
|
$("#packageName"+index).val(data.data.package);
|
|
|
$("#className"+index).val(data.data.class);
|
|
|
formObj.closest("div").find("span").html("重新导入<i></i>");
|
|
@ -421,7 +437,6 @@
|
|
|
}else{
|
|
|
$.ligerDialog.error("上传格式有问题");
|
|
|
Obj.css("background","#ebebeb").html("导入");
|
|
|
|
|
|
}
|
|
|
},
|
|
|
error: function processJson(data) {
|
|
@ -472,6 +487,22 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//删除旧文件
|
|
|
function _deleteFileAfterUpdate(fileId){
|
|
|
if(null == fileId || fileId.length == 0){
|
|
|
return;
|
|
|
}
|
|
|
var url = "${dfs}/" + fileId;
|
|
|
$.ajax({
|
|
|
url: url,
|
|
|
type: 'DELETE',
|
|
|
async: false,
|
|
|
success: function(){
|
|
|
console.log("旧文件删除成功");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$(function () {
|
|
|
editorFlow.init();
|
|
|
});
|