| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- 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 += '<option value="' + gooflow._this.dict[dict].class + '">' + gooflow._this.dict[dict].name + '</option>';
- }
- 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 = "<div onclick='gooflow.functions.hide();'>关闭</div>";
|