龚成明 il y a 2 ans
Parent
commit
4a85ab9d8a

+ 12 - 4
src/components/History.vue

@@ -21,8 +21,16 @@ export default {
     tx: undefined,
     query: {
       block: '',
-      hash: '',
-      dataVague: '',
+      tx: {
+        hash: '',
+        from: '',
+        to: ''
+      },
+      transfer: {
+        from: '',
+        to: '',
+        token: ''
+      },
       autoFlushTime: 0
     },
     page: {
@@ -59,7 +67,7 @@ export default {
   methods: {
     // 获取数据
     async generateTableData() {
-      if (!this.tx) this.createTx()
+      this.createTx()
 
       this.table.loading = true
       this.table.data.length = 0
@@ -76,7 +84,7 @@ export default {
       this.table.loading = false
     },
     createTx() {
-      this.tx = new BaseModel(this.chain.id, BaseModel.MODULES.HISTORY)
+      if (!this.tx) this.tx = new BaseModel(this.chain.id, BaseModel.MODULES.HISTORY)
     }
   },
   provide() {

+ 4 - 4
src/components/Pending.vue

@@ -21,8 +21,8 @@ export default {
     tx: undefined,
     query: {
       block: '',
-      hash: '',
-      dataVague: '',
+      txFilterText: '',
+      transferFilterText: '',
       autoFlushTime: 0
     },
     page: {
@@ -58,7 +58,7 @@ export default {
   methods: {
     // 获取数据
     async generateTableData() {
-      if (!this.tx) this.createTx()
+      this.createTx()
 
       this.table.loading = true
       this.table.data.length = 0
@@ -75,7 +75,7 @@ export default {
       this.table.loading = false
     },
     createTx() {
-      this.tx = new BaseModel(this.chain.id, BaseModel.MODULES.PENDING)
+      if (!this.tx) this.tx = new BaseModel(this.chain.id, BaseModel.MODULES.PENDING)
     }
   },
   provide() {

+ 2 - 2
src/components/viewer/Table.vue

@@ -20,10 +20,10 @@
         <v-row>
           <v-col cols="2"></v-col>
           <v-col cols="2">
-            <v-text-field type="number" required label="page" v-model="tempPage" @change="inputPageNum" />
+            <v-text-field required type="number" label="page" v-model="tempPage" @change="inputPageNum" />
           </v-col>
           <v-col cols="4">
-            <v-pagination :disabled="table.loading" :length="99" v-model="table.pageNum" @input="generateTableDataAgain"></v-pagination>
+            <v-pagination color="teal" :disabled="table.loading" :length="99" v-model="table.pageNum" @input="generateTableDataAgain"></v-pagination>
           </v-col>
         </v-row>
       </div>

+ 38 - 22
src/components/viewer/Top.vue

@@ -1,42 +1,58 @@
 <template>
   <div class="top-container">
     <v-row>
-      <!-- 数据刷新时间 -->
-      <v-col cols="18" md="1">
-        <v-text-field required label="自定义刷新时间" v-model="query.autoFlushTime" />
+      <!-- tx信息过滤 -->
+      <v-col cols="18" md="2">
+        <v-text-field required label="Tx.Hash" v-model="query.tx.hash" />
       </v-col>
-
-      <!-- 自动刷新提示 -->
-      <v-col v-if='query.autoFlushTime === 0' cols="18" md="2">
-        <v-btn outlined x-large tile color="teal" @click='query.autoFlushTime = 20'>以20s/次刷新</v-btn>
+      <v-col cols="18" md="2">
+        <v-text-field required label="Tx.From" v-model="query.tx.from" />
       </v-col>
-
-      <!-- 自动刷新提示 -->
-      <v-col v-else-if='query.autoFlushTime !== 0' cols="18" md="2">
-        <v-btn outlined x-large tile color="red" @click='query.autoFlushTime = 0'>停止刷新</v-btn>
+      <v-col cols="18" md="2">
+        <v-text-field required label="Tx.To" v-model="query.tx.to" />
       </v-col>
-
       <!-- block过滤 -->
       <v-col cols="18" md="2">
-        <v-text-field required label="BlockNumber" v-model="query.block" />
+        <v-text-field required label="Tx.BlockNumber" v-model="query.block" />
       </v-col>
 
-      <!-- hash过滤 -->
+      <!-- 搜索按钮 -->
+      <v-col cols="18" md="2">
+        <v-btn outlined x-large tile color="primary" @click="generateTableDataAgain">
+          <v-icon left>mdi-cloud-search-outline</v-icon>
+          拉取想要的
+        </v-btn>
+      </v-col>
+    </v-row>
+    <v-row>
+      <!-- transfer信息过滤 -->
       <v-col cols="18" md="2">
-        <v-text-field required label="Hash" v-model="query.hash" />
+        <v-text-field required label="Transfer.Token" v-model="query.transfer.token" />
+      </v-col>
+      <v-col cols="18" md="2">
+        <v-text-field required label="Transfer.From" v-model="query.transfer.from" />
+      </v-col>
+      <v-col cols="18" md="2">
+        <v-text-field required label="Transfer.To" v-model="query.transfer.to" />
       </v-col>
 
-      <!-- data过滤 -->
-      <v-col cols="18" md="4">
-        <v-text-field required label="Data" v-model="query.dataVague" />
+      <!-- 数据刷新时间 -->
+      <v-col cols="18" md="2">
+        <v-text-field required label="自定义刷新时间" v-model="query.autoFlushTime" />
       </v-col>
 
-      <!-- 搜索按钮 -->
-      <v-col cols="18" md="1">
-        <v-btn outlined x-large tile color="primary" @click="generateTableDataAgain">
-          <v-icon>mdi-cloud-search-outline</v-icon>
+      <!-- 自动刷新提示 -->
+      <v-col v-if='query.autoFlushTime === 0' cols="18" md="2">
+        <v-btn outlined x-large tile color="teal" @click='query.autoFlushTime = 20'>
+          <v-icon left>mdi-clock</v-icon>
+          以20s/次刷新
         </v-btn>
       </v-col>
+
+      <!-- 自动刷新提示 -->
+      <v-col v-else-if='query.autoFlushTime !== 0' cols="18" md="2">
+        <v-btn outlined x-large tile color="red" @click='query.autoFlushTime = 0'>停止刷新</v-btn>
+      </v-col>
     </v-row>
   </div>
 </template>