From 854cfc4737f6cd711bc0f50c205628cda5c23445 Mon Sep 17 00:00:00 2001 From: zuojincheng <lf_zuo@163.com> Date: 星期五, 30 五月 2025 14:03:10 +0800 Subject: [PATCH] 2025-05-30刘润玉复制代码恢复工程,修改了登录、工单、工作任务计划、排班、用户等组件vue。 --- src/views/system/user.vue | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-) diff --git a/src/views/system/user.vue b/src/views/system/user.vue index b5b1911..573addd 100644 --- a/src/views/system/user.vue +++ b/src/views/system/user.vue @@ -1,5 +1,6 @@ <template> <div class="user viewWrap"> + <a ref="download" style="display: none" /> <h2>鐢ㄦ埛绠$悊</h2> <!-- 鎼滅储鍔熻兘鍖� --> <div class="wrap"> @@ -28,9 +29,13 @@ </div> <!-- 鏁版嵁鍔熻兘鎸夐挳鍖� --> + <div> <el-button type="primary" style="margin-top: 20px; width: 100px;" icon="el-icon-plus" @click="handleFormDataAdd">娣诲姞</el-button> - + <el-button type="primary" style="margin-top: 20px; width: 100px;" icon="el-icon-download" + @click="handleExport">瀵煎嚭</el-button> + </div> + <!-- 鏁版嵁琛ㄦ牸鍖� --> <el-table stripe :data="tableData" height="0" style="margin-top: 20px;"> <el-table-column type="index" label="搴忓彿"> </el-table-column> @@ -320,6 +325,28 @@ this.onGetRoleData(); this.onGetDefaultPassword(); }, + // 瀵煎嚭 + handleExport: function () { + var that = this; + that + .$axiosAdmin({ + method: "post", + responseType: "blob", + url: "base/user/export", + data: JSON.stringify({ + "type":"" + }) + }) + .then((res) => { + const blob = res; + that.$refs.download.href = window.URL.createObjectURL(new Blob([blob], {type:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'})); + that.$refs.download.download = `鐢ㄦ埛淇℃伅.xlsx`; + that.$refs.download.click(); + }) + .catch((err) => { + console.log(err); + }); + }, // 鍏抽棴 handleFormDataClose: function () { this.formData.id = null; -- Gitblit v1.8.0