146 lines
414 KiB
HTML
146 lines
414 KiB
HTML
|
<!DOCTYPE html>
|
|||
|
<html><head><title>人力资源管理从入门到精通</title><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta property="og:title" content="人力资源管理从入门到精通"/><meta property="og:description" content="本书是一本企业人力资源管理实务书,由浅入深地介绍了人力资源管理的具体内容,即:在企业中,人力资源部门员工具体做什么、怎么做。职位不同,所需具备的知识和能力也是不同的,纵向职位层级的划分,构成了本书的框架:入门篇——人力资源专员的应知应会,提升篇——人力资源主管的工作技巧,精通篇——人力资源部经理的管理技术。全书共20章。从HR入行须知讲起,入门篇介绍了一个基本不懂业务的新手如何快速成长为熟手;提升篇介绍了人力资源主管的工作技巧,在专员、主管的层级,按五大模块(人事、招聘、培训、薪资、考核)具体介绍;精通篇,介绍了人力资源部经理的管理技术,包括组织架构、人力资源预算、体系审核、猎头合作、人力资源软件选型、人力资源规划、经营计划与预算。本书是作者12年企业HR从业经历的全面总结,适合企业人力资源部专员、主管、副经理、部门经理、总监等阅读,也可供本科生、研究生等作为参考书。."/><meta property="og:image" content="https://wiki.7wate.com/static/og-image.png"/><meta property="og:width" content="1200"/><meta property="og:height" content="675"/><link rel="icon" href="../../static/icon.png"/><meta name="description" content="本书是一本企业人力资源管理实务书,由浅入深地介绍了人力资源管理的具体内容,即:在企业中,人力资源部门员工具体做什么、怎么做。职位不同,所需具备的知识和能力也是不同的,纵向职位层级的划分,构成了本书的框架:入门篇——人力资源专员的应知应会,提升篇——人力资源主管的工作技巧,精通篇——人力资源部经理的管理技术。全书共20章。从HR入行须知讲起,入门篇介绍了一个基本不懂业务的新手如何快速成长为熟手;提升篇介绍了人力资源主管的工作技巧,在专员、主管的层级,按五大模块(人事、招聘、培训、薪资、考核)具体介绍;精通篇,介绍了人力资源部经理的管理技术,包括组织架构、人力资源预算、体系审核、猎头合作、人力资源软件选型、人力资源规划、经营计划与预算。本书是作者12年企业HR从业经历的全面总结,适合企业人力资源部专员、主管、副经理、部门经理、总监等阅读,也可供本科生、研究生等作为参考书。."/><meta name="generator" content="Quartz"/><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com"/><script async src="https://umami.7wate.com/script.js" data-website-id="c061efdc-95dd-4d21-9d04-a1ffda0a85b9"></script><script>
|
|||
|
var _hmt = _hmt || [];
|
|||
|
(function() {
|
|||
|
var hm = document.createElement("script");
|
|||
|
hm.src = "https://hm.baidu.com/hm.js?94d8ccb156eb7c65abf317e6e01cdba9";
|
|||
|
var s = document.getElementsByTagName("script")[0];
|
|||
|
s.parentNode.insertBefore(hm, s);
|
|||
|
})();
|
|||
|
</script><script async src="https://www.googletagmanager.com/gtag/js?id=G-MHMEL0F832"></script><script>
|
|||
|
(function() {
|
|||
|
window.dataLayer = window.dataLayer || [];
|
|||
|
function gtag() {
|
|||
|
window.dataLayer.push(arguments);
|
|||
|
}
|
|||
|
gtag('js', new Date());
|
|||
|
gtag('config', 'G-MHMEL0F832');
|
|||
|
})();
|
|||
|
</script><link href="../../index.css" rel="stylesheet" type="text/css" spa-preserve/><link href="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.css" rel="stylesheet" type="text/css" spa-preserve/><link href="https://fonts.googleapis.com/css2?family=IBM Plex Mono&family=Schibsted Grotesk:wght@400;700&family=Source Sans Pro:ital,wght@0,400;0,600;1,400;1,600&display=swap" rel="stylesheet" type="text/css" spa-preserve/><script src="../../prescript.js" type="application/javascript" spa-preserve></script><script type="application/javascript" spa-preserve>const fetchData = fetch(`../../static/contentIndex.json`).then(data => data.json())</script></head><body data-slug="Book/经济理财/人力资源管理从入门到精通"><div id="quartz-root" class="page"><div id="quartz-body"><div class="left sidebar"><h1 class="page-title "><a href="../..">📚 X·Eden</a></h1><div class="spacer mobile-only"></div><div class="search "><div id="search-icon"><p>Search</p><div></div><svg tabIndex="0" aria-labelledby="title desc" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19.9 19.7"><title id="title">Search</title><desc id="desc">Search</desc><g class="search-path" fill="none"><path stroke-linecap="square" d="M18.5 18.3l-5.4-5.4"></path><circle cx="8" cy="8" r="7"></circle></g></svg></div><div id="search-container"><div id="search-space"><input autocomplete="off" id="search-bar" name="search" type="text" aria-label="Search for something" placeholder="Search for something"/><div id="results-container"></div></div></div></div><div class="darkmode "><input class="toggle" id="darkmode-toggle" type="checkbox" tabIndex="-1"/><label id="toggle-label-light" for="darkmode-toggle" tabIndex="-1"><svg xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" version="1.1" id="dayIcon" x="0px" y="0px" viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xmlSpace="preserve"><title>Light mode</title><path d="M6,17.5C6,16.672,5.328,16,4.5,16h-3C0.672,16,0,16.672,0,17.5 S0.672,19,1.5,19h3C5.328,19,6,18.328,6,17.5z M7.5,26c-0.414,0-0.789,0.168-1.061,0.439l-2,2C4.168,28.711,4,29.086,4,29.5 C4,30.328,4.671,31,5.5,31c0.414,0,0.789-0.168,1.06-0.44l2-2C8.832,28.289,9,27.914,9,27.5C9,26.672,8.329,26,7.5,26z M17.5,6 C18.329,6,19,5.328,19,4.5v-3C19,0.672,18.329,0,17.5,0S16,0.672,16,1.5v3C16,5.328,16.671,6,17.5,6z M27.5,9 c0.414,0,0.789-0.168,1.06-0.439l2-2C30.832,6.289,31,5.914,31,5.5C31,4.672,30.329,4,29.5,4c-0.414,0-0.789,0.168-1.061,0.44 l-2,2C26.168,6.711,26,7.086,26,7.5C26,8.328,26.671,9,27.5,9z M6.439,8.561C6.711,8.832,7.086,9,7.5,9C8.328,9,9,8.328,9,7.5 c0-0.414-0.168-0.789-0.439-1.061l-2-2C6.289,4.168,5.914,4,5.5,4C4.672,4,4,4.672,4,5.5c0,0.414,0.168,0.789,0.439,1.06 L6.439,8.561z M33.5,16h-3c-0.828,0-1.5,0.672-1.5,1.5s0.672,1.5,1.5,1.5h3c0.828,0,1.5-0.672,1.5-1.5S34.328,16,33.5,16z M28.561,26.439C28.289,26.168,27.914,26,27.5,26c-0.828,0-1.5,0.672-1.5,1.5c0,0.414,0.168,0.789,0.439,1.06l2,2 C28.711,30.832,29.086,31,29.5,31c0.828,0,1.5-0.672,1.5-1.5c0-0.414-0.168-0.789-0.439-1.061L28.561,26.439z M17.5,29 c-0.829,0-1.5,0.672-1.5,1.5v3c0,0.828,0.671,1.5,1.5,1.5s1.5-0.672,1.5-1.5v-3C19,29.672,18.329,29,17.5,29z M17.5,7 C11.71,7,7,11.71,7,17.5S11.71,28,17.5,28S28,23.29,28,17.5S23.29,7,17.5,7z M17.5,25c-4.136,0-7.5-3.364-7.5-7.5 c0-4.136,3.364-7.5,7.5-7.5c4.136,0,7.5,3.364,7.5,7.5C25,21.636,21.636,25,17.5,25z"></path></svg></label><label id="toggle-label-dark" for="darkmode-toggle" tabIndex="-1"><svg xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" version="1.1" id="nightIcon" x="0px" y="0px" viewBox="0 0 100 100" style="enable-background='new 0 0 100 100'" xmlSpace="preserve"><title>Dark mode</title><path d="M96.76,66.458c-0.853-0.852-2.15-1.064-3.23-0.534c-6.063,2.991-12.858,4.571-19.655,4.571 C62.022,70.495,50.88,65.88,42.5,57.5C29.043,44.043,25.658,23.536,34.076,6.47c0.532-1.08,0.318-2.379-0.534-3.23 c-0.851-0.852-2.15-1.064-3.23-0.534c-4.918,2.427-9.375,5.619-13.246,9.491c-9.447,9.447-14.65,22.008-14.65,35.369 c0,13.36,5.20
|
|||
|
<ul>
|
|||
|
<li><strong>书名</strong>:《人力资源管理从入门到精通》</li>
|
|||
|
<li><strong>作者</strong>: 张明辉</li>
|
|||
|
<li><strong>分类</strong>: 经济理财-管理</li>
|
|||
|
<li><strong>ISBN</strong>:9787302392002</li>
|
|||
|
<li><strong>出版社</strong>:清华大学出版社</li>
|
|||
|
</ul>
|
|||
|
<h2 id="概述">概述<a aria-hidden="true" tabindex="-1" href="#概述" class="internal"> §</a></h2>
|
|||
|
<p>本书是一本企业人力资源管理实务书,由浅入深地介绍了人力资源管理的具体内容,即:在企业中,人力资源部门员工具体做什么、怎么做。职位不同,所需具备的知识和能力也是不同的,纵向职位层级的划分,构成了本书的框架:入门篇——人力资源专员的应知应会,提升篇——人力资源主管的工作技巧,精通篇——人力资源部经理的管理技术。全书共20章。从HR入行须知讲起,入门篇介绍了一个基本不懂业务的新手如何快速成长为熟手;提升篇介绍了人力资源主管的工作技巧,在专员、主管的层级,按五大模块(人事、招聘、培训、薪资、考核)具体介绍;精通篇,介绍了人力资源部经理的管理技术,包括组织架构、人力资源预算、体系审核、猎头合作、人力资源软件选型、人力资源规划、经营计划与预算。本书是作者12年企业HR从业经历的全面总结,适合企业人力资源部专员、主管、副经理、部门经理、总监等阅读,也可供本科生、研究生等作为参考书。</p>
|
|||
|
<h2 id="划线">划线<a aria-hidden="true" tabindex="-1" href="#划线" class="internal"> §</a></h2>
|
|||
|
<blockquote>
|
|||
|
<p>在企业中,人力资源管理具体做什么、怎么做。这个问题,很容易被模块化为人事、招聘、培训、薪资、考核五大模块,以及岗位、HR规划两大基础。</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>HR:人力资源,人力资源部,人力资源专业人员。HRM:人力资源管理,人力资源部经理。HRD:人力资源开发,人力资源总监。HRVP:人力资源副总裁。HRBP:人力资源业务合作伙伴,派驻到各业务部门的HR。HR Unit:人资单位,人力资源部门。</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>新员工报到入职当天,先由人力资源部按照正常流程办理入职手续。可能包括:提交核对身份证、相关证件,签订劳动合同,领取门禁卡(饭卡)、员工牌,开通公司邮箱、办公系统OA账号,办理工资卡,发放员工手册、电脑、必要的办公用品等。可通过邮箱发放通讯录,请新员工去OA下载并自学公司规章制度、财务报销流程等,还可以直接把职位说明书发给他。然后,人力资源部经理(或直接主管)找新员工谈话。除了表示欢迎,还要交代他尽快熟悉情况,包括公司、本部门、本岗位的情况。</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>第一种意思,熟悉办公环境。</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>第二种意思,熟悉人头。</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>第三种意思,熟悉公司规章制度。</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>第四种意思,熟悉工作情况。</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>总之,HR新手的工作,可以概括为:办事,跑腿,打电话,录数据,做表单。</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>每做一件事情之前,都要想一想:依据(法规政策,公司内部规章制度)是什么,需要准备哪些材料、是否齐全,相关领导、岗位人员是否签字确认(投入);</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>所以,直接主管在布置任务时,要把意图讲解、交代清楚,并向其确认:我刚才提到的事情、任务,你再重复下,有没有问题?新手也要在领任务时,多问一句:领导(主管),您刚才交代的任务,我理解是这样的,对吗?这就可以在源头上避免方向上的偏差。</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>甚至,在晚上或周末时,也可以做些额外的工作。现在的工作节奏快,新手没有在额外时间投入准备,在8小时内把事情做完,有时是不现实的;而经过阶段性的工作历练,在工作中学习,熟手是可以在8小时内把工作基本做完的。</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>一个成功的人需要四种人来帮助他:高人指点、贵人相助、爱人激励、小人监督</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>[插图]</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>(1)假设你所在的部门下设6个科,你是某科的科员,在你们科里,除了科长之外,大家公认你的业务能力最强。有一天,部门经理交给你一份刚收到的会议通知,让你去参加某个会议。请你谈谈,从你接到通知那一刻到参加会议前,你会做些什么?(2)如果你入选了,但你的岗位级别定得较低,而你的主管在学历、资历、能力等方面都不如你,你该怎么办?(3)请你说说与领导相处和与同事相处的不同点。(4)你和你的上司有过意见不一致的情况吗?如果有,且你觉得自己理由充分,你会据理力争吗?如果不会,为什么?你是否担心今后他给你“穿小鞋”?(5)企业管理人员的选择可以采用外部招聘和内部提升两种方式,你认为各有何优缺点?(6)面对客户除工作之外的要求,如暗示要财务旅游、招待,你如何对待?(7)你管理的员工及时处理了工作中发生的紧急情况,但违反了规章制度,事后,你会怎么办?(8)请你为我们这次面试做个小结或提个建议好吗?你对我们几个面试人员有什么看法和建议?(9)原单位的领导对你的离开会持什么态度?会不会挽留你?(10)请用三个词评价你自己(考虑半分钟)</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>(1)请谈谈你现在的工作情况和工作业绩。或在你最近的工作中,最突出的业绩是什么?(2)你认为现在的工作对你的发展有何影响?你为什么想换工作?对于这个岗位你有哪些优势和不足?你打算怎样弥补不足?(3)你怎样理解你所应聘的岗位?你觉得如果我们录用你,你能为我们带来的最直接的效益是什么?(4)你需要多长时间来适应一个新工作岗位?最难处理的是什么事情?为什么?(5)你最富有创造性的工作成果是什么?(6)对你而言,“成功”有何含义?在你以前的工作经历中,什么事令你最有成就感?(7)最不喜欢怎样的工作?觉得自己最大的失败是什么?从中吸取了哪些教训?</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>(1)你为什么应聘我们公司?你对我们公司有哪些了解?你最看好公司哪些方面?(2)你向往怎样的工作环境?欣赏怎样的领导风格?最反感怎样的领导风格?(3)你觉得至今为止,什么事情或什么人对你的影响最大?如何影响你?为什么?(4)你平时最喜欢什么休闲活动?最喜欢哪部文学作品或者哪个人物,为什么?(5)请结合自己的情况,谈谈你对公司晋升制度的建议?(6)你是如何看待事业和家庭之间的关系的?平时周末做什么?如经常需要周末加班,会有什么问题?为什么?(7)在你看来,当今最优秀的或最成功的企业是哪一家?为什么?(请考虑一分钟)(8)你选择工作时,薪酬的重要性排在第几位?排在第一位的是什么?为什么?</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>第一章:总则。介绍部门职能说明书的使用、岗位职责说明书的使用、名称定义。第二章:公司组织结构图。第三章:部门职能说明书。包括13个部门。第四章:岗位结构。包括董事会机构岗位结构图、集团职能部门岗位结构图。第五章:岗位职责说明书。包括63个岗位。</p>
|
|||
|
</blockquote>
|
|||
|
<blockquote>
|
|||
|
<p>(1)A猎头公司的寻访流程,包括6个阶段:需求分析、企业了解、综合分析、寻访猎取、人才推荐、跟踪服务,具体见表17.1。表17.1 猎头寻访流程[插图]</p>
|
|||
|
</blockquote>
|
|||
|
<h2 id="笔记">笔记<a aria-hidden="true" tabindex="-1" href="#笔记" class="internal"> §</a></h2>
|
|||
|
<h2 id="书评">书评<a aria-hidden="true" tabindex="-1" href="#书评" class="internal"> §</a></h2>
|
|||
|
<h2 id="点评">点评<a aria-hidden="true" tabindex="-1" href="#点评" class="internal"> §</a></h2></article></div><div class="right sidebar"><div class="graph "><h3>Graph View</h3><div class="graph-outer"><div id="graph-container" data-cfg="{"drag":true,"zoom":true,"depth":1,"scale":1.1,"repelForce":0.5,"centerForce":0.3,"linkDistance":30,"fontSize":0.6,"opacityScale":1,"showTags":true,"removeTags":[]}"></div><svg version="1.1" id="global-graph-icon" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 55 55" fill="currentColor" xmlSpace="preserve"><path d="M49,0c-3.309,0-6,2.691-6,6c0,1.035,0.263,2.009,0.726,2.86l-9.829,9.829C32.542,17.634,30.846,17,29,17
|
|||
|
s-3.542,0.634-4.898,1.688l-7.669-7.669C16.785,10.424,17,9.74,17,9c0-2.206-1.794-4-4-4S9,6.794,9,9s1.794,4,4,4
|
|||
|
c0.74,0,1.424-0.215,2.019-0.567l7.669,7.669C21.634,21.458,21,23.154,21,25s0.634,3.542,1.688,4.897L10.024,42.562
|
|||
|
C8.958,41.595,7.549,41,6,41c-3.309,0-6,2.691-6,6s2.691,6,6,6s6-2.691,6-6c0-1.035-0.263-2.009-0.726-2.86l12.829-12.829
|
|||
|
c1.106,0.86,2.44,1.436,3.898,1.619v10.16c-2.833,0.478-5,2.942-5,5.91c0,3.309,2.691,6,6,6s6-2.691,6-6c0-2.967-2.167-5.431-5-5.91
|
|||
|
v-10.16c1.458-0.183,2.792-0.759,3.898-1.619l7.669,7.669C41.215,39.576,41,40.26,41,41c0,2.206,1.794,4,4,4s4-1.794,4-4
|
|||
|
s-1.794-4-4-4c-0.74,0-1.424,0.215-2.019,0.567l-7.669-7.669C36.366,28.542,37,26.846,37,25s-0.634-3.542-1.688-4.897l9.665-9.665
|
|||
|
C46.042,11.405,47.451,12,49,12c3.309,0,6-2.691,6-6S52.309,0,49,0z M11,9c0-1.103,0.897-2,2-2s2,0.897,2,2s-0.897,2-2,2
|
|||
|
S11,10.103,11,9z M6,51c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S8.206,51,6,51z M33,49c0,2.206-1.794,4-4,4s-4-1.794-4-4
|
|||
|
s1.794-4,4-4S33,46.794,33,49z M29,31c-3.309,0-6-2.691-6-6s2.691-6,6-6s6,2.691,6,6S32.309,31,29,31z M47,41c0,1.103-0.897,2-2,2
|
|||
|
s-2-0.897-2-2s0.897-2,2-2S47,39.897,47,41z M49,10c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S51.206,10,49,10z"></path></svg></div><div id="global-graph-outer"><div id="global-graph-container" data-cfg="{"drag":true,"zoom":true,"depth":-1,"scale":0.9,"repelForce":0.5,"centerForce":0.3,"linkDistance":30,"fontSize":0.6,"opacityScale":1,"showTags":true,"removeTags":[]}"></div></div></div><div class="toc desktop-only"><button type="button" id="toc" class><h3>Table of Contents</h3><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="fold"><polyline points="6 9 12 15 18 9"></polyline></svg></button><div id="toc-content"><ul class="overflow"><li class="depth-0"><a href="#简介" data-for="简介">简介</a></li><li class="depth-0"><a href="#概述" data-for="概述">概述</a></li><li class="depth-0"><a href="#划线" data-for="划线">划线</a></li><li class="depth-0"><a href="#笔记" data-for="笔记">笔记</a></li><li class="depth-0"><a href="#书评" data-for="书评">书评</a></li><li class="depth-0"><a href="#点评" data-for="点评">点评</a></li></ul></div></div><div class="backlinks "><h3>Backlinks</h3><ul class="overflow"><li>No backlinks found</li></ul></div><div class="explorer mobile-only"><button type="button" id="explorer" data-behavior="collapse" data-collapsed="collapsed" data-savestate="true" data-tree="[{"path":"Basics","collapsed":true},{"path":"Basics/english","collapsed":true},{"path":"Blog","collapsed":true},{"path":"Book","collapsed":true},{"path":"Book/个人成长","collapsed":true},{"path":"Book/医学健康","collapsed":true},{"path":"Book/历史","collapsed":true},{"path":"Book/哲学宗教","collapsed":true},{"path":"Book/心理","collapsed":true},{"path":"Book/政治军事","collapsed":true},{"path":"Book/教育学习","collapsed":true},{"path":"Book/文学","collapsed":true},{"path":"Book/生活百科","collapsed":true},{"path":"Book/社会文化","collapsed":true},{"path":"Book/科学技术","collapsed":true},{"path":"Book/经济理财","collapsed":true},{"path":"Book/艺术","collapsed":true},{"path":"Book/计算机","collapsed":true},{"path":"Company","collapsed":true},{"path":"Company/信息化","collapsed":true},{"path":"Company/信息化/规范","collapsed":true},{"path":"Culture","collapsed":true},{"path":"Government","collapsed":true},{"path":"Government/中国","collapsed":true},{"path":"Government/中国/标准","collapsed":true},{"path":"Government/中国/法律","collapsed":true},{"path":"Journal","collapsed":true},{"path":"Journal/2022","collapsed":true},{"path":"Journal/2022/W34","collapsed":true},{"path":"Journal/2022/W35","collapsed":true},{"path":"Journal/2022/W36","collapsed":true},{"path":"Journal/2022/W37","collapsed":true},{"path":"Journal/2022/W38","collapsed":true},{"path":"Journal/2022/W39","collapsed":true},{"path&quo
|
|||
|
function toggleCallout() {
|
|||
|
const outerBlock = this.parentElement;
|
|||
|
outerBlock.classList.toggle(`is-collapsed`);
|
|||
|
const collapsed = outerBlock.classList.contains(`is-collapsed`);
|
|||
|
const height = collapsed ? this.scrollHeight : outerBlock.scrollHeight;
|
|||
|
outerBlock.style.maxHeight = height + `px`;
|
|||
|
let current = outerBlock;
|
|||
|
let parent = outerBlock.parentElement;
|
|||
|
while (parent) {
|
|||
|
if (!parent.classList.contains(`callout`)) {
|
|||
|
return;
|
|||
|
}
|
|||
|
const collapsed2 = parent.classList.contains(`is-collapsed`);
|
|||
|
const height2 = collapsed2 ? parent.scrollHeight : parent.scrollHeight + current.scrollHeight;
|
|||
|
parent.style.maxHeight = height2 + `px`;
|
|||
|
current = parent;
|
|||
|
parent = parent.parentElement;
|
|||
|
}
|
|||
|
}
|
|||
|
function setupCallout() {
|
|||
|
const collapsible = document.getElementsByClassName(
|
|||
|
`callout is-collapsible`
|
|||
|
);
|
|||
|
for (const div of collapsible) {
|
|||
|
const title = div.firstElementChild;
|
|||
|
if (title) {
|
|||
|
title.removeEventListener(`click`, toggleCallout);
|
|||
|
title.addEventListener(`click`, toggleCallout);
|
|||
|
const collapsed = div.classList.contains(`is-collapsed`);
|
|||
|
const height = collapsed ? title.scrollHeight : div.scrollHeight;
|
|||
|
div.style.maxHeight = height + `px`;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
document.addEventListener(`nav`, setupCallout);
|
|||
|
window.addEventListener(`resize`, setupCallout);
|
|||
|
</script><script type="module">
|
|||
|
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
|
|||
|
const darkMode = document.documentElement.getAttribute('saved-theme') === 'dark'
|
|||
|
mermaid.initialize({
|
|||
|
startOnLoad: false,
|
|||
|
securityLevel: 'loose',
|
|||
|
theme: darkMode ? 'dark' : 'default'
|
|||
|
});
|
|||
|
document.addEventListener('nav', async () => {
|
|||
|
await mermaid.run({
|
|||
|
querySelector: '.mermaid'
|
|||
|
})
|
|||
|
});
|
|||
|
</script><script src="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/contrib/copy-tex.min.js" type="application/javascript"></script><script src="../../postscript.js" type="module"></script></html>
|