From dfa2603ef9d3c4447d1beb87844bd0de8b3726d4 Mon Sep 17 00:00:00 2001
From: Jo <479214531@qq.com>
Date: Thu, 18 Nov 2021 02:33:13 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E7=AD=89bug=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/layouts/header/index.vue | 8 +--
src/layouts/navbar/index.vue | 2 +
src/pages/account/login/index.vue | 2 +-
src/pages/data/list/index.vue | 18 ++++--
src/pages/stat/list/index.vue | 100 ++++++++++++++++++++++++------
src/pages/user/list/index.vue | 20 +++++-
6 files changed, 120 insertions(+), 30 deletions(-)
diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue
index 8ce62be..b4f8c10 100644
--- a/src/layouts/header/index.vue
+++ b/src/layouts/header/index.vue
@@ -5,7 +5,7 @@
-
+
@@ -119,9 +119,6 @@ export default {
userName && this.setInfo({
userName
})
- } else {
- // 如果权限里没有后台的3个菜单,则隐藏进入后台的图标。/data/list是前台数据列表,仅在前台展示
- if (this.routes.length && !this.routes.find(e => e.name !== '/data/list')) this.showSetting = false
}
// 如果登录了,并且非客户,才调用用户信息的接口。客户是没有用户信息的,但是能进入后台(如果有权限菜单)
setTimeout(() => {
@@ -145,6 +142,9 @@ export default {
})
}).catch(err => { })
},
+ hideSetting() {
+ this.showSetting = false
+ },
toIndex() {
this.$route.path === '/index/list'
? location.reload()
diff --git a/src/layouts/navbar/index.vue b/src/layouts/navbar/index.vue
index 3999366..c435e1e 100644
--- a/src/layouts/navbar/index.vue
+++ b/src/layouts/navbar/index.vue
@@ -106,6 +106,8 @@ export default {
getPer() {
this.$get(`${this.api.getPermissions}?platformId=${Setting.platformId}`).then(res => {
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)
this.initMenu()
}).catch(err => {
diff --git a/src/pages/account/login/index.vue b/src/pages/account/login/index.vue
index 4917d9d..3c1371b 100644
--- a/src/pages/account/login/index.vue
+++ b/src/pages/account/login/index.vue
@@ -34,7 +34,7 @@
- 依据国家政策法规,需绑定手机号进行实网络实名才可登录使用本平台
+ 依据国家政策法规,需绑定手机号进行网络实名才可登录使用本平台
diff --git a/src/pages/data/list/index.vue b/src/pages/data/list/index.vue
index 8d1d440..2471a88 100644
--- a/src/pages/data/list/index.vue
+++ b/src/pages/data/list/index.vue
@@ -111,7 +111,7 @@
-
+
预览
下载
@@ -280,16 +280,19 @@ export default {
let introduce = ''// 对应股票的介绍,规则为无children则取上级
let dataSource = '' // 数据来源,同上
let action
+ let isFirst = true // 判断是否是第一条数据
// 取得选中的那一栏
function actionId(arr) {//传入res
arr && arr.map((e, i) => {
e.id = String(e.id)
- if (!i) {
+ if (!i && isFirst) {
// 获取介绍和来源
if (e.introduce) introduce = e.introduce
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 (i) isFirst = false
if (typeId && e.id == typeId) {// 若id匹配
action = String(e.id)
if (e.children.length) {// 若有下级
@@ -299,7 +302,7 @@ export default {
action = String(e.children[0].children[0].id)
}
}
- } else if (e.children.length) {// id不匹配,递归找
+ } else if (e.children.length) { // id不匹配,递归找
actionId(e.children)
}
})
@@ -352,19 +355,21 @@ export default {
getDeepest(data[0].children)
} else {
select = data[0].id
+ if (data[0].introduce) introduce = data[0].introduce
+ if (data[0].dataSource) dataSource = data[0].dataSource
}
}
function handleData(data) {
data.map((n, i) => {
// 匹配到点击的分类,默认展开子级第一个分类
if (n.id == index) {
- if (n.introduce) introduce = n.introduce
- if (n.dataSource) dataSource = n.dataSource
// 如果有子级,则递归取到最下面的第一级子级id,如果没有子级,则取当前id
if (n.children.length) {
getDeepest(n.children)
} else {
select = index
+ if (n.introduce) introduce = n.introduce
+ if (n.dataSource) dataSource = n.dataSource
}
} else {
handleData(n.children)
@@ -577,6 +582,9 @@ export default {
&.is-active{
color: #fff;
background-color: #0070FF;
+ span {
+ color: #fff;
+ }
}
}
.level-6 {
diff --git a/src/pages/stat/list/index.vue b/src/pages/stat/list/index.vue
index 47d62f3..99a2dfa 100644
--- a/src/pages/stat/list/index.vue
+++ b/src/pages/stat/list/index.vue
@@ -13,7 +13,15 @@
剩余期限:{{item.deadline}} 天
- 账号数量:{{item.accountNum}} 个
+
+ 账号数量:
+
+ ♾
+
+
+ {{item.accountNum}} 个
+
+
续费
@@ -234,36 +242,86 @@ export default {
// 按月份统计数据库使用概况图表
initChart(list){
const seriesList = []
- const data = ['下载量', '点击量', '登录量']
+ // 生成series
for (let i in list) {
const series = []
for (let n in list[i]) {
+ const datas = list[i][n]
+ const item = []
+ datas.map((e, j) => {
+ item.push([`${j + 1}`, e])
+ })
const temp = {
- name: n,
type: 'line',
- stack: 'Total',
- data: list[i][n]
+ smooth: true,
+ 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)
}
seriesList.push(series)
}
+ // 年份循环
seriesList.map((e, i) => {
echarts.init(document.querySelector(`#chart${i + 1}`)).setOption({
- title: {
- text: ''
- },
tooltip: {
- trigger: 'axis'
- },
- // legend: {
- // data
- // },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
+ trigger: 'item'
},
xAxis: {
show: false
@@ -271,6 +329,12 @@ export default {
yAxis: {
show: false
},
+ grid: {
+ left: '3%',
+ right: '4%',
+ bottom: '3%',
+ containLabel: true
+ },
series: e
})
})
diff --git a/src/pages/user/list/index.vue b/src/pages/user/list/index.vue
index 0bfd0a9..8e7937c 100644
--- a/src/pages/user/list/index.vue
+++ b/src/pages/user/list/index.vue
@@ -100,7 +100,7 @@
-
+
@@ -244,9 +244,11 @@ export default {
accountRepeat: false,
workNumberRepeat: false,
phoneRepeat: false,
+ emailRepeat: false,
originalAccount: '',
originalWorkNumber: '',
- originalPhone: ''
+ originalPhone: '',
+ originalEmail: ''
};
},
computed: {
@@ -369,6 +371,17 @@ export default {
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(){
this.$refs.form.resetFields()
this.form.userId = ''
@@ -400,9 +413,11 @@ export default {
uniqueIdentification: data.uniqueIdentification,
password: ''
}
+ // 先保存该用户的账号工号等信息,判重的时候如果判断到修改的字段跟这里保存的值一样,则不调判重的接口
this.originalAccount = data.account
this.originalWorkNumber = data.workNumber
this.originalPhone = data.phone
+ this.originalEmail = data.email
}).catch(res => {})
},
edit(row){
@@ -419,6 +434,7 @@ export default {
if(this.accountRepeat) return util.errorMsg('该账号已存在!')
if(this.workNumberRepeat) return util.errorMsg('该学号/工号已存在!')
if(this.phoneRepeat) return util.errorMsg('该手机号已存在!')
+ if(this.emailRepeat) return util.errorMsg('该邮箱已存在!')
let data = this.form
// 如果是新增,则取当前用户的schoolId
data.schoolId = data.schoolId ? data.schoolId : this.schoolId