Commit 50d5e226 authored by 田翔's avatar 田翔

fix: 文件流设置参数

parent 12c6e778
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "4.5.2", "version": "4.5.3",
"description": "4.5.2 下拉站点选择器默认选择第一个", "description": "4.5.3 文件流设置参数",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -284,14 +284,22 @@ export function ExportAccountData({ accountName, ids, exportAll }) { ...@@ -284,14 +284,22 @@ export function ExportAccountData({ accountName, ids, exportAll }) {
return request({ return request({
url: `${BASEURL}/ExportAccountData?accountName=${accountName}&ids=${ids}&exportAll=${exportAll}`, url: `${BASEURL}/ExportAccountData?accountName=${accountName}&ids=${ids}&exportAll=${exportAll}`,
method: 'get', method: 'get',
headers: {
'Content-Type': 'application/json; charset=UTF-8',
},
responseType: 'blob'
}); });
} }
//导出模板 //导出模板
export function ExportAccountModel({ accountName, exportAll }) { export function ExportAccountModel({ accountName, exportAll }) {
return request({ return request({
url: `${BASEURL}/ExportAccountData?accountName=${accountName}&exportAll=${exportAll}`, url: `${BASEURL}/ExportAccountModel?accountName=${accountName}&exportAll=${exportAll}`,
method: 'get', method: 'get',
headers: {
'Content-Type': 'application/json; charset=UTF-8',
},
responseType: 'blob'
}); });
} }
......
...@@ -167,12 +167,7 @@ const Account = (props, ref) => { ...@@ -167,12 +167,7 @@ const Account = (props, ref) => {
}) })
} }
const exportTemplate = ({ exportAll }) => { const exportTemplate = async ({ exportAll }) => {
Modal.confirm({
icon: <ExclamationCircleOutlined />,
content: keys.length > 0 ? `共选择${keys.length}条数据,确定要导出吗` : '确定要导出全部数据吗?',
onOk: async () => {
return await new Promise(async (resolve, reject) => {
let res = await ExportAccountModel({ accountName: accountName, exportAll }) let res = await ExportAccountModel({ accountName: accountName, exportAll })
if (res && res.code === -1) { if (res && res.code === -1) {
message.error(res.msg) message.error(res.msg)
...@@ -182,16 +177,11 @@ const Account = (props, ref) => { ...@@ -182,16 +177,11 @@ const Account = (props, ref) => {
const a = document.createElement('a') const a = document.createElement('a')
a.href = url a.href = url
a.target = '_blank' a.target = '_blank'
a.download = '数据文件.xls' a.download = '模板文件.xls'
a.click() a.click()
a.remove() a.remove()
resolve() resolve()
} }
})
},
okText: '确定',
cancelText: '取消',
})
} }
const saveClick = (field, formJson, values, type) => { const saveClick = (field, formJson, values, type) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment