解决甘特图中里程碑重叠的问题 - myhexin.com

2023/10/20 11:22:16

// ==UserScript==
// @license MIT
// @name        解决甘特图中里程碑重叠的问题 - myhexin.com
// @namespace   Violentmonkey Scripts
// @match       http://cf.myhexin.com/pages/viewpage.action
// @grant       none
// @version     1.0
// @author      -
// @description 2023/10/20 11:22:16
// ==/UserScript==
window.onload = () => {
  document.querySelectorAll('.heading-expand-body').forEach((container) => {
  [...container.querySelectorAll('.roadmap-macro-view >svg >g >g:nth-child(3) text')]
   .sort((a, b) => a.getAttribute('x') - b.getAttribute('x')).forEach((it, idx) => it.style = `transform:translateY(${(idx%3-1) * 20}px)`)
  })
}