12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553 |
- <template>
- <div class="app-container">
- <div class="app-container-head">
- <div class="app-container-head-left">
- <div class="app-container-head-left-item">
- <div class="app-container-head-left-item-count">
- {{ (count.batchCount + count.premiumCount) || 0 }}
- </div>
- <div class="app-container-head-left-item-name">
- 所有
- </div>
- </div>
- <div class="app-container-head-left-divider"/>
- <div class="app-container-head-left-item">
- <div class="app-container-head-left-item-count">
- {{ count.batchCount }}
- </div>
- <div class="app-container-head-left-item-name">
- 批处理账户
- </div>
- </div>
- <div class="app-container-head-left-divider"/>
- <div class="app-container-head-left-item">
- <div class="app-container-head-left-item-count">
- {{ count.premiumCount }}
- </div>
- <div class="app-container-head-left-item-name">
- 精品账户
- </div>
- </div>
- </div>
- <div class="app-container-head-right">
- <div class="app-container-head-right-button1" @click="exportAddress">
- 导出地址
- </div>
- <div class="app-container-head-right-button1" @click="downloadAddress()">
- 下载 KeyStore
- </div>
- <div class="app-container-head-right-button1" @click="drawerImport = true">
- <img src="../../assets/address/upload.svg" alt="upload">
- 导入
- </div>
- <div class="app-container-head-right-button2" @click="drawerAddress = true">
- <img src="../../assets/address/eyeglasses.svg" alt="eyeglasses">
- 观察地址
- </div>
- </div>
- </div>
- <div class="app-container-table">
- <div class="app-container-table-title">
- <div class="app-container-table-title-left">
- 地址列表
- </div>
- </div>
- <div class="app-container-table-select">
- <el-scrollbar>
- <div class="scrollbar-flex-content">
- <div @click="selectAddressGroup(index)" v-for="(item,index) in table.walletNameGroup" :class="index === table.walletNameGroupIndex ? 'app-container-table-select-item-active' : 'app-container-table-select-item'">
- {{item}}
- </div>
- </div>
- </el-scrollbar>
- </div>
- <div class="app-container-table-screening">
- <div class="app-container-table-screening-item">
- 时间
- <img src="../../assets/address/unfold_more.svg" alt="unfold_more">
- </div>
- <div class="app-container-table-screening-item">
- Gas消耗
- <img src="../../assets/address/unfold_more.svg" alt="unfold_more">
- </div>
- </div>
- <div class="app-container-table-main">
- <el-table
- :data="tableData"
- style="width: 100%">
- <el-table-column
- label="账户地址"
- width="600">
- <template v-slot="scope">
- <div class="accountAddress">
- <div class="img">
- </div>
- <div class="walletName" v-if="scope.row.addressType === 0">
- {{scope.row.groupName}}
- </div>
- <div class="walletName" v-if="scope.row.addressType === 1">
- {{scope.row.groupName}}-{{(scope.$index+1) + (table.page-1)*5}}
- </div>
- <div class="walletAddress">
- {{scope.row.address}}
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- label="Gas消耗/USDT"
- width="250">
- <template v-slot="scope">
- <div class="gas">
- {{scope.row.totalGas}}
- </div>
- </template>
- </el-table-column>
- <el-table-column
- label="type"
- width="255">
- <template v-slot="scope">
- <div class="type">
- <div class="bulk" v-if="table.walletNameGroupIndex !== 0">
- <img src="../../assets/address/precision_manufacturing.svg" alt="precision_manufacturing">
- 批量
- </div>
- <div class="boutique" v-if="table.walletNameGroupIndex === 0">
- <img src="../../assets/address/award_star.svg" alt="award_star">
- 精品号
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- label="最后操作时间"
- width="180">
- <template v-slot="scope">
- <div class="lastTime">
- {{scope.row.lastOperTime}}
- </div>
- </template>
- </el-table-column>
- <el-table-column align="right">
- <template v-slot="scope">
- <div class="view" @click="viewAddress(scope.row)">
- 查看
- </div>
- </template>
- </el-table-column>
- </el-table>
- <div class="pagination">
- <el-pagination
- small
- layout="prev, pager, next"
- :hide-on-single-page="false"
- :page-size="table.pageSize"
- :total="table.total"
- :current-page.sync="table.page"
- @current-change="pageChange">
- </el-pagination>
- </div>
- </div>
- </div>
- <el-drawer
- :visible.sync="drawerView"
- :with-header="false">
- <div class="drawerView-container">
- <div class="drawerView-container-head">
- <div class="drawerView-container-title">
- 钱包名称
- </div>
- <div class="drawerView-container-walletAddress">
- {{drawerViewData.address}}
- </div>
- <div class="drawerView-container-statistics">
- <div class="drawerView-container-statistics-item">
- <div class="drawerView-container-statistics-item-title">
- 累计花费
- </div>
- <div class="drawerView-container-statistics-item-amounts">
- <span class="number">{{drawerViewData.gas}}</span>
- <span class="currency">USDT</span>
- </div>
- </div>
- <div class="drawerView-container-statistics-item">
- <div class="drawerView-container-statistics-item-title">
- 剩余本金
- </div>
- <div class="drawerView-container-statistics-item-amounts">
- <span class="number">{{drawerViewData.balance}}</span>
- <span class="currency">USDT</span>
- </div>
- </div>
- </div>
- </div>
- <div class="drawerView-container-main">
- <div class="drawerView-container-title">
- 钱包活动
- </div>
- <div class="drawerView-container-total">
- 总计钱包: {{drawerViewData.total}}
- </div>
- <div class="drawerView-container-table-screening">
- <div class="drawerView-container-table-screening-item">
- 钱包活动
- <img src="../../assets/address/filter_list.svg" alt="filter_list">
- </div>
- <div class="drawerView-container-table-screening-item">
- 时间
- <img src="../../assets/address/filter_list.svg" alt="filter_list">
- </div>
- <div class="drawerView-container-table-screening-item" style="margin-left: 26px;margin-right: -10px">
- Gas
- <img src="../../assets/address/unfold_more.svg" alt="unfold_more">
- </div>
- <div class="drawerView-container-table-screening-item">
- 交易金额
- <img src="../../assets/address/unfold_more.svg" alt="unfold_more">
- </div>
- </div>
- <div class="drawerView-container-table-main">
- <div v-for="item in drawerViewData.table" class="drawerView-container-table-main-item">
- <div class="activity">
- <div class="activity-item" v-if="item.taskType !== 'SWAP'" style="background: #F2C94C;">
- {{item.taskName}}
- </div>
- <div class="activity-item" v-if="item.taskType === 'SWAP'" style="background: #6FCF97;">
- {{item.taskName}}
- </div>
- </div>
- <div class="time">
- {{item.createTime}}
- </div>
- <div class="gas">
- {{parseFloat(item.gas).toFixed(4)}}
- </div>
- <div class="balance">
- {{parseFloat(item.amount).toFixed(4)}}
- </div>
- <div class="link">
- 详情
- </div>
- </div>
- </div>
- </div>
- <div class="drawerView-container-footer">
- <div class="pagination">
- <el-pagination
- small
- layout="prev, pager, next"
- :page-size="10"
- :total="drawerViewData.total">
- </el-pagination>
- </div>
- <!-- <div class="manageAccount">-->
- <!-- <img src="../../assets/address/page_info.svg" alt="page_info">-->
- <!-- 管理账号-->
- <!-- </div>-->
- <!-- <div class="disassociation">-->
- <!-- <img src="../../assets/address/link_off.svg" alt="link_off">-->
- <!-- 取消关联-->
- <!-- </div>-->
- </div>
- </div>
- </el-drawer>
- <el-drawer
- :visible.sync="drawerAddress"
- :with-header="false">
- <div class="drawerAddress-container">
- <div class="drawerAddress-container-head">
- <div class="drawerAddress-container-head-left">
- <div class="drawerAddress-container-title">
- 添加地址
- </div>
- <div class="drawerAddress-container-tip">
- 添加观察地址
- </div>
- </div>
- <div class="drawerAddress-container-head-right">
- <div class="complete" @click="addBoutiqueAccount">
- <img src="../../assets/address/done_all.svg" alt="done_all">
- 完成
- </div>
- </div>
- </div>
- <div class="drawerAddress-container-main">
- <div class="item" v-for="(item,index) in addressArr">
- <div class="title">
- <div class="name">
- 钱包地址
- </div>
- <div class="delete" @click="addressArrDelete(index)">
- <img src="../../assets/address/delete.svg" alt="delete">
- 删除
- </div>
- </div>
- <div class="input">
- <el-select v-model="item.chainId" placeholder="选择公链">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <el-input v-model="item.groupName" placeholder="输入钱包名称"></el-input>
- </div>
- <div class="input">
- <el-input v-model="item.address" placeholder="输入钱包地址"></el-input>
- </div>
- </div>
- <div class="addAddress" @click="addressArrPush">
- <img src="../../assets/address/add_circle.svg" alt="add_circle">
- 新增观察地址
- </div>
- </div>
- </div>
- </el-drawer>
- <el-drawer
- :visible.sync="drawerImport"
- :with-header="false"
- @closed="completeGeneration = false">
- <div class="drawerImport-container">
- <div class="drawerImport-container-head">
- <div class="drawerImport-container-head-left">
- <div class="drawerImport-container-title">
- 导入钱包地址
- </div>
- <div class="drawerImport-container-tip">
- 仅支持Keystore导入
- </div>
- </div>
- </div>
- <div class="drawerImport-container-main" v-if="!completeGeneration">
- <div class="select">
- <div :class="drawerImportSelect === 0 ? 'select-item-active' : 'select-item'" @click="drawerImportSelect = 0">
- 导入钱包
- </div>
- <div :class="drawerImportSelect === 1 ? 'select-item-active' : 'select-item'" @click="drawerImportSelect = 1">
- 创建钱包
- </div>
- </div>
- <div class="importWallet" v-if="drawerImportSelect === 0">
- <div class="upload">
- <el-upload
- class="upload-demo"
- drag
- action="https://jsonplaceholder.typicode.com/posts/"
- multiple>
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">将Keystore文件拖到此处,或<em>上传文件</em></div>
- </el-upload>
- </div>
- <div class="inputTitle">
- 批量钱包名称
- </div>
- <div class="batchWalletName">
- <el-input v-model="input" placeholder="选择/输入批量钱包名称"></el-input>
- <el-select v-model="value" placeholder="选择类型">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </div>
- <div class="inputTitle">
- 钱包密码
- </div>
- <el-input v-model="input" placeholder="设置钱包密码"></el-input>
- <div class="confirm">
- <img src="../../assets/address/file_download_done.svg" alt="file_download_done">
- 确认导入
- </div>
- </div>
- <div class="createWallet" v-if="drawerImportSelect === 1">
- <div class="inputTitle">
- 批量钱包名称
- </div>
- <el-input v-model="batchAddressObj.groupName" placeholder="输入批量钱包名称"></el-input>
- <div class="inputBox">
- <div>
- <div class="inputTitle">
- 选择公链
- </div>
- <el-select style="width: 280px" v-model="batchAddressObj.chainId" placeholder="选择类型">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </div>
- <div>
- <div class="inputTitle">
- 生成数量
- </div>
- <el-input style="width: 230px" v-model="batchAddressObj.numWallet" placeholder="输入生成数量"></el-input>
- </div>
- </div>
- <div class="inputBox">
- <div>
- <div class="inputTitle">
- 钱包密码
- </div>
- <el-input style="width: 280px" auto-complete="new-password" v-model="batchAddressObj.password" placeholder="设置钱包密码" show-password></el-input>
- </div>
- <div>
- <div class="inputTitle">
- 确认钱包密码
- </div>
- <el-input style="width: 230px" auto-complete="new-password" v-model="batchAddressObj.verifyPassword" placeholder="设置钱包密码" show-password></el-input>
- </div>
- </div>
- <div class="confirm" @click="addBatchAddress">
- <img v-if="!confirmLoading" src="../../assets/address/Stroke-2.svg" alt="Stroke">
- <div v-if="confirmLoading" style="width: 20px;height: 20px;margin-top: -2px">
- <Loading/>
- </div>
- 开始生成
- </div>
- <div class="tip">
- <div class="title">
- <img src="../../assets/address/tips_and_updates.svg" alt="tips_and_updates">
- 提示
- </div>
- <div class="description">
- 此密码为您账户钱包的 Keystore 密码,请妥善保管,
- 系统无法为您找回。
- </div>
- </div>
- </div>
- </div>
- <div class="drawerImport-container-main" v-if="completeGeneration">
- <div class="completeTip">
- <img src="../../assets/address/Rectangle.png" alt="Rectangle">
- <div class="description">
- <div class="address">
- 成功生成 {{addressList.length}} 个钱包地址
- </div>
- <div class="tip">
- 请牢记您的 Keystore 文件及密码,系统无法帮你找回
- </div>
- </div>
- </div>
- <div class="addressListBox">
- <div class="addressList">
- <div class="addressList-item" v-for="(item,index) in addressList">
- <div class="name">
- Address-{{index+1}}
- </div>
- <div class="address" @click="copyAddress(item)">
- {{item}}
- <img src="../../assets/address/content_copy.svg" alt="content_copy">
- </div>
- </div>
- <div class="pagination">
- <el-pagination
- small
- layout="prev, pager, next"
- :total="addressList.length">
- </el-pagination>
- </div>
- </div>
- </div>
- </div>
- <div class="drawerImport-container-footer" v-if="completeGeneration">
- <div class="exportAddress">
- <img src="../../assets/address/upload.svg" alt="upload">
- 导出地址
- </div>
- <div class="download" @click="downloadAddress(batchAddressObj.groupName)">
- <img src="../../assets/address/download.svg" alt="download">
- 下载Keystore
- </div>
- </div>
- </div>
- </el-drawer>
- </div>
- </template>
- <script>
- import {
- addPremiumAddress,
- batchAddress,
- getCountAddress, getEventRecord,
- getGroupList,
- pageAddress
- } from '@/api/adress'
- import Axios from "axios";
- import Loading from "@/components/Loading";
- import {saveAs} from 'file-saver';
- import Web3 from "web3";
- import CryptoJS from "crypto-js";
- export default {
- components: {Loading},
- data() {
- return {
- table:{
- page:1,
- pageSize:5,
- walletNameGroup:['精品号'],
- walletNameGroupIndex:0,
- total:0
- },
- count:{
- batchCount:0,
- premiumCount:0
- },
- tableData: [],
- exportTableData:[],
- drawerView:false,
- drawerViewData:{
- address:'',
- table:[],
- gas:0,
- balance:0,
- total:0
- },
- drawerAddress:false,
- addressArr:[
- {
- chainId:'',
- address:'',
- groupName:''
- }
- ],
- batchAddressObj:{
- chainId:'',
- groupName:'',
- numWallet:1,
- password:'',
- verifyPassword:''
- },
- options: [{
- value: '1',
- label: 'ETH'
- }],
- value: '',
- input: '',
- drawerImport:false,
- drawerImportSelect:1,
- completeGeneration:false,
- addressList:[],
- confirmLoading:false,
- url: process.env.VUE_APP_BASE_API,
- }
- },
- created() {
- this.getAddressGroupList();
- this.getCount()
- },
- methods: {
- getAddressGroupList(){
- getGroupList().then(res=>{
- this.table.walletNameGroup.push(...res)
- this.getAddressGroupAddress()
- })
- },
- getAddressGroupAddress(){
- let params
- if(this.table.walletNameGroupIndex === 0){
- params = {
- page:this.table.page,
- pageSize:this.table.pageSize,
- addressType:0
- }
- }else {
- params = {
- page:this.table.page,
- pageSize:this.table.pageSize,
- groupName:this.table.walletNameGroup[this.table.walletNameGroupIndex]
- }
- }
- pageAddress(params).then(res=>{
- this.tableData = res.records
- this.table.total = res.total
- })
- },
- selectAddressGroup(index){
- this.table.walletNameGroupIndex = index
- this.table.page = 1
- this.getAddressGroupAddress()
- },
- viewAddress(row){
- let params = {
- page:1,
- pageSize:10,
- queryValue:row.address
- }
- getEventRecord(params).then(res=>{
- this.drawerViewData.address = row.address
- this.drawerViewData.gas = row.totalGas
- this.drawerViewData.total = res.total
- this.drawerViewData.table = res.records
- this.drawerView = true
- })
- },
- addBoutiqueAccount(){
- let params = this.addressArr
- addPremiumAddress(params).then(()=>{
- this.success('添加地址成功')
- this.drawerAddress = false
- let obj = {
- chainId:'',
- address:'',
- groupName:''
- }
- this.addressArr = [obj]
- this.getAddressGroupAddress()
- })
- },
- addressArrPush(){
- let obj = {
- chainId:'',
- address:'',
- groupName:''
- }
- this.addressArr.push(obj)
- },
- addressArrDelete(index){
- this.addressArr.splice(index,1)
- },
- getCount(){
- getCountAddress().then(res=>{
- this.count.batchCount = res.batchCount
- this.count.premiumCount = res.premiumCount
- })
- },
- pageChange(page){
- this.table.page = page
- this.getAddressGroupAddress()
- },
- addBatchAddress(){
- if(this.batchAddressObj.password !== this.batchAddressObj.verifyPassword){
- this.error('密码不一致')
- return
- }
- // 要加密的数据
- const dataToEncrypt = JSON.parse(JSON.stringify(this.batchAddressObj.password));
- // console.log('输入的密码:', dataToEncrypt);
- // 获取当前北京时间
- const beijingDate = this.getCurrentBeijingTime();
- // 生成keyByte;
- const keyByte = this.generateKeyByteArray(beijingDate);
- // console.log('生成的toHex:', keyByte);
- // 加密数据
- const encryptedData = this.encryptData(dataToEncrypt, keyByte);
- // console.log('加密后的数据:', encryptedData);
- let params = {
- chainId : this.batchAddressObj.chainId,
- groupName : this.batchAddressObj.groupName,
- numWallet : this.batchAddressObj.numWallet,
- password : encryptedData
- }
- this.confirmLoading = true
- batchAddress(params).then(res=>{
- this.addressList = res
- this.completeGeneration = true
- this.confirmLoading = false
- })
- },
- // 获取当前北京时间并格式化为 YYYYMMDD
- getCurrentBeijingTime() {
- const localDate = new Date();
- const localTime = localDate.getTime(); // 获取当前本地时间的时间戳
- const localOffset = localDate.getTimezoneOffset() * 60000; // 本地时区偏移的毫秒数
- const utcTime = localTime + localOffset; // 转换为 UTC 时间
- const beijingOffset = 8 * 60 * 60000; // 北京时区偏移的毫秒数
- const beijingTime = utcTime + beijingOffset; // 加上北京时区偏移
- const beijingDate = new Date(beijingTime);
- const year = beijingDate.getFullYear();
- const month = (beijingDate.getMonth() + 1).toString().padStart(2, '0');
- const day = beijingDate.getDate().toString().padStart(2, '0');
- return `${year}${month}${day}${year}${month}${day}`;
- },
- // 生成
- generateKeyByteArray(content) {
- let bytes = [];
- let len, c;
- len = content.length;
- for (let i = 0; i < len; i++) {
- c = content[i];
- bytes.push(parseInt(c))
- }
- // console.log('当前北京时间的数组',bytes);
- return Web3.utils.bytesToHex(bytes).substring(2);
- },
- // 加密函数
- encryptData(word, keyStr) {
- let key = CryptoJS.enc.Hex.parse(keyStr)
- // console.log('CryptoJS生成的key',key);
- let encrypted = CryptoJS.AES.encrypt(word, key, {mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7}) // 加密模式为ECB,补码方式为PKCS5Padding(也就是PKCS7)
- return encrypted.toString()
- },
- downloadAddress(el) {
- let groupName = this.table.walletNameGroup[this.table.walletNameGroupIndex]
- if(el){
- groupName = el
- }
- Axios.post(
- this.url + "ams/address/download/batch-keystore",
- {
- groupName: groupName,
- },
- {
- responseType: "arraybuffer",
- headers: {
- "Conntent-Type": "application/json; application/octet-stream;",
- },
- }
- )
- .then((response) => {
- let buffer = response.data;
- let view = new DataView(buffer);
- let str = "";
- for (let i = 0; i < view.byteLength; i++) {
- str += String.fromCharCode(view.getUint8(i));
- }
- if (str.includes(".json")) {
- this.downloadFile(response.data,groupName);
- } else {
- const data = JSON.parse(str);
- this.$message.error(data.message);
- }
- })
- .catch((e) => {
- this.$message.error(e);
- });
- },
- downloadFile(data,groupName) {
- let blob = new Blob([data], { type: "application/zip" });
- let url = window.URL.createObjectURL(blob);
- const link = document.createElement("a"); // 创建a标签
- link.href = url;
- link.download = groupName + ".zip";
- link.click();
- URL.revokeObjectURL(url); // 释放内存
- this.downloadModal = false;
- },
- exportAddress() {
- let params
- if(this.table.walletNameGroupIndex === 0){
- params = {
- page:1,
- pageSize:1000,
- addressType:0
- }
- }else {
- params = {
- page:1,
- pageSize:1000,
- groupName:this.table.walletNameGroup[this.table.walletNameGroupIndex]
- }
- }
- pageAddress(params).then(res=>{
- this.exportTableData = res.records
- this.exportTableData.forEach(item=>{
- })
- })
- },
- copyAddress(el){
- let address = el
- if (navigator.clipboard) {
- navigator.clipboard.writeText(address);
- this.success('复制成功')
- } else {
- let textarea = document.createElement('textarea');
- document.body.appendChild(textarea);
- // 隐藏此输入框
- textarea.style.position = 'fixed';
- textarea.style.clip = 'rect(0 0 0 0)';
- textarea.style.top = '10px';
- // 赋值
- textarea.value = address;
- // 选中
- textarea.select();
- // 复制
- document.execCommand('copy', true);
- // 移除输入框
- document.body.removeChild(textarea);
- this.success('复制成功')
- }
- },
- success(message) {
- this.$notify({
- title: '成功',
- message: message,
- type: 'success'
- });
- },
- error(message) {
- this.$notify.error({
- title: '错误',
- message: message
- });
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .app-container{
- .app-container-head{
- display: flex;
- justify-content: space-between;
- align-items: center;
- .app-container-head-left{
- display: flex;
- justify-content: space-between;
- align-items: center;
- gap:60px;
- .app-container-head-left-item{
- display: flex;
- flex-direction: column;
- gap:8px;
- .app-container-head-left-item-count{
- font-weight: 700;
- font-size: 21px;
- line-height: 28px;
- color: #181818;
- }
- .app-container-head-left-item-name{
- font-weight: 700;
- font-size: 12px;
- line-height: 16px;
- color: #8e8f91;
- }
- }
- .app-container-head-left-divider{
- width: 1px;
- height: 50px;
- border-right:1px solid #e4e6ea;
- }
- }
- .app-container-head-right{
- display: flex;
- align-items: center;
- gap:24px;
- .app-container-head-right-button1{
- width: 148px;
- height: 52px;
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- gap: 4px;
- background: #f9fbff;
- border-radius: 10px;
- font-weight: 700;
- font-size: 15px;
- line-height: 20px;
- color: #2980ff;
- border: 1px solid #2980FF;
- cursor: pointer;
- }
- .app-container-head-right-button2{
- width: 148px;
- height: 52px;
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- gap: 4px;
- background: #4A76FF;
- border-radius: 10px;
- font-weight: 700;
- font-size: 15px;
- line-height: 20px;
- color: #FFFFFF;
- cursor: pointer;
- }
- }
- }
- .app-container-table{
- margin-top: 80px;
- .app-container-table-title{
- display: flex;
- align-items: center;
- justify-content: space-between;
- .app-container-table-title-left{
- font-weight: 700;
- font-size: 21px;
- line-height: 28px;
- color: #181818;
- }
- }
- .app-container-table-select{
- display: flex;
- align-items: center;
- gap:56px;
- //border-bottom: 4px solid #f2f4f7;
- width: 100%;
- margin-top: 28px;
- .scrollbar-flex-content {
- display: flex;
- gap:56px;
- }
- .app-container-table-select-item{
- font-weight: 400;
- font-size: 17px;
- line-height: 22px;
- color: #ABABAB;
- padding-bottom: 16px;
- //margin-bottom: -4px;
- border-bottom: 4px solid #f9fbff;
- cursor: pointer;
- white-space:nowrap;
- margin-bottom: 20px;
- }
- .app-container-table-select-item-active{
- font-weight: 700;
- font-size: 17px;
- line-height: 22px;
- color: #2980FF;
- padding-bottom: 16px;
- //margin-bottom: -4px;
- border-bottom: 4px solid #2980FF;
- cursor: pointer;
- white-space:nowrap;
- margin-bottom: 20px;
- }
- }
- .app-container-table-screening{
- display: flex;
- align-items: center;
- gap:100px;
- padding: 20px 0;
- margin: 20px 0;
- border-top: 1px solid #f5f5f5;
- border-bottom: 1px solid #f5f5f5;
- .app-container-table-screening-item{
- display: flex;
- align-items: center;
- gap:6px;
- font-weight: 400;
- font-size: 15px;
- line-height: 20px;
- color: #4d4d4e;
- }
- }
- .app-container-table-main {
- .accountAddress{
- display: flex;
- align-items: center;
- gap:12px;
- margin-left: 14px;
- .img{
- width: 26px;
- height: 26px;
- background: black;
- border-radius: 50%;
- }
- .walletName{
- font-weight: 700;
- font-size: 15px;
- line-height: 20px;
- color: #181818;
- }
- .walletAddress{
- font-weight: 400;
- font-size: 15px;
- line-height: 20px;
- color: #181818;
- }
- }
- .gas{
- font-weight: 700;
- font-size: 17px;
- line-height: 22px;
- color: #2980FF;
- }
- .type{
- .bulk{
- width: fit-content;
- display: flex;
- align-items: center;
- justify-content: center;
- gap:4px;
- padding: 5px 10px;
- border: 1px solid #E0E0E0;
- border-radius: 30px;
- background: #edf2ff;
- font-weight: 400;
- font-size: 12px;
- line-height: 16px;
- color: #222222;
- }
- .boutique {
- width: fit-content;
- display: flex;
- align-items: center;
- justify-content: center;
- gap:4px;
- padding: 5px 10px;
- border-radius: 30px;
- background: #222222;
- font-weight: 700;
- font-size: 12px;
- line-height: 16px;
- color: #F2C94C;
- }
- }
- .lastTime{
- font-weight: 400;
- font-size: 14px;
- line-height: 18px;
- color: #898a8c;
- }
- .view{
- font-weight: 700;
- font-size: 14px;
- line-height: 18px;
- color: #2980FF;
- margin-right: 14px;
- cursor: pointer;
- }
- .pagination{
- position: fixed;
- bottom:36px
- }
- }
- }
- .drawerView-container{
- display: flex;
- flex-direction: column;
- height: 100vh;
- .drawerView-container-head{
- padding: 56px 40px;
- background: #FFFFFF;
- .drawerView-container-title{
- font-weight: 700;
- font-size: 21px;
- line-height: 28px;
- color: #181818;
- margin-bottom: 8px;
- }
- .drawerView-container-walletAddress{
- font-weight: 400;
- font-size: 12px;
- line-height: 16px;
- color: #94c0ff;
- margin-bottom: 24px;
- }
- .drawerView-container-statistics{
- display: flex;
- align-items: center;
- gap:80px;
- .drawerView-container-statistics-item{
- display: flex;
- flex-direction: column;
- gap: 4px;
- .drawerView-container-statistics-item-title{
- font-weight: 400;
- font-size: 15px;
- line-height: 20px;
- color: #8c8c8c;
- }
- .drawerView-container-statistics-item-amounts{
- font-weight: 700;
- color: #222222;
- .number{
- font-size: 17px;
- line-height: 22px;
- }
- .currency{
- font-size: 12px;
- line-height: 16px;
- }
- }
- }
- }
- }
- .drawerView-container-main{
- padding: 36px 40px;
- background: #f9fbff;
- flex-grow: 1;
- .drawerView-container-title{
- font-weight: 700;
- font-size: 21px;
- line-height: 28px;
- color: #181818;
- margin-bottom: 8px;
- }
- .drawerView-container-total{
- font-weight: 700;
- font-size: 12px;
- line-height: 16px;
- color: #8e8f91;
- }
- .drawerView-container-table-screening{
- margin-top: 28px;
- margin-bottom: 24px;
- height: 52px;
- display: flex;
- align-items: center;
- gap:60px;
- border-bottom: 1px solid #f5f5f5;
- border-top: 1px solid #f5f5f5;
- .drawerView-container-table-screening-item{
- display: flex;
- align-items: center;
- gap:6px;
- font-weight: 400;
- font-size: 15px;
- line-height: 20px;
- color: #4d4d4e;
- white-space: nowrap;
- }
- }
- .drawerView-container-table-main{
- display: flex;
- flex-direction: column;
- gap:16px;
- .drawerView-container-table-main-item{
- display: flex;
- align-items: center;
- height: 30px;
- .activity{
- width: 120px;
- .activity-item{
- width: 72px;
- height: 30px;
- border-radius: 30px;
- font-weight: 700;
- font-size: 14px;
- line-height: 18px;
- color: #222222;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- }
- .time{
- font-weight: 400;
- font-size: 15px;
- line-height: 20px;
- color: #ABABAB;
- width: 200px;
- }
- .link{
- font-weight: 400;
- font-size: 15px;
- line-height: 20px;
- color: #2980FF;
- white-space: nowrap;
- }
- .balance{
- font-weight: 700;
- font-size: 15px;
- line-height: 20px;
- color: #222222;
- width: 120px;
- }
- .gas{
- font-weight: 700;
- font-size: 15px;
- line-height: 20px;
- color: #222222;
- width: 120px;
- }
- }
- }
- }
- .drawerView-container-footer {
- height: 84px;
- padding: 30px 10px;
- display: flex;
- align-items: center;
- //justify-content: space-around;
- .pagination{
- width: 250px;
- }
- .manageAccount{
- display: flex;
- align-items: center;
- gap:12px;
- font-weight: 700;
- font-size: 17px;
- line-height: 22px;
- color: #222222;
- }
- .disassociation{
- display: flex;
- align-items: center;
- gap:12px;
- font-weight: 700;
- font-size: 17px;
- line-height: 22px;
- color: #EB5757;
- }
- }
- }
- .drawerAddress-container{
- display: flex;
- flex-direction: column;
- height: 100vh;
- overflow: auto;
- .drawerAddress-container-head{
- padding: 56px 40px;
- background: #FFFFFF;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .drawerAddress-container-head-left{
- .drawerAddress-container-title{
- font-weight: 700;
- font-size: 21px;
- line-height: 28px;
- color: #181818;
- margin-bottom: 8px;
- }
- .drawerAddress-container-tip{
- font-weight: 700;
- font-size: 12px;
- line-height: 16px;
- color: #919191;
- }
- }
- .drawerAddress-container-head-right{
- display: flex;
- align-items: center;
- gap:48px;
- .cancellation{
- width: 118px;
- height: 52px;
- background: #E0E0E0;
- border-radius: 10px;
- gap: 4px;
- display: flex;
- align-items: center;
- justify-content: center;
- font-weight: 700;
- font-size: 15px;
- line-height: 20px;
- color: #828282;
- }
- .complete{
- width: 118px;
- height: 52px;
- border: 2px solid #4A76FF;
- border-radius: 10px;
- gap:4px;
- display: flex;
- align-items: center;
- justify-content: center;
- font-weight: 700;
- font-size: 15px;
- line-height: 20px;
- color: #2980FF;
- cursor: pointer;
- }
- }
- }
- .drawerAddress-container-main{
- padding: 36px 40px;
- background: #f9fbff;
- flex-grow: 1;
- display: flex;
- flex-direction: column;
- gap:20px;
- .item{
- display: flex;
- flex-direction: column;
- gap:12px;
- .title{
- display: flex;
- align-items: center;
- justify-content: space-between;
- .name{
- font-weight: 400;
- font-size: 17px;
- line-height: 22px;
- color: #181818;
- }
- .delete{
- display: flex;
- align-items: center;
- gap:4px;
- font-weight: 700;
- font-size: 15px;
- line-height: 20px;
- color: #EB5757;
- cursor: pointer;
- }
- }
- .input{
- display: flex;
- align-items: center;
- gap:24px;
- }
- }
- .addAddress{
- display: flex;
- align-items: center;
- gap:12px;
- font-weight: 700;
- font-size: 17px;
- line-height: 22px;
- color: #2980FF;
- cursor: pointer;
- }
- }
- }
- .drawerImport-container{
- display: flex;
- flex-direction: column;
- height: 100vh;
- .drawerImport-container-head{
- padding: 56px 40px;
- background: #FFFFFF;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .drawerImport-container-head-left{
- .drawerImport-container-title{
- font-weight: 700;
- font-size: 21px;
- line-height: 28px;
- color: #181818;
- margin-bottom: 8px;
- }
- .drawerImport-container-tip{
- font-weight: 400;
- font-size: 12px;
- line-height: 16px;
- color: #919191;
- }
- }
- }
- .drawerImport-container-main{
- padding: 36px 40px;
- background: #f9fbff;
- flex-grow: 1;
- .select{
- display: flex;
- align-items: center;
- gap:56px;
- border-bottom: 4px solid #f2f4f7;
- margin-bottom: 40px;
- .select-item{
- font-weight: 400;
- font-size: 17px;
- line-height: 22px;
- color: #ABABAB;
- padding-bottom: 16px;
- margin-bottom: -4px;
- border-bottom: 4px solid #f2f4f7;
- cursor: pointer;
- }
- .select-item-active{
- font-weight: 700;
- font-size: 17px;
- line-height: 22px;
- color: #2980FF;
- padding-bottom: 16px;
- margin-bottom: -4px;
- border-bottom: 4px solid #2980FF;
- cursor: pointer;
- }
- }
- .inputTitle{
- font-weight: 500;
- font-size: 14px;
- line-height: 18px;
- color: #383838;
- margin-bottom: 12px;
- }
- .confirm{
- width: 100%;
- height: 53px;
- background: #2980FF;
- display: flex;
- align-items: center;
- justify-content: center;
- gap:8px;
- margin-top: 28px;
- cursor: pointer;
- font-weight: 700;
- font-size: 16px;
- line-height: 21px;
- color: #FFFFFF;
- }
- .importWallet{
- .upload{
- display: flex;
- justify-content: center;
- margin-bottom: 40px;
- }
- .batchWalletName{
- display: flex;
- align-items: center;
- gap:20px;
- margin-bottom: 28px;
- }
- }
- .createWallet{
- .inputBox{
- display: flex;
- gap:20px;
- margin-top: 28px;
- width: 100%;
- }
- .tip{
- display: flex;
- flex-direction: column;
- gap:9px;
- margin-top: 36px;
- .title{
- display: flex;
- align-items: center;
- gap:4px;
- font-weight: 700;
- font-size: 17px;
- line-height: 22px;
- color: #EB5757;
- }
- .description{
- font-weight: 400;
- font-size: 14px;
- line-height: 18px;
- color: #EB5757;
- }
- }
- }
- .completeTip{
- display: flex;
- align-items: center;
- justify-content: center;
- gap:8px;
- .description{
- display: flex;
- flex-direction: column;
- gap:8px;
- .address{
- font-weight: 700;
- font-size: 21px;
- line-height: 28px;
- color: #181818;
- }
- .tip{
- font-weight: 400;
- font-size: 14px;
- line-height: 18px;
- color: #8e8f91;
- }
- }
- }
- .addressListBox{
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- margin-top: 20px;
- .addressList{
- width: 402px;
- background: #FFFFFF;
- border: 1px solid #F5F5F5;
- border-radius: 6px;
- padding: 20px 34px;
- display: flex;
- flex-direction: column;
- gap:8px;
- .addressList-item{
- display: flex;
- flex-direction: column;
- gap:4px;
- .name{
- font-weight: 400;
- font-size: 12px;
- line-height: 16px;
- color: #9c9c9c;
- }
- .address{
- display: flex;
- align-items: center;
- justify-content: space-between;
- font-weight: 500;
- font-size: 12px;
- line-height: 16px;
- color: #212121;
- cursor: pointer;
- }
- }
- .pagination{
- display: flex;
- justify-content: center;
- margin-top: 20px;
- }
- }
- }
- }
- .drawerImport-container-footer{
- width: 100%;
- height: 84px;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- padding: 0 40px;
- gap:60px;
- .exportAddress{
- display: flex;
- align-items: center;
- gap:12px;
- font-weight: 700;
- font-size: 17px;
- line-height: 22px;
- color: #2980FF;
- }
- .download{
- display: flex;
- align-items: center;
- gap:12px;
- font-weight: 700;
- font-size: 17px;
- line-height: 22px;
- color: #222222;
- cursor: pointer;
- }
- }
- }
- }
- ::v-deep .el-table__body{
- -webkit-border-vertical-spacing: 20px;
- background: #f9fbff;
- }
- ::v-deep .el-table__row{
- border-radius: 10px;
- background: white;
- height: 58px;
- }
- ::v-deep .el-table__row>td{
- border: none;
- }
- ::v-deep .el-table th.is-leaf{
- border: none;
- font-weight: 400;
- font-size: 14px;
- line-height: 18px;
- color: #4d4d4e ;
- }
- ::v-deep .el-table::before{
- height: 0;
- }
- </style>
|