添加成果内容

This commit is contained in:
何童崇 2021-06-28 11:53:37 +08:00
parent 6ec6ab2308
commit 09e81b9e78
26 changed files with 480 additions and 111 deletions

View File

@ -101,6 +101,9 @@ module.exports = {
extensions: [".web.js", ".mjs", ".js", ".json", ".web.jsx", ".jsx"],
alias: {
educoder: __dirname + "/../src/common/educoder.js",
src: path.join(paths.appSrc), // 整个源代码目录
forge: path.join(paths.appSrc, 'forge'),
military: path.join(paths.appSrc, 'military'),
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
"react-native": "react-native-web",

View File

@ -87,6 +87,9 @@ module.exports = {
extensions: [".web.js", ".mjs", ".js", ".json", ".web.jsx", ".jsx"],
alias: {
educoder: __dirname + "/../src/common/educoder.js",
src: path.join(paths.appSrc),
forge: path.join(paths.appSrc, 'forge'),
military: path.join(paths.appSrc, 'military'),
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
"react-native": "react-native-web",

14
jsconfig.json Normal file
View File

@ -0,0 +1,14 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"educoder": ["./src/common/educoder.js"],
"forge":["./src/forge"],
"military":["./src/military"],
}
},
"exclude": [
"node_modules",
"build"
]
}

View File

@ -109,20 +109,20 @@ export function timeAgo(backDate) {
return;
}
let time = new Date() - moment(backDate);
var days = Math.round(time / (1000 * 60 * 60 * 24));
var hours = Math.round((time % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.round((time % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.round((time % (1000 * 60 * 60)) / 1000);
var days = Math.floor(time / (1000 * 60 * 60 * 24));
var hours = Math.floor((time % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((time % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((time % (1000 * 60 * 60)) / 1000);
if (days) {
return "约" + days + "天前";
return days + "天前";
}
if (hours) {
return "约" + hours + "小时前";
return hours + "小时前";
}
if (minutes) {
return "约" + minutes + "分前";
return minutes + "分前";
}
if (seconds) {
return "约" + seconds + "秒前";
return seconds + "秒前";
}
}

View File

@ -1,10 +1,11 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect, useState,memo } from 'react';
import classNames from 'classnames';
import './index.scss';
export default (props) => {
export default memo((props) => {
const { title, options, changeOptionId, type ,size} = props;
console.log(" --- 组件重新渲染 --- ");
const [option, setOption] = useState({ code: "", dicItemName: "" ,dicItemCode:""});
useEffect(() => {
@ -26,4 +27,4 @@ export default (props) => {
</div>
)
}
})

View File

@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect, useState ,memo} from 'react';
import { Icon, } from 'antd';
import classNames from 'classnames';
import './index.scss';
export default (props) => {
export default memo((props) => {
const { options, changeOptionId, type, defaultValue } = props;
const [myOptions, setMyOptions] = useState(options);
@ -45,4 +45,4 @@ export default (props) => {
</div>
)
}
})

View File

@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect, useState ,memo} from 'react';
import classNames from 'classnames';
import './index.scss';
export default (props) => {
const { title, options, changeOptionId, type } = props;
export default memo((props) => {
const { options, changeOptionId, type } = props;
const [option, setOption] = useState({ code: "", dicItemName: "" ,dicItemCode:""});
@ -23,4 +23,4 @@ export default (props) => {
</div>
)
}
})

View File

@ -3,10 +3,10 @@ import axios from 'axios';
import cookie from 'react-cookies';
// export const httpUrl='http://117.50.100.12:8001';
// export const httpUrl='http://192.168.31.72:8081';
export const httpUrl='http://192.168.31.72:8081';
// export const httpUrl = 'http://106.75.31.211:58088';
// export const httpUrl = 'http://192.168.31.72:8089';
export const httpUrl = 'http://192.168.31.104:8081';
// export const httpUrl = 'http://192.168.31.104:8081';
const TokenKey = 'autologin_forge_military';
@ -73,7 +73,7 @@ service.interceptors.response.use(
message: "提示",
description: '无权限',
});
window.location.href="/404";
// window.location.href="/404";
return Promise.reject('error');
}
if (res.status == 40001) {

View File

@ -114,6 +114,37 @@
border: 0;
}
// 富文本样式
.w-e-text table td, .w-e-text table th{
height: 30px;
}
// 富文本生成的内容的样式
.editor-w-text table td, .editor-w-text table th{
border-bottom: 1px solid #ccc;
border-right: 1px solid #ccc;
padding: 3px 5px;
height: 30px;
min-height: 30px;
}
.editor-w-text table th {
border-bottom: 2px solid #ccc;
text-align: center;
background-color: #f1f1f1;
}
.editor-w-text table {
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
}
.editor-w-text blockquote {
display: block;
border-left: 8px solid #d0e5f2;
padding: 5px 10px;
margin: 10px 0;
line-height: 1.4;
font-size: 100%;
background-color: #f1f1f1;
}
@media screen and (max-width: 1200px){
.centerbox {

View File

@ -42,7 +42,7 @@ export async function getTaskList(params) {
}
}
// 我的列表查询
// 我的任务列表查询
export async function getMyTaskList(params) {
let res = await fetch({
url: '/api/myTasks/',
@ -59,6 +59,23 @@ export async function getMyTaskList(params) {
}
}
// 我参与的任务列表查询
export async function getJoinTaskList(params) {
let res = await fetch({
url: '/api/myTasks/myPapers',
method: 'get',
params,
});
if (res.data) {
return res.data;
} else {
notification.open({
message: "提示",
description: res.message || '请求错误',
});
}
}
// 详情查询
export async function getTaskDetail(id) {

View File

@ -1,22 +1,16 @@
import React, { useEffect, useState } from 'react';
import { Icon, Pagination, Modal, Input ,Button} from 'antd';
import { getImageUrl, timeAgo } from 'educoder';
import { Pagination, Modal, Input, Button } from 'antd';
import ReactWEditor from 'wangeditor-for-react';
import { reportAchieve, thumbUpAchieve, commentAdd } from '../../task/api';
import { httpUrl } from '../../fetch';
import Nodata from '../../../forge/Nodata';
import Loading from "../../../Loading";
import { getImageUrl, timeAgo } from 'educoder';
import Nodata from 'forge/Nodata';
import Loading from "src/Loading";
import { reportAchieve, thumbUpAchieve, commentAdd } from '../../api';
import { httpUrl } from '../../../fetch';
import './index.scss';
const { TextArea } = Input;
// 使117.50.100.12
let fileHttpUrl = httpUrl;
if (window.location.href.indexOf('localhost') > -1) {
fileHttpUrl = 'http://117.50.100.12:8001';
}
// const classArr = ['', 'list-done', 'list-error', 'list-red', 'list-yellow', '', '', 'list-pay', 'list-gray',];
export default (props) => {
const { list, curPage, total, changePage, loading, applyStatusAllNameArr, relaodList, showNotification } = props;
const [page, setPage] = useState(1);
@ -28,12 +22,14 @@ export default (props) => {
const [reportValue, setReportValue] = useState('');
const [commentHtml, setCommentHtml] = useState('');
const [commentId, setCommentId] = useState(undefined);
useEffect(() => {
changePage(page);
}, [page]);
function downFile(item) {
let url = fileHttpUrl + '/busiAttachments/download/' + item.id;
let url = httpUrl + '/busiAttachments/download/' + item.id;
window.open(url);
}
@ -60,16 +56,27 @@ export default (props) => {
}
function commentPush(item) {
if (!commentHtml) {
showNotification("请输入评价");
return;
}
commentAdd({
content:commentHtml,
paperId:''
content: commentHtml,
paperId: item.id,
taskId: item.taskId
}).then(res => {
if (res.message === 'success') closeComment();
});
}
function commentEdit(id){
function closeComment() {
setCommentId(undefined);
setCommentHtml('');
}
function commentEdit(id) {
setCommentId(id);
setCommentHtml('');
}
return (
@ -111,37 +118,54 @@ export default (props) => {
}
</div>
{/* <div>
<div className="attachments" >
<p className="clearfix" id="attachments_1541">
<span title="歌曲ID代入演示.txt" id="attachment_">
<i className="iconfont icon-fujian color-green font-14 mr3"></i>
<a href="/attachments/download/1541/%E6%AD%8C%E6%9B%B2ID%E4%BB%A3%E5%85%A5%E6%BC%94%E7%A4%BA.txt" className="icon icon-attachment font-14" length="32">歌曲ID代入演示.txt</a>
</span>
<span className="size color-grey-9 ml10">(299 Bytes)</span>
</p>
</div>
<div class="padding20 fileCommentsList">
{item.comments.length > 0 &&
item.comments.map(commentsItem => {
return <div>
<p class="mb5 lineh-20">
<span class="color-grey3 font-bd mr20">{commentsItem.user.nickname || commentsItem.user.login}</span>
<span class="color-grey9">大约 3 小时</span>
</p>
<div dangerouslySetInnerHTML={{ __html: commentsItem.details.content }}>
</div>
</div>
})
}
{/* <ul>
<li class="mb5 lineh-20">
<span class="color-grey3 font-bd mr20">龙傲天</span>
<span class="color-grey9">大约 3 小时</span>
</li>
<li class="color-grey-6 lineh-20">
<div class="paper-detail-content markdown-body editormd-html-preview" id="paper-child-detail-content-194" >
<p>短发短发</p>
</div>
</li>
</ul> */}
{/* <!-- <a href="javascript:void(0)" class="mt10 mb10 color-blue">查看更多回复>></a>--> */}
</div>
*/}
<li className="clearfix color-grey-6 mt10 mb20">
<span className="mr50 fl"><span className="color-grey9">成果编号</span>#{item.number}</span>
<span className="mr50 fl"><span className="color-grey9">提交时间</span>{item.createdAt}</span>
<span className="fl"><span className="color-grey9">稿件状态</span>{item.read ? '雇主已浏览' : '雇主未浏览'}</span>
<span className="fr">
<a className="mr20" onClick={() => { setReportVisible(true); setCheckedItem(item) }}><i className="iconfont icon-jinggao font-15 mr3"></i>举报</a>
<a className="mr20" onClick={() => { commentEdit(item.id) }}><i className="iconfont icon-huifu1 font-15 mr3"></i>0</a>
<a className="mr20" onClick={() => { commentEdit(item.id) }}><i className="iconfont icon-huifu1 font-15 mr3"></i>{item.comments.length}</a>
<a onClick={() => { thumbUp(item.id) }}><i className="iconfont icon-dianzan11 font-16 mr3"></i>{item.thumbsUp}</a>
</span>
</li>
<React.Fragment>
{commentId === item.id && <React.Fragment>
<ReactWEditor
value={commentHtml}
config={
{
placeholder: "把您的任务内容补充详细一些吧,越清晰具体,任务完成质量越高哟~",
uploadImgServer: fileHttpUrl + '/busiAttachments/upload',
placeholder: "请输入评论",
uploadImgServer: httpUrl + '/busiAttachments/upload',
uploadFileName: 'file',
uploadImgHeaders: {
'X-Requested-With': 'XMLHttpRequest'
@ -151,7 +175,7 @@ export default (props) => {
customInsert: function (insertImgFn, result) {
// insertImgFn src
if (result && result.data && result.data.id) {
insertImgFn(`${fileHttpUrl}/busiAttachments/view/${result.data.id}`);
insertImgFn(`${httpUrl}/busiAttachments/view/${result.data.id}`);
}
}
},
@ -161,8 +185,10 @@ export default (props) => {
setCommentHtml(html);
}}
/>
<Button className="mr20 fr" type={"primary"} onClick={() => { commentPush(item) }}>发表</Button>
</React.Fragment>
<Button className="mt20 mr20 mb20 fr" type={"primary"} onClick={() => { commentPush(item) }}>发表</Button>
<Button className="mt20 mr20 mb20 fr" onClick={closeComment}>取消</Button>
</React.Fragment>}
</div>
</div>

View File

@ -17,4 +17,6 @@
text-align: center;
}
.fileCommentsList {
background: #FAFAFA;
}

View File

@ -1,18 +1,21 @@
import React, { useEffect, useState } from 'react';
import { Icon, Modal, Pagination } from 'antd';
import { Modal, Pagination } from 'antd';
import { Link } from "react-router-dom";
import Nodata from '../../../forge/Nodata';
import Loading from "../../../Loading";
import { publishModeArr } from '../../task/static';
import Nodata from 'forge/Nodata';
import Loading from "src/Loading";
import { publishModeArr ,taskStatusAllArr} from '../../static';
import './index.scss';
const statusArr = ["草稿", "待审核", "已拒绝", "成果征集中", "成果评选中", "公示中", "协议签订中", "支付中", "已完成"];
const statusArr = [];
for (const item of taskStatusAllArr){
statusArr[item.dicItemCode]=item.dicItemName;
}
export default (props) => {
const { list, itemClick, curPage, total, changePage, taskCategoryValueArr, loading } = props;
const { list, curPage, total, changePage, taskCategoryValueArr, loading } = props;
const [page, setPage] = useState(1);
const [activeItem, setActiveItem] = useState('');
const [visibleProofs, setVisibleProofs] = useState(false);
const [activeItem,setActiveItem]=useState({});
const [pageSize, setPageSize] = useState(() => {
return props.pageSize || 10;
@ -29,7 +32,7 @@ export default (props) => {
return (
<React.Fragment>
<ul className="df needs_condition_content_nav">
<ul className="df mt10 needs_condition_content_nav">
<li key={1} className="with35 edu-txt-left">任务</li>
<li key={2} className="with15">类型</li>
<li key={3} className="with10 draft_only">应征投稿</li>

View File

@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react';
import { Icon, Pagination } from 'antd';
import Nodata from '../../../forge/Nodata';
import Loading from "../../../Loading";
import Nodata from 'forge/Nodata';
import Loading from "src/Loading";
import './index.scss';

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -1,10 +1,12 @@
import React, { useEffect, useState } from 'react';
import { Tabs, Input, Button,Table,Pagination } from 'antd';
import React, { useCallback, useEffect, useState } from 'react';
import { Tabs, Input, Button, Table, Pagination } from 'antd';
import { Link } from "react-router-dom";
import StatusNav from '../../components/statusNav';
import ChooseNav from '../../components/chooseNav';
import ItemListMyTask from '../../components/itemListMyTask';
import { taskStatusAllArr, applyStatusArr } from '../static';
import { getTaskList, getTaskCategory } from '../api';
import ItemListMyTask from '../components/itemListMyTask';
import JoinTask from './joinTask';
import { taskStatusAllArr, applyStatusArr, publishModeArr } from '../static';
import { getTaskList, getTaskCategory, getMyTaskList, getJoinTaskList } from '../api';
import './index.scss';
const Search = Input.Search;
const { TabPane } = Tabs;
@ -12,7 +14,10 @@ const { TabPane } = Tabs;
const publishStatusArr = taskStatusAllArr.slice(3);
const unpublishStatusArr = taskStatusAllArr.slice(0, 3);
const columns=[];
const statusArr = [];
for (const item of taskStatusAllArr) {
statusArr[item.dicItemCode] = item.dicItemName;
}
export default ({ location, history, current_user }) => {
let defaultValue = decodeURI(location.search.split("=")[1] || "");
@ -33,7 +38,8 @@ export default ({ location, history, current_user }) => {
const [orderBy, setOrderBy] = useState('createdAtDesc');
const [curPage, setCurPage] = useState(1);
const [total, setTotal] = useState(0);
const [taskList, setTaskList] = useState([]);
const [myTaskList, setMyTaskList] = useState([]);
const [joinTaskList, setJoinTaskList] = useState([]);
const [loading, setLoading] = useState(false);
//
@ -60,7 +66,7 @@ export default ({ location, history, current_user }) => {
setLoading(true);
getTaskList(params).then(data => {
if (data) {
setTaskList(data.rows);
setMyTaskList(data.rows);
setTotal(data.total);
}
setLoading(false);
@ -68,14 +74,60 @@ export default ({ location, history, current_user }) => {
}, [statusString, searchInput, orderBy, curPage]);
// const columns = useCallback(()=>{
const columns = [
{
title: '任务',
dataIndex: 'name',
},
{
title: '类型',
dataIndex: 'createdAt',
render: (text, record) => {
return <div className="flex-column">
<span className="line_1">{taskCategoryValueArr[record.categoryId]}</span>
<span className="line_1">{publishModeArr[record.publishMode]}</span>
</div>
}
},
{
title: '应征投稿',
dataIndex: 'papersCount',
render: (text) => {
return text || 0
}
},
{
title: '金额',
dataIndex: 'bounty',
render: (text) => {
return <span className="color-orange">{text}</span>
}
},
{
title: '任务状态',
dataIndex: 'status',
render: (text, record) => {
return statusArr[text]
}
},
{
title: '操作',
key: 'action',
render: (text, record) => (
<span>
<Link className="line_1 color-grey3" to={`/task/taskDetail/${record.id}`}>查看详情</Link>
</span >
),
},
];
// },[taskCategoryValueArr,publishModeArr,statusArr]);
function taskClick(id) {
history.push(`/task/taskDetail/${id}`);
}
function goAdd() {
history.push("/task/taskAdd");
}
function changeOptionId(option, type) {
if (type === 'publishStatus') {
setStatusString(option.dicItemCode.toString() || '3,4,5,6,7,8');
@ -141,7 +193,7 @@ export default ({ location, history, current_user }) => {
/>
<ItemListMyTask
list={taskList}
list={myTaskList}
itemClick={taskClick}
curPage={curPage}
total={total}
@ -160,7 +212,7 @@ export default ({ location, history, current_user }) => {
/>
<ItemListMyTask
list={taskList}
list={myTaskList}
itemClick={taskClick}
curPage={curPage}
total={total}
@ -176,7 +228,11 @@ export default ({ location, history, current_user }) => {
<TabPane tab="我是创客" key="2">
<Tabs className="childTab"
<JoinTask
taskCategoryValueArr={taskCategoryValueArr}
/>
{/* <Tabs className="childTab"
activeKey={requireAchieve}
onChange={changeRequireAchieve}
tabBarExtraContent={
@ -206,7 +262,7 @@ export default ({ location, history, current_user }) => {
/>
<ItemListMyTask
list={taskList}
list={myTaskList}
itemClick={taskClick}
curPage={curPage}
total={total}
@ -228,18 +284,19 @@ export default ({ location, history, current_user }) => {
<Table
loading={loading}
rowKey={(row) => row.id}
dataSource={taskList}
dataSource={myTaskList}
columns={columns}
pagination={false}
className="mt10"
/>
{taskList.length > 10 &&
{myTaskList.length > 10 &&
<Pagination
onChange={(page) => { setCurPage(page) }}
current={curPage}
total={total}
/>}
</TabPane>
</Tabs>
</Tabs> */}
</TabPane>

View File

@ -32,8 +32,24 @@
visibility: hidden;
}
.ant-tabs-tabpane {
padding: 1rem 1.8rem;
padding: 0 1.8rem 1rem;
line-height: 2;
}
}
.ant-table-thead th{
text-align: center;
&:first-child{
text-align: left;
}
}
td{
text-align: center;
color: #333;
&:first-child{
text-align: left;
font-weight: bold;
font-size: 1rem;
}
}
}

View File

@ -0,0 +1,194 @@
import React, { useCallback, useEffect, useState } from 'react';
import { Tabs, Input, Table, Pagination } from 'antd';
import { Link } from "react-router-dom";
import ChooseNav from '../../components/chooseNav';
import ItemListMyTask from '../components/itemListMyTask';
import { taskStatusAllArr, applyStatusArr, publishModeArr } from '../static';
import { getJoinTaskList } from '../api';
import './index.scss';
const Search = Input.Search;
const { TabPane } = Tabs;
const publishStatusArr = taskStatusAllArr.slice(3);
const statusArr = [];
for (const item of taskStatusAllArr) {
statusArr[item.dicItemCode] = item.dicItemName;
}
export default ({ taskCategoryValueArr }) => {
const [paperStatusString, setPaperStatusString] = useState('0,1,2,3,4');
const [statusString, setStatusString] = useState('3,4,5,6,7,8');
const [requireAchieve, setRequireAchieve] = useState('1');
const [searchInput, setSearchInput] = useState('');
const [orderBy, setOrderBy] = useState('createdAtDesc');
const [curPage, setCurPage] = useState(1);
const [total, setTotal] = useState(0);
const [taskList, setTaskList] = useState([]);
const [loading, setLoading] = useState(false);
useEffect(() => {
const params = {
paperStatusString,
statusString,
searchInput,
orderBy,
curPage,
pageSize: 10,
};
setLoading(true);
getJoinTaskList(params).then(data => {
if (data) {
setTaskList(data.rows);
setTotal(data.total);
}
setLoading(false);
})
}, [statusString, searchInput, orderBy, curPage]);
// const columns = useCallback(()=>{
const columns = [
{
title: '任务',
dataIndex: 'name',
},
{
title: '类型',
dataIndex: 'createdAt',
render: (text, record) => {
return <div className="flex-column">
<span className="line_1">{taskCategoryValueArr[record.categoryId]}</span>
<span className="line_1">{publishModeArr[record.publishMode]}</span>
</div>
}
},
{
title: '应征投稿',
dataIndex: 'papersCount',
render: (text) => {
return text || 0
}
},
{
title: '金额',
dataIndex: 'bounty',
render: (text) => {
return <span className="color-orange">{text}</span>
}
},
{
title: '任务状态',
dataIndex: 'status',
render: (text, record) => {
return statusArr[text]
}
},
{
title: '操作',
key: 'action',
render: (text, record) => (
<span>
<Link className="line_1 color-grey3" to={`/task/taskDetail/${record.id}`}>查看详情</Link>
</span >
),
},
];
// },[taskCategoryValueArr,publishModeArr,statusArr]);
function changeOptionId(option, type) {
if (type === 'taskStatus') {
setStatusString(option.dicItemCode.toString() || '3,4,5,6,7,8');
} else if (type === 'applyStatus') {
setStatusString(option.dicItemCode.toString() || '0,1,2,3,4');
}
setCurPage(1);
}
function changeRequireAchieve(key) {
if (key === '1') {
setPaperStatusString('0,1,2,3,4');
} else {
setStatusString('3,4,5,6,7,8');
setPaperStatusString('0,1,2,3,4');
}
setCurPage(1);
setRequireAchieve(key);
}
return (
<Tabs className="childTab"
activeKey={requireAchieve}
onChange={changeRequireAchieve}
tabBarExtraContent={
<Search
maxLength={20}
style={{ width: "300px" }}
placeholder="请输入任务编号/任务名称关键字"
onSearch={(value) => setSearchInput(value)}
/>
}
>
<TabPane tab="我参加的任务" key="1">
<ChooseNav
key={'taskStatus'}
type={'taskStatus'}
title={'任务状态:'}
options={publishStatusArr}
changeOptionId={changeOptionId}
/>
<ChooseNav
key={'applyStatus'}
type={'applyStatus'}
title={'应征状态:'}
options={applyStatusArr}
changeOptionId={changeOptionId}
/>
<ItemListMyTask
list={taskList}
curPage={curPage}
total={total}
taskCategoryValueArr={taskCategoryValueArr}
changePage={(page) => { setCurPage(page) }}
loading={loading}
/>
</TabPane>
<TabPane tab="我的成果" key="2">
<ChooseNav
key={'applyStatus'}
type={'applyStatus'}
title={'应征状态:'}
options={applyStatusArr}
changeOptionId={changeOptionId}
/>
<Table
loading={loading}
rowKey={(row) => row.id}
dataSource={taskList}
columns={columns}
pagination={false}
className="mt10"
/>
{taskList.length > 10 &&
<Pagination
onChange={(page) => { setCurPage(page) }}
current={curPage}
total={total}
/>}
</TabPane>
</Tabs>
)
}

View File

@ -1,4 +1,4 @@
// 开始
// task静态数据
export const taskStatusArr = [
{ dicItemCode: '3,4,5,6,7', name: "正在进行中", dicItemName: '正在进行中' },
{ dicItemCode: '8', name: "已完成", dicItemName: '已完成' },

View File

@ -5,19 +5,16 @@ import { Link } from "react-router-dom";
import { getImageUrl } from 'educoder';
import Upload from '../../components/Upload';
import StatusNav from '../../components/statusNav';
import ItemListAchieve from '../../components/itemListAchieve';
import ItemListAchieve from '../components/itemListAchieve';
import { getTaskDetail, getTaskCategory, getTaskAchieve, addAchieve, getAgreement, agreement, checkAgreement, } from '../api';
import { taskModeIdArr, applyStatusArr, applyStatusAllArr, agreementContent } from '../static';
import { httpUrl } from '../../fetch';
import winpng from '../../image/win.png';
import winpng from '../image/win.png';
import './index.scss';
const { TextArea } = Input;
// 使117.50.100.12
let fileHttpUrl = httpUrl;
if (window.location.href.indexOf('localhost') > -1) {
fileHttpUrl = 'http://117.50.100.12:8001';
}
const taskModeNameArr = [];
for (const item of taskModeIdArr) {
taskModeNameArr[item.dicItemCode] = item.dicItemName;
@ -120,6 +117,7 @@ export default Form.create()(
//
useEffect(() => {
setLoading(true);
let params = {
taskId: id,
orderBy,
@ -134,9 +132,8 @@ export default Form.create()(
}
}
setDataList(data.rows || []);
console.log(data);
setLoading(false);
});
console.log(relaodChildList);
}, [id, status, curPage, reload, relaodChildList]);
@ -154,7 +151,7 @@ export default Form.create()(
}, [detailData]);
function downFile(item) {
let url = fileHttpUrl + '/busiAttachments/download/' + item.id;
let url = httpUrl + '/busiAttachments/download/' + item.id;
window.open(url);
}
@ -218,12 +215,11 @@ export default Form.create()(
setRelaodChildList(relaodChildList + 1);
}
return (
<div className="centerbox">
<div className="centerbox task-detail">
<div className="head-navigation">
<Link to="/task">创客空间 &gt;</Link>
<Link to="/task">任务大厅 &gt;</Link>
@ -333,7 +329,7 @@ export default Form.create()(
load={UploadFunc}
size={50}
showNotification={showNotification}
actionUrl={fileHttpUrl}
actionUrl={httpUrl}
fileList={fileList}
/>
{getFieldDecorator('files', {
@ -348,11 +344,9 @@ export default Form.create()(
<div className="applyList edu-back-white padding30 mt20">
<div className="font-16 font-bd">交稿0<i data-tip-down="不公示应征者姓名" className="iconfont icon-yincang1 color-grey9 font-20"></i>
{/* <a href="javascript:void(0)" onclick="upload_proofs_popup(130)" className="line_1 color-blue fr ml20" id="proof-upload-button">上传佐证材料</a> */}
{/* <a href="/tasks/130/export_papers" className="line_1 color-blue fr ml20" data-disable-with="<img alt=&quot;Loading&quot; className=&quot;download-loading&quot; src=&quot;/images/loading.gif?1564989000&quot; ></a>下载中..." target="_blank">一键导出成果物</a> */}
{/* <a href="javascript:notice_box('暂无应征者提交')"><span className="fr color-orange ml20">应征者名单公示 &gt;&gt;</span></a> */}
</div>
<StatusNav
@ -362,7 +356,6 @@ export default Form.create()(
changeOptionId={changeOptionId}
/>
{
detailData.status > 4 ?
<React.Fragment>

View File

@ -88,6 +88,8 @@
color: #409eff;
}
.applyText {
margin-top: 0.5rem;
border-radius: 3px;
@ -127,3 +129,10 @@
background: #fff;
}
}
.task-detail{
.ant-btn-primary{
background-color:#409eff;
border-color: #409eff;
}
}

View File

@ -9,7 +9,6 @@ import { httpUrl } from '../../fetch';
import { getTaskDetail, addTask, updateTask, getTaskCategory } from '../api';
import { formItemLayout, formModalLayout } from '../static';
import './index.scss';
import { number } from 'prop-types';
const { info } = Modal;

View File

@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
import { Input, Button } from 'antd';
import moment from 'moment';
import ChooseNav from '../../components/chooseNav';
import SortBox from '../../components/sortBox';
import ItemListTask from '../../components/itemListTask';
import ItemListTask from '../components/itemListTask';
import { taskTimeArr, taskStatusArr, sortArr, taskModeIdArr } from '../static';
import { getTaskList, getTaskCategory } from '../api';
const Search = Input.Search;
@ -58,7 +58,8 @@ export default ({ history, current_user }) => {
}, [categoryId, taskModeId, expiredStartTime, expiredEndTime, statusString, searchInput, orderBy, curPage]);
function changeOptionId(option, type) {
// function changeOptionId(option, type) {
const changeOptionId=useCallback((option, type)=>{
if (type === 'taskCategory') {
setCategoryId(option.dicItemCode);
} else if (type === 'taskModeId') {
@ -76,7 +77,7 @@ export default ({ history, current_user }) => {
} else if (type === 'taskStatus') {
setStatusString(option.dicItemCode||'3,4,5,6,7,8');
}
}
},[]);
function changeSort(sortType) {
let sortValue = '';