| | |
| | | <template> |
| | | <div class="user viewWrap"> |
| | | <a ref="download" style="display: none" /> |
| | | <h2>用户管理</h2> |
| | | <!-- 搜索功能区 --> |
| | | <div class="wrap"> |
| | |
| | | </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> |
| | |
| | | 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; |