Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pro-blocks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
pro-blocks
Commits
a6f14781
Commit
a6f14781
authored
5 years ago
by
陈帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix all eslint-error
parent
7306558b
Changes
53
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
279 additions
and
237 deletions
+279
-237
.eslintcache
.eslintcache
+1
-0
AccountCenter/src/_mock.ts
AccountCenter/src/_mock.ts
+1
-1
AccountSettings/src/model.ts
AccountSettings/src/model.ts
+3
-3
DashboardAnalysis/package.json
DashboardAnalysis/package.json
+3
-2
DashboardAnalysis/src/_mock.ts
DashboardAnalysis/src/_mock.ts
+1
-1
DashboardAnalysis/src/model.tsx
DashboardAnalysis/src/model.tsx
+1
-1
ListBasicList/package.json
ListBasicList/package.json
+3
-0
ListBasicList/src/_mock.ts
ListBasicList/src/_mock.ts
+1
-1
ListBasicList/src/index.tsx
ListBasicList/src/index.tsx
+6
-5
ListBasicList/src/model.ts
ListBasicList/src/model.ts
+6
-6
ListBasicList/src/service.ts
ListBasicList/src/service.ts
+1
-1
ListCardList/package.json
ListCardList/package.json
+4
-2
ListCardList/src/_mock.ts
ListCardList/src/_mock.ts
+1
-1
ListCardList/src/index.tsx
ListCardList/src/index.tsx
+31
-28
ListCardList/src/model.ts
ListCardList/src/model.ts
+5
-5
ListSearch/package.json
ListSearch/package.json
+3
-2
ListSearchApplications/package.json
ListSearchApplications/package.json
+3
-2
ListSearchApplications/src/_mock.ts
ListSearchApplications/src/_mock.ts
+1
-1
ListSearchApplications/src/index.tsx
ListSearchApplications/src/index.tsx
+4
-4
ListSearchApplications/src/model.ts
ListSearchApplications/src/model.ts
+5
-5
ListSearchApplications/src/service.ts
ListSearchApplications/src/service.ts
+1
-1
ListSearchArticles/package.json
ListSearchArticles/package.json
+3
-2
ListSearchArticles/src/_mock.ts
ListSearchArticles/src/_mock.ts
+1
-1
ListSearchArticles/src/index.tsx
ListSearchArticles/src/index.tsx
+4
-4
ListSearchArticles/src/model.ts
ListSearchArticles/src/model.ts
+7
-7
ListSearchArticles/src/service.ts
ListSearchArticles/src/service.ts
+1
-1
ListSearchProjects/package.json
ListSearchProjects/package.json
+3
-2
ListSearchProjects/src/_mock.ts
ListSearchProjects/src/_mock.ts
+1
-1
ListSearchProjects/src/index.tsx
ListSearchProjects/src/index.tsx
+6
-6
ListSearchProjects/src/model.ts
ListSearchProjects/src/model.ts
+5
-5
ListTableList/package.json
ListTableList/package.json
+4
-2
ListTableList/src/_mock.ts
ListTableList/src/_mock.ts
+5
-3
ListTableList/src/components/StandardTable/index.tsx
ListTableList/src/components/StandardTable/index.tsx
+19
-13
ListTableList/src/components/UpdateForm.tsx
ListTableList/src/components/UpdateForm.tsx
+7
-7
ListTableList/src/index.tsx
ListTableList/src/index.tsx
+8
-7
ListTableList/src/model.ts
ListTableList/src/model.ts
+5
-5
ListTableList/src/service.ts
ListTableList/src/service.ts
+1
-1
ProfileAdvanced/package.json
ProfileAdvanced/package.json
+5
-4
ProfileAdvanced/src/index.tsx
ProfileAdvanced/src/index.tsx
+17
-15
ProfileAdvanced/src/model.ts
ProfileAdvanced/src/model.ts
+1
-1
ProfileBasic/package.json
ProfileBasic/package.json
+4
-2
ProfileBasic/src/data.d.ts
ProfileBasic/src/data.d.ts
+5
-5
ProfileBasic/src/index.tsx
ProfileBasic/src/index.tsx
+14
-12
ProfileBasic/src/model.ts
ProfileBasic/src/model.ts
+5
-5
ResultFail/package.json
ResultFail/package.json
+5
-3
ResultSuccess/package.json
ResultSuccess/package.json
+5
-2
UserLogin/package.json
UserLogin/package.json
+5
-4
UserLogin/src/index.tsx
UserLogin/src/index.tsx
+23
-23
UserLogin/src/model.ts
UserLogin/src/model.ts
+4
-4
UserRegister/package.json
UserRegister/package.json
+3
-2
UserRegister/src/index.tsx
UserRegister/src/index.tsx
+12
-10
UserRegister/src/model.ts
UserRegister/src/model.ts
+4
-4
UserRegister/src/service.ts
UserRegister/src/service.ts
+2
-2
No files found.
.eslintcache
0 → 100644
View file @
a6f14781
This diff is collapsed.
Click to expand it.
AccountCenter/src/_mock.ts
View file @
a6f14781
import
{
ListItemDataType
}
from
'
./data
'
;
import
{
ListItemDataType
}
from
'
./data
.d
'
;
const
titles
=
[
'
Alipay
'
,
...
...
This diff is collapsed.
Click to expand it.
AccountSettings/src/model.ts
View file @
a6f14781
import
{
AnyAction
,
Reducer
}
from
'
redux
'
;
import
{
EffectsCommandMap
}
from
'
dva
'
;
import
{
City
,
CurrentUser
,
Province
}
from
'
./data
'
;
import
{
City
Type
,
CurrentUser
,
ProvinceType
}
from
'
./data.d
'
;
import
{
queryCity
,
queryCurrent
,
queryProvince
,
query
as
queryUsers
}
from
'
./service
'
;
export
interface
ModalState
{
currentUser
?:
Partial
<
CurrentUser
>
;
province
?:
Province
[];
city
?:
City
[];
province
?:
Province
Type
[];
city
?:
City
Type
[];
isLoading
?:
boolean
;
}
...
...
This diff is collapsed.
Click to expand it.
DashboardAnalysis/package.json
View file @
a6f14781
...
...
@@ -21,13 +21,14 @@
"numeral"
:
"^2.0.6"
,
"react"
:
"^16.6.3"
,
"react-fittext"
:
"^1.0.0"
,
"redux"
:
"^4.0.1"
,
"umi-request"
:
"^1.0.0"
},
"devDependencies"
:
{
"@types/numeral"
:
"^0.0.25"
,
"umi"
:
"^2.6.9"
,
"umi-plugin-block-dev"
:
"^1.1.0"
,
"umi-plugin-react"
:
"^1.7.2"
,
"@types/numeral"
:
"^0.0.25"
"umi-plugin-react"
:
"^1.7.2"
},
"blockConfig"
:
{
"specVersion"
:
"0.1"
...
...
This diff is collapsed.
Click to expand it.
DashboardAnalysis/src/_mock.ts
View file @
a6f14781
import
moment
from
'
moment
'
;
import
{
IAnalysisData
,
IRadarData
,
IVisitData
}
from
'
./data
'
;
import
{
IAnalysisData
,
IRadarData
,
IVisitData
}
from
'
./data
.d
'
;
// mock data
const
visitData
:
IVisitData
[]
=
[];
...
...
This diff is collapsed.
Click to expand it.
DashboardAnalysis/src/model.tsx
View file @
a6f14781
import
{
AnyAction
,
Reducer
}
from
'
redux
'
;
import
{
EffectsCommandMap
}
from
'
dva
'
;
import
{
IAnalysisData
}
from
'
./data
'
;
import
{
IAnalysisData
}
from
'
./data
.d
'
;
import
{
fakeChartData
}
from
'
./service
'
;
export
type
Effect
=
(
...
...
This diff is collapsed.
Click to expand it.
ListBasicList/package.json
View file @
a6f14781
...
...
@@ -12,12 +12,15 @@
"dev"
:
"umi dev"
},
"dependencies"
:
{
"@ant-design/pro-layout"
:
"^4.5.5"
,
"antd"
:
"^3.16.3"
,
"classnames"
:
"^2.2.6"
,
"dva"
:
"^2.4.0"
,
"hash.js"
:
"^1.1.5"
,
"moment"
:
"^2.22.2"
,
"react"
:
"^16.6.3"
,
"react-dom"
:
"^16.6.3"
,
"redux"
:
"^4.0.1"
,
"umi-request"
:
"^1.0.0"
},
"devDependencies"
:
{
...
...
This diff is collapsed.
Click to expand it.
ListBasicList/src/_mock.ts
View file @
a6f14781
import
{
BasicListItemDataType
}
from
'
./data
'
;
import
{
BasicListItemDataType
}
from
'
./data
.d
'
;
const
titles
=
[
'
Alipay
'
,
...
...
This diff is collapsed.
Click to expand it.
ListBasicList/src/index.tsx
View file @
a6f14781
...
...
@@ -25,7 +25,7 @@ import { connect } from 'dva';
import
{
findDOMNode
}
from
'
react-dom
'
;
import
moment
from
'
moment
'
;
import
Result
from
'
./Result
'
;
import
{
I
StateType
}
from
'
./model
'
;
import
{
StateType
}
from
'
./model
'
;
import
{
BasicListItemDataType
}
from
'
./data.d
'
;
import
styles
from
'
./style.less
'
;
...
...
@@ -36,7 +36,7 @@ const SelectOption = Select.Option;
const
{
Search
,
TextArea
}
=
Input
;
interface
PAGE_NAME_UPPER_CAMEL_CASEProps
extends
FormComponentProps
{
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
dispatch
:
Dispatch
<
any
>
;
loading
:
boolean
;
}
...
...
@@ -50,7 +50,7 @@ interface PAGE_NAME_UPPER_CAMEL_CASEState {
BLOCK_NAME_CAMEL_CASE
,
loading
,
}:
{
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
loading
:
{
models
:
{
[
key
:
string
]:
boolean
};
};
...
...
@@ -70,8 +70,6 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<
wrapperCol
:
{
span
:
13
},
};
addBtn
:
HTMLButtonElement
|
undefined
|
null
;
componentDidMount
()
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
...
...
@@ -138,6 +136,8 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<
});
};
addBtn
:
HTMLButtonElement
|
undefined
|
null
;
render
()
{
const
{
BLOCK_NAME_CAMEL_CASE
:
{
list
},
...
...
@@ -322,6 +322,7 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<
icon
=
"plus"
onClick
=
{
this
.
showModal
}
ref
=
{
component
=>
{
// eslint-disable-next-line react/no-find-dom-node
this
.
addBtn
=
findDOMNode
(
component
)
as
HTMLButtonElement
;
}
}
>
...
...
This diff is collapsed.
Click to expand it.
ListBasicList/src/model.ts
View file @
a6f14781
...
...
@@ -2,28 +2,28 @@ import { AnyAction, Reducer } from 'redux';
import
{
EffectsCommandMap
}
from
'
dva
'
;
import
{
addFakeList
,
queryFakeList
,
removeFakeList
,
updateFakeList
}
from
'
./service
'
;
import
{
BasicListItemDataType
}
from
'
./data
'
;
import
{
BasicListItemDataType
}
from
'
./data
.d
'
;
export
interface
I
StateType
{
export
interface
StateType
{
list
:
BasicListItemDataType
[];
}
export
type
Effect
=
(
action
:
AnyAction
,
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
I
StateType
)
=>
T
)
=>
T
},
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
StateType
)
=>
T
)
=>
T
},
)
=>
void
;
export
interface
ModelType
{
namespace
:
string
;
state
:
I
StateType
;
state
:
StateType
;
effects
:
{
fetch
:
Effect
;
appendFetch
:
Effect
;
submit
:
Effect
;
};
reducers
:
{
queryList
:
Reducer
<
I
StateType
>
;
appendList
:
Reducer
<
I
StateType
>
;
queryList
:
Reducer
<
StateType
>
;
appendList
:
Reducer
<
StateType
>
;
};
}
...
...
This diff is collapsed.
Click to expand it.
ListBasicList/src/service.ts
View file @
a6f14781
import
request
from
'
umi-request
'
;
import
{
BasicListItemDataType
}
from
'
./data
'
;
import
{
BasicListItemDataType
}
from
'
./data
.d
'
;
interface
ParamsType
extends
Partial
<
BasicListItemDataType
>
{
count
?:
number
;
...
...
This diff is collapsed.
Click to expand it.
ListCardList/package.json
View file @
a6f14781
...
...
@@ -11,15 +11,17 @@
"url"
:
"https://github.com/umijs/umi-blocks/ant-design-pro/cardlist"
},
"dependencies"
:
{
"@ant-design/pro-layout"
:
"^4.5.5"
,
"antd"
:
"^3.16.3"
,
"dva"
:
"^2.4.0"
,
"react"
:
"^16.6.3"
,
"redux"
:
"^4.0.1"
,
"umi-request"
:
"^1.0.0"
},
"devDependencies"
:
{
"umi"
:
"^2.6.9"
,
"umi-plugin-
react"
:
"^1.7.2
"
,
"umi-plugin-
block-dev"
:
"^1.0.0
"
"umi-plugin-
block-dev"
:
"^1.0.0
"
,
"umi-plugin-
react"
:
"^1.7.2
"
},
"license"
:
"ISC"
,
"blockConfig"
:
{
...
...
This diff is collapsed.
Click to expand it.
ListCardList/src/_mock.ts
View file @
a6f14781
import
{
CardListItemDataType
}
from
'
./data
'
;
import
{
CardListItemDataType
}
from
'
./data
.d
'
;
const
titles
=
[
'
Alipay
'
,
...
...
This diff is collapsed.
Click to expand it.
ListCardList/src/index.tsx
View file @
a6f14781
...
...
@@ -4,14 +4,14 @@ import React, { Component } from 'react';
import
{
Dispatch
}
from
'
redux
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
{
connect
}
from
'
dva
'
;
import
{
I
StateType
}
from
'
./model
'
;
import
{
CardListItemDataType
}
from
'
./data
'
;
import
{
StateType
}
from
'
./model
'
;
import
{
CardListItemDataType
}
from
'
./data
.d
'
;
import
styles
from
'
./style.less
'
;
const
{
Paragraph
}
=
Typography
;
interface
PAGE_NAME_UPPER_CAMEL_CASEProps
{
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
dispatch
:
Dispatch
<
any
>
;
loading
:
boolean
;
}
...
...
@@ -26,7 +26,7 @@ interface PAGE_NAME_UPPER_CAMEL_CASEState {
BLOCK_NAME_CAMEL_CASE
,
loading
,
}:
{
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
loading
:
{
models
:
{
[
key
:
string
]:
boolean
};
};
...
...
@@ -86,42 +86,45 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<
/>
</
div
>
);
const
nullData
=
{}
as
CardListItemDataType
;
const
nullData
:
Partial
<
CardListItemDataType
>
=
{}
;
return
(
<
PageHeaderWrapper
content
=
{
content
}
extraContent
=
{
extraContent
}
>
<
div
className
=
{
styles
.
cardList
}
>
<
List
<
List
<
Partial
<
CardListItemDataType
>
>
rowKey="id"
loading=
{
loading
}
grid=
{
{
gutter
:
24
,
lg
:
3
,
md
:
2
,
sm
:
1
,
xs
:
1
}
}
dataSource=
{
[
nullData
,
...
list
]
}
renderItem
=
{
item
=>
item
&&
item
.
id
?
(
<
List
.
Item
key
=
{
item
.
id
}
>
<
Card
hoverable
className
=
{
styles
.
card
}
actions
=
{
[<
a
key
=
"option1"
>
操作一
</
a
>,
<
a
key
=
"option2"
>
操作二
</
a
>]
}
>
<
Card
.
Meta
avatar
=
{
<
img
alt
=
""
className
=
{
styles
.
cardAvatar
}
src
=
{
item
.
avatar
}
/>
}
title
=
{
<
a
>
{
item
.
title
}
</
a
>
}
description
=
{
<
Paragraph
className
=
{
styles
.
item
}
ellipsis
=
{
{
rows
:
3
}
}
>
{
item
.
description
}
</
Paragraph
>
}
/>
</
Card
>
</
List
.
Item
>
)
:
(
renderItem=
{
item
=>
{
if
(
item
&&
item
.
id
)
{
return
(
<
List
.
Item
key
=
{
item
.
id
}
>
<
Card
hoverable
className
=
{
styles
.
card
}
actions
=
{
[<
a
key
=
"option1"
>
操作一
</
a
>,
<
a
key
=
"option2"
>
操作二
</
a
>]
}
>
<
Card
.
Meta
avatar
=
{
<
img
alt
=
""
className
=
{
styles
.
cardAvatar
}
src
=
{
item
.
avatar
}
/>
}
title
=
{
<
a
>
{
item
.
title
}
</
a
>
}
description
=
{
<
Paragraph
className
=
{
styles
.
item
}
ellipsis
=
{
{
rows
:
3
}
}
>
{
item
.
description
}
</
Paragraph
>
}
/>
</
Card
>
</
List
.
Item
>
);
}
return
(
<
List
.
Item
>
<
Button
type
=
"dashed"
className
=
{
styles
.
newButton
}
>
<
Icon
type
=
"plus"
/>
新增产品
</
Button
>
</
List
.
Item
>
)
}
)
;
}
}
/>
</
div
>
</
PageHeaderWrapper
>
...
...
This diff is collapsed.
Click to expand it.
ListCardList/src/model.ts
View file @
a6f14781
import
{
AnyAction
,
Reducer
}
from
'
redux
'
;
import
{
EffectsCommandMap
}
from
'
dva
'
;
import
{
CardListItemDataType
}
from
'
./data
'
;
import
{
CardListItemDataType
}
from
'
./data
.d
'
;
import
{
queryFakeList
}
from
'
./service
'
;
export
interface
I
StateType
{
export
interface
StateType
{
list
:
CardListItemDataType
[];
}
export
type
Effect
=
(
action
:
AnyAction
,
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
I
StateType
)
=>
T
)
=>
T
},
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
StateType
)
=>
T
)
=>
T
},
)
=>
void
;
export
interface
ModelType
{
namespace
:
string
;
state
:
I
StateType
;
state
:
StateType
;
effects
:
{
fetch
:
Effect
;
};
reducers
:
{
queryList
:
Reducer
<
I
StateType
>
;
queryList
:
Reducer
<
StateType
>
;
};
}
...
...
This diff is collapsed.
Click to expand it.
ListSearch/package.json
View file @
a6f14781
...
...
@@ -11,6 +11,7 @@
"url"
:
"https://github.com/umijs/umi-blocks/ant-design-pro/searchlistapplications"
},
"dependencies"
:
{
"@ant-design/pro-layout"
:
"^4.5.5"
,
"antd"
:
"^3.16.3"
,
"classnames"
:
"^2.2.6"
,
"dva"
:
"^2.4.0"
,
...
...
@@ -23,8 +24,8 @@
},
"devDependencies"
:
{
"umi"
:
"^2.6.9"
,
"umi-plugin-
react"
:
"^1.7.2
"
,
"umi-plugin-
block-dev"
:
"^1.0.0
"
"umi-plugin-
block-dev"
:
"^1.0.0
"
,
"umi-plugin-
react"
:
"^1.7.2
"
},
"license"
:
"ISC"
,
"blockConfig"
:
{
...
...
This diff is collapsed.
Click to expand it.
ListSearchApplications/package.json
View file @
a6f14781
...
...
@@ -19,12 +19,13 @@
"numeral"
:
"^2.0.6"
,
"nzh"
:
"^1.0.3"
,
"react"
:
"^16.6.3"
,
"redux"
:
"^4.0.1"
,
"umi-request"
:
"^1.0.0"
},
"devDependencies"
:
{
"umi"
:
"^2.6.9"
,
"umi-plugin-
react"
:
"^1.7.2
"
,
"umi-plugin-
block-dev"
:
"^1.0.0
"
"umi-plugin-
block-dev"
:
"^1.0.0
"
,
"umi-plugin-
react"
:
"^1.7.2
"
},
"license"
:
"ISC"
,
"blockConfig"
:
{
...
...
This diff is collapsed.
Click to expand it.
ListSearchApplications/src/_mock.ts
View file @
a6f14781
import
{
ListItemDataType
}
from
'
./data
'
;
import
{
ListItemDataType
}
from
'
./data
.d
'
;
const
titles
=
[
'
Alipay
'
,
...
...
This diff is collapsed.
Click to expand it.
ListSearchApplications/src/index.tsx
View file @
a6f14781
...
...
@@ -5,8 +5,8 @@ import { Dispatch } from 'redux';
import
{
FormComponentProps
}
from
'
antd/es/form
'
;
import
{
connect
}
from
'
dva
'
;
import
numeral
from
'
numeral
'
;
import
{
I
StateType
}
from
'
./model
'
;
import
{
ListItemDataType
}
from
'
./data
'
;
import
{
StateType
}
from
'
./model
'
;
import
{
ListItemDataType
}
from
'
./data
.d
'
;
import
StandardFormRow
from
'
./components/StandardFormRow
'
;
import
TagSelect
from
'
./components/TagSelect
'
;
import
styles
from
'
./style.less
'
;
...
...
@@ -42,7 +42,7 @@ export function formatWan(val: number) {
interface
PAGE_NAME_UPPER_CAMEL_CASEProps
extends
FormComponentProps
{
dispatch
:
Dispatch
<
any
>
;
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
loading
:
boolean
;
}
...
...
@@ -217,7 +217,7 @@ export default connect(
BLOCK_NAME_CAMEL_CASE
,
loading
,
}
:
{
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
loading
:
{
models
:
{
[
key
:
string
]:
boolean
}
};
}
) => (
{
BLOCK_NAME_CAMEL_CASE
,
...
...
This diff is collapsed.
Click to expand it.
ListSearchApplications/src/model.ts
View file @
a6f14781
import
{
AnyAction
,
Reducer
}
from
'
redux
'
;
import
{
EffectsCommandMap
}
from
'
dva
'
;
import
{
ListItemDataType
}
from
'
./data
'
;
import
{
ListItemDataType
}
from
'
./data
.d
'
;
import
{
queryFakeList
}
from
'
./service
'
;
export
interface
I
StateType
{
export
interface
StateType
{
list
:
ListItemDataType
[];
}
export
type
Effect
=
(
action
:
AnyAction
,
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
I
StateType
)
=>
T
)
=>
T
},
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
StateType
)
=>
T
)
=>
T
},
)
=>
void
;
export
interface
ModelType
{
namespace
:
string
;
state
:
I
StateType
;
state
:
StateType
;
effects
:
{
fetch
:
Effect
;
};
reducers
:
{
queryList
:
Reducer
<
I
StateType
>
;
queryList
:
Reducer
<
StateType
>
;
};
}
...
...
This diff is collapsed.
Click to expand it.
ListSearchApplications/src/service.ts
View file @
a6f14781
import
request
from
'
umi-request
'
;
import
{
ListItemDataType
}
from
'
./data
'
;
import
{
ListItemDataType
}
from
'
./data
.d
'
;
export
async
function
queryFakeList
(
params
:
ListItemDataType
)
{
return
request
(
'
/api/fake_list
'
,
{
...
...
This diff is collapsed.
Click to expand it.
ListSearchArticles/package.json
View file @
a6f14781
...
...
@@ -16,12 +16,13 @@
"dva"
:
"^2.4.0"
,
"moment"
:
"^2.22.2"
,
"react"
:
"^16.6.3"
,
"redux"
:
"^4.0.1"
,
"umi-request"
:
"^1.0.0"
},
"devDependencies"
:
{
"umi"
:
"^2.6.9"
,
"umi-plugin-
react"
:
"^1.7.2
"
,
"umi-plugin-
block-dev"
:
"^1.0.0
"
"umi-plugin-
block-dev"
:
"^1.0.0
"
,
"umi-plugin-
react"
:
"^1.7.2
"
},
"license"
:
"ISC"
,
"blockConfig"
:
{
...
...
This diff is collapsed.
Click to expand it.
ListSearchArticles/src/_mock.ts
View file @
a6f14781
import
{
ListItemDataType
}
from
'
./data
'
;
import
{
ListItemDataType
}
from
'
./data
.d
'
;
const
titles
=
[
'
Alipay
'
,
...
...
This diff is collapsed.
Click to expand it.
ListSearchArticles/src/index.tsx
View file @
a6f14781
...
...
@@ -5,8 +5,8 @@ import { Dispatch } from 'redux';
import
{
FormComponentProps
}
from
'
antd/es/form
'
;
import
{
connect
}
from
'
dva
'
;
import
ArticleListContent
from
'
./components/ArticleListContent
'
;
import
{
I
StateType
}
from
'
./model
'
;
import
{
ListItemDataType
}
from
'
./data
'
;
import
{
StateType
}
from
'
./model
'
;
import
{
ListItemDataType
}
from
'
./data
.d
'
;
import
StandardFormRow
from
'
./components/StandardFormRow
'
;
import
TagSelect
from
'
./components/TagSelect
'
;
import
styles
from
'
./style.less
'
;
...
...
@@ -18,7 +18,7 @@ const pageSize = 5;
interface
PAGE_NAME_UPPER_CAMEL_CASEProps
extends
FormComponentProps
{
dispatch
:
Dispatch
<
any
>
;
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
loading
:
boolean
;
}
...
...
@@ -252,7 +252,7 @@ export default connect(
BLOCK_NAME_CAMEL_CASE
,
loading
,
}
:
{
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
loading
:
{
models
:
{
[
key
:
string
]:
boolean
}
};
}
) => (
{
BLOCK_NAME_CAMEL_CASE
,
...
...
This diff is collapsed.
Click to expand it.
ListSearchArticles/src/model.ts
View file @
a6f14781
import
{
AnyAction
,
Reducer
}
from
'
redux
'
;
import
{
EffectsCommandMap
}
from
'
dva
'
;
import
{
ListItemDataType
}
from
'
./data
'
;
import
{
ListItemDataType
}
from
'
./data
.d
'
;
import
{
queryFakeList
}
from
'
./service
'
;
export
interface
I
StateType
{
export
interface
StateType
{
list
:
ListItemDataType
[];
}
export
type
Effect
=
(
action
:
AnyAction
,
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
I
StateType
)
=>
T
)
=>
T
},
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
StateType
)
=>
T
)
=>
T
},
)
=>
void
;
export
interface
ModelType
{
namespace
:
string
;
state
:
I
StateType
;
state
:
StateType
;
effects
:
{
fetch
:
Effect
;
appendFetch
:
Effect
;
};
reducers
:
{
queryList
:
Reducer
<
I
StateType
>
;
appendList
:
Reducer
<
I
StateType
>
;
queryList
:
Reducer
<
StateType
>
;
appendList
:
Reducer
<
StateType
>
;
};
}
...
...
@@ -60,7 +60,7 @@ const Model: ModelType = {
appendList
(
state
,
action
)
{
return
{
...
state
,
list
:
state
!
.
list
.
concat
(
action
.
payload
),
list
:
(
state
as
StateType
)
.
list
.
concat
(
action
.
payload
),
};
},
},
...
...
This diff is collapsed.
Click to expand it.
ListSearchArticles/src/service.ts
View file @
a6f14781
import
request
from
'
umi-request
'
;
import
{
ListItemDataType
}
from
'
./data
'
;
import
{
ListItemDataType
}
from
'
./data
.d
'
;
export
async
function
queryFakeList
(
params
:
ListItemDataType
)
{
return
request
(
'
/api/fake_list
'
,
{
...
...
This diff is collapsed.
Click to expand it.
ListSearchProjects/package.json
View file @
a6f14781
...
...
@@ -16,12 +16,13 @@
"dva"
:
"^2.4.0"
,
"moment"
:
"^2.22.2"
,
"react"
:
"^16.6.3"
,
"redux"
:
"^4.0.1"
,
"umi-request"
:
"^1.0.0"
},
"devDependencies"
:
{
"umi"
:
"^2.6.9"
,
"umi-plugin-
react"
:
"^1.7.2
"
,
"umi-plugin-
block-dev"
:
"^1.0.0
"
"umi-plugin-
block-dev"
:
"^1.0.0
"
,
"umi-plugin-
react"
:
"^1.7.2
"
},
"license"
:
"ISC"
,
"blockConfig"
:
{
...
...
This diff is collapsed.
Click to expand it.
ListSearchProjects/src/_mock.ts
View file @
a6f14781
import
{
ListItemDataType
}
from
'
./data
'
;
import
{
ListItemDataType
}
from
'
./data
.d
'
;
const
titles
=
[
'
Alipay
'
,
...
...
This diff is collapsed.
Click to expand it.
ListSearchProjects/src/index.tsx
View file @
a6f14781
...
...
@@ -6,8 +6,8 @@ import { FormComponentProps } from 'antd/es/form';
import
{
connect
}
from
'
dva
'
;
import
moment
from
'
moment
'
;
import
AvatarList
from
'
./components/AvatarList
'
;
import
{
I
StateType
}
from
'
./model
'
;
import
{
ListItemDataType
}
from
'
./data
'
;
import
{
StateType
}
from
'
./model
'
;
import
{
ListItemDataType
}
from
'
./data
.d
'
;
import
StandardFormRow
from
'
./components/StandardFormRow
'
;
import
TagSelect
from
'
./components/TagSelect
'
;
import
styles
from
'
./style.less
'
;
...
...
@@ -18,7 +18,7 @@ const { Paragraph } = Typography;
interface
PAGE_NAME_UPPER_CAMEL_CASEProps
extends
FormComponentProps
{
dispatch
:
Dispatch
<
any
>
;
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
loading
:
boolean
;
}
...
...
@@ -66,9 +66,9 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<PAGE_NAME_UPPER_CAMEL_CASEPro
<
span
>
{
moment
(
item
.
updatedAt
).
fromNow
()
}
</
span
>
<
div
className
=
{
styles
.
avatarList
}
>
<
AvatarList
size
=
"small"
>
{
item
.
members
.
map
(
(
member
,
i
)
=>
(
{
item
.
members
.
map
(
member
=>
(
<
AvatarList
.
Item
key
=
{
`
${
item
.
id
}
-avatar
-
${
i
}
`
}
key
=
{
`
${
item
.
id
}
-avatar`
}
src
=
{
member
.
avatar
}
tips
=
{
member
.
name
}
/>
...
...
@@ -162,7 +162,7 @@ export default connect(
BLOCK_NAME_CAMEL_CASE
,
loading
,
}
:
{
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
loading
:
{
models
:
{
[
key
:
string
]:
boolean
}
};
}
) => (
{
BLOCK_NAME_CAMEL_CASE
,
...
...
This diff is collapsed.
Click to expand it.
ListSearchProjects/src/model.ts
View file @
a6f14781
import
{
AnyAction
,
Reducer
}
from
'
redux
'
;
import
{
EffectsCommandMap
}
from
'
dva
'
;
import
{
ListItemDataType
}
from
'
./data
'
;
import
{
ListItemDataType
}
from
'
./data
.d
'
;
import
{
queryFakeList
}
from
'
./service
'
;
export
interface
I
StateType
{
export
interface
StateType
{
list
:
ListItemDataType
[];
}
export
type
Effect
=
(
action
:
AnyAction
,
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
I
StateType
)
=>
T
)
=>
T
},
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
StateType
)
=>
T
)
=>
T
},
)
=>
void
;
export
interface
ModelType
{
namespace
:
string
;
state
:
I
StateType
;
state
:
StateType
;
effects
:
{
fetch
:
Effect
;
};
reducers
:
{
queryList
:
Reducer
<
I
StateType
>
;
queryList
:
Reducer
<
StateType
>
;
};
}
...
...
This diff is collapsed.
Click to expand it.
ListTableList/package.json
View file @
a6f14781
...
...
@@ -11,16 +11,18 @@
"url"
:
"https://github.com/umijs/umi-blocks/ant-design-pro/tablelist"
},
"dependencies"
:
{
"@ant-design/pro-layout"
:
"^4.5.5"
,
"antd"
:
"^3.16.3"
,
"dva"
:
"^2.4.0"
,
"moment"
:
"^2.22.2"
,
"react"
:
"^16.6.3"
,
"redux"
:
"^4.0.1"
,
"umi-request"
:
"^1.0.0"
},
"devDependencies"
:
{
"umi"
:
"^2.6.9"
,
"umi-plugin-
react"
:
"^1.7.2
"
,
"umi-plugin-
block-dev"
:
"^1.0.0
"
"umi-plugin-
block-dev"
:
"^1.0.0
"
,
"umi-plugin-
react"
:
"^1.7.2
"
},
"license"
:
"ISC"
,
"blockConfig"
:
{
...
...
This diff is collapsed.
Click to expand it.
ListTableList/src/_mock.ts
View file @
a6f14781
import
{
parse
}
from
'
url
'
;
import
{
TableListItem
,
TableListParams
}
from
'
./data
'
;
import
{
TableListItem
,
TableListParams
}
from
'
./data
.d
'
;
// mock tableListDataSource
let
tableListDataSource
:
TableListItem
[]
=
[];
...
...
@@ -39,7 +39,8 @@ function getRule(
)
{
let
url
=
u
;
if
(
!
url
||
Object
.
prototype
.
toString
.
call
(
url
)
!==
'
[object String]
'
)
{
url
=
req
.
url
;
// eslint-disable-line
// eslint-disable-next-line prefer-destructuring
url
=
req
.
url
;
}
const
params
=
(
parse
(
url
,
true
).
query
as
unknown
)
as
TableListParams
;
...
...
@@ -101,7 +102,8 @@ function postRule(
)
{
let
url
=
u
;
if
(
!
url
||
Object
.
prototype
.
toString
.
call
(
url
)
!==
'
[object String]
'
)
{
url
=
req
.
url
;
// eslint-disable-line
// eslint-disable-next-line prefer-destructuring
url
=
req
.
url
;
}
const
body
=
(
b
&&
b
.
body
)
||
req
.
body
;
...
...
This diff is collapsed.
Click to expand it.
ListTableList/src/components/StandardTable/index.tsx
View file @
a6f14781
import
{
Alert
,
Table
}
from
'
antd
'
;
import
{
ColumnProps
,
SorterResult
,
TableProps
}
from
'
antd/es/table
'
;
import
{
ColumnProps
,
TableRowSelection
,
TableProps
}
from
'
antd/es/table
'
;
import
React
,
{
Component
,
Fragment
}
from
'
react
'
;
import
{
TableListItem
}
from
'
../../data
'
;
import
{
TableListItem
}
from
'
../../data
.d
'
;
import
styles
from
'
./index.less
'
;
type
Omit
<
T
,
K
extends
keyof
T
>
=
Pick
<
T
,
Exclude
<
keyof
T
,
K
>>
;
...
...
@@ -17,10 +17,10 @@ export interface StandardTableProps<T> extends Omit<TableProps<T>, 'columns'> {
onSelectRow
:
(
rows
:
any
)
=>
void
;
}
export
type
StandardTableColumnProps
=
ColumnProps
<
TableListItem
>
&
{
export
interface
StandardTableColumnProps
extends
ColumnProps
<
TableListItem
>
{
needTotal
?:
boolean
;
total
?:
number
;
}
;
}
function
initTotalList
(
columns
:
StandardTableColumnProps
[])
{
if
(
!
columns
)
{
...
...
@@ -64,24 +64,28 @@ class StandardTable extends Component<StandardTableProps<TableListItem>, Standar
};
}
handleRowSelectChange
=
(
selectedRowKeys
:
string
[],
selectedRows
:
TableListItem
[])
=>
{
handleRowSelectChange
:
TableRowSelection
<
TableListItem
>
[
'
onChange
'
]
=
(
selectedRowKeys
,
selectedRows
:
TableListItem
[],
)
=>
{
const
currySelectedRowKeys
=
selectedRowKeys
as
string
[];
let
{
needTotalList
}
=
this
.
state
;
needTotalList
=
needTotalList
.
map
(
item
=>
({
...
item
,
total
:
selectedRows
.
reduce
((
sum
,
val
)
=>
sum
+
parseFloat
(
val
[
item
.
dataIndex
],
10
),
0
),
total
:
selectedRows
.
reduce
((
sum
,
val
)
=>
sum
+
parseFloat
(
val
[
item
.
dataIndex
||
0
]
),
0
),
}));
const
{
onSelectRow
}
=
this
.
props
;
if
(
onSelectRow
)
{
onSelectRow
(
selectedRows
);
}
this
.
setState
({
selectedRowKeys
,
needTotalList
});
this
.
setState
({
selectedRowKeys
:
currySelectedRowKeys
,
needTotalList
});
};
handleTableChange
=
(
pagination
:
StandardTableProps
<
TableListItem
>
[
'
pagination
'
]
,
filters
:
Record
<
keyof
TableListItem
,
string
[]
>
,
sorter
:
SorterResult
<
TableListItem
>
,
handleTableChange
:
TableProps
<
TableListItem
>
[
'
onChange
'
]
=
(
pagination
,
filters
,
sorter
,
...
rest
)
=>
{
const
{
onChange
}
=
this
.
props
;
...
...
@@ -91,7 +95,9 @@ class StandardTable extends Component<StandardTableProps<TableListItem>, Standar
};
cleanSelectedKeys
=
()
=>
{
this
.
handleRowSelectChange
([],
[]);
if
(
this
.
handleRowSelectChange
)
{
this
.
handleRowSelectChange
([],
[]);
}
};
render
()
{
...
...
@@ -105,7 +111,7 @@ class StandardTable extends Component<StandardTableProps<TableListItem>, Standar
...
pagination
,
};
const
rowSelection
=
{
const
rowSelection
:
TableRowSelection
<
TableListItem
>
=
{
selectedRowKeys
,
onChange
:
this
.
handleRowSelectChange
,
getCheckboxProps
:
(
record
:
TableListItem
)
=>
({
...
...
This diff is collapsed.
Click to expand it.
ListTableList/src/components/UpdateForm.tsx
View file @
a6f14781
...
...
@@ -2,19 +2,19 @@ import { Button, DatePicker, Form, Input, Modal, Radio, Select, Steps } from 'an
import
React
,
{
Component
}
from
'
react
'
;
import
{
FormComponentProps
}
from
'
antd/es/form
'
;
import
{
TableListItem
}
from
'
../data
'
;
import
{
TableListItem
}
from
'
../data
.d
'
;
export
type
IFormValsType
=
{
export
interface
FormValsType
extends
Partial
<
TableListItem
>
{
target
?:
string
;
template
?:
string
;
type
?:
string
;
time
?:
string
;
frequency
?:
string
;
}
&
Partial
<
TableListItem
>
;
}
export
interface
UpdateFormProps
extends
FormComponentProps
{
handleUpdateModalVisible
:
(
flag
?:
boolean
,
formVals
?:
I
FormValsType
)
=>
void
;
handleUpdate
:
(
values
:
I
FormValsType
)
=>
void
;
handleUpdateModalVisible
:
(
flag
?:
boolean
,
formVals
?:
FormValsType
)
=>
void
;
handleUpdate
:
(
values
:
FormValsType
)
=>
void
;
updateModalVisible
:
boolean
;
values
:
Partial
<
TableListItem
>
;
}
...
...
@@ -25,7 +25,7 @@ const { Option } = Select;
const
RadioGroup
=
Radio
.
Group
;
export
interface
UpdateFormState
{
formVals
:
I
FormValsType
;
formVals
:
FormValsType
;
currentStep
:
number
;
}
...
...
@@ -94,7 +94,7 @@ class UpdateForm extends Component<UpdateFormProps, UpdateFormState> {
});
};
renderContent
=
(
currentStep
:
number
,
formVals
:
I
FormValsType
)
=>
{
renderContent
=
(
currentStep
:
number
,
formVals
:
FormValsType
)
=>
{
const
{
form
}
=
this
.
props
;
if
(
currentStep
===
1
)
{
return
[
...
...
This diff is collapsed.
Click to expand it.
ListTableList/src/index.tsx
View file @
a6f14781
...
...
@@ -23,11 +23,12 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
import
{
SorterResult
}
from
'
antd/es/table
'
;
import
{
connect
}
from
'
dva
'
;
import
moment
from
'
moment
'
;
import
{
I
StateType
}
from
'
./model
'
;
import
{
StateType
}
from
'
./model
'
;
import
CreateForm
from
'
./components/CreateForm
'
;
import
UpdateForm
,
{
IFormValsType
}
from
'
./components/UpdateForm
'
;
import
{
TableListItem
,
TableListPagination
,
TableListParams
}
from
'
./data
'
;
import
StandardTable
,
{
StandardTableColumnProps
}
from
'
./components/StandardTable
'
;
import
UpdateForm
,
{
FormValsType
}
from
'
./components/UpdateForm
'
;
import
{
TableListItem
,
TableListPagination
,
TableListParams
}
from
'
./data.d
'
;
import
styles
from
'
./style.less
'
;
const
FormItem
=
Form
.
Item
;
...
...
@@ -44,7 +45,7 @@ const status = ['关闭', '运行中', '已上线', '异常'];
interface
TableListProps
extends
FormComponentProps
{
dispatch
:
Dispatch
<
any
>
;
loading
:
boolean
;
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
}
interface
TableListState
{
...
...
@@ -62,7 +63,7 @@ interface TableListState {
BLOCK_NAME_CAMEL_CASE
,
loading
,
}:
{
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
loading
:
{
models
:
{
[
key
:
string
]:
boolean
;
...
...
@@ -260,7 +261,7 @@ class TableList extends Component<TableListProps, TableListState> {
});
};
handleUpdateModalVisible
=
(
flag
?:
boolean
,
record
?:
I
FormValsType
)
=>
{
handleUpdateModalVisible
=
(
flag
?:
boolean
,
record
?:
FormValsType
)
=>
{
this
.
setState
({
updateModalVisible
:
!!
flag
,
stepFormValues
:
record
||
{},
...
...
@@ -280,7 +281,7 @@ class TableList extends Component<TableListProps, TableListState> {
this
.
handleModalVisible
();
};
handleUpdate
=
(
fields
:
I
FormValsType
)
=>
{
handleUpdate
=
(
fields
:
FormValsType
)
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'
BLOCK_NAME_CAMEL_CASE/update
'
,
...
...
This diff is collapsed.
Click to expand it.
ListTableList/src/model.ts
View file @
a6f14781
...
...
@@ -2,20 +2,20 @@ import { AnyAction, Reducer } from 'redux';
import
{
EffectsCommandMap
}
from
'
dva
'
;
import
{
addRule
,
queryRule
,
removeRule
,
updateRule
}
from
'
./service
'
;
import
{
TableListDate
}
from
'
./data
'
;
import
{
TableListDate
}
from
'
./data
.d
'
;
export
interface
I
StateType
{
export
interface
StateType
{
data
:
TableListDate
;
}
export
type
Effect
=
(
action
:
AnyAction
,
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
I
StateType
)
=>
T
)
=>
T
},
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
StateType
)
=>
T
)
=>
T
},
)
=>
void
;
export
interface
ModelType
{
namespace
:
string
;
state
:
I
StateType
;
state
:
StateType
;
effects
:
{
fetch
:
Effect
;
add
:
Effect
;
...
...
@@ -23,7 +23,7 @@ export interface ModelType {
update
:
Effect
;
};
reducers
:
{
save
:
Reducer
<
I
StateType
>
;
save
:
Reducer
<
StateType
>
;
};
}
...
...
This diff is collapsed.
Click to expand it.
ListTableList/src/service.ts
View file @
a6f14781
import
request
from
'
umi-request
'
;
import
{
TableListParams
}
from
'
./data
'
;
import
{
TableListParams
}
from
'
./data
.d
'
;
export
async
function
queryRule
(
params
:
TableListParams
)
{
return
request
(
'
/api/rule
'
,
{
...
...
This diff is collapsed.
Click to expand it.
ProfileAdvanced/package.json
View file @
a6f14781
...
...
@@ -11,18 +11,19 @@
"url"
:
"https://github.com/umijs/umi-blocks/ant-design-pro/advancedprofile"
},
"dependencies"
:
{
"@ant-design/pro-layout"
:
"^4.0.5"
,
"antd"
:
"^3.16.3"
,
"classnames"
:
"^2.2.6"
,
"dva"
:
"^2.4.0"
,
"lodash-decorators"
:
"^6.0.0"
,
"react"
:
"^16.6.3"
,
"
umi-request"
:
"^1.0.0
"
,
"
@ant-design/pro-layout"
:
"^4.0.5
"
"
redux"
:
"^4.0.1
"
,
"
umi-request"
:
"^1.0.0
"
},
"devDependencies"
:
{
"umi"
:
"^2.6.9"
,
"umi-plugin-
react"
:
"^1.7.2
"
,
"umi-plugin-
block-dev"
:
"^1.0.0
"
"umi-plugin-
block-dev"
:
"^1.0.0
"
,
"umi-plugin-
react"
:
"^1.7.2
"
},
"license"
:
"ISC"
,
"blockConfig"
:
{
...
...
This diff is collapsed.
Click to expand it.
ProfileAdvanced/src/index.tsx
View file @
a6f14781
...
...
@@ -20,7 +20,7 @@ import React, { Component, Fragment } from 'react';
import
{
Dispatch
}
from
'
redux
'
;
import
classNames
from
'
classnames
'
;
import
{
connect
}
from
'
dva
'
;
import
{
AdvancedProfileData
}
from
'
./data
'
;
import
{
AdvancedProfileData
}
from
'
./data
.d
'
;
import
styles
from
'
./style.less
'
;
const
{
Step
}
=
Steps
;
...
...
@@ -122,14 +122,16 @@ const customDot = (
}:
{
status
:
string
;
},
)
=>
status
===
'
process
'
?
(
<
Popover
placement
=
"topLeft"
arrowPointAtCenter
content
=
{
popoverContent
}
>
{
dot
}
</
Popover
>
)
:
(
dot
);
)
=>
{
if
(
status
===
'
process
'
)
{
return
(
<
Popover
placement
=
"topLeft"
arrowPointAtCenter
content
=
{
popoverContent
}
>
{
dot
}
</
Popover
>
);
}
return
dot
;
};
const
operationTabList
=
[
{
...
...
@@ -161,12 +163,12 @@ const columns = [
title
:
'
执行结果
'
,
dataIndex
:
'
status
'
,
key
:
'
status
'
,
render
:
(
text
:
string
)
=>
text
===
'
agree
'
?
(
<
Badge
status
=
"success"
text
=
"成功"
/>
)
:
(
<
Badge
status
=
"error"
text
=
"驳回"
/>
)
,
render
:
(
text
:
string
)
=>
{
if
(
text
===
'
agree
'
)
{
return
<
Badge
status
=
"success"
text
=
"成功"
/>;
}
return
<
Badge
status
=
"error"
text
=
"驳回"
/>;
}
,
},
{
title
:
'
操作时间
'
,
...
...
This diff is collapsed.
Click to expand it.
ProfileAdvanced/src/model.ts
View file @
a6f14781
import
{
AnyAction
,
Reducer
}
from
'
redux
'
;
import
{
EffectsCommandMap
}
from
'
dva
'
;
import
{
AdvancedProfileData
}
from
'
./data
'
;
import
{
AdvancedProfileData
}
from
'
./data
.d
'
;
import
{
queryAdvancedProfile
}
from
'
./service
'
;
export
type
Effect
=
(
...
...
This diff is collapsed.
Click to expand it.
ProfileBasic/package.json
View file @
a6f14781
...
...
@@ -11,15 +11,17 @@
"url"
:
"https://github.com/umijs/umi-blocks/ant-design-pro/basicprofile"
},
"dependencies"
:
{
"@ant-design/pro-layout"
:
"^4.5.5"
,
"antd"
:
"^3.16.3"
,
"dva"
:
"^2.4.0"
,
"react"
:
"^16.6.3"
,
"redux"
:
"^4.0.1"
,
"umi-request"
:
"^1.0.0"
},
"devDependencies"
:
{
"umi"
:
"^2.6.9"
,
"umi-plugin-
react"
:
"^1.7.2
"
,
"umi-plugin-
block-dev"
:
"^1.0.0
"
"umi-plugin-
block-dev"
:
"^1.0.0
"
,
"umi-plugin-
react"
:
"^1.7.2
"
},
"license"
:
"ISC"
,
"blockConfig"
:
{
...
...
This diff is collapsed.
Click to expand it.
ProfileBasic/src/data.d.ts
View file @
a6f14781
export
interface
BasicGood
{
id
:
string
;
name
:
string
;
barcode
:
string
;
price
:
string
;
num
:
string
|
number
;
amount
:
string
|
number
;
name
?
:
string
;
barcode
?
:
string
;
price
?
:
string
;
num
?
:
string
|
number
;
amount
?
:
string
|
number
;
}
export
interface
BasicProgress
{
...
...
This diff is collapsed.
Click to expand it.
ProfileBasic/src/index.tsx
View file @
a6f14781
...
...
@@ -4,7 +4,7 @@ import React, { Component } from 'react';
import
{
Dispatch
}
from
'
redux
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
{
connect
}
from
'
dva
'
;
import
{
Basic
Good
,
BasicProfileDataType
}
from
'
./data
'
;
import
{
Basic
ProfileDataType
}
from
'
./data.d
'
;
import
styles
from
'
./style.less
'
;
const
progressColumns
=
[
...
...
@@ -22,13 +22,14 @@ const progressColumns = [
title
:
'
状态
'
,
dataIndex
:
'
status
'
,
key
:
'
status
'
,
render
:
(
text
:
string
)
=>
text
===
'
success
'
?
(
<
Badge
status
=
"success"
text
=
"成功"
/>
)
:
(
<
Badge
status
=
"processing"
text
=
"进行中"
/>
)
,
render
:
(
text
:
string
)
=>
{
if
(
text
===
'
success
'
)
{
return
<
Badge
status
=
"success"
text
=
"成功"
/>;
}
return
<
Badge
status
=
"processing"
text
=
"进行中"
/>;
}
,
},
{
title
:
'
操作员ID
'
,
dataIndex
:
'
operator
'
,
...
...
@@ -90,14 +91,15 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<
id
:
'
总计
'
,
num
,
amount
,
}
as
BasicGood
);
});
}
const
renderContent
=
(
value
:
any
,
row
:
any
,
index
:
any
)
=>
{
const
obj
=
{
const
obj
:
{
children
:
any
;
props
:
{
colSpan
?:
number
};
}
=
{
children
:
value
,
props
:
{}
as
{
colSpan
?:
number
;
},
props
:
{},
};
if
(
index
===
basicGoods
.
length
)
{
obj
.
props
.
colSpan
=
0
;
...
...
This diff is collapsed.
Click to expand it.
ProfileBasic/src/model.ts
View file @
a6f14781
import
{
AnyAction
,
Reducer
}
from
'
redux
'
;
import
{
EffectsCommandMap
}
from
'
dva
'
;
import
{
BasicGood
}
from
'
./data
'
;
import
{
BasicGood
}
from
'
./data
.d
'
;
import
{
queryBasicProfile
}
from
'
./service
'
;
export
interface
I
StateType
{
export
interface
StateType
{
basicGoods
:
BasicGood
[];
}
export
type
Effect
=
(
action
:
AnyAction
,
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
I
StateType
)
=>
T
)
=>
T
},
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
StateType
)
=>
T
)
=>
T
},
)
=>
void
;
export
interface
ModelType
{
namespace
:
string
;
state
:
I
StateType
;
state
:
StateType
;
effects
:
{
fetchBasic
:
Effect
;
};
reducers
:
{
show
:
Reducer
<
I
StateType
>
;
show
:
Reducer
<
StateType
>
;
};
}
...
...
This diff is collapsed.
Click to expand it.
ResultFail/package.json
View file @
a6f14781
...
...
@@ -11,12 +11,14 @@
"url"
:
"https://github.com/umijs/umi-blocks/ant-design-pro/resultfail"
},
"dependencies"
:
{
"react"
:
"^16.6.3"
,
"antd"
:
"^3.16.3"
"@ant-design/pro-layout"
:
"^4.5.5"
,
"antd"
:
"^3.16.3"
,
"classnames"
:
"^2.2.6"
,
"umi-plugin-react"
:
"^1.7.2"
,
"react"
:
"^16.6.3"
},
"devDependencies"
:
{
"umi"
:
"^2.6.9"
,
"umi-plugin-react"
:
"^1.7.2"
,
"umi-plugin-block-dev"
:
"^1.0.0"
},
"license"
:
"ISC"
,
...
...
This diff is collapsed.
Click to expand it.
ResultSuccess/package.json
View file @
a6f14781
...
...
@@ -11,8 +11,11 @@
"url"
:
"https://github.com/umijs/umi-blocks/ant-design-pro/resultsuccess"
},
"dependencies"
:
{
"react"
:
"^16.6.3"
,
"antd"
:
"^3.10.9"
"@ant-design/pro-layout"
:
"^4.5.5"
,
"antd"
:
"^3.16.3"
,
"classnames"
:
"^2.2.6"
,
"umi-plugin-react"
:
"^1.7.2"
,
"react"
:
"^16.6.3"
},
"devDependencies"
:
{
"umi"
:
"^2.6.9"
,
...
...
This diff is collapsed.
Click to expand it.
UserLogin/package.json
View file @
a6f14781
...
...
@@ -16,13 +16,14 @@
"moment"
:
"^2.22.2"
,
"qs"
:
"^6.7.0"
,
"react"
:
"^16.6.3"
,
"umi-request"
:
"^1.0.0"
"redux"
:
"^4.0.1"
,
"umi-request"
:
"^1.0.0"
,
"umi-plugin-react"
:
"^1.3.0"
},
"devDependencies"
:
{
"@types/qs"
:
"^6.5.3"
,
"umi"
:
"^2.6.9"
,
"umi-plugin-block-dev"
:
"^1.0.0"
,
"umi-plugin-react"
:
"^1.3.0-beta.1"
,
"@types/qs"
:
"^6.5.3"
"umi-plugin-block-dev"
:
"^1.0.0"
},
"license"
:
"MIT"
,
"blockConfig"
:
{
...
...
This diff is collapsed.
Click to expand it.
UserLogin/src/index.tsx
View file @
a6f14781
...
...
@@ -7,7 +7,7 @@ import { Dispatch } from 'redux';
import
{
FormComponentProps
}
from
'
antd/es/form
'
;
import
Link
from
'
umi/link
'
;
import
{
connect
}
from
'
dva
'
;
import
{
I
StateType
}
from
'
./model
'
;
import
{
StateType
}
from
'
./model
'
;
import
LoginComponents
from
'
./components/Login
'
;
import
styles
from
'
./style.less
'
;
...
...
@@ -15,7 +15,7 @@ const { Tab, UserName, Password, Mobile, Captcha, Submit } = LoginComponents;
interface
PAGE_NAME_UPPER_CAMEL_CASEProps
{
dispatch
:
Dispatch
<
any
>
;
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
submitting
:
boolean
;
}
interface
PAGE_NAME_UPPER_CAMEL_CASEState
{
...
...
@@ -34,7 +34,7 @@ export interface FromDataType {
BLOCK_NAME_CAMEL_CASE
,
loading
,
}:
{
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
loading
:
{
effects
:
{
[
key
:
string
]:
string
;
...
...
@@ -54,8 +54,28 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<
autoLogin
:
true
,
};
changeAutoLogin
=
(
e
:
CheckboxChangeEvent
)
=>
{
this
.
setState
({
autoLogin
:
e
.
target
.
checked
,
});
};
loginForm
:
FormComponentProps
[
'
form
'
]
|
undefined
|
null
;
handleSubmit
=
(
err
:
any
,
values
:
FromDataType
)
=>
{
const
{
type
}
=
this
.
state
;
if
(
!
err
)
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'
BLOCK_NAME_CAMEL_CASE/login
'
,
payload
:
{
...
values
,
type
,
},
});
}
};
onTabChange
=
(
type
:
string
)
=>
{
this
.
setState
({
type
});
};
...
...
@@ -80,26 +100,6 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<
});
});
handleSubmit
=
(
err
:
any
,
values
:
FromDataType
)
=>
{
const
{
type
}
=
this
.
state
;
if
(
!
err
)
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'
BLOCK_NAME_CAMEL_CASE/login
'
,
payload
:
{
...
values
,
type
,
},
});
}
};
changeAutoLogin
=
(
e
:
CheckboxChangeEvent
)
=>
{
this
.
setState
({
autoLogin
:
e
.
target
.
checked
,
});
};
renderMessage
=
(
content
:
string
)
=>
(
<
Alert
style
=
{
{
marginBottom
:
24
}
}
message
=
{
content
}
type
=
"error"
showIcon
/>
);
...
...
This diff is collapsed.
Click to expand it.
UserLogin/src/model.ts
View file @
a6f14781
...
...
@@ -4,7 +4,7 @@ import { routerRedux } from 'dva/router';
import
{
fakeAccountLogin
,
getFakeCaptcha
}
from
'
./service
'
;
import
{
getPageQuery
,
setAuthority
}
from
'
./utils/utils
'
;
export
interface
I
StateType
{
export
interface
StateType
{
status
?:
'
ok
'
|
'
error
'
;
type
?:
string
;
currentAuthority
?:
'
user
'
|
'
guest
'
|
'
admin
'
;
...
...
@@ -12,18 +12,18 @@ export interface IStateType {
export
type
Effect
=
(
action
:
AnyAction
,
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
I
StateType
)
=>
T
)
=>
T
},
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
StateType
)
=>
T
)
=>
T
},
)
=>
void
;
export
interface
ModelType
{
namespace
:
string
;
state
:
I
StateType
;
state
:
StateType
;
effects
:
{
login
:
Effect
;
getCaptcha
:
Effect
;
};
reducers
:
{
changeLoginStatus
:
Reducer
<
I
StateType
>
;
changeLoginStatus
:
Reducer
<
StateType
>
;
};
}
...
...
This diff is collapsed.
Click to expand it.
UserRegister/package.json
View file @
a6f14781
...
...
@@ -17,11 +17,12 @@
"moment"
:
"^2.22.2"
,
"nzh"
:
"^1.0.3"
,
"react"
:
"^16.6.3"
,
"umi-request"
:
"^1.0.0"
"redux"
:
"^4.0.1"
,
"umi-request"
:
"^1.0.0"
,
"umi-plugin-react"
:
"^1.7.2"
},
"devDependencies"
:
{
"umi"
:
"^2.6.9"
,
"umi-plugin-react"
:
"^1.7.2"
,
"umi-plugin-block-dev"
:
"^1.0.0"
},
"license"
:
"MIT"
,
...
...
This diff is collapsed.
Click to expand it.
UserRegister/src/index.tsx
View file @
a6f14781
...
...
@@ -7,7 +7,7 @@ import { FormComponentProps } from 'antd/es/form';
import
Link
from
'
umi/link
'
;
import
{
connect
}
from
'
dva
'
;
import
router
from
'
umi/router
'
;
import
{
I
StateType
}
from
'
./model
'
;
import
{
StateType
}
from
'
./model
'
;
import
styles
from
'
./style.less
'
;
const
FormItem
=
Form
.
Item
;
...
...
@@ -44,7 +44,7 @@ const passwordProgressMap: {
interface
BLOCK_NAME_CAMEL_CASEProps
extends
FormComponentProps
{
dispatch
:
Dispatch
<
any
>
;
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
submitting
:
boolean
;
}
interface
BLOCK_NAME_CAMEL_CASEState
{
...
...
@@ -55,7 +55,7 @@ interface BLOCK_NAME_CAMEL_CASEState {
prefix
:
string
;
}
export
interface
I
UserRegisterParams
{
export
interface
UserRegisterParams
{
mail
:
string
;
password
:
string
;
confirm
:
string
;
...
...
@@ -69,7 +69,7 @@ export interface IUserRegisterParams {
BLOCK_NAME_CAMEL_CASE
,
loading
,
}:
{
BLOCK_NAME_CAMEL_CASE
:
I
StateType
;
BLOCK_NAME_CAMEL_CASE
:
StateType
;
loading
:
{
effects
:
{
[
key
:
string
]:
string
;
...
...
@@ -92,8 +92,6 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<
prefix
:
'
86
'
,
};
interval
:
number
|
undefined
;
componentDidUpdate
()
{
const
{
BLOCK_NAME_CAMEL_CASE
,
form
}
=
this
.
props
;
const
account
=
form
.
getFieldValue
(
'
mail
'
);
...
...
@@ -197,6 +195,8 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<
});
};
interval
:
number
|
undefined
;
renderPasswordProgress
=
()
=>
{
const
{
form
}
=
this
.
props
;
const
value
=
form
.
getFieldValue
(
'
password
'
);
...
...
@@ -204,7 +204,6 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<
return
value
&&
value
.
length
?
(
<
div
className
=
{
styles
[
`progress-
${
passwordStatus
}
`
]
}
>
<
Progress
default
=
{
passwordProgressMap
[
passwordStatus
]
}
status
=
{
passwordProgressMap
[
passwordStatus
]
}
className
=
{
styles
.
progress
}
strokeWidth
=
{
6
}
...
...
@@ -246,9 +245,12 @@ class PAGE_NAME_UPPER_CAMEL_CASE extends Component<
</
FormItem
>
<
FormItem
help
=
{
help
}
>
<
Popover
getPopupContainer
=
{
node
=>
node
&&
node
.
parentNode
?
(
node
.
parentNode
as
HTMLElement
)
:
node
}
getPopupContainer
=
{
node
=>
{
if
(
node
&&
node
.
parentNode
)
{
return
node
.
parentNode
as
HTMLElement
;
}
return
node
;
}
}
content
=
{
<
div
style
=
{
{
padding
:
'
4px 0
'
}
}
>
{
passwordStatusMap
[
this
.
getPasswordStatus
()]
}
...
...
This diff is collapsed.
Click to expand it.
UserRegister/src/model.ts
View file @
a6f14781
...
...
@@ -3,24 +3,24 @@ import { AnyAction, Reducer } from 'redux';
import
{
EffectsCommandMap
}
from
'
dva
'
;
import
{
fakeRegister
}
from
'
./service
'
;
export
interface
I
StateType
{
export
interface
StateType
{
status
?:
'
ok
'
|
'
error
'
;
currentAuthority
?:
'
user
'
|
'
guest
'
|
'
admin
'
;
}
export
type
Effect
=
(
action
:
AnyAction
,
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
I
StateType
)
=>
T
)
=>
T
},
effects
:
EffectsCommandMap
&
{
select
:
<
T
>
(
func
:
(
state
:
StateType
)
=>
T
)
=>
T
},
)
=>
void
;
export
interface
ModelType
{
namespace
:
string
;
state
:
I
StateType
;
state
:
StateType
;
effects
:
{
submit
:
Effect
;
};
reducers
:
{
registerHandle
:
Reducer
<
I
StateType
>
;
registerHandle
:
Reducer
<
StateType
>
;
};
}
...
...
This diff is collapsed.
Click to expand it.
UserRegister/src/service.ts
View file @
a6f14781
import
request
from
'
umi-request
'
;
import
{
I
UserRegisterParams
}
from
'
./index
'
;
import
{
UserRegisterParams
}
from
'
./index
'
;
export
async
function
fakeRegister
(
params
:
I
UserRegisterParams
)
{
export
async
function
fakeRegister
(
params
:
UserRegisterParams
)
{
return
request
(
'
/api/register
'
,
{
method
:
'
POST
'
,
data
:
params
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment