学院导入功能
This commit is contained in:
parent
e8d8d5fd39
commit
d6cf328b61
@ -2,3 +2,4 @@ build/*.js
|
||||
src/assets
|
||||
public
|
||||
dist
|
||||
*
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user