Przeglądaj źródła

查询设计中增加视图功能

unknown 5 lat temu
rodzic
commit
e07f4935f6
90 zmienionych plików z 5705 dodań i 801 usunięć
  1. 172 0
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/column.html
  2. 32 0
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/column.json
  3. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/action/add.png
  4. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/action/delete1.png
  5. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/action/move1.png
  6. 50 0
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/actionbar.wcss
  7. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/actionbar/blue/export.png
  8. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/actionbar/default/export.png
  9. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/actionbar/export.png
  10. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/actionbar/red/export.png
  11. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/actionbar/white/export.png
  12. 390 0
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/css.wcss
  13. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/add.png
  14. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/addColumn.png
  15. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/col.png
  16. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/column.png
  17. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/del.png
  18. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/down.png
  19. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/exp.png
  20. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/hidden.png
  21. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/refresh.png
  22. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/right.png
  23. BIN
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/sel.png
  24. 730 0
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/inquiry.html
  25. 89 0
      o2web/source/x_component_query_InquiryDesigner/$Inquiry/inquiry.json
  26. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/appicon.png
  27. 9 0
      o2web/source/x_component_query_InquiryDesigner/$Main/blank.html
  28. 164 0
      o2web/source/x_component_query_InquiryDesigner/$Main/default/css.wcss
  29. 9 0
      o2web/source/x_component_query_InquiryDesigner/$Main/default/designBlank.html
  30. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/designerBg.png
  31. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon.png
  32. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/actionbar.png
  33. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/attachment.png
  34. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/button.png
  35. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/calendar.png
  36. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/checkbox.png
  37. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/datagrid.png
  38. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/div.png
  39. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/html.png
  40. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/htmleditor.png
  41. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/iframe.png
  42. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/image.png
  43. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/label.png
  44. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/layout.png
  45. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/log.png
  46. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/monitor.png
  47. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/office.png
  48. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/personfield.png
  49. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/radio.png
  50. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/select.png
  51. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/table.png
  52. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/tabs.png
  53. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/textarea.png
  54. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/textfield.png
  55. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/tree.png
  56. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/tree1.png
  57. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/left.png
  58. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/right.png
  59. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/formExplode.gif
  60. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/formExplode_gray.gif
  61. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/formImplode.gif
  62. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/formImplode_gray.gif
  63. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/help.png
  64. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/preview.png
  65. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/print.gif
  66. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/print_gray.gif
  67. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/save.gif
  68. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/saveNew.gif
  69. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/saveNew_gray.gif
  70. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/save_gray.gif
  71. 18 0
      o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbars.html
  72. 120 0
      o2web/source/x_component_query_InquiryDesigner/$Main/default/tools.json
  73. BIN
      o2web/source/x_component_query_InquiryDesigner/$Main/default/view.png
  74. 591 0
      o2web/source/x_component_query_InquiryDesigner/Inquiry.js
  75. 809 0
      o2web/source/x_component_query_InquiryDesigner/Main.js
  76. 44 0
      o2web/source/x_component_query_InquiryDesigner/Property.js
  77. 7 0
      o2web/source/x_component_query_InquiryDesigner/lp/zh-cn.js
  78. 60 0
      o2web/source/x_component_query_InquiryDesigner/widget/$ViewFilter/default/css.wcss
  79. BIN
      o2web/source/x_component_query_InquiryDesigner/widget/$ViewFilter/default/down.png
  80. BIN
      o2web/source/x_component_query_InquiryDesigner/widget/$ViewFilter/default/icon/addPerson.png
  81. BIN
      o2web/source/x_component_query_InquiryDesigner/widget/$ViewFilter/default/icon/delete1.png
  82. BIN
      o2web/source/x_component_query_InquiryDesigner/widget/$ViewFilter/default/icon/error.png
  83. 1166 0
      o2web/source/x_component_query_InquiryDesigner/widget/ViewFilter.js
  84. 17 15
      o2web/source/x_component_query_StatementDesigner/$Statement/statementDesigner.html
  85. 428 0
      o2web/source/x_component_query_StatementDesigner/$Statement/view.html
  86. 68 0
      o2web/source/x_component_query_StatementDesigner/$Statement/view.json
  87. 42 40
      o2web/source/x_component_query_StatementDesigner/Main.js
  88. 24 652
      o2web/source/x_component_query_StatementDesigner/Property.js
  89. 660 41
      o2web/source/x_component_query_StatementDesigner/Statement.js
  90. 6 53
      o2web/source/x_component_query_StatementDesigner/lp/zh-cn.js

+ 172 - 0
o2web/source/x_component_query_InquiryDesigner/$Inquiry/column.html

@@ -0,0 +1,172 @@
+<div style="background-color: #FFF; overflow: hidden">
+	<div title="基本" class="MWFTab">
+        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+            <tr>
+                <td class="editTableTitle">列标题:</td>
+                <td class="editTableValue"><input type="text" name="displayName" value="text{$.displayName}" class="editTableInput"/></td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">列名:</td>
+                <td class="editTableValue"><input type="text" name="column" value="text{$.column}" class="editTableInput"/></td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">默认值:</td>
+                <td class="editTableValue"><input type="text" name="defaultValue" value="text{$.defaultValue}" class="editTableInput"/></td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">打开文档:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="allowOpen" text{($.allowOpen===true)?'checked':''} type="radio" value="true"
+                           onclick="if(this.checked){ $('text{$.pid}clickCodeTr').setStyle('display', '');}"/>是
+                    <input class="editTableRadio" name="allowOpen" text{($.allowOpen!==true)?'checked':''} type="radio" value="false"
+                           onclick="if(this.checked){ $('text{$.pid}clickCodeTr').setStyle('display', 'none');}"/>否
+                </td>
+            </tr>
+            <tr id="text{$.pid}clickCodeTr" style="display:text{($.allowOpen===true)?'':'none'}">
+                <td class="editTableValue" colspan="2">
+                    <div class="MWFFormulaArea" name="clickCode" title="打开文档脚本(S)"></div>
+                </td>
+            </tr>
+        </table>
+
+        <div style="border-top: 1px solid #999; margin-top:10px">
+            <div style="background-color: #EEE; height:24px; line-height: 24px; text-align: center; font-weight: bold">数据</div>
+            <div class="MWFDataData" id="text{$.pid}dataDataEditor">
+                <div style="display:text{($.vtype=='process')?'block':'none'}" id="text{$.pid}dataPathSelectedProcessArea" class="text{$.vid}dataPathSelectedProcessArea">
+                    <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                        <tr>
+                            <td class="editTableTitle">选择数据:</td>
+                            <td class="editTableValue"><select id="text{$.pid}dataPathSelected" onchange=" var v=this.options[this.selectedIndex].value; if (v){var n = $('text{$.pid}viewColumnPathInput'); n.set('value', v); n.focus();} ">
+                                <option value="" selected>(请选择)</option>
+                                <option value="$work.title">标题</option>
+                                <option value="$work.startTime">创建时间</option>
+                                <option value="$work.startTimeMonth">创建月份</option>
+                                <option value="$work.completedTime">完成时间</option>
+                                <option value="$work.completedTimeMonth">完成月份</option>
+                                <option value="$work.creatorPerson">拟稿人</option>
+                                <option value="$work.creatorIdentity">拟稿人身份</option>
+                                <option value="$work.creatorUnit">拟稿组织</option>
+                                <option value="$work.creatorUnitLevelName">拟稿组织层级</option>
+                                <option value="$work.application">应用ID</option>
+                                <option value="$work.applicationName">应用名称</option>
+                                <option value="$work.applicationAlias">应用别名</option>
+                                <option value="$work.process">流程ID</option>
+                                <option value="$work.processName">流程名称</option>
+                                <option value="$work.processAlias">流程别名</option>
+                                <option value="$work.serial">编号</option>
+                                <option value="$work.activityType">活动类型</option>
+                                <option value="$work.activityName">活动名称</option>
+                                <option value="$work.activityArrivedTime">活动到达时间</option>
+                                <option value="$work.workId">工作ID</option>
+                                <option value="$work.workCompletedId">已完成工作ID</option>
+                                <option value="$work.job">JOB的ID(job)</option>
+                                <option value="$work.completed">是否已完成(completed)</option>
+                            </select></td>
+                        </tr>
+                    </table>
+                </div>
+                <div style="display:text{($.vtype=='cms')?'block':'none'}" id="text{$.pid}dataPathSelectedCMSArea" class="text{$.vid}dataPathSelectedCMSArea">
+                    <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                        <tr>
+                            <td class="editTableTitle">选择数据:</td>
+                            <td class="editTableValue"><select  id="text{$.pid}dataPathSelectedCMS" onchange="var v=this.options[this.selectedIndex].value; if (v){var n = $('text{$.pid}viewColumnPathInput'); n.set('value', v); n.focus();} ">
+                                <option value="" selected>(请选择)</option>
+                                <option value="$document.title">标题</option>
+                                <option value="$document.publishTime">发布时间</option>
+                                <option value="$document.creatorPerson">拟稿人</option>
+                                <option value="$document.creatorIdentity">拟稿人身份</option>
+                                <option value="$document.creatorUnitName">拟稿组织</option>
+                                <option value="$document.creatorTopUnitName">拟稿顶级组织</option>
+                                <option value="$document.appId">栏目ID</option>
+                                <option value="$document.appName">栏目名称</option>
+                                <option value="$document.categoryId">分类ID</option>
+                                <option value="$document.categoryName">分类名称</option>
+                                <option value="$document.categoryAlias">分类别名</option>
+                                <option value="$document.id">文档ID</option>
+                            </select></td>
+                        </tr>
+                    </table>
+                </div>
+                <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                    <tr>
+                        <td class="editTableTitle">数据路径:</td>
+                        <td class="editTableValue"><input onkeypress="$('text{$.pid}dataPathSelected').getElement('option').set('selected', true); $('text{$.pid}dataPathSelectedCMS').getElement('option').set('selected', true)" id="text{$.pid}viewColumnPathInput" type="text" name="path" value="text{$.path}" class="editTableInput"/></td>
+                    </tr>
+                </table>
+            </div>
+        </div>
+
+        <div style="border-top: 1px solid #999; margin-top:10px">
+            <div class="MWFColumnExport" id="text{$.pid}columnExportEditor">
+                <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                    <tr>
+                        <td class="editTableTitle">排序:</td>
+                        <td class="editTableValue"><select name="orderType" onchange="
+                            var node = $(this).getParent('table').getElement('.MWFColumnExportNumberOrder');
+                            if(this.options[this.selectedIndex].value==='none'){
+                                node.hide();
+                                node.getElements('input')[1].click();
+                            }else{
+                                node.setStyle('display','table-row');
+                            }
+                        ">
+                            <option value="none" text{(($.orderType)!='asc' && ($.orderType)!='desc') ?'selected':''}>无</option>
+                            <option value="asc" text{($.orderType)=='asc' ?'selected':''}>升序</option>
+                            <option value="desc" text{($.orderType)=='desc' ?'selected':''}>降序</option>
+                        </select></td>
+                    </tr>
+                    <tr class="MWFColumnExportNumberOrder" style="display: text{(($.orderType)!='asc' && ($.orderType)!='desc') ?'none':'table-row'}">
+                        <td class="editTableTitle">转换成数字排序:</td>
+                        <td class="editTableValue">
+                            <input class="MWFWorkDataCheck" name="numberOrder" type="radio" value="true" text{($.numberOrder)===true?'checked':''}/>是
+                            <input class="MWFWorkDataCheck" name="numberOrder" type="radio" value="false" text{($.numberOrder)!==true?'checked':''}/>否
+                        </td>
+                    </tr>
+                    <tr class="MWFColumnExportGroup">
+                        <td class="editTableTitle">分类:</td>
+                        <td class="editTableValue">
+                            <input class="MWFWorkDataCheck" name="groupEntry" type="radio" value="true" text{($.groupEntry)===true?'checked':''}/>是
+                            <input class="MWFWorkDataCheck" name="groupEntry" type="radio" value="false" text{($.groupEntry)!==true?'checked':''}/>否
+                        </td>
+                    </tr>
+                </table>
+            </div>
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr class="MWFColumnExportHide">
+                    <td class="editTableTitle">隐藏:</td>
+                    <td class="editTableValue">
+                        <input class="MWFWorkDataCheck" name="hideColumn" type="radio" value="true" text{($.hideColumn)===true?'checked':''}/>是
+                        <input class="MWFWorkDataCheck" name="hideColumn" type="radio" value="false" text{($.hideColumn)!==true?'checked':''}/>否
+                    </td>
+                </tr>
+                <tr class="MWFColumnExportGroup">
+                    <td class="editTableTitle">组织对象:</td>
+                    <td class="editTableValue">
+                        <input class="MWFWorkDataCheck" name="isName" type="radio" value="true" text{($.isName)===true?'checked':''}/>是
+                        <input class="MWFWorkDataCheck" name="isName" type="radio" value="false" text{($.isName)!==true?'checked':''}/>否
+                    </td>
+                </tr>
+                <tr class="MWFColumnExportGroup">
+                    <td class="editTableTitle">HTML值:</td>
+                    <td class="editTableValue">
+                        <input class="MWFWorkDataCheck" name="isHtml" type="radio" value="true" text{($.isHtml)===true?'checked':''}/>是
+                        <input class="MWFWorkDataCheck" name="isHtml" type="radio" value="false" text{($.isHtml)!==true?'checked':''}/>否
+                    </td>
+                </tr>
+            </table>
+        </div>
+        <div class="MWFFormulaArea" name="code" title="显示脚本 (S)"></div>
+	</div>
+    <div title="样式" class="MWFTab">
+        <div class="MWFMaplist" name="titleStyles" title="标题单元格样式"></div>
+        <div class="MWFMaplist" name="titleProperties" title="标题单元格属性"></div>
+        <div class="MWFMaplist" name="contentStyles" title="内容单元格样式"></div>
+        <div class="MWFMaplist" name="contentProperties" title="内容单元格属性"></div>
+    </div>
+    <div title="事件"  class="MWFTab">
+        <div class="MWFEventsArea" name="events"></div>
+    </div>
+	<div title="JSON"  class="MWFTab">
+		<div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
+	</div>
+</div>

+ 32 - 0
o2web/source/x_component_query_InquiryDesigner/$Inquiry/column.json

@@ -0,0 +1,32 @@
+{
+  "events": {
+    "loadTitle" : {
+      "code": "",
+      "html": ""
+    },
+    "loadContent" : {
+      "code": "",
+      "html": ""
+    },
+    "click": {
+      "code": "",
+      "html": ""
+    },
+    "mousedown": {
+      "code": "",
+      "html": ""
+    },
+    "mouseup": {
+      "code": "",
+      "html": ""
+    },
+    "mouseout": {
+      "code": "",
+      "html": ""
+    },
+    "mouseover": {
+      "code": "",
+      "html": ""
+    }
+  }
+}

BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/action/add.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/action/delete1.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/action/move1.png


+ 50 - 0
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/actionbar.wcss

@@ -0,0 +1,50 @@
+{
+	"moduleNodeMove": {
+		"border": "2px dashed #ffa200",
+		"height": "30px",
+		"overflow": "hidden",
+		"margin": "3px",
+		"display": "block",
+		"-webkit-user-select": "none",
+		"-moz-user-select": "none",
+		"position": "absolute",
+		"z-index": 10002,
+		"opacity": 0.7,
+		"width": "100px",
+		"background-color": "#999",
+		"cursor": "move"
+	},
+	"moduleNodeShow": {
+		"border": "1px dashed #333",
+        "height": "2px",
+        "cursor": "pointer",
+        "line-height": "22px",
+        "overflow": "hidden",
+        "margin": "3px 3px",
+        "-webkit-user-select": "none",
+        "-moz-user-select": "none",
+        "position": "static",
+        "display": "block",
+        "top": "auto",
+        "left": "auto",
+        "width": "auto",
+        "opacity": 0.5,
+        "background": "#ffa200"
+	},
+	"moduleNode": {
+        "border": "1px dashed #999",
+        "height": "auto",
+        "overflow": "hidden",
+        "margin": "auto",
+        "display": "block",
+        "-webkit-user-select": "none",
+        "-moz-user-select": "none",
+        "position": "static",
+        "opacity": 1,
+        "width": "auto",
+        "margin": "3px 3px",
+        "background-color": "#999",
+        "cursor": "pointer"
+	}
+	
+}

BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/actionbar/blue/export.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/actionbar/default/export.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/actionbar/export.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/actionbar/red/export.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/actionbar/white/export.png


+ 390 - 0
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/css.wcss

@@ -0,0 +1,390 @@
+{
+    "actionbarNode" : {
+        "overflow": "hidden"
+    },
+    "pagingNode" : {
+        "overflow": "hidden"
+    },
+    "viewAreaNode": {
+        "overflow": "hidden"
+    },
+	"viewTitleNode": {
+        "height": "40px",
+        "background-color": "#EEE",
+        "border-bottom": "1px solid #999",
+        "cursor": "pointer"
+    },
+    "viewContentScrollNode": {
+        "overflow": "hidden",
+        "border-bottom": "0px solid #999",
+        "cursor": "default"
+    },
+    "viewContentNode": {
+        "overflow": "hidden"
+    },
+    "contentLeftNode": {
+        "width": "30px",
+        "background-color": "#EEE",
+        "border-right": "1px solid #999",
+        "float": "left"
+    },
+    "contentRightNode": {
+        "width": "30px",
+        "background-color": "#EEE",
+        "border-left": "1px solid #999",
+        "float": "right"
+    },
+    "viewContentBodyNode": {
+        "overflow": "hidden",
+        "background-color": "#FFF"
+    },
+    "viewContentTableNode": {
+        "width": "100%"
+    },
+    "viewContentTrNode": {
+    },
+    "viewContentTdNode": {
+        "padding": "3px 5px",
+        "border-bottom": "1px solid #CCC"
+    },
+    "viewContentGroupTdNode": {
+        "padding": "3px 5px",
+        "border-bottom": "1px solid #CCC",
+        "background-color": "#F9F9F9"
+    },
+    "viewContentTdGroupNode": {
+        "overflow": "hidden",
+        "cursor": "pointer"
+    },
+    "viewContentTdGroupIconNode": {
+        "float": "left",
+        "width": "20px",
+        "height": "20px",
+        "background": "url("+"../x_component_process_ViewDesigner/$View/default/icon/right.png) center center no-repeat",
+    },
+    "viewContentTdGroupTextNode": {
+        "height": "20px",
+        "font-weight": "bold",
+        "line-height": "20px",
+        "margin-left": "20px"
+    },
+    "noDataTextNode" : {
+        "height" : "50px",
+        "font-size" : "16px",
+        "margin" : "20px auto",
+        "text-align" : "center"
+    },
+
+    "refreshNode": {
+        "width": "29px",
+        "height": "40px",
+        "background": "url("+"../x_component_process_ViewDesigner/$View/default/icon/refresh.png) center center no-repeat",
+        "float": "left"
+    },
+    "addColumnNode": {
+        "width": "29px",
+        "height": "40px",
+        "background": "url("+"../x_component_process_ViewDesigner/$View/default/icon/addColumn.png) center center no-repeat",
+        "float": "right"
+    },
+
+    "viewTitleContentNode": {
+        "margin": "0px 31px",
+        "height": "40px"
+    },
+    "viewTitleTableNode": {
+        "width": "100%",
+        "height": "30px",
+        "border-left": "1px solid #BBB",
+        "border-right": "1px solid #BBB"
+    },
+    "viewTitleTrNode": {
+        "height": "40px",
+        "line-height": "40px"
+    },
+    "viewTitleColumnAreaNode": {
+        "padding": "0px",
+        "background-color": "#EEE",
+        "border-right": "1px solid #BBB",
+        "border-left": "1px solid #FFF",
+        "white-space": "nowrap"
+    },
+
+    "viewTitleColumnNode": {
+        "background-color": "#EEE",
+        "height": "38px",
+        "overflow": "hidden",
+        "border": "1px solid #EEE"
+    },
+    "viewTitleColumnTextNode":{
+        "padding": "0px", //"padding": "0px 10px",
+        "height": "38px",
+        "white-space": "nowrap"
+    },
+    "viewTitleColumnNode_selected": {
+        "background-color": "#FFF",
+        "height": "38px",
+        "border": "1px solid red",
+        "white-space": "nowrap"
+    },
+    "viewTitleColumnNode_over": {
+        "background-color": "#F9F9F9",
+        "height": "38px",
+        "border": "1px dotted blue",
+        "white-space": "nowrap"
+    },
+
+    "propertyTabNode": {
+        "font-size": "12px",
+        "margin-top": "5px"
+    },
+    "cloumnListNode": {
+        "height": "26px",
+        "padding": "0px 5px",
+        "line-height": "26px",
+        "font-size": "12px",
+        "cursor": "pointer",
+        "border-bottom": "1px dotted #999",
+        "background-color": "#FFF",
+        "color": "#333"
+    },
+    "cloumnListNode_selected": {
+        "background-color": "#cce2ff"
+    },
+    "cloumnListNode_over": {
+        "background-color": "#eaf1fa"
+    },
+    "cloumnListIconNode": {
+        "height": "26px",
+        "width": "26px",
+        "float": "left",
+        "background": "url("+"../x_component_process_ViewDesigner/$View/default/icon/column.png) center center no-repeat"
+    },
+    "cloumnListTextNode": {
+        "margin-left": "26px"
+    },
+
+
+
+    "editTable": {
+
+    },
+    "editTableTitle": {
+        "width": "60px",
+        "font-weight": "bold",
+        "font-size": "12px",
+        "height": "24px",
+        "line-height": "24px",
+        "border-bottom": "1px dashed #CCC"
+    },
+    "editTableTitleNoWidth": {
+        "font-weight": "bold",
+        "font-size": "12px",
+        "height": "24px",
+        "line-height": "24px",
+        "border-bottom": "1px dashed #CCC"
+    },
+    "editTableValue": {
+        "height": "24px",
+        "line-height": "24px",
+        "border-bottom": "1px dashed #CCC"
+    },
+    "editTableInput": {
+        "width": "98%",
+        "border-top": "1px solid #DDD",
+        "border-left": "1px solid #DDD",
+        "border-bottom": "1px solid #EEE",
+        "border-right": "1px solid #EEE"
+    },
+    "editTableInputDate": {
+        "width": "98%",
+        "border-top": "1px solid #DDD",
+        "border-left": "1px solid #DDD",
+        "border-bottom": "1px solid #EEE",
+        "border-right": "1px solid #EEE"
+    },
+    "editTableInputNoWidth": {
+        "border-top": "1px solid #DDD",
+        "border-left": "1px solid #DDD",
+        "border-bottom": "1px solid #EEE",
+        "border-right": "1px solid #EEE"
+    },
+    "editTableTextarea": {
+        "width": "98%",
+        "height": "100px",
+        "border-top": "1px solid #DDD",
+        "border-left": "1px solid #DDD",
+        "border-bottom": "1px solid #EEE",
+        "border-right": "1px solid #EEE"
+    },
+    "columnFilterInputArea": {
+        "padding": "5px",
+        "overflow": "hidden"
+    },
+    "columnFilterAddNode": {
+        "border": "1px solid #999",
+        "background-color": "#EEE",
+        "width": "35px",
+        "-webkit-user-select": "none",
+        "-moz-user-select": "none",
+        "padding": "0px 8px",
+        "margin-top": "56px",
+        "height": "20px",
+        "line-height": "20px",
+        "float": "left",
+        "text-align": "right",
+        "cursor": "pointer",
+        "font-size": "12px",
+        "background": "url("+"../x_component_process_ViewDesigner/$View/default/icon/add.png) 3px center no-repeat"
+    },
+    "columnFilterValueNode": {
+        "width": "95%",
+        "height": "50px",
+        "border": "1px solid #999",
+        "margin-top": "5px",
+        "overflow": "auto"
+    },
+    "filterTableTitle": {
+        "height": "24px",
+        "background-color": "#EEE",
+        "line-height": "24px",
+        "color": "#000",
+        "font-size": "12px"
+    },
+    "filterTableTd": {
+        "background-color": "#FFF",
+        "color": "#333",
+        "font-size": "12px"
+    },
+    "filterAddActionNode":{
+        "background": "url("+"../x_component_process_ViewDesigner/$View/default/icon/add.png) 3px center no-repeat",
+        "height": "24px",
+        "cursor": "pointer"
+    },
+    "filterDelActionNode":{
+        "background": "url("+"../x_component_process_ViewDesigner/$View/default/icon/del.png) 3px center no-repeat",
+        "height": "24px",
+        "cursor": "pointer"
+    },
+
+    "actionNodeStyles": {
+        "width": "16px",
+        "height": "16px",
+        "margin-left": "2px",
+        "margin-right": "2px",
+        "float": "left",
+        "border": "1px solid #F1F1F1",
+        "cursor": "pointer"
+    },
+    "actionAreaNode": {
+        "display": "none",
+        //	"width": 18*this.options.actions.length,
+        "position": "absolute",
+        "background-color": "#F1F1F1",
+        "padding": "1px",
+        "padding-right": "0px",
+        "border": "1px solid #AAA",
+        "box-shadow": "0px 2px 5px #999",
+        "opacity": 1,
+        "z-index": 100
+    },
+
+    "moveFlagNode": {
+        "height": "40px",
+        //"border": "0px dashed #333",
+        "border-right": "1px solid #BBB",
+        "border-left": "1px solid #FFF",
+        "overflow": "hidden",
+        "display": "block",
+        "background": "#ffa200"
+    },
+    "applicationSelectTitle": {
+        "height": "24px",
+        "line-height": "24px",
+        "background-color": "#EEE",
+        "border-top": "2px solid #999",
+        "text-align": "center"
+    },
+    "applicationSelectContent": {
+        "min-height": "20px",
+        "border-top": "1px solid #999",
+        "padding": "5px 5px 0px 0px",
+        "overflow": "hidden"
+    },
+    "applicationSelectItem": {
+        "border": "1px solid #666",
+        "color": "#FFF",
+        "padding": "0px 5px",
+        "margin-left": "5px",
+        "margin-bottom": "5px",
+        "background-color": "#666",
+        "float": "left"
+    },
+    "applicationSelectAction": {
+        "height": "20px",
+        "margin": "10px auto",
+        "text-align": "center",
+        "width": "70px",
+        "border": "1px solid #999",
+        "background-color": "#F6F6F6",
+        "cursor": "pointer"
+    },
+    "columnHideFlagNode": {
+        "height": "40px",
+        "background": "url("+"../x_component_process_ViewDesigner/$View/default/icon/hidden.png) right center no-repeat",
+        "position": "relative",
+        "margin-right": "8px",
+        "top": "-38px"
+    },
+
+    "toolbarWarpNode": {
+        "border": "1px dashed #999",
+        "height": "auto",
+        "overflow": "hidden",
+        "margin": "auto",
+        "display": "block",
+        "-webkit-user-select": "none",
+        "-moz-user-select": "none",
+        "position": "static",
+        "opacity": 1,
+        "width": "auto",
+        "margin": "3px 3px",
+        "background-color": "#999",
+        "cursor": "pointer"
+    },
+    "toolbarWarpNode_selected": {
+        "background-color": "#FFF",
+        "border": "1px solid red",
+        "white-space": "nowrap"
+    },
+    "toolbarWarpNode_over": {
+        "background-color": "#F9F9F9",
+        "border": "1px dotted blue",
+        "white-space": "nowrap"
+    },
+
+    "pagingWarpNode": {
+        "border": "1px dashed #999",
+        "height": "auto",
+        "overflow": "hidden",
+        "display": "block",
+        "-webkit-user-select": "none",
+        "-moz-user-select": "none",
+        "position": "static",
+        "opacity": 1,
+        "width": "auto",
+        "margin": "3px 3px",
+        "background-color": "#FFF",
+        "cursor": "pointer"
+    },
+    "pagingWarpNode_selected": {
+        "background-color": "#FFF",
+        "border": "1px solid red",
+        "white-space": "nowrap"
+    },
+    "pagingWarpNode_over": {
+        "background-color": "#F9F9F9",
+        "border": "1px dotted blue",
+        "white-space": "nowrap"
+    }
+}

BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/add.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/addColumn.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/col.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/column.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/del.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/down.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/exp.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/hidden.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/refresh.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/right.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Inquiry/default/icon/sel.png


+ 730 - 0
o2web/source/x_component_query_InquiryDesigner/$Inquiry/inquiry.html

@@ -0,0 +1,730 @@
+<div style="background-color: #FFF; overflow: hidden">
+    <div title="基本" class="MWFTab">
+        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+            <tr>
+                <td class="editTableTitle">标识:</td>
+                <td class="editTableValue">text{$.id}</td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">名称:</td>
+                <td class="editTableValue"><input type="text" name="name" value="text{$.name}" class="editTableInput"/></td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">别名:</td>
+                <td class="editTableValue"><input type="text" name="alias" value="text{$.alias}" class="editTableInput"/></td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">描述:</td>
+                <td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">隐藏视图:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="display" text{($.display===false)?'checked':''} type="radio" value="false"/>是
+                    <input class="editTableRadio" name="display" text{($.display!==false)?'checked':''} type="radio" value="true"/>否
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">视图样式:</td>
+                <td class="editTableValue">
+                    <select class="MWFViewStyle" name="data.viewStyleType"></select>
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">展开分类:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="data.isExpand" text{($.data.isExpand==='yes')?'checked':''} type="radio" value="yes"/>是
+                    <input class="editTableRadio" name="data.isExpand" text{($.data.isExpand!=='yes')?'checked':''} type="radio" value="no"/>否
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">显示序号:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="data.isSequence" text{($.data.isSequence==='yes')?'checked':''} type="radio" value="yes"/>是
+                    <input class="editTableRadio" name="data.isSequence" text{($.data.isSequence!=='yes')?'checked':''} type="radio" value="no"/>否
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitleNoWidth">最大行数:</td>
+                <td class="editTableValue"><input type="number" name="count" value="text{$.count || 600}" class="editTableInput"/></td>
+            </tr>
+            <tr>
+                <td class="editTableTitleNoWidth">每页行数:</td>
+                <td class="editTableValue">
+                    <input type="number" name="pageSize" value="text{$.pageSize || 20}" class="editTableInput"/>
+                    <div style="color:#999;">注:每页最大行数为2000条</div>
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">隐藏操作条:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="data.actionbarHidden" text{($.data.actionbarHidden!==false)?'checked':''} type="radio" value="true"/>是
+                    <input class="editTableRadio" name="data.actionbarHidden" text{($.data.actionbarHidden===false)?'checked':''} type="radio" value="false"/>否
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">选择:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="data.select" text{($.data.select!=='single' || $.data.select!=='multi' )?'checked':''} type="radio" value="none"/>无
+                    <input class="editTableRadio" name="data.select" text{($.data.select==='single')?'checked':''} type="radio" value="single"/>单选
+                    <input class="editTableRadio" name="data.select" text{($.data.select==='multi')?'checked':''} type="radio" value="multi"/>多选
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">无分类和选择隐藏首列</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="data.firstTdHidden" text{($.data.firstTdHidden===true)?'checked':''} type="radio" value="single"/>是
+                    <input class="editTableRadio" name="data.firstTdHidden" text{($.data.firstTdHidden!==true)?'checked':''} type="radio" value="multi"/>否
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">无数据显示:</td>
+                <td class="editTableValue">
+                    <input type="text" name="data.noDataText" value="text{$.data.noDataText}" class="editTableInput"/>
+                </td>
+            </tr>
+            <!--<tr>-->
+            <!--<td class="editTableTitle">最大行数:</td>-->
+            <!--<td class="editTableValue"><input type="text" name="max" value="text{$.max}" class="editTableInput"/></td>-->
+            <!--</tr>-->
+        </table>
+
+        <div style="height:24px; text-align: center; line-height: 24px; background-color: #EEE; border-top: 1px solid #999; font-weight: bold">权限</div>
+        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable" id="processEditStarter">
+            <tr>
+                <td class="editTableTitle">可执行人:</td>
+                <td class="editTableValue">
+                    <div class="MWFPersonIdentity" name="availableIdentityList"></div>
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">执行组织:</td>
+                <td class="editTableValue">
+                    <div class="MWFPersonUnit" name="availableUnitList"></div>
+                </td>
+            </tr>
+            <!--<tr>-->
+            <!--<td class="editTableTitle">执行部门:</td>-->
+            <!--<td class="editTableValue">-->
+            <!--<div class="MWFSelectDepartment" name="availableDepartmentList"></div>-->
+            <!--</td>-->
+            <!--</tr>-->
+            <!--<tr>-->
+            <!--<td class="editTableTitle">执行公司:</td>-->
+            <!--<td class="editTableValue">-->
+            <!--<div class="MWFSelectCompany" name="availableCompanyList"></div>-->
+            <!--</td>-->
+            <!--</tr>-->
+        </table>
+
+        <div class="MWFFormulaArea" name="data.defaultSelectedScript" title="默认选中行脚本"></div>
+
+
+
+        <!--<div class="MWFApplicationSelect" title="选择应用"></div>-->
+        <!--<div class="MWFProcessSelect" title="选择流程"></div>-->
+        <!--<div class="MWFCompanySelect" title="选择公司"></div>-->
+        <!--<div class="MWFDepartmentSelect" title="选择部门"></div>-->
+        <!--<div class="MWFPersonSelect" title="选择人员"></div>-->
+        <!--<div class="MWFIdentitySelect" title="选择身份"></div>-->
+    </div>
+
+
+    <div title="范围"  class="MWFTab">
+        <div style="height:24px; text-align: center; line-height: 24px; background-color: #EEE; border-top: 1px solid #999; font-weight: bold">范围</div>
+        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+            <tr>
+                <td class="editTableValue" colspan="2" align="center">
+                    <input class="editTableRadio" onclick="
+                    if (this.checked){
+                        $('text{$.id}dateRangeType_process').setStyle('display', 'block');
+                        $('text{$.id}dateRangeType_cms').setStyle('display', 'none');
+                        $$('.text{$.id}dataPathSelectedProcessArea').setStyle('display', '');
+                        $$('.text{$.id}dataPathSelectedCMSArea').setStyle('display', 'none');
+                    }" name="text{$.id}*type" text{($.type!='cms')?'checked':''} type="radio" value="process"/>流程平台数据
+                    <input class="editTableRadio" onclick="
+                    if (this.checked){
+                        $('text{$.id}dateRangeType_process').setStyle('display', 'none');
+                        $('text{$.id}dateRangeType_cms').setStyle('display', 'block');
+                        $$('.text{$.id}dataPathSelectedProcessArea').setStyle('display', 'none');
+                        $$('.text{$.id}dataPathSelectedCMSArea').setStyle('display', '');
+                     }" name="text{$.id}*type" text{($.type=='cms')?'checked':''} type="radio" value="cms"/>内容管理数据
+                </td>
+            </tr>
+        </table>
+
+        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+            <tr>
+                <td class="editTableTitle">权限:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="text{$.id}*data.where.accessible" text{($.data.where.accessible)?'checked':''} type="radio" value="true"/>带权限
+                    <input class="editTableRadio" name="text{$.id}*data.where.accessible" text{(!$.data.where.accessible)?'checked':''} type="radio" value="false"/>忽略
+                </td>
+            </tr>
+        </table>
+        <div id="text{$.id}dateRangeType_process" style="display: text{($.type!='cms')?'block':'none'}">
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">流转状态:</td>
+                    <td class="editTableValue">
+                        <input class="editTableRadio" name="text{$.id}*data.where.scope" text{($.data.where.scope!='workCompleted' && $.data.where.scope!='all' && $.data.where.scope!='cms_info' && $.data.where.scope!='cms_data')?'checked':''} type="radio" value="work"/>流转中
+                        <input class="editTableRadio" name="text{$.id}*data.where.scope" text{($.data.where.scope=='workCompleted')?'checked':''} type="radio" value="workCompleted"/>已完成
+                        <input class="editTableRadio" name="text{$.id}*data.where.scope" text{($.data.where.scope=='all')?'checked':''} type="radio" value="all"/>全部
+                    </td>
+                </tr>
+                <tr>
+                    <td class="editTableValue" colspan="2">取应用和流程的并集</td>
+                </tr>
+                <tr>
+                    <td class="editTableTitle">选择应用:</td>
+                    <td class="editTableValue">
+                        <div class="MWFSelectApplication" name="data.where.applicationList"></div>
+                    </td>
+                </tr>
+                <tr>
+                    <td class="editTableTitle">选择流程:</td>
+                    <td class="editTableValue">
+                        <div class="MWFSelectProcess" name="data.where.processList"></div>
+                    </td>
+                </tr>
+            </table>
+        </div>
+        <div id="text{$.id}dateRangeType_cms" style="display: text{($.type=='cms')?'block':'none'}">
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">数据类型:</td>
+                    <td class="editTableValue">
+                        <input class="editTableRadio" name="text{$.id}*data.where.scope" text{($.data.where.scope!='cms_data' && $.data.where.scope!='all' && $.data.where.scope!='workCompleted' && $.data.where.scope!='work')?'checked':''} type="radio" value="cms_info"/>信息类
+                        <input class="editTableRadio" name="text{$.id}*data.where.scope" text{($.data.where.scope=='cms_data')?'checked':''} type="radio" value="cms_data"/>数据类
+                        <!--                        <input class="editTableRadio" name="text{$.id}*data.where.scope" text{($.data.where.scope=='all')?'checked':''} type="radio" value="all"/>全部-->
+                    </td>
+                </tr>
+                <tr>
+                    <td class="editTableTitle">返回草稿:</td>
+                    <td class="editTableValue">
+                        <input class="editTableRadio" name="text{$.id}*data.where.draft" text{($.data.where.draft)?'checked':''} type="radio" value="true"/>是
+                        <input class="editTableRadio" name="text{$.id}*data.where.draft" text{(!$.data.where.draft)?'checked':''} type="radio" value="false"/>否
+                    </td>
+                </tr>
+                <tr>
+                    <td class="editTableValue" colspan="2">取栏目和分类的并集:</td>
+                </tr>
+                <tr>
+                    <td class="editTableTitle">选择栏目:</td>
+                    <td class="editTableValue">
+                        <div class="MWFSelectCMSApplication" name="data.where.appInfoList"></div>
+                    </td>
+                </tr>
+                <tr>
+                    <td class="editTableTitle">选择分类:</td>
+                    <td class="editTableValue">
+                        <div class="MWFSelecCMStCategory" name="data.where.categoryInfoList"></div>
+                    </td>
+                </tr>
+            </table>
+        </div>
+        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+            <tr>
+                <td class="editTableValue" colspan="2">取组织、人员和身份的并集:</td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">拟稿组织:</td>
+                <td class="editTableValue">
+                    <div class="MWFSelectUnit" name="data.where.creatorUnitList"></div>
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">拟稿人员:</td>
+                <td class="editTableValue">
+                    <div class="MWFSelectPerson" name="data.where.creatorPersonList"></div>
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">拟稿身份:</td>
+                <td class="editTableValue">
+                    <div class="MWFSelectIdentity" name="data.where.creatorIdentityList"></div>
+                </td>
+            </tr>
+        </table>
+
+
+        <div style="height:24px; text-align: center; line-height: 24px; background-color: #EEE; border-top: 1px solid #999; font-weight: bold">时段</div>
+        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+            <tr><td class="editTableTitle">时段类型:</td><td class="editTableValue">
+                <input class="editTableRadio" name="text{$.id}*data.where.dateRange.dateRangeType"
+                       onclick="if (this.checked){
+                           $('text{$.id}dateRangeType_RangeArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_DateArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_WeekArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_MonthArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_YearArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_SeasonArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_adjust').setStyle('display', 'none');
+                       }"
+                       type="radio" text{(['year','season','month','week','date','season'].indexOf($.data.where.dateRange.dateRangeType)==-1)?'checked':''} value="none"/>全部
+
+                <input class="editTableRadio" name="text{$.id}*data.where.dateRange.dateRangeType"
+                       onclick="if (this.checked){
+                           $('text{$.id}dateRangeType_RangeArea').setStyle('display', 'block');
+                           $('text{$.id}dateRangeType_DateArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_WeekArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_MonthArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_YearArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_SeasonArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_adjust').setStyle('display', 'none');
+                       }"
+                       type="radio" text{($.data.where.dateRange.dateRangeType=='range')?'checked':''} value="range"/>范围<br/>
+
+                <input class="editTableRadio" name="text{$.id}*data.where.dateRange.dateRangeType"
+                       onclick="if (this.checked){
+                           $('text{$.id}dateRangeType_YearArea').setStyle('display', 'block');
+                           $('text{$.id}dateRangeType_DateArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_WeekArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_MonthArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_RangeArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_SeasonArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_adjust').setStyle('display', '');
+                       }"
+                       type="radio" text{($.data.where.dateRange.dateRangeType=='year')?'checked':''} value="year"/>年度
+                <input class="editTableRadio" name="text{$.id}*data.where.dateRange.dateRangeType"
+                       onclick="if (this.checked){
+                           $('text{$.id}dateRangeType_YearArea').setStyle('display', 'block');
+                           $('text{$.id}dateRangeType_DateArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_WeekArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_MonthArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_SeasonArea').setStyle('display', 'block');
+                           $('text{$.id}dateRangeType_RangeArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_adjust').setStyle('display', '');
+                       }"
+                       type="radio" text{($.data.where.dateRange.dateRangeType=='season')?'checked':''} value="season"/>季度
+                <input class="editTableRadio" name="text{$.id}*data.where.dateRange.dateRangeType"
+                       onclick="if (this.checked){
+                           $('text{$.id}dateRangeType_YearArea').setStyle('display', 'block');
+                           $('text{$.id}dateRangeType_DateArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_WeekArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_MonthArea').setStyle('display', 'block');
+                           $('text{$.id}dateRangeType_SeasonArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_RangeArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_adjust').setStyle('display', '');
+                       }"
+                       type="radio" text{($.data.where.dateRange.dateRangeType=='month')?'checked':''} value="month"/>月度
+                <input class="editTableRadio" name="text{$.id}*data.where.dateRange.dateRangeType"
+                       onclick="if (this.checked){
+                           $('text{$.id}dateRangeType_YearArea').setStyle('display', 'block');
+                           $('text{$.id}dateRangeType_DateArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_WeekArea').setStyle('display', 'block');
+                           $('text{$.id}dateRangeType_MonthArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_SeasonArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_RangeArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_adjust').setStyle('display', '');
+                       }"
+                       type="radio" text{($.data.where.dateRange.dateRangeType=='week')?'checked':''} value="week"/>周
+                <input class="editTableRadio" name="text{$.id}*data.where.dateRange.dateRangeType"
+                       onclick="if (this.checked){
+                           $('text{$.id}dateRangeType_YearArea').setStyle('display', 'block');
+                           $('text{$.id}dateRangeType_DateArea').setStyle('display', 'block');
+                           $('text{$.id}dateRangeType_WeekArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_MonthArea').setStyle('display', 'block');
+                           $('text{$.id}dateRangeType_SeasonArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_RangeArea').setStyle('display', 'none');
+                           $('text{$.id}dateRangeType_adjust').setStyle('display', '');
+                       }"
+                       type="radio" text{($.data.where.dateRange.dateRangeType=='date')?'checked':''} value="date"/>日
+            </td></tr>
+        </table>
+        <div id="text{$.id}dateRangeType_RangeArea" style="display: text{($.data.where.dateRange.dateRangeType=='range')?'block':'none'}">
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">开始日期:</td>
+                    <td class="editTableValue"><input readonly type="text" name="data.where.dateRange.start" value="text{$.data.where.dateRange.start}" class="editTableInputDate"/></td>
+                </tr>
+                <tr>
+                    <td class="editTableTitle">结束日期:</td>
+                    <td class="editTableValue"><input readonly type="text" name="data.where.dateRange.completed" value="text{$.data.where.dateRange.completed}" class="editTableInputDate"/></td>
+                </tr>
+            </table>
+        </div>
+        <div id="text{$.id}dateRangeType_YearArea" style="display: text{(['year','season','month'].indexOf($.data.where.dateRange.dateRangeType)!=-1)?'block':'none'}">
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">年度:</td>
+                    <td class="editTableValue"><select name="data.where.dateRange.year">
+                        <option value="">当前年度</option>
+                        fun{var y=(new Date()).getFullYear(); var html = ""; for (var i=0; i<10; i++)html+="<option value='"+(y-i)+"'>"+(y-i)+"</option>"; return html;}
+                    </select></td>
+                </tr>
+            </table>
+        </div>
+        <div id="text{$.id}dateRangeType_SeasonArea" style="display: text{($.data.where.dateRange.dateRangeType=='season')?'block':'none'}">
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">季度:</td>
+                    <td class="editTableValue"><select name="data.where.dateRange.season">
+                        <option value="">当前季度</option>
+                        <option value="1">第一季度</option>
+                        <option value="2">第二季度</option>
+                        <option value="3">第三季度</option>
+                        <option value="4">第四季度</option>
+                    </select></td>
+                </tr>
+            </table>
+        </div>
+        <div id="text{$.id}dateRangeType_MonthArea" style="display: text{($.data.where.dateRange.dateRangeType=='month')?'block':'none'}">
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">月份:</td>
+                    <td class="editTableValue"><select name="data.where.dateRange.month">
+                        <option value="">当前月份</option>
+                        <option value="1">1月</option>
+                        <option value="2">2月</option>
+                        <option value="3">3月</option>
+                        <option value="4">4月</option>
+                        <option value="5">5月</option>
+                        <option value="6">6月</option>
+                        <option value="7">7月</option>
+                        <option value="8">8月</option>
+                        <option value="9">9月</option>
+                        <option value="10">10月</option>
+                        <option value="11">11月</option>
+                        <option value="12">12月</option>
+                    </select></td>
+                </tr>
+            </table>
+        </div>
+        <div id="text{$.id}dateRangeType_WeekArea" style="display: text{($.data.where.dateRange.dateRangeType=='week')?'block':'none'}">
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">周:</td>
+                    <td class="editTableValue"><select name="data.where.dateRange.week">
+                        <option value="">当前周</option>
+                        fun{var html = ""; for (var i=1; i<56; i++)html+="<option value='"+i+"'>第"+i+"周</option>"; return html;}
+                    </select></td>
+                </tr>
+            </table>
+        </div>
+
+        <div id="text{$.id}dateRangeType_DateArea" style="display: text{($.data.where.dateRange.dateRangeType=='week')?'block':'none'}">
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">日期:</td>
+                    <td class="editTableValue"><select name="data.where.dateRange.date">
+                        <option value="">当天</option>
+                        fun{var html = ""; for (var i=1; i<32; i++)html+="<option value='"+i+"'>"+i+"日</option>"; return html;}
+                    </select></td>
+                </tr>
+            </table>
+        </div>
+
+        <div id="text{$.id}dateRangeType_adjust" style="display: text{($.data.where.dateRange.dateRangeType=='none'||$.data.where.dateRange.dateRangeType=='range')?'none':''}">
+            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                <tr>
+                    <td class="editTableTitle">偏移量:</td>
+                    <td class="editTableValue">
+                        <input type="text" name="data.where.dateRange.adjust" value="text{$.data.where.dateRange.adjust}" class="editTableInput"/>
+                    </td>
+                </tr>
+            </table>
+        </div>
+    </div>
+
+    <div title="过滤"  class="MWFTab">
+        <div class="MWFViewFilter">
+            <div class="inputAreaNode_vf">
+                <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable restrictViewFilterTable_vf">
+                    <tr>
+                        <td class="editTableTitle">标题:</td>
+                        <td class="editTableValue"><input type="text" class="editTableInput titleInput_vf"/></td>
+                    </tr>
+                    <tr>
+                        <td class="editTableTitle">路径:</td>
+                        <td class="editTableValue"><input type="text" class="editTableInput pathInput_vf"/></td>
+                    </tr>
+                    <tr>
+                        <td class="editTableTitle">数据类型:</td>
+                        <td class="editTableValue"><select class="datatypeInput_vf"
+                                onchange="if (this.selectedIndex==2){
+                                    $('text{$.id}viewFilterDateFormulaSelector').setStyle('display', 'block');
+                                    // $('text{$.id}viewFilterDateFormulaSelector2').setStyle('display', 'block');
+                                    $('text{$.id}viewFilterDateOnlyFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterDateOnlyFormulaSelector2').setStyle('display', 'none');
+                                    $('text{$.id}viewFilterTimeOnlyFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterTimeOnlyFormulaSelector2').setStyle('display', 'none');
+                                }else if (this.selectedIndex==3){
+                                    $('text{$.id}viewFilterDateFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterDateFormulaSelector2').setStyle('display', 'none');
+                                    $('text{$.id}viewFilterDateOnlyFormulaSelector').setStyle('display', 'block');
+                                    // $('text{$.id}viewFilterDateOnlyFormulaSelector2').setStyle('display', 'block');
+                                    $('text{$.id}viewFilterTimeOnlyFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterTimeOnlyFormulaSelector2').setStyle('display', 'none');
+                                }else if (this.selectedIndex==4){
+                                    $('text{$.id}viewFilterDateFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterDateFormulaSelector2').setStyle('display', 'none');
+                                    $('text{$.id}viewFilterDateOnlyFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterDateOnlyFormulaSelector2').setStyle('display', 'none');
+                                    $('text{$.id}viewFilterTimeOnlyFormulaSelector').setStyle('display', 'block');
+                                    // $('text{$.id}viewFilterTimeOnlyFormulaSelector2').setStyle('display', 'block');
+                                }else{
+                                    $('text{$.id}viewFilterDateFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterDateFormulaSelector2').setStyle('display', 'none');
+                                    $('text{$.id}viewFilterDateOnlyFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterDateOnlyFormulaSelector2').setStyle('display', 'none');
+                                    $('text{$.id}viewFilterTimeOnlyFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterTimeOnlyFormulaSelector2').setStyle('display', 'none');
+                                }
+
+                                if (this.selectedIndex==0){
+                                    $('text{$.id}viewFilterTextFormulaSelector').setStyle('display', 'block');
+                                    // $('text{$.id}viewFilterTextFormulaSelector2').setStyle('display', 'block')
+                                }else{
+                                    $('text{$.id}viewFilterTextFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterTextFormulaSelector2').setStyle('display', 'none')
+                                }">
+                            <option value="textValue" selected>文本</option>
+                            <option value="numberValue">数字</option>
+                            <option value="dateTimeValue">日期时间</option>
+                            <option value="dateValue">日期</option>
+                            <option value="timeValue">时间</option>
+                            <option value="booleanValue">布尔</option>
+                        </select></td>
+                    </tr>
+                    <tr>
+                        <td class="editTableTitle"></td>
+                        <td class="editTableValue">
+                            <input type="radio" class="restrictFilterInput_vf" value="restrict" name="text{$.id}viewFilterType" onclick="if (this.checked){
+                                $('text{$.id}viewFilterRestrict').setStyle('display', 'block');
+                                $('text{$.id}viewCustomFilterRestrict').setStyle('display', 'none');
+                            }"/>作为默认过滤条件<br>
+                            <input type="radio" class="customFilterInput_vf" value="custom" name="text{$.id}viewFilterType" onclick="if (this.checked){
+                                $('text{$.id}viewFilterRestrict').setStyle('display', 'none');
+                                $('text{$.id}viewCustomFilterRestrict').setStyle('display', 'block');
+                            }" checked/>作为自定义过滤数据
+                        </td>
+                    </tr>
+                </table>
+                <div id="text{$.id}viewFilterRestrict"  style="display: none">
+                    <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                        <tr>
+                            <td class="editTableTitle">逻辑:</td>
+                            <td class="editTableValue"><select class="logicInput_vf">
+                                <option selected value="and">并且(and)</option>
+                                <option value="or">或者(or)</option>
+                            </select></td>
+                        </tr>
+
+                        <tr>
+                            <td class="editTableTitle">比较:</td>
+                            <td class="editTableValue"><select class="comparisonInput_vf" onchange="
+                                // if (this.selectedIndex==8){
+                                //     $('text{$.id}viewFilterValue2Area').setStyle('display', 'block');
+                                //     $('text{$.id}viewFilterValueTitleArea').set('text', '从');
+                                // }else{
+                                //     $('text{$.id}viewFilterValue2Area').setStyle('display', 'none');
+                                //     $('text{$.id}viewFilterValueTitleArea').set('text', '值');
+                                // }"
+                                >
+                                <option value="equals" selected>等于(==)</option>
+                                <option value="notEquals">不等于(!=)</option>
+                                <option value="greaterThan">大于(>)</option>
+                                <option value="greaterThanOrEqualTo">大于等于(>=)</option>
+                                <option value="lessThan">小于(<)</option>
+                                <option value="lessThanOrEqualTo">小于等于(<=)</option>
+                                <option value="like">匹配(like)</option>
+                                <option value="notLike">不匹配(not-like)</option>
+                                <option value="range">范围(range)</option>
+                            </select></td>
+                        </tr>
+                        <tr>
+                            <td class="editTableTitle" id="text{$.id}viewFilterValueTitleArea">值:</td>
+                            <td class="editTableValue" id="text{$.id}viewFilterValueArea">
+                                <input type="text" class="editTableInput valueTextInput_vf" style="display: block" onkeypress="$('text{$.id}viewFilterTextFormulaSelector').getElements('input').set('checked', false)"/>
+                                <input type="number" class="editTableInput valueNumberInput_vf" style="display: none"/>
+                                <input type="text" class="editTableInput valueDatetimeInput_vf" style="display: none" readonly/>
+                                <input type="text" class="editTableInput valueDateInput_vf" style="display: none" readonly/>
+                                <input type="text" class="editTableInput valueTimeInput_vf" style="display: none" readonly/>
+                                <select class="valueBooleanInput_vf" style="display: none">
+                                    <option value="true" selected>是(True)</option>
+                                    <option value="false">否(False)</option>
+                                </select>
+                            </td>
+                        </tr>
+
+                    </table>
+                    <div style="display: none" id="text{$.id}viewFilterDateFormulaSelector">
+                        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                            <tr>
+                                <td class="editTableTitle"></td>
+                                <td class="editTableValue">
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@year" />当前年度
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@season" />当前季度
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@month" />当前月份<br/>
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@time" />当前时间
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@date" />当天
+
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
+                    <div style="display: none" id="text{$.id}viewFilterDateOnlyFormulaSelector">
+                        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                            <tr>
+                                <td class="editTableTitle"></td>
+                                <td class="editTableValue">
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDateInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@year" />当前年度
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDateInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@season" />当前季度
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDateInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@month" />当前月份<br/>
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDateInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@date" />当天
+
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
+                    <div style="display: none" id="text{$.id}viewFilterTimeOnlyFormulaSelector">
+                        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                            <tr>
+                                <td class="editTableTitle"></td>
+                                <td class="editTableValue">
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueTimeInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@time" />当前时间
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
+
+                    <div style="display: block" id="text{$.id}viewFilterTextFormulaSelector">
+                        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                            <tr>
+                                <td class="editTableTitle"></td>
+                                <td class="editTableValue">
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueTextInput_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula" onclick="" type="radio" value="@person" />当前人
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueTextInput_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula" type="radio" value="@identityList" />当前身份<br/>
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueTextInput_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula" type="radio" value="@unitList" />当前人所在直接组织<br/>
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueTextInput_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula" type="radio" value="@unitAllList" />当前人所在所有组织
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
+
+                    <div id="text{$.id}viewFilterValue2Area"  style="display: none">
+                        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                            <tr>
+                                <td class="editTableTitle">到:</td>
+                                <td class="editTableValue" id="text{$.id}viewFilterValueArea2">
+                                    <input type="text" class="editTableInput valueTextInput2_vf" style="display: block">
+<!--                                    onkeypress="$('text{$.id}viewFilterTextFormulaSelector2').getElements('input').set('checked', false)"/>-->
+                                    <input type="number" class="editTableInput valueNumberInput2_vf" style="display: none"/>
+                                    <input type="text" class="editTableInput valueDatetimeInput2_vf" style="display: none" readonly/>
+                                    <input type="text" class="editTableInput valueDateInput2_vf" style="display: none" readonly/>
+                                    <input type="text" class="editTableInput valueTimeInput2_vf" style="display: none" readonly/>
+                                    <select class="valueBooleanInput2_vf" style="display: none">
+                                        <option value="true" selected>是(True)</option>
+                                        <option value="false">否(False)</option>
+                                    </select>
+                                </td>
+                            </tr>
+                        </table>
+
+<!--       rang的时候,所有@xxx都是无效的
+                            <div style="display: none" id="text{$.id}viewFilterDateFormulaSelector2">-->
+<!--                            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">-->
+<!--                                <tr>-->
+<!--                                    <td class="editTableTitle"></td>-->
+<!--                                    <td class="editTableValue">-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDatetimeInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula2" type="radio" value="@year" />当前年度-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDatetimeInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula2" type="radio" value="@season" />当前季度-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDatetimeInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula2" type="radio" value="@month" />当前月份<br/>-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDatetimeInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula2" type="radio" value="@time" />当前时间-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDatetimeInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula2" type="radio" value="@date" />当天-->
+
+<!--                                    </td>-->
+<!--                                </tr>-->
+<!--                            </table>-->
+<!--                        </div>-->
+<!--                        <div style="display: none" id="text{$.id}viewFilterDateOnlyFormulaSelector2">-->
+<!--                            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">-->
+<!--                                <tr>-->
+<!--                                    <td class="editTableTitle"></td>-->
+<!--                                    <td class="editTableValue">-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDateInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@year" />当前年度-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDateInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@season" />当前季度-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDateInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@month" />当前月份<br/>-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDateInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@date" />当天-->
+
+<!--                                    </td>-->
+<!--                                </tr>-->
+<!--                            </table>-->
+<!--                        </div>-->
+<!--                        <div style="display: none" id="text{$.id}viewFilterTimeOnlyFormulaSelector2">-->
+<!--                            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">-->
+<!--                                <tr>-->
+<!--                                    <td class="editTableTitle"></td>-->
+<!--                                    <td class="editTableValue">-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueTimeInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@time" />当前时间-->
+<!--                                    </td>-->
+<!--                                </tr>-->
+<!--                            </table>-->
+<!--                        </div>-->
+<!--                        <div style="display: block" id="text{$.id}viewFilterTextFormulaSelector2">-->
+<!--                            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">-->
+<!--                                <tr>-->
+<!--                                    <td class="editTableTitle"></td>-->
+<!--                                    <td class="editTableValue">-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueTextInput2_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula2" onclick="" type="radio" value="@person" />当前人-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueTextInput2_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula2" type="radio" value="@identityList" />当前身份<br/>-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueTextInput2_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula2" type="radio" value="@unitList" />当前人所在直接组织<br/>-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueTextInput2_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula2" type="radio" value="@unitAllList" />当前人所在所有组织-->
+<!--                                    </td>-->
+<!--                                </tr>-->
+<!--                            </table>-->
+<!--                        </div>-->
+                    </div>
+
+                </div>
+                <div id="text{$.id}viewCustomFilterRestrict"  style="display: block">
+                    <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                        <tr>
+                            <td class="editTableTitle">值:</td>
+                            <td class="editTableValue">
+                                <input class="editTableRadio" onclick="
+                                if (this.checked){
+                                    $('text{$.id}viewCustomFilterValueScriptDiv').setStyle('display', 'none');
+                                }" name="viewCustomFilterValueType" checked type="radio" value="input"/>输入
+                                <input class="editTableRadio" onclick="
+                                if (this.checked){
+                                    $('text{$.id}viewCustomFilterValueScriptDiv').setStyle('display', 'block');
+                                }" name="viewCustomFilterValueType" type="radio" value="script"/>可选
+                            </td>
+                        </tr>
+                    </table>
+                    <div style="display:none" id="text{$.id}viewCustomFilterValueScriptDiv">
+                        <div style="padding: 5px">return ["选项文本|选项值"]</div>
+                        <div name="text{$.id}viewCustomFilterValueScript" title="选项脚本"></div>
+                    </div>
+                </div>
+            </div>
+            <div class="actionAreaNode_vf"></div>
+            <div style="height: 20px; line-height: 20px; text-align:center; background-color: #eeeeee">默认过滤条件</div>
+            <div class="listAreaNode_vf" style="min-height: 56px; border-bottom:1px solid #CCCCCC; overflow: hidden;"></div>
+            <div style="height: 20px; line-height: 20px; text-align:center; background-color: #eeeeee">自定义过滤数据</div>
+            <div class="fieldListAreaNode_vf" style="min-height: 56px; border-bottom:1px solid #CCCCCC; overflow: hidden;"></div>
+        </div>
+    </div>
+
+<!--    <div title="样式"  class="MWFTab">-->
+<!--        <div class="MWFMaplist" name="tableStyles" collapse="true" title="表格样式"></div>-->
+<!--        <div class="MWFMaplist" name="titleTdStyles" collapse="true" title="标题单元格样式"></div>-->
+<!--        <div class="MWFMaplist" name="contentTdStyles" collapse="true" title="内容单元格样式"></div>-->
+<!--        <div class="MWFMaplist" name="contentTdOverStyles" collapse="true" title="内容单元格鼠标over事件样式"></div>-->
+<!--        <div class="MWFMaplist" name="contentTdSelectedStyles" collapse="true" title="内容单元格选中样式"></div>-->
+<!--    </div>-->
+
+    <div title="样式"  class="MWFTab">
+        <div class="MWFViewStylesArea" name="data.viewStyles"></div>
+    </div>
+
+    <div title="事件"  class="MWFTab">
+        <div class="MWFEventsArea" name="data.events"></div>
+    </div>
+
+    <div title="JSON"  class="MWFTab">
+        <div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
+    </div>
+</div>

+ 89 - 0
o2web/source/x_component_query_InquiryDesigner/$Inquiry/inquiry.json

@@ -0,0 +1,89 @@
+{
+  "name": "",
+  "id": "",
+  "query": "",
+  "alias": "",
+  "description": "",
+  "display": true,
+  "type": "View",
+
+  "data": {
+    "exportGrid": true,
+    "exportGoupGrid": true,
+    "where": {
+      "accessible": false,
+      "scope": "work",
+      "applicationList": [],
+      "processList": [],
+      "dateRange": {
+        "dateRangeType": "none",
+        "dateEffectType": "start",
+        "year": "",
+        "month": "",
+        "date": "",
+        "season": 0,
+        "week": 0,
+        "adjust": 0,
+        "start": "",
+        "completed": ""
+      },
+      "creatorPersonList": [],
+      "creatorUnitList": [],
+      "creatorIdentityList": []
+    },
+    "noDataText" : "未找到数据",
+    "selectList": [],
+    "filterList": [],
+    "orderList": [],
+    "group": {},
+    "columnList": [],
+    "calculate": {},
+    "afterGridScriptText": "",
+    "afterGroupGridScriptText": "",
+    "afterCalculateGridScriptText": "",
+    "events": {
+      "queryLoad" : {
+        "code": "",
+        "html": ""
+      },
+      "postLoad": {
+        "code": "",
+        "html": ""
+      },
+      "postLoadPageData" : {
+        "code": "",
+        "html": ""
+      },
+      "postLoadPage": {
+        "code": "",
+        "html": ""
+      },
+      "queryLoadItemRow": {
+        "code": "",
+        "html": ""
+      },
+      "postLoadItemRow": {
+        "code": "",
+        "html": ""
+      },
+      "queryLoadCategoryRow": {
+        "code": "",
+        "html": ""
+      },
+      "postLoadCategoryRow": {
+        "code": "",
+        "html": ""
+      },
+      "selectRow" : {
+        "code": "",
+        "html": ""
+      },
+      "unselectRow" : {
+        "code": "",
+        "html": ""
+      }
+    }
+  },
+  "availableIdentityList": [],
+  "availableUnitList": []
+}

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


+ 9 - 0
o2web/source/x_component_query_InquiryDesigner/$Main/blank.html

@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script src="../o2_lib/mootools/mootools-core-1.4.5-full-nocompat.js"></script>
+</head>
+<body>
+111
+</body>
+</html>

+ 164 - 0
o2web/source/x_component_query_InquiryDesigner/$Main/default/css.wcss

@@ -0,0 +1,164 @@
+{
+	"propertyNode": {
+		"width": "320px",
+		"overflow": "hidden",
+		"float": "right",
+		"-webkit-user-select": "text",
+		"-moz-user-select": "text" 
+	},
+	"viewListNode": {
+        "width": "260px",
+        "overflow": "hidden",
+        "border": "1px solid #505050",
+        "height": "100%",
+        "float": "left",
+        "background-color": "#EEE"
+    },
+
+	"contentNode": {
+	    "margin-left": "261px",
+		"margin-right": "321px",
+		"border-right": "1px solid #505050",
+		"border-left": "1px solid #505050",
+		"background-color": "#FFF",
+		"-webkit-user-select": "none",
+		"-moz-user-select": "none" 
+	},
+
+    "viewListResizeNode": {
+        "width": "3px",
+        "float": "right",
+        "background-color": "#505050",
+        "margin-right": "2px",
+        "cursor": "col-resize"
+    },
+    "viewListAreaSccrollNode": {
+        "margin": "4px",
+        "margin-right": "8px",
+        "overflow": "hidden",
+        "background-color": "#FFF",
+        "border-top": "1px solid #999",
+        "border-left": "1px solid #999",
+        "border-bottom": "1px solid #DDD",
+        "border-right": "1px solid #DDD"
+    },
+    "viewListAreaNode": {
+        "overflow": "hidden"
+    },
+	"viewListTitleNode": {
+        "height": "26px",
+        "background-color": "#505050",
+        "border-radius": "0px",
+        "margin": "2px",
+        "color": "#FFF",
+        "line-height": "26px",
+        "font-size": "12px",
+        "font-weight": "bold",
+        "padding-left": "10px",
+        "clear": "both"
+    },
+
+
+    "listViewItem": {
+        "height": "24px",
+        "line-height": "24px",
+        "margin": "3px 10px 0px 10px",
+        "cursor": "pointer",
+        "background": "#FFF",
+        "color": "#333"
+    },
+    "listViewItem_over": {
+        "background": "#e8eef7"
+    },
+    "listViewItem_current": {
+        "background": "#48638f",
+        "color": "#FFF"
+    },
+    "listViewItemIcon": {
+        "height": "24px",
+        "width": "26px",
+        "background": "url("+"../x_component_query_ViewDesigner/$Main/default/view.png) no-repeat center center",
+        "float": "left"
+    },
+    "listViewItemText": {
+        "height": "24px",
+        "margin-left": "28px",
+        "white-space": "nowrap"
+    },
+
+
+	"contentToolbarNode": {
+		"height": "30px",
+		"background-color": "#EEE"
+	},
+	"editContentNode": {
+		"overflow": "hidden",
+		"background": "#CCC",
+		"-webkit-user-select": "none",
+		"-moz-user-select": "none" 
+	},
+	"designFrame": {
+		"width": "100%",
+		"height": "100%",
+		"border": "0px"
+	},
+	"designBody": {
+		"margin": "0px"
+	},
+	"designNode": {
+		//"height": "100%",
+		"margin": "15px",
+		"box-shadow": "0px 0px 20px #606060", 
+		"background": "#FFF",
+		"-webkit-user-select": "none",
+		"overflow": "hidden",
+		"background": "url("+"../x_component_process_ViewDesigner/$Main/default/designerBg.png)",
+		"-moz-user-select": "none" 
+	},
+	"propertyTitleNode": {
+		"height": "26px",
+		"background-color": "#505050",
+		"border-radius": "0px",
+		"margin": "2px",
+		"color": "#FFF",
+		"line-height": "26px",
+		"font-size": "12px",
+		"font-weight": "bold",
+		"padding-left": "10px",
+		"clear": "both"
+	},
+	"propertyResizeBar": {
+		"width": "3px",
+		"float": "left",
+		"background-color": "#505050",
+		"margin-left": "2px",
+		"cursor": "col-resize"
+	},
+	"propertyContentNode": {
+		"background-color": "#EEE",
+		"border-radius": "0px",
+		"margin": "2px",
+		"margin-left": "7px",
+		"padding-right": "0px",
+		"overflow": "hidden"
+	},
+	"propertyContentResizeNode": {
+		"height": "3px",
+		"background-color": "#505050",
+		"cursor": "row-resize"
+	},
+	"propertyDomArea": {
+		"overflow": "hidden",
+		"background": "#FFF",
+		"margin": "2px",
+		"font-family": "Verdana, Geneva, sans-serif",
+		"border-top": "1px solid #999",
+		"border-left": "1px solid #999",
+		"border-bottom": "1px solid #DDD",
+		"border-right": "1px solid #DDD"
+	},
+	"propertyContentArea": {
+		"overflow": "hidden",
+		"margin-bottom": "2px"
+	}
+}

+ 9 - 0
o2web/source/x_component_query_InquiryDesigner/$Main/default/designBlank.html

@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+	<script src="../../../../../../framework/mootools/mootools-core-1.4.5-full-nocompat.js"></script>
+</head>
+<body><div>111</div>
+</body>
+</html>

BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/designerBg.png


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


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/actionbar.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/attachment.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/button.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/calendar.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/checkbox.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/datagrid.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/div.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/html.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/htmleditor.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/iframe.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/image.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/label.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/layout.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/log.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/monitor.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/office.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/personfield.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/radio.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/select.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/table.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/tabs.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/textarea.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/textfield.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/tree.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/icon/tree1.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/left.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/right.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/formExplode.gif


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/formExplode_gray.gif


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/formImplode.gif


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/formImplode_gray.gif


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/help.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/preview.png


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/print.gif


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/print_gray.gif


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/save.gif


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/saveNew.gif


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/saveNew_gray.gif


BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbar/save_gray.gif


+ 18 - 0
o2web/source/x_component_query_InquiryDesigner/$Main/default/toolbars.html

@@ -0,0 +1,18 @@
+<div id="MWFFormToolbar">
+	<span MWFnodetype="MWFToolBarSeparator"></span>
+	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="save.gif" title="保存视图" MWFButtonAction="saveView" MWFButtonText=""></span>
+	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="saveNew.gif" title="视图另存为" MWFButtonAction="saveViewAs" MWFButtonText=""></span>
+	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="preview.png" title="预览" MWFButtonAction="preview" MWFButtonText=""></span>
+	<span MWFnodetype="MWFToolBarSeparator"></span>
+	
+	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="formExplode.gif" title="视图导出" MWFButtonAction="viewExplode" MWFButtonText=""></span>
+	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="formImplode.gif" title="视图导入" MWFButtonAction="viewImplode" MWFButtonText=""></span>
+
+    <span MWFnodetype="MWFToolBarSeparator"></span>
+	
+	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="help.png" title="帮助" MWFButtonAction="viewHelp" MWFButtonText=""></span>
+
+    <span MWFnodetype="MWFToolBarSeparator"></span>
+    <input type="checkbox" value="autoSave" id="MWFDictionaryAutoSaveCheck">自动保存
+	
+</div>

+ 120 - 0
o2web/source/x_component_query_InquiryDesigner/$Main/default/tools.json

@@ -0,0 +1,120 @@
+{
+  "label": {
+    "icon": "label.png",
+    "text": "文本",
+    "className": "Label"
+  },
+  "textfield": {
+    "icon": "textfield.png",
+    "text": "域",
+    "className": "Textfield"
+  },
+  "personfield": {
+    "icon": "personfield.png",
+    "text": "人员",
+    "className": "Personfield"
+  },
+  "calendar": {
+    "icon": "calendar.png",
+    "text": "日期选择",
+    "className": "Calendar"
+  },
+  "textarea": {
+    "icon": "textarea.png",
+    "text": "多行文本",
+    "className": "Textarea"
+  },
+  "select": {
+    "icon": "select.png",
+    "text": "下拉框",
+    "className": "Select"
+  },
+  "radio": {
+    "icon": "radio.png",
+    "text": "单选框",
+    "className": "Radio"
+  },
+  "checkbox": {
+    "icon": "checkbox.png",
+    "text": "多选框",
+    "className": "Checkbox"
+  },
+  "button": {
+    "icon": "button.png",
+    "text": "按钮",
+    "className": "Button"
+  },
+
+  "Actionbar": {
+    "icon": "actionbar.png",
+    "text": "操作条",
+    "className": "Actionbar"
+  },
+
+  "image": {
+    "icon": "image.png",
+    "text": "图片",
+    "className": "Image"
+  },
+  "image": {
+    "icon": "attachment.png",
+    "text": "附件",
+    "className": "Attachment"
+  },
+  "div": {
+    "icon": "div.png",
+    "text": "容器",
+    "className": "Div"
+  },
+  "table": {
+    "icon": "table.png",
+    "text": "表格",
+    "className": "Table"
+  },
+  "datagrid": {
+    "icon": "datagrid.png",
+    "text": "数据网格",
+    "className": "Datagrid"
+  },
+  "html": {
+    "icon": "html.png",
+    "text": "HTML",
+    "className": "Html"
+  },
+
+  "tab": {
+    "icon": "tabs.png",
+    "text": "分页",
+    "className": "Tab"
+  },
+  "tree": {
+    "icon": "tree.png",
+    "text": "树",
+    "className": "Tree"
+  },
+  "log": {
+    "icon": "log.png",
+    "text": "流程记录",
+    "className": "Log"
+  },
+  "monitor": {
+    "icon": "monitor.png",
+    "text": "流程监控",
+    "className": "Monitor"
+  },
+  "iframe": {
+    "icon": "iframe.png",
+    "text": "Iframe",
+    "className": "Iframe"
+  },
+  "htmledit": {
+    "icon": "htmleditor.png",
+    "text": "HTML编辑器",
+    "className": "Htmleditor"
+  },
+  "office": {
+    "icon": "office.png",
+    "text": "Office控件",
+    "className": "Office"
+  }
+}

BIN
o2web/source/x_component_query_InquiryDesigner/$Main/default/view.png


+ 591 - 0
o2web/source/x_component_query_InquiryDesigner/Inquiry.js

@@ -0,0 +1,591 @@
+MWF.xApplication = MWF.xApplication || {};
+MWF.xApplication.query = MWF.xApplication.query || {};
+MWF.xApplication.query.InquiryDesigner = MWF.xApplication.query.InquiryDesigner || {};
+
+MWF.APPDVD = MWF.xApplication.query.InquiryDesigner;
+MWF.require("MWF.widget.Common", null, false);
+MWF.require("MWF.xScript.Macro", null, false);
+
+MWF.APPISTD = MWF.xApplication.query.InquiryDesigner;
+
+MWF.xDesktop.requireApp("query.InquiryDesigner", "lp."+MWF.language, null, false);
+MWF.xDesktop.requireApp("query.ViewDesigner", "View", null, false);
+MWF.xDesktop.requireApp("query.InquiryDesigner", "Property", null, false);
+
+MWF.xApplication.query.InquiryDesigner.View = new Class({
+    Extends: MWF.xApplication.query.ViewDesigner.View,
+    Implements: [Options, Events],
+    options: {
+        "style": "default",
+        "isView": false,
+        "showTab": true,
+        "propertyPath": "../x_component_query_InquiryDesigner/$View/view.html"
+    },
+
+    initialize: function(designer, data, options){
+        this.setOptions(options);
+
+        this.path = "../x_component_query_InquiryDesigner/$View/";
+        this.cssPath = "../x_component_query_InquiryDesigner/$View/"+this.options.style+"/css.wcss";
+
+        this._loadCss();
+
+        this.designer = designer;
+        this.data = data;
+
+        if (!this.data.data) this.data.data = {};
+        this.parseData();
+
+        this.node = this.designer.designNode;
+        //this.tab = this.designer.tab;
+
+        this.areaNode = new Element("div", {"styles": {"height": "100%", "overflow": "auto"}});
+
+        //MWF.require("MWF.widget.ScrollBar", function(){
+        //    new MWF.widget.ScrollBar(this.areaNode, {"distance": 100});
+        //}.bind(this));
+
+
+        this.propertyListNode = this.designer.propertyDomArea;
+        //this.propertyNode = this.designer.propertyContentArea;
+
+        if(this.designer.application) this.data.applicationName = this.designer.application.name;
+        if(this.designer.application) this.data.application = this.designer.application.id;
+
+        this.isNewView = (this.data.name) ? false : true;
+
+        this.items = [];
+        this.view = this;
+
+        this.autoSave();
+        this.designer.addEvent("queryClose", function(){
+            if (this.autoSaveTimerID) window.clearInterval(this.autoSaveTimerID);
+        }.bind(this));
+    },
+    parseData: function(){
+        this.json = this.data;
+        if( !this.json.data.events ){
+            var url = "../x_component_query_InquiryDesigner/$View/view.json";
+            MWF.getJSON(url, {
+                "onSuccess": function(obj){
+                    this.json.data.events = obj.data.events;
+                }.bind(this),
+                "onerror": function(text){
+                    this.notice(text, "error");
+                }.bind(this),
+                "onRequestFailure": function(xhr){
+                    this.notice(xhr.responseText, "error");
+                }.bind(this)
+            },false);
+        }
+    },
+
+    showProperty: function(){
+        if (!this.property){
+            this.property = new MWF.xApplication.query.InquiryDesigner.Property(this, this.designer.propertyContentArea, this.designer, {
+                "path": this.options.propertyPath,
+                "onPostLoad": function(){
+                    this.property.show();
+                }.bind(this)
+            });
+            this.property.load();
+        }else{
+            this.property.show();
+        }
+    },
+    hideProperty: function(){
+        if (this.property) this.property.hide();
+    },
+
+    loadViewData: function(){
+        if (this.data.id){
+            this.saveSilence(function(){
+                this.viewContentBodyNode.empty();
+                this.viewContentTableNode = new Element("table", {
+                    "styles": this.css.viewContentTableNode,
+                    "border": "0px",
+                    "cellPadding": "0",
+                    "cellSpacing": "0"
+                }).inject(this.viewContentBodyNode);
+
+                this.designer.actions.loadView(this.data.id, null,function(json){
+                    var entries = {};
+
+                    json.data.selectList.each(function(entry){entries[entry.column] = entry;}.bind(this));
+
+                    if (this.json.data.group.column){
+                        if (json.data.groupGrid.length){
+                            var groupColumn = null;
+                            for (var c = 0; c<json.data.selectList.length; c++){
+                                if (json.data.selectList[c].column === json.data.group.column){
+                                    groupColumn = json.data.selectList[c];
+                                    break;
+                                }
+                            }
+
+                            json.data.groupGrid.each(function(line, idx){
+                                var groupTr = new Element("tr", {
+                                    "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTr"] : this.css.viewContentTrNode,
+                                    "data-is-group" : "yes"
+                                }).inject(this.viewContentTableNode);
+                                var colSpan = this.items.length ;
+                                var td = new Element("td", {
+                                    "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentGroupTd"] : this.css.viewContentGroupTdNode,
+                                    "colSpan": colSpan
+                                }).inject(groupTr);
+
+                                var groupAreaNode;
+                                if( this.json.data.viewStyles ){
+                                    groupAreaNode = new Element("div", {"styles": this.json.data.viewStyles["groupCollapseNode"]}).inject(td);
+                                    groupAreaNode.set("text", line.group);
+                                }else{
+                                    groupAreaNode = new Element("div", {"styles": this.css.viewContentTdGroupNode}).inject(td);
+                                    var groupIconNode = new Element("div", {"styles": this.css.viewContentTdGroupIconNode}).inject(groupAreaNode);
+                                    var groupTextNode = new Element("div", {"styles": this.css.viewContentTdGroupTextNode}).inject(groupAreaNode);
+                                    if (groupColumn){
+                                        //groupTextNode.set("text", (groupColumn.code) ? MWF.Macro.exec(groupColumn.code, {"value": line.group, "gridData": json.data.groupGrid, "data": json.data, "entry": line}) : line.group);
+                                        groupTextNode.set("text", line.group);
+                                    }else{
+                                        groupTextNode.set("text", line.group);
+                                    }
+
+                                }
+
+
+
+                                var subtrs = [];
+
+                                line.list.each(function(entry){
+                                    var tr = new Element("tr", {
+                                        "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTr"] : this.css.viewContentTrNode
+                                    }).inject(this.viewContentTableNode);
+                                    tr.setStyle("display", "none");
+
+                                    //this.createViewCheckboxTd( tr );
+
+                                    var td = new Element("td", {
+                                        "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTd"] : this.css.viewContentTdNode
+                                    }).inject(tr);
+
+                                    Object.each(entries, function(c, k){
+                                        var d = entry.data[k];
+                                        if (d!=undefined){
+                                            if (k!=this.json.data.group.column){
+                                                var td = new Element("td", {
+                                                    "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTd"] : this.css.viewContentTdNode
+                                                }).inject(tr);
+                                                //td.set("text", (entries[k].code) ? MWF.Macro.exec(entries[k].code, {"value": d, "gridData": json.data.groupGrid, "data": json.data, "entry": entry}) : d);
+
+                                                if (c.isHtml){
+                                                    td.set("html", d);
+                                                }else{
+                                                    td.set("text", d);
+                                                }
+
+                                            }
+                                        }
+                                    }.bind(this));
+
+                                    // Object.each(entry.data, function(d, k){
+                                    //     if (k!=this.json.data.group.column){
+                                    //         var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
+                                    //         td.set("text", (entries[k].code) ? MWF.Macro.exec(entries[k].code, {"value": d, "gridData": json.data.groupGrid, "data": json.data, "entry": entry}) : d);
+                                    //     }
+                                    // }.bind(this));
+                                    subtrs.push(tr)
+                                }.bind(this));
+
+                                groupAreaNode.store("subtrs", subtrs);
+
+                                var _self = this;
+                                groupAreaNode.addEvent("click", function(){
+                                    var subtrs = this.retrieve("subtrs");
+                                    var iconNode = groupAreaNode.getFirst("div");
+                                    if (subtrs[0]){
+                                        if (subtrs[0].getStyle("display")=="none"){
+                                            subtrs.each(function(subtr){ subtr.setStyle("display", "table-row"); });
+                                            if( iconNode ) {
+                                                iconNode.setStyle("background", "url(" + "../x_component_process_InquiryDesigner/$View/default/icon/down.png) center center no-repeat");
+                                            }else{
+                                                this.setStyles( _self.json.data.viewStyles["groupExpandNode"] )
+                                            }
+                                        }else{
+                                            subtrs.each(function(subtr){ subtr.setStyle("display", "none"); });
+                                            if( iconNode ) {
+                                                iconNode.setStyle("background", "url(" + "../x_component_process_InquiryDesigner/$View/default/icon/right.png) center center no-repeat");
+                                            }else{
+                                                this.setStyles( _self.json.data.viewStyles["groupCollapseNode"] )
+                                            }
+                                        }
+                                    }
+                                    _self.setContentHeight();
+                                });
+                            }.bind(this));
+                            this.setContentColumnWidth();
+                            this.setContentHeight();
+                        }else if(this.json.data.noDataText){
+                            var noDataTextNodeStyle = this.css.noDataTextNode;
+                            if( this.json.data.viewStyles ){
+                                if( this.json.data.viewStyles["noDataTextNode"] ){
+                                    noDataTextNodeStyle = this.json.data.viewStyles["noDataTextNode"]
+                                }else{
+                                     this.json.data.viewStyles["noDataTextNode"] = this.css.noDataTextNode
+                                }
+                            }
+                            this.noDataTextNode = new Element( "div", {
+                                "styles": noDataTextNodeStyle,
+                                "text" : this.json.data.noDataText
+                            }).inject( this.viewContentBodyNode );
+                        }
+
+                    }else{
+
+                        if (json.data.grid.length){
+                            json.data.grid.each(function(line, idx){
+                                var tr = new Element("tr", {
+                                    "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTr"] : this.css.viewContentTrNode
+                                }).inject(this.viewContentTableNode);
+
+                                //this.createViewCheckboxTd( tr );
+
+                                Object.each(entries, function(c, k){
+                                    var d = line.data[k];
+                                    if (d!=undefined){
+                                        var td = new Element("td", {
+                                            "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTd"] : this.css.viewContentTdNode
+                                        }).inject(tr);
+                                        //td.set("text", (entries[k].code) ? MWF.Macro.exec(entries[k].code, {"value": d, "gridData": json.data.grid, "data": json.data, "entry": line}) : d);
+                                        if (c.isHtml){
+                                            td.set("html", d);
+                                        }else{
+                                            td.set("text", d);
+                                        }
+                                        //td.set("text", d);
+                                    }
+                                }.bind(this));
+
+                                // Object.each(line.data, function(d, k){
+                                //     var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
+                                //     td.set("text", (entries[k].code) ? MWF.Macro.exec(entries[k].code, {"value": d, "gridData": json.data.grid, "data": json.data, "entry": line}) : d);
+                                // }.bind(this));
+                            }.bind(this));
+                            this.setContentColumnWidth();
+                            this.setContentHeight();
+                        }else if(this.json.data.noDataText){
+                            var noDataTextNodeStyle = this.css.noDataTextNode;
+                            if( this.json.data.viewStyles ){
+                                if( this.json.data.viewStyles["noDataTextNode"] ){
+                                    noDataTextNodeStyle = this.json.data.viewStyles["noDataTextNode"]
+                                }else{
+                                    this.json.data.viewStyles["noDataTextNode"] = this.css.noDataTextNode
+                                }
+                            }
+                            this.noDataTextNode = new Element( "div", {
+                                "styles": noDataTextNodeStyle,
+                                "text" : this.json.data.noDataText
+                            }).inject( this.viewContentBodyNode );
+                        }
+                    }
+                }.bind(this));
+            }.bind(this));
+        }
+    },
+    addColumn: function(){
+
+        debugger;
+
+        MWF.require("MWF.widget.UUID", function(){
+            var id = (new MWF.widget.UUID).id;
+            var json = {
+                "id": id,
+                "column": id,
+                "displayName": this.designer.lp.unnamed,
+                "orderType": "original"
+            };
+            if (!this.json.data.selectList) this.json.data.selectList = [];
+            this.json.data.selectList.push(json);
+            var column = new MWF.xApplication.query.InquiryDesigner.View.Column(json, this);
+            this.items.push(column);
+            column.selected();
+
+            if (this.viewContentTableNode){
+                var trs = this.viewContentTableNode.getElements("tr");
+                trs.each(function(tr){
+                    new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr)
+                }.bind(this));
+                //this.setContentColumnWidth();
+            }
+            this.setViewWidth();
+            this.addColumnNode.scrollIntoView(true);
+
+        }.bind(this));
+        //new Fx.Scroll(this.view.areaNode, {"wheelStops": false, "duration": 0}).toRight();
+    },
+    unSelected: function(){
+        this.currentSelectedModule = null;
+        this.hideProperty();
+    },
+    loadViewColumns: function(){
+    //    for (var i=0; i<10; i++){
+        if (this.json.data.selectList) {
+            this.json.data.selectList.each(function (json) {
+                this.items.push(new MWF.xApplication.query.InquiryDesigner.View.Column(json, this));
+
+            }.bind(this));
+        }
+    //    }
+    },
+    showActionbar : function( noSetHeight ){
+        this.actionbarNode.show();
+        if( !this.json.data.actionbarList )this.json.data.actionbarList = [];
+        if( !this.actionbarList || this.actionbarList.length == 0 ){
+            if( this.json.data.actionbarList.length ){
+                this.json.data.actionbarList.each( function(json){
+                    this.actionbarList.push( new MWF.xApplication.query.InquiryDesigner.View.Actionbar( json, this.json.data.actionbarList, this) )
+                }.bind(this));
+            }else{
+                this.actionbarList.push( new MWF.xApplication.query.InquiryDesigner.View.Actionbar( null, this.json.data.actionbarList, this) )
+            }
+        }
+        if( !noSetHeight )this.setContentHeight();
+    },
+    loadPaging: function( noSetHeight ){
+        this.pagingNode = new Element("div#pagingNode", {"styles": this.css.pagingNode}).inject(this.areaNode);
+        this.pagingList = [];
+        if( !this.json.data.pagingList )this.json.data.pagingList = [];
+        if( !this.pagingList || this.pagingList.length == 0 ){
+            if( this.json.data.pagingList.length ){
+                this.json.data.pagingList.each( function(json){
+                    this.pagingList.push( new MWF.xApplication.query.InquiryDesigner.View.Paging( json, this.json.data.pagingList, this) )
+                }.bind(this));
+            }else{
+                this.pagingList.push( new MWF.xApplication.query.InquiryDesigner.View.Paging( null, this.json.data.pagingList, this) )
+            }
+        }
+        // if( !noSetHeight )this.setContentHeight();
+    },
+    setViewWidth: function(){
+        if( !this.viewAreaNode )return;
+        this.viewAreaNode.setStyle("width", "auto");
+        this.viewTitleNode.setStyle("width", "auto");
+
+        var s1 = this.viewTitleTableNode.getSize();
+        var s2 = this.refreshNode.getSize();
+        var s3 = this.addColumnNode.getSize();
+        var width = s1.x+s2.x+s2.x;
+        var size = this.areaNode.getSize();
+
+        if (width>size.x){
+            this.viewTitleNode.setStyle("width", ""+width+"px");
+            this.viewAreaNode.setStyle("width", ""+width+"px");
+        }else{
+            this.viewTitleNode.setStyle("width", ""+size.x+"px");
+            this.viewAreaNode.setStyle("width", ""+size.x+"px");
+        }
+        this.setContentColumnWidth();
+        this.setContentHeight();
+    },
+
+
+    preview: function(){
+        if( this.isNewView ){
+            this.designer.notice( this.designer.lp.saveViewNotice, "error" );
+            return;
+        }
+        this.saveSilence( function () {
+            var url = "../x_desktop/app.html?app=query.Query&status=";
+            url += JSON.stringify({
+                id : this.data.application,
+                viewId : this.data.id
+            });
+            window.open(o2.filterUrl(url),"_blank");
+        }.bind(this));
+    },
+    saveSilence: function(callback){
+        if (!this.data.name){
+            this.designer.notice(this.designer.lp.notice.inputName, "error");
+            return false;
+        }
+
+        this.designer.actions.saveView(this.data, function(json){
+            this.data.id = json.data.id;
+            this.isNewView = false;
+            //this.page.textNode.set("text", this.data.name);
+            if (this.lisNode) {
+                this.lisNode.getLast().set("text", this.data.name+"("+this.data.alias+")");
+            }
+            if (callback) callback();
+        }.bind(this));
+    },
+    save: function(callback){
+        //if (this.designer.tab.showPage==this.page){
+            if (!this.data.name){
+                this.designer.notice(this.designer.lp.notice.inputName, "error");
+                return false;
+            }
+        //}
+        this.designer.actions.saveView(this.data, function(json){
+            this.designer.notice(this.designer.lp.notice.save_success, "success", this.node, {"x": "left", "y": "bottom"});
+            this.isNewView = false;
+            this.data.id = json.data.id;
+            //this.page.textNode.set("text", this.data.name);
+            if (this.lisNode) {
+                this.lisNode.getLast().set("text", this.data.name+"("+this.data.alias+")");
+            }
+            if (callback) callback();
+        }.bind(this));
+    },
+    _setEditStyle: function(name, input, oldValue){
+        if (name=="type"){
+            this.items.each(function(item){
+                if (item.property){
+                    var processDiv = item.property.propertyContent.getElements("#"+item.json.id+"dataPathSelectedProcessArea");
+                    var cmsDiv = item.property.propertyContent.getElements("#"+item.json.id+"dataPathSelectedCMSArea");
+                    if (this.json[name]=="cms"){
+                        cmsDiv.setStyle("display", "block");
+                        processDiv.setStyle("display", "none");
+                    }else{
+                        cmsDiv.setStyle("display", "none");
+                        processDiv.setStyle("display", "block");
+                    }
+                }
+            }.bind(this));
+        }
+        if( name=="data.actionbarHidden" ){
+            if( this.json.data.actionbarHidden ){
+                this.hideActionbar()
+            }else{
+                this.showActionbar()
+            }
+        }
+        if( name=="data.selectAllEnable" ){
+            if( this.json.data.selectAllEnable ){
+                this.viewTitleTrNode.getElement(".viewTitleCheckboxTd").setStyle("display","table-cell");
+                this.viewContentTableNode.getElements(".viewContentCheckboxTd").setStyle("display","table-cell");
+            }else{
+                this.viewTitleTrNode.getElement(".viewTitleCheckboxTd").setStyle("display","none");
+                this.viewContentTableNode.getElements(".viewContentCheckboxTd").setStyle("display","none");
+            }
+        }
+        if (name=="data.viewStyleType"){
+
+            var file = (this.stylesList && this.json.data.viewStyleType) ? this.stylesList[this.json.data.viewStyleType].file : null;
+            var extendFile = (this.stylesList && this.json.data.viewStyleType) ? this.stylesList[this.json.data.viewStyleType].extendFile : null;
+            this.loadTemplateStyles( file, extendFile, function( templateStyles ){
+                this.templateStyles = templateStyles;
+
+                var oldFile, oldExtendFile;
+                if( oldValue && this.stylesList[oldValue] ){
+                    oldFile = this.stylesList[oldValue].file;
+                    oldExtendFile = this.stylesList[oldValue].extendFile;
+                }
+                this.loadTemplateStyles( oldFile, oldExtendFile, function( oldTemplateStyles ){
+
+                    this.json.data.styleConfig = (this.stylesList && this.json.data.viewStyleType) ? this.stylesList[this.json.data.viewStyleType] : null;
+
+                    if (oldTemplateStyles["view"]) this.clearTemplateStyles(oldTemplateStyles["view"]);
+                    if (this.templateStyles["view"]) this.setTemplateStyles(this.templateStyles["view"]);
+                    this.setAllStyles();
+
+                    this.actionbarList.each( function (module) {
+                            if (oldTemplateStyles["actionbar"]){
+                                module.clearTemplateStyles(oldTemplateStyles["actionbar"]);
+                            }
+                            module.setStyleTemplate();
+                            module.setAllStyles();
+                    })
+
+                    this.pagingList.each( function (module) {
+                        if (oldTemplateStyles["paging"]){
+                            module.clearTemplateStyles(oldTemplateStyles["paging"]);
+                        }
+                        module.setStyleTemplate();
+                        module.setAllStyles();
+                    });
+
+                    // this.moduleList.each(function(module){
+                    //     if (oldTemplateStyles[module.moduleName]){
+                    //         module.clearTemplateStyles(oldTemplateStyles[module.moduleName]);
+                    //     }
+                    //     module.setStyleTemplate();
+                    //     module.setAllStyles();
+                    // }.bind(this));
+                }.bind(this))
+
+            }.bind(this))
+        }
+        if (name=="data.viewStyles"){
+            this.setCustomStyles();
+        }
+    },
+    removeStyles: function(from, to){
+        if (this.json.data.viewStyles[to]){
+            Object.each(from, function(style, key){
+                if (this.json.data.viewStyles[to][key] && this.json.data.viewStyles[to][key]==style){
+                    delete this.json.data.viewStyles[to][key];
+                }
+            }.bind(this));
+        }
+    },
+    copyStyles: function(from, to){
+        if (!this.json.data.viewStyles[to]) this.json.data.viewStyles[to] = {};
+        Object.each(from, function(style, key){
+            if (!this.json.data.viewStyles[to][key]) this.json.data.viewStyles[to][key] = style;
+        }.bind(this));
+    },
+
+    saveAs: function(){
+        var form = new MWF.xApplication.query.InquiryDesigner.View.NewNameForm(this, {
+            name : this.data.name + "_" + MWF.xApplication.query.InquiryDesigner.LP.copy,
+            query : this.data.query || this.data.application,
+            queryName :	this.data.queryName || this.data.applicationName
+        }, {
+            onSave : function( data, callback ){
+                this._saveAs( data, callback );
+            }.bind(this)
+        }, {
+            app: this.designer
+        });
+        form.edit()
+    },
+    _saveAs : function( data , callback){
+        var _self = this;
+
+        var d = this.cloneObject( this.data );
+
+        d.isNewView = true;
+        d.id = this.designer.actions.getUUID();
+        d.name = data.name;
+        d.alias = "";
+        d.query = data.query;
+        d.queryName = data.queryName;
+        d.application = data.query;
+        d.applicationName = data.queryName;
+        d.pid = d.id + d.id;
+
+        delete d[this.data.id+"viewFilterType"];
+        d[d.id+"viewFilterType"]="custom";
+
+        d.data.selectList.each( function( entry ){
+            entry.id = (new MWF.widget.UUID).id;
+        }.bind(this));
+
+        this.designer.actions.saveView(d, function(json){
+            this.designer.notice(this.designer.lp.notice.saveAs_success, "success", this.node, {"x": "left", "y": "bottom"});
+            if (callback) callback();
+        }.bind(this));
+    }
+
+});
+
+MWF.xApplication.query.InquiryDesigner.View.Column = new Class({
+    Extends: MWF.xApplication.query.ViewDesigner.View.Column
+});
+
+MWF.xApplication.query.InquiryDesigner.View.Actionbar = new Class({
+    Extends: MWF.xApplication.query.ViewDesigner.View.Actionbar
+});
+
+MWF.xApplication.query.InquiryDesigner.View.Paging = new Class({
+    Extends: MWF.xApplication.query.ViewDesigner.View.Paging
+});

+ 809 - 0
o2web/source/x_component_query_InquiryDesigner/Main.js

@@ -0,0 +1,809 @@
+MWF.xApplication.query.InquiryDesigner =MWF.xApplication.query.InquiryDesigner || {};
+MWF.APPDIQD = MWF.xApplication.query.InquiryDesigner;
+MWF.APPDIQD.options = {
+	"multitask": true,
+	"executable": false
+};
+MWF.xDesktop.requireApp("query.InquiryDesigner", "Inquiry", null, false);
+MWF.xApplication.query.InquiryDesigner.Main = new Class({
+	Extends: MWF.xApplication.Common.Main,
+	Implements: [Options, Events],
+	options: {
+		"style": "default",
+		"name": "query.InquiryDesigner",
+		"icon": "icon.png",
+		"title": MWF.APPDIQD.LP.title,
+		"appTitle": MWF.APPDIQD.LP.title,
+		"id": "",
+		"actions": null,
+		"category": null
+	},
+	onQueryLoad: function(){
+        this.shortcut = true;
+        if (this.status){
+            this.options.application = this.status.applicationId;
+            this.application = this.status.application;
+            this.options.id = this.status.id;
+        }
+
+		if (!this.options.id){
+			this.options.desktopReload = false;
+			this.options.title = this.options.title + "-"+MWF.APPDIQD.LP.title;
+		}
+		if (!this.actions) this.actions = MWF.Actions.get("x_query_assemble_designer");
+		
+		this.lp = MWF.xApplication.query.InquiryDesigner.LP;
+
+        this.addEvent("queryClose", function(e){
+            if (this.explorer){
+                this.explorer.reload();
+            }
+        }.bind(this));
+        this.addEvent("postLoadWindowMax", function(e){
+            this.loadWindowOk = true;
+            if (this.loadApplicationOk && this.loadWindowOk){
+                //if (this.tab.showPage) {
+                //    var view = this.tab.showPage.view;
+                //    if (view) {
+                        this.view.setViewWidth();
+                //    }
+                //}
+            }
+        }.bind(this));
+        this.addEvent("postLoadApplication", function(e){
+            this.loadApplicationOk = true;
+            if (this.loadApplicationOk && this.loadWindowOk){
+                //if (this.tab.showPage) {
+                //    var view = this.tab.showPage.view;
+                //    if (view) {
+                        this.view.setViewWidth();
+                //    }
+                //}
+            }
+        }.bind(this));
+	},
+	
+	loadApplication: function(callback){
+		this.createNode();
+		if (!this.options.isRefresh){
+			this.maxSize(function(){
+				this.openView(function(){
+                    if (callback) callback();
+                });
+			}.bind(this));
+		}else{
+			this.openView(function(){
+                if (callback) callback();
+            });
+		}
+
+        if (!this.options.readMode) this.addKeyboardEvents();
+	},
+    keySave: function(e){
+        if (this.shortcut) {
+            //if (this.tab.showPage) {
+            //    var view = this.tab.showPage.view;
+            //    if (view) {
+                    this.view.save();
+                    e.preventDefault();
+            //    }
+            //}
+        }
+    },
+    keyDelete: function(){
+        if (this.shortcut) {
+            //if (this.tab.showPage) {
+                //var view = this.tab.showPage.view;
+                //if (view) {
+                    if (this.view.currentSelectedModule) {
+                        var item = this.view.currentSelectedModule;
+                        item["delete"]();
+                    }
+                //}
+            //}
+        }
+    },
+
+    copyModule: function(){
+        if (this.shortcut) {
+            //if (this.tab.showPage) {
+                //var view = this.tab.showPage.view;
+                //if (view) {
+                    if (this.view.currentSelectedModule) {
+                        var item = this.view.currentSelectedModule;
+                        MWF.clipboard.data = {
+                            "type": "view",
+                            "data": item.json
+                        };
+                    }
+                //}
+            //}
+        }
+    },
+    cutModule: function(){
+        if (this.shortcut) {
+            //if (this.tab.showPage) {
+                //var view = this.tab.showPage.view;
+                //if (view) {
+                    if (this.view.currentSelectedModule) {
+                        this.copyModule();
+                        var item = this.view.currentSelectedModule;
+                        item.destroy();
+                    }
+                //}
+            //}
+        }
+    },
+    pasteModule: function(){
+        if (this.shortcut) {
+            if (MWF.clipboard.data) {
+                if (MWF.clipboard.data.type == "view") {
+                    //if (this.tab.showPage) {
+                        //var view = this.tab.showPage.view;
+                        //if (view) {
+                            if (this.view.currentSelectedModule) {
+                                var item = this.view.currentSelectedModule;
+                                var data = MWF.clipboard.data.data;
+
+                                item.addColumn(null, data);
+                            }
+                        //}
+                    //}
+                }
+            }
+        }
+    },
+
+	createNode: function(){
+		this.content.setStyle("overflow", "hidden");
+		this.node = new Element("div", {
+			"styles": {"width": "100%", "height": "100%", "overflow": "hidden"}
+		}).inject(this.content);
+	},
+    getApplication:function(callback){
+        if (!this.application){
+            this.actions.getApplication(this.options.application, function(json){
+                this.application = {"name": json.data.name, "id": json.data.id};
+                if (callback) callback();
+            }.bind(this));
+        }else{
+            if (callback) callback();
+        }
+    },
+	openView: function(callback){
+        this.getApplication(function(){
+            this.initOptions();
+            this.loadNodes();
+            this.loadViewListNodes();
+            //	this.loadToolbar();
+            this.loadContentNode();
+            this.loadProperty();
+            //	this.loadTools();
+            this.resizeNode();
+            this.addEvent("resize", this.resizeNode.bind(this));
+            this.loadView(function(){
+                if (callback) callback();
+            });
+
+            this.setScrollBar(this.propertyDomArea, null, {
+                "V": {"x": 0, "y": 0},
+                "H": {"x": 0, "y": 0}
+            });
+        }.bind(this));
+	},
+	initOptions: function(){
+		//this.toolsData = null;
+		//this.toolbarMode = "all";
+		//this.tools = [];
+		//this.toolbarDecrease = 0;
+		//
+		//this.designNode = null;
+		//this.form = null;
+	},
+	loadNodes: function(){
+        this.viewListNode = new Element("div", {
+            "styles": this.css.viewListNode
+        }).inject(this.node);
+		this.propertyNode = new Element("div", {
+			"styles": this.css.propertyNode
+		}).inject(this.node);
+		this.contentNode = new Element("div", {
+			"styles": this.css.contentNode
+		}).inject(this.node);
+	},
+
+    //loadViewListNodes-------------------------------
+    loadViewListNodes: function(){
+        this.viewListTitleNode = new Element("div", {
+            "styles": this.css.viewListTitleNode,
+            "text": MWF.APPDIQD.LP.view
+        }).inject(this.viewListNode);
+
+        this.viewListResizeNode = new Element("div", {"styles": this.css.viewListResizeNode}).inject(this.viewListNode);
+        this.viewListAreaSccrollNode = new Element("div", {"styles": this.css.viewListAreaSccrollNode}).inject(this.viewListNode);
+        this.viewListAreaNode = new Element("div", {"styles": this.css.viewListAreaNode}).inject(this.viewListAreaSccrollNode);
+
+        this.loadViewListResize();
+
+        this.loadViewList();
+    },
+
+    loadViewListResize: function(){
+        this.viewListResize = new Drag(this.viewListResizeNode,{
+            "snap": 1,
+            "onStart": function(el, e){
+                var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x;
+                var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
+                el.store("position", {"x": x, "y": y});
+
+                var size = this.viewListAreaSccrollNode.getSize();
+                el.store("initialWidth", size.x);
+            }.bind(this),
+            "onDrag": function(el, e){
+                var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x;
+//				var y = e.event.y;
+                var bodySize = this.content.getSize();
+                var position = el.retrieve("position");
+                var initialWidth = el.retrieve("initialWidth").toFloat();
+                var dx = x.toFloat() - position.x.toFloat();
+
+                var width = initialWidth+dx;
+                if (width> bodySize.x/2) width =  bodySize.x/2;
+                if (width<40) width = 40;
+                this.contentNode.setStyle("margin-left", width+1);
+                this.viewListNode.setStyle("width", width);
+                //this.tab.pages.each(function(page){
+                (this.view || this.table).setViewWidth();
+                //});
+            }.bind(this)
+        });
+        this.viewListResizeNode.addEvents({
+            "touchstart": function(e){
+                el = e.target;
+                var x = (Browser.name=="firefox") ? e.page.clientX : e.page.x;
+                var y = (Browser.name=="firefox") ? e.page.clientY : e.page.y;
+                el.store("position", {"x": x, "y": y});
+
+                var size = this.viewListAreaSccrollNode.getSize();
+                el.store("initialWidth", size.x);
+            }.bind(this),
+            "touchmove": function(e){
+                //Object.each(e, function(v, k){
+                //    alert(k+": "+ v);
+                //});
+                el = e.target;
+
+                var x = (Browser.name=="firefox") ? e.page.clientX : e.page.x;
+//				var y = e.event.y;
+                var bodySize = this.content.getSize();
+                var position = el.retrieve("position");
+                var initialWidth = el.retrieve("initialWidth").toFloat();
+                var dx = x.toFloat() - position.x.toFloat();
+
+                var width = initialWidth+dx;
+                if (width> bodySize.x/2) width =  bodySize.x/2;
+                if (width<40) width = 40;
+                this.contentNode.setStyle("margin-left", width+1);
+                this.viewListNode.setStyle("width", width);
+                //this.tab.pages.each(function(page){
+                (this.view || this.table).setViewWidth();
+                //});
+            }.bind(this)
+        });
+
+    },
+
+    loadViewList: function(){
+        this.actions.listView(this.application.id, function (json) {
+            json.data.each(function(view){
+                this.createListViewItem(view);
+            }.bind(this));
+        }.bind(this), null, false);
+    },
+
+    //列示所有视图列表
+    createListViewItem: function(view, isNew){
+        var _self = this;
+        var listViewItem = new Element("div", {"styles": this.css.listViewItem}).inject(this.viewListAreaNode, (isNew) ? "top": "bottom");
+        var listViewItemIcon = new Element("div", {"styles": this.css.listViewItemIcon}).inject(listViewItem);
+        var listViewItemText = new Element("div", {"styles": this.css.listViewItemText, "text": (view.name) ? view.name+" ("+view.alias+")" : this.lp.newView}).inject(listViewItem);
+
+        listViewItem.store("view", view);
+        listViewItem.addEvents({
+            "dblclick": function(e){_self.loadViewByData(this, e);},
+            "mouseover": function(){if (_self.currentListViewItem!=this) this.setStyles(_self.css.listViewItem_over);},
+            "mouseout": function(){if (_self.currentListViewItem!=this) this.setStyles(_self.css.listViewItem);}
+        });
+    },
+    //打开视图
+    loadViewByData: function(node, e){
+        var view = node.retrieve("view");
+        if (!view.isNewView){
+            var openNew = true;
+            //for (var i = 0; i<this.tab.pages.length; i++){
+            //    if (view.id==this.tab.pages[i].view.data.id){
+            //        this.tab.pages[i].showTabIm();
+            //        openNew = false;
+            //        break;
+            //    }
+            //}
+            if (openNew){
+                //this.loadViewData(view.id, function(vdata){
+                //    var view = new MWF.xApplication.process.InquiryDesigner.View(this, vdata);
+                //    view.load();
+                //}.bind(this));
+
+                var _self = this;
+
+                var options = {
+                    "appId": "query.InquiryDesigner"+view.id,
+                    "onQueryLoad": function(){
+                        this.actions = _self.actions;
+                        this.category = _self;
+                        this.options.id = view.id;
+                        this.application = _self.application;
+                        this.explorer = _self.explorer;
+                    }
+                };
+                this.desktop.openApplication(e, "query.InquiryDesigner", options);
+            }
+        }
+    },
+
+
+	//loadContentNode------------------------------
+    loadContentNode: function(){
+		this.contentToolbarNode = new Element("div", {
+			"styles": this.css.contentToolbarNode
+		}).inject(this.contentNode);
+		if (!this.options.readMode) this.loadContentToolbar();
+		
+		this.editContentNode = new Element("div", {
+			"styles": this.css.editContentNode
+		}).inject(this.contentNode);
+
+		this.loadEditContent(function(){
+		//	if (this.designDcoument) this.designDcoument.body.setStyles(this.css.designBody);
+			if (this.designNode) this.designNode.setStyles(this.css.designNode);
+		}.bind(this));
+	},
+    loadContentToolbar: function(callback){
+		this.getFormToolbarHTML(function(toolbarNode){
+			var spans = toolbarNode.getElements("span");
+			spans.each(function(item, idx){
+				var img = item.get("MWFButtonImage");
+				if (img){
+					item.set("MWFButtonImage", this.path+""+this.options.style+"/toolbar/"+img);
+				}
+			}.bind(this));
+
+			$(toolbarNode).inject(this.contentToolbarNode);
+			MWF.require("MWF.widget.Toolbar", function(){
+				this.toolbar = new MWF.widget.Toolbar(toolbarNode, {"style": "ProcessCategory"}, this);
+				this.toolbar.load();
+                if (this.table) if (this.table.checkToolbars) this.table.checkToolbars();
+				if (callback) callback();
+			}.bind(this));
+		}.bind(this));
+	},
+	getFormToolbarHTML: function(callback){
+		var toolbarUrl = this.path+this.options.style+"/toolbars.html";
+		var r = new Request.HTML({
+			url: toolbarUrl,
+			method: "get",
+			onSuccess: function(responseTree, responseElements, responseHTML, responseJavaScript){
+				var toolbarNode = responseTree[0];
+				if (callback) callback(toolbarNode);
+			}.bind(this),
+			onFailure: function(xhr){
+				this.notice("request processToolbars error: "+xhr.responseText, "error");
+			}.bind(this)
+		});
+		r.send();
+	},
+    maxOrReturnEditor: function(){
+        if (!this.isMax){
+            this.designNode.inject(this.node);
+            this.designNode.setStyles({
+                "position": "absolute",
+                "width": "100%",
+                "height": "100%",
+                "top": "0px",
+                "margin": "0px",
+                "left": "0px"
+            });
+            //this.tab.pages.each(function(page){
+                this.view.setAreaNodeSize();
+            //});
+            this.isMax = true;
+        }else{
+            this.isMax = false;
+            this.designNode.inject(this.editContentNode);
+            this.designNode.setStyles(this.css.designNode);
+            this.designNode.setStyles({
+                "position": "static"
+            });
+            this.resizeNode();
+            //this.tab.pages.each(function(page){
+                this.view.setAreaNodeSize();
+            //});
+        }
+
+    },
+    loadEditContent: function(callback){
+        this.designNode = new Element("div", {
+            "styles": this.css.designNode
+        }).inject(this.editContentNode);
+
+        //MWF.require("MWF.widget.Tab", function(){
+        //    this.tab = new MWF.widget.Tab(this.designNode, {"style": "dictionary"});
+        //    this.tab.load();
+        //}.bind(this), false);
+
+        //    MWF.require("MWF.widget.ScrollBar", function(){
+        //        new MWF.widget.ScrollBar(this.designNode, {"distance": 100});
+        //    }.bind(this));
+	},
+	
+	//loadProperty------------------------
+	loadProperty: function(){
+		this.propertyTitleNode = new Element("div", {
+            "styles": this.css.propertyTitleNode,
+            "text": MWF.APPDIQD.LP.property
+        }).inject(this.propertyNode);
+
+        this.propertyResizeBar = new Element("div", {
+            "styles": this.css.propertyResizeBar
+        }).inject(this.propertyNode);
+        this.loadPropertyResize();
+
+        this.propertyContentNode = new Element("div", {
+            "styles": this.css.propertyContentNode
+        }).inject(this.propertyNode);
+
+        this.propertyDomArea = new Element("div", {
+			"styles": this.css.propertyDomArea
+		}).inject(this.propertyContentNode);
+		
+		this.propertyDomPercent = 0.3;
+		this.propertyContentResizeNode = new Element("div", {
+			"styles": this.css.propertyContentResizeNode
+		}).inject(this.propertyContentNode);
+		
+		this.propertyContentArea = new Element("div", {
+			"styles": this.css.propertyContentArea
+		}).inject(this.propertyContentNode);
+		
+		this.loadPropertyContentResize();
+
+        //this.setPropertyContent();
+        this.propertyNode.addEvent("keydown", function(e){e.stopPropagation();});
+	},
+
+	loadPropertyResize: function(){
+//		var size = this.propertyNode.getSize();
+//		var position = this.propertyResizeBar.getPosition();
+		this.propertyResize = new Drag(this.propertyResizeBar,{
+			"snap": 1,
+			"onStart": function(el, e){
+				var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x;
+				var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
+				el.store("position", {"x": x, "y": y});
+				
+				var size = this.propertyNode.getSize();
+				el.store("initialWidth", size.x);
+			}.bind(this),
+			"onDrag": function(el, e){
+				var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x;
+//				var y = e.event.y;
+				var bodySize = this.content.getSize();
+				var position = el.retrieve("position");
+				var initialWidth = el.retrieve("initialWidth").toFloat();
+				var dx = position.x.toFloat()-x.toFloat();
+				
+				var width = initialWidth+dx;
+				if (width> bodySize.x/2) width =  bodySize.x/2;
+				if (width<40) width = 40;
+				this.contentNode.setStyle("margin-right", width+1);
+				this.propertyNode.setStyle("width", width);
+                //this.tab.pages.each(function(page){
+                (this.view || this.table).setViewWidth();
+                //});
+			}.bind(this)
+		});
+	},
+	loadPropertyContentResize: function(){
+		this.propertyContentResize = new Drag(this.propertyContentResizeNode, {
+			"snap": 1,
+			"onStart": function(el, e){
+				var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x;
+				var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
+				el.store("position", {"x": x, "y": y});
+				
+				var size = this.propertyDomArea.getSize();
+				el.store("initialHeight", size.y);
+			}.bind(this),
+			"onDrag": function(el, e){
+				var size = this.propertyContentNode.getSize();
+				
+	//			var x = e.event.x;
+				var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
+				var position = el.retrieve("position");
+				var dy = y.toFloat()-position.y.toFloat();
+
+				var initialHeight = el.retrieve("initialHeight").toFloat();
+				var height = initialHeight+dy;
+				if (height<40) height = 40;
+				if (height> size.y-40) height = size.y-40;
+				
+				this.propertyDomPercent = height/size.y;
+				
+				this.setPropertyContentResize();
+				
+			}.bind(this)
+		});
+	},
+	setPropertyContentResize: function(){
+		var size = this.propertyContentNode.getSize();
+		var resizeNodeSize = this.propertyContentResizeNode.getSize();
+		var height = size.y-resizeNodeSize.y;
+		
+		var domHeight = this.propertyDomPercent*height;
+		var contentHeight = height-domHeight;
+		
+		this.propertyDomArea.setStyle("height", ""+domHeight+"px");
+		this.propertyContentArea.setStyle("height", ""+contentHeight+"px");
+
+		if (this.table) this.view = this.table;
+		if (this.view){
+			if (this.view.currentSelectedModule){
+				if (this.view.currentSelectedModule.property){
+					var tab = this.view.currentSelectedModule.property.propertyTab;
+					if (tab){
+						var tabTitleSize = tab.tabNodeContainer.getSize();
+						
+						tab.pages.each(function(page){
+							var topMargin = page.contentNodeArea.getStyle("margin-top").toFloat();
+							var bottomMargin = page.contentNodeArea.getStyle("margin-bottom").toFloat();
+							
+							var tabContentNodeAreaHeight = contentHeight - topMargin - bottomMargin - tabTitleSize.y.toFloat()-15;
+							page.contentNodeArea.setStyle("height", tabContentNodeAreaHeight);
+						}.bind(this));
+						
+					}
+				}
+			}
+		}
+	},
+	
+
+	
+	//resizeNode------------------------------------------------
+	resizeNode: function(){
+		var nodeSize = this.node.getSize();
+		this.contentNode.setStyle("height", ""+nodeSize.y+"px");
+		this.propertyNode.setStyle("height", ""+nodeSize.y+"px");
+		
+		var contentToolbarMarginTop = this.contentToolbarNode.getStyle("margin-top").toFloat();
+		var contentToolbarMarginBottom = this.contentToolbarNode.getStyle("margin-bottom").toFloat();
+		var allContentToolberSize = this.contentToolbarNode.getComputedSize();
+		var y = nodeSize.y - allContentToolberSize.totalHeight - contentToolbarMarginTop - contentToolbarMarginBottom;
+		this.editContentNode.setStyle("height", ""+y+"px");
+		
+		if (this.designNode){
+			var designMarginTop = this.designNode.getStyle("margin-top").toFloat();
+			var designMarginBottom = this.designNode.getStyle("margin-bottom").toFloat();
+			y = nodeSize.y - allContentToolberSize.totalHeight - contentToolbarMarginTop - contentToolbarMarginBottom - designMarginTop - designMarginBottom;
+			this.designNode.setStyle("height", ""+y+"px");
+		}
+		
+		
+		titleSize = this.propertyTitleNode.getSize();
+		titleMarginTop = this.propertyTitleNode.getStyle("margin-top").toFloat();
+		titleMarginBottom = this.propertyTitleNode.getStyle("margin-bottom").toFloat();
+		titlePaddingTop = this.propertyTitleNode.getStyle("padding-top").toFloat();
+		titlePaddingBottom = this.propertyTitleNode.getStyle("padding-bottom").toFloat();
+		
+		y = titleSize.y+titleMarginTop+titleMarginBottom+titlePaddingTop+titlePaddingBottom;
+		y = nodeSize.y-y;
+		this.propertyContentNode.setStyle("height", ""+y+"px");
+		this.propertyResizeBar.setStyle("height", ""+y+"px");
+		
+		this.setPropertyContentResize();
+
+        titleSize = this.viewListTitleNode.getSize();
+        titleMarginTop = this.viewListTitleNode.getStyle("margin-top").toFloat();
+        titleMarginBottom = this.viewListTitleNode.getStyle("margin-bottom").toFloat();
+        titlePaddingTop = this.viewListTitleNode.getStyle("padding-top").toFloat();
+        titlePaddingBottom = this.viewListTitleNode.getStyle("padding-bottom").toFloat();
+        nodeMarginTop = this.viewListAreaSccrollNode.getStyle("margin-top").toFloat();
+        nodeMarginBottom = this.viewListAreaSccrollNode.getStyle("margin-bottom").toFloat();
+
+        y = titleSize.y+titleMarginTop+titleMarginBottom+titlePaddingTop+titlePaddingBottom+nodeMarginTop+nodeMarginBottom;
+        y = nodeSize.y-y;
+        this.viewListAreaSccrollNode.setStyle("height", ""+y+"px");
+        this.viewListResizeNode.setStyle("height", ""+y+"px");
+	},
+
+
+
+	
+	//loadView------------------------------------------
+    loadView: function(callback){
+		this.getViewData(this.options.id, function(vdata){
+            this.setTitle(this.options.appTitle + "-"+vdata.name);
+            this.taskitem.setText(this.options.appTitle + "-"+vdata.name);
+            this.options.appTitle = this.options.appTitle + "-"+vdata.name;
+
+            //if (this.options.readMode){
+            //    this.view = new MWF.xApplication.process.DictionaryDesigner.DictionaryReader(this, ddata);
+            //}else{
+                this.view = new MWF.xApplication.query.InquiryDesigner.View(this, vdata);
+            //}
+
+			this.view.load();
+            if (callback) callback();
+            //if (this.status){
+            //    if (this.status.openViews){
+            //        this.status.openViews.each(function(id){
+            //            this.loadViewData(id, function(data){
+            //                var showTab = true;
+            //                if (this.status.currentId){
+            //                    if (this.status.currentId!=data.id) showTab = false;
+            //                }
+            //                //if (this.options.readMode){
+            //                //    var view = new MWF.xApplication.process.DictionaryDesigner.DictionaryReader(this, data, {"showTab": showTab});
+            //                //}else{
+            //                    var view = new MWF.xApplication.process.DictionaryDesigner.View(this, data, {"showTab": showTab});
+            //                //}
+            //
+            //                view.load();
+            //            }.bind(this), true);
+            //        }.bind(this));
+            //    }
+            //}
+		}.bind(this));
+	},
+    getViewData: function(id, callback){
+		if (!this.options.id){
+			this.loadNewViewData(callback);
+		}else{
+			this.loadViewData(id, callback);
+		}
+	},
+	loadNewViewData: function(callback){
+        var url = "../x_component_query_ViewDesigner/$View/view.json";
+        MWF.getJSON(url, {
+            "onSuccess": function(obj){
+                this.actions.getUUID(function(id){
+                    obj.id=id;
+                    obj.isNewView = true;
+                    obj.application = this.application.id;
+                    this.createListViewItem(obj, true);
+                    if (callback) callback(obj);
+                }.bind(this));
+            }.bind(this),
+            "onerror": function(text){
+                this.notice(text, "error");
+            }.bind(this),
+            "onRequestFailure": function(xhr){
+                this.notice(xhr.responseText, "error");
+            }.bind(this)
+        });
+	},
+    loadViewData: function(id, callback){
+		this.actions.getView(id, function(json){
+			if (json){
+				var data = json.data;
+                var dataJson = JSON.decode(data.data);
+                data.data = dataJson;
+
+                if (!this.application){
+                    this.actions.getApplication(data.application, function(json){
+                        this.application = {"name": json.data.name, "id": json.data.id};
+                        if (callback) callback(data);
+                    }.bind(this));
+                }else{
+                    if (callback) callback(data);
+                }
+			}
+		}.bind(this));
+	},
+
+    saveView: function(){
+        this.view.save(function(){
+            var name = this.view.data.name;
+            this.setTitle(MWF.APPDIQD.LP.title + "-"+name);
+            this.options.desktopReload = true;
+            this.options.id = this.view.data.id;
+        }.bind(this));
+    },
+    preview : function(){
+	    this.view.preview();
+    },
+    saveViewAs: function(){
+        this.view.saveAs();
+	},
+    dictionaryExplode: function(){
+        this.view.explode();
+    },
+    dictionaryImplode: function(){
+        this.view.implode();
+    },
+	//recordStatus: function(){
+	//	return {"id": this.options.id};
+	//},
+    recordStatus: function(){
+        //if (this.tab){
+            var openViews = [];
+            openViews.push(this.view.data.id);
+            var currentId = this.view.data.id;
+            return {
+                "id": this.options.id,
+                "application": this.application,
+                "openViews": openViews,
+                "currentId": currentId
+            };
+        //}
+        //return {"id": this.options.id, "application": this.application};
+    }
+});
+
+
+MWF.xDesktop.requireApp("Template", "MPopupForm", null, false);
+MWF.xApplication.query.InquiryDesigner.View.NewNameForm = new Class({
+    Extends: MPopupForm,
+    Implements: [Options, Events],
+    options: {
+        "style": "design",
+        "width": 700,
+        //"height": 300,
+        "height": "260",
+        "hasTop": true,
+        "hasIcon": false,
+        "draggable": true,
+        "title" : MWF.xApplication.query.InquiryDesigner.LP.newView
+    },
+    _createTableContent: function () {
+
+        var html = "<table width='80%' bordr='0' cellpadding='7' cellspacing='0' styles='formTable' style='margin: 20px auto 0px auto; '>" +
+            "<tr><td styles='formTableTitle' lable='selectQuery' width='25%'></td>" +
+            "    <td styles='formTableValue' item='selectQuery' colspan='3' width='75%'></td></tr>" +
+            "<tr><td styles='formTableTitle' lable='name'></td>" +
+            "    <td styles='formTableValue' item='name' colspan='3'></td></tr>" +
+            "</table>";
+        this.formTableArea.set("html", html);
+
+        MWF.xDesktop.requireApp("Template", "MForm", function () {
+            this.form = new MForm(this.formTableArea, this.data || {}, {
+                isEdited: true,
+                style: "cms",
+                hasColon: true,
+                itemTemplate: {
+                    selectQuery : { text: MWF.xApplication.query.InquiryDesigner.LP.application , type : "org",  orgType : "Query", defaultValue :  this.data.queryName, orgWidgetOptions : {
+                        "canRemove" : false
+                    }},
+                    name: {text: MWF.xApplication.query.InquiryDesigner.LP.name, notEmpty: true}
+                }
+            }, this.app);
+            this.form.load();
+        }.bind(this),null, true)
+
+    },
+    ok: function(){
+        var data = this.form.getResult(true,null,true,false,true);
+        if( data ){
+            var selectQuery = this.form.getItem("selectQuery").orgObject;
+            if( selectQuery && selectQuery.length > 0 ){
+                var queryData = selectQuery[0].data;
+                data.query = queryData.id;
+                data.queryName = queryData.name;
+            }else{
+                //data.query 和 data.queryName 还是传进来的值
+            }
+            this.fireEvent("save", [data , function(){
+                this.close();
+            }.bind(this)])
+        }
+    }
+});

+ 44 - 0
o2web/source/x_component_query_InquiryDesigner/Property.js

@@ -0,0 +1,44 @@
+MWF.require("MWF.widget.Common", null, false);
+MWF.require("MWF.widget.JsonTemplate", null, false);
+
+MWF.xDesktop.requireApp("query.ViewDesigner", "Property", null, false);
+MWF.xApplication.query.InquiryDesigner.Property = MWF.FIProperty = new Class({
+    Extends: MWF.xApplication.query.ViewDesigner.Property,
+    Implements: [Options, Events],
+    options: {
+        "style": "default"
+    },
+    show: function () {
+        if (!this.propertyContent) {
+            this.getHtmlString(function () {
+                if (this.htmlString) {
+                    this.JsonTemplate = new MWF.widget.JsonTemplate(this.data, this.htmlString);
+                    this.propertyContent = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.propertyNode);
+                    this.propertyContent.set("html", this.JsonTemplate.load());
+
+                    this.setEditNodeEvent();
+                    this.setEditNodeStyles(this.propertyContent);
+                    this.loadPropertyTab();
+                    this.loadPersonInput();
+                    this.loadPersonSelectInput();
+                    this.loadViewFilter();
+                    this.loadScriptArea();
+
+                    this.loadColumnExportEditor();
+
+                    this.loadJSONArea();
+
+                    this.loadEventsEditor();
+                    this.loadViewStylesArea();
+                    this.loadPagingStylesArea();
+                    this.loadActionStylesArea();
+                    this.loadActionArea();
+                    this.loadStylesList();
+                    this.loadMaplist();
+                }
+            }.bind(this));
+        } else {
+            this.propertyContent.setStyle("display", "block");
+        }
+    }
+});

+ 7 - 0
o2web/source/x_component_query_InquiryDesigner/lp/zh-cn.js

@@ -0,0 +1,7 @@
+MWF.xApplication.query = MWF.xApplication.query || {};
+MWF.xApplication.query.InquiryDesigner = MWF.xApplication.query.InquiryDesigner || {};
+MWF.xApplication.query.ViewDesigner = MWF.xApplication.query.ViewDesigner || {};
+MWF.xDesktop.requireApp("process.ViewDesigner", "lp."+MWF.language, null, false);
+MWF.xApplication.query.InquiryDesigner.LP = Object.merge( MWF.xApplication.query.ViewDesigner.LP, {
+    "title" : "查询设计"
+});

+ 60 - 0
o2web/source/x_component_query_InquiryDesigner/widget/$ViewFilter/default/css.wcss

@@ -0,0 +1,60 @@
+{
+	"inputAreaNode": {
+	    "overflow": "hidden",
+	    "margin": "5px"
+	},
+	"actionAreaNode": {
+	    "height": "20px",
+	    "background": "#EEE",
+	    "border-top": "1px solid #CCC",
+	    "border-bottom": "1px solid #CCC",
+	    "cursor": "pointer"
+	},
+	"actionNode": {
+	    "height": "20px",
+	    "background": "url("+"../x_component_process_ViewDesigner/widget/$ViewFilter/default/down.png) no-repeat center -2px"
+	},
+	"verificationNode": {
+	    "background-color": "#fbe8e8",
+	    "color": "#ff0000",
+	    "height": "24px",
+	    "line-height": "24px"
+	},
+	"verificationTextNode": {
+	    "background": "url("+"../x_component_process_ViewDesigner/widget/$ViewFilter/default/icon/error.png) no-repeat 5px center",
+	    "padding-left": "26px"
+	},
+
+	"itemNode": {
+        "cursor": "pointer",
+        "height": "24px",
+        "margin": "2px 4px",
+        "background-color": "#f4f7fe",
+        "border": "1px solid #999999"
+    },
+    "itemNode_current": {
+        "cursor": "pointer",
+        "height": "24px",
+        "margin": "2px 4px",
+        "background-color": "#e1e9ff",
+        "border": "1px solid #999999"
+    },
+    "itemDeleteNode": {
+        "width": "20px",
+        "height": "24px",
+        "float": "right",
+        "background": "url("+"../x_component_process_ViewDesigner/widget/$ViewFilter/default/icon/delete1.png) no-repeat center center",
+        "cursor": "pointer"
+    },
+    "itemContentNode": {
+        "padding-left": "5px",
+        "padding-right": "3px",
+        "margin-right": "20px",
+        "height": "24px",
+        "line-height": "24px",
+        "overflow": "hidden",
+        "text-overflow": "ellipsis",
+        "white-space": "nowrap"
+    }
+
+}

BIN
o2web/source/x_component_query_InquiryDesigner/widget/$ViewFilter/default/down.png


BIN
o2web/source/x_component_query_InquiryDesigner/widget/$ViewFilter/default/icon/addPerson.png


BIN
o2web/source/x_component_query_InquiryDesigner/widget/$ViewFilter/default/icon/delete1.png


BIN
o2web/source/x_component_query_InquiryDesigner/widget/$ViewFilter/default/icon/error.png


+ 1166 - 0
o2web/source/x_component_query_InquiryDesigner/widget/ViewFilter.js

@@ -0,0 +1,1166 @@
+MWF.xApplication.query = MWF.xApplication.query || {};
+MWF.xApplication.query.ViewDesigner = MWF.xApplication.query.ViewDesigner || {};
+MWF.xApplication.query.ViewDesigner.widget = MWF.xApplication.query.ViewDesigner.widget || {};
+
+MWF.xApplication.query.ViewDesigner.widget.ViewFilter = new Class({
+    Implements: [Options, Events],
+    Extends: MWF.widget.Common,
+    options: {
+        "style": "default",
+        "type": "identity",
+        "names": []
+    },
+    initialize: function(node, app, filtrData, options){
+        this.setOptions(options);
+        this.node = $(node);
+        this.app = app;
+        this.filtrData = filtrData;
+
+        this.path = "../x_component_query_ViewDesigner/widget/$ViewFilter/";
+        this.cssPath = "../x_component_query_ViewDesigner/widget/$ViewFilter/"+this.options.style+"/css.wcss";
+        this._loadCss();
+
+        this.items = [];
+        this.load();
+
+    },
+    load: function(data){
+        this.getInputNodes();
+        this.createActionNode();
+        //this.createAddNode();
+        //this.loadIdentitys();
+        this.loadData();
+    },
+    loadData: function(){
+        if (this.filtrData.filtrData && this.filtrData.filtrData.length){
+            this.filtrData.filtrData.each(function(data){
+                this.items.push(new MWF.xApplication.query.ViewDesigner.widget.ViewFilter.Item(this, data));
+            }.bind(this));
+        }
+
+        if (this.filtrData.customData && this.filtrData.customData.length){
+            this.filtrData.customData.each(function(data){
+                data.type = "custom";
+                this.items.push(new MWF.xApplication.query.ViewDesigner.widget.ViewFilter.ItemCustom(this, data));
+            }.bind(this));
+        }
+    },
+    createScriptArea: function(node){
+        this.scriptValueArea = node;
+        var title = node.get("title");
+
+        MWF.require("MWF.widget.ScriptArea", function(){
+            this.scriptArea = new MWF.widget.ScriptArea(node, {
+                "title": title,
+                "maxObj": this.app.formContentNode || this.app.pageContentNode,
+                "onChange": function(){
+                    this.scriptData = this.scriptArea.toJson();
+                }.bind(this),
+                "onSave": function(){
+                    //this.app.saveForm();
+                }.bind(this),
+                "style": "formula"
+            });
+            var v = (this.scriptData) ? this.scriptData.code : "";
+            this.scriptArea.load(v);
+        }.bind(this));
+    },
+    createCustomFilterValueScriptArea : function(node){
+        var title = node.get("title");
+
+        MWF.require("MWF.widget.ScriptArea", function(){
+            this.customFilterValueScriptArea = new MWF.widget.ScriptArea(node, {
+                "title": title,
+                "isload" : true,
+                "isbind" : false,
+                "maxObj": this.app.formContentNode || this.app.pageContentNode,
+                "onChange": function(){
+                    this.customFilterValueScriptData = this.customFilterValueScriptArea.toJson();
+                }.bind(this),
+                "onSave": function(){
+                    //this.app.saveForm();
+                }.bind(this),
+                "style": "formula"
+            });
+            var v = (this.customFilterValueScriptData) ? this.customFilterValueScriptData.code : "";
+            this.customFilterValueScriptArea.load(v);
+        }.bind(this));
+    },
+    getInputNodes: function(){
+        debugger;
+        this.inputAreaNode = this.node.getElement(".inputAreaNode_vf");
+        this.actionAreaNode = this.node.getElement(".actionAreaNode_vf");
+        this.actionAreaNode.setStyles( this.css.actionAreaNode );
+        this.listAreaNode = this.node.getElement(".listAreaNode_vf");
+        this.fieldListAreaNode = this.node.getElement(".fieldListAreaNode_vf");
+
+        this.restrictViewFilterTable = this.node.getElement(".restrictViewFilterTable_vf");
+
+        var scriptValueArea = this.node.getElement(".MWFFilterFormulaArea");
+        if (scriptValueArea){
+            this.createScriptArea(scriptValueArea);
+        }
+
+        this.titleInput = this.inputAreaNode.getElement(".titleInput_vf");
+        this.pathInput = this.inputAreaNode.getElement(".pathInput_vf");
+        this.datatypeInput = this.inputAreaNode.getElement(".datatypeInput_vf");
+
+        this.restrictFilterInput = this.inputAreaNode.getElement(".restrictFilterInput_vf");
+        this.customFilterInput = this.inputAreaNode.getElement(".customFilterInput_vf");
+
+        this.logicInput = this.inputAreaNode.getElement(".logicInput_vf");
+
+        this.comparisonInput = this.inputAreaNode.getElement(".comparisonInput_vf");
+        this.comparisonInput.addEvent("change", function(){
+            this.switchInputDisplay();
+        }.bind(this))
+
+        this.valueTextInput = this.inputAreaNode.getElement(".valueTextInput_vf");
+        this.valueNumberInput = this.inputAreaNode.getElement(".valueNumberInput_vf");
+        this.valueDatetimeInput = this.inputAreaNode.getElement(".valueDatetimeInput_vf");
+        this.valueBooleanInput = this.inputAreaNode.getElement(".valueBooleanInput_vf");
+        this.valueDateInput = this.inputAreaNode.getElement(".valueDateInput_vf");
+        this.valueTimeInput = this.inputAreaNode.getElement(".valueTimeInput_vf");
+
+        if( this.app.view ){
+            var dataId = this.app.view.data.id;
+            this.customFilterValueTypes = this.inputAreaNode.getElements("[name='"+dataId+"viewCustomFilterValueType']");
+
+            this.customFilterValueScriptDiv = this.inputAreaNode.getElement("#"+dataId+"viewCustomFilterValueScriptDiv");
+            this.customFilterValueScript = this.inputAreaNode.getElement("[name='"+dataId+"viewCustomFilterValueScript']");
+            if( this.customFilterValueScript ){
+                this.createCustomFilterValueScriptArea(this.customFilterValueScript);
+            }
+        }
+
+        MWF.require("MWF.widget.Calendar", function(){
+            this.calendar = new MWF.widget.Calendar(this.valueDatetimeInput, {
+                "style": "xform",
+                "isTime": true,
+                "secondEnable": true,
+                "target": this.app.content,
+                "format": "db",
+                "onComplate": function(){
+                    this.node.getElement("#"+id+"viewFilterDateFormulaSelector").getElements("input").set("checked", false);
+                }.bind(this)
+            });
+            new MWF.widget.Calendar(this.valueDateInput, {
+                "style": "xform",
+                "isTime": false,
+                "target": this.app.content,
+                "format": "%Y-%m-%d"
+            });
+            new MWF.widget.Calendar(this.valueTimeInput, {
+                "style": "xform",
+                "timeOnly": true,
+                "secondEnable": true,
+                "target": this.app.content,
+                "format": "%H:%M:%S"
+            });
+        }.bind(this));
+
+        this.datatypeInput.addEvent("change", function(){
+            // this.changeValueInput();
+            this.switchInputDisplay();
+        }.bind(this));
+
+        this.valueTextInput.addEvent("keydown", function(e){
+            if (e.code==13) this.modifyOrAddFilterItem();
+        }.bind(this));
+        this.valueNumberInput.addEvent("keydown", function(e){
+            if (e.code==13) this.modifyOrAddFilterItem();
+        }.bind(this));
+
+        if (this.app.view){
+            var id = this.app.view.data.id;
+            var div = this.node.getElement("#"+id+"viewFilterValueArea2");
+            // inputs = div.getElements("input");
+            if( div ){
+                this.valueTextInput2 = div.getElement(".valueTextInput2_vf") || null;
+                this.valueNumberInput2 = div.getElement(".valueNumberInput2_vf") || null;
+                this.valueDatetimeInput2 = div.getElement(".valueDatetimeInput2_vf") || null;
+                this.valueDateInput2 = div.getElement(".valueDateInput2_vf") || null;
+                this.valueTimeInput2 = div.getElement(".valueTimeInput2_vf") || null;
+                this.valueBooleanInput2 = div.getElement(".valueBooleanInput2_vf") || null;
+
+                MWF.require("MWF.widget.Calendar", function(){
+                    this.calendar = new MWF.widget.Calendar(this.valueDatetimeInput2, {
+                        "style": "xform",
+                        "isTime": true,
+                        "secondEnable": true,
+                        "target": this.app.content,
+                        "format": "db",
+                        "onComplate": function(){
+                            this.node.getElement("#"+id+"viewFilterDateFormulaSelector2").getElements("input").set("checked", false);
+                        }.bind(this)
+                    });
+                    new MWF.widget.Calendar(this.valueDateInput2, {
+                        "style": "xform",
+                        "isTime": false,
+                        "target": this.app.content,
+                        "format": "%Y-%m-%d"
+                    });
+                    new MWF.widget.Calendar(this.valueTimeInput2, {
+                        "style": "xform",
+                        "timeOnly": true,
+                        "secondEnable": true,
+                        "target": this.app.content,
+                        "format": "%H:%M:%S"
+                    });
+                }.bind(this));
+
+                this.valueTextInput2.addEvent("keydown", function(e){
+                    if (e.code==13) this.modifyOrAddFilterItem();
+                }.bind(this));
+                this.valueNumberInput2.addEvent("keydown", function(e){
+                    if (e.code==13) this.modifyOrAddFilterItem();
+                }.bind(this));
+            }
+        }
+    },
+    switchInputDisplay : function(){
+        var id = "";
+        if( this.app.view ){
+            id = this.app.view.data.id;
+        }
+
+        var config = {
+            "textValue": {
+                "equals": {
+                    "selectorArea" : ["#"+id+"viewFilterTextFormulaSelector"] //["input", "@person", "@unitList", "@unitAllList", "@identityList" ],
+                },
+                "notEquals": {
+                    "selectorArea" : ["#"+id+"viewFilterTextFormulaSelector"] //["input", "@person", "@unitList", "@unitAllList", "@identityList" ],
+                },
+                "greaterThan": {
+                    "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ]
+                },
+                "greaterThanOrEqualTo": {
+                    "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ]
+                },
+                "lessThan": {
+                    "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ]
+                },
+                "lessThanOrEqualTo": {
+                    "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ]
+                },
+                "like": {
+                    "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ]
+                },
+                "notLike": {
+                    "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ]
+                },
+                "range": {
+                    "invalidValue" : ["@person", "@unitList", "@unitAllList", "@identityList" ]
+                }
+            },
+            "numberValue": {
+                "equals": {}, //["input"]
+                "notEquals": {},
+                "greaterThan": {},
+                "greaterThanOrEqualTo": {},
+                "lessThan": {},
+                "lessThanOrEqualTo": {},
+                "range": {}
+            },
+            "dateTimeValue": {
+                "equals": {
+                    "invalidValue" : ["@year","@season","@month","@time","@date"]
+                },
+                "notEquals": {
+                    "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"]
+                },
+                "greaterThan": {
+                    "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"]
+                },
+                "greaterThanOrEqualTo": {
+                    "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"]
+                },
+                "lessThan": {
+                    "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"]
+                },
+                "lessThanOrEqualTo": {
+                    "selectorArea" : ["#"+id+"viewFilterDateFormulaSelector"]
+                },
+                "range": {
+                    "invalidValue" : ["@year","@season","@month","@time","@date"]
+                }
+            },
+            "dateValue": {
+                "equals": {
+                    "invalidValue" : ["@year","@season","@month","@date"]
+                },
+                "notEquals": {
+                    "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"]
+                },
+                "greaterThan":{
+                    "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"]
+                },
+                "greaterThanOrEqualTo": {
+                    "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"]
+                },
+                "lessThan": {
+                    "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"]
+                },
+                "lessThanOrEqualTo": {
+                    "selectorArea" : ["#"+id+"viewFilterDateOnlyFormulaSelector"]
+                },
+                "range": {
+                    "invalidValue" : ["@year","@season","@month","@date"]
+                }
+            },
+            "timeValue": {
+                "equals": {
+                    "invalidValue" : ["@time"]
+                },
+                "notEquals": {
+                    "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"]
+                },
+                "greaterThan": {
+                    "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"]
+                },
+                "greaterThanOrEqualTo": {
+                    "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"]
+                },
+                "lessThan": {
+                    "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"]
+                },
+                "lessThanOrEqualTo": {
+                    "selectorArea" : ["#"+id+"viewFilterTimeOnlyFormulaSelector"]
+                },
+                "range": {
+                    "invalidValue" : ["@time"]
+                }
+            },
+            "booleanValue": {
+                "equals": {},
+                "notEquals": {}
+            }
+        };
+
+        debugger;
+
+        var formulaSelectorIdList = [
+            "#"+id+"viewFilterTextFormulaSelector",
+            "#"+id+"viewFilterDateFormulaSelector",
+            "#"+id+"viewFilterDateOnlyFormulaSelector",
+            "#"+id+"viewFilterTimeOnlyFormulaSelector"
+        ];
+
+        var formatType = this.datatypeInput.options[this.datatypeInput.selectedIndex].value;
+        var object = config[formatType];
+
+        var availableComparisonList = Object.keys( object );
+        var options = this.comparisonInput.options;
+
+        var comparison = options[this.comparisonInput.selectedIndex].value;
+
+        if( !this.originalComparisonOptions ){
+            this.originalComparisonOptions = [];
+            for( var i=0; i< options.length; i++ ){
+                this.originalComparisonOptions.push({
+                    "text" : options[i].text,
+                    "value" : options[i].value
+                });
+            }
+        }
+
+        while( this.comparisonInput.options && this.comparisonInput.options.length ){
+            this.comparisonInput.options[0].destroy();
+        }
+
+        for( var i=0; i<this.originalComparisonOptions.length; i++ ){
+            var opt = this.originalComparisonOptions[i];
+            if( availableComparisonList.contains( opt.value )){
+                var option = new Element("option", {
+                    text : opt.text,
+                    value : opt.value
+                }).inject( this.comparisonInput );
+                if( opt.value === comparison )option.selected = true;
+            }
+        }
+
+        var availableInputArray = [];
+        var invalidValue = [];
+        for( var key in object ){
+            if( comparison === key ){
+                availableInputArray = object[key].selectorArea || [];
+                invalidValue = object[key].invalidValue || [];
+                break;
+            }
+        }
+        for( var i=0; i<invalidValue.length; i++ ){
+            invalidValue[i] = invalidValue[i].toLowerCase();
+        }
+
+        formulaSelectorIdList.each( function(id) {
+            var el = this.inputAreaNode.getElement( id );
+            if( !el )return;
+            if( availableInputArray.contains(id) ){
+                el.setStyle("display", "block");
+            }else{
+                el.getElements("input").set("checked", false);
+                el.setStyle("display", "none");
+            }
+        }.bind(this));
+
+        var viewFilterValue2Area, viewFilterValueTitleArea;
+        if ( availableComparisonList.contains("range") && comparison=="range"){
+            viewFilterValue2Area = this.inputAreaNode.getElement("#"+id+"viewFilterValue2Area");
+            if(viewFilterValue2Area)viewFilterValue2Area.setStyle('display', 'block');
+
+            viewFilterValueTitleArea = this.inputAreaNode.getElement("#"+id+"viewFilterValueTitleArea");
+            if(viewFilterValueTitleArea)viewFilterValueTitleArea.set('text', '从');
+        }else{
+            viewFilterValue2Area = this.inputAreaNode.getElement("#"+id+"viewFilterValue2Area");
+            if(viewFilterValue2Area)viewFilterValue2Area.setStyle('display', 'none');
+
+            viewFilterValueTitleArea = this.inputAreaNode.getElement("#"+id+"viewFilterValueTitleArea");
+            if(viewFilterValueTitleArea)viewFilterValueTitleArea.set('text', '值');
+        }
+        switch (formatType){
+            case "textValue":
+                this.valueTextInput.setStyle("display", "block");
+                if( invalidValue.contains( (this.valueTextInput.get("value") || "" ).toLowerCase() )){
+                    this.valueTextInput.set("value","");
+                }
+                this.valueNumberInput.setStyle("display", "none");
+                this.valueDatetimeInput.setStyle("display", "none");
+                this.valueDateInput.setStyle("display", "none");
+                this.valueTimeInput.setStyle("display", "none");
+                this.valueBooleanInput.setStyle("display", "none");
+                if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "block");
+                if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
+                if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
+                if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
+                if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
+                if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
+                break;
+            case "numberValue":
+                this.valueTextInput.setStyle("display", "none");
+                this.valueNumberInput.setStyle("display", "block");
+                if( invalidValue.contains( (this.valueNumberInput.get("value") || "" ).toLowerCase() )){
+                    this.valueNumberInput.set("value","");
+                }
+                this.valueDatetimeInput.setStyle("display", "none");
+                this.valueBooleanInput.setStyle("display", "none");
+                this.valueDateInput.setStyle("display", "none");
+                this.valueTimeInput.setStyle("display", "none");
+                if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
+                if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "block");
+                if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
+                if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
+                if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
+                if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
+                break;
+            case "datetimeValue":
+            case "dateTimeValue":
+                this.valueTextInput.setStyle("display", "none");
+                this.valueNumberInput.setStyle("display", "none");
+                this.valueDatetimeInput.setStyle("display", "block");
+                if( invalidValue.contains( (this.valueDatetimeInput.get("value") || "" ).toLowerCase() )){
+                    this.valueDatetimeInput.set("value","");
+                }
+                this.valueBooleanInput.setStyle("display", "none");
+                this.valueDateInput.setStyle("display", "none");
+                this.valueTimeInput.setStyle("display", "none");
+                if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
+                if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
+                if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "block");
+                if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
+                if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
+                if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
+                break;
+            case "dateValue":
+                this.valueTextInput.setStyle("display", "none");
+                this.valueNumberInput.setStyle("display", "none");
+                this.valueDatetimeInput.setStyle("display", "none");
+                this.valueBooleanInput.setStyle("display", "none");
+                this.valueDateInput.setStyle("display", "block");
+                if( invalidValue.contains( (this.valueDateInput.get("value") || "" ).toLowerCase() )){
+                    this.valueDateInput.set("value","");
+                }
+                this.valueTimeInput.setStyle("display", "none");
+                if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
+                if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
+                if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
+                if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "block");
+                if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
+                if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
+                break;
+            case "timeValue":
+                this.valueTextInput.setStyle("display", "none");
+                this.valueNumberInput.setStyle("display", "none");
+                this.valueDatetimeInput.setStyle("display", "none");
+                this.valueBooleanInput.setStyle("display", "none");
+                this.valueDateInput.setStyle("display", "none");
+                this.valueTimeInput.setStyle("display", "block");
+                if( invalidValue.contains( (this.valueTimeInput.get("value") || "" ).toLowerCase() )){
+                    this.valueTimeInput.set("value","");
+                }
+                if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
+                if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
+                if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
+                if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
+                if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "block");
+                if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
+                break;
+            case "booleanValue":
+                this.valueTextInput.setStyle("display", "none");
+                this.valueNumberInput.setStyle("display", "none");
+                this.valueDatetimeInput.setStyle("display", "none");
+                this.valueDateInput.setStyle("display", "none");
+                this.valueTimeInput.setStyle("display", "none");
+                this.valueBooleanInput.setStyle("display", "block");
+                if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
+                if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
+                if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
+                if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
+                if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
+                if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "block");
+                break;
+        }
+    },
+    // getInputNodes: function(){
+    //     this.inputAreaNode = this.node.getFirst("div");
+    //     this.actionAreaNode = this.inputAreaNode.getNext().setStyles(this.css.actionAreaNode);
+    //     this.listAreaNode = this.actionAreaNode.getNext().getNext();
+    //     this.fieldListAreaNode = this.listAreaNode.getNext().getNext();
+    //     this.restrictViewFilterTable = this.inputAreaNode.getLast("table");
+    //
+    //     var selects = this.inputAreaNode.getElements("select");
+    //     var inputs = this.inputAreaNode.getElements("input");
+    //     var scriptValueArea = this.node.getElement(".MWFFilterFormulaArea");
+    //     if (scriptValueArea){
+    //         this.createScriptArea(scriptValueArea);
+    //     }
+    //
+    //     this.titleInput = inputs[0];
+    //     this.pathInput = inputs[1];
+    //     this.datatypeInput = selects[0];
+    //
+    //     this.restrictFilterInput = inputs[2];
+    //     this.customFilterInput = inputs[3];
+    //
+    //     this.logicInput = selects[1];
+    //     this.comparisonInput = selects[2];
+    //     this.valueTextInput = inputs[4];
+    //     this.valueNumberInput = inputs[5];
+    //     this.valueDatetimeInput = inputs[6];
+    //     this.valueBooleanInput = selects[3];
+    //     this.valueDateInput = inputs[7];
+    //     this.valueTimeInput = inputs[8];
+    //
+    //     debugger;
+    //     var dataId = this.app.view.data.id;
+    //     this.customFilterValueTypes = this.inputAreaNode.getElements("[name='"+dataId+"viewCustomFilterValueType']");
+    //
+    //     this.customFilterValueScriptDiv = this.inputAreaNode.getElement("#"+dataId+"viewCustomFilterValueScriptDiv");
+    //     this.customFilterValueScript = this.inputAreaNode.getElement("[name='"+dataId+"viewCustomFilterValueScript']");
+    //     if( this.customFilterValueScript ){
+    //         this.createCustomFilterValueScriptArea(this.customFilterValueScript);
+    //     }
+    //
+    //     this.datatypeInput.addEvent("change");
+    //
+    //     MWF.require("MWF.widget.Calendar", function(){
+    //         this.calendar = new MWF.widget.Calendar(this.valueDatetimeInput, {
+    //             "style": "xform",
+    //             "isTime": true,
+    //             "secondEnable": true,
+    //             "target": this.app.content,
+    //             "format": "db",
+    //             "onComplate": function(){
+    //                 this.node.getElement("#"+id+"viewFilterDateFormulaSelector").getElements("input").set("checked", false);
+    //             }.bind(this)
+    //         });
+    //         new MWF.widget.Calendar(this.valueDateInput, {
+    //             "style": "xform",
+    //             "isTime": false,
+    //             "target": this.app.content,
+    //             "format": "%Y-%m-%d"
+    //         });
+    //         new MWF.widget.Calendar(this.valueTimeInput, {
+    //             "style": "xform",
+    //             "timeOnly": true,
+    //             "secondEnable": true,
+    //             "target": this.app.content,
+    //             "format": "%H:%M:%S"
+    //         });
+    //     }.bind(this));
+    //
+    //     this.datatypeInput.addEvent("change", function(){
+    //         this.changeValueInput();
+    //     }.bind(this));
+    //
+    //     this.valueTextInput.addEvent("keydown", function(e){
+    //         if (e.code==13) this.modifyOrAddFilterItem();
+    //     }.bind(this));
+    //     this.valueNumberInput.addEvent("keydown", function(e){
+    //         if (e.code==13) this.modifyOrAddFilterItem();
+    //     }.bind(this));
+    //
+    //     if (this.app.view){
+    //         var id = this.app.view.data.id;
+    //         var div = this.node.getElement("#"+id+"viewFilterValueArea2");
+    //         inputs = div.getElements("input");
+    //         this.valueTextInput2 = inputs[0] || null;
+    //         this.valueNumberInput2 = inputs[1] || null;
+    //         this.valueDatetimeInput2 = inputs[2] || null;
+    //         this.valueDateInput2 = inputs[3] || null;
+    //         this.valueTimeInput2 = inputs[4] || null;
+    //         this.valueBooleanInput2 = div.getElement("select") || null;
+    //
+    //         MWF.require("MWF.widget.Calendar", function(){
+    //             this.calendar = new MWF.widget.Calendar(this.valueDatetimeInput2, {
+    //                 "style": "xform",
+    //                 "isTime": true,
+    //                 "secondEnable": true,
+    //                 "target": this.app.content,
+    //                 "format": "db",
+    //                 "onComplate": function(){
+    //                     this.node.getElement("#"+id+"viewFilterDateFormulaSelector2").getElements("input").set("checked", false);
+    //                 }.bind(this)
+    //             });
+    //             new MWF.widget.Calendar(this.valueDateInput2, {
+    //                 "style": "xform",
+    //                 "isTime": false,
+    //                 "target": this.app.content,
+    //                 "format": "%Y-%m-%d"
+    //             });
+    //             new MWF.widget.Calendar(this.valueTimeInput2, {
+    //                 "style": "xform",
+    //                 "timeOnly": true,
+    //                 "secondEnable": true,
+    //                 "target": this.app.content,
+    //                 "format": "%H:%M:%S"
+    //             });
+    //         }.bind(this));
+    //
+    //         this.valueTextInput2.addEvent("keydown", function(e){
+    //             if (e.code==13) this.modifyOrAddFilterItem();
+    //         }.bind(this));
+    //         this.valueNumberInput2.addEvent("keydown", function(e){
+    //             if (e.code==13) this.modifyOrAddFilterItem();
+    //         }.bind(this));
+    //     }
+    // },
+    // changeValueInput: function(){
+    //     var type = this.datatypeInput.options[this.datatypeInput.selectedIndex].value;
+    //     switch (type){
+    //         case "textValue":
+    //             this.valueTextInput.setStyle("display", "block");
+    //             this.valueNumberInput.setStyle("display", "none");
+    //             this.valueDatetimeInput.setStyle("display", "none");
+    //             this.valueDateInput.setStyle("display", "none");
+    //             this.valueTimeInput.setStyle("display", "none");
+    //             this.valueBooleanInput.setStyle("display", "none");
+    //             if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "block");
+    //             if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
+    //             if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
+    //             if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
+    //             if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
+    //             if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
+    //             break;
+    //         case "numberValue":
+    //             this.valueTextInput.setStyle("display", "none");
+    //             this.valueNumberInput.setStyle("display", "block");
+    //             this.valueDatetimeInput.setStyle("display", "none");
+    //             this.valueBooleanInput.setStyle("display", "none");
+    //             this.valueDateInput.setStyle("display", "none");
+    //             this.valueTimeInput.setStyle("display", "none");
+    //             if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
+    //             if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "block");
+    //             if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
+    //             if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
+    //             if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
+    //             if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
+    //             break;
+    //         case "datetimeValue":
+    //         case "dateTimeValue":
+    //             this.valueTextInput.setStyle("display", "none");
+    //             this.valueNumberInput.setStyle("display", "none");
+    //             this.valueDatetimeInput.setStyle("display", "block");
+    //             this.valueBooleanInput.setStyle("display", "none");
+    //             this.valueDateInput.setStyle("display", "none");
+    //             this.valueTimeInput.setStyle("display", "none");
+    //             if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
+    //             if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
+    //             if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "block");
+    //             if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
+    //             if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
+    //             if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
+    //             break;
+    //         case "dateValue":
+    //             this.valueTextInput.setStyle("display", "none");
+    //             this.valueNumberInput.setStyle("display", "none");
+    //             this.valueDatetimeInput.setStyle("display", "none");
+    //             this.valueBooleanInput.setStyle("display", "none");
+    //             this.valueDateInput.setStyle("display", "block");
+    //             this.valueTimeInput.setStyle("display", "none");
+    //             if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
+    //             if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
+    //             if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
+    //             if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "block");
+    //             if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
+    //             if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
+    //             break;
+    //         case "timeValue":
+    //             this.valueTextInput.setStyle("display", "none");
+    //             this.valueNumberInput.setStyle("display", "none");
+    //             this.valueDatetimeInput.setStyle("display", "none");
+    //             this.valueBooleanInput.setStyle("display", "none");
+    //             this.valueDateInput.setStyle("display", "none");
+    //             this.valueTimeInput.setStyle("display", "block");
+    //             if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
+    //             if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
+    //             if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
+    //             if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
+    //             if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "block");
+    //             if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "none");
+    //             break;
+    //         case "booleanValue":
+    //             this.valueTextInput.setStyle("display", "none");
+    //             this.valueNumberInput.setStyle("display", "none");
+    //             this.valueDatetimeInput.setStyle("display", "none");
+    //             this.valueTimeInput.setStyle("display", "none");
+    //             this.valueBooleanInput.setStyle("display", "block");
+    //             if (this.valueTextInput2) this.valueTextInput2.setStyle("display", "none");
+    //             if (this.valueNumberInput2) this.valueNumberInput2.setStyle("display", "none");
+    //             if (this.valueDatetimeInput2) this.valueDatetimeInput2.setStyle("display", "none");
+    //             if (this.valueDateInput2) this.valueDateInput2.setStyle("display", "none");
+    //             if (this.valueTimeInput2) this.valueTimeInput2.setStyle("display", "none");
+    //             if (this.valueBooleanInput2) this.valueBooleanInput2.setStyle("display", "block");
+    //             break;
+    //     }
+    // },
+    createActionNode: function(){
+        this.actionNode = new Element("div", {"styles": this.css.actionNode}).inject(this.actionAreaNode);
+        this.actionNode.addEvent("click", function(){
+            this.modifyOrAddFilterItem();
+        }.bind(this));
+    },
+    modifyOrAddFilterItem: function(){
+        if (this.currentFilterItem){
+            this.modifyFilterItem();
+        }else{
+            if (this.restrictFilterInput.checked){
+                this.addFilterItem();
+            }else{
+                this.addCustomFilterItem();
+            }
+        }
+        this.setData({
+            "logic": "and",
+            "path": "",
+            "title": "",
+            "type": this.restrictFilterInput.checked ? "restrict" : "custom",
+            "comparison": "equals",
+            "formatType": "textValue",
+            "value": "",
+            "otherValue": "",
+            "code": ""
+        });
+    },
+    modifyFilterItem: function(){
+        var data = this.getInputData();
+        if (this.verificationData(data)){
+            this.currentFilterItem.reload(data);
+            this.currentFilterItem.unSelected();
+            this.fireEvent("change");
+        }
+    },
+    addFilterItem: function(){
+        var data = this.getInputData();
+        if (this.verificationData(data)){
+            this.items.push(new MWF.xApplication.query.ViewDesigner.widget.ViewFilter.Item(this, data));
+            this.fireEvent("change");
+        }
+    },
+    addCustomFilterItem: function(){
+        var data = this.getInputData();
+        if (this.verificationDataCustom(data)){
+            this.items.push(new MWF.xApplication.query.ViewDesigner.widget.ViewFilter.ItemCustom(this, data));
+            this.fireEvent("change");
+        }
+    },
+    verificationData: function(data){
+        if (!data.path){
+            this.verificationNode = new Element("div", {"styles": this.css.verificationNode}).inject(this.inputAreaNode);
+            new Element("div", {"styles": this.css.verificationTextNode, "text": this.app.lp.mastInputPath}).inject(this.verificationNode);
+            this.pathInput.focus();
+            this.pathInput.setStyle("background-color", "#fbe8e8");
+
+            this.pathInput.addEvents({
+                "keydown": function(){
+                    if (this.verificationNode){
+                        this.verificationNode.destroy();
+                        this.verificationNode = null;
+                        this.pathInput.setStyle("background-color", "#FFF");
+                    }
+                }.bind(this),
+                "click": function(){
+                    if (this.verificationNode){
+                        this.verificationNode.destroy();
+                        this.verificationNode = null;
+                    }
+                }.bind(this)
+            });
+            return false;
+        }
+        // if (data.comparison=="range" && !data.otherValue){
+        //     this.verificationNode = new Element("div", {"styles": this.css.verificationNode}).inject(this.inputAreaNode);
+        //     new Element("div", {"styles": this.css.verificationTextNode, "text": this.app.lp.mastInputPath}).inject(this.verificationNode);
+        // }
+        return true;
+    },
+    verificationDataCustom: function(data){
+        if (!data.title){
+            this.verificationNode = new Element("div", {"styles": this.css.verificationNode}).inject(this.inputAreaNode);
+            new Element("div", {"styles": this.css.verificationTextNode, "text": this.app.lp.mastInputTitle}).inject(this.verificationNode);
+            this.titleInput.focus();
+            this.titleInput.setStyle("background-color", "#fbe8e8");
+
+            this.titleInput.addEvents({
+                "keydown": function(){
+                    if (this.verificationNode){
+                        this.verificationNode.destroy();
+                        this.verificationNode = null;
+                        this.titleInput.setStyle("background-color", "#FFF");
+                    }
+                }.bind(this),
+                "click": function(){
+                    if (this.verificationNode){
+                        this.verificationNode.destroy();
+                        this.verificationNode = null;
+                    }
+                }.bind(this)
+            });
+            return false;
+        }
+        if (!data.path){
+            this.verificationNode = new Element("div", {"styles": this.css.verificationNode}).inject(this.inputAreaNode);
+            new Element("div", {"styles": this.css.verificationTextNode, "text": this.app.lp.mastInputPath}).inject(this.verificationNode);
+            this.pathInput.focus();
+            this.pathInput.setStyle("background-color", "#fbe8e8");
+
+            this.pathInput.addEvents({
+                "keydown": function(){
+                    if (this.verificationNode){
+                        this.verificationNode.destroy();
+                        this.verificationNode = null;
+                        this.pathInput.setStyle("background-color", "#FFF");
+                    }
+                }.bind(this),
+                "click": function(){
+                    if (this.verificationNode){
+                        this.verificationNode.destroy();
+                        this.verificationNode = null;
+                    }
+                }.bind(this)
+            });
+            return false;
+        }
+        return true;
+    },
+    getInputData: function(){
+        var logic = this.logicInput.options[this.logicInput.selectedIndex].value;
+        var path = this.pathInput.get("value");
+        var title = this.titleInput.get("value");
+        if (this.restrictFilterInput.checked) var type = "restrict";
+        if (this.customFilterInput.checked) var type = "custom";
+
+        var comparison = this.comparisonInput.options[this.comparisonInput.selectedIndex].value;
+        var formatType = this.datatypeInput.options[this.datatypeInput.selectedIndex].value;
+        var value = "";
+        var value2 = "";
+        switch (formatType){
+            case "textValue":
+                value = this.valueTextInput.get("value") || "";
+                value2 = (this.valueTextInput2) ? (this.valueTextInput2.get("value") || "") : "";
+                break;
+            case "numberValue":
+                value = this.valueNumberInput.get("value").toFloat();
+                value2 = (this.valueNumberInput2) ? this.valueNumberInput2.get("value").toFloat() : "";
+                break;
+            case "datetimeValue":
+            case "dateTimeValue":
+                value = this.valueDatetimeInput.get("value") || "";
+                value2 = (this.valueDatetimeInput2) ? (this.valueDatetimeInput2.get("value") || "") : "";
+                break;
+            case "dateValue":
+                value = this.valueDateInput.get("value") || "";
+                value2 = (this.valueDateInput2) ? (this.valueDateInput2.get("value") || "") : "";
+                break;
+            case "timeValue":
+                value = this.valueTimeInput.get("value") || "";
+                value2 = (this.valueTimeInput2) ? (this.valueTimeInput2.get("value") || "") : "";
+                break;
+
+            case "booleanValue":
+                value = this.valueBooleanInput.options[this.valueBooleanInput.selectedIndex].value;
+                value2 = (this.valueBooleanInput2) ? this.valueBooleanInput2.options[this.valueBooleanInput.selectedIndex].value : "";
+                if (value=="true"){
+                    value = true;
+                }else{
+                    value = false;
+                }
+                if (value2=="true"){
+                    value2 = true;
+                }else{
+                    value2 = false;
+                }
+                break;
+        }
+        if( type === "restrict" ){
+            return {
+                "logic": logic,
+                "path": path,
+                "title": title,
+                "type": type,
+                "comparison": comparison,
+                "formatType": formatType,
+                "value": value,
+                "otherValue": value2,
+                "code": this.scriptData
+            };
+        }else{
+            var valueType = "";
+            this.customFilterValueTypes.each( function (radio) {
+                if( radio.get("checked") )valueType = radio.get("value");
+            });
+            return {
+                "logic": logic,
+                "path": path,
+                "title": title,
+                "type": type,
+                "comparison": comparison,
+                "formatType": formatType,
+                "value": value,
+                "otherValue": value2,
+                "code": this.scriptData,
+                "valueType" : valueType,
+                "valueScript" : this.customFilterValueScriptData
+            };
+        }
+    },
+
+    setData: function(data){
+        for (var i=0; i<this.logicInput.options.length; i++){
+            if (this.logicInput.options[i].value===data.logic){
+                this.logicInput.options[i].set("selected", true);
+                break;
+            }
+        }
+
+        this.titleInput.set("value", data.title);
+        this.pathInput.set("value", data.path);
+
+        for (var i=0; i<this.comparisonInput.options.length; i++){
+            if (this.comparisonInput.options[i].value===data.comparison){
+                this.comparisonInput.options[i].set("selected", true);
+                break;
+            }
+        }
+
+        for (var i=0; i<this.datatypeInput.options.length; i++){
+            if (this.datatypeInput.options[i].value===data.formatType){
+                this.datatypeInput.options[i].set("selected", true);
+                break;
+            }
+        }
+
+        switch (data.formatType){
+            case "textValue":
+                this.valueTextInput.set("value", data.value);
+                if (this.valueTextInput2) this.valueTextInput2.set("value", data.otherValue);
+                break;
+            case "numberValue":
+                this.valueNumberInput.set("value", data.value);
+                if (this.valueNumberInput2) this.valueNumberInput2.set("value", data.otherValue);
+                break;
+            case "datetimeValue":
+            case "dateTimeValue":
+                this.valueDatetimeInput.set("value", data.value);
+                if (this.valueDatetimeInput2) this.valueDatetimeInput2.set("value", data.otherValue);
+                break;
+            case "dateValue":
+                this.valueDateInput.set("value", data.value);
+                if (this.valueDateInput2) this.valueDateInput2.set("value", data.otherValue);
+                break;
+            case "timeValue":
+                this.valueTimeInput.set("value", data.value);
+                if (this.valueTimeInput2) this.valueTimeInput2.set("value", data.otherValue);
+                break;
+            case "booleanValue":
+
+                for (var i=0; i<this.valueBooleanInput.options.length; i++){
+                    var v = this.valueBooleanInput.options[i].value;
+                    if (v=="true"){
+                        v = true;
+                    }else{
+                        v = false;
+                    }
+                    if (v===data.value){
+                        this.valueBooleanInput.options[i].set("selected", true);
+                        break;
+                    }
+                }
+                if (this.valueBooleanInput2){
+                    for (var i=0; i<this.valueBooleanInput2.options.length; i++){
+                        var v = this.valueBooleanInput2.options[i].value;
+                        if (v=="true"){
+                            v = true;
+                        }else{
+                            v = false;
+                        }
+                        if (v===data.otherValue){
+                            this.valueBooleanInput2.options[i].set("selected", true);
+                            break;
+                        }
+                    }
+                }
+                break;
+        }
+        this.scriptData = data.code;
+        try{
+            if (this.scriptArea && this.scriptArea.editor) this.scriptArea.editor.setValue(this.scriptData.code);
+        }catch (e) {}
+
+        debugger;
+        if( data.type === "custom" ){
+            this.customFilterValueTypes.each( function (radio) {
+                if( data.valueType ){
+                    if( data.valueType === radio.get("value") )radio.set("checked", true);
+                }else{
+                    if( "input" === radio.get("value") )radio.set("checked", true);
+                }
+            });
+            if ( this.customFilterValueScriptArea ){
+                if( !data.valueType || data.valueType === "input" ){
+                    this.customFilterValueScriptDiv.hide();
+                    this.customFilterValueScriptData = "";
+                    this.customFilterValueScriptArea.editor.setValue( "" );
+                }else{
+                    this.customFilterValueScriptDiv.show();
+                    this.customFilterValueScriptData = data.valueScript;
+                    this.customFilterValueScriptArea.editor.setValue( data.valueScript ? data.valueScript.code : "" );
+                }
+            }
+        }
+
+
+        this.switchInputDisplay();
+        if(this.datatypeInput.onchange){
+            this.datatypeInput.onchange();
+        }
+    },
+
+    deleteItem: function(item){
+        if (this.currentFilterItem == item) item.unSelected();
+        this.items.erase(item);
+        item.node.destroy();
+        MWF.release(item);
+        this.fireEvent("change");
+    },
+    getData: function(){
+        var data = [];
+        var customData = [];
+        this.items.each(function(item){
+            if (item.data.type==="custom"){
+                customData.push(item.data);
+            }else{
+                data.push(item.data);
+            }
+        }.bind(this));
+        return {"data": data, "customData": customData};
+    }
+});
+
+
+
+MWF.xApplication.query.ViewDesigner.widget.ViewFilter.Item = new Class({
+    Implements: [Events],
+    initialize: function(filter, data){
+        this.filter = filter;
+        this.data = data;
+        this.container = this.filter.listAreaNode;
+        this.css = this.filter.css;
+        this.app = this.filter.app;
+        this.load();
+    },
+    load: function(){
+        this.node = new Element("div", {"styles": this.css.itemNode}).inject(this.container);
+        this.deleteNode = new Element("div", {"styles": this.css.itemDeleteNode}).inject(this.node);
+        this.contentNode = new Element("div", {"styles": this.css.itemContentNode}).inject(this.node);
+        this.contentNode.set("text", this.getText());
+
+        this.contentNode.addEvent("click", function(){
+            this.selected();
+        }.bind(this));
+
+        this.deleteNode.addEvent("click", function(e){
+            this.deleteItem(e);
+        }.bind(this));
+    },
+    getText: function(){
+        var lp = this.app.lp.filter;
+        if( this.data.formatType === "numberValue" ){
+            return lp[this.data.logic]+" "+this.data.path+" "+lp[this.data.comparison] + " "+this.data.value+((this.data.comparison=="range") ? ", \""+this.data.otherValue+"\"" : "");
+        }else{
+            return lp[this.data.logic]+" "+this.data.path+" "+lp[this.data.comparison] + " \""+this.data.value+"\""+((this.data.comparison=="range") ? ", \""+this.data.otherValue+"\"" : "");
+        }
+    },
+    reload: function(data){
+        this.data = data;
+        this.contentNode.set("text", this.getText());
+    },
+    selected: function(){
+        this.filter.restrictFilterInput.set("checked", true);
+        this.filter.restrictFilterInput.click();
+        if (this.filter.currentFilterItem) this.filter.currentFilterItem.unSelected();
+        this.node.setStyles(this.css.itemNode_current);
+        this.filter.currentFilterItem = this;
+        this.filter.setData(this.data);
+    },
+    unSelected: function(){
+        this.node.setStyles(this.css.itemNode);
+        this.filter.currentFilterItem = null;
+        this.filter.currentItem = this;
+    },
+    deleteItem: function(e){
+        var _self = this;
+        this.filter.app.confirm("warn", e, this.app.lp.delete_filterItem_title, this.app.lp.delete_filterItem, 300, 120, function(){
+            _self.destroy();
+            this.close();
+        }, function(){
+            this.close();
+        });
+    },
+    destroy: function(){
+        this.filter.deleteItem(this);
+    }
+});
+MWF.xApplication.query.ViewDesigner.widget.ViewFilter.ItemCustom = new Class({
+    Extends: MWF.xApplication.query.ViewDesigner.widget.ViewFilter.Item,
+    initialize: function(filter, data){
+        this.filter = filter;
+        this.data = data;
+        this.container = this.filter.fieldListAreaNode;
+        this.css = this.filter.css;
+        this.app = this.filter.app;
+        this.load();
+    },
+    selected: function(){
+        this.filter.customFilterInput.set("checked", true);
+        this.filter.customFilterInput.click();
+        if (this.filter.currentFilterItem) this.filter.currentFilterItem.unSelected();
+        this.node.setStyles(this.css.itemNode_current);
+        this.filter.currentFilterItem = this;
+        this.filter.setData(this.data);
+    },
+    getText: function(){
+        var lp = this.app.lp.filter;
+        return this.data.title+"("+this.data.path+")";
+    }
+});

+ 17 - 15
o2web/source/x_component_query_StatementDesigner/$Statement/statementDesigner.html

@@ -91,18 +91,20 @@
     </div>
 </div>
 
-<div class="o2_statement_statementRunNode">
-    <div class="o2_statement_statementRunTitleNode">{{$.lp.runTest}}</div>
-    <div class="o2_statement_statementRunContentNode">
-        <div class="o2_statement_statementRunJsonNode">
-<!--            <div class="o2_statement_statementRunJsonContent"></div>-->
-        </div>
-        <div class="o2_statement_statementRunActionNode">
-            <div class="o2_statement_statementRunActionContent"></div>
-        </div>
-        <div class="o2_statement_statementRunResultNode">
-<!--            <div class="o2_statement_statementRunResultContent"></div>-->
-        </div>
-    </div>
-
-</div>
+<!--<div class="o2_statement_statementRunNode">-->
+<!--    <div class="o2_statement_statementRunTitleNode">{{$.lp.runTest}}</div>-->
+<!--    <div class="o2_statement_statementRunContentNode">-->
+<!--        <div class="o2_statement_statementRunJsonNode">-->
+<!--&lt;!&ndash;            <div class="o2_statement_statementRunJsonContent"></div>&ndash;&gt;-->
+<!--        </div>-->
+<!--        <div class="o2_statement_statementRunActionNode">-->
+<!--            <div class="o2_statement_statementRunActionContent"></div>-->
+<!--        </div>-->
+<!--        <div class="o2_statement_statementRunResultNode">-->
+<!--&lt;!&ndash;            <div class="o2_statement_statementRunResultContent"></div>&ndash;&gt;-->
+<!--        </div>-->
+<!--    </div>-->
+
+<!--</div>-->
+
+<div class="o2_statement_viewNode"></div>

+ 428 - 0
o2web/source/x_component_query_StatementDesigner/$Statement/view.html

@@ -0,0 +1,428 @@
+<div style="background-color: #FFF; overflow: hidden">
+    <div title="基本" class="MWFTab">
+        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+            <tr>
+                <td class="editTableTitle">标识:</td>
+                <td class="editTableValue">text{$.id}</td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">名称:</td>
+                <td class="editTableValue"><input type="text" name="name" value="text{$.name}" class="editTableInput"/></td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">描述:</td>
+                <td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">隐藏:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="display" text{($.display===false)?'checked':''} type="radio" value="false"/>是
+                    <input class="editTableRadio" name="display" text{($.display!==false)?'checked':''} type="radio" value="true"/>否
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">视图样式:</td>
+                <td class="editTableValue">
+                    <select class="MWFViewStyle" name="data.viewStyleType"></select>
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">展开分类:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="data.isExpand" text{($.data.isExpand==='yes')?'checked':''} type="radio" value="yes"/>是
+                    <input class="editTableRadio" name="data.isExpand" text{($.data.isExpand!=='yes')?'checked':''} type="radio" value="no"/>否
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">显示序号:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="data.isSequence" text{($.data.isSequence==='yes')?'checked':''} type="radio" value="yes"/>是
+                    <input class="editTableRadio" name="data.isSequence" text{($.data.isSequence!=='yes')?'checked':''} type="radio" value="no"/>否
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitleNoWidth">最大行数:</td>
+                <td class="editTableValue"><input type="number" name="count" value="text{$.count || 600}" class="editTableInput"/></td>
+            </tr>
+            <tr>
+                <td class="editTableTitleNoWidth">每页行数:</td>
+                <td class="editTableValue">
+                    <input type="number" name="pageSize" value="text{$.pageSize || 20}" class="editTableInput"/>
+                    <div style="color:#999;">注:每页最大行数为2000条</div>
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">隐藏操作条:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="data.actionbarHidden" text{($.data.actionbarHidden!==false)?'checked':''} type="radio" value="true"/>是
+                    <input class="editTableRadio" name="data.actionbarHidden" text{($.data.actionbarHidden===false)?'checked':''} type="radio" value="false"/>否
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">选择:</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="data.select" text{($.data.select!=='single' || $.data.select!=='multi' )?'checked':''} type="radio" value="none"/>无
+                    <input class="editTableRadio" name="data.select" text{($.data.select==='single')?'checked':''} type="radio" value="single"/>单选
+                    <input class="editTableRadio" name="data.select" text{($.data.select==='multi')?'checked':''} type="radio" value="multi"/>多选
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">无分类和选择隐藏首列</td>
+                <td class="editTableValue">
+                    <input class="editTableRadio" name="data.firstTdHidden" text{($.data.firstTdHidden===true)?'checked':''} type="radio" value="single"/>是
+                    <input class="editTableRadio" name="data.firstTdHidden" text{($.data.firstTdHidden!==true)?'checked':''} type="radio" value="multi"/>否
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">无数据显示:</td>
+                <td class="editTableValue">
+                    <input type="text" name="data.noDataText" value="text{$.data.noDataText}" class="editTableInput"/>
+                </td>
+            </tr>
+            <!--<tr>-->
+            <!--<td class="editTableTitle">最大行数:</td>-->
+            <!--<td class="editTableValue"><input type="text" name="max" value="text{$.max}" class="editTableInput"/></td>-->
+            <!--</tr>-->
+        </table>
+
+        <div style="height:24px; text-align: center; line-height: 24px; background-color: #EEE; border-top: 1px solid #999; font-weight: bold">权限</div>
+        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable" id="processEditStarter">
+            <tr>
+                <td class="editTableTitle">可执行人:</td>
+                <td class="editTableValue">
+                    <div class="MWFPersonIdentity" name="availableIdentityList"></div>
+                </td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">执行组织:</td>
+                <td class="editTableValue">
+                    <div class="MWFPersonUnit" name="availableUnitList"></div>
+                </td>
+            </tr>
+            <!--<tr>-->
+            <!--<td class="editTableTitle">执行部门:</td>-->
+            <!--<td class="editTableValue">-->
+            <!--<div class="MWFSelectDepartment" name="availableDepartmentList"></div>-->
+            <!--</td>-->
+            <!--</tr>-->
+            <!--<tr>-->
+            <!--<td class="editTableTitle">执行公司:</td>-->
+            <!--<td class="editTableValue">-->
+            <!--<div class="MWFSelectCompany" name="availableCompanyList"></div>-->
+            <!--</td>-->
+            <!--</tr>-->
+        </table>
+
+        <div class="MWFFormulaArea" name="data.defaultSelectedScript" title="默认选中行脚本"></div>
+
+
+
+        <!--<div class="MWFApplicationSelect" title="选择应用"></div>-->
+        <!--<div class="MWFProcessSelect" title="选择流程"></div>-->
+        <!--<div class="MWFCompanySelect" title="选择公司"></div>-->
+        <!--<div class="MWFDepartmentSelect" title="选择部门"></div>-->
+        <!--<div class="MWFPersonSelect" title="选择人员"></div>-->
+        <!--<div class="MWFIdentitySelect" title="选择身份"></div>-->
+    </div>
+
+    <div title="过滤"  class="MWFTab">
+        <div class="MWFViewFilter">
+            <div class="inputAreaNode_vf">
+                <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable restrictViewFilterTable_vf">
+                    <tr>
+                        <td class="editTableTitle">标题:</td>
+                        <td class="editTableValue"><input type="text" class="editTableInput titleInput_vf"/></td>
+                    </tr>
+                    <tr>
+                        <td class="editTableTitle">路径:</td>
+                        <td class="editTableValue"><input type="text" class="editTableInput pathInput_vf"/></td>
+                    </tr>
+                    <tr>
+                        <td class="editTableTitle">数据类型:</td>
+                        <td class="editTableValue"><select class="datatypeInput_vf"
+                                onchange="if (this.selectedIndex==2){
+                                    $('text{$.id}viewFilterDateFormulaSelector').setStyle('display', 'block');
+                                    // $('text{$.id}viewFilterDateFormulaSelector2').setStyle('display', 'block');
+                                    $('text{$.id}viewFilterDateOnlyFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterDateOnlyFormulaSelector2').setStyle('display', 'none');
+                                    $('text{$.id}viewFilterTimeOnlyFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterTimeOnlyFormulaSelector2').setStyle('display', 'none');
+                                }else if (this.selectedIndex==3){
+                                    $('text{$.id}viewFilterDateFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterDateFormulaSelector2').setStyle('display', 'none');
+                                    $('text{$.id}viewFilterDateOnlyFormulaSelector').setStyle('display', 'block');
+                                    // $('text{$.id}viewFilterDateOnlyFormulaSelector2').setStyle('display', 'block');
+                                    $('text{$.id}viewFilterTimeOnlyFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterTimeOnlyFormulaSelector2').setStyle('display', 'none');
+                                }else if (this.selectedIndex==4){
+                                    $('text{$.id}viewFilterDateFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterDateFormulaSelector2').setStyle('display', 'none');
+                                    $('text{$.id}viewFilterDateOnlyFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterDateOnlyFormulaSelector2').setStyle('display', 'none');
+                                    $('text{$.id}viewFilterTimeOnlyFormulaSelector').setStyle('display', 'block');
+                                    // $('text{$.id}viewFilterTimeOnlyFormulaSelector2').setStyle('display', 'block');
+                                }else{
+                                    $('text{$.id}viewFilterDateFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterDateFormulaSelector2').setStyle('display', 'none');
+                                    $('text{$.id}viewFilterDateOnlyFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterDateOnlyFormulaSelector2').setStyle('display', 'none');
+                                    $('text{$.id}viewFilterTimeOnlyFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterTimeOnlyFormulaSelector2').setStyle('display', 'none');
+                                }
+
+                                if (this.selectedIndex==0){
+                                    $('text{$.id}viewFilterTextFormulaSelector').setStyle('display', 'block');
+                                    // $('text{$.id}viewFilterTextFormulaSelector2').setStyle('display', 'block')
+                                }else{
+                                    $('text{$.id}viewFilterTextFormulaSelector').setStyle('display', 'none');
+                                    // $('text{$.id}viewFilterTextFormulaSelector2').setStyle('display', 'none')
+                                }">
+                            <option value="textValue" selected>文本</option>
+                            <option value="numberValue">数字</option>
+                            <option value="dateTimeValue">日期时间</option>
+                            <option value="dateValue">日期</option>
+                            <option value="timeValue">时间</option>
+                            <option value="booleanValue">布尔</option>
+                        </select></td>
+                    </tr>
+                    <tr>
+                        <td class="editTableTitle"></td>
+                        <td class="editTableValue">
+                            <input type="radio" class="restrictFilterInput_vf" value="restrict" name="text{$.id}viewFilterType" onclick="if (this.checked){
+                                $('text{$.id}viewFilterRestrict').setStyle('display', 'block');
+                                $('text{$.id}viewCustomFilterRestrict').setStyle('display', 'none');
+                            }"/>作为默认过滤条件<br>
+                            <input type="radio" class="customFilterInput_vf" value="custom" name="text{$.id}viewFilterType" onclick="if (this.checked){
+                                $('text{$.id}viewFilterRestrict').setStyle('display', 'none');
+                                $('text{$.id}viewCustomFilterRestrict').setStyle('display', 'block');
+                            }" checked/>作为自定义过滤数据
+                        </td>
+                    </tr>
+                </table>
+                <div id="text{$.id}viewFilterRestrict"  style="display: none">
+                    <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                        <tr>
+                            <td class="editTableTitle">逻辑:</td>
+                            <td class="editTableValue"><select class="logicInput_vf">
+                                <option selected value="and">并且(and)</option>
+                                <option value="or">或者(or)</option>
+                            </select></td>
+                        </tr>
+
+                        <tr>
+                            <td class="editTableTitle">比较:</td>
+                            <td class="editTableValue"><select class="comparisonInput_vf" onchange="
+                                // if (this.selectedIndex==8){
+                                //     $('text{$.id}viewFilterValue2Area').setStyle('display', 'block');
+                                //     $('text{$.id}viewFilterValueTitleArea').set('text', '从');
+                                // }else{
+                                //     $('text{$.id}viewFilterValue2Area').setStyle('display', 'none');
+                                //     $('text{$.id}viewFilterValueTitleArea').set('text', '值');
+                                // }"
+                                >
+                                <option value="equals" selected>等于(==)</option>
+                                <option value="notEquals">不等于(!=)</option>
+                                <option value="greaterThan">大于(>)</option>
+                                <option value="greaterThanOrEqualTo">大于等于(>=)</option>
+                                <option value="lessThan">小于(<)</option>
+                                <option value="lessThanOrEqualTo">小于等于(<=)</option>
+                                <option value="like">匹配(like)</option>
+                                <option value="notLike">不匹配(not-like)</option>
+                                <option value="range">范围(range)</option>
+                            </select></td>
+                        </tr>
+                        <tr>
+                            <td class="editTableTitle" id="text{$.id}viewFilterValueTitleArea">值:</td>
+                            <td class="editTableValue" id="text{$.id}viewFilterValueArea">
+                                <input type="text" class="editTableInput valueTextInput_vf" style="display: block" onkeypress="$('text{$.id}viewFilterTextFormulaSelector').getElements('input').set('checked', false)"/>
+                                <input type="number" class="editTableInput valueNumberInput_vf" style="display: none"/>
+                                <input type="text" class="editTableInput valueDatetimeInput_vf" style="display: none" readonly/>
+                                <input type="text" class="editTableInput valueDateInput_vf" style="display: none" readonly/>
+                                <input type="text" class="editTableInput valueTimeInput_vf" style="display: none" readonly/>
+                                <select class="valueBooleanInput_vf" style="display: none">
+                                    <option value="true" selected>是(True)</option>
+                                    <option value="false">否(False)</option>
+                                </select>
+                            </td>
+                        </tr>
+
+                    </table>
+                    <div style="display: none" id="text{$.id}viewFilterDateFormulaSelector">
+                        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                            <tr>
+                                <td class="editTableTitle"></td>
+                                <td class="editTableValue">
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@year" />当前年度
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@season" />当前季度
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@month" />当前月份<br/>
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@time" />当前时间
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDatetimeInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@date" />当天
+
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
+                    <div style="display: none" id="text{$.id}viewFilterDateOnlyFormulaSelector">
+                        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                            <tr>
+                                <td class="editTableTitle"></td>
+                                <td class="editTableValue">
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDateInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@year" />当前年度
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDateInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@season" />当前季度
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDateInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@month" />当前月份<br/>
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueDateInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@date" />当天
+
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
+                    <div style="display: none" id="text{$.id}viewFilterTimeOnlyFormulaSelector">
+                        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                            <tr>
+                                <td class="editTableTitle"></td>
+                                <td class="editTableValue">
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueTimeInput_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@time" />当前时间
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
+
+                    <div style="display: block" id="text{$.id}viewFilterTextFormulaSelector">
+                        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                            <tr>
+                                <td class="editTableTitle"></td>
+                                <td class="editTableValue">
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueTextInput_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula" onclick="" type="radio" value="@person" />当前人
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueTextInput_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula" type="radio" value="@identityList" />当前身份<br/>
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueTextInput_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula" type="radio" value="@unitList" />当前人所在直接组织<br/>
+                                    <input onclick="$('text{$.id}viewFilterValueArea').getElement('.valueTextInput_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula" type="radio" value="@unitAllList" />当前人所在所有组织
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
+
+                    <div id="text{$.id}viewFilterValue2Area"  style="display: none">
+                        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                            <tr>
+                                <td class="editTableTitle">到:</td>
+                                <td class="editTableValue" id="text{$.id}viewFilterValueArea2">
+                                    <input type="text" class="editTableInput valueTextInput2_vf" style="display: block">
+<!--                                    onkeypress="$('text{$.id}viewFilterTextFormulaSelector2').getElements('input').set('checked', false)"/>-->
+                                    <input type="number" class="editTableInput valueNumberInput2_vf" style="display: none"/>
+                                    <input type="text" class="editTableInput valueDatetimeInput2_vf" style="display: none" readonly/>
+                                    <input type="text" class="editTableInput valueDateInput2_vf" style="display: none" readonly/>
+                                    <input type="text" class="editTableInput valueTimeInput2_vf" style="display: none" readonly/>
+                                    <select class="valueBooleanInput2_vf" style="display: none">
+                                        <option value="true" selected>是(True)</option>
+                                        <option value="false">否(False)</option>
+                                    </select>
+                                </td>
+                            </tr>
+                        </table>
+
+<!--       rang的时候,所有@xxx都是无效的
+                            <div style="display: none" id="text{$.id}viewFilterDateFormulaSelector2">-->
+<!--                            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">-->
+<!--                                <tr>-->
+<!--                                    <td class="editTableTitle"></td>-->
+<!--                                    <td class="editTableValue">-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDatetimeInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula2" type="radio" value="@year" />当前年度-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDatetimeInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula2" type="radio" value="@season" />当前季度-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDatetimeInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula2" type="radio" value="@month" />当前月份<br/>-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDatetimeInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula2" type="radio" value="@time" />当前时间-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDatetimeInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula2" type="radio" value="@date" />当天-->
+
+<!--                                    </td>-->
+<!--                                </tr>-->
+<!--                            </table>-->
+<!--                        </div>-->
+<!--                        <div style="display: none" id="text{$.id}viewFilterDateOnlyFormulaSelector2">-->
+<!--                            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">-->
+<!--                                <tr>-->
+<!--                                    <td class="editTableTitle"></td>-->
+<!--                                    <td class="editTableValue">-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDateInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@year" />当前年度-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDateInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@season" />当前季度-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDateInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@month" />当前月份<br/>-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueDateInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@date" />当天-->
+
+<!--                                    </td>-->
+<!--                                </tr>-->
+<!--                            </table>-->
+<!--                        </div>-->
+<!--                        <div style="display: none" id="text{$.id}viewFilterTimeOnlyFormulaSelector2">-->
+<!--                            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">-->
+<!--                                <tr>-->
+<!--                                    <td class="editTableTitle"></td>-->
+<!--                                    <td class="editTableValue">-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueTimeInput2_vf').set('value', this.value)" name="text{$.id}viewFilterDateFormula" type="radio" value="@time" />当前时间-->
+<!--                                    </td>-->
+<!--                                </tr>-->
+<!--                            </table>-->
+<!--                        </div>-->
+<!--                        <div style="display: block" id="text{$.id}viewFilterTextFormulaSelector2">-->
+<!--                            <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">-->
+<!--                                <tr>-->
+<!--                                    <td class="editTableTitle"></td>-->
+<!--                                    <td class="editTableValue">-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueTextInput2_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula2" onclick="" type="radio" value="@person" />当前人-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueTextInput2_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula2" type="radio" value="@identityList" />当前身份<br/>-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueTextInput2_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula2" type="radio" value="@unitList" />当前人所在直接组织<br/>-->
+<!--                                        <input onclick="$('text{$.id}viewFilterValueArea2').getElement('.valueTextInput2_vf').set('value', this.value)" name="text{$.id}viewFilterTextFormula2" type="radio" value="@unitAllList" />当前人所在所有组织-->
+<!--                                    </td>-->
+<!--                                </tr>-->
+<!--                            </table>-->
+<!--                        </div>-->
+                    </div>
+
+                </div>
+                <div id="text{$.id}viewCustomFilterRestrict"  style="display: block">
+                    <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+                        <tr>
+                            <td class="editTableTitle">值:</td>
+                            <td class="editTableValue">
+                                <input class="editTableRadio" onclick="
+                                if (this.checked){
+                                    $('text{$.id}viewCustomFilterValueScriptDiv').setStyle('display', 'none');
+                                }" name="viewCustomFilterValueType" checked type="radio" value="input"/>输入
+                                <input class="editTableRadio" onclick="
+                                if (this.checked){
+                                    $('text{$.id}viewCustomFilterValueScriptDiv').setStyle('display', 'block');
+                                }" name="viewCustomFilterValueType" type="radio" value="script"/>可选
+                            </td>
+                        </tr>
+                    </table>
+                    <div style="display:none" id="text{$.id}viewCustomFilterValueScriptDiv">
+                        <div style="padding: 5px">return ["选项文本|选项值"]</div>
+                        <div name="text{$.id}viewCustomFilterValueScript" title="选项脚本"></div>
+                    </div>
+                </div>
+            </div>
+            <div class="actionAreaNode_vf"></div>
+            <div style="height: 20px; line-height: 20px; text-align:center; background-color: #eeeeee">默认过滤条件</div>
+            <div class="listAreaNode_vf" style="min-height: 56px; border-bottom:1px solid #CCCCCC; overflow: hidden;"></div>
+            <div style="height: 20px; line-height: 20px; text-align:center; background-color: #eeeeee">自定义过滤数据</div>
+            <div class="fieldListAreaNode_vf" style="min-height: 56px; border-bottom:1px solid #CCCCCC; overflow: hidden;"></div>
+        </div>
+    </div>
+
+<!--    <div title="样式"  class="MWFTab">-->
+<!--        <div class="MWFMaplist" name="tableStyles" collapse="true" title="表格样式"></div>-->
+<!--        <div class="MWFMaplist" name="titleTdStyles" collapse="true" title="标题单元格样式"></div>-->
+<!--        <div class="MWFMaplist" name="contentTdStyles" collapse="true" title="内容单元格样式"></div>-->
+<!--        <div class="MWFMaplist" name="contentTdOverStyles" collapse="true" title="内容单元格鼠标over事件样式"></div>-->
+<!--        <div class="MWFMaplist" name="contentTdSelectedStyles" collapse="true" title="内容单元格选中样式"></div>-->
+<!--    </div>-->
+
+    <div title="样式"  class="MWFTab">
+        <div class="MWFViewStylesArea" name="data.viewStyles"></div>
+    </div>
+
+    <div title="事件"  class="MWFTab">
+        <div class="MWFEventsArea" name="data.events"></div>
+    </div>
+
+    <div title="JSON"  class="MWFTab">
+        <div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
+    </div>
+</div>

+ 68 - 0
o2web/source/x_component_query_StatementDesigner/$Statement/view.json

@@ -0,0 +1,68 @@
+{
+  "name": "",
+  "id": "",
+  "query": "",
+  "alias": "",
+  "description": "",
+  "display": true,
+  "type": "View",
+
+  "data": {
+    "exportGrid": true,
+    "exportGoupGrid": true,
+    "noDataText" : "未找到数据",
+    "selectList": [],
+    "filterList": [],
+    "orderList": [],
+    "group": {},
+    "columnList": [],
+    "calculate": {},
+    "afterGridScriptText": "",
+    "afterGroupGridScriptText": "",
+    "afterCalculateGridScriptText": "",
+    "events": {
+      "queryLoad" : {
+        "code": "",
+        "html": ""
+      },
+      "postLoad": {
+        "code": "",
+        "html": ""
+      },
+      "postLoadPageData" : {
+        "code": "",
+        "html": ""
+      },
+      "postLoadPage": {
+        "code": "",
+        "html": ""
+      },
+      "queryLoadItemRow": {
+        "code": "",
+        "html": ""
+      },
+      "postLoadItemRow": {
+        "code": "",
+        "html": ""
+      },
+      "queryLoadCategoryRow": {
+        "code": "",
+        "html": ""
+      },
+      "postLoadCategoryRow": {
+        "code": "",
+        "html": ""
+      },
+      "selectRow" : {
+        "code": "",
+        "html": ""
+      },
+      "unselectRow" : {
+        "code": "",
+        "html": ""
+      }
+    }
+  },
+  "availableIdentityList": [],
+  "availableUnitList": []
+}

+ 42 - 40
o2web/source/x_component_query_StatementDesigner/Main.js

@@ -299,20 +299,22 @@ MWF.xApplication.query.StatementDesigner.Main = new Class({
             "styles": this.css.designerContentNode
         }).inject(this.designerNode);
 
-        // this.designerStatementArea = new Element("div", {
-        //     "styles": this.css.designerStatementArea
-        // }).inject(this.designerContentNode);
-        //
-        // this.designerStatementPercent = 0.6;
-        // this.designerContentResizeNode = new Element("div", {
-        //     "styles": this.css.designerContentResizeNode
-        // }).inject(this.designerContentNode);
+        this.designerStatementArea = new Element("div", {
+            "styles": this.css.designerStatementArea
+        }).inject(this.designerContentNode);
+        this.propertyDomArea = this.designerStatementArea;
+
+        this.designerStatementPercent = 0.6;
+        this.designerContentResizeNode = new Element("div", {
+            "styles": this.css.designerContentResizeNode
+        }).inject(this.designerContentNode);
 
         this.designerContentArea = new Element("div", {
             "styles": this.css.designerContentArea
         }).inject(this.designerContentNode);
+        this.propertyContentArea = this.designerContentArea;
 
-        //this.loadDesignerStatementResize();
+        this.loadDesignerStatementResize();
         //this.setPropertyContent();
         this.designerNode.addEvent("keydown", function(e){e.stopPropagation();});
     },
@@ -348,37 +350,37 @@ MWF.xApplication.query.StatementDesigner.Main = new Class({
             }.bind(this)
         });
     },
-    // loadDesignerStatementResize: function(){
-    //     this.designerContentResize = new Drag(this.designerContentResizeNode, {
-    //         "snap": 1,
-    //         "onStart": function(el, e){
-    //             var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x;
-    //             var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
-    //             el.store("position", {"x": x, "y": y});
-    //
-    //             var size = this.designerStatementArea.getSize();
-    //             el.store("initialHeight", size.y);
-    //         }.bind(this),
-    //         "onDrag": function(el, e){
-    //             var size = this.designerContentNode.getSize();
-    //
-    //             //			var x = e.event.x;
-    //             var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
-    //             var position = el.retrieve("position");
-    //             var dy = y.toFloat()-position.y.toFloat();
-    //
-    //             var initialHeight = el.retrieve("initialHeight").toFloat();
-    //             var height = initialHeight+dy;
-    //             if (height<40) height = 40;
-    //             if (height> size.y-40) height = size.y-40;
-    //
-    //             this.designerStatementPercent = height/size.y;
-    //
-    //             this.setDesignerStatementResize();
-    //
-    //         }.bind(this)
-    //     });
-    // },
+    loadDesignerStatementResize: function(){
+        this.designerContentResize = new Drag(this.designerContentResizeNode, {
+            "snap": 1,
+            "onStart": function(el, e){
+                var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x;
+                var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
+                el.store("position", {"x": x, "y": y});
+
+                var size = this.designerStatementArea.getSize();
+                el.store("initialHeight", size.y);
+            }.bind(this),
+            "onDrag": function(el, e){
+                var size = this.designerContentNode.getSize();
+
+                //			var x = e.event.x;
+                var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y;
+                var position = el.retrieve("position");
+                var dy = y.toFloat()-position.y.toFloat();
+
+                var initialHeight = el.retrieve("initialHeight").toFloat();
+                var height = initialHeight+dy;
+                if (height<40) height = 40;
+                if (height> size.y-40) height = size.y-40;
+
+                this.designerStatementPercent = height/size.y;
+
+                this.setDesignerStatementResize();
+
+            }.bind(this)
+        });
+    },
     setDesignerStatementResize: function(){
         var size = this.designerContentNode.getSize();
         //var resizeNodeSize = this.designerContentResizeNode.getSize();

+ 24 - 652
o2web/source/x_component_query_StatementDesigner/Property.js

@@ -1,48 +1,17 @@
 MWF.require("MWF.widget.Common", null, false);
 MWF.require("MWF.widget.JsonTemplate", null, false);
-MWF.xApplication.query.TableDesigner.Property = MWF.FTProperty = new Class({
-	Extends: MWF.widget.Common,
-	Implements: [Options, Events],
-	options: {
-		"style": "default",
-		"path": "../x_component_query_FormDesigner/property/property.html"
-	},
-	
-	initialize: function(module, propertyNode, designer, options){
-		this.setOptions(options);
-		this.module = module;
-		this.view = module.view;
-		this.data = module.json;
-		this.htmlPath = this.options.path;
-		this.designer = designer;
-		
-		this.propertyNode = propertyNode;
-	},
-	load: function(){
-		if (this.fireEvent("queryLoad")){
-			MWF.getRequestText(this.htmlPath, function(responseText, responseXML){
-				this.htmlString = responseText;
-                this.fireEvent("postLoad");
-			}.bind(this));
-		}
-        this.propertyNode.addEvent("keydown", function(e){e.stopPropagation();});
-	},
-	editProperty: function(td){
-	},
-    getHtmlString: function(callback){
-        if (!this.htmlString){
-            MWF.getRequestText(this.htmlPath, function(responseText, responseXML){
-                this.htmlString = responseText;
-                if (callback) callback();
-            }.bind(this));
-        }else{
-            if (callback) callback();
-        }
-    },
-	show: function(){
-        if (!this.propertyContent){
-            this.getHtmlString(function(){
-                if (this.htmlString){
+
+MWF.xDesktop.requireApp("query.ViewDesigner", "Property", null, false);
+MWF.xApplication.query.StatementDesigner.Property = MWF.SDProperty = new Class({
+    Extends: MWF.xApplication.query.ViewDesigner.Property,
+    Implements: [Options, Events],
+    options: {
+        "style": "default"
+    },
+    show: function () {
+        if (!this.propertyContent) {
+            this.getHtmlString(function () {
+                if (this.htmlString) {
                     this.JsonTemplate = new MWF.widget.JsonTemplate(this.data, this.htmlString);
                     this.propertyContent = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.propertyNode);
                     this.propertyContent.set("html", this.JsonTemplate.load());
@@ -52,621 +21,24 @@ MWF.xApplication.query.TableDesigner.Property = MWF.FTProperty = new Class({
                     this.loadPropertyTab();
                     this.loadPersonInput();
                     this.loadPersonSelectInput();
-                    // this.loadViewSelect();
-                    // this.loadStatColumnSelect();
-                    this.loadArrayList();
+                    this.loadViewFilter();
                     this.loadScriptArea();
-                    this.loadJSONArea();
-
-                    //this.view.changeViewSelected();
-                    //this.module.changeViewSelected();
-                }
-            }.bind(this));
-        }else{
-            this.propertyContent.setStyle("display", "block");
-        }
-	},
-	hide: function(){
-		//this.JsonTemplate = null;
-		//this.propertyNode.set("html", "");
-        if (this.propertyContent) this.propertyContent.setStyle("display", "none");
-	},
 
-	loadJSONArea: function(){
-		var jsonNode = this.propertyContent.getElement(".MWFJSONArea");
+                    this.loadColumnExportEditor();
 
-        if (jsonNode){
-            this.propertyTab.pages.each(function(page){
-                if (page.contentNode == jsonNode.parentElement){
-                    page.setOptions({
-                        "onShow": function(){
-                            jsonNode.empty();
-                            MWF.require("MWF.widget.JsonParse", function(){
-                                this.json = new MWF.widget.JsonParse(this.module.json, jsonNode, null);
-                                this.json.load();
-                            }.bind(this));
-                        }.bind(this)
-                    });
-                }
-            }.bind(this));
-        }
-	},
-	loadPropertyTab: function(){
-		var tabNodes = this.propertyContent.getElements(".MWFTab");
-		if (tabNodes.length){
-			var tmpNode = this.propertyContent.getFirst();
-			var tabAreaNode = new Element("div", {
-				"styles": this.view.css.propertyTabNode
-			}).inject(tmpNode, "before");
-			
-			MWF.require("MWF.widget.Tab", function(){
-				var tab = new MWF.widget.Tab(tabAreaNode, {"style": "formPropertyList"});
-				tab.load();
-				var tabPages = [];
-				tabNodes.each(function(node){
-					var page = tab.addTab(node, node.get("title"), false);
-					tabPages.push(page);
-					this.setScrollBar(page.contentNodeArea, "small", null, null);
-				}.bind(this));
-				tabPages[0].showTab();
-				
-				this.propertyTab = tab;
-				
-				this.designer.resizeNode();
-			}.bind(this), false);
-		}
-	},
-	
-	setEditNodeEvent: function(){
-		var property = this;
-	//	var inputs = this.process.propertyListNode.getElements(".editTableInput");
-		var inputs = this.propertyContent.getElements("input");
-		inputs.each(function(input){
-			var jsondata = input.get("name");
-            if (jsondata && jsondata.substr(0,1)!="_"){
-                if (this.module){
-                    var id = this.module.json.id;
-                    input.set("name", id+jsondata);
-                }
-
-                if (jsondata){
-                    var inputType = input.get("type").toLowerCase();
-                    switch (inputType){
-                        case "radio":
-                            input.addEvent("change", function(e){
-                                property.setRadioValue(jsondata, this);
-                            });
-                            //input.addEvent("blur", function(e){
-                            //    property.setRadioValue(jsondata, this);
-                            //});
-                            input.addEvent("keydown", function(e){
-                                e.stopPropagation();
-                            });
-                            property.setRadioValue(jsondata, input);
-                            break;
-                        case "checkbox":
-
-                            input.addEvent("change", function(e){
-                                property.setCheckboxValue(jsondata, this);
-                            });
-                            input.addEvent("click", function(e){
-                                property.setCheckboxValue(jsondata, this);
-                            });
-                            input.addEvent("keydown", function(e){
-                                e.stopPropagation();
-                            });
-                            break;
-                        default:
-                            input.addEvent("change", function(e){
-                                property.setValue(jsondata, this.value, this);
-                            });
-                            input.addEvent("blur", function(e){
-                                property.setValue(jsondata, this.value, this);
-                            });
-                            input.addEvent("keydown", function(e){
-                                if (e.code==13){
-                                    property.setValue(jsondata, this.value, this);
-                                }
-                                e.stopPropagation();
-                            });
-                            if (input.hasClass("editTableInputDate")){
-                                this.loadCalendar(input);
-                            }
-                    }
-                }
-            }
-		}.bind(this));
-		
-		var selects = this.propertyContent.getElements("select");
-		selects.each(function(select){
-			var jsondata = select.get("name");
-			if (jsondata){
-				select.addEvent("change", function(e){
-					property.setSelectValue(jsondata, this);
-				});
-                //property.setSelectValue(jsondata, select);
-			}
-		});
-		
-		var textareas = this.propertyContent.getElements("textarea");
-		textareas.each(function(input){
-			var jsondata = input.get("name");
-			if (jsondata){
-				input.addEvent("change", function(e){
-					property.setValue(jsondata, this.value);
-				});
-				input.addEvent("blur", function(e){
-					property.setValue(jsondata, this.value);
-				});
-                input.addEvent("keydown", function(e){
-                    e.stopPropagation();
-                });
-			}
-		}.bind(this));
-		
-	},
-    loadCalendar: function(node){
-        MWF.require("MWF.widget.Calendar", function(){
-            this.calendar = new MWF.widget.Calendar(node, {
-                "style": "xform",
-                "isTime": false,
-                "target": this.module.designer.content,
-                "format": "%Y-%m-%d",
-                "onComplate": function(){
-                    //this.validationMode();
-                    //this.validation();
-                    //this.fireEvent("complete");
-                }.bind(this)
-            });
-            //this.calendar.show();
-        }.bind(this));
-    },
-    changeStyle: function(name){
-        this.module.setPropertiesOrStyles(name);
-    },
-    changeData: function(name, input, oldValue){
-        this.module._setEditStyle(name, input, oldValue);
-    },
-    changeJsonDate: function(key, value){
-        if (typeOf(key)!="array") key = [key];
-        var o = this.data;
-        var len = key.length-1;
-        key.each(function(n, i){
-            if (!o[n]) o[n] = {};
-            if (i<len) o = o[n];
-        }.bind(this));
-        o[key[len]] = value;
-    },
-	setRadioValue: function(name, input){
-
-		if (input.checked){
-            var i = name.indexOf("*");
-            var names = (i==-1) ? name.split(".") : name.substr(i+1, name.length).split(".");
-
-			var value = input.value;
-			if (value=="false") value = false;
-			if (value=="true") value = true;
-
-            var oldValue = this.data;
-            for (var idx = 0; idx<names.length; idx++){
-                if (!oldValue[names[idx]]){
-                    oldValue = null;
-                    break;
-                }else{
-                    oldValue = oldValue[names[idx]];
-                }
-            }
-
-			//var oldValue = this.data[name];
-			this.changeJsonDate(names, value);
-            this.changeData(name, input, oldValue);
-		}
-	},
-	setCheckboxValue: function(name, input){
-        var i = name.indexOf("*");
-        var names = (i==-1) ? name.split(".") : name.substr(i+1, name.length).split(".");
-
-        var id = this.module.json.id;
-        var checkboxList = $$("input[name='"+id+name+"']");
-		var values = [];
-		checkboxList.each(function(checkbox){
-			if (checkbox.get("checked")){
-				values.push(checkbox.value);
-			}
-		});
-        var o = this.data;
-        names.each(function(k){ o = o[k]; }.bind(this));
-		var oldValue = o;
-
-        this.changeJsonDate(names, values);
-        this.changeData(name, input, oldValue);
-	},
-	setSelectValue: function(name, select){
-		var idx = select.selectedIndex;
-		var options = select.getElements("option");
-		var value = "";
-		if (options[idx]){
-			value = options[idx].get("value");
-		}
-		var oldValue = this.data[name];
-		//this.data[name] = value;
-        var names = name.split(".");
-        this.changeJsonDate(names, value);
-        this.changeData(name, select, oldValue);
-	},
-	
-	setValue: function(name, value, obj){
-        var names = name.split(".");
-        var oldValue = this.data;
-        for (var idx = 0; idx<names.length; idx++){
-            if (!oldValue[names[idx]]){
-                oldValue = null;
-                break;
-            }else{
-                oldValue = oldValue[names[idx]];
-            }
-        }
-
-		//var oldValue = this.data[name];
-		//this.data[name] = value;
-        this.changeJsonDate(names, value);
-        this.changeData(name, obj, oldValue);
-	},
-	setEditNodeStyles: function(node){
-		var nodes = node.getChildren();
-		if (nodes.length){
-			nodes.each(function(el){
-				var cName = el.get("class");
-				if (cName){
-					if (this.view.css[cName]) el.setStyles(this.view.css[cName]);
-				}
-				this.setEditNodeStyles(el);
-			}.bind(this));
-		}
-	},
-    loadPersonInput: function(){
-        var personIdentityNodes = this.propertyContent.getElements(".MWFPersonIdentity");
-        var personUnitNodes = this.propertyContent.getElements(".MWFPersonUnit");
-        var dutyNodes = this.propertyContent.getElements(".MWFDutySelector");
-        var dutyNameNodes = this.propertyContent.getElements(".MWFPersonDuty");
-        var viewNodes = this.propertyContent.getElements(".MWFViewSelect");
-        var cmsviewNodes = this.propertyContent.getElements(".MWFCMSViewSelect");
-        var queryviewNodes = this.propertyContent.getElements(".MWFQueryViewSelect");
-        var querystatNodes = this.propertyContent.getElements(".MWFQueryStatSelect");
-        MWF.xDesktop.requireApp("process.ProcessDesigner", "widget.PersonSelector", function(){
-            personIdentityNodes.each(function(node){
-                new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-                    "type": "identity",
-                    "names": this.data[node.get("name")],
-                    "onChange": function(ids){this.savePersonItem(node, ids);}.bind(this)
-                });
-            }.bind(this));
-
-            personUnitNodes.each(function(node){
-                new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-                    "type": "unit",
-                    "names": this.data[node.get("name")],
-                    "onChange": function(ids){this.savePersonItem(node, ids);}.bind(this)
-                });
-            }.bind(this));
-            dutyNodes.each(function(node){
-                new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-                    "type": "duty",
-                    "names": this.data[node.get("name")],
-                    "onChange": function(ids){this.addDutyItem(node, ids);}.bind(this),
-                    "onRemoveDuty": function(item){this.removeDutyItem(node, item);}.bind(this)
-                });
-            }.bind(this));
-
-            dutyNameNodes.each(function(node){
-                new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-                    "type": "dutyName",
-                    "names": this.data[node.get("name")],
-                    "onChange": function(ids){this.savePersonItem(node, ids);}.bind(this)
-                });
-            }.bind(this));
-
-            viewNodes.each(function(node){
-                new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-                    "type": "View",
-                    "count": 1,
-                    "names": [this.data[node.get("name")]],
-                    "onChange": function(ids){this.saveViewItem(node, ids);}.bind(this)
-                });
-            }.bind(this));
-            cmsviewNodes.each(function(node){
-                new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-                    "type": "CMSView",
-                    "count": 1,
-                    "names": [this.data[node.get("name")]],
-                    "onChange": function(ids){this.saveViewItem(node, ids);}.bind(this)
-                });
-            }.bind(this));
-            queryviewNodes.each(function(node){
-                new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-                    "type": "QueryView",
-                    "count": 1,
-                    "names": [this.data[node.get("name")]],
-                    "onChange": function(ids){this.saveViewItem(node, ids);}.bind(this)
-                });
-            }.bind(this));
-
-            querystatNodes.each(function(node){
-                new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-                    "type": "QueryStat",
-                    "count": 1,
-                    "names": [this.data[node.get("name")]],
-                    "onChange": function(ids){this.saveViewItem(node, ids);}.bind(this)
-                });
-            }.bind(this));
-        }.bind(this));
-        // var identityNodes = this.propertyContent.getElements(".MWFPersonIdentity");
-        // var personUnitNodes = this.propertyContent.getElements(".MWFPersonUnit");
-        //
-        // MWF.xDesktop.requireApp("process.ProcessDesigner", "widget.PersonSelector", function(){
-        //     identityNodes.each(function(node){
-        //         new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-        //             "type": "identity",
-        //             "names": this.data[node.get("name")],
-        //             "onChange": function(ids){this.savePersonItem(node, ids);}.bind(this)
-        //         });
-        //     }.bind(this));
-        //
-        //     personUnitNodes.each(function(node){
-        //         new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-        //             "type": "unit",
-        //             "names": this.data[node.get("name")],
-        //             "onChange": function(ids){this.savePersonItem(node, ids);}.bind(this)
-        //         });
-        //     }.bind(this));
-        // }.bind(this));
-    },
-    saveViewItem: function(node, ids){
-        var oldValue = this.data[node.get("name")];
-        if (ids[0]){
-            var view = ids[0].data;
-            var data = {
-                "name": view.name,
-                "alias": view.alias,
-                "id": view.id,
-                "appName" : view.appName || view.applicationName,
-                "appId": view.appId,
-                "application": view.application
-            };
-            this.data[node.get("name")] = view.id;
-        }else{
-            this.data[node.get("name")] = null;
-        }
-        this.changeData(node.get("name"), node, oldValue);
-        //if (this.module._checkView) this.module._checkView();
-    },
-    removeViewItem: function(node, item){
-
-    },
-    savePersonItem: function(node, ids){
-        var values = [];
-        ids.each(function(id){
-            //values.push({"name": (id.data.distinguishedName || id.data.name), "id": id.data.id});
-            values.push((id.data.distinguishedName || id.data.id || id.data.name));
-        }.bind(this));
-        var name = node.get("name");
-
-        key = name.split(".");
-        var o = this.data;
-        var len = key.length-1;
-        key.each(function(n, i){
-            if (!o[n]) o[n] = {};
-            if (i<len) o = o[n];
-        }.bind(this));
-        o[key[len]] = values;
-
-        //this.data.data.restrictWhereEntry[node.get("name")] = values;
-    },
-
-    loadPersonSelectInput: function(){
-        var applicationNodes = this.propertyContent.getElements(".MWFSelectApplication");
-        var processNodes = this.propertyContent.getElements(".MWFSelectProcess");
-        // var companyNodes = this.propertyContent.getElements(".MWFSelectCompany");
-        // var departmentNodes = this.propertyContent.getElements(".MWFSelectDepartment");
-        var personNodes = this.propertyContent.getElements(".MWFSelectPerson");
-        var identityNodes = this.propertyContent.getElements(".MWFSelectIdentity");
-        var personUnitNodes = this.propertyContent.getElements(".MWFSelectUnit");
-
-        MWF.xDesktop.requireApp("process.ProcessDesigner", "widget.PersonSelector", function(){
-            applicationNodes.each(function(node){
-                new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-                    "type": "application",
-                    "names": (this.data.data.restrictWhereEntry) ? this.data.data.restrictWhereEntry.applicationList : [],
-                    "onChange": function(ids){this.savePersonSelectItem(node, ids);}.bind(this)
-                });
-            }.bind(this));
-            processNodes.each(function(node){
-                new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-                    "type": "process",
-                    "names": (this.data.data.restrictWhereEntry) ? this.data.data.restrictWhereEntry.processList : [],
-                    "onChange": function(ids){this.savePersonSelectItem(node, ids);}.bind(this)
-                });
-            }.bind(this));
-            personUnitNodes.each(function(node){
-                new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-                    "type": "unit",
-                    "names": (this.data.data.restrictWhereEntry) ? this.data.data.restrictWhereEntry.unitList : [],
-                    "onChange": function(ids){this.savePersonSelectItem(node, ids);}.bind(this)
-                });
-            }.bind(this));
-
-            personNodes.each(function(node){
-                new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-                    "type": "person",
-                    "names": (this.data.data.restrictWhereEntry) ? this.data.data.restrictWhereEntry.personList : [],
-                    "onChange": function(ids){this.savePersonSelectItem(node, ids);}.bind(this)
-                });
-            }.bind(this));
-
-            identityNodes.each(function(node){
-                new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.view.designer, {
-                    "type": "identity",
-                    "names": (this.data.data.restrictWhereEntry) ? this.data.data.restrictWhereEntry.identityList : [],
-                    "onChange": function(ids){this.savePersonSelectItem(node, ids);}.bind(this)
-                });
-            }.bind(this));
-        }.bind(this));
-    },
-    savePersonSelectItem: function(node, ids){
-        //this.initWhereEntryData();
-
-        var values = [];
-        ids.each(function(id){
-            values.push({"name": id.data.name, "id": id.data.id});
-        }.bind(this));
-        var name = node.get("name");
-
-        key = name.split(".");
-        var o = this.data;
-        var len = key.length-1;
-        key.each(function(n, i){
-            if (!o[n]) o[n] = {};
-            if (i<len) o = o[n];
-        }.bind(this));
-        o[key[len]] = values;
-
-        //this.data.data.restrictWhereEntry[node.get("name")] = values;
-    },
-
-    loadArrayList: function(){
-        var arrays = this.propertyContent.getElements(".MWFArraylist");
-        arrays.each(function(node){
-            var title = node.get("title");
-            var name = node.get("name");
+                    this.loadJSONArea();
 
-            var names = name.split(".");
-            var arr = this.data;
-            for (var idx = 0; idx<names.length; idx++){
-                if (!arr[names[idx]]){
-                    arr = null;
-                    break;
-                }else{
-                    arr = arr[names[idx]];
+                    this.loadEventsEditor();
+                    this.loadViewStylesArea();
+                    this.loadPagingStylesArea();
+                    this.loadActionStylesArea();
+                    this.loadActionArea();
+                    this.loadStylesList();
+                    this.loadMaplist();
                 }
-            }
-            //var arr = this.data[name];
-            if (!arr) arr = [];
-            MWF.require("MWF.widget.Arraylist", function(){
-                var arraylist = new MWF.widget.Arraylist(node, {
-                    "title": title,
-                    "onChange": function(){
-                        this.setValue(name, arraylist.toArray(), node);
-
-                        //this.data[name] = arraylist.toArray();
-                    }.bind(this)
-                });
-                arraylist.load(arr);
-            }.bind(this));
-            node.addEvent("keydown", function(e){e.stopPropagation();});
-        }.bind(this));
-    },
-
-    loadStatColumnSelect: function(){
-        var columnNodes = this.propertyContent.getElements(".MWFStatSelectColumn");
-        if (columnNodes.length){
-            columnNodes.each(function(node){
-                var key = node.get("name");
-                var v = this.data[key];
-                node.empty();
-                new Element("option", {
-                    "value": "",
-                    "selected": true,
-                    "text": this.module.designer.lp.category
-                }).inject(node);
-                this.module.items.each(function(item){
-                    new Element("option", {
-                        "value": item.json.id,
-                        "selected": (v===item.json.id),
-                        "text": item.json.displayName
-                    }).inject(node);
-                }.bind(this));
             }.bind(this));
+        } else {
+            this.propertyContent.setStyle("display", "block");
         }
-    },
-    // loadViewSelect: function(){
-    //     var viewNodes = this.propertyContent.getElements(".MWFViewSelect");
-    //     if (viewNodes.length){
-    //         this.getViewList(function(){
-    //             viewNodes.each(function(node){
-    //                 var select = new Element("select").inject(node);
-    //                 select.addEvent("change", function(e){
-    //                     var viewId = e.target.options[e.target.selectedIndex].value;
-    //                     var viewName = e.target.options[e.target.selectedIndex].get("text");
-    //                     this.setValue(e.target.getParent("div").get("name"), viewId);
-    //                     this.setValue(e.target.getParent("div").get("name")+"Name", viewName);
-    //                 }.bind(this));
-    //                 this.setViewSelectOptions(node, select);
-    //
-    //                 var refreshNode = new Element("div", {"styles": this.view.css.propertyRefreshFormNode}).inject(node);
-    //                 refreshNode.addEvent("click", function(e){
-    //                     this.getViewList(function(){
-    //                         this.setViewSelectOptions(node, select);
-    //                     }.bind(this), true);
-    //                 }.bind(this));
-    //                 //select.addEvent("click", function(e){
-    //                 //    this.setFormSelectOptions(node, select);
-    //                 //}.bind(this));
-    //             }.bind(this));
-    //         }.bind(this));
-    //     }
-    // },
-    // setViewSelectOptions: function(node, select){
-    //     var name = node.get("name");
-    //     select.empty();
-    //     var option = new Element("option", {"text": "(none)"}).inject(select);
-    //     this.views.each(function(view){
-    //         var option = new Element("option", {
-    //             "text": view.name,
-    //             "value": view.id,
-    //             "selected": (this.data[name]==view.id)
-    //         }).inject(select);
-    //     }.bind(this));
-    // },
-    // getViewList: function(callback, refresh){
-    //     if (!this.views || refresh){
-    //         this.view.designer.actions.listView(this.view.designer.application.id, function(json){
-    //             this.views = json.data;
-    //             if (callback) callback();
-    //         }.bind(this));
-    //     }else{
-    //         if (callback) callback();
-    //     }
-    // },
-    loadScriptArea: function(){
-
-        var scriptAreas = this.propertyContent.getElements(".MWFScriptArea");
-        var formulaAreas = this.propertyContent.getElements(".MWFFormulaArea");
-        this.loadScriptEditor(scriptAreas);
-        this.loadScriptEditor(formulaAreas, "formula");
-    },
-    loadScriptEditor: function(scriptAreas, style){
-        scriptAreas.each(function(node){
-            var title = node.get("title");
-            var name = node.get("name");
-            var scriptContent = this.data[name];
-
-            MWF.require("MWF.widget.ScriptArea", function(){
-                var scriptArea = new MWF.widget.ScriptArea(node, {
-                    "title": title,
-                    //"maxObj": this.propertyNode.parentElement.parentElement.parentElement,
-                    "maxObj": this.designer.editContentNode,
-                    "onChange": function(){
-                        this.data[name] = scriptArea.toJson().code;
-                    }.bind(this),
-                    "onSave": function(){
-                        this.designer.saveView();
-                    }.bind(this),
-                    "style": style || "default",
-                    "runtime": "server"
-                });
-                scriptArea.load({"code": scriptContent});
-            }.bind(this));
-
-        }.bind(this));
     }
 });

+ 660 - 41
o2web/source/x_component_query_StatementDesigner/Statement.js

@@ -4,8 +4,8 @@ MWF.xApplication.query.StatementDesigner = MWF.xApplication.query.StatementDesig
 MWF.APPDSMD = MWF.xApplication.query.StatementDesigner;
 
 MWF.xDesktop.requireApp("query.StatementDesigner", "lp."+MWF.language, null, false);
-//MWF.xDesktop.requireApp("query.StatementDesigner", "Property", null, false);
-MWF.xDesktop.requireApp("query.TableDesigner", "Property", null, false);
+MWF.xDesktop.requireApp("query.StatementDesigner", "Property", null, false);
+MWF.xDesktop.requireApp("query.ViewDesigner", "View", null, false);
 o2.require("o2.widget.JavascriptEditor", null, false);
 
 MWF.xApplication.query.StatementDesigner.Statement = new Class({
@@ -89,7 +89,7 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
     },
     showProperty: function(){
         if (!this.property){
-            this.property = new MWF.xApplication.query.TableDesigner.Property(this, this.designer.designerContentArea, this.designer, {
+            this.property = new MWF.xApplication.query.StatementDesigner.Property(this, this.designer.designerContentArea, this.designer, {
                 "path": this.options.propertyPath,
                 "onPostLoad": function(){
                     this.property.show();
@@ -135,15 +135,20 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
             this.jpqlEditorNode = this.areaNode.getElement(".o2_statement_statementDesignerJpqlLine");
 
 
-            this.runArea = this.areaNode.getElement(".o2_statement_statementRunNode");
-            this.runTitleNode = this.areaNode.getElement(".o2_statement_statementRunTitleNode");
-            this.runContentNode = this.areaNode.getElement(".o2_statement_statementRunContentNode");
-            this.runJsonNode = this.runContentNode.getFirst();
-            this.runActionNode = this.runJsonNode.getNext();
-            this.runResultNode = this.runContentNode.getLast();
+            // this.runArea = this.areaNode.getElement(".o2_statement_statementRunNode");
+            // this.runTitleNode = this.areaNode.getElement(".o2_statement_statementRunTitleNode");
+            // this.runContentNode = this.areaNode.getElement(".o2_statement_statementRunContentNode");
+            // this.runJsonNode = this.runContentNode.getFirst();
+            // this.runActionNode = this.runJsonNode.getNext();
+            // this.runResultNode = this.runContentNode.getLast();
+            //
+            // this.setRunnerSize();
+            // this.designer.addEvent("resize", this.setRunnerSize.bind(this));
 
-            this.setRunnerSize();
-            this.designer.addEvent("resize", this.setRunnerSize.bind(this));
+            this.viewArea = this.areaNode.getElement(".o2_statement_viewNode");
+
+            this.setViewSize();
+            this.designer.addEvent("resize", this.setViewSize.bind(this));
 
             if (this.json.format=="script"){
                 this.loadStatementScriptEditor();
@@ -151,7 +156,8 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
                 this.loadStatementEditor();
             }
 
-            this.loadStatementRunner();
+            // this.loadStatementRunner();
+            this.loadView();
             this.setEvent();
         }.bind(this));
     },
@@ -171,23 +177,23 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
             }.bind(this), false);
         }
     },
-    setRunnerSize: function(){
-        debugger;
-        var size = this.areaNode.getSize();
-        var designerSize = this.designerArea.getComputedSize();
-        var y = size.y-designerSize.totalHeight;
-        var mTop = this.runArea.getStyle("margin-top").toInt();
-        var mBottom = this.runArea.getStyle("margin-bottom").toInt();
-        var pTop = this.runArea.getStyle("padding-top").toInt();
-        var pBottom = this.runArea.getStyle("padding-bottom").toInt();
-        y = y-mTop-mBottom-pTop-pBottom-1;
-
-        this.runArea.setStyle("height", ""+y+"px");
-
-        var titleSize = this.runTitleNode.getComputedSize();
-        y = y - titleSize.totalHeight;
-        this.runContentNode.setStyle("height", ""+y+"px");
-    },
+    // setRunnerSize: function(){
+    //     debugger;
+    //     var size = this.areaNode.getSize();
+    //     var designerSize = this.designerArea.getComputedSize();
+    //     var y = size.y-designerSize.totalHeight;
+    //     var mTop = this.runArea.getStyle("margin-top").toInt();
+    //     var mBottom = this.runArea.getStyle("margin-bottom").toInt();
+    //     var pTop = this.runArea.getStyle("padding-top").toInt();
+    //     var pBottom = this.runArea.getStyle("padding-bottom").toInt();
+    //     y = y-mTop-mBottom-pTop-pBottom-1;
+    //
+    //     this.runArea.setStyle("height", ""+y+"px");
+    //
+    //     var titleSize = this.runTitleNode.getComputedSize();
+    //     y = y - titleSize.totalHeight;
+    //     this.runContentNode.setStyle("height", ""+y+"px");
+    // },
     loadStatementEditor: function(){
         if (!this.editor){
             o2.require("o2.widget.JavascriptEditor", function(){
@@ -276,14 +282,14 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
             if (callback) callback();
         }.bind(this));
     },
-    loadStatementRunner: function(){
-        o2.require("o2.widget.JavascriptEditor", function(){
-            this.jsonEditor = new o2.widget.JavascriptEditor(this.runJsonNode, {"title": "JPQL", "option": {"mode": "json"}});
-            this.jsonEditor.load(function(){
-                this.jsonEditor.editor.setValue("{}");
-            }.bind(this));
-        }.bind(this), false);
-    },
+    // loadStatementRunner: function(){
+    //     o2.require("o2.widget.JavascriptEditor", function(){
+    //         this.jsonEditor = new o2.widget.JavascriptEditor(this.runJsonNode, {"title": "JPQL", "option": {"mode": "json"}});
+    //         this.jsonEditor.load(function(){
+    //             this.jsonEditor.editor.setValue("{}");
+    //         }.bind(this));
+    //     }.bind(this), false);
+    // },
     setEvent: function(){
         this.formatTypeArea.getElements("input").addEvent("click", function(e){
             if (e.target.checked){
@@ -379,7 +385,8 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
         //     }
         }.bind(this));
 
-        this.runActionNode.getFirst().addEvent("click", this.runStatement.bind(this));
+        // this.runActionNode.getFirst().addEvent("click", this.runStatement.bind(this));
+
         this.dynamicTableSelect.addEvent("click", this.selectTable.bind(this));
         this.jpqlTypeSelect.addEvent("change", function(){
             var t = this.jpqlTypeSelect.options[this.jpqlTypeSelect.selectedIndex].value;
@@ -423,9 +430,9 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
             var o = JSON.parse(json);
             o2.Actions.get("x_query_assemble_designer").executeStatement(this.json.id, 1, 50 , o, function(json){
                 o2.require("o2.widget.JsonParse", function(){
-                    this.runResultNode.empty();
-                    var jsonResult = new o2.widget.JsonParse(json.data, this.runResultNode);
-                    jsonResult.load();
+                    // this.runResultNode.empty();
+                    // var jsonResult = new o2.widget.JsonParse(json.data, this.runResultNode);
+                    // jsonResult.load();
                 }.bind(this));
                 this.runMask.hide();
             }.bind(this), function(xhr, text, error){
@@ -488,5 +495,617 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
             }
             if (callback) callback();
         }.bind(this));
+    },
+
+    loadView : function(){
+        if( !this.data.view )this.data.view = {};
+        this.view = new MWF.xApplication.query.StatementDesigner.View(this.designer, this, this.data.view, {});
+        this.view.load();
+    },
+    setViewSize: function(){
+        debugger;
+        var size = this.areaNode.getSize();
+        var designerSize = this.designerArea.getComputedSize();
+        var y = size.y-designerSize.totalHeight;
+        var mTop = this.viewArea.getStyle("margin-top").toInt();
+        var mBottom = this.viewArea.getStyle("margin-bottom").toInt();
+        var pTop = this.viewArea.getStyle("padding-top").toInt();
+        var pBottom = this.viewArea.getStyle("padding-bottom").toInt();
+        y = y-mTop-mBottom-pTop-pBottom-1;
+
+        this.viewArea.setStyle("height", ""+y+"px");
+
+        // var titleSize = this.runTitleNode.getComputedSize();
+        // y = y - titleSize.totalHeight;
+        // this.runContentNode.setStyle("height", ""+y+"px");
+    }
+});
+
+MWF.xApplication.query.StatementDesigner.View = new Class({
+    Extends: MWF.xApplication.query.ViewDesigner.View,
+    Implements: [Options, Events],
+    options: {
+        "style": "default",
+        "isView": false,
+        "showTab": true,
+        "propertyPath": "../x_component_query_StatementDesigner/$Statement/view.html"
+    },
+
+    initialize: function(designer, statement, data, options){
+        this.setOptions(options);
+
+        this.path = "../x_component_query_ViewDesigner/$View/";
+        this.cssPath = "../x_component_query_ViewDesigner/$View/"+this.options.style+"/css.wcss";
+
+        this._loadCss();
+
+        this.statement = statement;
+        this.designer = designer;
+        this.data = data;
+
+        // if (!this.data.data) this.data.data = {};
+        this.parseData();
+
+        this.node = this.statement.viewArea;
+        //this.tab = this.designer.tab;
+
+        this.areaNode = new Element("div", {"styles": {"height": "100%", "overflow": "auto"}});
+
+        //MWF.require("MWF.widget.ScrollBar", function(){
+        //    new MWF.widget.ScrollBar(this.areaNode, {"distance": 100});
+        //}.bind(this));
+
+
+        // this.propertyListNode = this.designer.propertyDomArea;
+        //this.propertyNode = this.designer.propertyContentArea;
+
+        // if(this.designer.application) this.data.applicationName = this.designer.application.name;
+        // if(this.designer.application) this.data.application = this.designer.application.id;
+
+        // this.isNewView = (this.data.name) ? false : true;
+
+        this.items = [];
+        this.view = this;
+
+        // this.autoSave();
+        // this.designer.addEvent("queryClose", function(){
+        //     if (this.autoSaveTimerID) window.clearInterval(this.autoSaveTimerID);
+        // }.bind(this));
+    },
+    load : function(){
+        this.setAreaNodeSize();
+        this.designer.addEvent("resize", this.setAreaNodeSize.bind(this));
+        this.areaNode.inject(this.node);
+
+        this.domListNode = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.designer.propertyDomArea);
+
+        this.loadTemplateStyle( function () {
+
+            this.loadActionbar();
+
+            this.loadView();
+
+            this.loadPaging();
+
+            this.selected();
+            this.setEvent();
+
+            //if (this.options.showTab) this.page.showTabIm();
+            this.setViewWidth();
+
+            this.designer.addEvent("resize", this.setViewWidth.bind(this));
+        }.bind(this))
+    },
+    parseData: function(){
+        this.json = this.data;
+        if( !this.json.data || !this.json.data.events ){
+            var url = "../x_component_query_StatementDesigner/$Statement/view.json";
+            MWF.getJSON(url, {
+                "onSuccess": function(obj){
+                    if(!this.json.data)this.json.data = obj.data;
+                    if(!this.json.data.events)this.json.data.events = obj.data.events;
+                }.bind(this),
+                "onerror": function(text){
+                    this.notice(text, "error");
+                }.bind(this),
+                "onRequestFailure": function(xhr){
+                    this.notice(xhr.responseText, "error");
+                }.bind(this)
+            },false);
+        }
+    },
+
+    showProperty: function(){
+        if (!this.property){
+            this.property = new MWF.xApplication.query.StatementDesigner.Property(this, this.designer.propertyContentArea, this.designer, {
+                "path": this.options.propertyPath,
+                "onPostLoad": function(){
+                    this.property.show();
+                }.bind(this)
+            });
+            this.property.load();
+        }else{
+            this.property.show();
+        }
+    },
+    hideProperty: function(){
+        if (this.property) this.property.hide();
+    },
+
+    loadViewData: function(){
+        if (this.data.id){
+            this.saveSilence(function(){
+                this.viewContentBodyNode.empty();
+                this.viewContentTableNode = new Element("table", {
+                    "styles": this.css.viewContentTableNode,
+                    "border": "0px",
+                    "cellPadding": "0",
+                    "cellSpacing": "0"
+                }).inject(this.viewContentBodyNode);
+
+                this.designer.actions.loadView(this.data.id, null,function(json){
+                    var entries = {};
+
+                    json.data.selectList.each(function(entry){entries[entry.column] = entry;}.bind(this));
+
+                    if (this.json.data.group.column){
+                        if (json.data.groupGrid.length){
+                            var groupColumn = null;
+                            for (var c = 0; c<json.data.selectList.length; c++){
+                                if (json.data.selectList[c].column === json.data.group.column){
+                                    groupColumn = json.data.selectList[c];
+                                    break;
+                                }
+                            }
+
+                            json.data.groupGrid.each(function(line, idx){
+                                var groupTr = new Element("tr", {
+                                    "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTr"] : this.css.viewContentTrNode,
+                                    "data-is-group" : "yes"
+                                }).inject(this.viewContentTableNode);
+                                var colSpan = this.items.length ;
+                                var td = new Element("td", {
+                                    "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentGroupTd"] : this.css.viewContentGroupTdNode,
+                                    "colSpan": colSpan
+                                }).inject(groupTr);
+
+                                var groupAreaNode;
+                                if( this.json.data.viewStyles ){
+                                    groupAreaNode = new Element("div", {"styles": this.json.data.viewStyles["groupCollapseNode"]}).inject(td);
+                                    groupAreaNode.set("text", line.group);
+                                }else{
+                                    groupAreaNode = new Element("div", {"styles": this.css.viewContentTdGroupNode}).inject(td);
+                                    var groupIconNode = new Element("div", {"styles": this.css.viewContentTdGroupIconNode}).inject(groupAreaNode);
+                                    var groupTextNode = new Element("div", {"styles": this.css.viewContentTdGroupTextNode}).inject(groupAreaNode);
+                                    if (groupColumn){
+                                        //groupTextNode.set("text", (groupColumn.code) ? MWF.Macro.exec(groupColumn.code, {"value": line.group, "gridData": json.data.groupGrid, "data": json.data, "entry": line}) : line.group);
+                                        groupTextNode.set("text", line.group);
+                                    }else{
+                                        groupTextNode.set("text", line.group);
+                                    }
+
+                                }
+
+
+
+                                var subtrs = [];
+
+                                line.list.each(function(entry){
+                                    var tr = new Element("tr", {
+                                        "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTr"] : this.css.viewContentTrNode
+                                    }).inject(this.viewContentTableNode);
+                                    tr.setStyle("display", "none");
+
+                                    //this.createViewCheckboxTd( tr );
+
+                                    var td = new Element("td", {
+                                        "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTd"] : this.css.viewContentTdNode
+                                    }).inject(tr);
+
+                                    Object.each(entries, function(c, k){
+                                        var d = entry.data[k];
+                                        if (d!=undefined){
+                                            if (k!=this.json.data.group.column){
+                                                var td = new Element("td", {
+                                                    "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTd"] : this.css.viewContentTdNode
+                                                }).inject(tr);
+                                                //td.set("text", (entries[k].code) ? MWF.Macro.exec(entries[k].code, {"value": d, "gridData": json.data.groupGrid, "data": json.data, "entry": entry}) : d);
+
+                                                if (c.isHtml){
+                                                    td.set("html", d);
+                                                }else{
+                                                    td.set("text", d);
+                                                }
+
+                                            }
+                                        }
+                                    }.bind(this));
+
+                                    // Object.each(entry.data, function(d, k){
+                                    //     if (k!=this.json.data.group.column){
+                                    //         var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
+                                    //         td.set("text", (entries[k].code) ? MWF.Macro.exec(entries[k].code, {"value": d, "gridData": json.data.groupGrid, "data": json.data, "entry": entry}) : d);
+                                    //     }
+                                    // }.bind(this));
+                                    subtrs.push(tr)
+                                }.bind(this));
+
+                                groupAreaNode.store("subtrs", subtrs);
+
+                                var _self = this;
+                                groupAreaNode.addEvent("click", function(){
+                                    var subtrs = this.retrieve("subtrs");
+                                    var iconNode = groupAreaNode.getFirst("div");
+                                    if (subtrs[0]){
+                                        if (subtrs[0].getStyle("display")=="none"){
+                                            subtrs.each(function(subtr){ subtr.setStyle("display", "table-row"); });
+                                            if( iconNode ) {
+                                                iconNode.setStyle("background", "url(" + "../x_component_process_StatementDesigner/$View/default/icon/down.png) center center no-repeat");
+                                            }else{
+                                                this.setStyles( _self.json.data.viewStyles["groupExpandNode"] )
+                                            }
+                                        }else{
+                                            subtrs.each(function(subtr){ subtr.setStyle("display", "none"); });
+                                            if( iconNode ) {
+                                                iconNode.setStyle("background", "url(" + "../x_component_process_StatementDesigner/$View/default/icon/right.png) center center no-repeat");
+                                            }else{
+                                                this.setStyles( _self.json.data.viewStyles["groupCollapseNode"] )
+                                            }
+                                        }
+                                    }
+                                    _self.setContentHeight();
+                                });
+                            }.bind(this));
+                            this.setContentColumnWidth();
+                            this.setContentHeight();
+                        }else if(this.json.data.noDataText){
+                            var noDataTextNodeStyle = this.css.noDataTextNode;
+                            if( this.json.data.viewStyles ){
+                                if( this.json.data.viewStyles["noDataTextNode"] ){
+                                    noDataTextNodeStyle = this.json.data.viewStyles["noDataTextNode"]
+                                }else{
+                                    this.json.data.viewStyles["noDataTextNode"] = this.css.noDataTextNode
+                                }
+                            }
+                            this.noDataTextNode = new Element( "div", {
+                                "styles": noDataTextNodeStyle,
+                                "text" : this.json.data.noDataText
+                            }).inject( this.viewContentBodyNode );
+                        }
+
+                    }else{
+
+                        if (json.data.grid.length){
+                            json.data.grid.each(function(line, idx){
+                                var tr = new Element("tr", {
+                                    "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTr"] : this.css.viewContentTrNode
+                                }).inject(this.viewContentTableNode);
+
+                                //this.createViewCheckboxTd( tr );
+
+                                Object.each(entries, function(c, k){
+                                    var d = line.data[k];
+                                    if (d!=undefined){
+                                        var td = new Element("td", {
+                                            "styles": this.json.data.viewStyles ? this.json.data.viewStyles["contentTd"] : this.css.viewContentTdNode
+                                        }).inject(tr);
+                                        //td.set("text", (entries[k].code) ? MWF.Macro.exec(entries[k].code, {"value": d, "gridData": json.data.grid, "data": json.data, "entry": line}) : d);
+                                        if (c.isHtml){
+                                            td.set("html", d);
+                                        }else{
+                                            td.set("text", d);
+                                        }
+                                        //td.set("text", d);
+                                    }
+                                }.bind(this));
+
+                                // Object.each(line.data, function(d, k){
+                                //     var td = new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr);
+                                //     td.set("text", (entries[k].code) ? MWF.Macro.exec(entries[k].code, {"value": d, "gridData": json.data.grid, "data": json.data, "entry": line}) : d);
+                                // }.bind(this));
+                            }.bind(this));
+                            this.setContentColumnWidth();
+                            this.setContentHeight();
+                        }else if(this.json.data.noDataText){
+                            var noDataTextNodeStyle = this.css.noDataTextNode;
+                            if( this.json.data.viewStyles ){
+                                if( this.json.data.viewStyles["noDataTextNode"] ){
+                                    noDataTextNodeStyle = this.json.data.viewStyles["noDataTextNode"]
+                                }else{
+                                    this.json.data.viewStyles["noDataTextNode"] = this.css.noDataTextNode
+                                }
+                            }
+                            this.noDataTextNode = new Element( "div", {
+                                "styles": noDataTextNodeStyle,
+                                "text" : this.json.data.noDataText
+                            }).inject( this.viewContentBodyNode );
+                        }
+                    }
+                }.bind(this));
+            }.bind(this));
+        }
+    },
+    addColumn: function(){
+
+        debugger;
+
+        MWF.require("MWF.widget.UUID", function(){
+            var id = (new MWF.widget.UUID).id;
+            var json = {
+                "id": id,
+                "column": id,
+                "displayName": this.designer.lp.unnamed,
+                "orderType": "original"
+            };
+            if (!this.json.data.selectList) this.json.data.selectList = [];
+            this.json.data.selectList.push(json);
+            var column = new MWF.xApplication.query.StatementDesigner.View.Column(json, this);
+            this.items.push(column);
+            column.selected();
+
+            if (this.viewContentTableNode){
+                var trs = this.viewContentTableNode.getElements("tr");
+                trs.each(function(tr){
+                    new Element("td", {"styles": this.css.viewContentTdNode}).inject(tr)
+                }.bind(this));
+                //this.setContentColumnWidth();
+            }
+            this.setViewWidth();
+            this.addColumnNode.scrollIntoView(true);
+
+        }.bind(this));
+        //new Fx.Scroll(this.view.areaNode, {"wheelStops": false, "duration": 0}).toRight();
+    },
+    unSelected: function(){
+        this.currentSelectedModule = null;
+        this.hideProperty();
+    },
+    loadViewColumns: function(){
+        //    for (var i=0; i<10; i++){
+        if (this.json.data.selectList) {
+            this.json.data.selectList.each(function (json) {
+                this.items.push(new MWF.xApplication.query.StatementDesigner.View.Column(json, this));
+
+            }.bind(this));
+        }
+        //    }
+    },
+    showActionbar : function( noSetHeight ){
+        this.actionbarNode.show();
+        if( !this.json.data.actionbarList )this.json.data.actionbarList = [];
+        if( !this.actionbarList || this.actionbarList.length == 0 ){
+            if( this.json.data.actionbarList.length ){
+                this.json.data.actionbarList.each( function(json){
+                    this.actionbarList.push( new MWF.xApplication.query.StatementDesigner.View.Actionbar( json, this.json.data.actionbarList, this) )
+                }.bind(this));
+            }else{
+                this.actionbarList.push( new MWF.xApplication.query.StatementDesigner.View.Actionbar( null, this.json.data.actionbarList, this) )
+            }
+        }
+        if( !noSetHeight )this.setContentHeight();
+    },
+    loadPaging: function( noSetHeight ){
+        this.pagingNode = new Element("div#pagingNode", {"styles": this.css.pagingNode}).inject(this.areaNode);
+        this.pagingList = [];
+        if( !this.json.data.pagingList )this.json.data.pagingList = [];
+        if( !this.pagingList || this.pagingList.length == 0 ){
+            if( this.json.data.pagingList.length ){
+                this.json.data.pagingList.each( function(json){
+                    this.pagingList.push( new MWF.xApplication.query.StatementDesigner.View.Paging( json, this.json.data.pagingList, this) )
+                }.bind(this));
+            }else{
+                this.pagingList.push( new MWF.xApplication.query.StatementDesigner.View.Paging( null, this.json.data.pagingList, this) )
+            }
+        }
+        // if( !noSetHeight )this.setContentHeight();
+    },
+    setViewWidth: function(){
+        if( !this.viewAreaNode )return;
+        this.viewAreaNode.setStyle("width", "auto");
+        this.viewTitleNode.setStyle("width", "auto");
+
+        var s1 = this.viewTitleTableNode.getSize();
+        var s2 = this.refreshNode.getSize();
+        var s3 = this.addColumnNode.getSize();
+        var width = s1.x+s2.x+s2.x;
+        var size = this.areaNode.getSize();
+
+        if (width>size.x){
+            this.viewTitleNode.setStyle("width", ""+width+"px");
+            this.viewAreaNode.setStyle("width", ""+width+"px");
+        }else{
+            this.viewTitleNode.setStyle("width", ""+size.x+"px");
+            this.viewAreaNode.setStyle("width", ""+size.x+"px");
+        }
+        this.setContentColumnWidth();
+        this.setContentHeight();
+    },
+
+
+    preview: function(){
+        if( this.isNewView ){
+            this.designer.notice( this.designer.lp.saveViewNotice, "error" );
+            return;
+        }
+        this.saveSilence( function () {
+            var url = "../x_desktop/app.html?app=query.Query&status=";
+            url += JSON.stringify({
+                id : this.data.application,
+                viewId : this.data.id
+            });
+            window.open(o2.filterUrl(url),"_blank");
+        }.bind(this));
+    },
+    saveSilence: function(callback){
+        if (!this.data.name){
+            this.designer.notice(this.designer.lp.notice.inputName, "error");
+            return false;
+        }
+
+        this.designer.actions.saveView(this.data, function(json){
+            this.data.id = json.data.id;
+            this.isNewView = false;
+            //this.page.textNode.set("text", this.data.name);
+            if (this.lisNode) {
+                this.lisNode.getLast().set("text", this.data.name+"("+this.data.alias+")");
+            }
+            if (callback) callback();
+        }.bind(this));
+    },
+    save: function(callback){
+        //if (this.designer.tab.showPage==this.page){
+        if (!this.data.name){
+            this.designer.notice(this.designer.lp.notice.inputName, "error");
+            return false;
+        }
+        //}
+        this.designer.actions.saveView(this.data, function(json){
+            this.designer.notice(this.designer.lp.notice.save_success, "success", this.node, {"x": "left", "y": "bottom"});
+            this.isNewView = false;
+            this.data.id = json.data.id;
+            //this.page.textNode.set("text", this.data.name);
+            if (this.lisNode) {
+                this.lisNode.getLast().set("text", this.data.name+"("+this.data.alias+")");
+            }
+            if (callback) callback();
+        }.bind(this));
+    },
+    _setEditStyle: function(name, input, oldValue){
+        if( name=="data.actionbarHidden" ){
+            if( this.json.data.actionbarHidden ){
+                this.hideActionbar()
+            }else{
+                this.showActionbar()
+            }
+        }
+        if( name=="data.selectAllEnable" ){
+            if( this.json.data.selectAllEnable ){
+                this.viewTitleTrNode.getElement(".viewTitleCheckboxTd").setStyle("display","table-cell");
+                this.viewContentTableNode.getElements(".viewContentCheckboxTd").setStyle("display","table-cell");
+            }else{
+                this.viewTitleTrNode.getElement(".viewTitleCheckboxTd").setStyle("display","none");
+                this.viewContentTableNode.getElements(".viewContentCheckboxTd").setStyle("display","none");
+            }
+        }
+        if (name=="data.viewStyleType"){
+
+            var file = (this.stylesList && this.json.data.viewStyleType) ? this.stylesList[this.json.data.viewStyleType].file : null;
+            var extendFile = (this.stylesList && this.json.data.viewStyleType) ? this.stylesList[this.json.data.viewStyleType].extendFile : null;
+            this.loadTemplateStyles( file, extendFile, function( templateStyles ){
+                this.templateStyles = templateStyles;
+
+                var oldFile, oldExtendFile;
+                if( oldValue && this.stylesList[oldValue] ){
+                    oldFile = this.stylesList[oldValue].file;
+                    oldExtendFile = this.stylesList[oldValue].extendFile;
+                }
+                this.loadTemplateStyles( oldFile, oldExtendFile, function( oldTemplateStyles ){
+
+                    this.json.data.styleConfig = (this.stylesList && this.json.data.viewStyleType) ? this.stylesList[this.json.data.viewStyleType] : null;
+
+                    if (oldTemplateStyles["view"]) this.clearTemplateStyles(oldTemplateStyles["view"]);
+                    if (this.templateStyles["view"]) this.setTemplateStyles(this.templateStyles["view"]);
+                    this.setAllStyles();
+
+                    this.actionbarList.each( function (module) {
+                        if (oldTemplateStyles["actionbar"]){
+                            module.clearTemplateStyles(oldTemplateStyles["actionbar"]);
+                        }
+                        module.setStyleTemplate();
+                        module.setAllStyles();
+                    })
+
+                    this.pagingList.each( function (module) {
+                        if (oldTemplateStyles["paging"]){
+                            module.clearTemplateStyles(oldTemplateStyles["paging"]);
+                        }
+                        module.setStyleTemplate();
+                        module.setAllStyles();
+                    });
+
+                    // this.moduleList.each(function(module){
+                    //     if (oldTemplateStyles[module.moduleName]){
+                    //         module.clearTemplateStyles(oldTemplateStyles[module.moduleName]);
+                    //     }
+                    //     module.setStyleTemplate();
+                    //     module.setAllStyles();
+                    // }.bind(this));
+                }.bind(this))
+
+            }.bind(this))
+        }
+        if (name=="data.viewStyles"){
+            this.setCustomStyles();
+        }
+    },
+    removeStyles: function(from, to){
+        if (this.json.data.viewStyles[to]){
+            Object.each(from, function(style, key){
+                if (this.json.data.viewStyles[to][key] && this.json.data.viewStyles[to][key]==style){
+                    delete this.json.data.viewStyles[to][key];
+                }
+            }.bind(this));
+        }
+    },
+    copyStyles: function(from, to){
+        if (!this.json.data.viewStyles[to]) this.json.data.viewStyles[to] = {};
+        Object.each(from, function(style, key){
+            if (!this.json.data.viewStyles[to][key]) this.json.data.viewStyles[to][key] = style;
+        }.bind(this));
+    },
+
+    saveAs: function(){
+        var form = new MWF.xApplication.query.StatementDesigner.View.NewNameForm(this, {
+            name : this.data.name + "_" + MWF.xApplication.query.StatementDesigner.LP.copy,
+            query : this.data.query || this.data.application,
+            queryName :	this.data.queryName || this.data.applicationName
+        }, {
+            onSave : function( data, callback ){
+                this._saveAs( data, callback );
+            }.bind(this)
+        }, {
+            app: this.designer
+        });
+        form.edit()
+    },
+    _saveAs : function( data , callback){
+        var _self = this;
+
+        var d = this.cloneObject( this.data );
+
+        d.isNewView = true;
+        d.id = this.designer.actions.getUUID();
+        d.name = data.name;
+        d.alias = "";
+        d.query = data.query;
+        d.queryName = data.queryName;
+        d.application = data.query;
+        d.applicationName = data.queryName;
+        d.pid = d.id + d.id;
+
+        delete d[this.data.id+"viewFilterType"];
+        d[d.id+"viewFilterType"]="custom";
+
+        d.data.selectList.each( function( entry ){
+            entry.id = (new MWF.widget.UUID).id;
+        }.bind(this));
+
+        this.designer.actions.saveView(d, function(json){
+            this.designer.notice(this.designer.lp.notice.saveAs_success, "success", this.node, {"x": "left", "y": "bottom"});
+            if (callback) callback();
+        }.bind(this));
     }
+
+});
+
+MWF.xApplication.query.StatementDesigner.View.Column = new Class({
+    Extends: MWF.xApplication.query.ViewDesigner.View.Column
+});
+
+MWF.xApplication.query.StatementDesigner.View.Actionbar = new Class({
+    Extends: MWF.xApplication.query.ViewDesigner.View.Actionbar
+});
+
+MWF.xApplication.query.StatementDesigner.View.Paging = new Class({
+    Extends: MWF.xApplication.query.ViewDesigner.View.Paging
 });

+ 6 - 53
o2web/source/x_component_query_StatementDesigner/lp/zh-cn.js

@@ -1,4 +1,8 @@
-MWF.xApplication.query.StatementDesigner.LP = {
+MWF.xApplication.query = MWF.xApplication.query || {};
+MWF.xApplication.query.StatementDesigner = MWF.xApplication.query.StatementDesigner || {};
+MWF.xApplication.query.ViewDesigner = MWF.xApplication.query.ViewDesigner || {};
+MWF.xDesktop.requireApp("query.ViewDesigner", "lp."+MWF.language, null, false);
+MWF.xApplication.query.StatementDesigner.LP = Object.merge( MWF.xApplication.query.ViewDesigner.LP, {
     "title": "查询设计",
     "newStatement": "新建查询配置",
     "unCategory": "未分类",
@@ -20,32 +24,6 @@ MWF.xApplication.query.StatementDesigner.LP = {
     "statementCategory": "访问对象类型",
     "scriptTitle": "通过脚本创建JPQL",
 
-
-    "item": "项目",
-    "type": "类型",
-    "value": "值",
-    "stat": "统计",
-    "unnamed": "无标题列",
-    "newColumn": "新建列",
-
-    "close": "关闭",
-
-    "id": "标识",
-    "name": "名称",
-    "alias": "别名",
-    "description": "描述",
-
-    "application" : "数据应用",
-    "copyStat" : "拷贝统计",
-    "newStatName" : "新统计名称",
-    "copy" : "副本",
-    "ok" : "确定",
-    "cancel" : "取消",
-    "view" : "视图",
-
-    "clumn": "列",
-    "addLine": "添加数据",
-
     "jpqlType": "JPQL类型",
     "jpqlFromResult": "查询开始条目",
     "jpqlMaxResult": "最大返回结果",
@@ -54,29 +32,4 @@ MWF.xApplication.query.StatementDesigner.LP = {
     "jpqlRunSuccess": "JPQL执行成功",
     "newLineSuccess": "插入数据成功",
     "newLineJsonError": "插入数据错误,数据格式有误",
-
-    "action": {
-        "move": "移动",
-        "delete": "删除",
-        "add": "添加"
-    },
-    "errorName": "列名只允许使用字母数字和下划线组合,并且不能以数字开头。",
-    "errorFieldList": "请先创建数据列。",
-    "duplicateName": "同名的列已存在",
-    "inputName": "请输入列名称",
-    "inputTableName": "请输入数据表名称",
-
-    "deleteColumnTitle": "删除列确认",
-    "deleteColumn": "是否确定删除当前列?",
-    "statusBuildTitle": "发布数据表",
-    "statusBuildInfor": "当前数据表将会发布到编译环境,如果您删除了列或修改了列的类型,您可能需要手工删除数据库表。您确定要执行此操作吗?",
-    "statusDraftTitle": "取消编译数据表",
-    "statusDraftInfor": "<span style='color: #FF0000;'>注意:您正在将此数据表从编译环境中删除,下次编译会删除数据库表。</span><br><br>您确定要执行此操作吗?",
-    "statusDraftInforAgain": "<span style='color: #FF0000;'>注意:您正在将此数据表从编译环境中删除,您将无法使用当前数据表,这可能会影响到已使用此数据表的相关应用。</span><br><br>请再次确认要执行此操作吗?",
-    "statusBuild_success": "当前数据表已经发布到编译环境,您需要运行“全部编译”使其生效",
-    "statusDraft_success": "当前数据表已从编译环境取消,下次“全部编译”时会删除从数据库中删除表",
-    "buildAllViewTitle": "编译所有数据表",
-    "buildAllViewInfor": "即将编译所有数据表,包括所有数据应用中的数据表,编译后您可能需要重启服务器后才能使用此数据表。您确定要执行此操作吗?",
-    "buildAllView_success": "已编译所有数据表,新的更改需要您重启服务器后生效",
-    "tableHelp": "数据表能够在系统数据库中自动创建真实表,并生成java实体对象,您可以使用JPQL操作数据表。创建数据表需要以下步骤:<br><br>1、创建数据表,并创建每一列;<br>2、点击工具栏按钮,将数据表发布到编译状态;<br>3、点击工具栏按钮,执行“编译所有数据表”操作<br>4、重启服务器,数据表就可以使用了。"
-};
+});