修改bug

This commit is contained in:
何童崇 2021-07-13 16:29:56 +08:00
parent bdf3a8e72a
commit 16aac3b835
5 changed files with 203 additions and 166 deletions

View File

@ -138,7 +138,7 @@ export default Form.create()((props) => {
{item.createdAt}
</p>
<ul className="df">
<li key={1} className="with35 edu-txt-left font-16 font-bd" style={{ justifyContent: "left" }}>
<li key={1} className="mytask-title with35 edu-txt-left font-16 font-bd" >
<Link className="color-grey3 font-16 font-bd" to={`/task/taskDetail/${item.id}`}>{item.name}</Link>
{item.status === 4 && <span className="list_status ml10">待确认</span>}
{item.status === 6 && <span className="list_status s_orange ml10">待签订协议</span>}

View File

@ -6,7 +6,6 @@
color: #656565;
text-align: center;
margin-bottom: 10px;
}
.needs_condition_content {
@ -25,6 +24,14 @@
align-items: center;
display: -webkit-flex;
}
.mytask-title {
align-items: start;
justify-content: left;
span{
flex: 0 0 auto;
}
}
}
.list_status {
@ -40,9 +47,9 @@
}
.s_orange {
background: #FFB121;
background: #ffb121;
}
.needs_condition_content_t {
height: 40px;
padding: 0px 20px;
@ -69,18 +76,17 @@
align-items: center;
}
.vertical-radio{
.ant-radio-wrapper{
.vertical-radio {
.ant-radio-wrapper {
display: flex;
line-height: 2rem;
align-items: flex-start;
.ant-radio{
margin-top:.5rem;
.ant-radio {
margin-top: 0.5rem;
}
p{
p {
white-space: normal;
word-break: break-all;
}
}
}

View File

@ -6,6 +6,7 @@ import { readyCheckPapers, proofAdd } from "../../api";
import { httpUrl } from 'military/fetch';
import '../../index.scss';
import './index.scss';
import { func } from 'prop-types';
export default Form.create()(props => {
@ -97,127 +98,136 @@ export default Form.create()(props => {
title: '操作',
dataIndex: 'action',
render: (text, record) => {
return <Link className="line_1 color-grey3" to={`/task/taskDetail/${record.task.id}`}>查看详情</Link>
// return <Link className="line_1 color-grey3" to={`/task/taskDetail/${record.task.id}`}></Link>
return <a className="line_1 color-grey3" onClick={(e) => { goToDeatil(e,record.task.id) }}> 查看详情</a >
}
}];
}, [taskId]);
const rowSelection = useMemo(() => {
return {
type: taskModeId === 1 ? 'radio' : 'checkbox',
onChange: (selectedRowKeys, selectedRows) => {
setSelectedRows(selectedRows);
},
}
}, [taskModeId]);
const rowSelection = useMemo(() => {
return {
type: taskModeId === 1 ? 'radio' : 'checkbox',
onChange: (selectedRowKeys, selectedRows) => {
setSelectedRows(selectedRows);
},
}
}, [taskModeId]);
function goToDeatil(e,taskId){
e.stopPropagation();
window.location.href=`/task/taskDetail/${taskId}`;
}
const handleRow = record => {
return {
onClick: event => {
const handleRow = record => {
return {
onClick: event => {
if (event.currentTarget.getElementsByClassName("ant-checkbox-wrapper")) {
event.currentTarget.getElementsByClassName("ant-checkbox-wrapper")[0].click();
},
};
};
function proofItem() {
if (!selectedRows.length) {
showNotification("请至少选择一条数据!");
return;
}
validateFields((err, values) => {
if (!err) {
let paperNumber = [];
let winnerIds = [];
let winnerName = [];
for (const item of selectedRows) {
paperNumber.push(item.number);
winnerIds.push(item.user.id);
winnerName.push(item.user.nickname || item.user.login);
}
let params = {
paperNumber: paperNumber.join(),
winnerIds: winnerIds.join(),
winnerName: winnerName.join(),
proofFileNumbers: values.files,
status: 2,
taskId,
};
proofAdd(params).then(res => {
if (res && res.message === 'success') {
changeVisible(false);
reloadList();
}
});
} else {
event.currentTarget.getElementsByClassName("ant-radio-wrapper")[0].click();
}
});
},
};
};
function proofItem() {
if (!selectedRows.length) {
showNotification("请至少选择一条数据!");
return;
}
return (
<Modal
title="上传评选佐证材料"
visible={visible}
onOk={proofItem}
onCancel={() => { changeVisible(false) }}
className="proof-modal"
draggable={true}
>
<h3 className="margin10">选出胜出者<span className="color-red">*</span></h3>
<div className="center-right-but">
{helper(
"number",
[{ max: 20, message: '长度不能超过20个字符' }],
<Input
placeholder="请输入成果编号进行检索"
/>
)}
validateFields((err, values) => {
if (!err) {
let paperNumber = [];
let winnerIds = [];
let winnerName = [];
{helper(
"userName",
[{ max: 20, message: '长度不能超过20个字符' }],
<Input
placeholder="请输入作者名称进行检索"
/>
)}
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
<Button className="mr10" type="" onClick={clearSearch}>清除</Button>
</div>
<Table
loading={loading}
rowKey={(row) => row.id}
dataSource={dataList}
columns={columns}
pagination={false}
rowSelection={rowSelection}
onRow={handleRow}
/>
{total > 10 &&
<Pagination
onChange={(page) => { setCurPage(page) }}
current={curPage}
total={total}
/>}
for (const item of selectedRows) {
paperNumber.push(item.number);
winnerIds.push(item.user.id);
winnerName.push(item.user.nickname || item.user.login);
}
<Form.Item className="upload-form" label="上传附件" required={true} >
<Upload
className="commentStyle"
load={UploadFunc}
size={50}
showNotification={showNotification}
actionUrl={httpUrl}
fileList={fileList}
let params = {
paperNumber: paperNumber.join(),
winnerIds: winnerIds.join(),
winnerName: winnerName.join(),
proofFileNumbers: values.files,
status: 2,
taskId,
};
proofAdd(params).then(res => {
if (res && res.message === 'success') {
changeVisible(false);
reloadList();
}
});
}
});
}
return (
<Modal
title="上传评选佐证材料"
visible={visible}
onOk={proofItem}
onCancel={() => { changeVisible(false) }}
className="proof-modal"
draggable={true}
>
<h3 className="margin10">选出胜出者<span className="color-red">*</span></h3>
<div className="center-right-but">
{helper(
"number",
[{ max: 20, message: '长度不能超过20个字符' }],
<Input
placeholder="请输入成果编号进行检索"
/>
{getFieldDecorator('files', {
rules: [{ required: visible, message: "请上传文件" }],
validateFirst: true
})(<Input style={{ display: 'none' }} />)}
</Form.Item>
</Modal>
)}
)
{helper(
"userName",
[{ max: 20, message: '长度不能超过20个字符' }],
<Input
placeholder="请输入作者名称进行检索"
/>
)}
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
<Button className="mr10" type="" onClick={clearSearch}>清除</Button>
</div>
<Table
loading={loading}
rowKey={(row) => row.id}
dataSource={dataList}
columns={columns}
pagination={false}
rowSelection={rowSelection}
onRow={handleRow}
/>
{total > 10 &&
<Pagination
onChange={(page) => { setCurPage(page) }}
current={curPage}
total={total}
/>}
<Form.Item className="upload-form" label="上传附件" required={true} >
<Upload
className="commentStyle"
load={UploadFunc}
size={50}
showNotification={showNotification}
actionUrl={httpUrl}
fileList={fileList}
/>
{getFieldDecorator('files', {
rules: [{ required: visible, message: "请上传文件" }],
validateFirst: true
})(<Input style={{ display: 'none' }} />)}
</Form.Item>
</Modal>
)
}
)

View File

@ -327,33 +327,37 @@ export default Form.create()(
Modal.info({ title: '暂未提供接口' });
}
const columns = useMemo(() => {
return [
{
title: '应征者姓名',
dataIndex: 'name',
render: (text, record) => {
return !detailData.showUserStatus && record.user ? (record.user.nickname || record.user.login) : '******'
}
},
{
title: '投稿时间',
dataIndex: 'createdAt',
},
{
title: '状态',
dataIndex: 'status',
render: (text, record) => {
return text === 2 ? <img alt="胜出" src={winpng} /> : applyStatusAllNameArr[text]
}
},
{
title: '详情',
dataIndex: 'detail',
},
];
}, [detailData]);
//
// const columns = useMemo(() => {
// return [
// {
// title: '',
// dataIndex: 'name',
// render: (text, record) => {
// return !detailData.showUserStatus && record.user ? (record.user.nickname || record.user.login) : '******'
// }
// },
// {
// title: '稿',
// dataIndex: 'createdAt',
// },
// {
// title: '',
// dataIndex: 'status',
// render: (text, record) => {
// return text === 2 ? <img alt="" src={winpng} /> : applyStatusAllNameArr[text]
// }
// },
// {
// title: '',
// dataIndex: 'detail',
// },
// ];
// }, [detailData]);
function goUserProfiles() {
window.open(`/users/${current_user.login}/profiles`);
}
return (
<div className="centerbox task-detail">
@ -381,13 +385,9 @@ export default Form.create()(
<li><span className="mr10 color-grey9">悬赏模式</span><span className="color-grey3">{taskModeNameArr[detailData.taskModeId]}</span></li>
<li><span className="mr10 color-grey9">任务编号</span><span className="color-grey3">{detailData.number}</span></li>
<li><span className="mr10 color-grey9">发布时间</span><span className="color-grey3">{detailData.publishedAt || detailData.createdAt}</span></li>
{/* <li><span className="mr10 color-grey9">截止时间:</span><span className="color-grey3">{detailData.expiredAt}</span></li> */}
</ul>
<ul className="fr edu-txt-right">
<li className="color-orange font-bd lineh-30"><span className="font-18"></span><span className="font-28">{detailData.bounty}</span></li>
{/* <a className="base_largeBtn orange_line_btn">
<i className="iconfont icon-kehuliuyan font-18 mr10"></i>联系TA
</a> */}
</ul>
</div>
</div>
@ -447,7 +447,11 @@ export default Form.create()(
</p>
</div>
{detailData.status === 3 && signContent()}
{!current_user.enterpriseCertification && <div className="edu-back-white padding30 mt20 font-16 text-center mb50">
<a onClick={goUserProfiles} className="color-blue_4C">请先完善主体信息</a>
</div>}
{current_user.enterpriseCertification && detailData.status === 3 && signContent()}
<div className="applyList edu-back-white padding30 mt20">
<div className="font-16 font-bd">交稿{dataList.length}
@ -468,7 +472,8 @@ export default Form.create()(
changeOptionId={changeOptionId}
/>
{
{/* {
//
detailData.status > 6 ?
<React.Fragment>
<Table
@ -485,20 +490,20 @@ export default Form.create()(
total={total}
/>}
</React.Fragment>
:
<ItemListPaper
current_user={current_user}
list={dataList}
itemClick={dataList}
curPage={curPage}
total={total}
changePage={(page) => { setCurPage(page) }}
loading={loading}
applyStatusAllNameArr={applyStatusAllNameArr}
reloadList={reloadList}
showNotification={showNotification}
detailStatus={detailData.status}
/>}
: */}
<ItemListPaper
current_user={current_user}
list={dataList}
itemClick={dataList}
curPage={curPage}
total={total}
changePage={(page) => { setCurPage(page) }}
loading={loading}
applyStatusAllNameArr={applyStatusAllNameArr}
reloadList={reloadList}
showNotification={showNotification}
detailStatus={detailData.status}
/>
</div>
<Modal

View File

@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useState } from 'react';
import { Input, Button } from 'antd';
import { Input, Button, Modal } from 'antd';
import moment from 'moment';
import ChooseNav from '../../components/chooseNav';
import SortBox from '../../components/sortBox';
@ -99,11 +99,27 @@ export default ({ history, current_user }) => {
function goAdd() {
getCompanyInfo().then(res => {
if(res){
if (res) {
if (res.message === 'success') {
history.push("/task/taskAdd");
} else if (res.message === '主体信息未认证') {
Modal.info({
title: '因为以下原因,您暂时不能进行本操作',
content: <div className="mt10">
<p>完成条件后重新点击查看您的最新参与资格</p>
<div className="inline mt10">
<span className="mr30"> <i className="iconfont icon-mingpian"></i> <span className="color-red">主体信息未认证</span> </span>
</div>
</div>,
onOk: () => {
window.location.href = `/users/${current_user.login}/profiles`;
},
okText: '立即完善',
});
} else {
Modal.info({
content: res.message
});
}
}
});