This commit is contained in:
chaosBreaking
2019-10-07 19:52:58 +08:00
parent d094299226
commit cc76ad9940
17 changed files with 194 additions and 593 deletions

View File

@@ -7,9 +7,9 @@ export default {
errorMnemonic: '输入的密语无效',
},
home: {
titleOwner: '账户',
titleNode: '节点',
titleNetwork: '网络',
titleOwner: '账户信息',
titleNode: '用户操作',
titleNetwork: '提现申请',
titleChain: '数据',
titleToken: '通证',
titleMarket: '应用',

View File

@@ -5,10 +5,8 @@ import store from './store'
import Home from './views/Home'
import Login from './views/Login'
import Owner from './views/Owner'
import Chain from './views/Chain'
import Netnode from './views/Netnode'
import Network from './views/Network'
import Market from './views/Market'
Vue.use(Router)

View File

@@ -2,7 +2,7 @@ import axios from 'axios'
// import app from './app'
// let baseURL = `${window.location.protocol}//${window.location.hostname}:${window.location.port}/api/`
// let baseURL = `${location.protocol}//${location.hostname}:80/api/`
let baseURL = `http://server4test.vic.yuanjin.net/v1/`
let baseURL = `http://localhost:80/v1/`
// 控制台应当默认访问控制台所在主机(localhost 或者 window.location.hostname)的 TIC后台或者让用户在控制台启动时自己设置一个节点主机。
axios.defaults.baseURL = baseURL

View File

@@ -1,67 +0,0 @@
import axios from 'axios'
export default {
namespaced: true,
state: {
pageEntity: [5, 10, 25],
headers: [
{ text: 'chain.thHeight', value: 'height', align: 'center' },
{ text: 'chain.thTimestamp', value: 'timestamp', align: 'center' },
{ text: 'chain.thType', value: 'type', align: 'center', sortable: false },
{ text: 'chain.thHash', value: 'hash', align: 'center' },
],
itemList: [
{
height: 'loading',
timestamp: 'loading',
type: 'loading',
hash: 'loading',
},
],
fetching: false,
filter: '',
modal: false,
isConnected: false,
},
mutations: {
inputFilter(state, filter) {
state.filter = filter
},
showModal(state) {
state.modal = true
},
hideModal(state) {
state.modal = false
},
setItemList(state, blockList) {
state.itemList = blockList
},
addItem(state, block) {
let temp = [block]
state.itemList = temp.concat(state.itemList)
},
SOCKET_CONNECT(state, status) {
state.isConnected = true
},
},
actions: {
async queryBlockList({ state, commit }) {
let result = await axios.post('Block/getBlockList', { config: { order: 'height DESC' } })
commit('setItemList', result.data || [])
},
addNewBlock({ state, commit }, block) {
console.log(block)
commit('addItem', JSON.parse(block))
},
},
getters: {},
}

View File

@@ -1,6 +1,4 @@
export { default as chain } from './chain'
export { default as market } from './market'
export { default as network } from './network'
export { default as network } from './network'
export { default as netnode } from './netnode'
export { default as owner } from './owner'
export { default as login } from './login'

View File

@@ -4,32 +4,39 @@ import { i18n } from '../../i18n'
import _ from 'lodash'
import ticCrypto from 'tic.crypto'
import axios from 'axios'
import * as Ticrypto from 'tic.crypto'
export default {
namespaced: true,
state: {
user: '',
username: '',
passwd: '',
errorMnemonic: '',
erroruser: '',
signing: false,
renewing: false,
},
getters: {
inputError: state => !!state.errorMnemonic,
inputError: state => !!state.erroruser,
},
mutations: {
updateMnemonic(state, mnemonic) {
updateUserName(state, username) {
if (state.errorMnemonic) {
state.errorMnemonic = ''
}
state.mnemonic = mnemonic
state.username = username
},
updatePasswd(state, passwd) {
if (state.errorMnemonic) {
state.errorMnemonic = ''
}
state.passwd = passwd
},
updateError(state, error) {
state.errorMnemonic = error
state.erroruser = error
},
updateSign(state, signing) {
@@ -39,15 +46,17 @@ export default {
actions: {
async login({ state, commit }) {
console.log(state)
commit('updateSign', true)
let result = await axios.post('admin/in', { name: 'jojo', passwd: '941411d944c479af9a5e9d29d7430722d90a8e34d9585014e2f2c12b21db143d' })
const passwd = Ticrypto.hash(state.passwd)
let result = await axios.post('admin/in', { name: state.username, passwd })
commit('updateSign', false)
console.log(result.data)
if (result.code === 0) {
commit('updateAccount', 'xxx', { root: true })
if (result.data.code === 0) {
commit('updateAccount', result.data.data, { root: true })
commit('updatePasswd', '')
router.push('/home')
} else {
commit('updateError', '用户名或密码错误')
commit('updateError', result.data.msg)
}
},
async createSecword({ state, commit }) {

View File

@@ -1,7 +0,0 @@
export default {
namespaced: true,
state: {},
mutations: {},
actions: {},
getters: {},
}

View File

@@ -1,58 +1,104 @@
import axios from 'axios'
import { app } from '../../services'
import { ticApi } from '../../services/api'
export default {
namespaced: true,
state: {
pageEntity: [5, 10, 25],
headers: [
{ text: 'netnode.thHeight', value: 'height', align: 'center' },
{ text: 'netnode.thType', value: 'type', align: 'center' },
{ text: 'netnode.thHash', value: 'hash', align: 'center' },
{ text: 'netnode.thTimestamp', value: 'timestamp', align: 'center' },
// { text: 'netnode.thWinner', value: 'winnerPubkey', align: 'center' },
{ text: 'netnode.thPacker', value: 'packerPubkey', align: 'center' },
{ text: 'netnode.thRewardPacker', value: 'rewardPacker', align: 'center' },
{ text: '类型', value: 'type', align: 'center' },
{ text: '用户id', value: '_id', align: 'center' },
{ text: '资金类型', value: 'tokenType', align: 'center' },
{ text: '金额', value: 'amount', align: 'center' },
{ text: '创建时间', value: 'createdAt', align: 'center' },
],
blockList: [
itemList: [
{
height: 'loading',
timestamp: 'loading',
type: 'loading',
hash: 'loading',
rewardPacker: 'loading',
winnerPubkey: 'loading',
packerPubkey: 'loading',
_id: 'loading',
tokenType: 'loading',
createdAt: 'loading',
amount: 'loading',
},
],
fetching: false,
filter: '',
modal: false,
ipAddress: '',
userNumSum: 0,
},
mutations: {
inputFilter(state, filter) {
state.filter = filter
},
setIpAddress(state, ipAddress) {
state.ipAddress = ipAddress
setUserNumSum(state, address) {
state.address = address
},
setBlockList(state, blockList) {
state.blockList = blockList
setUserList(state, actions) {
state.itemList = actions
},
},
actions: {
async updateNodeInfo({ state, commit }) {
let account = sessionStorage.getItem('KEY_ACCOUNT')
commit('setIpAddress', axios.defaults.baseURL)
try {
account = JSON.parse(account)
const myBlocks = await axios.post('Block/getBlockList', {
Block: { packerPubkey: account.pubkey },
})
commit('setBlockList', myBlocks && myBlocks.data ? myBlocks.data : [])
} catch (e) {}
async queryUserInfo({ state, commit }) {
const { token } = JSON.parse(sessionStorage.getItem('KEY_ACCOUNT'))
const { userId, type = 0, op } = state
const result = await axios.post('admin/actions', { userId, type, op }, { headers: { token } })
axios.post('admin/actions', { userId, type, op }, { headers: { token } })
const arr = result.data && result.data.data || []
commit('setUserList', arr)
},
async performTransfer({ state, commit, rootState }) {
commit('updateSubmitting', true)
const {
targetAddress,
transferAmount,
transferFee,
// transferRemark,
} = state
let wrongAddress, wrongAmount, wrongFee
if (!(await ticApi.isAddress(targetAddress))) {
wrongAddress = '错误的地址'
} else {
wrongAddress = ''
}
if (!(+transferAmount > 0)) {
wrongAmount = '请输入正确的交易金额'
} else {
wrongAmount = ''
}
if (!(+transferFee > 0)) {
wrongFee = '请输入正确的手续费'
} else {
wrongFee = ''
}
commit('updateWrongAddress', wrongAddress)
commit('updateWrongAmount', wrongAmount)
commit('updateWrongFee', wrongFee)
if (wrongAddress || wrongAmount || wrongFee) {
commit('updateSubmitting', false)
return
}
const res = await ticApi.transferTic({
mnemonic: rootState.account.mnemonic,
to: targetAddress,
amount: +transferAmount,
fee: +transferFee,
})
if (res) {
// success
commit('updateTransferResult', '转账成功')
await app.delay(1000)
commit('toggleTransferDlg', false)
} else {
// fail
commit('updateTransferResult', '转账失败')
}
commit('updateSubmitting', false)
},
},

View File

@@ -1,4 +1,6 @@
import axios from 'axios'
import { app } from '../../services'
import { ticApi } from '../../services/api'
export default {
namespaced: true,
@@ -6,43 +8,43 @@ export default {
state: {
pageEntity: [5, 10, 25],
headers: [
{ text: 'network.thIndex', value: 'index', align: 'center' },
{ text: 'network.thAccessPoint', value: 'accessPoint', align: 'center' },
{ text: 'network.thOwnerAddress', value: 'ownerAddress', align: 'center' },
{ text: 'network.thStatus', value: 'status', align: 'center' },
{ text: '类型', value: 'type', align: 'center' },
{ text: '用户id', value: 'userId', align: 'center' },
{ text: '状态', value: 'status', align: 'center' },
{ text: '目标地址', value: 'amount', align: 'center' },
{ text: '目标地址', value: 'targetAddress', align: 'center' },
{ text: '创建时间', value: 'createdAt', align: 'center' },
],
itemList: [
{
index: 'loading',
accessPoint: 'loading',
ownerAddress: 'loading',
status: 'loading',
type: 'loading',
_id: 'loading',
tokenType: 'loading',
createdAt: 'loading',
amount: 'loading',
},
],
fetching: false,
filter: '',
nodeNumber: 'unknown',
},
mutations: {
inputFilter(state, filter) {
state.filter = filter
},
setNodeNumber(state, nodeNumber) {
state.nodeNumber = nodeNumber
},
setItemList(state, nodeList) {
state.itemList = nodeList
updateTickets(state, tickets) {
state.itemList = tickets
},
},
actions: {
async updateNetInfo({ state, commit }) {
let result = await axios.post('Netnode/nodeStat', {})
commit('setNodeNumber', (result && result.data) ? result.data.length : 0)
commit('setItemList', result.data || [])
async queryTickets({ state, commit }) {
const { token } = JSON.parse(sessionStorage.getItem('KEY_ACCOUNT'))
const { userId, type = 0, op } = state
const result = await axios.post('admin/tickets', { userId, type, op }, { headers: { token } })
axios.post('admin/tickets', { userId, type, op }, { headers: { token } })
const arr = result.data && result.data.data || []
console.log(arr)
commit('updateTickets', arr)
},
},

View File

@@ -8,44 +8,21 @@ export default {
state: {
pageEntity: [5, 10, 25],
headers: [
{ text: 'owner.thId', value: 'id', align: 'center' },
{ text: 'owner.thType', value: 'type', align: 'center' },
{ text: 'owner.thSender', value: 'sender', align: 'center' },
{ text: 'owner.thReceiver', value: 'receiver', align: 'center' },
{ text: 'owner.thDate', value: 'date', align: 'center' },
{ text: 'owner.thAmount', value: 'amount', align: 'center' },
{ text: 'owner.thFee', value: 'fee', align: 'center' },
{ text: 'owner.thRemark', value: 'remark', align: 'center' },
{ text: '用户id', value: 'id', align: 'center' },
{ text: '手机号', value: 'phone', align: 'center' },
{ text: '邀请人数', value: 'group', align: 'center' },
{ text: '持有vic', value: 'vic', align: 'center' },
],
itemList: [
{
id: 'loading',
type: 'loading',
sender: 'loading',
receiver: 'loading',
date: 'loading',
amount: 'loading',
fee: 'loading',
remark: 'loading',
phone: 'loading',
group: 'loading',
vic: 'loading',
},
],
fetching: false,
filter: '',
balance: 0,
address: '',
transferVisible: false,
submitting: false, // 提交转账
targetAddress: '',
transferAmount: '',
transferFee: '',
transferRemark: '',
wrongAddress: '',
wrongAmount: '',
wrongFee: '',
transferResult: '',
userNumSum: 0,
},
mutations: {
@@ -53,75 +30,24 @@ export default {
state.filter = filter
},
setBalance(state, balance) {
state.balance = balance
setUserNumSum(state, sum) {
state.userNumSum = sum
},
setAddress(state, address) {
state.address = address
},
setActions(state, actions) {
setUserList(state, actions) {
state.itemList = actions
},
toggleTransferDlg(state, value) {
state.transferVisible = value
state.transferResult = ''
},
changeTargetAddress(state, value) {
state.targetAddress = value
},
changeTransferAmount(state, value) {
state.transferAmount = value
},
changeTransferFee(state, value) {
state.transferFee = value
},
changeTransferRemark(state, value) {
state.transferRemark = value
},
updateSubmitting(state, submitting) {
state.submitting = submitting
},
updateWrongAddress(state, msg) {
state.wrongAddress = msg
},
updateWrongAmount(state, msg) {
state.wrongAmount = msg
},
updateWrongFee(state, msg) {
state.wrongFee = msg
},
updateTransferResult(state, msg) {
state.transferResult = msg
},
},
actions: {
async updateOwnerInfo({ state, commit }) {
let account = sessionStorage.getItem('KEY_ACCOUNT')
try {
account = JSON.parse(account)
commit('setAddress', account.address)
const balance = await axios.post('Account/getBalance', {
Account: { address: account.address },
})
commit('setBalance', (balance && balance.data) ? balance.data : 0)
const actions = await axios.post('Action/getActionList', {
Action: { actorAddress: account.address },
})
commit('setActions', actions && actions.data ? actions.data : [])
} catch (e) {}
async queryUserInfo({ state, commit }) {
const { token } = JSON.parse(sessionStorage.getItem('KEY_ACCOUNT'))
const { id, phone } = state
const result = await axios.post('admin/users', { id, phone }, { headers: { token } })
const arr = result.data && result.data.data || []
const sum = result.data && result.data.sum || 0
commit('setUserList', arr)
commit('setUserNumSum', sum)
},
async performTransfer({ state, commit, rootState }) {

View File

@@ -36,16 +36,16 @@ const sideMenus = [
icon: 'public',
path: '/network',
},
{
title: 'home.titleChain',
icon: 'timeline',
path: '/chain',
},
{
title: 'home.titleMarket',
icon: 'apps',
path: '/market',
},
// {
// title: 'home.titleChain',
// icon: 'timeline',
// path: '/chain',
// },
// {
// title: 'home.titleMarket',
// icon: 'apps',
// path: '/market',
// },
]
export default {
@@ -58,7 +58,7 @@ export default {
},
getters: {
isLogin: state => state.account.pubkey,
isLogin: state => state.account.token,
currentPath: () => router.currentRoute.path,
},

View File

@@ -1,186 +0,0 @@
<template>
<div class="chain-page">
<div class="card-content">
<div @click="showModal" class="app-card elevation-1"></div>
<div class="app-sep"></div>
<div class="app-card elevation-1"></div>
<div class="app-sep"></div>
<div class="app-card elevation-1"></div>
</div>
<div class="table-content elevation-1">
<div class="panel-header">
<h3>{{ $t('chain.tableHeader') }}</h3>
<div class="search-input">
<v-text-field
:placeholder="$t('chain.searchHolder')"
:value="filter"
@input="inputFilter"
append-icon="search" />
</div>
</div>
<template>
<v-data-table
:headers="headers"
:items="itemList"
:total-items="100"
:rows-per-page-items="pageEntity"
:loading="fetching"
class="panel-content elevation-1"
>
<template slot="headerCell" slot-scope="props">
<span>{{ $t(props.header.text) }}</span>
</template>
<template slot="items" slot-scope="props">
<td>{{ props.item.height }}</td>
<td>{{ props.item.timestamp }}</td>
<td>{{ props.item.type }}</td>
<td>{{ props.item.hash }}</td>
</template>
<template slot="no-results">
{{ $t('chain.tableNone') }}
</template>
</v-data-table>
</template>
</div>
<v-dialog v-model="modal" persistent>
<v-card class="app-modal">
<v-card-title>事务列表</v-card-title>
<v-data-table
:headers="headers"
:items="itemList"
:total-items="100"
:rows-per-page-items="pageEntity"
:loading="fetching"
class="panel-content elevation-1"
>
<template slot="headerCell" slot-scope="props">
<span>{{ $t(props.header.text) }}</span>
</template>
<template slot="items" slot-scope="props">
<td>{{ props.item.height }}</td>
<td>{{ props.item.timestamp }}</td>
<td>{{ props.item.type }}</td>
<td>{{ props.item.hash }}</td>
</template>
<template slot="no-results">
{{ $t('chain.tableNone') }}
</template>
</v-data-table>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary darken-1" flat @click.native="hideModal">Close</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
import {
createNamespacedHelpers,
} from 'vuex'
import Vue from 'vue'
import store from '../store'
import VueSocketio from 'vue-socket.io'
import io from 'socket.io-client'
// import axios from 'axios'
const { mapState, mapGetters, mapActions, mapMutations } = createNamespacedHelpers('chain')
const socketUrl = `ws://${location.hostname}:60000`
// Vue.use(VueSocketio, io(socketUrl), store)
export default {
name: 'Chain',
computed: {
...mapState([
'headers',
'itemList',
'pageEntity',
'fetching',
'filter',
'modal',
]),
...mapGetters([]),
},
// sockets: {
// connect() {
// console.log('socket connected')
// },
// newBlock(msg) {
// this.addNewBlock(msg)
// },
// },
methods: {
...mapActions([
'queryBlockList',
'addNewBlock',
]),
...mapMutations([
'inputFilter',
'showModal',
'hideModal',
'addItem',
]),
},
mounted() {
// this.queryBlockList()
},
}
</script>
<style scoped lang="scss">
.chain-page {
height: 0;
overflow: auto;
z-index: 1;
.card-content {
display: flex;
padding: 20px;
.app-card {
flex: 1;
height: 100px;
background-color: white;
}
.app-sep {
width: 20px;
}
}
.table-content {
flex: 1;
margin: 0 20px 20px;
background-color: white;
display: flex;
flex-direction: column;
.panel-header {
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 20px;
.search-input {
width: 80%;
}
}
.panel-content {
margin: 0 20px 20px;
}
}
}
</style>

View File

@@ -9,11 +9,11 @@
dark autofocus
single-line
:error="inputError"
:error-messages="errorMnemonic"
:error-messages="erroruser"
:value="user"
:loading="signing"
:renewing="renewing"
@input="updateMnemonic"
@input="updateUserName"
label="用户名" />
<v-text-field
@@ -21,11 +21,12 @@
dark autofocus
single-line
:error="inputError"
:error-messages="errorMnemonic"
:error-messages="erroruser"
:value="passwd"
:loading="signing"
:renewing="renewing"
@input="updateMnemonic"
@input="updatePasswd"
type='password'
@keyup.13="login"
label="密码" />
@@ -72,7 +73,7 @@ export default {
...mapState([
'user',
'passwd',
'errorMnemonic',
'erroruser',
'signing',
'renewing',
]),
@@ -87,7 +88,8 @@ export default {
methods: {
...mapMutations([
'updateMnemonic',
'updateUserName',
'updatePasswd'
]),
...mapActions([
'login',

View File

@@ -1,16 +0,0 @@
<template>
<div class="market-page">
Market
</div>
</template>
<script>
export default {
name: 'Market',
}
</script>
<style scoped lang="scss">
.market-page {
}
</style>

View File

@@ -1,15 +1,5 @@
<template>
<div class="netnode-page">
<div class="card-content">
<div class="app-card elevation-1">
<div>主机地址 <br> {{ ipAddress }}</div>
</div>
<div class="app-sep"></div>
<div class="app-card elevation-1">
<div>在线用户 <br> </div>
</div>
</div>
<div class="table-content elevation-1">
<div class="panel-header">
<h3>{{ $t('netnode.tableHeader') }}</h3>
@@ -21,11 +11,10 @@
append-icon="search" />
</div>
</div>
<template>
<v-data-table
:headers="headers"
:items="blockList"
:items="itemList"
:total-items="100"
:rows-per-page-items="pageEntity"
:loading="fetching"
@@ -35,13 +24,11 @@
<span>{{ $t(props.header.text) }}</span>
</template>
<template slot="items" slot-scope="props">
<td>{{ props.item.height }}</td>
<td>{{ props.item.type }}</td>
<td>{{ props.item.hash }}</td>
<td>{{ props.item.timestamp }}</td>
<!-- <td>{{ props.item.winnerPubkey }}</td> -->
<td>{{ props.item.packerPubkey }}</td>
<td>{{ props.item.rewardPacker }}</td>
<td>{{ props.item._id }}</td>
<td>{{ props.item.tokenType }}</td>
<td>{{ props.item.amount }}</td>
<td>{{ props.item.createdAt }}</td>
</template>
<template slot="no-results">
{{ $t('netnode.tableNone') }}
@@ -66,19 +53,17 @@ export default {
computed: {
...mapState([
'headers',
'blockList',
'itemList',
'pageEntity',
'fetching',
'filter',
'modal',
'ipAddress',
]),
...mapGetters([]),
},
methods: {
...mapActions([
'updateNodeInfo',
'queryUserInfo',
'queryOne',
]),
...mapMutations([
'inputFilter',
@@ -87,7 +72,7 @@ export default {
},
mounted() {
this.updateNodeInfo()
this.queryUserInfo()
},
}

View File

@@ -1,15 +1,5 @@
<template>
<div class="network-page">
<div class="card-content">
<div class="app-card elevation-1">
<div>当前邻居节点数 <br>{{ nodeNumber }}</div>
</div>
<div class="app-sep"></div>
<div class="app-card elevation-1">
<div>当前全网节点数 <br>{{ nodeNumber }}</div>
</div>
</div>
<div class="table-content elevation-1">
<div class="panel-header">
<h3>{{ $t('network.tableHeader') }}</h3>
@@ -35,10 +25,12 @@
<span>{{ $t(props.header.text) }}</span>
</template>
<template slot="items" slot-scope="props">
<td>{{ props.item.index }}</td>
<td>{{ props.item.accessPoint }}</td>
<td>{{ props.item.ownerAddress }}</td>
<td>{{ props.item.type }}</td>
<td>{{ props.item.userId }}</td>
<td>{{ props.item.status }}</td>
<td>{{ props.item.targetAddress }}</td>
<td>{{ props.item.action.amount }}</td>
<td>{{ props.item.createdAt }}</td>
</template>
<template slot="no-results">
{{ $t('network.tableNone') }}
@@ -66,15 +58,13 @@ export default {
'pageEntity',
'fetching',
'filter',
'nodeNumber',
'nodeNumber',
]),
...mapGetters([]),
},
methods: {
...mapActions([
'updateNetInfo',
'queryTickets',
]),
...mapMutations([
'inputFilter',
@@ -84,7 +74,7 @@ export default {
},
mounted() {
this.updateNetInfo()
this.queryTickets()
},
}

View File

@@ -1,77 +1,14 @@
<template>
<div class="owner-page">
<v-dialog
:value="transferVisible"
@input="toggleTransferDlg"
:width="500"
:max-width="600"
persistent
>
<v-card>
<section class='dlg-body'>
<span class="title-decoration dlg-line">我的地址</span>
<span class="address-decoration dlg-line">{{ address }}</span>
<span class="title-decoration dlg-line">接受地址</span>
<v-text-field
autofocus
single-line
:error-messages="wrongAddress"
:value="targetAddress"
@input="changeTargetAddress"
></v-text-field>
<div class="group-line">
<span class="title-decoration title-left">转账金额</span>
<v-text-field
single-line
:error-messages="wrongAmount"
:value="transferAmount"
@input="changeTransferAmount"
></v-text-field>
<span class="title-decoration title-right">TIC</span>
</div>
<div class="group-line">
<span class="title-decoration title-left">手续费</span>
<v-text-field
single-line
:error-messages="wrongFee"
:value="transferFee"
@input="changeTransferFee"
></v-text-field>
<span class="title-decoration title-right">TIC</span>
</div>
<span class="title-decoration dlg-line">备注</span>
<v-text-field
:value="transferRemark"
@input="changeTransferRemark"
></v-text-field>
</section>
<v-card-actions>
<v-spacer></v-spacer>
<span class="result-hint">{{ transferResult }}</span>
<v-btn color="grey darken-1" flat @click="hideTransferDlg">关闭</v-btn>
<v-btn
color="blue darken-1"
flat
@click="performTransfer"
:loading="submitting"
>转账</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<div class="card-content">
<div class="app-card elevation-1">
<div class="card-body">
<span>主人地址</span>
<span>{{ address }}</span>
<span>用户总数</span>
<span>{{ userNumSum }}</span>
</div>
</div>
<div class="app-sep"></div>
<div class="app-card elevation-1">
<!-- <div class="app-card elevation-1">
<div class="card-body">
<span>余额: {{ balance }}</span>
<v-btn
@@ -79,11 +16,11 @@
color="info"
>转账</v-btn>
</div>
</div>
</div> -->
</div>
<div class="table-content elevation-1">
<div class="panel-header">
<h3>{{ $t('owner.tableHeader') }}</h3>
<h3>用户列表</h3>
<div class="search-input">
<v-text-field
:placeholder="$t('owner.searchHolder')"
@@ -106,14 +43,10 @@
<span>{{ $t(props.header.text) }}</span>
</template>
<template slot="items" slot-scope="props">
<td>{{ props.item.hash }}</td>
<td>{{ props.item.type }}</td>
<td>{{ props.item.actorAddress }}</td>
<td>{{ props.item.toAddress }}</td>
<td>{{ props.item.timestamp }}</td>
<td>{{ props.item.amount }}</td>
<td>{{ props.item.fee }}</td>
<td>{{ props.item.message }}</td>
<td>{{ props.item._id }}</td>
<td>{{ props.item.phone }}</td>
<td>{{ props.item.group.length }}</td>
<td>{{ props.item.vic }}</td>
</template>
<template slot="no-results">
{{ $t('owner.tableNone') }}
@@ -136,31 +69,19 @@ export default {
computed: {
...mapState([
'userNumSum',
'headers',
'itemList',
'pageEntity',
'fetching',
'filter',
'balance',
'address',
'transferVisible',
'targetAddress',
'transferAmount',
'transferFee',
'transferRemark',
'submitting',
'wrongAddress',
'wrongAmount',
'wrongFee',
'transferResult',
]),
...mapGetters([]),
},
methods: {
...mapActions([
'updateOwnerInfo',
'performTransfer',
'queryUserInfo',
'queryOne',
]),
...mapMutations([
'inputFilter',
@@ -183,7 +104,7 @@ export default {
},
mounted() {
this.updateOwnerInfo()
this.queryUserInfo()
},
}