luobisheng
2022-11-16 13e9ddabf4ba3a89aa2a93fe8d3b35c8604c6813
获取文件名字修改
2个文件已修改
12 ■■■■ 已修改文件
src/utils/helper.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/systemSetting/platform/cockpitManage/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/helper.js
@@ -49,15 +49,15 @@
// data: 文件, contentDisposition:请求头中文件的名字
// 默认不用修改,直接将返回的res传入即可
export function downloadFile(res) {
    const blob = new Blob([res.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
    const fileName = res.contentDisposition.split('=')[1];
    const blob = new Blob([res.data], { type: '.xlsx' });
    const fileName = res.contentDisposition.split(`''`)[1];
    if (window.navigator && window.navigator.msSaveBlob) {
        navigator.msSaveBlob(blob, `${new Date().getTime()}`);
        navigator.msSaveBlob(blob, fileName);
    } else {
        const link = document.createElement('a');
        link.style.display = 'none';
        link.href = URL.createObjectURL(blob);
        link.setAttribute('download', decodeURI(`${new Date().getTime()}`));
        link.setAttribute('download', decodeURI(fileName));
        document.body.appendChild(link);
        link.click();
        URL.revokeObjectURL(link.href);
src/views/systemSetting/platform/cockpitManage/index.vue
@@ -143,8 +143,8 @@
    data() {
        return {
            updateDepartmentData: null,
            searchDepartment: '',
            searchStatus: '',
            searchDepartment: null,
            searchStatus: null,
            dialogUpdate: false,
            dialogcheck: false,
            tableData: [],