function_assign_role.lview 7.1 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: jack  
    $Date: 2014-10-13 上午10:05:38  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <a:link id="hls_doc_layout_tab_column_validation_sql_link" url="${/request/@context_path}/modules/sys/SYS890/hls_doc_layout_tab_column_validation_sql.lview"/>
        <a:link id="function_assign_to_role_link" url="${/request/@context_path}/modules/sys/SYS890/role_assign_home_page_fun.lview"/>
        <a:link id="function_query_copy_link" url="${/request/@context_path}/modules/sys/SYS890/sys_home_page_fun_copy.lview"/>
        <script type="text/javascript"><![CDATA[
            
             function field_render(value, record, name) {
                if (name == 'count_sql') {
                    return '<a  href="javascript:clob_validation_sql_window_open(' + record.id + ')">' + '待办数值sql' + '</a>';
                }
            }
            
             function clob_validation_sql_window_open(id) {
            
                var win = new Leaf.Window({
                    id: 'clob_validation_sql_his_id',
                    params: {
                        record_id: id,
                        ds_name: 'hls_sys_home_page_ds',
                        name: 'count_sql',
            
                        winId: 'clob_validation_sql_his_id'
                    },
                    url: $('hls_doc_layout_tab_column_validation_sql_link').getUrl(),
                    title: '待办数值SQL',
                    width: 550,
                    height: 430,
                    draggable: true
                });
            }
            
            function this_query(){
                $('hls_sys_home_page_ds').query();
            }
            
            function win_reset(){
                $('function_query_ds').reset();
            }
          
           function assign_function_to_role(){
                var ds = $('hls_sys_home_page_ds');
                var records = ds.getSelected();
                if (records.length == 0) {
                    Leaf.showMessage('${l:PROMPT}', '请选择一条记录');
                    return;
                }
                  var win = new Leaf.Window({
                    id: 'function_assign_to_role_link_id',
                    params: {
                        ds_name: 'hls_sys_home_page_ds'
                    },
                    url: $('function_assign_to_role_link').getUrl(),
                    title: '角色分配',
                    width: 600,
                    height: 500,
                    draggable: true
                }); 
           }
           
           function assign_function_query(){
               var win = new Leaf.Window({
                    id: 'function_query_copy_link_id',
                    url: $('function_query_copy_link').getUrl(),
                    title: '角色功能',
                    width: 860,
                    height: 500,
                    draggable: true
                }); 
           }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="function_query_ds" autoCreate="true">
                <a:field name="function_name"/>
                <a:field name="function_code"/>
            </a:dataSet>
            <a:dataSet id="hls_sys_home_page_ds" autoQuery="true" model="sys.SYS890.hls_sys_home_page" queryDataSet="function_query_ds" queryUrl="${/request/@context_path}/autocrud/sys.SYS890.hls_sys_home_page/query" selectable="true">
                <a:fields>
                    <a:field name="home_page_id"/>
                    <a:field name="function_name"/>
                    <a:field name="function_code" lovGridHeight="320" lovHeight="500" lovService="sys.SYS890.sys_role_function_v" lovWidth="500" title="功能代码">
                        <a:mapping>
                            <a:map from="function_code" to="function_code"/>
                            <a:map from="function_name" to="function_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="home_page_desc"/>
                    <a:filed name="count_sql"/>
                    <a:field name="order_sequence"/>
                    <a:field name="enable_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <!-- <a:field name="count_number"/> -->
                    <a:field name="background_color"/>
                    <a:field name="image"/>
                </a:fields>
                <a:events>
                    <a:event name="submitsuccess" handler="this_query"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="win_reset" text="重置"/>
                <a:gridButton click="this_query" text="查询"/>
                <a:gridButton click="assign_function_to_role" text="角色功能分配"/>
                <a:gridButton click="assign_function_query" text="角色功能查询"/>
            </a:screenTopToolbar>
            <a:form title="查询条件">
                <a:hBox>
                    <a:textField name="function_code" bindTarget="function_query_ds" prompt="功能编码"/>
                    <a:textField name="function_name" bindTarget="function_query_ds" prompt="功能名称"/>
                </a:hBox>
            </a:form>
            <a:grid bindTarget="hls_sys_home_page_ds" height="350" marginHeight="200" marginWidth="50" navBar="true">
                <a:toolBar>
                    <a:button type="add"/>
                    <a:button type="delete"/>
                    <a:button type="save"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="function_code" editor="function_code_lov" prompt="功能代码" width="180"/>
                    <a:column name="function_name" prompt="功能名称" width="180"/>
                    <a:column name="home_page_desc" editor="home_page_text_e" prompt="首页功能描述" width="180"/>
                    <a:column name="background_color" align="left" editor="text_e" prompt="背景色" width="100"/>
                    <a:column name="image" align="left" editor="text_e" prompt="图片" width="150"/>
                    <a:column name="order_sequence" align="right" editor="text_e" prompt="排序" width="50"/>
                    <a:column name="count_sql" align="center" prompt="待办数值sql" renderer="field_render" width="100"/>
                    <!-- <a:column name="count_number" align="center" prompt="待办数" width="80"/> -->
                    <a:column name="enable_flag" editor="check_field_e" prompt="启用" width="80"/>
                </a:columns>
                <a:editors>
                    <a:lov id="function_code_lov"/>
                    <a:textField id="home_page_text_e"/>
                    <a:numberField id="number_filed_e"/>
                    <a:checkBox id="check_field_e"/>
                    <a:textField id="text_e"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>