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

This commit is contained in:
何童崇 2022-12-29 09:55:52 +08:00
commit a74bd1daf6
39 changed files with 2463 additions and 65 deletions

View File

@ -222,7 +222,7 @@
"webpack": "^4.42.1",
"webpack-bundle-analyzer": "^3.7.0"
},
"volta":{
"node":"8.12.0"
"volta": {
"node": "8.12.0"
}
}

View File

@ -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} />
{/*专家评审*/}

View File

@ -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";
//响应前的设置

View File

@ -8,6 +8,7 @@ export default (props) => {
return (
<div className='pagination-table'>
<Table
rowKey={(row,i) => row.id||i}
{...props}
pagination={false}
onRow={handleRow}

View File

@ -199,7 +199,8 @@ class NewHeader extends Component {
const hostname = window.location.hostname;
const port = window.location.port;
const isDev = window.location.port == 3007;
let isdev2= isDev ?'http://192.168.1.40:3000':`http://${hostname}`;
let isdev2= isDev ?'http://117.50.100.12:49999':`http://${hostname}`;
console.log(url,isdev2,isDev);
let str = "";
if(url.indexOf("http")>-1){
if(url.indexOf("https")>-1){
@ -326,22 +327,7 @@ class NewHeader extends Component {
{
settings.navbar && settings.navbar.map((item, key) => {
var new_link = item.link;
// var user_login = current_user && current_user.login;
var is_hidden = item.hidden;
// if (new_link && (new_link.indexOf("courses") > -1 || new_link.indexOf("contests") > -1)) {
// if (user_login) {
// if (new_link.indexOf("courses") > -1) {
// new_link = new_link.replace(/courses/g, user_login + "/courses")
// } else if (new_link.indexOf("contests") > -1) {
// new_link = new_link.replace(/contests/g, user_login + "/contests")
// }
// } else {
// is_hidden = true
// }
// }
// if (user_login && (new_link && new_link.indexOf("homes") > -1)) {
// new_link = new_link.replace(/homes/g, user_login + "/user_activities")
// }
var waiLian = (new_link && str.filter(item=>new_link.indexOf(item)>-1) );
var wl = waiLian && waiLian.length>0;
return (

View File

@ -395,6 +395,7 @@ class Detail extends Component {
forked_count: result.data.forked_count,
defaultBranch: result.data.default_branch
})
document.title = `${result.data.author.name}/${result.data.name}${result.data.description?''+result.data.description:''}`;
}
}).catch((error) => { })
}

View File

@ -36,7 +36,8 @@ class order_form extends Component {
show_token: false,
cannot_edit: false,
issue_current_user: true,
atWhoLoginList:undefined
atWhoLoginList:undefined,
endDisableData:undefined
};
}
componentDidUpdate=(prevPros)=>{
@ -276,7 +277,11 @@ class order_form extends Component {
changeBeginTime = (start_date, value) => {
this.setState({
start_date: value,
endDisableData:c=>c<moment(value).endOf('day'),
due_date:undefined
});
console.log(moment(value).endOf('day'));
};
changeEndTime = (due_date, value) => {
this.setState({
@ -347,13 +352,12 @@ class order_form extends Component {
});
}
};
render() {
const { getFieldDecorator } = this.props.form;
const { projectsId , owner } = this.props.match.params;
const { orderId } = this.props.match.params;
const { form_type } = this.props;
const {issue_chosen,branches,description,get_attachments,isSpin,start_date,due_date} = this.state;
const {issue_chosen,branches,description,get_attachments,isSpin,start_date,due_date,endDisableData} = this.state;
return (
<Spin spinning={isSpin}>
<div className="ProjectListIndex issue-form-index">
@ -523,6 +527,7 @@ class order_form extends Component {
style={{ width: "100%" }}
placeholder="请选择结束日期"
onChange={this.changeEndTime}
disabledDate={endDisableData}
/>
</Form.Item>
<Form.Item label="完成度">

View File

@ -136,6 +136,7 @@ class Infos extends Component {
isSpin: false,
undo_events:e
});
document.title = result.data.username+'('+ username +')';
})
.catch((error) => {
this.setState({
@ -238,9 +239,9 @@ class Infos extends Component {
<span>
{
user && user.gender===1?
<i className="iconfont icon-nan1"></i>
:
<i className="iconfont icon-nv1"></i>
:
<i className="iconfont icon-nan1"></i>
}
</span>
</span>

View File

@ -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 || '请求错误');
}
}

View File

@ -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>
)
}

View File

@ -0,0 +1,60 @@
.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;
}
.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;
}

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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: 255, message: '长度不能超过255个字符' }],
<Input
className="edit-input"
placeholder="请输入成果名称"
/>
)}
{editor()}
{helper(
"发布单位:",
"publisher",
[{ required: true, message: "请输入发布单位" },
{ max: 255, message: '长度不能超过255个字符' }],
<Input
className="edit-input"
placeholder="请输入发布单位"
/>
)}
{helper(
"联系人:",
"achievementIntro",
[{ max: 255, message: '长度不能超过255个字符' }],
<Input
className="edit-input"
placeholder="请输入联系人"
/>
)}
{helper(
"联系方式:",
"contactInfo",
[{ max: 5000, message: '长度不能超过5000个字符' }],
<TextArea
rows={4}
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;

View File

@ -0,0 +1,468 @@
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, //21
}).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, //21
}).then(data => {
setDataAll(data.rows || []);
setDownloading(false);
exportExcel("#exportList .ant-table-body", `成果列表 ${moment().format("YYYY-MM-DD HH:mm:ss")}`);
});
}, [download]);
const columns = [
{
title: '序号',
dataIndex: "index",
render: (text, record, index) => {
return index + 1 + (curPage - 1) * pageSize
}
},
{
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%',
render: (text, record) => {
return <span>{isChecked == 1 ? <Link to={`/achievement/noticeDetail/${record.id}`}>{text}</Link> : text}</span>;
}
},
{
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(6, 0, {
title: '浏览数',
key: 'visits',
dataIndex: 'visits'
});
columns.splice(7, 0, {
title: '附件下载数',
key: 'attachmentDownloadCount',
dataIndex: 'attachmentDownloadCount',
render: (text, record) => {
return <span>{text ? text : '无附件'}</span>;
}
});
}
let exportColumn = [
{
title: '序号',
dataIndex: "index",
render: (text, record, index) => {
return index + 1 + (curPage - 1) * pageSize
}
},
{
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: '创建时间',
key: 'createdAt',
dataIndex: 'createdAt',
},
{
title: '成果描述',
key: 'text',
dataIndex: 'text',
render: (text, record) => {
return <div className="editor-w-text" dangerouslySetInnerHTML={{ __html: text && text.replace(/\n/g, '</br>') }}></div>
}
},
{
title: '发布单位',
dataIndex: 'publisher',
key: 'publisher',
width: '20%'
},
{
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>
}
}
];
if (isChecked == 1) {
exportColumn.splice(3, 1, {
title: '发布时间',
key: 'publishDate',
dataIndex: 'publishDate',
});
}
//
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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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 = [

View File

@ -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"

View File

@ -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{

View File

@ -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';

View File

@ -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');
}

View File

@ -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, //21
}).then(data => {

View File

@ -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';

View File

@ -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))))
);

View File

@ -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
});
}

View File

@ -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>
)
})
)
}

View File

@ -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%;
}
}

View File

@ -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

View File

@ -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">&nbsp;&gt;&nbsp;</span></Link>
<Link to="/achievement">成果库<span className="greater">&nbsp;&gt;&nbsp;</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>
)
}
)

View File

@ -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;
}
}

View File

@ -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, //21
};
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, //21
};
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">&nbsp;&gt;&nbsp;</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>
)
}

View File

@ -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
}
}

View File

@ -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: "未处理" },
];
//成果结束

View File

@ -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>
}

View File

@ -56,7 +56,6 @@ const display = (node, newTd) => {
const {type, checked, value} = node;
newSpan.innerText = value;
if (type === 'radio' || type === 'checkbox') {
console.log("type", type)
newSpan.innerText = type === 'radio' ? (checked ? "●" : "○") : (checked ? "■" : "□");
newSpan.style.fontSize = '16px';
newSpan.style.paddingLeft = '15px';

View File

@ -577,31 +577,60 @@ class NewHeader extends Component {
matchpaths = (url) => {
const { match } = this.props;
let pathname=sessionStorage.pathname;
if(url){
if (url.indexOf('forums') > -1 && match.path.indexOf('forums') > -1) {
return true
// 开源项目,路由改版后,比较麻烦,因此使用多个进行判断
} else if (url.indexOf('explore') > -1 && match.path.indexOf('explore') > -1) {
return true
// 开源项目,路由改版后,比较麻烦,因此使用多个进行判断
} else if (url.indexOf('explore') > -1 && match.url.indexOf(pathname) > -1 && match.url.indexOf('/administration') === -1 && match.url.indexOf('/admin') === -1) {
return true
// 公告
} else if (url.indexOf('/notice') > -1 && match.path.indexOf('/notice') > -1) {
return true
// 创客
} else if (url.indexOf('/task') > -1 && match.path.indexOf('/task') > -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
} else if (['http://117.50.100.12:8080','https://osredm.com','http://111.8.36.180:8000','http://localhost:3007'].includes(url) && match.path === '/') {
return true
} else {
return false
const hostname = window.location.hostname;
const port = window.location.port;
const isDev = hostname == "localhost";
let isdev2= isDev ?'http://117.50.100.12:49999':`http://${hostname}`;
let str = "";
if(url.indexOf("http")>-1){
if(url.indexOf("https")>-1){
isdev2 = `https://${hostname}`;
}
if(!isDev && port){
isdev2+=`:${port}`;
}
str = isdev2+match.path;
}else{
str = match.path;
}
console.log(str,(url+"/"),url && str === url);
if (url && (str === url || str===(url+"/"))) {
return true
}else {
return false
}
// const { match } = this.props;
// let pathname=sessionStorage.pathname;
// console.log(url);
// if(url){
// if (url.indexOf('forums') > -1 && match.path.indexOf('forums') > -1) {
// return true
// // 开源项目,路由改版后,比较麻烦,因此使用多个进行判断
// } else if (url.indexOf('explore') > -1 && match.path.indexOf('explore') > -1) {
// return true
// // 开源项目,路由改版后,比较麻烦,因此使用多个进行判断
// } else if (url.indexOf('explore') > -1 && match.url.indexOf(pathname) > -1 && match.url.indexOf('/administration') === -1 && match.url.indexOf('/admin') === -1) {
// return true
// // 公告
// } else if (url.indexOf('/notice') > -1 && match.path.indexOf('/notice') > -1) {
// return true
// // 创客
// } 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
// } else if (['http://117.50.100.12:8080','https://osredm.com','http://111.8.36.180:8000','http://localhost:3007'].includes(url) && match.path === '/') {
// return true
// } else {
// return false
// }
// }
}
handleVisibleChange = visible => {