From 7c20fd15b7fbc2bd5756b39d5ab655cc849ffcc3 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期三, 16 七月 2025 22:39:23 +0800
Subject: [PATCH] 添加时间筛选
---
src/views/systemSetting/baseSetting/user/components/header/index.vue | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 56 insertions(+), 1 deletions(-)
diff --git a/src/views/systemSetting/baseSetting/user/components/header/index.vue b/src/views/systemSetting/baseSetting/user/components/header/index.vue
index ccde5e8..91b8b73 100644
--- a/src/views/systemSetting/baseSetting/user/components/header/index.vue
+++ b/src/views/systemSetting/baseSetting/user/components/header/index.vue
@@ -6,6 +6,18 @@
<el-input placeholder="璇疯緭鍏ュ唴瀹�" v-model="search"></el-input>
<div class="findBtn">
<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">
@@ -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,6 +105,9 @@
}
</script>
<style lang="scss" scoped>
+.department-margin-left10{
+ margin-left: 10px;
+}
header {
// background-color: #09152f;
//border: 1px solid #fff;
--
Gitblit v1.8.0