diff --git a/lib/page/search.d.ts b/lib/page/search.d.ts index 0400a7b83a63c034471236fb724c5b1e60ae913c..a0a6441be19da5220b032e2a7a3f2812357a6379 100644 --- a/lib/page/search.d.ts +++ b/lib/page/search.d.ts @@ -5,11 +5,15 @@ interface Props { /** * 标题。 */ - title?: string; + title?: React.ReactNode; /** * 按钮列的列宽。 */ buttonSpan: number; + /** + * 按钮列的对齐。 + */ + buttonAlign: 'right' | 'left' | 'center' | undefined; /** * 字段列表。 */ @@ -46,5 +50,5 @@ declare class SearchComponent extends React.PureComponent) => void; _onReset: (e: React.MouseEvent) => void; } -declare const _default: import("antd/lib/form/interface").ConnectedComponentClass>; +declare const _default: import("antd/lib/form/interface").ConnectedComponentClass>; export default _default; diff --git a/lib/page/search.js b/lib/page/search.js index c1704603fece83b264e56162edf26426c027eb6b..cdccbbf85597f5828e10051282c6e668f3bd4c0a 100644 --- a/lib/page/search.js +++ b/lib/page/search.js @@ -55,12 +55,12 @@ class SearchComponent extends React.PureComponent { }; } render() { - return (React.createElement(antd_1.Collapse, { accordion: true, className: 'xc-search-form', expandIcon: ({ isActive }) => React.createElement(antd_1.Icon, { type: "caret-right", rotate: isActive ? 90 : 0 }) }, + return (React.createElement(antd_1.Collapse, { accordion: true, className: "xc-search-form", expandIconPosition: "right", expandIcon: ({ isActive }) => React.createElement(antd_1.Icon, { type: "caret-right", rotate: isActive ? 90 : 0 }) }, React.createElement(Panel, { header: this.props.title, key: "1" }, React.createElement(antd_1.Form, { onSubmit: this._onSubmit }, React.createElement(antd_1.Row, { gutter: [16, 8] }, this._renderFields(), - React.createElement(antd_1.Col, { span: this.props.buttonSpan, style: { textAlign: 'right' } }, + React.createElement(antd_1.Col, { span: this.props.buttonSpan, style: { textAlign: this.props.buttonAlign } }, React.createElement(antd_1.Button, { className: "xc-button-search", style: { marginRight: '5px' }, icon: "search", type: "primary", htmlType: "submit" }, "搜索"), React.createElement(antd_1.Button, { icon: "redo", type: "default", onClick: this._onReset }, "重置"))))))); } diff --git a/src/page/search.tsx b/src/page/search.tsx index fb946f385301989f9f9501a0d342452f81382fe4..053029899c45610a60e6fbb75d26b2e93063dc64 100644 --- a/src/page/search.tsx +++ b/src/page/search.tsx @@ -10,11 +10,15 @@ interface Props { /** * 标题。 */ - title?: string; + title?: React.ReactNode; /** * 按钮列的列宽。 */ buttonSpan: number; + /** + * 按钮列的对齐。 + */ + buttonAlign: 'right' | 'left' | 'center' | undefined; /** * 字段列表。 */ @@ -50,14 +54,18 @@ class SearchComponent extends React.PureComponent { return ( } >
{this._renderFields()} - +