|
@@ -11,7 +11,9 @@ import {
|
|
|
API_getImportResult,
|
|
API_getImportResult,
|
|
|
API_deleteImportResult,
|
|
API_deleteImportResult,
|
|
|
API_getImportExcelResult,
|
|
API_getImportExcelResult,
|
|
|
- API_deleteImportExcelResult
|
|
|
|
|
|
|
+ API_deleteImportExcelResult,
|
|
|
|
|
+ API_getFileLog,
|
|
|
|
|
+ API_saveFileLog
|
|
|
} from '@/store/action/Cledger/C1ledger'
|
|
} from '@/store/action/Cledger/C1ledger'
|
|
|
import { importDataTableC } from '@/utils/tableData'
|
|
import { importDataTableC } from '@/utils/tableData'
|
|
|
import { Button, Radio } from 'antd'
|
|
import { Button, Radio } from 'antd'
|
|
@@ -19,6 +21,8 @@ import { MessageFu } from '@/utils/message'
|
|
|
import { baseURL } from '@/utils/http'
|
|
import { baseURL } from '@/utils/http'
|
|
|
import C1ImportRes from '../C1ImportRes'
|
|
import C1ImportRes from '../C1ImportRes'
|
|
|
import C1ImportZipRes from '../C1importZipRes'
|
|
import C1ImportZipRes from '../C1importZipRes'
|
|
|
|
|
+import { downloadFileByUrl } from '@/utils'
|
|
|
|
|
+import DownLog from '@/pages/Zother/DownLog'
|
|
|
|
|
|
|
|
const C1ImportBaseFormData = {
|
|
const C1ImportBaseFormData = {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
@@ -37,6 +41,8 @@ function C1Import({ onClose }: { onClose: () => void }) {
|
|
|
const [isLook, setIsLook] = useState(false)
|
|
const [isLook, setIsLook] = useState(false)
|
|
|
const fileInputRef = useRef<HTMLInputElement>(null)
|
|
const fileInputRef = useRef<HTMLInputElement>(null)
|
|
|
const clickSearchRef = useRef<() => void>(() => {})
|
|
const clickSearchRef = useRef<() => void>(() => {})
|
|
|
|
|
+ // 下载记录参数
|
|
|
|
|
+ const [downLogId, setDownLogId] = useState(0)
|
|
|
const [uploadData, setUploadData] = useState<{
|
|
const [uploadData, setUploadData] = useState<{
|
|
|
visible: boolean
|
|
visible: boolean
|
|
|
result: any | null
|
|
result: any | null
|
|
@@ -263,6 +269,23 @@ function C1Import({ onClose }: { onClose: () => void }) {
|
|
|
<Button size='small' type='text' onClick={() => handleDeleteImportResult(item)}>
|
|
<Button size='small' type='text' onClick={() => handleDeleteImportResult(item)}>
|
|
|
删除记录
|
|
删除记录
|
|
|
</Button>
|
|
</Button>
|
|
|
|
|
+ <br />
|
|
|
|
|
+ <Button
|
|
|
|
|
+ size='small'
|
|
|
|
|
+ type='text'
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ downloadFileByUrl(item.filePath, item.fileName)
|
|
|
|
|
+ API_saveFileLog({
|
|
|
|
|
+ moduleIds: [item.id],
|
|
|
|
|
+ moduleName: isImportData ? 'Excel导入' : '图片导入'
|
|
|
|
|
+ } as any)
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ 下载
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ <Button size='small' type='text' onClick={() => setDownLogId(item.id)}>
|
|
|
|
|
+ 下载记录
|
|
|
|
|
+ </Button>
|
|
|
</>
|
|
</>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
@@ -288,20 +311,31 @@ function C1Import({ onClose }: { onClose: () => void }) {
|
|
|
/>
|
|
/>
|
|
|
)
|
|
)
|
|
|
) : (
|
|
) : (
|
|
|
- <TableList
|
|
|
|
|
- key={isImportData ? 'importExcel' : 'importZip'}
|
|
|
|
|
- baseFormData={C1ImportBaseFormData}
|
|
|
|
|
- getListAPI={isImportData ? API_getImportExcelList : API_getImportZipList}
|
|
|
|
|
- pageKey={isImportData ? 'importExcel' : 'importZip'}
|
|
|
|
|
- tableInfo={isImportData ? importExcelTableInfo : importZipTableInfo}
|
|
|
|
|
- columnsTemp={importDataTableC}
|
|
|
|
|
- rightBtnWidth={'100%'}
|
|
|
|
|
- leftRowWidth={'20%'}
|
|
|
|
|
- yHeight={592}
|
|
|
|
|
- searchDom={[]}
|
|
|
|
|
- storyTableListToprr={storyTableListToprr}
|
|
|
|
|
- storyTableLastBtn={storyTableLastBtn}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <>
|
|
|
|
|
+ <TableList
|
|
|
|
|
+ key={isImportData ? 'importExcel' : 'importZip'}
|
|
|
|
|
+ baseFormData={C1ImportBaseFormData}
|
|
|
|
|
+ getListAPI={isImportData ? API_getImportExcelList : API_getImportZipList}
|
|
|
|
|
+ pageKey={isImportData ? 'importExcel' : 'importZip'}
|
|
|
|
|
+ tableInfo={isImportData ? importExcelTableInfo : importZipTableInfo}
|
|
|
|
|
+ columnsTemp={importDataTableC}
|
|
|
|
|
+ rightBtnWidth={'100%'}
|
|
|
|
|
+ leftRowWidth={'20%'}
|
|
|
|
|
+ yHeight={592}
|
|
|
|
|
+ searchDom={[]}
|
|
|
|
|
+ storyTableListToprr={storyTableListToprr}
|
|
|
|
|
+ storyTableLastBtn={storyTableLastBtn}
|
|
|
|
|
+ />
|
|
|
|
|
+ {/* 下载记录 */}
|
|
|
|
|
+ {downLogId ? (
|
|
|
|
|
+ <DownLog
|
|
|
|
|
+ id={downLogId}
|
|
|
|
|
+ moduleName={isImportData ? 'Excel导入' : '图片导入'}
|
|
|
|
|
+ getListAPI={API_getFileLog as any}
|
|
|
|
|
+ closeFu={() => setDownLogId(0)}
|
|
|
|
|
+ />
|
|
|
|
|
+ ) : null}
|
|
|
|
|
+ </>
|
|
|
)}
|
|
)}
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|