From 622ebcbcd73857df1f533574d55b76f778bc4225 Mon Sep 17 00:00:00 2001
From: Chengliang <1546584672@qq.com>
Date: Mon, 24 Jul 2023 09:36:44 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E8=BF=AD=E4=BB=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/encodings.xml | 4 +
.idea/inspectionProfiles/Project_Default.xml | 36 ++
.idea/misc.xml | 7 +
.idea/modules.xml | 8 +
.idea/org-chart-frant.iml | 9 +
.idea/vcs.xml | 6 +
.idea/workspace.xml | 535 +++++++++++++++++++
src/components/toolBar/img/compact.png | Bin 0 -> 210 bytes
src/components/toolBar/img/expandAll.png | Bin 0 -> 414 bytes
src/components/toolBar/img/fit.png | Bin 0 -> 1153 bytes
src/components/toolBar/img/fullscreen.png | Bin 0 -> 474 bytes
src/components/toolBar/index.jsx | 32 ++
src/components/toolBar/index.less | 71 +--
src/pages/company.jsx | 36 +-
14 files changed, 707 insertions(+), 37 deletions(-)
create mode 100644 .idea/encodings.xml
create mode 100644 .idea/inspectionProfiles/Project_Default.xml
create mode 100644 .idea/misc.xml
create mode 100644 .idea/modules.xml
create mode 100644 .idea/org-chart-frant.iml
create mode 100644 .idea/vcs.xml
create mode 100644 .idea/workspace.xml
create mode 100644 src/components/toolBar/img/compact.png
create mode 100644 src/components/toolBar/img/expandAll.png
create mode 100644 src/components/toolBar/img/fit.png
create mode 100644 src/components/toolBar/img/fullscreen.png
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..ce358e4
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..6560a98
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..cf64fc2
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..e674d91
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/org-chart-frant.iml b/.idea/org-chart-frant.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/.idea/org-chart-frant.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..198aa37
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,535 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ DEFINITION_ORDER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ActionScript specificJavaScript
+
+
+ Android
+
+
+ Ant
+
+
+ Batch Applications
+
+
+ CFML
+
+
+ CSS
+
+
+ Class structureJava
+
+
+ Code quality toolsCSS
+
+
+ Code quality toolsJavaScript
+
+
+ Code style issuesJava
+
+
+ CoffeeScript
+
+
+ CorrectnessLintAndroid
+
+
+ Cucumber
+
+
+ Error handlingJava
+
+
+ Faces Model
+
+
+ Flow type checkerJavaScript
+
+
+ FreeMarker
+
+
+ General
+
+
+ GeneralCoffeeScript
+
+
+ GeneralJavaScript
+
+
+ Google Web Toolkit
+
+
+ GrailsGroovy
+
+
+ Groovy
+
+
+ HTML
+
+
+ Hibernate
+
+
+ IconsUsabilityLintAndroid
+
+
+ ImportsJava
+
+
+ Inheritance issuesJava
+
+
+ Internationalization
+
+
+ InternationalizationJava
+
+
+ InternationalizationLintAndroid
+
+
+ Invalid elementsCSS
+
+
+ J2ME issuesJava
+
+
+ JSON and JSON5
+
+
+ JSP
+
+
+ Java
+
+
+ Java 8Java language level migration aidsJava
+
+
+ Java interop issuesKotlin
+
+
+ Java language level migration aidsJava
+
+
+ JavaFX
+
+
+ JavaScript
+
+
+ JavadocJava
+
+
+ Kotlin
+
+
+ LintAndroid
+
+
+ LintLintAndroid
+
+
+ Manifest
+
+
+ Markdown
+
+
+ MessagesCorrectnessLintAndroid
+
+
+ Node.jsJavaScript
+
+
+ OSGi
+
+
+ OtherGroovy
+
+
+ Pages Navigation Model
+
+
+ Plugin DevKit
+
+
+ PortabilityJava
+
+
+ Potentially confusing code constructsGroovy
+
+
+ Probable bugsJava
+
+
+ Properties Files
+
+
+ Properties FilesJava
+
+
+ RELAX NG
+
+
+ RESTful Web Service
+
+
+ Resource managementJava
+
+
+ SQL
+
+
+ Sass/SCSS
+
+
+ SecurityLintAndroid
+
+
+ SetupSpring CoreSpring
+
+
+ Spring
+
+
+ Spring BootSpring
+
+
+ Spring CoreSpring
+
+
+ Struts
+
+
+ Struts 1Struts
+
+
+ Struts 2Struts
+
+
+ Style issuesKotlin
+
+
+ TestNGJava
+
+
+ Threading issuesJava
+
+
+ TypeScript
+
+
+ UI Form
+
+
+ UsabilityLintAndroid
+
+
+ Validity issuesGroovy
+
+
+ Velocity
+
+
+ Verbose or redundant code constructsJava
+
+
+ VisibilityJava
+
+
+ Vue
+
+
+ Web Services
+
+
+ XML
+
+
+ XMLSpring CoreSpring
+
+
+ XPath
+
+
+ YAML
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ jr
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1689842546961
+
+
+ 1689842546961
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ fastdfs-client-java-1.27-RELEASE
+
+
+
+
+
+
+
+
+
+
+
+ 10
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/toolBar/img/compact.png b/src/components/toolBar/img/compact.png
new file mode 100644
index 0000000000000000000000000000000000000000..5233876a740f4a580eb6cafc18eafb7742405e69
GIT binary patch
literal 210
zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}J)SO(ArbCx
zryt~PG2mg@`|_dGg5KX3IQCxPDLwGG!nKe!q+wl~L@WCurfJ8QHAeQnx#4!M(npgw
z?b^-F`K!13X)Jw{_N{VS?Ztn(4ig@zhcTuwyt8w6Ij`Zuz%B8>I+*bX+nvASg7I#;
z3=v=XPc-msi9C?&?DjufY|m+iTE&Y|dd&F-2WPx$SV=@dR9Hvtmc35HFc8OmexumVqfka*;$z}NVqu^REJ(CWd`y&)@+h&LH}WAz
zDT*wswU1U-rFe{!`~Q6B-2H(SUQk${jR52fXsr(b;K`Q|5pR`JKa_Hk0DAG|P!JI(
z6o_nqnD`2W0+9s}5r6E(@2C*T0HHV{&XiI&URZ1W3;@>@h$MiB_?uGdVt5C%)~^6?
zo(qu#&@|1IbAI0kUq~rWVmICx^T`-H_Iu8`hq|t(oBoU>03XC!yF^5kQXZ}gYK-{?
z01!e81HhLMqHDL|veqsT@o4LAv*-h%zPAkO)`s;X`Tw{1If&Ryk-XU~E#6P)wTkT~adZ%9_BD{9Hs
zK~Vf)b_oIp
literal 0
HcmV?d00001
diff --git a/src/components/toolBar/img/fit.png b/src/components/toolBar/img/fit.png
new file mode 100644
index 0000000000000000000000000000000000000000..cd8ee5b6aa9c6329a83da3d0eec38daae752056e
GIT binary patch
literal 1153
zcmV-{1b+L8P)Px(J4r-AR9Hu~ms^M&MHGhrQ!{2)NJKOWih>uCh^x*{Rrl^M2|7^`kdcKTI+|KK{N$uBL1ZaYpvgJ
zCj@aE4=SYuWP9D7h>mEj2jw}A;|+yE;bgg7K5`yFR-Bp7GV|sz3=gy;oVT&oJ_6vC
zG(__HPXIpy=jkeSLj>(K!IQk)Hyv*%)(hKH_yB=iIFTcI3kepk$2srU4)c$INew
zqa+UzZ8FA;EJQqxoXP`|;l25{BWi27tBpFn}aRL=Xbxuzt;Nm`HHpj
z8y_EES*z8CbJ3T#Z$y)m^fKBqJ
zQfg(nT$b;9N1L_wH2_Z%(IEklwcZclj4|fC4W$z#&bcvW4w?BcisSe+5nVw{i5Z2nK0St?d_kMc-Rbd;hd{5
zb5db>@7E;&qobo&7K=sMtEKHK6bi$=y}k7~EgDZ+)P9zBc+ePgZ#@Lp5Yfqu(kW(s
zAqaxE7EK*MuHM*ajQJn|Nb9*@nutj;vSXojf%NN~3z#`dH7drKHAy1MPZUL~lu|!5
z0r)tbiEkG&6H*s2^FAVy>RGn@ZCdMH4FGHH9RMb>B2pK~=(X10FHl^Hk-Y$tS|DF<
zBr`BJHWn5Ng)zxT05=0zo{Am^@QlQ2J`hn9ttXbWe;#KgoZ@BJDPX68Hd
z;hfXKr0(pTd)9lurJg*w(aVM+A(BC?0FX>`wlVVwB6`CZ^Jc4=yXfI`WMt&BB}uIeu0M5D6QT|3mC*&T0tnp;CX{Y@U@+9?=
TaRa1;00000NkvXXu0mjf37;1{
literal 0
HcmV?d00001
diff --git a/src/components/toolBar/img/fullscreen.png b/src/components/toolBar/img/fullscreen.png
new file mode 100644
index 0000000000000000000000000000000000000000..ee9d692a08aa95fa5ba4db22ae569f166d8dd6ba
GIT binary patch
literal 474
zcmV<00VV#4P)Px$lu1NER9HvtS36DvF%TWQNyP;?0QJhVrrIJo04+5%a127r4M+nW1tkYaic~BU
zrREw`Q6w8p6t9A_!5@VXM7G@dyti+kH68)K{0N6nL}-jT+XWvf~@Bjdpi1?WF3#QZQ2^SPa@t#XyJRTo)Ivt$NW>i(xM-qWt
z&`@3UDF`*njUNac6!<#|@ML4BE2Vn5jwhlk0JsN$W`ag5aF_*qqks@%k07*qoM6N<$g0#243;+NC
literal 0
HcmV?d00001
diff --git a/src/components/toolBar/index.jsx b/src/components/toolBar/index.jsx
index 1cbe424..7b8a09f 100644
--- a/src/components/toolBar/index.jsx
+++ b/src/components/toolBar/index.jsx
@@ -6,6 +6,10 @@ import top from './img/top.png';
import left from './img/left.png';
import topActive from './img/top_active.png';
import leftActive from './img/left_active.png';
+import fullscreen from './img/fullscreen.png';
+import fit from './img/fit.png';
+import compact from './img/compact.png';
+import expandAll from './img/expandAll.png';
export default class ToolBar extends React.Component {
progressBtn = React.createRef();
@@ -97,6 +101,34 @@ export default class ToolBar extends React.Component {
this.props.onLeftLayoutClick(this.progressBtn);
}}
/>
+
{
+ this.props.onFullscreen(this.progressBtn);
+ }}
+ />
+
{
+ this.props.onFit(this.progressBtn);
+ }}
+ />
+
{
+ this.props.onCompact(this.progressBtn);
+ }}
+ />
+
{
+ this.props.onExpandAll(this.progressBtn);
+ }}
+ />
);
}
diff --git a/src/components/toolBar/index.less b/src/components/toolBar/index.less
index ffe10d8..305d10f 100644
--- a/src/components/toolBar/index.less
+++ b/src/components/toolBar/index.less
@@ -1,38 +1,39 @@
.toolbarWrapper {
- width: 68px;
- position: fixed;
- right: 10px;
- z-index: 100;
- background: #fff;
- border-radius: 20px;
- padding-top: 20px;
- padding-bottom: 20px;
- text-align: center;
- .progressWrapper {
- position: relative;
- padding-top: 5px;
- padding-bottom: 5px;
- margin-left: 20px;
- .progressLine {
- height: 100px;
- width: 0px;
- border-left: 2px solid #C9C9C9;
- margin-left: 12px;
- }
- .progressBtn {
- width: 16px;
- height: 9px;
- background-color: #C9C9C9;
- position: absolute;
- left: 5px;
- top: 0px;
- }
+ width: 68px;
+ position: fixed;
+ right: 10px;
+ z-index: 100;
+ background: #fff;
+ border-radius: 20px;
+ padding-top: 20px;
+ padding-bottom: 20px;
+ text-align: center;
+ .progressWrapper {
+ position: relative;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ margin-left: 20px;
+ .progressLine {
+ height: 100px;
+ width: 0px;
+ border-left: 2px solid #c9c9c9;
+ margin-left: 12px;
}
- .toolBarItem {
- display: block;
- margin-top: 20px;
- margin-bottom: 20px;
- margin-left: 20px;
- cursor: pointer;
+ .progressBtn {
+ width: 16px;
+ height: 9px;
+ background-color: #c9c9c9;
+ position: absolute;
+ left: 5px;
+ top: 0px;
}
-}
\ No newline at end of file
+ }
+ .toolBarItem {
+ display: block;
+ margin-top: 20px;
+ margin-bottom: 20px;
+ margin-left: 26px;
+ cursor: pointer;
+ width: 20px;
+ }
+}
diff --git a/src/pages/company.jsx b/src/pages/company.jsx
index 3e51d47..832c039 100644
--- a/src/pages/company.jsx
+++ b/src/pages/company.jsx
@@ -19,9 +19,11 @@ let topbar = null;
export default function companyPage() {
const [data, setData] = useState(null);
+ let compact = 0;
+ let expandAll = 0;
+
const [sliderProgress, setSliderProgress] = useState(50);
let addNodeChildFunc = null;
-
let topBarSearchRequest = null;
const [hasRight, setHasRight] = useState('');
const [timelineId, setTimelineId] = useState(0);
@@ -205,6 +207,30 @@ export default function companyPage() {
active = 'left';
};
+ const handleFullscreen = (progressBtn) => {
+ progressBtn.current.style.top = 50 + 'px';
+ orgChart && orgChart.fullscreen('body');
+ };
+
+ const handleFit = (progressBtn) => {
+ progressBtn.current.style.top = 50 + 'px';
+ orgChart && orgChart.fit();
+ };
+
+ const handleCompact = (progressBtn) => {
+ progressBtn.current.style.top = 50 + 'px';
+ orgChart &&
+ orgChart
+ .compact(!!(compact++ % 2))
+ .render()
+ .fit();
+ };
+
+ const handleExpandAll = (progressBtn) => {
+ progressBtn.current.style.top = 50 + 'px';
+ orgChart && expandAll++ % 2 ? orgChart.collapseAll() : orgChart.expandAll();
+ };
+
const handleZoomIn = (progressBtn) => {
if (progressBtn) {
let top = parseInt(progressBtn.current.style.top) - 10;
@@ -309,7 +335,9 @@ export default function companyPage() {
setData(data?.data);
}
}
- setSpinning(false);
+ setTimeout(function () {
+ setSpinning(false);
+ }, 200);
});
};
@@ -376,6 +404,10 @@ export default function companyPage() {
onLeftLayoutClick={(progressBtn) =>
handleLeftLayoutClick(progressBtn)
}
+ onFullscreen={(progressBtn) => handleFullscreen(progressBtn)}
+ onFit={(progressBtn) => handleFit(progressBtn)}
+ onCompact={(progressBtn) => handleCompact(progressBtn)}
+ onExpandAll={(progressBtn) => handleExpandAll(progressBtn)}
onZoomOut={(progressBtn) => handleZoomOut(progressBtn)}
onZoomIn={(progressBtn) => handleZoomIn(progressBtn)}
onZoomBehavior={(value) => handleZoomBehavior(value)}