CommonTree.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. <template>
  2. <!-- 公共树形组件:基于 Element UI el-tree 封装 -->
  3. <!-- common_tree_wrapper:用作非 scoped 样式的全局命名空间,防止样式泄漏到其他组件 -->
  4. <div class="common_tree_wrapper common_tree">
  5. <!--
  6. el-tree 核心配置说明:
  7. - ref: 用于父组件通过 this.$refs 调用 el-tree 原生方法(如 setCheckedKeys、getCheckedNodes 等)
  8. - data: 树形数据源(由父组件通过 props 传入)
  9. - props: 配置 el-tree 如何读取数据结构中的字段(label/children)
  10. - node-key: 每个树节点的唯一标识字段,用于选中/高亮定位
  11. - show-checkbox: 开启多选复选框
  12. - highlight-current: 高亮当前点击选中的节点
  13. - default-expand-all: 默认展开所有节点
  14. -->
  15. <el-tree
  16. ref="commonTree"
  17. class="tree_container"
  18. :data="treeData"
  19. :props="treeProps"
  20. :node-key="nodeKey"
  21. :show-checkbox="showCheckbox"
  22. :highlight-current="highlightCurrent"
  23. :default-expand-all="defaultExpandAll"
  24. :default-expanded-keys="defaultExpandedKeys"
  25. :current-node-key="currentNodeKey"
  26. :expand-on-click-node="expandOnClickNode"
  27. @check="handleNodeCheck"
  28. >
  29. <!--
  30. 自定义树节点内容插槽(slot-scope)
  31. - node: 当前节点的完整数据对象(label、children、data 等)
  32. - data: 当前节点绑定的用户数据(即 treeData 中的每一项)
  33. -->
  34. <span class="custom_tree_node" slot-scope="{ node, data }">
  35. <!-- 节点名称区域 -->
  36. <span class="node_label" :title="data[treeProps.label]">
  37. <!-- 名称文本单独包裹一层,确保省略号只作用于真正承载文字的元素 -->
  38. <span class="node_label_text">{{ data[treeProps.label] }}</span>
  39. <!-- 右侧计数(可选,数据存在 count 字段时显示) -->
  40. <span
  41. class="node_count"
  42. v-if="data.count !== undefined && data.count !== null"
  43. >
  44. ({{ data.count }})
  45. </span>
  46. </span>
  47. <!--
  48. AI 讲解按钮(Element UI 文字按钮 type="text")
  49. - 默认隐藏(opacity: 0)
  50. - 通过父级 hover 显示
  51. - @click.stop 阻止冒泡,避免触发树节点点击
  52. -->
  53. <el-button
  54. class="ai_explain_btn"
  55. type="text"
  56. size="mini"
  57. icon=""
  58. @click.stop="HandleAiExplain(node, data)"
  59. >
  60. <img
  61. src="@/assets/knowledgeGraph/aiIcon.png"
  62. alt="AI讲解"
  63. style="width: 16px; height: 16px"
  64. />
  65. <span>AI讲解</span>
  66. </el-button>
  67. </span>
  68. </el-tree>
  69. </div>
  70. </template>
  71. <script>
  72. /**
  73. * CommonTree 公共树形组件
  74. *
  75. * 功能说明:
  76. * 1. 基于 Element UI el-tree 二次封装,支持数据传入渲染
  77. * 2. 支持多选复选框
  78. * 3. 节点勾选回传(仅发送勾选节点的 key 数组,如 knowledgeId 列表)
  79. * 4. 鼠标悬停节点行显示 "AI讲解" 按钮,点击打印并回传当前节点
  80. *
  81. * 父组件使用示例:
  82. * <CommonTree
  83. * :tree-data="knowledgeTreeData"
  84. * :tree-props="{ label: 'knowledgeName', children: 'children' }"
  85. * node-key="knowledgeId"
  86. * show-checkbox
  87. * @nodeCheck="handleTreeCheck"
  88. * @ai-explain="handleAiExplain"
  89. * />
  90. *
  91. * 父组件 handleTreeCheck 接收参数:
  92. * - checkedKeys: Array — 所有勾选节点的 key 数组(勾选父节点时包含其全部子节点 key)
  93. */
  94. export default {
  95. name: "CommonTree",
  96. // ==================== Props 配置(由父组件传入) ====================
  97. props: {
  98. /**
  99. * 树形数据源
  100. * 数据结构示例:
  101. * [
  102. * { id: 1, label: '节点1', count: 10, children: [
  103. * { id: 11, label: '子节点1', count: 5 }
  104. * ]}
  105. * ]
  106. */
  107. treeData: {
  108. type: Array,
  109. default: () => [],
  110. },
  111. /**
  112. * el-tree 的 props 配置,用于映射数据结构的字段
  113. * 默认:{ label: 'label', children: 'children' }
  114. * 如使用其他字段名,可传:{ label: 'knowledgeName', children: 'childList' }
  115. */
  116. treeProps: {
  117. type: Object,
  118. default: () => ({
  119. label: "label",
  120. children: "children",
  121. }),
  122. },
  123. /**
  124. * 节点唯一标识字段名
  125. * 用于选中、高亮、展开等操作的定位
  126. */
  127. nodeKey: {
  128. type: String,
  129. default: "id",
  130. },
  131. /** 是否显示多选复选框 */
  132. showCheckbox: {
  133. type: Boolean,
  134. default: false,
  135. },
  136. /** 是否高亮当前点击的节点 */
  137. highlightCurrent: {
  138. type: Boolean,
  139. default: true,
  140. },
  141. /** 是否默认展开所有节点 */
  142. defaultExpandAll: {
  143. type: Boolean,
  144. default: true,
  145. },
  146. /**
  147. * 默认展开的节点 key 数组
  148. * 与 defaultExpandAll 互斥使用
  149. */
  150. defaultExpandedKeys: {
  151. type: Array,
  152. default: () => [],
  153. },
  154. /** 当前高亮选中的节点 key */
  155. currentNodeKey: {
  156. type: [String, Number],
  157. default: "",
  158. },
  159. /**
  160. * 点击节点时是否展开/收起
  161. * false:只有点击小箭头才展开;点击节点文字只触发选中
  162. * true:点击节点文字也会触发展开/收起
  163. */
  164. expandOnClickNode: {
  165. type: Boolean,
  166. default: false,
  167. },
  168. },
  169. inject: ['openAiRobot'],//注入Ai机器人组件调用方法
  170. // ==================== 数据状态 ====================
  171. data() {
  172. return {};
  173. },
  174. computed:{
  175. subjectName()
  176. {
  177. return this.$store.state.target.subjectName;
  178. }
  179. },
  180. // ==================== 生命周期 ====================
  181. mounted() {
  182. if (Array.isArray(this.treeData) && this.treeData.length > 0) {
  183. clearTimeout(this._defaultSelectTimer);
  184. this._defaultSelectTimer = setTimeout(() => {
  185. this.applyDefaultFirstNode(this.treeData);
  186. }, 100);
  187. }
  188. },
  189. beforeDestroy() {
  190. clearTimeout(this._defaultSelectTimer);
  191. },
  192. // ==================== Watch ====================
  193. watch: {
  194. treeData: {
  195. handler(newVal) {
  196. if (!Array.isArray(newVal) || newVal.length === 0) return;
  197. // 用 setTimeout 确保 el-tree 内部节点已完全渲染(比 $nextTick 更可靠)
  198. clearTimeout(this._defaultSelectTimer);
  199. this._defaultSelectTimer = setTimeout(() => {
  200. this.applyDefaultFirstNode(newVal);
  201. }, 100);
  202. },
  203. },
  204. },
  205. // ==================== 方法 ====================
  206. methods: {
  207. /**
  208. * 树节点勾选事件(多选,showCheckbox=true 时生效)
  209. * 将所有勾选节点的 key(即 nodeKey 字段值,如 knowledgeId)数组发给父组件
  210. * 勾选父节点时,el-tree 默认级联勾选其全部子节点,故数组中包含父节点及全部子节点 key
  211. * @param {Object} data - 当前勾选/取消的节点数据
  212. * @param {Object} checkedInfo - 勾选状态详情 { checkedNodes, checkedKeys, halfCheckedKeys, halfCheckedNodes }
  213. */
  214. handleNodeCheck(data, checkedInfo) {
  215. console.log("当前节点数据:", data);
  216. console.log("勾选状态详情:", checkedInfo);
  217. this.$emit("nodeCheck", checkedInfo.checkedKeys);
  218. },
  219. /**
  220. * AI 讲解按钮点击事件
  221. * 1. 打印当前节点数据(方便调试)
  222. * 2. 通过 $emit 回传给父组件处理
  223. *
  224. * @param {Object} node - el-tree 节点对象
  225. * @param {Object} data - 当前节点绑定的用户数据
  226. */
  227. HandleAiExplain(node, data)
  228. {
  229. console.log("当前节点数据:", data);
  230. let content = "科目:"+this.subjectName+",知识点:"+data.knowledgeName;
  231. this.openAiRobot(content);
  232. },
  233. /**
  234. * 对外暴露方法:获取所有勾选的节点(仅多选模式 showCheckbox=true 有效)
  235. * @param {Boolean} leafOnly - 是否只返回叶子节点
  236. * @returns {Array} 选中的节点对象数组
  237. */
  238. getCheckedNodes(leafOnly = false) {
  239. if (!this.$refs.commonTree) return [];
  240. return this.$refs.commonTree.getCheckedNodes(leafOnly);
  241. },
  242. /**
  243. * 对外暴露方法:获取所有勾选节点的 key 数组
  244. * @param {Boolean} leafOnly
  245. * @returns {Array} 选中的节点 key 数组
  246. */
  247. getCheckedKeys(leafOnly = false) {
  248. if (!this.$refs.commonTree) return [];
  249. return this.$refs.commonTree.getCheckedKeys(leafOnly);
  250. },
  251. /**
  252. * 对外暴露方法:通过 keys 设置哪些节点被选中
  253. * @param {Array} keys - 要选中的节点 key 数组
  254. * @param {Boolean} leafOnly - 是否只设置叶子节点
  255. */
  256. setCheckedKeys(keys, leafOnly = false) {
  257. if (!this.$refs.commonTree) return;
  258. this.$refs.commonTree.setCheckedKeys(keys, leafOnly);
  259. },
  260. /**
  261. * 对外暴露方法:清空所有选中节点
  262. */
  263. clearChecked() {
  264. if (!this.$refs.commonTree) return;
  265. this.$refs.commonTree.setCheckedKeys([]);
  266. },
  267. /**
  268. * 对外暴露方法:设置当前高亮的节点
  269. * @param {String|Number} key - 节点 key
  270. */
  271. setCurrentKey(key) {
  272. if (!this.$refs.commonTree) return;
  273. this.$refs.commonTree.setCurrentKey(key);
  274. },
  275. /**
  276. * 默认勾选并展开第一个一级节点
  277. * 直接通过 el-tree 内部 store 获取节点实例,避免 node-key 与数据字段不匹配导致的 key 查找失败
  278. * @param {Array} data - 树形数据
  279. */
  280. applyDefaultFirstNode(data) {
  281. if (!data || data.length === 0) return;
  282. const treeRef = this.$refs.commonTree;
  283. if (!treeRef || !treeRef.store || !treeRef.store.root) return;
  284. // 1. 获取第一个顶层节点实例(绕过 key 匹配)
  285. const rootNode = treeRef.store.root;
  286. const childNodes = rootNode.childNodes;
  287. if (!childNodes || childNodes.length === 0) return;
  288. const firstNodeInstance = childNodes[0];
  289. if (!firstNodeInstance) return;
  290. // 2. 默认勾选第一个节点及其全部子节点(deep=true 级联勾选所有子节点)
  291. if (this.showCheckbox) {
  292. firstNodeInstance.setChecked(true, true);
  293. }
  294. // 3. 默认高亮选中第一个节点
  295. treeRef.setCurrentKey(firstNodeInstance.key);
  296. // 4. 默认展开第一个节点及其全部子节点(所有层级)
  297. const expandAllChildren = (node) => {
  298. if (!node) return;
  299. node.expanded = true;
  300. const subs = node.childNodes;
  301. if (Array.isArray(subs) && subs.length > 0) {
  302. subs.forEach((s) => expandAllChildren(s));
  303. }
  304. };
  305. expandAllChildren(firstNodeInstance);
  306. // 5. 触发 nodeCheck 事件,将所有勾选节点的 key 数组发给父组件
  307. // 仅发送一个数组参数(包含第一个节点及其所有子节点的 key)
  308. if (this.showCheckbox) {
  309. const checkedKeys = treeRef.getCheckedKeys();
  310. console.log("当前节点数据:", checkedKeys);
  311. this.$emit("nodeCheck", checkedKeys);
  312. }
  313. },
  314. },
  315. };
  316. </script>
  317. <!--
  318. ==========================================================================
  319. 样式分两块:
  320. 1. 下面这个不带 scoped 的 style 块:专门覆盖 Element UI 原生类名(连接线、padding、间距、选中态)
  321. - scoped + :deep 在 el-tree 深层级嵌套下经常不生效,改用非 scoped 搭配组件唯一根类
  322. .common_tree_wrapper 做命名空间隔离,不会污染全局其他 el-tree
  323. 2. 后面带 scoped 的 style 块:放自定义节点内容(custom_tree_node / node_label / ai_explain_btn 等)
  324. ==========================================================================
  325. -->
  326. <style lang="scss">
  327. /* ============== 可配置常量 ============== */
  328. $line_color: #dcdfe6; // 连接线颜色(虚线)
  329. $line_style: dashed; // 连接线样式
  330. $line_width: 1px; // 连接线宽度
  331. $indent_size: 35px; // 每层缩进
  332. $node_height: 36px; // 单行节点高度
  333. $node_padding_l: 15px; // 节点左侧 padding (用户要求:15px)
  334. $node_gap: 10px; // 节点上下间距 (用户要求:10px)
  335. $label_color: #333333; // 节点文字 (用户要求)
  336. $label_active: #2e64fa; // 选中节点文字 (用户要求)
  337. $label_fs: 14px; // 文字字号 (用户要求)
  338. $label_fw: 400; // 文字字重 (用户要求)
  339. $btn_color: #4f3eff; // AI讲解按钮颜色 (用户要求)
  340. /* =========================================================
  341. 命名空间:.common_tree_wrapper(只影响本组件)
  342. ========================================================= */
  343. .common_tree_wrapper {
  344. width: 100%;
  345. height: 100%;
  346. box-sizing: border-box;
  347. padding: 8px 0;
  348. /* ===================== 基础 ===================== */
  349. .tree_container,
  350. .el-tree {
  351. width: 100%;
  352. min-width: max-content; /* 整棵树按最宽节点内容撑开,所有节点行宽度一致 */
  353. background: transparent;
  354. }
  355. /* 允许每个节点内容宽度超过容器,从而触发父容器横向滚动条 */
  356. .el-tree-node__content {
  357. padding-left: 0 !important;
  358. padding-right: 0px;
  359. height: $node_height;
  360. line-height: $node_height;
  361. background: transparent;
  362. border-radius: 4px;
  363. margin-top: 0;
  364. margin-bottom: 0;
  365. font-weight: $label_fw;
  366. font-size: $label_fs;
  367. color: $label_color;
  368. width: 100%; /* 所有节点行跟随树宽度,保持一致 */
  369. overflow: visible; /* 取消默认内容裁剪 */
  370. &:hover {
  371. background-color: #f0f7ff;
  372. }
  373. }
  374. /* 第一级也统一 15px */
  375. .el-tree > .el-tree-node > .el-tree-node__content {
  376. padding-left: $node_padding_l !important;
  377. }
  378. /* ===================== 自定义展开收起图标样式 ===================== */
  379. .el-tree-node__expand-icon {
  380. width: 16px;
  381. height: 16px;
  382. display: flex !important;
  383. align-items: center !important;
  384. justify-content: center !important;
  385. cursor: pointer;
  386. margin-right: 8px;
  387. padding: 0 !important;
  388. border: none !important;
  389. /* 去掉Element UI默认的transform旋转过渡动画,直接切换图标 */
  390. transform: none !important;
  391. transition: none !important;
  392. }
  393. /* 去掉展开状态的transform旋转 */
  394. .el-tree-node__expand-icon.expanded {
  395. transform: none !important;
  396. -webkit-transform: none !important;
  397. }
  398. /* 隐藏Element UI默认的箭头伪元素 */
  399. .el-tree-node__expand-icon::before {
  400. display: none !important;
  401. }
  402. /* 收起状态:显示加号 icon_jia */
  403. .el-tree-node__expand-icon:not(.expanded):not(.is-leaf)::after {
  404. content: "\e64e";
  405. font-family: "iconfont" !important;
  406. font-size: 16px;
  407. color: #e0e3e9;
  408. display: inline-block;
  409. width: 16px;
  410. height: 16px;
  411. line-height: 16px;
  412. text-align: center;
  413. }
  414. /* 展开状态:显示减号 icon_jian */
  415. .el-tree-node__expand-icon.expanded:not(.is-leaf)::after {
  416. content: "\e64f";
  417. font-family: "iconfont" !important;
  418. font-size: 16px;
  419. color: #2e64fa;
  420. display: inline-block;
  421. width: 16px;
  422. height: 16px;
  423. line-height: 16px;
  424. text-align: center;
  425. }
  426. /* 叶子节点的占位符,保持对齐一致 */
  427. .el-tree-node__expand-icon.is-leaf {
  428. width: 0 !important;
  429. height: 0 !important;
  430. display: inline-block !important;
  431. cursor: default;
  432. visibility: hidden;
  433. margin-right: 8px;
  434. padding: 0 !important;
  435. }
  436. /* ===================== 虚线连接线(核心) ===================== */
  437. /* 1. 竖虚线:画在 children 容器的左侧,贯穿所有子节点 */
  438. .el-tree-node .el-tree-node__children {
  439. overflow: visible;
  440. position: relative;
  441. margin-left: 0;
  442. padding-left: 20px; // 层级缩进
  443. &::before {
  444. content: "";
  445. position: absolute;
  446. top: 0;
  447. bottom: $node_gap + $node_height / 2; // 末端停在最后一个节点"半高"处,和横线接上
  448. left: 18px; // 竖线 x 坐标
  449. width: $line_width;
  450. border-left: $line_width $line_style $line_color;
  451. }
  452. }
  453. /* 2. 横虚线:画在每个节点行的左侧,从竖线方向延伸到文字左边 */
  454. .el-tree-node {
  455. position: relative;
  456. > .el-tree-node__content::before {
  457. content: "";
  458. position: absolute;
  459. top: 50%;
  460. left: -($indent_size - 18px); // 起点对齐竖线
  461. width: $indent_size - 20px; // 横线长度
  462. height: 0;
  463. border-top: $line_width $line_style $line_color;
  464. pointer-events: none;
  465. }
  466. }
  467. /* 3. 第一级节点不画横线 */
  468. .el-tree > .el-tree-node > .el-tree-node__content::before {
  469. display: none;
  470. }
  471. /* 4. 最后一个子节点:竖线在横线之下的部分用白色盖掉,形成"L"拐角 */
  472. .el-tree-node > .el-tree-node__children > .el-tree-node:last-child {
  473. > .el-tree-node__content::after {
  474. content: "";
  475. position: absolute;
  476. top: 50%;
  477. bottom: -$node_gap;
  478. left: 18px - $indent_size; // 与竖线同 x
  479. width: $line_width + 2px;
  480. background: #fff; // 白色遮挡(面板必须是白色背景)
  481. z-index: 1;
  482. }
  483. }
  484. /* ===================== 选中 & 复选框 ===================== */
  485. .el-tree-node.is-current > .el-tree-node__content {
  486. background-color: #e6f0ff;
  487. color: $label_active; // 让文字内容(含原生 el-tree label 模式)也变色
  488. /* 额外命中自定义 slot 中的 .node_label,防止 scoped 里写的 #333 覆盖掉选中色 */
  489. .node_label {
  490. color: $label_active !important;
  491. font-weight: $label_fw;
  492. }
  493. }
  494. .el-checkbox {
  495. margin-right: 6px;
  496. }
  497. /* ===================== AI 讲解按钮(Element UI 文字按钮) =====================
  498. 字体 400 / 14 / #4F3EFF;opacity 0 默认隐藏,hover 节点行显示
  499. */
  500. .ai_explain_btn.el-button--text {
  501. display: inline-flex !important;
  502. align-items: center;
  503. justify-content: center;
  504. gap: 4px;
  505. padding: 4px 6px !important;
  506. height: auto !important;
  507. min-height: 24px;
  508. margin-left: 8px;
  509. opacity: 0;
  510. transition: opacity 0.2s ease;
  511. white-space: nowrap;
  512. flex-shrink: 0;
  513. position: relative;
  514. z-index: 3;
  515. font-weight: 400; // 用户要求
  516. font-size: 14px; // 用户要求
  517. color: $btn_color !important; // 用户要求:#4F3EFF
  518. // 确保内部img和span都居中对齐
  519. img {
  520. display: inline-block;
  521. vertical-align: middle;
  522. flex-shrink: 0;
  523. margin-right: 4px;
  524. }
  525. span {
  526. display: inline-block;
  527. vertical-align: middle;
  528. line-height: 1;
  529. }
  530. }
  531. .ai_explain_btn.el-button--text:hover {
  532. color: darken($btn_color, 10%) !important;
  533. }
  534. .ai_explain_btn .ai_icon {
  535. display: inline-block;
  536. width: 16px;
  537. height: 16px;
  538. line-height: 16px;
  539. text-align: center;
  540. font-size: 10px;
  541. font-weight: 600;
  542. color: #fff;
  543. background: $btn_color;
  544. border-radius: 3px;
  545. font-style: normal;
  546. flex-shrink: 0;
  547. }
  548. .ai_explain_btn.el-button--text:hover .ai_icon {
  549. background: darken($btn_color, 10%);
  550. }
  551. /* hover 节点行时,让 AI 讲解按钮淡入 */
  552. .el-tree-node__content:hover .ai_explain_btn.el-button--text {
  553. opacity: 1 !important;
  554. }
  555. }
  556. </style>
  557. <!-- ===============================================================
  558. 以下 scoped 样式块:只处理"自定义节点内容"(我们自己模板里写的)
  559. 类名是自定义的,能被 scoped 正常命中,无需 :deep
  560. =============================================================== -->
  561. <style lang="scss" scoped>
  562. .custom_tree_node {
  563. display: flex;
  564. align-items: center;
  565. justify-content: space-between;
  566. flex: 1;
  567. width: 100%; /* 占满整个节点行宽度(跟随树整体宽度) */
  568. padding-right: 8px;
  569. height: 36px;
  570. line-height: 36px;
  571. white-space: nowrap;
  572. position: relative;
  573. z-index: 2;
  574. /* ===== 节点文字(用户要求:400 / 14px / #333333) ===== */
  575. .node_label {
  576. flex: 1;
  577. display: inline-flex;
  578. align-items: center;
  579. font-weight: 400;
  580. font-size: 14px;
  581. color: #333333;
  582. white-space: nowrap;
  583. /* 名称文本:完整显示,不省略 */
  584. .node_label_text {
  585. display: inline-block;
  586. white-space: nowrap;
  587. line-height: 1;
  588. }
  589. /* 计数(60):灰色小字,不收缩 */
  590. .node_count {
  591. color: #909399;
  592. margin-left: 4px;
  593. font-size: 13px;
  594. flex-shrink: 0;
  595. }
  596. }
  597. }
  598. </style>