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