| | |
| | | <el-input v-model="context" placeholder="请输入内容"></el-input> |
| | | <div class="findBtn"> |
| | | <el-button type="primary" @click="search()">查询</el-button> |
| | | <el-upload |
| | | class="department-margin-left10" |
| | | action="" |
| | | ref="uploadFile" |
| | | :http-request="importTable" |
| | | :show-file-list="false" |
| | | :auto-upload="true" |
| | | :limit="1" |
| | | > |
| | | <el-button type="primary">导入</el-button> |
| | | </el-upload> |
| | | <el-button class="department-margin-left10" type="primary" @click="exportTable()">导出</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="addUser"> |
| | |
| | | <script> |
| | | import createUser from "./createUser"; |
| | | import updateUser from "./updateUser"; |
| | | import {exportTeamInfo, importTeamInfo} from "@/api/system/portal/teamConstruction"; |
| | | import {downloadFile} from "@/utils/helper"; |
| | | import {exportTeamInfoDepartment, importTeamInfoDepartment} from "@/api/system/department"; |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | this.getUserList(); |
| | | }, |
| | | methods: { |
| | | // 导出 |
| | | exportTable() { |
| | | // const status = this.searchStatus === 2 ? null : this.searchStatus; |
| | | exportTeamInfoDepartment({ |
| | | // current: this.currentPage, |
| | | // size: this.pageSize, |
| | | // departName: this.searchDepartment, |
| | | // status, |
| | | }) |
| | | .then((res) => { |
| | | console.log(res) |
| | | downloadFile(res); |
| | | this.$message({ type: "success", message: "操作成功" }); |
| | | }) |
| | | .catch((err) => { |
| | | this.$message({ type: "error", message: err }); |
| | | }); |
| | | }, |
| | | |
| | | // 导入 |
| | | importTable(file) { |
| | | const formData = new FormData(); |
| | | formData.append("file", file.file); |
| | | console.log(formData) |
| | | console.log(file) |
| | | importTeamInfoDepartment(formData) |
| | | .then(() => { |
| | | this.$message({ type: "success", message: "操作成功" }); |
| | | this.getUserList(); |
| | | this.$refs.uploadFile.clearFiles(); |
| | | }) |
| | | .catch((err) => { |
| | | this.$message({ type: "error", message: err }); |
| | | this.$refs.uploadFile.clearFiles(); |
| | | }); |
| | | }, |
| | | |
| | | selectChange(list) { |
| | | console.log(this.tempList); |
| | | if (this.tempList.length !== 0) { |
| | |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .department-margin-left10{ |
| | | margin-left: 10px; |
| | | } |
| | | .userList { |
| | | text-align: left; |
| | | padding: 10px 20px; |
| | |
| | | .funs-sp { |
| | | // border: 1px solid #17324c; |
| | | border: 1px solid #DCDFE6; |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .funs { |
| | |
| | | .line { |
| | | padding: 0 5px; |
| | | } |
| | | |
| | | color: var(--operation-color); |
| | | span:hover { |
| | | cursor: pointer; |
| | | } |