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) {
{details.author.name} 添加于{details.created_at} + {details.score>0&&综合得分: {details.score}分}
} + { details.user_permission && - +
+ + +
}
@@ -572,7 +576,7 @@ function Details(props) { setScoreVisible(false)} @@ -580,7 +584,11 @@ function Details(props) {
@@ -589,7 +597,7 @@ function Details(props) { centered >
-
+ {/* {getFieldDecorator("score", { rules: [ @@ -599,7 +607,19 @@ function Details(props) { )} -
+ */} +
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((item, index) => { + return
{ + setScoreActive(item) + }} style={{ + width: '30px', height: '30px', marginRight: '10px', textAlign: 'center', + lineHeight: "30px", border: '1px solid', background: scoreActive == item ? '#2A61FF' : '#fff', + borderColor: scoreActive == item ? '#2A61FF' : '#999999', + color: scoreActive == item ? '#fff' : '#666666', cursor: "pointer" + }}>{item}
+ })} +