浏览代码

feat: 完成地址管理导入抽屉

million 1 年之前
父节点
当前提交
dc3c47cc51

二进制
front/admin-front/src/assets/address/Rectangle.png


+ 3 - 0
front/admin-front/src/assets/address/Stroke-2.svg

@@ -0,0 +1,3 @@
+<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M5 10.5L6.66667 3H12.9167L11.6667 7.99993H15L7.5 18L8.75 10.5H5Z" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
+</svg>

+ 8 - 0
front/admin-front/src/assets/address/content_copy.svg

@@ -0,0 +1,8 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<mask id="mask0_447_1560" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="16" height="16">
+<rect width="16" height="16" fill="#D9D9D9"/>
+</mask>
+<g mask="url(#mask0_447_1560)">
+<path d="M6.17967 11.8718C5.84292 11.8718 5.55575 11.7551 5.31813 11.5218C5.08053 11.2884 4.96173 11.0034 4.96173 10.6667V3.07694C4.96173 2.7402 5.08053 2.45516 5.31813 2.22183C5.55575 1.98849 5.84292 1.87183 6.17967 1.87183H11.7566C12.089 1.87183 12.373 1.98956 12.6085 2.22503C12.844 2.46049 12.9617 2.74447 12.9617 3.07694V10.6667C12.9617 10.9991 12.844 11.2831 12.6085 11.5186C12.373 11.754 12.089 11.8718 11.7566 11.8718H6.17967ZM6.17967 10.8718H11.7566C11.8207 10.8718 11.8709 10.8526 11.9072 10.8141C11.9435 10.7756 11.9617 10.7265 11.9617 10.6667V3.07694C11.9617 3.01284 11.9435 2.96263 11.9072 2.92629C11.8709 2.88997 11.8207 2.87181 11.7566 2.87181H6.17967C6.11983 2.87181 6.06855 2.88997 6.02582 2.92629C5.98307 2.96263 5.9617 3.01284 5.9617 3.07694V10.6667C5.9617 10.7265 5.98307 10.7756 6.02582 10.8141C6.06855 10.8526 6.11983 10.8718 6.17967 10.8718ZM3.83353 14.2051C3.50106 14.2051 3.21708 14.0874 2.98162 13.8519C2.74615 13.6164 2.62842 13.3324 2.62842 13V5.03848C2.62842 4.8966 2.67628 4.7778 2.772 4.68208C2.86772 4.58635 2.98652 4.53849 3.1284 4.53849C3.27028 4.53849 3.38908 4.58635 3.4848 4.68208C3.58053 4.7778 3.6284 4.8966 3.6284 5.03848V13C3.6284 13.0513 3.64977 13.0983 3.6925 13.141C3.73523 13.1837 3.78225 13.2051 3.83353 13.2051H9.79502C9.9369 13.2051 10.0557 13.253 10.1514 13.3487C10.2472 13.4444 10.295 13.5632 10.295 13.7051C10.295 13.847 10.2472 13.9658 10.1514 14.0615C10.0557 14.1572 9.9369 14.2051 9.79502 14.2051H3.83353Z" fill="#FF6F61"/>
+</g>
+</svg>

+ 8 - 0
front/admin-front/src/assets/address/download.svg

@@ -0,0 +1,8 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<mask id="mask0_463_1863" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
+<rect width="24" height="24" fill="#D9D9D9"/>
+</mask>
+<g mask="url(#mask0_463_1863)">
+<path d="M6 20C5.45 20 4.97917 19.8042 4.5875 19.4125C4.19583 19.0208 4 18.55 4 18V15H6V18H18V15H20V18C20 18.55 19.8042 19.0208 19.4125 19.4125C19.0208 19.8042 18.55 20 18 20H6ZM12 16L7 11L8.4 9.55L11 12.15V4H13V12.15L15.6 9.55L17 11L12 16Z" fill="#222222"/>
+</g>
+</svg>

+ 8 - 0
front/admin-front/src/assets/address/file_download_done.svg

@@ -0,0 +1,8 @@
+<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
+<mask id="mask0_468_2071" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="20" height="21">
+<rect y="0.5" width="20" height="20" fill="#D9D9D9"/>
+</mask>
+<g mask="url(#mask0_468_2071)">
+<path d="M4.99984 17.1667C4.76373 17.1667 4.56581 17.0868 4.40609 16.9271C4.24637 16.7674 4.1665 16.5694 4.1665 16.3333C4.1665 16.0972 4.24637 15.8993 4.40609 15.7396C4.56581 15.5799 4.76373 15.5 4.99984 15.5H14.9998C15.2359 15.5 15.4339 15.5799 15.5936 15.7396C15.7533 15.8993 15.8332 16.0972 15.8332 16.3333C15.8332 16.5694 15.7533 16.7674 15.5936 16.9271C15.4339 17.0868 15.2359 17.1667 14.9998 17.1667H4.99984ZM7.95817 13.4792C7.84706 13.4792 7.74289 13.4618 7.64567 13.4271C7.54845 13.3924 7.45817 13.3333 7.37484 13.25L3.83317 9.70833C3.68039 9.55556 3.604 9.35417 3.604 9.10417C3.604 8.85417 3.68039 8.65278 3.83317 8.5C3.98595 8.34722 4.18039 8.27083 4.4165 8.27083C4.65261 8.27083 4.84706 8.34722 4.99984 8.5L7.95817 11.4583L14.9998 4.41667C15.1526 4.26389 15.3505 4.1875 15.5936 4.1875C15.8366 4.1875 16.0346 4.26389 16.1873 4.41667C16.3401 4.56944 16.4165 4.76736 16.4165 5.01042C16.4165 5.25347 16.3401 5.45139 16.1873 5.60417L8.5415 13.25C8.45817 13.3333 8.36789 13.3924 8.27067 13.4271C8.17345 13.4618 8.06928 13.4792 7.95817 13.4792Z" fill="white"/>
+</g>
+</svg>

+ 8 - 0
front/admin-front/src/assets/address/tips_and_updates.svg

@@ -0,0 +1,8 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<mask id="mask0_448_1841" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="20" height="20">
+<rect width="20" height="20" fill="#D9D9D9"/>
+</mask>
+<g mask="url(#mask0_448_1841)">
+<path d="M17.8774 7.12258L16.8748 6.66685L17.8774 6.21113L18.3332 5.20854L18.7889 6.21113L19.7915 6.66685L18.7889 7.12258L18.3332 8.12517L17.8774 7.12258ZM15.1379 3.19542L13.6377 2.50019L15.1379 1.80496L15.8332 0.304688L16.5284 1.80496L18.0287 2.50019L16.5284 3.19542L15.8332 4.69569L15.1379 3.19542ZM7.49982 17.9809C7.07889 17.9809 6.71591 17.8351 6.41088 17.5434C6.10587 17.2518 5.94 16.8955 5.91328 16.4745H9.08636C9.05964 16.8955 8.89377 17.2518 8.58875 17.5434C8.28373 17.8351 7.92075 17.9809 7.49982 17.9809ZM4.99982 15.3207C4.82273 15.3207 4.6743 15.2607 4.55452 15.1409C4.43473 15.0211 4.37484 14.8726 4.37484 14.6954C4.37484 14.5182 4.43473 14.3698 4.55452 14.2502C4.6743 14.1305 4.82273 14.0707 4.99982 14.0707H9.99982C10.1769 14.0707 10.3253 14.1306 10.4451 14.2505C10.5649 14.3703 10.6248 14.5188 10.6248 14.696C10.6248 14.8731 10.5649 15.0215 10.4451 15.1412C10.3253 15.2608 10.1769 15.3207 9.99982 15.3207H4.99982ZM4.50303 12.9168C3.63018 12.3741 2.93921 11.665 2.43013 10.7894C1.92105 9.91391 1.6665 8.95638 1.6665 7.91685C1.6665 6.29294 2.23274 4.91474 3.36521 3.78225C4.4977 2.64978 5.8759 2.08354 7.49982 2.08354C9.12373 2.08354 10.5019 2.64978 11.6344 3.78225C12.7669 4.91474 13.3331 6.29294 13.3331 7.91685C13.3331 8.95638 13.0786 9.91391 12.5695 10.7894C12.0604 11.665 11.3695 12.3741 10.4966 12.9168H4.50303ZM4.87482 11.6669H10.1248C10.7498 11.2224 11.2325 10.6738 11.5727 10.021C11.913 9.36824 12.0832 8.66685 12.0832 7.91685C12.0832 6.63908 11.6387 5.55574 10.7498 4.66685C9.86093 3.77797 8.77759 3.33352 7.49982 3.33352C6.22204 3.33352 5.13871 3.77797 4.24982 4.66685C3.36093 5.55574 2.91648 6.63908 2.91648 7.91685C2.91648 8.66685 3.08662 9.36824 3.4269 10.021C3.76718 10.6738 4.24982 11.2224 4.87482 11.6669Z" fill="#EB5757"/>
+</g>
+</svg>

+ 394 - 4
front/admin-front/src/views/address/index.vue

@@ -31,10 +31,12 @@
       </div>
       <div class="app-container-head-right">
         <div class="app-container-head-right-button1">
-          <img src="../../assets/address/vertical_align_bottom.svg" alt="vertical_align_bottom">
-          导出
+          导出地址
         </div>
         <div class="app-container-head-right-button1">
+          下载 KeyStore
+        </div>
+        <div class="app-container-head-right-button1" @click="drawerImport = true">
           <img src="../../assets/address/upload.svg" alt="upload">
           导入
         </div>
@@ -294,6 +296,164 @@
         </div>
       </div>
     </el-drawer>
+    <el-drawer
+      :visible.sync="drawerImport"
+      :with-header="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="input" placeholder="输入批量钱包名称"></el-input>
+            <div class="inputBox">
+              <div>
+                <div class="inputTitle">
+                  选择公链
+                </div>
+                <el-select style="width: 280px" 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>
+                <div class="inputTitle">
+                  生成数量
+                </div>
+                <el-input style="width: 230px" v-model="input" placeholder="输入生成数量"></el-input>
+              </div>
+            </div>
+            <div class="inputBox">
+              <div>
+                <div class="inputTitle">
+                  钱包密码
+                </div>
+                <el-input style="width: 280px" v-model="input" placeholder="设置钱包密码"></el-input>
+              </div>
+              <div>
+                <div class="inputTitle">
+                  确认钱包密码
+                </div>
+                <el-input style="width: 230px" v-model="input" placeholder="设置钱包密码"></el-input>
+              </div>
+            </div>
+            <div class="confirm" @click="completeGeneration = true">
+              <img src="../../assets/address/Stroke-2.svg" alt="Stroke">
+              开始生成
+            </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">
+                成功生成 100 个钱包地址
+              </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">
+                  {{item}}
+                  <img src="../../assets/address/content_copy.svg" alt="content_copy">
+                </div>
+              </div>
+              <div class="pagination">
+                <el-pagination
+                  small
+                  layout="prev, pager, next"
+                  :total="1000">
+                </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">
+            <img src="../../assets/address/download.svg" alt="download">
+            下载Keystore
+          </div>
+        </div>
+      </div>
+    </el-drawer>
   </div>
 
 </template>
@@ -395,7 +555,21 @@ export default {
       }],
       value: '',
       input: '',
-
+      drawerImport:false,
+      drawerImportSelect:0,
+      completeGeneration:false,
+      addressList:[
+        '0xc63988ae669C41125ecB4e8113f4D0eF21874637',
+        '0xc63988ae669C41125ecB4e8113f4D0eF21874637',
+        '0xc63988ae669C41125ecB4e8113f4D0eF21874637',
+        '0xc63988ae669C41125ecB4e8113f4D0eF21874637',
+        '0xc63988ae669C41125ecB4e8113f4D0eF21874637',
+        '0xc63988ae669C41125ecB4e8113f4D0eF21874637',
+        '0xc63988ae669C41125ecB4e8113f4D0eF21874637',
+        '0xc63988ae669C41125ecB4e8113f4D0eF21874637',
+        '0xc63988ae669C41125ecB4e8113f4D0eF21874637',
+        '0xc63988ae669C41125ecB4e8113f4D0eF21874637',
+      ]
     }
   },
   methods: {
@@ -801,7 +975,7 @@ export default {
           color: #181818;
           margin-bottom: 8px;
         }
-        .drawerAddress-container-walletAddress{
+        .drawerAddress-container-tip{
           font-weight: 700;
           font-size: 12px;
           line-height: 16px;
@@ -891,6 +1065,222 @@ export default {
       }
     }
   }
+  .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;
+
+      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;
+            }
+          }
+          .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;
+      }
+    }
+  }
 }
 ::v-deep .el-table__body{
   -webkit-border-vertical-spacing: 20px;