Merge branch 'expert_review' of https://code.gitlink.org.cn/durian/forgeplus-react into dev_military_osredm

This commit is contained in:
何童崇 2022-01-20 15:34:10 +08:00
commit c2c3f3ef98
8 changed files with 54 additions and 24 deletions

View File

@ -18,6 +18,14 @@ export async function expertList(params) {
}
}
//删除专家
export function deleteExpert(expertId) {
return fetch({
url: `/api/experts/${expertId}?isDelete=1`,
method: 'delete'
});
}
// 获取用户信息
export function getUserInfo() {
return fetch({

View File

@ -1,10 +1,10 @@
import React, { useState, useMemo, useEffect } from "react";
import { Input, Select, Button, Form, Table, Upload, Modal } from 'antd';
import { Input, Select, Button, Form, Table, Upload, Modal, Popconfirm, message } from 'antd';
import cookie from 'react-cookies';
import { exportExcel } from '../components/exportExcel.js';
import Paginationtable from "../../components/paginationTable";
import { Info } from '../../components/ModalFun';
import { expertList } from "../api";
import { expertList, deleteExpert } from "../api";
import { professionalType, reviewArea } from "../static";
import { httpUrl } from '../fetch';
@ -38,12 +38,14 @@ function RegisterList({ showNotification }) {
return [{
title: '姓名',
dataIndex: 'expertName',
width: 75,
width: 85,
key: 'expertName',
fixed: 'left',
// render: (text, record) => {
// return record.user ? record.user.nickname || record.user.login : ''
// }
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
},
{
title: '最高学历',
@ -52,9 +54,13 @@ function RegisterList({ showNotification }) {
width: 80,
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
title: '专家评估',
dataIndex: 'expertScore',
key: 'expertScore',
width: 80,
render: (text, record) => {
return text || '--'
}
},
{
title: '工作单位',
@ -186,6 +192,15 @@ function RegisterList({ showNotification }) {
})
}
},
{
title: '操作',
dataIndex: 'id',
key: 'action',
fixed: 'right',
render: (text, record)=>{
return <Popconfirm placement="bottom" title="你确认要删除此专家吗?" onConfirm={() => { delExpert(text);}} okText="是" cancelText="否"><Button size="small" type="primary">删除</Button></Popconfirm>
}
}
];
}, []);
@ -233,6 +248,20 @@ function RegisterList({ showNotification }) {
});
}, [download]);
//
const delExpert=(expertId)=>{
setLoading(true);
deleteExpert(expertId).then(response=>{
if(response && response.message === "删除专家成功"){
message.success("删除成功");
setReload(Math.random());
}else{
message.error("删除失败");
}
}).finally(()=>{
setLoading(false);
})
}
function beforeUpload(file) {
const isExcel = file.type.indexOf('xlsx') || file.type.indexOf('xls') || file.type.indexOf('sheet');
@ -350,7 +379,6 @@ function RegisterList({ showNotification }) {
rowKey={(row) => row.id}
/>
<Modal
title="上传"
visible={visible}

View File

@ -9,7 +9,7 @@
.center-right-but{
flex:auto;
justify-content: space-between;
margin:0 4em 2em 0;
margin-right: 4em;
}
.ant-form-item-control-wrapper{

View File

@ -252,7 +252,6 @@ export default Form.create()(({ match, history, showNotification, form, current_
}
}
return (
<div className='register_right'>
{
@ -561,9 +560,10 @@ export default Form.create()(({ match, history, showNotification, form, current_
<div className='hint'>提示个人简介职称证明学术成果荣誉称号都只能上传一个文件建议上传zip或rar格式的压缩文件</div>
</Form>
<div className='buts'>
<Button className="but41_fill mr20" type="primary" disabled={forbidden} onClick={() => expertRegisterSubmit(true)}>{lastRegister && lastRegister.status === 1 ? '修改' : '提交'}资料</Button>
{/* 专家: 修改,非专家: 提交 */}
<Button className="but41_fill mr20" type="primary" disabled={forbidden} onClick={() => expertRegisterSubmit(true)}>{current_user.expert ? '修改' : '提交'}资料</Button>
{(!lastRegister || lastRegister.status !== 1) && <Button className="but41_border mr20" disabled={forbidden} onClick={draft}>保存资料</Button>}
<Button className="butE3_border" onClick={cancel}></Button>
<Button className="butE3_border" onClick={cancel}>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</Button>
<Modal
title={`${lastRegister && lastRegister.status === 1 ? '修改' : '提交'}资料`}

View File

@ -85,15 +85,9 @@
border: 1px solid #4154f1 !important;
}
}
.but41_border {
margin-bottom: 0.6em;
padding: 0 0.5em;
}
.ant-cascader-menu-item:hover {
background: #f2f3ff;
}
// }
.buts {
font-size: 0.7em;
padding: 1.5em 2em;

View File

@ -382,9 +382,9 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
<button className="back-button but41_border" onClick={() => { history.goBack() }}>返回上一页</button>
</p>
<Tabs defaultActiveKey="1" animated={false}>
<Tabs defaultActiveKey="0" animated={false}>
<TabPane tab="评信息" key="0">
<TabPane tab="评信息" key="0">
<div className="task-rules">
<div className="rules-box">
<p className="rules-head">任务信息</p>

View File

@ -85,7 +85,7 @@ function SelectExpert(props) {
align: 'center',
},
{
title: '专家评',
title: '专家评',
dataIndex: 'expertScore',
align: 'center',
render:(text,record)=>{

View File

@ -324,7 +324,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
width: 260,
},
{
title: '专家评',
title: '专家评',
dataIndex: 'expertScore',
align: 'center',
render:(text,record)=>{