diff --git a/config/index.js b/config/index.js index 3b43552..24d6131 100644 --- a/config/index.js +++ b/config/index.js @@ -20,7 +20,7 @@ module.exports = { }, // Various Dev Server settings - host: '192.168.0.118', // can be overwritten by process.env.HOST + host: 'localhost', // can be overwritten by process.env.HOST port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: false, errorOverlay: true, diff --git a/src/views/personStrucManage/components/list.vue b/src/views/personStrucManage/components/list.vue index fb19807..3180bbb 100644 --- a/src/views/personStrucManage/components/list.vue +++ b/src/views/personStrucManage/components/list.vue @@ -152,8 +152,8 @@ import Pagination from '@/components/Pagination' import { requestFN } from '@/utils/request' import waves from '@/directive/waves' -import axios from 'axios' -import moment from 'moment' +// import axios from 'axios' +// import moment from 'moment' export default { components: { Pagination }, @@ -626,37 +626,7 @@ export default { }, // 导出指定数据项至 excel 表格 exportExcelHandler(ids, head) { - return new Promise((resolve, reject) => { - axios - .post( - config.httpurl + '/openApi/excel?' + `ids=${ids}&head=${head}`, - {}, - { - responseType: 'blob' - } - ) - .then(res => { - setTimeout(() => { - const blob = new Blob([res.data], { - type: 'application/vnd.ms-excel' - }) - const downloadElement = document.createElement('a') - const href = window.URL.createObjectURL(blob) - downloadElement.style.display = 'none' - downloadElement.href = href - downloadElement.download = moment().format('YYYY-MM-DD HH:mm:ss') - document.body.appendChild(downloadElement) - downloadElement.click() - document.body.removeChild(downloadElement) - window.URL.revokeObjectURL(href) - resolve(res) - }, 2000) - }) - .catch(e => { - reject(e) - this.$message.error('导出失败,或未查询到隐患') - }) - }) + window.open(`${this.config.httpurl}/openApi/excel?ids=${ids}&head=${head}`) }, // 点击操作打开菜单选择框 openPopover() {