Explorar el Código

上线测试查询功能

龚成明 hace 2 años
padre
commit
0260e36000

+ 2 - 2
src/components/History.vue

@@ -20,8 +20,8 @@ export default {
   data: () => ({
     tx: undefined,
     query: {
-      block: '',
       tx: {
+        block: '',
         hash: '',
         from: '',
         to: ''
@@ -72,7 +72,7 @@ export default {
       this.table.loading = true
       this.table.data.length = 0
 
-      const rst = await this.tx.findByPaginate(this.table.pageNum, this.table.pageSize)
+      const rst = await this.tx.find(this.query, this.table.pageNum, this.table.pageSize)
 
       if (rst.state) {
         this.table.data = BaseModel.parseLocalRecordList(rst.data)

+ 12 - 4
src/components/Pending.vue

@@ -20,9 +20,17 @@ export default {
   data: () => ({
     tx: undefined,
     query: {
-      block: '',
-      txFilterText: '',
-      transferFilterText: '',
+      tx: {
+        block: '',
+        hash: '',
+        from: '',
+        to: ''
+      },
+      transfer: {
+        from: '',
+        to: '',
+        token: ''
+      },
       autoFlushTime: 0
     },
     page: {
@@ -63,7 +71,7 @@ export default {
       this.table.loading = true
       this.table.data.length = 0
 
-      const rst = await this.tx.findByPaginate(this.table.pageNum, this.table.pageSize)
+      const rst = await this.tx.find(this.query, this.table.pageNum, this.table.pageSize)
 
       if (rst.state) {
         this.table.data = BaseModel.parseLocalRecordList(rst.data)

+ 1 - 1
src/components/viewer/Top.vue

@@ -13,7 +13,7 @@
       </v-col>
       <!-- block过滤 -->
       <v-col cols="18" md="2">
-        <v-text-field required label="Tx.BlockNumber" v-model="query.block" />
+        <v-text-field required label="Tx.BlockNumber" v-model="query.tx.block" />
       </v-col>
 
       <!-- 搜索按钮 -->

+ 4 - 3
src/plugins/model/BaseModel.js

@@ -13,12 +13,13 @@ export default class BaseModel {
     this.module = module
   }
 
-  async findByPaginate(pageNumber=1, pageSize=200) {
-    const url = `/${this.module}/findByChainIdAndPaginate`
+  async find(conditions, pageNumber=1, pageSize=200) {
+    const url = `/${this.module}/findByChainId`
     const rst = await http.post(url, {
       chainId: this.chainId,
       pageNumber: pageNumber,
-      pageSize: pageSize
+      pageSize: pageSize,
+      conditions: conditions
     })
 
     return rst.data