sys_customization_setup.lview 3.66 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
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <script type="text/javascript"><![CDATA[

            function customization_cancel(){
                $('sys_customization_window').close();
            }

            function customization_ok(){
                var ds = $('customization_ds');
                var r = ds.getCurrentRecord();
                var v = r.get('switch');
                var ifa = document.getElementById('mainFrame');
                var wid = ifa.contentWindow;
                if(v=='Y'){
                    wid.Leaf.startCustomization();
                }else{
                    wid.Leaf.stopCustomization();
                }
                customization_cancel();
            }
            function customizationRenderer(v){
                if(v == 'Y'){
                    return '<span style="color:green">开启</span>'
                }else{
                    return '<span style="color:red">关闭</span>'
                }
            }
            
            function customizationSwitch(){
                var ds = $('customization_ds');
                var r = ds.getCurrentRecord();
                var s = r.get('switch');
                if(s=='Y'){
                    r.set('switch','N')
                    Ext.get('custStopBtn').setStyle('display','none');
                    Ext.get('custStartBtn').setStyle('display','');
                }else{
                    r.set('switch','Y')
                    Ext.get('custStopBtn').setStyle('display','');
                    Ext.get('custStartBtn').setStyle('display','none');
                }
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="customization_ds"/>
        </a:dataSets>
        <center>
            <TABLE border="0" cellSpacing="10" cellPadding="0" style="margin-top:50px;">
                <TR>
                    <TD style="font-size:16px;">个性化设置状态:</TD>
                    <TD><a:label bindTarget="customization_ds" renderer="customizationRenderer" width="60" name="switch" style="font-size:16px;text-align:left"/></TD>
                    <TD>
                        <a:button text="开启" style="display:none" width="80" btnstyle="font-size:16px;color:green" height="30" id="custStartBtn" click="customizationSwitch"/>
                        <a:button text="关闭" style="display:none" width="80" btnstyle="font-size:16px;color:red" height="30" id="custStopBtn" click="customizationSwitch"/>
                    </TD>
                </TR>
            </TABLE>
        </center>
        <div class="win-toolbar" style="width:100%;height:38px;position:absolute; bottom:0px;">
            <a:hBox style="float:right;margin-right:10px;margin-top:5px;">
                <a:button click="customization_ok" text="HAP_OK" width="90"/>
                <a:button click="customization_cancel" text="HAP_CANCEL" width="90"/>
            </a:hBox>
        </div>
        <script type="text/javascript"><![CDATA[

            function initCustomization(){
                var ds = $('customization_ds');
                var ifa = document.getElementById('mainFrame');
                var wid = ifa.contentWindow;
                var v = 'N'
                var ct = wid.Leaf.CmpManager.get('_customization');
                if(ct) v = 'Y';
                ds.create({'switch':v});
                if(ct!=null) {
                    Ext.get('custStopBtn').setStyle('display', '');
                }else{
                    Ext.get('custStartBtn').setStyle('display', '');
                }
                
            }
            initCustomization();
        ]]></script>
    </a:view>
</a:screen>