var gooflow = { vars : {}, functions : {}, buttons : {}, // GooFlow 对象 _this : undefined }; /** * 初始化节点的属性列表 * @param {Object} type 节点的类型 */ gooflow.functions.initMsgLayer = function(type) { gooflow.vars.dom.empty(); // 根据不同的节点设置各自的表单 switch (type) { case "task": gooflow.functions.switchToTask(); gooflow.functions.replaceTaskFormContent(); break; default: break; } } /** * 显示属性模态框 * @param {Object} nodeData 节点数据 * @param {Object} modal 模态框的DOM元素id或class */ gooflow.functions.show = function(nodeData, _this) { gooflow._this = _this gooflow.vars.dom = $(_this.$modal); gooflow.vars.json = nodeData; gooflow.functions.initMsgLayer(nodeData.realtype) gooflow.vars.dom.fadeIn(0) } /** * 生成任务节点中需要的表单 */ gooflow.functions.switchToTask = function() { gooflow.vars.dom.append(gooflow_from.taskHtml()); } gooflow.functions.replaceTaskFormContent = function() { var dom = gooflow.vars.dom; dom.find('#name').val(gooflow.vars.json.name) var html = ''; for (dict in gooflow._this.dict) { html += ''; } dom.find('#handleType').html(html); } /** * 保存任务节点的属性 */ gooflow.functions.saveTask = function() { gooflow.vars.json.name = gooflow.vars.dom.find('#name').val(); console.log(gooflow.vars.json,gooflow.vars.dom.find('#name').val()); gooflow._this.setName(gooflow.vars.json.id, gooflow.vars.dom.find('#name').val(),'node') gooflow.functions.hide(); } gooflow.functions.hide = function() { gooflow.vars.dom.hide(); } gooflow.buttons.closeButton = "
关闭
";