forked from Gitlink/forgeplus-react
issue
This commit is contained in:
parent
172a0293aa
commit
a1dc4e5f4d
|
@ -222,7 +222,7 @@
|
||||||
"webpack": "^4.42.1",
|
"webpack": "^4.42.1",
|
||||||
"webpack-bundle-analyzer": "^3.7.0"
|
"webpack-bundle-analyzer": "^3.7.0"
|
||||||
},
|
},
|
||||||
"volta":{
|
"volta": {
|
||||||
"node":"8.12.0"
|
"node": "8.12.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,7 +199,8 @@ class NewHeader extends Component {
|
||||||
const hostname = window.location.hostname;
|
const hostname = window.location.hostname;
|
||||||
const port = window.location.port;
|
const port = window.location.port;
|
||||||
const isDev = window.location.port == 3007;
|
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 = "";
|
let str = "";
|
||||||
if(url.indexOf("http")>-1){
|
if(url.indexOf("http")>-1){
|
||||||
if(url.indexOf("https")>-1){
|
if(url.indexOf("https")>-1){
|
||||||
|
@ -326,22 +327,7 @@ class NewHeader extends Component {
|
||||||
{
|
{
|
||||||
settings.navbar && settings.navbar.map((item, key) => {
|
settings.navbar && settings.navbar.map((item, key) => {
|
||||||
var new_link = item.link;
|
var new_link = item.link;
|
||||||
// var user_login = current_user && current_user.login;
|
|
||||||
var is_hidden = item.hidden;
|
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 waiLian = (new_link && str.filter(item=>new_link.indexOf(item)>-1) );
|
||||||
var wl = waiLian && waiLian.length>0;
|
var wl = waiLian && waiLian.length>0;
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -36,7 +36,8 @@ class order_form extends Component {
|
||||||
show_token: false,
|
show_token: false,
|
||||||
cannot_edit: false,
|
cannot_edit: false,
|
||||||
issue_current_user: true,
|
issue_current_user: true,
|
||||||
atWhoLoginList:undefined
|
atWhoLoginList:undefined,
|
||||||
|
endDisableData:undefined
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
componentDidUpdate=(prevPros)=>{
|
componentDidUpdate=(prevPros)=>{
|
||||||
|
@ -276,7 +277,11 @@ class order_form extends Component {
|
||||||
changeBeginTime = (start_date, value) => {
|
changeBeginTime = (start_date, value) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
start_date: value,
|
start_date: value,
|
||||||
|
endDisableData:c=>c<moment(value).endOf('day'),
|
||||||
|
due_date:undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(moment(value).endOf('day'));
|
||||||
};
|
};
|
||||||
changeEndTime = (due_date, value) => {
|
changeEndTime = (due_date, value) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -347,13 +352,12 @@ class order_form extends Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { getFieldDecorator } = this.props.form;
|
const { getFieldDecorator } = this.props.form;
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
const { orderId } = this.props.match.params;
|
const { orderId } = this.props.match.params;
|
||||||
const { form_type } = this.props;
|
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 (
|
return (
|
||||||
<Spin spinning={isSpin}>
|
<Spin spinning={isSpin}>
|
||||||
<div className="ProjectListIndex issue-form-index">
|
<div className="ProjectListIndex issue-form-index">
|
||||||
|
@ -523,6 +527,7 @@ class order_form extends Component {
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
placeholder="请选择结束日期"
|
placeholder="请选择结束日期"
|
||||||
onChange={this.changeEndTime}
|
onChange={this.changeEndTime}
|
||||||
|
disabledDate={endDisableData}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="完成度">
|
<Form.Item label="完成度">
|
||||||
|
|
|
@ -577,34 +577,60 @@ class NewHeader extends Component {
|
||||||
|
|
||||||
matchpaths = (url) => {
|
matchpaths = (url) => {
|
||||||
const { match } = this.props;
|
const { match } = this.props;
|
||||||
let pathname=sessionStorage.pathname;
|
const hostname = window.location.hostname;
|
||||||
if(url){
|
const port = window.location.port;
|
||||||
if (url.indexOf('forums') > -1 && match.path.indexOf('forums') > -1) {
|
const isDev = hostname == "localhost";
|
||||||
return true
|
let isdev2= isDev ?'http://117.50.100.12:49999':`http://${hostname}`;
|
||||||
// 开源项目,路由改版后,比较麻烦,因此使用多个进行判断
|
let str = "";
|
||||||
} else if (url.indexOf('explore') > -1 && match.path.indexOf('explore') > -1) {
|
if(url.indexOf("http")>-1){
|
||||||
return true
|
if(url.indexOf("https")>-1){
|
||||||
// 开源项目,路由改版后,比较麻烦,因此使用多个进行判断
|
isdev2 = `https://${hostname}`;
|
||||||
} 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
|
|
||||||
}
|
}
|
||||||
|
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 => {
|
handleVisibleChange = visible => {
|
||||||
|
|
Loading…
Reference in New Issue