Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linweijiong
jinfa-platform
Commits
87449069
Commit
87449069
authored
Dec 24, 2020
by
Bill
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
446a2a32
00ddc67b
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
158 additions
and
75 deletions
+158
-75
BasicLayout.tsx
src/layouts/BasicLayout.tsx
+1
-0
AvatarDropdown.tsx
src/layouts/components/AvatarDropdown.tsx
+5
-3
RightContent.tsx
src/layouts/components/RightContent.tsx
+2
-2
index.tsx
src/pages/balance/accountsPayable/settlementList/index.tsx
+1
-1
productNoticeSettlementDetail.tsx
...sPayable/settlementList/productNoticeSettlementDetail.tsx
+1
-1
index.tsx
src/pages/balance/accountsReceivable/invoice/index.tsx
+17
-4
index.tsx
...pages/balance/accountsReceivable/invoice/schema/index.tsx
+2
-2
index.tsx
...es/balance/platformSettlement/accountReceivable/index.tsx
+1
-1
index.tsx
...nce/platformSettlement/accountReceivable/schema/index.tsx
+1
-1
index.tsx
src/pages/balance/platformSettlement/integral/index.tsx
+2
-2
info.tsx
src/pages/balance/platformSettlement/integral/info.tsx
+0
-1
index.tsx
...ages/balance/platformSettlement/integral/schema/index.tsx
+2
-2
index.tsx
src/pages/balance/settleRules/memberSettle/schema/index.tsx
+1
-1
index.tsx
src/pages/balance/settleRules/receipt/index.tsx
+0
-0
info.tsx
src/pages/balance/settleRules/receipt/info.tsx
+3
-1
index.tsx
src/pages/handling/assign/add/index.tsx
+3
-3
index.tsx
src/pages/handling/assign/detail/index.tsx
+1
-1
index.tsx
src/pages/handling/common/index.tsx
+3
-1
content.tsx
src/pages/handling/components/ProcessDetail/content.tsx
+4
-4
index.tsx
src/pages/handling/components/ProcessProducts/index.tsx
+36
-6
schema.tsx
src/pages/handling/components/ProcessProducts/schema.tsx
+13
-2
index.less
src/pages/home/components/UserCenter/index.less
+7
-0
index.tsx
src/pages/home/components/UserCenter/index.tsx
+3
-4
index.less
src/pages/home/index.less
+5
-1
index.tsx
src/pages/home/index.tsx
+0
-5
index.less
src/pages/systemSetting/message/index.less
+11
-0
index.tsx
src/pages/systemSetting/message/index.tsx
+33
-26
No files found.
src/layouts/BasicLayout.tsx
View file @
87449069
...
...
@@ -153,6 +153,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
return
(
<
ProLayout
pageTitleRender=
{
()
=>
currentRouter
?
currentRouter
.
name
:
window
.
location
.
href
}
// contentStyle={{minWidth: '1280px'}}
style=
{
prolayoutStyle
}
logo=
{
logo
}
formatMessage=
{
formatMessage
}
...
...
src/layouts/components/AvatarDropdown.tsx
View file @
87449069
...
...
@@ -5,8 +5,9 @@ import { history, Link } from 'umi';
import
PersonDropdown
from
'./PersonDropdown'
import
styles
from
'../styles/RightContent.less'
;
import
{
removeAuth
,
removeRouters
,
getAuth
}
from
'@/utils/auth'
;
import
{
inject
,
observer
}
from
'mobx-react'
const
AvatarDropdown
=
()
=>
{
const
AvatarDropdown
=
(
props
)
=>
{
const
logout
=
()
=>
{
removeAuth
()
...
...
@@ -16,7 +17,7 @@ const AvatarDropdown = () => {
const
currentUser
=
{
name
:
getAuth
()?.
name
||
'未知用户'
,
avatar
:
'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png
'
,
avatar
:
props
.
UserStore
.
avatar
||
'
'
,
}
const
menuHeaderDropdown
=
(
...
...
@@ -50,4 +51,5 @@ const AvatarDropdown = () => {
)
}
export
default
AvatarDropdown
export
default
inject
(
'UserStore'
)(
observer
(
AvatarDropdown
))
src/layouts/components/RightContent.tsx
View file @
87449069
...
...
@@ -72,7 +72,7 @@ const GlobalHeaderRight: React.FC<{}> = (props) => {
</
Badge
>
</
a
>
</
Tooltip
>
<
Tooltip
title=
"服务"
>
{
/*
<Tooltip title="服务">
<a
target="_blank"
href=""
...
...
@@ -81,7 +81,7 @@ const GlobalHeaderRight: React.FC<{}> = (props) => {
>
<CustomerServiceOutlined />
</a>
</
Tooltip
>
</Tooltip>
*/
}
<
Avatar
/>
</
div
>
);
...
...
src/pages/balance/accountsPayable/settlementList/index.tsx
View file @
87449069
...
...
@@ -72,7 +72,7 @@ const SettlementList = () => {
{
title
:
'结算日期'
,
dataIndex
:
'settlementDate'
},
{
title
:
'结算方式'
,
dataIndex
:
'settlementWayName'
},
{
title
:
'结算方'
,
dataIndex
:
'settlementName'
},
{
title
:
'结算单据'
,
dataIndex
:
'orderTypeName'
},
{
title
:
'结算单据
类型
'
,
dataIndex
:
'orderTypeName'
},
{
title
:
'总单数'
,
dataIndex
:
'totalCount'
},
{
title
:
'结算金额'
,
dataIndex
:
'amount'
},
{
title
:
'结算时间'
,
dataIndex
:
'settlementTime'
},
...
...
src/pages/balance/accountsPayable/settlementList/productNoticeSettlementDetail.tsx
View file @
87449069
...
...
@@ -31,7 +31,7 @@ const columns = [
{
title
:
'单据总额'
,
dataIndex
:
'orderAmount'
},
{
title
:
'收货批次'
,
dataIndex
:
'batch'
},
{
title
:
'收货时间'
,
dataIndex
:
'receiveTime'
},
{
title
:
'收货数量'
,
dataIndex
:
'receive
Time
'
},
{
title
:
'收货数量'
,
dataIndex
:
'receive
Count
'
},
// {title: '加工单价', dataIndex: 'processPrice'},
{
title
:
'结算金额'
,
dataIndex
:
'settlementAmount'
},
]
...
...
src/pages/balance/accountsReceivable/invoice/index.tsx
View file @
87449069
...
...
@@ -144,8 +144,16 @@ const SettlementList = () => {
return
data
}
const
reload
=
(
values
)
=>
{
ref
.
current
.
reload
(
values
);
/**
* 搜索
*/
const
handleSearch
=
(
values
)
=>
{
const
format
=
'YYYY-MM-DD'
const
payStartTime
=
values
.
payStartTime
?.
format
(
format
);
const
payEndTime
=
values
.
payEndTime
?.
format
(
format
);
const
orderStartTime
=
values
.
orderStartTime
?.
format
(
format
);
const
orderEndTime
=
values
.
orderEndTime
?.
format
(
format
);
ref
.
current
.
reload
({...
values
,
payStartTime
,
payEndTime
,
orderStartTime
,
orderEndTime
});
}
return
(
...
...
@@ -182,8 +190,13 @@ const SettlementList = () => {
);
}
}
schema=
{
schema
}
onSubmit=
{
reload
}
onSubmit=
{
handleSearch
}
onReset=
{
()
=>
{
formActions
.
setFieldValue
(
'payStartTime'
,
null
);
formActions
.
setFieldValue
(
'payEndTime'
,
null
);
formActions
.
setFieldValue
(
'orderStartTime'
,
null
);
formActions
.
setFieldValue
(
'orderEndTime'
,
null
);
}
}
/>
}
/>
...
...
src/pages/balance/accountsReceivable/invoice/schema/index.tsx
View file @
87449069
...
...
@@ -29,7 +29,7 @@ export const schema: ISchema = {
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'搜索'
,
placeholder
:
'搜索
订单号
'
,
},
},
},
...
...
@@ -43,7 +43,7 @@ export const schema: ISchema = {
},
},
properties
:
{
desc
:
{
orderAbstract
:
{
type
:
'string'
,
default
:
undefined
,
'x-component-props'
:
{
...
...
src/pages/balance/platformSettlement/accountReceivable/index.tsx
View file @
87449069
...
...
@@ -159,7 +159,7 @@ const AccountReceivable = () => {
expressionScope=
{
{}
}
components=
{
{
DatePicker
}
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'megaLayout.settlementN
ame
'
,
FORM_FILTER_PATH
);
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'megaLayout.settlementN
o
'
,
FORM_FILTER_PATH
);
useAsyncSelect
(
[
'status'
],
fetchOptions
(
PublicApi
.
getSettleAccountsCommonGetSettlementStatus
),
...
...
src/pages/balance/platformSettlement/accountReceivable/schema/index.tsx
View file @
87449069
...
...
@@ -13,7 +13,7 @@ export const schema: ISchema = {
type
:
'object'
,
'x-component'
:
'mega-layout'
,
properties
:
{
settlementN
ame
:
{
settlementN
o
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
...
...
src/pages/balance/platformSettlement/integral/index.tsx
View file @
87449069
...
...
@@ -55,7 +55,7 @@ const Integral: React.FC = () => {
title
:
'兑换比率'
,
dataIndex
:
'ratio'
,
render
:
(
text
,
record
)
=>
{
return
(
record
.
ratio
*
100
+
"%"
);
return
(
record
.
ratio
+
"%"
);
}
},
{
title
:
'结算金额'
,
dataIndex
:
'amount'
},
...
...
@@ -160,7 +160,7 @@ const Integral: React.FC = () => {
components=
{
{
DatePicker
}
}
expressionScope=
{
{}
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'megaLayout.
name
'
,
FORM_FILTER_PATH
);
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'megaLayout.
settlementNo
'
,
FORM_FILTER_PATH
);
useAsyncSelect
(
[
'status'
],
fetchOptions
(
PublicApi
.
getSettleAccountsCommonGetSettlementStatus
),
...
...
src/pages/balance/platformSettlement/integral/info.tsx
View file @
87449069
...
...
@@ -72,7 +72,6 @@ const Info: React.FC = () => {
* 搜索
*/
const
handleSearch
=
(
values
)
=>
{
console
.
log
(
values
);
const
format
=
'YYYY-MM-DD'
const
{
payTime
,
orderTime
,
...
rest
}
=
values
;
// 支付时间
...
...
src/pages/balance/platformSettlement/integral/schema/index.tsx
View file @
87449069
...
...
@@ -18,11 +18,11 @@ export const schema: ISchema = {
type
:
'object'
,
'x-component'
:
'mega-layout'
,
properties
:
{
name
:
{
settlementNo
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'搜索'
,
placeholder
:
'搜索
结算单号
'
,
align
:
'flex-left'
,
// tip: '输入通知单号、通知单摘要进行搜索',
},
...
...
src/pages/balance/settleRules/memberSettle/schema/index.tsx
View file @
87449069
...
...
@@ -33,7 +33,7 @@ export const indexSchema = {
"span"
:
2
},
'x-component-props'
:
{
placeholder
:
'搜索'
,
placeholder
:
'搜索
策略名称
'
,
advanced
:
false
,
},
},
...
...
src/pages/balance/settleRules/receipt/index.tsx
View file @
87449069
src/pages/balance/settleRules/receipt/info.tsx
View file @
87449069
...
...
@@ -160,7 +160,9 @@ const Info: React.FC = () => {
}
return
(
<
PageHeaderWrapper
>
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
>
<
Card
>
<
NiceForm
components=
{
{
SchemaSwitch
,
SchemaRadio
}
}
...
...
src/pages/handling/assign/add/index.tsx
View file @
87449069
...
...
@@ -356,9 +356,9 @@ const Add: React.FC<{}> = () => {
category
:
item
.
customerCategoryName
,
brand
:
item
.
brandName
,
unit
:
item
.
unitName
,
processNum
:
item
.
processNum
||
0
,
processPrice
:
item
.
processUnitPrice
||
0
,
processTotalPrice
:
item
.
processTotalPrice
,
processNum
:
item
.
processNum
*
1
||
0
,
processPrice
:
item
.
processUnitPrice
*
1
||
0
,
processTotalPrice
:
item
.
processTotalPrice
*
1
,
deliveryDate
:
deliveryDateFormat
,
property
:{
specs
:
item
.
productProps
||
[],
...
...
src/pages/handling/assign/detail/index.tsx
View file @
87449069
...
...
@@ -244,7 +244,7 @@ const Detail: React.FC<{}> = () => {
const
AllReceiptReceive
=
(
<
Space
direction=
{
"vertical"
}
>
{
hasProductNoReply
!
hasProductNoReply
?
<
Popconfirm
title=
{
'确认本单全部发货单是否已全部收到回单'
}
onConfirm=
{
()
=>
handleAllReceiptReceive
(
true
)
}
...
...
src/pages/handling/common/index.tsx
View file @
87449069
...
...
@@ -180,7 +180,9 @@ export const SUPPLIER_INNER_STATUS_COLOR = {
"3"
:
"processing"
,
'4'
:
'processing'
,
"5"
:
"success"
,
"7"
:
"processing"
,
"6"
:
"processing"
,
"7"
:
"warning"
,
"8"
:
"processing"
,
"9"
:
"error"
,
"10"
:
"success"
,
}
...
...
src/pages/handling/components/ProcessDetail/content.tsx
View file @
87449069
...
...
@@ -29,8 +29,8 @@ const schema = {
message
:
'请填写加工数量'
},
{
pattern
:
/^
[
1-9
][
0-9
]
*
(\.[
0-9
]{1,
2
})?
$/
,
message
:
'请填写整数或保留
两
位小数'
pattern
:
/^
[
1-9
][
0-9
]
*
(\.[
0-9
]{1,
3
})?
$/
,
message
:
'请填写整数或保留
三
位小数'
}
]
},
...
...
@@ -43,8 +43,8 @@ const schema = {
message
:
'请填写加工单价'
},
{
pattern
:
/^
[
1-9
][
0-9
]
*
(\.[
0-9
]{1,
2
})?
$/
,
message
:
'请填写整数或保留
两
位小数'
pattern
:
/^
[
1-9
][
0-9
]
*
(\.[
0-9
]{1,
3
})?
$/
,
message
:
'请填写整数或保留
三
位小数'
}
]
}
...
...
src/pages/handling/components/ProcessProducts/index.tsx
View file @
87449069
...
...
@@ -6,6 +6,7 @@ import { BasicForm, TablePagination, SearchForm } from '../ModalForTable'
import
{
createAsyncFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
schema
}
from
'./schema'
;
import
{
getAuth
}
from
'@/utils/auth'
;
import
{
useDebounceFn
}
from
'@umijs/hooks'
;
const
{
onFieldInit$
}
=
FormEffectHooks
...
...
@@ -55,7 +56,15 @@ const ProcessProducts = ({visible, cancel, rowSelection, loading, ...restProps})
const
effects
=
()
=>
{
onFieldInit$
(
'branchId'
).
subscribe
((
fieldState
)
=>
{
PublicApi
.
getProductSelectGetSelectBrand
({
name
:
''
}).
then
(
res
=>
{
changeBrand
({
name
:
''
})
});
onFieldInit$
(
'categoryId'
).
subscribe
((
fieldState
)
=>
{
changeCategory
({
name
:
''
});
})
}
const
changeBrand
=
(
params
)
=>
{
PublicApi
.
getProductSelectGetSelectBrand
(
params
).
then
(
res
=>
{
let
options
=
[]
if
(
res
.
code
===
1000
)
{
options
=
res
.
data
.
map
((
item
)
=>
{
return
{
label
:
item
.
name
,
value
:
item
.
id
}})
...
...
@@ -64,9 +73,9 @@ const ProcessProducts = ({visible, cancel, rowSelection, loading, ...restProps})
state
.
props
[
"x-component-props"
][
"options"
]
=
options
;
})
})
});
onFieldInit$
(
'categoryId'
).
subscribe
((
fieldState
)
=>
{
PublicApi
.
getProductSelectGetSelectCategory
({
name
:
''
}
).
then
(
res
=>
{
}
const
changeCategory
=
(
params
)
=>
{
PublicApi
.
getProductSelectGetSelectCustomerCategory
(
params
).
then
(
res
=>
{
let
options
=
[]
if
(
res
.
code
===
1000
)
{
options
=
res
.
data
.
map
((
item
)
=>
{
return
{
label
:
item
.
name
,
value
:
item
.
id
}})
...
...
@@ -75,9 +84,23 @@ const ProcessProducts = ({visible, cancel, rowSelection, loading, ...restProps})
state
.
props
[
"x-component-props"
][
"options"
]
=
options
;
})
})
})
}
const
filterCategroyOption
=
(
input
,
option
)
=>
{
return
option
.
label
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
0
}
const
onCategory
=
useDebounceFn
((
value
)
=>
{
changeCategory
({
name
:
value
});
},
500
)
const
filterBrandOption
=
(
input
,
option
)
=>
{
return
option
.
label
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
0
}
const
onBrandSearch
=
useDebounceFn
((
value
)
=>
{
changeBrand
({
name
:
value
});
},
500
);
return
(
<
Modal
...
...
@@ -96,7 +119,14 @@ const ProcessProducts = ({visible, cancel, rowSelection, loading, ...restProps})
schema=
{
schema
}
actions=
{
actions
}
effects=
{
effects
}
expressionScope=
{
{
rowSelection
:
rowSelection
,
columns
:
columns
}
}
expressionScope=
{
{
rowSelection
:
rowSelection
,
columns
:
columns
,
filterCategroyOption
:
filterCategroyOption
,
onCategory
:
onCategory
.
run
,
filterBrandOption
:
filterBrandOption
,
onBrandSearch
:
onBrandSearch
.
run
}
}
/>
</
Spin
>
:
null
...
...
src/pages/handling/components/ProcessProducts/schema.tsx
View file @
87449069
...
...
@@ -69,7 +69,14 @@ export const schema = {
style
:
{
width
:
'200px'
,
margin
:
'0 20px 0 0'
}
},
showSearch
:
true
,
optionFilterProp
:
"children"
,
filterOption
:
"{{filterCategroyOption}}"
,
onSearch
:
"{{onCategory}}"
// filterOption: {(input, option) =>
// option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
// }
}
},
branchId
:
{
...
...
@@ -81,7 +88,11 @@ export const schema = {
style
:
{
width
:
'200px'
,
margin
:
'0 20px 0 0'
}
},
showSearch
:
true
,
optionFilterProp
:
"children"
,
filterOption
:
"{{filterBrandOption}}"
,
onSearch
:
"{{onBrandSearch}}"
}
},
queryBtn
:
{
...
...
src/pages/home/components/UserCenter/index.less
View file @
87449069
...
...
@@ -65,6 +65,12 @@
color: #fff;
position: relative;
overflow: hidden;
&:hover {
.upload {
display: block;
}
}
.text {
position: absolute;
top: 50%;
...
...
@@ -73,6 +79,7 @@
margin-left: -4px;
}
.upload {
display: none;
position: absolute;
bottom: 0;
left: 0;
...
...
src/pages/home/components/UserCenter/index.tsx
View file @
87449069
...
...
@@ -37,8 +37,8 @@ const UserCenter: React.FC<Iprops> = (props) => {
const
userAuth
=
getAuth
();
// const hasChangeMemberAuth = userAuth?.urls.includes(EDIT_USER_URL);
// const hasCenterAuth = userAuth?.urls.includes(USER_CENTER_URL);
const
currentRole
=
userAuth
.
roles
.
filter
((
item
)
=>
item
.
memberRoleId
===
userAuth
.
memberRoleId
)
const
[
state
,
dispatch
]
=
useReducer
(
reducer
,
{
loading
:
false
,
logo
:
userAuth
.
logo
})
const
currentRole
=
userAuth
?.
roles
?
.
filter
((
item
)
=>
item
.
memberRoleId
===
userAuth
.
memberRoleId
)
const
[
state
,
dispatch
]
=
useReducer
(
reducer
,
{
loading
:
false
,
logo
:
userAuth
?
.
logo
})
if
(
!
userAuth
)
{
return
null
}
...
...
@@ -60,7 +60,6 @@ const UserCenter: React.FC<Iprops> = (props) => {
if
(
info
.
file
.
status
===
'done'
)
{
const
{
code
,
data
}
=
info
.
file
.
response
if
(
code
===
1000
)
{
console
.
log
(
'upload success'
)
PublicApi
.
postMemberBusinessLogoAdd
({
logo
:
data
})
.
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
...
...
@@ -99,12 +98,12 @@ const UserCenter: React.FC<Iprops> = (props) => {
<
Spin
spinning=
{
state
.
loading
}
>
<
div
className=
{
styles
.
userLogo
}
>
<
div
className=
{
styles
.
randomLogo
}
>
<
Upload
{
...
uploadProps
}
>
{
state
.
logo
?
<
img
src=
{
state
.
logo
||
''
}
className=
{
styles
.
logo
}
/>
:
<
span
className=
{
styles
.
text
}
>
H
</
span
>
}
<
Upload
{
...
uploadProps
}
>
<
span
className=
{
styles
.
upload
}
>
修改
</
span
>
</
Upload
>
</
div
>
...
...
src/pages/home/index.less
View file @
87449069
.container {
display: flex;
flex-direction: row;
min-width: 1
366
px;
min-width: 1
179
px;
.left {
flex: 1;
...
...
@@ -56,3 +56,7 @@
margin-left: 8px;
}
}
@media (max-width: '1280px') {
}
src/pages/home/index.tsx
View file @
87449069
...
...
@@ -53,15 +53,12 @@ const Home: React.FC<{}> = () => {
return
(
<
PageHeaderWrapper
>
<
div
>
<
div
className=
{
styles
.
userGuaid
}
style=
{
{
display
:
visible
?
'none'
:
'none'
}
}
>
<
UseGuaid
/>
</
div
>
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
left
}
>
<
div
className=
{
styles
.
userCenter
}
>
<
UserCenter
/>
</
div
>
<
div
className=
{
styles
.
otherCenters
}
>
{
layout
.
map
((
item
)
=>
{
...
...
@@ -109,8 +106,6 @@ const Home: React.FC<{}> = () => {
</
div
>
</
div
>
</
div
>
</
div
>
</
PageHeaderWrapper
>
)
}
...
...
src/pages/systemSetting/message/index.less
View file @
87449069
...
...
@@ -18,4 +18,15 @@
display: inline-block;
cursor: pointer;
}
.time {
margin-left: 20px;
}
.section {
margin-left: 20px;
display: flex;
flex-direction: row;
align-items: center;
}
}
src/pages/systemSetting/message/index.tsx
View file @
87449069
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
history
}
from
'umi'
;
import
{
Card
,
List
,
Avatar
}
from
'antd'
;
import
{
Card
,
List
,
Avatar
,
Button
}
from
'antd'
;
import
styles
from
'./index.less'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
StatusTag
from
'@/components/StatusTag'
;
...
...
@@ -8,42 +8,33 @@ import { PublicApi } from '@/services/api';
import
moment
from
'moment'
;
import
msg_system
from
'@/assets/imgs/msg_system.png'
import
msg_platform
from
'@/assets/imgs/msg_platform.png'
;
import
{
BookOutlined
,
ReadOutlined
}
from
'@ant-design/icons'
;
const
Message
:
React
.
FC
<
{}
>
=
()
=>
{
const
[
dataSource
,
setDataSource
]
=
useState
<
any
>
(
[]
)
const
pagation
=
{
const
[
dataSource
,
setDataSource
]
=
useState
<
any
>
(
{
totalCount
:
0
,
data
:
[]}
)
const
[
pagination
,
setPagination
]
=
useState
(
{
current
:
1
,
pageSize
:
10
,
}
}
)
useEffect
(()
=>
{
// @ts-ignore
async
function
init
()
{
const
data
=
await
getList
(
pagation
);
setDataSource
(
data
);
}
init
()
getList
(
pagination
)
},
[])
const
getList
=
async
(
params
)
=>
{
///report/message/member/page
const
res
=
await
PublicApi
.
getReportMessageMemberPage
(
params
);
if
(
res
.
code
===
1000
)
{
return
res
.
data
}
return
{
totalCount
:
0
,
data
:
[]
const
getList
=
(
params
)
=>
{
PublicApi
.
getReportMessageMemberPage
(
params
).
then
(({
data
,
code
})
=>
{
if
(
code
===
1000
)
{
setDataSource
(
data
)
}
})
}
const
handlePaginationChange
=
(
page
,
pageSize
)
=>
{
getList
({
page
,
pageSize
})
.
then
((
data
)
=>
{
console
.
log
(
data
);
setDataSource
(
data
);
})
setPagination
({
current
:
page
,
pageSize
});
getList
({
current
:
page
,
pageSize
})
}
const
handleRead
=
(
id
,
url
:
string
)
=>
{
...
...
@@ -56,14 +47,17 @@ const Message: React.FC<{}> = () => {
}
else
{
history
.
push
(
url
);
}
}
else
{
getList
(
pagination
);
}
})
}
const
renderMessage
=
(
data
)
=>
{
const
type
=
data
.
type
return
(
<>
<
StatusTag
type=
{
data
.
type
==
1
?
'primary'
:
'success'
}
title=
{
data
.
type
==
1
?
'系统消息'
:
'平台消息'
}
/>
<
StatusTag
type=
{
type
==
1
?
'primary'
:
'success'
}
title=
{
type
==
1
?
'系统消息'
:
'平台消息'
}
/>
<
span
className=
{
styles
.
messageTitle
}
style=
{
{
minWidth
:
'100px'
,
fontWeight
:
600
,
color
:
!
data
.
status
?
'#303133'
:
'#606266'
,
marginRight
:
"15px"
}
}
>
{
data
.
title
}
</
span
>
<
span
className=
{
styles
.
messageText
}
style=
{
{
color
:
!
data
.
status
?
'#303133'
:
'#606266'
,
marginRight
:
"15px"
}
}
onClick=
{
()
=>
handleRead
(
data
.
id
,
data
.
url
)
}
>
{
data
.
content
}
</
span
>
</>
...
...
@@ -78,6 +72,9 @@ const Message: React.FC<{}> = () => {
<
PageHeaderWrapper
>
<
Card
title=
"消息列表"
extra=
{
(
<
div
><
Button
>
全部已读
</
Button
></
div
>
)
}
>
<
List
itemLayout=
"horizontal"
...
...
@@ -89,7 +86,8 @@ const Message: React.FC<{}> = () => {
size
:
"small"
,
showQuickJumper
:
true
,
total
:
dataSource
.
totalCount
,
showTotal
:
showTotal
showTotal
:
showTotal
,
current
:
pagination
.
current
}
}
renderItem=
{
(
item
:
any
)
=>
(
<
List
.
Item
>
...
...
@@ -97,7 +95,16 @@ const Message: React.FC<{}> = () => {
avatar=
{
<
Avatar
src=
{
item
.
type
==
1
?
msg_system
:
msg_platform
}
/>
}
title=
{
renderMessage
(
item
)
}
/>
<
div
style=
{
{
marginLeft
:
"25px"
}
}
>
{
moment
(
item
.
sendTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
</
div
>
<
div
className=
{
styles
.
section
}
>
{
item
.
status
===
0
?
<
BookOutlined
style=
{
{
fontSize
:
'20px'
,
color
:
'#909090'
}
}
/>
:
<
ReadOutlined
style=
{
{
fontSize
:
'24px'
,
color
:
'#909090'
}
}
/>
}
<
span
className=
{
styles
.
time
}
>
{
moment
(
item
.
sendTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
</
span
>
</
div
>
</
List
.
Item
>
)
}
/>
...
...
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