index.vue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485
  1. <template>
  2. <div class="app-container">
  3. <div class="app-container-head">
  4. <div class="app-container-head-left">
  5. <div class="app-container-head-left-item">
  6. <div class="app-container-head-left-item-count">
  7. {{ (count.batchCount + count.premiumCount) || 0 }}
  8. </div>
  9. <div class="app-container-head-left-item-name">
  10. 所有
  11. </div>
  12. </div>
  13. <div class="app-container-head-left-divider"/>
  14. <div class="app-container-head-left-item">
  15. <div class="app-container-head-left-item-count">
  16. {{ count.batchCount }}
  17. </div>
  18. <div class="app-container-head-left-item-name">
  19. 批处理账户
  20. </div>
  21. </div>
  22. <div class="app-container-head-left-divider"/>
  23. <div class="app-container-head-left-item">
  24. <div class="app-container-head-left-item-count">
  25. {{ count.premiumCount }}
  26. </div>
  27. <div class="app-container-head-left-item-name">
  28. 精品账户
  29. </div>
  30. </div>
  31. </div>
  32. <div class="app-container-head-right">
  33. <div class="app-container-head-right-button1" @click="exportAddress">
  34. 导出地址
  35. </div>
  36. <div class="app-container-head-right-button1" @click="downloadAddress()">
  37. 下载 KeyStore
  38. </div>
  39. <div class="app-container-head-right-button1" @click="drawerImport = true">
  40. <img src="../../assets/address/upload.svg" alt="upload">
  41. 导入
  42. </div>
  43. <div class="app-container-head-right-button2" @click="drawerAddress = true">
  44. <img src="../../assets/address/eyeglasses.svg" alt="eyeglasses">
  45. 观察地址
  46. </div>
  47. </div>
  48. </div>
  49. <div class="app-container-table">
  50. <div class="app-container-table-title">
  51. <div class="app-container-table-title-left">
  52. 地址列表
  53. </div>
  54. </div>
  55. <div class="app-container-table-select">
  56. <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'">
  57. {{item}}
  58. </div>
  59. </div>
  60. <div class="app-container-table-screening">
  61. <div class="app-container-table-screening-item">
  62. 时间
  63. <img src="../../assets/address/unfold_more.svg" alt="unfold_more">
  64. </div>
  65. <div class="app-container-table-screening-item">
  66. Gas消耗
  67. <img src="../../assets/address/unfold_more.svg" alt="unfold_more">
  68. </div>
  69. </div>
  70. <div class="app-container-table-main">
  71. <el-table
  72. :data="tableData"
  73. style="width: 100%">
  74. <el-table-column
  75. label="账户地址"
  76. width="600">
  77. <template v-slot="scope">
  78. <div class="accountAddress">
  79. <div class="img">
  80. </div>
  81. <div class="walletName" v-if="scope.row.addressType === 0">
  82. {{scope.row.groupName}}
  83. </div>
  84. <div class="walletName" v-if="scope.row.addressType === 1">
  85. {{scope.row.groupName}}-{{(scope.$index+1) + (table.page-1)*5}}
  86. </div>
  87. <div class="walletAddress">
  88. {{scope.row.address}}
  89. </div>
  90. </div>
  91. </template>
  92. </el-table-column>
  93. <el-table-column
  94. label="Gas消耗/USDT"
  95. width="250">
  96. <template v-slot="scope">
  97. <div class="gas">
  98. {{scope.row.totalGas}}
  99. </div>
  100. </template>
  101. </el-table-column>
  102. <el-table-column
  103. label="type"
  104. width="255">
  105. <template v-slot="scope">
  106. <div class="type">
  107. <div class="bulk" v-if="table.walletNameGroupIndex !== 0">
  108. <img src="../../assets/address/precision_manufacturing.svg" alt="precision_manufacturing">
  109. 批量
  110. </div>
  111. <div class="boutique" v-if="table.walletNameGroupIndex === 0">
  112. <img src="../../assets/address/award_star.svg" alt="award_star">
  113. 精品号
  114. </div>
  115. </div>
  116. </template>
  117. </el-table-column>
  118. <el-table-column
  119. label="最后操作时间"
  120. width="180">
  121. <template v-slot="scope">
  122. <div class="lastTime">
  123. {{scope.row.lastOperTime}}
  124. </div>
  125. </template>
  126. </el-table-column>
  127. <el-table-column align="right">
  128. <template v-slot="scope">
  129. <div class="view" @click="viewAddress(scope.row)">
  130. 查看
  131. </div>
  132. </template>
  133. </el-table-column>
  134. </el-table>
  135. <div class="pagination">
  136. <el-pagination
  137. small
  138. layout="prev, pager, next"
  139. :hide-on-single-page="false"
  140. :page-size="table.pageSize"
  141. :total="table.total"
  142. :current-page.sync="table.page"
  143. @current-change="pageChange">
  144. </el-pagination>
  145. </div>
  146. </div>
  147. </div>
  148. <el-drawer
  149. :visible.sync="drawerView"
  150. :with-header="false">
  151. <div class="drawerView-container">
  152. <div class="drawerView-container-head">
  153. <div class="drawerView-container-title">
  154. 钱包名称
  155. </div>
  156. <div class="drawerView-container-walletAddress">
  157. {{drawerViewData.address}}
  158. </div>
  159. <div class="drawerView-container-statistics">
  160. <div class="drawerView-container-statistics-item">
  161. <div class="drawerView-container-statistics-item-title">
  162. 累计花费
  163. </div>
  164. <div class="drawerView-container-statistics-item-amounts">
  165. <span class="number">{{drawerViewData.gas}}</span>
  166. <span class="currency">USDT</span>
  167. </div>
  168. </div>
  169. <div class="drawerView-container-statistics-item">
  170. <div class="drawerView-container-statistics-item-title">
  171. 剩余本金
  172. </div>
  173. <div class="drawerView-container-statistics-item-amounts">
  174. <span class="number">{{drawerViewData.balance}}</span>
  175. <span class="currency">USDT</span>
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. <div class="drawerView-container-main">
  181. <div class="drawerView-container-title">
  182. 钱包活动
  183. </div>
  184. <div class="drawerView-container-total">
  185. 总计钱包: {{drawerViewData.total}}
  186. </div>
  187. <div class="drawerView-container-table-screening">
  188. <div class="drawerView-container-table-screening-item">
  189. 钱包活动
  190. <img src="../../assets/address/filter_list.svg" alt="filter_list">
  191. </div>
  192. <div class="drawerView-container-table-screening-item">
  193. 时间
  194. <img src="../../assets/address/filter_list.svg" alt="filter_list">
  195. </div>
  196. <div class="drawerView-container-table-screening-item" style="margin-left: 26px;margin-right: -10px">
  197. Gas
  198. <img src="../../assets/address/unfold_more.svg" alt="unfold_more">
  199. </div>
  200. <div class="drawerView-container-table-screening-item">
  201. 交易金额
  202. <img src="../../assets/address/unfold_more.svg" alt="unfold_more">
  203. </div>
  204. </div>
  205. <div class="drawerView-container-table-main">
  206. <div v-for="item in drawerViewData.table" class="drawerView-container-table-main-item">
  207. <div class="activity">
  208. <div class="activity-item" v-if="item.taskType !== 'SWAP'" style="background: #F2C94C;">
  209. {{item.taskName}}
  210. </div>
  211. <div class="activity-item" v-if="item.taskType === 'SWAP'" style="background: #6FCF97;">
  212. {{item.taskName}}
  213. </div>
  214. </div>
  215. <div class="time">
  216. {{item.createTime}}
  217. </div>
  218. <div class="gas">
  219. {{parseFloat(item.gas).toFixed(4)}}
  220. </div>
  221. <div class="balance">
  222. {{parseFloat(item.amount).toFixed(4)}}
  223. </div>
  224. <div class="link">
  225. 详情
  226. </div>
  227. </div>
  228. </div>
  229. </div>
  230. <div class="drawerView-container-footer">
  231. <div class="pagination">
  232. <el-pagination
  233. small
  234. layout="prev, pager, next"
  235. :page-size="10"
  236. :total="drawerViewData.total">
  237. </el-pagination>
  238. </div>
  239. <!-- <div class="manageAccount">-->
  240. <!-- <img src="../../assets/address/page_info.svg" alt="page_info">-->
  241. <!-- 管理账号-->
  242. <!-- </div>-->
  243. <!-- <div class="disassociation">-->
  244. <!-- <img src="../../assets/address/link_off.svg" alt="link_off">-->
  245. <!-- 取消关联-->
  246. <!-- </div>-->
  247. </div>
  248. </div>
  249. </el-drawer>
  250. <el-drawer
  251. :visible.sync="drawerAddress"
  252. :with-header="false">
  253. <div class="drawerAddress-container">
  254. <div class="drawerAddress-container-head">
  255. <div class="drawerAddress-container-head-left">
  256. <div class="drawerAddress-container-title">
  257. 添加地址
  258. </div>
  259. <div class="drawerAddress-container-tip">
  260. 添加观察地址
  261. </div>
  262. </div>
  263. <div class="drawerAddress-container-head-right">
  264. <div class="complete" @click="addBoutiqueAccount">
  265. <img src="../../assets/address/done_all.svg" alt="done_all">
  266. 完成
  267. </div>
  268. </div>
  269. </div>
  270. <div class="drawerAddress-container-main">
  271. <div class="item" v-for="(item,index) in addressArr">
  272. <div class="title">
  273. <div class="name">
  274. 钱包地址
  275. </div>
  276. <div class="delete" @click="addressArrDelete(index)">
  277. <img src="../../assets/address/delete.svg" alt="delete">
  278. 删除
  279. </div>
  280. </div>
  281. <div class="input">
  282. <el-select v-model="item.chainId" placeholder="选择公链">
  283. <el-option
  284. v-for="item in options"
  285. :key="item.value"
  286. :label="item.label"
  287. :value="item.value">
  288. </el-option>
  289. </el-select>
  290. <el-input v-model="item.groupName" placeholder="输入钱包名称"></el-input>
  291. </div>
  292. <div class="input">
  293. <el-input v-model="item.address" placeholder="输入钱包地址"></el-input>
  294. </div>
  295. </div>
  296. <div class="addAddress" @click="addressArrPush">
  297. <img src="../../assets/address/add_circle.svg" alt="add_circle">
  298. 新增观察地址
  299. </div>
  300. </div>
  301. </div>
  302. </el-drawer>
  303. <el-drawer
  304. :visible.sync="drawerImport"
  305. :with-header="false"
  306. @closed="completeGeneration = false">
  307. <div class="drawerImport-container">
  308. <div class="drawerImport-container-head">
  309. <div class="drawerImport-container-head-left">
  310. <div class="drawerImport-container-title">
  311. 导入钱包地址
  312. </div>
  313. <div class="drawerImport-container-tip">
  314. 仅支持Keystore导入
  315. </div>
  316. </div>
  317. </div>
  318. <div class="drawerImport-container-main" v-if="!completeGeneration">
  319. <div class="select">
  320. <div :class="drawerImportSelect === 0 ? 'select-item-active' : 'select-item'" @click="drawerImportSelect = 0">
  321. 导入钱包
  322. </div>
  323. <div :class="drawerImportSelect === 1 ? 'select-item-active' : 'select-item'" @click="drawerImportSelect = 1">
  324. 创建钱包
  325. </div>
  326. </div>
  327. <div class="importWallet" v-if="drawerImportSelect === 0">
  328. <div class="upload">
  329. <el-upload
  330. class="upload-demo"
  331. drag
  332. action="https://jsonplaceholder.typicode.com/posts/"
  333. multiple>
  334. <i class="el-icon-upload"></i>
  335. <div class="el-upload__text">将Keystore文件拖到此处,或<em>上传文件</em></div>
  336. </el-upload>
  337. </div>
  338. <div class="inputTitle">
  339. 批量钱包名称
  340. </div>
  341. <div class="batchWalletName">
  342. <el-input v-model="input" placeholder="选择/输入批量钱包名称"></el-input>
  343. <el-select v-model="value" placeholder="选择类型">
  344. <el-option
  345. v-for="item in options"
  346. :key="item.value"
  347. :label="item.label"
  348. :value="item.value">
  349. </el-option>
  350. </el-select>
  351. </div>
  352. <div class="inputTitle">
  353. 钱包密码
  354. </div>
  355. <el-input v-model="input" placeholder="设置钱包密码"></el-input>
  356. <div class="confirm">
  357. <img src="../../assets/address/file_download_done.svg" alt="file_download_done">
  358. 确认导入
  359. </div>
  360. </div>
  361. <div class="createWallet" v-if="drawerImportSelect === 1">
  362. <div class="inputTitle">
  363. 批量钱包名称
  364. </div>
  365. <el-input v-model="batchAddressObj.groupName" placeholder="输入批量钱包名称"></el-input>
  366. <div class="inputBox">
  367. <div>
  368. <div class="inputTitle">
  369. 选择公链
  370. </div>
  371. <el-select style="width: 280px" v-model="batchAddressObj.chainId" placeholder="选择类型">
  372. <el-option
  373. v-for="item in options"
  374. :key="item.value"
  375. :label="item.label"
  376. :value="item.value">
  377. </el-option>
  378. </el-select>
  379. </div>
  380. <div>
  381. <div class="inputTitle">
  382. 生成数量
  383. </div>
  384. <el-input style="width: 230px" v-model="batchAddressObj.numWallet" placeholder="输入生成数量"></el-input>
  385. </div>
  386. </div>
  387. <div class="inputBox">
  388. <div>
  389. <div class="inputTitle">
  390. 钱包密码
  391. </div>
  392. <el-input style="width: 280px" auto-complete="new-password" v-model="batchAddressObj.password" placeholder="设置钱包密码" show-password></el-input>
  393. </div>
  394. <div>
  395. <div class="inputTitle">
  396. 确认钱包密码
  397. </div>
  398. <el-input style="width: 230px" auto-complete="new-password" v-model="batchAddressObj.verifyPassword" placeholder="设置钱包密码" show-password></el-input>
  399. </div>
  400. </div>
  401. <div class="confirm" @click="addBatchAddress">
  402. <img v-if="!confirmLoading" src="../../assets/address/Stroke-2.svg" alt="Stroke">
  403. <div v-if="confirmLoading" style="width: 20px;height: 20px;margin-top: -2px">
  404. <Loading/>
  405. </div>
  406. 开始生成
  407. </div>
  408. <div class="tip">
  409. <div class="title">
  410. <img src="../../assets/address/tips_and_updates.svg" alt="tips_and_updates">
  411. 提示
  412. </div>
  413. <div class="description">
  414. 此密码为您账户钱包的 Keystore 密码,请妥善保管,
  415. 系统无法为您找回。
  416. </div>
  417. </div>
  418. </div>
  419. </div>
  420. <div class="drawerImport-container-main" v-if="completeGeneration">
  421. <div class="completeTip">
  422. <img src="../../assets/address/Rectangle.png" alt="Rectangle">
  423. <div class="description">
  424. <div class="address">
  425. 成功生成 {{addressList.length}} 个钱包地址
  426. </div>
  427. <div class="tip">
  428. 请牢记您的 Keystore 文件及密码,系统无法帮你找回
  429. </div>
  430. </div>
  431. </div>
  432. <div class="addressListBox">
  433. <div class="addressList">
  434. <div class="addressList-item" v-for="(item,index) in addressList">
  435. <div class="name">
  436. Address-{{index+1}}
  437. </div>
  438. <div class="address" @click="copyAddress(item)">
  439. {{item}}
  440. <img src="../../assets/address/content_copy.svg" alt="content_copy">
  441. </div>
  442. </div>
  443. <div class="pagination">
  444. <el-pagination
  445. small
  446. layout="prev, pager, next"
  447. :total="addressList.length">
  448. </el-pagination>
  449. </div>
  450. </div>
  451. </div>
  452. </div>
  453. <div class="drawerImport-container-footer" v-if="completeGeneration">
  454. <div class="exportAddress">
  455. <img src="../../assets/address/upload.svg" alt="upload">
  456. 导出地址
  457. </div>
  458. <div class="download" @click="downloadAddress(batchAddressObj.groupName)">
  459. <img src="../../assets/address/download.svg" alt="download">
  460. 下载Keystore
  461. </div>
  462. </div>
  463. </div>
  464. </el-drawer>
  465. </div>
  466. </template>
  467. <script>
  468. import {
  469. addPremiumAddress,
  470. batchAddress,
  471. getCountAddress, getEventRecord,
  472. getGroupList,
  473. pageAddress
  474. } from '@/api/adress'
  475. import Axios from "axios";
  476. import Loading from "@/components/Loading";
  477. import {saveAs} from 'file-saver';
  478. export default {
  479. components: {Loading},
  480. data() {
  481. return {
  482. table:{
  483. page:1,
  484. pageSize:5,
  485. walletNameGroup:['精品号'],
  486. walletNameGroupIndex:0,
  487. total:0
  488. },
  489. count:{
  490. batchCount:0,
  491. premiumCount:0
  492. },
  493. tableData: [],
  494. exportTableData:[],
  495. drawerView:false,
  496. drawerViewData:{
  497. address:'',
  498. table:[],
  499. gas:0,
  500. balance:0,
  501. total:0
  502. },
  503. drawerAddress:false,
  504. addressArr:[
  505. {
  506. chainId:'',
  507. address:'',
  508. groupName:''
  509. }
  510. ],
  511. batchAddressObj:{
  512. chainId:'',
  513. groupName:'',
  514. numWallet:1,
  515. password:'',
  516. verifyPassword:''
  517. },
  518. options: [{
  519. value: '1',
  520. label: 'ETH'
  521. }],
  522. value: '',
  523. input: '',
  524. drawerImport:false,
  525. drawerImportSelect:1,
  526. completeGeneration:false,
  527. addressList:[],
  528. confirmLoading:false,
  529. url: process.env.VUE_APP_BASE_API,
  530. }
  531. },
  532. created() {
  533. this.getAddressGroupList();
  534. this.getCount()
  535. },
  536. methods: {
  537. getAddressGroupList(){
  538. getGroupList().then(res=>{
  539. this.table.walletNameGroup.push(...res)
  540. this.getAddressGroupAddress()
  541. })
  542. },
  543. getAddressGroupAddress(){
  544. let params
  545. if(this.table.walletNameGroupIndex === 0){
  546. params = {
  547. page:this.table.page,
  548. pageSize:this.table.pageSize,
  549. addressType:0
  550. }
  551. }else {
  552. params = {
  553. page:this.table.page,
  554. pageSize:this.table.pageSize,
  555. groupName:this.table.walletNameGroup[this.table.walletNameGroupIndex]
  556. }
  557. }
  558. pageAddress(params).then(res=>{
  559. this.tableData = res.records
  560. this.table.total = res.total
  561. })
  562. },
  563. selectAddressGroup(index){
  564. this.table.walletNameGroupIndex = index
  565. this.table.page = 1
  566. this.getAddressGroupAddress()
  567. },
  568. viewAddress(row){
  569. let params = {
  570. page:1,
  571. pageSize:10,
  572. queryValue:row.address
  573. }
  574. getEventRecord(params).then(res=>{
  575. this.drawerViewData.address = row.address
  576. this.drawerViewData.gas = row.totalGas
  577. this.drawerViewData.total = res.total
  578. this.drawerViewData.table = res.records
  579. this.drawerView = true
  580. })
  581. },
  582. addBoutiqueAccount(){
  583. let params = this.addressArr
  584. addPremiumAddress(params).then(()=>{
  585. this.success('添加地址成功')
  586. this.drawerAddress = false
  587. let obj = {
  588. chainId:'',
  589. address:'',
  590. groupName:''
  591. }
  592. this.addressArr = [obj]
  593. this.getAddressGroupAddress()
  594. })
  595. },
  596. addressArrPush(){
  597. let obj = {
  598. chainId:'',
  599. address:'',
  600. groupName:''
  601. }
  602. this.addressArr.push(obj)
  603. },
  604. addressArrDelete(index){
  605. this.addressArr.splice(index,1)
  606. },
  607. getCount(){
  608. getCountAddress().then(res=>{
  609. this.count.batchCount = res.batchCount
  610. this.count.premiumCount = res.premiumCount
  611. })
  612. },
  613. pageChange(page){
  614. this.table.page = page
  615. this.getAddressGroupAddress()
  616. },
  617. addBatchAddress(){
  618. if(this.batchAddressObj.password !== this.batchAddressObj.verifyPassword){
  619. this.error('密码不一致')
  620. return
  621. }
  622. let params = this.batchAddressObj
  623. this.confirmLoading = true
  624. batchAddress(params).then(res=>{
  625. this.addressList = res
  626. this.completeGeneration = true
  627. this.confirmLoading = true
  628. })
  629. },
  630. downloadAddress(el) {
  631. let groupName = this.table.walletNameGroup[this.table.walletNameGroupIndex]
  632. if(el){
  633. groupName = el
  634. }
  635. Axios.post(
  636. this.url + "ams/address/download/batch-keystore",
  637. {
  638. groupName: groupName,
  639. },
  640. {
  641. responseType: "arraybuffer",
  642. headers: {
  643. "Conntent-Type": "application/json; application/octet-stream;",
  644. },
  645. }
  646. )
  647. .then((response) => {
  648. let buffer = response.data;
  649. let view = new DataView(buffer);
  650. let str = "";
  651. for (let i = 0; i < view.byteLength; i++) {
  652. str += String.fromCharCode(view.getUint8(i));
  653. }
  654. if (str.includes(".json")) {
  655. this.downloadFile(response.data,groupName);
  656. } else {
  657. const data = JSON.parse(str);
  658. this.$message.error(data.message);
  659. }
  660. })
  661. .catch((e) => {
  662. this.$message.error(e);
  663. });
  664. },
  665. downloadFile(data,groupName) {
  666. let blob = new Blob([data], { type: "application/zip" });
  667. let url = window.URL.createObjectURL(blob);
  668. const link = document.createElement("a"); // 创建a标签
  669. link.href = url;
  670. link.download = groupName + ".zip";
  671. link.click();
  672. URL.revokeObjectURL(url); // 释放内存
  673. this.downloadModal = false;
  674. },
  675. exportAddress() {
  676. let params
  677. if(this.table.walletNameGroupIndex === 0){
  678. params = {
  679. page:1,
  680. pageSize:1000,
  681. addressType:0
  682. }
  683. }else {
  684. params = {
  685. page:1,
  686. pageSize:1000,
  687. groupName:this.table.walletNameGroup[this.table.walletNameGroupIndex]
  688. }
  689. }
  690. pageAddress(params).then(res=>{
  691. this.exportTableData = res.records
  692. this.exportTableData.forEach(item=>{
  693. })
  694. })
  695. },
  696. copyAddress(el){
  697. let address = el
  698. if (navigator.clipboard) {
  699. navigator.clipboard.writeText(address);
  700. this.success('复制成功')
  701. } else {
  702. let textarea = document.createElement('textarea');
  703. document.body.appendChild(textarea);
  704. // 隐藏此输入框
  705. textarea.style.position = 'fixed';
  706. textarea.style.clip = 'rect(0 0 0 0)';
  707. textarea.style.top = '10px';
  708. // 赋值
  709. textarea.value = address;
  710. // 选中
  711. textarea.select();
  712. // 复制
  713. document.execCommand('copy', true);
  714. // 移除输入框
  715. document.body.removeChild(textarea);
  716. this.success('复制成功')
  717. }
  718. },
  719. success(message) {
  720. this.$notify({
  721. title: '成功',
  722. message: message,
  723. type: 'success'
  724. });
  725. },
  726. error(message) {
  727. this.$notify.error({
  728. title: '错误',
  729. message: message
  730. });
  731. }
  732. }
  733. }
  734. </script>
  735. <style lang="scss" scoped>
  736. .app-container{
  737. .app-container-head{
  738. display: flex;
  739. justify-content: space-between;
  740. align-items: center;
  741. .app-container-head-left{
  742. display: flex;
  743. justify-content: space-between;
  744. align-items: center;
  745. gap:60px;
  746. .app-container-head-left-item{
  747. display: flex;
  748. flex-direction: column;
  749. gap:8px;
  750. .app-container-head-left-item-count{
  751. font-weight: 700;
  752. font-size: 21px;
  753. line-height: 28px;
  754. color: #181818;
  755. }
  756. .app-container-head-left-item-name{
  757. font-weight: 700;
  758. font-size: 12px;
  759. line-height: 16px;
  760. color: #8e8f91;
  761. }
  762. }
  763. .app-container-head-left-divider{
  764. width: 1px;
  765. height: 50px;
  766. border-right:1px solid #e4e6ea;
  767. }
  768. }
  769. .app-container-head-right{
  770. display: flex;
  771. align-items: center;
  772. gap:24px;
  773. .app-container-head-right-button1{
  774. width: 148px;
  775. height: 52px;
  776. display: flex;
  777. flex-direction: row;
  778. justify-content: center;
  779. align-items: center;
  780. gap: 4px;
  781. background: #f9fbff;
  782. border-radius: 10px;
  783. font-weight: 700;
  784. font-size: 15px;
  785. line-height: 20px;
  786. color: #2980ff;
  787. border: 1px solid #2980FF;
  788. cursor: pointer;
  789. }
  790. .app-container-head-right-button2{
  791. width: 148px;
  792. height: 52px;
  793. display: flex;
  794. flex-direction: row;
  795. justify-content: center;
  796. align-items: center;
  797. gap: 4px;
  798. background: #4A76FF;
  799. border-radius: 10px;
  800. font-weight: 700;
  801. font-size: 15px;
  802. line-height: 20px;
  803. color: #FFFFFF;
  804. cursor: pointer;
  805. }
  806. }
  807. }
  808. .app-container-table{
  809. margin-top: 80px;
  810. .app-container-table-title{
  811. display: flex;
  812. align-items: center;
  813. justify-content: space-between;
  814. .app-container-table-title-left{
  815. font-weight: 700;
  816. font-size: 21px;
  817. line-height: 28px;
  818. color: #181818;
  819. }
  820. }
  821. .app-container-table-select{
  822. display: flex;
  823. align-items: center;
  824. gap:56px;
  825. border-bottom: 4px solid #f2f4f7;
  826. width: 100%;
  827. margin-top: 28px;
  828. .app-container-table-select-item{
  829. font-weight: 400;
  830. font-size: 17px;
  831. line-height: 22px;
  832. color: #ABABAB;
  833. padding-bottom: 16px;
  834. margin-bottom: -4px;
  835. border-bottom: 4px solid #f2f4f7;
  836. cursor: pointer;
  837. }
  838. .app-container-table-select-item-active{
  839. font-weight: 700;
  840. font-size: 17px;
  841. line-height: 22px;
  842. color: #2980FF;
  843. padding-bottom: 16px;
  844. margin-bottom: -4px;
  845. border-bottom: 4px solid #2980FF;
  846. cursor: pointer;
  847. }
  848. }
  849. .app-container-table-screening{
  850. display: flex;
  851. align-items: center;
  852. gap:100px;
  853. padding: 20px 0;
  854. margin: 20px 0;
  855. border-top: 1px solid #f5f5f5;
  856. border-bottom: 1px solid #f5f5f5;
  857. .app-container-table-screening-item{
  858. display: flex;
  859. align-items: center;
  860. gap:6px;
  861. font-weight: 400;
  862. font-size: 15px;
  863. line-height: 20px;
  864. color: #4d4d4e;
  865. }
  866. }
  867. .app-container-table-main {
  868. .accountAddress{
  869. display: flex;
  870. align-items: center;
  871. gap:12px;
  872. margin-left: 14px;
  873. .img{
  874. width: 26px;
  875. height: 26px;
  876. background: black;
  877. border-radius: 50%;
  878. }
  879. .walletName{
  880. font-weight: 700;
  881. font-size: 15px;
  882. line-height: 20px;
  883. color: #181818;
  884. }
  885. .walletAddress{
  886. font-weight: 400;
  887. font-size: 15px;
  888. line-height: 20px;
  889. color: #181818;
  890. }
  891. }
  892. .gas{
  893. font-weight: 700;
  894. font-size: 17px;
  895. line-height: 22px;
  896. color: #2980FF;
  897. }
  898. .type{
  899. .bulk{
  900. width: fit-content;
  901. display: flex;
  902. align-items: center;
  903. justify-content: center;
  904. gap:4px;
  905. padding: 5px 10px;
  906. border: 1px solid #E0E0E0;
  907. border-radius: 30px;
  908. background: #edf2ff;
  909. font-weight: 400;
  910. font-size: 12px;
  911. line-height: 16px;
  912. color: #222222;
  913. }
  914. .boutique {
  915. width: fit-content;
  916. display: flex;
  917. align-items: center;
  918. justify-content: center;
  919. gap:4px;
  920. padding: 5px 10px;
  921. border-radius: 30px;
  922. background: #222222;
  923. font-weight: 700;
  924. font-size: 12px;
  925. line-height: 16px;
  926. color: #F2C94C;
  927. }
  928. }
  929. .lastTime{
  930. font-weight: 400;
  931. font-size: 14px;
  932. line-height: 18px;
  933. color: #898a8c;
  934. }
  935. .view{
  936. font-weight: 700;
  937. font-size: 14px;
  938. line-height: 18px;
  939. color: #2980FF;
  940. margin-right: 14px;
  941. cursor: pointer;
  942. }
  943. .pagination{
  944. position: fixed;
  945. bottom:36px
  946. }
  947. }
  948. }
  949. .drawerView-container{
  950. display: flex;
  951. flex-direction: column;
  952. height: 100vh;
  953. .drawerView-container-head{
  954. padding: 56px 40px;
  955. background: #FFFFFF;
  956. .drawerView-container-title{
  957. font-weight: 700;
  958. font-size: 21px;
  959. line-height: 28px;
  960. color: #181818;
  961. margin-bottom: 8px;
  962. }
  963. .drawerView-container-walletAddress{
  964. font-weight: 400;
  965. font-size: 12px;
  966. line-height: 16px;
  967. color: #94c0ff;
  968. margin-bottom: 24px;
  969. }
  970. .drawerView-container-statistics{
  971. display: flex;
  972. align-items: center;
  973. gap:80px;
  974. .drawerView-container-statistics-item{
  975. display: flex;
  976. flex-direction: column;
  977. gap: 4px;
  978. .drawerView-container-statistics-item-title{
  979. font-weight: 400;
  980. font-size: 15px;
  981. line-height: 20px;
  982. color: #8c8c8c;
  983. }
  984. .drawerView-container-statistics-item-amounts{
  985. font-weight: 700;
  986. color: #222222;
  987. .number{
  988. font-size: 17px;
  989. line-height: 22px;
  990. }
  991. .currency{
  992. font-size: 12px;
  993. line-height: 16px;
  994. }
  995. }
  996. }
  997. }
  998. }
  999. .drawerView-container-main{
  1000. padding: 36px 40px;
  1001. background: #f9fbff;
  1002. flex-grow: 1;
  1003. .drawerView-container-title{
  1004. font-weight: 700;
  1005. font-size: 21px;
  1006. line-height: 28px;
  1007. color: #181818;
  1008. margin-bottom: 8px;
  1009. }
  1010. .drawerView-container-total{
  1011. font-weight: 700;
  1012. font-size: 12px;
  1013. line-height: 16px;
  1014. color: #8e8f91;
  1015. }
  1016. .drawerView-container-table-screening{
  1017. margin-top: 28px;
  1018. margin-bottom: 24px;
  1019. height: 52px;
  1020. display: flex;
  1021. align-items: center;
  1022. gap:60px;
  1023. border-bottom: 1px solid #f5f5f5;
  1024. border-top: 1px solid #f5f5f5;
  1025. .drawerView-container-table-screening-item{
  1026. display: flex;
  1027. align-items: center;
  1028. gap:6px;
  1029. font-weight: 400;
  1030. font-size: 15px;
  1031. line-height: 20px;
  1032. color: #4d4d4e;
  1033. white-space: nowrap;
  1034. }
  1035. }
  1036. .drawerView-container-table-main{
  1037. display: flex;
  1038. flex-direction: column;
  1039. gap:16px;
  1040. .drawerView-container-table-main-item{
  1041. display: flex;
  1042. align-items: center;
  1043. height: 30px;
  1044. .activity{
  1045. width: 120px;
  1046. .activity-item{
  1047. width: 72px;
  1048. height: 30px;
  1049. border-radius: 30px;
  1050. font-weight: 700;
  1051. font-size: 14px;
  1052. line-height: 18px;
  1053. color: #222222;
  1054. display: flex;
  1055. justify-content: center;
  1056. align-items: center;
  1057. }
  1058. }
  1059. .time{
  1060. font-weight: 400;
  1061. font-size: 15px;
  1062. line-height: 20px;
  1063. color: #ABABAB;
  1064. width: 200px;
  1065. }
  1066. .link{
  1067. font-weight: 400;
  1068. font-size: 15px;
  1069. line-height: 20px;
  1070. color: #2980FF;
  1071. white-space: nowrap;
  1072. }
  1073. .balance{
  1074. font-weight: 700;
  1075. font-size: 15px;
  1076. line-height: 20px;
  1077. color: #222222;
  1078. width: 120px;
  1079. }
  1080. .gas{
  1081. font-weight: 700;
  1082. font-size: 15px;
  1083. line-height: 20px;
  1084. color: #222222;
  1085. width: 120px;
  1086. }
  1087. }
  1088. }
  1089. }
  1090. .drawerView-container-footer {
  1091. height: 84px;
  1092. padding: 30px 10px;
  1093. display: flex;
  1094. align-items: center;
  1095. //justify-content: space-around;
  1096. .pagination{
  1097. width: 250px;
  1098. }
  1099. .manageAccount{
  1100. display: flex;
  1101. align-items: center;
  1102. gap:12px;
  1103. font-weight: 700;
  1104. font-size: 17px;
  1105. line-height: 22px;
  1106. color: #222222;
  1107. }
  1108. .disassociation{
  1109. display: flex;
  1110. align-items: center;
  1111. gap:12px;
  1112. font-weight: 700;
  1113. font-size: 17px;
  1114. line-height: 22px;
  1115. color: #EB5757;
  1116. }
  1117. }
  1118. }
  1119. .drawerAddress-container{
  1120. display: flex;
  1121. flex-direction: column;
  1122. height: 100vh;
  1123. overflow: auto;
  1124. .drawerAddress-container-head{
  1125. padding: 56px 40px;
  1126. background: #FFFFFF;
  1127. display: flex;
  1128. align-items: center;
  1129. justify-content: space-between;
  1130. .drawerAddress-container-head-left{
  1131. .drawerAddress-container-title{
  1132. font-weight: 700;
  1133. font-size: 21px;
  1134. line-height: 28px;
  1135. color: #181818;
  1136. margin-bottom: 8px;
  1137. }
  1138. .drawerAddress-container-tip{
  1139. font-weight: 700;
  1140. font-size: 12px;
  1141. line-height: 16px;
  1142. color: #919191;
  1143. }
  1144. }
  1145. .drawerAddress-container-head-right{
  1146. display: flex;
  1147. align-items: center;
  1148. gap:48px;
  1149. .cancellation{
  1150. width: 118px;
  1151. height: 52px;
  1152. background: #E0E0E0;
  1153. border-radius: 10px;
  1154. gap: 4px;
  1155. display: flex;
  1156. align-items: center;
  1157. justify-content: center;
  1158. font-weight: 700;
  1159. font-size: 15px;
  1160. line-height: 20px;
  1161. color: #828282;
  1162. }
  1163. .complete{
  1164. width: 118px;
  1165. height: 52px;
  1166. border: 2px solid #4A76FF;
  1167. border-radius: 10px;
  1168. gap:4px;
  1169. display: flex;
  1170. align-items: center;
  1171. justify-content: center;
  1172. font-weight: 700;
  1173. font-size: 15px;
  1174. line-height: 20px;
  1175. color: #2980FF;
  1176. cursor: pointer;
  1177. }
  1178. }
  1179. }
  1180. .drawerAddress-container-main{
  1181. padding: 36px 40px;
  1182. background: #f9fbff;
  1183. flex-grow: 1;
  1184. display: flex;
  1185. flex-direction: column;
  1186. gap:20px;
  1187. .item{
  1188. display: flex;
  1189. flex-direction: column;
  1190. gap:12px;
  1191. .title{
  1192. display: flex;
  1193. align-items: center;
  1194. justify-content: space-between;
  1195. .name{
  1196. font-weight: 400;
  1197. font-size: 17px;
  1198. line-height: 22px;
  1199. color: #181818;
  1200. }
  1201. .delete{
  1202. display: flex;
  1203. align-items: center;
  1204. gap:4px;
  1205. font-weight: 700;
  1206. font-size: 15px;
  1207. line-height: 20px;
  1208. color: #EB5757;
  1209. cursor: pointer;
  1210. }
  1211. }
  1212. .input{
  1213. display: flex;
  1214. align-items: center;
  1215. gap:24px;
  1216. }
  1217. }
  1218. .addAddress{
  1219. display: flex;
  1220. align-items: center;
  1221. gap:12px;
  1222. font-weight: 700;
  1223. font-size: 17px;
  1224. line-height: 22px;
  1225. color: #2980FF;
  1226. cursor: pointer;
  1227. }
  1228. }
  1229. }
  1230. .drawerImport-container{
  1231. display: flex;
  1232. flex-direction: column;
  1233. height: 100vh;
  1234. .drawerImport-container-head{
  1235. padding: 56px 40px;
  1236. background: #FFFFFF;
  1237. display: flex;
  1238. align-items: center;
  1239. justify-content: space-between;
  1240. .drawerImport-container-head-left{
  1241. .drawerImport-container-title{
  1242. font-weight: 700;
  1243. font-size: 21px;
  1244. line-height: 28px;
  1245. color: #181818;
  1246. margin-bottom: 8px;
  1247. }
  1248. .drawerImport-container-tip{
  1249. font-weight: 400;
  1250. font-size: 12px;
  1251. line-height: 16px;
  1252. color: #919191;
  1253. }
  1254. }
  1255. }
  1256. .drawerImport-container-main{
  1257. padding: 36px 40px;
  1258. background: #f9fbff;
  1259. flex-grow: 1;
  1260. .select{
  1261. display: flex;
  1262. align-items: center;
  1263. gap:56px;
  1264. border-bottom: 4px solid #f2f4f7;
  1265. margin-bottom: 40px;
  1266. .select-item{
  1267. font-weight: 400;
  1268. font-size: 17px;
  1269. line-height: 22px;
  1270. color: #ABABAB;
  1271. padding-bottom: 16px;
  1272. margin-bottom: -4px;
  1273. border-bottom: 4px solid #f2f4f7;
  1274. cursor: pointer;
  1275. }
  1276. .select-item-active{
  1277. font-weight: 700;
  1278. font-size: 17px;
  1279. line-height: 22px;
  1280. color: #2980FF;
  1281. padding-bottom: 16px;
  1282. margin-bottom: -4px;
  1283. border-bottom: 4px solid #2980FF;
  1284. cursor: pointer;
  1285. }
  1286. }
  1287. .inputTitle{
  1288. font-weight: 500;
  1289. font-size: 14px;
  1290. line-height: 18px;
  1291. color: #383838;
  1292. margin-bottom: 12px;
  1293. }
  1294. .confirm{
  1295. width: 100%;
  1296. height: 53px;
  1297. background: #2980FF;
  1298. display: flex;
  1299. align-items: center;
  1300. justify-content: center;
  1301. gap:8px;
  1302. margin-top: 28px;
  1303. cursor: pointer;
  1304. font-weight: 700;
  1305. font-size: 16px;
  1306. line-height: 21px;
  1307. color: #FFFFFF;
  1308. }
  1309. .importWallet{
  1310. .upload{
  1311. display: flex;
  1312. justify-content: center;
  1313. margin-bottom: 40px;
  1314. }
  1315. .batchWalletName{
  1316. display: flex;
  1317. align-items: center;
  1318. gap:20px;
  1319. margin-bottom: 28px;
  1320. }
  1321. }
  1322. .createWallet{
  1323. .inputBox{
  1324. display: flex;
  1325. gap:20px;
  1326. margin-top: 28px;
  1327. width: 100%;
  1328. }
  1329. .tip{
  1330. display: flex;
  1331. flex-direction: column;
  1332. gap:9px;
  1333. margin-top: 36px;
  1334. .title{
  1335. display: flex;
  1336. align-items: center;
  1337. gap:4px;
  1338. font-weight: 700;
  1339. font-size: 17px;
  1340. line-height: 22px;
  1341. color: #EB5757;
  1342. }
  1343. .description{
  1344. font-weight: 400;
  1345. font-size: 14px;
  1346. line-height: 18px;
  1347. color: #EB5757;
  1348. }
  1349. }
  1350. }
  1351. .completeTip{
  1352. display: flex;
  1353. align-items: center;
  1354. justify-content: center;
  1355. gap:8px;
  1356. .description{
  1357. display: flex;
  1358. flex-direction: column;
  1359. gap:8px;
  1360. .address{
  1361. font-weight: 700;
  1362. font-size: 21px;
  1363. line-height: 28px;
  1364. color: #181818;
  1365. }
  1366. .tip{
  1367. font-weight: 400;
  1368. font-size: 14px;
  1369. line-height: 18px;
  1370. color: #8e8f91;
  1371. }
  1372. }
  1373. }
  1374. .addressListBox{
  1375. display: flex;
  1376. flex-direction: column;
  1377. align-items: center;
  1378. justify-content: center;
  1379. margin-top: 20px;
  1380. .addressList{
  1381. width: 402px;
  1382. background: #FFFFFF;
  1383. border: 1px solid #F5F5F5;
  1384. border-radius: 6px;
  1385. padding: 20px 34px;
  1386. display: flex;
  1387. flex-direction: column;
  1388. gap:8px;
  1389. .addressList-item{
  1390. display: flex;
  1391. flex-direction: column;
  1392. gap:4px;
  1393. .name{
  1394. font-weight: 400;
  1395. font-size: 12px;
  1396. line-height: 16px;
  1397. color: #9c9c9c;
  1398. }
  1399. .address{
  1400. display: flex;
  1401. align-items: center;
  1402. justify-content: space-between;
  1403. font-weight: 500;
  1404. font-size: 12px;
  1405. line-height: 16px;
  1406. color: #212121;
  1407. cursor: pointer;
  1408. }
  1409. }
  1410. .pagination{
  1411. display: flex;
  1412. justify-content: center;
  1413. margin-top: 20px;
  1414. }
  1415. }
  1416. }
  1417. }
  1418. .drawerImport-container-footer{
  1419. width: 100%;
  1420. height: 84px;
  1421. display: flex;
  1422. align-items: center;
  1423. justify-content: flex-end;
  1424. padding: 0 40px;
  1425. gap:60px;
  1426. .exportAddress{
  1427. display: flex;
  1428. align-items: center;
  1429. gap:12px;
  1430. font-weight: 700;
  1431. font-size: 17px;
  1432. line-height: 22px;
  1433. color: #2980FF;
  1434. }
  1435. .download{
  1436. display: flex;
  1437. align-items: center;
  1438. gap:12px;
  1439. font-weight: 700;
  1440. font-size: 17px;
  1441. line-height: 22px;
  1442. color: #222222;
  1443. cursor: pointer;
  1444. }
  1445. }
  1446. }
  1447. }
  1448. ::v-deep .el-table__body{
  1449. -webkit-border-vertical-spacing: 20px;
  1450. background: #f9fbff;
  1451. }
  1452. ::v-deep .el-table__row{
  1453. border-radius: 10px;
  1454. background: white;
  1455. height: 58px;
  1456. }
  1457. ::v-deep .el-table__row>td{
  1458. border: none;
  1459. }
  1460. ::v-deep .el-table th.is-leaf{
  1461. border: none;
  1462. font-weight: 400;
  1463. font-size: 14px;
  1464. line-height: 18px;
  1465. color: #4d4d4e ;
  1466. }
  1467. ::v-deep .el-table::before{
  1468. height: 0;
  1469. }
  1470. </style>