UserAvatar_wev8.js 1.15 KB
define("UserAvatar_html",function(){return'<div id="NMEC_${id}" class="wev-comp-${compType}">\t<div class="wev-avatar-container ${style}">\t\t<img src="${avatar}">\t    <div>\t        <div class="wev-avatar-username">&nbsp;</div>\t        <span class="wev-avatar-dept">&nbsp;</span>\t        <span class="wev-avatar-jobtitle">&nbsp;</span>\t    </div>\t</div></div>'}),define(["mUtil","Component"],function(r,a){return a.init(function(t){a.super(this,t),this.type="UserAvatar",this.tpl=this.type+"_html",this.css=this.type+"_css",this.dataload=!0;var s=this.viewModel={userid:"",style:"wev-avatar-vertical",avatar:"/messager/images/icon_m_wev8.jpg"};this.beforeMount=function(){-1!=s.style.indexOf("vertical")&&(s.style="wev-avatar-vertical")||(s.style="wev-avatar-horizontal")},this.mounted=function(){var e=this,t=this.type,i=this.$el.children(".wev-comp-"+t),a=r.getActionUrl(this.type,{action:"info",userid:s.userid},this.pageid);r.getJSON(a,function(t){var a=t.data;$("img",i).attr("src",a.avatar),$(".wev-avatar-username",i).html(a.userName),$(".wev-avatar-dept",i).html(a.deptName),$(".wev-avatar-jobtitle",i).html(a.jobTitle),r.trigger("dataload",e.pageid,e.id)})}})});