diff --git a/src/military/fetch.js b/src/military/fetch.js index f1e2553f..45a48ed7 100644 --- a/src/military/fetch.js +++ b/src/military/fetch.js @@ -5,19 +5,21 @@ import cookie from 'react-cookies'; let actionUrl = ''; if (window.location.href.indexOf('localhost') > -1) { - actionUrl='http://117.50.100.12:8008'; -}else if(window.location.href.indexOf('117.50.100.12') > -1){ - actionUrl="http://117.50.100.12:8008"; -}else if(window.location.href.indexOf('osredm')>-1){ - actionUrl="https://info.osredm.com"; + // actionUrl = 'http://117.50.100.12:8008'; + actionUrl='http://192.168.31.72:8081'; +} else if (window.location.href.indexOf('117.50.100.12') > -1) { + actionUrl = "http://117.50.100.12:8008"; + axios.defaults.withCredentials = true; +} else if (window.location.href.indexOf('osredm') > -1) { + actionUrl = "https://info.osredm.com"; + axios.defaults.withCredentials = true; } -export const httpUrl=actionUrl; +export const httpUrl = actionUrl; // export const httpUrl = 'http://106.75.31.211:58088'; //可视化 // export const httpUrl = 'http://117.50.100.12:8008'; //测试环境 // export const httpUrl = 'https://info.osredm.com/'; //生产环境 const TokenKey = 'autologin_forge_military'; -axios.defaults.withCredentials = true; // 创建axios实例 const service = axios.create({ @@ -33,7 +35,7 @@ service.interceptors.request.use(config => { } if (window.location.port === "3007") { // 模拟token为登录用户 - const taskToken = sessionStorage.taskToken || 'fde0d895b20856ccea4ff2df032c4450d6b692fd'; + const taskToken = sessionStorage.taskToken; if (config.url.indexOf('?') === -1) { config.url = `${config.url}?token=${taskToken}`; } else { diff --git a/src/military/index.scss b/src/military/index.scss index 3dae0f66..d3bf5f41 100644 --- a/src/military/index.scss +++ b/src/military/index.scss @@ -1,35 +1,35 @@ // 本模块公共样式 -.color-grey3{ +.color-grey3 { color: #333; } -.color-grey9{ +.color-grey9 { color: #999; } .color-orange { color: #ff6800; } -.color-deep-blue{ - color:#1B8FFF; +.color-deep-blue { + color: #1b8fff; } .centerbox { width: 1200px; margin: 40px auto; position: relative; } -.head-navigation{ - position: absolute; - top:-2.3em; - span{ +.head-navigation { + position: absolute; + top: -2.3em; + // width: 80vw; + // max-width: 1280px; + // margin: 40px auto; + // position: relative; + span { display: inline-flex; align-items: center; - &:hover{ + &:hover { color: #409eff; } } - width: 80vw; - max-width: 1280px; - margin: 40px auto; - position: relative; } .center-content { background: #fff; @@ -73,13 +73,6 @@ color: #fff; } -.head-navigation { - position: absolute; - top: -2.3em; - a:hover { - color: #409eff; - } -} // 内容标题左侧样式 .center-left-but { @@ -130,24 +123,24 @@ max-width: 500px; } -.link{ +.link { color: #0089ff; cursor: pointer; - &:hover{ - color:#509eff; + &:hover { + color: #509eff; } } -.color-grey-a{ +.color-grey-a { color: #aaa; } -.greater{ +.greater { position: relative; - top:-1px; + top: -1px; } -.none_panels{ +.none_panels { display: flex; justify-content: center; align-items: center; @@ -162,41 +155,41 @@ text-align: left; } - -.ant-modal-footer{ +.ant-modal-footer { text-align: center; border: 0; } - // 头像 -.head-log-big{ +.head-log-big { width: 4rem; height: 4rem; - margin-right: .5rem; + margin-right: 0.5rem; border-radius: 50%; } -.head-log-middle{ +.head-log-middle { width: 3rem; height: 3rem; - margin-right: .35rem; + margin-right: 0.35rem; border-radius: 50%; } -.head-log-small{ +.head-log-small { width: 1.25rem; height: 1.25rem; - margin-right: .35rem; + margin-right: 0.35rem; border-radius: 50%; } // 富文本样式 -.w-e-text table td, .w-e-text table th{ +.w-e-text table td, +.w-e-text table th { height: 30px; } .editor-w-text { - table td, table th{ + table td, + table th { border-bottom: 1px solid #ccc; border-right: 1px solid #ccc; padding: 3px 5px; @@ -221,15 +214,17 @@ font-size: 100%; background-color: #f1f1f1; } - a{ + a { color: #409eff; cursor: pointer; } } +.text-center{ + text-align: center; +} - -@media screen and (max-width: 1200px){ +@media screen and (max-width: 1200px) { .centerbox { width: 98%; } diff --git a/src/military/notice/api.js b/src/military/notice/api.js index d01e2a61..b397f779 100644 --- a/src/military/notice/api.js +++ b/src/military/notice/api.js @@ -9,7 +9,7 @@ export async function getNoticeList(params) { method: 'get', params, }); - if (res.code === '1') { + if (res.message === 'success') { return res.data; } else { notification.open({ @@ -27,7 +27,7 @@ export async function getNoticeDetail(id) { method: 'get', params:{flag:1} }); - if (res.code === '1') { + if (res.message === 'success') { return res.data; } else { notification.open({ diff --git a/src/military/task.js b/src/military/task.js index d356ef27..35db697f 100644 --- a/src/military/task.js +++ b/src/military/task.js @@ -73,19 +73,17 @@ const TaskAdmin = Loadable({ const Index = (propsTransmit) => { // 开发时,从代理的位置获取用户信息 - const [currentUser, setCurrentUser] = useState(null); - const isDev = window.location.href.indexOf('3007') > -1 ? true : false; + const [currentUser, setCurrentUser] = useState(propsTransmit.current_user); + // const isDev = window.location.href.indexOf('3007') > -1 ? true : false; useEffect(() => { - isDev && getUserInfo().then(res => { + getUserInfo().then(res => { if (res && res.data) { setCurrentUser(res.data); } }) - }, [isDev]) + }, []) let propsF = { ...propsTransmit }; - if (isDev && currentUser) { - propsF.current_user = currentUser; - } + propsF.current_user = currentUser; return (
diff --git a/src/military/task/agreementManage/index.js b/src/military/task/agreementManage/index.js index d25bb8ec..8fee7247 100644 --- a/src/military/task/agreementManage/index.js +++ b/src/military/task/agreementManage/index.js @@ -1,5 +1,6 @@ import React, { useCallback, forwardRef, useEffect, useState } from 'react'; import { Input, Button, Form, Select } from 'antd'; +import AdminRouter from '../components/adminRouter'; import ItemAgreementManage from '../components/itemAgreementManage'; import StatusNav from '../../components/statusNav'; import { agreementArr } from '../static'; @@ -90,7 +91,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his return (
- +
{helper( diff --git a/src/military/task/components/adminRouter/index.jsx b/src/military/task/components/adminRouter/index.jsx index f7351a50..d56e53b1 100644 --- a/src/military/task/components/adminRouter/index.jsx +++ b/src/military/task/components/adminRouter/index.jsx @@ -5,6 +5,9 @@ import './index.scss'; const { SubMenu } = Menu; export default props => { + const main_web_site_url = useMemo(() => { + return JSON.parse(localStorage.chromesetting).main_web_site_url; + }); const current_main_site_url = useMemo(() => { return JSON.parse(localStorage.chromesetting).current_main_site_url; }); @@ -18,77 +21,76 @@ export default props => { const taskMenu = useMemo(() => { return - 任务领域 - 行业信息 - 职位信息 - 需求导入模板 - 签订协议内容 - 应征投稿协议内容 + 任务领域 + 行业信息 + 职位信息 + 需求导入模板 + 签订协议内容 + 应征投稿协议内容 - 延期任务处理 - 协议签订凭证上传 + 延期任务处理 + 协议签订凭证上传 支付报酬凭证上传 创客列表 - 创意征集评论 + 创意征集评论 }); const competitionMenu = useMemo(() => { return - 竞赛列表 + 竞赛列表 }); const userMenu = useMemo(() => { return - 用户列表 - 主体信息列表 - 试用授权列表 - 自动授权列表 + 用户列表 + 主体信息列表 + 试用授权列表 + 自动授权列表 }); const forumMenu = useMemo(() => { return - 帖子 - 申请删帖 - 回复 - 版块配置 - 禁言列表 - 版主审批 + 帖子 + 申请删帖 + 回复 + 版块配置 + 禁言列表 + 版主审批 }); const checkMenu = useMemo(() => { return - 企业认证 - 开源项目 + 企业认证 + 开源项目 统筹任务发布审批 协议审批 - 成果举报申诉 + 成果举报申诉 评选佐证材料 - 支付报酬凭证上传 }); const limitsMenu = useMemo(() => { return - 权限组配置 - 权限操作配置 + 权限组配置 + 权限操作配置 }); const configMenu = useMemo(() => { return - 关于我们 - 首页版块 - 合作伙伴 + 关于我们 + 首页版块 + 合作伙伴 }); diff --git a/src/military/task/components/itemListMyTask/index.jsx b/src/military/task/components/itemListMyTask/index.jsx index c8f736a6..3b2d6476 100644 --- a/src/military/task/components/itemListMyTask/index.jsx +++ b/src/military/task/components/itemListMyTask/index.jsx @@ -21,6 +21,7 @@ export default Form.create()((props) => { const [page, setPage] = useState(1); const [visibleProofs, setVisibleProofs] = useState(false); const [taskId, setTaskId] = useState(); + const [checkItem, setCheckItem] = useState({}); const [taskModeId, setTaskModeId] = useState(''); const pageSize = props.pageSize || 10; @@ -54,6 +55,7 @@ export default Form.create()((props) => { function uploadAgree(item) { setVisibleAgree(true); setTaskId(item.id); + setCheckItem(item); } function chooseMethod() { @@ -257,7 +259,9 @@ export default Form.create()((props) => { onCancel={() => { setVisibleAgree(false) }} className="form-edit-modal" > - + {checkItem.auditing &&

+ {checkItem.auditing.message} +

} { - const { list, curPage, total, changePage, loading, applyStatusAllNameArr, reloadList, showNotification, current_user, form, detailStatus,agreementSigning } = props; + const { list, curPage, total, changePage, loading, applyStatusAllNameArr, reloadList, showNotification, current_user, form, detailStatus, agreementSigning } = props; const { getFieldDecorator, validateFields, setFieldsValue } = form; const [page, setPage] = useState(1); const pageSize = props.pageSize || 10; @@ -160,7 +160,7 @@ export default Form.create()((props) => { {((item.needComplain && detailStatus === 3) || (detailStatus === 5 && item.status !== 2)) && (current_user.login === item.user.login) && { setComplainVisible(true); setCheckedItem(item) }}>申诉} - {item.status === 2 && detailStatus === 6 && (current_user.login === item.user.login) && + {item.status === 2 && detailStatus === 6 && (current_user.login === item.user.login) && (!item.sign) && { setAgreeVisible(true); setCheckedItem(item) }}>签订协议} {item.status === 2 && detailStatus === 7 && (current_user.login === item.user.login) && (item.agreementSigning === 1) && (!item.isPay) && diff --git a/src/military/task/components/proofModal/index.jsx b/src/military/task/components/proofModal/index.jsx index c61a1520..6166d858 100644 --- a/src/military/task/components/proofModal/index.jsx +++ b/src/military/task/components/proofModal/index.jsx @@ -121,8 +121,8 @@ export default Form.create()(props => { const handleRow = record => { return { onClick: event => { - let chooseDom = event.currentTarget.getElementsByClassName("ant-checkbox-wrapper") || event.currentTarget.getElementsByClassName("ant-radio-wrapper"); - chooseDom && chooseDom[0] && chooseDom[0].click(); + let chooseDom = event.currentTarget.getElementsByClassName("ant-checkbox-wrapper")[0] || event.currentTarget.getElementsByClassName("ant-radio-wrapper")[0]; + chooseDom && chooseDom.click(); }, }; }; diff --git a/src/military/task/paperManage/index.jsx b/src/military/task/paperManage/index.jsx index d086bf00..093d1411 100644 --- a/src/military/task/paperManage/index.jsx +++ b/src/military/task/paperManage/index.jsx @@ -76,6 +76,31 @@ export default Form.create()(({ current_user, form, showNotification, match, his setSearchObj({}); } + function checkPaperItem(paperId, passStatus) { + validateFields((err, values) => { + if (!err) { + setLoading(true); + checkPaper({ + paperId, + auditingVo: { + pass: passStatus ? 1 : values.pass, + message: values.message, + } + }).then(res => { + setLoading(false); + if (res && res.message === 'success') { + setReload(Math.random()); + setVisible(false); + setFieldsValue({ + pass: '', + message: '', + }) + } + }); + } + }); + } + const columns = useMemo(() => { return [ { @@ -150,30 +175,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his }); } - function checkPaperItem(paperId, passStatus) { - validateFields((err, values) => { - if (!err) { - setLoading(true); - checkPaper({ - paperId, - auditingVo: { - pass: passStatus ? 1 : values.pass, - message: values.message, - } - }).then(res => { - setLoading(false); - if (res && res.message === 'success') { - setReload(reload + 1); - setVisible(false); - setFieldsValue({ - pass: '', - message: '', - }) - } - }); - } - }); - } + function changeStatus(e) { setSearchObj({ diff --git a/src/military/task/taskDetail/index.jsx b/src/military/task/taskDetail/index.jsx index 4616a4a2..1ab2a779 100644 --- a/src/military/task/taskDetail/index.jsx +++ b/src/military/task/taskDetail/index.jsx @@ -10,7 +10,6 @@ import ProofModal from '../components/proofModal'; import { getTaskDetail, getTaskCategory, getTaskPaper, makePublic, addPaper, getAgreement, agreement, checkAgreement, checkHavePaper } from '../api'; import { taskModeIdArr, applyStatusArr, applyStatusAllArr, agreementContent } from '../static'; import { httpUrl } from '../../fetch'; -import winpng from '../image/win.png'; import './index.scss'; const { TextArea } = Input; @@ -130,6 +129,13 @@ export default Form.create()( for (const item of data.rows) { item.detail = item.paperDetail ? item.paperDetail.content : ""; } + data.rows.sort((a, b) => { + if (b.status < a.status) { + return -1; + } else { + return 0; + } + }); } setDataList(data.rows || []); setLoading(false); @@ -163,7 +169,7 @@ export default Form.create()( {title} {detailData.status !== status && days &&

{days}天

} - {detailData.status === status&&detailData.status !== 8 && detailData.delayTime &&

{detailData.delayTime}

} + {detailData.status === status && detailData.status !== 8 && detailData.delayTime &&

{detailData.delayTime}

} {/* 因为有时只延期几秒或者几分钟时后端没有返回延期,所以这里加一个判断 */} {detailData.status === status && (!detailData.delayTime) && days &&

{surplusTimetext.indexOf('-') > 0 ? ('延期' + surplusTimetext.replaceAll('-', '')) : ('剩余' + surplusTimetext)}

} @@ -255,7 +261,7 @@ export default Form.create()( onOk: () => { makePublic(id).then(res => { if (res && res.message === 'success') { - setReload(reload+1); + setReload(reload + 1); } else { showNotification('操作失败'); }