Browse Source

全部提交

master
xingyongchun 2 years ago
parent
commit
97da162690
  1. BIN
      web/client/assets/人员信息.xlsx
  2. BIN
      web/client/assets/项目信息.xlsx
  3. 23
      web/client/src/sections/article/actions/article.js
  4. 20
      web/client/src/sections/article/components/import_model.js
  5. 9
      web/client/src/sections/article/components/modeal.js
  6. 108
      web/client/src/sections/article/containers/index.js
  7. 6
      web/client/src/sections/homePage/actions/profile.js
  8. 154
      web/client/src/sections/homePage/containers/index.js
  9. 12
      web/client/src/sections/personnel/actions/article.js
  10. 79
      web/client/src/sections/personnel/components/import_model.js
  11. 95
      web/client/src/sections/personnel/components/modeal.js
  12. 100
      web/client/src/sections/personnel/containers/index.js
  13. 56
      web/client/src/sections/wait/actions/article.js
  14. 2
      web/client/src/sections/wait/components/import_model.js
  15. 43
      web/client/src/sections/wait/components/modeal.js
  16. 135
      web/client/src/sections/wait/containers/index.js
  17. 10
      web/client/src/utils/webapi.js

BIN
web/client/assets/人员信息.xlsx

Binary file not shown.

BIN
web/client/assets/项目信息.xlsx

Binary file not shown.

23
web/client/src/sections/article/actions/article.js

@ -86,3 +86,26 @@ export function postInProject(articleObj) {
// reducer: { name: "articleInsertInfo" }, // reducer: { name: "articleInsertInfo" },
}); });
} }
export function delCancel(query) {
return (dispatch) =>
basicAction({
type: "post",
dispatch: dispatch,
data: query,
actionType: "DEL_CANCEL",
url: `${ApiTable.delCancel}`,
msg: { error: "删除项目信息失败" },
// reducer: { name: "articleInsertInfo" },
});
}
export function getDownProject() {
return (dispatch) =>
basicAction({
type: "get",
dispatch: dispatch,
actionType: "DEL_CANCEL",
url: `${ApiTable.getDownProject}`,
msg: { error: "下载项目信息失败" },
// reducer: { name: "articleInsertInfo" },
});
}

20
web/client/src/sections/article/components/import_model.js

@ -12,7 +12,7 @@ import { Button, Input, Card, Modal, Upload, message } from "antd";
import { Request } from "@peace/utils"; import { Request } from "@peace/utils";
import request from "superagent"; import request from "superagent";
import XLSX from "xlsx"; import XLSX from "xlsx";
import { postInProject } from "../actions/article"; import { postInProject,getDownProject } from "../actions/article";
//TODO 下载模板和上传文件读取 //TODO 下载模板和上传文件读取
const ImportUser = (props) => { const ImportUser = (props) => {
@ -22,13 +22,16 @@ const ImportUser = (props) => {
const [postData, setPostData] = useState([]); const [postData, setPostData] = useState([]);
const confirm = () => { const confirm = () => {
handleCancel
if (postData.length) { if (postData.length) {
console.log(postData)
setLoading(true); setLoading(true);
dispatch(postInProject(postData)).then((res) => { dispatch(postInProject(postData)).then((res) => {
console.log(res) console.log(res)
if (res.success) { if (res.success) {
handleCancel();
message.success("上传成功"); message.success("上传成功");
handleCancel()
} }
setLoading(false); setLoading(false);
}); });
@ -55,17 +58,8 @@ const ImportUser = (props) => {
}) })
}}>下载模板</Button> */} }}>下载模板</Button> */}
<a <a href={`/assets/项目信息.xlsx`} >
href={ <Button size="small" type='primary' >下载模板</Button>
"/_api/" +
`attachments?src=files/用户信息导入模板.xlsx&filename=${encodeURIComponent(
"用户信息导入模板.xlsx"
)}&token=${user.token}`
}
>
<Button size="small" type="primary">
下载模板
</Button>
</a> </a>
<div style={{ marginTop: 10 }}>下载模板后填写完整后上传</div> <div style={{ marginTop: 10 }}>下载模板后填写完整后上传</div>
<div style={{ marginTop: 10 }}> <div style={{ marginTop: 10 }}>

9
web/client/src/sections/article/components/modeal.js

@ -1,6 +1,7 @@
import React,{useState,useEffect} from 'react' import React,{useState,useEffect} from 'react'
import { Modal, Form, Input, Button,DatePicker,Select } from 'antd' import { Modal, Form, Input, Button,DatePicker,Select } from 'antd'
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import moment from 'moment';
function modeal(props) { function modeal(props) {
const [form] = Form.useForm(); const [form] = Form.useForm();
const { visible, handleOk, handleCancel, editData } = props const { visible, handleOk, handleCancel, editData } = props
@ -10,8 +11,8 @@ function modeal(props) {
form.setFieldsValue({ form.setFieldsValue({
name_project: editData.name_project, name_project: editData.name_project,
part_people: editData.part_people.map((i)=>i.name_people), part_people: editData.part_people.map((i)=>i.name_people),
build_time: dayjs(editData?.build_time), build_time: moment(editData?.build_time).format('YYYY-MM-DD'),
publish_time: dayjs(editData.publish_time), publish_time: moment(editData?.publish_time).format('YYYY-MM-DD'),
progress:editData.progress progress:editData.progress
}) })
} }
@ -49,14 +50,14 @@ function modeal(props) {
name="build_time" name="build_time"
rules={[{ required: true, message: '请选择时间' }]} rules={[{ required: true, message: '请选择时间' }]}
> >
<DatePicker /> <Input/>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="发布时间" label="发布时间"
name="publish_time" name="publish_time"
rules={[{ required: true, message: '请选择时间' }]} rules={[{ required: true, message: '请选择时间' }]}
> >
<DatePicker /> <Input/>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="目前进度" label="目前进度"

108
web/client/src/sections/article/containers/index.js

@ -3,12 +3,12 @@ import React, { useEffect, useState, useRef } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Button, Popconfirm } from "antd"; import { Button, Popconfirm } from "antd";
import ProTable from "@ant-design/pro-table"; import ProTable from "@ant-design/pro-table";
import {postProject} from "../actions/article"; import { postProject, delCancel,postInProject } from "../actions/article";
import moment from "moment"; import moment from "moment";
import { push } from "react-router-redux"; import { push } from "react-router-redux";
import { Scroller } from "$components"; import { Scroller } from "$components";
import ProjectModeal from '../components/modeal' import ProjectModeal from "../components/modeal";
import ImportModeal from '../components/import_model' import ImportModeal from "../components/import_model";
export const Default = (props) => { export const Default = (props) => {
const { dispatch } = props; const { dispatch } = props;
@ -19,9 +19,7 @@ export const Default = (props) => {
const [visible, setVisible] = useState(false); //弹窗 const [visible, setVisible] = useState(false); //弹窗
const [editData, setEditData] = useState(); //数据 const [editData, setEditData] = useState(); //数据
const [importVisible, setImportVisible] = useState(false); //弹窗 const [importVisible, setImportVisible] = useState(false); //弹窗
const tableActionRef = useRef(); const tableActionRef = useRef();
const dataSore = [{ name_project: '企服v1.0.1', part_people: '投入研发3、测试1', build_time: new Date( ), publish_time: new Date( ), progress: '研发中' }]
const columns = [ const columns = [
{ {
title: "项目计划", title: "项目计划",
@ -38,7 +36,20 @@ export const Default = (props) => {
dataIndex: "part_people", dataIndex: "part_people",
hideInSearch: true, hideInSearch: true,
render: (dom, record) => { render: (dom, record) => {
return <div>{record.part_people.map((i, index) => record.part_people.length == 1 ? <span>{i.name_people}</span> : <span>{i.name_people}{index < record.part_people.length-1 ? '':'' }</span>) }</div> return (
<div>
{record.part_people.map((i, index) =>
record.part_people.length == 1 ? (
<span>{i.name_people}</span>
) : (
<span>
{i.name_people}
{index < record.part_people.length - 1 ? "、" : ""}
</span>
)
)}
</div>
);
}, },
}, },
{ {
@ -47,7 +58,7 @@ export const Default = (props) => {
dataIndex: "build_time", dataIndex: "build_time",
hideInSearch: true, hideInSearch: true,
render: (dom, record) => { render: (dom, record) => {
return moment(record.build_time).format('YYYY-MM-DD') return moment(record.build_time).format("YYYY-MM-DD");
}, },
}, },
{ {
@ -56,7 +67,7 @@ export const Default = (props) => {
dataIndex: "publish_time", dataIndex: "publish_time",
hideInSearch: true, hideInSearch: true,
render: (dom, record) => { render: (dom, record) => {
return moment(record.publish_time).format('YYYY-MM-DD') return moment(record.publish_time).format("YYYY-MM-DD");
}, },
}, },
{ {
@ -65,7 +76,7 @@ export const Default = (props) => {
hideInSearch: true, hideInSearch: true,
order: 3, order: 3,
render: (dom, record) => { render: (dom, record) => {
return record.progress return record.progress;
}, },
}, },
{ {
@ -87,14 +98,13 @@ export const Default = (props) => {
<Popconfirm <Popconfirm
title="确认删除?" title="确认删除?"
onConfirm={() => { onConfirm={() => {
delDataList(record.id); delDataList(record);
}} }}
> >
<Button type="link">删除</Button> <Button type="link">删除</Button>
</Popconfirm> </Popconfirm>
</div> </div>
) );
}, },
}, },
{ {
@ -108,7 +118,7 @@ export const Default = (props) => {
type="primary" type="primary"
style={{ width: "200px" }} style={{ width: "200px" }}
onClick={() => { onClick={() => {
setImportVisible(true) setImportVisible(true);
}} }}
> >
项目信息导入 项目信息导入
@ -118,27 +128,50 @@ export const Default = (props) => {
}, },
]; ];
const handleCancel = () => { const handleCancel = () => {
setVisible(false) tableActionRef.current.reload();
} setVisible(false);
const handOk = () => { };
const handOk = (values) => {
const query = [{
build_time: values.build_time,
name_project: values.name_project,
part_people: values.part_people.map((i) => {
return {name_people:i}
}),
progress: values.progress,
publish_time: values.publish_time,
o_name_project:editData?.name_project,
}];
dispatch(postInProject(query)).then((res) => {
if (res.success) {
handleCancel();
// tableActionRef.current.reload();
} }
});
};
const importHandleCancel = () => { const importHandleCancel = () => {
setImportVisible(false) tableActionRef.current.reload();
} setImportVisible(false);
};
//删除资讯 //删除资讯
const delDataList = (ids, type) => { const delDataList = (record) => {
dispatch(Action.delDataList(ids)).then((res) => { const query = {
delete: record.name_project,
delete_state: record.progress,
table_name: "test_project",
};
dispatch(delCancel(query)).then((res) => {
if (res.success) { if (res.success) {
// 刷新 // 刷新
tableActionRef.current.reload(); // tableActionRef.current.reload();
handleCancel()
} }
}); });
}; };
//编辑 //编辑
const editor = (record) => { const editor = (record) => {
setVisible(true) setVisible(true);
setEditData(record) setEditData(record);
}; };
return ( return (
<div style={{ height: "100%" }}> <div style={{ height: "100%" }}>
@ -154,7 +187,6 @@ export const Default = (props) => {
}} }}
request={async (params) => { request={async (params) => {
const res = await dispatch(postProject()); const res = await dispatch(postProject());
console.log(res)
setCounts(res.payload.data.projects); setCounts(res.payload.data.projects);
return { return {
...res, ...res,
@ -167,8 +199,17 @@ export const Default = (props) => {
}} }}
/> />
</Scroller> </Scroller>
<ProjectModeal visible={visible} handleOk={handOk} editData={editData} handleCancel={handleCancel}></ProjectModeal> <ProjectModeal
<ImportModeal importVisible={importVisible} handleCancel={importHandleCancel} editData={editData}></ImportModeal> visible={visible}
handleOk={handOk}
editData={editData}
handleCancel={handleCancel}
></ProjectModeal>
<ImportModeal
importVisible={importVisible}
handleCancel={importHandleCancel}
editData={editData}
></ImportModeal>
</div> </div>
); );
}; };
@ -181,11 +222,10 @@ const mapStateToProps = (state) => ({});
export default connect(mapStateToProps)(Default); export default connect(mapStateToProps)(Default);
const data = [ const data = [
{ name: 'yongchu', age: '18', 任务1: 'v1', 计划1: 'time1' }, { name: "yongchu", age: "18", 任务1: "v1", 计划1: "time1" },
{ name: 'yongchu', age: '18', 任务1: 'v1', 计划1: 'time1' }, { name: "yongchu", age: "18", 任务1: "v1", 计划1: "time1" },
{ name: 'yongchu', age: '18', 任务1: 'v1', 计划1: 'time1' }, { name: "yongchu", age: "18", 任务1: "v1", 计划1: "time1" },
{ name: '大王', age: '18', 任务1: 'v1', 计划1: 'time1' }, { name: "大王", age: "18", 任务1: "v1", 计划1: "time1" },
{ name: '大王', age: '18', 任务1: 'v1', 计划1: 'time1' } { name: "大王", age: "18", 任务1: "v1", 计划1: "time1" },
] ];

6
web/client/src/sections/homePage/actions/profile.js

@ -99,7 +99,7 @@ export function getProject() {
type: "post", type: "post",
dispatch: dispatch, dispatch: dispatch,
actionType: "PROJECT", actionType: "PROJECT",
url: ApiTable.getProjectUrl, url: ApiTable.projectUrl,
msg: { option: "获取本周在研项目" }, msg: { option: "获取本周在研项目" },
reducer: { reducer: {
name: "project", name: "project",
@ -113,7 +113,7 @@ export function getPeople() {
type: "post", type: "post",
dispatch: dispatch, dispatch: dispatch,
actionType: "PEOPLE", actionType: "PEOPLE",
url: ApiTable.getPeopleUrl, url: ApiTable.peopleUrl,
msg: { option: "获取人员情况" }, msg: { option: "获取人员情况" },
reducer: { reducer: {
name: "people", name: "people",
@ -127,7 +127,7 @@ export function getWait() {
type: "post", type: "post",
dispatch: dispatch, dispatch: dispatch,
actionType: "WAIT", actionType: "WAIT",
url: ApiTable.getWaitUrl, url: ApiTable.waitUrl,
msg: { option: "获取待研发项目" }, msg: { option: "获取待研发项目" },
reducer: { reducer: {
name: "wait", name: "wait",

154
web/client/src/sections/homePage/containers/index.js

@ -13,7 +13,7 @@ const topImg = "/assets/images/top.png";
const pointImg = "/assets/images/point.png"; const pointImg = "/assets/images/point.png";
function Management(props) { function Management(props) {
const { dispatch, user } = props; const { dispatch, user } = props
const [dataSource, setDataSource] = useState([]) const [dataSource, setDataSource] = useState([])
@ -21,6 +21,17 @@ function Management(props) {
const [peopleData, setPeopleData] = useState([]) const [peopleData, setPeopleData] = useState([])
const [waitData, setWaitData] = useState([]) const [waitData, setWaitData] = useState([])
useEffect(() => {
dispatch(getProject()).then((res) => {
setProjectData(res.payload.data.projects)
})
dispatch(getPeople()).then((res) => {
setPeopleData(res.payload.data.projects)
})
dispatch(getWait()).then((res) => {
setWaitData(res.payload.data.projects)
})
},[])
const projectCol = [ const projectCol = [
{ {
title: '项目名称', title: '项目名称',
@ -32,19 +43,28 @@ function Management(props) {
title: '投入人力', title: '投入人力',
dataIndex: 'part_people', dataIndex: 'part_people',
key: 'part_people', key: 'part_people',
align: 'center' align: 'center',
render: (dom, record) => {
return <div>{record.part_people.map((i, index) => record.part_people.length == 1 ? <span>{i.name_people}</span> : <span>{i.name_people}{index < record.part_people.length-1 ? '':'' }</span>) }</div>
},
}, },
{ {
title: '构建时间', title: '构建时间',
dataIndex: 'build_time', dataIndex: 'build_time',
key: 'build_time', key: 'build_time',
align: 'center' align: 'center',
render: (dom, record) => {
return moment(record.build_time).format('YYYY-MM-DD')
},
}, },
{ {
title: '发布时间', title: '发布时间',
dataIndex: 'publish_time', dataIndex: 'publish_time',
key: 'publish_time', key: 'publish_time',
align: 'center' align: 'center',
render: (dom, record) => {
return moment(record.publish_time).format('YYYY-MM-DD')
},
}, },
{ {
title: '进度', title: '进度',
@ -56,53 +76,80 @@ function Management(props) {
const peopleCol = [ const peopleCol = [
{ {
title: '姓名', title: "人员姓名",
dataIndex: 'name', dataIndex: "name_people",
key: 'name', key: "name_people",
align: 'center' hideInSearch: true,
}, render: (dom, record) => {
{ return record.name_people;
title: '部门', },
dataIndex: 'dept', },
key: 'dept', {
align: 'center' title: "岗位",
}, key: "post_people",
{ dataIndex: "post_people",
title: '11.28', hideInSearch: true,
dataIndex: 'monday', render: (dom, record) => {
key: 'monday', return record.post_people
align: 'center', },
onCell: (record, index) => { },
// console.log("record, index: ", record, index); {
return { title: "周一",
className: "cell-class", key: "md",
colSpan: 2 dataIndex: "md",
}; hideInSearch: true,
} render: (dom, record) => {
}, return record.md
{ },
title: '11.29', },
dataIndex: 'tuesday', {
key: 'tuesday', title: "周二",
align: 'center' key: "td",
}, dataIndex: "td",
{ hideInSearch: true,
title: '11.30', render: (dom, record) => {
dataIndex: 'wednesday', return record.td
key: 'wednesday', },
align: 'center' },{
}, title: "周三",
{ key: "wd",
title: '12.1', dataIndex: "wd",
dataIndex: 'thursday', hideInSearch: true,
key: 'thursday', render: (dom, record) => {
align: 'center' return record.wd
},
},{
title: "周四",
key: "thd ",
dataIndex: "thd ",
hideInSearch: true,
render: (dom, record) => {
return record.thd
},
},{
title: "周五",
key: "fd",
dataIndex: "fd",
hideInSearch: true,
render: (dom, record) => {
return record.fd
},
},{
title: "周六",
key: "sd",
dataIndex: "sd",
hideInSearch: true,
render: (dom, record) => {
return record.sd
},
},{
title: "周日",
key: "ssd",
dataIndex: "ssd",
hideInSearch: true,
render: (dom, record) => {
return record.ssd
}, },
{
title: '12.2',
dataIndex: 'friday',
key: 'friday',
align: 'center'
}, },
]; ];
@ -132,11 +179,6 @@ function Management(props) {
align: 'center' align: 'center'
}, },
]; ];
// useEffect(() => {
// dispatch(getPartyMember()).then((res) => {});
// }, []);
return ( return (
<> <>
<div className={CX("index")}> <div className={CX("index")}>
@ -154,7 +196,7 @@ function Management(props) {
<img className={CX("index-main-box-point")} src={pointImg} /> <img className={CX("index-main-box-point")} src={pointImg} />
<div className={CX("index-main-box-title")}>人员情况</div> <div className={CX("index-main-box-title")}>人员情况</div>
<div className={CX("index-main-box-en")}>/Information on Personnel</div> <div className={CX("index-main-box-en")}>/Information on Personnel</div>
<Table dataSource={dataSource} columns={peopleCol} size="middle" /> <Table dataSource={peopleData} columns={peopleCol} size="middle" />
</div> </div>
<div className={CX("index-main-box")}> <div className={CX("index-main-box")}>
<img className={CX("index-main-box-point")} src={pointImg} /> <img className={CX("index-main-box-point")} src={pointImg} />

12
web/client/src/sections/personnel/actions/article.js

@ -86,3 +86,15 @@ export function postInPeople(articleObj) {
// reducer: { name: "articleInsertInfo" }, // reducer: { name: "articleInsertInfo" },
}); });
} }
export function delCancel(query) {
return (dispatch) =>
basicAction({
type: "post",
dispatch: dispatch,
data: query,
actionType: "DEL_CANCEL",
url: `${ApiTable.delCancel}`,
msg: { error: "删除项目信息失败" },
// reducer: { name: "articleInsertInfo" },
});
}

79
web/client/src/sections/personnel/components/import_model.js

@ -54,17 +54,8 @@ const ImportUser = (props) => {
}) })
}}>下载模板</Button> */} }}>下载模板</Button> */}
<a <a href={`/assets/人员信息.xlsx`} >
href={ <Button size="small" type='primary' >下载模板</Button>
"/_api/" +
`attachments?src=files/用户信息导入模板.xlsx&filename=${encodeURIComponent(
"用户信息导入模板.xlsx"
)}&token=${user.token}`
}
>
<Button size="small" type="primary">
下载模板
</Button>
</a> </a>
<div style={{ marginTop: 10 }}>下载模板后填写完整后上传</div> <div style={{ marginTop: 10 }}>下载模板后填写完整后上传</div>
<div style={{ marginTop: 10 }}> <div style={{ marginTop: 10 }}>
@ -121,46 +112,50 @@ const ImportUser = (props) => {
for (let i = 0; i < res.length; i++) { for (let i = 0; i < res.length; i++) {
let d = res[i]; let d = res[i];
let name_people = String(d["人员姓名"]).trim(); let name_people = String(d["人员姓名"]).trim();
let post_people = String(d["岗位"]).trim(); let post_people = String(d["岗位"]).trim();
let time = String(d["本周计划"]).trim();
let project = String(d["本周任务"]).trim(); let md = String(d["周一"]).trim();
if (!name_people || !post_people || !time || !project) { let td = String(d["周二"]).trim();
let wd = String(d["周三"]).trim();
let thd = String(d["周四"]).trim();
let fd = String(d["周五"]).trim();
let sd = String(d["周六"]).trim();
let ssd = String(d["周日"]).trim();
if (!name_people || !post_people || !md || !td||!wd||!thd||!fd||!sd||!ssd) {
error(`${i + 1} 行有空值,请填写后重新上传`); error(`${i + 1} 行有空值,请填写后重新上传`);
return; return;
} }
postData.push({ postData.push({
name_people, name_people,
post_people, post_people,md,td,wd,thd,fd,sd,ssd
time,
project,
}); });
} }
if (postData.length) { if (postData.length) {
let newArray = postData.reduce((total, cur, index) => { // let newArray = postData.reduce((total, cur, index) => {
let hasValue = total.findIndex((current) => { // let hasValue = total.findIndex((current) => {
return current.name_people === cur.name_people; // return current.name_people === cur.name_people;
}); // });
let obj = { // let obj = {
name_people: cur.name_people, // name_people: cur.name_people,
post_people: cur.post_people, // post_people: cur.post_people,
work: [ // work: [
{ // {
time: cur.time, // time: cur.time,
project: cur.project, // project: cur.project,
}, // },
], // ],
}; // };
let obj1 = { // let obj1 = {
time: cur.time, // time: cur.time,
project: cur.project, // project: cur.project,
}; // };
hasValue === -1 && total.push(obj); // hasValue === -1 && total.push(obj);
hasValue !== -1 && total[hasValue].work.push(obj1); // hasValue !== -1 && total[hasValue].work.push(obj1);
return total; // return total;
}, []); // }, []);
console.log(newArray); // console.log(newArray);
setPostData(newArray); setPostData(postData);
} }
let msg = "文件解析完成,点击确定按钮上传保存!"; let msg = "文件解析完成,点击确定按钮上传保存!";
setMsg(msg); setMsg(msg);

95
web/client/src/sections/personnel/components/modeal.js

@ -12,8 +12,14 @@ function modeal(props) {
name_people: editData.name_people, name_people: editData.name_people,
post_people: editData.post_people, post_people: editData.post_people,
progress: editData.progress, progress: editData.progress,
time:editData.work.map((i)=>i.time), md: editData.md,
project:editData.work.map((i)=>i.project) td: editData.td,
wd: editData.wd,
thd: editData.thd,
fd: editData.fd,
sd: editData.sd,
ssd: editData.ssd,
}) })
} }
@ -46,67 +52,58 @@ function modeal(props) {
> >
<Input/> <Input/>
</Form.Item> </Form.Item>
{/* {editData?.work.map(() => { <Form.Item
return <> <Form.Item label="周一"
label="本周计划" name="md"
name="time"
rules={[{ required: true, message: '请填写工作计划' }]} rules={[{ required: true, message: '请填写工作计划' }]}
> >
<Input/> <Input/>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="本周任务" label="周二"
name="project" name="td"
rules={[{ required: true, message: '请填写工作计划' }]} rules={[{ required: true, message: '请填写工作计划' }]}
> >
<Input/> <Input/>
</Form.Item></>
})} */}
<Form.List name="users">
{(fields, { add, remove }) => (
<>
{editData?.work.map(({ key, name, ...restField }) => (
<Space
key={key}
style={{
display: 'flex',
marginBottom: 8,
}}
align="baseline"
>
<Form.Item
{...restField}
name={[name, 'first']}
rules={[
{
required: true,
message: 'Missing first name',
},
]}
>
<Input placeholder="First Name" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
{...restField} label="周三"
name={[name, 'last']} name="wd"
rules={[ rules={[{ required: true, message: '请填写工作计划' }]}
{
required: true,
message: 'Missing last name',
},
]}
> >
<Input placeholder="Last Name" /> <Input/>
</Form.Item> <Form.Item
label="周四"
name="thd"
rules={[{ required: true, message: '请填写工作计划' }]}
>
<Input/>
</Form.Item> <Form.Item
label="周五"
name="fd"
rules={[{ required: true, message: '请填写工作计划' }]}
>
<Input/>
</Form.Item> <Form.Item
label="周六"
name="sd"
rules={[{ required: true, message: '请填写工作计划' }]}
>
<Input/>
</Form.Item> <Form.Item
label="周日"
name="ssd"
rules={[{ required: true, message: '请填写工作计划' }]}
>
<Input/>
</Form.Item> </Form.Item>
</Space>
))}
<Form.Item>
</Form.Item>
</>
)}
</Form.List>
<Form.Item noStyle={true}> <Form.Item noStyle={true}>
<div style={{ <div style={{
padding: '12px 0', padding: '12px 0',

100
web/client/src/sections/personnel/containers/index.js

@ -3,7 +3,7 @@ import React, { useEffect, useState, useRef } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Button, Popconfirm } from "antd"; import { Button, Popconfirm } from "antd";
import ProTable from "@ant-design/pro-table"; import ProTable from "@ant-design/pro-table";
import {postOutPeople} from "../actions/article"; import {postOutPeople,postInPeople,delCancel} from "../actions/article";
import moment from "moment"; import moment from "moment";
import { push } from "react-router-redux"; import { push } from "react-router-redux";
import { Scroller } from "$components"; import { Scroller } from "$components";
@ -21,7 +21,6 @@ export const Default = (props) => {
const [importVisible, setImportVisible] = useState(false); //弹窗 const [importVisible, setImportVisible] = useState(false); //弹窗
const tableActionRef = useRef(); const tableActionRef = useRef();
const dataSore = [{ name_project: '企服v1.0.1', part_people: '投入研发3、测试1', build_time: new Date( ), publish_time: new Date( ), progress: '研发中' }]
const columns = [ const columns = [
{ {
title: "人员姓名", title: "人员姓名",
@ -42,14 +41,61 @@ export const Default = (props) => {
}, },
}, },
{ {
title: "本周工作计划", title: "周一",
key: "work", key: "md",
dataIndex: "work", dataIndex: "md",
hideInSearch: true, hideInSearch: true,
render: (dom, record) => { render: (dom, record) => {
return <div>{record?.work?.map((item) => { return record.md
return <div><span>{item.time}</span><span>{item.project }</span></div> },
})}</div> },
{
title: "周二",
key: "td",
dataIndex: "td",
hideInSearch: true,
render: (dom, record) => {
return record.td
},
},{
title: "周三",
key: "wd",
dataIndex: "wd",
hideInSearch: true,
render: (dom, record) => {
return record.wd
},
},{
title: "周四",
key: "thd ",
dataIndex: "thd ",
hideInSearch: true,
render: (dom, record) => {
return record.thd
},
},{
title: "周五",
key: "fd",
dataIndex: "fd",
hideInSearch: true,
render: (dom, record) => {
return record.fd
},
},{
title: "周六",
key: "sd",
dataIndex: "sd",
hideInSearch: true,
render: (dom, record) => {
return record.sd
},
},{
title: "周日",
key: "ssd",
dataIndex: "ssd",
hideInSearch: true,
render: (dom, record) => {
return record.ssd
}, },
}, },
{ {
@ -71,7 +117,7 @@ export const Default = (props) => {
<Popconfirm <Popconfirm
title="确认删除?" title="确认删除?"
onConfirm={() => { onConfirm={() => {
delDataList(record.id); delDataList(record);
}} }}
> >
<Button type="link">删除</Button> <Button type="link">删除</Button>
@ -103,19 +149,44 @@ export const Default = (props) => {
]; ];
const handleCancel = () => { const handleCancel = () => {
setVisible(false) setVisible(false)
tableActionRef.current.reload();
} }
const handOk = () => { const handOk = (values) => {
const query = [{
name_people: values.name_people,
post_people: values.post_people,
md: values.md,
td: values.td,
wd: values.wd,
thd: values.thd,
fd: values.fd,
sd: values.sd,
ssd: values.ssd,
o_name_people:editData?.name_people,
}];
dispatch(postInPeople(query)).then((res) => {
if (res.success) {
handleCancel();
// tableActionRef.current.reload();
}
});
} }
const importHandleCancel = () => { const importHandleCancel = () => {
setImportVisible(false) setImportVisible(false)
tableActionRef.current.reload();
} }
//删除资讯 //删除资讯
const delDataList = (ids, type) => { const delDataList = (record) => {
dispatch(Action.delDataList(ids)).then((res) => { const query = {
delete: record?.name_people,
delete_state: record?.post_people,
table_name: "test_people",
};
dispatch(delCancel(query)).then((res) => {
if (res.success) { if (res.success) {
// 刷新 // 刷新
tableActionRef.current.reload(); // tableActionRef.current.reload();
handleCancel()
} }
}); });
}; };
@ -137,7 +208,6 @@ export const Default = (props) => {
collapsed: false, collapsed: false,
}} }}
request={async(params) => { request={async(params) => {
console.log(params)
const res = await dispatch(postOutPeople()); const res = await dispatch(postOutPeople());
setCounts(res.payload.data.projects); setCounts(res.payload.data.projects);

56
web/client/src/sections/wait/actions/article.js

@ -3,62 +3,38 @@ import { ApiTable } from "$utils";
import { Request } from "@peace/utils"; import { Request } from "@peace/utils";
import { basicAction } from "@peace/utils"; import { basicAction } from "@peace/utils";
export function addArticle(articleObj) { export function postWaitUrl(articleObj) {
return (dispatch) => return (dispatch) =>
basicAction({ basicAction({
type: "post", type: "post",
dispatch: dispatch, dispatch: dispatch,
data: articleObj, data: articleObj,
actionType: "ADD_ARTICLE", actionType: "POST_WAITURL",
url: `${ApiTable.addArticle}`, url: `${ApiTable.waitUrl}`,
msg: { error: "新增文章失败" }, msg: { error: "获取项目失败" },
reducer: { name: "articleInsertInfo" },
}); });
} }
export function postInWait(articleObj) {
export function editArticle(articleObj) {
return (dispatch) => return (dispatch) =>
basicAction({ basicAction({
type: "put", type: "post",
dispatch: dispatch, dispatch: dispatch,
data: articleObj, data: articleObj,
actionType: "EDIT_ARTICLE", actionType: "POST_INWAIT",
url: `${ApiTable.addArticle}`, url: `${ApiTable.postInWait}`,
msg: { error: "编辑文章失败" }, msg: { error: "添加项目失败" },
reducer: { name: "articleInsertInfo" },
}); });
} }
export function getDataList(query) { export function delCancel(query) {
return (dispatch) => return (dispatch) =>
basicAction({ basicAction({
type: "get", type: "post",
dispatch: dispatch, dispatch: dispatch,
actionType: "GET_DATALIST", data: query,
url: ApiTable.getDataList, actionType: "DEL_CANCEL",
query: query, url: `${ApiTable.delCancel}`,
msg: { error: "获取文章信息失败" }, msg: { error: "删除项目信息失败" },
reducer: { // reducer: { name: "articleInsertInfo" },
name: "articlesfrom",
},
}); });
} }
export function delDataList(id) {
return (dispatch) =>
basicAction({
type: "del",
dispatch: dispatch,
actionType: "DEL_DATALIST11",
url: ApiTable.delDataList + `?id=${id}`,
query: { id: id },
msg: { error: "删除文章信息失败" },
});
}
export const MODIFYARTICAL = {
REQUEST_SUCCESS: "MODIFY_ARTICAL_SUCCESS",
};
export function setModifyData(data) {
return (dispatch) => {
dispatch({ type: MODIFYARTICAL.REQUEST_SUCCESS, payload: { data } });
};
}

2
web/client/src/sections/wait/components/import_model.js

@ -53,7 +53,7 @@ const ImportUser = props => {
}) })
}}>下载模板</Button> */} }}>下载模板</Button> */}
<a href={'/_api/' + `attachments?src=files/用户信息导入模板.xlsx&filename=${encodeURIComponent('用户信息导入模板.xlsx')}&token=${user.token}`} > <a href={`/assets/人员信息.xlsx`} >
<Button size="small" type='primary' >下载模板</Button> <Button size="small" type='primary' >下载模板</Button>
</a> </a>
<div style={{ marginTop: 10 }}>下载模板后填写完整后上传</div> <div style={{ marginTop: 10 }}>下载模板后填写完整后上传</div>

43
web/client/src/sections/wait/components/modeal.js

@ -3,19 +3,21 @@ import { Modal, Form, Input, Button,DatePicker,Select } from 'antd'
import dayjs from 'dayjs'; import dayjs from 'dayjs';
function modeal(props) { function modeal(props) {
const [form] = Form.useForm(); const [form] = Form.useForm();
const { visible, handleOk, handleCancel, editData } = props const { visible, handleOk, handleCancel, editData ,setEditData,setState} = props
console.log(editData) console.log(editData)
useEffect(() => { useEffect(() => {
if (editData && visible) { if (editData && visible) {
form.setFieldsValue({ form.setFieldsValue({
name_project: editData.name_project, name_project: editData.name_project,
part_people: editData.part_people, from_project: editData.from_project,
build_time: dayjs(editData?.build_time), contacts: editData.contacts,
publish_time: dayjs(editData.publish_time),
progress:editData.progress progress:editData.progress
}) })
setState(true)
} }
}, [editData, visible]) }, [editData, visible])
return ( return (
<Modal <Modal
visible={visible} visible={visible}
@ -31,32 +33,25 @@ function modeal(props) {
autoComplete="off" autoComplete="off"
> >
<Form.Item <Form.Item
label="项目计划" label="项目"
name="name_project" name="name_project"
rules={[{ required: true, message: '请输入项目计划' }]} rules={[{ required: true, message: '请输入项目' }]}
> >
<Input/> <Input/>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="投入人力" label="需求来源"
name="part_people" name="from_project"
rules={[{ required: true, message: '请输入人员姓名' }]} rules={[{ required: true, message: '请输入来源' }]}
> >
<Input/> <Input/>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="构建时间" label="对接人"
name="build_time" name="contacts"
rules={[{ required: true, message: '请选择时间' }]} rules={[{ required: true, message: '请输入对接人' }]}
>
<DatePicker />
</Form.Item>
<Form.Item
label="发布时间"
name="publish_time"
rules={[{ required: true, message: '请选择时间' }]}
> >
<DatePicker /> <Input/>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="目前进度" label="目前进度"
@ -77,13 +72,17 @@ function modeal(props) {
}}> }}>
<Button <Button
style={{ marginRight: 16, width: 88 }} style={{ marginRight: 16, width: 88 }}
onClick={handleCancel} onClick={(() => {
// cancel()
handleCancel()
setEditData([])
})}
>取消</Button> >取消</Button>
<Button <Button
htmlType="submit" htmlType="submit"
type="primary" type="primary"
style={{ marginRight: 16, width: 88 }} style={{ marginRight: 16, width: 88 }}
// onClick={() => handleOk(form)} // onClick={() => cancel()}
>确定</Button> >确定</Button>
</div> </div>
</Form.Item> </Form.Item>

135
web/client/src/sections/wait/containers/index.js

@ -3,25 +3,21 @@ import React, { useEffect, useState, useRef } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Button, Popconfirm } from "antd"; import { Button, Popconfirm } from "antd";
import ProTable from "@ant-design/pro-table"; import ProTable from "@ant-design/pro-table";
import Action from "../actions/index"; import { postWaitUrl, postInWait,delCancel } from "../actions/article";
import moment from "moment"; import moment from "moment";
import { push } from "react-router-redux"; import { push } from "react-router-redux";
import { Scroller } from "$components"; import { Scroller } from "$components";
import ProjectModeal from '../components/modeal' import ProjectModeal from "../components/modeal";
import ImportModeal from '../components/import_model' import ImportModeal from "../components/import_model";
export const Default = (props) => { export const Default = (props) => {
const { dispatch } = props; const { dispatch } = props;
const [heading, setHeading] = useState(); //标题 const [state, setState] = useState(false); //状态
const [state, setState] = useState(); //状态
const [day, setDay] = useState(); //发布时间
const [counts, setCounts] = useState(); //数据 const [counts, setCounts] = useState(); //数据
const [visible, setVisible] = useState(false); //弹窗 const [visible, setVisible] = useState(false); //弹窗
const [editData, setEditData] = useState(); //数据 const [editData, setEditData] = useState(); //数据
const [importVisible, setImportVisible] = useState(false); //弹窗
const tableActionRef = useRef(); const tableActionRef = useRef();
const dataSore = [{ name_project: '企服v1.0.1', part_people: '投入研发3、测试1', build_time: new Date(), publish_time: new Date(), progress: '研发中' }]
const columns = [ const columns = [
{ {
title: "项目", title: "项目",
@ -38,7 +34,7 @@ export const Default = (props) => {
dataIndex: "from_project", dataIndex: "from_project",
hideInSearch: true, hideInSearch: true,
render: (dom, record) => { render: (dom, record) => {
return record.part_people return record.from_project;
}, },
}, },
{ {
@ -47,14 +43,15 @@ export const Default = (props) => {
dataIndex: "contacts", dataIndex: "contacts",
hideInSearch: true, hideInSearch: true,
render: (dom, record) => { render: (dom, record) => {
return moment(record.build_time).format('YYYY-MM-DD') return record.contacts;
}, },
}, },
{ {
title: '处理进度', title: "处理进度",
dataIndex: 'progress', dataIndex: "progress",
key: 'progress', key: "progress",
align: 'center' align: "center",
hideInSearch: true,
}, },
{ {
title: "操作", title: "操作",
@ -75,14 +72,13 @@ export const Default = (props) => {
<Popconfirm <Popconfirm
title="确认删除?" title="确认删除?"
onConfirm={() => { onConfirm={() => {
delDataList(record.id); delDataList(record);
}} }}
> >
<Button type="link">删除</Button> <Button type="link">删除</Button>
</Popconfirm> </Popconfirm>
</div> </div>
) );
}, },
}, },
{ {
@ -96,37 +92,72 @@ export const Default = (props) => {
type="primary" type="primary"
style={{ width: "200px" }} style={{ width: "200px" }}
onClick={() => { onClick={() => {
setImportVisible(true) editor();
}} }}
> >
项目信息导入 添加
</Button> </Button>
); );
}, },
}, },
]; ];
const handleCancel = () => { const handleCancel = () => {
setVisible(false) tableActionRef.current.reload();
setVisible(false);
};
const handOk = (values) => {
let query = null;
if (state) {
query = [
{
name_project: values.name_project,
from_project: values.from_project,
contacts: values.contacts,
progress: values.progress,
o_name_project: editData?.name_project,
},
];
} else {
query = [
{
name_project: values.name_project,
from_project: values.from_project,
contacts: values.contacts,
progress: values.progress,
},
];
} }
const handOk = () => {
dispatch(postInWait(query)).then((res) => {
if (res.success) {
handleCancel();
setEditData([]);
tableActionRef.current.reload();
} }
const importHandleCancel = () => { });
setImportVisible(false) };
}
//删除资讯 //删除资讯
const delDataList = (ids, type) => { const delDataList = (record) => {
dispatch(Action.delDataList(ids)).then((res) => { const query = {
delete: record.name_project,
delete_state: record.progress,
table_name: "test_waiting",
};
dispatch(delCancel(query)).then((res) => {
if (res.success) { if (res.success) {
// 刷新 // 刷新
tableActionRef.current.reload(); // tableActionRef.current.reload();
handleCancel()
} }
}); });
}; };
//编辑 //编辑
const editor = (record) => { const editor = (record) => {
setVisible(true) if (record) {
setEditData(record) setEditData(record);
}
setVisible(true);
}; };
return ( return (
<div style={{ height: "100%" }}> <div style={{ height: "100%" }}>
@ -135,28 +166,14 @@ export const Default = (props) => {
actionRef={tableActionRef} actionRef={tableActionRef}
columns={columns} columns={columns}
options={false} options={false}
dataSource={dataSore} dataSource={counts || []}
search={{ search={{
optionRender: false, optionRender: false,
collapsed: false, collapsed: false,
}} }}
request={async (params) => { request={async (params) => {
let query = { const res = await dispatch(postWaitUrl());
type: -1, setCounts(res.payload.data.projects);
searchValue: heading,
status: state,
page: params.current,
limit: params.pageSize,
publishTime:
day && day.length && day[0].trim() != ""
? JSON.stringify([
moment(day[0]).startOf("day"),
moment(day[1]).endOf("day"),
])
: null,
};
const res = await dispatch(Action.getDataList(query));
setCounts(res.payload.data);
return { return {
...res, ...res,
total: res.payload.data ? res.payload.data.total : 0, total: res.payload.data ? res.payload.data.total : 0,
@ -168,8 +185,15 @@ export const Default = (props) => {
}} }}
/> />
</Scroller> </Scroller>
<ProjectModeal visible={visible} handleOk={handOk} editData={editData} handleCancel={handleCancel}></ProjectModeal> <ProjectModeal
<ImportModeal importVisible={importVisible} handleCancel={importHandleCancel} editData={editData}></ImportModeal> visible={visible}
handleOk={handOk}
editData={editData}
handleCancel={handleCancel}
setEditData={setEditData}
setState={setState}
></ProjectModeal>
</div> </div>
); );
}; };
@ -182,11 +206,10 @@ const mapStateToProps = (state) => ({});
export default connect(mapStateToProps)(Default); export default connect(mapStateToProps)(Default);
const data = [ const data = [
{ name: 'yongchu', age: '18', 任务1: 'v1', 计划1: 'time1' }, { name: "yongchu", age: "18", 任务1: "v1", 计划1: "time1" },
{ name: 'yongchu', age: '18', 任务1: 'v1', 计划1: 'time1' }, { name: "yongchu", age: "18", 任务1: "v1", 计划1: "time1" },
{ name: 'yongchu', age: '18', 任务1: 'v1', 计划1: 'time1' }, { name: "yongchu", age: "18", 任务1: "v1", 计划1: "time1" },
{ name: '大王', age: '18', 任务1: 'v1', 计划1: 'time1' }, { name: "大王", age: "18", 任务1: "v1", 计划1: "time1" },
{ name: '大王', age: '18', 任务1: 'v1', 计划1: 'time1' } { name: "大王", age: "18", 任务1: "v1", 计划1: "time1" },
] ];

10
web/client/src/utils/webapi.js

@ -8,11 +8,11 @@ export const ApiTable = {
waitUrl: "outWait", // 待研项目 waitUrl: "outWait", // 待研项目
postInProject:'inProject', // 增加项目 postInProject:'inProject', // 增加项目
postInPeople: 'inPeople',//增加人员任务 postInPeople: 'inPeople',//增加人员任务
//支委会人员信息 postInWait: 'inWait',//增加人员任务
getCommittee: "partyOrganizations", //获取支委会人员
postCommittee: "partyOrganization", //新增 delCancel: 'deleteDB', //删除信息
putCommittee: "partyOrganization/:id", //修改 //下载项目模板
apiRoot: 'query/api/root', getDownProject:'downProject'
}; };
export const RouteTable = { export const RouteTable = {

Loading…
Cancel
Save