Browse Source

提交编辑增加问题

master
xingyongchun 2 years ago
parent
commit
ac43f9604b
  1. 3
      web/client/src/sections/article/components/import_model.js
  2. 7
      web/client/src/sections/homePage/containers/index.js
  3. 3
      web/client/src/sections/personnel/components/import_model.js
  4. 1
      web/client/src/sections/personnel/components/modeal.js
  5. 97
      web/client/src/sections/personnel/containers/index.js
  6. 8
      web/client/src/sections/wait/components/modeal.js
  7. 3
      web/client/src/sections/wait/containers/index.js

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

@ -120,6 +120,7 @@ const ImportUser = (props) => {
let build_time = String(d["构建时间"]).trim(); let build_time = String(d["构建时间"]).trim();
let publish_time = String(d["发布时间"]).trim(); let publish_time = String(d["发布时间"]).trim();
let progress = String(d["目前进度"]).trim(); let progress = String(d["目前进度"]).trim();
let o_name_project=''
if (!name_project || !part_people_in || !build_time || !publish_time||!progress) { if (!name_project || !part_people_in || !build_time || !publish_time||!progress) {
error(`${i + 1} 行有空值,请填写后重新上传`); error(`${i + 1} 行有空值,请填写后重新上传`);
return; return;
@ -132,7 +133,7 @@ const ImportUser = (props) => {
name_project, name_project,
part_people, part_people,
build_time, build_time,
publish_time,progress publish_time,progress,o_name_project
}); });
} }
if (postData.length) { if (postData.length) {

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

@ -99,6 +99,7 @@ function Management(props) {
key: "md", key: "md",
dataIndex: "md", dataIndex: "md",
hideInSearch: true, hideInSearch: true,
width: 150,
render: (dom, record) => { render: (dom, record) => {
return record.md return record.md
}, },
@ -196,15 +197,15 @@ function Management(props) {
<div className={CX("index-main-box-title")}>本周在研项目</div> <div className={CX("index-main-box-title")}>本周在研项目</div>
<div className={CX("index-main-box-en")}>/Research project this week</div> <div className={CX("index-main-box-en")}>/Research project this week</div>
<Spin spinning={false}> <Spin spinning={false}>
<Table dataSource={projectData} columns={projectCol} size="middle" pagination={false} scroll={{x:500}}/> <Table dataSource={projectData} columns={projectCol} size="middle" pagination={false} scroll={{x:800}}/>
</Spin> </Spin>
</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} />
<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>
<Scroller containerId={"article-container-query"} height={"80%"}> <Scroller containerId={"article-container-query"} height={"90%"}>
<Table dataSource={peopleData} columns={peopleCol} size="middle" pagination={false} scroll={{ x: 500 }} /> <Table dataSource={peopleData} columns={peopleCol} size="middle" pagination={false} scroll={{ x: 1000 }} />
</Scroller> </Scroller>
</div> </div>

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

@ -121,13 +121,14 @@ const ImportUser = (props) => {
let fd = String(d["周五"]).trim(); let fd = String(d["周五"]).trim();
let sd = String(d["周六"]).trim(); let sd = String(d["周六"]).trim();
let ssd = String(d["周日"]).trim(); let ssd = String(d["周日"]).trim();
let o_name_people=''
if (!name_people || !post_people || !md || !td||!wd||!thd||!fd||!sd||!ssd) { 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,md,td,wd,thd,fd,sd,ssd post_people,md,td,wd,thd,fd,sd,ssd,o_name_people
}); });
} }

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

@ -5,7 +5,6 @@ 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 } = props
console.log(editData)
useEffect(() => { useEffect(() => {
if (editData && visible) { if (editData && visible) {
form.setFieldsValue({ form.setFieldsValue({

97
web/client/src/sections/personnel/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 {postOutPeople,postInPeople,delCancel} 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";
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;
@ -37,7 +37,7 @@ export const Default = (props) => {
dataIndex: "post_people", dataIndex: "post_people",
hideInSearch: true, hideInSearch: true,
render: (dom, record) => { render: (dom, record) => {
return record.post_people return record.post_people;
}, },
}, },
{ {
@ -46,7 +46,7 @@ export const Default = (props) => {
dataIndex: "md", dataIndex: "md",
hideInSearch: true, hideInSearch: true,
render: (dom, record) => { render: (dom, record) => {
return record.md return record.md;
}, },
}, },
{ {
@ -55,47 +55,52 @@ export const Default = (props) => {
dataIndex: "td", dataIndex: "td",
hideInSearch: true, hideInSearch: true,
render: (dom, record) => { render: (dom, record) => {
return record.td return record.td;
}, },
},{ },
{
title: "周三", title: "周三",
key: "wd", key: "wd",
dataIndex: "wd", dataIndex: "wd",
hideInSearch: true, hideInSearch: true,
render: (dom, record) => { render: (dom, record) => {
return record.wd return record.wd;
},
}, },
},{ {
title: "周四", title: "周四",
key: "thd ", key: "thd ",
dataIndex: "thd ", dataIndex: "thd ",
hideInSearch: true, hideInSearch: true,
render: (dom, record) => { render: (dom, record) => {
return record.thd return record.thd;
},
}, },
},{ {
title: "周五", title: "周五",
key: "fd", key: "fd",
dataIndex: "fd", dataIndex: "fd",
hideInSearch: true, hideInSearch: true,
render: (dom, record) => { render: (dom, record) => {
return record.fd return record.fd;
}, },
},{ },
{
title: "周六", title: "周六",
key: "sd", key: "sd",
dataIndex: "sd", dataIndex: "sd",
hideInSearch: true, hideInSearch: true,
render: (dom, record) => { render: (dom, record) => {
return record.sd return record.sd;
},
}, },
},{ {
title: "周日", title: "周日",
key: "ssd", key: "ssd",
dataIndex: "ssd", dataIndex: "ssd",
hideInSearch: true, hideInSearch: true,
render: (dom, record) => { render: (dom, record) => {
return record.ssd return record.ssd;
}, },
}, },
{ {
@ -123,8 +128,7 @@ export const Default = (props) => {
<Button type="link">删除</Button> <Button type="link">删除</Button>
</Popconfirm> </Popconfirm>
</div> </div>
) );
}, },
}, },
{ {
@ -138,7 +142,7 @@ export const Default = (props) => {
type="primary" type="primary"
style={{ width: "200px" }} style={{ width: "200px" }}
onClick={() => { onClick={() => {
setImportVisible(true) setImportVisible(true);
}} }}
> >
项目信息导入 项目信息导入
@ -148,11 +152,12 @@ export const Default = (props) => {
}, },
]; ];
const handleCancel = () => { const handleCancel = () => {
setVisible(false) setVisible(false);
tableActionRef.current.reload(); tableActionRef.current.reload();
} };
const handOk = (values) => { const handOk = (values) => {
const query = [{ const query = [
{
name_people: values.name_people, name_people: values.name_people,
post_people: values.post_people, post_people: values.post_people,
md: values.md, md: values.md,
@ -162,19 +167,21 @@ export const Default = (props) => {
fd: values.fd, fd: values.fd,
sd: values.sd, sd: values.sd,
ssd: values.ssd, ssd: values.ssd,
o_name_people:editData?.name_people, o_name_people: editData?.name_people,
}]; },
];
dispatch(postInPeople(query)).then((res) => { dispatch(postInPeople(query)).then((res) => {
if (res.success) { if (res.success) {
handleCancel(); handleCancel();
console.log(res);
// tableActionRef.current.reload(); // tableActionRef.current.reload();
} }
}); });
} };
const importHandleCancel = () => { const importHandleCancel = () => {
setImportVisible(false) setImportVisible(false);
tableActionRef.current.reload(); tableActionRef.current.reload();
} };
//删除资讯 //删除资讯
const delDataList = (record) => { const delDataList = (record) => {
const query = { const query = {
@ -186,14 +193,14 @@ export const Default = (props) => {
if (res.success) { if (res.success) {
// 刷新 // 刷新
// tableActionRef.current.reload(); // tableActionRef.current.reload();
handleCancel() 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%" }}>
@ -202,12 +209,12 @@ export const Default = (props) => {
actionRef={tableActionRef} actionRef={tableActionRef}
columns={columns} columns={columns}
options={false} options={false}
dataSource={counts||[]} dataSource={counts || []}
search={{ search={{
optionRender: false, optionRender: false,
collapsed: false, collapsed: false,
}} }}
request={async(params) => { request={async (params) => {
const res = await dispatch(postOutPeople()); const res = await dispatch(postOutPeople());
setCounts(res.payload.data.projects); setCounts(res.payload.data.projects);
@ -222,8 +229,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>
); );
}; };
@ -236,11 +252,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" },
] ];

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

@ -63,13 +63,9 @@ function modeal(props) {
<Form.Item <Form.Item
label="目前进度" label="目前进度"
name="progress" name="progress"
rules={[{ required: true, message: '请选择进度' }]} rules={[{ required: true, message: '请填写进度' }]}
> >
<Select><Select.Option value="需求评审中">需求评审中</Select.Option> <Input/>
<Select.Option value="研发中">研发中</Select.Option>
<Select.Option value="测试中">测试中</Select.Option>
<Select.Option value="已发布">已发布</Select.Option>
</Select>
</Form.Item> </Form.Item>
<Form.Item noStyle={true}> <Form.Item noStyle={true}>
<div style={{ <div style={{

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

@ -48,7 +48,8 @@ export const Default = (props) => {
title: '评估工时', title: '评估工时',
dataIndex: 'consum_time', dataIndex: 'consum_time',
key: 'consum_time', key: 'consum_time',
align: 'center' align: 'center',
hideInSearch: true,
}, },
{ {
title: "处理进度", title: "处理进度",

Loading…
Cancel
Save