|
|
@@ -1,5 +1,5 @@ |
|
|
|
import { DropboxOutlined, PlusOutlined } from '@ant-design/icons'; |
|
|
|
import { Button, message, Input, Drawer, Modal, Popconfirm } from 'antd'; |
|
|
|
import { DropboxOutlined, PlusOutlined,UploadOutlined } from '@ant-design/icons'; |
|
|
|
import { Button, message, Input, Upload, Modal, Popconfirm } from 'antd'; |
|
|
|
import React, { useState, useRef, useEffect } from 'react'; |
|
|
|
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; |
|
|
|
import ProTable from '@ant-design/pro-table'; |
|
|
@@ -54,6 +54,36 @@ const handleRemove = async (ids) => { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const props = { |
|
|
|
beforeUpload: (file) => { |
|
|
|
if ( |
|
|
|
file.type !== 'application/vnd.ms-excel' && |
|
|
|
file.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|
|
|
) { |
|
|
|
message.error(`${file.name} 不是 exelce 文件`); |
|
|
|
} |
|
|
|
return file.type == 'application/vnd.ms-excel' || |
|
|
|
file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|
|
|
? true |
|
|
|
: Upload.LIST_IGNORE; |
|
|
|
}, |
|
|
|
name: 'file', |
|
|
|
action: '/kitchen/api/goodes/DeviceVersionTemplateImport', |
|
|
|
headers: { |
|
|
|
Authorization:'Bearer ' + localStorage.getItem('token') |
|
|
|
}, |
|
|
|
onChange(info) { |
|
|
|
if (info.file.status !== 'uploading') { |
|
|
|
console.log(info.file, info.fileList); |
|
|
|
} |
|
|
|
if (info.file.status === 'done') { |
|
|
|
message.success(`${info.file.name} file uploaded successfully`); |
|
|
|
} else if (info.file.status === 'error') { |
|
|
|
message.error(`${info.file.name} file upload failed.`); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
* 更新节点 |
|
|
|
* |
|
|
@@ -231,6 +261,20 @@ const bomtechnology = () => { |
|
|
|
> |
|
|
|
<PlusOutlined /> 新建 |
|
|
|
</Button>, |
|
|
|
<Button |
|
|
|
key="primary" |
|
|
|
onClick={async () => { |
|
|
|
|
|
|
|
const link = document.createElement('a'); |
|
|
|
link.href = "https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com//Franchisee/gzaxn@163.com/goods/133458884696092845.xlsx"; |
|
|
|
link.click(); |
|
|
|
}} |
|
|
|
> |
|
|
|
<UploadOutlined /> 下载设备版本工艺模板 |
|
|
|
</Button>, |
|
|
|
<Upload {...props}> |
|
|
|
<Button icon={<UploadOutlined />}>导入工艺模版</Button> |
|
|
|
</Upload> |
|
|
|
]} |
|
|
|
//数据绑定 |
|
|
|
request={async (params) => { |
|
|
|