/*
* 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;
}
*/
/* 再改,不用 this.temp.dictionaryData,改用 eval("("+ $("#bpmComponentData").html()+")").scope。Lin
* 保存 前,没有打开 task 的设置窗口,或最后打开的设置窗口不是 task 节点的,都会因为 this.temp 为空导致抛出异常
* 在 lc.js 里
* 把 bpmDiagHome.ss.jsp 里的 URL(value=)
* 赋值到 bpmDiagHome.ss.jsp 里的