|
@@ -1,4 +1,4 @@
|
|
|
-import React, { useState } from 'react'
|
|
|
|
|
|
|
+import React, { useEffect, useState, useRef } from 'react'
|
|
|
import { Tag, Select, Tooltip, Input, DatePicker, Button } from 'antd'
|
|
import { Tag, Select, Tooltip, Input, DatePicker, Button } from 'antd'
|
|
|
import ProTable from '@ant-design/pro-table'
|
|
import ProTable from '@ant-design/pro-table'
|
|
|
import consts from '@/consts'
|
|
import consts from '@/consts'
|
|
@@ -63,7 +63,8 @@ const longleStatusNum = {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const LockStore = ({ prodList = [], dispatch }) => {
|
|
|
|
|
|
|
+const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
|
|
|
|
|
+ const tRef = useRef()
|
|
|
const [selectKeys] = useState([])
|
|
const [selectKeys] = useState([])
|
|
|
const { toggleDrawer, setDrawerProps, toggleModal, setModalProps } = useModal()
|
|
const { toggleDrawer, setDrawerProps, toggleModal, setModalProps } = useModal()
|
|
|
const showReceiveLockModal = () => {
|
|
const showReceiveLockModal = () => {
|
|
@@ -92,6 +93,18 @@ const LockStore = ({ prodList = [], dispatch }) => {
|
|
|
const handleSearch = value => {
|
|
const handleSearch = value => {
|
|
|
setState({ ...state, params: { ...state.params, search: value } })
|
|
setState({ ...state, params: { ...state.params, search: value } })
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 刷新
|
|
|
|
|
+ const refreshData = () => {
|
|
|
|
|
+ tRef.current.reload()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ if (shouldUpdate) {
|
|
|
|
|
+ tRef.current.reload()
|
|
|
|
|
+ }
|
|
|
|
|
+ }, [shouldUpdate])
|
|
|
|
|
+
|
|
|
// 展示drawer
|
|
// 展示drawer
|
|
|
const showDrawer = id => {
|
|
const showDrawer = id => {
|
|
|
setDrawerProps({
|
|
setDrawerProps({
|
|
@@ -251,6 +264,7 @@ const LockStore = ({ prodList = [], dispatch }) => {
|
|
|
rowKey={record => record.id}
|
|
rowKey={record => record.id}
|
|
|
search={false}
|
|
search={false}
|
|
|
bordered
|
|
bordered
|
|
|
|
|
+ actionRef={tRef}
|
|
|
params={state.params}
|
|
params={state.params}
|
|
|
columns={columns}
|
|
columns={columns}
|
|
|
onLoadingChange={loadingStatus => {
|
|
onLoadingChange={loadingStatus => {
|
|
@@ -326,6 +340,7 @@ const LockStore = ({ prodList = [], dispatch }) => {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export default connect(({ lock }) => ({
|
|
|
|
|
- prodList: lock.prodList
|
|
|
|
|
|
|
+export default connect(({ lock, refresh }) => ({
|
|
|
|
|
+ prodList: lock.prodList,
|
|
|
|
|
+ shouldUpdate: refresh.longle
|
|
|
}))(LockStore)
|
|
}))(LockStore)
|