Skip to content

Commit

Permalink
fix ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Feb 24, 2021
1 parent c746ce0 commit 0cd56b9
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 26 deletions.
2 changes: 1 addition & 1 deletion AccountCenter/src/_mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function fakeList(count: number): ListItemDataType[] {
}

function getFakeList(req: Request, res: Response) {
const params = req.query;
const params = req.query as any;

const count = params.count * 1 || 5;

Expand Down
2 changes: 1 addition & 1 deletion DashboardAnalysis/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EllipsisOutlined } from '@ant-design/icons';
import { Col, Dropdown, Menu, Row } from 'antd';
import React, { Componen } from 'react';
import React, { Component } from 'react';
import { GridContent } from '@ant-design/pro-layout';
import type { RadioChangeEvent } from 'antd/es/radio';
import type { RangePickerProps } from 'antd/es/date-picker/generatePicker';
Expand Down
2 changes: 1 addition & 1 deletion DashboardMonitor/src/components/Charts/WaterWave/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class WaterWave extends Component<WaterWaveProps> {
sp += 0.07;
drawSin();
}
self.timer = requestAnimationFrame(render);
this.timer = requestAnimationFrame(render);
};
render();
}
Expand Down
2 changes: 1 addition & 1 deletion ListBasicList/src/_mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function fakeList(count: number): BasicListItemDataType[] {
let sourceData: BasicListItemDataType[] = [];

function getFakeList(req: Request, res: Response) {
const params = req.query;
const params = req.query as any

const count = params.count * 1 || 20;

Expand Down
6 changes: 2 additions & 4 deletions ListBasicList/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const PAGE_NAME_UPPER_CAMEL_CASE: FC<PAGE_NAME_UPPER_CAMEL_CASEProps> = (
});
};

const editAndDelete = (key: string, currentItem: BasicListItemDataType) => {
const editAndDelete = (key: string | number, currentItem: BasicListItemDataType) => {
if (key === 'edit') showEditModal(currentItem);
else if (key === 'delete') {
Modal.confirm({
Expand Down Expand Up @@ -174,14 +174,12 @@ export const PAGE_NAME_UPPER_CAMEL_CASE: FC<PAGE_NAME_UPPER_CAMEL_CASEProps> = (
};

const handleSubmit = (values: BasicListItemDataType) => {
const id = current ? current.id : '';

setAddBtnblur();

setDone(true);
dispatch({
type: 'BLOCK_NAME_CAMEL_CASE/submit',
payload: { id, ...values },
payload: values,
});
};

Expand Down
2 changes: 1 addition & 1 deletion ListCardList/src/_mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function fakeList(count: number): CardListItemDataType[] {
}

function getFakeList(req: Request, res: Response) {
const params = req.query;
const params = req.query as any;

const count = params.count * 1 || 20;

Expand Down
2 changes: 1 addition & 1 deletion ListSearchApplications/src/_mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function fakeList(count: number): ListItemDataType[] {
}

function getFakeList(req: Request, res: Response) {
const params = req.query;
const params = req.query as any;

const count = params.count * 1 || 20;

Expand Down
8 changes: 4 additions & 4 deletions ListSearchApplications/src/components/TagSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type TagSelectProps = {
};
className?: string;
Option?: TagSelectOptionProps;
children?: React.ReactElement<TagSelectOption> | React.ReactElement<TagSelectOption>[];
children?: React.ReactElement<any> | React.ReactElement<any>[];
};

const TagSelectOption: React.FC<TagSelectOptionProps> & {
Expand Down Expand Up @@ -95,7 +95,7 @@ class TagSelect extends Component<TagSelectProps, TagSelectState> {

getAllTags() {
const { children } = this.props;
const childrenArray = React.Children.toArray(children) as React.ReactElement<TagSelectOption>[];
const childrenArray = React.Children.toArray(children) as React.ReactElement<any>[];
const checkedTags = childrenArray
.filter((child) => this.isTagSelectOption(child))
.map((child) => child.props.value);
Expand Down Expand Up @@ -127,7 +127,7 @@ class TagSelect extends Component<TagSelectProps, TagSelectState> {
node.type &&
(node.type.isTagSelectOption || node.type.displayName === 'TagSelectOption');

static Option: TagSelectOption = TagSelectOption;
static Option: React.FC<TagSelectOptionProps> = TagSelectOption;

render() {
const { value, expand } = this.state;
Expand All @@ -149,7 +149,7 @@ class TagSelect extends Component<TagSelectProps, TagSelectState> {
)}
{value &&
children &&
React.Children.map(children, (child: React.ReactElement<TagSelectOption>) => {
React.Children.map(children, (child: React.ReactElement<any>) => {
if (this.isTagSelectOption(child)) {
return React.cloneElement(child, {
key: `tag-select-${child.props.value}`,
Expand Down
2 changes: 1 addition & 1 deletion ListSearchArticles/src/_mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function fakeList(count: number): ListItemDataType[] {
}

function getFakeList(req: Request, res: Response) {
const params = req.query;
const params = req.query as any;

const count = params.count * 1 || 20;

Expand Down
8 changes: 4 additions & 4 deletions ListSearchArticles/src/components/TagSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type TagSelectProps = {
};
className?: string;
Option?: TagSelectOptionProps;
children?: React.ReactElement<TagSelectOption> | React.ReactElement<TagSelectOption>[];
children?: React.ReactElement<any> | React.ReactElement<any>[];
};

const TagSelectOption: React.FC<TagSelectOptionProps> & {
Expand Down Expand Up @@ -95,7 +95,7 @@ class TagSelect extends Component<TagSelectProps, TagSelectState> {

getAllTags() {
const { children } = this.props;
const childrenArray = React.Children.toArray(children) as React.ReactElement<TagSelectOption>[];
const childrenArray = React.Children.toArray(children) as React.ReactElement<any>[];
const checkedTags = childrenArray
.filter((child) => this.isTagSelectOption(child))
.map((child) => child.props.value);
Expand Down Expand Up @@ -127,7 +127,7 @@ class TagSelect extends Component<TagSelectProps, TagSelectState> {
node.type &&
(node.type.isTagSelectOption || node.type.displayName === 'TagSelectOption');

static Option: TagSelectOption = TagSelectOption;
static Option: React.FC<TagSelectOptionProps> = TagSelectOption;

render() {
const { value, expand } = this.state;
Expand All @@ -149,7 +149,7 @@ class TagSelect extends Component<TagSelectProps, TagSelectState> {
)}
{value &&
children &&
React.Children.map(children, (child: React.ReactElement<TagSelectOption>) => {
React.Children.map(children, (child: React.ReactElement<any>) => {
if (this.isTagSelectOption(child)) {
return React.cloneElement(child, {
key: `tag-select-${child.props.value}`,
Expand Down
2 changes: 1 addition & 1 deletion ListSearchProjects/src/_mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function fakeList(count: number): ListItemDataType[] {
}

function getFakeList(req: Request, res: Response) {
const params = req.query;
const params = req.query as any;

const count = params.count * 1 || 20;

Expand Down
4 changes: 2 additions & 2 deletions ListSearchProjects/src/components/TagSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ class TagSelect extends Component<TagSelectProps, TagSelectState> {
});
};

isTagSelectOption = (node: React.ReactElement<TagSelectOptionType, TagSelectOptionType>) =>
isTagSelectOption = (node: React.ReactElement<any, any>) =>
node &&
node.type &&
(node.type.isTagSelectOption || node.type.displayName === 'TagSelectOption');

static Option: TagSelectOptionType = TagSelectOption;
static Option: React.FC<TagSelectOptionProps> = TagSelectOption;

render() {
const { value, expand } = this.state;
Expand Down
8 changes: 4 additions & 4 deletions UserRegisterResult/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button, Result } from 'antd';
import { FormattedMessage, formatMessage, Link } from 'umi';
import type { IRouteProps } from 'umi';
import { FormattedMessage, Link } from 'umi';
import React from 'react';
import type { RouteChildrenProps } from 'react-router';

import styles from './style.less';

Expand All @@ -20,7 +20,7 @@ const actions = (
</div>
);

const PAGE_NAME_UPPER_CAMEL_CASE: React.FC<RouteChildrenProps> = ({ location }) => (
const PAGE_NAME_UPPER_CAMEL_CASE: React.FC<IRouteProps> = ({ location }) => (
<Result
className={styles.registerResult}
status="success"
Expand All @@ -32,7 +32,7 @@ const PAGE_NAME_UPPER_CAMEL_CASE: React.FC<RouteChildrenProps> = ({ location })
/>
</div>
}
subTitle={formatMessage({ id: 'BLOCK_NAME.register-result.activation-email' })}
subTitle={<FormattedMessage id="BLOCK_NAME.register-result.activation-email" />}
extra={actions}
/>
);
Expand Down

0 comments on commit 0cd56b9

Please sign in to comment.