Compare commits
9 Commits
master
...
custom-人事报
Author | SHA1 | Date |
---|---|---|
|
8a979d67b8 | 2 years ago |
|
87482fee74 | 2 years ago |
|
72799b73a5 | 2 years ago |
|
aeb7a1457d | 2 years ago |
|
496b86d8bc | 2 years ago |
|
70d0508a9c | 2 years ago |
|
c31ec3957a | 2 years ago |
|
8ec05fab81 | 2 years ago |
|
093e4838a8 | 2 years ago |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 950 B |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 218 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 832 KiB |
After Width: | Height: | Size: 108 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 101 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 104 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 6.0 MiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 251 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 197 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 254 B |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 1017 B |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 389 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 3.4 KiB |
@ -0,0 +1,172 @@
|
|||||||
|
@node-color: #1890ff;
|
||||||
|
@line-width: 1px;
|
||||||
|
@line-color: @node-color;
|
||||||
|
@expand-icon-size: 16px;
|
||||||
|
.text-overflow-ellipsis() {
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.org-chart {
|
||||||
|
&-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-table {
|
||||||
|
border-collapse: separate;
|
||||||
|
border-spacing: 0;
|
||||||
|
line-height: 1.5715;
|
||||||
|
|
||||||
|
.expand-icon {
|
||||||
|
display: inline-block;
|
||||||
|
width: @expand-icon-size;
|
||||||
|
height: @expand-icon-size;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: @line-color;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
bottom: 0;
|
||||||
|
margin-left: -@expand-icon-size / 2;
|
||||||
|
margin-bottom: -@expand-icon-size / 2;
|
||||||
|
z-index: 99;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&-expanded,
|
||||||
|
&-collapsed {
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
width: 8px;
|
||||||
|
height: 2px;
|
||||||
|
background-color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
top: 7px;
|
||||||
|
left: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-collapsed {
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
width: 2px;
|
||||||
|
height: 8px;
|
||||||
|
background-color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
top: 4px;
|
||||||
|
left: 7px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: darken(@line-color, 5%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
text-align: center;
|
||||||
|
padding: 0;
|
||||||
|
vertical-align: top;
|
||||||
|
|
||||||
|
&.hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-node {
|
||||||
|
display: inline-block;
|
||||||
|
//border: 1px solid @node-color;
|
||||||
|
//padding: 0.5rem;
|
||||||
|
margin: 0 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-line {
|
||||||
|
height: 20px;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&:not(&-children) {
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
width: @line-width;
|
||||||
|
height: 100%;
|
||||||
|
background-color: @line-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-children {
|
||||||
|
&:nth-child(odd) {
|
||||||
|
border-right: @line-width solid @line-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not(:first-child, :last-child) {
|
||||||
|
border-top: @line-width solid @line-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 水平
|
||||||
|
&&-horizontal {
|
||||||
|
.expand-icon {
|
||||||
|
top: 50%;
|
||||||
|
bottom: auto;
|
||||||
|
left: auto;
|
||||||
|
right: 0;
|
||||||
|
margin: -@expand-icon-size / 2 -@expand-icon-size / 2 auto auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr {
|
||||||
|
&:nth-child(odd) {
|
||||||
|
> .org-chart-table-line-children {
|
||||||
|
border-bottom: @line-width solid @line-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not(:first-child, :last-child) {
|
||||||
|
> .org-chart-table-line-children {
|
||||||
|
border-left: @line-width solid @line-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.org-chart-table {
|
||||||
|
&-node {
|
||||||
|
margin: 5px 0;
|
||||||
|
width: 120px;
|
||||||
|
|
||||||
|
&-content {
|
||||||
|
.text-overflow-ellipsis();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-line {
|
||||||
|
height: auto;
|
||||||
|
width: 20px;
|
||||||
|
|
||||||
|
&:not(&-children) {
|
||||||
|
&:before {
|
||||||
|
top: auto;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: @line-width;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-children {
|
||||||
|
&:nth-child(odd),
|
||||||
|
&:not(:first-child, :last-child) {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
import classNames from "classnames";
|
||||||
|
import React from "react";
|
||||||
|
import { OrgChartProps } from "./interface";
|
||||||
|
import OrgChartNode from "./components/OrgChartNode";
|
||||||
|
import ChartWrapper from "./components/ChartWrapper";
|
||||||
|
import styles from "./OrgChart.less";
|
||||||
|
|
||||||
|
const OrgChart = (props: OrgChartProps) => {
|
||||||
|
const { data, className, style, pan, zoom, maxZoom,minZoom,zoomStep, ...otherProps } = props;
|
||||||
|
return !!data ? (
|
||||||
|
<ChartWrapper
|
||||||
|
pan={pan}
|
||||||
|
zoom={zoom}
|
||||||
|
maxZoom={maxZoom}
|
||||||
|
minZoom={minZoom}
|
||||||
|
zoomStep={zoomStep}
|
||||||
|
>
|
||||||
|
<div className={classNames(styles["org-chart-container"], className)} style={style}>
|
||||||
|
<OrgChartNode {...otherProps} data={data}/>
|
||||||
|
</div>
|
||||||
|
</ChartWrapper>
|
||||||
|
) : null;
|
||||||
|
};
|
||||||
|
|
||||||
|
OrgChart.defaultProps = {
|
||||||
|
direction: "vertical",
|
||||||
|
expandAll: true,
|
||||||
|
expandable: false
|
||||||
|
};
|
||||||
|
|
||||||
|
export default OrgChart;
|
@ -0,0 +1,126 @@
|
|||||||
|
import React from "react";
|
||||||
|
import styles from "../OrgChart.less";
|
||||||
|
|
||||||
|
|
||||||
|
const clsPrefix = "cp-react-org-chart-chart-wrapper";
|
||||||
|
|
||||||
|
export default class ChartWrapper extends React.PureComponent {
|
||||||
|
|
||||||
|
static propTypes = {};
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
maxZoom: 2,
|
||||||
|
minZoom: 0.5,
|
||||||
|
zoomStep: 0.03
|
||||||
|
};
|
||||||
|
|
||||||
|
state = {
|
||||||
|
scale: 1,
|
||||||
|
isMove: false,
|
||||||
|
translateX: 0,
|
||||||
|
translateY: 0,
|
||||||
|
originX: 0,
|
||||||
|
originY: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
document.addEventListener("mousemove", this.onMouseMove);
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
document.removeEventListener("mousemove", this.onMouseMove);
|
||||||
|
}
|
||||||
|
|
||||||
|
onZoom = e => {
|
||||||
|
const { zoom, maxZoom, minZoom, zoomStep } = this.props;
|
||||||
|
|
||||||
|
if (!zoom) return;
|
||||||
|
const { deltaY, pageX, pageY } = e;
|
||||||
|
|
||||||
|
const { offsetWidth, offsetHeight } = this.wrapper;
|
||||||
|
let { scale } = this.state;
|
||||||
|
const { translateX, translateY } = this.state;
|
||||||
|
if (deltaY < 0 && scale < maxZoom) {
|
||||||
|
scale += zoomStep;
|
||||||
|
}
|
||||||
|
if (deltaY > 0 && scale > minZoom) {
|
||||||
|
scale -= zoomStep;
|
||||||
|
}
|
||||||
|
this.setState({
|
||||||
|
scale,
|
||||||
|
originX: pageX,
|
||||||
|
originY: pageY
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
toggleMove(isMove) {
|
||||||
|
this.setState({ isMove });
|
||||||
|
}
|
||||||
|
|
||||||
|
onMouseDown = e => {
|
||||||
|
this.toggleMove(true);
|
||||||
|
const { pageX, pageY } = e;
|
||||||
|
const { translateX, translateY } = this.state;
|
||||||
|
this.pageX = pageX;
|
||||||
|
this.pageY = pageY;
|
||||||
|
this.translateX = translateX;
|
||||||
|
this.translateY = translateY;
|
||||||
|
};
|
||||||
|
|
||||||
|
onMouseUp = e => {
|
||||||
|
this.toggleMove(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMouseMove = e => {
|
||||||
|
|
||||||
|
const { isMove, scale } = this.state;
|
||||||
|
if (!isMove) return;
|
||||||
|
const { pageX, pageY } = e;
|
||||||
|
const x = (pageX - this.pageX) / scale + this.translateX;
|
||||||
|
const y = (pageY - this.pageY) / scale + this.translateY;
|
||||||
|
this.setState({
|
||||||
|
translateX: x,
|
||||||
|
translateY: y
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
getProps() {
|
||||||
|
const { zoom, pan } = this.props;
|
||||||
|
const props = {};
|
||||||
|
if (zoom) {
|
||||||
|
props.onWheel = this.onZoom;
|
||||||
|
}
|
||||||
|
if (pan) {
|
||||||
|
props.onMouseUp = this.onMouseUp;
|
||||||
|
props.onMouseDown = this.onMouseDown;
|
||||||
|
props.onMouseMove = this.onMouseMove;
|
||||||
|
}
|
||||||
|
return props;
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { children } = this.props;
|
||||||
|
const { scale, translateX, translateY, isMove, originX, originY } = this.state;
|
||||||
|
const cursor = isMove ? "move" : "default";
|
||||||
|
const props = this.getProps();
|
||||||
|
return (
|
||||||
|
<div className={styles[clsPrefix]} style={{ overflow: "hidden", flex: 1 }}>
|
||||||
|
<div
|
||||||
|
ref={node => {
|
||||||
|
this.wrapper = node;
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
cursor,
|
||||||
|
transform: `scale(${scale}) translate(${translateX}px, ${translateY}px)`,
|
||||||
|
transformOrigin: `${originX}px ${originY}px`
|
||||||
|
}}
|
||||||
|
className={styles["chart-wrapper-main"]}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,180 @@
|
|||||||
|
import classNames from "classnames";
|
||||||
|
import React from "react";
|
||||||
|
import { OrgChartNodeDataType, OrgChartNodeProps, RowProps } from "../interface";
|
||||||
|
import OrgChartNodeRow from "./OrgChartNodeRow";
|
||||||
|
import styles from "../OrgChart.less";
|
||||||
|
|
||||||
|
const OrgChartNode = (props: OrgChartNodeProps) => {
|
||||||
|
const {
|
||||||
|
data,
|
||||||
|
expandAll,
|
||||||
|
expandable,
|
||||||
|
direction,
|
||||||
|
renderNode,
|
||||||
|
onExpand,
|
||||||
|
onClick
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
const [expanded, setExpanded] = React.useState<boolean>(false);
|
||||||
|
|
||||||
|
const handleExpandChange = () => {
|
||||||
|
const newExpanded = !expanded;
|
||||||
|
setExpanded(newExpanded);
|
||||||
|
onExpand?.(newExpanded, data);
|
||||||
|
};
|
||||||
|
|
||||||
|
const getOrgNodeRow = (
|
||||||
|
span: number,
|
||||||
|
data: OrgChartNodeDataType
|
||||||
|
): RowProps => {
|
||||||
|
const contentNode: React.ReactNode = (
|
||||||
|
<div className={styles["org-chart-table-node-content"]} title={data.label}>
|
||||||
|
{data.label}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
span,
|
||||||
|
content: (
|
||||||
|
<td>
|
||||||
|
<div
|
||||||
|
className={classNames(styles["org-chart-table-node"], data.className)}
|
||||||
|
style={data.style}
|
||||||
|
onClick={() => onClick?.(data)}>
|
||||||
|
{!!renderNode ? renderNode(data, contentNode) : contentNode}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
const getLineRow = (span: number): RowProps => {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
span,
|
||||||
|
content: (
|
||||||
|
<td className={styles["org-chart-table-line"]}>
|
||||||
|
{expandable ? (
|
||||||
|
<div
|
||||||
|
className={classNames({
|
||||||
|
[styles["expand-icon"]]: expandable,
|
||||||
|
[styles["expand-icon-expanded"]]: expandable && expanded,
|
||||||
|
[styles["expand-icon-collapsed"]]: expandable && !expanded
|
||||||
|
})}
|
||||||
|
onClick={() => handleExpandChange()}></div>
|
||||||
|
) : null}
|
||||||
|
</td>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
const getChildrenLineRow = (span: number, itemSpan: number): RowProps => {
|
||||||
|
const cells: RowProps = [];
|
||||||
|
for (let index = 0; index < span; index = index + itemSpan) {
|
||||||
|
cells.push({
|
||||||
|
span: 1,
|
||||||
|
content: (
|
||||||
|
<td
|
||||||
|
key={index}
|
||||||
|
className={classNames(
|
||||||
|
styles["org-chart-table-line"],
|
||||||
|
styles["org-chart-table-line-children"],
|
||||||
|
{
|
||||||
|
[styles["hidden"]]: !expanded
|
||||||
|
}
|
||||||
|
)}>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return cells;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getChildrenNode = (
|
||||||
|
datas: OrgChartNodeDataType[] = [],
|
||||||
|
itemSpan: number
|
||||||
|
): RowProps => {
|
||||||
|
const cells: RowProps = [];
|
||||||
|
datas.forEach((data, index) => {
|
||||||
|
cells[itemSpan * index] = {
|
||||||
|
span: itemSpan,
|
||||||
|
content: (
|
||||||
|
<td
|
||||||
|
key={data.key}
|
||||||
|
className={classNames(styles["org-chart-table-node-children"], {
|
||||||
|
[styles["hidden"]]: !expanded
|
||||||
|
})}>
|
||||||
|
<OrgChartNode {...props} data={data}/>
|
||||||
|
</td>
|
||||||
|
)
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return cells;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getRows = (): RowProps[] => {
|
||||||
|
if (data) {
|
||||||
|
const rows: RowProps[] = [];
|
||||||
|
const childrenLength = data?.children?.length || 0;
|
||||||
|
const span = childrenLength * 2;
|
||||||
|
|
||||||
|
rows.push(getOrgNodeRow(span, data));
|
||||||
|
// 判断是否有子节点
|
||||||
|
if (data.children?.length ?? 0 > 0) {
|
||||||
|
rows.push(getLineRow(span));
|
||||||
|
rows.push(getChildrenLineRow(span, 1));
|
||||||
|
rows.push(getChildrenNode(data.children, 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (direction === "horizontal") {
|
||||||
|
const newRow: RowProps[] = [];
|
||||||
|
rows.forEach((row, rowIndex) => {
|
||||||
|
row.forEach((cell, cellIndex) => {
|
||||||
|
newRow[cellIndex] = newRow[cellIndex] || [];
|
||||||
|
newRow[cellIndex][rowIndex] = cell;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return newRow;
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
};
|
||||||
|
|
||||||
|
const rows = React.useMemo(() => {
|
||||||
|
return getRows();
|
||||||
|
}, [data, expanded, direction]);
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (expandable === true) {
|
||||||
|
setExpanded(!!expandAll);
|
||||||
|
} else {
|
||||||
|
setExpanded(true);
|
||||||
|
}
|
||||||
|
}, [expandAll, expandable]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<table
|
||||||
|
className={classNames(styles["org-chart-table"], {
|
||||||
|
[styles["org-chart-table-horizontal"]]: direction === "horizontal",
|
||||||
|
[styles["org-chart-table-vertical"]]: direction === "vertical"
|
||||||
|
})}>
|
||||||
|
<tbody>
|
||||||
|
{rows.map((row, index) => (
|
||||||
|
<OrgChartNodeRow
|
||||||
|
key={index}
|
||||||
|
index={index}
|
||||||
|
row={row}
|
||||||
|
direction={direction}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default OrgChartNode;
|
@ -0,0 +1,27 @@
|
|||||||
|
import { OrgChartNodeProps, RowProps } from '../interface';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
export interface OrgChartNodeRowProps
|
||||||
|
extends Pick<OrgChartNodeProps, 'direction'> {
|
||||||
|
className?: string;
|
||||||
|
index: number;
|
||||||
|
row: RowProps;
|
||||||
|
}
|
||||||
|
|
||||||
|
const OrgChartNodeRow = (props: OrgChartNodeRowProps) => {
|
||||||
|
const { className, index, row, direction } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<tr key={index} className={className}>
|
||||||
|
{row.map((cell, cellIndex) => {
|
||||||
|
return React.cloneElement(cell.content, {
|
||||||
|
key: cellIndex,
|
||||||
|
...(direction === 'horizontal' ? { rowSpan: cell.span } : {}),
|
||||||
|
...(direction === 'vertical' ? { colSpan: cell.span } : {}),
|
||||||
|
});
|
||||||
|
})}
|
||||||
|
</tr>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default OrgChartNodeRow;
|
@ -0,0 +1,5 @@
|
|||||||
|
// import { OrgChartNodeDataType, OrgChartProps } from './interface';
|
||||||
|
import OrgChart from './OrgChart';
|
||||||
|
|
||||||
|
// export { OrgChartNodeDataType, OrgChartProps };
|
||||||
|
export default OrgChart;
|
@ -0,0 +1,43 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
export interface CellProps {
|
||||||
|
span: number;
|
||||||
|
content: React.ReactElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type RowProps = CellProps[];
|
||||||
|
|
||||||
|
export interface OrgChartNodeDataType {
|
||||||
|
key: string | number;
|
||||||
|
label: string;
|
||||||
|
operatingIncome?: string;
|
||||||
|
operatingIncomePercent?: string;
|
||||||
|
operatingProfit?: string;
|
||||||
|
operatingProfitPercent?: string;
|
||||||
|
children?: OrgChartNodeDataType[];
|
||||||
|
className?: string;
|
||||||
|
style?: React.CSSProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface OrgChartNodeProps {
|
||||||
|
data: OrgChartNodeDataType;
|
||||||
|
expandAll?: boolean;
|
||||||
|
expandable?: boolean;
|
||||||
|
direction?: "horizontal" | "vertical";
|
||||||
|
renderNode?: (
|
||||||
|
node: OrgChartNodeDataType,
|
||||||
|
originNode: React.ReactNode
|
||||||
|
) => React.ReactNode;
|
||||||
|
onExpand?: (expanded: boolean, node: OrgChartNodeDataType) => void;
|
||||||
|
onClick?: (node: OrgChartNodeDataType) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface OrgChartProps extends Partial<OrgChartNodeProps> {
|
||||||
|
className?: string;
|
||||||
|
style?: React.CSSProperties;
|
||||||
|
pan?: boolean;
|
||||||
|
zoom?: boolean;
|
||||||
|
maxZoom?: number;
|
||||||
|
minZoom?: number;
|
||||||
|
zoomStep?: number;
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* Author: 黎永顺
|
||||||
|
* name: 框架组件
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/6
|
||||||
|
*/
|
||||||
|
import React, { FunctionComponent } from "react";
|
||||||
|
import styles from "./index.less";
|
||||||
|
|
||||||
|
interface OwnProps {
|
||||||
|
children: any;
|
||||||
|
title: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
type Props = OwnProps;
|
||||||
|
|
||||||
|
const frameBox: FunctionComponent<Props> = (props) => {
|
||||||
|
const { children, title } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={styles.frameBoxWrapper}>
|
||||||
|
<div className={styles.header}><span><span>{title}</span></span></div>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default frameBox;
|
@ -0,0 +1,28 @@
|
|||||||
|
.frameBoxWrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.header {
|
||||||
|
height: 54px;
|
||||||
|
line-height: 54px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 16px;
|
||||||
|
|
||||||
|
& > span {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #333333;
|
||||||
|
letter-spacing: 0;
|
||||||
|
font-weight: 700;
|
||||||
|
width: 100%;
|
||||||
|
height: inherit;
|
||||||
|
border-bottom: 1px solid #e5e5e5;
|
||||||
|
|
||||||
|
span {
|
||||||
|
border-left: 5px solid #0055F3;
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,193 @@
|
|||||||
|
.frameCard1Wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.top {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
& > div:first-child {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 20px;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #333333;
|
||||||
|
letter-spacing: 0;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& > div:last-child {
|
||||||
|
& > span:first-child {
|
||||||
|
font-size: 24px;
|
||||||
|
color: #14224F;
|
||||||
|
letter-spacing: 0;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > span:last-child {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #D4D4D4;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 83px;
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global {
|
||||||
|
.ant-progress {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
border-top: 0.5px solid #e5e5e5;
|
||||||
|
padding-top: 10px;
|
||||||
|
|
||||||
|
& > span {
|
||||||
|
img {
|
||||||
|
width: 8px;
|
||||||
|
margin-left: 8px;
|
||||||
|
margin-right: 4px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > span:first-child {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #D4D4D4;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > span:last-child {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #333333;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.frameCard2Wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.top {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-bottom: 16px;
|
||||||
|
background: url("../../../../assets/images/top_bottom.png") no-repeat;
|
||||||
|
background-size: 100% auto;
|
||||||
|
background-position-y: bottom;
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
font-size: 18px;
|
||||||
|
color: #FFFFFF;
|
||||||
|
letter-spacing: 0;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
& > span:first-child {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #FFFFFF;
|
||||||
|
letter-spacing: 0;
|
||||||
|
font-weight: 400;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > div:last-child {
|
||||||
|
& > span:first-child {
|
||||||
|
font-size: 24px;
|
||||||
|
color: #FFF;
|
||||||
|
letter-spacing: 0;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > span:last-child {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #FFF;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
background: rgba(255, 255, 255, 0.3);
|
||||||
|
border-radius: 2px;
|
||||||
|
color: #FFF;
|
||||||
|
padding: 0 8px;
|
||||||
|
height: 33px;
|
||||||
|
|
||||||
|
& > span {
|
||||||
|
img {
|
||||||
|
width: 8px;
|
||||||
|
margin-left: 8px;
|
||||||
|
margin-right: 4px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > span:first-child {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #FFF;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > span:last-child {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #FFF;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,136 @@
|
|||||||
|
const PersonnelFlowBar = (echarts: any) => {
|
||||||
|
// 实例化对象
|
||||||
|
const myChart = echarts.init(document.getElementById("personnelFlowBar"));
|
||||||
|
// 配置项
|
||||||
|
const option = {
|
||||||
|
tooltip: {
|
||||||
|
// 坐标轴指示器,坐标轴触发有效
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
// 默认为直线,可选为:'line' | 'shadow'
|
||||||
|
type: "shadow"
|
||||||
|
},
|
||||||
|
formatter: function (params: any) {
|
||||||
|
let str = params[0].name + "<br>";
|
||||||
|
for (let item of params) {
|
||||||
|
str += item.seriesName + " : " + item.value + "%<br>";
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
icon: "circle",
|
||||||
|
top: "-1%",
|
||||||
|
right: "2%",
|
||||||
|
itemGap: 20,
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 12,//字体大小
|
||||||
|
color: "#B8B8B8"//字体颜色
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
top: "15%",
|
||||||
|
left: "2%",
|
||||||
|
right: "2%",
|
||||||
|
bottom: "3%",
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
type: "category",
|
||||||
|
data: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||||
|
axisTick: {
|
||||||
|
alignWithLabel: true,
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
// 修改坐标值样式
|
||||||
|
axisLabel: {
|
||||||
|
color: "#B8B8B8",
|
||||||
|
fontSize: 16,
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
yAxis: [
|
||||||
|
{
|
||||||
|
type: "value",
|
||||||
|
name: "%",
|
||||||
|
// 修改坐标值样式
|
||||||
|
axisLabel: {
|
||||||
|
color: "#787E95",
|
||||||
|
fontSize: 14
|
||||||
|
// formatter: '{value} 人'
|
||||||
|
},
|
||||||
|
nameTextStyle: {
|
||||||
|
color: "#787E95",
|
||||||
|
fontSize: 16
|
||||||
|
},
|
||||||
|
// 修改坐标轴线样式
|
||||||
|
axisLine: {
|
||||||
|
show: true,
|
||||||
|
lineStyle: {
|
||||||
|
color: "transparent"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false // 不显示坐标轴刻度线
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
lineStyle: {
|
||||||
|
type: "dashed",
|
||||||
|
color: "rgba(93,126,158,1)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "今年",
|
||||||
|
type: "bar",
|
||||||
|
showBackground: false,
|
||||||
|
barWidth: "15%",
|
||||||
|
barGap: "80%",
|
||||||
|
data: initData([12, 10, 23, 15, 3, 7, 11, 20, 17, 15, 8, 12]),
|
||||||
|
// bar 样式修改
|
||||||
|
itemStyle: {
|
||||||
|
color: "#3EA1FF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "去年",
|
||||||
|
type: "bar",
|
||||||
|
showBackground: false,
|
||||||
|
barWidth: "15%",
|
||||||
|
data: initData([7, 12, 8, 12, 12, 5, 8, 15, 18, 12, 9, 7]),
|
||||||
|
// bar 样式修改
|
||||||
|
itemStyle: {
|
||||||
|
color: "#0ED8F9"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
// 配置项给实例对象
|
||||||
|
myChart.setOption(option);
|
||||||
|
return myChart;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default PersonnelFlowBar;
|
||||||
|
|
||||||
|
|
||||||
|
const initData = (arr: Array<number>) => {
|
||||||
|
const total = _.reduce(arr, (pre: number, cur: number) => pre + cur, 0);
|
||||||
|
const serie = [];
|
||||||
|
for (let i = 0; i < arr.length; i++) {
|
||||||
|
const num = arr[i];
|
||||||
|
const numcount = Percentage(num, total);
|
||||||
|
serie.push(numcount);
|
||||||
|
}
|
||||||
|
return serie;
|
||||||
|
};
|
||||||
|
|
||||||
|
const Percentage = (num: number, total: number) => {
|
||||||
|
return (Math.round(num / total * 100));// 小数点后两位百分比
|
||||||
|
};
|
@ -0,0 +1,161 @@
|
|||||||
|
const TrendsInSeparationsCharts = (echarts: any) => {
|
||||||
|
// 实例化对象
|
||||||
|
const myChart = echarts.init(document.getElementById("trendsInSeparationsCharts"));
|
||||||
|
// 配置项
|
||||||
|
const option = {
|
||||||
|
tooltip: {
|
||||||
|
// 坐标轴指示器,坐标轴触发有效
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
// 默认为直线,可选为:'line' | 'shadow'
|
||||||
|
type: "shadow"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
icon: "circle",
|
||||||
|
top: "5%",
|
||||||
|
right: "center",
|
||||||
|
itemGap: 20,
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 12,//字体大小
|
||||||
|
color: "#787E95"//字体颜色
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
top: "20%",
|
||||||
|
left: "2%",
|
||||||
|
right: "2%",
|
||||||
|
bottom: "3%",
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
type: "category",
|
||||||
|
data: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||||||
|
axisTick: {
|
||||||
|
alignWithLabel: true,
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
// 修改坐标值样式
|
||||||
|
axisLabel: {
|
||||||
|
color: "#B8B8B8",
|
||||||
|
fontSize: 16,
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
yAxis: [
|
||||||
|
{
|
||||||
|
type: "value",
|
||||||
|
name: "人",
|
||||||
|
// 修改坐标值样式
|
||||||
|
axisLabel: {
|
||||||
|
color: "#787E95",
|
||||||
|
fontSize: 14
|
||||||
|
// formatter: '{value} 人'
|
||||||
|
},
|
||||||
|
nameTextStyle: {
|
||||||
|
color: "#787E95",
|
||||||
|
fontSize: 16
|
||||||
|
},
|
||||||
|
// 修改坐标轴线样式
|
||||||
|
axisLine: {
|
||||||
|
show: true,
|
||||||
|
lineStyle: {
|
||||||
|
color: "transparent"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false // 不显示坐标轴刻度线
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
lineStyle: {
|
||||||
|
type: "dashed",
|
||||||
|
color: "rgba(93,126,158,1)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "value",
|
||||||
|
// 修改坐标值样式
|
||||||
|
axisLabel: {
|
||||||
|
color: "#787E95",
|
||||||
|
fontSize: 14,
|
||||||
|
formatter: '{value} %'
|
||||||
|
},
|
||||||
|
nameTextStyle: {
|
||||||
|
color: "#787E95",
|
||||||
|
fontSize: 16
|
||||||
|
},
|
||||||
|
// 修改坐标轴线样式
|
||||||
|
axisLine: {
|
||||||
|
show: true,
|
||||||
|
lineStyle: {
|
||||||
|
color: "transparent"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false // 不显示坐标轴刻度线
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
show: false,
|
||||||
|
lineStyle: {
|
||||||
|
type: "dashed",
|
||||||
|
color: "rgba(93,126,158,1)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "主动离职",
|
||||||
|
type: "bar",
|
||||||
|
stack:"Search Engine",
|
||||||
|
showBackground: false,
|
||||||
|
barWidth: "10%",
|
||||||
|
barGap: "100%",
|
||||||
|
data: [80, 30, 10, 38, 45, 70, 70, 70, 40, 50, 30, 10],
|
||||||
|
// bar 样式修改
|
||||||
|
itemStyle: {
|
||||||
|
barBorderRadius: 2,
|
||||||
|
color: "#00C48B"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "辞退",
|
||||||
|
type: "bar",
|
||||||
|
stack:"Search Engine",
|
||||||
|
showBackground: false,
|
||||||
|
barWidth: "10%",
|
||||||
|
data: [20, 10, 5, 10, 10, 1, 1, 12, 10, 15, 5, 2],
|
||||||
|
// bar 样式修改
|
||||||
|
itemStyle: {
|
||||||
|
barBorderRadius: 2,
|
||||||
|
color: "#FFA400"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "离职率",
|
||||||
|
type: "line",
|
||||||
|
yAxisIndex: 1,
|
||||||
|
data: [10, 4, 2, 5, 5, 7, 7, 10, 4, 6, 4, 2],
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: "#66EFE8",
|
||||||
|
lineStyle: {
|
||||||
|
color: "#66EFE8"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
// 配置项给实例对象
|
||||||
|
myChart.setOption(option);
|
||||||
|
return myChart;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default TrendsInSeparationsCharts;
|
@ -0,0 +1,201 @@
|
|||||||
|
@gap: 16px;
|
||||||
|
@cardWidth: calc(~"20vw" - 4 * @gap / 5);
|
||||||
|
.peopleFlowWrapper {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: #e5e5e5;
|
||||||
|
overflow: auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.headerCardWrapper {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: @gap;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
& > li:not(:last-child) {
|
||||||
|
margin-right: @gap;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
& > li:not(:first-child) {
|
||||||
|
background-size: 100% 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > li:first-child {
|
||||||
|
background: #FFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > li {
|
||||||
|
width: @cardWidth;
|
||||||
|
min-height: 220px;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.contentBox {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.contentBoxLeft {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.contenBoxTop {
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.chartsBox {
|
||||||
|
flex: 4 1;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
& > ul {
|
||||||
|
width: @cardWidth;
|
||||||
|
margin: 0 @gap 0 0;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
& > li:first-child {
|
||||||
|
margin-bottom: @gap;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > li {
|
||||||
|
background: #FFF;
|
||||||
|
min-height: 220px;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
flex: 3 1;
|
||||||
|
background: #FFF;
|
||||||
|
border-radius: 5px;
|
||||||
|
min-height: 220px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
& > ul {
|
||||||
|
margin: 20px 16px;
|
||||||
|
padding: 0;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
& > li:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > li.active {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #0055F3;
|
||||||
|
letter-spacing: 0;
|
||||||
|
font-weight: 700;
|
||||||
|
border-bottom: 1px solid #0055F3;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > li:not(:last-child) {
|
||||||
|
margin-right: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #999999;
|
||||||
|
letter-spacing: 0;
|
||||||
|
font-weight: 400;
|
||||||
|
padding: 6px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
min-height: 377px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.contenBoxBottom {
|
||||||
|
flex: 1;
|
||||||
|
margin-top: @gap;
|
||||||
|
background: #FFF;
|
||||||
|
border-radius: 5px;
|
||||||
|
|
||||||
|
.trendsInSeparations {
|
||||||
|
min-height: 220px;
|
||||||
|
max-height: 220px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.rankingBox {
|
||||||
|
width: @cardWidth;
|
||||||
|
margin-left: @gap;
|
||||||
|
background: #FFF;
|
||||||
|
border-radius: 5px;
|
||||||
|
|
||||||
|
.trainingRanking {
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
|
.rankDescBox {
|
||||||
|
display: flex;
|
||||||
|
font-size: 4px;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 30px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rankNum {
|
||||||
|
margin-right: 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
.rankNumber {
|
||||||
|
width: 30px;
|
||||||
|
margin-right: 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rankDescPersBox {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
& > span:last-child {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-left: 8px;
|
||||||
|
|
||||||
|
& > span:first-child {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #333333;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > span:last-child {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #B8B8B8;
|
||||||
|
font-weight: 400;
|
||||||
|
min-width: 130px;
|
||||||
|
max-width: 130px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.rankRow {
|
||||||
|
background: #FEFAED;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global {
|
||||||
|
.ant-list-item {
|
||||||
|
padding: 16px 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,119 @@
|
|||||||
|
const PersonnelCategoryBar = (echarts: any) => {
|
||||||
|
// 实例化对象
|
||||||
|
const myChart = echarts.init(document.getElementById("changeStatistics"));
|
||||||
|
// 配置项
|
||||||
|
const option = {
|
||||||
|
tooltip: {
|
||||||
|
// 坐标轴指示器,坐标轴触发有效
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
// 默认为直线,可选为:'line' | 'shadow'
|
||||||
|
type: "shadow"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: "0%",
|
||||||
|
top: 10,
|
||||||
|
right: "0%",
|
||||||
|
bottom: "4%",
|
||||||
|
// true: 数值离DOM盒子的距离 false: 坐标轴离DOM盒子的距离
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
type: "category",
|
||||||
|
data: ["公司本部", "公司1", "公司2", "公司3", "公司4", "公司5", "公司6", "公司7"],
|
||||||
|
axisTick: {
|
||||||
|
alignWithLabel: true
|
||||||
|
},
|
||||||
|
// 修改坐标值样式
|
||||||
|
axisLabel: {
|
||||||
|
color: "rgba(255, 255, 255, 1)",
|
||||||
|
fontSize: 10,
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
yAxis: [
|
||||||
|
{
|
||||||
|
type: "value",
|
||||||
|
// 修改坐标值样式
|
||||||
|
axisLabel: {
|
||||||
|
color: "rgba(255, 255, 255, 1)",
|
||||||
|
fontSize: 12
|
||||||
|
},
|
||||||
|
// 修改坐标轴线样式
|
||||||
|
axisLine: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false // 不显示坐标轴刻度线
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
lineStyle: {
|
||||||
|
type: "dashed",
|
||||||
|
color: "rgba(93,126,158,1)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "入职",
|
||||||
|
type: "bar",
|
||||||
|
showBackground: false,
|
||||||
|
barWidth: "10%",
|
||||||
|
data: [250, 250, 320, 410, 280, 320, 405, 405],
|
||||||
|
// bar 样式修改
|
||||||
|
itemStyle: {
|
||||||
|
barBorderRadius: 10,
|
||||||
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
{ offset: 0, color: "#3EA1FF" },
|
||||||
|
{ offset: 0.5, color: "#72CFFF" },
|
||||||
|
{ offset: 1, color: "#72CFFF" }
|
||||||
|
])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "离职",
|
||||||
|
type: "bar",
|
||||||
|
showBackground: false,
|
||||||
|
barWidth: "10%",
|
||||||
|
data: [370, 370, 260, 110, 390, 280, 110, 110],
|
||||||
|
// bar 样式修改
|
||||||
|
itemStyle: {
|
||||||
|
barBorderRadius: 10,
|
||||||
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
{ offset: 0, color: "#00D5FF" },
|
||||||
|
{ offset: 0.5, color: "#B2FDB2" },
|
||||||
|
{ offset: 1, color: "#B2FDB2" }
|
||||||
|
])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "调职",
|
||||||
|
type: "bar",
|
||||||
|
showBackground: false,
|
||||||
|
barWidth: "10%",
|
||||||
|
data: [310, 310, 80, 280, 310, 70, 280, 280],
|
||||||
|
// bar 样式修改
|
||||||
|
itemStyle: {
|
||||||
|
barBorderRadius: 10,
|
||||||
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
{ offset: 0, color: "#1455FF" },
|
||||||
|
{ offset: 0.5, color: "#5F9CFF" },
|
||||||
|
{ offset: 1, color: "#5F9CFF" }
|
||||||
|
])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
// 配置项给实例对象
|
||||||
|
myChart.setOption(option);
|
||||||
|
return myChart;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default PersonnelCategoryBar;
|
@ -0,0 +1,103 @@
|
|||||||
|
import { getPie3D } from "@/utils/chart";
|
||||||
|
|
||||||
|
const color = ["#FE772D", "#FEDB4B", "#2A71FF", "#00EDFE"];
|
||||||
|
|
||||||
|
const DegreeStructurePie = (echarts: any) => {
|
||||||
|
// 实例化对象
|
||||||
|
const myChart = echarts.init(document.getElementById("degreeStructure"));
|
||||||
|
// 配置项
|
||||||
|
const option = {
|
||||||
|
...getPie3D(setLabel([
|
||||||
|
{
|
||||||
|
name: "研究生(博士)",
|
||||||
|
value: 176
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "研究生(硕士)",
|
||||||
|
value: 288
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "本科",
|
||||||
|
value: 588
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "大专及以下",
|
||||||
|
value: 78
|
||||||
|
}
|
||||||
|
], color), 0.6, 240, 26, 18, 1, true)
|
||||||
|
};
|
||||||
|
// 配置项给实例对象
|
||||||
|
myChart.setOption({
|
||||||
|
...option,
|
||||||
|
legend: {
|
||||||
|
orient: "vertical",
|
||||||
|
icon: "circle",
|
||||||
|
top: "25%",
|
||||||
|
left: "10%",
|
||||||
|
itemGap: 28,
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 12,//字体大小
|
||||||
|
color: "#ffffff"//字体颜色
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return myChart;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DegreeStructurePie;
|
||||||
|
|
||||||
|
export const setLabel = (optionData: any, color: any) => {
|
||||||
|
return optionData.map((item: any, index: number) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
itemStyle: {
|
||||||
|
color: color[index]
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
normal: {
|
||||||
|
show: false,
|
||||||
|
color: color[index],
|
||||||
|
position: "right",
|
||||||
|
// distance:-10,
|
||||||
|
offset: [0, 3],
|
||||||
|
formatter: [
|
||||||
|
"{d|{d}%}",
|
||||||
|
"————",
|
||||||
|
// '{c|{c}}{b|台}',
|
||||||
|
"{b|{b}}"
|
||||||
|
].join("\n"), // 用\n来换行
|
||||||
|
rich: {
|
||||||
|
b: {
|
||||||
|
// color: '#fff',
|
||||||
|
lineHeight: 25,
|
||||||
|
align: "left",
|
||||||
|
color: color[index]
|
||||||
|
},
|
||||||
|
c: {
|
||||||
|
fontSize: 22,
|
||||||
|
textShadowColor: "#1c90a6",
|
||||||
|
textShadowOffsetX: 0,
|
||||||
|
textShadowOffsetY: 2,
|
||||||
|
textShadowBlur: 5,
|
||||||
|
color: color[index]
|
||||||
|
},
|
||||||
|
d: {
|
||||||
|
color: color[index],
|
||||||
|
align: "left"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
labelLine: {
|
||||||
|
normal: {
|
||||||
|
show: false,
|
||||||
|
length2: 30,
|
||||||
|
lineStyle: {
|
||||||
|
width: 1,
|
||||||
|
color: color[index]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
@ -0,0 +1,47 @@
|
|||||||
|
import { getPie3D } from "@/utils/chart";
|
||||||
|
import { setLabel } from "./degreeStructurePie";
|
||||||
|
|
||||||
|
const color = ["#BD42EF", "#6D45F3", "#3358F3", "#6ECDE5"];
|
||||||
|
const GradAnalysisPie = (echarts: any) => {
|
||||||
|
// 实例化对象
|
||||||
|
const myChart = echarts.init(document.getElementById("gradAnalysis"));
|
||||||
|
// 配置项
|
||||||
|
const option = {
|
||||||
|
...getPie3D(setLabel([
|
||||||
|
{
|
||||||
|
name: "正高级",
|
||||||
|
value: 500
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "副高级",
|
||||||
|
value: 1120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "中级",
|
||||||
|
value: 4567
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "初级",
|
||||||
|
value: 5278
|
||||||
|
}
|
||||||
|
], color), 0.6, 240, 26, 18, 1, false)
|
||||||
|
};
|
||||||
|
// 配置项给实例对象
|
||||||
|
myChart.setOption({
|
||||||
|
...option,
|
||||||
|
legend: {
|
||||||
|
orient: "vertical",
|
||||||
|
icon: "circle",
|
||||||
|
top: "25%",
|
||||||
|
left: "10%",
|
||||||
|
itemGap: 28,
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 12,//字体大小
|
||||||
|
color: "#ffffff"//字体颜色
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return myChart;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default GradAnalysisPie;
|
@ -0,0 +1,96 @@
|
|||||||
|
const PersonnelCategoryBar = (echarts: any) => {
|
||||||
|
// 实例化对象
|
||||||
|
const myChart = echarts.init(document.getElementById("personnelCategory"));
|
||||||
|
// 配置项
|
||||||
|
const option = {
|
||||||
|
tooltip: {
|
||||||
|
// 坐标轴指示器,坐标轴触发有效
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
// 默认为直线,可选为:'line' | 'shadow'
|
||||||
|
type: "shadow"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: "0%",
|
||||||
|
top: 10,
|
||||||
|
right: "0%",
|
||||||
|
bottom: "4%",
|
||||||
|
// true: 数值离DOM盒子的距离 false: 坐标轴离DOM盒子的距离
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
type: "category",
|
||||||
|
data: ["领导班子", "海外中国籍", "正式在岗", "海外外籍", "退休返聘", "其他临时", "劳务派遣", "内退"],
|
||||||
|
axisTick: {
|
||||||
|
alignWithLabel: true
|
||||||
|
},
|
||||||
|
// 修改坐标值样式
|
||||||
|
axisLabel: {
|
||||||
|
color: "rgba(255, 255, 255, 1)",
|
||||||
|
fontSize: 10,
|
||||||
|
rotate: 60,
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
yAxis: [
|
||||||
|
{
|
||||||
|
type: "value",
|
||||||
|
// 修改坐标值样式
|
||||||
|
axisLabel: {
|
||||||
|
color: "rgba(255, 255, 255, 1)",
|
||||||
|
fontSize: 12
|
||||||
|
},
|
||||||
|
// 修改坐标轴线样式
|
||||||
|
axisLine: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
axisTick: {
|
||||||
|
show: false // 不显示坐标轴刻度线
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
lineStyle: {
|
||||||
|
type: "dashed",
|
||||||
|
color: "rgba(93,126,158,1)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "直接访问",
|
||||||
|
type: "bar",
|
||||||
|
showBackground: true,
|
||||||
|
barWidth: "30%",
|
||||||
|
data: [10, 52, 200, 334, 390, 1030, 220, 210],
|
||||||
|
// bar 样式修改
|
||||||
|
itemStyle: {
|
||||||
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
{ offset: 0, color: "#3EA1FF" },
|
||||||
|
{ offset: 0.5, color: "#72CFFF" },
|
||||||
|
{ offset: 1, color: "#72CFFF" }
|
||||||
|
]),
|
||||||
|
emphasis: {
|
||||||
|
itemStyle: {
|
||||||
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
|
{ offset: 0, color: "#AFD8FF" },
|
||||||
|
{ offset: 0.7, color: "#AFD8FF" },
|
||||||
|
{ offset: 1, color: "#AFD8FF" }
|
||||||
|
])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
// 配置项给实例对象
|
||||||
|
myChart.setOption(option);
|
||||||
|
return myChart;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default PersonnelCategoryBar;
|
@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Author: 黎永顺
|
||||||
|
* name: 框架组件
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/4
|
||||||
|
*/
|
||||||
|
import React, { FC, useState } from "react";
|
||||||
|
import cs from "classnames";
|
||||||
|
import styles from "./index.less";
|
||||||
|
|
||||||
|
interface OwnProps {
|
||||||
|
position: string;
|
||||||
|
tabList: Array<any>;
|
||||||
|
children: any;
|
||||||
|
titleImg: any;
|
||||||
|
type?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
type Props = OwnProps;
|
||||||
|
const FrameComp: FC<Props> = (props) => {
|
||||||
|
const { position, children, tabList, titleImg } = props;
|
||||||
|
const [active, setActive] = useState<number>(0);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={styles.frameWrapper}>
|
||||||
|
<div className={styles.headerTop}>
|
||||||
|
<div className={cs(styles.headerLeft, { [styles["halfHeaderLeft"]]: position === "right" })}>
|
||||||
|
<img src={titleImg} alt=""/>
|
||||||
|
{
|
||||||
|
position === "right" &&
|
||||||
|
<ul className={styles.tabWrapper}>
|
||||||
|
{
|
||||||
|
_.map(tabList, (item, index) => {
|
||||||
|
const classes = cs({
|
||||||
|
[styles["liActive"]]: index === active
|
||||||
|
});
|
||||||
|
return <li key={index} onClick={() => setActive(index)} className={classes}>{item}</li>;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<span className={styles.moreWrapper}>More <img src={require("../../../../assets/images/more.png")}
|
||||||
|
alt=""/></span>
|
||||||
|
</div>
|
||||||
|
{
|
||||||
|
position === "bottom" &&
|
||||||
|
<ul className={styles.tabWrapper}>
|
||||||
|
{
|
||||||
|
_.map(tabList, (item, index) => {
|
||||||
|
const classes = cs({
|
||||||
|
[styles["liActive"]]: index === active
|
||||||
|
});
|
||||||
|
return <li key={index} onClick={() => setActive(index)} className={classes}>{item}</li>;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
}
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default FrameComp;
|
@ -0,0 +1,125 @@
|
|||||||
|
.topPageWrapper {
|
||||||
|
height: 1.25rem;
|
||||||
|
position: relative;
|
||||||
|
background: url("../../../../assets/images/head_bg1.png") no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
line-height: 0.875rem;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.updateTime {
|
||||||
|
color: #fff;
|
||||||
|
line-height: 0;
|
||||||
|
margin-top: 0.0625rem;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 0.225rem;
|
||||||
|
margin-right: .2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 4.475rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.logoWrapper, .showTime {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.showTime {
|
||||||
|
right: 2.375rem;
|
||||||
|
top: 0.4rem;
|
||||||
|
text-align: right;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
.dateDay {
|
||||||
|
padding: 0 .35rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.logoWrapper {
|
||||||
|
top: 0.1rem;
|
||||||
|
left: 2.375rem;
|
||||||
|
line-height: 0.875rem;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 1.675rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mapWrapper {
|
||||||
|
width: 10.625rem;
|
||||||
|
height: 8.125rem;
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.frameWrapper {
|
||||||
|
background: url("../../../../assets/images/frame_bg.png") no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
margin-bottom: 0.2rem;
|
||||||
|
|
||||||
|
.headerTop {
|
||||||
|
height: 0.475rem;
|
||||||
|
position: relative;
|
||||||
|
background: url("../../../../assets/images/frame_title_bg.png") no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
|
||||||
|
.halfHeaderLeft {
|
||||||
|
left: 1.45rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headerLeft {
|
||||||
|
position: absolute;
|
||||||
|
left: 0.7375rem;
|
||||||
|
top: 0.0625rem;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
img {
|
||||||
|
height: 0.3rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.moreWrapper {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 0.175rem;
|
||||||
|
position: absolute;
|
||||||
|
right: 0.3375rem;
|
||||||
|
top: 0.1rem;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 0.2375rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabWrapper {
|
||||||
|
margin-left: 0.775rem;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabWrapper {
|
||||||
|
display: flex;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0 0.3375rem;
|
||||||
|
|
||||||
|
li {
|
||||||
|
padding: 0.1rem 0.175rem;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #ACACAC;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
li.liActive {
|
||||||
|
background: url("../../../../assets/images/tabSelected.png") no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-position-y: .125rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Author: 黎永顺
|
||||||
|
* name: 地图组件
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/4
|
||||||
|
*/
|
||||||
|
import React, { FC } from "react";
|
||||||
|
import Chart from "@/utils/chart";
|
||||||
|
import { mapOptions } from "./options";
|
||||||
|
// import { mapProvinceOptions } from "./provinceOptions";
|
||||||
|
import styles from "./index.less";
|
||||||
|
|
||||||
|
interface OwnProps {
|
||||||
|
}
|
||||||
|
|
||||||
|
type Props = OwnProps;
|
||||||
|
const Map: FC<Props> = (props) => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={styles.mapWrapper}>
|
||||||
|
<Chart renderer={"canvas"} option={mapOptions({})}/>
|
||||||
|
{/*<Chart renderer={"canvas"} option={mapProvinceOptions({})}/>*/}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Map;
|
@ -0,0 +1,243 @@
|
|||||||
|
import "echarts/map/js/china";
|
||||||
|
// 地图数据
|
||||||
|
const mapData = {
|
||||||
|
citys: [
|
||||||
|
{
|
||||||
|
name: "浙江",
|
||||||
|
value: [120.15, 29.28, -2],
|
||||||
|
symbolSize: 2,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: "#FFF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "四川",
|
||||||
|
value: [103.36, 30.65, -5],
|
||||||
|
symbolSize: 2,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: "#FFF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "内蒙古",
|
||||||
|
value: [112.17, 42.81, -23],
|
||||||
|
symbolSize: 2,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: "#FFF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "江苏",
|
||||||
|
value: [120.26, 32.54, -1],
|
||||||
|
symbolSize: 2,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: "#FFF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "西藏",
|
||||||
|
value: [89.13, 30.66, -1],
|
||||||
|
symbolSize: 2,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: "#FFF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
export const salaryData = {
|
||||||
|
header: ["业务板块", "二级机构", "人员类型", "起始时间", "截止时间", "发薪人数", "固定薪酬", "浮动薪酬", "薪酬合计", "薪酬固浮化"],
|
||||||
|
data: [
|
||||||
|
["国内工程", "建设集团", "领导班子", "2023.1", "2023.1", "23", "20,000", "20,000", "20,000", "20,000"],
|
||||||
|
["国内工程", "建设集团", "领导班子", "2023.1", "2023.1", "23", "20,000", "20,000", "20,000", "20,000"],
|
||||||
|
["国内工程", "建设集团", "领导班子", "2023.1", "2023.1", "23", "20,000", "20,000", "20,000", "20,000"],
|
||||||
|
["国内工程", "建设集团", "领导班子", "2023.1", "2023.1", "23", "20,000", "20,000", "20,000", "20,000"],
|
||||||
|
["国内工程", "建设集团", "领导班子", "2023.1", "2023.1", "23", "20,000", "20,000", "20,000", "20,000"],
|
||||||
|
["国内工程", "建设集团", "领导班子", "2023.1", "2023.1", "23", "20,000", "20,000", "20,000", "20,000"],
|
||||||
|
["国内工程", "建设集团", "领导班子", "2023.1", "2023.1", "23", "20,000", "20,000", "20,000", "20,000"],
|
||||||
|
["国内工程", "建设集团", "领导班子", "2023.1", "2023.1", "23", "20,000", "20,000", "20,000", "20,000"]
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
export const mapOptions = (params) => ({
|
||||||
|
title: {
|
||||||
|
show: false,
|
||||||
|
text: "全国物流输送图",
|
||||||
|
left: "center",
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
geo: [
|
||||||
|
{
|
||||||
|
nameMap: {
|
||||||
|
China: "中国"
|
||||||
|
},
|
||||||
|
map: "china",
|
||||||
|
zlevel: 5,
|
||||||
|
label: {
|
||||||
|
normal: {
|
||||||
|
show: true,
|
||||||
|
formatter: function (params) {
|
||||||
|
//圆环显示文字
|
||||||
|
return params.name === "江苏" || params.name === "浙江" || params.name === "四川" || params.name === "内蒙古" || params.name === "西藏" ? params.name : "";
|
||||||
|
},
|
||||||
|
fontSize: 12,
|
||||||
|
color: "#FFF"
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
show: true,
|
||||||
|
color: "#FFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
zoom: 1.2,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
borderColor: "rgba(148,224,250, .5)", //区域边框颜色
|
||||||
|
areaColor: "rgba(82,164,238,.1)", //区域颜色
|
||||||
|
borderWidth: 1, //区域边框宽度
|
||||||
|
shadowBlur: 5,
|
||||||
|
shadowColor: "rgba(3,113,173,.7)"
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
borderColor: "rgba(148,224,250, .5)",
|
||||||
|
areaColor: "rgba(6,89,176,.3)",
|
||||||
|
borderWidth: 2.5,
|
||||||
|
shadowBlur: 5,
|
||||||
|
shadowColor: "rgba(3,113,173,.5)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
nameMap: {
|
||||||
|
China: "中国"
|
||||||
|
},
|
||||||
|
map: "china",
|
||||||
|
zlevel: 4,
|
||||||
|
top: "11%",
|
||||||
|
label: {
|
||||||
|
emphasis: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
zoom: 1.2,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
// borderColor: 'rgba(255,209,163, .5)', //区域边框颜色
|
||||||
|
areaColor: "rgba(73,86,166,.1)", //区域颜色
|
||||||
|
borderWidth: 0.5, //区域边框宽度
|
||||||
|
shadowBlur: 5,
|
||||||
|
shadowColor: "rgba(107,91,237,.7)"
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
borderColor: "transparent",
|
||||||
|
areaColor: "transparent",
|
||||||
|
borderWidth: 1,
|
||||||
|
shadowBlur: 5,
|
||||||
|
shadowColor: "transparent"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
nameMap: {
|
||||||
|
China: "中国"
|
||||||
|
},
|
||||||
|
map: "china",
|
||||||
|
zlevel: 3,
|
||||||
|
top: "12%",
|
||||||
|
label: {
|
||||||
|
emphasis: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
zoom: 1.2,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
areaColor: "rgba(73,86,166,.1)", //区域颜色
|
||||||
|
borderWidth: 0.5, //区域边框宽度
|
||||||
|
shadowBlur: 5,
|
||||||
|
shadowColor: "rgba(107,91,237,.7)"
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
borderColor: "transparent",
|
||||||
|
areaColor: "transparent",
|
||||||
|
borderWidth: 1,
|
||||||
|
shadowBlur: 5,
|
||||||
|
shadowColor: "transparent"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
nameMap: {
|
||||||
|
China: "中国"
|
||||||
|
},
|
||||||
|
map: "china",
|
||||||
|
zlevel: 2,
|
||||||
|
top: "13%",
|
||||||
|
label: {
|
||||||
|
emphasis: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
zoom: 1.2,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
// borderColor: 'rgba(255,209,163, .5)', //区域边框颜色
|
||||||
|
areaColor: "rgba(73,86,166,.1)", //区域颜色
|
||||||
|
borderWidth: 0.5, //区域边框宽度
|
||||||
|
shadowBlur: 5,
|
||||||
|
shadowColor: "rgba(107,91,237,.7)"
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
borderColor: "transparent",
|
||||||
|
areaColor: "transparent",
|
||||||
|
borderWidth: 1,
|
||||||
|
shadowBlur: 5,
|
||||||
|
shadowColor: "transparent"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "地点",
|
||||||
|
type: "custom",
|
||||||
|
coordinateSystem: "geo",
|
||||||
|
zlevel: 12,
|
||||||
|
renderItem(params, api) {
|
||||||
|
//具体实现自定义图标的方法
|
||||||
|
return {
|
||||||
|
type: "image",
|
||||||
|
style: {
|
||||||
|
image: require("../../../../assets/images/zs.png"),
|
||||||
|
x: api.coord([
|
||||||
|
mapData.citys[params.dataIndex].value[0],
|
||||||
|
mapData.citys[params.dataIndex].value[1]
|
||||||
|
])[0],
|
||||||
|
y: api.coord([
|
||||||
|
mapData.citys[params.dataIndex].value[0],
|
||||||
|
mapData.citys[params.dataIndex].value[1]
|
||||||
|
])[1]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
data: mapData.citys
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
export const userOptions = (params = {}) => ({
|
||||||
|
header: params.header,
|
||||||
|
data: params.data
|
||||||
|
});
|
@ -0,0 +1,115 @@
|
|||||||
|
.screenWrapperRoot {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
|
.screenWrapper {
|
||||||
|
line-height: 1.15;
|
||||||
|
min-height: 100vh;
|
||||||
|
background: url("../../../assets/images/pageBg.png") top center no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
|
||||||
|
.screenMain {
|
||||||
|
display: flex;
|
||||||
|
min-width: 1024px;
|
||||||
|
max-width: 1920px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0 0.6875rem;
|
||||||
|
|
||||||
|
.screenColCenter {
|
||||||
|
flex: 5 1;
|
||||||
|
margin: 0 0.125rem;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.cardWrapper {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 99;
|
||||||
|
padding: 0.25rem 0.125rem 0;
|
||||||
|
|
||||||
|
& > li:not(:last-child) {
|
||||||
|
margin-right: 0.275rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > li {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 1.1625rem;
|
||||||
|
background: url("../../../assets/images/card_bg.png") no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 0.725rem;
|
||||||
|
margin-right: 0.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cardInner {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
color: #FFF;
|
||||||
|
min-width: 1.125rem;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
span:first-child {
|
||||||
|
font-size: 0.275rem;
|
||||||
|
margin-bottom: 0.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
span:last-child {
|
||||||
|
font-size: 0.2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.screenCol {
|
||||||
|
flex: 3 1;
|
||||||
|
|
||||||
|
.personnelCate, .ageStruct, .degreeStructure, .gradAnalysis {
|
||||||
|
height: 3.875rem;
|
||||||
|
padding: 0 0.3375rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.screenFooter {
|
||||||
|
display: flex;
|
||||||
|
min-width: 1024px;
|
||||||
|
max-width: 1920px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0 0.6875rem;
|
||||||
|
|
||||||
|
& > div:first-child {
|
||||||
|
margin-right: 0.125rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.screenFooterCol {
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.payrollStatistics {
|
||||||
|
padding-bottom: 0.2375rem !important;
|
||||||
|
|
||||||
|
:global {
|
||||||
|
.dv-scroll-board {
|
||||||
|
.rows .row-item, .header {
|
||||||
|
font-size: 0.15rem !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.payrollStatistics, .personnelChangeStatistics {
|
||||||
|
height: 3.5rem;
|
||||||
|
padding: 0 0.3375rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* Author: 黎永顺
|
||||||
|
* name: 公司组件
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/10
|
||||||
|
*/
|
||||||
|
import React, { FunctionComponent } from "react";
|
||||||
|
import { OrgChartNodeDataType } from "@/components/reactChart/interface";
|
||||||
|
import styles from "./index.less";
|
||||||
|
import classNames from "classnames";
|
||||||
|
|
||||||
|
interface OwnProps {
|
||||||
|
node: OrgChartNodeDataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
type Props = OwnProps;
|
||||||
|
|
||||||
|
const CompanyItem: FunctionComponent<Props> = (props) => {
|
||||||
|
const { node } = props;
|
||||||
|
const classes = classNames(styles["header"], {
|
||||||
|
[styles["parent"]]: node.key === 0
|
||||||
|
});
|
||||||
|
return (
|
||||||
|
<div className={styles.companyItemWrapper}>
|
||||||
|
<div className={classes}>{node?.label}</div>
|
||||||
|
<div className={styles.contBox}>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<span>营业收入</span>
|
||||||
|
<span>{node?.operatingIncome}</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span>同比</span>
|
||||||
|
<span>{node?.operatingIncomePercent}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<span>利润总额</span>
|
||||||
|
<span>{node?.operatingProfit}</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span>同比</span>
|
||||||
|
<span>{node?.operatingProfitPercent}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CompanyItem;
|
@ -0,0 +1,94 @@
|
|||||||
|
const IncomeStatisticsRadar = (echarts: any) => {
|
||||||
|
// 实例化对象
|
||||||
|
const myChart = echarts.init(document.getElementById("incomeStatisticsRadar"));
|
||||||
|
// 配置项
|
||||||
|
const option = {
|
||||||
|
tooltip: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
show: true, //是否显示图例
|
||||||
|
icon: "rect", //图例形状
|
||||||
|
bottom: "2%", // 图例距离顶部边距
|
||||||
|
left: "center", // 图例距离左侧边距
|
||||||
|
itemWidth: 10, // 图例标记的图形宽度。[ default: 25 ]
|
||||||
|
itemHeight: 10, // 图例标记的图形高度。[ default: 14 ]
|
||||||
|
itemGap: 30, // 图例每项之间的间隔。[ default: 10 ]横向布局时为水平间隔,纵向布局时为纵向间隔。
|
||||||
|
orient: "horizontal", // 图例列表的布局朝向,'horizontal'为横向,''为纵向.
|
||||||
|
textStyle: { // 图例的公用文本样式。
|
||||||
|
fontSize: 14,
|
||||||
|
color: "#D4D4D4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
radar: {
|
||||||
|
// shape: 'circle',
|
||||||
|
// , axisLabel: { show: true } 该属性加上会报错
|
||||||
|
indicator: [
|
||||||
|
{ name: "销售", max: 20000 },
|
||||||
|
{ name: "客服", max: 20000 },
|
||||||
|
{ name: "开发", max: 20000 },
|
||||||
|
{ name: "其他", max: 20000 },
|
||||||
|
{ name: "项目", max: 20000 }
|
||||||
|
],
|
||||||
|
splitArea: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "人均浮动收入",
|
||||||
|
type: "radar",
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
value: [9000, 2000, 9000, 6000, 6000],
|
||||||
|
name: "人均浮动收入"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
label: {
|
||||||
|
show: false,
|
||||||
|
formatter: function (params: any) {
|
||||||
|
return params.value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
itemStyle: { //此属性的颜色和下面areaStyle属性的颜色都设置成相同色即可实现
|
||||||
|
color: "#64C3FF",
|
||||||
|
borderColor: "#64C3FF"
|
||||||
|
},
|
||||||
|
areaStyle: {
|
||||||
|
color: "rgba(100,195,255,0.26)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "人均固定收入",
|
||||||
|
type: "radar",
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
value: [5500, 8000, 5000, 8800, 8900],
|
||||||
|
name: "人均固定收入"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
label: {
|
||||||
|
show: false,
|
||||||
|
formatter: function (params: any) {
|
||||||
|
return params.value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
itemStyle: { //此属性的颜色和下面areaStyle属性的颜色都设置成相同色即可实现
|
||||||
|
color: "#66EFE8",
|
||||||
|
borderColor: "#66EFE8"
|
||||||
|
},
|
||||||
|
areaStyle: {
|
||||||
|
color: "rgba(102,239,232,0.26)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
// 配置项给实例对象
|
||||||
|
myChart.setOption(option);
|
||||||
|
return myChart;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default IncomeStatisticsRadar;
|
@ -0,0 +1,100 @@
|
|||||||
|
.companyItemWrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.header {
|
||||||
|
height: 38px;
|
||||||
|
line-height: 38px;
|
||||||
|
text-align: center;
|
||||||
|
color: #FFF;
|
||||||
|
font-size: 16px;
|
||||||
|
background: #199DFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.parent {
|
||||||
|
background: #1E66F6 !important;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contBox {
|
||||||
|
display: flex;
|
||||||
|
padding: 10px;
|
||||||
|
color: #B8B8B8;
|
||||||
|
font-size: 12px;
|
||||||
|
border: 1px solid rgba(25, 157, 255, 1);
|
||||||
|
border-top: none;
|
||||||
|
|
||||||
|
& > div:first-child {
|
||||||
|
border-right: 1px solid #e5e5e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
& > div:first-child {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
& > span:last-child {
|
||||||
|
color: #787E95;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.regionItemWrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background: #EBF5FF;
|
||||||
|
min-width: 116px;
|
||||||
|
|
||||||
|
.header {
|
||||||
|
height: 38px;
|
||||||
|
line-height: 38px;
|
||||||
|
text-align: center;
|
||||||
|
color: #333333;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contBox {
|
||||||
|
display: flex;
|
||||||
|
padding: 10px 0;
|
||||||
|
color: #B8B8B8;
|
||||||
|
font-size: 12px;
|
||||||
|
|
||||||
|
& > div:first-child {
|
||||||
|
border-right: 1px solid #e5e5e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
& > span:last-child {
|
||||||
|
color: #787E95;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.regionItemWrapperChild {
|
||||||
|
background: #EAFCFC;
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* Author: 黎永顺
|
||||||
|
* name: 公司组件
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/10
|
||||||
|
*/
|
||||||
|
import React, { FunctionComponent } from "react";
|
||||||
|
import { OrgChartNodeDataType } from "@/components/reactChart/interface";
|
||||||
|
import styles from "./index.less";
|
||||||
|
import classNames from "classnames";
|
||||||
|
|
||||||
|
interface OwnProps {
|
||||||
|
node: OrgChartNodeDataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
type Props = OwnProps;
|
||||||
|
|
||||||
|
const RegionItem: FunctionComponent<Props> = (props) => {
|
||||||
|
const { node } = props;
|
||||||
|
const classes = classNames(styles["regionItemWrapper"], {
|
||||||
|
[styles["regionItemWrapperChild"]]: node.key === 20 || node.key === 21 || node.key === 22 || node.key === 23 || node.key === 24 || node.key === 25
|
||||||
|
});
|
||||||
|
return (
|
||||||
|
<div className={classes}>
|
||||||
|
<div className={styles.header}>{node?.label}</div>
|
||||||
|
<div className={styles.contBox}>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<span>营业收入</span>
|
||||||
|
<span>{node?.operatingIncome}</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span>同比</span>
|
||||||
|
<span>{node?.operatingIncomePercent}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<span>利润总额</span>
|
||||||
|
<span>{node?.operatingProfit}</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span>同比</span>
|
||||||
|
<span>{node?.operatingProfitPercent}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RegionItem;
|