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
shenshaokai
jinfa-platform
Commits
004f146a
Commit
004f146a
authored
Aug 18, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge
parent
f574a668
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
120 additions
and
116 deletions
+120
-116
index.tsx
src/pages/transaction/components/contractList/index.tsx
+70
-69
index.less
...pages/transaction/components/orderDetailHeader/index.less
+33
-32
index.less
...ages/transaction/components/orderDetailWrapper/index.less
+3
-2
index.tsx
...pages/transaction/components/orderDetailWrapper/index.tsx
+14
-13
No files found.
src/pages/transaction/components/contractList/index.tsx
View file @
004f146a
import
React
from
'react'
;
import
React
from
'react'
;
import
{
FilePdfFilled
,
FileWordFilled
,
FileFilled
}
from
'@ant-design/icons'
;
import
{
FilePdfFilled
,
FileWordFilled
,
FileFilled
}
from
'@ant-design/icons'
;
import
{
PublicApi
}
from
'@/services/api'
import
{
PublicApi
}
from
'@/services/api'
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
interface
ContractItem
{
interface
ContractItem
{
electronicContractUrl
?:
string
;
electronicContractUrl
?:
string
;
electronicContractName
?:
string
;
electronicContractName
?:
string
;
};
};
interface
ContractList
{
interface
ContractList
{
dataSource
:
ContractItem
[];
dataSource
:
ContractItem
[];
};
};
const
IconMap
=
{
const
IconMap
=
{
'.pdf'
:
<
FilePdfFilled
/>
,
'.pdf'
:
<
FilePdfFilled
/>
,
'.doc'
:
<
FileWordFilled
/>
,
'.doc'
:
<
FileWordFilled
/>
,
'.doxc'
:
<
FileWordFilled
/>
,
'.doxc'
:
<
FileWordFilled
/>
,
};
};
const
ContractItem
:
React
.
FC
<
ContractItem
>
=
({
const
ContractItem
:
React
.
FC
<
ContractItem
>
=
({
electronicContractUrl
,
electronicContractUrl
,
electronicContractName
,
electronicContractName
,
})
=>
{
})
=>
{
const
index1
=
electronicContractUrl
.
lastIndexOf
(
'.'
);
const
index1
=
electronicContractUrl
.
lastIndexOf
(
'.'
);
const
suffix
=
electronicContractUrl
.
slice
(
index1
);
const
suffix
=
electronicContractUrl
.
slice
(
index1
);
const
index2
=
electronicContractUrl
.
lastIndexOf
(
'/'
);
const
index2
=
electronicContractUrl
.
lastIndexOf
(
'/'
);
// 如果没有文件名,但是有链接就从链接截取文件名
// 如果没有文件名,但是有链接就从链接截取文件名
const
fileName
=
electronicContractName
?
electronicContractName
:
electronicContractUrl
.
slice
(
index2
+
1
);
const
fileName
=
electronicContractName
?
electronicContractName
:
electronicContractUrl
.
slice
(
index2
+
1
);
const
handleDownload
=
(
name
,
url
)
=>
{
const
handleDownload
=
(
name
,
url
)
=>
{
window
.
location
.
href
=
`/api/order/contractTemplate/downloadContract?contractName=
${
name
}
&contractUrl=
${
url
}
`
;
window
.
location
.
href
=
`/api/order/contractTemplate/downloadContract?contractName=
${
name
}
&contractUrl=
${
url
}
`
;
};
};
return
(
return
(
<
li
className=
{
styles
[
'contractList-item'
]
}
onClick=
{
()
=>
handleDownload
(
fileName
,
electronicContractUrl
)
}
>
<
li
className=
{
styles
[
'contractList-item'
]
}
onClick=
{
()
=>
handleDownload
(
fileName
,
electronicContractUrl
)
}
>
<
a
>
<
a
>
<
div
className=
{
styles
[
'contractList-item-icon'
]
}
>
<
div
className=
{
styles
[
'contractList-item-icon'
]
}
>
{
IconMap
[
suffix
]
||
<
FileFilled
/>
}
{
IconMap
[
suffix
]
||
<
FileFilled
/>
}
</
div
>
</
div
>
<
div
<
div
className=
{
styles
[
'contractList-item-name'
]
}
className=
{
styles
[
'contractList-item-name'
]
}
title=
{
fileName
}
title=
{
fileName
}
>
>
{
fileName
}
{
fileName
}
</
div
>
</
div
>
</
a
>
</
a
>
</
li
>
</
li
>
);
);
};
};
const
ContractList
:
React
.
FC
<
ContractList
>
=
({
dataSource
})
=>
{
const
ContractList
:
React
.
FC
<
ContractList
>
=
({
dataSource
})
=>
{
if
(
!
Array
.
isArray
(
dataSource
))
{
if
(
!
Array
.
isArray
(
dataSource
))
{
return
<
div
className=
{
styles
.
noData
}
>
没有相关数据~
</
div
>;
return
<
div
className=
{
styles
.
noData
}
>
没有相关数据~
</
div
>;
}
}
return
(
return
(
<
ul
className=
{
styles
.
contractList
}
>
<
ul
className=
{
styles
.
contractList
}
>
{
dataSource
.
map
((
item
,
index
)
=>
(
{
dataSource
.
map
((
item
,
index
)
=>
(
<
ContractItem
<
ContractItem
key=
{
index
}
key=
{
index
}
electronicContractUrl=
{
item
.
electronicContractUrl
}
electronicContractUrl=
{
item
.
electronicContractUrl
}
electronicContractName=
{
item
.
electronicContractName
}
electronicContractName=
{
item
.
electronicContractName
}
/>
/>
))
}
))
}
</
ul
>
</
ul
>
);
);
};
};
export
default
ContractList
;
export
default
ContractList
;
\ No newline at end of file
src/pages/transaction/components/orderDetailHeader/index.less
View file @
004f146a
.titleAvator {
.titleAvator {
width:48px;
width:48px;
height:48px;
height:48px;
background:rgba(135,119,217,1);
background:rgba(135,119,217,1);
border-radius:4px;
border-radius:4px;
border:1px solid rgba(223,225,230,1);
border:1px solid rgba(223,225,230,1);
line-height: 48px;
line-height: 48px;
text-align: center;
text-align: center;
color: #fff;
color: #fff;
margin: 0 24px;
margin: 0 24px;
}
}
.titleAvatorText {
.titleAvatorText {
color: #303133;
color: #303133;
font-size: 18px;
font-size: 18px;
line-height: 20px;
line-height: 20px;
}
}
.detailHeader {
.detailHeader {
background: #fff;
background: #fff;
padding: 24px;
padding: 24px;
}
}
.detailCol {
.detailCol {
display: flex;
display: flex;
margin-top: 20px;
margin-top: 20px;
color: #303133;
color: #303133;
}
}
.colLabel {
.colLabel {
color: #909399;
color: #909399;
margin-right: 16px;
margin-right: 16px;
}
}
\ No newline at end of file
src/pages/transaction/components/orderDetailWrapper/index.less
View file @
004f146a
.wrapper {
.wrapper {
padding: 24px;
padding: 24px;
}
}
\ No newline at end of file
src/pages/transaction/components/orderDetailWrapper/index.tsx
View file @
004f146a
import
React
from
'react'
import
React
from
'react'
import
style
from
'./index.less'
import
style
from
'./index.less'
export
interface
OrderDetailWrapperProps
{}
export
interface
OrderDetailWrapperProps
{}
const
OrderDetailWrapper
:
React
.
FC
<
OrderDetailWrapperProps
>
=
(
props
)
=>
{
const
OrderDetailWrapper
:
React
.
FC
<
OrderDetailWrapperProps
>
=
(
props
)
=>
{
return
(
return
(
<
div
className=
{
style
.
wrapper
}
>
{
props
.
children
}
</
div
>
<
div
className=
{
style
.
wrapper
}
>
{
props
.
children
}
</
div
>
)
)
}
}
OrderDetailWrapper
.
defaultProps
=
{}
OrderDetailWrapper
.
defaultProps
=
{}
export
default
OrderDetailWrapper
export
default
OrderDetailWrapper
\ No newline at end of file
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