龚成明 преди 3 години
родител
ревизия
224197e26b
променени са 1 файла, в които са добавени 22 реда и са изтрити 19 реда
  1. 22 19
      src/components/History.vue

+ 22 - 19
src/components/History.vue

@@ -92,6 +92,7 @@
         :loading="loading"
         :sort-by="['block', 'index']"
         :sort-desc="[true, false]"
+        @click:row="logInfo"
       >
         <template v-slot:item.option="{ item }">
           <div @mouseenter="changeShowBlock(item, false)">
@@ -102,8 +103,8 @@
               <!--              </v-btn>-->
               <!--            </v-col>-->
               <v-col cols="5">
-                <v-btn icon elevation="0" color="red" small @click="deleteByHash(item.hash)">
-                  <v-icon small>mdi-delete-forever-outline</v-icon>
+                <v-btn icon elevation="0" color="red" large @click="deleteByHash(item.hash)">
+                  <v-icon large>mdi-delete-forever-outline</v-icon>
                 </v-btn>
               </v-col>
             </v-row>
@@ -122,7 +123,7 @@
               :href="'https://etherscan.io/tx/' + item.hash"
               target="_blank"
           >
-            {{ getSimpleStr2(item.hash) + '..' }}
+            {{ getSimpleStr2(item.hash) + '..'  }}
           </v-chip>
         </template>
         <!-- From -->
@@ -132,27 +133,27 @@
               @click="jump(item.from)"
               target="_blank"
           >
-            {{ getSimpleStr2(item.from) + '..' }}
+            {{ getSimpleStr3(item.from) }}
           </v-chip>
         </template>
-        <!-- To -->
+        <!-- to -->
         <template v-slot:item.to="{ item }">
           <v-chip
               label
               @click="jump(item.to)"
               target="_blank"
+              v-if="!item.toObj"
           >
-            {{ getSimpleStr2(item.to) + '..' }}
+              {{ getSimpleStr3(item.to) }}
           </v-chip>
-        </template>
-        <!-- GasPrice -->
-        <template v-slot:item.to="{ item }">
           <v-chip
               label
+              color="primary"
               @click="jump(item.to)"
               target="_blank"
+              v-else
           >
-            {{ getSimpleStr2(item.to) + '..' }}
+            {{ JSON.parse(item.toObj.data).name }}
           </v-chip>
         </template>
         <!-- tradeInfo -->
@@ -250,6 +251,16 @@
           return str
         }
       },
+      // 获取简易str3
+      getSimpleStr3 (str) {
+        if (str && str.indexOf('x') !== -1 && str.length > 15) {
+          return str.substr(0, 4)
+              + '..'
+              + str.substr(str.length - 2, 2)
+        } else {
+          return str
+        }
+      },
       // 获取数据
       async pullData () {
         let url = '/ethmev/findByHashOrBlockOrDataVague'
@@ -352,15 +363,7 @@
         { text: 'State', value: 'state' },
         { text: 'Mev', value: 'mev' },
         { text: 'Pending', value: 'pending' },
-        { text: 'TradeInfo', value: 'tradeInfo'},
-        // { text: '交易数量', value: 'amount' },
-        // { text: '利润', value: 'profit' },
-        // { text: 'Gas', value: 'gas' },
-        // { text: '状态', value: 'state' },
-        // { text: 'BlockNumber', value: 'blockNumber' },
-        // { text: 'Nonce', value: 'nonce' },
-        // { text: 'Hash', value: 'hs' },
-        // { text: '  ', value: 'origin' }
+        { text: 'TradeInfo', value: 'tradeInfo'}
       ],
       history: {"data":[{"t":"0x8a2a17e7adb6cbf6635380a35c04c01db473ed5ca919706f1c492d3aa1d9f1a9","fm":"0x6ff6f16a2459114fad74eed1604b402b97b02717","hs":"0x8a2a17e7adb6cbf6635380a35c04c01db473ed5ca919706f1c492d3aa1d9f1a9","state":"ok","ts":1602503469,"o":"{'type': 'NO TOKEN', 'intoken': 'WETH', 'outtoken': false, 'inamount': 0.314674952033383, 'outamount': 48953401866254456333, 'symbol': false, 'gas': 56.100000233, 'profit': 0, 'balance': 0, 'stocks': 0, 'decimals': 18, 'symbolAddress': '0x054f76beed60ab6dbeb23502178c52d6c5debe40', 'pairAddress': false, 'from': '0x6ff6f16a2459114fad74eed1604b402b97b02717', 'to': '0x8a2a17e7adb6cbf6635380a35c04c01db473ed5ca919706f1c492d3aa1d9f1a9', 'hs': '0x8a2a17e7adb6cbf6635380a35c04c01db473ed5ca919706f1c492d3aa1d9f1a9'}"}],"count":1,"state":"ok"},
       tableData: []