统计等bug修复

dev
Jo 3 years ago
parent 9f404f0a3d
commit dfa2603ef9
  1. 8
      src/layouts/header/index.vue
  2. 2
      src/layouts/navbar/index.vue
  3. 2
      src/pages/account/login/index.vue
  4. 18
      src/pages/data/list/index.vue
  5. 100
      src/pages/stat/list/index.vue
  6. 20
      src/pages/user/list/index.vue

@ -5,7 +5,7 @@
</a> </a>
<div class="inner"> <div class="inner">
<div style="height: 64px;"></div> <div style="height: 64px;"></div>
<navbar ref="nav"></navbar> <navbar ref="nav" @hideSetting="hideSetting"></navbar>
<div class="action" v-if="token"> <div class="action" v-if="token">
<img v-if="showSetting" class="icon m-r-20" src="../../assets/img/setting.png" alt="" @click="toManager"> <img v-if="showSetting" class="icon m-r-20" src="../../assets/img/setting.png" alt="" @click="toManager">
<el-dropdown class="user-wrap" @command="userCommand"> <el-dropdown class="user-wrap" @command="userCommand">
@ -119,9 +119,6 @@ export default {
userName && this.setInfo({ userName && this.setInfo({
userName userName
}) })
} else {
// 3/data/list
if (this.routes.length && !this.routes.find(e => e.name !== '/data/list')) this.showSetting = false
} }
// , // ,
setTimeout(() => { setTimeout(() => {
@ -145,6 +142,9 @@ export default {
}) })
}).catch(err => { }) }).catch(err => { })
}, },
hideSetting() {
this.showSetting = false
},
toIndex() { toIndex() {
this.$route.path === '/index/list' this.$route.path === '/index/list'
? location.reload() ? location.reload()

@ -106,6 +106,8 @@ export default {
getPer() { getPer() {
this.$get(`${this.api.getPermissions}?platformId=${Setting.platformId}`).then(res => { this.$get(`${this.api.getPermissions}?platformId=${Setting.platformId}`).then(res => {
let routes = res.permissionMenu[0].children let routes = res.permissionMenu[0].children
// 3/data/list
routes.length && !routes.find(e => e.path !== '/data/list') && this.$emit('hideSetting')
Setting.dynamicRoute && addRoutes(routes) Setting.dynamicRoute && addRoutes(routes)
this.initMenu() this.initMenu()
}).catch(err => { }).catch(err => {

@ -34,7 +34,7 @@
</div> </div>
<el-dialog title="绑定手机号" :visible.sync="phoneVisible" :close-on-click-modal="false" width="30%"> <el-dialog title="绑定手机号" :visible.sync="phoneVisible" :close-on-click-modal="false" width="30%">
<p class="tips">依据国家政策法规需绑定手机号进行网络实名才可登录使用本平台</p> <p class="tips">依据国家政策法规需绑定手机号进行网络实名才可登录使用本平台</p>
<el-form ref="form" label-width="60px"> <el-form ref="form" label-width="60px">
<el-form-item label="手机号"> <el-form-item label="手机号">
<el-input style="width: 394px;" placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input> <el-input style="width: 394px;" placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>

@ -111,7 +111,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="updateTime" label="更新时间" width="170" align="center"></el-table-column> <el-table-column prop="updateTime" label="更新时间" width="170" align="center"></el-table-column>
<el-table-column label="操作" width="200"> <el-table-column label="操作" width="200" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="preview(scope.row)" v-auth>预览</el-button> <el-button type="text" @click="preview(scope.row)" v-auth>预览</el-button>
<el-button type="text" @click="download(scope.row)" v-auth>下载</el-button> <el-button type="text" @click="download(scope.row)" v-auth>下载</el-button>
@ -280,16 +280,19 @@ export default {
let introduce = ''// children let introduce = ''// children
let dataSource = '' // let dataSource = '' //
let action let action
let isFirst = true //
// //
function actionId(arr) {//res function actionId(arr) {//res
arr && arr.map((e, i) => { arr && arr.map((e, i) => {
e.id = String(e.id) e.id = String(e.id)
if (!i) { if (!i && isFirst) {
// //
if (e.introduce) introduce = e.introduce if (e.introduce) introduce = e.introduce
if (e.dataSource) dataSource = e.dataSource if (e.dataSource) dataSource = e.dataSource
if (!action) action = e.children[0].children.length ? String(e.children[0].children[0].id) : String(e.children[0].id) if (!action) action = e.children[0].children.length ? String(e.children[0].children[0].id) : String(e.children[0].id)
} }
//
if (i) isFirst = false
if (typeId && e.id == typeId) {// id if (typeId && e.id == typeId) {// id
action = String(e.id) action = String(e.id)
if (e.children.length) {// if (e.children.length) {//
@ -299,7 +302,7 @@ export default {
action = String(e.children[0].children[0].id) action = String(e.children[0].children[0].id)
} }
} }
} else if (e.children.length) {// id } else if (e.children.length) { // id
actionId(e.children) actionId(e.children)
} }
}) })
@ -352,19 +355,21 @@ export default {
getDeepest(data[0].children) getDeepest(data[0].children)
} else { } else {
select = data[0].id select = data[0].id
if (data[0].introduce) introduce = data[0].introduce
if (data[0].dataSource) dataSource = data[0].dataSource
} }
} }
function handleData(data) { function handleData(data) {
data.map((n, i) => { data.map((n, i) => {
// //
if (n.id == index) { if (n.id == index) {
if (n.introduce) introduce = n.introduce
if (n.dataSource) dataSource = n.dataSource
// idid // idid
if (n.children.length) { if (n.children.length) {
getDeepest(n.children) getDeepest(n.children)
} else { } else {
select = index select = index
if (n.introduce) introduce = n.introduce
if (n.dataSource) dataSource = n.dataSource
} }
} else { } else {
handleData(n.children) handleData(n.children)
@ -577,6 +582,9 @@ export default {
&.is-active{ &.is-active{
color: #fff; color: #fff;
background-color: #0070FF; background-color: #0070FF;
span {
color: #fff;
}
} }
} }
.level-6 { .level-6 {

@ -13,7 +13,15 @@
</div> </div>
</div> </div>
<p class="surplus" v-if="item.deadline"><span class="name">剩余期限</span><span class="num">{{item.deadline}}</span> </p> <p class="surplus" v-if="item.deadline"><span class="name">剩余期限</span><span class="num">{{item.deadline}}</span> </p>
<p class="surplus"><span class="name">账号数量</span><span class="num">{{item.accountNum}}</span> </p> <p class="surplus">
<span class="name">账号数量</span>
<template v-if="item.accountNum > 1000">
<span></span>
</template>
<template v-else>
<span class="num">{{item.accountNum}}</span>
</template>
</p>
<el-button class="renew" size="small" type="primary" v-if="!item.deadline">续费</el-button> <el-button class="renew" size="small" type="primary" v-if="!item.deadline">续费</el-button>
</div> </div>
</div> </div>
@ -234,36 +242,86 @@ export default {
// 使 // 使
initChart(list){ initChart(list){
const seriesList = [] const seriesList = []
const data = ['下载量', '点击量', '登录量'] // series
for (let i in list) { for (let i in list) {
const series = [] const series = []
for (let n in list[i]) { for (let n in list[i]) {
const datas = list[i][n]
const item = []
datas.map((e, j) => {
item.push([`${j + 1}`, e])
})
const temp = { const temp = {
name: n,
type: 'line', type: 'line',
stack: 'Total', smooth: true,
data: list[i][n] stack: 'a',
symbol: 'circle',
symbolSize: 5,
sampling: 'average',
data: item
}
//
if (n === '下载量') {
temp.name = '下载量'
temp.itemStyle = {
color: '#55D3DE'
}
temp.areaStyle = {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgba(109,219,229,0.3)'
},
{
offset: 1,
color: 'rgba(37,237,225,0.6)'
}
])
}
} else if (n === '点击量') {
temp.name = '点击量'
temp.itemStyle = {
color: '#7ED321'
}
temp.areaStyle = {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgba(255, 255, 255, 0.18)'
},
{
offset: 1,
color: 'rgba(210, 247, 215, 0.6)'
}
])
}
} else if (n === '登录量') {
temp.name = '登录量'
temp.itemStyle = {
color: '#57A0FF'
}
temp.areaStyle = {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#E8F0FF'
},
{
offset: 1,
color: 'rgba(255, 255, 255, 0.5)'
}
])
}
} }
series.push(temp) series.push(temp)
} }
seriesList.push(series) seriesList.push(series)
} }
//
seriesList.map((e, i) => { seriesList.map((e, i) => {
echarts.init(document.querySelector(`#chart${i + 1}`)).setOption({ echarts.init(document.querySelector(`#chart${i + 1}`)).setOption({
title: {
text: ''
},
tooltip: { tooltip: {
trigger: 'axis' trigger: 'item'
},
// legend: {
// data
// },
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
}, },
xAxis: { xAxis: {
show: false show: false
@ -271,6 +329,12 @@ export default {
yAxis: { yAxis: {
show: false show: false
}, },
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
series: e series: e
}) })
}) })

@ -100,7 +100,7 @@
<el-input disabled v-model="form.uniqueIdentification" placeholder="唯一标识"></el-input> <el-input disabled v-model="form.uniqueIdentification" placeholder="唯一标识"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="email" label="邮箱"> <el-form-item prop="email" label="邮箱">
<el-input v-model="form.email" placeholder="请输入邮箱"></el-input> <el-input v-model="form.email" placeholder="请输入邮箱" @change="emailChange"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="workNumber" label="工号/学号"> <el-form-item prop="workNumber" label="工号/学号">
<el-input v-model="form.workNumber" placeholder="请输入工号/学号" @change="workNumberChange"></el-input> <el-input v-model="form.workNumber" placeholder="请输入工号/学号" @change="workNumberChange"></el-input>
@ -244,9 +244,11 @@ export default {
accountRepeat: false, accountRepeat: false,
workNumberRepeat: false, workNumberRepeat: false,
phoneRepeat: false, phoneRepeat: false,
emailRepeat: false,
originalAccount: '', originalAccount: '',
originalWorkNumber: '', originalWorkNumber: '',
originalPhone: '' originalPhone: '',
originalEmail: ''
}; };
}, },
computed: { computed: {
@ -369,6 +371,17 @@ export default {
this.phoneRepeat = false this.phoneRepeat = false
} }
}, },
emailChange(){
if(this.form.email !== this.originalEmail){
this.$post(`${this.api.checkEmailOrPhone}?email=${this.form.email}${this.form.accountId ? '&accountId=' + this.form.accountId : ''}`).then(res => {
this.emailRepeat = false
}).catch(res => {
this.emailRepeat = true
})
}else{
this.emailRepeat = false
}
},
closeUser(){ closeUser(){
this.$refs.form.resetFields() this.$refs.form.resetFields()
this.form.userId = '' this.form.userId = ''
@ -400,9 +413,11 @@ export default {
uniqueIdentification: data.uniqueIdentification, uniqueIdentification: data.uniqueIdentification,
password: '' password: ''
} }
//
this.originalAccount = data.account this.originalAccount = data.account
this.originalWorkNumber = data.workNumber this.originalWorkNumber = data.workNumber
this.originalPhone = data.phone this.originalPhone = data.phone
this.originalEmail = data.email
}).catch(res => {}) }).catch(res => {})
}, },
edit(row){ edit(row){
@ -419,6 +434,7 @@ export default {
if(this.accountRepeat) return util.errorMsg('该账号已存在!') if(this.accountRepeat) return util.errorMsg('该账号已存在!')
if(this.workNumberRepeat) return util.errorMsg('该学号/工号已存在!') if(this.workNumberRepeat) return util.errorMsg('该学号/工号已存在!')
if(this.phoneRepeat) return util.errorMsg('该手机号已存在!') if(this.phoneRepeat) return util.errorMsg('该手机号已存在!')
if(this.emailRepeat) return util.errorMsg('该邮箱已存在!')
let data = this.form let data = this.form
// ,schoolId // ,schoolId
data.schoolId = data.schoolId ? data.schoolId : this.schoolId data.schoolId = data.schoolId ? data.schoolId : this.schoolId

Loading…
Cancel
Save