学院导入功能

This commit is contained in:
贾晓峰 2024-11-08 12:46:13 +08:00
parent e8d8d5fd39
commit d6cf328b61
2 changed files with 23 additions and 0 deletions

View File

@ -2,3 +2,4 @@ build/*.js
src/assets
public
dist
*

View File

@ -44,6 +44,16 @@
@click="toggleExpandAll"
>展开/折叠</el-button>
</el-col>
<el-col :span="1.5">
<el-upload
class="upload-file-uploader"
:action="uploadUrl"
:headers="headers"
:on-success="handleUploadSuccess"
multiple
:show-file-list="false"
>导入数据</el-upload>
</el-col>
</el-row>
<el-table
@ -162,6 +172,7 @@
<script>
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
import { getToken } from "@/utils/auth";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@ -171,6 +182,11 @@ export default {
components: { Treeselect },
data() {
return {
//
uploadUrl: process.env.VUE_APP_BASE_API+'/system/dept/import',
headers: {
Authorization: "Bearer " + getToken(),
},
//
loading: true,
//
@ -229,6 +245,12 @@ export default {
this.getList();
},
methods: {
//
handleUploadSuccess(res, file) {
if (res.code === 200) {
this.getList();
}
},
/** 查询部门列表 */
getList() {
this.loading = true;