1、导出钱包白名单

This commit is contained in:
2025-07-25 17:26:33 +08:00
parent 34867c170c
commit a34ab3f9c4
4 changed files with 51 additions and 15 deletions

View File

@ -51,3 +51,13 @@ export function batchInsertMmWalletWhiteList(data) {
data: data,
});
}
// 导出MmWalletWhiteList
export function exportMmWalletWhiteList(query) {
return request({
url: "/api/v1/mm-wallet-white-list/export",
method: "get",
params: query,
responseType: "blob",
});
}

View File

@ -105,7 +105,7 @@ export default {
needGoolAuth()
.then(response => {
console.log("needGoogleAuth", response)
if (response.code === 200) {
if (response.data.needGooglAuth) {
this.needGoolAuthData.otpAuthUrl = response.data.otpAuthUrl

View File

@ -48,7 +48,6 @@ service.interceptors.response.use(
return response.data
}
const code = response.data.code
console.log("xx",code)
if (code === 401) {
store.dispatch('user/resetToken')

View File

@ -8,8 +8,8 @@
</el-form-item>
<el-form-item label="是否启用" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择" clearable>
<el-option v-for="dict in statusOptions" :key="'query_status'+dict.value" :label="dict.label"
:value="dict.value" />
<el-option v-for="dict in statusOptions" :key="'query_status' + dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
@ -26,8 +26,8 @@
</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-permisaction="['admin:mmWalletWhiteList:add']" type="primary"
icon="el-icon-plus" size="mini" @click="handleBatchAdd">批量新增
<el-button v-permisaction="['admin:mmWalletWhiteList:add']" type="primary" icon="el-icon-plus"
size="mini" @click="handleBatchAdd">批量新增
</el-button>
</el-col>
<el-col :span="1.5">
@ -40,14 +40,24 @@
icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-popconfirm class="delete-popconfirm" title="确定要导出记录吗?" confirm-button-text="确定"
@confirm="handleExport">
<el-button slot="reference" v-permisaction="['admin:mmWalletWhiteList:export']"
icon="el-icon-files" :loading="loading" size="mini">导出
</el-button>
</el-popconfirm>
</el-col>
</el-row>
<el-table v-loading="loading" :data="mmWalletWhiteListList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="钱包地址" align="center" prop="address" :show-overflow-tooltip="true" />
<el-table-column label="是否启用" align="center" prop="status" :show-overflow-tooltip="true" >
<el-table-column label="是否启用" align="center" prop="status" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-tag :type="scope.row.status===1?'success':'danger'">{{ statusFormat(scope.row.status) }}</el-tag>
<el-tag :type="scope.row.status === 1 ? 'success' : 'danger'">{{ statusFormat(scope.row.status)
}}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -98,8 +108,9 @@
</template>
<script>
import { addMmWalletWhiteList, delMmWalletWhiteList, getMmWalletWhiteList, listMmWalletWhiteList, updateMmWalletWhiteList } from '@/api/admin/mm-wallet-white-list'
import { addMmWalletWhiteList, delMmWalletWhiteList, getMmWalletWhiteList, listMmWalletWhiteList, updateMmWalletWhiteList, exportMmWalletWhiteList } from '@/api/admin/mm-wallet-white-list'
import BatchAdd from './batch-add.vue'
import { resolveBlob } from '@/utils/zipdownload'
export default {
name: 'MmWalletWhiteList',
@ -122,7 +133,7 @@ export default {
title: '',
// 是否显示弹出层
open: false,
showBatch:false,
showBatch: false,
isEdit: false,
// 类型数据字典
typeOptions: [],
@ -159,9 +170,9 @@ export default {
this.getList()
},
methods: {
statusFormat(statusId){
statusFormat(statusId) {
let status = this.statusOptions.find(item => item.value === statusId)
return status? status.label : ''
return status ? status.label : ''
},
/** 查询参数列表 */
getList() {
@ -281,11 +292,27 @@ export default {
}).catch(function () {
})
},
handleBatchClose(){
handleBatchClose() {
this.getList()
},
handleBatchAdd(){
handleBatchAdd() {
this.showBatch = true
},
handleExport() {
this.loading = true
exportMmWalletWhiteList(this.queryParams)
.then(response => {
console.log(response)
resolveBlob(response, '钱包白名单.xlsx')
this.msgSuccess('导出成功')
})
.catch(err => {
console.log(err)
})
.finally(() => {
this.loading = false
})
}
}
}