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

This commit is contained in:
谢思 2023-09-22 11:13:50 +08:00
commit 7a8bcac160
4 changed files with 41 additions and 21 deletions

View File

@ -2,17 +2,23 @@ import React, { useEffect } from 'react';
import { Form , Input , Row , Col, Button } from 'antd';
import '../index.scss';
import { postCreateZone } from '../api';
import cookie from 'react-cookies';
const { TextArea } = Input;
const phonereg = /^([1][3456789])\d{9}$/
function Apply(props){
const { form } = props;
const { form , current_user } = props;
const { getFieldDecorator , validateFields } = form;
console.log(props);
useEffect(()=>{
document.title = '申请创建专区';
},[])
useEffect(()=>{
if(!(current_user && current_user.login)){
props.history.push("/403");
}
},[current_user])
function submitFunc(){
validateFields((error,values)=>{
if(!error){
@ -22,7 +28,7 @@ console.log(props);
props.showNotification("提交成功!");
setTimeout(() => {
window.location.href="/";
}, 200);
}, 100);
}
}).catch(error=>{})
}
@ -39,13 +45,6 @@ console.log(props);
callback();
}
// function checkIndentity(rule, value, callback){
// if(value && !idenReg.test(value)){
// callback("2-20线线");
// }
// callback();
// }
return(
<div className="applyBox">

View File

@ -4,6 +4,8 @@ import { Link } from 'react-router-dom';
import { getNewsMyList , getSourceMyList , delNewsMyList , delSourceMyList } from '../api';
import moment from 'moment';
import nodata from '../img/nodata.png';
import { tempEnum } from '../tempInfo';
import emptydata from '../../Images/nodata.png';
import '../index.scss';
@ -25,16 +27,29 @@ function SelfList(props){
useEffect(()=>{
if(id){
setIsSpin(true);
if(source===true){
getSource();
}
if(source===false){
getNew();
}
getFunc(source);
}
},[status, page , id,source])
},[id,source,page])
useEffect(()=>{
if(page===1){
setIsSpin(true);
getFunc(source);
}else{
setPage(1);
}
},[status])
function getFunc(s){
if(s===true){
getSource();
}
if(s===false){
getNew();
}
}
useEffect(()=>{
if(pathname){
if(pathname.indexOf("/source/self")>-1){
@ -113,12 +128,12 @@ function SelfList(props){
</div>
</div>
<div className="delBoxBtn">
<Button onClick={cancelFunc}>取消</Button>
<Button type="primary" onClick={sureFunc} style={{backgroundColor:"#fff",color:"#466aff"}}>确认</Button>
<Button onClick={cancelFunc} style={{borderColor:"#d9d9d9",color:"rgba(0, 0, 0, 0.65)"}}>取消</Button>
<Button type="primary" onClick={sureFunc} style={{backgroundColor:"#fff"}}>确认</Button>
</div>
</Modal>
<Breadcrumb separator=">" style={{paddingTop:"20px"}}>
<Breadcrumb.Item><Link className="primaryColor" to={pathname.replace("/self","")}>{source ? "资源发布": temp==="zone1" ? "新闻资讯":"领域资讯"}</Link></Breadcrumb.Item>
<Breadcrumb.Item><Link className="primaryColor" to={pathname.replace("/self","")}>{source ? "资源发布": temp === tempEnum.zone1 ? "新闻资讯":"领域资讯"}</Link></Breadcrumb.Item>
<Breadcrumb.Item>我的{source ? "资源":"文章"}</Breadcrumb.Item>
</Breadcrumb>
<ul className="selfMenu">
@ -132,7 +147,7 @@ function SelfList(props){
{
list && list.length === 0 &&
<div style={{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",height:500}}>
<img src={ nodata } alt="" width="300"/>
<img src={ temp === tempEnum.zone1 ? nodata : emptydata } alt="" width="300"/>
<p className="font-15 color-grey-6 mt20">暂无数据~</p>
</div>
}

View File

@ -172,6 +172,8 @@ export function delSourceMyList(id){
export function postCreateZone(data) {
return fetch({
url: `/zone/application`,
method: 'post',
data: data
})
}

View File

@ -1742,6 +1742,10 @@
.ant-btn{
width: 95px;
margin:0px 20px;
&.ant-btn-primary{
color: var(--primary-color);
border-color: var(--primary-color);
}
}
}
}