Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
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
zhaochengxiang
szse
Commits
76541f33
Commit
76541f33
authored
Mar 28, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导入日志增加文件列 增加刷新
parent
2e7d2114
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
7 deletions
+90
-7
ImportStockWordDrawer.jsx
src/view/Manage/Model/Component/ImportStockWordDrawer.jsx
+90
-7
No files found.
src/view/Manage/Model/Component/ImportStockWordDrawer.jsx
View file @
76541f33
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Button
,
Upload
,
Drawer
,
Table
,
Pagination
,
Divider
,
Form
}
from
'antd'
;
import
{
Button
,
Upload
,
Drawer
,
Table
,
Pagination
,
Divider
,
Form
,
Tooltip
,
Typography
}
from
'antd'
;
import
{
UploadOutlined
}
from
'@ant-design/icons'
;
import
{
UploadOutlined
}
from
'@ant-design/icons'
;
import
{
Resizable
}
from
'react-resizable'
;
import
ResizeObserver
from
'rc-resize-observer'
;
import
{
dispatch
,
dispatchLatest
}
from
'../../../../model'
;
import
{
dispatch
,
dispatchLatest
}
from
'../../../../model'
;
import
{
showMessage
,
formatDate
}
from
'../../../../util'
;
import
{
showMessage
,
formatDate
}
from
'../../../../util'
;
const
{
Text
}
=
Typography
;
const
ResizeableHeaderCell
=
props
=>
{
const
{
onResize
,
width
,
onClick
,
...
restProps
}
=
props
;
if
(
!
width
)
{
return
<
th
{
...
restProps
}
/>;
}
return
(
<
Resizable
width=
{
width
}
height=
{
0
}
handle=
{
<
span
className=
"react-resizable-handle"
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
}
}
/>
}
onResize=
{
onResize
}
draggableOpts=
{
{
enableUserSelectHack
:
false
}
}
>
<
th
onClick=
{
onClick
}
{
...
restProps
}
/>
</
Resizable
>
);
};
const
ImportStockWordModal
=
(
props
)
=>
{
const
ImportStockWordModal
=
(
props
)
=>
{
const
{
onCancel
,
onSuccess
,
visible
,
catalogId
}
=
props
;
const
{
onCancel
,
onSuccess
,
visible
,
catalogId
}
=
props
;
const
[
fileList
,
setFileList
]
=
useState
([]);
const
[
fileList
,
setFileList
]
=
useState
([]);
...
@@ -16,7 +50,7 @@ const ImportStockWordModal = (props) => {
...
@@ -16,7 +50,7 @@ const ImportStockWordModal = (props) => {
const
{
pageNum
,
pageSize
}
=
pagination
;
const
{
pageNum
,
pageSize
}
=
pagination
;
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
total
,
setTotal
]
=
useState
(
0
);
const
col
umn
s
=
[
const
cols
=
[
{
{
title
:
'序号'
,
title
:
'序号'
,
dataIndex
:
'key'
,
dataIndex
:
'key'
,
...
@@ -26,9 +60,20 @@ const ImportStockWordModal = (props) => {
...
@@ -26,9 +60,20 @@ const ImportStockWordModal = (props) => {
width
:
60
,
width
:
60
,
},
},
{
{
title
:
'导入文件名'
,
dataIndex
:
'fileName'
,
width
:
200
,
ellipsis
:
true
,
render
:
(
text
,
_
,
__
)
=>
{
return
<
Tooltip
title=
{
text
||
''
}
>
<
Text
ellipsis=
{
true
}
>
{
text
||
''
}
</
Text
>
</
Tooltip
>
}
},
{
title
:
'开始时间'
,
title
:
'开始时间'
,
dataIndex
:
'startTime'
,
dataIndex
:
'startTime'
,
width
:
20
0
,
width
:
17
0
,
ellipsis
:
true
,
ellipsis
:
true
,
render
:
(
_
,
record
,
__
)
=>
{
render
:
(
_
,
record
,
__
)
=>
{
return
formatDate
(
record
.
startTime
);
return
formatDate
(
record
.
startTime
);
...
@@ -37,7 +82,7 @@ const ImportStockWordModal = (props) => {
...
@@ -37,7 +82,7 @@ const ImportStockWordModal = (props) => {
{
{
title
:
'结束时间'
,
title
:
'结束时间'
,
dataIndex
:
'endTime'
,
dataIndex
:
'endTime'
,
width
:
20
0
,
width
:
17
0
,
ellipsis
:
true
,
ellipsis
:
true
,
render
:
(
_
,
record
,
__
)
=>
{
render
:
(
_
,
record
,
__
)
=>
{
return
formatDate
(
record
.
endTime
);
return
formatDate
(
record
.
endTime
);
...
@@ -65,6 +110,8 @@ const ImportStockWordModal = (props) => {
...
@@ -65,6 +110,8 @@ const ImportStockWordModal = (props) => {
}
}
]
]
const
[
columns
,
setColumns
]
=
useState
(
cols
);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
visible
)
{
if
(
visible
)
{
...
@@ -96,6 +143,10 @@ const ImportStockWordModal = (props) => {
...
@@ -96,6 +143,10 @@ const ImportStockWordModal = (props) => {
})
})
}
}
const
onRefreshClick
=
()
=>
{
getLogs
();
}
const
uploadProps
=
{
const
uploadProps
=
{
onRemove
:
file
=>
{
onRemove
:
file
=>
{
...
@@ -148,12 +199,36 @@ const ImportStockWordModal = (props) => {
...
@@ -148,12 +199,36 @@ const ImportStockWordModal = (props) => {
setFileList
([]);
setFileList
([]);
}
}
const
handleResize
=
index
=>
(
e
,
{
size
})
=>
{
const
nextColumns
=
[...
columns
];
nextColumns
[
index
]
=
{
...
nextColumns
[
index
],
width
:
size
.
width
,
};
setColumns
(
nextColumns
);
};
const
mergedColumns
=
()
=>
{
return
(
columns
.
map
((
column
,
index
)
=>
{
return
{
...
column
,
onHeaderCell
:
column
=>
({
width
:
column
.
width
,
onResize
:
handleResize
(
index
),
}),
};
})
);
}
return
(
return
(
<
Drawer
<
Drawer
forceRender
forceRender
visible=
{
visible
}
visible=
{
visible
}
title=
'存量模型导入'
title=
'存量模型导入'
width=
{
9
00
}
width=
{
10
00
}
placement=
"right"
placement=
"right"
closable=
{
true
}
closable=
{
true
}
onClose=
{
()
=>
{
onClose=
{
()
=>
{
...
@@ -176,10 +251,18 @@ const ImportStockWordModal = (props) => {
...
@@ -176,10 +251,18 @@ const ImportStockWordModal = (props) => {
</
Form
.
Item
>
</
Form
.
Item
>
</
Form
>
</
Form
>
</
div
>
</
div
>
<
Divider
orientation=
"left"
>
导入日志
</
Divider
>
<
div
className=
'd-flex my-3'
style=
{
{
justifyContent
:
'space-between'
,
alignItems
:
'center'
}
}
>
<
h3
style=
{
{
marginBottom
:
0
}
}
>
导入日志
</
h3
>
<
Button
onClick=
{
onRefreshClick
}
>
刷新
</
Button
>
</
div
>
<
Table
<
Table
className=
'mt-3'
className=
'mt-3'
columns=
{
columns
||
[]
}
components=
{
{
header
:
{
cell
:
ResizeableHeaderCell
,
}
}
}
columns=
{
mergedColumns
()
}
rowKey=
{
'id'
}
rowKey=
{
'id'
}
dataSource=
{
logs
||
[]
}
dataSource=
{
logs
||
[]
}
pagination=
{
false
}
pagination=
{
false
}
...
...
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