From e6443cf405d4e950abe35a29e6c133d097fc1ad5 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期一, 04 十二月 2023 17:46:01 +0800
Subject: [PATCH] 100路视频

---
 src/views/systemSetting/baseSetting/user/components/header/index.vue |   90 +++++++++++++++++++++++++++++++++------------
 1 files changed, 66 insertions(+), 24 deletions(-)

diff --git a/src/views/systemSetting/baseSetting/user/components/header/index.vue b/src/views/systemSetting/baseSetting/user/components/header/index.vue
index a07ce89..91b8b73 100644
--- a/src/views/systemSetting/baseSetting/user/components/header/index.vue
+++ b/src/views/systemSetting/baseSetting/user/components/header/index.vue
@@ -5,13 +5,25 @@
                 <span>绛涢�夋潯浠�:</span>
                 <el-input placeholder="璇疯緭鍏ュ唴瀹�" v-model="search"></el-input>
                 <div class="findBtn">
-                    <el-button type="primary" @click="setSearch">鏌ヨ</el-button>
+                    <el-button class="find-Btn" type="primary" @click="setSearch">鏌ヨ</el-button>
+                  <el-upload style="margin-top: -5px;"
+                      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">
                 <!-- :before-close="handleClose" -->
                 <el-button class="addBtn button-addition" type="primary" @click="dialogCreate = true">娣诲姞鐢ㄦ埛</el-button>
-                <el-dialog :visible.sync="dialogCreate" title="鏂板璐︽埛" width="60%" v-if="dialogCreate"
+                <el-dialog :visible.sync="dialogCreate" title="鏂板璐︽埛" width="800px" v-if="dialogCreate"
                     :before-close="handleClose">
                     <createUser @sendDialog="sendDialog" />
                 </el-dialog>
@@ -21,6 +33,9 @@
 </template>
 <script>
 import createUser from "../createUser";
+import {exportTeamInfoDepartment, importTeamInfoDepartment} from "@/api/system/department";
+import {downloadFile} from "@/utils/helper";
+import {exportUser, importUser} from "@/api/system/user";
 export default {
     components: {
         createUser,
@@ -32,7 +47,44 @@
         }
     },
     methods: {
-        setSearch() {
+      // 瀵煎嚭
+      exportTable() {
+        // const status = this.searchStatus === 2 ? null : this.searchStatus;
+        exportUser({
+          // 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)
+        importUser(formData)
+            .then(() => {
+              this.$message({ type: "success", message: "鎿嶄綔鎴愬姛" });
+              this.setSearch();
+              this.$refs.uploadFile.clearFiles();
+            })
+            .catch((err) => {
+              this.$message({ type: "error", message: err });
+              this.$refs.uploadFile.clearFiles();
+            });
+      },
+
+      setSearch() {
             this.$emit('getSearch', { text: this.search })
         },
         sendDialog(flag) {
@@ -53,58 +105,48 @@
 }
 </script>
 <style lang="scss" scoped>
+.department-margin-left10{
+  margin-left: 10px;
+}
 header {
-    background-color: #09152f;
-    border: 1pox solid #fff;
-
+    // background-color: #09152f;
+    //border: 1px solid #fff;
     .headerContent {
-        padding: 0 40px;
+        padding: 0;
         display: flex;
         line-height: 100px;
         justify-content: space-between;
         align-items: center;
-
         .search {
             display: flex;
             justify-content: flex-start;
-
             span {
                 flex: 1;
             }
-
             .el-input {
                 flex: 2;
-                color: #1d3f57;
-
+                // color: #1d3f57;
                 &::v-deep .el-input__inner {
-                    background-color: #09152f;
-                    border: 1px solid #17324c;
+                    // background-color: #09152f;
+                    // border: 1px solid #17324c;
                 }
             }
-
         }
-
         .findBtn {
             line-height: 100px;
             margin-left: 15px;
             display: flex;
             align-items: center;
             margin-top: -2px;
-
             .el-button {
                 padding: 12px 25px;
-                border-radius: 20px;
             }
         }
-
         .addBtn {
-            background-color: #eb5d01;
+            background-color: #409EFF;
             border: none;
-            border-radius: 20px;
             padding: 12px 30px;
         }
-
-
     }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.8.0