Skip to content

Commit

Permalink
fix(tslint): fix ant-design/ant-design#34952
Browse files Browse the repository at this point in the history
  • Loading branch information
Lind-pro committed Apr 11, 2022
1 parent 5ab56e0 commit cea3315
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 25 deletions.
3 changes: 3 additions & 0 deletions src/components/HeaderSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const HeaderSearch: React.FC<HeaderSearchProps> = (props) => {
const inputClass = classNames(styles.input, {
[styles.show]: searchMode,
});
// @ts-ignore
return (
<div
className={classNames(className, styles.headerSearch)}
Expand All @@ -70,11 +71,13 @@ const HeaderSearch: React.FC<HeaderSearchProps> = (props) => {
cursor: 'pointer',
}}
/>

<AutoComplete
key="AutoComplete"
className={inputClass}
value={value}
options={restProps.options}
// @ts-ignore
onChange={setValue}
>
<Input
Expand Down
5 changes: 2 additions & 3 deletions src/components/SearchComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,7 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
const handleHistory = (item: SearchHistory) => {
const log = JSON.parse(item.content) as SearchTermsUI;
form.setValues(log);
// @ts-ignore
setExpand(!(log.terms1?.length > 1 || log.terms2?.length > 1));
setExpand(!((log.terms1 && log.terms1?.length > 1) || (log.terms2 && log.terms2?.length > 1)));
};

const historyDom = (
Expand Down Expand Up @@ -413,7 +412,7 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
}

return _value
.filter((i) => i.terms?.length > 0)
.filter((i) => i.terms && i.terms?.length > 0)
.map((term) => {
term.terms?.map((item) => {
if (item.termType === 'like') {
Expand Down
1 change: 1 addition & 0 deletions src/pages/device/Instance/Detail/Functions/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default (props: FunctionProps) => {
case 'double':
return <InputNumber style={{ width: '100%' }} placeholder={'请输入'} />;
case 'date':
// @ts-ignore
return <DatePicker style={{ width: '100%' }} />;
default:
return <Input placeholder={'请输入'} />;
Expand Down
48 changes: 26 additions & 22 deletions src/pages/device/Instance/Detail/MetadataLog/Property/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const PropertyLog = (props: Props) => {
}
}, [visible]);

// @ts-ignore
return (
<Modal
maskClosable={false}
Expand Down Expand Up @@ -110,28 +111,31 @@ const PropertyLog = (props: Props) => {
<Radio.Button value="week">近一周</Radio.Button>
<Radio.Button value="month">近一月</Radio.Button>
</Radio.Group>
<DatePicker.RangePicker
value={dateValue}
showTime
onChange={(dates: any) => {
if (dates) {
setRadioValue(undefined);
setDateValue(dates);
const st = dates[0]?.valueOf();
const et = dates[1]?.valueOf();
setStart(st);
setEnd(et);
handleSearch(
{
pageSize: 10,
pageIndex: 0,
},
st,
et,
);
}
}}
/>
{
// @ts-ignore
<DatePicker.RangePicker
value={dateValue}
showTime
onChange={(dates: any) => {
if (dates) {
setRadioValue(undefined);
setDateValue(dates);
const st = dates[0]?.valueOf();
const et = dates[1]?.valueOf();
setStart(st);
setEnd(et);
handleSearch(
{
pageSize: 10,
pageIndex: 0,
},
st,
et,
);
}
}}
/>
}
</Space>
</div>

Expand Down

0 comments on commit cea3315

Please sign in to comment.