1、导出钱包白名单
This commit is contained in:
		| @ -51,3 +51,13 @@ export function batchInsertMmWalletWhiteList(data) { | |||||||
|     data: data, |     data: data, | ||||||
|   }); |   }); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | // 导出MmWalletWhiteList | ||||||
|  | export function exportMmWalletWhiteList(query) { | ||||||
|  |   return request({ | ||||||
|  |     url: "/api/v1/mm-wallet-white-list/export", | ||||||
|  |     method: "get", | ||||||
|  |     params: query, | ||||||
|  |     responseType: "blob", | ||||||
|  |   }); | ||||||
|  | } | ||||||
| @ -105,7 +105,7 @@ export default { | |||||||
|  |  | ||||||
|       needGoolAuth() |       needGoolAuth() | ||||||
|         .then(response => { |         .then(response => { | ||||||
|           console.log("needGoogleAuth", response) |            | ||||||
|           if (response.code === 200) { |           if (response.code === 200) { | ||||||
|             if (response.data.needGooglAuth) { |             if (response.data.needGooglAuth) { | ||||||
|               this.needGoolAuthData.otpAuthUrl = response.data.otpAuthUrl |               this.needGoolAuthData.otpAuthUrl = response.data.otpAuthUrl | ||||||
|  | |||||||
| @ -48,7 +48,6 @@ service.interceptors.response.use( | |||||||
|       return response.data |       return response.data | ||||||
|     } |     } | ||||||
|     const code = response.data.code |     const code = response.data.code | ||||||
|     console.log("xx",code) |  | ||||||
|  |  | ||||||
|     if (code === 401) { |     if (code === 401) { | ||||||
|       store.dispatch('user/resetToken') |       store.dispatch('user/resetToken') | ||||||
|  | |||||||
| @ -8,8 +8,8 @@ | |||||||
|                     </el-form-item> |                     </el-form-item> | ||||||
|                     <el-form-item label="是否启用" prop="status"> |                     <el-form-item label="是否启用" prop="status"> | ||||||
|                         <el-select v-model="queryParams.status" placeholder="请选择" clearable> |                         <el-select v-model="queryParams.status" placeholder="请选择" clearable> | ||||||
|                             <el-option v-for="dict in statusOptions" :key="'query_status'+dict.value" :label="dict.label" |                             <el-option v-for="dict in statusOptions" :key="'query_status' + dict.value" | ||||||
|                                 :value="dict.value" /> |                                 :label="dict.label" :value="dict.value" /> | ||||||
|                         </el-select> |                         </el-select> | ||||||
|                     </el-form-item> |                     </el-form-item> | ||||||
|  |  | ||||||
| @ -26,8 +26,8 @@ | |||||||
|                         </el-button> |                         </el-button> | ||||||
|                     </el-col> |                     </el-col> | ||||||
|                     <el-col :span="1.5"> |                     <el-col :span="1.5"> | ||||||
|                         <el-button v-permisaction="['admin:mmWalletWhiteList:add']" type="primary" |                         <el-button v-permisaction="['admin:mmWalletWhiteList:add']" type="primary" icon="el-icon-plus" | ||||||
|                             icon="el-icon-plus" size="mini" @click="handleBatchAdd">批量新增 |                             size="mini" @click="handleBatchAdd">批量新增 | ||||||
|                         </el-button> |                         </el-button> | ||||||
|                     </el-col> |                     </el-col> | ||||||
|                     <el-col :span="1.5"> |                     <el-col :span="1.5"> | ||||||
| @ -40,14 +40,24 @@ | |||||||
|                             icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除 |                             icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除 | ||||||
|                         </el-button> |                         </el-button> | ||||||
|                     </el-col> |                     </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-row> | ||||||
|  |  | ||||||
|                 <el-table v-loading="loading" :data="mmWalletWhiteListList" @selection-change="handleSelectionChange"> |                 <el-table v-loading="loading" :data="mmWalletWhiteListList" @selection-change="handleSelectionChange"> | ||||||
|                     <el-table-column type="selection" width="55" align="center" /> |                     <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="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"> |                         <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> |                         </template> | ||||||
|                     </el-table-column> |                     </el-table-column> | ||||||
|                     <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |                     <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | ||||||
| @ -98,13 +108,14 @@ | |||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script> | <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 BatchAdd from './batch-add.vue' | ||||||
|  | import { resolveBlob } from '@/utils/zipdownload' | ||||||
|  |  | ||||||
| export default { | export default { | ||||||
|     name: 'MmWalletWhiteList', |     name: 'MmWalletWhiteList', | ||||||
|     components: { |     components: { | ||||||
|         BatchAdd     |         BatchAdd | ||||||
|     }, |     }, | ||||||
|     data() { |     data() { | ||||||
|         return { |         return { | ||||||
| @ -122,7 +133,7 @@ export default { | |||||||
|             title: '', |             title: '', | ||||||
|             // 是否显示弹出层 |             // 是否显示弹出层 | ||||||
|             open: false, |             open: false, | ||||||
|             showBatch:false, |             showBatch: false, | ||||||
|             isEdit: false, |             isEdit: false, | ||||||
|             // 类型数据字典 |             // 类型数据字典 | ||||||
|             typeOptions: [], |             typeOptions: [], | ||||||
| @ -159,9 +170,9 @@ export default { | |||||||
|         this.getList() |         this.getList() | ||||||
|     }, |     }, | ||||||
|     methods: { |     methods: { | ||||||
|         statusFormat(statusId){ |         statusFormat(statusId) { | ||||||
|             let status = this.statusOptions.find(item => item.value === statusId) |             let status = this.statusOptions.find(item => item.value === statusId) | ||||||
|             return status? status.label : '' |             return status ? status.label : '' | ||||||
|         }, |         }, | ||||||
|         /** 查询参数列表 */ |         /** 查询参数列表 */ | ||||||
|         getList() { |         getList() { | ||||||
| @ -281,11 +292,27 @@ export default { | |||||||
|             }).catch(function () { |             }).catch(function () { | ||||||
|             }) |             }) | ||||||
|         }, |         }, | ||||||
|         handleBatchClose(){ |         handleBatchClose() { | ||||||
|             this.getList() |             this.getList() | ||||||
|         }, |         }, | ||||||
|         handleBatchAdd(){ |         handleBatchAdd() { | ||||||
|             this.showBatch = true |             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 | ||||||
|  |                 }) | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user