|
@@ -0,0 +1,252 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div class="table-container">
|
|
|
|
|
+ <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>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 顶部分页 -->
|
|
|
|
|
+ <div class="mt-2">
|
|
|
|
|
+ <v-row>
|
|
|
|
|
+ <v-col cols="2"></v-col>
|
|
|
|
|
+ <v-col cols="2">
|
|
|
|
|
+ <v-text-field required type="number" label="page" v-model="tempPage" @change="inputPageNum"/>
|
|
|
|
|
+ </v-col>
|
|
|
|
|
+ <v-col cols="4">
|
|
|
|
|
+ <v-pagination color="teal" :disabled="table.loading" :length="table.pageLength" v-model="table.pageNum"
|
|
|
|
|
+ @input="generateTableDataAgain"></v-pagination>
|
|
|
|
|
+ </v-col>
|
|
|
|
|
+ </v-row>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 表格主体 -->
|
|
|
|
|
+ <v-data-table calculate-widths multi-sort hide-default-footer
|
|
|
|
|
+ :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-row>
|
|
|
|
|
+ <v-col cols="5">
|
|
|
|
|
+ <v-btn large icon elevation="0" color="primary" @click="editItem(item)">
|
|
|
|
|
+ <v-icon>mdi-table-edit</v-icon>
|
|
|
|
|
+ </v-btn>
|
|
|
|
|
+ </v-col>
|
|
|
|
|
+ </v-row>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:item.hash="{ item }">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <a :href="explorer + '/token/'+item.hash "> {{ item.hash }}</a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:item.name="{ item }">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ {{ item.name }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:item.symbol="{ item }">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ {{ item.symbol }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:item.explorer="{ item }">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <v-row>
|
|
|
|
|
+ <!-- tx信息过滤 -->
|
|
|
|
|
+ <v-col cols="24" md="6">
|
|
|
|
|
+ <v-select
|
|
|
|
|
+ v-model='item.magicApproval'
|
|
|
|
|
+ :items='["PASS","PENDING","REJECT"]'
|
|
|
|
|
+ label="审批状态"
|
|
|
|
|
+ ></v-select>
|
|
|
|
|
+ </v-col>
|
|
|
|
|
+ <v-col cols="24" md="2" style="margin-top:11px;">
|
|
|
|
|
+ <v-btn @click="upButClick(item)">更 新</v-btn>
|
|
|
|
|
+ </v-col>
|
|
|
|
|
+ </v-row>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ </v-data-table>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 底部分页 -->
|
|
|
|
|
+ <div class="mt-2">
|
|
|
|
|
+ <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-col>
|
|
|
|
|
+ <v-col cols="4">
|
|
|
|
|
+ <v-pagination :disabled="table.loading" :length="table.pageLength" v-model="table.pageNum"
|
|
|
|
|
+ @input="generateTableDataAgain"></v-pagination>
|
|
|
|
|
+ </v-col>
|
|
|
|
|
+ </v-row>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </v-card>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 新增 -->
|
|
|
|
|
+ <v-dialog v-model="editDialog.visible" max-width="800">
|
|
|
|
|
+ <v-card elevation="0">
|
|
|
|
|
+ <v-card-title>{{ editDialog.addOrUpdate ? '新增' : '编辑' }} MagicToken</v-card-title>
|
|
|
|
|
+ <v-card-text>
|
|
|
|
|
+ <v-row>
|
|
|
|
|
+ <v-col cols="12">
|
|
|
|
|
+ <v-text-field v-if="editDialog.addOrUpdate" label="hash" v-model="editDialog.item.hash"></v-text-field>
|
|
|
|
|
+ <v-text-field v-else disabled label="hash" v-model="editDialog.item.hash"></v-text-field>
|
|
|
|
|
+ </v-col>
|
|
|
|
|
+ </v-row>
|
|
|
|
|
+ <v-row>
|
|
|
|
|
+ <v-col cols="12">
|
|
|
|
|
+ <v-text-field label="name" v-model="editDialog.item.name"></v-text-field>
|
|
|
|
|
+ </v-col>
|
|
|
|
|
+ </v-row>
|
|
|
|
|
+ <v-row>
|
|
|
|
|
+ <v-col cols="12">
|
|
|
|
|
+ <v-text-field label="symbol" v-model="editDialog.item.symbol"></v-text-field>
|
|
|
|
|
+ </v-col>
|
|
|
|
|
+ </v-row>
|
|
|
|
|
+ <v-row>
|
|
|
|
|
+ <v-col cols="12">
|
|
|
|
|
+ <v-text-field label="decimals" v-model="editDialog.item.decimals"></v-text-field>
|
|
|
|
|
+ </v-col>
|
|
|
|
|
+ </v-row>
|
|
|
|
|
+<!-- <v-row>-->
|
|
|
|
|
+<!-- <v-col cols="12">-->
|
|
|
|
|
+<!-- <v-select-->
|
|
|
|
|
+<!-- v-model='editDialog.item.magicApproval'-->
|
|
|
|
|
+<!-- :items='["PASS","PENDING","REJECT"]'-->
|
|
|
|
|
+<!-- label="审批状态"-->
|
|
|
|
|
+<!-- ></v-select>-->
|
|
|
|
|
+<!-- </v-col>-->
|
|
|
|
|
+<!-- </v-row>-->
|
|
|
|
|
+ </v-card-text>
|
|
|
|
|
+ <v-card-actions>
|
|
|
|
|
+ <v-spacer></v-spacer>
|
|
|
|
|
+ <v-btn text color="primary" @click="addOrUpdateAddress">提交</v-btn>
|
|
|
|
|
+ </v-card-actions>
|
|
|
|
|
+ </v-card>
|
|
|
|
|
+ </v-dialog>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import TradeInfo from '@/components/viewer/magicToken/table/TradeInfoDetails'
|
|
|
|
|
+import BooleanViewer from '@/components/viewer/magicToken/table/BooleanViewer'
|
|
|
|
|
+import HashKit from '@/plugins/kit/HashKit'
|
|
|
|
|
+import HttpKit from '@/plugins/kit/HttpKit'
|
|
|
|
|
+import TimeKit from '@/plugins/kit/TimeKit'
|
|
|
|
|
+import MagicTokenModel from "@/plugins/model/MagicTokenModel";
|
|
|
|
|
+import jquery from 'jquery'
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: 'Table',
|
|
|
|
|
+ components: {BooleanViewer, TradeInfo},
|
|
|
|
|
+ props: ['query', 'page', 'table', 'magicTokenModel', 'explorer', 'editDialog'],
|
|
|
|
|
+ inject: ['packQuery', 'showVisible', 'butSetMagicApprolval'],
|
|
|
|
|
+ data: () => ({
|
|
|
|
|
+ hashKit: HashKit,
|
|
|
|
|
+ httpKit: HttpKit,
|
|
|
|
|
+ timeKit: TimeKit,
|
|
|
|
|
+ transferDetailsDialog: {
|
|
|
|
|
+ data: [],
|
|
|
|
|
+ visible: false
|
|
|
|
|
+ },
|
|
|
|
|
+ tempPage: 1,
|
|
|
|
|
+ dblclickRowUrl: "https://tools.blocksec.com/tx/eth/",
|
|
|
|
|
+ }),
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ async addOrUpdateAddress() {
|
|
|
|
|
+
|
|
|
|
|
+ const {hash, symbol,name,decimals} = this.editDialog.item
|
|
|
|
|
+ const updateMagicToken = {hash, symbol,name,decimals}
|
|
|
|
|
+ const rst1 = await this.magicTokenModel.updateMagicTokenModelBaseModel(updateMagicToken)
|
|
|
|
|
+ if (rst1.state) {
|
|
|
|
|
+ this.$msgkit.success((this.editDialog.addOrUpdate ? '添加' : '更新') + '成功')
|
|
|
|
|
+
|
|
|
|
|
+ this.editDialog.visible = false
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$msgkit.error(`rst1: ${rst1.msg}`)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ async inputPageNum() {
|
|
|
|
|
+ this.table.pageNum = parseInt(this.tempPage)
|
|
|
|
|
+ await this.generateTableDataAgain()
|
|
|
|
|
+ },
|
|
|
|
|
+ async generateTableDataAgain() {
|
|
|
|
|
+ this.tempPage = this.table.pageNum
|
|
|
|
|
+ this.table.data = []
|
|
|
|
|
+
|
|
|
|
|
+ await this.packQuery()
|
|
|
|
|
+ },
|
|
|
|
|
+ formatTimeBySixBitTimestamp(sixBitTimestamp) {
|
|
|
|
|
+ let lastThreeBit = (sixBitTimestamp + '').slice(-3)
|
|
|
|
|
+ return this.timeKit.getTime(sixBitTimestamp) + lastThreeBit
|
|
|
|
|
+ },
|
|
|
|
|
+ editItem(item) {
|
|
|
|
|
+ this.editDialog.item = item
|
|
|
|
|
+ this.editDialog.visible = true
|
|
|
|
|
+ this.editDialog.addOrUpdate = false
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ upButClick(item) {
|
|
|
|
|
+ console.log('---', item)
|
|
|
|
|
+ this.butSetMagicApprolval(item.hash, item.magicApproval, '')
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ remButClick() {
|
|
|
|
|
+ jquery(".v-row-group__header td.text-start").unbind('click')
|
|
|
|
|
+ // console.log("移除点击事件:remButClick")
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ async mounted() {
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style scoped>
|
|
|
|
|
+.table-container {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+#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;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.memo-span {
|
|
|
|
|
+ width: 200px;
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ padding: 10px;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|