/*
* control.show(id);
*属性设置框
*/
var control={
//临时AJAX数据
close:true,
closeButton:"
",
temp:null,
setFieldData:null,
$dom:$("#control"),
/// 增加,读取分支字典下拉列表所选字典的 playDesc。lin
// 为设置分支属性页面里的 "名称" 录入框的默认值
rdDecDictPlayDesc:function(selVal) {
for (var i= 0; i < this.temp.length; i ++) {
if (selVal == this.temp[i].name) {
return this.temp[i].playDesc;
}
}
return "";
},
///
/// 再增加,刷新 "分支"、"并行"、"可变" 图标样式。Lin
wrDecStyle:function(selIdx, selval) {
var dom = demo.$nodeDom[this.json.id];
var tableB = dom.children("table").children("tbody").children("tr").children("td").children("b");
if (selIdx == 0) {
// ",
dragDom:function(dom){
var e=window.event;
if(e.target.nodeName=="INPUT"||e.target.nodeName=="SELECT"){return;}
// 获取鼠标初始位置
var lastmouseX=e.pageX
var lastmouseY=e.pageY
document.onmousemove=function(){
var e=window.event
// 获取最新鼠标位置
var aa=e.pageX
var bb=e.pageY
// console.log("xxx "+aa)
var left=parseInt(dom.style.left)
var top=parseInt(dom.style.top)
// 根据鼠标新旧位置差值 移动
dom.style.left=left+e.pageX-lastmouseX+"px"
dom.style.top=top+e.pageY-lastmouseY+"px"
// 保存最新鼠标位置
lastmouseX=aa
lastmouseY=bb
}
document.onmouseup=function(dom){
this.onmousemove=null
}
},
// 保存按钮
saveButton:"",
// 保存程序
save:function(){
// var data=this.$dom[0].getElementsByTagName("input")
//
// for (var i=0;i0){
var aa={"name":"setField","desc":"改变对象属性值","type":"agree",param:{}};
for(var i=0;i 改为 。Lin
transition_name = this.temp[i].decVal // .transition_name。Lin
*/ transition_name = this.temp[i].forkValList
break;
}
}
//检查checkedbox
if (document.getElementById("foreachCheckBox").checked) {
this.json.type = "foreach";
this.json.realtype = "foreach"
this.json.condition_name = transition_name;
this.json.key = option;
//不勾选的时候
} else {
// 改变分支类型:空:并行、非空:分支
if (option == "") {
this.json.type = "fork"; // 英文用得不好,fork = 分叉。Lin
this.json.realtype = "fork"
this.json.condition_name = transition_name;
removeDecisionLine(this.json.id)
} else {
this.json.type = "node";
this.json.realtype = "decision"
//条件为:(搜索到分支条件|| 用户选择为空)&&用户选中值和原本值不同
if ((transition_name.length > 0 || option == "") && (option != this.json.key)) {
removeDecisionLine(this.json.id)
//设置分支条件
this.json.condition_name = transition_name;
initDecisionLine($("#"+this.json.id))
}
}
this.json.key = option;
}
if (this.json.name == "分支" || this.json.name == "并行" || this.json.name == "可变") { // == "可变并行")。Lin
if (this.json.realtype == "decision")
this.json.name="分支"
if (this.json.realtype == "fork")
this.json.name="并行"
if (this.json.realtype == "foreach")
this.json.name="可变" // ="可变并行"。Lin
}
/// 增加。刷新 "分支"、"并行"、"可变" style。Lin
if (this.json.realtype == "decision")
control.wrDecStyle(index, option);
else if (this.json.realtype == "fork")
control.wrDecStyle(index, "并行");
else
control.wrDecStyle(index, "可变");
///
}
if(this.json.realtype=="subprocess"){
}
if (this.json.realtype == "join") {
//设置分支条件
var confirmthis= this.$dom[0].querySelector("[name=confirmthis]").checked;
this.json.confirmthis = confirmthis? "1" : "0"
this.json.service_dest = "joinSure"; // = "sureJoin" < "env_confirm"。Lin
this.json.service_name = "sureJoin"; // = "env_confirm"。Lin
if (confirmthis) {
this.json.assignee = this.$dom[0].querySelector("select[name=assignee]").value;
if (this.json.assignee == "zdbm")
this.json.scopeParam = this.$dom[0].querySelector("select[name=scopeParam]").value;
this.json.taskChain = 0;
this.json.service_dest = "joinSure"; // = "sureJoin" < "env_confirm"。Lin
this.json.service_name = "sureJoin"; // = "env_confirm"。Lin
this.json.condition_name = []
var addcondition=true
for (var key in demo.$lineData) {
if (demo.$lineData[key].from == this.json.id)
addcondition = false;
}
if (addcondition)
this.json.condition_name = ["补发",""]
removeDecisionLine(this.json.id);
initDecisionLine($("#"+this.json.id));
}
}
demo.setName(this.json.id,this.json.name,"node")
this.hidden()
},
json:null,
html:"",
// 隐藏设置框
hidden:function(){
this.$dom.fadeOut(200)
this.close=true
},
// 显示设置框-
show:function(nodeData){
this.$dom=$("#control");
// 清除缓存文档
this.$dom.html("")
this.json=nodeData;
// 获取主要信息
this.$dom.append(this.getMain(nodeData.realtype))
// 闪亮出现设置框
this.$dom.fadeIn(0)
this.html="";
},
// 主体信息
getMain:function(nodeType){
switch (nodeType){
case "task":
this.switchToTask();
break;
case "transmit":
this.switchToTransmit();
break;
case "decision":
this.switchToDecision();
break;
case "fork":
this.switchToFork();
break;
case "end":
this.switchToEnd();
break;
case "foreach":
this.switchToForeach();
break;
case "subprocess":
this.switchToSubprocess();
break;
case "start":
this.switchToStart();
break;
case "join":
this.switchToJoin();
break;
default :
this.html="不用设置";
}
this.receiveData()
return this.html
},
//判断字典是否使用部门内审核
useTaskChain:function(assignee){
/* 重写,改为根据 -1){ // 增加非空判断 assignee &&。Lin
return true;
}
*/
var dictList = this.temp.dictionaryData;
for (var i=0;i"+cc.desc+" | | "
}
if(this.setFieldData){
for(var i=0;i";
var currentValue;
if(json_setFieldData){
currentValue=json_setFieldData.param[f.field];
}
for(var j=0;j"+f.codebook[j][1]+"";
}
finishServiceStr+="| "+f.desc+" | |
";
}
}
this.html=this.html.replace("$finishService",finishServiceStr);
}
//task
if(this.json.realtype=="task"||this.json.realtype=="transmit"||this.json.realtype=="join"){
/*
*/
/* 再改,去掉 thisAppName。Lin
var url=$("#scopeDictionaryURL")[0].value + '&thisAppName=' + document.getElementById("thisAppName").value;
*/ var url=$("#scopeDictionaryURL")[0].value;
var fileName=$("#fileName").val()
// $.post(url,{
// 'fileName':fileName
// },function(data,status){
// var result=new DOMParser().parseFromString(data,"text/html")
// window.self.control.temp=result
// })
$.ajax({
type:"post",
url:url,
data:{'fileName':fileName},
async:false,
dataType: "json", // 再增加,不通过 lc_scopeDictionary.jsp 中转。Lin
success:function(data){
/* 再改,不通过 lc_scopeDictionary.jsp 中转。Lin
var result=new DOMParser().parseFromString(data,"text/html")
window.self.control.temp=result
*/ window.self.control.temp = data;
}
});
var aa=this.json.assignee;
if(aa)
this.json.assignee=aa.replace(/@env.|@/g,"")
console.log(this.temp)
if(this.json.assignee=="zdbm"){ // =="指定部门")。Lin
this.html=this.html.replace("$displayable","");
}
/* 再改,不通过 lc_scopeDictionary.jsp 中转。Lin
var bmList=eval( this.temp.getElementById("bmListData").value)
*/ var bmList = this.temp.bmListData;
var bm=this.buildingValue("TASK_scopeParam_option",bmList,this.json.scopeParam)
/* 再改,不通过 lc_scopeDictionary.jsp 中转。Lin
var optionsList=eval( this.temp.getElementById("dictionaryData").value);
*/ var optionsList = this.temp.dictionaryData;
var options=this.buildingValue("TASK_dictionary_option",optionsList,this.json.assignee)
var usesubprocessdisplay="none";
var usesubprocesscheck="";
var usesubprocessname="";
if(this.json.subprocess_key){
usesubprocessdisplay=""
usesubprocessname=this.json.subprocess_name;
if(this.json.usesubprocess==1){
usesubprocesscheck="checked"
}
}
this.html=this.html.replace("$rejectnodeoption",this.buildingValue("TASK_rejectnode_option"));
this.html=this.html.replace("$sfsxpsoption",this.buildingValue("TASK_sfsxps_option",[{name:"否",value:"0"},{name:"是",value:"1"}],this.json.sfsxps||0));
/// 增加 是否重做节点、是否执行节点。Lin
this.html=this.html.replace("$sfRedooption",this.buildingValue("TASK_sfRedo_option",[{name:"否",value:"0"},{name:"是",value:"1"}],this.json.sfRedo||0));
this.html=this.html.replace("$sfRunoption",this.buildingValue("TASK_sfRun_option",[{name:"否",value:"0"},{name:"是",value:"1"}],this.json.sfRun||0));
///
this.html=this.html.replace("$usesubprocessname",usesubprocessname)
this.html=this.html.replace("$usesubprocessdisplay",usesubprocessdisplay)
this.html=this.html.replace("$usesubprocesscheck",usesubprocesscheck)
if(this.json.confirmthis){
this.html=this.html.replace("$confirmthischecked","1"==this.json.confirmthis?"checked":"");
}
this.html=this.html.replace("$options",options)
this.html=this.html.replace("$bmList",bm);
var displayable=this.json.scopeParam?"":"none";
this.html=this.html.replace("$displayable",displayable);
/* 再改为,对部门字典,显示属性 "
+"
| 节点名称 | |
"
+"| 办理人 | "
+" |
"
+"| 选择部门 | |
"
+"| 按层级先后 | |
"
+"| $usesubprocessname | |
"
+"| 消息标题 | |
"
+"| 消息内容 | |
"
+"| 节点序号 | |
"
// +"| 指定序号: | |
"
+"| 批示意见序号 | |
"
+"| 批示落款序号 | |
"
+"| 是否手写批示 | |
"
+"| 是否重做节点 | |
" // 增加 是否重做节点。Lin
+"| 是否执行节点 | |
" // 增加 是否执行节点。Lin
+"$finishService"
+"| 限时 | "
+""
+" |
|---|
| 时间 | "
+"天"
+"时"
+"分"
+" |
"
+"| 退回处理 | |
"
+"| 系统消息回执 | |
"
+"| 显示名称 | |
"
/// 再增加编辑 "前置服务"、"后置服务" -- 临时实现 并行 的一票否决,后置服务终止掉其他人的待办。Lin
+"| 前置服务 | |
"
+"| 后置服务 | |
"
///
+"| $button | "
+""
/* 再改,增加编辑 "前置服务"、"后置服务" -- 临时实现 并行 的一票否决,后置服务终止掉其他人的待办。Lin
this.setValue(["message_title","message_content","step","name","psyj_xh","pslk_xh","displayName"]) */
this.setValue(["message_title","message_content","step","name","psyj_xh","pslk_xh","displayName",
"Bservice_name","Aservice_name"])
},
changeScope:function(v){
/* 再改为,对部门字典,显示属性
|---|
"
+"
| 节点名称 | |
"
+"| 办理人 | "
+" |
"
+"| 选择部门 | |
"
+"| $usesubprocessname | |
"
+"| 消息标题 | |
"
+"| 消息内容 | |
"
+"| 节点序号 | |
"
+"| 限时 | "
+""
+" |
|---|
| 时间 | "
+"天"
+"小时"
+"分"
+" |
"
+"| 系统消息回执 | |
"
+"| $button |
"
+""
this.setValue(["message_title","message_content","step","name"])
},
switchToDecision:function(){
this.html=""
/* +"分支"*/
+""
this.setValue(["name"])
},
switchToFork:function(){
this.html=""
/* +"并行"*/
+""
this.setValue(["name"])
},
switchToForeach:function(){
this.html=""
+"可变" // +"可变并行"。Lin
+""
this.setValue(["name"])
},
switchToEnd:function(){
this.html=""
+""
this.setValue(["agree_message_title","agree_message_content","reject_message_title","reject_message_content"])
//加载节点数据
//添加保存按钮
//加载本地数据
},
switchToSubprocess:function(){
this.html=""
+"";
this.setValue(["subprocesskey"])
},
switchToStart:function(){
this.html=""
+"";
this.setValue([]);
},
switchToJoin:function(){
this.html=""
+""
this.setValue([])
// this.setValue(["message_title","message_content","step","name","bgbj_xh"])
},
setValue:function(keys){
for (var i=0;i请选择 -- 原来选了之后,就不能清空了。Lin
* 再,先不改,TaskAsg 里写死了节点一定要有字典(办理人) -- 升级为 JBPM5 时再弄
*/
var result="";
var inList=false
if(key=="TASK_scopeParam_option"){
for (var i=0;i"+data[i].mc+""
}
return result;
}
if(key=="Start_dictionary_option"){
for(var i=0;i"+data[i].name+""
}
/* 再去掉,都增加 了 -- 原来选了之后,就不能清空了。Lin
* 再,先不去掉,TaskAsg 里写死了节点一定要有字典(办理人) -- 升级为 JBPM5 时再弄
*/
result=(result.indexOf("selected")==-1)?(""+result):(result);
if(!inList&&dafauleValue){alert(dafauleValue+"不存在于字典")}
return result;
}
if(key=="TASK_sfsxps_option"){
for(var i=0;i"+data[i].name+""
}
return result;
}
/// 增加 是否重做节点、是否执行节点。Lin
if(key=="TASK_sfRedo_option"){
for(var i=0;i"+data[i].name+""
}
return result;
}
if(key=="TASK_sfRun_option"){
for(var i=0;i"+data[i].name+""
}
return result;
}
///
if(key=="TASK_dictionary_option"){
for(var i=0;i"+data[i].name+""
*/ result += ""
}
/* 再改为显示描述,字典的 name("所在部门") 分开为 name("szbm") 和 desc("所在部门") 了。Lin
result=(result.indexOf("selected")==-1)?(""+result):(result);
*/
/* 再去掉,都增加 了 -- 原来选了之后,就不能清空了。Lin
* 再,先不去掉,TaskAsg 里写死了节点一定要有字典(办理人) -- 升级为 JBPM5 时再弄
*/
result = (result.indexOf("selected")==-1)? (""+ result) : result;
// console.log(data)
if(!inList&&dafauleValue){alert(dafauleValue+"不存在于字典")}
return result;
}
if(key=="DECISION_key_option"){
result="";
for(var i=0;i"+data[i].name+"";
*/ result+="";
continue;
}
/* 再改为显示描述,字典的 name("所在部门") 分开为 name("szbm") 和 desc("所在部门") 了。Lin
result+=""
*/ result+=""
}
if(!inList&&dafauleValue){alert(dafauleValue+"不存在于字典")}
return result;
}else if(key=="duedatetypeoption"){
var result="";
for(var i=0;i"+data[i].name+"";
continue;
}
result+=""
}
return result;
}else if(key=="TASK_rejectnode_option"){
var result="";
result="";
var allnode= demo.$nodeData
for(var key in allnode){
if(allnode[key].realtype=="task"&&this.json.id!=key){
result+='"
}
}
console.log(result)
return result;
}
},
clickTaskChainOrTaskSubprocess:function(checkbox){
//保存状态
var status=checkbox.checked
// 清除其他选中状态
// if(status)
// {
// document.getElementById("taskChain").getElementsByTagName("input")[0].checked=false;
// document.getElementById("taskSubprocess").getElementsByTagName("input")[0].checked=false;
// }
//
// checkbox.checked=status;
},
selectDueDate:function(selecteElement){
if(selecteElement.value==0){
document.getElementById("taskDuedate").style.display="none"
}else{
document.getElementById("taskDuedate").style.display=""
}
}
}