|
|
@ -2,17 +2,12 @@ |
|
|
|
import React, { useState, useEffect } from "react"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import { Spin, Tabs, Table } from "antd"; |
|
|
|
import { LayoutContent } from "@peace/components"; |
|
|
|
import classnames from "classnames/bind"; |
|
|
|
import styles from "./index.less"; |
|
|
|
import { push } from "react-router-redux"; |
|
|
|
import moment from "moment"; |
|
|
|
import { getPartyMember } from "../actions/profile"; |
|
|
|
// const ROOTLESSNAME = "ly-alarm-configure-container-indexjs";
|
|
|
|
import { getProject, getPeople, getWait } from "../actions/profile"; |
|
|
|
const CX = classnames.bind(styles); |
|
|
|
// function cx_(name) {
|
|
|
|
// return CX(`${ROOTLESSNAME}${name}`);
|
|
|
|
// }
|
|
|
|
|
|
|
|
const topImg = "/assets/images/top.png"; |
|
|
|
const pointImg = "/assets/images/point.png"; |
|
|
@ -22,29 +17,33 @@ function Management(props) { |
|
|
|
|
|
|
|
const [dataSource, setDataSource] = useState([]) |
|
|
|
|
|
|
|
const currentCol = [ |
|
|
|
const [projectData, setProjectData] = useState([]) |
|
|
|
const [peopleData, setPeopleData] = useState([]) |
|
|
|
const [waitData, setWaitData] = useState([]) |
|
|
|
|
|
|
|
const projectCol = [ |
|
|
|
{ |
|
|
|
title: '项目名称', |
|
|
|
dataIndex: 'name', |
|
|
|
key: 'name', |
|
|
|
dataIndex: 'name_project', |
|
|
|
key: 'name_project', |
|
|
|
align: 'center' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '投入人力', |
|
|
|
dataIndex: 'worker', |
|
|
|
key: 'worker', |
|
|
|
dataIndex: 'part_people', |
|
|
|
key: 'part_people', |
|
|
|
align: 'center' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '构建时间', |
|
|
|
dataIndex: 'buildTime', |
|
|
|
key: 'buildTime', |
|
|
|
dataIndex: 'build_time', |
|
|
|
key: 'build_time', |
|
|
|
align: 'center' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '发布时间', |
|
|
|
dataIndex: 'releaseTime', |
|
|
|
key: 'releaseTime', |
|
|
|
dataIndex: 'publish_time', |
|
|
|
key: 'publish_time', |
|
|
|
align: 'center' |
|
|
|
}, |
|
|
|
{ |
|
|
@ -74,7 +73,7 @@ function Management(props) { |
|
|
|
key: 'monday', |
|
|
|
align: 'center', |
|
|
|
onCell: (record, index) => { |
|
|
|
console.log("record, index: ", record, index); |
|
|
|
// console.log("record, index: ", record, index);
|
|
|
|
return { |
|
|
|
className: "cell-class", |
|
|
|
colSpan: 2 |
|
|
@ -110,20 +109,20 @@ function Management(props) { |
|
|
|
const waitCol = [ |
|
|
|
{ |
|
|
|
title: '项目', |
|
|
|
dataIndex: 'name', |
|
|
|
key: 'name', |
|
|
|
dataIndex: 'name_project', |
|
|
|
key: 'name_project', |
|
|
|
align: 'center' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '需求来源', |
|
|
|
dataIndex: 'source', |
|
|
|
key: 'source', |
|
|
|
dataIndex: 'from_project', |
|
|
|
key: 'from_project', |
|
|
|
align: 'center' |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '对接人', |
|
|
|
dataIndex: 'head', |
|
|
|
key: 'head', |
|
|
|
dataIndex: 'contacts', |
|
|
|
key: 'contacts', |
|
|
|
align: 'center' |
|
|
|
}, |
|
|
|
{ |
|
|
@ -135,7 +134,34 @@ function Management(props) { |
|
|
|
]; |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
// dispatch(getPartyMember()).then((res) => { });
|
|
|
|
dispatch(getProject()).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
const nextData = res.payload?.data?.projects?.map((d, i) => ({ |
|
|
|
...d, |
|
|
|
key: i, |
|
|
|
build_time: moment(d.build_time).format("YYYY/MM/DD"), |
|
|
|
publish_time: moment(d.publish_time).format("YYYY/MM/DD"), |
|
|
|
part_people: d.part_people?.map(p => p.name_people).join(), |
|
|
|
})); |
|
|
|
setProjectData(nextData) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
dispatch(getPeople()).then((res) => { |
|
|
|
console.log(res, 'getPeople') |
|
|
|
}) |
|
|
|
|
|
|
|
dispatch(getWait()).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
const nextData = res.payload?.data?.projects?.map((d, i) => ({ |
|
|
|
...d, |
|
|
|
key: i, |
|
|
|
})); |
|
|
|
setWaitData(nextData) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
let nextData = [] |
|
|
|
for (let i = 1; i <= 34; i++) { |
|
|
|
nextData.push({ |
|
|
@ -158,7 +184,7 @@ function Management(props) { |
|
|
|
<div className={CX("index-main-box-title")}>本周在研项目</div> |
|
|
|
<div className={CX("index-main-box-en")}>/Research project this week</div> |
|
|
|
<Spin spinning={false}> |
|
|
|
<Table dataSource={dataSource} columns={currentCol} size="middle" /> |
|
|
|
<Table dataSource={projectData} columns={projectCol} size="middle" /> |
|
|
|
</Spin> |
|
|
|
</div> |
|
|
|
<div className={CX("index-main-box")}> |
|
|
@ -171,7 +197,7 @@ function Management(props) { |
|
|
|
<img className={CX("index-main-box-point")} src={pointImg} /> |
|
|
|
<div className={CX("index-main-box-title")}>待研发项目</div> |
|
|
|
<div className={CX("index-main-box-en")}>/Project to be developed</div> |
|
|
|
<Table dataSource={dataSource} columns={waitCol} size="middle" /> |
|
|
|
<Table dataSource={waitData} columns={waitCol} size="middle" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -203,13 +229,10 @@ function Management(props) { |
|
|
|
); |
|
|
|
} |
|
|
|
function mapStateToProps(state) { |
|
|
|
const { auth, global, party, articlesfrom } = state; |
|
|
|
const { auth, global } = state; |
|
|
|
return { |
|
|
|
loding: party.isRequesting, |
|
|
|
user: auth.user, |
|
|
|
actions: global.actions, |
|
|
|
articlesfrom: articlesfrom, |
|
|
|
party: party || [], |
|
|
|
}; |
|
|
|
} |
|
|
|
export default connect(mapStateToProps)(Management); |
|
|
|