Kaynağa Gözat

视图中增加可以选择行的条件

unknown 5 yıl önce
ebeveyn
işleme
e724b24287

+ 4 - 0
o2web/source/x_component_cms_Module/ViewExplorer.js

@@ -321,6 +321,10 @@ MWF.xApplication.cms.Module.QueryViewer = new Class({
             this.viewJson.firstTdHidden = true;
             if( this.json.defaultSelectedScript )this.json.defaultSelectedScript = "";
             if( this.viewJson.defaultSelectedScript )this.viewJson.defaultSelectedScript = "";
+
+            if( this.json.selectedAbleScript )this.json.selectedAbleScript = "";
+            if( this.viewJson.selectedAbleScript )this.viewJson.selectedAbleScript = "";
+
             if( this.isSelectTdHidden() ){
                 this.selectTitleCell.hide();
             }

+ 3 - 1
o2web/source/x_component_portal_PageDesigner/Module/View/view.html

@@ -98,7 +98,7 @@
 			<tr>
 				<td class="editTableTitle">选择文件</td>
 				<td class="editTableValue">
-					<select name="select">
+					<select name="select" onchange="$('text{$.pid}selectedAbleScript').setStyle('display', this.options[this.selectedIndex].value === 'no' ? 'none' : 'block');">
 						<option text{($.select!='single' && $.select!='multi')?'selected':''} value="no">不允许</option>
 						<option text{($.select=='single')?'selected':''} value="single">单选</option>
 						<option text{($.select=='multi')?'selected':''} value="multi">多选</option>
@@ -197,6 +197,8 @@
 			<div class="fieldListAreaNode_vf" style="display:none; min-height: 56px; border-bottom:1px solid #CCCCCC; overflow: hidden;"></div>
 		</div>
 		<div class="MWFScriptArea" name="defaultSelectedScript" title="默认选中行脚本"></div>
+		<div class="MWFScriptArea" name="selectedAbleScript" title="允许选择行脚本" id="text{$.pid}selectedAbleScript"
+			 style="display: text{($.select=='single' || $.select=='multi')?'':'none'}"></div>
 	</div>
 	<div title="事件"  class="MWFTab">
 		<div class="MWFEventsArea" name="events"></div>

+ 3 - 1
o2web/source/x_component_process_FormDesigner/Module/View/view.html

@@ -159,7 +159,7 @@
 			<tr>
 				<td class="editTableTitle">选择文件</td>
 				<td class="editTableValue">
-					<select name="select">
+					<select name="select" onchange="$('text{$.pid}selectedAbleScript').setStyle('display', this.options[this.selectedIndex].value === 'no' ? 'none' : 'block');">
 						<option text{($.select!='single' && $.select!='multi')?'selected':''} value="no">不允许</option>
 						<option text{($.select=='single')?'selected':''} value="single">单选</option>
 						<option text{($.select=='multi')?'selected':''} value="multi">多选</option>
@@ -258,6 +258,8 @@
 			<div class="fieldListAreaNode_vf" style="display:none; min-height: 56px; border-bottom:1px solid #CCCCCC; overflow: hidden;"></div>
 		</div>
 		<div class="MWFScriptArea" name="defaultSelectedScript" title="默认选中行脚本"></div>
+		<div class="MWFScriptArea" name="selectedAbleScript" title="允许选择行脚本" id="text{$.pid}selectedAbleScript"
+			 style="display: text{($.select=='single' || $.select=='multi')?'':'none'}"></div>
 	</div>
 
 	<div title="事件"  class="MWFTab">

+ 1 - 0
o2web/source/x_component_process_FormDesigner/Module/ViewSelector/ViewSelector.html

@@ -108,6 +108,7 @@
             <div class="MWFScriptArea" name="selectedScript" title="选择结果 (S)"></div>
         </div>
         <div class="MWFScriptArea" name="defaultSelectedScript" title="默认选中行脚本"></div>
+        <div class="MWFScriptArea" name="selectedAbleScript" title="允许选择行脚本"></div>
 	</div>
     <div title="过滤"  class="MWFTab">
         <div class="MWFViewFilter">

+ 2 - 1
o2web/source/x_component_process_Xform/View.js

@@ -63,7 +63,8 @@ MWF.xApplication.process.Xform.View = MWF.APPView =  new Class({
             "isExpand": this.json.isExpand || "no",
             "showActionbar" : this.json.actionbar === "show",
             "filter": filter,
-            "defaultSelectedScript" : this.json.defaultSelectedScript ? this.json.defaultSelectedScript.code : null
+            "defaultSelectedScript" : this.json.defaultSelectedScript ? this.json.defaultSelectedScript.code : null,
+            "selectedAbleScript" : this.json.selectedAbleScript ? this.json.selectedAbleScript.code : null
         };
 
         //MWF.xDesktop.requireApp("query.Query", "Viewer", function(){

+ 2 - 1
o2web/source/x_component_process_Xform/ViewSelector.js

@@ -284,7 +284,8 @@ MWF.xApplication.process.Xform.ViewSelector = MWF.APPViewSelector =  new Class({
                 "isExpand": this.json.isExpand || "no",
                 "showActionbar" : this.json.actionbar === "show",
                 "filter": filter,
-                "defaultSelectedScript" : this.json.defaultSelectedScript ? this.json.defaultSelectedScript.code : null
+                "defaultSelectedScript" : this.json.defaultSelectedScript ? this.json.defaultSelectedScript.code : null,
+                "selectedAbleScript" : this.json.selectedAbleScript ? this.json.selectedAbleScript.code : null
             };
             var options = {};
             var width = options.width || "850";

+ 5 - 1
o2web/source/x_component_query_ViewDesigner/$View/view.html

@@ -69,16 +69,19 @@
                     if (this.checked){
                         $('text{$.id}selectBoxShowTr').setStyle('display', 'none');
                         $('text{$.id}allowSelectAllTr').setStyle('display', 'none');
+                        $('text{$.id}selectedAbleScript').setStyle('display', 'none');
                     }"/>无
                     <input class="editTableRadio" name="data.select" text{($.data.select==='single')?'checked':''} type="radio" value="single" onclick="
                     if (this.checked){
                         $('text{$.id}selectBoxShowTr').setStyle('display', 'table-row');
                         $('text{$.id}allowSelectAllTr').setStyle('display', 'none');
+                        $('text{$.id}selectedAbleScript').setStyle('display', 'block');
                     }"/>单选
                     <input class="editTableRadio" name="data.select" text{($.data.select==='multi')?'checked':''} type="radio" value="multi" onclick="
                     if (this.checked){
                         $('text{$.id}selectBoxShowTr').setStyle('display', 'table-row');
                         $('text{$.id}allowSelectAllTr').setStyle('display', 'table-row');
+                        $('text{$.id}selectedAbleScript').setStyle('display', 'block');
                     }"/>多选
                 </td>
             </tr>
@@ -144,7 +147,8 @@
         </table>
 
         <div class="MWFFormulaArea" name="data.defaultSelectedScript" title="默认选中行脚本"></div>
-        <div class="MWFFormulaArea" name="data.selectedAbleScript" title="允许选择行脚本"></div>
+        <div class="MWFFormulaArea" name="data.selectedAbleScript" title="允许选择行脚本" id="text{$.id}selectedAbleScript"
+             style="display: text{($.data.select=='single' || $.data.select=='multi')?'':'none'}"></div>