|
|
@@ -1,115 +1,141 @@
|
|
|
<template>
|
|
|
- <v-card elevation="0">
|
|
|
- <!-- 表格上功能区 -->
|
|
|
- <v-card-title>
|
|
|
- <v-container id="dataTableHeader">
|
|
|
- <v-row>
|
|
|
- <v-col cols="4">
|
|
|
- {{ page.name }}
|
|
|
- </v-col>
|
|
|
- <v-col cols="8">
|
|
|
- <v-text-field hide-details single-line label="Local Search" append-icon="mdi-magnify" v-model="table.search"/>
|
|
|
- </v-col>
|
|
|
- </v-row>
|
|
|
- </v-container>
|
|
|
- </v-card-title>
|
|
|
-
|
|
|
- <!-- 表格主体 -->
|
|
|
- <v-data-table calculate-widths multi-sort
|
|
|
- :group-by="table.groupBy"
|
|
|
- :headers="table.headers" :items="table.data" :search="table.search" :loading="table.loading"
|
|
|
- :items-per-page="table.pageSize"
|
|
|
- :sort-by="table.sortBy" :sort-desc="table.sortDesc">
|
|
|
- <!-- 操作区 -->
|
|
|
- <template v-slot:item.option="{ item }">
|
|
|
- <div>
|
|
|
+ <v-container>
|
|
|
+ <v-card elevation="0">
|
|
|
+ <!-- 表格上功能区 -->
|
|
|
+ <v-card-title>
|
|
|
+ <v-container id="dataTableHeader">
|
|
|
<v-row>
|
|
|
- <v-col cols="5">
|
|
|
- <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 cols="4">
|
|
|
+ {{ page.name }}
|
|
|
+ </v-col>
|
|
|
+ <v-col cols="8">
|
|
|
+ <v-text-field hide-details single-line label="Local Search" append-icon="mdi-magnify" v-model="table.search"/>
|
|
|
</v-col>
|
|
|
</v-row>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <!-- Block -->
|
|
|
- <template v-slot:item.block="{ item }">
|
|
|
- <div>
|
|
|
- {{ item.block }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <!-- Hash -->
|
|
|
- <template v-slot:item.hash="{ item }">
|
|
|
- <v-chip label target="_blank" :href="'https://www.oklink.com/en/ethw/tx/' + item.hash">
|
|
|
- {{ hashKit.head5(item.hash) + '..' }}
|
|
|
- </v-chip>
|
|
|
- </template>
|
|
|
- <!-- From -->
|
|
|
- <template v-slot:item.from="{ item }">
|
|
|
- <v-chip label color="green lighten-3" target="_blank" @click="httpKit.jumpToEthw(item.from)">
|
|
|
- {{ hashKit.headAndEnd2(item.from) }}
|
|
|
- </v-chip>
|
|
|
- </template>
|
|
|
- <!-- to -->
|
|
|
- <template v-slot:item.to="{ item }">
|
|
|
- <v-chip v-if="!item.toName" label color="indigo lighten-4" @click="httpKit.jumpToEthw(item.to)">
|
|
|
- {{ hashKit.headAndEnd2(item.to) }}
|
|
|
- </v-chip>
|
|
|
- <v-chip v-else label color="indigo lighten-4" @click="httpKit.jumpToEthw(item.to)">
|
|
|
- {{ item.toName }}
|
|
|
- </v-chip>
|
|
|
- </template>
|
|
|
- <template v-slot:item.type="{ item }">
|
|
|
- <div v-if="item.type !== undefined && item.type !== ''">
|
|
|
- {{ item.type }}
|
|
|
- </div>
|
|
|
- <div v-else>
|
|
|
- [type]
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template v-slot:item.index="{ item }">
|
|
|
- <div v-if="item.index !== undefined">
|
|
|
- {{ item.index }}
|
|
|
- </div>
|
|
|
- <div v-else>
|
|
|
- [index]
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template v-slot:item.state="{ item }">
|
|
|
- <div v-if="item.state !== undefined">
|
|
|
- {{ item.state }}
|
|
|
- </div>
|
|
|
- <div v-else>
|
|
|
- [state]
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template v-slot:item.mev="{ item }">
|
|
|
- <div v-if="item.mev !== undefined">
|
|
|
- {{ item.mev }}
|
|
|
- </div>
|
|
|
- <div v-else>
|
|
|
- [mev]
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template v-slot:item.pending="{ item }">
|
|
|
- <div v-if="item.pending !== undefined">
|
|
|
- {{ item.pending }}
|
|
|
- </div>
|
|
|
- <div v-else>
|
|
|
- [pending]
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <!--tradeInfo-->
|
|
|
- <template v-slot:item.tradeInfo="{ item }">
|
|
|
- <TradeInfo :item="item"></TradeInfo>
|
|
|
- </template>
|
|
|
- </v-data-table>
|
|
|
- </v-card>
|
|
|
+ </v-container>
|
|
|
+ </v-card-title>
|
|
|
+
|
|
|
+ <!-- 表格主体 -->
|
|
|
+ <v-data-table calculate-widths multi-sort
|
|
|
+ :group-by="table.groupBy"
|
|
|
+ :headers="table.headers" :items="table.data" :search="table.search" :loading="table.loading"
|
|
|
+ :items-per-page="table.pageSize" :page="table.pageNum"
|
|
|
+ :sort-by="table.sortBy" :sort-desc="table.sortDesc">
|
|
|
+ <!-- 操作区 -->
|
|
|
+ <template v-slot:item.option="{ item }">
|
|
|
+ <div>
|
|
|
+ <v-row>
|
|
|
+ <v-col cols="5">
|
|
|
+ <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>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <!-- Block -->
|
|
|
+ <template v-slot:item.block="{ item }">
|
|
|
+ <div>
|
|
|
+ {{ item.block }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <!-- Hash -->
|
|
|
+ <template v-slot:item.hash="{ item }">
|
|
|
+ <v-btn v-if="item.hash.indexOf('0x') !== -1" outlined text target="_blank" :href="'https://www.oklink.com/en/ethw/tx/' + item.hash">
|
|
|
+ {{ hashKit.head5(item.hash) + '..' }}
|
|
|
+ </v-btn>
|
|
|
+ <v-chip v-else label target="_blank">
|
|
|
+ {{ hashKit.head5(item.hash) + '..' }}
|
|
|
+ </v-chip>
|
|
|
+ </template>
|
|
|
+ <!-- From -->
|
|
|
+ <template v-slot:item.from="{ item }">
|
|
|
+ <v-chip label color="green lighten-3" target="_blank" @click="httpKit.jumpToEthw(item.from)">
|
|
|
+ {{ hashKit.headAndEnd2(item.from) }}
|
|
|
+ </v-chip>
|
|
|
+ </template>
|
|
|
+ <!-- to -->
|
|
|
+ <template v-slot:item.to="{ item }">
|
|
|
+ <v-chip v-if="!item.toName" label color="indigo lighten-4" @click="httpKit.jumpToEthw(item.to)">
|
|
|
+ {{ hashKit.headAndEnd2(item.to) }}
|
|
|
+ </v-chip>
|
|
|
+ <v-chip v-else label color="indigo lighten-4" @click="httpKit.jumpToEthw(item.to)">
|
|
|
+ {{ item.toName }}
|
|
|
+ </v-chip>
|
|
|
+ </template>
|
|
|
+ <template v-slot:item.type="{ item }">
|
|
|
+ <div v-if="item.type !== undefined && item.type !== ''">
|
|
|
+ {{ item.type }}
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ [type]
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:item.index="{ item }">
|
|
|
+ <div v-if="item.index !== undefined">
|
|
|
+ {{ item.index }}
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ [index]
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:item.state="{ item }">
|
|
|
+ <div v-if="item.state !== undefined">
|
|
|
+ {{ item.state }}
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ [state]
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:item.mev="{ item }">
|
|
|
+ <div v-if="item.mev !== undefined">
|
|
|
+ {{ item.mev }}
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ [mev]
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:item.pending="{ item }">
|
|
|
+ <div v-if="item.pending !== undefined">
|
|
|
+ {{ item.pending }}
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ [pending]
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <!--tradeInfo-->
|
|
|
+ <template v-slot:item.tradeInfo="{ item }">
|
|
|
+ <div class="tradeInfoBtn" @click="showTradeInfo(item)">
|
|
|
+ <v-chip v-for="tokenAddress in item.tokenAddressList"
|
|
|
+ :color="item.tokenMap[tokenAddress] ? hashKit.generateColorByHash(tokenAddress) : undefined" class="tokenChip">
|
|
|
+ {{ item.tokenMap[tokenAddress] ? item.tokenMap[tokenAddress] : hashKit.headAndEnd2(tokenAddress) }}
|
|
|
+ </v-chip>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </v-data-table>
|
|
|
+ </v-card>
|
|
|
+
|
|
|
+ <v-dialog v-model="dialog.visible" max-width="800">
|
|
|
+ <v-card>
|
|
|
+ <v-card-title>交易详情</v-card-title>
|
|
|
+ <v-card-text><TradeInfo :item="dialog.data"></TradeInfo></v-card-text>
|
|
|
+ <v-card-actions>
|
|
|
+ <v-spacer></v-spacer>
|
|
|
+ <v-btn
|
|
|
+ color="primary"
|
|
|
+ text
|
|
|
+ @click="dialog.visible = false"
|
|
|
+ >
|
|
|
+ 我知道了
|
|
|
+ </v-btn>
|
|
|
+ </v-card-actions>
|
|
|
+ </v-card>
|
|
|
+ </v-dialog>
|
|
|
+ </v-container>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import TradeInfo from '@/components/viewer/table/TradeInfo'
|
|
|
-import EthMev from '@/plugins/model/EthMev'
|
|
|
+import TradeInfo from '@/components/viewer/table/TradeInfoDetails'
|
|
|
import HashKit from '@/plugins/kit/HashKit'
|
|
|
import HttpKit from '@/plugins/kit/HttpKit'
|
|
|
|
|
|
@@ -120,6 +146,10 @@ export default {
|
|
|
data: () => ({
|
|
|
hashKit: HashKit,
|
|
|
httpKit: HttpKit,
|
|
|
+ dialog: {
|
|
|
+ data: [],
|
|
|
+ visible: false
|
|
|
+ }
|
|
|
}),
|
|
|
methods: {
|
|
|
async deleteByHash(hash_code) {
|
|
|
@@ -134,11 +164,32 @@ export default {
|
|
|
// this.$msgkit.error(rst.data.msg)
|
|
|
// }
|
|
|
}
|
|
|
+ },
|
|
|
+ showTradeInfo(item) {
|
|
|
+ this.dialog.data = item
|
|
|
+ this.dialog.visible = true
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-
|
|
|
+#dataTable {
|
|
|
+ height: 410px;
|
|
|
+}
|
|
|
+#dataTableHeader {
|
|
|
+ max-width: none;
|
|
|
+}
|
|
|
+.tokenChip {
|
|
|
+ margin-top: 5px;
|
|
|
+ margin-left: 5px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+}
|
|
|
+.tradeInfoBtn {
|
|
|
+ padding: 15px !important;
|
|
|
+ border: grey 2px solid;
|
|
|
+}
|
|
|
+.tradeInfoBtn:hover {
|
|
|
+ background: beige;
|
|
|
+}
|
|
|
</style>
|