forked from Gitlink/forgeplus-react
issue
This commit is contained in:
parent
a51f0625a6
commit
357435579a
|
|
@ -23,7 +23,7 @@ function MyEditor(props) {
|
|||
const toolbarConfig = {};
|
||||
// 隐藏 代办
|
||||
toolbarConfig.excludeKeys = [
|
||||
'todo'
|
||||
'todo', "fullScreen"
|
||||
]
|
||||
|
||||
// 编辑器配置
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ function Main(props){
|
|||
<div className="boxmain">
|
||||
<div className='titleButBox'>
|
||||
<p className="in_title">{tempConfig[temp].mainTitle}</p>
|
||||
{role && role.role !== "None" && <div className='createButs'>
|
||||
{role && role.role !== "None" && <div className='createButs mt10'>
|
||||
{role.role === "Member" && <Button type="primary" ghost className='mr20'>
|
||||
<Link to={`/zone/${deptId}/news/self`}>我的文章</Link>
|
||||
</Button>}
|
||||
|
|
|
|||
|
|
@ -90,22 +90,26 @@ function NewsCreate(props){
|
|||
const {data:{code, msg}} = res;
|
||||
setLoading(false);
|
||||
if(code === 200){
|
||||
message.success("更新成功");
|
||||
history.push(`/zone/${deptId}/news/self`);
|
||||
message.success("提交成功");
|
||||
history.push(`/zone/${deptId}/newdetail/${newsId}`);
|
||||
}else{
|
||||
message.error(msg || '更新失败,请联系管理员!')
|
||||
message.error(msg || '提交失败,请联系管理员!')
|
||||
}
|
||||
}).catch(e=>{
|
||||
setLoading(false);
|
||||
})
|
||||
}
|
||||
addNewsByDirId(fieldsValue.dirId, params).then(res=>{
|
||||
const {data:{code, msg}} = res;
|
||||
const {data:{code, msg, data}} = res;
|
||||
setLoading(false);
|
||||
if(code === 200){
|
||||
message.success("新增成功");
|
||||
history.push(`/zone/${deptId}/news/self`);
|
||||
message.success("提交成功");
|
||||
history.push(`/zone/${deptId}/newdetail/${data}`);
|
||||
}else{
|
||||
message.error(msg || '新增失败,请联系管理员!')
|
||||
message.error(msg || '提交失败,请联系管理员!')
|
||||
}
|
||||
}).catch(e=>{
|
||||
setLoading(false);
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
@ -153,7 +157,7 @@ function NewsCreate(props){
|
|||
type === "richEditor" ? <RichEditor uploadUrl={`${httpUrl}/file/common/upload`} videoUploadUrl={`${httpUrl}/file/common/upload?type=cms`} setValue={(value)=>{setFieldsValue({"content": value})}}/> : <MdEditor
|
||||
placeholder={"请输入详细介绍"}
|
||||
height={500}
|
||||
mdID={"order-new-description"}
|
||||
className='editNewsMd'
|
||||
initValue={value}
|
||||
onChange={(value)=>{setFieldsValue({"content": value})}}
|
||||
imageExpand={false}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React,{ useState , useEffect } from 'react';
|
||||
import { Breadcrumb , Divider, Spin } from 'antd';
|
||||
import { Badge, Breadcrumb , Divider, Spin } from 'antd';
|
||||
import liulan from '../img/liulan.png';
|
||||
import RenderHtml from '../../../components/render-html';
|
||||
import { Base64 } from 'js-base64';
|
||||
|
|
@ -108,6 +108,8 @@ function NewsDetail(props){
|
|||
{ cmsDir && <li><a href={ detail.publishUserUrl } ><img src={ detail.publishUserImage } alt="" className="headimg" /> { detail.publishUserNickname }</a></li> }
|
||||
{ cmsDir && <li>{ detail.isFirstPublish ? '创建于' : '更新于' }{detail.publishTime}</li> }
|
||||
{ detail.visits && <li><img src={liulan} alt="" className="mr5" />{detail.visits}</li> }
|
||||
{ detail.auditStatus === '2' && <li><Badge color={temp === "zone" ? "#466aff" : "#089f7f"} text="待审核" className='pass'/></li>}
|
||||
{ detail.auditStatus === '0' && <li><Badge color="#eb1212" text="未通过" className='failed'/></li>}
|
||||
</ul>
|
||||
</div>
|
||||
{ !IsPC() && <Divider dashed={true} /> }
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ function SourceCreate(props){
|
|||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
// 新建文章
|
||||
// 新建/编辑资源
|
||||
function submit(e){
|
||||
e.preventDefault();
|
||||
validateFields((err, fieldsValue)=>{
|
||||
|
|
@ -89,21 +89,21 @@ function SourceCreate(props){
|
|||
updateMyResource(params).then((res)=>{
|
||||
const {data:{code, msg}} = res;
|
||||
if(code === 200){
|
||||
message.success("编辑成功");
|
||||
history.push(`/zone/${deptId}/source/self`);
|
||||
message.success("提交成功");
|
||||
history.push(`/zone/${deptId}/source/${sourceid}`);
|
||||
}else{
|
||||
message.error(msg || '编辑失败,请联系管理员!')
|
||||
message.error(msg || '提交失败,请联系管理员!')
|
||||
}
|
||||
})
|
||||
return;
|
||||
}
|
||||
addResource(params).then((res)=>{
|
||||
const {data:{code, msg}} = res;
|
||||
const {data:{code, msg, data}} = res;
|
||||
if(code === 200){
|
||||
message.success("新增成功");
|
||||
history.push(`/zone/${deptId}/source/self`);
|
||||
message.success("提交成功");
|
||||
history.push(`/zone/${deptId}/source/${data.id}`);
|
||||
}else{
|
||||
message.error(msg || '新增失败,请联系管理员!')
|
||||
message.error(msg || '提交失败,请联系管理员!')
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
@ -203,8 +203,8 @@ function SourceCreate(props){
|
|||
{getFieldDecorator("fileList", {
|
||||
rules:[{ required:true,message:"请上传资源附件!" }]
|
||||
})(
|
||||
<Upload action={getZoneUrl(`/api/file/common/upload?type=resource`)} showUploadList={false} beforeUpload={beforeUpload} onChange={onChange} withCredentials={true}>
|
||||
<Button>
|
||||
<Upload action={getZoneUrl(`/api/file/common/upload?type=resource`)} showUploadList={false} beforeUpload={beforeUpload} onChange={onChange} withCredentials={true} headers={{Authorization: "3e33a5b0a35824f93666b1084488f0bd5f010025"}}>
|
||||
<Button className='hoverThemeColorBut'>
|
||||
<Icon type="upload" />单击上传
|
||||
</Button>
|
||||
</Upload>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import { Breadcrumb } from 'antd';
|
||||
import { Badge, Breadcrumb } from 'antd';
|
||||
import SourceFile from '../img/sourceFile.png';
|
||||
import RenderHtml from '../../../components/render-html';
|
||||
import { getSourceDetail } from '../api';
|
||||
import { Link } from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import { Base64 } from 'js-base64';
|
||||
import { httpUrl } from '../fetch';
|
||||
import { AlignCenter, FlexAJ } from '../../Component/layout';
|
||||
import SourceIcon from '../img/sourceIcon.png';
|
||||
|
|
@ -16,6 +13,7 @@ function SourceDetail(props){
|
|||
const { deptId , sourceid } = props.match.params;
|
||||
const [ detail , setDetail ] = useState(undefined);
|
||||
const zonedetail = props.data;
|
||||
const {temp} = props;
|
||||
|
||||
useEffect(()=>{
|
||||
if(sourceid){
|
||||
|
|
@ -69,7 +67,9 @@ function SourceDetail(props){
|
|||
</FlexAJ>
|
||||
{detail.createUser && detail.createUser.avatar && <Link to={`/${detail.createUser.userName}`}><img alt='' src={detail.createUser.avatar} className='publicUserAvatar mr10'/></Link>}
|
||||
{detail.createUser && <Link className='mr20' to={`/${detail.createUser.userName}`}>{detail.createUser.nickName}</Link>}
|
||||
<span>发布于{detail.updateTime || detail.createTime}</span>
|
||||
<span className='mr20'>发布于{detail.updateTime || detail.createTime}</span>
|
||||
{detail.auditStatus === '0' && <Badge color={temp === "zone" ? "#466aff" : "#089f7f"} text="待审核" className='pass'/> }
|
||||
{detail.auditStatus === '2' && <Badge color="#eb1212" text="未通过" className='failed'/> }
|
||||
</div>
|
||||
<div className='pb20'>{detail.summary}</div>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ function beforeFetch(actionUrl){
|
|||
}
|
||||
|
||||
const service = axios.create({
|
||||
headers:{Authorization:"0cd46d63363af9205eb7ccecff574309ce069a97"},
|
||||
baseURL: actionUrl,
|
||||
timeout: 1800000, // 请求超时时间
|
||||
});
|
||||
|
|
|
|||
|
|
@ -28,6 +28,12 @@
|
|||
background-color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
.hoverThemeColorBut{
|
||||
&:hover, &:active, &:focus{
|
||||
border-color: var(--light-color);
|
||||
color: var(--light-color);
|
||||
}
|
||||
}
|
||||
|
||||
.information_main{
|
||||
background-color:#f3f5f8;
|
||||
|
|
@ -1547,7 +1553,7 @@
|
|||
button{
|
||||
border-color: var(--primary-color);
|
||||
color: var(--primary-color);
|
||||
&:hover{
|
||||
&:hover, &:active, &:focus{
|
||||
border-color: var(--light-color);
|
||||
color: var(--light-color);
|
||||
}
|
||||
|
|
@ -1562,6 +1568,12 @@
|
|||
padding: 30px 35px 50px;
|
||||
}
|
||||
}
|
||||
.editNewsMd .editormd-dialog-header{
|
||||
padding: 5px 20px;
|
||||
}
|
||||
.editNewsMd .number-input{
|
||||
width: 60px !important;
|
||||
}
|
||||
// 新增资源
|
||||
.sourceCreateBox{
|
||||
.sourceFilesBox{
|
||||
|
|
@ -1580,6 +1592,13 @@
|
|||
color: var(--primary-color)!important;
|
||||
}
|
||||
|
||||
.failed .ant-badge-status-text{
|
||||
color: #eb1212;
|
||||
}
|
||||
.pass .ant-badge-status-text{
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
// --------------新建专区
|
||||
.applyBox{
|
||||
background-color: #fff;
|
||||
|
|
|
|||
Loading…
Reference in New Issue