Просмотр исходного кода

Merge branch 'feature/search_in_application' into 'wrdp'

Feature/search in application设计元素搜索功能

See merge request o2oa/o2oa!2730
胡起 5 лет назад
Родитель
Сommit
f5f072d40c
100 измененных файлов с 6289 добавлено и 53 удалено
  1. 2 1
      o2web/gulpapps.js
  2. 8 3
      o2web/gulpfile.js
  3. 4 4
      o2web/karma.conf.js
  4. 12 3
      o2web/package.json
  5. 4 2
      o2web/source/o2_core/o2.js
  6. 112 0
      o2web/source/o2_core/o2/widget/$Arraylist/findDesigner/css.wcss
  7. BIN
      o2web/source/o2_core/o2/widget/$Arraylist/findDesigner/icon/add.png
  8. BIN
      o2web/source/o2_core/o2/widget/$Arraylist/findDesigner/icon/add2.png
  9. BIN
      o2web/source/o2_core/o2/widget/$Arraylist/findDesigner/icon/add3.png
  10. BIN
      o2web/source/o2_core/o2/widget/$Arraylist/findDesigner/icon/delete.png
  11. BIN
      o2web/source/o2_core/o2/widget/$Arraylist/findDesigner/icon/delete3.png
  12. BIN
      o2web/source/o2_core/o2/widget/$Arraylist/findDesigner/icon/error.png
  13. 128 0
      o2web/source/o2_core/o2/widget/$Maplist/findDesigner/css.wcss
  14. BIN
      o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/add.png
  15. BIN
      o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/add2.png
  16. BIN
      o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/add3.png
  17. BIN
      o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/code.png
  18. BIN
      o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/code_empty.png
  19. BIN
      o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/collapse.png
  20. BIN
      o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/delete.png
  21. BIN
      o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/error.png
  22. BIN
      o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/expand.png
  23. 68 0
      o2web/source/o2_core/o2/widget/$O2Identity/find/css.wcss
  24. BIN
      o2web/source/o2_core/o2/widget/$O2Identity/find/icon/del.png
  25. 97 0
      o2web/source/o2_core/o2/widget/$Toolbar/findDesigner/css.wcss
  26. BIN
      o2web/source/o2_core/o2/widget/$Toolbar/findDesigner/downicon.gif
  27. BIN
      o2web/source/o2_core/o2/widget/$Toolbar/findDesigner/separatorbg.gif
  28. BIN
      o2web/source/o2_core/o2/widget/$Toolbar/findDesigner/submenu.png
  29. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/blank.gif
  30. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/blankOperate.gif
  31. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/collapse.gif
  32. 55 0
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/css.wcss
  33. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/expand.gif
  34. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_actions.png
  35. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_array.png
  36. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_css.png
  37. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_duty.png
  38. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_events.png
  39. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_filter.png
  40. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_html.png
  41. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_map.png
  42. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_object-array.png
  43. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_projection.png
  44. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_script.png
  45. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_selectConfig.png
  46. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_serial.png
  47. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_sql.png
  48. BIN
      o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_text.png
  49. 12 1
      o2web/source/o2_core/o2/widget/Arraylist.js
  50. 92 3
      o2web/source/o2_core/o2/widget/JavascriptEditor.js
  51. 19 5
      o2web/source/o2_core/o2/widget/Maplist.js
  52. 8 5
      o2web/source/o2_core/o2/widget/Tree.js
  53. 7 3
      o2web/source/o2_core/o2/widget/Tree2.js
  54. 28 1
      o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_designer.js
  55. 1 1
      o2web/source/o2_core/o2/xDesktop/$Default/blue/layout-pc.html
  56. 47 8
      o2web/source/o2_core/o2/xDesktop/Default.js
  57. BIN
      o2web/source/x_component_FindDesigner/$Main/appicon.png
  58. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icon.png
  59. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/dockBottom.png
  60. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/dockRight.png
  61. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/enter.png
  62. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/loading.gif
  63. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/op-case-gray.png
  64. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/op-case.png
  65. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/op-regex-gray.png
  66. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/op-regex.png
  67. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/op-word-gray.png
  68. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/op-word.png
  69. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/open.png
  70. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/open_gray.png
  71. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/save.png
  72. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/save_gray.png
  73. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/search.png
  74. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/stop.png
  75. BIN
      o2web/source/x_component_FindDesigner/$Main/default/icons/stop_gray.png
  76. 345 0
      o2web/source/x_component_FindDesigner/$Main/default/style.css
  77. 87 0
      o2web/source/x_component_FindDesigner/$Main/default/view.html
  78. 1555 0
      o2web/source/x_component_FindDesigner/FindWorker.js
  79. 2405 0
      o2web/source/x_component_FindDesigner/Main.js
  80. 431 0
      o2web/source/x_component_FindDesigner/PatternWorker.js
  81. 55 0
      o2web/source/x_component_FindDesigner/lp/zh-cn.js
  82. 349 0
      o2web/source/x_component_FindDesigner/propertys.json
  83. 249 0
      o2web/source/x_component_Selector/PlatApp.js
  84. 7 1
      o2web/source/x_component_Selector/lp/zh-cn.js
  85. 14 1
      o2web/source/x_component_cms_Column/$Main/default/css.wcss
  86. BIN
      o2web/source/x_component_cms_Column/$Main/default/icon/icons_find.png
  87. 13 0
      o2web/source/x_component_cms_Column/Main.js
  88. 2 1
      o2web/source/x_component_cms_Column/lp/zh-cn.js
  89. BIN
      o2web/source/x_component_cms_ColumnManager/$Main/default/icon/icons_find.png
  90. 11 1
      o2web/source/x_component_cms_ColumnManager/$Main/startMenu.json
  91. 19 5
      o2web/source/x_component_cms_ColumnManager/Main.js
  92. 1 0
      o2web/source/x_component_cms_ColumnManager/ScriptExplorer.js
  93. 5 1
      o2web/source/x_component_portal_PageDesigner/Main.js
  94. 2 0
      o2web/source/x_component_portal_PageDesigner/Module/Page.js
  95. BIN
      o2web/source/x_component_portal_PortalExplorer/$Main/default/icon/icons_find.png
  96. 12 0
      o2web/source/x_component_portal_PortalExplorer/$Main/default/style.css
  97. 2 1
      o2web/source/x_component_portal_PortalExplorer/$Main/default/view.html
  98. 8 0
      o2web/source/x_component_portal_PortalExplorer/Main.js
  99. 2 1
      o2web/source/x_component_portal_PortalExplorer/lp/zh-cn.js
  100. 11 1
      o2web/source/x_component_portal_PortalManager/FileExplorer.js

+ 2 - 1
o2web/gulpapps.js

@@ -31,6 +31,7 @@ var apps = [
     { "folder": "x_component_ExeManager", "tasks": ["move", "min"] },
     { "folder": "x_component_FaceSet", "tasks": ["move", "min"] },
     { "folder": "x_component_File", "tasks": ["move", "min"] },
+    { "folder": "x_component_FindDesigner", "tasks": ["move", "min"] },
     { "folder": "x_component_Forum", "tasks": ["move", "min"] },
     { "folder": "x_component_ForumCategory", "tasks": ["move", "min"] },
     { "folder": "x_component_ForumDocument", "tasks": ["move", "min"] },
@@ -88,7 +89,7 @@ var apps = [
     { "folder": "x_desktop", "tasks": ["move", "min"] },
     { "folder": "x_component_IMV2", "tasks": ["move", "min"] },
     { "folder": "x_component_ConfigDesigner", "tasks": ["move", "min"] },
-
+    { "folder": "x_test", "tasks": ["move"] }
 ];
 
 module.exports = apps;

+ 8 - 3
o2web/gulpfile.js

@@ -50,6 +50,7 @@ function setOptions(op1, op2){
     options.remotePath = op1.remotePath || op2.remotePath || "";
     options.dest = op1.dest || op2.dest || "dest";
     options.lp = op1.lp || op2.lp || "zh-cn";
+    options.src = op1.src || op2.src || "";
 }
 var options = {};
 setOptions(o_options, getEvOptions(o_options.ev));
@@ -324,6 +325,7 @@ function createO2ConcatTask(path, isMin, thisOptions) {
             'source/o2_lib/mootools/plugin/mBox.js',
             'source/' + path + '/o2.js',
             'source/x_desktop/js/base.js',
+            'source/x_desktop/js/base_loader.js',
             "source/o2_core/o2/framework.js"
         ];
         var dest = option.dest+'/' + path + '/';
@@ -514,7 +516,8 @@ function createBaseWorkConcatBodyTask(path, isMin, thisOptions) {
 
             'source/' + path + '/js/base_work_actions_temp.js',
 
-            'source/' + path + '/js/base.js'
+            'source/' + path + '/js/base.js',
+            'source/' + path + '/js/base_loader.js'
         ];
         var dest = option.dest+'/' + path + '/';
         return gulp.src(src)
@@ -663,7 +666,8 @@ function createBasePortalConcatBodyTask(path, isMin, thisOptions) {
 
             'source/' + path + '/js/base_portal_actions_temp.js',
 
-            'source/' + path + '/js/base.js'
+            'source/' + path + '/js/base.js',
+            'source/' + path + '/js/base_loader.js'
         ];
         var dest = option.dest+'/' + path + '/';
         return gulp.src(src)
@@ -719,7 +723,8 @@ function createBaseConcatTask(path, isMin, thisOptions){
     gulp.task(path+".base", function(){
         var option = thisOptions || options;
         var src = [
-            'source/' + path + '/js/base.js'
+            'source/' + path + '/js/base.js',
+            'source/' + path + '/js/base_loader.js'
         ];
         var dest = option.dest+'/' + path + '/';
         return gulp.src(src)

+ 4 - 4
o2web/karma.conf.js

@@ -6,8 +6,8 @@ module.exports = function(config) {
         basePath: '',
         frameworks: ['jasmine'],
         files: [
-            'source/*',
-            'test/**/*.js'
+            //'source/*',
+            '**/test/**/*.spec.js'
         ],
         exclude: [
         ],
@@ -19,8 +19,8 @@ module.exports = function(config) {
         colors: true,
         logLevel: config.LOG_INFO,
         autoWatch: false,
-        browsers: ['PhantomJS'],
+        browsers: ['Chrome'],
         singleRun: false,
         concurrency: Infinity
-    })
+    });
 };

+ 12 - 3
o2web/package.json

@@ -5,7 +5,7 @@
   "main": "o2.js",
   "scripts": {
     "build": "gulp",
-    "report-coverage": "codecov"
+    "test": "karma start source/x_test/karma.FindDesigner.js --auto-watch"
   },
   "repository": {
     "type": "git",
@@ -35,12 +35,21 @@
     "gulp-if": "^2.0.2",
     "gulp-rename": "^1.4.0",
     "gulp-sftp-up4": "^0.1.8",
+    "gulp-sourcemaps": "^3.0.0",
     "gulp-tm-asset-rev": "0.0.16",
     "gulp-tm-uglify": "3.0.1",
     "gulp-uglify-es": "^2.0.0",
+    "jasmine-core": "^3.6.0",
+    "karma": "^5.2.3",
+    "karma-chrome-launcher": "^3.1.0",
+    "karma-coverage": "^2.0.3",
+    "karma-ie-launcher": "^1.0.0",
+    "karma-jasmine": "^4.0.1",
     "merge-stream": "^1.0.1",
     "minimist": "^1.2.0",
-    "readline-sync": "^1.4.10",
-    "gulp-sourcemaps": "^3.0.0"
+    "readline-sync": "^1.4.10"
+  },
+  "dependencies": {
+    "gulp-cli": "^2.3.0"
   }
 }

+ 4 - 2
o2web/source/o2_core/o2.js

@@ -21,7 +21,7 @@
  *  GNU Affero General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with Foobar.  If not, see <https://www.gnu.org/licenses/>.
+ *  along with O2OA.  If not, see <https://www.gnu.org/licenses/>.
  *
  * ***** END LICENSE BLOCK ******/
 
@@ -775,7 +775,9 @@ if (!window.Promise){
             var el = els.item(i);
             var name = el.getAttribute("data-o2-element");
             if (name) _bindToModule(op.module, el, name.toString());
+            debugger;
             if (el.hasAttribute("data-o2-events")){
+
                 var events = el.getAttribute("data-o2-events").toString();
                 if (events) _bindToEvents(op.module, el, events);
             }
@@ -1846,7 +1848,7 @@ if (!window.Promise){
     //     return Object.appendChain(asyncGeneratorPrototype, "if (this.success) this.success.apply(this, arguments);");
     // }
     //
-    // //@todo
+    //
     // _AsyncGenerator.all = function(arr){
     //     var result = [];
     //     var ag = function (){

+ 112 - 0
o2web/source/o2_core/o2/widget/$Arraylist/findDesigner/css.wcss

@@ -0,0 +1,112 @@
+{
+	"container": {
+		"border-top": "1px solid #999",
+		"border-bottom": "1px solid #999",
+		"overflow": "auto"
+	},
+	
+	"titleNode": {
+		"height": "30px",
+		"line-height": "30px",
+		"background": "#EEE"
+	},
+	
+	"titleActionNode": {
+		"float": "right",
+		"width": "20px",
+		"height": "20px",
+		"background": "url("+o2.session.path+"/widget/$ScriptArea/default/icon/add2.png) center center no-repeat",
+		"cursor": "pointer"
+	},
+	
+	"titleTextNode": {
+		"line-height": "30px",
+		"font-size": "12px",
+		"padding-left": "5px"
+	},
+	"contentNode": {
+		"overflow": "hidden",
+		"font-size": "12px",
+		"cursor": "default",
+		"padding": "3px 3px"
+	},
+	"contentStartNode": {
+		"height": "18px",
+		"line-height": "18px",
+		"font-family": "Verdana, Geneva, sans-serif",
+		"cursor": "default",
+		"background": "transparent"
+	},
+	"contentStartNodeOver": {
+		"height": "18px",
+		"line-height": "18px",
+		"font-family": "Verdana, Geneva, sans-serif",
+		"cursor": "default",
+		"background": "#E9E9E9"
+	},
+	
+	"contentItemsNode": {
+		"margin-left": "2px",
+		"overflow": "hidden",
+		"min-height": "12px"
+	},
+	"contentEndNode": {
+		"height": "18px",
+		"line-height": "18px",
+		"font-family": "Verdana, Geneva, sans-serif",
+		"cursor": "default",
+		"background": "transparent"
+	},
+	"contentEndNodeOver": {
+		"height": "18px",
+		"line-height": "18px",
+		"font-family": "Verdana, Geneva, sans-serif",
+		"cursor": "default",
+		"background": "#E9E9E9"
+	},
+	"contentItemNode": {
+		"height": "22px",
+		"line-height": "22px",
+		"background": "transparent"
+	},
+	"contentItemNodeOver": {
+		"height": "22px",
+		"line-height": "22px",
+		"background": "#E9E9E9"
+	},
+	"contentItemIconNode": {
+		"width": "16px",
+		"height": "22px",
+		"float": "left"
+	},
+	"contentItemKeyNode": {
+		"color": "#C80000",
+		"font-family": "Verdana, Geneva, sans-serif",
+		"cursor": "default"
+	},
+	"contentItemValueNode": {
+		"color": "#395cdf",
+		"margin-left": "3px",
+		"font-family": "Verdana, Geneva, sans-serif",
+		"cursor": "default"
+	},
+	"contentItemColonNode": {
+		"margin-left": "2px"
+	},
+	
+	"editInputDiv": {
+		"border": "1px solid #999",
+		"height": "16px",
+		"line-height": "16px",
+		"overflow": "hidden",
+		"display": "inline",
+		"box-shadow": "0px 2px 5px #999"
+	},
+	
+	"editInput": {
+		"border": "0px",
+		"font-size": "12px",
+		"font-family": "Verdana, Geneva, sans-serif"
+	}
+	
+}

BIN
o2web/source/o2_core/o2/widget/$Arraylist/findDesigner/icon/add.png


BIN
o2web/source/o2_core/o2/widget/$Arraylist/findDesigner/icon/add2.png


BIN
o2web/source/o2_core/o2/widget/$Arraylist/findDesigner/icon/add3.png


BIN
o2web/source/o2_core/o2/widget/$Arraylist/findDesigner/icon/delete.png


BIN
o2web/source/o2_core/o2/widget/$Arraylist/findDesigner/icon/delete3.png


BIN
o2web/source/o2_core/o2/widget/$Arraylist/findDesigner/icon/error.png


+ 128 - 0
o2web/source/o2_core/o2/widget/$Maplist/findDesigner/css.wcss

@@ -0,0 +1,128 @@
+{
+	"container": {
+		"border-top": "1px solid #999",
+		"border-bottom": "1px solid #999",
+		"overflow": "auto"
+	},
+	
+	"titleNode": {
+		"height": "30px",
+		"line-height": "30px",
+		"background": "#EEE"
+	},
+	"titleTextNode": {
+		"line-height": "20px",
+		"font-size": "12px",
+		"padding-left": "5px",
+		"cursor": "pointer"
+	},
+	"titleActionNode": {
+		"float": "right",
+		"width": "17px",
+		"height": "14px",
+		"margin-right": "2px",
+		"margin-top": "2px",
+		"border": "1px solid #EEE"
+	},
+	"actionNode": {
+		"width": "16px",
+		"height": "13px",
+		"float": "right",
+		"background-repeat": "no-repeat",
+		"background-position": "center",
+		"cursor": "pointer"
+	},
+	"contentNode": {
+		"overflow": "hidden",
+		"font-size": "12px",
+		"cursor": "default",
+		"padding": "3px 3px",
+		"overflow-x": "auto"
+	},
+	"codeTextNode": {
+		"height": "100px",
+		"width": "99%",
+		"border": "0px",
+		"overflow": "auto"
+	},
+	"contentStartNode": {
+		"height": "18px",
+		"line-height": "18px",
+		"font-family": "Verdana, Geneva, sans-serif",
+		"cursor": "default",
+		"background": "transparent"
+	},
+	"contentStartNodeOver": {
+		"height": "18px",
+		"line-height": "18px",
+		"font-family": "Verdana, Geneva, sans-serif",
+		"cursor": "default",
+		"background": "#E9E9E9"
+	},
+	
+	"contentItemsNode": {
+		"margin-left": "10px",
+		"overflow": "hidden",
+	},
+	"contentEndNode": {
+		"height": "18px",
+		"line-height": "18px",
+		"font-family": "Verdana, Geneva, sans-serif",
+		"cursor": "default",
+		"background": "transparent"
+	},
+	"contentEndNodeOver": {
+		"height": "18px",
+		"line-height": "18px",
+		"font-family": "Verdana, Geneva, sans-serif",
+		"cursor": "default",
+		"background": "#E9E9E9"
+	},
+	"contentItemNode": {
+		"height": "20px",
+		"line-height": "20px",
+		"background": "transparent",
+		"whiteSpace": "nowrap"
+	},
+	"contentItemNodeOver": {
+		"height": "20px",
+		"line-height": "20px",
+		"background": "#E9E9E9"
+	},
+	"contentItemIconNode": {
+		"width": "20px",
+		"height": "20px",
+		"float": "left"
+	},
+	"contentItemKeyNode": {
+		"color": "#C80000",
+		"font-family": "Verdana, Geneva, sans-serif",
+		"cursor": "default"
+	},
+	"contentItemValueNode": {
+		"color": "#666",
+		"margin-left": "3px",
+		"font-family": "Verdana, Geneva, sans-serif",
+		"cursor": "default"
+	},
+	"contentItemColonNode": {
+		"margin-left": "2px"
+	},
+	
+	"editInputDiv": {
+		"border": "1px solid #999",
+		"height": "14px",
+		"line-height": "16px",
+		"overflow": "hidden",
+		"display": "inline",
+		"box-shadow": "0px 1px 4px #999"
+	},
+	
+	"editInput": {
+		"height": "12px",
+		"border": "0px",
+		"font-size": "12px",
+		"font-family": "Verdana, Geneva, sans-serif"
+	}
+	
+}

BIN
o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/add.png


BIN
o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/add2.png


BIN
o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/add3.png


BIN
o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/code.png


BIN
o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/code_empty.png


BIN
o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/collapse.png


BIN
o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/delete.png


BIN
o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/error.png


BIN
o2web/source/o2_core/o2/widget/$Maplist/findDesigner/icon/expand.png


+ 68 - 0
o2web/source/o2_core/o2/widget/$O2Identity/find/css.wcss

@@ -0,0 +1,68 @@
+{
+    "identityNode": {
+        "padding": "0 10px",
+        "float": "left",
+        "margin-right": "5px",
+        "margin-left": "5px",
+        "background": "#ffffff",
+        "border-radius":"100px",
+        "color": "#666",
+        "border": "1px solid #cccccc",
+        "font-size": "12px",
+        "cursor": "pointer",
+    },
+    "identityNode_over": {
+        "padding": "0 10px",
+        "float": "left",
+        "margin-right": "5px",
+        "margin-left": "5px",
+        "background-color": "#f3f3f3",
+        "border-radius":"100px",
+        "border": "1px solid #f3f3f3",
+        "color": "#666",
+        "cursor": "pointer"
+    },
+    "identityRemoveNode": {
+        "background": "url("+o2.session.path+"/widget/$O2Identity/find/icon/del.png) center center no-repeat",
+        "width": "16px",
+        "margin-left": "5px",
+        "height": "20px",
+        "float": "right"
+    },
+    "identityInforNode": {
+        "overflow": "hidden"
+    },
+    "identityInforNameNode": {
+        "height": "40px"
+    },
+    "identityInforPicNode": {
+        "height": "40px",
+        "width": "40px",
+        "float": "left"
+    },
+    "identityInforRightTextNode": {
+        "height": "40px",
+        "float": "left",
+        "margin-left": "20px"
+    },
+    "identityInforNameTextNode": {
+        "height": "20px",
+        "line-height": "20px",
+        "width": "120px",
+        "color": "#da7429",
+        "font-size": "12px",
+        "font-weight": "bold"
+    },
+    "identityInforEmployeeTextNode": {
+        "height": "16px",
+        "line-height": "16px",
+        "width": "120px",
+        "color": "#999999",
+        "font-size": "12px"
+    },
+    "identityInforPhoneNode": {
+        "padding": "0px",
+        "margin-top": "15px",
+        "height": "10px"
+    }
+}

BIN
o2web/source/o2_core/o2/widget/$O2Identity/find/icon/del.png


+ 97 - 0
o2web/source/o2_core/o2/widget/$Toolbar/findDesigner/css.wcss

@@ -0,0 +1,97 @@
+{
+	"container": {
+		"border": "0px",
+		"word-wrap" : "normal",
+		"word-break" : "keep-all",
+		"cursor": "pointer",
+		"overflow": "hidden",
+		"height": "24px",
+		"display":"block",
+		"font-size": "12px"
+	},
+	"toolbarSeparator": {
+		"display":"block",
+		"float": "left",
+		"margin-bottom": "2px",
+		"margin-top": "2px",
+		"height": "20px",
+		"width": "1px",
+		"background-color": "#888888",
+		"border-right": "1px solid #FFFFFF",
+		"overflow": "hidden"
+	},
+
+	"button": {
+		"display":"block",
+		"position": "static",
+		"float": "left",
+		"border": "1px solid transparent",
+		"background": "transparent",
+		"height": "20px",
+		"margin-right": "5px",
+		"padding-left": "2px",
+		"padding-right": "2px",
+		"cursor": "pointer"
+	},
+	"buttonImgDiv": {
+		"display":"block",
+		"float": "left",
+		"padding-top": "1px",
+		"padding-bottom": "1px",
+		"padding-left": "1px",
+		"padding-right": "1px",
+		"cursor": "pointer"
+	},
+	"buttonImg": {
+		"height": "16px",
+		"width": "16px",
+		"cursor": "pointer",
+		"margin-top": "0px"
+	},
+	"buttonTextDiv": {
+		"display":"block",
+		"float": "left",
+		"height": "20px",
+		"padding-left": "2px",
+		"padding-right": "2px",
+		"line-height": "20px",
+		"cursor": "pointer"
+	},
+
+	"buttonDisable": {
+		"color": "#999"
+	},
+	"buttonImgDivDisable": {
+		"color": "#999"
+	},
+	"buttonTextDivDisable": {
+		"color": "#999"
+	},
+
+	"buttonOver": {
+		"border": "1px solid #000000",
+		"background": "#b5bed6"
+	},
+	"buttonOut": {
+		"border": "1px solid transparent",
+		"background": "transparent"
+	},
+	"buttonDown": {
+		"border": "1px solid #000000",
+		"background": "#8492b5"
+	},
+	"buttonUp": {
+		"border": "1px solid #000000",
+		"background": "#b5bed6"
+	},
+	"toolbarButtonDownNode": {
+		"display":"block",
+		"float": "left",
+		"padding-left": "2px",
+		"padding-right": "2px",
+		"padding-top": "0px",
+		"height": "18px",
+		"color": "#ff0000",
+		"cursor": "pointer"
+	}
+}

BIN
o2web/source/o2_core/o2/widget/$Toolbar/findDesigner/downicon.gif


BIN
o2web/source/o2_core/o2/widget/$Toolbar/findDesigner/separatorbg.gif


BIN
o2web/source/o2_core/o2/widget/$Toolbar/findDesigner/submenu.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/blank.gif


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/blankOperate.gif


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/collapse.gif


+ 55 - 0
o2web/source/o2_core/o2/widget/$Tree/findDesigner/css.wcss

@@ -0,0 +1,55 @@
+{
+	"areaNode": {
+		"cursor": "pointer",
+		"margin": "10px"
+	},
+
+	"treeNode": {
+		"line-height": "24px"
+	},
+	
+	"treeItemNode":{
+
+	},
+	"treeChildrenNode": {
+	},
+	"blankLevelNode": {
+		"height": "24px",
+		"width": "15px"
+	},
+	"operateNode": {
+		"height": "24px",
+		"width": "20px",
+		"background-position": "center 2px",
+		"background-repeat": "no-repeat"
+	},
+	"nodeTable": {},
+	"iconNode": {
+		"height": "24px",
+		"width": "24px",
+		"background-position": "center center"
+	},
+	"textNode": {
+		"height": "24px"
+	},
+	"textDivNode": {
+		"line-height": "24px",
+		"font-size":"12px",
+		"word-break": "keep-all",
+		"white-space": "nowrap",
+		"padding-left": "5px",
+		"padding-right": "5px",
+		"background": "transparent",
+		"color": "#000"
+	},
+	"textDivNodeSelected": {
+		"line-height": "24px",
+		"font-size":"12px",
+		"word-break": "keep-all",
+		"white-space": "nowrap",
+		"padding-left": "5px",
+		"padding-right": "5px",
+		"background": "#dddddd",
+		"color": "#FFF"
+	}
+}

BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/expand.gif


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_actions.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_array.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_css.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_duty.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_events.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_filter.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_html.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_map.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_object-array.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_projection.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_script.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_selectConfig.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_serial.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_sql.png


BIN
o2web/source/o2_core/o2/widget/$Tree/findDesigner/icon_text.png


+ 12 - 1
o2web/source/o2_core/o2/widget/Arraylist.js

@@ -4,6 +4,7 @@ o2.widget.Arraylist = new Class({
 	Extends: o2.widget.Common,
 	options: {
 		"title": "arraylist",
+		"htmlTitle": "",
 		"style": "default",
 		
 		"isAdd": true,
@@ -53,7 +54,9 @@ o2.widget.Arraylist = new Class({
 		this.titleTextNode = new Element("div", {
 			"styles": this.css.titleTextNode,
 			"text": this.options.title
-		}).inject(this.titleNode);	
+		}).inject(this.titleNode);
+
+		if (this.options.htmlTitle) this.titleTextNode.set("html", this.options.htmlTitle);
 	},
 	
 	createContent: function(arr){
@@ -110,6 +113,14 @@ o2.widget.Arraylist = new Class({
 			}
 		});
 		return arr;
+	},
+	getValue: function(){
+		return this.toArray();
+	},
+	destroy: function(){
+		this.fireEvent("destroy");
+		this.container.destroy();
+		o2.release(this);
 	}
 	
 });

+ 92 - 3
o2web/source/o2_core/o2/widget/JavascriptEditor.js

@@ -1,5 +1,5 @@
 o2.widget = o2.widget || {};
-o2.require("o2.widget.codemirror", null, false);
+//o2.require("o2.widget.codemirror", null, false);
 o2.require("o2.xDesktop.UserData", null, false);
 o2.widget.JavascriptEditor = new Class({
 	Implements: [Options, Events],
@@ -145,8 +145,11 @@ o2.widget.JavascriptEditor = new Class({
                 }.bind(this));
                 this.editor.onDidBlurEditorText(function(e){
                     o2.shortcut.keyboard.activate();
+                    this.fireEvent("blur");
                 }.bind(this));
-
+                this.editor.onDidChangeModelContent(function(e){
+                    this.fireEvent("change");
+                }.bind(this))
 
                 //o2.widget.JavascriptEditor.getCompletionEnvironment(this.options.runtime, function(){
                     this.monacoModel = this.editor.getModel();
@@ -221,6 +224,14 @@ o2.widget.JavascriptEditor = new Class({
                     }.bind(this)
                 });
 
+                this.editor.on("blur", function(){
+                    this.fireEvent("blur");
+                }.bind(this));
+                this.editor.on("change", function(){
+                    this.fireEvent("change");
+                }.bind(this));
+
+
                 this.node.addEvent("keydown", function(e){
                     e.stopPropagation();
                 });
@@ -270,7 +281,7 @@ o2.widget.JavascriptEditor = new Class({
         if (textPrefix.lastIndexOf("=")!=-1) textPrefix = textPrefix.substr(textPrefix.lastIndexOf("=")+1);
         if (textPrefix.lastIndexOf(" new ")!=-1) textPrefix = textPrefix.substr(textPrefix.lastIndexOf(" new ")+5);
         //if (preCode.lastIndexOf("{")!=-1) preCode = preCode.substr(preCode.lastIndexOf("{")+1);
-debugger;
+
         var codeObj = {
             "code": textPrefix,
             "preCode": preCode,
@@ -423,6 +434,11 @@ debugger;
             }
         }
     },
+    destroy: function(){
+	    this.fireEvent("destroy");
+	    this.destroyEditor();
+	    o2.release(this);
+    },
     setTheme: function(theme){
         if (this.editor){
             switch (this.options.type.toLowerCase()) {
@@ -439,6 +455,67 @@ debugger;
             }
         }
     },
+
+    getRange: function(startLine, startCol, endLine, endCol){
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "ace":
+                    var range = this.editor.getSelection().getWordRange( startLine-1, startCol-1 );
+                    range.setStart(startLine-1, startCol-1);
+                    if (endLine && endCol){
+                        range.setEnd(endLine-1, endCol-1);
+                    }
+                    return range;
+                case "monaco":
+                    return {
+                        "endColumn": endCol,
+                        "endLineNumber": endLine,
+                        "startColumn": startCol,
+                        "startLineNumber": startLine
+                    }
+                    ;
+            }
+        }
+        return null;
+    },
+    selectRange: function(range){
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "ace":
+                    if (o2.typeOf(range)==="array"){
+                        this.editor.getSelection().setSelectionRange( range[0] );
+                        for (var i=1; i<range.length; i++) this.editor.getSelection().addRange( range[i] );
+                    }else{
+                        this.editor.getSelection().setSelectionRange( range );
+                    }
+                    break;
+                case "monaco":
+                    if (o2.typeOf(range)==="array"){
+                        var selections = [];
+                        range.each(function(r){
+                            selections.push({
+                                "positionColumn": r.endColumn,
+                                "positionLineNumber": r.endLineNumber,
+                                "selectionStartColumn": r.startColumn,
+                                "selectionStartLineNumber": r.startLineNumber
+                            });
+                        });
+                        this.editor.setSelections(selections);
+                    }else{
+                        var selection = {
+                            "positionColumn": range.endColumn,
+                            "positionLineNumber": range.endLineNumber,
+                            "selectionStartColumn": range.startColumn,
+                            "selectionStartLineNumber": range.startLineNumber
+                        }
+                        this.editor.setSelection(selection);
+                    }
+                    this.editor.focus();
+                    break;
+            }
+        }
+    },
+
     setValue: function(v){
         if (this.editor) this.editor.setValue(v);
     },
@@ -555,6 +632,18 @@ debugger;
             }
         }
     },
+    gotoLine: function(line, col){
+        if (this.editor){
+            switch (this.options.type.toLowerCase()) {
+                case "ace": this.editor.gotoLine(line-1, col-1, true); break;
+                case "monaco": this.editor.revealPositionInCenterIfOutsideViewport({
+                    "column": col,
+                    "lineNumber": line
+                }, 0);
+            }
+        }
+    },
+
     goto: function(){
         var p = this.editor.getCursorPosition();
         if (p.row==0){

+ 19 - 5
o2web/source/o2_core/o2/widget/Maplist.js

@@ -4,6 +4,7 @@ o2.widget.Maplist = new Class({
 	Extends: o2.widget.Common,
 	options: {
 		"title": "maplist",
+		"htmlTitle": "",
 		"style": "default",
 		
 		"collapse": false,
@@ -57,6 +58,9 @@ o2.widget.Maplist = new Class({
 			"styles": this.css.titleTextNode,
 			"text": this.options.title
 		}).inject(this.titleNode);
+
+		if (this.options.htmlTitle) this.titleTextNode.set("html", this.options.htmlTitle);
+
 		this.titleTextNode.addEvent("click", function(){
 			if(this.isShowCode){
 
@@ -293,8 +297,12 @@ o2.widget.Maplist = new Class({
 	},
     getValue: function(){
 		return this.toJson();
+	},
+	destroy: function(){
+		this.fireEvent("destroy");
+		this.container.destroy();
+		o2.release(this);
 	}
-	
 });
 
 o2.widget.Maplist.Item = new Class({
@@ -417,6 +425,7 @@ o2.widget.Maplist.Item = new Class({
 	},
 	
 	editItemComplate: function(node, input){
+		var isChangeed = false;
 		var text = input.get("value");
 		if (node == this.keyNode){
 			if (!text){
@@ -431,6 +440,7 @@ o2.widget.Maplist.Item = new Class({
 			}.bind(this));
 			
 			if (flag){
+				if (this.key !== text) isChangeed = true;
 				this.key = text;
 				this.editValue();
 				this.maplist.notAddItem = true;
@@ -444,6 +454,7 @@ o2.widget.Maplist.Item = new Class({
 		
 		var addNewItem = false;
 		if (node == this.valueNode){
+			if (this.value !== text) isChangeed = true;
 			this.value = text;
 			if (this.isEnterKey){
 				if (this.isNewItem){
@@ -457,7 +468,7 @@ o2.widget.Maplist.Item = new Class({
 		this.iconNode.setStyle("background", "transparent ");
 		this.iconNode.title = "";
 
-		this.maplist.fireEvent("change");
+		if (isChangeed) this.maplist.fireEvent("change");
 		
 		if (addNewItem){
 			this.maplist.notAddItem = false;
@@ -471,8 +482,6 @@ o2.widget.Maplist.Item = new Class({
 	
 });
 
-
-
 o2.widget.Maplist.Style = new Class({
     Implements: [Options, Events],
     Extends: o2.widget.Maplist,
@@ -682,6 +691,8 @@ o2.widget.Maplist.Style.Item = new Class({
         dlg.close();
     },
     editItemComplate: function(node, input){
+    	var isChangeed = false;
+
         var text = input.get("value");
         if (node == this.keyNode){
             if (!text){
@@ -696,6 +707,7 @@ o2.widget.Maplist.Style.Item = new Class({
             }.bind(this));
 
             if (flag){
+				if (this.key !== text) isChangeed = true;
                 this.key = text;
                 if (this.imgKeys.indexOf(this.key)==-1) this.editValue();
                 this.maplist.notAddItem = true;
@@ -709,6 +721,7 @@ o2.widget.Maplist.Style.Item = new Class({
 
         var addNewItem = false;
         if (node == this.valueNode){
+			if (this.value !== text) isChangeed = true;
             this.value = text;
             if (this.isEnterKey){
                 if (this.isNewItem){
@@ -722,7 +735,8 @@ o2.widget.Maplist.Style.Item = new Class({
         this.iconNode.setStyle("background", "transparent ");
         this.iconNode.title = "";
 
-        this.maplist.fireEvent("change");
+		if (isChangeed) this.maplist.fireEvent("change");
+        //this.maplist.fireEvent("change");
 
         if (addNewItem){
             this.maplist.notAddItem = false;

+ 8 - 5
o2web/source/o2_core/o2/widget/Tree.js

@@ -235,8 +235,9 @@ o2.widget.Tree.Node = new Class({
 			"border": "0",
 			"cellpadding": "0",
 			"cellspacing": "0",
-			"styles": this.tree.css.nodeTable
+			"styles": {"width": "fit-content", "table-layout": "fixed"}
 		}).inject(this.itemNode);
+		this.nodeTable.setStyles(this.tree.css.nodeTable);
 
         if (this.options.style){
             if (this.tree.css[this.options.style]){
@@ -319,12 +320,13 @@ o2.widget.Tree.Node = new Class({
         }
 	//	var width = this.tree.container.getSize().x - (this.level*20+40);
 	//	this.textNode.setStyle("width", ""+width+"px");
-		
+
 		var textDivNode = new Element("div", {
-			"styles": this.tree.css.textDivNode,
-		//	"html": this.options.text,
+			"styles": {"display": "inline-block"},
+			//	"html": this.options.text,
 			"title": this.options.title
 		});
+		textDivNode.setStyles(this.tree.css.textDivNode);
         if (this.options.style){
             if (this.tree.css[this.options.style]){
                 textDivNode.setStyles(this.tree.css[this.options.style].textDivNode);
@@ -354,6 +356,7 @@ o2.widget.Tree.Node = new Class({
 	selectNode: function(){
 		this.tree.fireEvent("beforeSelect", [this]);
 		if (this.tree.currentNode){
+			this.tree.currentNode.fireEvent("unselect");
 			var textDivNode = this.tree.currentNode.textNode.getElement("div");
 			textDivNode.setStyles(this.tree.css.textDivNode);
             if (this.tree.currentNode.options.style){
@@ -462,4 +465,4 @@ o2.widget.Tree.Node = new Class({
 		this.node.destroy();
 		delete this;
 	}
-});
+});

+ 7 - 3
o2web/source/o2_core/o2/widget/Tree2.js

@@ -62,8 +62,10 @@ o2.widget.Tree2.Node = new Class({
 			"border": "0",
 			"cellpadding": "0",
 			"cellspacing": "0",
-			"styles": this.tree.css.nodeTable
+			"styles": {"width": "fit-content", "table-layout": "fixed"}
 		}).inject(this.itemNode);
+		this.nodeTable.setStyles(this.tree.css.nodeTable);
+
 		var tbody = new Element("tbody").inject(this.nodeTable);
 		this.nodeArea = new Element("tr").inject(tbody);
 		
@@ -130,10 +132,12 @@ o2.widget.Tree2.Node = new Class({
 	//	this.textNode.setStyle("width", ""+width+"px");
 		
 		var textDivNode = new Element("div", {
-			"styles": this.tree.css.textDivNode,
+			"styles": {"display": "inline-block"},
 		//	"html": this.options.text,
 			"title": this.options.title
 		});
+		textDivNode.setStyles(this.tree.css.textDivNode);
+
         if (this.tree.options.text=="html"){
             textDivNode.set("html", this.options.text);
         }else{
@@ -242,4 +246,4 @@ o2.widget.Tree2.Node = new Class({
 		this.node.destroy();
 		delete this;
 	}
-});
+});

+ 28 - 1
o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_designer.js

@@ -1,4 +1,4 @@
-MWF.xAction.RestActions.Action["x_processplatform_assemble_designer"] = new Class({
+ MWF.xAction.RestActions.Action["x_processplatform_assemble_designer"] = new Class({
     Extends: MWF.xAction.RestActions.Action,
 
     getId: function(count, success, failure, async){
@@ -220,6 +220,33 @@ MWF.xAction.RestActions.Action["x_processplatform_assemble_designer"] = new Clas
             mobileData.json.includeScripts.each(function(s){
                 mobileRelatedScriptMap[s.id] = ((s.appType==="process") ? "processPlatform" : s.appType);
             });
+        };
+
+        if (!fieldList){
+            dataTypes = {
+                "string": ["htmledit", "radio", "select", "textarea", "textfield"],
+                "person": ["personfield","orgfield","org"],
+                "date": ["calender"],
+                "number": ["number"],
+                "array": ["checkbox"]
+            };
+            fieldList = [];
+            Object.keys(formData.json.moduleList).forEach(function(moduleKey){
+                var moudle = formData.json.moduleList[moduleKey];
+                var key = "";
+                for (k in dataTypes){
+                    if (dataTypes[k].indexOf(moudle.type.toLowerCase())!=-1){
+                        key = k;
+                        break;
+                    }
+                }
+                if (key){
+                    fieldList.push({
+                        "name": moudle.id,
+                        "dataType": key
+                    });
+                }
+            }.bind(this));
         }
 
         var json = {

+ 1 - 1
o2web/source/o2_core/o2/xDesktop/$Default/blue/layout-pc.html

@@ -17,7 +17,7 @@
             <div style="display: table-row"><div class="layout_content_taskbar" data-o2-element="taskbarNode">
                 <div class="layout_content_taskbar_area">
                     <div class="layout_content_taskbar_area_user" data-o2-element="userInforNode">
-                        <div class="layout_content_taskbar_area_user_icon" style="background-image: url({{$.user.iconUrl}});"></div>
+                        <div class="layout_content_taskbar_area_user_icon"></div>
                         <div class="layout_content_taskbar_area_user_text">{{ $.user.name }}</div>
                     </div>
 

+ 47 - 8
o2web/source/o2_core/o2/xDesktop/Default.js

@@ -52,7 +52,7 @@ o2.xDesktop.Default = new Class({
         if (this.status && this.status.flatStyle) this.options.style = this.status.flatStyle;
     },
 
-    load: function(){
+    load: function(cb){
         this.loadLayout(function(){
             this.setEvent();
             if (!this.noDefault) this.loadDefaultPage();
@@ -63,6 +63,8 @@ o2.xDesktop.Default = new Class({
                     this.loadDefaultLnk();
 
                     this.loadStatus();
+
+                    if (cb) cb();
                 }.bind(this));
 
                 this.openWebSocket();
@@ -167,21 +169,45 @@ o2.xDesktop.Default = new Class({
 
 
     loadLayout: function(callback){
-        this.session.user.iconUrl = o2.Actions.get("x_organization_assemble_control").getPersonIcon(this.session.user.id);
-        //var css = this.path+this.options.style+ ((o2.session.isMobile || layout.mobile) ? "/style-mobile.css" : "/style-pc.css");
+        this.session.user.iconUrl = o2.filterUrl(o2.Actions.get("x_organization_assemble_control").getPersonIcon(this.session.user.id));
+
         var css = this.path+this.options.style+ ((o2.session.isMobile || layout.mobile) ? "/style-pc.css" : "/style-pc.css");
         var skinCss = this.path+this.options.style+ "/style-skin.css";
-        //var html = this.path+this.options.style+((o2.session.isMobile || layout.mobile) ? "/layout-mobile.html" : "/layout-pc.html");
         var html = this.path+this.options.style+((o2.session.isMobile || layout.mobile) ? "/layout-pc.html" : "/layout-pc.html");
 
         this.node.loadAll({ "css": [css], "html": [html]}, {"bind": {"user": this.session.user}, "module": this},function(){
+            var oReq = new XMLHttpRequest();
+            debugger;
+            oReq.addEventListener("load", function(){
+                var reader  = new FileReader();
+                reader.addEventListener("load", function () {
+                    this.userInforNode.getFirst().setStyle("background-image", "url("+reader.result+")");
+                }.bind(this), false);
+                reader.readAsDataURL(oReq.response);
+            }.bind(this));
+            oReq.open("GET", this.session.user.iconUrl);
+            oReq.setRequestHeader("authorization", layout.session.user.token);
+            oReq.responseType = "blob";
+            oReq.withCredentials = true;
+            oReq.send();
+
+            // var res = new Request({
+            //     "url": this.session.user.iconUrl,
+            //     method: "get",
+            //     withCredentials: true,
+            //     onSuccess: function(response,a,s,d){
+            //
+            //     }.bind(this)
+            // });
+            // res.setHeader("authorization", layout.session.user.token);
+            // res.send();
+
             this.node.loadCss(skinCss);
             if (callback) callback();
             // this.node.load(html, {
             //     "bind": {"user": this.session.user}
             // }, function(){});
         }.bind(this));
-
     },
 
 
@@ -483,9 +509,22 @@ o2.xDesktop.Default = new Class({
             }
         }.bind(this));
         var status = this.getLayoutStatusData();
-        o2.UD.putData("layout", status, function(){
-            if (callback) callback();
-        });
+
+        // if (navigator.sendBeacon) {
+        //     var obj = this.personalAction.action.actions["putUserData"];
+        //     var url = this.personalAction.action.address + obj.uri;
+        //     url = url.replace("{name}", "layout");
+        //     navigator.sendBeacon(url, status);
+        // } else {
+       try{
+           o2.UD.putData("layout", status, function(){
+               if (callback) callback();
+           });
+       }catch(e){};
+
+        // }
+
+
     },
     getLayoutStatusData: function(){
         var status = {

BIN
o2web/source/x_component_FindDesigner/$Main/appicon.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icon.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/dockBottom.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/dockRight.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/enter.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/loading.gif


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/op-case-gray.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/op-case.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/op-regex-gray.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/op-regex.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/op-word-gray.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/op-word.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/open.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/open_gray.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/save.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/save_gray.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/search.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/stop.png


BIN
o2web/source/x_component_FindDesigner/$Main/default/icons/stop_gray.png


+ 345 - 0
o2web/source/x_component_FindDesigner/$Main/default/style.css

@@ -0,0 +1,345 @@
+.content{
+    height: 100%;
+}
+.filterNode {
+    height: 20px;
+    line-height: 20px;
+    padding: 10px 0;
+    border-bottom: 1px solid #cccccc;
+    background-color: #f0f0f0;
+}
+.keywordNode {
+    height: 30px;
+    line-height: 30px;
+    padding: 2px 0;
+    background-color: #ffffff;
+    border-bottom: 1px solid #cccccc;
+}
+.rangeNode {
+    height: 40px;
+    padding: 0;
+    line-height: 20px;
+    border-bottom: 1px solid #cccccc;
+    background-color: #f0f0f0;
+}
+.resultNode {
+    overflow: auto;
+}
+.listNode {
+    background-color: #ffffff;
+}
+.previewNode {
+    background-color: #f0f0f0;
+}
+
+.listNode_lr {
+    background-color: #ffffff;
+    height: 100%;
+    float: left;
+}
+.previewNode_lr {
+    background-color: #f0f0f0;
+    height: 100%;
+}
+
+.filterNode_title {
+    float: left;
+    padding: 0 10px;
+    text-align: center;
+    width: 75px;
+    font-size: 12px;
+    font-weight: bold;
+    height: 20px;
+}
+.filterNode_content {
+    margin-left: 80px;
+    font-size: 12px;
+    color: #666666;
+    height: 20px;
+}
+.filterNode_item {
+    margin-left: 5px;
+    float: left;
+    display: inline-flex;
+    cursor: default;
+}
+.rangeType_Item {
+    margin-left: 5px;
+    float: left;
+    display: inline-flex;
+    cursor: default;
+}
+.rangeNode_title {
+    float: left;
+    padding: 0 10px;
+    text-align: center;
+    width: 75px;
+    font-size: 12px;
+    font-weight: bold;
+    height: 40px;
+    line-height: 40px;
+}
+.rangeNode_content {
+    width: 400px;
+    font-size: 12px;
+    color: #666666;
+    padding: 10px 0;
+    height: 20px;
+    float: left;
+}
+.rangeNode_select {
+    margin-left: 495px;
+    padding: 0;
+    height: 40px;
+}
+.rangeNode_select_area {
+    padding: 5px 0;
+    height: 30px;
+}
+.rangeNode_select_action_area {
+    float: left;
+    width: 100px;
+    padding: 4px 10px;
+    border-right: 1px solid #cccccc;
+    border-left: 1px solid #cccccc;
+    height: 22px;
+}
+.rangeNode_select_action {
+    border: 1px solid #bbbbbb;
+    height: 20px;
+    padding: 0 10px;
+    border-radius: 12px;
+    background-color: #f9f9f9;
+    cursor: pointer;
+    font-size: 12px;
+    color: #888888;
+}
+.rangeNode_select_content {
+    margin-left: 120px;
+    background-color: #ffffff;
+    height: 22px;
+    overflow: hidden;
+    padding: 4px 5px;
+}
+
+.keywordNode_inputArea {
+    margin-left: 95px;
+    height: 30px;
+}
+.keywordNode_optionArea {
+    width: 85px;
+    float: left;
+    height: 24px;
+    border-right: 1px solid #cccccc;
+    padding: 3px 5px;
+}
+.keywordNode_optionItem {
+    height: 24px;
+    width: 24px;
+    background-position: center center;
+    background-repeat: no-repeat;
+    float: left;
+    margin-left: 3px;
+    cursor: pointer;
+    border-radius: 3px;
+}
+.optionItem_over {
+    background-color: #eeeeee;
+}
+.caseSensitiveNode_false {
+    background-image: url("../x_component_FindDesigner/$Main/default/icons/op-case-gray.png");
+}
+.matchWholeWordNode_false {
+    background-image: url("../x_component_FindDesigner/$Main/default/icons/op-word-gray.png");
+}
+.matchRegExpNode_false {
+    background-image: url("../x_component_FindDesigner/$Main/default/icons/op-regex-gray.png");
+}
+.caseSensitiveNode_true {
+    background-image: url("../x_component_FindDesigner/$Main/default/icons/op-case.png");
+}
+.matchWholeWordNode_true {
+    background-image: url("../x_component_FindDesigner/$Main/default/icons/op-word.png");
+}
+.matchRegExpNode_true {
+    background-image: url("../x_component_FindDesigner/$Main/default/icons/op-regex.png");
+}
+.keywordNode_icon {
+    height: 30px;
+    width: 24px;
+    background-position: center center;
+    background-repeat: no-repeat;
+    float: left;
+    margin-left: 3px;
+    cursor: pointer;
+    border-radius: 3px;
+    background-image: url("../x_component_FindDesigner/$Main/default/icons/search.png");
+}
+.keywordNode_action {
+    height: 30px;
+    width: 24px;
+    background-position: center center;
+    background-repeat: no-repeat;
+    float: right;
+    margin-left: 3px;
+    cursor: pointer;
+    border-radius: 3px;
+    background-image: url("../x_component_FindDesigner/$Main/default/icons/enter.png");
+}
+.keywordNode_area {
+    margin-left: 24px;
+    margin-right: 24px;
+    height: 30px;
+}
+.keywordNode_input {
+    border: 0;
+    width: 90%;
+    height: 26px;
+    line-height: 26px;
+    color: #888888;
+    font-size: 14px;
+}
+.keywordNode_input::placeholder {
+    color: #bbbbbb;
+}
+
+.previewNode_separator {
+    border-top: 1px solid #cccccc;
+    height: 10px;
+    cursor: row-resize;
+}
+.previewNode_separator_lr {
+    border-left: 1px solid #cccccc;
+    height: 100%;
+    background-color: #f0f0f0;
+    width: 10px;
+    cursor: col-resize;
+    float: left;
+}
+
+.previewNode_title {
+    height: 20px;
+    padding: 0 5px 5px 5px;
+    background-color: #f0f0f0;
+    border-bottom: 1px solid #cccccc;
+}
+.previewNode_title_lr {
+    height: 20px;
+    padding: 5px;
+    background-color: #f0f0f0;
+    border-bottom: 1px solid #cccccc;
+}
+.listNode_title {
+    height: 27px;
+    padding-top: 3px;
+    background-color: #f0f0f0;
+    border-bottom: 1px solid #cccccc;
+}
+.listNode_title_lr {
+    height: 27px;
+    padding-top: 3px;
+    background-color: #f0f0f0;
+    border-bottom: 1px solid #cccccc;
+}
+.listNode_area {
+    overflow: auto;
+}
+
+
+.previewNode_content {
+    background-color: #ffffff;
+    overflow: auto;
+}
+.previewNode_content_lr {
+    background-color: #ffffff;
+    overflow: auto;
+}
+.previewNode_title_icon {
+    background: transparent;
+    height: 20px;
+    width: 80px;
+    background-position: center center;
+    background-repeat: no-repeat;
+    float: left;
+}
+.previewNode_title_action {
+    float: right;
+    height: 20px;
+    width: 24px;
+    background-position: center center;
+    background-repeat: no-repeat;
+    background-image: url("../x_component_FindDesigner/$Main/default/icons/dockRight.png");
+    cursor: pointer;
+}
+.previewNode_title_action_lr {
+    float: right;
+    height: 20px;
+    width: 24px;
+    background-position: center center;
+    background-repeat: no-repeat;
+    background-image: url("../x_component_FindDesigner/$Main/default/icons/dockBottom.png");
+    cursor: pointer;
+}
+.previewNode_title_action_l {
+    float:  left;
+    height: 20px;
+    width: 24px;
+    background-position: center center;
+    background-repeat: no-repeat;
+    background-image: url("../x_component_FindDesigner/$Main/default/icons/dockBottom.png");
+    cursor: pointer;
+}
+
+.previewNode_title_content {
+    height: 20px;
+    line-height: 20px;
+    margin-left: 24px;
+    margin-right: 24px;
+}
+.inforNode {
+    display: table;
+    width: 100%;
+    height: 100%;
+}
+.inforNode div{
+    display: table-cell;
+    vertical-align: middle;
+    color: #bbbbbb;
+    text-align: center;
+}
+.listContentNode {
+}
+.loadding {
+    background-repeat: no-repeat;
+    background-position: center;
+    background-image: url("../x_component_FindDesigner/$Main/default/icons/loading.gif");
+}
+
+.listNode_title_info {
+    margin-left: 10px;
+    margin-right: 40px;
+    font-size: 12px;
+    color: #888888;
+    height: 24px;
+    line-height: 24px;
+}
+.listNode_title_progress {
+    height: 3px;
+}
+.listNode_title_progress_node {
+    height: 3px;
+    background-color: #0b58a2;
+    width: 0%;
+}
+.listNode_title_action {
+    float: right;
+    height: 24px;
+    width: 40px;
+    background-position: center;
+    background-repeat: no-repeat;
+    background-image: url("../x_component_FindDesigner/$Main/default/icons/stop_gray.png");
+    cursor: pointer;
+}
+.listNode_title_action_enabled {
+    background-image: url("../x_component_FindDesigner/$Main/default/icons/stop.png");
+}

+ 87 - 0
o2web/source/x_component_FindDesigner/$Main/default/view.html

@@ -0,0 +1,87 @@
+<div class="content" data-o2-element="contentNode">
+    <div class="filterNode" data-o2-element="filterNode">
+        <div class="filterNode_title">{{$.lp.filter}}</div>
+        <div class="filterNode_content" data-o2-events="click:checkFilter">
+            <div class="filterNode_item"><input checked type="checkbox" value="script" />{{$.lp.script}}(script)</div>
+            <div class="filterNode_item"><input checked type="checkbox" value="form" />{{$.lp.form}}(form)</div>
+            <div class="filterNode_item"><input checked type="checkbox" value="process" />{{$.lp.process}}(process)</div>
+            <div class="filterNode_item"><input checked type="checkbox" value="page" />{{$.lp.page}}(page)</div>
+            <div class="filterNode_item"><input checked type="checkbox" value="widget" />{{$.lp.widget}}(widget)</div>
+            <div class="filterNode_item"><input checked type="checkbox" value="view" />{{$.lp.view}}(view)</div>
+            <div class="filterNode_item"><input checked type="checkbox" value="statement" />{{$.lp.statement}}(statement)</div>
+<!--            <div class="filterNode_item"><input checked type="checkbox" value="stat" />{{$.lp.stat}}(stat)</div>-->
+        </div>
+    </div>
+
+    <div class="keywordNode" data-o2-element="keywordNode">
+        <div class="keywordNode_optionArea" data-o2-events="mouseover:overKeywordOption;mouseout:outKeywordOption">
+            <div class="keywordNode_optionItem caseSensitiveNode_false" data-o2-element="caseSensitiveNode" data-o2-events="click:setCaseSensitive" title="区分大小写"></div>
+            <div class="keywordNode_optionItem matchWholeWordNode_false" data-o2-element="matchWholeWordNode" data-o2-events="click:setMatchWholeWord" title="全字匹配"></div>
+            <div class="keywordNode_optionItem matchRegExpNode_false" data-o2-element="matchRegExpNode" data-o2-events="click:setMatchRegExp" title="正则表达式"></div>
+        </div>
+        <div class="keywordNode_inputArea">
+            <div class="keywordNode_icon"></div>
+            <div class="keywordNode_action"></div>
+            <div class="keywordNode_area">
+                <input class="keywordNode_input" data-o2-element="keywordInputNode" data-o2-events="keydown:checkFindDesigner" type="text" placeholder="{{$.lp.search_placeholder}}"/>
+            </div>
+
+        </div>
+    </div>
+
+    <div class="rangeNode" data-o2-element="rangeNode">
+        <div class="rangeNode_title">{{$.lp.range}}</div>
+        <div class="rangeNode_content" data-o2-element="rangeContentNode">
+            <div class="rangeType" data-o2-events="click:checkRange">
+                <div class="rangeType_Item"><input checked type="checkbox" value="processPlatform" />{{$.lp.processPlatform}}</div>
+                <div class="rangeType_Item"><input checked type="checkbox" value="cms" />{{$.lp.cms}}</div>
+                <div class="rangeType_Item"><input checked type="checkbox" value="portal" />{{$.lp.portal}}</div>
+                <div class="rangeType_Item"><input checked type="checkbox" value="query" />{{$.lp.query}}</div>
+                <div class="rangeType_Item"><input checked type="checkbox" value="service" />{{$.lp.service}}</div>
+            </div>
+
+        </div>
+        <div class="rangeNode_select">
+            <div class="rangeNode_select_area">
+                <div class="rangeNode_select_action_area">
+                    <div class="rangeNode_select_action" data-o2-element="rangeSelectedActionNode" data-o2-events="click:selectFindRange">{{$.lp.selectRange}}</div>
+                </div>
+                <div class="rangeNode_select_content" data-o2-element="rangeSelectedContentNode"></div>
+            </div>
+        </div>
+    </div>
+
+    <div class="resultNode" data-o2-element="resultNode">
+        <div class="listNode_lr" data-o2-element="listNode">
+            <div class="listNode_title_lr" data-o2-element="listTitleNode">
+                <div class="listNode_title_action"></div>
+                <div class="listNode_title_info" data-o2-element="listTitleInfoNode"></div>
+                <div class="listNode_title_progress">
+                    <div class="listNode_title_progress_node" data-o2-element="listTitleProgressNode"></div>
+                </div>
+            </div>
+
+            <div class="listNode_area" data-o2-element="listAreaNode">
+                <div class="inforNode" data-o2-element="listInfoNode"><div>{{$.lp.nothingFind_keyword}}</div></div>
+                <div class="listContentNode" data-o2-element="listContentNode"></div>
+            </div>
+
+
+        </div>
+        <div class="previewNode_lr" data-o2-element="previewNode">
+            <div class="previewNode_separator_lr" data-o2-element="previewSeparatorNode"></div>
+            <div class="previewNode_title_lr" data-o2-element="previewTitleNode">
+                <div class="previewNode_title_icon" data-o2-element="previewTitleToolbar">
+                    <span MWFnodetype="MWFToolBarButton" title="{{$.lp.saveDesigner}}" MWFButtonImage="../x_component_FindDesigner/$Main/default/icons/save.png" MWFButtonAction="saveDesigner" MWFButtonText=""></span>
+                    <span MWFnodetype="MWFToolBarButton" title="{{$.lp.openDesigner}}" MWFButtonImage="../x_component_FindDesigner/$Main/default/icons/open.png"  MWFButtonAction="openDesinger" MWFButtonText=""></span>
+                </div>
+                <div class="previewNode_title_action_lr" data-o2-element="previewTitleActionNode" title="{{$.lp.dockToBottom}}" data-o2-events="click:changeLayout"></div>
+                <div class="previewNode_title_content"></div>
+            </div>
+            <div class="previewNode_content_lr" data-o2-element="previewContentNode">
+                <div class="inforNode" data-o2-element="previewInforNode"><div>{{$.lp.nothingPreview}}</div></div>
+            </div>
+        </div>
+    </div>
+
+</div>

+ 1555 - 0
o2web/source/x_component_FindDesigner/FindWorker.js

@@ -0,0 +1,1555 @@
+var _worker = self;
+var _action = {
+    _checkRequest: function(s,f){
+        if (this.request.readyState === XMLHttpRequest.DONE) {
+            if (this.request.status === 200) {
+                this._doneRequest(s);
+            } else {
+                this._errorRequest(f);
+            }
+        }
+    },
+    _createRequest: function(s, f){
+        var request = new XMLHttpRequest();
+        request.addEventListener("readystatechange",function(){
+            if (this.readyState === XMLHttpRequest.DONE) {
+                if (this.status === 200) {
+                    var json = JSON.parse(this.responseText);
+                    var xToken = this.getResponseHeader("x-token");
+                    if (xToken){
+                        json.xToken = xToken;
+                    }
+                    if (s) s(json);
+                } else {
+                    if (f) f(this, this.responseText);
+                }
+            }
+        });
+        return request
+    },
+    sendRequest: function(data){
+        return new Promise(function(s, f){
+            var request = this._createRequest(s, f);
+            var method = data.method;
+            var noCache = !!data.noCache;
+            var async = !!data.loadAsync;
+            var withCredentials = !!data.credentials;
+            var url = data.address;
+            var body = data.body;
+            var debug = data.debug;
+            var token = data.token;
+
+            if (noCache) url = url+(((url.indexOf("?")!==-1) ? "&" : "?")+(new Date()).getTime());
+
+            request.open(method, url, async);
+
+            request.withCredentials = withCredentials;
+            request.setRequestHeader("Content-Type", "application/json; charset=utf-8");
+            request.setRequestHeader("Accept", "text/html,application/json,*/*");
+            if (debug) request.setRequestHeader("x-debugger", "true");
+            if (token){
+                request.setRequestHeader("x-token", token);
+                request.setRequestHeader("authorization", token);
+            }
+
+            request.send(body);
+        }.bind(this));
+    },
+
+    _doneRequest: function(s){
+        var json = JSON.parse(this.request.responseText);
+        var xToken = this.request.getResponseHeader("x-token");
+        if (xToken){
+            json.xToken = xToken;
+        }
+        if (s) s(json);
+        // _worker.postMessage({"type": "done", "data": json});
+        // _worker.close();
+    },
+    _errorRequest: function(f){
+        if (s) s(this.request, this.request.responseText);
+        // _worker.postMessage({"type":"error", "data": {"status":  this.request.status, "statusText":  this.request.statusText, "responseText":this.request.responseText}});
+        // _worker.close();
+    }
+};
+
+_worker.action = _action;
+
+_worker._receiveMessageReply = function(){
+    _worker.postMessage({
+        "type": "receive"
+    });
+};
+_worker._readyMessageReply = function(){
+    _worker.postMessage({
+        "type": "ready",
+        "count": this.filterOptionList.length
+    });
+};
+
+_worker._getRequestOption = function(data, par){
+    if (par){
+        Object.keys(par).forEach(function(k){
+            data.url = data.url.replace("{"+k+"}", par[k]);
+        });
+    }
+    return {
+        "method": data.method||"get",
+        "noCache": false,
+        "loadAsync": true,
+        "credentials": true,
+        "address": data.url,
+        "body": data.body || "",
+        "debug": data.debug || _worker.findData.debug,
+        "token": data.token || _worker.findData.token
+    };
+};
+
+_worker._createFilterOption = function(moduleType, appId, designerType, desingerId){
+    var filterOption = JSON.parse(_worker.filterOptionTemplete);
+    filterOption.moduleList.push({
+        "moduleType": moduleType,
+        "moduleAppList": [{"appId": appId, "designerList": [{"designerType": designerType, "designerIdList": [desingerId]}]}]
+    });
+    this.filterOptionList.push(filterOption);
+    return filterOption;
+};
+_worker._getDesingerModule = function(id, restful, par, moduleType, designerType){
+    var p = _worker.action.sendRequest(_worker._getRequestOption({"url": restful, "debug": _worker.findData.debug, "token": _worker.findData.token }, par));
+    return p.then(function(json){
+        list = json.data;
+        if (list) list.forEach(function(designer){
+            _worker._createFilterOption(moduleType, id, designerType, designer.id)
+        });
+    }, function(){
+        return Promise.resolve("");
+    });
+};
+
+_worker._getDesinger_processPlatform = function(id){
+    var promiseArr = [];
+    if (_worker.findData.filterOption.designerTypes.indexOf("script")!=-1){    //所有脚本
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listProcessScript, {"applicationId": id}, "processPlatform", "script"));
+    }
+    if (_worker.findData.filterOption.designerTypes.indexOf("form")!=-1){      //所有表单
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listProcessForm, {"applicationId": id}, "processPlatform", "form"));
+    }
+    if (_worker.findData.filterOption.designerTypes.indexOf("process")!=-1){   //所有流程
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listProcessProcess, {"applicationId": id}, "processPlatform", "process"));
+    }
+    return promiseArr;
+};
+
+_worker._getDesinger_cms = function(id){
+    var promiseArr = [];
+    if (_worker.findData.filterOption.designerTypes.indexOf("script")!=-1){    //所有脚本
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listCmsScript, {"flag": id}, "cms", "script"));
+    }
+    if (_worker.findData.filterOption.designerTypes.indexOf("form")!=-1){      //所有表单
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listCmsForm, {"appId": id}, "cms", "form"));
+    }
+    return promiseArr;
+};
+
+_worker._getDesinger_portal = function(id){
+    var promiseArr = [];
+    if (_worker.findData.filterOption.designerTypes.indexOf("script")!=-1){    //所有脚本
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listPortalScript, {"portalId": id}, "portal", "script"));
+    }
+    if (_worker.findData.filterOption.designerTypes.indexOf("page")!=-1){      //所有表单
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listPortalPage, {"portalId": id}, "portal", "page"));
+    }
+    if (_worker.findData.filterOption.designerTypes.indexOf("widget")!=-1){   //所有流程
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listPortalWidget, {"portalId": id}, "portal", "widget"));
+    }
+    return promiseArr;
+};
+
+_worker._getDesinger_query = function(id){
+    var promiseArr = [];
+    if (_worker.findData.filterOption.designerTypes.indexOf("view")!=-1){    //所有脚本
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listQueryView, {"flag": id}, "query", "view"));
+    }
+    if (_worker.findData.filterOption.designerTypes.indexOf("stat")!=-1){      //所有表单
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listQueryStat, {"flag": id}, "query", "stat"));
+    }
+    if (_worker.findData.filterOption.designerTypes.indexOf("statement")!=-1){   //所有流程
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listQueryStatement, {"flag": id}, "query", "statement"));
+    }
+    return promiseArr;
+};
+
+_worker._getDesinger_service = function(id){
+    var promiseArr = [];
+    if (_worker.findData.filterOption.designerTypes.indexOf("script")!=-1){    //所有脚本
+        if (id=="invoke"){
+            promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listInvoke, null, "service", "script"));
+        }else{
+            promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listAgent, null, "service", "script"));
+        }
+    }
+    return promiseArr;
+};
+
+
+_worker._listApplication = function(type){
+    switch (type){
+        case "processPlatform":
+            return this.action.sendRequest(_worker._getRequestOption({"url": this.findData.actions.listProcess, "debug": this.findData.debug, "token": this.findData.token }));
+        case "cms":
+            return this.action.sendRequest(_worker._getRequestOption({"url": this.findData.actions.listCms, "debug": this.findData.debug, "token": this.findData.token }));
+        case "portal":
+            return this.action.sendRequest(_worker._getRequestOption({"url": this.findData.actions.listPortal, "debug": this.findData.debug, "token": this.findData.token }));
+        case "query":
+            return this.action.sendRequest(_worker._getRequestOption({"url": this.findData.actions.listQuery, "debug": this.findData.debug, "token": this.findData.token }));
+    }
+
+};
+_worker._parseFindModule = function(moduleList){
+    var promiseArr = [];
+    moduleList.forEach(function(module){
+        if (module.moduleType==="service"){
+            if (!module.flagList || !module.flagList.length){
+
+                var filterOption = JSON.parse(_worker.filterOptionTemplete);
+                filterOption.moduleList.push({
+                    "moduleType": module.moduleType,
+                    "moduleAppList": [{"appId": "invoke"}]
+                });
+                this.filterOptionList.push(filterOption);
+
+                var filterOption = JSON.parse(_worker.filterOptionTemplete);
+                filterOption.moduleList.push({
+                    "moduleType": module.moduleType,
+                    "moduleAppList": [{"appId": "agent"}]
+                });
+                this.filterOptionList.push(filterOption);
+
+                promiseArr.push(Promise.resolve(""));
+                //promiseArr = promiseArr.concat(_worker["_getDesinger_"+module.moduleType]("invoke"));
+                //promiseArr = promiseArr.concat(_worker["_getDesinger_"+module.moduleType]("agent"));
+            }else{
+                module.flagList.forEach(function(flag){
+                    if (!flag.designerList || !flag.designerList.length){
+                        promiseArr = promiseArr.concat(_worker["_getDesinger_"+module.moduleType](flag.id));
+                    }else{
+                        flag.designerList.forEach(function(designer){
+                            var filterOption = _worker._createFilterOption(module.moduleType, flag.id, designer.designerType, designer.id)
+                            promiseArr = promiseArr.concat(Promise.resolve(filterOption));
+                        });
+                    }
+                });
+            }
+        }else{
+            if (!module.flagList || !module.flagList.length){
+                var p = _worker._listApplication(module.moduleType);
+                promiseArr.push(p.then(function(json){
+
+                    //按应用进行搜索
+                    if (json && json.data) json.data.forEach(function(app){
+                        var filterOption = JSON.parse(_worker.filterOptionTemplete);
+                        filterOption.moduleList.push({
+                            "moduleType": module.moduleType,
+                            "moduleAppList": [{"appId": app.id}]
+                        });
+                        this.filterOptionList.push(filterOption);
+                    });
+                    return Promise.resolve("");
+
+                    //按设计元素进行搜索
+                    // var pArr = [];
+                    // json.data.forEach(function(app){
+                    //     pArr = pArr.concat(_worker["_getDesinger_"+module.moduleType](app.id));
+                    // });
+                    // return Promise.all(pArr);
+                }, function(){
+                    return Promise.resolve("");
+                }));
+
+            }else{
+                module.flagList.forEach(function(flag){
+                    if (!flag.designerList || !flag.designerList.length){
+                        promiseArr = promiseArr.concat(_worker["_getDesinger_"+module.moduleType](flag.id));
+                    }else{
+                        flag.designerList.forEach(function(designer){
+                            var filterOption = _worker._createFilterOption(module.moduleType, flag.id, designer.designerType, designer.id)
+                            promiseArr = promiseArr.concat(Promise.resolve(filterOption));
+                        });
+                    }
+                });
+            }
+        }
+    }.bind(this));
+    return promiseArr;
+}
+
+_worker._findMessageReply = function(data, option){
+    //_worker.setTimeout(function(){
+        _worker.postMessage({
+            "type": "find",
+            "data": data,
+            "option": option
+        });
+    //}, 10);
+};
+_worker._findOptionReply = function(){
+    _worker.postMessage({
+        "type": "done"
+    });
+};
+_worker._findCompletedReply = function(data, option){
+    _worker.setTimeout(function(){
+        _worker.postMessage({
+            "type": "completed"
+        });
+    }, 100);
+};
+
+
+
+_worker._createFindMessageReplyData = function(module, designer, aliase, pattern){
+    return {
+        "module": module,
+        "appId": designer.appId,
+        "appName": designer.appName,
+        "designerId": designer.designerId,
+        "designerName": designer.designerName,
+        "designerType": designer.designerType,
+        "designerAliase": aliase,
+
+        "pattern": pattern
+    };
+};
+
+_worker._setFilterOptionRegex = function(){
+    var keyword = _worker.findData.filterOption.keyword;
+    keyword = keyword.replace("[", "\\[").replace("]", "\\]").replace("(", "\\(").replace(")", "\\)").replace("{", "\\{").replace("}", "\\}")
+        .replace("^", "\\^").replace("$", "\\$").replace(".", "\\.").replace("?", "\\?").replace("+", "\\+").replace("*", "\\*").replace("|", "\\|");
+
+    if (_worker.findData.filterOption.matchRegExp){
+        var flag = (_worker.findData.filterOption.caseSensitive) ? "gm" : "gmi";
+        this.keywordRegexp =  new RegExp(keyword, flag);
+    }else{
+        var flag = (_worker.findData.filterOption.caseSensitive) ? "gm" : "gmi";
+        keyword = (_worker.findData.filterOption.matchWholeWord) ? "\\b"+keyword+"\\b" : keyword;
+        this.keywordRegexp = new RegExp(keyword, flag);
+    }
+};
+
+_worker._findProcessPlatformParse_script = function(designer, option, module){
+    if (designer.patternList && designer.patternList.length){
+        // var action = this.findData.actions.getProcessScript;
+        //
+        // var p = _worker.action.sendRequest(_worker._getRequestOption({"url": action}, {"id": designer.designerId}));
+        // p.then(function(json){
+            designer.patternList.forEach(function(pattern){
+                if (pattern.property=="text"){
+                    //var scriptLines = json.data.text.split(/\n/);
+                    pattern.lines.forEach(function(line){
+                        var scriptText = line.lineValue;
+                        _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                            "property": pattern.property,
+                            "value": scriptText,
+                            "line": line.line
+                        }), option);
+
+                        // var scriptText = scriptLines[line-1];
+                        // while ((arr = this.keywordRegexp.exec(scriptText)) !== null) {
+                        //     var col = arr.index;
+                        //     var key = arr[0];
+                        //     var value = arr.input;
+                        //     _worker._findMessageReply(_worker._createFindMessageReplyData("processPlatform", designer, json.data.aliase, {
+                        //         "property": pattern.property,
+                        //         "value": value,
+                        //         "line": line,
+                        //         "column": col,
+                        //         "key": key
+                        //     }), option);
+                        // }
+                    });
+                }else{
+                    // _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                    //     "property": pattern.property,
+                    //     "value": pattern.propertyValue
+                    // }), option);
+                }
+            });
+        //}, function(){});
+    }
+};
+
+_worker.findScriptLineValue = function(result, code, preLine, preIndex, len){
+    var lineRegexp = /\r\n|\n|\r/g;
+    var preText = code.substring(preIndex, result.index);
+    var m = preText.match(lineRegexp);
+    preLine += (m) ? m.length : 0;
+
+    var value = result[0];
+
+    var n = result.index-1;
+    var char = code.charAt(n);
+    while (!lineRegexp.test(char) && n>=0){
+        value = char+value;
+        n--;
+        char = code.charAt(n);
+    }
+    n =  this.keywordRegexp.lastIndex;
+    char = code.charAt(n);
+    while (!lineRegexp.test(char) && n<len){
+        value = value+char;
+        n++;
+        char = code.charAt(n);
+    }
+    preIndex = this.keywordRegexp.lastIndex = n;
+    return {"value": value, "preLine": preLine, "preIndex": preIndex};
+};
+
+_worker.findInDesigner_script = function(formData, key, module, designer, propertyDefinition, option, mode, path){
+    if (formData[key].hasOwnProperty("code")) path.push("code");
+    var code = formData[key].code || formData[key];
+    if (code){
+        this.keywordRegexp.lastIndex = 0;
+        var len = code.length;
+
+        var preLine = 0;
+        var preIndex = 0;
+        var result;
+        while ((result = this.keywordRegexp.exec(code)) !== null){
+            var obj = _worker.findScriptLineValue(result, code, preLine, preIndex, len);
+            preLine = obj.preLine;
+            preIndex = obj.preIndex;
+
+            _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                "type": formData.type,
+                "propertyType": propertyDefinition.type || "text",
+                "propertyName": propertyDefinition.name,
+                "name": formData.name || formData.id,
+                "id": formData.id,
+                "key": key,
+                "value": obj.value,
+                "line": preLine+1,
+                "mode": mode,
+                "path": path
+            }), option);
+        }
+    }
+};
+
+
+
+
+_worker.findInDesigner_events = function(formData, key, module, designer, propertyDefinition, option, mode, path){
+    var eventObj = formData[key];
+    Object.keys(eventObj).forEach(function(evkey){
+        var code = eventObj[evkey].code;
+        this.keywordRegexp.lastIndex = 0;
+        var len = code.length;
+
+        var preLine = 0;
+        var preIndex = 0;
+        var result;
+        while ((result = this.keywordRegexp.exec(code)) !== null){
+            var obj = _worker.findScriptLineValue(result, code, preLine, preIndex, len);
+            preLine = obj.preLine;
+            preIndex = obj.preIndex;
+
+            _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                "type": formData.type,
+                "propertyType": propertyDefinition.type || "text",
+                "propertyName": propertyDefinition.name,
+                "name": formData.name || formData.id,
+                "id": formData.id,
+                "key": key,
+                "evkey": evkey,
+                "value": obj.value,
+                "line": preLine+1,
+                "mode": mode,
+                "path": (path) ? path.concat([evkey, "code"]) : ""
+            }), option);
+        }
+    });
+};
+_worker.findInDesigner_map = function(formData, key, module, designer, propertyDefinition, option, mode, path){
+    var map = formData[key];
+    Object.keys(map).forEach(function(evkey) {
+        this.keywordRegexp.lastIndex = 0;
+        var text = map[evkey];
+        if (text){
+            if ((typeof text)=="string") {
+                if (this.keywordRegexp.test(text)) {
+                    _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                        "type": formData.type,
+                        "propertyType": propertyDefinition.type || "text",
+                        "propertyName": propertyDefinition.name,
+                        "name": formData.name || formData.id,
+                        "id": formData.id,
+                        "key": key,
+                        "value": evkey + ": " + text,
+                        "mode": mode,
+                        "path": path
+                    }), option);
+                }
+            }else{
+                Object.keys(text).forEach(function (stylekey){
+                    this.keywordRegexp.lastIndex = 0;
+
+                    if (this.keywordRegexp.test(text[stylekey])) {
+                        _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                            "type": formData.type,
+                            "propertyType": propertyDefinition.type || "text",
+                            "propertyName": propertyDefinition.name+"-"+evkey,
+                            "name": formData.name || formData.id,
+                            "id": formData.id,
+                            "key": key,
+                            "value": stylekey + ": " + text[stylekey],
+                            "mode": mode,
+                            "path": path.concat(evkey)
+                        }), option);
+                    }
+                });
+            }
+        }
+    });
+};
+_worker.findInDesigner_array = function(formData, key, module, designer, propertyDefinition, option, mode, path){
+    var arr = formData[key];
+    arr.forEach(function(v, i) {
+        this.keywordRegexp.lastIndex = 0;
+        var text = v.toString();
+        if (this.keywordRegexp.test(text)){
+            _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                "type": formData.type,
+                "propertyType": propertyDefinition.type || "text",
+                "propertyName": propertyDefinition.name,
+                "name": formData.name || formData.id,
+                "id": formData.id,
+                "line": i+1,
+                "key": key,
+                "value": text,
+                "mode": mode,
+                "path": path
+            }), option);
+        }
+    });
+};
+_worker.findInDesigner_objectArray = function(formData, key, module, designer, propertyDefinition, option, mode, path){
+    var arr = formData[key];
+    arr.forEach(function(map, i) {
+        var p = path.concat(i);
+        Object.keys(map).forEach(function(evkey) {
+            this.keywordRegexp.lastIndex = 0;
+            var text = map[evkey];
+            if (this.keywordRegexp.test(text)){
+                _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                    "type": formData.type,
+                    "propertyType": propertyDefinition.type || "text",
+                    "propertyName": propertyDefinition.name,
+                    "name": formData.name || formData.id,
+                    "id": formData.id,
+                    "line": i+1,
+                    "key": key,
+                    "value": evkey+": "+text,
+                    "mode": mode,
+                    "path": p.concat(evkey)
+                }), option);
+            }
+        });
+    });
+};
+
+_worker.findInDesigner_duty = function(formData, key, module, designer, propertyDefinition, option, mode, path){
+    var text = formData[key];
+    if (text){
+        var json = JSON.parse(text);
+        json.forEach(function(duty, i) {
+            var p = path.concat(i);
+            this.keywordRegexp.lastIndex = 0;
+            var text = duty.name;
+            if (text) if (this.keywordRegexp.test(text)){
+                _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                    "type": formData.type,
+                    "propertyType": propertyDefinition.type || "text",
+                    "propertyName": propertyDefinition.name,
+                    "name": formData.name || formData.id,
+                    "id": formData.id,
+                    "key": key,
+                    "line": i+1,
+                    "valueKey": "name",
+                    "value": "name:"+text,
+                    "mode": mode,
+                    "path": p.concat("name")
+                }), option);
+            }
+
+            var code = duty.code;
+            if (code){
+                this.keywordRegexp.lastIndex = 0;
+                var len = code.length;
+                var idx = i+1;
+                var preLine = 0;
+                var preIndex = 0;
+                var result;
+                while ((result = this.keywordRegexp.exec(code)) !== null){
+                    var obj = _worker.findScriptLineValue(result, code, preLine, preIndex, len);
+                    preLine = obj.preLine;
+                    preIndex = obj.preIndex;
+
+
+                    _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                        "type": formData.type,
+                        "propertyType": propertyDefinition.type || "text",
+                        "propertyName": propertyDefinition.name+"(code)&nbsp;"+idx+"."+duty.name,
+                        "name": formData.name || formData.id,
+                        "id": formData.id,
+                        "key": key,
+                        "valueKey": "code",
+                        "idx": i,
+                        "value": obj.value,
+                        "line": preLine+1,
+                        "mode": mode,
+                        "path": p.concat("code")
+                    }), option);
+                }
+            }
+        });
+    }
+};
+
+_worker.findInDesigner_actions = function(formData, key, module, designer, propertyDefinition, option, mode, path){
+    var arr = formData[key];
+    arr.forEach(function(action, i) {
+        var p = path.concat(i);
+        this.keywordRegexp.lastIndex = 0;
+        var text = action.text;
+        if (text) if (this.keywordRegexp.test(text)){
+            _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                "type": formData.type,
+                "propertyType": propertyDefinition.type || "text",
+                "propertyName": propertyDefinition.name,
+                "name": formData.name || formData.id,
+                "id": formData.id,
+                "key": key,
+                "line": i+1,
+                "value": "text:"+text,
+                "mode": mode,
+                "path": p.concat("text")
+            }), option);
+        }
+
+        var code = action.actionScript;
+        if (code){
+            this.keywordRegexp.lastIndex = 0;
+            var len = code.length;
+            var idx = i+1;
+            var preLine = 0;
+            var preIndex = 0;
+            var result;
+            while ((result = this.keywordRegexp.exec(code)) !== null){
+                var obj = _worker.findScriptLineValue(result, code, preLine, preIndex, len);
+                preLine = obj.preLine;
+                preIndex = obj.preIndex;
+
+
+                _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                    "type": formData.type,
+                    "propertyType": propertyDefinition.type || "text",
+                    "propertyName": propertyDefinition.name+"(actionScript)&nbsp;"+action.text,
+                    "name": formData.name || formData.id,
+                    "id": formData.id,
+                    "key": key,
+                    "value": obj.value,
+                    "line": preLine+1,
+                    "mode": mode,
+                    "path": p.concat("actionScript")
+                }), option);
+            }
+        }
+        code = action.condition;
+        if (code){
+            this.keywordRegexp.lastIndex = 0;
+            var len = code.length;
+            var idx = i+1;
+            var preLine = 0;
+            var preIndex = 0;
+            var result;
+            while ((result = this.keywordRegexp.exec(code)) !== null){
+                var obj = _worker.findScriptLineValue(result, code, preLine, preIndex, len);
+                preLine = obj.preLine;
+                preIndex = obj.preIndex;
+
+                _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                    "type": formData.type,
+                    "propertyType": propertyDefinition.type || "text",
+                    "propertyName": propertyDefinition.name+"(condition)&nbsp;"+action.text,
+                    "name": formData.name || formData.id,
+                    "id": formData.id,
+                    "key": key,
+                    "value": obj.value,
+                    "line": preLine+1,
+                    "mode": mode,
+                    "path": p.concat("condition")
+                }), option);
+            }
+        }
+    });
+};
+
+_worker.findInDesigner_filter = function(formData, key, module, designer, propertyDefinition, option, mode){
+    var arr = formData[key];
+    arr.forEach(function(filter, i) {
+        this.keywordRegexp.lastIndex = 0;
+        var text = filter.path;
+        if (text) if (this.keywordRegexp.test(text)){
+            _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                "type": formData.type,
+                "propertyType": propertyDefinition.type || "text",
+                "propertyName": propertyDefinition.name,
+                "name": formData.name || formData.id,
+                "id": formData.id,
+                "key": key,
+                "line": i+1,
+                "value": "path:"+text,
+                "mode": mode
+            }), option);
+        }
+
+        var value = filter.value;
+        if (value) if (this.keywordRegexp.test(value)){
+            _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                "type": formData.type,
+                "propertyType": propertyDefinition.type || "text",
+                "propertyName": propertyDefinition.name,
+                "name": formData.name || formData.id,
+                "id": formData.id,
+                "key": key,
+                "line": i+1,
+                "value": "value:"+value,
+                "mode": mode
+            }), option);
+        }
+
+        var otherValue = filter.otherValue;
+        if (otherValue) if (this.keywordRegexp.test(otherValue)){
+            _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                "type": formData.type,
+                "propertyType": propertyDefinition.type || "text",
+                "propertyName": propertyDefinition.name,
+                "name": formData.name || formData.id,
+                "id": formData.id,
+                "key": key,
+                "line": i+1,
+                "value": "otherValue:"+otherValue,
+                "mode": mode
+            }), option);
+        }
+
+
+        var code = (filter.code) ? filter.code.code: "";
+        if (code){
+            this.keywordRegexp.lastIndex = 0;
+            var len = code.length;
+            var idx = i+1;
+            var preLine = 0;
+            var preIndex = 0;
+            var result;
+            while ((result = this.keywordRegexp.exec(code)) !== null){
+                var obj = _worker.findScriptLineValue(result, code, preLine, preIndex, len);
+                preLine = obj.preLine;
+                preIndex = obj.preIndex;
+
+
+                _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                    "type": formData.type,
+                    "propertyType": propertyDefinition.type || "text",
+                    "propertyName": propertyDefinition.name+"(code)&nbsp;"+filter.path,
+                    "name": formData.name || formData.id,
+                    "id": formData.id,
+                    "key": key,
+                    "value": obj.value,
+                    "line": preLine+1,
+                    "mode": mode
+                }), option);
+            }
+        }
+
+        code = (filter.valueScript) ? filter.valueScript.code : "";
+        if (code){
+            this.keywordRegexp.lastIndex = 0;
+            var len = code.length;
+            var idx = i+1;
+            var preLine = 0;
+            var preIndex = 0;
+            var result;
+            while ((result = this.keywordRegexp.exec(code)) !== null){
+                var obj = _worker.findScriptLineValue(result, code, preLine, preIndex, len);
+                preLine = obj.preLine;
+                preIndex = obj.preIndex;
+
+
+                _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                    "type": formData.type,
+                    "propertyType": propertyDefinition.type || "text",
+                    "propertyName": propertyDefinition.name+"(valueScript)&nbsp;"+filter.path,
+                    "name": formData.name || formData.id,
+                    "id": formData.id,
+                    "key": key,
+                    "value": obj.value,
+                    "line": preLine+1,
+                    "mode": mode
+                }), option);
+            }
+        }
+
+    });
+};
+
+_worker.findInDesigner_serial = function(formData, key, module, designer, propertyDefinition, option, mode){
+    var text = formData[key];
+    if (text) {
+        var json = JSON.parse(text);
+
+        json.forEach(function(serial, i) {
+            this.keywordRegexp.lastIndex = 0;
+            switch (serial.key){
+                case "text":
+                case "unitAttribute":
+                    if (this.keywordRegexp.test(serial.value)){
+                        _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                            "type": formData.type,
+                            "propertyType": propertyDefinition.type || "text",
+                            "propertyName": propertyDefinition.name+"&nbsp"+serial.key+"&nbsp",
+                            "name": formData.name || formData.id,
+                            "id": formData.id,
+                            "key": key,
+                            "value": serial.value
+                        }), option);
+                    }
+                    break;
+                case "script":
+                    var code = serial.value;
+                    if (serial.value){
+                        if (code){
+                            this.keywordRegexp.lastIndex = 0;
+                            var len = code.length;
+                            var idx = i+1;
+                            var preLine = 0;
+                            var preIndex = 0;
+                            var result;
+                            while ((result = this.keywordRegexp.exec(code)) !== null){
+                                var obj = _worker.findScriptLineValue(result, code, preLine, preIndex, len);
+                                preLine = obj.preLine;
+                                preIndex = obj.preIndex;
+
+                                _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                                    "type": formData.type,
+                                    "propertyType": propertyDefinition.type || "text",
+                                    "propertyName": propertyDefinition.name+"&nbsp"+serial.key+"&nbsp",
+                                    "name": formData.name || formData.id,
+                                    "id": formData.id,
+                                    "key": key,
+                                    "value": obj.value,
+                                    "line": preLine+1
+                                }), option);
+                            }
+                        }
+                    }
+                    break;
+                default:
+                    //nothing
+            }
+        });
+    }
+};
+
+
+_worker.findInDesigner_projection = function(formData, key, module, designer, propertyDefinition, option, mode){
+    var text = formData[key];
+    if (text) {
+        var json = JSON.parse(text);
+        json.forEach(function(projection, i) {
+            this.keywordRegexp.lastIndex = 0;
+            var text = projection.path+"->"+projection.name;
+            if (this.keywordRegexp.test(text)){
+                _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                    "type": formData.type,
+                    "propertyType": propertyDefinition.type || "text",
+                    "propertyName": propertyDefinition.name,
+                    "name": formData.name || formData.id,
+                    "id": formData.id,
+                    "key": key,
+                    "value": text,
+                    "line": i
+                }), option);
+            }
+        });
+    }
+};
+
+_worker.findInDesigner_selectConfig_script = function(formData, key, module, designer, propertyDefinition, option, mode, code, propertyName){
+    if (code){
+        this.keywordRegexp.lastIndex = 0;
+        var len = code.length;
+        var preLine = 0;
+        var preIndex = 0;
+        var result;
+        while ((result = this.keywordRegexp.exec(code)) !== null){
+            var obj = _worker.findScriptLineValue(result, code, preLine, preIndex, len);
+            preLine = obj.preLine;
+            preIndex = obj.preIndex;
+
+            _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                "type": formData.type,
+                "propertyType": propertyDefinition.type || "text",
+                "propertyName": propertyName,
+                "name": formData.name || formData.id,
+                "id": formData.id,
+                "key": key,
+                "value": obj.value,
+                "line": preLine+1
+            }), option);
+        }
+    }
+};
+_worker.findInDesigner_selectConfig_events = function(formData, key, module, designer, propertyDefinition, option, mode, eventObj, propertyName){
+    Object.keys(eventObj).forEach(function(evkey){
+        var code = eventObj[evkey].code;
+        this.keywordRegexp.lastIndex = 0;
+        var len = code.length;
+
+        var preLine = 0;
+        var preIndex = 0;
+        var result;
+        while ((result = this.keywordRegexp.exec(code)) !== null){
+            var obj = _worker.findScriptLineValue(result, code, preLine, preIndex, len);
+            preLine = obj.preLine;
+            preIndex = obj.preIndex;
+
+            _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                "type": formData.type,
+                "propertyType": propertyDefinition.type || "text",
+                "propertyName": propertyName,
+                "name": formData.name || formData.id,
+                "id": formData.id,
+                "key": key,
+                "evkey": evkey,
+                "value": obj.value,
+                "line": preLine+1,
+                "mode": mode
+            }), option);
+        }
+    });
+};
+
+_worker.findInDesigner_selectConfig = function(formData, key, module, designer, propertyDefinition, option, mode){
+    var text = formData[key];
+    if (text) {
+        var json = JSON.parse(text);
+        json.forEach(function(config, i) {
+            var idx = i+1;
+            var propertyName = propertyDefinition.name+"&nbsp"+idx+"-"+config.name+"&nbsp默认值脚本(defaultValue)&nbsp";
+            _worker.findInDesigner_selectConfig_script(formData, key, module, designer, propertyDefinition, option, mode, config.defaultValue.code, propertyName);
+
+            propertyName = propertyDefinition.name+"&nbsp"+idx+"-"+config.name+"&nbsp校验脚本(validation)&nbsp";
+            _worker.findInDesigner_selectConfig_script(formData, key, module, designer, propertyDefinition, option, mode, config.validation.code, propertyName);
+
+            propertyName = propertyDefinition.name+"&nbsp"+idx+"-"+config.name+"&nbsp隐藏脚本(hiddenScript)&nbsp";
+            _worker.findInDesigner_selectConfig_script(formData, key, module, designer, propertyDefinition, option, mode, config.hiddenScript.code, propertyName);
+
+            propertyName = propertyDefinition.name+"&nbsp"+idx+"-"+config.name+"&nbsp身份选择组织范围脚本(identityRangeKey)&nbsp";
+            _worker.findInDesigner_selectConfig_script(formData, key, module, designer, propertyDefinition, option, mode, config.identityRangeKey.code, propertyName);
+
+            propertyName = propertyDefinition.name+"&nbsp"+idx+"-"+config.name+"&nbsp职务范围脚本(rangeDutyKey)&nbsp";
+            _worker.findInDesigner_selectConfig_script(formData, key, module, designer, propertyDefinition, option, mode, config.rangeDutyKey.code, propertyName);
+
+            propertyName = propertyDefinition.name+"&nbsp"+idx+"-"+config.name+"&nbsp身份添加脚本(identityIncludeKey)&nbsp";
+            _worker.findInDesigner_selectConfig_script(formData, key, module, designer, propertyDefinition, option, mode, config.identityIncludeKey.code, propertyName);
+
+            propertyName = propertyDefinition.name+"&nbsp"+idx+"-"+config.name+"&nbsp组织选择组织范围脚本(unitRangeKey)&nbsp";
+            _worker.findInDesigner_selectConfig_script(formData, key, module, designer, propertyDefinition, option, mode, config.unitRangeKey.code, propertyName);
+
+            propertyName = propertyDefinition.name+"&nbsp"+idx+"-"+config.name+"&nbsp排除范围脚本(exclude)&nbsp";
+            _worker.findInDesigner_selectConfig_script(formData, key, module, designer, propertyDefinition, option, mode, config.exclude.code, propertyName);
+
+            var arr = config.rangeDuty;
+            if (arr && arr.length) arr.forEach(function(v, i) {
+                this.keywordRegexp.lastIndex = 0;
+                var text = v.toString();
+                if (this.keywordRegexp.test(text)){
+
+                    propertyName = propertyDefinition.name+"&nbsp"+idx+"-"+config.name+"&nbsp职务范围(rangeDuty)&nbsp";
+
+                    _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                        "type": formData.type,
+                        "propertyType": propertyDefinition.type || "text",
+                        "propertyName": propertyName,
+                        "name": formData.name || formData.id,
+                        "id": formData.id,
+                        "line": i+1,
+                        "key": key,
+                        "value": text,
+                        "mode": mode
+                    }), option);
+                }
+            });
+
+            propertyName = propertyDefinition.name+"&nbsp"+idx+"-"+config.name+"&nbsp事件(events)&nbsp";
+            _worker.findInDesigner_selectConfig_events(formData, key, module, designer, propertyDefinition, option, mode, config.events, propertyName);
+        });
+    }
+};
+
+_worker.findInDesigner_text = function(formData, key, module, designer, propertyDefinition, option, mode){
+    this.keywordRegexp.lastIndex = 0;
+    var text = formData[key];
+    if (this.keywordRegexp.test(text)){
+        _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+            "type": formData.type,
+            "propertyType": propertyDefinition.type || "text",
+            "propertyName": propertyDefinition.name,
+            "name": formData.name || formData.id,
+            "id": formData.id,
+            "key": key,
+            "value": text,
+            "mode": mode
+        }), option);
+    }
+};
+
+_worker.findInDesignerProperty = function(key, propertyDefinition, formData, option, module, designer, mode, path){
+    if (propertyDefinition){
+        switch (propertyDefinition.type){
+            case "html":
+                _worker.findInDesigner_script(formData, key, module, designer, propertyDefinition, option, mode, path);
+                break;
+            case "script":
+            case "css":
+            case "sql":
+                _worker.findInDesigner_script(formData, key, module, designer, propertyDefinition, option, mode, path);
+                break;
+            case "events":
+                _worker.findInDesigner_events(formData, key, module, designer, propertyDefinition, option, mode, path);
+                break;
+            case "map":
+                _worker.findInDesigner_map(formData, key, module, designer, propertyDefinition, option, mode, path);
+                break;
+            case "array":
+                _worker.findInDesigner_array(formData, key, module, designer, propertyDefinition, option, mode, path);
+                break;
+            case "object-array":
+                _worker.findInDesigner_objectArray(formData, key, module, designer, propertyDefinition, option, mode, path);
+                break;
+            case "duty":
+                _worker.findInDesigner_duty(formData, key, module, designer, propertyDefinition, option, mode, path);
+                break;
+            case "actions":
+                _worker.findInDesigner_actions(formData, key, module, designer, propertyDefinition, option, mode, path);
+                break;
+            case "filter":
+                _worker.findInDesigner_filter(formData, key, module, designer, propertyDefinition, option, mode, path);
+                break;
+            case "serial":
+                _worker.findInDesigner_serial(formData, key, module, designer, propertyDefinition, option, mode, path);
+                break;
+            case "projection":
+                _worker.findInDesigner_projection(formData, key, module, designer, propertyDefinition, option, mode, path);
+                break;
+            case "selectConfig":
+                _worker.findInDesigner_selectConfig(formData, key, module, designer, propertyDefinition, option, mode, path);
+                break;
+            default:
+                _worker.findInDesigner_text(formData, key, module, designer, propertyDefinition, option, mode, path);
+        }
+    }
+}
+
+_worker.findInDesigner = function(formData, option, module, designer, mode, path){
+    Object.keys(formData).forEach(function(key){
+        var propertyDefinition = this.designerPropertysData.form[key];
+        _worker.findInDesignerProperty(key, propertyDefinition, formData, option, module, designer, mode, path.concat(key));
+    });
+};
+
+_worker.decodeJsonString = function(str){
+    var tmp = "[\""+str+"\"]";
+    var dataObj = (JSON.parse(tmp));
+    return dataObj[0];
+};
+
+_worker._getDesignerData = function(designer, module){
+    var action = "";
+
+    switch (designer.designerType){
+        case "form":
+            if (module=="processPlatform") action = this.findData.actions.getProcessForm
+            else if (module=="cms") action = this.findData.actions.getCmsForm;
+            break;
+        case "process":
+            action = this.findData.actions.getProcessProcess;
+            break;
+        case "page":
+            action = this.findData.actions.getPortalPage;
+            break;
+        case "widget":
+            action = this.findData.actions.getPortalWidget;
+            break;
+        case "view":
+            action = this.findData.actions.getQueryView;
+            break;
+        case "statement":
+            action = this.findData.actions.getQueryStatement;
+            break;
+    }
+
+    if (action){
+        var formPromise = _worker.action.sendRequest(_worker._getRequestOption({"url": action}, {"id": designer.designerId}));
+        if (!this.designerPropertysData) this.designerPropertysData = _worker.action.sendRequest(_worker._getRequestOption({"url": "../x_component_FindDesigner/propertys.json"}));
+        return Promise.all([formPromise, this.designerPropertysData]);
+    }
+};
+
+_worker._findInDesigner_form = function(formData, designer, option, module, path){
+    var mode = formData.json.mode;
+    path.push("json");
+    _worker.findInDesigner(formData.json, option, module, designer, mode, path);
+
+    path.push("moduleList");
+    for (key in formData.json.moduleList){
+        if (formData.json.moduleList[key].recoveryStyles) formData.json.moduleList[key].styles = formData.json.moduleList[key].recoveryStyles;
+        if (formData.json.moduleList[key].recoveryInputStyles) formData.json.moduleList[key].inputStyles = formData.json.moduleList[key].recoveryInputStyles;
+
+        _worker.findInDesigner(formData.json.moduleList[key], option, module, designer, mode, path.concat(key));
+    }
+};
+
+_worker._findProcessPlatformParse_form = function(designer, option, module){
+    if (designer.patternList && designer.patternList.length){
+        var p = _worker._getDesignerData(designer, module);
+        if (p){
+            var patternPropertys = designer.patternList.map(function(a){return a.property;});
+            p.then(function(arr){
+                var formJson = arr[0];
+                this.designerPropertysData = arr[1];
+                if (patternPropertys.indexOf("data")!=-1){
+                    var formData = JSON.parse(_worker.decodeJsonString(formJson.data.data));
+                    _worker._findInDesigner_form(formData, designer, option, module, ["data"]);
+                }
+                if (patternPropertys.indexOf("mobileData")!=-1){
+                    var formData = JSON.parse(_worker.decodeJsonString(formJson.data.mobileData));
+                    _worker._findInDesigner_form(formData, designer, option, module, ["mobileData"])
+                }
+            }, function(){});
+        }
+    }
+};
+
+_worker._findProcessPlatformParse_view = function(designer, option, module){
+    debugger;
+    if (designer.patternList && designer.patternList.length){
+        if (!this.designerPropertysData) this.designerPropertysData = _worker.action.sendRequest(_worker._getRequestOption({"url": "../x_component_FindDesigner/propertys.json"}));
+        var patternPropertys = designer.patternList.map(function(a){return a.property;});
+        if (patternPropertys.indexOf("data")!=-1){
+
+            var p = _worker._getDesignerData(designer, module);
+            if (p) {
+                p.then(function (arr) {
+                    var viewJson = arr[0].data;
+                    this.designerPropertysData = arr[1];
+
+                    var viewData = JSON.parse(viewJson.data);
+
+                    viewData.type = "View";
+                    viewData.name = viewJson.name;
+                    Object.keys(viewData).forEach(function(key){
+                        if (key!=="where" && key!=="selectList" && key!=="actionbarList" && key!=="pagingList" && key!=="type" && key!=="name" ){
+                            var propertyDefinition = this.designerPropertysData.view[key];
+                            _worker.findInDesignerProperty(key, propertyDefinition, viewData, option, module, designer, null, ["data", key]);
+                        }
+                    });
+
+                    if (viewData.where) {
+                        viewData.where.type = "View";
+                        viewData.where.name = viewJson.name;
+                        Object.keys(viewData.where).forEach(function (key) {
+                            if (key !== "type" && key !== "name") {
+                                var propertyDefinition = this.designerPropertysData.view[key];
+                                _worker.findInDesignerProperty(key, propertyDefinition, viewData.where, option, module, designer, null, ["data", "where", key]);
+                            }
+                        });
+                    }
+
+                    if (viewData.selectList) {
+                        viewData.selectList.forEach(function (col, i) {
+                            col.type = "column";
+                            col.name = col.displayName;
+                            Object.keys(col).forEach(function (key) {
+                                if (key !== "name" && key !== "type") {
+                                    var propertyDefinition = this.designerPropertysData.view[key];
+                                    _worker.findInDesignerProperty(key, propertyDefinition, col, option, module, designer, null, ["data", "selectList", i, key]);
+                                }
+                            });
+                        });
+                    }
+
+                    if (viewData.actionbarList) {
+                        viewData.actionbarList.forEach(function (item, i) {
+                            item.type = "actionbar";
+                            item.name = item.type;
+                            Object.keys(item).forEach(function (key) {
+                                if (key !== "name" && key !== "type") {
+                                    var propertyDefinition = this.designerPropertysData.view[key];
+                                    _worker.findInDesignerProperty(key, propertyDefinition, item, option, module, designer, null, ["data", "actionbarList", i, key]);
+                                }
+                            });
+                        });
+                    }
+
+                    if (viewData.pagingList) {
+                        viewData.pagingList.forEach(function (item, i) {
+                            item.type = "paging";
+                            item.name = item.type;
+                            Object.keys(item).forEach(function (key) {
+                                if (key !== "name" && key !== "type") {
+                                    var propertyDefinition = this.designerPropertysData.view[key];
+                                    _worker.findInDesignerProperty(key, propertyDefinition, item, option, module, designer, null, ["data", "pagingList", i, key]);
+                                }
+                            });
+                        });
+                    }
+
+                }, function () {
+                });
+            }
+        }else{
+            Promise.resolve(this.designerPropertysData).then(function(data){
+                this.designerPropertysData = data;
+                designer.patternList.forEach(function(pattern){
+                    var propertyDefinition = this.designerPropertysData.view[pattern.property];
+                    if (propertyDefinition){
+                        _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+                            "type": "View",
+                            "propertyType": propertyDefinition.type || "text",
+                            "propertyName": propertyDefinition.name,
+                            "name": designer.designerName,
+                            "key": pattern.property,
+                            "path": [pattern.property],
+                            "value": pattern.propertyValue
+                        }), option);
+                    }
+                });
+            }, function(){});
+        }
+    }
+}
+
+_worker._findProcessPlatformParse_statement = function(designer, option, module){
+    if (designer.patternList && designer.patternList.length){
+        if (!this.designerPropertysData) this.designerPropertysData = _worker.action.sendRequest(_worker._getRequestOption({"url": "../x_component_FindDesigner/propertys.json"}));
+        // var patternPropertys = designer.patternList.map(function(a){return a.property;});
+        // if (patternPropertys.indexOf("view")!=-1){
+debugger;
+            var p = _worker._getDesignerData(designer, module);
+            if (p) {
+                p.then(function (arr) {
+                    var statementJson = arr[0].data;
+                    this.designerPropertysData = arr[1];
+
+                    designer.patternList.forEach(function(pattern){
+                        if (pattern.property=="view"){
+                            if ((typeof statementJson.view)=="string"){
+                                statementJson.view = JSON.parse(statementJson.view);
+                            }
+                            var viewData = statementJson.view.data;
+                            if (viewData){
+                                viewData.type = "View";
+                                viewData.name = statementJson.name;
+                                Object.keys(viewData).forEach(function(key){
+                                    if (key!=="where" && key!=="selectList" && key!=="actionbarList" && key!=="pagingList" && key!=="type" && key!=="name" ){
+                                        var propertyDefinition = this.designerPropertysData.view[key];
+                                        _worker.findInDesignerProperty(key, propertyDefinition, viewData, option, module, designer, null, ["view", "data", key]);
+                                    }
+                                });
+
+                                if (viewData.where) {
+                                    viewData.where.type = "View";
+                                    viewData.where.name = viewJson.name;
+                                    Object.keys(viewData.where).forEach(function(key){
+                                        if ( key!=="type" && key!=="name"){
+                                            var propertyDefinition = this.designerPropertysData.view[key];
+                                            _worker.findInDesignerProperty(key, propertyDefinition, viewData.where, option, module, designer, null, ["view", "data", "where", key]);
+                                        }
+                                    });
+                                }
+
+                                if (viewData.selectList) {
+                                    viewData.selectList.forEach(function (col, i) {
+                                        col.type = "View-column";
+                                        col.name = col.displayName;
+                                        Object.keys(col).forEach(function (key) {
+                                            if (key !== "name" && key !== "type") {
+                                                var propertyDefinition = this.designerPropertysData.view[key];
+                                                _worker.findInDesignerProperty(key, propertyDefinition, col, option, module, designer, null, ["view", "data", "selectList", i, key]);
+                                            }
+                                        });
+                                    });
+                                }
+
+                                if (viewData.actionbarList) {
+                                    viewData.actionbarList.forEach(function (item, i) {
+                                        item.type = "View-actionbar";
+                                        item.name = item.type;
+                                        Object.keys(item).forEach(function (key) {
+                                            if (key !== "name" && key !== "type") {
+                                                var propertyDefinition = this.designerPropertysData.view[key];
+                                                _worker.findInDesignerProperty(key, propertyDefinition, item, option, module, designer, null, ["view", "data", "actionbarList", i, key]);
+                                            }
+                                        });
+                                    });
+                                }
+
+                                if (viewData.pagingList) {
+                                    viewData.pagingList.forEach(function (item, i) {
+                                        item.type = "View-paging";
+                                        item.name = item.type;
+                                        Object.keys(item).forEach(function (key) {
+                                            if (key !== "name" && key !== "type") {
+                                                var propertyDefinition = this.designerPropertysData.view[key];
+                                                _worker.findInDesignerProperty(key, propertyDefinition, item, option, module, designer, null, ["view", "data", "pagingList", i, key]);
+                                            }
+                                        });
+                                    });
+                                }
+                            }
+                        }else{
+                            var propertyDefinition = this.designerPropertysData.statement[pattern.property];
+                            if (propertyDefinition){
+                                _worker.findInDesignerProperty(pattern.property, propertyDefinition, statementJson, option, module, designer, null, [pattern.property]);
+                            }
+                        }
+                    });
+
+
+                    // if (statementJson.view){
+                    //     var viewJson = JSON.parse(statementJson.view);
+                    //     var viewData = viewJson.data;
+                    //
+                    // }
+                }, function () {});
+            }
+        // }else{
+        //     Promise.resolve(this.designerPropertysData).then(function(data){
+        //         this.designerPropertysData = data;
+        //         designer.patternList.forEach(function(pattern){
+        //             var propertyDefinition = this.designerPropertysData.statement[pattern.property];
+        //             if (propertyDefinition){
+        //                 _worker._findMessageReply(_worker._createFindMessageReplyData(module, designer, "", {
+        //                     "type": "Statement",
+        //                     "propertyType": propertyDefinition.type || "text",
+        //                     "propertyName": propertyDefinition.name,
+        //                     "name": designer.designerName,
+        //                     "key": pattern.property,
+        //                     "mode": null,
+        //                     "path": [pattern.property],
+        //                     "value": pattern.propertyValue
+        //                 }), option);
+        //             }
+        //         });
+        //     }, function(){});
+        // }
+    }
+};
+
+
+_worker._findProcessPlatformParse_process = function(designer, option, module){
+    if (designer.patternList && designer.patternList.length){
+        var p = _worker._getDesignerData(designer, module);
+        if (p){
+            p.then(function(arr){
+                var processData = arr[0].data;
+                this.designerPropertysData = arr[1];
+
+                designer.patternList.forEach(function(pattern){
+                    if (pattern.elementType === "process"){
+                        debugger;
+                        var propertyDefinition = this.designerPropertysData.process[pattern.property];
+                        processData.type = pattern.elementType;
+                        _worker.findInDesignerProperty(pattern.property, propertyDefinition, processData, option, module, designer, null, [pattern.property]);
+                    }else if (pattern.elementType === "route") {
+                        for (var i=0; i<processData.routeList.length; i++){
+                            if (processData.routeList[i].id===pattern.elementId) break;
+                        }
+                        Object.keys(processData.routeList[i]).forEach(function(key){
+                            var propertyDefinition = this.designerPropertysData.process[key];
+                            processData.routeList[i].type = pattern.elementType;
+                            _worker.findInDesignerProperty(key, propertyDefinition, processData.routeList[i], option, module, designer, null,["routeList", i, key]);
+                        }.bind(this));
+
+
+                    }else{
+                        if (pattern.elementType=="begin" && pattern.elementId===processData.begin.id){
+                            Object.keys(processData.begin).forEach(function(key){
+                                var propertyDefinition = this.designerPropertysData.process[key];
+                                processData.begin.type = pattern.elementType;
+                                _worker.findInDesignerProperty(key, propertyDefinition, processData.begin, option, module, designer, null,["begin", key]);
+                            }.bind(this));
+                        }else{
+                            var arrKey = pattern.elementType+"List";
+                            for (var i=0; i<processData[arrKey].length; i++){
+                                if (processData[arrKey][i].id===pattern.elementId) break;
+                            }
+                            Object.keys(processData[arrKey][i]).forEach(function(key){
+                                var propertyDefinition = this.designerPropertysData.process[key];
+                                processData[arrKey][i].type = pattern.elementType;
+                                _worker.findInDesignerProperty(key, propertyDefinition, processData[arrKey][i], option, module, designer, null,[arrKey, i, key]);
+                            }.bind(this));
+                        }
+                    }
+                });
+            }, function(){});
+        }
+    }
+};
+
+_worker._findProcessPlatformParse = function(resultList, option, module){
+    resultList.forEach(function(designer){
+        switch (designer.designerType){
+            case "script":
+                _worker._findProcessPlatformParse_script(designer, option, module);
+                break;
+            case "form":
+            case "page":
+            case "widget":
+                debugger;
+                _worker._findProcessPlatformParse_form(designer, option, module);
+                break;
+            case "process":
+                _worker._findProcessPlatformParse_process(designer, option, module);
+                break;
+            case "view":
+                _worker._findProcessPlatformParse_view(designer, option, module);
+                break;
+            case "statement":
+                _worker._findProcessPlatformParse_statement(designer, option, module);
+                break;
+        }
+    });
+};
+
+
+
+
+_worker._doFindDesigner = function(option, idx){
+
+    var option = this.filterOptionList[idx];
+
+        var res = _worker._getRequestOption({
+            "method": "post",
+            "url": this.findData.actions.findAction,
+            "body": JSON.stringify(option),
+            "debug": this.findData.debug,
+            "token": this.findData.token
+        });
+        this.action.sendRequest(res).then(function(json){
+            if (json.data.processPlatformList && json.data.processPlatformList.length){
+
+                // var worker = new Worker("../x_component_FindDesigner/PatternWorker.js");
+                // worker.onmessage = function(e) {
+                //     if (e.data) _worker._findMessageReply(e.data, option);
+                // }.bind(this);
+                // worker.postMessage({
+                //     "parser": "_findProcessPlatformParse",
+                //     "actions": _worker.findData.actions,
+                //     "option": option,
+                //     "pattern": json.data.processPlatformList
+                // });
+
+               _worker._findProcessPlatformParse(json.data.processPlatformList, option, "processPlatform");
+            }
+            if (json.data.cmsList && json.data.cmsList.length){
+                _worker._findProcessPlatformParse(json.data.cmsList, option, "cms");
+            }
+            if (json.data.portalList && json.data.portalList.length){
+                _worker._findProcessPlatformParse(json.data.portalList, option, "portal");
+            }
+            if (json.data.queryList && json.data.queryList.length){
+                _worker._findProcessPlatformParse(json.data.queryList, option, "query");
+            }
+            if (json.data.serviceList && json.data.serviceList.length){
+                _worker._findProcessPlatformParse(json.data.serviceList, option, "service");
+            }
+            _worker._findOptionReply();
+
+            idx++;
+            if (this.filterOptionList.length>idx){
+                _worker._doFindDesigner(null, idx);
+            }else{
+                debugger;
+                _worker._findCompletedReply();
+            }
+            //this.filterOptionList[idx];
+
+            //_worker._findMessageReply(json.data, option);
+        }, function(xhr){
+            _worker._findOptionReply(null);
+            _worker._findMessageReply(null);
+
+            idx++;
+            if (this.filterOptionList.length>idx){
+                _worker._doFindDesigner(null, idx);
+            }else{
+                _worker._findCompletedReply();
+            }
+        });
+
+},
+
+_worker._doFindDesignerFromFilterOption = function(){
+    var idx = 0;
+    //this.filterOptionList.forEach(function(option){
+    //    _worker._doFindDesigner(option, idx);
+    //});
+
+    _worker._doFindDesigner(null, idx);
+},
+onmessage = function(e) {
+    this.findData = e.data;
+    var moduleList = this.findData.filterOption.moduleList;
+    this.findData.filterOption.moduleList = [];
+    _worker._setFilterOptionRegex();
+
+    this.filterOptionTemplete = JSON.stringify(this.findData.filterOption);
+    this.filterOptionList = [];
+
+    Promise.all(_worker._parseFindModule(moduleList)).then(function(){
+        // this.filterOptionList[0].moduleList=[];
+        // //_worker._doFindDesigner(this.filterOptionList[0]);
+        // this.filterOptionList = [this.filterOptionList[0]];
+        _worker._readyMessageReply();
+        debugger;
+        _worker._doFindDesignerFromFilterOption();
+    });
+
+    //"moduleType": "cms", "flagList": [];
+    // designerTypes
+    // flagList = [{
+    //     "id": "dddd",
+    //     "desingerList": [
+    //         {
+    //             "desingerType": "脚本(script)表单(form)流程(process)页面(page)部件(widget)视图(view)脚本(statement)统计(stat",
+    //             "id": ""
+    //         },
+    //         {
+    //             "desingerType": "脚本(script)表单(form)流程(process)页面(page)部件(widget)视图(view)脚本(statement)统计(stat",
+    //             "id": ""
+    //         }
+    //     ]
+    // }]
+
+
+
+
+    _worker._receiveMessageReply();
+
+
+
+    //_worker.action.sendRequest(e.data);
+}

+ 2405 - 0
o2web/source/x_component_FindDesigner/Main.js

@@ -0,0 +1,2405 @@
+MWF.xApplication.FindDesigner.options.multitask = false;
+MWF.xApplication.FindDesigner.Main = new Class({
+	Extends: MWF.xApplication.Common.Main,
+	Implements: [Options, Events],
+
+	options: {
+		"style": "default",
+		"name": "FindDesigner",
+		"mvcStyle": "style.css",
+		"icon": "icon.png",
+		"width": "1200",
+		"height": "800",
+		"filter": null,
+		"isResize": true,
+		"isMax": true,
+		"layout": {
+			"type": "leftRight",
+			"percent": 0.3
+		},
+		"title": MWF.xApplication.FindDesigner.LP.title
+	},
+	onQueryLoad: function(){
+		this.lp = MWF.xApplication.FindDesigner.LP;
+		this.filterOption = {
+			"keyword": "",
+			"designerTypes": [],
+			"caseSensitive": false,
+			"matchWholeWord": false,
+			"matchRegExp": false,
+			"moduleList": []
+		}
+		this.selectedModules = [];
+		this.selectedRange = [];
+		o2.UD.getDataJson("findDesignerLayout", function(json){
+			this.setOptions(json);
+		}.bind(this), false);
+	},
+	loadApplication: function(callback){
+		var url = this.path+this.options.style+"/view.html";
+		this.content.loadHtml(url, {"bind": {"lp": this.lp}, "module": this}, function(){
+			this.setSizeNode();
+			this.createToolbar();
+debugger;
+			this.initFilter();
+
+			if (callback) callback();
+		}.bind(this));
+	},
+	initFilter: function(){
+		if (this.options.filter){
+			if (this.options.filter.moduleList){
+				var inputs = this.rangeContentNode.getElements("input");
+				inputs.forEach(function(input){
+					if (input.get("value").indexOf(this.options.filter.moduleList) !== -1){
+						input.set("checked", true);
+					}else{
+						input.set("checked", false);
+					}
+				}.bind(this));
+			}
+			if (this.options.filter.appList){
+				o2.require("o2.widget.O2Identity", function(){
+					this.options.filter.appList.each(function(app){
+						app.name = this.lp[app.moduleType] + "-" + app.name;
+						var item = new o2.widget.O2Other(app, this.rangeSelectedContentNode, {"canRemove": true, "style": "find", "onRemove": function(item){this.removeRangeItem(item);}.bind(this)});
+						item.node.store("data", item.data);
+					}.bind(this));
+				}.bind(this));
+			}
+		}
+	},
+	createToolbar: function(){
+		o2.require("o2.widget.Toolbar", function(){
+			this.previewToolbar = new o2.widget.Toolbar(this.previewTitleToolbar, {"style": "findDesigner"}, this);
+			this.previewToolbar.load();
+			this.previewToolbar.childrenButton[0].disable();
+			this.previewToolbar.childrenButton[1].disable();
+		}.bind(this));
+
+	},
+	initLayout: function(){
+		this.listNode.set("style", "");
+		this.previewNode.set("style", "");
+		if (this.resizeDrag) this.resizeDrag.detach();
+		if (this.sizeNodeFun) this.removeEvent("resize", this.sizeNodeFun);
+
+		if (this.options.layout.type=="leftRight"){
+			this.toLeftRight();
+		}else{
+			this.toTopBottom();
+		}
+	},
+	setSizeNode: function(){
+		this.initLayout();
+		this["sizeNode_"+this.options.layout.type]();
+		this["setResizeNode_"+this.options.layout.type]();
+
+		this.sizeNodeFun = null;
+		this.sizeNodeFun = this["sizeNode_"+this.options.layout.type].bind(this);
+		this.addEvent("resize", this.sizeNodeFun);
+	},
+	sizeResultNode: function(){
+		var size = this.content.getSize();
+		var filterSzie = this.filterNode.getSize();
+		var keywordSize = this.keywordNode.getSize();
+		var rangeSize = this.rangeNode.getSize();
+		var h = size.y-filterSzie.y-keywordSize.y-rangeSize.y;
+		this.resultNode.setStyle("height", ""+h+"px");
+		return h;
+	},
+	sizeNode_topBottom: function(){
+		var h = this.sizeResultNode();
+
+		var listHeight = h*this.options.layout.percent;
+		this.listNode.setStyle("height", ""+listHeight+"px");
+		var previewHeight = h*(1-this.options.layout.percent);
+		this.previewNode.setStyle("height", ""+previewHeight+"px");
+
+		var listTitleSize = this.listTitleNode.getSize();
+		var listContentHeight = listHeight - listTitleSize.y;
+		this.listAreaNode.setStyle("height", ""+listContentHeight+"px");
+
+		var previewSeparatorSize = this.previewSeparatorNode.getSize();
+		var previewTitleSize = this.previewTitleNode.getSize();
+		var previewContentHeight = previewHeight - previewSeparatorSize.y - previewTitleSize.y;
+		this.previewContentNode.setStyle("height", ""+previewContentHeight+"px");
+	},
+	sizeNode_leftRight: function(){
+		var h = this.sizeResultNode();
+		var w = this.resultNode.getSize().x;
+
+		var listWidth = w*this.options.layout.percent;
+		this.listNode.setStyle("width", ""+listWidth+"px");
+		this.previewNode.setStyle("margin-left", ""+listWidth+"px");
+
+		var listTitleSize = this.listTitleNode.getSize();
+		var listContentHeight = h - listTitleSize.y;
+		this.listAreaNode.setStyle("height", ""+listContentHeight+"px");
+
+		var previewTitleSize = this.previewTitleNode.getSize();
+		var previewContentHeight = h - previewTitleSize.y;
+		this.previewContentNode.setStyle("height", ""+previewContentHeight+"px");
+	},
+
+	setResizeNode_topBottom: function(){
+		if (this.previewSeparatorNode){
+			this.resizeDrag = new Drag(this.previewSeparatorNode, {
+				"onStart": function(el, e){
+					el.store("position", o2.eventPosition(e));
+					el.store("initialSize", this.listNode.getSize());
+				}.bind(this),
+				"onDrag": function(el, e){
+					var p = o2.eventPosition(e);
+					var position = el.retrieve("position");
+					var initialSize = el.retrieve("initialSize");
+					var dy = position.y.toFloat()-p.y.toFloat();
+					var height = initialSize.y-dy;
+
+					var size = this.resultNode.getSize();
+					this.options.layout.percent = height/size.y;
+					if (this.options.layout.percent<0.1) this.options.layout.percent = 0.1;
+					if (this.options.layout.percent>0.85) this.options.layout.percent = 0.85;
+					this.sizeNode_topBottom();
+
+					if (this.editor) if(this.editor.resize) this.editor.resize();
+				}.bind(this),
+				"onComplete": function(){
+					o2.UD.putData("findDesignerLayout", {"layout": this.options.layout});
+				}.bind(this)
+			});
+		}
+	},
+	setResizeNode_leftRight: function(){
+		if (this.previewSeparatorNode){
+			this.resizeDrag = new Drag(this.previewSeparatorNode, {
+				"onStart": function(el, e){
+					el.store("position", o2.eventPosition(e));
+					el.store("initialSize", this.listNode.getSize());
+				}.bind(this),
+				"onDrag": function(el, e){
+					var p = o2.eventPosition(e);
+					var position = el.retrieve("position");
+					var initialSize = el.retrieve("initialSize");
+					var dx = position.x.toFloat()-p.x.toFloat();
+					var width = initialSize.x-dx;
+
+					var size = this.resultNode.getSize();
+					this.options.layout.percent = width/size.x;
+					if (this.options.layout.percent<0.1) this.options.layout.percent = 0.1;
+					if (this.options.layout.percent>0.85) this.options.layout.percent = 0.85;
+
+					this.sizeNode_leftRight();
+
+					if (this.editor) if(this.editor.resize) this.editor.resize();
+				}.bind(this),
+				"onComplete": function(){
+					o2.UD.putData("findDesignerLayout", {"layout": this.options.layout});
+				}.bind(this)
+			});
+		}
+	},
+
+	checkFilter: function(e){
+		if (e.target.hasClass("filterNode_item")) e.target.getElement("input").click();
+		e.stopPropagation();
+	},
+	checkRange: function(e){
+		if (e.target.hasClass("rangeType_Item")) e.target.getElement("input").click();
+		e.stopPropagation();
+	},
+	overKeywordOption: function(e){
+		if (e.target.hasClass("o2_findDesigner_keywordNode_optionItem")){
+			if (!e.target.hasClass("optionItem_over")) e.target.addClass("optionItem_over");
+		}
+	},
+	outKeywordOption: function(e){
+		if (e.target.hasClass("o2_findDesigner_keywordNode_optionItem")) e.target.removeClass("optionItem_over");
+	},
+
+	setCaseSensitive: function(e){
+		this.filterOption.caseSensitive = !this.filterOption.caseSensitive;
+		this.caseSensitiveNode.removeClass("caseSensitiveNode_"+!this.filterOption.caseSensitive);
+		this.caseSensitiveNode.addClass("caseSensitiveNode_"+this.filterOption.caseSensitive);
+	},
+	setMatchWholeWord: function(e){
+		this.filterOption.matchWholeWord = !this.filterOption.matchWholeWord;
+		this.matchWholeWordNode.removeClass("matchWholeWordNode_"+!this.filterOption.matchWholeWord);
+		this.matchWholeWordNode.addClass("matchWholeWordNode_"+this.filterOption.matchWholeWord);
+	},
+	setMatchRegExp: function(e){
+		this.filterOption.matchRegExp = !this.filterOption.matchRegExp;
+		this.matchRegExpNode.removeClass("matchRegExpNode_"+!this.filterOption.matchRegExp);
+		this.matchRegExpNode.addClass("matchRegExpNode_"+this.filterOption.matchRegExp);
+	},
+
+	layoutAddClass: function(flag){
+		flag = flag || "";
+		this.listNode.addClass("listNode"+flag);
+		this.previewNode.addClass("previewNode"+flag);
+		this.previewSeparatorNode.addClass("previewNode_separator"+flag);
+		this.previewTitleNode.addClass("previewNode_title"+flag);
+		this.previewTitleActionNode.addClass("previewNode_title_action"+flag);
+		this.previewContentNode.addClass("previewNode_content"+flag);
+	},
+
+	layoutRemoveClass: function(flag){
+		flag = flag || "";
+		this.listNode.removeClass("listNode"+flag);
+		this.previewNode.removeClass("previewNode"+flag);
+		this.previewSeparatorNode.removeClass("previewNode_separator"+flag);
+		this.previewTitleNode.removeClass("previewNode_title"+flag);
+		this.previewTitleActionNode.removeClass("previewNode_title_action"+flag);
+		this.previewContentNode.removeClass("previewNode_content"+flag);
+	},
+	toLeftRight: function(){
+		this.layoutAddClass("_lr");
+		this.layoutRemoveClass();
+		this.options.layout.type="leftRight";
+	},
+	toTopBottom: function(){
+		this.layoutAddClass();
+		this.layoutRemoveClass("_lr");
+		this.options.layout.type="topBottom";
+	},
+	changeLayout: function(){
+		if (this.options.layout.type=="leftRight"){
+			this.options.layout.type="topBottom";
+		}else{
+			this.options.layout.type="leftRight";
+		}
+		this.setSizeNode();
+		o2.UD.putData("findDesignerLayout", {"layout": this.options.layout});
+	},
+
+	getSelectedRange: function(){
+		this.selectedRange = [];
+		var rangeInputs = this.rangeContentNode.getElements("input");
+		rangeInputs.each(function(input){
+			if (input.checked) this.selectedRange.push(input.get("value"));
+		}.bind(this));
+	},
+
+	setSelectedRange: function(){
+		if (this.selectedRange && this.selectedRange.length){
+			var rangeInputs = this.rangeContentNode.getElements("input");
+			rangeInputs.each(function(input){
+				if (this.selectedRange.indexOf(input.get("value"))!=-1) input.set("checked", true);
+			}.bind(this));
+		}
+	},
+	removeRangeItem: function(item){
+		item.destroy();
+		var itemNodes = this.rangeSelectedContentNode.getChildren();
+		if (!itemNodes.length) this.setSelectedRange();
+	},
+	selectFindRange: function(loadFun){
+		debugger;
+		o2.requireApp("Selector", "package", function(){
+			new o2.O2Selector(this.content, {
+				"values": this.selectedModules,
+				"type": "PlatApp",
+				"selectAllEnable": true,
+				"onLoad": function(){
+					if (loadFun && o2.typeOf(loadFun)=="function") loadFun();
+				},
+				"onComplete": function(list){
+					this.rangeSelectedContentNode.empty();
+					//this.selectedModules = [];
+					if (list.length){
+						this.getSelectedRange();
+						this.rangeContentNode.getElements("input").set("checked", false);
+
+						o2.require("o2.widget.O2Identity", function(){
+							list.each(function(app){
+								//this.selectedModules.push(app.data);
+								debugger;
+								app.data.name = this.lp[app.data.moduleType] + "-" + app.data.name;
+								var item = new o2.widget.O2Other(app.data, this.rangeSelectedContentNode, {"canRemove": true, "style": "find", "onRemove": function(item){this.removeRangeItem(item);}.bind(this)});
+								item.node.store("data", item.data);
+							}.bind(this));
+						}.bind(this));
+
+					}else{
+						this.setSelectedRange();
+					}
+
+				}.bind(this)
+			});
+		}.bind(this));
+	},
+	getFindOption: function(){
+		var filterTypes = [];
+		filterItems = this.filterNode.getElements("input");
+		filterItems.each(function(item){
+			if (item.checked) filterTypes.push(item.get("value"));
+		}.bind(this));
+
+		var keyword = this.keywordInputNode.get("value");
+
+		var moduleList = [];
+		var itemNodes = this.rangeSelectedContentNode.getChildren();
+		if (!itemNodes.length){
+			this.getSelectedRange();
+			this.selectedRange.each(function(type){
+				moduleList.push({"moduleType": type, "flagList": []});
+			});
+		}else{
+			var rangeApp = {};
+			itemNodes.each(function(node){
+				var data = node.retrieve("data");
+				if (!rangeApp[data.moduleType]) rangeApp[data.moduleType] = [];
+				rangeApp[data.moduleType].push({"id": data.id});
+			}.bind(this));
+
+			Object.keys(rangeApp).each(function(k){
+				moduleList.push({"moduleType": k, "flagList": rangeApp[k]});
+			});
+		}
+
+		this.filterOption.keyword = keyword;
+		this.filterOption.designerTypes = filterTypes;
+		this.filterOption.moduleList = moduleList;
+
+		return this.filterOption;
+	},
+
+	checkFindDesigner: function(e){
+		if (e.keyCode===13){
+			this.getFindOption();
+
+			if (!this.filterOption.keyword){
+				this.listInfoNode.show().removeClass("loadding").getFirst().set("text", this.lp.nothingFind_keyword);
+				return false;
+			}
+			if (!this.filterOption.designerTypes.length){
+				this.listInfoNode.show().removeClass("loadding").getFirst().set("text", this.lp.nothingFind_noFilter);
+				return false;
+			}
+			if (!this.filterOption.moduleList.length){
+				this.listInfoNode.show().removeClass("loadding").getFirst().set("text", this.lp.nothingFind_noRange);
+				return false;
+			}
+
+			this.findDesigner();
+		}
+	},
+
+	getFindWorker: function(){
+		if (!this.findWorker) this.findWorker = new Worker("../x_component_FindDesigner/FindWorker.js");
+		this.findWorker.onmessage = function(e) {
+			if (e.data && e.data.type=="receive") this.setReceiveMessage();
+			if (e.data && e.data.type=="ready") this.setReadyMessage(e.data);
+			if (e.data && e.data.type=="done") this.doFindOptionResult(e.data);
+			if (e.data && e.data.type=="find") this.doFindResult(e.data);
+			if (e.data && e.data.type=="completed") this.doFindCompleted(e.data);
+		}.bind(this);
+	},
+	doFindCompleted: function(){
+		if (!this.tree || !this.tree.children.length){
+			//not find
+			this.listContentNode.hide();
+			this.listContentNode.empty();
+			this.listInfoNode.removeClass("loadding");
+			this.listInfoNode.show().getFirst().set("text", this.lp.nothingFind);
+		}
+
+		if (!this.patternCount) this.patternCount = 0;
+		var t = this.lp.findPatternCountCompleted.replace("{n}", this.patternCount);
+		this.listTitleInfoNode.set("text", t);
+	},
+	doFindOptionResult: function(){
+		// this.listInfoNode.hide();
+		// this.listContentNode.show();
+		// moduleNode = this.createResultCategroyItem("xxxx", "", this.tree);
+		this.findOptionModuleProcessed++;
+		this.updateFindProgress();
+	},
+	doFindResult: function(data){
+		debugger
+		if (data.data) this.showFindResult(data.data, data.option);
+	},
+
+	getResultTree: function(callback){
+		if (!this.tree){
+			o2.require("o2.widget.Tree", function(){
+				this.tree = new o2.widget.Tree(this.listContentNode, {
+					"style": "findDesigner"
+					// "onQueryExpand": function(item){
+					// 	if (item.designer) this.loadDesignerPattern(item);
+					// }.bind(this)
+				});
+				this.tree.load();
+				if (callback) callback();
+			}.bind(this), null, false);
+		}else{
+			if (callback) callback();
+		}
+	},
+	createResultCategroyItem: function(text, title, tree){
+		var obj = {
+			"title": title,
+			"text": "<span style='font-weight: bold'>"+text+"</span>",
+			"icon": ""
+		}
+		return tree.appendChild(obj);
+	},
+	createResultAppItem: function(text, title, tree){
+		var obj = {
+			"title": title,
+			"text": "<span style='font-weight: bold; color: #0b58a2'>"+text+"</span>",
+			"icon": ""
+		}
+		return tree.appendChild(obj);
+	},
+	createResultTypeItem: function(text, title, tree){
+		var obj = {
+			"title": title,
+			"text": "<span style='color: #333333'>"+text+"</span>",
+			"icon": ""
+		}
+		return tree.appendChild(obj);
+	},
+	createResultDesignerItem: function(text, title, tree){
+		var obj = {
+			"expand": false,
+			"title": title,
+			"text": "<span style='color: #333333'>"+text+"</span>",
+			"icon": ""
+		}
+		return tree.appendChild(obj);
+	},
+	createResultPatternItem: function(text, title, tree, icon, action, treeNode){
+		var obj = {
+			"title": title,
+			"text": "<span style='color: #000000'>"+text+"</span>",
+			"icon": icon||"",
+			"action": action || null
+		}
+
+		var node = (treeNode) ? treeNode.insertChild(obj) : tree.appendChild(obj);
+		node.addEvent("unselect", function(){
+			if (this.editor){
+				if (this.editor.pattern.designerType === "script"){
+					if (this.scriptDesignerDataObject && this.scriptDesignerDataObject[this.editor.pattern.designerId]){
+						this.scriptDesignerDataObject[this.editor.pattern.designerId].text = this.editor.getValue();
+					}
+				}else{
+					debugger;
+					if (this.designerDataObject && this.designerDataObject[this.editor.pattern.designerId]){
+						var d = this.designerDataObject[this.editor.pattern.designerId];
+						switch (this.editor.pattern.pattern.propertyType){
+							case "duty":
+								if (this.editor.pattern.pattern.path){
+									var path = this.editor.pattern.pattern.path;
+									for (var i=0; i<path.length-1; i++){
+										if (path[i]==this.editor.pattern.pattern.key){
+											d[path[i]] = JSON.parse(d[path[i]]);
+											d = d[path[i]];
+										}else{
+											d = d[path[i]];
+										}
+									}
+									d[path[path.length-1]] = this.editor.getValue();
+
+									d = this.designerDataObject[this.editor.pattern.designerId];
+									for (var i=0; i<path.length-1; i++){
+										if (path[i]==this.editor.pattern.pattern.key){
+											d[path[i]] = JSON.stringify(d[path[i]]);
+											break;
+										}else{
+											d = d[path[i]];
+										}
+									}
+								}
+								break;
+							default:
+								if (this.editor.getValue){
+									if (this.editor.pattern.pattern.path){
+										var path = this.editor.pattern.pattern.path;
+										for (var i=0; i<path.length-1; i++){
+											d = d[path[i]];
+										}
+									}
+									if (path[path.length-1]=="styles"){
+										d["recoveryStyles"] = this.editor.getValue();
+									}else if (path[path.length-1]=="inputStyles"){
+										d["recoveryInputStyles"] = this.editor.getValue();
+									}
+									d[path[path.length-1]] = this.editor.getValue();
+								}
+						}
+
+					}
+				}
+				this.editor.destroy();
+				this.editor = null;
+				this.previewInforNode.show().inject(this.previewContentNode);
+			}
+		}.bind(this));
+		return node;
+	},
+
+	updatePatternCount: function(node){
+		node.patternCount++;
+		var textDivNode = node.textNode.getElement("div");
+		if (textDivNode){
+			var text = this.lp.patternCount.replace("{n}", node.patternCount)
+			var t = node.options.text+"&nbsp;&nbsp;<span style='color: #666666'>("+text+")</span>>";
+			//var html = item.options.text;
+			textDivNode.set("html", t);
+		}
+	},
+	subPatternCount: function(node){
+		node.patternCount--;
+		if (node.patternCount<0) node.patternCount=0;
+		var textDivNode = node.textNode.getElement("div");
+		if (textDivNode){
+			var text = this.lp.patternCount.replace("{n}", node.patternCount)
+			var t = node.options.text+"&nbsp;&nbsp;<span style='color: #666666'>("+text+")</span>>";
+			//var html = item.options.text;
+			textDivNode.set("html", t);
+		}
+	},
+	addResultTitle: function(){
+		if (!this.patternCount) this.patternCount = 0;
+		this.patternCount++;
+		var t = this.lp.findPatternCount.replace("{n}", this.patternCount);
+		this.listTitleInfoNode.set("text", t);
+	},
+	subResultTitle: function(){
+		if (!this.patternCount) this.patternCount = 1;
+		this.patternCount--;
+		var t = this.lp.findPatternCount.replace("{n}", this.patternCount);
+		this.listTitleInfoNode.set("text", t);
+	},
+	showFindResult: function(data,option, treeNode){
+		this.addResultTitle();
+
+		this.listInfoNode.hide();
+		this.listContentNode.show();
+
+		var regexp = this.getFilterOptionRegex(option);
+		var moduleNode = (this.tree.modules) ? this.tree.modules[data.module] : null;
+		if (!moduleNode){
+			moduleNode = this.createResultCategroyItem(this.lp[data.module], this.lp[data.module], this.tree);
+			moduleNode.patternCount = 0;
+			if (!this.tree.modules) this.tree.modules = {};
+			this.tree.modules[data.module] = moduleNode;
+		}
+		this.updatePatternCount(moduleNode);
+
+		var appNode = (moduleNode.apps) ? moduleNode.apps[data.appId] : null;
+		if (!appNode){
+			appNode = this.createResultAppItem(data.appName, data.appName, moduleNode);
+			appNode.patternCount = 0;
+			if (!moduleNode.apps) moduleNode.apps = {};
+			moduleNode.apps[data.appId] = appNode;
+		}
+		this.updatePatternCount(appNode);
+
+		var typeNode = (appNode.types) ? appNode.types[data.designerType] : null;
+		if (!typeNode){
+			typeNode = this.createResultTypeItem(this.lp[data.designerType], this.lp[data.designerType], appNode);
+			typeNode.patternCount = 0;
+			if (!appNode.types) appNode.types = {};
+			appNode.types[data.designerType] = typeNode;
+		}
+		this.updatePatternCount(typeNode);
+
+		var designerNode = (typeNode.designers) ? typeNode.designers[data.designerId] : null;
+		if (!designerNode){
+			designerNode = this.createResultDesignerItem(data.designerName, data.designerName, typeNode);
+			designerNode.patternCount = 0;
+			if (!typeNode.designers) typeNode.designers = {};
+			typeNode.designers[data.designerId] = designerNode;
+		}
+		this.updatePatternCount(designerNode);
+
+		switch (data.designerType){
+			case "script":
+				this.createScriptPatternNode(data, designerNode, regexp, treeNode);
+				break;
+			case "form":
+			case "page":
+			case "widget":
+			case "view":
+			case "statement":
+			case "process":
+				this.createFormPatternNode(data, designerNode, regexp, treeNode);
+				break;
+			// case "process":
+			// 	this.createProcessPatternNode(data, designerNode, regexp, treeNode);
+			// 	break;
+
+		}
+	},
+
+	// createProcessPatternNode: function(data, node, regexp){
+	// 	var text = this.lp.elementPattern.replace("{element}", "&lt;"+data.pattern.type+"&gt;"+data.pattern.name).
+	// 	replace("{property}", "{"+data.pattern.key+"}"+data.pattern.propertyName);
+	// 	text = "<span style='color: #666666'>"+text+"</span>&nbsp;&nbsp;"
+	//
+	// 	if (data.pattern.line){
+	// 		if (data.pattern.evkey){
+	// 			text += "<b>["+data.pattern.evkey+"]</b>&nbsp;"+((data.pattern.line) ? data.pattern.line+"&nbsp;&nbsp;" : "" )+this.getPatternValue(data.pattern.value, regexp);
+	// 		}else{
+	// 			text += ((data.pattern.line) ? data.pattern.line+"&nbsp;&nbsp;" : "" )+this.getPatternValue(data.pattern.value, regexp);
+	// 		}
+	// 	}else{
+	// 		text += this.getPatternValue(data.pattern.value, regexp);
+	// 	}
+	// 	if (data.pattern.mode){
+	// 		text = "<b>["+data.pattern.mode+"]</b>&nbsp;"+text;
+	// 	}
+	//
+	// 	patternNode = this.createResultPatternItem(text, "", node, "icon_"+data.pattern.propertyType+".png");
+	// },
+
+	getPatternValueText: function(data, regexp){
+		var text = "";
+		if (data.pattern.line){
+			if (data.pattern.evkey){
+				text += "<b>["+data.pattern.evkey+"]</b>&nbsp;"+((data.pattern.line) ? data.pattern.line+"&nbsp;&nbsp;" : "" )+this.getPatternValue(data.pattern.value, regexp, data.pattern);
+			}else{
+				text += ((data.pattern.line) ? data.pattern.line+"&nbsp;&nbsp;" : "" )+this.getPatternValue(data.pattern.value, regexp, data.pattern);
+			}
+		}else{
+			text += this.getPatternValue(data.pattern.value, regexp, data.pattern);
+		}
+		return text;
+	},
+	getFormPatternNodeText: function(data, regexp){
+		var text = this.lp.elementPattern.replace("{element}", "&lt;"+data.pattern.type+"&gt;"+data.pattern.name).
+		replace("{property}", "{"+data.pattern.key+"}"+data.pattern.propertyName);
+		text = "<span style='color: #666666'>"+text+"</span>&nbsp;&nbsp;";
+
+		text += this.getPatternValueText(data, regexp);
+		// if (data.pattern.line){
+		// 	if (data.pattern.evkey){
+		// 		text += "<b>["+data.pattern.evkey+"]</b>&nbsp;"+((data.pattern.line) ? data.pattern.line+"&nbsp;&nbsp;" : "" )+this.getPatternValue(data.pattern.value, regexp, data.pattern);
+		// 	}else{
+		// 		text += ((data.pattern.line) ? data.pattern.line+"&nbsp;&nbsp;" : "" )+this.getPatternValue(data.pattern.value, regexp, data.pattern);
+		// 	}
+		// }else{
+		// 	text += this.getPatternValue(data.pattern.value, regexp, data.pattern);
+		// }
+		if (data.pattern.mode){
+			text = "<b>["+data.pattern.mode+"]</b>&nbsp;"+text;
+		}
+		return text;
+	},
+	createFormPatternNode: function(data, node, regexp, treeNode){
+		var text = this.getFormPatternNodeText(data, regexp)
+
+		var openScript = function(node){
+			this.openPatternForm(node);
+		}.bind(this);
+
+		patternNode = this.createResultPatternItem(text, "", node, "icon_"+data.pattern.propertyType+".png", openScript, treeNode);
+		patternNode.pattern = data;
+	},
+
+	getPatternValue: function(value, regexp, pattern){
+		regexp.lastIndex = 0;
+		var valueHtml = "";
+		var idx = 0;
+		while ((arr = regexp.exec(value)) !== null) {
+			if (pattern){
+				if (!pattern.cols) pattern.cols = [];
+				pattern.cols.push({"start": arr.index+1, "end": regexp.lastIndex+1});
+			}
+			valueHtml += o2.common.encodeHtml(value.substring(idx, arr.index));
+			valueHtml += "<span style='background-color: #ffef8f'>"+o2.common.encodeHtml(value.substring(arr.index, regexp.lastIndex))+"</span>";
+			idx = regexp.lastIndex;
+		}
+		valueHtml += o2.common.encodeHtml(value.substring(idx, value.length));
+		return valueHtml;
+	},
+	createScriptPatternNode: function(data, node, regexp){
+		var patternNode;
+		var text;
+
+		var openScript = function(node){
+			this.openPatternScript(node);
+		}.bind(this);
+
+		if (data.pattern.property=="text"){
+			text = "<span style='color: #666666'>"+data.pattern.line+"</span>&nbsp;&nbsp;"+this.getPatternValue(data.pattern.value, regexp, data.pattern);
+			patternNode = this.createResultPatternItem(text, "", node, "icon_script.png", openScript);
+		}else{
+			text = this.lp.property+":&nbsp;<b>"+data.pattern.property+"</b> "+this.lp.value+":&nbsp;"+this.getPatternValue(data.pattern.value, regexp);
+			patternNode = this.createResultPatternItem(text, "", node, "icon_text.png", openScript);
+		}
+		patternNode.pattern = data;
+	},
+
+	openPatternForm: function(node){
+		var pattern = node.pattern;
+
+		if (this.editor && this.editor.pattern.designerId === node.pattern.designerId && this.editor.pattern.module === node.pattern.module){
+			this.resetFormEditor(node.pattern);
+		}else{
+			if (this.editor){
+				if (this.editor.pattern.designerType === "script"){
+					if (this.scriptDesignerDataObject && this.scriptDesignerDataObject[this.editor.pattern.designerId]){
+						this.scriptDesignerDataObject[this.editor.pattern.designerId].text = this.editor.getValue();
+					}
+				}else{
+
+					if (this.designerDataObject && this.designerDataObject[this.editor.pattern.designerId]){
+						var d = this.designerDataObject[this.editor.pattern.designerId];
+						switch (this.editor.pattern.pattern.propertyType){
+							case "duty":
+								if (this.editor.pattern.pattern.path){
+									var path = this.editor.pattern.pattern.path;
+									for (var i=0; i<path.length-1; i++){
+										if (path[i]==this.editor.pattern.pattern.key){
+											d[path[i]] = JSON.parse(d[path[i]]);
+											d = d[path[i]];
+										}else{
+											d = d[path[i]];
+										}
+									}
+									d[path[path.length-1]] = this.editor.getValue();
+
+									d = this.designerDataObject[this.editor.pattern.designerId];
+									for (var i=0; i<path.length-1; i++){
+										if (path[i]==this.editor.pattern.pattern.key){
+											d[path[i]] = JSON.stringify(d[path[i]]);
+											break;
+										}else{
+											d = d[path[i]];
+										}
+									}
+								}
+								break;
+							default:
+								if (this.editor.getValue){
+									if (this.editor.pattern.pattern.path){
+										var path = this.editor.pattern.pattern.path;
+										for (var i=0; i<path.length-1; i++){
+											d = d[path[i]];
+										}
+									}
+									if (path[path.length-1]=="styles"){
+										d["recoveryStyles"] = this.editor.getValue();
+									}else if (path[path.length-1]=="inputStyles"){
+										d["recoveryInputStyles"] = this.editor.getValue();
+									}
+									d[path[path.length-1]] = this.editor.getValue();
+								}
+						}
+
+						// if (this.editor.pattern.pattern.path){
+						// 	var path = this.editor.pattern.pattern.path;
+						// 	for (var i=0; i<path.length-1; i++){
+						// 		d = d[path[i]];
+						// 	}
+						// }
+						// d[path[path.length-1]] = this.editor.getValue();
+					}
+				}
+				this.editor.destroy();
+			}
+			this.editor = null;
+			this.previewInforNode.hide().dispose();
+
+			var m;
+			switch (node.pattern.module){
+				case "processPlatform":
+					if (node.pattern.designerType==="form"){
+						m = o2.Actions.load("x_processplatform_assemble_designer").FormAction.get;
+						break;
+					}
+					if (node.pattern.designerType==="process"){
+						m = o2.Actions.load("x_processplatform_assemble_designer").ProcessAction.get;
+						break;
+					}
+					break;
+				case "cms":
+					m = o2.Actions.load("x_cms_assemble_control").FormAction.get;
+					//m = o2.Actions.load("x_cms_assemble_control").ScriptAction.get;
+					break;
+				case "portal":
+					if (node.pattern.designerType==="page"){
+						m = o2.Actions.load("x_portal_assemble_designer").PageAction.get;
+						break;
+					}
+					if (node.pattern.designerType==="widget"){
+						m = o2.Actions.load("x_portal_assemble_designer").WidgetAction.get;
+						break;
+					}
+					break;
+				case "query":
+					if (node.pattern.designerType==="view"){
+						m = o2.Actions.load("x_query_assemble_designer").ViewAction.get;
+						break;
+					}
+					if (node.pattern.designerType==="statement"){
+						m = o2.Actions.load("x_query_assemble_designer").StatementAction.get;
+						break;
+					}
+					break;
+
+				case "service":
+					//m = (node.pattern.appId==="invoke") ? o2.Actions.load("x_program_center").InvokeAction.get : o2.Actions.load("x_program_center").AgentAction.get;
+					break;
+			}
+			if (m) this.openPatternFormWithData(m, node);
+		}
+	},
+	resetFormEditor: function(pattern){
+		switch (pattern.pattern.propertyType){
+			case "html":
+			case "script":
+			case "css":
+			case "sql":
+			case "events":
+				this.reLocationEditor(pattern);
+				break;
+			case "duty":
+				if (pattern.pattern.valueKey=="code") this.reLocationEditor(pattern);
+				break;
+			case "map":
+				this.reLocationMapEditor(pattern);
+				break;
+			case "array":
+				this.reLocationArrayEditor(pattern);
+				break;
+
+		}
+	},
+	reLocationArrayEditor: function(pattern){
+		if (this.editor){
+			var i = pattern.pattern.line-1;
+			if (this.editor.items[i]) this.editor.items[i].editValue();
+		}
+	},
+	reLocationMapEditor: function(pattern){
+		if (this.editor){
+			var keyv = pattern.pattern.value.split(":");
+			var key = keyv[0];
+
+			for (var i=0; i<this.editor.items.length; i++){
+				if (this.editor.items[i].key===key){
+					this.editor.items[i].editValue();
+					break;
+				}
+			}
+		}
+	},
+	openPatternFormWithData: function(m, node){
+		if (this.designerDataObject && this.designerDataObject[node.pattern.designerId]){
+			this.openPatternFormEditor(this.designerDataObject[node.pattern.designerId], node);
+		}else{
+			if (m) m(node.pattern.designerId).then(function(json){
+				if (json.data){
+					var d = json.data;
+					if (node.pattern.designerType=="form" || node.pattern.designerType=="page" || node.pattern.designerType=="widget"){
+						var pcData = JSON.decode(MWF.decodeJsonString(json.data.data));
+						var mobileData = (json.data.mobileData) ? JSON.decode(MWF.decodeJsonString(json.data.mobileData)) : null;
+						d = {"data": pcData, "mobileData": mobileData};
+					}
+					if (node.pattern.designerType=="view"){
+						var dataJson = JSON.decode(json.data.data);
+						d.application = d.query
+						d.applicationName = d.queryName;
+						d.data = dataJson;
+					}
+					if (node.pattern.designerType=="statement"){
+						d.application = d.query
+						d.applicationName = d.queryName;
+						var viewJson = JSON.decode(d.view);
+						d.view = viewJson;
+					}
+
+					if (!this.designerDataObject) this.designerDataObject = {};
+					this.designerDataObject[node.pattern.designerId] = d;
+					this.openPatternFormEditor(d, node);
+				}
+			}.bind(this), function(){});
+		}
+	},
+	openPatternFormEditor: function(data, node){
+		switch (node.pattern.pattern.propertyType){
+			case "html":
+			case "script":
+			case "css":
+			case "sql":
+			case "events":
+				this.openPatternFormEditor_script(data, node);
+				break;
+			case "map":
+				this.openPatternFormEditor_map(data, node);
+				break;
+			case "array":
+				this.openPatternFormEditor_array(data, node);
+				break;
+			case "duty":
+				this.openPatternFormEditor_duty(data, node);
+				break;
+
+			default:
+				this.openPatternFormEditor_default(data, node);
+		}
+	},
+	getValueWithPath: function(data, pattern, offset){
+		var path = pattern.pattern.path;
+		var d = data;
+		var i=0;
+		var oset = (offset) ? offset.toInt() : 0;
+		while (i<(path.length-oset)){
+			if (path[i]=="styles"){
+				d.styles = d.recoveryStyles;
+			}else if (path[i]=="inputStyles"){
+				d.inputStyles = d.recoveryInputStyles;
+			}
+			d = d[path[i]];
+			i++;
+		}
+		return d;
+	},
+	getTitleWithPath: function(data, pattern){
+		var el = this.lp.elementPattern.replace("{element}", "&lt;"+pattern.pattern.type+"&gt;"+pattern.pattern.name).
+		replace("{property}", pattern.pattern.propertyName+"{"+pattern.pattern.key+"}");
+		var title = "<b>"+this.lp[pattern.module]+":&nbsp;<span style='color: #4A90E2'>"+pattern.appName+"</span></b>->"+": "+"<b>["+pattern.pattern.mode+this.lp[pattern.designerType]+"]</b>&nbsp;"+pattern.designerName+"->"+el;
+
+		return "<div style='line-height: 30px'>"+title+"</div>"
+	},
+	getDefaultEditorContent: function(data, pattern){
+		var el = this.lp.elementPattern.replace("{element}", "&lt;"+pattern.pattern.type+"&gt;"+pattern.pattern.name).
+		replace("{property}", pattern.pattern.propertyName+"{"+pattern.pattern.key+"}");
+
+		var html = "<div style='padding: 20px;'>" +
+			"<div style='height: 40px; line-height: 40px; font-size: 18px'>"+this.lp.findInfor+"</div>" +
+			"<div style='padding-left: 10px; padding: 30px; border: 1px solid #eeeeee; background-color: #f9f9f9; border-radius: 5px; float: left'>" +
+			"<div style='padding-left: 20px; height: 30px; line-height: 30px'><b>"+this.lp[pattern.module]+":&nbsp;<span style='color: #4A90E2'>"+pattern.appName+"</span></b></div>" +
+			"<div style='padding-left: 40px; height: 30px; line-height: 30px'><b>["+(pattern.pattern.mode || "")+this.lp[pattern.designerType]+"]</b>&nbsp;"+pattern.designerName+"</div>" +
+			"<div style='padding-left: 60px; height: 30px; line-height: 30px'><b>"+this.lp.element+":</b>&nbsp;"+"&lt;"+pattern.pattern.type+"&gt;"+pattern.pattern.name+"</div>" +
+			"<div style='padding-left: 80px; height: 30px; line-height: 30px'><div style='float: left'><b>"+this.lp.property+":</b>&nbsp;"+pattern.pattern.propertyName+"{"+pattern.pattern.key+"}:&nbsp;"+"</div>" +
+			"<div style='margin-left: 10px; float:left; height: 30px; padding: 0px 10px; line-height: 30px; border-radius: 5px; background-color: #eeeeee;'>"+this.getPatternValueText(pattern, this.getFindRegExp())+"</div></div></div>" +
+			"<div style='float:left; margin-top:20px; clear:both; height: 40px; line-height: 40px; cursor: pointer; font-size: 18px; color: #0b58a2'>"+this.lp.findInforOpen+"</div>" +
+			"</div>";
+
+		return html;
+	},
+
+	commonEditor: new Class({
+		Implements: [Events],
+		initialize: function(node){
+			this.node = $(node);
+			this.container = new Element("div", {
+				"styles": {
+					"padding": "10px"
+				}
+			});
+		},
+		load : function(title){
+			this.container.set("html", title).inject(this.node);
+		},
+		destroy: function(){
+			this.fireEvent("destroy");
+			this.container.destroy();
+			o2.release(this);
+		},
+		// getValue: function(){
+		// 	return this.value;
+		// },
+		getContent: function(){
+
+		}
+	}),
+	openPatternFormEditor_default: function(data, node){
+		debugger;
+		// var d = this.getValueWithPath(data, node.pattern);
+		// if (d){
+			debugger;
+			var content = this.getDefaultEditorContent(data, node.pattern);
+			this.editor = new this.commonEditor(this.previewContentNode);
+			this.editor.addEvent("destroy", function(){
+				this.previewToolbar.childrenButton[0].disable();
+				this.previewToolbar.childrenButton[1].disable();
+			}.bind(this));
+			this.editor.pattern = node.pattern;
+			this.editor.designerNode = node;
+			this.editor.designerData = data;
+			this.editor.load(content);
+			this.editor.container.getFirst().getLast().addEvent("click", function(){
+				this.openDesinger();
+			}.bind(this));
+
+			this.previewToolbar.childrenButton[0].disable();
+			this.previewToolbar.childrenButton[1].enable();
+		// }
+	 },
+	openPatternFormEditor_duty: function(data, node){
+		debugger;
+		if (node.pattern.pattern.valueKey=="name"){
+			this.openPatternFormEditor_default(data, node)
+		}else {
+			var d = this.getValueWithPath(data, node.pattern, 2);
+			if (d){
+				var json = JSON.parse(d);
+				var idx = node.pattern.pattern.idx.toInt();
+
+				var code = json[idx].code;
+
+				o2.require("o2.widget.JavascriptEditor", function(){
+					this.editor = new o2.widget.JavascriptEditor(this.previewContentNode, {
+						"option": {
+							"value": code,
+							"mode": "javascript"
+						}
+					});
+					this.editor.pattern = node.pattern;
+					this.editor.designerNode = node;
+					this.editor.designerData = data;
+					this.editor.load(function(){
+						if (this.previewToolbar){
+							this.previewToolbar.childrenButton[0].enable();
+							this.previewToolbar.childrenButton[1].enable();
+						}
+						this.editor.addEvent("change", function(){
+							this.editor.isRefind = true;
+						}.bind(this));
+						this.editor.addEvent("blur", function(){
+							if (this.editor.isRefind) this.reFindInFormDesigner();
+						}.bind(this));
+						this.editor.addEvent("destroy", function(){
+							this.previewToolbar.childrenButton[0].disable();
+							this.previewToolbar.childrenButton[1].disable();
+						}.bind(this));
+						this.editor.addEvent("save", function(){
+							this.saveDesigner();
+						}.bind(this));
+
+						this.resetFormEditor(node.pattern);
+					}.bind(this));
+				}.bind(this));
+
+			}
+		}
+		//var d = this.getValueWithPath(data, node.pattern);
+	},
+
+	openPatternFormEditor_array: function(data, node){
+		var d = this.getValueWithPath(data, node.pattern);
+		if (d){
+			var title = this.getTitleWithPath(data, node.pattern);
+			o2.require("o2.widget.Arraylist", function(){
+				this.editor = new o2.widget.Arraylist(this.previewContentNode, {
+					"htmlTitle": title,
+					"style": "findDesigner",
+					"onChange": function(){
+						this.reFindInFormDesigner();
+					}.bind(this),
+					"onPostLoad": function(){
+						if (this.previewToolbar){
+							this.previewToolbar.childrenButton[0].enable();
+							this.previewToolbar.childrenButton[1].enable();
+						}
+					}.bind(this),
+				});
+				this.editor.addEvent("destroy", function(){
+					this.previewToolbar.childrenButton[0].disable();
+					this.previewToolbar.childrenButton[1].disable();
+				}.bind(this));
+
+				this.editor.pattern = node.pattern;
+				this.editor.designerNode = node;
+				this.editor.designerData = data;
+
+				this.editor.load(d);
+
+				this.resetFormEditor(node.pattern);
+
+			}.bind(this))
+		}
+
+	},
+
+	openPatternFormEditor_map: function(data, node){
+		debugger;
+		var d = this.getValueWithPath(data, node.pattern);
+
+		if (d){
+			var title = this.getTitleWithPath(data, node.pattern);
+			o2.require("o2.widget.Maplist", function(){
+				this.editor = new o2.widget.Maplist(this.previewContentNode, {
+					"htmlTitle": title,
+					"style": "findDesigner",
+					"onChange": function(){
+						this.reFindInFormDesigner();
+					}.bind(this),
+					"onPostLoad": function(){
+						if (this.previewToolbar){
+							this.previewToolbar.childrenButton[0].enable();
+							this.previewToolbar.childrenButton[1].enable();
+						}
+					}.bind(this),
+				});
+				this.editor.addEvent("destroy", function(){
+					this.previewToolbar.childrenButton[0].disable();
+					this.previewToolbar.childrenButton[1].disable();
+				}.bind(this));
+
+				this.editor.pattern = node.pattern;
+				this.editor.designerNode = node;
+				this.editor.designerData = data;
+
+				this.editor.load(d);
+
+				this.resetFormEditor(node.pattern);
+
+			}.bind(this))
+		}
+	},
+
+	openPatternFormEditor_script: function(data, node){
+		var path = node.pattern.pattern.path;
+		var d = data;
+		var i=0;
+		while (i<path.length){
+			d = d[path[i]];
+			i++;
+		}
+
+		if (d){
+			o2.require("o2.widget.JavascriptEditor", function(){
+				this.editor = new o2.widget.JavascriptEditor(this.previewContentNode, {
+					"option": {
+						"value": d,
+						"mode": (!node.pattern.pattern.propertyType || node.pattern.pattern.propertyType==="script" || node.pattern.pattern.propertyType==="events") ? "javascript" : node.pattern.pattern.propertyType
+					}
+				});
+				this.editor.pattern = node.pattern;
+				this.editor.designerNode = node;
+				this.editor.designerData = data;
+				this.editor.load(function(){
+					if (this.previewToolbar){
+						this.previewToolbar.childrenButton[0].enable();
+						this.previewToolbar.childrenButton[1].enable();
+					}
+					this.editor.addEvent("change", function(){
+						this.editor.isRefind = true;
+					}.bind(this));
+					this.editor.addEvent("blur", function(){
+						if (this.editor.isRefind) this.reFindInFormDesigner();
+					}.bind(this));
+					this.editor.addEvent("destroy", function(){
+						this.previewToolbar.childrenButton[0].disable();
+						this.previewToolbar.childrenButton[1].disable();
+					}.bind(this));
+					this.editor.addEvent("save", function(){
+						this.saveDesigner();
+					}.bind(this));
+
+					this.resetFormEditor(node.pattern);
+				}.bind(this));
+			}.bind(this));
+
+		}
+
+	},
+
+	openPatternScript: function(node){
+		var pattern = node.pattern;
+		if (this.editor && this.editor.pattern.designerId === node.pattern.designerId && this.editor.pattern.module === node.pattern.module){
+			this.reLocationEditor(node.pattern);
+		}else{
+			if (this.editor){
+				if (this.editor.pattern.designerType === "script"){
+					if (this.scriptDesignerDataObject && this.scriptDesignerDataObject[this.editor.pattern.designerId]){
+						this.scriptDesignerDataObject[this.editor.pattern.designerId].text = this.editor.getValue();
+					}
+				}else{
+					if (this.designerDataObject && this.designerDataObject[this.editor.pattern.designerId]){
+						this.designerDataObject[this.editor.pattern.designerId] = this.editor.designerData;
+					}
+				}
+				this.editor.destroy();
+			}
+			this.editor = null;
+			this.previewInforNode.hide().dispose();
+
+			var m;
+			switch (node.pattern.module){
+				case "processPlatform":
+					m = o2.Actions.load("x_processplatform_assemble_designer").ScriptAction.get;
+					break;
+				case "cms":
+					m = o2.Actions.load("x_cms_assemble_control").ScriptAction.get;
+					break;
+				case "portal":
+					m = o2.Actions.load("x_portal_assemble_designer").ScriptAction.get;
+					break;
+				case "service":
+					m = (node.pattern.appId==="invoke") ? o2.Actions.load("x_program_center").InvokeAction.get : o2.Actions.load("x_program_center").AgentAction.get;
+					break;
+			}
+			this.openPatternScriptWithData(m, node);
+		}
+	},
+	openPatternScriptWithData: function(m, node){
+		if (this.scriptDesignerDataObject && this.scriptDesignerDataObject[node.pattern.designerId]){
+			this.openPatternScriptEditor(this.scriptDesignerDataObject[node.pattern.designerId], node);
+		}else{
+			if (m) m(node.pattern.designerId).then(function(json){
+				if (!this.scriptDesignerDataObject) this.scriptDesignerDataObject = {};
+				this.scriptDesignerDataObject[node.pattern.designerId] = json.data;
+				if (json.data) this.openPatternScriptEditor(json.data, node);
+			}.bind(this), function(){});
+		}
+	},
+
+	openPatternScriptEditor: function(data, node){
+		o2.require("o2.widget.JavascriptEditor", function(){
+			this.editor = new o2.widget.JavascriptEditor(this.previewContentNode, {
+				"option": {"value": data.text}
+			});
+			this.editor.pattern = node.pattern;
+			this.editor.designerNode = node.parentNode;
+			this.editor.designerData = data;
+			this.editor.load(function(){
+				if (this.previewToolbar){
+					this.previewToolbar.childrenButton[0].enable();
+					this.previewToolbar.childrenButton[1].enable();
+				}
+				this.editor.addEvent("change", function(){
+					this.editor.isRefind = true;
+				}.bind(this));
+				this.editor.addEvent("blur", function(){
+					if (this.editor.isRefind) this.reFindInDesigner();
+				}.bind(this));
+				this.editor.addEvent("destroy", function(){
+					this.previewToolbar.childrenButton[0].disable();
+					this.previewToolbar.childrenButton[1].disable();
+				}.bind(this));
+				this.editor.addEvent("save", function(){
+					this.saveDesigner();
+				}.bind(this));
+
+
+				//var idx = node.parentNode.children.indexOf(node);
+				//this.reFindInDesigner();
+				this.reLocationEditor(node.pattern);
+				//if (node.parentNode.children[idx]) node.parentNode.children[idx].clickNode();
+			}.bind(this));
+		}.bind(this));
+	},
+	findScriptLineValue: function(result, code, preLine, preIndex, len, regex){
+		var lineRegexp = /\r\n|\n|\r/g;
+		var preText = code.substring(preIndex, result.index);
+		var m = preText.match(lineRegexp);
+		preLine += (m) ? m.length : 0;
+
+		var value = result[0];
+
+		var n = result.index-1;
+		var char = code.charAt(n);
+		while (!lineRegexp.test(char) && n>=0){
+			value = char+value;
+			n--;
+			char = code.charAt(n);
+		}
+		n =  regex.lastIndex;
+		char = code.charAt(n);
+		while (!lineRegexp.test(char) && n<len){
+			value = value+char;
+			n++;
+			char = code.charAt(n);
+		}
+		preIndex = regex.lastIndex = n;
+		return {"value": value, "preLine": preLine, "preIndex": preIndex};
+	},
+
+	subResultCount: function(pattern){
+		this.subResultTitle();
+
+		var moduleNode = (this.tree.modules) ? this.tree.modules[pattern.module] : null;
+		if (moduleNode) this.subPatternCount(moduleNode);
+
+		var appNode = (moduleNode.apps) ? moduleNode.apps[pattern.appId] : null;
+		if (appNode) this.subPatternCount(appNode);
+
+		var typeNode = (appNode.types) ? appNode.types[pattern.designerType] : null;
+		if (typeNode) this.subPatternCount(typeNode);
+
+		var designerNode = (typeNode.designers) ? typeNode.designers[pattern.designerId] : null;
+		if (designerNode) this.subPatternCount(designerNode);
+	},
+
+	reFindInFormDesigner: function(){
+		debugger;
+		if (this.editor && this.editor.designerNode){
+
+			var pathStr = this.editor.pattern.pattern.path.join(".");
+			var pNode = this.editor.designerNode.parentNode;
+			var removeNodes = [];
+			pNode.children.forEach(function(n){
+				if (n.pattern.pattern.path && n.pattern.pattern.path.join(".")===pathStr) removeNodes.push(n);
+			}.bind(this));
+
+			var pattern = this.editor.pattern;
+debugger;
+			switch (pattern.pattern.propertyType){
+				case "html":
+				case "script":
+				case "css":
+				case "sql":
+				case "events":
+					if (removeNodes.length>1){
+						for (var i=1; i<removeNodes.length; i++){
+							removeNodes[i].destroy();
+							this.subResultCount(this.editor.pattern);
+						}
+					}
+					flagNode = removeNodes[0];
+					this.reFindInFormDesigner_script(flagNode, pattern);
+					break;
+				case "duty":
+					if (removeNodes.length>1){
+						for (var i=1; i<removeNodes.length; i++){
+							removeNodes[i].destroy();
+							this.subResultCount(this.editor.pattern);
+						}
+					}
+					flagNode = removeNodes[0];
+					this.reFindInFormDesigner_duty(flagNode, pattern);
+					break;
+				case "map":
+					this.reFindInFormDesigner_map(removeNodes, pattern);
+					break;
+				case "array":
+					this.reFindInFormDesigner_array(removeNodes, pattern);
+					break;
+			}
+			this.subResultCount(this.editor.pattern);
+		}
+		this.editor.isRefind = false;
+	},
+	reFindInFormDesigner_duty: function(removeNodes, pattern){
+		var code = this.editor.getValue();
+		if (code){
+			var regex = this.getFilterOptionRegex(this.filterOption)
+			regex.lastIndex = 0;
+			var len = code.length;
+
+			var preLine = 0;
+			var preIndex = 0;
+			var result;
+			while ((result = regex.exec(code)) !== null){
+				var obj = this.findScriptLineValue(result, code, preLine, preIndex, len, regex);
+				preLine = obj.preLine;
+				preIndex = obj.preIndex;
+
+				this.showFindResult(this._createFindMessageReplyData( this.editor.pattern.module, this.editor.pattern, "", {
+					"type": pattern.pattern.type,
+					"propertyType": pattern.pattern.propertyType,
+					"propertyName": pattern.pattern.propertyName,
+					"name": pattern.pattern.name,
+					"id": pattern.pattern.id,
+					"key": pattern.pattern.key,
+					"evkey": pattern.pattern.evkey,
+					"idx": pattern.pattern.idx,
+					"valueKey": pattern.pattern.valueKey,
+					"value": obj.value,
+					"line": preLine+1,
+					"mode": pattern.pattern.mode,
+					"path": pattern.pattern.path
+				}), this.filterOption, flagNode);
+			}
+
+		}
+		if (flagNode) flagNode.destroy();
+	},
+	reFindInFormDesigner_array: function(removeNodes, pattern){
+		var arr = this.editor.getValue();
+		if (arr){
+			var regex = this.getFilterOptionRegex(this.filterOption)
+			removeNodes.forEach(function(i){
+				var idx = i.pattern.pattern.line.toInt()-1;
+				var value = arr[idx] || "";
+				if (i.pattern.pattern.value!=value){
+					i.pattern.pattern.value = value;
+					var text = this.getFormPatternNodeText(i.pattern, regex)
+					var textDivNode = i.textNode.getElement("div");
+					if (textDivNode){
+						textDivNode.set("html", "<span style='color: #000000'>"+text+"</span>");
+					}
+				}
+			}.bind(this));
+
+			arr.forEach(function(v, i) {
+				regex.lastIndex = 0;
+				var text = v.toString();
+				if (regex.test(text)){
+
+
+					var n = removeNodes.filter(function(n){
+						var idx = n.pattern.pattern.line.toInt()-1;
+						return (idx==i);
+					});
+					if (!n.length){
+						this.showFindResult(this._createFindMessageReplyData(this.editor.pattern.module, this.editor.pattern, "", {
+							"type": pattern.pattern.type,
+							"propertyType": pattern.pattern.propertyType,
+							"propertyName": pattern.pattern.propertyName,
+							"name": pattern.pattern.name,
+							"id": pattern.pattern.id,
+							"line": i+1,
+							"key": pattern.pattern.key,
+							"value": text,
+							"mode": pattern.pattern.mode,
+							"path": pattern.pattern.path
+						}), this.filterOption, removeNodes[removeNodes.length-1].nextSibling);
+					}
+				}
+			}.bind(this));
+		}
+	},
+	reFindInFormDesigner_map: function(removeNodes, pattern){
+		var map = this.editor.getValue();
+		if (map){
+			var regex = this.getFilterOptionRegex(this.filterOption)
+			removeNodes.forEach(function(i){
+				var k = i.pattern.pattern.value.split(":")[0];
+				if (i.pattern.pattern.value!=(k+": "+map[k])){
+					i.pattern.pattern.value = k+": "+(map[k] || "");
+					var text = this.getFormPatternNodeText(i.pattern, regex)
+
+					var textDivNode = i.textNode.getElement("div");
+					if (textDivNode){
+						textDivNode.set("html", "<span style='color: #000000'>"+text+"</span>");
+					}
+				}
+			}.bind(this));
+
+			Object.keys(map).forEach(function(evkey) {
+				regex.lastIndex = 0;
+				var text = map[evkey];
+				if (text){
+					if ((typeof text)=="string") {
+						if (regex.test(text)) {
+
+							var n = removeNodes.filter(function(i){
+								var k = i.pattern.pattern.value.split(":")[0];
+								return (k==evkey)
+							});
+							if (!n.length){
+								this.showFindResult(this._createFindMessageReplyData(this.editor.pattern.module, this.editor.pattern, "", {
+									"type": pattern.pattern.type,
+									"propertyType": pattern.pattern.propertyType,
+									"propertyName": pattern.pattern.propertyName,
+									"name": pattern.pattern.name,
+									"id": pattern.pattern.id,
+									"key": pattern.pattern.key,
+									"value": evkey + ": " + text,
+									"mode": pattern.pattern.mode,
+									"path": pattern.pattern.path
+								}), this.filterOption, removeNodes[removeNodes.length-1].nextSibling);
+							}
+						}
+					}
+				}
+			}.bind(this));
+		}
+	},
+
+	reFindInFormDesigner_script: function(flagNode){
+		var code = this.editor.getValue();
+		if (code){
+			var regex = this.getFilterOptionRegex(this.filterOption)
+			regex.lastIndex = 0;
+			var len = code.length;
+
+			var preLine = 0;
+			var preIndex = 0;
+			var result;
+			while ((result = regex.exec(code)) !== null){
+				var obj = this.findScriptLineValue(result, code, preLine, preIndex, len, regex);
+				preLine = obj.preLine;
+				preIndex = obj.preIndex;
+
+				var pattern =  this.editor.pattern;
+				this.showFindResult(this._createFindMessageReplyData( this.editor.pattern.module, this.editor.pattern, "", {
+					"type": pattern.pattern.type,
+					"propertyType": pattern.pattern.propertyType,
+					"propertyName": pattern.pattern.propertyName,
+					"name": pattern.pattern.name,
+					"id": pattern.pattern.id,
+					"key": pattern.pattern.key,
+					"evkey": pattern.pattern.evkey,
+					"value": obj.value,
+					"line": preLine+1,
+					"mode": pattern.pattern.mode,
+					"path": pattern.pattern.path
+				}), this.filterOption, flagNode);
+			}
+
+		}
+		if (flagNode) flagNode.destroy();
+	},
+
+	reFindInDesigner: function(){
+		if (this.editor && this.editor.designerNode){
+			while (this.editor.designerNode.firstChild){
+				this.editor.designerNode.firstChild.destroy();
+				this.subResultCount(this.editor.pattern);
+			}
+			var code = this.editor.getValue();
+			if (code){
+				var regex = this.getFilterOptionRegex(this.filterOption)
+				regex.lastIndex = 0;
+				var len = code.length;
+
+				var preLine = 0;
+				var preIndex = 0;
+				var result;
+				while ((result = regex.exec(code)) !== null){
+					var obj = this.findScriptLineValue(result, code, preLine, preIndex, len, regex);
+					preLine = obj.preLine;
+					preIndex = obj.preIndex;
+
+					this.showFindResult(this._createFindMessageReplyData( this.editor.pattern.module, this.editor.pattern, "", {
+						"property": "text",
+						"value": obj.value,
+						"line": preLine+1
+					}), this.filterOption);
+				}
+			}
+		}
+		this.editor.isRefind = false;
+	},
+
+	saveDesigner: function(){
+		debugger;
+		if (this.editor && this.editor.pattern){
+			var pattern = this.editor.pattern;
+			var data = this.editor.designerData;
+
+			switch (pattern.designerType){
+				case "script":
+					var m;
+					switch (pattern.module){
+						case "processPlatform":
+							m = o2.Actions.load("x_processplatform_assemble_designer").ScriptAction.put;
+							break;
+						case "cms":
+							m = o2.Actions.load("x_cms_assemble_control").ScriptAction.put;
+							break;
+						case "portal":
+							m = o2.Actions.load("x_portal_assemble_designer").ScriptAction.edit;
+							break;
+						case "service":
+							m = (pattern.appId==="invoke") ? o2.Actions.load("x_program_center").InvokeAction.edit : o2.Actions.load("x_program_center").AgentAction.edit;
+							break;
+					}
+					data.text = this.editor.getValue();
+					if (m) m(data.id, data).then(function(){
+						this.notice(this.lp.notice.save_success, "success", this.previewContentNode, {"x": "left", "y": "bottom"});
+					}.bind(this), function(){});
+
+					break;
+				case "form":
+				case "page":
+				case "widget":
+					switch (pattern.module){
+						case "processPlatform":
+							var action = MWF.Actions.get("x_processplatform_assemble_designer");
+							m = action.saveForm.bind(action);
+							break;
+						case "cms":
+							var action = MWF.Actions.get("x_cms_assemble_control");
+							m = action.saveForm.bind(action);
+							break;
+						case "portal":
+							var action = MWF.Actions.get("x_portal_assemble_designer");
+							m = (pattern.designerType=="page") ? action.savePage.bind(action) : action.saveWidget.bind(action);
+							break;
+					}
+					if (this.designerDataObject && this.designerDataObject[this.editor.pattern.designerId]){
+						var d = this.designerDataObject[this.editor.pattern.designerId];
+						switch (this.editor.pattern.pattern.propertyType){
+							case "duty":
+								if (this.editor.pattern.pattern.path){
+									var path = this.editor.pattern.pattern.path;
+									for (var i=0; i<path.length-1; i++){
+										if (path[i]==this.editor.pattern.pattern.key){
+											d[path[i]] = JSON.parse(d[path[i]]);
+											d = d[path[i]];
+										}else{
+											d = d[path[i]];
+										}
+									}
+									d[path[path.length-1]] = this.editor.getValue();
+
+									d = this.designerDataObject[this.editor.pattern.designerId];
+									for (var i=0; i<path.length-1; i++){
+										if (path[i]==this.editor.pattern.pattern.key){
+											d[path[i]] = JSON.stringify(d[path[i]]);
+											break;
+										}else{
+											d = d[path[i]];
+										}
+									}
+								}
+								break;
+							default:
+								if (this.editor.getValue){
+									if (this.editor.pattern.pattern.path){
+										var path = this.editor.pattern.pattern.path;
+										for (var i=0; i<path.length-1; i++){
+											d = d[path[i]];
+										}
+									}
+									if (path[path.length-1]=="styles"){
+										d["recoveryStyles"] = this.editor.getValue();
+									}else if (path[path.length-1]=="inputStyles"){
+										d["recoveryInputStyles"] = this.editor.getValue();
+									}
+									d[path[path.length-1]] = this.editor.getValue();
+								}
+						}
+
+					}
+
+					if (m) m(data.data, data.mobileData, null, function(){
+						this.notice(this.lp.notice.save_success, "success", this.previewContentNode, {"x": "left", "y": "bottom"});
+					}.bind(this), function(){});
+
+					break;
+				case "process":
+					var action = MWF.Actions.get("x_processplatform_assemble_designer");
+					m = action.saveProcess.bind(action);
+
+					if (this.designerDataObject && this.designerDataObject[this.editor.pattern.designerId]) {
+						var d = this.designerDataObject[this.editor.pattern.designerId];
+						if (this.editor.getValue){
+							if (this.editor.pattern.pattern.path){
+								var path = this.editor.pattern.pattern.path;
+								for (var i=0; i<path.length-1; i++){
+									d = d[path[i]];
+								}
+							}
+							d[path[path.length-1]] = this.editor.getValue();
+						}
+					}
+
+					if (m) m(data, function(){
+						this.notice(this.lp.notice.save_success, "success", this.previewContentNode, {"x": "left", "y": "bottom"});
+					}.bind(this), function(){});
+
+					break;
+				case "view":
+					var action = MWF.Actions.get("x_query_assemble_designer");
+					m = action.saveView.bind(action);
+
+					if (this.designerDataObject && this.designerDataObject[this.editor.pattern.designerId]) {
+						var d = this.designerDataObject[this.editor.pattern.designerId];
+						if (this.editor.getValue){
+							if (this.editor.pattern.pattern.path){
+								var path = this.editor.pattern.pattern.path;
+								for (var i=0; i<path.length-1; i++){
+									d = d[path[i]];
+								}
+							}
+							d[path[path.length-1]] = this.editor.getValue();
+						}
+					}
+
+					if (m) m(data, function(){
+						this.notice(this.lp.notice.save_success, "success", this.previewContentNode, {"x": "left", "y": "bottom"});
+					}.bind(this), function(){});
+
+					break;
+
+				case "statement":
+					var action = MWF.Actions.get("x_query_assemble_designer");
+					m = action.saveStatement.bind(action);
+					if (this.designerDataObject && this.designerDataObject[this.editor.pattern.designerId]) {
+						var d = this.designerDataObject[this.editor.pattern.designerId];
+						if (this.editor.getValue){
+							if (this.editor.pattern.pattern.path){
+								var path = this.editor.pattern.pattern.path;
+								for (var i=0; i<path.length-1; i++){
+									d = d[path[i]];
+								}
+							}
+							d[path[path.length-1]] = this.editor.getValue();
+						}
+					}
+					var viewText = JSON.stringify(data.view);
+					data.view = viewText;
+
+					if (m) m(data, function(){
+						this.notice(this.lp.notice.save_success, "success", this.previewContentNode, {"x": "left", "y": "bottom"});
+					}.bind(this), function(){});
+					break;
+			}
+		}
+	},
+
+	openDesinger: function(){
+		if (this.editor && this.editor.pattern){
+			var pattern = this.editor.pattern;
+
+			switch (pattern.designerType){
+				case "script":
+					var m;
+					switch (pattern.module){
+						case "processPlatform":
+							var options = {
+								"appId": "process.ScriptDesigner"+pattern.designerId,
+								"id": pattern.designerId,
+								"application":  pattern.appId,
+							};
+							layout.openApplication(null, "process.ScriptDesigner", options);
+							break;
+						case "cms":
+							var options = {
+								"appId": "cms.ScriptDesigner"+pattern.designerId,
+								"id": pattern.designerId,
+								"application":  pattern.appId,
+							};
+							layout.openApplication(null, "cms.ScriptDesigner", options);
+							break;
+						case "portal":
+							var options = {
+								"appId": "portal.ScriptDesigner"+pattern.designerId,
+								"id": pattern.designerId,
+								"application":  pattern.appId,
+							};
+							layout.openApplication(null, "portal.ScriptDesigner", options);
+							break;
+						case "service":
+							if (pattern.appId==="invoke"){
+								var options = {
+									"appId": "service.InvokeDesigner"+pattern.designerId,
+									"id": pattern.designerId,
+								};
+								layout.openApplication(null, "service.InvokeDesigner", options);
+							}else{
+								var options = {
+									"appId": "service.AgentDesigner"+pattern.designerId,
+									"id": pattern.designerId,
+								};
+								layout.openApplication(null, "service.AgentDesigner", options);
+							}
+							break;
+					}
+					break;
+				case "form":
+					switch (pattern.module) {
+						case "processPlatform":
+							var _self = this;
+							var options = {
+								"style": layout.desktop.formDesignerStyle || "default",
+								"appId": "process.FormDesigner"+pattern.designerId,
+								"id": pattern.designerId,
+								"onPostFormLoad": function(){
+									_self.checkSelectDesignerElement_form(this, pattern, 0);
+								}
+							};
+							layout.openApplication(null, "process.FormDesigner", options);
+							break;
+						case "cms":
+							var _self = this;
+							var options = {
+								"style": layout.desktop.formDesignerStyle || "default",
+								"appId": "cms.FormDesigner"+pattern.designerId,
+								"id": pattern.designerId,
+								"onPostFormLoad": function(){
+									_self.checkSelectDesignerElement_form(this, pattern, 0);
+								}
+							};
+							layout.openApplication(null, "cms.FormDesigner", options);
+							break;
+					}
+					//this.createFormPatternNode(data, designerNode, regexp);
+					break;
+				case "process":
+					var _self = this;
+					var options = {
+						"appId": "process.ProcessDesigner"+pattern.designerId,
+						"id": pattern.designerId,
+						"onPostProcessLoad": function(){
+							_self.checkSelectDesignerElement_process(this, pattern, 0);
+						}
+					};
+					layout.openApplication(null, "process.ProcessDesigner", options);
+					break;
+				case "page":
+					var _self = this;
+					var options = {
+						"appId": "portal.PageDesigner"+pattern.designerId,
+						"id": pattern.designerId,
+						"onPostPageLoad": function(){
+							_self.checkSelectDesignerElement_form(this, pattern, 0);
+						}
+					};
+					layout.openApplication(null, "portal.PageDesigner", options);
+					break;
+				case "widget":
+					var _self = this;
+					var options = {
+						"appId": "portal.WidgetDesigner"+pattern.designerId,
+						"id": pattern.designerId,
+						"onPostWidgetLoad": function(){
+							_self.checkSelectDesignerElement_form(this, pattern, 0);
+						}
+					};
+					layout.openApplication(null, "portal.WidgetDesigner", options);
+					break;
+				case "view":
+					var _self = this;
+					var options = {
+						"appId": "query.ViewDesigner"+pattern.designerId,
+						"id": pattern.designerId,
+						"application": pattern.appId,
+						"onPostViewLoad": function(){
+							_self.checkSelectDesignerElement_view(this, pattern, 0);
+						}
+					};
+					layout.openApplication(null, "query.ViewDesigner", options);
+					break;
+				case "statement":
+					var _self = this;
+					var options = {
+						"appId": "query.StatementDesigner"+pattern.designerId,
+						"id": pattern.designerId,
+						"application": pattern.appId
+					};
+					layout.openApplication(null, "query.StatementDesigner", options);
+					break;
+			}
+			if (this.editor.getValue) window.setTimeout(function(){
+				if (this.scriptDesignerDataObject && this.scriptDesignerDataObject[this.editor.pattern.designerId]){
+					this.scriptDesignerDataObject[this.editor.pattern.designerId] = null;
+					delete this.scriptDesignerDataObject[this.editor.pattern.designerId];
+				}
+				if (this.editor) this.editor.destroy();
+				this.editor = null;
+
+				this.previewInforNode.show().inject(this.previewContentNode);
+			}.bind(this), 100);
+		}
+	},
+	checkSelectDesignerElement_view: function(app, pattern, idx){
+		var flag = false;
+		var view = app.view;
+		if (view){
+			var type = pattern.pattern.type.toLowerCase();
+			switch (type){
+				case "view":
+					flag = true;
+					break;
+				case "column":
+					for (var i=0; i<view.items.length; i++){
+						var m = view.items[i];
+						if (m.json.id==pattern.pattern.id || m.json.name==pattern.pattern.id){
+							window.setTimeout(function(){m.selected()}, 500);
+							flag = true;
+							break;
+						}
+					}
+					break;
+				case "actionbar":
+					for (var i=0; i<view.actionbarList.length; i++){
+						var m = view.actionbarList[i];
+						if (m.json.id==pattern.pattern.id || m.json.name==pattern.pattern.id){
+							window.setTimeout(function(){m.selected()}, 500);
+							flag = true;
+							break;
+						}
+					}
+					break;
+				case "paging":
+					for (var i=0; i<view.pagingList.length; i++){
+						var m = view.pagingList[i];
+						if (m.json.id==pattern.pattern.id || m.json.name==pattern.pattern.id){
+							window.setTimeout(function(){m.selected()}, 500);
+							flag = true;
+							break;
+						}
+					}
+					break;
+			}
+		}
+
+		if (!flag){
+			idx++;
+			if (idx<10) window.setTimeout(function(){
+				this.checkSelectDesignerElement_view(app, pattern, idx);
+			}.bind(this), 300);
+		}
+	},
+	checkSelectDesignerElement_process: function(app, pattern, idx){
+		var flag = false;
+		var process = app.process;
+		if (process){
+			var type = pattern.pattern.type.toLowerCase();
+			switch (type){
+				case "process":
+					flag = true;
+					break;
+				case "route":
+					if (process.routes && process.routes[pattern.pattern.id]){
+						process.routes[pattern.pattern.id].selected();
+						flag = true;
+					}
+					break;
+				case "begin":
+					if (process.begin){
+						process.begin.selected();
+						flag = true;
+					}
+					break;
+				default:
+					if (process[type+"s"] && process[type+"s"][pattern.pattern.id]){
+						process[type+"s"][pattern.pattern.id].selected();
+						flag = true;
+					}
+			}
+		}
+
+		if (!flag){
+			idx++;
+			if (idx<10) window.setTimeout(function(){
+				this.checkSelectDesignerElement_process(app, pattern, idx);
+			}.bind(this), 300);
+		}
+	},
+	checkSelectDesignerElement_form: function(app, pattern, idx){
+		var flag = false;
+		var form;
+		debugger;
+		try{
+			if (pattern.pattern.mode=="PC"){
+				app.changeDesignerModeToPC();
+				form = app.pcForm || app.pcPage;
+			}else{
+				app.changeDesignerModeToMobile();
+				form = app.mobileForm || app.mobilePage;
+			}
+		}catch(e){}
+
+		if (form && pattern.pattern.mode=="PC"){
+			if (pattern.pattern.type.toLowerCase()!="form"){
+				for (var i=0; i<form.moduleList.length; i++){
+					var m = form.moduleList[i];
+					if (m.json.id==pattern.pattern.name || m.json.name==pattern.pattern.name){
+						window.setTimeout(function(){m.selected()}, 500);
+						flag = true;
+						break;
+					}
+				}
+			}else{
+				flag = true;
+			}
+		}
+
+		if (!flag){
+			idx++;
+			if (idx<10) window.setTimeout(function(){
+				this.checkSelectDesignerElement_form(app, pattern, idx);
+			}.bind(this), 300);
+		}
+	},
+
+
+	_createFindMessageReplyData: function(module, designer, aliase, pattern){
+		return {
+			"module": module,
+			"appId": designer.appId,
+			"appName": designer.appName,
+			"designerId": designer.designerId,
+			"designerName": designer.designerName,
+			"designerType": designer.designerType,
+			"designerAliase": aliase,
+
+			"pattern": pattern
+		};
+	},
+
+	reLocationEditor: function(pattern){
+		this.editor.pattern = pattern;
+		this.editor.gotoLine(pattern.pattern.line, 1);
+		if (pattern.pattern.cols && pattern.pattern.cols.length){
+			var rs = [];
+			pattern.pattern.cols.forEach(function(col){
+				rs.push(this.editor.getRange(pattern.pattern.line,col.start, pattern.pattern.line, col.end));
+			}.bind(this));
+			this.editor.selectRange(rs);
+		}else{
+			this.editor.selectRange(this.editor.getRange(pattern.pattern.line,0));
+		}
+	},
+
+
+	getFilterOptionRegex: function(option){
+		var keyword = option.keyword;
+		keyword = keyword.replace("[", "\\[").replace("]", "\\]").replace("(", "\\(").replace(")", "\\)").replace("{", "\\{").replace("}", "\\}")
+			.replace("^", "\\^").replace("$", "\\$").replace(".", "\\.").replace("?", "\\?").replace("+", "\\+").replace("*", "\\*").replace("|", "\\|");
+
+		if (option.matchRegExp){
+			var flag = (option.caseSensitive) ? "gm" : "gmi";
+			return new RegExp(keyword, flag);
+		}else{
+			var flag = (option.caseSensitive) ? "gm" : "gmi";
+			keyword = (option.matchWholeWord) ? "\\b"+keyword+"\\b" : keyword;
+			return new RegExp(keyword, flag);
+		}
+	},
+
+	setReceiveMessage: function(){
+		this.listTitleInfoNode.set("text", this.lp.receiveToFind);
+	},
+	setReadyMessage: function(data){
+		this.findOptionModuleCount = data.count;
+		this.findOptionModuleProcessed = 0;
+		this.updateFindProgress();
+		this.listTitleInfoNode.set("text", this.lp.readyToFind.replace("{n}", data.count));
+	},
+	updateFindProgress: function(){
+		var percent = (this.findOptionModuleProcessed/this.findOptionModuleCount)*100;
+		this.listTitleProgressNode.setStyle("width", ""+percent+"%");
+	},
+
+	getActionsUrl:function(){
+		var processHost = o2.Actions.getHost("x_processplatform_assemble_designer");
+		var cmsHost = o2.Actions.getHost("x_cms_assemble_control");
+		var portalHost = o2.Actions.getHost("x_portal_assemble_designer");
+		var queryHost = o2.Actions.getHost("x_query_assemble_designer");
+		var serviceHost = o2.Actions.getHost("x_program_center");
+		var findHost = o2.Actions.getHost("x_query_service_processing");
+
+		var actions = {
+			"listProcess": o2.filterUrl(processHost+"/x_processplatform_assemble_designer/jaxrs/application/list"),
+			"listProcessProcess": o2.filterUrl(processHost+"/x_processplatform_assemble_designer/jaxrs/process/application/{applicationId}"),
+			"listProcessForm": o2.filterUrl(processHost+"/x_processplatform_assemble_designer/jaxrs/form/list/application/{applicationId}"),
+			"listProcessScript": o2.filterUrl(processHost+"/x_processplatform_assemble_designer/jaxrs/script/application/{applicationId}"),
+			"getProcessProcess": o2.filterUrl(processHost+"/x_processplatform_assemble_designer/jaxrs/process/{id}"),
+			"getProcessForm": o2.filterUrl(processHost+"/x_processplatform_assemble_designer/jaxrs/form/{id}"),
+			"getProcessScript": o2.filterUrl(processHost+"/x_processplatform_assemble_designer/jaxrs/script/{id}"),
+
+			"listCms": o2.filterUrl(cmsHost+"/x_cms_assemble_control/jaxrs/appinfo/list/manage"),
+			"listCmsForm": o2.filterUrl(cmsHost+"/x_cms_assemble_control/jaxrs/form/list/app/{appId}"),
+			"listCmsScript": o2.filterUrl(cmsHost+"/x_cms_assemble_control/jaxrs/script/list/app/{flag}"),
+			"getCmsForm": o2.filterUrl(cmsHost+"/x_cms_assemble_control/jaxrs/form/{id}"),
+			"getCmsScript": o2.filterUrl(cmsHost+"/x_cms_assemble_control/jaxrs/script/{id}"),
+
+			"listPortal": o2.filterUrl(portalHost+"/x_portal_assemble_designer/jaxrs/portal/list"),
+			"listPortalPage": o2.filterUrl(portalHost+"/x_portal_assemble_designer/jaxrs/page/list/portal/{portalId}"),
+			"listPortalScript": o2.filterUrl(portalHost+"/x_portal_assemble_designer/jaxrs/script/list/portal/{portalId}"),
+			"listPortalWidget": o2.filterUrl(portalHost+"/x_portal_assemble_designer/jaxrs/widget/list/portal/{portalId}"),
+			"getPortalPage": o2.filterUrl(portalHost+"/x_portal_assemble_designer/jaxrs/page/{id}"),
+			"getPortalScript": o2.filterUrl(portalHost+"/x_portal_assemble_designer/jaxrs/script/{id}"),
+			"getPortalWidget": o2.filterUrl(portalHost+"/x_portal_assemble_designer/jaxrs/widget/{id}"),
+
+			"listQuery": o2.filterUrl(queryHost+"/x_query_assemble_designer/jaxrs/query/list/summary"),
+			"listQueryView": o2.filterUrl(portalHost+"/x_query_assemble_designer/jaxrs/view/list/query/{flag}"),
+			"listQueryStat": o2.filterUrl(portalHost+"/x_query_assemble_designer/jaxrs/stat/list/query/{flag}"),
+			"listQueryStatement": o2.filterUrl(portalHost+"/x_query_assemble_designer/jaxrs/statement/list/query/{flag}"),
+			"getQueryView": o2.filterUrl(portalHost+"/x_query_assemble_designer/jaxrs/view/{id}"),
+			"getQueryStat": o2.filterUrl(portalHost+"/x_query_assemble_designer/jaxrs/stat/{id}"),
+			"getQueryStatement": o2.filterUrl(portalHost+"/x_query_assemble_designer/jaxrs/statement/{id}"),
+
+			"listInvoke": o2.filterUrl(serviceHost+"/x_program_center/jaxrs/invoke"),
+			"listAgent": o2.filterUrl(serviceHost+"/x_program_center/jaxrs/agent"),
+			"getInvoke": o2.filterUrl(serviceHost+"/x_program_center/jaxrs/invoke/{flag}"),
+			"getAgent": o2.filterUrl(serviceHost+"/x_program_center/jaxrs/agent/{flag}"),
+
+			"findAction": o2.filterUrl(findHost+"/x_query_service_processing/jaxrs/design/search")
+		};
+		return actions;
+	},
+
+	findDesigner: function(){
+		this.listContentNode.hide();
+		this.listContentNode.empty();
+		this.listInfoNode.show().getFirst().set("text", "");
+		this.listInfoNode.addClass("loadding");
+		this.patternCount = 0;
+
+		if (this.editor) this.editor.destroy();
+		this.editor = null;
+		this.previewInforNode.show().inject(this.previewContentNode);
+
+		this.scriptDesignerDataObject = null;
+		this.designerDataObject = null;
+
+		this.getFindWorker();
+		var actions = this.getActionsUrl();
+
+		this.tree = null;
+		this.getResultTree(function(){
+			var workerMessage = {
+				actions:actions,
+				filterOption: this.filterOption,
+				debug: (window.layout && layout["debugger"]),
+				token: (window.layout && layout.session && layout.session.user) ? layout.session.user.token : ""
+			};
+			this.findWorker.postMessage(workerMessage);
+		}.bind(this));
+	},
+
+	//------------------------------------------------------------
+	//------------------------------------------------------------
+	//------------------------------------------------------------
+	//------------------------------------------------------------
+	//------------------------------------------------------------
+	//------------------------------------------------------------
+	//------------------------------------------------------------
+	//------------------------------------------------------------
+	//------------------------------------------------------------
+	//------------------------------------------------------------
+	// ------------------------------------------------------------
+	// ------------------------------------------------------------
+
+
+
+	// findDesigner_bak: function(){
+	// 	this.listContentNode.hide();
+	// 	this.listInfoNode.show().getFirst().set("text", "");
+	// 	this.listInfoNode.addClass("loadding")
+	// 	o2.Actions.load("x_query_service_processing").DesignAction.search(this.filterOption, function(json){
+	// 		if ((json.data.processPlatformList && json.data.processPlatformList.length) ||
+	// 			(json.data.cmsList && json.data.cmsList.length) ||
+	// 			(json.data.portalList && json.data.portalList.length) ||
+	// 			(json.data.queryList && json.data.queryList.length) ||
+	// 			(json.data.serviceList && json.data.serviceList.length)){
+	//
+	// 			this.listInfoNode.hide();
+	// 			this.listFindResult(json.data);
+	//
+	// 		}else{
+	// 			this.listInfoNode.show().removeClass("loadding").getFirst().set("text", this.lp.nothingFind);
+	// 		}
+	// 	}.bind(this));
+	// },
+	//
+	//
+	// createResultAppItem: function(text, title, tree){
+	// 	var obj = {
+	// 		"title": title,
+	// 		"text": "<span style='font-weight: bold; color: #4A90E2'>"+text+"</span>",
+	// 		"icon": ""
+	// 	}
+	// 	return tree.appendChild(obj);
+	// },
+	// // createResultDesignerItem: function(designer, tree){
+	// // 	var title = this.lp[designer.designerType]+ ": "+ designer.designerName + " ("+designer.designerId+")";
+	// // 	var text = this.lp[designer.designerType]+ ": <b>"+ designer.designerName+"</b>";
+	// // 	var obj = {
+	// // 		"expand": false,
+	// // 		"title": title,
+	// // 		"text": text,
+	// // 		"icon": ""
+	// // 	}
+	// // 	var item = tree.appendChild(obj);
+	// // 	item.designer = designer;
+	// // 	item.appendChild({ "expand": false, "text": "loading...", "icon": "" });
+	// // 	return item;
+	// // },
+	// listFindResult: function(data){
+	// 	this.listContentNode.empty();
+	// 	this.listContentNode.show();
+	// 	o2.require("o2.widget.Tree", function(){
+	// 		var tree = new o2.widget.Tree(this.listContentNode, {
+	// 			"onQueryExpand": function(item){
+	// 				if (item.designer) this.loadDesignerPattern(item);
+	// 			}.bind(this)
+	// 		});
+	// 		tree.load();
+	// 		if (data.processPlatformList && data.processPlatformList.length){
+	// 			var platformItem = this.createResultCategroyItem(this.lp.processPlatform, this.lp.processPlatform, tree);
+	// 			this.listProcessResult(platformItem, data.processPlatformList, "processPlatform");
+	// 		}
+	// 		if (data.cmsList && data.cmsList.length){
+	// 			var platformItem = this.createResultCategroyItem(this.lp.cms, this.lp.cms, tree);
+	// 			//this.listProcessResult(categroyItem, data.cmsList);
+	// 		}
+	// 		if (data.portalList && data.portalList.length){
+	// 			var platformItem = this.createResultCategroyItem(this.lp.portal, this.lp.portal, tree);
+	//
+	// 		}
+	// 		if (data.queryList && data.queryList.length){
+	// 			var platformItem = this.createResultCategroyItem(this.lp.query, this.lp.query, tree);
+	// 		}
+	// 		if (data.serviceList && data.serviceList.length){
+	// 			var platformItem = this.createResultCategroyItem(this.lp.service, this.lp.service, tree);
+	// 		}
+	//
+	//
+	// 	}.bind(this));
+	// },
+	// addPatternCount: function(item, count){
+	// 	if (!item.count) item.count = 0;
+	// 	item.count += count;
+	// 	var t = this.lp.patternCount.replace("{n}", item.count);
+	// 	var textDivNode = item.textNode.getElement("div");
+	// 	if (textDivNode){
+	// 		var html = item.options.text;
+	// 		textDivNode.set("html", html+" <span style=''>( "+t+" )</span>");
+	// 	}
+	// },
+	// listProcessResult: function(platformItem, list, platform){
+	// 	var applicationItems = {};
+	// 	list.each(function(designer){
+	// 		if (designer.patternList && designer.patternList.length){
+	// 			var appItem = applicationItems[designer.appId];
+	// 			if (!appItem){
+	// 				applicationItems[designer.appId] = appItem = this.createResultAppItem(designer.appName, designer.appName+" ("+designer.appId+")", platformItem);
+	// 			}
+	// 			designer.platform = platform;
+	// 			var designerItem = this.createResultDesignerItem(designer, appItem);
+	// 			var count=0;
+	// 			designer.patternList.each(function(p){
+	// 				if (p.lines && p.lines.length){
+	// 					count += p.lines.length;
+	// 				}else{
+	// 					count++;
+	// 				}
+	// 			});
+	// 			// var count = designer.patternList.length;
+	//
+	// 			this.addPatternCount(designerItem, count);
+	// 			this.addPatternCount(appItem, count);
+	// 			this.addPatternCount(platformItem, count);
+	// 		}
+	// 	}.bind(this));
+	// },
+	//
+	// getDesignerObject: function(designer){
+	// 	switch (designer.platform){
+	// 		case "processPlatform":
+	// 			var action = this.Actions.load("x_processplatform_assemble_designer");
+	// 			switch (designer.designerType){
+	// 				case "script":
+	// 					return action.ScriptAction.get(designer.designerId, function(json){return json.data;});
+	// 				case "form":
+	// 					return action.FomrAction.get(designer.designerId, function(json){return json.data;});
+	// 				case "process":
+	// 					return action.ProcessAction.get(designer.designerId, function(json){return json.data;});
+	// 			}
+	// 		case "cms":
+	// 			var action = this.Actions.load("x_cms_assemble_control");
+	// 			switch (designer.designerType){
+	// 				case "script":
+	// 					return action.ScriptAction.get(designer.designerId, function(json){return json.data;});
+	// 				case "form":
+	// 					return action.FormAction.get(designer.designerId, function(json){return json.data;});
+	// 			}
+	//
+	// 		case "portal":
+	// 			var action = this.Actions.load("x_portal_assemble_designer");
+	// 			switch (designer.designerType){
+	// 				case "script":
+	// 					return action.ScriptAction.get(designer.designerId, function(json){return json.data;});
+	// 				case "page":
+	// 					return action.PageAction.get(designer.designerId, function(json){return json.data;});
+	// 				case "widget":
+	// 					return action.WidgetAction.get(designer.designerId, function(json){return json.data;});
+	// 			}
+	// 		case "query":
+	// 			var action = this.Actions.load("x_query_assemble_designer");
+	// 			switch (designer.designerType){
+	// 				case "view":
+	// 					return action.ViewAction.get(designer.designerId, function(json){return json.data;});
+	// 				case "statement":
+	// 					return action.StatementAction.get(designer.designerId, function(json){return json.data;});
+	// 				case "stat":
+	// 					return action.StatAction.get(designer.designerId, function(json){return json.data;});
+	// 			}
+	// 		case "service":
+	// 			var action = this.Actions.load("x_program_center");
+	// 			switch (designer.appId){
+	// 				case "invoke":
+	// 					return action.InvokeAction.get(designer.designerId, function(json){return json.data;});
+	// 				case "agent":
+	// 					return action.AgentAction.get(designer.designerId, function(json){return json.data;});
+	// 			}
+	// 	}
+	// },
+	// loadDesignerPattern: function(item){
+	// 	if (item.firstChild && item.firstChild.options.text==="loading..."){
+	// 		item.firstChild.destroy();
+	//
+	// 		var root, actionName, fun;
+	// 		switch (designer.platform) {
+	// 			case "processPlatform":
+	// 				root = "x_processplatform_assemble_designer";
+	// 				switch (designer.designerType) {
+	// 					case "script": actionName = "ScriptAction"; fun = "listProcessScriptPattern";
+	// 					case "form": actionName = "FomrAction"; fun = "listProcessFormPattern";
+	// 					case "process": actionName = "ProcessAction"; fun = "listProcessProcessPattern";
+	// 				}
+	// 			case "cms":
+	// 				root = "x_cms_assemble_control";
+	// 				switch (designer.designerType) {
+	// 					case "script": actionName = "ScriptAction"; fun = "listCmsScriptPattern";
+	// 					case "form": actionName = "FormAction"; fun = "listCmsFormPattern";
+	// 				}
+	//
+	// 			case "portal":
+	// 				root = "x_portal_assemble_designer";
+	// 				switch (designer.designerType) {
+	// 					case "script": actionName = "ScriptAction"; fun = "listPortalScriptPattern";
+	// 					case "page": actionName = "PageAction"; fun = "listPortalPagePattern";
+	// 					case "widget": actionName = "WidgetAction"; fun = "listPortalWidgetPattern";
+	// 				}
+	// 			case "query":
+	// 				root = "x_query_assemble_designer";
+	// 				switch (designer.designerType) {
+	// 					case "view": actionName = "ViewAction"; fun = "listQueryViewPattern";
+	// 					case "statement": actionName = "StatementAction"; fun = "listQueryStatementPattern";
+	// 					case "stat": actionName = "StatAction"; fun = "listQueryStatPattern";
+	// 				}
+	// 			case "service":
+	// 				root = "x_program_center";
+	// 				switch (designer.appId) {
+	// 					case "invoke": actionName = "InvokeAction"; fun = "listServiceInvokePattern";
+	// 					case "agent": actionName = "AgentAction"; fun = "listServiceAgentPattern";
+	// 				}
+	// 		}
+	// 		this.Actions.load(root)[actionName].get(designer.designerId, function(json){
+	// 			this[fun](json.data, designer.patternList, item);
+	// 		}.bind(this))
+	// 	}
+	// },
+	//
+	// getFindRegExp: function(){
+	// 	var flag = "gm";
+	// 	var keyword = this.filterOption.keyword;
+	// 	if (!this.filterOption.caseSensitive) flag+="i";
+	// 	if (this.filterOption.matchRegExp){
+	// 		return new RegExp(keyword, flag)
+	// 	}else{
+	// 		if (this.filterOption.matchWholeWord) keyword = "\\b"+keyword+"\\b";
+	// 		return new RegExp(keyword, flag)
+	// 	}
+	// },
+	//
+	//
+	// //启动一个webworker处理
+	// listProcessScriptPattern: function (data, patternList, item){
+	// 	patternList.each(function(pattern){
+	// 		if (pattern.property == "text"){
+	// 			var textArr = data.split("\n");
+	// 			var regex = this.getFindRegExp();
+	// 			pattern.lines.each(function(line){
+	// 				var text = textArr[line];
+	//
+	//
+	//
+	// 			}.bind(this));
+	// 		}else{
+	//
+	// 		}
+	// 	}.bind(this));
+	// }
+
+
+});

+ 431 - 0
o2web/source/x_component_FindDesigner/PatternWorker.js

@@ -0,0 +1,431 @@
+var _worker = self;
+var _action = {
+    _checkRequest: function(s,f){
+        if (this.request.readyState === XMLHttpRequest.DONE) {
+            if (this.request.status === 200) {
+                this._doneRequest(s);
+            } else {
+                this._errorRequest(f);
+            }
+        }
+    },
+    _createRequest: function(s, f){
+        var request = new XMLHttpRequest();
+        request.addEventListener("readystatechange",function(){
+            if (this.readyState === XMLHttpRequest.DONE) {
+                if (this.status === 200) {
+                    var json = JSON.parse(this.responseText);
+                    var xToken = this.getResponseHeader("x-token");
+                    if (xToken){
+                        json.xToken = xToken;
+                    }
+                    if (s) s(json);
+                } else {
+                    if (f) f(this, this.responseText);
+                }
+            }
+        });
+        return request
+    },
+    sendRequest: function(data){
+        return new Promise(function(s, f){
+            var request = this._createRequest(s, f);
+            var method = data.method;
+            var noCache = !!data.noCache;
+            var async = !!data.loadAsync;
+            var withCredentials = !!data.credentials;
+            var url = data.address;
+            var body = data.body;
+            var debug = data.debug;
+            var token = data.token;
+
+            if (noCache) url = url+(((url.indexOf("?")!==-1) ? "&" : "?")+(new Date()).getTime());
+
+            request.open(method, url, async);
+
+            request.withCredentials = withCredentials;
+            request.setRequestHeader("Content-Type", "application/json; charset=utf-8");
+            request.setRequestHeader("Accept", "text/html,application/json,*/*");
+            if (debug) request.setRequestHeader("x-debugger", "true");
+            if (token){
+                request.setRequestHeader("x-token", token);
+                request.setRequestHeader("authorization", token);
+            }
+
+            request.send(body);
+        }.bind(this));
+    },
+
+    _doneRequest: function(s){
+        var json = JSON.parse(this.request.responseText);
+        var xToken = this.request.getResponseHeader("x-token");
+        if (xToken){
+            json.xToken = xToken;
+        }
+        if (s) s(json);
+        // _worker.postMessage({"type": "done", "data": json});
+        // _worker.close();
+    },
+    _errorRequest: function(f){
+        if (s) s(this.request, this.request.responseText);
+        // _worker.postMessage({"type":"error", "data": {"status":  this.request.status, "statusText":  this.request.statusText, "responseText":this.request.responseText}});
+        // _worker.close();
+    }
+};
+
+_worker.action = _action;
+
+_worker._receiveMessageReply = function(){
+    _worker.postMessage({
+        "type": "receive"
+    });
+};
+_worker._readyMessageReply = function(){
+    _worker.postMessage({
+        "type": "ready",
+        "count": this.filterOptionList.length
+    });
+};
+
+_worker._getRequestOption = function(data, par){
+    if (par){
+        Object.keys(par).forEach(function(k){
+            data.url = data.url.replace("{"+k+"}", par[k]);
+        });
+    }
+    return {
+        "method": data.method||"get",
+        "noCache": false,
+        "loadAsync": true,
+        "credentials": true,
+        "address": data.url,
+        "body": data.body || "",
+        "debug": data.debug || _worker.findData.debug,
+        "token": data.token || _worker.findData.token
+    };
+};
+
+_worker._createFilterOption = function(moduleType, appId, desingerType, desingerId){
+    var filterOption = JSON.parse(_worker.filterOptionTemplete);
+    filterOption.moduleList.push({
+        "moduleType": moduleType,
+        "moduleAppList": [{"appId": appId, "designerList": [{"desingerType": desingerType, "designerIdList": [desingerId]}]}]
+    });
+    this.filterOptionList.push(filterOption);
+    return filterOption;
+};
+_worker._getDesingerModule = function(id, restful, par, moduleType, desingerType){
+    var p = _worker.action.sendRequest(_worker._getRequestOption({"url": restful, "debug": _worker.findData.debug, "token": _worker.findData.token }, par));
+    return p.then(function(json){
+        list = json.data;
+        list.forEach(function(designer){
+            _worker._createFilterOption(moduleType, id, desingerType, designer.id)
+        });
+    }, function(){});
+};
+
+_worker._getDesinger_processPlatform = function(id){
+    var promiseArr = [];
+    if (_worker.findData.filterOption.designerTypes.indexOf("script")!=-1){    //所有脚本
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listProcessScript, {"applicationId": id}, "processPlatform", "script"));
+    }
+    if (_worker.findData.filterOption.designerTypes.indexOf("form")!=-1){      //所有表单
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listProcessForm, {"applicationId": id}, "processPlatform", "form"));
+    }
+    if (_worker.findData.filterOption.designerTypes.indexOf("process")!=-1){   //所有流程
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listProcessProcess, {"applicationId": id}, "processPlatform", "process"));
+    }
+    return promiseArr;
+};
+
+_worker._getDesinger_cms = function(id){
+    var promiseArr = [];
+    if (_worker.findData.filterOption.designerTypes.indexOf("script")!=-1){    //所有脚本
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listCmsScript, {"flag": id}, "cms", "script"));
+    }
+    if (_worker.findData.filterOption.designerTypes.indexOf("form")!=-1){      //所有表单
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listCmsForm, {"appId": id}, "cms", "form"));
+    }
+    return promiseArr;
+};
+
+_worker._getDesinger_portal = function(id){
+    var promiseArr = [];
+    if (_worker.findData.filterOption.designerTypes.indexOf("script")!=-1){    //所有脚本
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listPortalScript, {"portalId": id}, "portal", "script"));
+    }
+    if (_worker.findData.filterOption.designerTypes.indexOf("page")!=-1){      //所有表单
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listPortalPage, {"portalId": id}, "portal", "page"));
+    }
+    if (_worker.findData.filterOption.designerTypes.indexOf("widget")!=-1){   //所有流程
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listPortalWidget, {"portalId": id}, "portal", "widget"));
+    }
+    return promiseArr;
+};
+
+_worker._getDesinger_query = function(id){
+    var promiseArr = [];
+    if (_worker.findData.filterOption.designerTypes.indexOf("view")!=-1){    //所有脚本
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listQueryView, {"flag": id}, "query", "view"));
+    }
+    if (_worker.findData.filterOption.designerTypes.indexOf("stat")!=-1){      //所有表单
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listQueryStat, {"flag": id}, "query", "stat"));
+    }
+    if (_worker.findData.filterOption.designerTypes.indexOf("statement")!=-1){   //所有流程
+        promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listQueryStatement, {"flag": id}, "query", "statement"));
+    }
+    return promiseArr;
+};
+
+_worker._getDesinger_service = function(id){
+    var promiseArr = [];
+    if (_worker.findData.filterOption.designerTypes.indexOf("script")!=-1){    //所有脚本
+        if (id=="invoke"){
+            promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listInvoke, null, "service", "script"));
+        }else{
+            promiseArr.push(_worker._getDesingerModule(id, _worker.findData.actions.listAgent, null, "service", "script"));
+        }
+    }
+    return promiseArr;
+};
+
+
+_worker._listApplication = function(type){
+    switch (type){
+        case "processPlatform":
+            return this.action.sendRequest(_worker._getRequestOption({"url": this.findData.actions.listProcess, "debug": this.findData.debug, "token": this.findData.token }));
+        case "cms":
+            return this.action.sendRequest(_worker._getRequestOption({"url": this.findData.actions.listCms, "debug": this.findData.debug, "token": this.findData.token }));
+        case "portal":
+            return this.action.sendRequest(_worker._getRequestOption({"url": this.findData.actions.listPortal, "debug": this.findData.debug, "token": this.findData.token }));
+        case "query":
+            return this.action.sendRequest(_worker._getRequestOption({"url": this.findData.actions.listQuery, "debug": this.findData.debug, "token": this.findData.token }));
+    }
+
+};
+_worker._parseFindModule = function(moduleList){
+    var promiseArr = [];
+    moduleList.forEach(function(module){
+        if (module.moduleType==="service"){
+            if (!module.flagList || !module.flagList.length){
+
+                var filterOption = JSON.parse(_worker.filterOptionTemplete);
+                filterOption.moduleList.push({
+                    "moduleType": module.moduleType,
+                    "moduleAppList": [{"appId": "invoke"}]
+                });
+                this.filterOptionList.push(filterOption);
+
+                var filterOption = JSON.parse(_worker.filterOptionTemplete);
+                filterOption.moduleList.push({
+                    "moduleType": module.moduleType,
+                    "moduleAppList": [{"appId": "agent"}]
+                });
+                this.filterOptionList.push(filterOption);
+
+                //promiseArr.push(Promise.resolve(""));
+                promiseArr = promiseArr.concat(_worker["_getDesinger_"+module.moduleType]("invoke"));
+                promiseArr = promiseArr.concat(_worker["_getDesinger_"+module.moduleType]("agent"));
+            }else{
+                module.flagList.forEach(function(flag){
+                    if (!flag.designerList || !flag.designerList.length){
+                        promiseArr = promiseArr.concat(_worker["_getDesinger_"+module.moduleType](flag.id));
+                    }else{
+                        flag.designerList.forEach(function(designer){
+                            var filterOption = _worker._createFilterOption(module.moduleType, flag.id, designer.desingerType, designer.id)
+                            promiseArr = promiseArr.concat(Promise.resolve(filterOption));
+                        });
+                    }
+                });
+            }
+        }else{
+            if (!module.flagList || !module.flagList.length){
+                var p = _worker._listApplication(module.moduleType);
+                promiseArr.push(p.then(function(json){
+
+                    // json.data.forEach(function(app){
+                    //     var filterOption = JSON.parse(_worker.filterOptionTemplete);
+                    //     filterOption.moduleList.push({
+                    //         "moduleType": module.moduleType,
+                    //         "moduleAppList": [{"appId": app.id}]
+                    //     });
+                    //     this.filterOptionList.push(filterOption);
+                    // });
+                    // return Promise.resolve("");
+                    //临时处理
+
+
+                    var pArr = [];
+                    json.data.forEach(function(app){
+                        pArr = pArr.concat(_worker["_getDesinger_"+module.moduleType](app.id));
+                    });
+                    return Promise.all(pArr);
+                }, function(){}));
+
+            }else{
+                module.flagList.forEach(function(flag){
+                    if (!flag.designerList || !flag.designerList.length){
+                        promiseArr = promiseArr.concat(_worker["_getDesinger_"+module.moduleType](flag.id));
+                    }else{
+                        flag.designerList.forEach(function(designer){
+                            var filterOption = _worker._createFilterOption(module.moduleType, flag.id, designer.desingerType, designer.id)
+                            promiseArr = promiseArr.concat(Promise.resolve(filterOption));
+                        });
+                    }
+                });
+            }
+        }
+    }.bind(this));
+    return promiseArr;
+}
+
+_worker._findMessageReply = function(data, option){
+    _worker.setTimeout(function(){
+        _worker.postMessage(data);
+    }, 100);
+
+};
+_worker._findOptionReply = function(){
+    _worker.postMessage({
+        "type": "done"
+    });
+};
+
+
+
+_worker._createFindMessageReplyData = function(module, designer, aliase, pattern){
+    return {
+        "module": module,
+        "appId": designer.appId,
+        "appName": designer.appName,
+        "designerId": designer.designerId,
+        "designerName": designer.designerName,
+        "designerType": designer.designerType,
+        "designerAliase": aliase,
+
+        "pattern": pattern
+    };
+};
+
+_worker._setFilterOptionRegex = function(){
+    var keyword = _worker.findData.option.keyword;
+    if (_worker.findData.option.matchRegExp){
+        var flag = (_worker.findData.option.caseSensitive) ? "g" : "gi";
+        this.keywordRegexp =  new RegExp(keyword, flag);
+    }else{
+        var flag = (_worker.findData.option.caseSensitive) ? "g" : "gi";
+        keyword = (_worker.findData.option.matchWholeWord) ? "\\b"+keyword+"\\b" : keyword;
+        this.keywordRegexp = new RegExp(keyword, flag);
+    }
+};
+
+_worker._findProcessPlatformParse_script = function(designer){
+    if (designer.patternList && designer.patternList.length){
+        var action = this.findData.actions.getProcessScript;
+
+        var p = _worker.action.sendRequest(_worker._getRequestOption({"url": action}, {"id": designer.designerId}));
+        p.then(function(json){
+            designer.patternList.forEach(function(pattern){
+                if (pattern.property=="text"){
+                    var scriptLines = json.data.text.split(/\n/);
+                    pattern.lines.forEach(function(line){
+                        var scriptText = scriptLines[line-1];
+                        while ((arr = this.keywordRegexp.exec(scriptText)) !== null) {
+                            var col = arr.index;
+                            var key = arr[0];
+                            var value = arr.input;
+                            _worker._findMessageReply(_worker._createFindMessageReplyData("processPlatform", designer, json.data.aliase, {
+                                "property": pattern.property,
+                                "value": value,
+                                "line": line,
+                                "column": col,
+                                "key": key
+                            }));
+                        }
+                    });
+                }else{
+                    _worker._findMessageReply(_worker._createFindMessageReplyData("processPlatform", designer, json.data.aliase, {
+                        "property": pattern.property,
+                        "value": json.data[pattern.property]
+                    }));
+                }
+            });
+        }, function(){});
+    }
+};
+
+_worker._findProcessPlatformParse_form = function(designer){
+
+};
+
+_worker._findProcessPlatformParse_process = function(designer){
+
+};
+
+_worker._findProcessPlatformParse = function(resultList){
+    resultList.forEach(function(designer){
+        switch (designer.designerType){
+            case "script":
+                _worker._findProcessPlatformParse_script(designer);
+                break;
+            case "form":
+                _worker._findProcessPlatformParse_form(designer);
+                break;
+            case "process":
+                _worker._findProcessPlatformParse_process(designer);
+                break;
+        }
+    });
+};
+
+
+_worker._doFindDesigner = function(option){
+
+        var res = _worker._getRequestOption({
+            "method": "post",
+            "url": this.findData.actions.findAction,
+            "body": JSON.stringify(option),
+            "debug": this.findData.debug,
+            "token": this.findData.token
+        });
+        this.action.sendRequest(res).then(function(json){
+            if (json.data.processPlatformList && json.data.processPlatformList.length){
+                _worker._findProcessPlatformParse(json.data.processPlatformList);
+            }
+            if (json.data.cmsList && json.data.cmsList.length){
+
+            }
+            if (json.data.portalList && json.data.portalList.length){
+
+            }
+            if (json.data.queryList && json.data.queryList.length){
+
+            }
+            if (json.data.serviceList && json.data.serviceList.length){
+
+            }
+            _worker._findOptionReply();
+            //_worker._findMessageReply(json.data, option);
+        }, function(xhr){
+            _worker._findOptionReply(null);
+            _worker._findMessageReply(null);
+        });
+
+
+
+},
+
+_worker._doFindDesignerFromFilterOption = function(){
+    this.filterOptionList.forEach(function(option){
+        _worker._doFindDesigner(option);
+    });
+},
+onmessage = function(e) {
+    this.findData = e.data;
+    _worker._setFilterOptionRegex();
+    // "parser": "_findProcessPlatformParse",
+    //     "actions": _worker.findData.actions,
+    //     "option": option,
+    //     "pattern": json.data.processPlatformList
+    _worker[e.data.parser](e.data.pattern);
+}

+ 55 - 0
o2web/source/x_component_FindDesigner/lp/zh-cn.js

@@ -0,0 +1,55 @@
+MWF.xApplication.FindDesigner.LP = {
+	"title": "在设计中查找",
+
+	"filter": "在设计中查找",
+	"range": "查找范围",
+
+	"script": "脚本",
+	"form": "表单",
+	"process": "流程",
+	"page": "页面",
+	"widget": "部件",
+	"view": "视图",
+	"statement": "查询语句",
+	"stat": "统计",
+	"property": "属性",
+	"value": "值",
+
+
+	"processPlatform": "流程平台",
+	"cms": "内容管理",
+	"portal": "门户管理",
+	"query": "数据中心",
+	"service": "服务管理",
+
+	"search_placeholder": "请输入查询内容",
+	"dockToBottom": "固定到下方",
+	"dockToRight": "固定到右侧",
+	"nothingFind": "未找到任何结果, 请修改查询条件",
+	"nothingFind_keyword": "未找到任何结果\n请输入查询关键字",
+	"nothingFind_noFilter": "未找到任何结果\n请输选择查询类型",
+	"nothingFind_noRange": "未找到任何结果\n请确定查询范围",
+	"nothingPreview": "选择查找结果列表,可在此处预览",
+
+	"selectRange": "选择查找范围",
+	"patternCount": "{n} 项匹配",
+
+	"receiveToFind": "正在准备查询数据 ...",
+	"readyToFind": "设计元素准备完毕(共{n}个) ...",
+	"findPatternCount": "已找到{n}项匹配",
+	"findPatternCountCompleted": "查询完毕,已找到{n}项匹配",
+
+	"elementPattern": "<b>元素:</b> {element}, <b>属性:</b> {property}: ",
+
+	"element": "元素",
+
+	"saveDesigner": "保存设计元素",
+	"openDesigner": "打开应用",
+
+	"findInfor": "您在此设计元素中找到匹配项:",
+	"findInforOpen": "请点击此处开打设计元素",
+
+	"notice": {
+		"save_success": "保存成功!"
+	}
+};

+ 349 - 0
o2web/source/x_component_FindDesigner/propertys.json

@@ -0,0 +1,349 @@
+{
+  "form": {
+    "id": {"name": "标识"},
+    "name": {"name": "名称"},
+    "description": {"name": "描述"},
+    "category": {"name": "分类"},
+    "formStyleType": {"name": "表单样式"},
+    "includeScripts": {"name": "预加载脚本", "type": "object-array"},
+    "styles": {"name": "样式", "type":"map"},
+    "properties": {"name": "属性", "type":"map"},
+    "css": {"name": "CSS样式", "type": "css"},
+    "submitFormScript": {"name": "提交表单脚本", "type": "script"},
+    "submitScript": {"name": "提交操作脚本", "type": "script"},
+    "afterProcessRedirectScript": {"name": "提交后重定向脚本", "type": "script"},
+    "validationOpinion": {"name": "校验意见脚本", "type": "script"},
+    "validationRoute": {"name": "校验路由脚本", "type": "script"},
+    "validationFormCustom": {"name": "流转校验脚本", "type": "script"},
+    "events": {"name": "事件", "type": "events"},
+
+    "text": {"name": "文本值"},
+    "script": {"name": "脚本", "type": "script"},
+
+    "inputStyles": {"name": "输入框样式", "type":"map"},
+    "defaultValue": {"name": "默认值脚本", "type":"script"},
+    "validation": {"name": "校验脚本", "type":"script"},
+    "sectionByScript": {"name": "区段依据脚本", "type":"script"},
+
+    "identityValue": {"name": "身份默认值", "type": "object-array"},
+    "unitValue": {"name": "组织默认值", "type": "object-array"},
+    "dutyValue": {"name": "职务默认值", "type": "duty"},
+    "displayTextScript": {"name": "组织数据显示脚本", "type":"script"},
+    "rangeDutyKey": {"name": "身份选择职务范围脚本", "type":"script"},
+    "unitRangeKey": {"name": "组织选择职务范围脚本", "type":"script"},
+    "groupRangeKey": {"name": "群组选择职务范围脚本", "type":"script"},
+    "identityIncludeKey": {"name": "增加身份选择脚本", "type":"script"},
+    "exclude": {"name": "排除选择脚本", "type":"script"},
+
+    "itemValues": {"name": "可选值", "type":"array"},
+    "itemScript": {"name": "可选值脚本", "type":"script"},
+
+    "buttonStyles": {"name": "按钮样式", "type":"map"},
+
+    "itemDynamic": {"name": "可选值动态脚本", "type":"map"},
+
+    "multiTools": {"name": "操作按钮", "type":"actions"},
+
+    "tools": {"name": "操作按钮", "type":"actions"},
+
+    "site": {"name": "附件site"},
+
+    "titleTdStyles": {"name": "标题单元格样式", "type":"map"},
+    "contentTdStyles": {"name": "内容单元格样式", "type":"map"},
+    "layoutTdStyles": {"name": "布局单元格样式", "type":"map"},
+
+    "tableStyles": {"name": "表格样式", "type":"map"},
+    "defaultData": {"name": "默认数据脚本", "type":"script"},
+    "editableScript": {"name": "允许编辑脚本", "type":"script"},
+    "titleStyles": {"name": "标题样式", "type":"map"},
+    "contentStyles": {"name": "内容单元格样式", "type":"map"},
+    "actionStyles": {"name": "样式", "type":"map"},
+    "editStyles": {"name": "编辑单元格样式", "type":"map"},
+    "amountStyles": {"name": "总计单元格样式", "type":"map"},
+    "itemTitleStyles": {"name": "条目标题样式(仅移动端)", "type":"map"},
+
+    "subformScript": {"name": "计算子表单脚本", "type":"script"},
+
+    "itemStyles": {"name": "条目样式", "type":"map"},
+    "selectedSetValues": {"name": "选择结果赋值", "type":"map"},
+    "selectedScript": {"name": "选择结果处理脚本", "type":"script"},
+    "defaultSelectedScript": {"name": "默认选择脚本", "type":"script"},
+    "selectedAbleScript": {"name": "允许选择脚本", "type":"script"},
+    "filterList": {"name": "视图过滤脚本", "type":"filter"},
+
+    "innerHTML": {"name": "内置HTML", "type":"html"},
+
+    "tabNodeContainer": {"name": "Tab容器样式", "type":"map"},
+    "contentNodeContainer": {"name": "内容容器样式", "type":"map"},
+    "tabStyles": {"name": "基本Tab样式", "type":"map"},
+    "tabTextStyles": {"name": "基本Tab字体样式", "type":"map"},
+    "tabCurrentStyles": {"name": "当前Tab样式", "type":"map"},
+    "tabTextCurrentStyles": {"name": "当前Tab字体样式", "type":"map"},
+
+    "dataScript": {"name": "数据脚本", "type":"script"},
+    "areaNodeStyle": {"name": "tree区域样式", "type":"map"},
+    "treeItemNodeStyle": {"name": "tree节点样式", "type":"map"},
+    "textDivNodeStyle": {"name": "tree节点字体样式", "type":"map"},
+    "textDivNodeSelectedStyle": {"name": "当前tree节点字体样式", "type":"map"},
+
+    "textStyle": {"name": "流程意见格式"},
+    "textStyleScript": {"name": "流程意见格式脚本", "type":"script"},
+    "filterActivitye": {"name": "活动过滤"},
+    "filterActivityAliase": {"name": "活动别名过滤"},
+    "filterPersone": {"name": "处理人过滤"},
+    "filterRoutee": {"name": "路由过滤"},
+    "filterScript": {"name": "过滤脚本", "type":"script"},
+
+    "src": {"name": "src"},
+
+    "toWordFilename": {"name": "转换文件名"},
+    "toWordSite": {"name": "转换文件site"},
+    "toWordConditionScript": {"name": "文件转换条件脚本", "type":"script"},
+
+    "copiesSecretPriorityShowScript": {"name": "份数密级紧急度显示脚本", "type":"script"},
+    "copiesShowScript": {"name": "份数显示脚本", "type":"script"},
+    "copiesValueData": {"name": "份数绑定表单数据"},
+    "copiesValueScript": {"name": "份数绑定值脚本", "type":"script"},
+
+    "secretShowScript": {"name": "密级显示脚本", "type":"script"},
+    "secretValueData": {"name": "密级绑定表单数据"},
+    "secretValueScript": {"name": "密级绑定值脚本", "type":"script"},
+
+    "priorityShowScript": {"name": "紧急度显示脚本", "type":"script"},
+    "priorityValueData": {"name": "紧急度绑定表单数据"},
+    "priorityValueScript": {"name": "紧急度绑定值脚本", "type":"script"},
+
+    "redHeaderShowScript": {"name": "红头显示脚本", "type":"script"},
+    "redHeaderValueData": {"name": "红头绑定表单数据"},
+    "redHeaderValueScript": {"name": "红头绑定值脚本", "type":"script"},
+
+    "redLineShowScript": {"name": "红线显示脚本", "type":"script"},
+
+    "filenoShowScript": {"name": "文号显示脚本", "type":"script"},
+    "filenoValueData": {"name": "文号绑定表单数据"},
+    "filenoValueScript": {"name": "文号绑定值脚本", "type":"script"},
+
+    "signerShowScript": {"name": "签发人显示脚本", "type":"script"},
+    "signerValueData": {"name": "签发人绑定表单数据"},
+    "signerValueScript": {"name": "签发人绑定值脚本", "type":"script"},
+
+    "subjectShowScript": {"name": "标题显示脚本", "type":"script"},
+    "subjectValueData": {"name": "标题绑定表单数据"},
+    "subjectEditScript": {"name": "标题编辑脚本", "type":"script"},
+    "subjectValueScript": {"name": "标题绑定值脚本", "type":"script"},
+
+    "mainSendShowScript": {"name": "主送显示脚本", "type":"script"},
+    "mainSendValueData": {"name": "主送绑定表单数据"},
+    "mainSendValueScript": {"name": "主送绑定值脚本", "type":"script"},
+
+    "attachmentShowScript": {"name": "附件显示脚本", "type":"script"},
+    "attachmentValueData": {"name": "附件绑定表单数据"},
+    "attachmentValueScript": {"name": "附件绑定值脚本", "type":"script"},
+
+    "issuanceUnitShowScript": {"name": "成文单位显示脚本", "type":"script"},
+    "issuanceUnitEditScript": {"name": "成文单位编辑脚本", "type":"script"},
+    "issuanceUnitValueData": {"name": "成文单位绑定表单数据"},
+    "issuanceUnitValueScript": {"name": "成文单位绑定值脚本", "type":"script"},
+
+    "issuanceDateShowScript": {"name": "成文日期显示脚本", "type":"script"},
+    "issuanceDateValueData": {"name": "成文日期绑定表单数据"},
+    "issuanceDateValueScript": {"name": "成文日期绑定值脚本", "type":"script"},
+
+    "annotationShowScript": {"name": "附注显示脚本", "type":"script"},
+    "annotationValueData": {"name": "附注绑定表单数据"},
+    "annotationValueScript": {"name": "附注绑定值脚本", "type":"script"},
+
+    "copytoShowScript": {"name": "抄送显示脚本", "type":"script"},
+    "copytoValueData": {"name": "抄送绑定表单数据"},
+    "copytoValueScript": {"name": "抄送绑定值脚本", "type":"script"},
+
+    "copyto2ShowScript": {"name": "发送显示脚本", "type":"script"},
+    "copyto2ValueData": {"name": "发送绑定表单数据"},
+    "copyto2ValueScript": {"name": "发送绑定值脚本", "type":"script"},
+
+    "editionUnitShowScript": {"name": "印发单位显示脚本", "type":"script"},
+    "editionUnitValueData": {"name": "印发单位绑定表单数据"},
+    "editionUnitValueScript": {"name": "印发单位绑定值脚本", "type":"script"},
+
+    "editionDateShowScript": {"name": "印发日期显示脚本", "type":"script"},
+    "editionDateValueData": {"name": "印发日期绑定表单数据"},
+    "editionDateValueScript": {"name": "印发日期绑定值脚本", "type":"script"},
+
+    "meetingAttendShowScript": {"name": "会议出席显示脚本", "type":"script"},
+    "meetingAttendValueData": {"name": "会议出席绑定表单数据"},
+    "meetingAttendValueScript": {"name": "会议出席绑定值脚本", "type":"script"},
+
+    "meetingLeaveShowScript": {"name": "会议请假显示脚本", "type":"script"},
+    "meetingLeaveValueData": {"name": "会议请假绑定表单数据"},
+    "meetingLeaveValueScript": {"name": "会议请假绑定值脚本", "type":"script"},
+
+    "meetingSitShowScript": {"name": "会议列席显示脚本", "type":"script"},
+    "meetingSitValueData": {"name": "会议列席绑定表单数据"},
+    "meetingSitValueScript": {"name": "会议列席绑定值脚本", "type":"script"},
+
+    "meetingRecordShowScript": {"name": "会议记录显示脚本", "type":"script"},
+    "meetingRecordValueData": {"name": "会议记录绑定表单数据"},
+    "meetingRecordValueScript": {"name": "会议记录绑定值脚本", "type":"script"},
+
+    "customFields": {"name": "自定义元素配置", "type":"map"},
+
+    "templateCode": {"name": "默认值", "type":"script"},
+    "config": {"name": "配置脚本", "type":"script"},
+
+    "template": {"name": "文件模板"},
+    "readScript": {"name": "只读脚本", "type":"script"},
+    "fileSite": {"name": "读取文件的site脚本", "type":"script"}
+  },
+  "process": {
+    "id": {"name": "标识"},
+    "name": {"name": "名称"},
+    "alias": {"name": "别名"},
+    "description": {"name": "描述"},
+    "controllerList": {"name": "管理者", "type":"array"},
+    "editionDes": {"name": "版本描述"},
+    "startableIdentityList": {"name": "启动者", "type":"array"},
+    "startableUnitList": {"name": "启动组织", "type":"array"},
+    "serialTexture": {"name": "编号规则", "type":"serial"},
+    "expireScriptText": {"name": "超时脚本", "type":"script"},
+    "projection": {"name": "数据映射", "type":"projection"},
+
+    "beforeBeginScriptText": {"name": "流程启动前事件", "type":"script"},
+    "afterBeginScriptText ": {"name": "流程启动后事件", "type":"script"},
+    "beforeEndScriptText ": {"name": "流程结束前事件", "type":"script"},
+    "afterEndScriptText ": {"name": "流程结束后事件", "type":"script"},
+    "beforeArriveScriptText ": {"name": "活动到达前事件", "type":"script"},
+    "afterArriveScriptText ": {"name": "活动到达后事件", "type":"script"},
+    "beforeExecuteScriptText ": {"name": "活动执行前事件", "type":"script"},
+    "afterExecuteScriptText ": {"name": "活动执行后事件", "type":"script"},
+    "beforeInquireScriptText": {"name": "路由查询前事件", "type":"script"},
+    "afterInquireScriptText ": {"name": "路由查询后事件", "type":"script"},
+
+    "readIdentityList": {"name": "待阅人", "type":"array"},
+    "readUnitList": {"name": "待阅组织", "type":"array"},
+    "readGroupList": {"name": "待阅群组", "type":"array"},
+    "readDataPathList": {"name": "待阅人表单数据", "type":"array"},
+    "readScriptText": {"name": "待阅人脚本", "type":"script"},
+    "readDuty": {"name": "待阅人职务", "type":"duty"},
+    "reviewIdentityList": {"name": "可阅读人", "type":"array"},
+    "reviewUnitList": {"name": "可阅读组织", "type":"array"},
+    "reviewGroupList": {"name": "可阅读群组", "type":"array"},
+    "reviewDataPathList": {"name": "可阅读人表单数据", "type":"array"},
+    "reviewScriptText": {"name": "可阅读人脚本", "type":"script"},
+    "reviewDuty": {"name": "可阅读人职务", "type":"duty"},
+
+    "scriptText": {"name": "脚本", "type":"script"},
+
+    "targetTitleScriptText": {"name": "流程调用标题脚本", "type":"script"},
+    "targetAssginDataScriptText": {"name": "流程调用数据脚本", "type":"script"},
+    "targetIdentity": {"name": "流程调用启动者"},
+    "targetIdentityScriptText": {"name": "流程调用启动者脚本", "type":"script"},
+
+    "delayScriptText": {"name": "定时脚本", "type":"script"},
+    "delayDataPath": {"name": "定时数据路径"},
+
+    "jaxwsAddress": {"name": "WSDL地址"},
+    "jaxwsMethod": {"name": "调用方法"},
+    "jaxwsParameterScriptText": {"name": "参数脚本", "type":"script"},
+    "jaxwsResponseScriptText": {"name": "响应脚本", "type":"script"},
+    "jaxrsAddress": {"name": "REST服务地址"},
+    "jaxrsContentType": {"name": "ContentType"},
+    "jaxrsParameterScriptText ": {"name": "参数脚本", "type":"script"},
+    "jaxrsBodyScriptText ": {"name": "消息体脚本", "type":"script"},
+    "jaxrsHeadScriptText ": {"name": "消息头脚本", "type":"script"},
+    "jaxrsResponseScriptText": {"name": "响应脚本", "type":"script"},
+
+    "group": {"name": "活动组"},
+    "opinionGroup": {"name": "意见组"},
+
+    "taskIdentityList": {"name": "待办人", "type":"array"},
+    "taskUnitList": {"name": "待办组织", "type":"array"},
+    "taskGroupList": {"name": "待办群组", "type":"array"},
+    "taskDataPathList": {"name": "待办人表单数据", "type":"array"},
+    "taskScriptText": {"name": "待办人脚本", "type":"script"},
+    "taskDuty": {"name": "待办人职务", "type":"duty"},
+    "taskExpireScriptText": {"name": "超时脚本", "type":"script"},
+
+    "manualStayScriptText": {"name": "等待人工处理事件", "type":"script"},
+    "manualBeforeTaskScriptText ": {"name": "待办处理前事件", "type":"script"},
+    "manualAfterTaskScriptText ": {"name": "待办处理后事件", "type":"script"},
+
+    "opinion": {"name": "默认意见"},
+    "appendTaskIdentityScriptText": {"name": "转交脚本", "type":"script"},
+    "decisionOpinion": {"name": "决策组"},
+    "validationScriptText": {"name": "路由校验脚本", "type":"script"},
+    "displayNameScriptText": {"name": "路由显示名称脚本", "type":"script"},
+    "hiddenScriptText ": {"name": "隐藏条件脚本", "type":"script"},
+    "selectConfig": {"name": "组织选择配置", "type":"selectConfig"}
+  },
+  "view": {
+    "id": {"name": "标识"},
+    "name": {"name": "名称"},
+    "alias": {"name": "别名"},
+    "description": {"name": "描述"},
+    "noDataText": {"name": "无数据显示"},
+    "defaultSelectedScript": {"name": "默认选中脚本", "type":"script"},
+
+    "applicationList": {"name": "流程应用范围", "type":"object-array"},
+    "processList": {"name": "流程范围", "type":"object-array"},
+    "creatorPersonList": {"name": "拟稿人范围", "type":"object-array"},
+    "creatorUnitList": {"name": "拟稿组织范围", "type":"object-array"},
+    "creatorIdentityList": {"name": "拟稿身份范围", "type":"object-array"},
+    "appInfoList": {"name": "栏目范围", "type":"object-array"},
+    "categoryInfoList": {"name": "分类范围", "type":"object-array"},
+
+    "filterList": {"name": "默认过滤", "type":"filter"},
+    "customFilterList": {"name": "自定义过滤", "type":"filter"},
+
+    "events": {"name": "事件", "type": "events"},
+
+    "container": {"name": "container样式", "type": "map"},
+    "table": {"name": "table样式", "type": "map"},
+    "titleTr": {"name": "titleTr样式", "type": "map"},
+    "titleTd": {"name": "titleTd样式", "type": "map"},
+    "contentTr": {"name": "contentTr样式", "type": "map"},
+    "contentSelectedTr": {"name": "contentSelectedTr样式", "type": "map"},
+    "contentTd": {"name": "contentTd样式", "type": "map"},
+    "contentGroupTd": {"name": "contentGroupTd样式", "type": "map"},
+    "groupCollapseNode": {"name": "groupCollapseNode样式", "type": "map"},
+    "groupExpandNode": {"name": "groupExpandNode样式", "type": "map"},
+    "checkboxNode": {"name": "checkboxNode样式", "type": "map"},
+    "checkedCheckboxNode": {"name": "checkedCheckboxNode样式", "type": "map"},
+    "radioNode": {"name": "radioNode样式", "type": "map"},
+    "checkedRadioNode": {"name": "checkedRadioNode样式", "type": "map"},
+    "noDataTextNode": {"name": "noDataTextNode样式", "type": "map"},
+    "tableProperties": {"name": "tableProperties样式", "type": "map"},
+
+    "displayName": {"name": "列标题"},
+    "defaultValue": {"name": "默认值"},
+    "path": {"name": "数据路径"},
+    "clickCode": {"name": "打开文档脚本", "type": "script"},
+    "code": {"name": "显示脚本", "type": "script"},
+
+    "titleStyles": {"name": "标题单元格样式", "type": "map"},
+    "titleProperties": {"name": "标题单元格属性", "type": "map"},
+    "contentStyles": {"name": "内容单元格样式", "type": "map"},
+    "contentProperties": {"name": "内容单元格属性", "type": "map"},
+
+    "actionStyles": {"name": "操作条样式", "type": "map"},
+    "multiTools": {"name": "操作按钮", "type":"actions"},
+
+
+    "prePageText": {"name": "上一页文本"},
+    "nextPageText": {"name": "下一页文本"},
+    "firstPageText": {"name": "首页文本"},
+    "lastPageText": {"name": "末页文本"},
+    "pagingStyles": {"name": "分页栏样式", "type": "map"},
+
+    "column": {"name": "列名"}
+  },
+  "statement": {
+    "name": {"name": "名称"},
+    "alias": {"name": "别名"},
+    "description": {"name": "描述"},
+
+    "data": {"name": "JPQL语句", "type": "sql"},
+    "scriptText": {"name": "JPQL脚本", "type": "script"},
+    "countData": {"name": "JPQL总数语句", "type": "sql"},
+    "countScriptText": {"name": "JPQL总数脚本", "type": "script"}
+  }
+}

+ 249 - 0
o2web/source/x_component_Selector/PlatApp.js

@@ -0,0 +1,249 @@
+MWF.xApplication.Selector = MWF.xApplication.Selector || {};
+MWF.xDesktop.requireApp("Selector", "Person", null, false);
+MWF.xApplication.Selector.PlatApp = new Class({
+	Extends: MWF.xApplication.Selector.Person,
+    options: {
+        "style": "default",
+        "count": 0,
+        "title": MWF.xApplication.Selector.LP.selectProcess,
+        "values": [],
+        "names": [],
+        "expand": false,
+        "forceSearchInItem" : true
+    },
+    _init : function(){
+        this.selectType = "platApp";
+        this.className = "platApp";
+    },
+    loadSelectItems: function(addToNext){
+	    var categorys = [
+            {"name": MWF.SelectorLP.processPlatform, "id": "processPlatform"},
+            {"name": MWF.SelectorLP.cms, "id": "cms"},
+            {"name": MWF.SelectorLP.portal, "id": "portal"},
+            {"name": MWF.SelectorLP.query, "id": "query"},
+            {"name": MWF.SelectorLP.service, "id": "service"}
+        ]
+        //window.setTimeout(function(){
+            categorys.each(function(data){
+                switch (data.id){
+                    case "processPlatform":
+                        this.processAction.listApplication(function(json){ data.appList = json.data; }.bind(this), null, false);
+                        break;
+                    case "cms":
+                        this.cmsAction.listColumn(function(json){ data.appList = json.data; }.bind(this), null, false);
+                        break;
+                    case "portal":
+                        this.portalDesignerAction.listApplication(function(json){ data.appList = json.data; }.bind(this), null, false);
+                        break;
+                    case "query":
+                        this.queryAction.listApplication(function(json){ data.appList = json.data; }.bind(this), null, false);
+                        break;
+                    case "service":
+                        data.appList = [
+                            { "id": "invoke", "name": "服务" },
+                            { "id": "agent", "name": "代理" }
+                        ];
+                        break;
+                    default:
+                        this.processAction.listApplication(function(json){ data.appList = json.data; }.bind(this), null, false);
+                };
+
+                var category = this._newItemCategory(data, this, this.itemAreaNode);
+                if (data.appList && data.appList.length){
+                    data.appList.each(function(d){
+                        debugger;
+                        d.moduleType = data.id;
+                        if (d.moduleType=="cms") d.name = d.appName;
+                        var item = this._newItem(d, this, category.children);
+                        this.items.push(item);
+                    }.bind(this));
+                }
+            }.bind(this));
+        //}.bind(this), 1);
+    },
+
+    _scrollEvent: function(y){
+        return true;
+    },
+    _getChildrenItemIds: function(data){
+	    debugger;
+        return data.appList || [];
+    },
+    _newItemCategory: function(data, selector, item, level){
+        return new MWF.xApplication.Selector.PlatApp.ItemCategory(data, selector, item, level)
+    },
+
+    _listItemByKey: function(callback, failure, key){
+        return false;
+    },
+    _getItem: function(callback, failure, id, async){
+        if( !id )return;
+        this.processAction.getProcess(function(json){
+            if (callback) callback.apply(this, [json]);
+        }.bind(this), failure, ((typeOf(id)==="string") ? id : (typeOf(id)=="string") ? id : id.id), async);
+    },
+    _newItemSelected: function(data, selector, item){
+        return new MWF.xApplication.Selector.PlatApp.ItemSelected(data, selector, item)
+    },
+    _listItemByPinyin: function(callback, failure, key){
+        return false;
+    },
+    _newItem: function(data, selector, container, level){
+        return new MWF.xApplication.Selector.PlatApp.Item(data, selector, container, level);
+    }
+});
+MWF.xApplication.Selector.PlatApp.Item = new Class({
+	Extends: MWF.xApplication.Selector.Person.Item,
+    _getShowName: function(){
+	    switch (this.data.moduleType){
+            case "processPlatform":
+                return this.data.name;
+            case "cms":
+                return this.data.appName;
+            case "portal":
+                return this.data.name;
+            case "query":
+                return this.data.name;
+            case "service":
+                return this.data.name;
+            default:
+                return this.data.name;
+        };
+    },
+    _setIcon: function(){
+        this.iconNode.setStyle("background-image", "url("+"../x_component_Selector/$Selector/default/icon/processicon.png)");
+    },
+    _getTtiteText: function(){
+        return this.data.name;
+    },
+    loadSubItem: function(){
+        return false;
+    },
+    checkSelectedSingle: function(){
+        var selectedItem = this.selector.options.values.filter(function(item, index){
+            if (typeOf(item)==="object"){
+                // return (this.data.id === item.id);
+                if( this.data.id && item.id ){
+                    return this.data.id === item.id;
+                }else{
+                    return this.data.name === item.name;
+                }
+            }
+            if (typeOf(item)==="string") return (this.data.id === item) || (this.data.name === item);
+            return false;
+        }.bind(this));
+        if (selectedItem.length){
+            this.selectedSingle();
+        }
+    },
+    checkSelected: function(){
+
+        var selectedItem = this.selector.selectedItems.filter(function(item, index){
+            if( item.data.id && this.data.id){
+                return item.data.id === this.data.id;
+            }else{
+                return item.data.name === this.data.name;
+            }
+        }.bind(this));
+        if (selectedItem.length){
+            //selectedItem[0].item = this;
+            selectedItem[0].addItem(this);
+            this.selectedItem = selectedItem[0];
+            this.setSelected();
+        }
+    }
+});
+
+MWF.xApplication.Selector.PlatApp.ItemSelected = new Class({
+	Extends: MWF.xApplication.Selector.Person.ItemSelected,
+    _getShowName: function(){
+        switch (this.data.moduleType){
+            case "processPlatform":
+                return this.data.name;
+            case "cms":
+                return this.data.appName;
+            case "portal":
+                return this.data.name;
+            case "query":
+                return this.data.name;
+            case "service":
+                return this.data.name;
+            default:
+                return this.data.name;
+        };
+    },
+    _setIcon: function(){
+        this.iconNode.setStyle("background-image", "url("+"../x_component_Selector/$Selector/default/icon/processicon.png)");
+    },
+    check: function(){
+        if (this.selector.items.length){
+            var items = this.selector.items.filter(function(item, index){
+                debugger;
+                if( item.data.id && this.data.id){
+                    return item.data.id === this.data.id;
+                }else{
+                    return item.data.name === this.data.name;
+                }
+            }.bind(this));
+            this.items = items;
+            if (items.length){
+                items.each(function(item){
+                    item.selectedItem = this;
+                    item.setSelected();
+                }.bind(this));
+            }
+        }
+    }
+});
+
+MWF.xApplication.Selector.PlatApp.ItemCategory = new Class({
+    Extends: MWF.xApplication.Selector.Person.ItemCategory,
+    _getShowName: function(){
+        return this.data.name;
+    },
+    createNode: function(){
+        this.node = new Element("div", {
+            "styles": this.selector.css.selectorItemCategory_department
+        }).inject(this.container);
+    },
+    _setIcon: function(){
+        this.iconNode.setStyle("background-image", "url("+"../x_component_Selector/$Selector/default/icon/applicationicon.png)");
+    },
+    loadSub: function(callback){
+        if (!this.loaded){
+            if (this.data.id=="processPlatform"){
+                this.selector.processAction.listApplication(function(subJson){
+                    subJson.data.each(function(subData){
+                        var category = this.selector._newItem(subData, this.selector, this.children, this.level+1);
+                        this.selector.items.push( category );
+                    }.bind(this));
+
+                    this.loaded = true;
+                    if (callback) callback();
+                }.bind(this));
+            }else{
+                this.loaded = true;
+                if (callback) callback();
+            }
+
+
+            // this.selector.action.listProcess(function(subJson){
+            //     subJson.data.each(function(subData){
+            //         subData.applicationName = this.data.name;
+            //         subData.application = this.data.id;
+            //         var category = this.selector._newItem(subData, this.selector, this.children, this.level+1);
+            //         this.selector.items.push( category );
+            //     }.bind(this));
+            //
+            //     this.loaded = true;
+            //     if (callback) callback();
+            // }.bind(this), null, this.data.id);
+        }else{
+            if (callback) callback();
+        }
+    },
+    _hasChild: function(){
+        return true;
+    },
+    check: function(){}
+});

+ 7 - 1
o2web/source/x_component_Selector/lp/zh-cn.js

@@ -49,6 +49,12 @@ MWF.xApplication.Selector.LP = MWF.SelectorLP = {
     "cancel": "取消",
     "back": "返回",
     "ok": "确定",
-    "noPerson": "人员“{name}”不存在"
+    "noPerson": "人员“{name}”不存在",
+
+    "processPlatform": "流程平台",
+    "cms": "内容管理",
+    "portal": "门户管理",
+    "query": "数据中心",
+    "service": "服务管理",
 };
 MWF.xApplication.Selector["lp."+o2.language] = MWF.xApplication.Selector.LP;

+ 14 - 1
o2web/source/x_component_cms_Column/$Main/default/css.wcss

@@ -207,6 +207,19 @@
 //        "color" : "#3c76b7",
 //        "background": "url(../x_component_cms_Index/$Main/default/icon/createDocument_over.png) center center no-repeat"
     },
+    "findNode": {
+        "float": "right",
+        "margin-right": "30px",
+        "width": "56px",
+        "background": "url(../x_component_cms_Column/$Main/default/icon/icons_find.png) 0 center no-repeat",
+        "padding-left": "22px",
+        "height": "50px",
+        "line-height": "50px",
+        "font-size": "14px",
+        "color": "#333333",
+        "cursor": "pointer"
+    },
+
     "columnItemNode": {
         "width": "260px",
         "height" : "360px",
@@ -441,4 +454,4 @@
         "border": "1px solid #999",
         "background": "url(../x_component_cms_Column/$Main/default/icon/editCancel_bg.png) no-repeat"
     }
-}
+}

BIN
o2web/source/x_component_cms_Column/$Main/default/icon/icons_find.png


+ 13 - 0
o2web/source/x_component_cms_Column/Main.js

@@ -118,6 +118,19 @@ MWF.xApplication.cms.Column.Main = new Class({
                     this.createColumn();
                 }.bind(this)
             });
+
+            this.findNode = new Element("div.createColumnNode", {
+                "styles": this.css.findNode,
+                "text": this.lp.column.findDesigner
+            }).inject(this.columnToolbarAreaNode);
+            this.findNode.addEvent("click", function(){
+                var options = {
+                    "filter": {
+                        "moduleList": ["cms"]
+                    }
+                };
+                layout.openApplication(null, "FindDesigner", options);
+            }.bind(this));
         }
 
         this.columnTypeListContaienr = new Element("div.columnTop_category", {

+ 2 - 1
o2web/source/x_component_cms_Column/lp/zh-cn.js

@@ -18,6 +18,7 @@ MWF.xApplication.cms.Column.LP = {
 	"column" : {
 		"title" :"栏目管理",
 		"create" : "新建栏目",
+		"findDesigner": "查找设计",
 		"searchText": "请输入关键字",
 		"loadding": "正在加载……",
 		"loaded": "栏目加载完毕",
@@ -63,4 +64,4 @@ MWF.xApplication.cms.Column.LP = {
 		"delete" : "删除分类",
 		"edit" : "编辑分类"
 	}
-};
+};

BIN
o2web/source/x_component_cms_ColumnManager/$Main/default/icon/icons_find.png


+ 11 - 1
o2web/source/x_component_cms_ColumnManager/$Main/startMenu.json

@@ -85,5 +85,15 @@
     "selectedIcon": "icon_lan_mu_click.png",
     "expand": false,
     "sub": []
+  },
+  {
+    "title": "查找设计",
+    "id": "findDesigner",
+    "action": "findDesigner",
+    "icon": "icons_find.png",
+    "selectedIcon": "icons_find.png",
+    "noSelect": true,
+    "expand": false,
+    "sub": []
   }
-]
+]

+ 19 - 5
o2web/source/x_component_cms_ColumnManager/Main.js

@@ -25,6 +25,18 @@ MWF.xApplication.cms.ColumnManager.Main = new Class({
         this.lp = MWF.xApplication.cms.ColumnManager.LP;
         this.currentContentNode = null;
     },
+    findDesigner: function(){
+        this.options.column.moduleType = "cms";
+        this.options.column.name = this.options.column.appName;
+        //this.options.column.id = this.options.column.appId;
+        var options = {
+            "filter": {
+                "moduleList": ["cms"],
+                "appList": [this.options.column]
+            }
+        };
+        layout.openApplication(null, "FindDesigner", options);
+    },
     loadApplication: function(callback){
 
         this.restActions = MWF.Actions.get("x_cms_assemble_control"); //new MWF.xApplication.cms.ColumnManager.Actions.RestActions();
@@ -749,7 +761,8 @@ MWF.xApplication.cms.ColumnManager.Menu = new Class({
             return;
         }
 
-        if (this.currentNavi){
+        var naviNodeData = (naviNode) ? naviNode.retrieve("naviData") : null;
+        if (this.currentNavi && (!naviNodeData || !naviNodeData.noSelect)){
             this.currentNavi.setStyles(this.app.css.startMenuNaviNode);
             var iconNode = this.currentNavi.retrieve("iconNode");
             var navi = this.currentNavi.retrieve("naviData");
@@ -768,10 +781,11 @@ MWF.xApplication.cms.ColumnManager.Menu = new Class({
         }
 
         if( naviNode ){
-            var navi = naviNode.retrieve("naviData");
+            //var navi = naviNode.retrieve("naviData");
+            var navi = naviNodeData;
             var action = navi.action;
 
-            if( !navi.unselected ){
+            if( !navi.unselected && !navi.noSelect ){
                 naviNode.setStyles(this.app.css.startMenuNaviNode_current);
                 var iconNode = naviNode.retrieve("iconNode");
                 iconNode.setStyle("background-image", "url("+this.app.path+this.app.options.style+"/icon/"+navi.selectedIcon+")");
@@ -802,7 +816,7 @@ MWF.xApplication.cms.ColumnManager.Menu = new Class({
             if (this.app[action]) this.app[action].apply( this.app );
         }
 
-        this.currentNavi = naviNode;
+        if (!navi || !navi.noSelect) this.currentNavi = naviNode;
 
     },
     setContentSize : function(){
@@ -1240,4 +1254,4 @@ MWF.xApplication.cms.ColumnManager.Input = new Class({
 //                "</table>";
 //        return html;
 //    }
-//});
+//});

+ 1 - 0
o2web/source/x_component_cms_ColumnManager/ScriptExplorer.js

@@ -224,6 +224,7 @@ MWF.xApplication.cms.ColumnManager.ScriptExplorer.Script = new Class({
 	_open: function(e){
 		var _self = this;
 		var options = {
+            "appId": "cms.ScriptDesigner"+_self.data.id,
 			"onQueryLoad": function(){
 				this.actions = _self.explorer.actions;
 				this.category = _self;

+ 5 - 1
o2web/source/x_component_portal_PageDesigner/Main.js

@@ -1258,7 +1258,11 @@ MWF.xApplication.portal.PageDesigner.Main = new Class({
 	//loadPage------------------------------------------
 	loadPage: function(){
 		this.getPageData(function(){
-			this.pcPage = new MWF.PCPage(this, this.designNode);
+			this.pcPage = new MWF.PCPage(this, this.designNode, {
+			    "onPostLoad": function(){
+                    this.fireEvent("postPageLoad");
+                }.bind(this)
+            });
 			this.pcPage.load(this.pageData);
 
             this.page = this.pcPage;

+ 2 - 0
o2web/source/x_component_portal_PageDesigner/Module/Page.js

@@ -134,6 +134,8 @@ MWF.xApplication.portal.PageDesigner.Module.Page = MWF.PCPage = new Class({
             this.designer.addEvent("queryClose", function(){
                 if (this.autoSaveTimerID) window.clearInterval(this.autoSaveTimerID);
             }.bind(this));
+
+            this.fireEvent("postLoad");
         }.bind(this));
 	},
     removeStyles: function(from, to){

BIN
o2web/source/x_component_portal_PortalExplorer/$Main/default/icon/icons_find.png


+ 12 - 0
o2web/source/x_component_portal_PortalExplorer/$Main/default/style.css

@@ -59,6 +59,18 @@
     color: #333333;
     cursor: pointer;
 }
+.o2_process_AppExp_find {
+    float: right;
+    margin-right: 30px;
+    width: 56px;
+    background: url("../x_component_portal_PortalExplorer/$Main/default/icon/icons_find.png") 0 center no-repeat;
+    padding-left: 22px;
+    height: 50px;
+    line-height: 50px;
+    font-size: 14px;
+    color: #333333;
+    cursor: pointer;
+}
 .o2_process_AppExp_category {
     background: #FAFAFA;
     height: 50px;

+ 2 - 1
o2web/source/x_component_portal_PortalExplorer/$Main/default/view.html

@@ -6,6 +6,7 @@
         {{end if}}
         {{if $.control.canCreate}}
             <div class="o2_process_AppExp_import">{{ $.lp.import }}</div>
+            <div class="o2_process_AppExp_find">{{ $.lp.find }}</div>
         {{end if}}
         <div class="o2_process_AppExp_category"></div>
 
@@ -17,4 +18,4 @@
         </div>
     </div>
     <div class="o2_process_AppExp_bottom"></div>
-</div>
+</div>

+ 8 - 0
o2web/source/x_component_portal_PortalExplorer/Main.js

@@ -29,6 +29,14 @@ MWF.xApplication.portal.PortalExplorer.Main = new Class({
         this.control.canCreate = MWF.AC.isPortalPlatformCreator();
         this.control.canManage = !!(MWF.AC.isAdministrator() || MWF.AC.isPortalManager());
     },
+    openFindDesigner: function(){
+        var options = {
+            "filter": {
+                "moduleList": ["portal"]
+            }
+        };
+        layout.openApplication(null, "FindDesigner", options);
+    },
     createApplicationItem: function(appData, where){
         var application = new MWF.xApplication.portal.PortalExplorer.Portal(this, appData, where);
         application.load();

+ 2 - 1
o2web/source/x_component_portal_PortalExplorer/lp/zh-cn.js

@@ -4,6 +4,7 @@ MWF.xApplication.portal.PortalExplorer.LP = MWF.PortalLP = {
     "all": "全部",
     "create": "新建门户",
     "import": "导入门户",
+    "find": "查找设计",
 
     "noApplicationCreate": "系统没有门户或没有您有权限管理的门户 <br/> 点击此处创建新门户",
     "noApplication": "系统没有门户或没有您有权限管理的门户",
@@ -75,4 +76,4 @@ MWF.xApplication.portal.PortalExplorer.LP = MWF.PortalLP = {
         // "loadding": "正在加载……",
         "select": "反选"
     }
-};
+};

+ 11 - 1
o2web/source/x_component_portal_PortalManager/FileExplorer.js

@@ -21,6 +21,16 @@ MWF.xApplication.portal.PortalManager.FileExplorer = new Class({
     //     // this.app.desktop.openApplication(e, "process.FileDesigner", options);
     //     new MWF.xApplication.portal.PortalManager.FileDesigner(this);
     // },
+    openFindDesigner: function(){
+        this.app.options.application.moduleType = "portal";
+        var options = {
+            "filter": {
+                "moduleList": ["portal"],
+                "appList": [this.app.options.application]
+            }
+        };
+        layout.openApplication(null, "FindDesigner", options);
+    },
     getNewData: function(){
         return {
             "id": "",
@@ -233,4 +243,4 @@ MWF.xApplication.portal.PortalManager.FileDesigner = new Class({
         }.bind(this));
     }
 
-});
+});

Некоторые файлы не были показаны из-за большого количества измененных файлов