hls_sys_homepage_message.lview 9.58 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangguangfan2864 
    $Date: 2011-8-5 上午09:11:20  
    $Revision: 1.0  
    $Purpose: 首页提醒定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure/>
    <a:view package="leaf.ui.std" template="default">
        <a:link id="delete_message_link" model="db.hls_sys_homepage_message_pkg.delete_message" modelaction="batch_update"/>
        <a:link id="hls_sys_homepage_message_role_link" url="${/request/@context_path}/modules/hls_fnd/hls_sys_homepage_message_role.lview"/>
        <a:link id="hls_sys_homepage_message_user_link" url="${/request/@context_path}/modules/hls_fnd/hls_sys_homepage_message_user.lview"/>
        <div/>
        <script type="text/javascript"><![CDATA[
        	function assignUserRender(value,record, name){
        		return '<a href="javascript:openAssignUser('+record.get('message_id')+')">分配用户</a>'
        	}
        	
        	function openAssignUser(msg_id){
        		if(typeof(msg_id) != 'undefined' && !Ext.isEmpty(msg_id)){
        			new Leaf.Window({id:'hls_sys_assign_user_window', url:'hls_sys_homepage_message_user.lview'/*$('hls_sys_homepage_message_user_link').getUrl()*/+'?message_id='+ msg_id, title:'分配用户', height:400,width:500});
        		}else{
        			 Leaf.showMessage("提示信息","该数据还未保存!");
        		}
        	}
        	
        	function assignRoleRender(value,record, name){
        		return '<a href="javascript:openAssignRole('+record.get('message_id')+')">分配角色</a>'
        	}
        	
        	function openAssignRole(msg_id){
        		if(typeof(msg_id) != 'undefined' && !Ext.isEmpty(msg_id)){
        			new Leaf.Window({id:'hls_sys_assign_role_window', url:'hls_sys_homepage_message_role.lview'/*$('hls_sys_homepage_message_role_link').getUrl()*/+'?message_id='+ msg_id, title:'分配角色', height:400,width:500});
        		}else{
        			 Leaf.showMessage("提示信息","该数据还未保存!");
        		}
        	}
        	
        	function delMsg(){
        		var ds = $('hls_sys_homepage_message');
        		var record = ds.getCurrentRecord();
                var selects = ds.getSelected();
                var data = ds.getJsonData(true);
                var count = selects.length;
                for(i=0;i<data.length;i++){
                	var message_id = data[i]['message_id'];
                	if(typeof(message_id) == 'undefined'){
                		data[i]=null;
                	}
                }
              
                if(count > 0){
	        		var queryConfirm = Leaf.showConfirm('提示', '确认要删除?', function() {
			                    Leaf.request({
		                            url: '${/request/@context_path}/autocrud/db.hls_sys_homepage_message_pkg.delete_message/batch_update'/*$('delete_message_link').getUrl()*/,
		                            para:data,
		                            success: function(args) {
		                                ds.query();
		                            },
		                            scope: this
		                        });
			                }, function() {
			                    queryConfirm.close();
			         }, null, null);
			     }   
        	}
        	
        	function homepage_message_save(){
        		$('hls_sys_homepage_message').submit();
        	}
        	
        	function subsce(dataSet,ref){
        		dataSet.query();
        	}
        	
        	function equalValidator(record, name, value){
        		var equal_value = record.get('equal_value');
        		var un_equan_value = record.get('un_equan_value');
        		if(equal_value == un_equan_value){
        			return "等于和不等于的值应不相同!";
        		}
        		return true;
        	}
        ]]></script>
        <a:dataSets>
            <a:dataSet id="hls_sys_homepage_message" autoQuery="true" loadData="true" model="hls.HLS1020.hls_sys_homepage_message_for_maintain" pageSize="20" selectable="true">
                <a:fields>
                    <a:field name="company_name" lovGridHeight="340" lovHeight="460" lovService="hls_fnd.hls_fnd_companies" lovWidth="340" required="true" title="FND_COMPANIES.INFO">
                        <a:mapping>
                            <a:map from="company_id" to="company_id"/>
                            <a:map from="company_short_name" to="company_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="equal_value" required="true" validator="equalValidator"/>
                    <a:field name="un_equan_value" required="true" validator="equalValidator"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" required="true" unCheckedValue="N"/>
                    <a:field name="message_content" required="true"/>
                    <a:field name="condition_sql" required="true"/>
                    <a:field name="message_code" required="true"/>
                    <a:field name="message_desc" required="true"/>
                    <a:field name="sequence_no" required="true"/>
                    <a:field name="message_content_type" defaultValue="02"/>
                    <a:field name="return_condition_type" defaultValue="02"/>
                </a:fields>
                <a:events>
                    <a:event name="submitsuccess" handler="subsce"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:form height="370" title="HLS_SYS_HOMEPAGE_MESSAGE.HOMEPAGE_MESSAGE" width="760">
                <a:grid id="grid_id" bindTarget="hls_sys_homepage_message" height="370" navBar="true" style="margin-left:10px" width="731">
                    <a:toolBar>
                        <a:button type="add"/>
                        <a:button click="delMsg" icon="../../images/remove.png" text="PROMPT.DELETE"/>
                    </a:toolBar>
                    <a:columns>
                        <a:column name="company_name" editor="lovedit" prompt="HLS_SYS_HOMEPAGE_MESSAGE.COMPANY_NAME" width="150"/>
                        <a:column name="message_code" editor="txtedit" prompt="HLS_SYS_HOMEPAGE_MESSAGE.MESSAGE_CODE" sortable="true" width="60"/>
                        <a:column name="message_desc" editor="txtedit" prompt="HLS_SYS_HOMEPAGE_MESSAGE.MESSAGE_DESC" width="200"/>
                        <a:column name="sequence_no" editor="unmberedit" prompt="HLS_SYS_HOMEPAGE_MESSAGE.SEQUENCE_NO" sortable="true" width="45"/>
                        <a:column name="assign_user" align="center" prompt="HLS_SYS_HOMEPAGE_MESSAGE.ASSIGN_USER" renderer="assignUserRender"/>
                        <a:column name="assign_role" align="center" prompt="HLS_SYS_HOMEPAGE_MESSAGE.ASSIGN_ROLE" renderer="assignRoleRender"/>
                        <a:column name="enabled_flag" editor="check_edit" prompt="HLS_SYS_HOMEPAGE_MESSAGE.ENABLED_FLAG" width="50"/>
                    </a:columns>
                    <a:editors>
                        <a:numberField id="unmberedit"/>
                        <a:textField id="txtedit"/>
                        <a:checkBox id="check_edit"/>
                        <a:lov id="lovedit"/>
                    </a:editors>
                </a:grid>
            </a:form>
            <a:tabPanel id="hls_sys_homepage_message_tab" height="190" width="760">
                <a:tabs>
                    <a:tab prompt="HLS_SYS_HOMEPAGE_MESSAGE.MESSAGE_TEXT" width="80">
                        <a:hBox height="30" style="background-color:#eceded" width="758">
                            <a:radio name="message_content_type" bindTarget="hls_sys_homepage_message" prompt="" width="200">
                                <a:items>
                                    <a:item label="HLS_SYS_HOMEPAGE_MESSAGE.MESSAGE_CONTENT_TYPE_DYNAMIC_SQL" value="01"/>
                                    <a:item label="HLS_SYS_HOMEPAGE_MESSAGE.MESSAGE_CONTENT_TYPE_TEXT" value="02"/>
                                </a:items>
                            </a:radio>
                        </a:hBox>
                        <a:textArea name="message_content" bindTarget="hls_sys_homepage_message" height="100" style="margin:10px 23px" width="705"/>
                    </a:tab>
                    <a:tab prompt="HLS_SYS_HOMEPAGE_MESSAGE.SEND_CONDITION" width="80">
                        <a:hBox height="30" style="background-color:#eceded" width="758">
                            <a:radio name="return_condition_type" bindTarget="hls_sys_homepage_message" prompt="" width="200">
                                <a:items>
                                    <a:item label="HLS_SYS_HOMEPAGE_MESSAGE.RETURN_CONDITION_TYPE_FUNCTION" value="01"/>
                                    <a:item label="HLS_SYS_HOMEPAGE_MESSAGE.RETURN_CONDITION_TYPE_SQL" value="02"/>
                                </a:items>
                            </a:radio>
                            <a:hBox padding="0" width="300">
                                <a:textField name="equal_value" bindTarget="hls_sys_homepage_message" prompt="HLS_SYS_HOMEPAGE_MESSAGE.EQUAL_VALUE" width="50"/>
                                <a:textField name="un_equan_value" bindTarget="hls_sys_homepage_message" prompt="HLS_SYS_HOMEPAGE_MESSAGE.UN_EQUAL_VALUE" width="50"/>
                            </a:hBox>
                        </a:hBox>
                        <a:textArea name="condition_sql" bindTarget="hls_sys_homepage_message" height="100" style="margin:10px 23px" width="705"/>
                    </a:tab>
                </a:tabs>
            </a:tabPanel>
            <a:button click="homepage_message_save" text="HAP_SAVE"/>
        </a:screenBody>
    </a:view>
</a:screen>