From 1baba5c8827297d34960ac1da64d63c25e113d0d Mon Sep 17 00:00:00 2001 From: chaosBreaking Date: Fri, 18 Oct 2019 23:23:49 +0800 Subject: [PATCH] fear:vreq --- src/i18n/zh-CN.js | 4 +- src/router.js | 5 ++ src/store/modules/actions.js | 6 +- src/store/modules/index.js | 1 + src/store/modules/vreq.js | 87 +++++++++++++++++++++++ src/store/rootStore.js | 10 +-- src/views/Home.vue | 2 +- src/views/Vreqs.vue | 130 +++++++++++++++++++++++++++++++++++ 8 files changed, 233 insertions(+), 12 deletions(-) create mode 100644 src/store/modules/vreq.js create mode 100644 src/views/Vreqs.vue diff --git a/src/i18n/zh-CN.js b/src/i18n/zh-CN.js index 51ad2b3..448e58c 100644 --- a/src/i18n/zh-CN.js +++ b/src/i18n/zh-CN.js @@ -1,6 +1,6 @@ export default { login: { - title: 'TIC 控制台', + title: 'VIC后台', inputLabel: '请输入密语,例如:Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos, molestias, quisquam?', loginBtn: '登录', secwordBtn: '新密语', @@ -10,7 +10,7 @@ export default { titleOwner: '账户信息', titleNode: '用户操作', titleNetwork: '提现申请', - titleChain: '数据', + titleChain: '实名申请', titleToken: '通证', titleMarket: '应用', }, diff --git a/src/router.js b/src/router.js index 4e3b7fd..743bdf3 100644 --- a/src/router.js +++ b/src/router.js @@ -7,6 +7,7 @@ import Login from './views/Login' import Users from './views/Users' import Actions from './views/Actions' import Tickets from './views/Tickets' +import Vreqs from './views/Vreqs' Vue.use(Router) @@ -32,6 +33,10 @@ const router = new Router({ path: 'tickets', component: Tickets, }, + { + path: 'vreq', + component: Vreqs, + }, { path: '*', redirect: 'users', diff --git a/src/store/modules/actions.js b/src/store/modules/actions.js index 008dc67..aacf744 100644 --- a/src/store/modules/actions.js +++ b/src/store/modules/actions.js @@ -1,6 +1,4 @@ import axios from 'axios' -import { app } from '../../services' -import { ticApi } from '../../services/api' export default { namespaced: true, @@ -55,10 +53,10 @@ export default { async nextPage({ state, commit }, event) { const { token } = JSON.parse(sessionStorage.getItem('KEY_ACCOUNT')) const { page, rowsPerPage } = event - // const { userId, type, op } = state + const { type } = state const pageSize = rowsPerPage 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 || [] commit('setUserList', arr) }, diff --git a/src/store/modules/index.js b/src/store/modules/index.js index 8336f12..17e4590 100644 --- a/src/store/modules/index.js +++ b/src/store/modules/index.js @@ -2,3 +2,4 @@ export { default as netnode } from './actions' export { default as owner } from './users' export { default as login } from './login' +export { default as chain } from './vreq' diff --git a/src/store/modules/vreq.js b/src/store/modules/vreq.js new file mode 100644 index 0000000..4d0664f --- /dev/null +++ b/src/store/modules/vreq.js @@ -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: {}, +} diff --git a/src/store/rootStore.js b/src/store/rootStore.js index 98729f8..a4be12e 100644 --- a/src/store/rootStore.js +++ b/src/store/rootStore.js @@ -36,11 +36,11 @@ const sideMenus = [ icon: 'public', path: '/tickets', }, - // { - // title: 'home.titleChain', - // icon: 'timeline', - // path: '/chain', - // }, + { + title: 'home.titleChain', + icon: 'timeline', + path: '/vreq', + }, // { // title: 'home.titleMarket', // icon: 'apps', diff --git a/src/views/Home.vue b/src/views/Home.vue index 843ff38..63bf27a 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -178,7 +178,7 @@ export default { .app-body { display: flex; flex-direction: column; - + overflow: auto; .app-header { &.collapsed { margin-top: -$headerHeight; diff --git a/src/views/Vreqs.vue b/src/views/Vreqs.vue new file mode 100644 index 0000000..41eabf3 --- /dev/null +++ b/src/views/Vreqs.vue @@ -0,0 +1,130 @@ + + + + +