|
|
@@ -5,7 +5,7 @@ import { useDispatch, useSelector } from 'react-redux'
|
|
|
import { selectTopBase } from '@/pages/Zother/SelectGoods/data'
|
|
|
import { getKuListByOpenFu } from '@/pages/Zother/data'
|
|
|
import { ziyuanAcGet, ziyuanAcSet } from '@/utils/storage'
|
|
|
-import { APIdelTable, B1_APIgetList } from '@/store/action/Bresource/B1overview'
|
|
|
+import { APIdelTable, APIdownXlsx, B1_APIgetList } from '@/store/action/Bresource/B1overview'
|
|
|
import { RootState } from '@/store'
|
|
|
import { Button, Cascader, Input, Select } from 'antd'
|
|
|
import { Z1_APIgetFormZiDuan } from '@/store/action/Zsystem/Z1sysSet'
|
|
|
@@ -16,6 +16,7 @@ import { MessageFu } from '@/utils/message'
|
|
|
import Z0sonTable from '@/components/Z0sonTable'
|
|
|
import { openLink } from '@/utils/history'
|
|
|
import MyPopconfirm from '@/components/MyPopconfirm'
|
|
|
+import { downloadFileByUrl } from '@/utils'
|
|
|
function B1overview() {
|
|
|
const [kuList, setKuList] = useState<antdSelectType[]>([])
|
|
|
|
|
|
@@ -196,6 +197,19 @@ function B1overview() {
|
|
|
]
|
|
|
}, [formData.formDefId, tableBtnFu])
|
|
|
|
|
|
+ // 点击下载模版
|
|
|
+ const downXlsxFu = useCallback(async () => {
|
|
|
+ if (formData.formDefId) {
|
|
|
+ const res = await APIdownXlsx(formData.formDefId)
|
|
|
+ if (res.code === 0) {
|
|
|
+ let fileName: any = undefined
|
|
|
+ const obj = kuList.find(v => v.value === formData.formDefId)
|
|
|
+ if (obj) fileName = obj.label
|
|
|
+ downloadFileByUrl(res.data, fileName)
|
|
|
+ }
|
|
|
+ } else MessageFu.warning('资源库表ID错误')
|
|
|
+ }, [formData.formDefId, kuList])
|
|
|
+
|
|
|
return (
|
|
|
<div className={styles.B1overview}>
|
|
|
<div className='pageTitle'>资源总览</div>
|
|
|
@@ -217,6 +231,7 @@ function B1overview() {
|
|
|
options={kuList}
|
|
|
/>
|
|
|
<div className='Z0ku1'>
|
|
|
+ <Button onClick={downXlsxFu}>下载模版</Button>
|
|
|
<Button type='primary' onClick={() => MessageFu.warning('开发中')}>
|
|
|
数据导入
|
|
|
</Button>
|