diff --git a/src/forge/Issues/Pages/details.jsx b/src/forge/Issues/Pages/details.jsx index 46cd9c959..8f2a1ca4c 100644 --- a/src/forge/Issues/Pages/details.jsx +++ b/src/forge/Issues/Pages/details.jsx @@ -17,8 +17,8 @@ import Claims from '../../claims/claims'; import ChooseMenu from '../Component/chooseMenu'; import CaseDrop from '../Component/caseDrop'; import Nodata from '../../../forge/Nodata'; -import pf from './pf.png'; -import pfjl from './pfjl.png'; +import pf from './pf.jpg'; +import pfjl from './pfjl.jpg'; function Details(props) { const owner = props.match.params.owner; @@ -64,6 +64,8 @@ function Details(props) { const [rewardFlag, setRewardFlag] = useState(false); const [caseValue, setCaseValue] = useState(undefined); + const [scoreActive, setScoreActive] = useState(''); + const pathname = props.history.location.pathname; const permission = props && props.projectDetail && props.projectDetail.permission; let colors = ["#1abcb1", "#28be6c", "#e67e22", "#db3d1d"]; @@ -96,7 +98,7 @@ function Details(props) { const url = `/v1/${owner}/${projectsId}/issues/${index}`; axios.get(url).then(result => { if (result && result.data) { - let data=result.data + let data = result.data setDetails(data); let per = data && !data.user_permission; setEditFlag(per); @@ -125,23 +127,10 @@ function Details(props) { setOrderId(data.id); } - - - let urls = `/ratings.json`; - axios.get(urls, { - params: { - ratee_type: 'Issue', - ratee_id: result.data.id, - } - }).then(result => { - if (result && result.data && result.data.status === 0) { - recordsData.current = result.data.data - } - }).catch(error => { }) }).catch(error => { console.log(error); }) - + } @@ -385,25 +374,22 @@ function Details(props) { }; function onSure() { - validateFields((error, values) => { - if (!error) { - let url = `/ratings.json`; - // const { email , is_sync_pwd} = current_user; - // if(email && !is_sync_pwd){ - // url = `/users/change_password.json`; - // } - axios.post(url, { - ratee_type: 'Issue', - ratee_id: details.id, - ...values - }).then(result => { - if (result && result.data && result.data.status === 0) { - Init() - setScoreVisible(false) - } - }).catch(error => { }) + let url = `/ratings.json`; + // const { email , is_sync_pwd} = current_user; + // if(email && !is_sync_pwd){ + // url = `/users/change_password.json`; + // } + axios.post(url, { + ratee_type: 'Issue', + ratee_id: details.id, + score: scoreActive, + }).then(result => { + if (result && result.data && result.data.status === 0) { + Init() + setScoreVisible(false) + message.success('评分成功!') } - }) + }).catch(error => { }) } return ( @@ -447,21 +433,39 @@ function Details(props) {