From 2b6f255b97dba15d22b86319e2f38f6efac417cc Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期一, 13 十一月 2023 23:23:27 +0800
Subject: [PATCH] 一点一档
---
src/views/systemSetting/baseSetting/department/index.vue | 65 ++++++++++++++++++++++++++++++--
1 files changed, 61 insertions(+), 4 deletions(-)
diff --git a/src/views/systemSetting/baseSetting/department/index.vue b/src/views/systemSetting/baseSetting/department/index.vue
index 54691db..eab00aa 100644
--- a/src/views/systemSetting/baseSetting/department/index.vue
+++ b/src/views/systemSetting/baseSetting/department/index.vue
@@ -7,6 +7,18 @@
<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">
@@ -155,6 +167,9 @@
<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: {
@@ -202,6 +217,43 @@
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) {
@@ -446,17 +498,21 @@
};
</script>
<style lang="scss" scoped>
+.department-margin-left10{
+ margin-left: 10px;
+}
.userList {
text-align: left;
- margin: 10px 20px;
+ padding: 10px 20px;
// color: #4b9bb7;
+ //height: 100%;
border: 1px solid #ccc;
header {
// background-color: white;
// border: 1 pox solid #fff;
.headerContent {
- padding: 0 40px;
+ padding: 0;
display: flex;
line-height: 100px;
justify-content: space-between;
@@ -517,11 +573,12 @@
display: flex;
justify-content: space-between;
align-items: center;
- padding: 0 20px;
+ padding: 0;
.funs-sp {
// border: 1px solid #17324c;
border: 1px solid #DCDFE6;
+ background-color: #fff;
}
.funs {
@@ -591,7 +648,7 @@
.line {
padding: 0 5px;
}
-
+ color: var(--operation-color);
span:hover {
cursor: pointer;
}
--
Gitblit v1.8.0