forked from Gitlink/forgeplus-react
Merge pull request '创客系统升级,权限修改,增加成果库等' (#490) from tongChong/forgeplus-react:feature_achieve into pre_dev_military
This commit is contained in:
commit
ff6a9c927b
19
src/App.js
19
src/App.js
|
@ -59,6 +59,11 @@ const Notice = Loadable({
|
|||
loader: () => import('./military/notice'),
|
||||
loading: Loading,
|
||||
})
|
||||
// 成果库
|
||||
const Achievement = Loadable({
|
||||
loader: () => import('./military/achievement'),
|
||||
loading: Loading,
|
||||
})
|
||||
//任务/需求
|
||||
const Task = Loadable({
|
||||
loader: () => import('./military/task'),
|
||||
|
@ -156,7 +161,7 @@ const Managements = Loadable({
|
|||
// })
|
||||
|
||||
// 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。
|
||||
const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder","task","notice","managements","expert","competition","administration", "needs"];
|
||||
const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder","task","notice","achievement","managements","expert","competition","administration", "needs"];
|
||||
|
||||
class App extends Component {
|
||||
constructor(props) {
|
||||
|
@ -176,7 +181,6 @@ class App extends Component {
|
|||
initAxiosInterceptors(this.props);
|
||||
let pathname = window.location.pathname ? window.location.pathname.split('/')[1] : '';
|
||||
pathname && this.getPathnameType(pathname);
|
||||
|
||||
// 添加路由监听,决定组织还是个人
|
||||
this.unlisten = this.props.history.listen((location,history) => {
|
||||
let newPathname = location.pathname.split('/')[1];
|
||||
|
@ -192,7 +196,7 @@ class App extends Component {
|
|||
return true;
|
||||
}
|
||||
// 阻止个人与组织切换时(组件渲染)请求导致的404
|
||||
if (nextProps.location.pathname.split('/')[1] !== this.props.location.pathname.split('/')[1] && nextState.pathType === this.state.pathType) {
|
||||
if (nextProps.location.pathname.split('/')[1] !== this.props.location.pathname.split('/')[1] && nextState.pathType === this.state.pathType &&!keyWord.includes( this.state.pathType)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
@ -388,6 +392,15 @@ class App extends Component {
|
|||
}
|
||||
}>
|
||||
</Route>
|
||||
{/*成果*/}
|
||||
<Route
|
||||
path={"/achievement"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<Achievement {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
{/*任务*/}
|
||||
<Route path="/task" component={Task} />
|
||||
{/*专家评审*/}
|
||||
|
|
|
@ -33,7 +33,8 @@ export function initAxiosInterceptors(props) {
|
|||
initOnlineOfflineListener();
|
||||
|
||||
// var proxy = "http://192.168.1.40:3000";
|
||||
var proxy = "http://111.8.36.180:8000";
|
||||
// var proxy = "http://111.8.36.180:8000";
|
||||
var proxy = "http://117.50.100.12:49999";
|
||||
// var proxy = "https://www.osredm.com";
|
||||
|
||||
//响应前的设置
|
||||
|
|
|
@ -8,6 +8,7 @@ export default (props) => {
|
|||
return (
|
||||
<div className='pagination-table'>
|
||||
<Table
|
||||
rowKey={(row,i) => row.id||i}
|
||||
{...props}
|
||||
pagination={false}
|
||||
onRow={handleRow}
|
||||
|
|
|
@ -80,7 +80,7 @@ function AddProjectModal(props){
|
|||
</Modal>
|
||||
{/* 红山无资料要求限制,暂时注释 */}
|
||||
{/* <CheckProfile {...props} sureFunc={()=>setVisible(true)}>加入项目</CheckProfile> */}
|
||||
<Button type="primary" onClick={()=>setVisible(true)}>加入项目</Button>
|
||||
<a onClick={()=>setVisible(true)}>加入项目</a>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
import fetch from 'military/achievement/fetch';
|
||||
import showNotification from '../components/ShowNotification';
|
||||
|
||||
|
||||
// 成果列表查询
|
||||
export async function getNoticeList(params) {
|
||||
let res = await fetch({
|
||||
url: '/api/announcements/',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
if (res.message === 'success') {
|
||||
return res.data;
|
||||
} else {
|
||||
showNotification(res.message || '请求错误');
|
||||
}
|
||||
}
|
||||
|
||||
//新增成果
|
||||
export function addNotice(data) {
|
||||
return fetch({
|
||||
url: '/api/announcements/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
//删除成果
|
||||
export function deleteNotice(id) {
|
||||
return fetch({
|
||||
url: '/api/announcements/' + id,
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
//更新成果
|
||||
export function editNotice(data) {
|
||||
return fetch({
|
||||
url: '/api/announcements/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
//审核成果
|
||||
export function checkNotice(data) {
|
||||
return fetch({
|
||||
url: '/api/announcements/check',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 成果详情查询
|
||||
export async function getNoticeDetail(id) {
|
||||
let res = await fetch({
|
||||
url: '/api/announcements/' + id,
|
||||
method: 'get',
|
||||
});
|
||||
if (res.data) {
|
||||
return res.data;
|
||||
} else {
|
||||
showNotification(res.message || '请求错误');
|
||||
}
|
||||
}
|
||||
|
||||
// 成果密文查看人详情
|
||||
export async function getNoticeReader(params) {
|
||||
let res = await fetch({
|
||||
url: '/api/request_contact_reader_info/',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
if (res.data) {
|
||||
return res.data;
|
||||
} else {
|
||||
showNotification(res.message || '请求错误');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
import React from "react";
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import Loadable from "react-loadable";
|
||||
import Loading from "../../Loading";
|
||||
|
||||
// 成果管理
|
||||
const NoticeList = Loadable({
|
||||
loader: () => import("./noticeList"),
|
||||
loading: Loading,
|
||||
});
|
||||
// 成果管理详情
|
||||
const NoticeDetail = Loadable({
|
||||
loader: () => import("./noticeDetail"),
|
||||
loading: Loading,
|
||||
});
|
||||
// 成果管理编辑
|
||||
const NoticeEdit = Loadable({
|
||||
loader: () => import("./noticeEdit"),
|
||||
loading: Loading,
|
||||
});
|
||||
// 成果reader
|
||||
const NoticeReader = Loadable({
|
||||
loader: () => import("./noticeReader"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
export default (propsF)=>{
|
||||
return (
|
||||
<Switch {...propsF}>
|
||||
{/* 成果列表 */}
|
||||
<Route
|
||||
path="/managements/achievement/list/:isChecked"
|
||||
render={(props) => (
|
||||
<NoticeList {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
{/* 成果详情 */}
|
||||
<Route
|
||||
path="/managements/achievement/detail/:noticeId"
|
||||
render={(props) => (
|
||||
<NoticeDetail {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
{/* 成果编辑 */}
|
||||
<Route
|
||||
path="/managements/achievement/edit/:noticeId"
|
||||
render={(props) => (
|
||||
<NoticeEdit {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
{/* 成果新增 */}
|
||||
<Route
|
||||
path="/managements/achievement/edit"
|
||||
render={(props) => (
|
||||
<NoticeEdit {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
{/* 成果预览 */}
|
||||
<Route
|
||||
path="/managements/achievement/reader/:noticeId"
|
||||
render={(props) => (
|
||||
<NoticeReader {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
</Switch>
|
||||
)
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
.notice-content {
|
||||
min-height: 50vh;
|
||||
margin: 1em;
|
||||
background: #fff;
|
||||
border-radius: 1em;
|
||||
box-shadow: 0 1px 2px #d9d9d9;
|
||||
padding-bottom: 1vh;
|
||||
}
|
||||
|
||||
.notice-title {
|
||||
padding: 0.75em;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.notice-form .edit-input{
|
||||
max-width:450px;
|
||||
}
|
||||
|
||||
.my-search-button{
|
||||
margin-top:4px;
|
||||
}
|
||||
|
||||
.encrypt-item{
|
||||
margin-top: -24px;
|
||||
}
|
||||
|
||||
.encrypt-item .ant-form-item-label{
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.ant-radio-checked .ant-radio-inner{
|
||||
border-color: #4154f1;
|
||||
}
|
||||
.ant-radio-inner::after{
|
||||
background-color: #4154f1;
|
||||
}
|
||||
.ant-radio-wrapper:hover .ant-radio, .ant-radio:hover .ant-radio-inner, .ant-radio-input:focus + .ant-radio-inner{
|
||||
border-color: #4154f1;
|
||||
}
|
||||
.ant-radio-checked::after{
|
||||
border: 1px solid #4154f1;
|
||||
}
|
||||
|
||||
.but41_fill {
|
||||
color: white;
|
||||
background-color: #4154f1;
|
||||
&:hover {
|
||||
background-color: #5d6eff;
|
||||
}
|
||||
&:active {
|
||||
background-color: #374bf2;
|
||||
}
|
||||
}
|
||||
|
||||
.importFile{
|
||||
margin:30px auto;
|
||||
text-align: center;
|
||||
}
|
||||
.mess.fail span{
|
||||
color: #f5222d;
|
||||
margin:0 4px;
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { Button, Descriptions, Icon } from 'antd';
|
||||
import ShowNotification from '../../components/ShowNotification';
|
||||
import { noticeChecked } from '../../common/static';
|
||||
import { achieveSource, achieveType } from 'military/achievement/static';
|
||||
import { getNoticeDetail, checkNotice } from '../api';
|
||||
import '../index.scss';
|
||||
import './index.scss';
|
||||
|
||||
const achieveSourceArr = [];
|
||||
for (const item of achieveSource) {
|
||||
achieveSourceArr[item.code] = (item.name);
|
||||
}
|
||||
const achieveTypeArr = [];
|
||||
for (const item of achieveType) {
|
||||
achieveTypeArr[item.code] = (item.name);
|
||||
}
|
||||
const noticeCheckedArr = [];
|
||||
for (const item of noticeChecked) {
|
||||
noticeCheckedArr[item.code] = (item.name);
|
||||
}
|
||||
|
||||
const IndexPage = ({ match, history, current_user: { admin } }) => {
|
||||
const [noticeData, setNoticeData] = useState({});
|
||||
const id = match.params.noticeId;
|
||||
|
||||
useEffect(() => {
|
||||
id && getNoticeDetail(id).then(data => {
|
||||
setNoticeData(data || {});
|
||||
})
|
||||
}, [id]);
|
||||
|
||||
// 审核
|
||||
function checkItem(isChecked) {
|
||||
checkNotice({
|
||||
id: noticeData.id,
|
||||
isChecked,
|
||||
}).then(res => {
|
||||
if (res && res.code == '1') {
|
||||
ShowNotification("操作成功");
|
||||
history.go(-1);
|
||||
} else {
|
||||
ShowNotification(res.message || "操作失败");
|
||||
history.go(-1);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function download(url) {
|
||||
if (window.location.href.indexOf('localhost') > -1) {
|
||||
url = 'http://106.75.31.211:58088' + url;
|
||||
}
|
||||
window.open(url);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="notice-content">
|
||||
<h4 className="notice-title"><span className='backList' onClick={() => { history.go(-1) }}><Icon type="left" />返回</span>成果详情</h4>
|
||||
|
||||
<Descriptions className='itemContent' column={1}>
|
||||
<Descriptions.Item label="成果状态"><span className='statusColor'>{noticeData.status == 1 ? noticeCheckedArr[noticeData.isChecked] : '草稿'}</span></Descriptions.Item>
|
||||
<Descriptions.Item label="成果名称">{noticeData.title}</Descriptions.Item>
|
||||
<Descriptions.Item label="成果来源">{achieveSourceArr[noticeData.achievementSource]}</Descriptions.Item>
|
||||
<Descriptions.Item label="成果类型">{achieveTypeArr[noticeData.achievementCategory]}</Descriptions.Item>
|
||||
<Descriptions.Item label="发布单位">{noticeData.publisher}</Descriptions.Item>
|
||||
<Descriptions.Item label="成果描述" className='alignTop'><div className="editor-w-text" dangerouslySetInnerHTML={{ __html: noticeData.text }}></div></Descriptions.Item>
|
||||
<Descriptions.Item label="联系人">{noticeData.achievementIntro}</Descriptions.Item>
|
||||
<Descriptions.Item label="联系方式" className='alignTop'><div className="editor-w-text" dangerouslySetInnerHTML={{ __html: noticeData.contactInfo && noticeData.contactInfo.replace(/\n/g, '</br>') }}></div></Descriptions.Item>
|
||||
<Descriptions.Item label="成果附件">
|
||||
<div style={{ color: '#1890ff' }} onClick={() => { download(noticeData.fileDownloadPath) }}>{noticeData.fileName}</div>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="创建时间">{noticeData.createdAt}</Descriptions.Item>
|
||||
{noticeData.publishDate && <Descriptions.Item label="发布时间">{noticeData.publishDate}</Descriptions.Item>}
|
||||
{/* <Descriptions.Item label="截止时间">{noticeData.closingDate}</Descriptions.Item> */}
|
||||
<Descriptions.Item label="">
|
||||
{admin && noticeData.status == 1 && noticeData.isChecked == 2 &&
|
||||
<React.Fragment>
|
||||
<Button className="mr20" type="primary" onClick={() => { checkItem(1) }}>通过</Button>
|
||||
<Button className="mr20" type="primary" onClick={() => { checkItem(0) }}>拒绝</Button>
|
||||
<Button className="mr20" onClick={() => { history.go(-1) }}>取消</Button>
|
||||
</React.Fragment>
|
||||
}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
export default IndexPage;
|
|
@ -0,0 +1,22 @@
|
|||
.itemContent {
|
||||
padding: 10px 10px 0 30px;
|
||||
}
|
||||
.statusColor{
|
||||
color: #1890ff;
|
||||
}
|
||||
.alignTop{
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.backList{
|
||||
margin-right:1em;
|
||||
&:hover{
|
||||
color: #1890ff;
|
||||
}
|
||||
}
|
||||
|
||||
:global{
|
||||
.ant-descriptions-item-label{
|
||||
min-width: 5em;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,391 @@
|
|||
import React, { Fragment, useCallback, useEffect, useState } from 'react';
|
||||
import ReactWEditor from 'wangeditor-for-react';
|
||||
import { Form, Input, Button, Radio, Checkbox, Modal, Upload } from 'antd';
|
||||
import cookie from 'react-cookies';
|
||||
import { achieveSource, achieveType } from 'military/achievement/static';
|
||||
import ShowNotification from '../../components/ShowNotification';
|
||||
import { getNoticeDetail, addNotice, editNotice } from '../api';
|
||||
import { httpUrl } from 'military/achievement/fetch';
|
||||
import { Info } from 'military/components/ModalFun';
|
||||
import UploadMine from 'military/components/Upload';
|
||||
|
||||
import '../index.scss';
|
||||
const format = "YYYY-MM-DD HH:mm:ss";
|
||||
const { TextArea } = Input;
|
||||
|
||||
let actionUrl = httpUrl;
|
||||
|
||||
const NoticeEdit = Form.create()(({ form, match, history, showNotification }) => {
|
||||
|
||||
const [fileList, setFileList] = useState(null);
|
||||
const [noticeHtml, setNoticeHtml] = useState('');
|
||||
const id = match.params.noticeId;
|
||||
const { getFieldDecorator, validateFields, setFieldsValue } = form;
|
||||
const [typeValue, setTypeValue] = useState(4);
|
||||
const [isSecret, setIsSecret] = useState();
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
id && getNoticeDetail(id).then(data => {
|
||||
const formValue = {
|
||||
type: data.type,
|
||||
achievementSource: data.achievementSource,
|
||||
achievementCategory: data.achievementCategory,
|
||||
achievementIntro: data.achievementIntro,
|
||||
title: data.title,
|
||||
publisher: data.publisher,
|
||||
text: data.text,
|
||||
contactInfo: data.contactInfo,
|
||||
};
|
||||
setFieldsValue(formValue);
|
||||
setNoticeHtml(data.text || '');
|
||||
setIsSecret(Boolean(data.isSecret));
|
||||
if (data.fileName) {
|
||||
setFileList([{
|
||||
name: data.fileName,
|
||||
fileName: data.fileName,
|
||||
fileDownloadPath: data.fileDownloadPath,
|
||||
uid: "rc-upload" + data.id
|
||||
}])
|
||||
}
|
||||
})
|
||||
}, [id]);
|
||||
|
||||
// 上传附件后得到的文件数组
|
||||
function UploadFunc(fileList) {
|
||||
setFileList(fileList);
|
||||
}
|
||||
|
||||
const helper = useCallback(
|
||||
(label, name, rules, widget, initialValue) => (
|
||||
<Form.Item label={label}>
|
||||
{getFieldDecorator(name, { rules, initialValue, validateFirst: true })(widget)}
|
||||
</Form.Item>
|
||||
),
|
||||
[]
|
||||
);
|
||||
|
||||
const editor = useCallback(() => (
|
||||
<Form.Item label={"成果描述:"} required={true}>
|
||||
{(!id || (id && noticeHtml)) &&
|
||||
<ReactWEditor
|
||||
defaultValue={noticeHtml}
|
||||
config={
|
||||
{
|
||||
placeholder: "请输入成果描述",
|
||||
excludeMenus: [
|
||||
'list',
|
||||
'todo',
|
||||
'emoticon',
|
||||
'video'
|
||||
],
|
||||
uploadImgServer: actionUrl + '/busiAttachments/upload',
|
||||
uploadFileName: 'file',
|
||||
uploadImgHeaders: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
},
|
||||
uploadImgHooks: {
|
||||
// 图片上传并返回了结果,想要自己把图片插入到编辑器中
|
||||
customInsert: function (insertImgFn, result) {
|
||||
// result 即服务端返回的接口
|
||||
// insertImgFn 可把图片插入到编辑器,传入图片 src ,执行函数即可
|
||||
if (result && result.data && result.data.id) {
|
||||
insertImgFn(`${actionUrl}/busiAttachments/view/${result.data.id}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onChange={(html) => {
|
||||
changeHtml(html);
|
||||
}}
|
||||
/>}
|
||||
|
||||
{getFieldDecorator('text', {
|
||||
rules: [{ required: true, message: "请输入成果描述" }],
|
||||
validateFirst: true
|
||||
})(<Input style={{ display: 'none' }} />)}
|
||||
</Form.Item>
|
||||
), [noticeHtml])
|
||||
|
||||
const formItemLayout = {
|
||||
labelCol: {
|
||||
xs: { span: 10 },
|
||||
sm: { span: 8 },
|
||||
lg: { span: 3 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 14 },
|
||||
sm: { span: 16 },
|
||||
lg: { span: 16 },
|
||||
},
|
||||
};
|
||||
|
||||
const tailFormItemLayout = {
|
||||
wrapperCol: {
|
||||
xs: {
|
||||
span: 20,
|
||||
offset: 4,
|
||||
},
|
||||
sm: {
|
||||
span: 20,
|
||||
offset: 4,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// 修改
|
||||
function saveItem(status) {
|
||||
validateFields((error, values) => {
|
||||
if (!error) {
|
||||
let params = {
|
||||
...values,
|
||||
status,
|
||||
fileDownloadPath: '',
|
||||
fileName: '',
|
||||
templateUrl: '',
|
||||
type: 7
|
||||
};
|
||||
params.isSecret = Number(params.isSecret);
|
||||
if (fileList && fileList.length) {
|
||||
params.fileName = fileList[0].fileName || fileList[0].response.data.fileName;
|
||||
params.fileDownloadPath = fileList[0].fileDownloadPath || `${actionUrl}/busiAttachments/download/${fileList[0].response.data.id}`;
|
||||
}
|
||||
if (id) {
|
||||
// 编辑
|
||||
params.id = id;
|
||||
editNotice(params).then(res => {
|
||||
if (res.message === 'success') {
|
||||
ShowNotification("操作成功!");
|
||||
if (status == 1) {
|
||||
history.push('/managements/achievement/list/1');
|
||||
} else {
|
||||
history.push('/managements/achievement/list/draft');
|
||||
}
|
||||
} else {
|
||||
ShowNotification(res.message);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 新增
|
||||
addNotice(params).then(res => {
|
||||
if (res.message === 'success') {
|
||||
ShowNotification("成果新增成功!");
|
||||
if (status == 1) {
|
||||
history.push('/managements/achievement/list/1');
|
||||
} else {
|
||||
history.push('/managements/achievement/list/draft');
|
||||
}
|
||||
} else {
|
||||
ShowNotification(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function changeHtml(html) {
|
||||
setFieldsValue({
|
||||
text: html
|
||||
});
|
||||
// setNoticeHtml(html);
|
||||
}
|
||||
|
||||
function beforeUpload(file) {
|
||||
const isExcel = file.type.indexOf('xlsx') || file.type.indexOf('xls') || file.type.indexOf('sheet');
|
||||
if (!isExcel) {
|
||||
showNotification(`只支持.xlsx、xls格式!`);
|
||||
}
|
||||
return isExcel;
|
||||
}
|
||||
|
||||
function handleChange(info) {
|
||||
if (info.file.status === 'uploading' || info.file.status === 'done') {
|
||||
if (info.file.response) {
|
||||
let resData = info.file.response.data;
|
||||
if (resData) {
|
||||
Info({
|
||||
title: '提示',
|
||||
content: <div className="import-important">
|
||||
<div>执行成功!</div>
|
||||
{resData.successMessages && <div>
|
||||
<p>导入成功:</p>
|
||||
</div>}
|
||||
{resData.failMessages && <div>
|
||||
<p>导入失败:</p>
|
||||
<p dangerouslySetInnerHTML={{ __html: resData.failMessages }} className="mess fail"></p>
|
||||
</div>}
|
||||
</div>,
|
||||
});
|
||||
setVisible(false);
|
||||
} else {
|
||||
setVisible(false);
|
||||
showNotification(info.file.response.message || '系统错误');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (info.file.status === 'error') {
|
||||
showNotification(info.file.response.message || '系统错误');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const upload = {
|
||||
name: 'file',
|
||||
action: `${httpUrl}/api/announcements/importAchievementByExcel`,
|
||||
onChange: handleChange,
|
||||
beforeUpload: beforeUpload,
|
||||
size: 10,
|
||||
accept: ".xlsx,.xls",
|
||||
showUploadList: true,
|
||||
withCredentials: true,
|
||||
headers: {
|
||||
Authorization: cookie.load('autologin_trustie') || sessionStorage.osredmToken,
|
||||
},
|
||||
};
|
||||
|
||||
const urlHost = window.location.host;
|
||||
return (
|
||||
<div className="notice-content">
|
||||
<h4 className="notice-title">{id ? '修改' : '发布'}成果 <Button type="primary" className="ml10 but41_fill fr" onClick={() => { setVisible(true) }}>批量导入</Button></h4>
|
||||
|
||||
<Form className="notice-form" {...formItemLayout}>
|
||||
|
||||
{helper(
|
||||
"成果来源:",
|
||||
"achievementSource",
|
||||
[{ required: true, message: "请选择成果类型" }],
|
||||
<Radio.Group
|
||||
// onChange={(e) => { setTypeValue(e.target.value) }}
|
||||
>
|
||||
{
|
||||
achieveSource.map(item => {
|
||||
return <Radio key={item.code} value={item.code}>{item.name}</Radio>
|
||||
})
|
||||
}
|
||||
</Radio.Group>
|
||||
)}
|
||||
|
||||
{helper(
|
||||
"成果类型:",
|
||||
"achievementCategory",
|
||||
[{ required: true, message: "请选择成果类型" }],
|
||||
<Radio.Group
|
||||
// onChange={(e) => { setTypeValue(e.target.value) }}
|
||||
>
|
||||
{
|
||||
achieveType.map(item => {
|
||||
return <Radio key={item.code} value={item.code}>{item.name}</Radio>
|
||||
})
|
||||
}
|
||||
</Radio.Group>
|
||||
)}
|
||||
|
||||
{helper(
|
||||
"成果名称:",
|
||||
"title",
|
||||
[{ required: true, message: "请输入成果名称" },
|
||||
{ max: 50, message: '长度不能超过50个字符' }],
|
||||
<Input
|
||||
className="edit-input"
|
||||
placeholder="请输入成果名称"
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
{editor()}
|
||||
|
||||
{helper(
|
||||
"发布单位:",
|
||||
"publisher",
|
||||
[{ required: true, message: "请输入发布单位" },
|
||||
{ max: 50, message: '长度不能超过50个字符' }],
|
||||
<Input
|
||||
className="edit-input"
|
||||
placeholder="请输入发布单位"
|
||||
/>
|
||||
)}
|
||||
|
||||
{helper(
|
||||
"联系人:",
|
||||
"achievementIntro",
|
||||
[{ max: 50, message: '长度不能超过50个字符' }],
|
||||
<TextArea
|
||||
rows={4}
|
||||
placeholder="请输入联系人"
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
{helper(
|
||||
"联系方式:",
|
||||
"contactInfo",
|
||||
[{ max: 5000, message: '长度不能超过5000个字符' }],
|
||||
<Input
|
||||
className="edit-input"
|
||||
placeholder="请输入联系方式"
|
||||
/>
|
||||
)}
|
||||
|
||||
<Form.Item className="encrypt-item" label="加密与否">
|
||||
{/* <Checkbox checked={isSecret} onChange={e => { setIsSecret(e.target.checked) }}>设置联系方式为加密内容</Checkbox> */}
|
||||
{getFieldDecorator('isSecret',
|
||||
{
|
||||
validateFirst: true
|
||||
})(<Checkbox checked={isSecret} onChange={e => { setIsSecret(e.target.checked) }}>设置联系方式为加密内容</Checkbox>)}
|
||||
</Form.Item>
|
||||
|
||||
|
||||
<Form.Item label={"上传文件:"}>
|
||||
<UploadMine
|
||||
className="commentStyle"
|
||||
load={UploadFunc}
|
||||
size={100}
|
||||
ShowNotification={ShowNotification}
|
||||
actionUrl={actionUrl}
|
||||
fileList={fileList}
|
||||
number={1}
|
||||
/>
|
||||
{/* 用一个隐藏的input实现上传文件的必填校验 */}
|
||||
{/* {getFieldDecorator('file_name', {
|
||||
rules: [{ required: true, message: "请上传成果文件" }],
|
||||
validateFirst: true
|
||||
})(<Input style={{ display: 'none' }} />)} */}
|
||||
</Form.Item>
|
||||
|
||||
|
||||
<Form.Item {...tailFormItemLayout}>
|
||||
<Button className="mr20" type={"primary"} onClick={() => { saveItem(1) }}>发布</Button>
|
||||
<Button className="mr20" type={"primary"} onClick={() => { saveItem(2) }}>保存</Button>
|
||||
<Button onClick={() => { history.go(-1) }}>取消</Button>
|
||||
</Form.Item>
|
||||
|
||||
</Form>
|
||||
|
||||
<Modal
|
||||
title="批量导入"
|
||||
visible={visible}
|
||||
onCancel={() => { setVisible(false) }}
|
||||
className="upload-modal"
|
||||
footer={null}
|
||||
key={Math.random()}
|
||||
destroyOnClose
|
||||
>
|
||||
<p className='hint'>请下载<a className="link mt10 mb10" onClick={() => { window.open(`${httpUrl}/busiAttachments/download/${urlHost.indexOf('osredm') === -1 ? '1052' : urlHost.indexOf('osredm.jk') > -1 ? '8888' : '520'}`) }}>成果导入模板.xlsx</a></p>
|
||||
<p className='hint'>提示:只能在导入模版上增减数据,才能导入成功!</p>
|
||||
<p className='importFile'>
|
||||
<Upload
|
||||
{...upload}
|
||||
>
|
||||
<Button type="primary" className="but41_fill ">导入</Button>
|
||||
</Upload>
|
||||
</p>
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
export default NoticeEdit;
|
|
@ -0,0 +1,405 @@
|
|||
import React, { forwardRef, useEffect, useState, useCallback, Fragment } from 'react';
|
||||
import { Button, Form, Modal, Input, Select, Radio, Table } from 'antd';
|
||||
import Link from 'react-router-dom/Link';
|
||||
import PaginationTable from "../../../components/pagination-table";
|
||||
import { exportExcel } from 'military/components/exportExcel';
|
||||
import { achieveSource, achieveType } from 'military/achievement/static';
|
||||
import DelModal from '../../components/DelModal';
|
||||
import ShowNotification from '../../components/ShowNotification';
|
||||
|
||||
import { getNoticeList, checkNotice, deleteNotice } from '../api';
|
||||
import '../index.scss';
|
||||
import './index.scss';
|
||||
import moment from 'moment';
|
||||
const Option = Select.Option;
|
||||
|
||||
const achieveSourceArr = [];
|
||||
for (const item of achieveSource) {
|
||||
achieveSourceArr[item.code] = (item.name);
|
||||
}
|
||||
const achieveTypeArr = [];
|
||||
for (const item of achieveType) {
|
||||
achieveTypeArr[item.code] = (item.name);
|
||||
}
|
||||
|
||||
const NoticeList = Form.create()(forwardRef(({ form, match, history, current_user: { admin } }, ref) => {
|
||||
let status = 1;
|
||||
let isChecked = match.params.isChecked;
|
||||
if (history.location.pathname.indexOf('draft') > -1) {
|
||||
status = 2;
|
||||
isChecked = '';
|
||||
}
|
||||
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, } = form;
|
||||
|
||||
const [type, setType] = useState(undefined);
|
||||
const [title, setTitle] = useState(undefined);
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [orderBy, setOrderBy] = useState('');
|
||||
const [dataList, setDataList] = useState([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [currentId, setCurrentId] = useState('');
|
||||
const [currentIsChecked, setCurrentIsChecked] = useState(1);
|
||||
|
||||
const [reload, setReload] = useState(0);
|
||||
const [params, setParams] = useState({});
|
||||
|
||||
const [dataAll, setDataAll] = useState([]);
|
||||
const [download, setDownload] = useState();
|
||||
const [downloading, setDownloading] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
// 组件第一次渲染会执行这个方法
|
||||
console.log('useEffect --- ');
|
||||
// 添加路由监听函数
|
||||
history.listen(historyLocation => {
|
||||
// 每次路由变化都会执行这个方法
|
||||
// console.log('route history , ', history);
|
||||
// console.log('route history location , ', historyLocation);
|
||||
setCurPage(1);
|
||||
setType(undefined);
|
||||
setTitle(undefined);
|
||||
setFieldsValue({
|
||||
type: undefined,
|
||||
title: undefined,
|
||||
});
|
||||
})
|
||||
}, [history]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
getNoticeList({
|
||||
...params,
|
||||
orderBy,
|
||||
curPage,
|
||||
isChecked,
|
||||
pageSize,
|
||||
status,
|
||||
type: 7, //成果都是7
|
||||
// title,
|
||||
flag: 2, //后台管理查询:2;前台展示:1
|
||||
}).then(data => {
|
||||
setLoading(false);
|
||||
if (data) {
|
||||
setDataList(data.rows);
|
||||
setTotal(data.total);
|
||||
} else {
|
||||
setTotal(0);
|
||||
setDataList([]);
|
||||
}
|
||||
});
|
||||
}, [curPage, params, isChecked, reload, pageSize]);
|
||||
|
||||
// 获取下载数据的列表
|
||||
useEffect(() => {
|
||||
if (!download) {
|
||||
return;
|
||||
}
|
||||
setDownloading(true);
|
||||
getNoticeList({
|
||||
...params,
|
||||
orderBy,
|
||||
curPage,
|
||||
isChecked,
|
||||
pageSize: 100000000,
|
||||
status,
|
||||
type: 7, //成果都是7
|
||||
flag: 2, //后台管理查询:2;前台展示:1
|
||||
}).then(data => {
|
||||
setDataAll(data.rows || []);
|
||||
setDownloading(false);
|
||||
exportExcel("#exportList .ant-table-body", `成果列表 ${moment().format("YYYY-MM-DD HH:mm:ss")}`);
|
||||
});
|
||||
}, [download]);
|
||||
|
||||
|
||||
|
||||
const columns = [
|
||||
|
||||
{
|
||||
title: '成果来源',
|
||||
key: 'achievementSource',
|
||||
dataIndex: 'achievementSource',
|
||||
render: (text, record) => {
|
||||
return achieveSourceArr[text];
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '成果类型',
|
||||
key: 'achievementCategory',
|
||||
dataIndex: 'achievementCategory',
|
||||
render: (text, record) => {
|
||||
return achieveTypeArr[text];
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '成果名称',
|
||||
dataIndex: 'title',
|
||||
key: 'title',
|
||||
width: '20%'
|
||||
},
|
||||
{
|
||||
title: '发布单位',
|
||||
dataIndex: 'publisher',
|
||||
key: 'publisher',
|
||||
width: '20%'
|
||||
},
|
||||
|
||||
{
|
||||
title: '创建时间',
|
||||
key: 'createdAt',
|
||||
dataIndex: 'createdAt',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
{record.status == 2 && <Button className="mr5 font-12" type="primary" size="small" onClick={() => { editItem(record.id) }}>修改</Button>}
|
||||
<Link className="mr10 mb5 font-12" size="small" to={`/managements/achievement/detail/${record.id}`}>详情</Link>
|
||||
{admin && record.status == 1 && record.isChecked == 2 && <Button className="mr5 font-12" type="primary" size="small" onClick={() => { setCurrentId(record.id); setVisible(true); }}>审核</Button>}
|
||||
{(admin || (record.isChecked != 1)) && < Button className="mr5 font-12" type="danger" size="small" onClick={() => { deletItem(record.id) }}>删除</Button>}
|
||||
</span >
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
// 如果是已发布,那么增加一项
|
||||
if (isChecked == 1) {
|
||||
columns.splice(3, 0, {
|
||||
title: '发布时间',
|
||||
key: 'publishDate',
|
||||
dataIndex: 'publishDate',
|
||||
});
|
||||
columns.splice(4, 0, {
|
||||
title: '密文浏览数',
|
||||
key: 'requestViewCount',
|
||||
dataIndex: 'requestViewCount',
|
||||
render: (text, record) => {
|
||||
return <span className={`${text > 0 ? 'link' : ''}`} onClick={() => { text > 0 && history.push(`/managements/achievement/detail/${record.id}`) }}>{text}</span>;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let exportColumn = [...columns];
|
||||
exportColumn.splice(4, 0, {
|
||||
title: '成果描述',
|
||||
key: 'text',
|
||||
dataIndex: 'text',
|
||||
render: (text, record) => {
|
||||
return <div className="editor-w-text" dangerouslySetInnerHTML={{ __html: text && text.replace(/\n/g, '</br>') }}></div>
|
||||
}
|
||||
});
|
||||
|
||||
exportColumn.splice(exportColumn.length - 3, 3, {
|
||||
title: '联系人',
|
||||
dataIndex: 'achievementIntro',
|
||||
key: 'achievementIntro',
|
||||
}, {
|
||||
title: '联系方式',
|
||||
dataIndex: 'contactInfo',
|
||||
key: 'contactInfo',
|
||||
}, {
|
||||
title: '联系方式是否加密',
|
||||
dataIndex: 'isSecret',
|
||||
key: 'isSecret',
|
||||
render: (text, record) => {
|
||||
return text ? '加密' : "不加密"
|
||||
}
|
||||
}, {
|
||||
title: '可见性',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
render: (text, record) => {
|
||||
return text === 1 ? '已发布' : "草稿"
|
||||
}
|
||||
}, {
|
||||
title: '附件路径',
|
||||
dataIndex: 'fileDownloadPath',
|
||||
key: 'fileDownloadPath',
|
||||
render:(text)=>{
|
||||
return <Fragment><a href={text} target="_blank">{text}</a></Fragment>
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 审核
|
||||
function checkItem() {
|
||||
checkNotice({
|
||||
id: currentId,
|
||||
isChecked: currentIsChecked,
|
||||
}).then(res => {
|
||||
if (res && res.code == '1') {
|
||||
ShowNotification("操作成功");
|
||||
setVisible(false);
|
||||
setReload(reload + 1);
|
||||
} else {
|
||||
ShowNotification(res.message || "操作失败");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function editItem(id) {
|
||||
history.push(`/managements/achievement/edit/${id}`);
|
||||
}
|
||||
|
||||
function deletItem(id) {
|
||||
DelModal(() => {
|
||||
deleteNotice(id).then(res => {
|
||||
if (res.message === 'success') {
|
||||
ShowNotification("删除成功");
|
||||
if (dataList.length == 1 && curPage > 1) {
|
||||
setCurPage(curPage - 1);
|
||||
} else {
|
||||
setReload(reload + 1);
|
||||
}
|
||||
} else {
|
||||
ShowNotification("删除失败");
|
||||
}
|
||||
})
|
||||
}, '此操作将删除该记录, 是否继续?');
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
validateFields((error, values) => {
|
||||
console.log(values);
|
||||
if (!error) {
|
||||
// setType(values.type || "");
|
||||
// setTitle(values.title);
|
||||
setParams(values);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const helper = useCallback(
|
||||
(label, name, rules, widget) => (
|
||||
<Form.Item label={label} className='searchForm'>
|
||||
{getFieldDecorator(name, { rules, validateFirst: true, })(widget)}
|
||||
</Form.Item>
|
||||
), []);
|
||||
|
||||
|
||||
const formItemLayout = {
|
||||
labelCol: {
|
||||
xs: { span: 12 },
|
||||
sm: { span: 6 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 12 },
|
||||
sm: { span: 18 },
|
||||
},
|
||||
};
|
||||
|
||||
function onShowSizeChange(current, pageSize) {
|
||||
setCurPage(current);
|
||||
setPageSize(pageSize);
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className="content">
|
||||
<Form className="clearfix">
|
||||
{helper(
|
||||
"",
|
||||
"achievementCategory",
|
||||
[],
|
||||
<Select
|
||||
placeholder="成果类型"
|
||||
allowClear
|
||||
showArrow
|
||||
>
|
||||
{
|
||||
achieveType.map(item => {
|
||||
return <Option key={item.code}>{item.name}</Option>
|
||||
})
|
||||
}
|
||||
</Select>
|
||||
)}
|
||||
|
||||
{helper(
|
||||
"",
|
||||
"achievementSource",
|
||||
[],
|
||||
<Select
|
||||
placeholder="成果来源"
|
||||
allowClear
|
||||
showArrow
|
||||
>
|
||||
{
|
||||
achieveSource.map(item => {
|
||||
return <Option key={item.code}>{item.name}</Option>
|
||||
})
|
||||
}
|
||||
</Select>
|
||||
)}
|
||||
|
||||
{helper(
|
||||
"",
|
||||
"title",
|
||||
[{ max: 20, message: '关键字长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="输入标题关键字进行搜索"
|
||||
/>
|
||||
)}
|
||||
|
||||
<Button className="my-search-button" type="primary" onClick={handleSearch}>查询</Button>
|
||||
|
||||
<div className="btn-group">
|
||||
<Button type="primary" loading={downloading} className="ml10 but41_fill" onClick={() => { setDownload(Math.random()) }}>导出</Button>
|
||||
</div>
|
||||
</Form>
|
||||
|
||||
<div className="table-detail">
|
||||
<PaginationTable
|
||||
loading={loading}
|
||||
dataSource={dataList}
|
||||
columns={columns}
|
||||
total={total}
|
||||
setCurPage={setCurPage}
|
||||
current={curPage}
|
||||
onShowSizeChange={onShowSizeChange}
|
||||
showSizeChanger
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Table
|
||||
id="exportList"
|
||||
style={{ display: "none" }}
|
||||
columns={exportColumn}
|
||||
dataSource={dataAll}
|
||||
pagination={false}
|
||||
rowKey={(row) => row.id}
|
||||
/>
|
||||
|
||||
<Modal
|
||||
title="成果审核"
|
||||
visible={visible}
|
||||
onOk={checkItem}
|
||||
onCancel={() => { setVisible(false) }}
|
||||
className="form-edit-modal"
|
||||
>
|
||||
<Form {...formItemLayout}>
|
||||
<Form.Item label={"审核意见:"} >
|
||||
<Radio.Group defaultValue={currentIsChecked} onChange={(e) => { setCurrentIsChecked(e.target.value) }} >
|
||||
<Radio className="columsRadio" value={1}>
|
||||
通过
|
||||
</Radio>
|
||||
<Radio className="columsRadio" value={0}>
|
||||
拒绝
|
||||
</Radio>
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
})
|
||||
)
|
||||
|
||||
export default NoticeList;
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
.searchForm{
|
||||
float: left;
|
||||
min-width: 260px;
|
||||
margin-right:2em !important;
|
||||
}
|
||||
|
||||
.link{
|
||||
cursor: pointer;
|
||||
&:hover{
|
||||
color: $primary-color;
|
||||
}
|
||||
}
|
||||
.btn-group{
|
||||
display: inline-block;
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { Button, Descriptions, Pagination, Icon, Table } from 'antd';
|
||||
import PaginationTable from "../../../components/pagination-table";
|
||||
import { achieveSource, noticeChecked } from '../../common/static';
|
||||
import { getNoticeDetail, getNoticeReader } from '../api';
|
||||
import '../index.scss';
|
||||
import './index.scss';
|
||||
|
||||
const achieveSourceArr = [];
|
||||
for (const item of achieveSource) {
|
||||
achieveSourceArr[item.code] = (item.name);
|
||||
}
|
||||
const noticeCheckedArr = [];
|
||||
for (const item of noticeChecked) {
|
||||
noticeCheckedArr[item.code] = (item.name);
|
||||
}
|
||||
|
||||
const NoticeReader = ({ match, history }) => {
|
||||
const id = match.params.noticeId;
|
||||
const [noticeData, setNoticeData] = useState({});
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [dataList, setDataList] = useState([]);
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [total, setTotal] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
id && getNoticeDetail(id).then(data => {
|
||||
setNoticeData(data || {});
|
||||
})
|
||||
}, [id]);
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
id && getNoticeReader({
|
||||
currentPage: curPage,
|
||||
annId: id,
|
||||
pageSize,
|
||||
}).then(data => {
|
||||
setLoading(false);
|
||||
if (data) {
|
||||
setDataList(data.rows);
|
||||
setTotal(data.total);
|
||||
} else {
|
||||
setTotal(0);
|
||||
setDataList([]);
|
||||
}
|
||||
})
|
||||
}, [id, curPage, pageSize]);
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '用户姓名',
|
||||
key: 'readerName',
|
||||
dataIndex: 'readerName',
|
||||
width: '20%',
|
||||
},
|
||||
{
|
||||
title: '公司名称',
|
||||
key: 'companyName',
|
||||
dataIndex: 'companyName',
|
||||
width: '40%',
|
||||
},
|
||||
{
|
||||
title: '联系方式',
|
||||
key: 'contactInfo',
|
||||
dataIndex: 'contactInfo',
|
||||
width: '40%',
|
||||
},
|
||||
];
|
||||
|
||||
function onShowSizeChange(current, pageSize) {
|
||||
setCurPage(current);
|
||||
setPageSize(pageSize);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="notice-content">
|
||||
<h4 className="notice-title"><span className='backList' onClick={() => { history.go(-1) }}><Icon type="left" />返回</span>浏览过该成果加密内容的用户详情</h4>
|
||||
|
||||
<Descriptions className='itemContent' column={1}>
|
||||
<Descriptions.Item label="成果名称">{noticeData.title}</Descriptions.Item>
|
||||
<Descriptions.Item label="加密信息被浏览数">{total}</Descriptions.Item>
|
||||
<Descriptions.Item label="浏览过该成果加密内容的用户信息"></Descriptions.Item>
|
||||
</Descriptions>
|
||||
|
||||
<div className="table-detail">
|
||||
<PaginationTable
|
||||
loading={loading}
|
||||
dataSource={dataList}
|
||||
columns={columns}
|
||||
total={total}
|
||||
setCurPage={setCurPage}
|
||||
current={curPage}
|
||||
onShowSizeChange={onShowSizeChange}
|
||||
showSizeChanger
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
export default NoticeReader;
|
|
@ -0,0 +1,25 @@
|
|||
.itemContent {
|
||||
padding: 10px 10px 0 30px;
|
||||
}
|
||||
.statusColor{
|
||||
color: #1890ff;
|
||||
}
|
||||
.alignTop{
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.backList{
|
||||
margin-right:1em;
|
||||
&:hover{
|
||||
color: #1890ff;
|
||||
}
|
||||
}
|
||||
|
||||
:global{
|
||||
.ant-descriptions-item-label{
|
||||
min-width: 5em;
|
||||
}
|
||||
.ant-table-row-cell-break-word{
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
|
@ -5,13 +5,11 @@ export const noticeStatus = [
|
|||
{ code: 2, name: "草稿" },
|
||||
];
|
||||
|
||||
export const noticeType = [
|
||||
{ code: 4, name: "招标" },
|
||||
{ code: 1, name: "更正" },
|
||||
{ code: 2, name: "中标" },
|
||||
{ code: 3, name: "废标" },
|
||||
{ code: 5, name: "技术资产" },
|
||||
{ code: 6, name: "成交" },
|
||||
export const achieveSource = [
|
||||
{ code: 4, name: "开源项目", dicItemName: "招标" },
|
||||
{ code: 1, name: "创客任务", dicItemName: "更正" },
|
||||
{ code: 2, name: "开放竞赛", dicItemName: "中标" },
|
||||
{ code: 3, name: "科研成果", dicItemName: "废标" },
|
||||
];
|
||||
|
||||
export const noticeChecked = [
|
||||
|
|
|
@ -115,6 +115,11 @@ const NoticeManage = Loadable({
|
|||
loader: () => import("./notice"),
|
||||
loading: Loading,
|
||||
});
|
||||
// 成果库管理
|
||||
const Achievement = Loadable({
|
||||
loader: () => import("./achievement"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
// 权限管理
|
||||
// 非普通用户(管理员)列表
|
||||
|
@ -321,6 +326,14 @@ const Managements = (propsF) => {
|
|||
)}
|
||||
></Route>
|
||||
|
||||
{/* 成果库管理 */}
|
||||
<Route
|
||||
path="/managements/achievement"
|
||||
render={(props) => (
|
||||
<Achievement {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
{/* 定制竞赛配置详情 */}
|
||||
<Route
|
||||
path="/managements/competition/customize/edit/:id"
|
||||
|
|
|
@ -85,6 +85,13 @@
|
|||
span{color:#a6adc4;}
|
||||
}
|
||||
}
|
||||
.link, .link:hover {
|
||||
color: #4154f1;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
// 系统默认字体大小是16px,大屏的在此基础上增大字体
|
||||
@media screen and (min-width: 1921px) {
|
||||
html{
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { Button, Descriptions, Icon } from 'antd';
|
||||
import ShowNotification from '../../components/ShowNotification';
|
||||
import { noticeType, noticeChecked } from '../../common/static';
|
||||
import { noticeChecked } from '../../common/static';
|
||||
import { noticeType } from 'military/notice/static';
|
||||
import { getNoticeDetail, checkNotice } from '../api';
|
||||
import '../index.css';
|
||||
import './index.scss';
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, { forwardRef, Fragment, useCallback, useEffect, useState } from 'r
|
|||
import ReactWEditor from 'wangeditor-for-react';
|
||||
import { Form, Input, Button, Radio, Checkbox, DatePicker } from 'antd';
|
||||
import moment from 'moment';
|
||||
import { noticeType } from '../../common/static';
|
||||
import { noticeType } from 'military/notice/static';
|
||||
import Upload from '../../components/Upload';
|
||||
import ShowNotification from '../../components/ShowNotification';
|
||||
import { getNoticeDetail, addNotice, editNotice } from '../api';
|
||||
|
@ -160,7 +160,7 @@ const NoticeEdit = Form.create()(forwardRef(({ form, match, history }, ref) => {
|
|||
if (res.message === 'success') {
|
||||
ShowNotification("操作成功!");
|
||||
if (status == 1) {
|
||||
history.push('/managements/notice/list/2');
|
||||
history.push('/managements/notice/list/1');
|
||||
} else {
|
||||
history.push('/managements/notice/list/draft');
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ const NoticeEdit = Form.create()(forwardRef(({ form, match, history }, ref) => {
|
|||
if (res.message === 'success') {
|
||||
ShowNotification("公告新增成功!");
|
||||
if (status == 1) {
|
||||
history.push('/managements/notice/list/2');
|
||||
history.push('/managements/notice/list/1');
|
||||
} else {
|
||||
history.push('/managements/notice/list/draft');
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { forwardRef, useEffect, useState, useCallback } from 'react';
|
||||
import { Button, Form, Modal, Input, Select, Radio, } from 'antd';
|
||||
import PaginationTable from "../../../components/pagination-table";
|
||||
import { noticeType } from '../../common/static';
|
||||
import { noticeType } from 'military/notice/static';
|
||||
import DelModal from '../../components/DelModal';
|
||||
import ShowNotification from '../../components/ShowNotification';
|
||||
|
||||
|
@ -67,7 +67,7 @@ const NoticeList = Form.create()(forwardRef(({ form, match, history, current_use
|
|||
isChecked,
|
||||
pageSize,
|
||||
status,
|
||||
type,
|
||||
type:type||'1,2,3,4,5,6',
|
||||
title,
|
||||
flag: 2, //后台管理查询:2;前台展示:1
|
||||
}).then(data => {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { Button, Descriptions, Pagination, Icon, Table } from 'antd';
|
||||
import PaginationTable from "../../../components/pagination-table";
|
||||
import { noticeType, noticeChecked } from '../../common/static';
|
||||
import { noticeChecked } from '../../common/static';
|
||||
import { noticeType } from 'military/notice/static';
|
||||
import { getNoticeDetail, getNoticeReader } from '../api';
|
||||
import '../index.css';
|
||||
import './index.scss';
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
|
||||
import React, { Component } from "react";
|
||||
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import { withRouter } from "react-router";
|
||||
import { SnackbarHOC } from "educoder";
|
||||
import { CNotificationHOC } from "../modules/courses/common/CNotificationHOC";
|
||||
import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
|
||||
import Loadable from "react-loadable";
|
||||
import Loading from "../Loading";
|
||||
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
|
||||
import './index.scss';
|
||||
|
||||
const NoticeList = Loadable({
|
||||
loader: () => import("./achievement/noticeList"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const NoticeDetail = Loadable({
|
||||
loader: () => import("./achievement/noticeDetail"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
|
||||
class Index extends Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="newMain clearfix">
|
||||
<Switch {...this.props}>
|
||||
|
||||
<Route
|
||||
path="/achievement/noticeDetail/:noticeId"
|
||||
render={(props) => (
|
||||
<NoticeDetail {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/achievement"
|
||||
render={(props) => (
|
||||
<NoticeList {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
</Switch>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
export default withRouter(
|
||||
ImageLayerOfCommentHOC({
|
||||
imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
|
||||
parentSelector: ".newMain",
|
||||
})(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Index))))
|
||||
);
|
|
@ -0,0 +1,49 @@
|
|||
import fetch from './fetch';
|
||||
import { notification } from 'antd';
|
||||
|
||||
|
||||
// 成果列表查询
|
||||
export async function getNoticeList(params) {
|
||||
let res = await fetch({
|
||||
url: '/api/announcements/',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
if (res.message === 'success') {
|
||||
return res.data;
|
||||
} else {
|
||||
notification.open({
|
||||
message: "提示",
|
||||
description: res.message || '请求错误',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 成果详情查询
|
||||
export async function getNoticeDetail(id) {
|
||||
let res = await fetch({
|
||||
url: '/api/announcements/' + id,
|
||||
method: 'get',
|
||||
params:{flag:1}
|
||||
});
|
||||
if (res.data) {
|
||||
return res.data;
|
||||
} else {
|
||||
notification.open({
|
||||
message: "提示",
|
||||
description: res.message || '请求错误',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//新增加密成果申请人
|
||||
export function addReader(data) {
|
||||
return fetch({
|
||||
url: '/api/request_contact_reader_info/',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
import React from 'react';
|
||||
import { NewSvg } from '../../svg';
|
||||
import './index.scss';
|
||||
export default (props) => {
|
||||
const { list, itemClick, } = props;
|
||||
|
||||
return (
|
||||
list.map(item => {
|
||||
return (
|
||||
<div className="list-box" key={item.id}>
|
||||
<div className="list-title" onClick={() => { itemClick(item.id) }}>
|
||||
{item.achievementName || item.title} {item.new && <NewSvg color="#ffb300"/>}
|
||||
</div>
|
||||
<div className="list-other">
|
||||
{item.publisher && <p>发布单位:{item.publisher}</p>}
|
||||
<p>发布时间:{(item.publishDate && item.publishDate.split(' ')[0]) || (item.createTime && item.createTime.split(' ')[0])}</p>
|
||||
<p><i className="iconfont icon-dianjiliang mr5 font-12" />{item.visits || 0}</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
)
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
.list-box {
|
||||
position: relative;
|
||||
padding: 17px 20px;
|
||||
background: #fff;
|
||||
border-bottom: 1px dashed #dedede;
|
||||
}
|
||||
.list-title {
|
||||
font-size: 1rem;
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
svg {
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
}
|
||||
.list-title:hover {
|
||||
color: #4154f1;
|
||||
}
|
||||
.list-title span {
|
||||
padding: 3px 5px;
|
||||
margin-left: 0.5em;
|
||||
background: #f8c753;
|
||||
font-size: 13px;
|
||||
color: #fff;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.list-other {
|
||||
margin-top: 0.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
& > p {
|
||||
display: inline-block;
|
||||
font-size: 0.875rem;
|
||||
color: #666;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
p:first-child{
|
||||
width: 50%;
|
||||
}
|
||||
p:nth-child(2){
|
||||
width: 40%;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
import javaFetch from '../javaFetch';
|
||||
|
||||
|
||||
let settings =localStorage.chromesetting && JSON.parse(localStorage.chromesetting);
|
||||
let actionUrl = settings && settings.api_urls ? settings.api_urls.notice : 'https://info.osredm.com';
|
||||
// let actionUrl = 'http://111.8.36.180:8089';
|
||||
const service = javaFetch(actionUrl);
|
||||
export const httpUrl = actionUrl;
|
||||
export default service;
|
Binary file not shown.
After Width: | Height: | Size: 149 KiB |
|
@ -0,0 +1,183 @@
|
|||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { Button, Icon, Form, Modal, Input } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import { getNoticeDetail, addReader } from '../api';
|
||||
import { achieveSource,achieveType } from '../static';
|
||||
import './index.scss';
|
||||
|
||||
const achieveSourceArr = [];
|
||||
for (const item of achieveSource) {
|
||||
achieveSourceArr[item.code] = item.name;
|
||||
}
|
||||
const achieveTypeArr = [];
|
||||
for (const item of achieveType) {
|
||||
achieveTypeArr[item.code] = (item.name);
|
||||
}
|
||||
export default Form.create()(({ match, history, showNotification, form }) => {
|
||||
const { getFieldDecorator, validateFields, setFieldsValue } = form;
|
||||
|
||||
const [reload, setReload] = useState(0);
|
||||
const [noticeData, setNoticeData] = useState({});
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
const [readerName,setReaderName]=useState('');
|
||||
|
||||
const id = match.params.noticeId;
|
||||
|
||||
useEffect(() => {
|
||||
id && getNoticeDetail(id).then(data => {
|
||||
if (data) {
|
||||
data.publishDate = data.publishDate&&data.publishDate.split(' ')[0];
|
||||
data.createdAt = data.publishDate&&data.createdAt.split(' ')[0];
|
||||
}
|
||||
setNoticeData(data || {});
|
||||
})
|
||||
}, [id, reload]);
|
||||
|
||||
// form表单公共处理函数
|
||||
const helper = useCallback(
|
||||
(label, name, rules, widget) => (
|
||||
<Form.Item label={label}>
|
||||
{getFieldDecorator(name, { rules, validateFirst: true ,getValueFromEvent: e=>e.target.value.replace(/(^\s*)|(\s*$)/g, "") })(widget)}
|
||||
</Form.Item>
|
||||
),
|
||||
[]
|
||||
);
|
||||
|
||||
function pushInfo() {
|
||||
validateFields((err, values) => {
|
||||
if (!err) {
|
||||
addReader({
|
||||
...values,
|
||||
annId: noticeData.id,
|
||||
}).then(res => {
|
||||
if (res.message === "success") {
|
||||
setVisible(false);
|
||||
setReload(Math.random());
|
||||
} else {
|
||||
res && Modal.error({ content: res.message });
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className="centerbox notice-detail">
|
||||
<div className="head-navigation">
|
||||
<Link to="/">首页<span className="greater"> > </span></Link>
|
||||
<Link to="/achievement">成果库<span className="greater"> > </span></Link>
|
||||
<span>成果详情</span>
|
||||
</div>
|
||||
<div className="center-content">
|
||||
{/* <div className="notice-center-content"> */}
|
||||
<div className="notice-title">
|
||||
{noticeData.title}
|
||||
</div>
|
||||
<div className="notice-detail-content">
|
||||
<div className="center-author">
|
||||
<p key={0}>成果来源:{noticeData.achievementSource}</p>
|
||||
<p key={1}>成果类型:{noticeData.achievementCategory}</p>
|
||||
{noticeData.publisher && <p key={1}>发布单位:{noticeData.publisher}</p>}
|
||||
<p key={2}>发布时间:{noticeData.publishDate || noticeData.createdAt}</p>
|
||||
{/* <p key={3}>截止时间:{noticeData.closingDate}</p> */}
|
||||
<p key={4}>浏览:{noticeData.visits || 0}</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div className="content-text">
|
||||
<div className="notice-content-title"><Icon type="caret-right" />成果主要内容</div>
|
||||
<div className="editor-w-text" dangerouslySetInnerHTML={{ __html: noticeData.text }}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="mb20">
|
||||
<div className="notice-content-title"><Icon type="caret-right" />联系人</div>
|
||||
<div className="editor-w-text">{noticeData.achievementIntro}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{
|
||||
noticeData.contactInfo ? <React.Fragment>
|
||||
<div className="notice-content-title"><Icon type="caret-right" />联系方式</div>
|
||||
<div className="content-secret" dangerouslySetInnerHTML={{ __html: noticeData.contactInfo && noticeData.contactInfo.replace(/\n/g, '</br>') }}>
|
||||
</div>
|
||||
{
|
||||
noticeData.blockedView && <Button type="primary" onClick={() => { setVisible(true) }}>申请查看加密内容</Button>
|
||||
}
|
||||
</React.Fragment> : ''
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
noticeData.fileDownloadPath &&
|
||||
<React.Fragment>
|
||||
<div className="notice-content-title"><Icon type="caret-right" />成果附件</div>
|
||||
<p className="notice-content-download" >
|
||||
<span onClick={() => { window.open(noticeData.fileDownloadPath) }}>
|
||||
<i className="iconfont icon-fujian color-green font-14 mr3"></i>{noticeData.fileName}
|
||||
</span>
|
||||
<span className="link" onClick={() => { window.open(noticeData.fileDownloadPath) }}>下载</span>
|
||||
</p>
|
||||
</React.Fragment>
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Modal
|
||||
title="提交信息"
|
||||
visible={visible}
|
||||
onOk={pushInfo}
|
||||
onCancel={() => { setVisible(false) }}
|
||||
className="form-edit-modal"
|
||||
>
|
||||
|
||||
{
|
||||
helper('用户姓名',
|
||||
'readerName',
|
||||
[{ required: true, message: "请输入用户姓名" }, { max: 50, message: '不能超过50字符' }],
|
||||
<Input
|
||||
placeholder="请输入用户姓名"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
helper('公司名称',
|
||||
'companyName',
|
||||
[{ required: true, message: "请输入公司名称" }, { max: 100, message: '不能超过100字符' }],
|
||||
<Input
|
||||
placeholder="请输入公司名称"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
helper('联系方式',
|
||||
'contactInfo',
|
||||
[{ required: true, message: "请输入联系方式" },
|
||||
{ max: 100, message: '不能超过100字符' },
|
||||
{ validator: (rule,val,callback) =>{
|
||||
const pattern = /^((\+)?86|((\+)?86)?)0?1[3458]\d{9}$/;
|
||||
if(pattern.test(val)){
|
||||
callback();
|
||||
}else {
|
||||
callback('请输入正确的手机号码!');
|
||||
}
|
||||
}}],
|
||||
<Input
|
||||
placeholder="请输入联系方式"
|
||||
/>
|
||||
)
|
||||
}
|
||||
</Modal>
|
||||
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
)
|
|
@ -0,0 +1,102 @@
|
|||
.centerbox {
|
||||
position: relative;
|
||||
}
|
||||
.notice-detail {
|
||||
margin-top: 3.5rem;
|
||||
.head-navigation {
|
||||
top: -2.5rem;
|
||||
}
|
||||
.center-content {
|
||||
overflow: auto;
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.notice-detail-content {
|
||||
padding: 2rem 2.5rem 3rem;
|
||||
|
||||
.anticon-caret-right {
|
||||
color: #1890ff;
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.notice-title {
|
||||
margin: 3rem auto 0;
|
||||
text-align: center;
|
||||
font-size: 1.375rem;
|
||||
font-weight: bold;
|
||||
line-height: 1.375rem;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
// 内容详情
|
||||
.item-content {
|
||||
padding: 10px 10px 0 30px;
|
||||
}
|
||||
.content-notice {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.center-author {
|
||||
display: flex;
|
||||
flex-flow:row wrap-reverse;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
padding: .5rem;
|
||||
background: #f9f9f9;
|
||||
color: #333;
|
||||
p {
|
||||
padding: 0 .5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.content-text {
|
||||
margin: 1.25rem 0;
|
||||
min-height: 30vh;
|
||||
}
|
||||
|
||||
.content-secret{
|
||||
min-height: 2em;
|
||||
}
|
||||
|
||||
.notice-content-title {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.notice-content-download {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 2rem !important;
|
||||
padding: 0 1rem;
|
||||
background: #f9f9f9;
|
||||
span:hover{
|
||||
cursor: pointer;
|
||||
color: #1890ff;
|
||||
}
|
||||
}
|
||||
|
||||
.form-edit-modal {
|
||||
.ant-form-item{
|
||||
display: flex;
|
||||
}
|
||||
.ant-form-item-label{
|
||||
min-width: 5rem;
|
||||
}
|
||||
.ant-form-item-control-wrapper{
|
||||
width: 75%;
|
||||
display: inline-block;
|
||||
}
|
||||
.ant-input-number{
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.ant-modal-footer{
|
||||
border-top: 0;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,224 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { Pagination, Icon, Input, Affix, } from 'antd';
|
||||
import ItemList from '../components/itemList';
|
||||
import { achieveSource } from '../static';
|
||||
import Nodata from '../../../forge/Nodata';
|
||||
import Loading from "../../../Loading";
|
||||
import noticePng from '../image/banner.png';
|
||||
import { getNoticeList } from '../api';
|
||||
|
||||
import './index.scss';
|
||||
const Search = Input.Search;
|
||||
|
||||
export default (props) => {
|
||||
|
||||
const [tab, setTab] = useState('0');
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const [title, setTitle] = useState(undefined);
|
||||
const [orderBy, setOrderBy] = useState('publishDateDesc');
|
||||
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [noticeList, setNoticeList] = useState([]);
|
||||
|
||||
const [callList, setCallList] = useState([]);
|
||||
const [changeList, setChangeList] = useState([]);
|
||||
const [checkList, setCheckList] = useState([]);
|
||||
const [abandonList, setAbandonList] = useState([]);
|
||||
const [technologyList, setTechnologyList] = useState([]);
|
||||
const [dealList, setDealList] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
if (tab === '0' || tab === '7') {
|
||||
const params = {
|
||||
orderBy,
|
||||
curPage: 1,
|
||||
isChecked: 1,
|
||||
pageSize: 5,
|
||||
status: 1,
|
||||
type: 7,
|
||||
title,
|
||||
flag: 1, //后台管理查询:2;前台展示:1
|
||||
};
|
||||
getNoticeList({ ...params,achievementSource:'开源项目' }).then(data => {
|
||||
setCallList(data.rows);
|
||||
setLoading(false);
|
||||
});
|
||||
getNoticeList({...params,achievementSource:'创客任务'}).then(data => {
|
||||
setChangeList(data.rows);
|
||||
});
|
||||
getNoticeList({ ...params,achievementSource:'科研成果' }).then(data => {
|
||||
setCheckList(data.rows);
|
||||
});
|
||||
getNoticeList({ ...params,achievementSource:'其他' }).then(data => {
|
||||
setAbandonList(data.rows);
|
||||
setLoading(false);
|
||||
});
|
||||
} else {
|
||||
const params = {
|
||||
orderBy,
|
||||
curPage,
|
||||
isChecked: 1,
|
||||
pageSize: 10,
|
||||
status: 1,
|
||||
title,
|
||||
type: 7,
|
||||
achievementSource:tab,
|
||||
flag: 1, //后台管理查询:2;前台展示:1
|
||||
};
|
||||
getNoticeList(params).then(data => {
|
||||
setNoticeList(data.rows);
|
||||
setTotal(data.total);
|
||||
setLoading(false);
|
||||
})
|
||||
}
|
||||
}, [tab, title, orderBy, curPage]);
|
||||
|
||||
function changeSort(sortType) {
|
||||
setOrderBy(sortType);
|
||||
setCurPage(1);
|
||||
}
|
||||
|
||||
function noticeClick(id) {
|
||||
props.history.push(`/achievement/noticeDetail/${id}`);
|
||||
}
|
||||
|
||||
function sortNav() {
|
||||
return <div className="notice-sort-nav">
|
||||
<Search
|
||||
size="large"
|
||||
maxLength={20}
|
||||
style={{ width: "56%" }}
|
||||
placeholder="输入标题关键字,不能超过20字符"
|
||||
enterButton={<span><Icon type="search" className="mr5" /> 搜索</span>}
|
||||
onSearch={(value) => setTitle(value)} />
|
||||
<div className="center-right-but">
|
||||
<div className={classNames({ sortLink: true, active: orderBy === 'publishDateDesc' })} onClick={() => { changeSort('publishDateDesc') }}>时间降序<Icon type="arrow-down" /></div>
|
||||
<span className="piece">|</span>
|
||||
<div className={classNames({ sortLink: true, active: orderBy === 'publishDateAsc' })} onClick={() => { changeSort('publishDateAsc') }}>时间升序<Icon type="arrow-up" /></div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
function handleClick(e) {
|
||||
setTab(e.key);
|
||||
setCurPage(1);
|
||||
setTitle('');
|
||||
setOrderBy('publishDateDesc');
|
||||
}
|
||||
|
||||
function click(e){
|
||||
setTab(e);
|
||||
setCurPage(1);
|
||||
setTitle('');
|
||||
setOrderBy('publishDateDesc');
|
||||
}
|
||||
|
||||
function cont(param, titleStr, key, svgStr) {
|
||||
return <React.Fragment>
|
||||
<div className="item-head-title">
|
||||
<div className="item-head-title-content">
|
||||
<i className={svgStr}></i>
|
||||
<span>{titleStr}</span>
|
||||
</div>
|
||||
{param.length === 5 && <span className="link" onClick={() => { handleClick({ key: key }) }}>查看更多 <Icon type="arrow-right" /></span>}
|
||||
</div>
|
||||
{param.length > 0 ? <ItemList
|
||||
list={param}
|
||||
itemClick={noticeClick}
|
||||
/> : <Nodata _html="暂无数据" />}
|
||||
</React.Fragment>
|
||||
}
|
||||
|
||||
function content() {
|
||||
if (tab === '0') {
|
||||
if(callList.length === 0 && changeList.length === 0 && checkList.length === 0 && abandonList.length === 0){
|
||||
return <React.Fragment><Nodata _html="暂无数据" /></React.Fragment>
|
||||
}else{
|
||||
return <React.Fragment>
|
||||
{cont(callList, "开源项目", '开源项目', "iconfont icon-zhaobiaogonggao")}
|
||||
{cont(changeList, "创客任务", '创客任务', "iconfont icon-gengzhenggonggao")}
|
||||
{cont(checkList, "科研成果", '科研成果', "iconfont icon-zhongbiaogonggao")}
|
||||
{cont(abandonList, "其他", '其他', "iconfont icon-feibiaogonggao")}
|
||||
</React.Fragment>
|
||||
}
|
||||
} else if (tab === '8') {
|
||||
return <div></div>
|
||||
} else {
|
||||
let titleStr;
|
||||
let svgStr;
|
||||
switch (tab) {
|
||||
case '开源项目':
|
||||
titleStr = "开源项目";
|
||||
svgStr = "iconfont icon-gengzhenggonggao"
|
||||
break;
|
||||
case '创客任务':
|
||||
titleStr = "创客任务";
|
||||
svgStr = "iconfont icon-zhongbiaogonggao"
|
||||
break;
|
||||
case '科研成果':
|
||||
titleStr = "科研成果";
|
||||
svgStr = "iconfont icon-feibiaogonggao"
|
||||
break;
|
||||
case '其他':
|
||||
titleStr = "其他";
|
||||
svgStr = "iconfont icon-zhaobiaogonggao"
|
||||
break;
|
||||
}
|
||||
return <React.Fragment>
|
||||
<div className="item-head-title">
|
||||
<div className="item-head-title-content">
|
||||
<i className={svgStr}></i>
|
||||
<span>{titleStr}</span>
|
||||
</div>
|
||||
</div>
|
||||
<ItemList
|
||||
list={noticeList}
|
||||
itemClick={noticeClick}
|
||||
/>
|
||||
{total > 0 ? total> 10 ? <div className="edu-txt-center mt30 mb30">
|
||||
<Pagination
|
||||
showQuickJumper
|
||||
onChange={(page) => { setCurPage(page) }}
|
||||
current={curPage}
|
||||
total={total}
|
||||
showTotal={total => `共 ${total} 条`}
|
||||
/>
|
||||
</div> : "" : <Nodata _html="暂无数据" />}
|
||||
</React.Fragment>
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<img alt="图片加载失败" src={noticePng} width="100%"></img>
|
||||
<div className="centerbox notice-list clearfix">
|
||||
{/* <div className="head-navigation">
|
||||
<Link to="/">首页<span className="greater"> > </span></Link>
|
||||
<span>成果</span>
|
||||
</div> */}
|
||||
<div className="body">
|
||||
<Affix className="affix-list-left" offsetTop={90}>
|
||||
<div className="navigationMenu">
|
||||
<ul className="menu-ul">
|
||||
<li className="MenuTitle" onClick={()=>click('0')}><span><i className="iconfont icon-xiangmugonggao"></i>成果来源</span></li>
|
||||
{
|
||||
achieveSource.map(item=>{
|
||||
return <li className={tab == item.code ? "active" : ""} onClick={()=>click(item.code)} key={item.code}><span>{item.name}</span></li>
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</Affix>
|
||||
<div className="notice-center-content">
|
||||
{sortNav()}
|
||||
{loading ? <Loading /> : content()}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
|
@ -0,0 +1,215 @@
|
|||
.notice-list{
|
||||
.ant-tabs {
|
||||
.ant-tabs-left-bar{
|
||||
border: 1px solid #E5E5E5;
|
||||
.ant-tabs-nav-container{
|
||||
margin-right: 0;
|
||||
}
|
||||
.ant-tabs-nav-wrap{
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
svg{
|
||||
margin-right:.75em;
|
||||
}
|
||||
}
|
||||
.ant-tabs-tab{
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
align-items: center;
|
||||
margin-bottom: 0.5rem;
|
||||
width: 13.5rem;
|
||||
height: 2.8125rem;
|
||||
background: #fff;
|
||||
font-size: 1.125rem;
|
||||
|
||||
}
|
||||
.ant-tabs-left-content{
|
||||
border: 0;
|
||||
}
|
||||
.ant-tabs-tab-active{
|
||||
background: #1890FF;
|
||||
color: #fff;
|
||||
}
|
||||
.ant-tabs-ink-bar{
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.notice-sort-nav{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: .3rem 2rem 1.5rem;
|
||||
margin: 0px -1.25rem;
|
||||
border-bottom: 1px solid #E0E0E0;
|
||||
.ant-input:hover{
|
||||
border-color: #4154f1;
|
||||
}
|
||||
.ant-btn-primary{
|
||||
background-color: #4154f1;
|
||||
&:hover{
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.notice-center-content{
|
||||
padding:1.25rem;
|
||||
background: #fff;
|
||||
flex: auto;
|
||||
}
|
||||
|
||||
.item-head-title{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 1.25rem 0 .6rem 0;
|
||||
.item-head-title-content{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 1rem;
|
||||
span{
|
||||
font-weight: bold;
|
||||
}
|
||||
i{
|
||||
margin-right: .25em;
|
||||
color: #4154f1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-input-group-addon{
|
||||
border: 0 !important;
|
||||
}
|
||||
|
||||
.item-head-title{
|
||||
border-bottom: 1px solid #E5E5E5;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.center-right-but{
|
||||
caret-color: rgba(0, 0, 0, 0);
|
||||
.piece{
|
||||
margin:0 .8rem;
|
||||
color: #aaa;
|
||||
}
|
||||
.sortLink{
|
||||
color: #333;
|
||||
cursor: pointer;
|
||||
&:hover{
|
||||
color: #4154f1;
|
||||
}
|
||||
&.active{
|
||||
color: #4154f1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.body{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: -20px;
|
||||
|
||||
.navigationMenu{
|
||||
margin-right: 20px;
|
||||
width: 20.8em;
|
||||
caret-color: rgba(0, 0, 0, 0);
|
||||
.menu-ul:last-child{
|
||||
margin-top: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.none_p_title{
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.menu-ul{
|
||||
background-color: white;
|
||||
margin-bottom: 12px;
|
||||
border-radius:2px;
|
||||
|
||||
.MenuTitle{
|
||||
border-bottom: 1px solid #E0E0E0;
|
||||
|
||||
span{
|
||||
display: block;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
border-bottom: 0px solid;
|
||||
i{
|
||||
color: #afaaae;
|
||||
}
|
||||
}
|
||||
|
||||
span:hover{
|
||||
color: #4154f1;
|
||||
.iconfont{
|
||||
color: #4154f1 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
li{
|
||||
padding:0px 0px 0px 20px;
|
||||
position: relative;
|
||||
height: 62px;
|
||||
line-height: 62px;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
span{
|
||||
display: block;
|
||||
height: 62px;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
&:last-child > span{
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
li:hover{
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.active{
|
||||
background-color: #fafafa;
|
||||
& ::before{
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 15px;
|
||||
width: 6px;
|
||||
content: '';
|
||||
height: 30px;
|
||||
background: #4154f1;
|
||||
}
|
||||
}
|
||||
|
||||
& i{
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-input-group-addon .ant-btn-lg {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.edu-txt-center .ant-pagination {
|
||||
margin: 2rem auto;
|
||||
text-align: center;
|
||||
.ant-pagination-item:focus, .ant-pagination-item:hover, .ant-pagination-item-active, .ant-pagination-prev:hover a, .ant-pagination-next:hover a, .ant-pagination-options-quick-jumper input:focus, .ant-pagination-options-quick-jumper input:hover{
|
||||
border-color: #4154f1;
|
||||
}
|
||||
.ant-pagination-disabled{
|
||||
& a, & :hover a, & :focus a, & .ant-pagination-item-link, &:hover .ant-pagination-item-link , &:focus .ant-pagination-item-link {
|
||||
color: rgba(0, 0, 0, 0.25) !important;
|
||||
border-color: #d9d9d9;
|
||||
}
|
||||
}
|
||||
.ant-pagination-item-active a{
|
||||
color: #4154f1
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// 成果开始
|
||||
export const noticeStatus = [
|
||||
{ code: 0, name: "关闭", dicItemName: '关闭' },
|
||||
{ code: 1, name: "正常", dicItemName: '正常' },
|
||||
{ code: 2, name: "草稿", dicItemName: '草稿' },
|
||||
];
|
||||
|
||||
export const achieveSource = [
|
||||
// { code: "1", name: "开源项目" },
|
||||
// { code: "2", name: "创客任务" },
|
||||
// { code: "3", name: "科研成果" },
|
||||
// { code: "4", name: "其他" },
|
||||
{ code: "开源项目", name: "开源项目" },
|
||||
{ code: "创客任务", name: "创客任务" },
|
||||
{ code: "科研成果", name: "科研成果" },
|
||||
{ code: "其他", name: "其他" },
|
||||
];
|
||||
|
||||
export const achieveType = [
|
||||
{ code: "算法", name: "算法"},
|
||||
{ code: "理论", name: "理论"},
|
||||
{ code: "工具", name: "工具"},
|
||||
{ code: "软件", name: "软件"},
|
||||
{ code: "其他", name: "其他"},
|
||||
// { code: "1", name: "算法"},
|
||||
// { code: "2", name: "理论"},
|
||||
// { code: "3", name: "工具"},
|
||||
// { code: "4", name: "软件"},
|
||||
// { code: "5", name: "其他"},
|
||||
];
|
||||
|
||||
export const noticeChecked = [
|
||||
{ code: 0, name: "未通过", dicItemName: "未通过" },
|
||||
{ code: 1, name: "通过", dicItemName: "通过" },
|
||||
{ code: 2, name: "未处理", dicItemName: "未处理" },
|
||||
];
|
||||
//成果结束
|
|
@ -0,0 +1,73 @@
|
|||
import React from 'react';
|
||||
|
||||
export function AbandonSvg({ color }) {
|
||||
return <svg width="16" height="15.198" viewBox="0 0 16 15.198">
|
||||
<g id="组_96" data-name="组 96" transform="translate(-54.703 -1778.755)">
|
||||
<g id="组_87" data-name="组 87" transform="translate(63.014 1786.264)">
|
||||
<path id="路径_334" data-name="路径 334" d="M365.033,2110.025H361.89a.591.591,0,1,1,0-1.183h3.143a.591.591,0,1,1,0,1.183Z" transform="translate(-359.618 -2105.589)" fill={color} />
|
||||
<path id="路径_335" data-name="路径 335" d="M316.429,2010.462a3.844,3.844,0,1,0,1.126,2.718A3.819,3.819,0,0,0,316.429,2010.462Zm-.739,4.7a2.8,2.8,0,1,1,0-3.959A2.79,2.79,0,0,1,315.69,2015.16Z" transform="translate(-309.866 -2009.336)" fill={color} />
|
||||
</g>
|
||||
<g id="组_88" data-name="组 88" transform="translate(54.703 1778.755)">
|
||||
<path id="路径_336" data-name="路径 336" d="M61.441,1790.478a5.6,5.6,0,0,1,5.545-5.651,5.476,5.476,0,0,1,1.02.1v-4.368a1.808,1.808,0,0,0-1.8-1.8H56.507a1.808,1.808,0,0,0-1.8,1.8v11.02a1.808,1.808,0,0,0,1.8,1.8h5.718A5.705,5.705,0,0,1,61.441,1790.478Zm-4.155-8.229a.7.7,0,0,1,.728-.666h6.692a.7.7,0,0,1,.728.666h0a.7.7,0,0,1-.728.666H58.014a.7.7,0,0,1-.728-.666Zm3.077,7.351h-2.5a.673.673,0,0,1,0-1.332h2.5a.673.673,0,0,1,0,1.332Zm-2.349-3.44a.7.7,0,0,1-.728-.666h0a.7.7,0,0,1,.728-.666h3.18a.7.7,0,0,1,.728.666h0a.7.7,0,0,1-.728.666Z" transform="translate(-54.703 -1778.755)" fill={color} />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
}
|
||||
|
||||
export function AllSvg({ color }) {
|
||||
return <svg width="16" height="15.198" viewBox="0 0 16 15.198">
|
||||
<g id="组_93" data-name="组 93" transform="translate(696.223 -1778.755)">
|
||||
<path id="路径_337" data-name="路径 337" d="M-365.778,2071.537l-1.4.948h-.467a.313.313,0,0,0-.311.315v1.263a.314.314,0,0,0,.311.316h.467l1.4.947a.315.315,0,0,0,.221-.094.314.314,0,0,0,.09-.222v-3.157A.314.314,0,0,0-365.778,2071.537Z" transform="translate(-317.611 -283.396)" fill={color} />
|
||||
<g id="组_90" data-name="组 90" transform="translate(-688.125 1786.051)">
|
||||
<path id="路径_338" data-name="路径 338" d="M-434.315,2010.493a3.925,3.925,0,0,0-2.794-1.157,3.925,3.925,0,0,0-2.794,1.157,3.925,3.925,0,0,0-1.157,2.794,3.925,3.925,0,0,0,1.157,2.794,3.926,3.926,0,0,0,2.794,1.157,3.926,3.926,0,0,0,2.794-1.157,3.925,3.925,0,0,0,1.157-2.794A3.925,3.925,0,0,0-434.315,2010.493Zm-.76,4.828a2.867,2.867,0,0,1-2.034.841,2.868,2.868,0,0,1-2.034-.841,2.858,2.858,0,0,1-.843-2.034,2.858,2.858,0,0,1,.843-2.034,2.858,2.858,0,0,1,2.034-.843,2.858,2.858,0,0,1,2.034.843A2.88,2.88,0,0,1-435.075,2015.321Z" transform="translate(441.06 -2009.336)" fill={color} />
|
||||
</g>
|
||||
<g id="组_91" data-name="组 91" transform="translate(-696.223 1778.755)">
|
||||
<path id="路径_339" data-name="路径 339" d="M-689.3,1790.466a5.672,5.672,0,0,1,5.7-5.645,5.79,5.79,0,0,1,1.048.1v-4.363a1.832,1.832,0,0,0-1.854-1.8h-9.964a1.832,1.832,0,0,0-1.854,1.8v11.008a1.833,1.833,0,0,0,1.854,1.8h5.877A5.577,5.577,0,0,1-689.3,1790.466Zm-4.27-8.22a.712.712,0,0,1,.748-.665h6.878a.713.713,0,0,1,.748.665h0a.713.713,0,0,1-.748.665h-6.878a.713.713,0,0,1-.748-.665Zm3.163,7.343h-2.573a.633.633,0,0,1-.589-.665.633.633,0,0,1,.589-.665h2.573a.633.633,0,0,1,.589.665A.632.632,0,0,1-690.406,1789.588Zm-2.414-3.437a.713.713,0,0,1-.748-.665h0a.713.713,0,0,1,.748-.665h3.268a.713.713,0,0,1,.748.665h0a.713.713,0,0,1-.748.665Z" transform="translate(696.223 -1778.755)" fill={color} />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
}
|
||||
|
||||
export function ChangeSvg({ color }) {
|
||||
return <svg width="16" height="15.176" viewBox="0 0 16 15.176">
|
||||
<g id="组_94" data-name="组 94" transform="translate(-703.372 -1778.755)">
|
||||
<path id="路径_331" data-name="路径 331" d="M1034.307,2069.547a1.2,1.2,0,0,0-1.2.934,1.17,1.17,0,0,0,.707,1.326c.044.219.063.475-.073.573a1.129,1.129,0,0,0-.885.486v.422h2.865v-.393a1.414,1.414,0,0,0-.949-.523.751.751,0,0,1-.032-.554,1.172,1.172,0,0,0,.739-1.309,1.2,1.2,0,0,0-1.175-.961Z" transform="translate(-318.75 -281.318)" fill={color} />
|
||||
<path id="路径_332" data-name="路径 332" d="M965.772,2010.458a3.832,3.832,0,1,0,1.122,2.709A3.807,3.807,0,0,0,965.772,2010.458Zm-.737,4.682a2.79,2.79,0,1,1,0-3.946A2.781,2.781,0,0,1,965.035,2015.141Z" transform="translate(-247.522 -223.068)" fill={color} />
|
||||
<g id="组_85" data-name="组 85" transform="translate(703.372 1778.755)">
|
||||
<path id="路径_333" data-name="路径 333" d="M710.088,1790.463a5.586,5.586,0,0,1,5.527-5.643,5.441,5.441,0,0,1,1.017.1v-4.362a1.8,1.8,0,0,0-1.8-1.8H705.17a1.8,1.8,0,0,0-1.8,1.8v11.005a1.8,1.8,0,0,0,1.8,1.8h5.7A5.705,5.705,0,0,1,710.088,1790.463Zm-4.141-8.218a.7.7,0,0,1,.726-.665h6.67a.7.7,0,0,1,.726.665h0a.7.7,0,0,1-.726.665h-6.67a.7.7,0,0,1-.726-.665Zm3.067,7.341h-2.5a.673.673,0,0,1,0-1.33h2.5a.673.673,0,0,1,0,1.33Zm-2.341-3.436a.7.7,0,0,1-.726-.665h0a.7.7,0,0,1,.726-.665h3.169a.7.7,0,0,1,.726.665h0a.7.7,0,0,1-.726.665Z" transform="translate(-703.372 -1778.755)" fill={color} />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
}
|
||||
|
||||
export function CheckSvg({ color }) {
|
||||
return <svg width="16" height="14.548" viewBox="0 0 16 14.548">
|
||||
<g id="组_95" data-name="组 95" transform="translate(-1325.073 -1778.755)">
|
||||
<path id="路径_325" data-name="路径 325" d="M1655.311,1844.214" transform="translate(-319.943 -63.419)" fill={color} />
|
||||
<path id="路径_326" data-name="路径 326" d="M1680.948,2109.083a.659.659,0,1,0-.407.609.659.659,0,0,0,.407-.609Z" transform="translate(-343.504 -319.392)" fill={color} />
|
||||
<g id="组_82" data-name="组 82" transform="translate(1333.053 1785.974)">
|
||||
<path id="路径_327" data-name="路径 327" d="M1587.227,2013.456a2.664,2.664,0,1,1-1.177-1.812l.058-.378.585-.39a3.665,3.665,0,1,0,1.565,3,3.7,3.7,0,0,0-.064-.686l-.541.361Z" transform="translate(-1580.931 -2010.216)" fill={color} />
|
||||
<path id="路径_328" data-name="路径 328" d="M1645.528,2074.812a1.261,1.261,0,1,1-.58-2.115l.479-.319a1.734,1.734,0,1,0,.941,1.542c0-.008,0-.016,0-.023l-.514.349A1.254,1.254,0,0,1,1645.528,2074.812Z" transform="translate(-1640.971 -2070.255)" fill={color} />
|
||||
</g>
|
||||
<g id="组_83" data-name="组 83" transform="translate(1337.198 1786.341)">
|
||||
<path id="路径_329" data-name="路径 329" d="M1717.735,2023.462h-.009l-.741-.124h0a.373.373,0,0,1-.271-.406v0l.186-.693,0-.01a.092.092,0,0,0-.05-.125l-.01,0-.009-.006a.132.132,0,0,0-.074-.023.134.134,0,0,0-.075.023l-1.335.89-.133.628-1.246.831.005,0a1.024,1.024,0,0,1,.608.916l1.238-.84.628.121,1.34-.893.005,0c.04-.02.049-.053.05-.148C1717.805,2023.516,1717.773,2023.462,1717.735,2023.462Z" transform="translate(-1713.97 -2022.066)" fill={color} />
|
||||
</g>
|
||||
<path id="路径_330" data-name="路径 330" d="M1331.495,1789.957a5.343,5.343,0,0,1,5.285-5.4,5.206,5.206,0,0,1,.972.091v-4.174a1.725,1.725,0,0,0-1.719-1.72h-9.24a1.725,1.725,0,0,0-1.719,1.72v10.53a1.725,1.725,0,0,0,1.719,1.72h5.45A5.462,5.462,0,0,1,1331.495,1789.957Zm-3.96-7.863a.669.669,0,0,1,.694-.636h6.378a.669.669,0,0,1,.694.636h0a.669.669,0,0,1-.694.636h-6.378a.669.669,0,0,1-.694-.636Zm2.933,7.024h-2.386a.644.644,0,0,1,0-1.272h2.386a.644.644,0,0,1,0,1.272Zm-2.239-3.287a.669.669,0,0,1-.694-.636h0a.669.669,0,0,1,.694-.636h3.031a.669.669,0,0,1,.694.636h0a.669.669,0,0,1-.694.636Z" transform="translate(0 0)" fill={color} />
|
||||
</g>
|
||||
</svg>
|
||||
}
|
||||
|
||||
export function NewSvg({ color }) {
|
||||
return <svg width="33.091" height="14" viewBox="0 0 33.091 14">
|
||||
<g id="组_137" data-name="组 137" transform="translate(-294 -259)">
|
||||
<path id="路径_346" data-name="路径 346" d="M324.546,259h-28A2.553,2.553,0,0,0,294,261.545v8.909A2.553,2.553,0,0,0,296.545,273h28a2.553,2.553,0,0,0,2.545-2.545v-8.909A2.553,2.553,0,0,0,324.546,259ZM302.9,269.818a.642.642,0,0,1-.445.611.983.983,0,0,1-.191.025.664.664,0,0,1-.535-.28l-3.907-5.893v5.524a.636.636,0,1,1-1.273.013v-7.636a.632.632,0,0,1,1.158-.356l3.92,5.88v-5.524a.636.636,0,1,1,1.273,0Zm8.285-4.455a.636.636,0,1,1,0,1.273h-4.455v2.546h4.455a.636.636,0,1,1,0,1.273h-5.091a.63.63,0,0,1-.636-.636v-7.636a.63.63,0,0,1,.636-.636h5.091a.636.636,0,0,1,0,1.273h-4.455v2.545Zm13.211-3.029-2.52,7.522a.63.63,0,0,1-1.2,0l-1.922-5.74-1.922,5.74a.659.659,0,0,1-1.2,0l-2.52-7.522a.636.636,0,0,1,1.209-.395l1.922,5.74,1.922-5.74a.659.659,0,0,1,1.2,0l1.922,5.74,1.922-5.74a.624.624,0,1,1,1.184.395Zm0,0" fill={color} />
|
||||
</g>
|
||||
</svg>
|
||||
}
|
||||
|
||||
export function CallSvg({ color }) {
|
||||
return <svg width="13.925" height="16" viewBox="0 0 13.925 16">
|
||||
<path id="路径_350" data-name="路径 350" d="M1822.1,2425.528h-1.478a1.674,1.674,0,0,1-1.68,1.68h-5.371a1.674,1.674,0,0,1-1.68-1.68h-1.461a1.122,1.122,0,0,0-1.117,1.117v12.485a1.122,1.122,0,0,0,1.117,1.117h11.691a1.122,1.122,0,0,0,1.117-1.117v-12.481A1.155,1.155,0,0,0,1822.1,2425.528Zm-10.052,4.009h4.306a.77.77,0,1,1,0,1.539h-4.306a.77.77,0,1,1,0-1.539Zm0,3.463h4.306a.77.77,0,1,1,0,1.54h-4.306a.77.77,0,0,1,0-1.54Zm5.358,4.781h-5.382a.77.77,0,0,1,0-1.54h5.382a.77.77,0,0,1,0,1.54Zm2.92.052a.822.822,0,1,1,.822-.822A.822.822,0,0,1,1820.33,2437.833Zm.028-4.967-1.245.953v-3.9a.362.362,0,0,1,.331-.382h1.816a.362.362,0,0,1,.331.382l.01,3.9Zm-1.673-6.569h-4.871a1.034,1.034,0,0,1-1.025-1.025,1.045,1.045,0,0,1,1.025-1.025h4.871a1.025,1.025,0,0,1,0,2.049Zm0,0" transform="translate(-1809.317 -2424.247)" fill={color} />
|
||||
</svg>
|
||||
|
||||
}
|
|
@ -331,7 +331,7 @@ const Competition = (props) => {
|
|||
{/* 交流互动 */}
|
||||
<Route path="/competition/:competitionId/chat"
|
||||
render={
|
||||
() => (<Chat {...props} isLoacl={qzDetail && qzDetail.is_local} />)
|
||||
() => (<Chat {...props} isLocal={qzDetail && qzDetail.is_local}/>)
|
||||
}
|
||||
></Route>
|
||||
{/* 联系我们 */}
|
||||
|
|
|
@ -229,7 +229,7 @@ export default Form.create()((props) => {
|
|||
<span className="mr50 fl"><span className="color-grey9">提交时间:</span>{item.createdAt}</span>
|
||||
<span className="fl"><span className="color-grey9">稿件状态:</span>{item.read ? '雇主已浏览' : '雇主未浏览'}</span>
|
||||
{
|
||||
item.user.nickname !== "******" && <span className="fr">
|
||||
item.paperDetail&&item.paperDetail.content !== "******" && <span className="fr">
|
||||
{[4, 5].includes(detailStatus) && <a className="mr20" onClick={() => { setReportVisible(!reportVisible); setCheckedItem(item) }}><i className="iconfont icon-jinggao font-15 mr3"></i>举报</a>}
|
||||
<a className="mr20" onClick={() => { commentEdit(item.id) }}><i className="iconfont icon-huifu1 font-15 mr3"></i>{item.comments ? item.comments.length : 0}</a>
|
||||
<a onClick={() => { thumbUp(item.id) }}><i className={`iconfont ${item.currentUserCanThumbsUp?'icon-morendianzan_icon':'icon-dianzan_icon'} font-16 mr3`}></i>{item.thumbsUp}</a>
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Form, Input, Button, Modal, Checkbox, Tooltip } from 'antd';
|
|||
import classNames from 'classnames';
|
||||
import moment from 'moment';
|
||||
import { Link } from "react-router-dom";
|
||||
import { formatDuring, getImageUrl } from 'educoder';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import Upload from '../../components/Upload';
|
||||
import StatusNav from '../../components/statusNav';
|
||||
import ItemListPaper from '../components/itemListPaper';
|
||||
|
@ -267,6 +267,7 @@ export default Form.create()(
|
|||
});
|
||||
}
|
||||
|
||||
// 公示应征者信息
|
||||
function showUser() {
|
||||
if (dataList.length === 0) {
|
||||
Modal.info({
|
||||
|
@ -290,6 +291,7 @@ export default Form.create()(
|
|||
}
|
||||
}
|
||||
|
||||
// 添加专家评审流程
|
||||
function addExpertReviewModal() {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
|
@ -306,14 +308,17 @@ export default Form.create()(
|
|||
})
|
||||
}
|
||||
|
||||
// 刷新成果列表
|
||||
const reloadList = useCallback(() => {
|
||||
setRelaodChildList(Math.random());
|
||||
});
|
||||
|
||||
// 刷新详情
|
||||
const reloadDetail = useCallback(() => {
|
||||
setReload(Math.random());
|
||||
}, []);
|
||||
|
||||
// 实名认证
|
||||
function certificationCheck() {
|
||||
if (current_user.authentication || current_user.enterpriseCertification) {
|
||||
setApplyModal(true);
|
||||
|
@ -327,6 +332,7 @@ export default Form.create()(
|
|||
}
|
||||
}
|
||||
|
||||
// 签订协议/提交成果
|
||||
const signContent = useCallback(() => {
|
||||
if (signAgreement && isPaper) {
|
||||
let checkStatustext;
|
||||
|
@ -376,18 +382,22 @@ export default Form.create()(
|
|||
}
|
||||
}, [signAgreement, isPaper, current_user, detailData, dataList]);
|
||||
|
||||
// 用户详情页
|
||||
function goUser(login) {
|
||||
window.location.href = mygetHelmetapi && mygetHelmetapi.main_web_site_url + `/accounts/${login}`;
|
||||
}
|
||||
|
||||
// 身份认证页
|
||||
function goUserProfiles() {
|
||||
window.open(mygetHelmetapi && mygetHelmetapi.main_web_site_url + `/users/${current_user.login}/profiles`);
|
||||
}
|
||||
|
||||
// 公示时间计算
|
||||
function backPublicEnd(makePublicAt, makePublicDays) {
|
||||
return moment(new Date(makePublicAt).getTime() + makePublicDays * 24 * 3600 * 1000).format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
|
||||
// 关注
|
||||
function follow() {
|
||||
followTask({
|
||||
userId: current_user.user_id,
|
||||
|
@ -400,6 +410,7 @@ export default Form.create()(
|
|||
})
|
||||
}
|
||||
|
||||
// 取关
|
||||
function unfollow() {
|
||||
unfollowTask({
|
||||
userId: current_user.user_id,
|
||||
|
@ -412,6 +423,14 @@ export default Form.create()(
|
|||
})
|
||||
}
|
||||
|
||||
// 在线预览佐证材料
|
||||
function showProof(){
|
||||
let pdfId=detailData.taskResultProof&&detailData.taskResultProof.proofFileNumbers;
|
||||
|
||||
Number(pdfId)>0&&window.open(`${httpUrl}/busiAttachments/view/${pdfId}?disposition=inline`, '_blank');
|
||||
}
|
||||
|
||||
console.log(detailData.status === 4 && dataList.length && (!detailData.isProofBoolean) && (!detailData.expertReview) && detailData.user)
|
||||
return (
|
||||
<div className="centerbox task-detail">
|
||||
<div className="head-navigation">
|
||||
|
@ -553,8 +572,13 @@ export default Form.create()(
|
|||
{detailData.status === 4 && dataList.length && (!detailData.isProofBoolean) && (!detailData.expertReview) && detailData.user && (current_user.admin || current_user.login === detailData.user.login) ?
|
||||
<a className="line_1 color-blue fr ml20" onClick={() => { setVisibleProofs(true) }}>上传佐证材料</a> : ''}
|
||||
{dataList.length > 0 && taskLimit && <a className="line_1 color-blue fr ml20" onClick={() => { window.open(`${httpUrl}/api/paper/papers/download/${id}`) }}>一键导出成果物 >></a>}
|
||||
|
||||
{/* 若后台为“手动公示”,则显示按钮,是否公示由雇主与管理员是否点击“应征者名单公示”按钮决定,同时必须有成果,非关闭状态 */}
|
||||
{!detailData.showUserStatus && !detailData.expertReview && taskLimit && detailData.showUserMode===2 && <a className="fr color-orange ml20" onClick={showUser}>应征者名单公示 >></a>}
|
||||
|
||||
{detailData.isProofBoolean&& <a className="fr color-orange ml20" onClick={showProof}>评审结果公示</a>}
|
||||
|
||||
|
||||
{/* [添加专家评审流程]按钮入口,仅管理员可见 */}
|
||||
{taskLimit && !detailData.expertReview && detailData.status < 4 && <a className="fr color-orange ml20" onClick={addExpertReviewModal}>添加专家评审流程</a>}
|
||||
</div>
|
||||
|
|
|
@ -593,6 +593,9 @@ class NewHeader extends Component {
|
|||
// 创客
|
||||
} else if (url.indexOf('/task') > -1 && match.path.indexOf('/task') > -1) {
|
||||
return true
|
||||
// 成果库
|
||||
} else if (url.indexOf('/achievement') > -1 && match.path.indexOf('/achievement') > -1) {
|
||||
return true
|
||||
// 管理
|
||||
} else if ((url.indexOf('/managements') > -1 && (match.path.indexOf('/managements') > -1 || match.path.indexOf('/administration') > -1 || match.path.indexOf('/admin') > -1))) {
|
||||
return true
|
||||
|
@ -616,7 +619,7 @@ class NewHeader extends Component {
|
|||
}
|
||||
needAdd=(url)=> {
|
||||
let {current_user,mygetHelmetapi,history}=this.props;
|
||||
if (current_user.authentication || current_user.enterpriseCertification) {
|
||||
if (current_user.authentication || current_user.enterprise_certification) {
|
||||
history.push('/needs/new')
|
||||
} else {
|
||||
Modal.confirm({
|
||||
|
|
Loading…
Reference in New Issue