sys_function_bm.lview 5.29 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: machao1505 $
    $Date: 2010/12/21 09:04:27 $
    $Revision: 1.4 $
    $Purpose: 功能分配BM页面
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure><![CDATA[
    ]]></a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
            function closeAssignPage() {
                $('sys_function_bm_window').close();
            }
            
            function serviceLovFunction(record) {
                return record.isNew ? 'sys_function_service_grid_lv' : '';
            }
            
            function saveAssignBm() {
                $('sys_function_bm_access_ds').submit();
            }
            
            function setinitdata(ds, record, index) {
                record.set('function_id', '${/parameter/@function_id}');
            }
            
            function doFetch(){
                var bms = fetchBM('${/parameter/@function_id}')[0];
                var ds = $('sys_function_bm_access_ds');
                for(var i=0;i<bms.length;i++){
                    var rec=ds.create();
                    rec.set('function_id','${/parameter/@function_id}');
                    rec.set('bm_name',bms[i]);
                    rec.set('query_option','Y');
                    rec.set('insert_option','Y');
                    rec.set('update_option','Y');
                    rec.set('delete_option','Y');
                    rec.set('execute_option','Y');
                }
            }
           function sys_8010_child2_grid_add(){
                $('sys_function_bm_access').showEditorByRecord($('sys_function_bm_access_ds').create());
            }
            function sys_8010_child2_grid_clear(){
                $('sys_function_bm_access').clear();
            }
            function sys_8010_child2_grid_remove(){
                $('sys_function_bm_access').remove();
            }
            function sys_8010_child2_grid_submit() {
                var result_ds = $('sys_function_bm_access_ds');
                if (result_ds.validate()) {
                    result_ds.submit();
                }
            }
            
            ]]></script>
        <a:dataSets>
            <a:dataSet id="sys_function" loadData="true" model="sys.SYS860.sys_function">
                <a:fields>
                    <a:field name="function_code" readOnly="true"/>
                    <a:field name="function_name" readOnly="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="sys_function_bm_access_ds" autoQuery="true" fetchAll="true" model="sys.SYS860.bm_accesscheck" queryUrl="${/request/@context_path}/autocrud/sys.SYS860.bm_accesscheck/query?ORDER_FIELD=bm_name&amp;function_id=${/parameter/@function_id}" selectable="true">
                <a:fields>
                    <a:field name="function_id"/>
                    <a:field name="bm_name" required="true"/>
                    <a:field name="insert_option" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="update_option" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="query_option" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="delete_option" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="execute_option" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                </a:fields>
                <a:events>
                    <a:event name="add" handler="setinitdata"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="closeAssignPage" text="HLS.CLOSE"/>
                <a:gridButton click="sys_8010_child2_grid_add" text="HLS.NEW"/>
                <a:gridButton click="sys_8010_child2_grid_remove" text="HLS.REMOVE"/>
                <a:gridButton click="sys_8010_child2_grid_clear" text="HLS.CLEAR"/>
                <a:gridButton click="saveAssignBm" text="HLS.SAVE"/>
                <a:gridButton click="doFetch" text="SYS8010.BUTTON.FETCH_BM"/>
            </a:screenTopToolbar>
            <a:form column="2" title=" ">
                <a:textField name="function_code" bindTarget="sys_function"/>
                <a:textField name="function_name" bindTarget="sys_function"/>
            </a:form>
            <a:grid id="sys_function_bm_access" bindTarget="sys_function_bm_access_ds" height="300" width="650">
                <a:columns>
                    <a:column name="bm_name" editor="description_grid_tf" width="260"/>
                    <a:column name="insert_option" editor="enabled_flag_cb" width="60"/>
                    <a:column name="update_option" editor="enabled_flag_cb" width="60"/>
                    <a:column name="delete_option" editor="enabled_flag_cb" width="60"/>
                    <a:column name="execute_option" editor="enabled_flag_cb" width="60"/>
                    <a:column name="query_option" editor="enabled_flag_cb" width="60"/>
                </a:columns>
                <a:editors>
                    <a:textField id="description_grid_tf"/>
                    <a:checkBox id="enabled_flag_cb"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>