|
|
@ -3,12 +3,12 @@ import React, { useEffect, useState, useRef } from "react"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import { Button, Popconfirm } from "antd"; |
|
|
|
import ProTable from "@ant-design/pro-table"; |
|
|
|
import {postOutPeople,postInPeople,delCancel} from "../actions/article"; |
|
|
|
import { postOutPeople, postInPeople, delCancel } from "../actions/article"; |
|
|
|
import moment from "moment"; |
|
|
|
import { push } from "react-router-redux"; |
|
|
|
import { Scroller } from "$components"; |
|
|
|
import ProjectModeal from '../components/modeal' |
|
|
|
import ImportModeal from '../components/import_model' |
|
|
|
import ProjectModeal from "../components/modeal"; |
|
|
|
import ImportModeal from "../components/import_model"; |
|
|
|
|
|
|
|
export const Default = (props) => { |
|
|
|
const { dispatch } = props; |
|
|
@ -37,7 +37,7 @@ export const Default = (props) => { |
|
|
|
dataIndex: "post_people", |
|
|
|
hideInSearch: true, |
|
|
|
render: (dom, record) => { |
|
|
|
return record.post_people |
|
|
|
return record.post_people; |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
@ -46,7 +46,7 @@ export const Default = (props) => { |
|
|
|
dataIndex: "md", |
|
|
|
hideInSearch: true, |
|
|
|
render: (dom, record) => { |
|
|
|
return record.md |
|
|
|
return record.md; |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
@ -55,47 +55,52 @@ export const Default = (props) => { |
|
|
|
dataIndex: "td", |
|
|
|
hideInSearch: true, |
|
|
|
render: (dom, record) => { |
|
|
|
return record.td |
|
|
|
return record.td; |
|
|
|
}, |
|
|
|
},{ |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "周三", |
|
|
|
key: "wd", |
|
|
|
dataIndex: "wd", |
|
|
|
hideInSearch: true, |
|
|
|
render: (dom, record) => { |
|
|
|
return record.wd |
|
|
|
return record.wd; |
|
|
|
}, |
|
|
|
},{ |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "周四", |
|
|
|
key: "thd ", |
|
|
|
dataIndex: "thd ", |
|
|
|
hideInSearch: true, |
|
|
|
render: (dom, record) => { |
|
|
|
return record.thd |
|
|
|
return record.thd; |
|
|
|
}, |
|
|
|
},{ |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "周五", |
|
|
|
key: "fd", |
|
|
|
dataIndex: "fd", |
|
|
|
hideInSearch: true, |
|
|
|
render: (dom, record) => { |
|
|
|
return record.fd |
|
|
|
return record.fd; |
|
|
|
}, |
|
|
|
},{ |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "周六", |
|
|
|
key: "sd", |
|
|
|
dataIndex: "sd", |
|
|
|
hideInSearch: true, |
|
|
|
render: (dom, record) => { |
|
|
|
return record.sd |
|
|
|
return record.sd; |
|
|
|
}, |
|
|
|
},{ |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "周日", |
|
|
|
key: "ssd", |
|
|
|
dataIndex: "ssd", |
|
|
|
hideInSearch: true, |
|
|
|
render: (dom, record) => { |
|
|
|
return record.ssd |
|
|
|
return record.ssd; |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
@ -123,8 +128,7 @@ export const Default = (props) => { |
|
|
|
<Button type="link">删除</Button> |
|
|
|
</Popconfirm> |
|
|
|
</div> |
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
@ -138,7 +142,7 @@ export const Default = (props) => { |
|
|
|
type="primary" |
|
|
|
style={{ width: "200px" }} |
|
|
|
onClick={() => { |
|
|
|
setImportVisible(true) |
|
|
|
setImportVisible(true); |
|
|
|
}} |
|
|
|
> |
|
|
|
项目信息导入 |
|
|
@ -148,33 +152,36 @@ export const Default = (props) => { |
|
|
|
}, |
|
|
|
]; |
|
|
|
const handleCancel = () => { |
|
|
|
setVisible(false) |
|
|
|
setVisible(false); |
|
|
|
tableActionRef.current.reload(); |
|
|
|
} |
|
|
|
}; |
|
|
|
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, |
|
|
|
}]; |
|
|
|
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(); |
|
|
|
console.log(res); |
|
|
|
// tableActionRef.current.reload();
|
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
const importHandleCancel = () => { |
|
|
|
setImportVisible(false) |
|
|
|
setImportVisible(false); |
|
|
|
tableActionRef.current.reload(); |
|
|
|
} |
|
|
|
}; |
|
|
|
//删除资讯
|
|
|
|
const delDataList = (record) => { |
|
|
|
const query = { |
|
|
@ -186,30 +193,30 @@ export const Default = (props) => { |
|
|
|
if (res.success) { |
|
|
|
// 刷新
|
|
|
|
// tableActionRef.current.reload();
|
|
|
|
handleCancel() |
|
|
|
handleCancel(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
//编辑
|
|
|
|
const editor = (record) => { |
|
|
|
setVisible(true) |
|
|
|
setEditData(record) |
|
|
|
setVisible(true); |
|
|
|
setEditData(record); |
|
|
|
}; |
|
|
|
return ( |
|
|
|
<div style={{ height: "100%" }}> |
|
|
|
<Scroller containerId={"article-container-query"} height={"100%"}> |
|
|
|
<ProTable |
|
|
|
<ProTable |
|
|
|
actionRef={tableActionRef} |
|
|
|
columns={columns} |
|
|
|
options={false} |
|
|
|
dataSource={counts||[]} |
|
|
|
dataSource={counts || []} |
|
|
|
search={{ |
|
|
|
optionRender: false, |
|
|
|
collapsed: false, |
|
|
|
}} |
|
|
|
request={async(params) => { |
|
|
|
request={async (params) => { |
|
|
|
const res = await dispatch(postOutPeople()); |
|
|
|
|
|
|
|
|
|
|
|
setCounts(res.payload.data.projects); |
|
|
|
return { |
|
|
|
...res, |
|
|
@ -222,8 +229,17 @@ export const Default = (props) => { |
|
|
|
}} |
|
|
|
/> |
|
|
|
</Scroller> |
|
|
|
<ProjectModeal visible={visible} handleOk={handOk} editData={editData} handleCancel={handleCancel}></ProjectModeal> |
|
|
|
<ImportModeal importVisible={importVisible} handleCancel={importHandleCancel} editData={editData}></ImportModeal> |
|
|
|
<ProjectModeal |
|
|
|
visible={visible} |
|
|
|
handleOk={handOk} |
|
|
|
editData={editData} |
|
|
|
handleCancel={handleCancel} |
|
|
|
></ProjectModeal> |
|
|
|
<ImportModeal |
|
|
|
importVisible={importVisible} |
|
|
|
handleCancel={importHandleCancel} |
|
|
|
editData={editData} |
|
|
|
></ImportModeal> |
|
|
|
</div> |
|
|
|
); |
|
|
|
}; |
|
|
@ -236,11 +252,10 @@ const mapStateToProps = (state) => ({}); |
|
|
|
|
|
|
|
export default connect(mapStateToProps)(Default); |
|
|
|
|
|
|
|
|
|
|
|
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: '大王', age: '18', 任务1: 'v1', 计划1: 'time1' }, |
|
|
|
{ name: '大王', 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" }, |
|
|
|
]; |
|
|
|