Procházet zdrojové kódy

表单中选择脚本

unknown před 5 roky
rodič
revize
dc2a786076

+ 119 - 1
o2web/source/o2_core/o2/widget/O2Identity.js

@@ -100,7 +100,16 @@ o2.widget.O2Identity = new Class({
             }.bind(this)
         });
     },
-    setEvent: function(){},
+    setEvent: function(){
+	    if( this.open ){
+            this.node.addEvents({
+                "click": function(ev){
+                    this.open(ev);
+                    ev.stopPropagation();
+                }.bind(this)
+            });
+        }
+    },
     getPersonData: function(){
         if (!this.data.dutys){
             var action = o2.Actions.get("x_organization_assemble_control");
@@ -446,6 +455,17 @@ o2.widget.O2QueryView = new Class({
         }else{
             return this.data;
         }
+    },
+    open : function (e) {
+        if( this.data.id ){
+            var appId = "query.ViewDesigner" + this.data.id;
+            if (layout.desktop.apps[appId]){
+                layout.desktop.apps[appId].setCurrent();
+            }else {
+                var options = {"id": this.data.id, "appId": appId};
+                layout.desktop.openApplication(e, "query.ViewDesigner", options);
+            }
+        }
     }
 });
 o2.widget.O2QueryStat = new Class({
@@ -461,6 +481,17 @@ o2.widget.O2QueryStat = new Class({
         }else{
             return this.data;
         }
+    },
+    open : function (e) {
+        if( this.data.id ){
+            var appId = "query.StatDesigner" + this.data.id;
+            if (layout.desktop.apps[appId]){
+                layout.desktop.apps[appId].setCurrent();
+            }else {
+                var options = {"id": this.data.id, "appId": appId};
+                layout.desktop.openApplication(e, "query.StatDesigner", options);
+            }
+        }
     }
 });
 o2.widget.O2QueryTable = new Class({
@@ -476,6 +507,17 @@ o2.widget.O2QueryTable = new Class({
         }else{
             return this.data;
         }
+    },
+    open : function (e) {
+        if( this.data.id ){
+            var appId = "query.TableDesigner" + this.data.id;
+            if (layout.desktop.apps[appId]){
+                layout.desktop.apps[appId].setCurrent();
+            }else {
+                var options = {"id": this.data.id, "appId": appId};
+                layout.desktop.openApplication(e, "query.TableDesigner", options);
+            }
+        }
     }
 });
 o2.widget.O2FormField = new Class({
@@ -524,6 +566,82 @@ o2.widget.O2File = new Class({
         return this.data;
     }
 });
+
+o2.widget.O2Script = new Class({
+    Extends: o2.widget.O2Group,
+    getPersonData: function(){
+        return this.data;
+    },
+    open : function (e) {
+        if( this.data.id && this.data.appId &&  this.data.appType){
+            var appName;
+            if( this.data.appType === "cms" ){
+                appName = "cms.ScriptDesigner";
+            }else if( this.data.appType === "portal" ){
+                appName = "portal.ScriptDesigner";
+            }else if( this.data.appType === "process" ) {
+                appName = "process.ScriptDesigner";
+            }
+            var appId = appName + this.data.id;
+            if (layout.desktop.apps[appId]){
+                layout.desktop.apps[appId].setCurrent();
+            }else {
+                var options = {"id": this.data.id, "appId": appId, "application":this.data.appId};
+                layout.desktop.openApplication(e, appName, options);
+            }
+        }
+    }
+});
+
+o2.widget.O2FormStyle = new Class({
+    Extends: o2.widget.O2Group,
+    getPersonData: function(){
+        return this.data;
+    },
+    open : function (e) {
+        if( typeOf(this.data)==="object" && this.data.id && this.data.appId && this.data.type === "script"){
+            var appName;
+            if( this.data.appType === "cms" ){
+                appName = "cms.ScriptDesigner";
+            }else{
+                appName = "process.ScriptDesigner";
+            }
+            var appId = appName + this.data.id;
+            if (layout.desktop.apps[appId]){
+                layout.desktop.apps[appId].setCurrent();
+            }else {
+                var options = {"id": this.data.id, "appId": appId, "application":this.data.appId};
+                layout.desktop.openApplication(e, appName, options);
+            }
+        }
+    }
+});
+
+o2.widget.O2Dictionary = new Class({
+    Extends: o2.widget.O2Group,
+    getPersonData: function(){
+        return this.data;
+    },
+    open : function (e) {
+        if( this.data.id && this.data.appId && this.data.appType){
+            var appName;
+            if( this.data.appType === "cms" ){
+                appName = "cms.DictionaryDesigner";
+            }else if( this.data.appType === "process" ) {
+                appName = "process.DictionaryDesigner";
+            }
+            var appId = appName + this.data.id;
+            if (layout.desktop.apps[appId]){
+                layout.desktop.apps[appId].setCurrent();
+            }else {
+                var options = {"id": this.data.id, "appId": appId, "application":this.data.appId};
+                layout.desktop.openApplication(e, appName, options);
+            }
+        }
+    }
+});
+
+
 o2.widget.O2Other = new Class({
     Extends: o2.widget.O2Group,
     getPersonData: function(){

+ 6 - 0
o2web/source/x_component_Selector/Dictionary.js

@@ -48,9 +48,15 @@ MWF.xApplication.Selector.Dictionary = new Class({
                 }.bind(this));
                 for (var application in json) {
                     if (json[application].dictionaryList && json[application].dictionaryList.length) {
+                        json[application].dictionaryList.sort(function (a, b) {
+                            return (a.name||"").localeCompare((b.name||""));
+                        });
                         array.push(json[application]);
                     }
                 }
+                array.sort( function (a, b) {
+                    return (a.name||"").localeCompare((b.name||""));
+                });
 
                 if( this.options.appType.length === 1 ){
                     array.each( function (data) {

+ 6 - 0
o2web/source/x_component_Selector/FormStyle.js

@@ -54,9 +54,15 @@ MWF.xApplication.Selector.FormStyle = new Class({
                         }.bind(this));
                         for (var application in json) {
                             if (json[application].scriptList && json[application].scriptList.length) {
+                                json[application].scriptList.sort(function (a, b) {
+                                    return (a.name||"").localeCompare((b.name||""));
+                                });
                                 array.push(json[application]);
                             }
                         }
+                        array.sort( function (a, b) {
+                            return (a.name||"").localeCompare((b.name||""));
+                        });
 
                         var category = this._newItemCategory({
                             name : "自定义样式(脚本)",

+ 7 - 1
o2web/source/x_component_Selector/Script.js

@@ -8,7 +8,7 @@ MWF.xApplication.Selector.Script = new Class({
         "title": MWF.xApplication.Selector.LP.selectScript,
         "values": [],
         "names": [],
-        "appType" : ["process","portal"],
+        "appType" : ["process","portal","cms"],
         "expand": false,
         "forceSearchInItem" : true
     },
@@ -50,9 +50,15 @@ MWF.xApplication.Selector.Script = new Class({
                 }.bind(this));
                 for (var application in json) {
                     if (json[application].scriptList && json[application].scriptList.length) {
+                        json[application].scriptList.sort(function (a, b) {
+                            return (a.name||"").localeCompare((b.name||""));
+                        });
                         array.push(json[application]);
                     }
                 }
+                array.sort( function (a, b) {
+                    return (a.name||"").localeCompare((b.name||""));
+                });
 
                 if( this.options.appType.length === 1 ){
                     array.each( function (data) {

+ 4 - 6
o2web/source/x_component_process_FormDesigner/Module/Form/form.html

@@ -65,20 +65,18 @@
                     <div class="MWFFormSelect" name="printForm"></div>
                 </td>
             </tr>
-            <tr>
-                <td class="editTableTitle">加载脚本:</td>
-                <td class="editTableValue">
-                    <div class="MWFScriptIncluder" name="scriptIncluder"></div>
-                </td>
-            </tr>
         </table>
 
+
 		<!--<div class="MWFArraylist" name="cssLinks" title="CSS引用"></div>-->
 		<!--<div class="MWFArraylist" name="scriptSrc" title="JS引用"></div>-->
 
 		<div class="MWFMaplist" name="styles" title="样式"></div>
 		<div class="MWFMaplist" name="properties" title="属性"></div>
 
+        <div style="height:24px; text-align: center; line-height: 24px; background-color: #EEE; border-top: 1px solid #eee;font-weight:bold;">加载脚本</div>
+        <div class="MWFScriptIncluder" name="scriptIncluder"></div>
+
         <div class="MWFCssArea" name="css" title="CSS"></div>
 		<!--<div class="MWFScriptArea" name="jsheader" title="JS Header"></div>-->
 

+ 19 - 0
o2web/source/x_component_process_FormDesigner/Property.js

@@ -85,6 +85,7 @@ MWF.xApplication.process.FormDesigner.Property = MWF.FCProperty = new Class({
                     this.loadSidebarPosition();
                     this.loadViewFilter();
                     this.loadDocumentTempleteSelect();
+                    this.loadScriptIncluder();
                     //this.testRestful();
 //			this.loadScriptInput();
                     //MWF.process.widget.EventsEditor
@@ -1446,6 +1447,24 @@ debugger;
 
         }.bind(this));
     },
+    loadScriptIncluder : function(){
+        var nodes = this.propertyContent.getElements(".MWFScriptIncluder");
+        if (nodes.length){
+            nodes.each(function(node){
+                var name = node.get("name");
+                MWF.xDesktop.requireApp("process.FormDesigner", "widget.ScriptIncluder", function(){
+                    var scriptIncluder = new MWF.xApplication.process.FormDesigner.widget.ScriptIncluder(node, this.designer, {
+                        "onChange": function(){
+                            // var data = validationEditor.getValidationData();
+                            // this.data[name] = data;
+                        }.bind(this)
+                    });
+                    scriptIncluder.load(this.data[name])
+                }.bind(this));
+            }.bind(this));
+        }
+
+    },
     saveFileItem: function(node, ids){
         if (ids[0]){
             var file = ids[0].data;

+ 151 - 0
o2web/source/x_component_process_FormDesigner/widget/$ScriptIncluder/default/css.wcss

@@ -0,0 +1,151 @@
+{
+    "titleNode": {
+        "height": "24px",
+        "background-color": "#eeeeee",
+        "line-height": "24px",
+        "text-align": "center",
+        "border-top": "1px solid #999"
+    },
+    "editorNode": {
+        "border-top": "1px solid #999",
+        "overflow": "hidden"
+    },
+    "actionNode":{
+        "border-top": "1px solid #999",
+        "height": "30px",
+        "text-align": "center"
+    },
+    "listNode": {
+        "border-top": "1px solid #999",
+        "min-height": "60px",
+        "padding-top": "2px",
+        "overflow": "hidden"
+    },
+    "editTableTdValue": {
+        "height": "24px",
+        "line-height": "24px",
+        "border-bottom": "1px dashed #CCC"
+    },
+    "decisionNameInput": {
+        "color": "#666",
+        "width": "90%",
+        "border-top": "1px solid #AAA",
+        "border-left": "1px solid #AAA",
+        "border-bottom": "1px solid #CCC",
+        "border-right": "1px solid #CCC"
+    },
+    "valueInput":{
+        "color": "#666",
+        "width": "90%",
+        "border-top": "1px solid #AAA",
+        "border-left": "1px solid #AAA",
+        "border-bottom": "1px solid #CCC",
+        "border-right": "1px solid #CCC"
+    },
+    "promptInput": {
+        "color": "#666",
+        "width": "90%",
+        "border-top": "1px solid #AAA",
+        "border-left": "1px solid #AAA",
+        "border-bottom": "1px solid #CCC",
+        "border-right": "1px solid #CCC"
+    },
+    "valueSelect": {
+        "color": "#666",
+        "width": "auto",
+        "border-top": "1px solid #AAA",
+        "border-left": "1px solid #AAA",
+        "border-bottom": "1px solid #CCC",
+        "border-right": "1px solid #CCC"
+    },
+    "titleTd": {
+        "width": "60px",
+        "font-weight": "bold",
+        "font-size": "12px",
+        "height": "24px",
+        "line-height": "24px"
+    },
+    "actionAreaNode": {
+        "width": "110px",
+        "height": "22px",
+        "margin": "auto",
+        "margin-top": "4px"
+    },
+    "addAction": {
+        "width": "50px",
+        "height": "20px",
+        "line-height": "20px",
+        "float": "left",
+        "cursor": "pointer",
+        "border-radius": "3px",
+        "border": "1px solid #999",
+        "background-color": "#798795",
+        "color": "#FFF"
+    },
+    "modifyAction": {
+        "width": "50px",
+        "height": "20px",
+        "line-height": "20px",
+        "float": "right",
+        "cursor": "pointer",
+        "border-radius": "3px",
+        "border": "1px solid #999",
+        "background-color": "#798795",
+        "color": "#FFF"
+    },
+    "modifyAction_disabled": {
+        "width": "50px",
+        "height": "20px",
+        "line-height": "20px",
+        "float": "right",
+        "cursor": "pointer",
+        "border-radius": "3px",
+        "border": "1px solid #999",
+        "background-color": "#d1dee9",
+        "color": "#999"
+    },
+    "errorNode": {
+        "height": "24px",
+        "background-color": "#fbe8e8",
+        "color": "#FF0000"
+    },
+    "errorTextNode": {
+        "height": "24px",
+        "line-height": "24px",
+        "background": "url("+"../x_component_process_FormDesigner/widget/$ValidationEditor/default/icon/error.png) no-repeat 5px center",
+        "padding-left": "30px"
+    },
+    "scriptNode" : {
+        "padding-left" : "5px",
+        "padding-top" : "5px"
+    },
+    "itemNode": {
+        "cursor": "pointer",
+        "height": "auto",
+        "margin": "2px 4px",
+        "background-color": "#fff",
+        "border": "1px solid #999999"
+    },
+    "itemNode_current": {
+        "cursor": "pointer",
+        "height": "auto",
+        "margin": "2px 4px",
+        "background-color": "#f5f5f5",
+        "border": "1px solid #999999"
+    },
+    "itemDeleteNode": {
+        "width": "20px",
+        "height": "24px",
+        "float": "right",
+        "background": "url("+"../x_component_process_FormDesigner/widget/$ValidationEditor/default/icon/delete1.png) no-repeat center center",
+        "cursor": "pointer"
+    },
+    "itemContentNode": {
+        "padding": "5px",
+        "margin-right": "20px",
+        "height": "auto",
+        "overflow": "hidden",
+        "text-overflow": "ellipsis",
+        "white-space": "nowrap"
+    }
+}

binární
o2web/source/x_component_process_FormDesigner/widget/$ScriptIncluder/default/icon/delete1.png


binární
o2web/source/x_component_process_FormDesigner/widget/$ScriptIncluder/default/icon/error.png


+ 116 - 96
o2web/source/x_component_process_FormDesigner/widget/ScriptIncluder.js

@@ -1,5 +1,6 @@
 MWF.xApplication.process.FormDesigner.widget = MWF.xApplication.process.FormDesigner.widget || {};
 MWF.require("MWF.widget.UUID", null, false);
+MWF.require("MWF.widget.O2Identity", null, false);
 MWF.xApplication.process.FormDesigner.widget.ScriptIncluder = new Class({
 	Implements: [Options, Events],
 	Extends: MWF.widget.Common,
@@ -19,7 +20,6 @@ MWF.xApplication.process.FormDesigner.widget.ScriptIncluder = new Class({
 		this.items = [];
 	},
     load: function(data){
-        this.titleNode = new Element("div", {"styles": this.css.titleNode, "text": this.designer.lp.validation.validation}).inject(this.node);
 		this.editorNode = new Element("div", {"styles": this.css.editorNode}).inject(this.node);
         this.actionNode = new Element("div", {"styles": this.css.actionNode}).inject(this.node);
         this.listNode = new Element("div", {"styles": this.css.listNode}).inject(this.node);
@@ -28,11 +28,44 @@ MWF.xApplication.process.FormDesigner.widget.ScriptIncluder = new Class({
         this.loadListNode(data);
 	},
     loadEditorNode: function(){
+	    debugger;
         var html = "<table width='100%' border='0' cellpadding='5' cellspacing='0' class='editTable'>" +
-            "<tr><td></td><td></td></tr><tr><td></td><td></td></tr></table>";
+            "<tr><td style='width: 60px; '>异步加载:</td><td align='left'>"+
+            "<input type='radio' name='"+(this.designer.appId||"")+"asyncLoadScript' value='true' checked/>是"+
+            "<input type='radio' name='"+(this.designer.appId||"")+"asyncLoadScript' value='false'/>否"+
+            "</td></tr><tr><td>选择脚本:</td><td><div class='scriptSelectorArea'></div></td></tr></table>";
         this.editorNode.set("html", html);
         var tds = this.editorNode.getElements("td").setStyles(this.css.editTableTdValue);
-
+        this.asyncLoadScript = this.editorNode.getElements("[type='radio']");
+        this.scriptSelectorArea = this.editorNode.getElement(".scriptSelectorArea");
+        this.loadScriptSelector();
+    },
+    loadScriptSelector: function( data ){
+        MWF.xDesktop.requireApp("process.ProcessDesigner", "widget.PersonSelector", function(){
+            var _self = this;
+            if( !data )data = [];
+            this.scriptSelector = new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(this.scriptSelectorArea, this.designer, {
+                "type": "Script",
+                "count": 0,
+                "names": data,
+                "onChange": function(ids){
+                    var value = [];
+                    ids.each( function (id) {
+                        var d = id.data;
+                        value.push({
+                            "type" : "script",
+                            "name": d.name,
+                            "alias": d.alias,
+                            "id": d.id,
+                            "appName" : d.appName || d.applicationName,
+                            "appId": d.appId || d.application,
+                            "appType" : d.appType
+                        });
+                    })
+                    this.currentSelectScripts = value;
+                }.bind(this)
+            });
+        }.bind(this));
     },
     loadActionNode: function(){
         this.actionAreaNode = new Element("div", {"styles": this.css.actionAreaNode}).inject(this.actionNode);
@@ -40,56 +73,58 @@ MWF.xApplication.process.FormDesigner.widget.ScriptIncluder = new Class({
         this.modifyAction = new Element("div", {"styles": this.css.modifyAction_disabled, "text": this.designer.lp.validation.modify}).inject(this.actionAreaNode);
 
         this.addAction.addEvent("click", function(){
-            this.addValidation();
+            this.add();
         }.bind(this));
         this.modifyAction.addEvent("click", function(){
-            this.modifyValidation();
+            this.modify();
         }.bind(this));
     },
-    getData: function(){
-        var status = this.getStatusValue();
-        var decision = this.decisionInputNode.get("value");
-        var valueType = this.valueTypeSelectNode.options[this.valueTypeSelectNode.selectedIndex].value;
-        var operateor = this.operateorSelectNode.options[this.operateorSelectNode.selectedIndex].value;
-        var value = this.valueInputNode.get("value");
-        var prompt = this.promptInputNode.get("value");
-        if (decision == this.designer.lp.validation.decisionName) decision = "";
-        if (value == this.designer.lp.validation.valueInput) value = "";
+    getCurrentData: function(){
+	    var async = true;
+        this.asyncLoadScript.each( function (el) {
+            if( el.checked ){
+                async = el.get("value") === "true";
+            }
+        });
 
         return {
-            "status": status,
-            "decision": decision,
-            "valueType": valueType,
-            "operateor": operateor,
-            "value": value,
-            "prompt": prompt
+            "async": async,
+            "scriptList": this.currentSelectScripts || []
         };
     },
-    addValidation: function(){
+    add: function(){
         this.hideErrorNode();
-        var data = this.getData();
+        var data = this.getCurrentData();
 
-        if (data.status!="all"){
-            if (!data.decision || data.decision==this.designer.lp.validation.decisionName){
-                this.showErrorNode(this.designer.lp.validation.inputDecisionName);
-                return false;
-            }
+        if ( data.scriptList.length === 0 ){
+            this.showErrorNode("请先选择脚本");
+            return false;
         }
-        if (data.operateor!="isnull" && data.operateor!="notnull"){
-            if (!data.value || data.value==this.designer.lp.validation.valueInput){
-                this.showErrorNode(this.designer.lp.validation.inputValue);
-                return false;
+        for( var i=0; i<this.items.length; i++ ){
+            var scriptList = this.items[i].data.scriptList;
+            for( var j=0; j<scriptList.length; j++ ){
+                for( var k=0; k< data.scriptList.length; k++ )
+                if( scriptList[j].id === data.scriptList[i].id ){
+                    this.showErrorNode("请不要重复添加脚本");
+                    return false;
+                }
             }
         }
-        if (!data.prompt){
-            this.showErrorNode(this.designer.lp.validation.inputPrompt);
-            return false;
-        }
         var item = new MWF.xApplication.process.FormDesigner.widget.ScriptIncluder.Item(data, this);
         this.items.push(item);
         item.selected();
+        this.empty();
         this.fireEvent("change");
     },
+    empty: function(){
+        this.asyncLoadScript.each( function (el) {
+            if( el.get("value") === "true" ){
+                el.set("checked", true)
+            }
+        });
+        if(this.scriptSelector)this.scriptSelector.setData( [] );
+        this.currentSelectScripts = [];
+    },
     showErrorNode: function(text){
         this.errorNode = new Element("div", {"styles": this.css.errorNode}).inject(this.actionNode, "before");
         this.errorTextNode = new Element("div", {"styles": this.css.errorTextNode}).inject(this.errorNode);
@@ -99,39 +134,33 @@ MWF.xApplication.process.FormDesigner.widget.ScriptIncluder = new Class({
     hideErrorNode: function(){
         if (this.errorNode) this.errorNode.destroy();
     },
-    getStatusValue: function(){
-        for (var i=0; i<this.statusRadioNodes.length; i++){
-            var item = this.statusRadioNodes[i];
-            if (item.checked) return item.value;
-        }
-        return "";
-    },
-    modifyValidation: function(){
+    modify: function(){
         if (this.currentItem){
             this.hideErrorNode();
 
-            var data = this.getData();
+            var data = this.getCurrentData();
 
-            if (data.status!="all"){
-                if (!data.decision || data.decision==this.designer.lp.validation.decisionName){
-                    this.showErrorNode(this.designer.lp.validation.inputDecisionName);
-                    return false;
-                }
+            if ( data.scriptList.length === 0 ){
+                this.showErrorNode("请先选择脚本");
+                return false;
             }
-            if (data.operateor!="isnull" && data.operateor!="notnull"){
-                if (!data.value || data.value==this.designer.lp.validation.valueInput){
-                    this.showErrorNode(this.designer.lp.validation.inputValue);
-                    return false;
+            for( var i=0; i<this.items.length; i++ ){
+                if( this.currentItem !== this.items[i] ){
+                    var scriptList = this.items[i].data.scriptList;
+                    for( var j=0; j< scriptList.length; j++ ){
+                        for( var k=0; k< data.scriptList.length; k++ )
+                            if( scriptList[j].id === data.scriptList[i].id ){
+                                this.showErrorNode("请不要重复添加脚本");
+                                return false;
+                            }
+                    }
                 }
             }
-            if (!data.prompt){
-                this.showErrorNode(this.designer.lp.validation.inputPrompt);
-                return false;
-            }
 
             this.currentItem.reload(data);
             this.currentItem.unSelected();
             this.disabledModify();
+            this.empty();
             this.fireEvent("change");
         }
     },
@@ -152,31 +181,19 @@ MWF.xApplication.process.FormDesigner.widget.ScriptIncluder = new Class({
         this.modifyAction.setStyles(this.css.modifyAction_disabled);
     },
     setData: function(data){
-        if (data.decision) this.decisionInputNode.set("value", data.decision);
-        if (data.status){
-            for (var i=0; i<this.statusRadioNodes.length; i++){
-                if (data.status == this.statusRadioNodes[i].get("value")){
-                    this.statusRadioNodes[i].set("checked", true);
-                    break;
-                }
+        this.asyncLoadScript.each( function (el) {
+            if( el.get("value") === "true" && data.async ){
+                el.set("checked", true)
+            }else if( el.get("value") === "false" && !data.async ){
+                el.set("checked", true)
             }
+        });
+        if( !this.scriptSelector ){
+            this.loadScriptSelector( data.scriptList );
         }else{
-            this.statusRadioNodes[0].set("checked", true);
-        }
-        for (var i=0; i<this.valueTypeSelectNode.options.length; i++){
-            if (data.valueType == this.valueTypeSelectNode.options[i].get("value")){
-                this.valueTypeSelectNode.options[i].set("selected", true);
-                break;
-            }
-        }
-        for (var i=0; i<this.operateorSelectNode.options.length; i++){
-            if (data.operateor == this.operateorSelectNode.options[i].get("value")){
-                this.operateorSelectNode.options[i].set("selected", true);
-                break;
-            }
+            this.scriptSelector.setData( data.scriptList );
         }
-        if (data.value) this.valueInputNode.set("value", data.value);
-        if (data.prompt) this.promptInputNode.set("value", data.prompt);
+        this.currentSelectScripts = data.scriptList;
     },
 
     deleteItem: function(item){
@@ -186,7 +203,7 @@ MWF.xApplication.process.FormDesigner.widget.ScriptIncluder = new Class({
         MWF.release(item);
         this.fireEvent("change");
     },
-    getValidationData: function(){
+    getData: function(){
         var data = [];
         this.items.each(function(item){
             data.push(item.data);
@@ -205,10 +222,21 @@ MWF.xApplication.process.FormDesigner.widget.ScriptIncluder.Item = new Class({
         this.load();
     },
     load: function(){
+        debugger;
         this.node = new Element("div", {"styles": this.css.itemNode}).inject(this.container);
         this.deleteNode = new Element("div", {"styles": this.css.itemDeleteNode}).inject(this.node);
         this.contentNode = new Element("div", {"styles": this.css.itemContentNode}).inject(this.node);
-        this.contentNode.set("text", this.getText());
+
+        this.asyncNode = new Element("div", {"styles": {}}).inject(this.contentNode);
+        this.asyncNode.set({
+            "text": this.data.async ? "异步加载脚本:" : "同步加载脚本:"
+        });
+        this.scriptNode = new Element("div", {
+            styles : this.css.scriptNode
+        }).inject(this.contentNode);
+        this.data.scriptList.each( function (scipt) {
+            new MWF.widget.O2Script(scipt, this.scriptNode)
+        }.bind(this));
 
         this.contentNode.addEvent("click", function(){
             this.selected();
@@ -220,21 +248,13 @@ MWF.xApplication.process.FormDesigner.widget.ScriptIncluder.Item = new Class({
     },
     reload: function(data){
         this.data = data;
-        this.contentNode.set("text", this.getText());
-    },
-    getText: function(){
-        var text = "";
-        if (this.data.status=="all"){
-            text = this.lp.validation.anytime+" ";
-        }else{
-            text = this.lp.validation.when+this.lp.validation.decision+" \""+this.data.decision+"\" "+this.lp.validation.as+" ";
-        }
-        text += this.lp.validation[this.data.valueType]+" ";
-        text += this.lp.validation[this.data.operateor]+" ";
-        text += " \""+this.data.value+"\" ";
-
-        text += this.lp.validation.prompt+": \""+this.data.prompt+"\"";
-        return text;
+        this.asyncNode.set({
+            "text": this.data.async ? "异步加载脚本:" : "同步加载脚本:"
+        });
+        this.scriptNode.empty();
+        this.data.scriptList.each( function (scipt) {
+            new MWF.widget.O2Script(scipt, this.scriptNode)
+        }.bind(this));
     },
     selected: function(){
         if (this.editor.currentItem) this.editor.currentItem.unSelected();

+ 12 - 4
o2web/source/x_component_process_ProcessDesigner/widget/PersonSelector.js

@@ -37,6 +37,12 @@ MWF.xApplication.process.ProcessDesigner.widget.PersonSelector = new Class({
         this.createAddNode();
         this.loadIdentitys();
     },
+    setData: function( data ){
+        this.node.empty();
+        this.identitys = [];
+        this.options.names = data;
+        this.loadIdentitys();
+    },
     loadIdentitys: function(){
         if (this.options.names){
             if (this.options.type.toLowerCase()==="duty"){
@@ -88,8 +94,9 @@ MWF.xApplication.process.ProcessDesigner.widget.PersonSelector = new Class({
                             if (this.options.type.toLowerCase()==="portalfile") this.identitys.push(new MWF.widget.O2File(data, this.node));
                             if (this.options.type.toLowerCase()==="processfile") this.identitys.push(new MWF.widget.O2File(data, this.node));
 
-                            if (this.options.type.toLowerCase()==="script") this.identitys.push(new MWF.widget.O2Other(data, this.node));
-                            if (this.options.type.toLowerCase()==="formstyle") this.identitys.push(new MWF.widget.O2Other(data, this.node));
+                            if (this.options.type.toLowerCase()==="dictionary") this.identitys.push(new MWF.widget.O2Dictionary(data, this.node));
+                            if (this.options.type.toLowerCase()==="script") this.identitys.push(new MWF.widget.O2Script(data, this.node));
+                            if (this.options.type.toLowerCase()==="formstyle") this.identitys.push(new MWF.widget.O2FormStyle(data, this.node));
                         }.bind(this));
                     }
                 }.bind(this));
@@ -154,8 +161,9 @@ MWF.xApplication.process.ProcessDesigner.widget.PersonSelector = new Class({
                             if (this.options.type.toLowerCase()==="portalfile") this.identitys.push(new MWF.widget.O2File(item.data, this.node));
                             if (this.options.type.toLowerCase()==="processfile") this.identitys.push(new MWF.widget.O2File(item.data, this.node));
 
-                            if (this.options.type.toLowerCase()==="script") this.identitys.push(new MWF.widget.O2Other(item.data, this.node));
-                            if (this.options.type.toLowerCase()==="formstyle") this.identitys.push(new MWF.widget.O2Other(item.data, this.node));
+                            if (this.options.type.toLowerCase()==="dictionary") this.identitys.push(new MWF.widget.O2Dictionary(item.data, this.node));
+                            if (this.options.type.toLowerCase()==="script") this.identitys.push(new MWF.widget.O2Script(item.data, this.node));
+                            if (this.options.type.toLowerCase()==="formstyle") this.identitys.push(new MWF.widget.O2FormStyle(item.data, this.node));
                         }.bind(this));
                         if (this.options.type.toLowerCase()==="duty") {
                             items.each(function(item){