From 99f97b11a334ce482db9aa91fca86dadbaffd716 Mon Sep 17 00:00:00 2001 From: luobisheng <727299681@qq.com> Date: 星期四, 17 十一月 2022 17:40:43 +0800 Subject: [PATCH] 我的代办修改 --- src/utils/helper.js | 29 ++++++++++++++++++++++------- 1 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/utils/helper.js b/src/utils/helper.js index e9853bc..621af9a 100644 --- a/src/utils/helper.js +++ b/src/utils/helper.js @@ -2,7 +2,7 @@ // 娣辨嫹璐� export function deepClone(obj) { let objClone = Array.isArray(obj) ? [] : {}; - if (obj && typeof obj === 'object' && obj != null) { + if (obj && typeof obj === 'object') { for (let key in obj) { if (obj.hasOwnProperty(key)) { if (obj[key] && typeof obj[key] === 'object') { @@ -49,18 +49,18 @@ // data: 鏂囦欢, contentDisposition锛氳姹傚ご涓枃浠剁殑鍚嶅瓧 // 榛樿涓嶇敤淇敼锛岀洿鎺ュ皢杩斿洖鐨剅es浼犲叆鍗冲彲 export function downloadFile(res) { - const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }); - const fileName = res.contentDisposition.split('=')[1]; + const blob = new Blob([res.data], { type: 'application/octet-stream' }); + const fileName = res.contentDisposition.split(`''`)[1]; if (window.navigator && window.navigator.msSaveBlob) { - navigator.msSaveBlob(blob, fileName); + window.navigator.msSaveBlob(blob, fileName); } else { const link = document.createElement('a'); link.style.display = 'none'; - link.href = URL.createObjectURL(blob); - link.setAttribute('download', decodeURI(fileName)); + link.href = window.URL.createObjectURL(blob); + link.download = decodeURI(fileName); document.body.appendChild(link); link.click(); - URL.revokeObjectURL(link.href); + window.URL.revokeObjectURL(link.href); document.body.removeChild(link); } } @@ -120,3 +120,18 @@ } return str + '鍒嗛挓' } + +export const EVENT_SOURCE = [ + { label: '瑙嗛', value: 1 }, + { label: '鎵嬪姩绛夌骇', value: 2 } +] + +export const CATEGOTY = [ + { label: '杩濊', value: 1 }, + { label: '杩濆缓', value: 2 } +] + +export const RESOURCE_TYPE = [ + { label: '涓婃姤', value: '01' }, + { label: '澶勭疆', value: '02' } +] -- Gitblit v1.8.0