forked from Gitlink/forgeplus-react
里程碑增加搜索功能
This commit is contained in:
parent
071110b934
commit
f58193307f
|
|
@ -1,12 +1,13 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Dropdown, Icon, Menu, Pagination, Typography, Popconfirm, Spin } from 'antd';
|
||||
import { Dropdown, Icon, Menu, Pagination, Typography, Popconfirm, Spin, Input } from 'antd';
|
||||
import NoneData from '../Nodata';
|
||||
import axios from 'axios';
|
||||
import './order.css';
|
||||
import CheckProfile from '../Component/ProfileModal/Profile';
|
||||
|
||||
const { Text } = Typography;
|
||||
const Search = Input.Search;
|
||||
|
||||
class Milepost extends Component {
|
||||
constructor(props) {
|
||||
|
|
@ -15,14 +16,14 @@ class Milepost extends Component {
|
|||
data: undefined,
|
||||
limit: 15,
|
||||
page: 1,
|
||||
order_type: undefined,
|
||||
order_type: 'desc',
|
||||
//新建标签区域是否显示 none 隐藏 block 显示
|
||||
display: 'none',
|
||||
status: 'open',
|
||||
openselect: 1,
|
||||
closeselect: undefined,
|
||||
order_name: undefined,
|
||||
|
||||
keyword:undefined,
|
||||
spinings: true
|
||||
}
|
||||
}
|
||||
|
|
@ -48,7 +49,7 @@ class Milepost extends Component {
|
|||
const url = `/${owner}/${projectsId}/milestones.json`;
|
||||
axios.get(url, {
|
||||
params: {
|
||||
projectsId, page, limit, status, order_type, order_name
|
||||
projectsId, page, limit, status, order_type, order_name,keyword
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
|
|
@ -147,6 +148,15 @@ class Milepost extends Component {
|
|||
this.getList(1, this.state.status, e.item.props.value, e.key);
|
||||
}
|
||||
|
||||
// 搜索
|
||||
searchFunc = (value) => {
|
||||
const {status, order_type, order_name} = this.state
|
||||
this.setState({
|
||||
keyword: value,
|
||||
},()=>{
|
||||
this.getList(1,status,order_type,order_name);
|
||||
});
|
||||
};
|
||||
|
||||
//控制新建标签页是否显示
|
||||
newshow = () => {
|
||||
|
|
@ -163,7 +173,7 @@ class Milepost extends Component {
|
|||
|
||||
|
||||
render() {
|
||||
const { data, limit, page, openselect, closeselect, spinings } = this.state;
|
||||
const { data, limit, page, openselect, closeselect, spinings,keyword } = this.state;
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
const menu = (
|
||||
<Menu className="orderCondition" onClick={this.arrayList}>
|
||||
|
|
@ -185,6 +195,17 @@ class Milepost extends Component {
|
|||
<span>里程碑{data && data.issue_tags_count}已创建</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="target-detail-search" style={{marginBottom:20}}>
|
||||
<Search
|
||||
placeholder="输入关键字搜索疑修"
|
||||
enterButton
|
||||
onSearch={this.searchFunc}
|
||||
style={{ width: 300 }}
|
||||
value={keyword}
|
||||
allowClear
|
||||
onChange={(e) => { this.setState({ keyword: e.target.value }) }}
|
||||
/>
|
||||
</div>
|
||||
<div className="topWrapper" style={{borderBottom:"1px solid #eee"}}>
|
||||
<div className="topWrapper_type_infos">
|
||||
<li className={openselect ? "active" : ""} onClick={() => this.opneMilelist(1)}>{data && data.open_count}个开启中</li>
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class UpdateMilepost extends Component {
|
|||
required: true, message: '请输入描述内容'
|
||||
}],
|
||||
})(
|
||||
<TextArea placeholder="请输入描述内容..." style={{ height: "150px" }} />
|
||||
<TextArea placeholder="请输入描述内容..." style={{ height: "150px" }} maxLength={10000}/>
|
||||
|
||||
)}
|
||||
</Form.Item>
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class NewMilepost extends Component {
|
|||
required: true, message: '请输入描述内容'
|
||||
}],
|
||||
})(
|
||||
<TextArea placeholder="请输入描述内容..." style={{ height: "150px" }} maxLength={500} />
|
||||
<TextArea placeholder="请输入描述内容..." style={{ height: "150px" }} maxLength={10000} />
|
||||
|
||||
)}
|
||||
</Form.Item>
|
||||
|
|
|
|||
Loading…
Reference in New Issue