\n
\n 当前版本为'+(i.packageName||"")+',即将在'+(i.pkgRemainDay||0)+'天后到期。如需续期,请 点击此处\n ',n=document.createElement("div"),e=(n.classList.add("pkg-tooltip"),n.id="pkg-tooltip",n.innerHTML=e,document.getElementById("headerApp"));if(e&&e.parentNode)return e.parentNode.insertBefore(n,e),(n=document.getElementById("go-pkglist")).onclick=function(){var n,o,e,t,a,r;document.querySelector("#zx-pkg-remind-modal")||((n=document.createElement("div")).id="zx-pkg-remind-modal-mask",(o=document.createElement("div")).id="zx-pkg-remind-modal",e=i.pkgRemainDay||0,(t=new Date).setDate(t.getDate()+e),e=t.getFullYear()+"年"+(t.getMonth()+1)+"月"+t.getDate()+"日",o.innerHTML='\n 重要提醒
\n \n 贵校'+(i.packageName||"")+'到期时间为'+e+',到期后,以下常用功能将受到限制:
\n 1. 学校每个年级一年内只能创建1场考试
\n 2. 选题组卷、智能批改、精准教学等功能将无法使用
\n 如果您需要继续续期,可以直接扫描下方企业微信二维码添加我们的工作人员,了解最新的续期政策及优惠活动\n
\n \n

\n
\n \n ',document.body.appendChild(n),document.body.appendChild(o),(t=document.createElement("img")).src="//zhixue.oss-cn-hangzhou.aliyuncs.com/container/oss_93d915c8-d561-4139-9193-8ecce5cd3d7b.png",t.classList.add("zx-pkg-remind-bg"),o.insertBefore(t,o.firstChild),a=document.querySelector('#zx-pkg-remind-modal #zx-pkg-remind-checkbox input[type="checkbox"]'),r=document.querySelector("#zx-pkg-remind-modal #zx-pkg-remind-checkbox .zx-txt"),a.addEventListener("change",function(){this.checked?r.style.color="#05C1AE":r.style.color="#595959"}),document.querySelector("#zx-pkg-remind-modal #zx-pkg-remind-modal-btn").onclick=function(){a&&a.checked!==c?l({url:"/container/container/teacher/updateRemindStatus",type:"POST",data:{status:a.checked?1:0},success:function(){c=a.checked,document.body.removeChild(o),document.body.removeChild(n)},error:function(e){console.info("[zx-common-header] updateRemindStatus failed: ",e),document.body.removeChild(o),document.body.removeChild(n)}}):(document.body.removeChild(o),document.body.removeChild(n))},c&&(a.checked=!0,r.style.color="#05C1AE"))},n},renderPackageInfoV1:function(e){var n,o;e.packageOverdueRemind&&0\n 当前版本为'+e.packageName+',即将在'+e.pkgRemainDay+'天后到期。如需续期,请 点击此处 >\n
\n ',"AX"!==e.packageType&&"XY"!==e.packageType||(o='\n \n 当前版本为'+e.packageName+',即将在'+e.pkgRemainDay+'天后到期。\n
\n
'),(n=document.createElement("div")).classList.add("pkg-tooltip"),n.id="pkg-tooltip",n.innerHTML=o,o=document.getElementById("headerApp"))&&o.parentNode&&(o.parentNode.insertBefore(n,o),this.initPkgTooltip(e.packageType))},initPackageInfo:function(){var n=this,e=document.getElementById("pkg-tooltip");e&&document.body.removeChild(e),l({url:"/container/container/teacher/getSchoolPackageInfo",data:{},type:"GET",success:function(e){e=z(e);e&&(e.packageExpireRemindOnline?n.renderPackageInfoV2(e):n.renderPackageInfoV1(e))},error:function(e){console.info("[zx-common-header] init package info error: ",e)}})},getSchoolPackageName:function(){var o=this;l({url:"/container/container/teacher/getSchoolPackageName",data:{},type:"GET",success:function(e){var n,e=z(e);e.showSchoolPackageVersion&&((n=document.getElementById("headerPackage")).innerText=e.packageName||"试用版",H(n),"AX"!==e.packageType&&"XY"!==e.packageType&&(n.onclick=o.goApplicationCenter),M())},error:function(e){console.info("[zx-common-header] init package info error: ",e)}})},getHomeworkLinkInfo:function(){var o=this;ce(function(e){e&&l({url:"//"+window.location.host+"/hw/v3/firstPage/getHomeWorkPermissions",type:"POST",contentType:"application/json",headers:{Authorization:e},data:JSON.stringify(J({permissionCodes:[800]})),success:function(e){var n;e.result&&0'+o[a].cName+"";e.innerHTML=t;var r=this;"student"===n||"parent"===n?r.addClass(e.querySelectorAll('dt > a[data-role="parent"]'),"on"):r.addClass(e.querySelectorAll('dt > a[data-role="'+n+'"]'),"on"),e.style.display="block",e.onclick=function(e){e=e.target;"a"===e.nodeName.toLowerCase()&&e.className.indexOf("on")<0&&r.changeRole(e,!0)}}},initEbgRole:function(e,t){var a=[],n=(e.forEach(function(e){var n=e.id,o=e.eName;a.push({title:e.cName,property:n+"_"+o,current:"student"===t&&"parent"===o||t===o,funcname:"zxSwitchRole",params:JSON.stringify({id:n,role:o})})}),[{title:"角色切换",property:"switchRole",children:a}]),o=this;window.ebgnavigation&&window.ebgnavigation.setSettingList&&(window.ebgnavigation.setSettingList(n),window.ebgnavigation.on("zxSwitchRole",function(e){var e=e||{};e.current||(e=z(e.params),o.changeRole(e,!1))})),window.ebgnavigation.on("navRenderCompleted",function(){window.ebgnavigation.setSettingList(n),window.ebgnavigation.on("zxSwitchRole",function(e){var e=e||{};e.current||(e=z(e.params),o.changeRole(e,!1))})})},changeRole:function(e,n){C("help_role",n?e.getAttribute("data-role"):e.role,T?null:"zhixue.com","/"),d("u_d_s"),d("dxq_package_info");var o="/htm-vessel";l({url:"/container/container/teacher/setUserRole",type:"POST",data:{role:n?e.getAttribute("data-role"):e.role},success:function(e){(!e||"success"===(e="string"==typeof e?z(e):e).result)&&(window.location.href=o)},error:function(e){console.info("[zx-common-header] change role failed: ",e),window.location.href=o}})},checkDefaultRole:function(e,o){if(h){var t=void 0;if("school"===h?t=m:"admin"===h?t=g:"jyy"===h?t=$:"parent"===h?t=["parent"]:"student"===h&&(t=["student"]),t&&t.length&&(!e.role||!t.includes(e.role))&&o&&o.length){for(var a=void 0,n=0;n{if(o.some(function(e){return e.eName===t[n]}))return a=t[n],"break"})(n))break;return a}}},setLoginNextPage:function(e){de=e||""},changeRoleV2:function(e,n){try{C("help_role",e,T?null:"zhixue.com","/"),d("u_d_s"),d("dxq_package_info"),console.log("change role to =>",e),e&&l({url:"/container/container/teacher/setUserRole",type:"POST",data:{role:e},success:function(e){n&&n()},error:function(e){console.info("[zx-common-header] change role failed: ",e),window.location.href=logoutURL}})}catch(e){console.error("[zx-common-header] change role v2 failed: ",e)}},initshowDropMenu:function(e,n,o,t){var a=document.getElementById("headerDropMore"),e=(F()?"student"===o.role&&c(a.querySelector('[data-type="school"]')):(e?"student"===o.role&&c(a.querySelector('[data-type="school"]')):(c(a.querySelector('[data-type="account"]')),c(a.querySelector('[data-type="school"]')),a.querySelector(".person").innerText="个人中心"),e=o,o=a.querySelector('[data-type="person"]'),e=e.role,["areaExamAdministrator","scanner"].indexOf(void 0===e?"":e)<0||c(o),n&&c(a.querySelector('[data-type="central"]'))),this.setDropMenuConfigUrl(t),a.querySelectorAll("a")),r=this;e.forEach(function(n){n.addEventListener("click",function(){var e=n.parentNode.getAttribute("data-type");console.log("type",e),r.userMenuEventTracking(e)})})},setDropMenuConfigUrl:function(e){var n=this,o=document.getElementById("headerDropMore");o.querySelector(".school").href="http://umanage.changyan.com?app-key=zx-container-client",o.querySelector(".account").href="http://ucenter.changyan.com?app-key=zx-container-client",o.querySelector(".out").onclick=function(){n.userLoginOut(e)}},userLoginOut:function(e){var n,o,t,a,r;function i(){l({url:"/container/ssoservice.jsp",type:"POST",data:{action:"logout"},success:function(){c()},error:function(){c()}})}function c(){window.location.href=B(e,de)}d("u_d_s"),d("dxq_package_info"),d("custom_project"),n="cur_role",o="",a=(a="/")?";path="+a:"",t=(t=".zhixue.com")?";domain="+t:"",r=";expires="+new Date(0).toGMTString(),document.cookie=n+"="+o+t+a+r,window.sessionStorage.removeItem("zyDotButton"),window.localStorage&&window.localStorage.removeItem("xToken"),l({url:"//sso.zhixue.com/sso_alpha/logout",type:"GET",jsonp:"userLoginOut",time:2e3,success:function(){i()},error:function(){i()}})},addClass:function(e,n){if(e&&0!==e.length)if(e.length)for(var o=0;o