fear:vreq

This commit is contained in:
chaosBreaking
2019-10-18 23:23:49 +08:00
parent 4632ed8849
commit 1baba5c882
8 changed files with 233 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
export default { export default {
login: { login: {
title: 'TIC 控制台', title: 'VIC台',
inputLabel: '请输入密语例如Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos, molestias, quisquam?', inputLabel: '请输入密语例如Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos, molestias, quisquam?',
loginBtn: '登录', loginBtn: '登录',
secwordBtn: '新密语', secwordBtn: '新密语',
@@ -10,7 +10,7 @@ export default {
titleOwner: '账户信息', titleOwner: '账户信息',
titleNode: '用户操作', titleNode: '用户操作',
titleNetwork: '提现申请', titleNetwork: '提现申请',
titleChain: '数据', titleChain: '实名申请',
titleToken: '通证', titleToken: '通证',
titleMarket: '应用', titleMarket: '应用',
}, },

View File

@@ -7,6 +7,7 @@ import Login from './views/Login'
import Users from './views/Users' import Users from './views/Users'
import Actions from './views/Actions' import Actions from './views/Actions'
import Tickets from './views/Tickets' import Tickets from './views/Tickets'
import Vreqs from './views/Vreqs'
Vue.use(Router) Vue.use(Router)
@@ -32,6 +33,10 @@ const router = new Router({
path: 'tickets', path: 'tickets',
component: Tickets, component: Tickets,
}, },
{
path: 'vreq',
component: Vreqs,
},
{ {
path: '*', path: '*',
redirect: 'users', redirect: 'users',

View File

@@ -1,6 +1,4 @@
import axios from 'axios' import axios from 'axios'
import { app } from '../../services'
import { ticApi } from '../../services/api'
export default { export default {
namespaced: true, namespaced: true,
@@ -55,10 +53,10 @@ export default {
async nextPage({ state, commit }, event) { async nextPage({ state, commit }, event) {
const { token } = JSON.parse(sessionStorage.getItem('KEY_ACCOUNT')) const { token } = JSON.parse(sessionStorage.getItem('KEY_ACCOUNT'))
const { page, rowsPerPage } = event const { page, rowsPerPage } = event
// const { userId, type, op } = state const { type } = state
const pageSize = rowsPerPage const pageSize = rowsPerPage
const pageIndex = page const pageIndex = page
const result = await axios.post('admin/actions', { query: { ...state }, option: { pageSize, pageIndex } }, { headers: { token } }) const result = await axios.post('admin/actions', { query: { type }, option: { pageSize, pageIndex } }, { headers: { token } })
const arr = result.data && result.data.data || [] const arr = result.data && result.data.data || []
commit('setUserList', arr) commit('setUserList', arr)
}, },

View File

@@ -2,3 +2,4 @@
export { default as netnode } from './actions' export { default as netnode } from './actions'
export { default as owner } from './users' export { default as owner } from './users'
export { default as login } from './login' export { default as login } from './login'
export { default as chain } from './vreq'

87
src/store/modules/vreq.js Normal file
View File

@@ -0,0 +1,87 @@
import axios from 'axios'
export default {
namespaced: true,
state: {
pageEntity: [10, 20],
headers: [
{ text: '用户userId', value: 'userId', align: 'center' },
{ text: '申请认证等级verifyLevel', value: 'type', align: 'center' },
{ text: '认证状态status(0认证中/1认证成功/2认证失败)', value: 'status', align: 'center' },
{ text: '回执信息info', value: 'info', align: 'center' },
{ text: '真实姓名realname', value: 'realname', align: 'center' },
{ text: '证件号idNo', value: 'idNo', align: 'center' },
{ text: '正照pic1', value: 'pic1', align: 'center' },
{ text: '反照pic2', value: 'pic2', align: 'center' },
{ text: '创建时间createdAt', value: 'createdAt', align: 'center' },
],
itemList: [
{
userId: 'loading',
type: 'loading',
status: 'loading',
info: 'loading',
realname: 'loading',
idNo: 'loading',
pic1: 'loading',
pic2: 'loading',
createdAt: 'loading',
},
],
},
mutations: {
inputFilter(state, filter) {
state.filter = filter
},
setUserNumSum(state, address) {
state.address = address
},
setUserList(state, actions) {
state.itemList = actions
},
},
actions: {
async queryVreqInfo({ state, commit }) {
const { token } = JSON.parse(sessionStorage.getItem('KEY_ACCOUNT'))
const { userId } = state
const pageSize = 20
const pageIndex = 1
const result = await axios.post('admin/vreqs', { query: { userId }, option: { pageSize, pageIndex } }, { headers: { token } })
const arr = result.data && result.data.data || []
commit('setUserList', arr)
},
async nextPage({ state, commit }, event) {
const { token } = JSON.parse(sessionStorage.getItem('KEY_ACCOUNT'))
const { page, rowsPerPage } = event
const pageSize = rowsPerPage
const pageIndex = page
const { type, status } = state
const result = await axios.post('admin/vreqs', { query: { type, status }, option: { pageSize, pageIndex } }, { headers: { token } })
const arr = result.data && result.data.data || []
commit('setUserList', arr)
},
async searchVreq({ state, commit }, event) {
const { token } = JSON.parse(sessionStorage.getItem('KEY_ACCOUNT'))
const { page, rowsPerPage } = event
const t = state.filter
if (!t) return 0
const query = {}
t.replace(/{|}| /g, '').replace('', ',').replace('', ':').replace('id', '_id').split(',').map(obj => {
const [k, v] = obj.split(':')
query[k] = v
})
const pageSize = rowsPerPage
const pageIndex = page
const result = await axios.post('admin/vreqs', { query, option: { pageSize, pageIndex } }, { headers: { token } })
const arr = result.data && result.data.data || []
commit('setUserList', arr)
},
},
getters: {},
}

View File

@@ -36,11 +36,11 @@ const sideMenus = [
icon: 'public', icon: 'public',
path: '/tickets', path: '/tickets',
}, },
// { {
// title: 'home.titleChain', title: 'home.titleChain',
// icon: 'timeline', icon: 'timeline',
// path: '/chain', path: '/vreq',
// }, },
// { // {
// title: 'home.titleMarket', // title: 'home.titleMarket',
// icon: 'apps', // icon: 'apps',

View File

@@ -178,7 +178,7 @@ export default {
.app-body { .app-body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: auto;
.app-header { .app-header {
&.collapsed { &.collapsed {
margin-top: -$headerHeight; margin-top: -$headerHeight;

130
src/views/Vreqs.vue Normal file
View File

@@ -0,0 +1,130 @@
<template>
<div class="netnode-page">
<div class="table-content elevation-1">
<div class="panel-header">
<h3>实名请求</h3>
<div class="search-input">
<v-text-field
@keyup.13="searchVreq"
placeholder="输入查询条件"
: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"
@update:pagination="nextPage"
>
<template slot="headerCell" slot-scope="props">
<span>{{ $t(props.header.text) }}</span>
</template>
<template slot="items" slot-scope="props">
<td>{{ props.item.userId }}</td>
<td>{{ props.item.verifyLevel }}</td>
<td>{{ props.item.status }}</td>
<td>{{ props.item.info }}</td>
<td>{{ props.item.data.realname }}</td>
<td>{{ props.item.data.idNo }}</td>
<td><a target="_blank" :href="'https://server.vic.yuanjin.net/static/'+props.item.data.pic1.split('/')[1]">正面照片</a></td>
<td><a target="_blank" :href="'https://server.vic.yuanjin.net/static/'+props.item.data.pic2.split('/')[1]">背面照片</a></td>
<td>{{ props.item.createdAt }}</td>
</template>
<template slot="no-results">
{{ $t('netnode.tableNone') }}
</template>
</v-data-table>
</template>
</div>
</div>
</template>
<script>
import {
createNamespacedHelpers,
} from 'vuex'
const { mapState, mapGetters, mapActions, mapMutations } = createNamespacedHelpers('chain')
export default {
computed: {
...mapState([
'headers',
'itemList',
'pageEntity',
'fetching',
]),
...mapGetters([]),
},
methods: {
...mapActions([
'queryVreqInfo',
'queryOne',
'nextPage',
'searchVreq'
]),
...mapMutations([
'inputFilter',
'setIpAddress',
]),
},
mounted() {
this.queryVreqInfo()
},
}
</script>
<style scoped lang="scss">
.netnode-page {
.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>