diff --git a/src/forge/Component/HeadSearch.jsx b/src/forge/Component/HeadSearch.jsx
new file mode 100644
index 000000000..f71fb014e
--- /dev/null
+++ b/src/forge/Component/HeadSearch.jsx
@@ -0,0 +1,40 @@
+import React, { useState } from "react";
+import { Input ,notification} from "antd";
+
+const { Search } = Input;
+export default ({history}) => {
+ const [openSearch, setOpenSearch] = useState(false);
+
+ function onGlobalSearch(value) {
+ history.push('/search?value=' + value);
+ // window.location.href = `search?value=` + value;
+ // history.push({
+ // pathname:'/search',
+ // state:value
+ // })
+ }
+ return (
+
+ {
+ openSearch ?
+ {
+ setTimeout(() => {
+ setOpenSearch(false)
+ }, 500)
+ }}
+ >
+
+
+ :
+ {
+ setOpenSearch(true)
+ }} />
+ }
+
+ )
+};
diff --git a/src/forge/Component/SiderBar.js b/src/forge/Component/SiderBar.js
index 8267959ba..3d6b8acf8 100644
--- a/src/forge/Component/SiderBar.js
+++ b/src/forge/Component/SiderBar.js
@@ -43,7 +43,7 @@ function SiderBar() {
{
list && list.map((i,k)=>{
return(
-
{i.question}
+ {i.question}
)
})
}
diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js
index 4d55f824c..f3b69c4ea 100644
--- a/src/forge/Head/Header.js
+++ b/src/forge/Head/Header.js
@@ -5,7 +5,8 @@ import axios from 'axios';
import { Modal, Input, message, notification , Dropdown , Menu } from 'antd';
import LoginDialog from '../../modules/login/LoginDialog';
-import GotoQQgroup from '../../modal/GotoQQgroup'
+import GotoQQgroup from '../../modal/GotoQQgroup';
+import HeadSearch from '../Component/HeadSearch';
import '../../modules/tpm/TPMIndex.css';
import logo from '../../modules/tpm/images/logo.png';
@@ -81,35 +82,35 @@ class NewHeader extends Component {
} catch (e) {}
}
- SearchInput = (open,item)=>{
- if(open){
- return(
- {
- setTimeout(() => {
- this.setState({
- openSearch:false
- })
- }, 300)
- }}
- >
- this.onGlobalSearch(value,item)}
- autoFocus={true}
- />
-
- )
- }else{
- return {
- this.setState({openSearch:true})
- }} />
- }
- }
+ // SearchInput = (open,item)=>{
+ // if(open){
+ // return(
+ // {
+ // setTimeout(() => {
+ // this.setState({
+ // openSearch:false
+ // })
+ // }, 300)
+ // }}
+ // >
+ // this.onGlobalSearch(value,item)}
+ // autoFocus={true}
+ // />
+ //
+ // )
+ // }else{
+ // return {
+ // this.setState({openSearch:true})
+ // }} />
+ // }
+ // }
- onGlobalSearch=(value,item)=>{
- window.location.href=`${item}?value=` + value;
- }
+ // onGlobalSearch=(value,item)=>{
+ // window.location.href=`${item}?value=` + value;
+ // }
openNotification = (messge) => {
notification.open({
@@ -329,7 +330,7 @@ class NewHeader extends Component {
{
list.map((item,key)=>{
return(
- (item.name !=="加入课堂" && item.name !=="加入开发项目") && {item.name}
+ (item.name !=="加入课堂" && item.name !=="加入开发项目") && {item.name}
)
})
}
@@ -434,7 +435,7 @@ class NewHeader extends Component {
})
}
- let search_url = settings && settings.common && settings.common.search;
+ // let search_url = settings && settings.common && settings.common.search;
let notice_url = settings && settings.common && settings.common.notice;
return (
- {search_url ? this.SearchInput(openSearch,search_url):""}
+ {/* {search_url ? this.SearchInput(openSearch,search_url):""} */}
+
{
current_user && (current_user.main_site || current_user.login) && (settings && settings.add && settings.add.length>0)?