diff --git a/.umirc.ts b/.umirc.ts index 6e46cf4..bda2586 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -1,11 +1,3 @@ -/* - * @Author: Chengliang 1546584672@qq.com - * @Date: 2023-08-16 11:22:18 - * @LastEditors: Chengliang 1546584672@qq.com - * @LastEditTime: 2023-08-24 15:58:29 - * @FilePath: /org-chart-frant/.umirc.ts - * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE - */ import { defineConfig } from 'umi'; export default defineConfig({ @@ -21,6 +13,7 @@ export default defineConfig({ { path: '/user', component: '@/pages/user' }, { path: '/company', component: '@/pages/company' }, { path: '/dragtree', component: '@/pages/dragTree' }, + { path: '/statistics', component: '@/pages/statisticsTable' }, ], fastRefresh: {}, antd: {}, diff --git a/dist.zip b/dist.zip deleted file mode 100644 index f6bce9c..0000000 Binary files a/dist.zip and /dev/null differ diff --git a/src/components/timeline/img/leftTree-hide.png b/src/components/timeline/img/leftTree-hide.png new file mode 100644 index 0000000..0a1cadf Binary files /dev/null and b/src/components/timeline/img/leftTree-hide.png differ diff --git a/src/components/timeline/img/leftTree-show-hover.png b/src/components/timeline/img/leftTree-show-hover.png new file mode 100644 index 0000000..96967b5 Binary files /dev/null and b/src/components/timeline/img/leftTree-show-hover.png differ diff --git a/src/components/timeline/img/leftTree-show.png b/src/components/timeline/img/leftTree-show.png new file mode 100644 index 0000000..cc791aa Binary files /dev/null and b/src/components/timeline/img/leftTree-show.png differ diff --git a/src/components/timeline/index.jsx b/src/components/timeline/index.jsx index 49f34e8..a961adf 100644 --- a/src/components/timeline/index.jsx +++ b/src/components/timeline/index.jsx @@ -2,19 +2,22 @@ * @Author: Chengliang 1546584672@qq.com * @Date: 2023-06-25 16:33:21 * @LastEditors: Chengliang 1546584672@qq.com - * @LastEditTime: 2023-06-29 14:24:04 + * @LastEditTime: 2023-09-14 17:48:39 * @FilePath: /org-chart-frant/src/components/timeline/index.jsx * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ import React from 'react'; -import { Timeline } from 'antd'; +import { Timeline, Drawer } from 'antd'; import styles from './index.less'; +import leftTreeShow from './img/leftTree-show.png'; +import leftHide from './img/leftTree-hide.png'; export default class TimeLine extends React.Component { constructor(props) { super(props); this.state = { timelineList: [], + open: true, }; } @@ -46,26 +49,61 @@ export default class TimeLine extends React.Component { }); } + setOpen = () => { + this.setState({ + open: !this.state.open, + }); + }; + render() { + let showStyle = {}; + let positionStyle = {}; + if (this.state.open) { + showStyle = { + display: 'block', + }; + positionStyle = { + left: '219px', + background: `url(${leftTreeShow}) no-repeat -2px 0`, + }; + } else { + showStyle = { + display: 'none', + }; + positionStyle = { + left: '0', + background: `url(${leftHide}) no-repeat -2px 0`, + }; + } + return ( -
- - {this.state.timelineList.map((item) => { - return ( - -
{item.title}
-
{item.time}
-
- ); - })} -
-
+ <> +
+
+ + {this.state.timelineList.map((item) => { + return ( + +
{item.title}
+
{item.time}
+
+ ); + })} +
+
+ ); } } diff --git a/src/components/timeline/index.less b/src/components/timeline/index.less index 55d216d..3d5571b 100644 --- a/src/components/timeline/index.less +++ b/src/components/timeline/index.less @@ -24,6 +24,21 @@ } } +.leftRightLayoutBtn { + width: 18px; + height: 60px; + position: absolute; + top: 50%; + margin-top: -30px; + z-index: 101; + cursor: pointer; +} + +.leftRightLayoutBtn :hover { + background-image: url(./img/leftTree-show-hover.png) no-repeat -2px 0 !important; + background-color: #1890ff; +} + .lineWrapper::-webkit-scrollbar { /*滚动条整体样式*/ width: 10px; diff --git a/src/components/topBar/index.jsx b/src/components/topBar/index.jsx index 9668d1b..06b3f73 100644 --- a/src/components/topBar/index.jsx +++ b/src/components/topBar/index.jsx @@ -293,7 +293,7 @@ export class TopBar extends React.Component { /> - + + diff --git a/src/department/index.js b/src/department/index.js deleted file mode 100644 index b04fce2..0000000 --- a/src/department/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react' - -export default () => { - return
Hello
-} \ No newline at end of file diff --git a/src/pages/company.jsx b/src/pages/company.jsx index 8916c64..eafb603 100644 --- a/src/pages/company.jsx +++ b/src/pages/company.jsx @@ -10,7 +10,8 @@ import OperateDialog from '../components/dialog'; import jsPDF from 'jspdf'; import moment from 'moment'; import qs from 'qs'; -import { message, Spin } from 'antd'; +import { message, Spin, notification } from 'antd'; +import { SmileOutlined } from '@ant-design/icons'; let active = 'top'; let drawerCom = null; @@ -31,6 +32,14 @@ export default function companyPage() { const [timelineId, setTimelineId] = useState(0); const infoRef = useRef(); + useEffect(() => { + notification.open({ + message: '提示', + description: + '组织架构图中编制数和在编数显示初始化需参考文档配置定时任务并执行!!!(编制数默认取本年度最新编制信息,人数统计展示仅限于行政维度)', + icon: , + }); + }, []); useEffect(() => { infoRef.current = timelineId; }, [timelineId]); @@ -140,6 +149,8 @@ export default function companyPage() { }; const nodeContentRender = (d, i, arr, state) => { + let fclass = topbar.state.requestData.fclass; + let statisticsStyle = fclass == 0 ? 'block' : 'none'; if (d.data.ftype == 0) { return `
@@ -166,7 +177,13 @@ export default function companyPage() { d.data.fname } style="width: 110px;margin: 0 auto;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis; line-height: 18px;word-break: break-all;">${d.data.fname}
-
`; +
+ ${d.data.staffNum} / + ${d.data.onJobNum} +
+ + + `; } else if (d.data.ftype == 2) { return `
@@ -179,6 +196,10 @@ export default function companyPage() { font-family: Microsoft YaHei-Regular, Microsoft YaHei;color: #333333;text-align: center;">
${d.data.fname}
+
+ ${d.data.staffNum} / + ${d.data.onJobNum} +
`; diff --git a/src/pages/statisticsTable.jsx b/src/pages/statisticsTable.jsx new file mode 100644 index 0000000..79b5c73 --- /dev/null +++ b/src/pages/statisticsTable.jsx @@ -0,0 +1,89 @@ +/* + * @Author: Chengliang 1546584672@qq.com + * @Date: 2023-09-11 15:33:27 + * @LastEditors: Chengliang 1546584672@qq.com + * @LastEditTime: 2023-09-13 17:49:16 + * @FilePath: /org-chart-frant/src/pages/statisticsTable.jsx + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import React, { useEffect, useState, useRef } from 'react'; +import * as d3 from 'd3'; +import qs from 'qs'; +import { Table } from 'antd'; + +const StatisticsTable = () => { + const [loading, setLoading] = useState(true); + const [dataSource, setDataSource] = useState([]); + const [columns, setColumns] = useState([]); + + useEffect(() => { + const columns = [ + { + title: '序号', + dataIndex: 'key', + key: 'key', + }, + { + title: '名称', + dataIndex: 'dataIdName', + key: 'dataIdName', + }, + { + title: '上级', + dataIndex: 'superIdName', + key: 'superIdName', + }, + { + title: '类型', + dataIndex: 'type', + key: 'type', + render(value, row, index) { + if (value == 1) { + return '分部'; + } else { + return '部门'; + } + }, + }, + { + title: '在编数', + dataIndex: 'onJobNum', + key: 'onJobNum', + }, + { + title: '编制数', + dataIndex: 'staffNum', + key: 'staffNum', + }, + { + title: '创建人', + dataIndex: 'creator', + key: 'creator', + }, + { + title: '创建时间', + dataIndex: 'createTime', + key: 'createTime', + }, + { + title: '更新时间', + dataIndex: 'updateTime', + key: 'updateTime', + }, + ]; + setColumns(columns); + d3.json(`/api/bs/hrmorganization/orgchart/selectStatistics`).then((res) => { + setDataSource(res.data.result); + setLoading(false); + }); + }, [true]); + + return ( + <> +
+ ; + + + ); +}; +export default StatisticsTable; diff --git a/src/pages/user.jsx b/src/pages/user.jsx index 3955f2f..0321098 100644 --- a/src/pages/user.jsx +++ b/src/pages/user.jsx @@ -99,7 +99,7 @@ export default function userPage() { // 获取数据 useEffect(() => { document.cookie = - 'ecology_JSessionid=aaaX333ODS20gePpBTCOy; JSESSIONID=aaaX333ODS20gePpBTCOy; Systemlanguid=7; languageidweaver=7; loginuuids=1; loginidweaver=sysadmin; __randcode__=6359f5f6-7958-4201-8982-fdc38c5348b7'; + 'ecology_JSessionid=aaaQRFwOgYRXPc88EZiQy; JSESSIONID=aaaQRFwOgYRXPc88EZiQy; Systemlanguid=7; languageidweaver=7; loginuuids=1; loginidweaver=sysadmin; __randcode__=0418808b-1045-4624-bea6-5b308360da7b'; d3.json( '/api/bs/hrmorganization/orgchart/userData?fclass=0&fisvitual=0&root=0&level=3&id=0', ).then((data) => {