|
@@ -18,7 +18,7 @@
|
|
<hc-icon name="refresh" />
|
|
<hc-icon name="refresh" />
|
|
<span>重置密码</span>
|
|
<span>重置密码</span>
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button v-yes-com:[exportClick] color="#6CC2FF" yes-com-text="确定导出用户数据?">
|
|
|
|
|
|
+ <el-button v-yes-com:[exportClick] color="#6CC2FF" yes-com-text="确定导出用户数据?" :loading="downloadLoading">
|
|
<hc-icon class="text-white" name="download" />
|
|
<hc-icon class="text-white" name="download" />
|
|
<span class="text-white">导出</span>
|
|
<span class="text-white">导出</span>
|
|
</el-button>
|
|
</el-button>
|
|
@@ -76,10 +76,15 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { onMounted, ref } from 'vue'
|
|
import { onMounted, ref } from 'vue'
|
|
import { HcDelMsg } from 'hc-vue3-ui'
|
|
import { HcDelMsg } from 'hc-vue3-ui'
|
|
-import { arrToId, formValidate, getArrValue, getObjValue } from 'js-fast-way'
|
|
|
|
-import { add, getList, getUser, remove, resetPassword, update } from '~api/system/user.js'
|
|
|
|
|
|
+import { arrToId, downloadBlob, formValidate, getArrValue, getObjValue } from 'js-fast-way'
|
|
|
|
+import { add, getExportExcel, getList, getUser, remove, resetPassword, update } from '~api/system/user.js'
|
|
import { getRoleTree } from '~api/system/role.js'
|
|
import { getRoleTree } from '~api/system/role.js'
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
onMounted(()=>{
|
|
onMounted(()=>{
|
|
getTableData()
|
|
getTableData()
|
|
})
|
|
})
|
|
@@ -210,8 +215,27 @@ const resetPasswordClick = async (id)=>{
|
|
}
|
|
}
|
|
const exportClick = async (_, resolve) => {
|
|
const exportClick = async (_, resolve) => {
|
|
//这里可以写一些操作
|
|
//这里可以写一些操作
|
|
|
|
+ await getExportExcelClick()
|
|
resolve() //这个一定要存在,否则不会关闭弹窗
|
|
resolve() //这个一定要存在,否则不会关闭弹窗
|
|
}
|
|
}
|
|
|
|
+const downloadLoading = ref(false)
|
|
|
|
+const getExportExcelClick = async () => {
|
|
|
|
+ //批量下载
|
|
|
|
+ downloadLoading.value = true
|
|
|
|
+ const { error, disposition, res } = await getExportExcel({
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ //处理数据
|
|
|
|
+ downloadLoading.value = false
|
|
|
|
+ if (!error) {
|
|
|
|
+ if (disposition) {
|
|
|
|
+ downloadBlob(res, disposition)
|
|
|
|
+ } else {
|
|
|
|
+ window.$message?.error('数据异常')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
const formRef = ref(null)
|
|
const formRef = ref(null)
|
|
const roleIdArr = ref([])
|
|
const roleIdArr = ref([])
|
|
const addsaveLoading = ref(false)
|
|
const addsaveLoading = ref(false)
|