psr_border_details.lview 9.48 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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2013-7-31 上午10:32:42  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <!-- <a:model-query autoCount="false" defaultwhereclause="report_type=&apos;CONDITION_REPORT&apos;" fetchAll="true" model="psr.PSR1010.psr_report_headers" rootPath="report_list"/> --><![CDATA[
        
        
    ]]></a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
            function colorRenderer(value, record, name) {
                return '<img src="${/request/@context_path}/images/report_cell_style/' + value + '"/>';
            }
            
            function queryColorName() {
                $('psr_report_color_result_ds').query();
            }
            
            function resetColorName() {
                $('psr_report_color_query_ds').reset();
            }
            
            function dblClick(grid, record, row) {
                $('${/parameter/@lovid}').commit(record);
            }
            
            function topCommit(lov, r1, r2) {
                document.getElementById("p1").src = "${/request/@context_path}/images/report_cell_style/" + r2.get('border_code');
            }
            
            function bottomCommit(lov, r1, r2) {
                document.getElementById("p2").src = "${/request/@context_path}/images/report_cell_style/" + r2.get('border_code');
            }
            
            function leftCommit(lov, r1, r2) {
                document.getElementById("p3").src = "${/request/@context_path}/images/report_cell_style/" + r2.get('border_code');
            }
            
            function rightCommit(lov, r1, r2) {
                document.getElementById("p4").src = "${/request/@context_path}/images/report_cell_style/" + r2.get('border_code');
            }
            
            function topColorCommit(lov, r1, r2) {
                document.getElementById("p5").src = "${/request/@context_path}/images/report_cell_style/" + r2.get('color_code');
            }
            
            function bottomColorCommit(lov, r1, r2) {
                document.getElementById("p6").src = "${/request/@context_path}/images/report_cell_style/" + r2.get('color_code');
            }
            
            function leftColorCommit(lov, r1, r2) {
                document.getElementById("p7").src = "${/request/@context_path}/images/report_cell_style/" + r2.get('color_code');
            }
            
            function rightColorCommit(lov, r1, r2) {
                document.getElementById("p8").src = "${/request/@context_path}/images/report_cell_style/" + r2.get('color_code');
            }
            
            function cancelFun() {
                ifDetailed = 0;
                $('border_detail').close();
            }
            
            function okFun() {
                $('border_detail').close();
            }
            
            function resetFun() {
                document.getElementById("p1").style.display = 'none';
                document.getElementById("p2").style.display = 'none';
                document.getElementById("p3").style.display = 'none';
                document.getElementById("p4").style.display = 'none';
                document.getElementById("p5").style.display = 'none';
                document.getElementById("p6").style.display = 'none';
                document.getElementById("p7").style.display = 'none';
                document.getElementById("p8").style.display = 'none';
                var ds = $('psr_report_cell_style_ds');
                var record = ds.getJsonData();
                record[0]['bordertop'] = 'BORDER_NONE';
                record[0]['borderbottom'] = 'BORDER_NONE';
                record[0]['borderleft'] = 'BORDER_NONE';
                record[0]['borderright'] = 'BORDER_NONE';
                record[0]['topbordercolor'] = 'ROYAL_BLUE';
                record[0]['bottombordercolor'] = 'ROYAL_BLUE';
                record[0]['leftbordercolor'] = 'ROYAL_BLUE';
                record[0]['rightbordercolor'] = 'ROYAL_BLUE';
            }
            Leaf.onReady(function() {
                var record = $('psr_report_cell_style_ds').getCurrentRecord(),
                    temp_record;
                if (record.get('bordertop_code')) {
                    temp_record = new Leaf.Record({
                        border_code: record.get('bordertop_code')
                    });
                    topCommit('', '', temp_record);
                }
                if (record.get('borderbottom_code')) {
                    temp_record = new Leaf.Record({
                        border_code: record.get('borderbottom_code')
                    });
                    bottomCommit('', '', temp_record);
                }
                if (record.get('borderleft_code')) {
                    temp_record = new Leaf.Record({
                        border_code: record.get('borderleft_code')
                    });
                    leftCommit('', '', temp_record);
                }
                if (record.get('borderright_code')) {
                    temp_record = new Leaf.Record({
                        border_code: record.get('borderright_code')
                    });
                    rightCommit('', '', temp_record);
                }
                if (record.get('topbordercolor_code')) {
                    temp_record = new Leaf.Record({
                        color_code: record.get('topbordercolor_code')
                    });
                    topColorCommit('', '', temp_record);
                }
                if (record.get('bottombordercolor_code')) {
                    temp_record = new Leaf.Record({
                        color_code: record.get('bottombordercolor_code')
                    });
                    bottomColorCommit('', '', temp_record);
                }
                if (record.get('leftbordercolor_code')) {
                    temp_record = new Leaf.Record({
                        color_code: record.get('leftbordercolor_code')
                    });
                    leftColorCommit('', '', temp_record);
                }
                if (record.get('rightbordercolor_code')) {
                    temp_record = new Leaf.Record({
                        color_code: record.get('rightbordercolor_code')
                    });
                    rightColorCommit('', '', temp_record);
                }
            });
        ]]></script>
        <a:screenBody>
            <a:form column="5" labelWidth="150" title="边框详细设置" width="700">
                <a:label prompt="顶部边框样式(线条)" width="20"/>
                <img id="p1" height="20" width="100"/>
                <a:lov name="bordertop" bindTarget="psr_report_cell_style_ds">
                    <a:events>
                        <a:event name="commit" handler="topCommit"/>
                    </a:events>
                </a:lov>
                <img id="p5" height="20" width="100"/>
                <a:lov name="topbordercolor" bindTarget="psr_report_cell_style_ds">
                    <a:events>
                        <a:event name="commit" handler="topColorCommit"/>
                    </a:events>
                </a:lov>
                <a:label prompt="底部边框样式(线条)" width="20"/>
                <img id="p2" height="20" width="100"/>
                <a:lov name="borderbottom" bindTarget="psr_report_cell_style_ds">
                    <a:events>
                        <a:event name="commit" handler="bottomCommit"/>
                    </a:events>
                </a:lov>
                <img id="p6" height="20" width="100"/>
                <a:lov name="bottombordercolor" bindTarget="psr_report_cell_style_ds">
                    <a:events>
                        <a:event name="commit" handler="bottomColorCommit"/>
                    </a:events>
                </a:lov>
                <a:label prompt="左边框样式(线条) " width="20"/>
                <img id="p3" height="20" width="100"/>
                <a:lov name="borderleft" bindTarget="psr_report_cell_style_ds">
                    <a:events>
                        <a:event name="commit" handler="leftCommit"/>
                    </a:events>
                </a:lov>
                <img id="p7" height="20" width="100"/>
                <a:lov name="leftbordercolor" bindTarget="psr_report_cell_style_ds">
                    <a:events>
                        <a:event name="commit" handler="leftColorCommit"/>
                    </a:events>
                </a:lov>
                <a:label prompt="右边框样式(线条)" width="20"/>
                <img id="p4" height="20" width="100"/>
                <a:lov name="borderright" bindTarget="psr_report_cell_style_ds">
                    <a:events>
                        <a:event name="commit" handler="rightCommit"/>
                    </a:events>
                </a:lov>
                <img id="p8" height="20" width="100"/>
                <a:lov name="rightbordercolor" bindTarget="psr_report_cell_style_ds">
                    <a:events>
                        <a:event name="commit" handler="rightColorCommit"/>
                    </a:events>
                </a:lov>
                <!-- <a:button text="重置" click="resetFun"/> -->
            </a:form>
            <a:hBox>
                <a:button click="okFun" text="确定"/>
                <a:button click="cancelFun" text="取消"/>
            </a:hBox>
        </a:screenBody>
    </a:view>
</a:screen>