| | |
| | | import detailUser from "./detailUser"; |
| | | import { deleteTeam, exportTeamInfo, importTeamInfo, searchTeamInfo } from "@/api/system/portal/teamConstruction"; |
| | | import {SUCCESS_CODE} from "@/utils"; |
| | | import {downloadFile} from "@/utils/helper"; |
| | | |
| | | export default { |
| | | components: { updateUser, detailUser }, |
| | |
| | | exportTable() { |
| | | exportTeamInfo({ current: this.currentPage, size: this.pageSize, departName: this.searchDepartment, status: this.searchStatus }) |
| | | .then(res => { |
| | | const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }); |
| | | const fileName = res.contentDisposition.split('=')[1]; |
| | | if (window.navigator && window.navigator.msSaveBlob) { |
| | | navigator.msSaveBlob(blob, fileName); |
| | | } else { |
| | | const link = document.createElement('a'); |
| | | link.style.display = 'none'; |
| | | link.href = URL.createObjectURL(blob); |
| | | link.setAttribute('download', decodeURI(fileName)); |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | URL.revokeObjectURL(link.href); |
| | | document.body.removeChild(link); |
| | | } |
| | | downloadFile(res); |
| | | this.$message({ type: 'success', message: '操作成功' }); |
| | | }) |
| | | .catch(err => { |
| | | this.$message({ type: 'error', message: err }); |
| | |
| | | |
| | | // 导入 |
| | | importTable(file) { |
| | | importTeamInfo({ 'multipartFile': file.file }) |
| | | importTeamInfo(file.file) |
| | | .then(() => { |
| | | this.$message({ type: 'success', message: '操作成功' }); |
| | | this.getDepartmentList(); |