hls_document_node_define.lview 8.87 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: ZLF  
    $Date: 2015-1-2 上午9:53:03  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure><![CDATA[
		
	]]></a:init-procedure>
    <a:view>
        <a:link id="branch_node_edit_link" url="${/request/@context_path}/modules/hls/HLS600/hls_branch_node_edit.lview"/>
        <a:link id="normal_node_edit_link" url="${/request/@context_path}/modules/hls/HLS600/hls_normal_node_edit.lview"/>
        <a:link id="node_verify_sql_link" url="${/request/@context_path}/modules/hls/HLS600/hls_branch_verify_sql.lview"/>
        <script type="text/javascript"><![CDATA[
			function hls600_reset() {
			    $('hls600_document_node_query_ds').reset();
			}
			
			function hls600_query() {
			    $('hls600_document_node_result_ds').query();
			}
			
			function hls600_save() {
			    if($('hls600_document_node_result_ds').validate()) {
			    	$('hls600_document_node_result_ds').submit();
			    }
			}
			
			function node_edit_renderer(value, record, name) {
			    var node_type = record.get('node_type');
			    if(node_type == 'NORMAL') {
			        return '<a href="javascript:winOpen_normal_node_edit(' + record.get('node_id') + ',\'' + node_type + '\')">编辑节点</a>';
			    }else if(node_type == 'BRANCH') {
			        return '<a href="javascript:winOpen_branch_node_edit(' + record.get('node_id') + ',\'' + node_type + '\')">编辑节点</a>';
			    }
			}
			
			function winOpen_normal_node_edit(node_id ,node_type) {
                var win = new Leaf.Window({
                    id: 'normal_node_edit_window',
                    url: $('normal_node_edit_link').getUrl(),
                    params: {
                    	node_id:node_id,
                    	node_type : node_type,
                    	workflow_id:'${/parameter/@workflow_id}'
                    },
                    title: '编辑节点',
                    fullScreen: true
                });
                win.on('close', function() {
                    refresh_nodeDs();
                });
                
            }
            
            function winOpen_branch_node_edit(node_id ,node_type) {
                var win = new Leaf.Window({
                    id: 'branch_node_edit_window',
                    url: $('branch_node_edit_link').getUrl(),
                    params: {
                    	node_id:node_id,
                    	node_type : node_type,
                    	workflow_id:'${/parameter/@workflow_id}'
                    },
                    title: '编辑节点',
                    fullScreen: true
                });
                win.on('close', function() {
                    refresh_nodeDs();
                });
                
            }
            
            function document_node_addHandler(ds,record,index) {
                record.set('node_type','NORMAL');
                record.set('node_type_desc','普通节点');
            }
            
            function verify_sql_renderer(value, record, name) {
		        if (!value){
                	return '<a  href="javascript:verify_sql_window_open(' + record.id +',\'' + name + '\')">' + '验证SQL' + '</a>';
                }else{
                    return '<a  href="javascript:verify_sql_window_open(' + record.id +',\'' + name + '\')">' + '<font color="#FF9900">验证SQL</font>' + '</a>';
                }
			}
			
			function verify_sql_window_open(id,name) {           
                var win = new Leaf.Window({
                    id: 'verify_sql_his_id',
                    params: {
                        record_id: id,
                        ds_name: 'hls600_document_node_result_ds',
                        name: name,
            
                        winId: 'verify_sql_his_id'
                    },
                    url: $('node_verify_sql_link').getUrl(),
                    title: '验证SQL',
                    width: 600,
                    height: 430,
                    draggable: true
                });
            }
		]]></script>
        <a:dataSets>
            <a:dataSet id="hls_document_node_type_ds" lookupCode="HLS_DOCUMENT_NODE_TYPE"/>
            <a:dataSet id="yes_or_no_ds" lookupCode="YES_NO"/>
            <a:dataSet id="hls600_document_node_query_ds">
                <a:fields>
                    <a:field name="node_desc"/>
                    <a:field name="node_type_desc" displayField="code_value_name" options="hls_document_node_type_ds" returnField="node_type" valueField="code_value"/>
                    <a:field name="enabled_flag"/>
                    <a:field name="enabled_flag_desc" displayField="code_value_name" options="yes_or_no_ds" returnField="enabled_flag" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="hls600_document_node_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS600.hls_document_node" queryDataSet="hls600_document_node_query_ds" selectable="true">
                <a:fields>
                    <a:field name="node_desc"/>
                    <a:field name="node_type"/>
                    <a:field name="node_type_desc" displayField="code_value_name" options="hls_document_node_type_ds" required="true" returnField="node_type" valueField="code_value"/>
                    <a:field name="enabled_flag" checkedValue="Y" uncheckedValue="N"/>
                    <a:field name="enabled_flag_desc" displayField="code_value_name" options="yes_or_no_ds" returnField="enabled_flag" valueField="code_value"/>
                    <a:field name="approved_sql"/>
                    <a:field name="condition_sql1"/>
                    <a:field name="condition_sql2"/>
                    <a:field name="condition_sql3"/>
                    <a:field name="condition_sql4"/>
                    <a:field name="condition_sql5"/>
                </a:fields>
                <a:events>
                    <a:event name="add" handler="document_node_addHandler"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hls600_reset" text="重置"/>
                <a:gridButton click="hls600_query" text="HLS.QUERY"/>
                <a:gridButton click="hls600_save" text="保存"/>
            </a:screenTopToolbar>
            <a:form Width="500" column="2" title="查询条件">
                <a:textField name="node_desc" bindTarget="hls600_document_node_query_ds" prompt="节点描述"/>
                <!-- <a:comboBox name="node_type_desc" bindTarget="hls600_document_node_query_ds" prompt="节点类型"/> -->
                <a:comboBox name="enabled_flag_desc" bindTarget="hls600_document_node_query_ds" prompt="是否启用"/>
            </a:form>
            <a:grid id="hls_document_node_result_grid" bindTarget="hls600_document_node_result_ds" marginHeight="180" marginWidth="60" navBar="true">
                <a:toolBar>
                    <a:button type="add"/>
                    <a:button type="delete"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="node_seq" align="right" editor="nodeDs_grid_editor_nf_integer" prompt="节点序号" width="100"/>
                    <a:column name="node_desc" editor="nodeDs_grid_editor_tf" prompt="节点描述" width="200"/>
                    <a:column name="node_type_desc" align="center" prompt="节点类型" width="100"/>
                    <a:column name="enabled_flag" editor="nodeDs_grid_editor_check" prompt="启用标志" width="120"/>
                    <a:column name="approved_sql" align="center" autoAdjust="false" prompt="验证通过SQL" renderer="verify_sql_renderer" width="120"/>
                    <a:column name="condition_sql1" align="center" autoAdjust="false" prompt="条件SQL1" renderer="verify_sql_renderer" width="120"/>
                    <a:column name="condition_sql2" align="center" autoAdjust="false" prompt="条件SQL2" renderer="verify_sql_renderer" width="120"/>
                    <a:column name="condition_sql3" align="center" autoAdjust="false" prompt="条件SQL3" renderer="verify_sql_renderer" width="120"/>
                    <a:column name="condition_sql4" align="center" autoAdjust="false" prompt="条件SQL4" renderer="verify_sql_renderer" width="120"/>
                    <a:column name="condition_sql5" align="center" autoAdjust="false" prompt="条件SQL5" renderer="verify_sql_renderer" width="120"/>
                </a:columns>
                <a:editors>
                    <a:numberField id="nodeDs_grid_editor_nf_integer" allowDecimals="false" allowNegative="false"/>
                    <a:textField id="nodeDs_grid_editor_tf"/>
                    <a:comboBox id="nodeDs_grid_editor_comb"/>
                    <a:checkBox id="nodeDs_grid_editor_check"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>