Merge remote-tracking branch 'upstream/gitlink_server' into gitlink_server

This commit is contained in:
黄心宇 2023-09-21 16:32:21 +08:00
commit b9013ff502
5 changed files with 54 additions and 29 deletions

6
package-lock.json generated
View File

@ -16660,7 +16660,7 @@
},
"sass-loader": {
"version": "7.3.1",
"resolved": "http://173.15.15.82:8081/repository/npm-all/sass-loader/-/sass-loader-7.3.1.tgz",
"resolved": "https://registry.npmmirror.com/sass-loader/-/sass-loader-7.3.1.tgz",
"integrity": "sha512-tuU7+zm0pTCynKYHpdqaPpe+MMTQ76I9TPZ7i4/5dZsigE350shQWe5EZNl5dBidM49TPET75tNqRbcsUZWeNA==",
"dev": true,
"requires": {
@ -18669,7 +18669,7 @@
},
"ssri": {
"version": "7.1.1",
"resolved": "http://173.15.15.82:8081/repository/npm-all/ssri/-/ssri-7.1.1.tgz",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-7.1.1.tgz",
"integrity": "sha512-w+daCzXN89PseTL99MkA+fxJEcU3wfaE/ah0i0lnOlpG1CYLJ2ZjzEry68YBKfLs4JfoTShrTEsJkAZuNZ/stw==",
"dev": true,
"requires": {
@ -20518,7 +20518,7 @@
},
"y18n": {
"version": "4.0.3",
"resolved": "http://173.15.15.82:8081/repository/npm-all/y18n/-/y18n-4.0.3.tgz",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"dev": true
},

View File

@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect } from 'react';
import { Form , Input , Row , Col, Button } from 'antd';
import '../index.scss';
import { postCreateZone } from '../api';
@ -8,6 +8,10 @@ const phonereg = /^([1][3456789])\d{9}$/
function Apply(props){
const { form } = props;
const { getFieldDecorator , validateFields } = form;
console.log(props);
useEffect(()=>{
document.title = '申请创建专区';
},[])
function submitFunc(){
validateFields((error,values)=>{
@ -15,8 +19,10 @@ function Apply(props){
const zoneApplication = {...values};
postCreateZone(zoneApplication).then(response=>{
if(response && response.data && response.data.code===200){
props.showNotification("提交成功!")
props.history.push({pathname:"/"});
props.showNotification("提交成功!");
setTimeout(() => {
window.location.href="/";
}, 200);
}
}).catch(error=>{})
}
@ -33,6 +39,14 @@ function Apply(props){
callback();
}
// function checkIndentity(rule, value, callback){
// if(value && !idenReg.test(value)){
// callback("2-20线线");
// }
// callback();
// }
return(
<div className="applyBox">
<div className="applyContent">
@ -78,9 +92,12 @@ function Apply(props){
label="专区标识"
>
{getFieldDecorator("key",{
rules:[{required:true,message:"请输入专区域名标识"}]
rules:[
{ required: true,message:"请输入专区域名标识" },
{ pattern: /^[a-zA-Z][a-zA-Z0-9_-]{0,18}[a-zA-Z]$/, message: "长度2-20只能包含数字、字母、下划线、中划线必须以字母开头结尾"},
]
})(
<Input placeholder="请输入专区域名标识" maxLength={50} style={{height:"36px"}}/>
<Input placeholder="请输入专区域名标识" maxLength={20} style={{height:"36px"}}/>
)}
</Form.Item>
</Col>
@ -139,7 +156,7 @@ function Apply(props){
</Form.Item>
<div className="mt20">
<Button style={{height:"36px",width:"100px"}} type="primary" onClick={submitFunc}>提交</Button>
<Button style={{marginLeft:"30px",height:"36px",width:"100px"}}>取消</Button>
<Button style={{marginLeft:"30px",height:"36px",width:"100px"}} onClick={()=>{window.location.href="/"}}>取消</Button>
</div>
</Form>
</div>

View File

@ -25,9 +25,10 @@ function SelfList(props){
useEffect(()=>{
if(id){
setIsSpin(true);
if(source && source===true){
if(source===true){
getSource();
}else{
}
if(source===false){
getNew();
}
}
@ -48,7 +49,8 @@ function SelfList(props){
getSourceMyList({
auditStatus:status,
zoneId:id,
pageSize:limit
pageSize:limit,
pageNum:page
}).then(result=>{
setList(result.data.rows);
setTotal(result.data.total);
@ -59,7 +61,8 @@ function SelfList(props){
function getNew(){
getNewsMyList(id,{
auditStatus:status===0 ? 2 : status === 2 ? 0 : 1,
pageSize:limit
pageSize:limit,
pageNum:page
}).then(result=>{
setList(result.data.rows);
setTotal(result.data.total);
@ -101,7 +104,7 @@ function SelfList(props){
<i className="iconfont icon-shanchu_tc_icon font-22 mr15" style={{color:"#ca0002"}}></i>
<div>
<p className="font-15 mb15 mt5" style={{color:"#202d40"}}>确定删除该{source?"资源":"文章"}?</p>
<p style={{color:"#5f6872"}}>{source?"删除后所有资源文件将被清楚,请谨慎操作":"此操作将发出文章删除申请,管理员同意申请后该文章将被删除"}</p>
{(source || (!source && status === 1)) && <p style={{color:"#5f6872"}}>{source?"删除后所有资源文件将被清除,请谨慎操作":"此操作将提交删除申请,管理员同意申请后该文章将被删除"}</p> }
</div>
</div>
<div className="delBoxBtn">
@ -119,6 +122,7 @@ function SelfList(props){
<li onClick={()=>setStatus(2)} className={status===2?"active":""}>未通过</li>
</ul>
<Spin spinning={isSpin}>
<div style={{backgroundColor:"#fff",borderRadius:"4px"}}>
<ul className="selfListPanel">
{
list && list.length === 0 &&
@ -132,10 +136,10 @@ function SelfList(props){
return(
<li>
<div>
<a className="s-name task-hide">{i.name}</a>
<Link to={`/zone/${deptId}/${source?"source":"newdetail"}/${i.id}`} className="s-name task-hide">{i.name}</Link>
<div className="s-info">
<span>
<span>{i.domainName}</span>
<span>{i.domainName || i.dirName}</span>
<span className="ml10 mr15">|</span>
<span><i className="iconfont icon-a-31shijian mr5 font-15"></i>{moment(i.createTime).format("YYYY/MM/DD")}</span>
</span>
@ -149,13 +153,14 @@ function SelfList(props){
)
})
}
{
total > limit &&
<div style={{padding:"20px",textAlign:"right"}}>
<Pagination showQuickJumper current={page} total={total} pageSize={limit} onChange={(p)=>setPage(p)}/>
</div>
}
</ul>
{
total > limit &&
<div style={{padding:"20px",textAlign:"right"}}>
<Pagination showQuickJumper current={page} total={total} pageSize={limit} onChange={(p)=>{setPage(p);window.scrollTo(0,450)}}/>
</div>
}
</div>
</Spin>
</div>
)

View File

@ -1,6 +1,5 @@
import axios from 'axios';
import { message , notification } from 'antd';
// import cookie from 'react-cookies';
function beforeFetch(actionUrl){
if (window.location.href.indexOf('localhost') < 0) {
@ -8,7 +7,7 @@ function beforeFetch(actionUrl){
}
const service = axios.create({
// headers:{Authorization: cookie.load("autologin_trustie")},
headers:{Authorization:"0cd46d63363af9205eb7ccecff574309ce069a97"},
baseURL: actionUrl,
timeout: 1800000, // 请求超时时间
});

View File

@ -1604,7 +1604,8 @@
margin-bottom: 20px;
p{
color: #424650;
margin-top: 15px;
margin-top: 14px;
line-height: 24px;
}
h5{
color:#000000;
@ -1647,7 +1648,7 @@
border-radius: 0px 4px 4px 0px;
}
&.active{
background-color: #466aff;
background-color: var(--primary-color);
color: #fff;
}
}
@ -1671,7 +1672,7 @@
.s-name{
position: relative;
color:#1f2329;
font-size:18px;
font-size:16px;
padding-left: 16px;
height: 26px;
line-height: 26px;
@ -1681,11 +1682,14 @@
left: 0px;
height: 8px;
width: 8px;
background-color: #466aff;
background-color: var(--primary-color);
border-radius: 50%;
top:10px;
top:8px;
content: "";
}
&:hover{
color: var(--primary-color);
}
}
.s-info{
display: flex;