From 6b63cd25aaadf8e4e62feae0ccc9b86ad8f87fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= <792998983@qq.com> Date: Mon, 28 Jun 2021 17:35:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=88=90=E6=9E=9C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/military/components/chooseNav/index.jsx | 4 +- src/military/fetch.js | 4 +- .../task/components/itemListAchieve/index.jsx | 29 ++- .../components/itemListAchieve/index.scss | 22 ++- src/military/task/myTask/index.jsx | 182 ++++++------------ src/military/task/myTask/joinTask.jsx | 18 +- src/military/task/taskDetail/index.jsx | 91 +++++---- 7 files changed, 143 insertions(+), 207 deletions(-) diff --git a/src/military/components/chooseNav/index.jsx b/src/military/components/chooseNav/index.jsx index 1074cb185..04bc70558 100644 --- a/src/military/components/chooseNav/index.jsx +++ b/src/military/components/chooseNav/index.jsx @@ -3,9 +3,7 @@ import classNames from 'classnames'; import './index.scss'; export default memo((props) => { - const { title, options, changeOptionId, type ,size} = props; - console.log(" --- 组件重新渲染 --- "); - + const { title, options, changeOptionId, type ,size} = props; const [option, setOption] = useState({ code: "", dicItemName: "" ,dicItemCode:""}); useEffect(() => { diff --git a/src/military/fetch.js b/src/military/fetch.js index 9cd4f9dba..42f083099 100644 --- a/src/military/fetch.js +++ b/src/military/fetch.js @@ -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'; diff --git a/src/military/task/components/itemListAchieve/index.jsx b/src/military/task/components/itemListAchieve/index.jsx index 26720353a..692ea10bb 100644 --- a/src/military/task/components/itemListAchieve/index.jsx +++ b/src/military/task/components/itemListAchieve/index.jsx @@ -79,6 +79,7 @@ export default (props) => { setCommentHtml(''); } + return ( {loading ? : @@ -122,28 +123,16 @@ export default (props) => {
{item.comments.length > 0 && item.comments.map(commentsItem => { - return
-

+ return

+
{commentsItem.user.nickname || commentsItem.user.login} - 大约 3 小时 -

- -
+ {timeAgo(commentsItem.createdAt)} +
+
}) } - {/*
    -
  • - 龙傲天 - 大约 3 小时 -
  • -
  • -
    -

    短发短发

    -
    -
  • -
*/} {/* */}
@@ -165,6 +154,12 @@ export default (props) => { config={ { placeholder: "请输入评论", + excludeMenus :[ + 'list', + 'todo', + 'emoticon', + 'video' + ], uploadImgServer: httpUrl + '/busiAttachments/upload', uploadFileName: 'file', uploadImgHeaders: { diff --git a/src/military/task/components/itemListAchieve/index.scss b/src/military/task/components/itemListAchieve/index.scss index 7544184f7..365931cf3 100644 --- a/src/military/task/components/itemListAchieve/index.scss +++ b/src/military/task/components/itemListAchieve/index.scss @@ -1,7 +1,7 @@ .blue_line_btn { - color: #4CACFF!important; - border: 1px solid #4CACFF; - background: #fff!important; + color: #4cacff !important; + border: 1px solid #4cacff; + background: #fff !important; } .base_smallBtn { @@ -18,5 +18,19 @@ } .fileCommentsList { - background: #FAFAFA; + background: #fafafa; + padding-top: .25rem; +} + +.comments-item{ + margin-top:1rem; +} +.comments-content { + text-align: left; + font-size: 16px; + line-height: 1.6; + padding: 20px; + overflow: auto; + width: 100%; + background-color: #fff; } diff --git a/src/military/task/myTask/index.jsx b/src/military/task/myTask/index.jsx index 79c5d3b85..98a8f2bc8 100644 --- a/src/military/task/myTask/index.jsx +++ b/src/military/task/myTask/index.jsx @@ -1,12 +1,11 @@ import React, { useCallback, useEffect, useState } from 'react'; -import { Tabs, Input, Button, Table, Pagination } from 'antd'; +import { Tabs, Input, } from 'antd'; import { Link } from "react-router-dom"; import StatusNav from '../../components/statusNav'; -import ChooseNav from '../../components/chooseNav'; import ItemListMyTask from '../components/itemListMyTask'; import JoinTask from './joinTask'; -import { taskStatusAllArr, applyStatusArr, publishModeArr } from '../static'; -import { getTaskList, getTaskCategory, getMyTaskList, getJoinTaskList } from '../api'; +import { taskStatusAllArr, publishModeArr } from '../static'; +import { getTaskCategory, getMyTaskList } from '../api'; import './index.scss'; const Search = Input.Search; const { TabPane } = Tabs; @@ -64,7 +63,7 @@ export default ({ location, history, current_user }) => { pageSize: 10, }; setLoading(true); - getTaskList(params).then(data => { + getMyTaskList(params).then(data => { if (data) { setMyTaskList(data.rows); setTotal(data.total); @@ -75,67 +74,67 @@ export default ({ location, history, current_user }) => { // const columns = useCallback(()=>{ - const columns = [ - { - title: '任务', - dataIndex: 'name', - }, - { - title: '类型', - dataIndex: 'createdAt', - render: (text, record) => { - return
- {taskCategoryValueArr[record.categoryId]} - {publishModeArr[record.publishMode]} -
- } - }, - { - title: '应征投稿', - dataIndex: 'papersCount', - render: (text) => { - return text || 0 - } - }, - { - title: '金额', - dataIndex: 'bounty', - render: (text) => { - return ¥{text} - } - }, - { - title: '任务状态', - dataIndex: 'status', - render: (text, record) => { - return statusArr[text] - } - }, - - { - title: '操作', - key: 'action', - render: (text, record) => ( - - 查看详情 - - ), - }, - ]; + const columns = [ + { + title: '任务', + dataIndex: 'name', + }, + { + title: '类型', + dataIndex: 'createdAt', + render: (text, record) => { + return
+ {taskCategoryValueArr[record.categoryId]} + {publishModeArr[record.publishMode]} +
+ } + }, + { + title: '应征投稿', + dataIndex: 'papersCount', + render: (text) => { + return text || 0 + } + }, + { + title: '金额', + dataIndex: 'bounty', + render: (text) => { + return ¥{text} + } + }, + { + title: '任务状态', + dataIndex: 'status', + render: (text, record) => { + return statusArr[text] + } + }, + + { + title: '操作', + key: 'action', + render: (text, record) => ( + + 查看详情 + + ), + }, + ]; // },[taskCategoryValueArr,publishModeArr,statusArr]); - + function taskClick(id) { history.push(`/task/taskDetail/${id}`); } - function changeOptionId(option, type) { + const changeOptionId = useCallback((option, type) => { if (type === 'publishStatus') { setStatusString(option.dicItemCode.toString() || '3,4,5,6,7,8'); } else if (type === 'unpublishStatus') { setStatusString(option.dicItemCode.toString() || '0,1,2'); } setCurPage(1); - } + }, []) function changeIdentity(key) { setIdentity(key); @@ -228,76 +227,9 @@ export default ({ location, history, current_user }) => { - - - {/* setSearchInput(value)} - /> - } - > - - - - - - { setCurPage(page) }} - loading={loading} - /> - - - - - - row.id} - dataSource={myTaskList} - columns={columns} - pagination={false} - className="mt10" - /> - {myTaskList.length > 10 && - { setCurPage(page) }} - current={curPage} - total={total} - />} - - */} - + diff --git a/src/military/task/myTask/joinTask.jsx b/src/military/task/myTask/joinTask.jsx index fc2e29814..d2e444337 100644 --- a/src/military/task/myTask/joinTask.jsx +++ b/src/military/task/myTask/joinTask.jsx @@ -1,5 +1,5 @@ import React, { useCallback, useEffect, useState } from 'react'; -import { Tabs, Input, Table, Pagination } from 'antd'; +import { Tabs, Input, Table, Pagination } from 'antd'; import { Link } from "react-router-dom"; import ChooseNav from '../../components/chooseNav'; import ItemListMyTask from '../components/itemListMyTask'; @@ -19,7 +19,7 @@ for (const item of taskStatusAllArr) { export default ({ taskCategoryValueArr }) => { const [paperStatusString, setPaperStatusString] = useState('0,1,2,3,4'); - const [statusString, setStatusString] = useState('3,4,5,6,7,8'); + const [taskStatusString, setTaskStatusString] = useState('3,4,5,6,7,8'); const [requireAchieve, setRequireAchieve] = useState('1'); @@ -34,7 +34,7 @@ export default ({ taskCategoryValueArr }) => { useEffect(() => { const params = { paperStatusString, - statusString, + taskStatusString, searchInput, orderBy, curPage, @@ -48,7 +48,7 @@ export default ({ taskCategoryValueArr }) => { } setLoading(false); }) - }, [statusString, searchInput, orderBy, curPage]); + }, [paperStatusString, taskStatusString, searchInput, orderBy, curPage]); // const columns = useCallback(()=>{ @@ -103,20 +103,20 @@ export default ({ taskCategoryValueArr }) => { - function changeOptionId(option, type) { + const changeOptionId = useCallback((option, type) => { if (type === 'taskStatus') { - setStatusString(option.dicItemCode.toString() || '3,4,5,6,7,8'); + setTaskStatusString(option.dicItemCode.toString() || '3,4,5,6,7,8'); } else if (type === 'applyStatus') { - setStatusString(option.dicItemCode.toString() || '0,1,2,3,4'); + setPaperStatusString(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'); + setTaskStatusString('3,4,5,6,7,8'); setPaperStatusString('0,1,2,3,4'); } setCurPage(1); diff --git a/src/military/task/taskDetail/index.jsx b/src/military/task/taskDetail/index.jsx index a96196e1a..92b90a77b 100644 --- a/src/military/task/taskDetail/index.jsx +++ b/src/military/task/taskDetail/index.jsx @@ -13,7 +13,6 @@ import winpng from '../image/win.png'; import './index.scss'; const { TextArea } = Input; -// 如果是开发,那么文件系统默认使用117.50.100.12 const taskModeNameArr = []; for (const item of taskModeIdArr) { @@ -39,7 +38,7 @@ const columns = [ title: '状态', dataIndex: 'status', render: (text, record) => { - return text == 2 ? : applyStatusAllNameArr[text] + return text === 2 ? 胜出 : applyStatusAllNameArr[text] } }, { @@ -50,7 +49,6 @@ const columns = [ export default Form.create()( forwardRef(({ match, current_user, form, history, showNotification }, ref) => { - // console.log(current_user); const id = match.params.taskId; const { getFieldDecorator, validateFields, setFieldsValue } = form; @@ -61,12 +59,11 @@ export default Form.create()( const [applyModal, setApplyModal] = useState(false); const [applyContent, setApplyContent] = useState({ title: '应征投稿协议内容', content: agreementContent }); const [agreementCheckBox, setAgreementCheckBox] = useState(false); - const [signAgreement,setSignAgreement] = useState(false); + const [signAgreement, setSignAgreement] = useState(false); const [status, setStatus] = useState(''); const [curPage, setCurPage] = useState(1); const [total, setTotal] = useState(0); - const [orderBy, setOrderBy] = useState(''); const [dataList, setDataList] = useState([]); const [loading, setLoading] = useState(false); @@ -97,7 +94,7 @@ export default Form.create()( // 检查用户是否同意协议 useEffect(() => { id && checkAgreement(id).then(res => { - if(res&&res.data&&res.data.status==1){ + if (res && res.data && res.data.status === 1) { setSignAgreement(true); } }) @@ -120,7 +117,7 @@ export default Form.create()( setLoading(true); let params = { taskId: id, - orderBy, + orderBy: '', pageSize: 10, curPage, status, @@ -133,6 +130,7 @@ export default Form.create()( } setDataList(data.rows || []); setLoading(false); + setTotal(data.total); }); }, [id, status, curPage, reload, relaodChildList]); @@ -204,7 +202,9 @@ export default Form.create()( function agreementSign() { agreement(id).then(res => { if (res.message === 'success') { - showNotification('已签订协议'); + Modal.success({ + content: '签订成功!', + }); setApplyModal(false); setSignAgreement(true); } @@ -277,7 +277,7 @@ export default Form.create()(
任务详情:
{/* 富文本内容插入 */} -
+
{detailData.tasksAttachments &&
任务文件:
@@ -304,46 +304,43 @@ export default Form.create()(

- {/* {detailData.status == '3' ? */} -
- -
- - {/* : */} -
-
我要应征投稿:
- {helper( - "", - "content", - [{ required: true, message: "请输入" }], -