diff --git a/g.rar b/dist.rar similarity index 80% rename from g.rar rename to dist.rar index 0eda9f1..4f5c346 100644 Binary files a/g.rar and b/dist.rar differ diff --git a/m.rar b/m.rar new file mode 100644 index 0000000..6fb0191 Binary files /dev/null and b/m.rar differ diff --git a/src/api/admin/line-symbol.js b/src/api/admin/line-symbol.js index 4a8940d..e97249e 100644 --- a/src/api/admin/line-symbol.js +++ b/src/api/admin/line-symbol.js @@ -51,4 +51,20 @@ export function getSameSymbol(params) { params }) } +// 导出交易对 +export function exportSymbols(params) { + return request({ + url: '/api/v1/line-symbol/export', + method: 'get', + responseType: 'blob', + params + }) +} +export function symbolAll(params) { + return request({ + url: '/api/v1/line-symbol/all', + method: 'get', + params + }) +} diff --git a/src/utils/request.js b/src/utils/request.js index 9e57218..70b1ae1 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -44,6 +44,9 @@ service.interceptors.response.use( * You can also judge the status by HTTP Status Code */ response => { + if (['blob'].includes(response.config.responseType)) { + return response.data + } const code = response.data.code if (code === 401) { store.dispatch('user/resetToken') diff --git a/src/utils/zipdownload.js b/src/utils/zipdownload.js index 6f44c9b..9acdc8a 100644 --- a/src/utils/zipdownload.js +++ b/src/utils/zipdownload.js @@ -32,17 +32,15 @@ export function downLoadFile(str) { * @param {*} res blob响应内容 * @param {String} mimeType MIME类型 */ -export function resolveBlob(res, mimeType) { +export function resolveBlob(res, name, mimeType) { const aLink = document.createElement('a') - var blob = new Blob([res.data], { type: mimeType }) + var blob = new Blob([res], { type: mimeType || 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }) // //从response的headers中获取filename, 后端response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 设置的文件名; - var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*') - var contentDisposition = decodeURI(res.headers['content-disposition']) - var result = patt.exec(contentDisposition) - var fileName = result[1] - fileName = fileName.replace(/\"/g, '') + // var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*') + // var contentDisposition = decodeURI(res.headers['content-disposition']) + // var result = patt.exec(contentDisposition) aLink.href = URL.createObjectURL(blob) - aLink.setAttribute('download', fileName) // 设置下载文件名称 + aLink.setAttribute('download', name) // 设置下载文件名称 document.body.appendChild(aLink) aLink.click() document.body.appendChild(aLink) diff --git a/src/views/admin/line-order/index.vue b/src/views/admin/line-order/index.vue index 86d8d2e..9f205ed 100644 --- a/src/views/admin/line-order/index.vue +++ b/src/views/admin/line-order/index.vue @@ -84,6 +84,32 @@ /> + + + + + + + + - - - - + + + + + + + + - - - - - + - - - - 现货 - 合约 - - - - - 输入 - 选择 - - - - - -
- + + 现货 + 合约 + + + + + 输入 + 选择 + + + + + -
-
-
- - - - - @@ -224,7 +227,7 @@