|
@@ -22,11 +22,12 @@ const initData = [
|
|
];
|
|
];
|
|
|
|
|
|
function Department(props) {
|
|
function Department(props) {
|
|
- const { dispatch, loading, dep, depUserTree } = props;
|
|
|
|
|
|
+ const { dispatch, loading, dep } = props;
|
|
const [form] = Form.useForm();
|
|
const [form] = Form.useForm();
|
|
const [visible, setVisible] = useState(false);
|
|
const [visible, setVisible] = useState(false);
|
|
const [modalFilter, setModalFilter] = useState({});
|
|
const [modalFilter, setModalFilter] = useState({});
|
|
const [current, setCurrent] = useState(null);
|
|
const [current, setCurrent] = useState(null);
|
|
|
|
+ const [currentDep, setCurrentDep] = useState(null);
|
|
const chartRef = useRef(null);
|
|
const chartRef = useRef(null);
|
|
const columns = [
|
|
const columns = [
|
|
{
|
|
{
|
|
@@ -98,6 +99,7 @@ function Department(props) {
|
|
payload: {
|
|
payload: {
|
|
filter: filterRef.current,
|
|
filter: filterRef.current,
|
|
},
|
|
},
|
|
|
|
+ callback: list => handleChangeCurrent(list[0]),
|
|
});
|
|
});
|
|
};
|
|
};
|
|
const handleDownload = () => {
|
|
const handleDownload = () => {
|
|
@@ -140,7 +142,7 @@ function Department(props) {
|
|
});
|
|
});
|
|
};
|
|
};
|
|
const showUserModal = item => {
|
|
const showUserModal = item => {
|
|
- // const showDepCompare = item => {
|
|
|
|
|
|
+ // const showDepCompare = item => {
|
|
const { s_time, e_time } = filterRef.current;
|
|
const { s_time, e_time } = filterRef.current;
|
|
setModalFilter({
|
|
setModalFilter({
|
|
s_time: s_time,
|
|
s_time: s_time,
|
|
@@ -192,6 +194,7 @@ function Department(props) {
|
|
{ value: item.type_standardize_cnt, name: '标准化' },
|
|
{ value: item.type_standardize_cnt, name: '标准化' },
|
|
{ value: item.type_rd_cnt, name: '研发' },
|
|
{ value: item.type_rd_cnt, name: '研发' },
|
|
];
|
|
];
|
|
|
|
+ setCurrentDep(item.dep_id);
|
|
// 过滤为0的值
|
|
// 过滤为0的值
|
|
data = data.filter(item => item.value);
|
|
data = data.filter(item => item.value);
|
|
if (data.length > 0) {
|
|
if (data.length > 0) {
|
|
@@ -220,12 +223,13 @@ function Department(props) {
|
|
value: 'dep_id',
|
|
value: 'dep_id',
|
|
}}
|
|
}}
|
|
filterTreeNode={(input, option) => {
|
|
filterTreeNode={(input, option) => {
|
|
- return option.props.title === input;
|
|
|
|
|
|
+ return option.props.dep_name.includes(input);
|
|
}}
|
|
}}
|
|
onSelect={(_, node) => {
|
|
onSelect={(_, node) => {
|
|
handleChangeCurrent(node);
|
|
handleChangeCurrent(node);
|
|
}}
|
|
}}
|
|
loadData={node => onExpand(true, node)}
|
|
loadData={node => onExpand(true, node)}
|
|
|
|
+ value={currentDep}
|
|
/>
|
|
/>
|
|
);
|
|
);
|
|
};
|
|
};
|
|
@@ -234,9 +238,6 @@ function Department(props) {
|
|
// dispatch({
|
|
// dispatch({
|
|
// type: 'report/queryUserReport',
|
|
// type: 'report/queryUserReport',
|
|
// });
|
|
// });
|
|
- dispatch({
|
|
|
|
- type: 'report/fetchDepV2',
|
|
|
|
- });
|
|
|
|
handleSearch();
|
|
handleSearch();
|
|
chartRef.current = echarts.init(document.getElementById('chart'));
|
|
chartRef.current = echarts.init(document.getElementById('chart'));
|
|
}, []);
|
|
}, []);
|
|
@@ -288,6 +289,5 @@ function Department(props) {
|
|
|
|
|
|
export default connect(({ report, loading }) => ({
|
|
export default connect(({ report, loading }) => ({
|
|
dep: report.dep,
|
|
dep: report.dep,
|
|
- depUserTree: report.depUserTree,
|
|
|
|
loading: loading.models.report,
|
|
loading: loading.models.report,
|
|
}))(Department);
|
|
}))(Department);
|