Commit 258e9dc3 by yangqingjie

update

parents 76774393 866742ef
...@@ -116,7 +116,7 @@ export default { ...@@ -116,7 +116,7 @@ export default {
show: false show: false
}, },
grid: { grid: {
left: -10, left: 0,
right: 35, right: 35,
bottom: 0, bottom: 0,
top: 0, top: 0,
......
...@@ -8,16 +8,16 @@ ...@@ -8,16 +8,16 @@
</div> </div>
<div class="details"> <div class="details">
<p class="percent"> <p class="percent">
<span>{{genderPercent.male}}</span> <span>{{genderPercent.malePer}}</span>
<span>{{genderPercent.female}}</span> <span>{{genderPercent.femalePer}}</span>
</p> </p>
<div class="line"> <div class="line">
<span class="male" :style={width:genderPercent.male}></span> <span class="male" :style={width:genderPercent.malePer}></span>
<span class="female" :style={width:genderPercent.female}></span> <span class="female" :style={width:genderPercent.femalePer}></span>
</div> </div>
<p class="num"> <p class="num">
<span>{{gender.male | dealWithNumber}}</span> <span>{{genderPercent.male | dealWithNumber}}</span>
<span>{{gender.female | dealWithNumber}}</span> <span>{{genderPercent.female | dealWithNumber}}</span>
</p> </p>
</div> </div>
<div class="female"> <div class="female">
...@@ -48,14 +48,14 @@ ...@@ -48,14 +48,14 @@
</div> </div>
<ul> <ul>
<li v-for="(item, index) in distribution[distShowKey]" :key="index"> <li v-for="(item, index) in distribution[distShowKey]" :key="index">
<p>{{item.name}}</p> <p>{{item.key}}</p>
<count-to :endVal="item.value"/> <count-to :endVal="item.value"/>
</li> </li>
</ul> </ul>
</div> </div>
<!-- 行业分布 --> <!-- 行业分布 -->
<div class="industry"> <div class="industry">
<div class="partTitle margin20-10">年龄结构</div> <div class="partTitle margin20-10">行业分布</div>
<bar-chart :option="industryConfig.option" :layout="industryConfig.layout" /> <bar-chart :option="industryConfig.option" :layout="industryConfig.layout" />
</div> </div>
<!-- 参与度|活跃度 --> <!-- 参与度|活跃度 -->
...@@ -78,9 +78,9 @@ ...@@ -78,9 +78,9 @@
<div class="studentDemeanor" v-if="greatKey === 0"> <div class="studentDemeanor" v-if="greatKey === 0">
<swiper :options="swiperOption"> <swiper :options="swiperOption">
<swiper-slide v-for="(item, index) in studentDemeanor" :key="index"> <swiper-slide v-for="(item, index) in studentDemeanor" :key="index">
<img :src="item.pic" alt="照片" @click="openStudent(index)"> <img :src="item.iconUrl" alt="照片" @click="openStudent(index)">
<p>{{item.name}}</p> <p>{{item.name}}</p>
<p>{{item.position}}</p> <p>{{item.desc}}</p>
</swiper-slide> </swiper-slide>
</swiper> </swiper>
</div> </div>
...@@ -93,10 +93,7 @@ ...@@ -93,10 +93,7 @@
> >
<ul> <ul>
<li v-for="(item, index) in starClass" :key="index"> <li v-for="(item, index) in starClass" :key="index">
<span>{{item.name}}</span> <span v-for="(con, i) in item" :key="i + 'key'">{{con}}</span>
<span>{{item.content1}}</span>
<span>{{item.content2}}</span>
<span>{{item.content3}}</span>
</li> </li>
</ul> </ul>
</vue-seamless-scroll> </vue-seamless-scroll>
...@@ -142,233 +139,40 @@ export default { ...@@ -142,233 +139,40 @@ export default {
data () { data () {
return { return {
// 男女学员数量 // 男女学员比例
gender: { genderPercent: {
male: 92768, male: 0,
female: 41768 female: 0,
malePer: '0%',
femalePer: '0%'
}, },
genderPercent: {},
// 年龄数据
age: [
{
name: '60’s',
value: 32
}, {
name: '70’s',
value: 106
}, {
name: '80’s',
value: 184
}, {
name: '90’s',
value: 131
}
],
// 平均年龄 // 平均年龄
ageAverage: 45.7, ageAverage: 0,
// 年龄结构配置 // 年龄结构配置
ageConfig: {}, ageConfig: {},
// 学历数据
edu: [
{value: 735, name: '大专'},
{value: 580, name: '本科'},
{value: 484, name: '硕士'},
{value: 300, name: '博士以上'}
],
// 学历情况配置 // 学历情况配置
eduConfig: {}, eduConfig: {},
// 分布 // 分布
distribution: { distribution: {
// 党派 // 党派
party: [ party: [],
{
name: '民革',
value: 4293
}, {
name: '民盟',
value: 4293
}, {
name: '民健',
value: 4293
}, {
name: '民进',
value: 4293
}, {
name: '无党派',
value: 4293
}
],
// 民族 // 民族
ethnic: [ ethnic: []
{
name: '汉族',
value: 3924
}, {
name: '藏族',
value: 3924
}, {
name: '维吾尔族',
value: 3924
}, {
name: '白族',
value: 3924
}, {
name: '苗族',
value: 3924
}
]
}, },
// 分布当前展示数据标识 // 分布当前展示数据标识
distShowKey: 'party', distShowKey: 'party',
// 行业分布 // 行业分布
industry: [
{
name: '家电行业',
value: 4172
}, {
name: '电子信息',
value: 892
}, {
name: '机械制造',
value: 8321
}, {
name: '纺织生产',
value: 1892
}, {
name: '生物医药',
value: 1892
}
],
industryConfig: { industryConfig: {
layout: { layout: {
height: '143px' height: '143px'
} }
}, },
// 参与度活跃度 // 参与度活跃度
degree: { degree: {},
// 参与度
participate: [
{
name: '课程',
value: [
{
name: '0-20%',
value: 100
}, {
name: '21-40%',
value: 180
}, {
name: '41-60%',
value: 310
}, {
name: '61-80%',
value: 380
}, {
name: '81-100%',
value: 489
}
]
}, {
name: '活动',
value: [
{
name: '0-20%',
value: 30
}, {
name: '21-40%',
value: 110
}, {
name: '41-60%',
value: 220
}, {
name: '61-80%',
value: 310
}, {
name: '81-100%',
value: 320
}
]
}
],
// 活跃度
active: [
{
name: '课程',
value: [
{
name: '0-20%',
value: 100
}, {
name: '21-40%',
value: 29
}, {
name: '41-60%',
value: 300
}, {
name: '61-80%',
value: 200
}, {
name: '81-100%',
value: 300
}
]
}, {
name: '活动',
value: [
{
name: '0-20%',
value: 30
}, {
name: '21-40%',
value: 80
}, {
name: '41-60%',
value: 20
}, {
name: '61-80%',
value: 400
}, {
name: '81-100%',
value: 500
}
]
}
]
},
degreeKey: '', degreeKey: '',
degreeConfig: {}, degreeConfig: {},
// 学员风采 // 学员风采
studentDemeanor: [ studentDemeanor: [],
{
pic: require('../../../static/images/index/persion.png'),
name: '白岩松1',
position: '主持人/作家'
}, {
pic: require('../../../static/images/index/persion.png'),
name: '白岩松2',
position: '主持人/作家'
}, {
pic: require('../../../static/images/index/persion.png'),
name: '白岩松3',
position: '主持人/作家'
}, {
pic: require('../../../static/images/index/persion.png'),
name: '白岩松4',
position: '主持人/作家'
}, {
pic: require('../../../static/images/index/persion.png'),
name: '白岩松5',
position: '主持人/作家'
}, {
pic: require('../../../static/images/index/persion.png'),
name: '白岩松6',
position: '主持人/作家'
}, {
pic: require('../../../static/images/index/persion.png'),
name: '白岩松7',
position: '主持人/作家'
}
],
swiperOption: { swiperOption: {
loop: false, loop: false,
autoplay: false, autoplay: false,
...@@ -376,34 +180,7 @@ export default { ...@@ -376,34 +180,7 @@ export default {
slidesPerView: 4.5 slidesPerView: 4.5
}, },
// 明星班级 // 明星班级
starClass: [ starClass: [],
{
name: '2021年秋季班(21人)',
content1: '5人博士后',
content2: '6人博士',
content3: '5人企业家'
}, {
name: '2021年秋季班(22人)',
content1: '5人博士后',
content2: '6人博士',
content3: '5人企业家'
}, {
name: '2021年秋季班(23人)',
content1: '5人博士后',
content2: '6人博士',
content3: '5人企业家'
}, {
name: '2021年秋季班(24人)',
content1: '5人博士后',
content2: '6人博士',
content3: '5人企业家'
}, {
name: '2021年秋季班(25人)',
content1: '5人博士后',
content2: '6人博士',
content3: '5人企业家'
}
],
classOption: { classOption: {
step: 0.35, step: 0.35,
singleHeight: 50 singleHeight: 50
...@@ -418,56 +195,86 @@ export default { ...@@ -418,56 +195,86 @@ export default {
methods: { methods: {
init () { init () {
this.dealGender() const {
this.getAge() gender,
this.getEdu() age,
this.getIndustry() edu,
this.changeDegree('participate') party,
ethnic,
industry,
participate,
active,
studentDemeanor,
starClass
} = this.leftData
this.dealGender(gender)
this.getAge(age)
this.getEdu(edu)
this.getDist(party, ethnic)
this.getIndustry(industry)
this.getDegree(participate, active)
this.getStudent(studentDemeanor)
this.getClass(starClass)
}, },
// 求性别百分比 // 求性别百分比
dealGender () { dealGender (data) {
const arr = Object.values(this.gender) // total为1防止NAN
const total = arr.reduce((pre, next) => pre + next) const total = data.total || 1
const maleItem = data.list && data.list.find(item => item.key === '男')
const male = maleItem.value || 0
const femaleItem = data.list && data.list.find(item => item.key === '女')
const female = femaleItem.value || 0
this.genderPercent = { this.genderPercent = {
male: (this.gender.male * 100 / total).toFixed(1) + '%', male,
female: (this.gender.female * 100 / total).toFixed(1) + '%' female,
malePer: (male * 100 / total).toFixed(1) + '%',
femalePer: (female * 100 / total).toFixed(1) + '%'
} }
}, },
// 年龄结构 // 年龄结构
getAge () { getAge (data) {
this.ageAverage = data.subTitleValue || 0
const age = data.list || []
this.ageConfig = { this.ageConfig = {
option: { option: {
seriesData: [ seriesData: [
{ {
data: this.age.map(item => item.value).reverse() data: age.map(item => item.value).reverse()
} }
], ],
base: { base: {
yAxis: [{ yAxis: [{
data: this.age.map(item => item.name).reverse() data: age.map(item => item.key).reverse()
}] }]
} }
} }
} }
}, },
// 学历情况 // 学历情况
getEdu () { getEdu (data) {
const edu = this.formatArr(data.list || [])
this.eduConfig = { this.eduConfig = {
option: { option: {
seriesData: [ seriesData: [
{ {
data: this.edu data: edu
} }
] ]
} }
} }
}, },
// 党派/民族分布 // 党派/民族分布
getDist (data1, data2) {
this.distribution.party = data1.list || []
this.distribution.ethnic = data2.list || []
},
// 切换党派/民族
changeDist (type) { changeDist (type) {
this.distShowKey = type this.distShowKey = type
}, },
// 行业分布 // 行业分布
getIndustry () { getIndustry (data) {
const industry = data.list || []
this.industryConfig.option = { this.industryConfig.option = {
seriesData: [ seriesData: [
{ {
...@@ -477,7 +284,7 @@ export default { ...@@ -477,7 +284,7 @@ export default {
return utils.dealWithNumber(item.value) return utils.dealWithNumber(item.value)
} }
}, },
data: this.industry.map(item => item.value).reverse() data: industry.map(item => item.value).reverse()
} }
], ],
base: { base: {
...@@ -492,11 +299,37 @@ export default { ...@@ -492,11 +299,37 @@ export default {
padding: [0, 10, 0, 0], padding: [0, 10, 0, 0],
fontFamily: 'Microsoft YaHei' fontFamily: 'Microsoft YaHei'
}, },
data: this.industry.map(item => item.name).reverse() data: industry.map(item => item.key).reverse()
}] }]
} }
} }
}, },
// 获取参与度与活跃度数据
getDegree (data1, data2) {
// 参与度
const oldParticipate = data1.list || []
const participate = []
oldParticipate.forEach(item => {
participate.push({
name: item.title,
value: this.formatArr(item.list || [])
})
})
// 活跃度
const oldActive = data2.list || []
const active = []
oldActive.forEach(item => {
active.push({
name: item.title,
value: this.formatArr(item.list || [])
})
})
this.degree = {
participate,
active
}
this.changeDegree('participate')
},
// 切换参与度与活跃度 // 切换参与度与活跃度
changeDegree (type) { changeDegree (type) {
this.degreeKey = type this.degreeKey = type
...@@ -542,8 +375,29 @@ export default { ...@@ -542,8 +375,29 @@ export default {
} }
}, },
// 学员风采 // 学员风采
getStudent (data) {
this.studentDemeanor = data.list || []
},
// 明星班级
getClass (data) {
this.starClass = data.valueList || []
},
// 打开学员风采弹框
openStudent (index) { openStudent (index) {
console.log(index) console.log(index)
},
// 把数组中的key转成name
formatArr (arr) {
const newArr = []
if (this.utils.isArray(arr) && arr.length) {
arr.forEach(item => {
newArr.push({
name: item.key,
value: item.value
})
})
}
return newArr
} }
} }
} }
...@@ -586,7 +440,7 @@ export default { ...@@ -586,7 +440,7 @@ export default {
span { span {
width: 0%; width: 0%;
height: 8px; height: 8px;
transition: width linear 300ms; transition: width linear 1000ms;
&.male { &.male {
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-bottom-left-radius: 4px; border-bottom-left-radius: 4px;
...@@ -718,6 +572,7 @@ export default { ...@@ -718,6 +572,7 @@ export default {
.img { .img {
width: 88px; width: 88px;
height: 88px; height: 88px;
border-radius: 50%;
} }
p { p {
font-size: 14px; font-size: 14px;
...@@ -747,7 +602,10 @@ export default { ...@@ -747,7 +602,10 @@ export default {
font-weight: 400; font-weight: 400;
color: #6DCDFF; color: #6DCDFF;
line-height: 34px; line-height: 34px;
padding: 8px 0px 8px 40px; font-size: 16px;
padding: 8px 10px 8px 40px;
display: flex;
justify-content: space-between;
} }
} }
} }
......
...@@ -18,9 +18,10 @@ ...@@ -18,9 +18,10 @@
<div class="seemore">查看更多</div> <div class="seemore">查看更多</div>
</div> </div>
<p class="percent"> <p class="percent">
<span>课程数<count-to :endVal="120" /></span> <span v-for="(item, l) in coursedata" :key="l">
<span>学习总时长<count-to :endVal="1248" /></span> {{item.name}}
<span>出勤率<count-to :endVal="88" suffix="%"/></span> <count-to :endVal="item.value" :suffix="item.unit"/>
</span>
</p> </p>
<div class="line"> <div class="line">
<bar-chart :layout="lineConfig.layout" :option="lineConfig.option" /> <bar-chart :layout="lineConfig.layout" :option="lineConfig.option" />
...@@ -168,6 +169,14 @@ export default { ...@@ -168,6 +169,14 @@ export default {
CountRoll CountRoll
// PopupFrame // PopupFrame
}, },
props: {
rightData: {
type: Object,
default () {
return {}
}
}
},
data () { data () {
return { return {
activeShow: false, activeShow: false,
...@@ -194,6 +203,21 @@ export default { ...@@ -194,6 +203,21 @@ export default {
} }
], ],
// 教学课程 // 教学课程
coursedata: [
{
name: '课程数',
value: 120
},
{
name: '学习总时长',
value: 1248
},
{
name: '出勤率',
value: 88,
unit: '%'
}
],
lineConfig: {}, lineConfig: {},
line: [ line: [
{ {
...@@ -286,109 +310,98 @@ export default { ...@@ -286,109 +310,98 @@ export default {
this.getActive(this.activeList) this.getActive(this.activeList)
}, },
methods: { methods: {
// 学习内容 // 师资力量
getlearn () { getstaff () {
const xData = this.learn.map(v => v.name) this.staffConfig = {
const Data = this.learn.map(v => v.value)
this.learnConfig = {
layout: {
width: '100%',
height: '136px'
},
option: { option: {
seriesData: [
{
data: this.staff.map(item => item.value).reverse()
}
],
base: { base: {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'line' // 默认为直线,可选为:'line' | 'shadow'
},
textStyle: {
color: '#ffffff'
},
backgroundColor: 'rgba(55, 128, 246, 0.2)',
borderColor: 'rgba(55, 128, 246, 0.2)'
},
grid: {
left: 0,
right: 0,
bottom: 0,
top: 10,
containLabel: true
},
xAxis: {
type: 'category',
axisTick: {
show: false
},
axisLine: {
show: false,
lineStyle: {
color: 'rgba(17, 63, 116, 1)'
}
},
splitLine: {
show: false
},
axisLabel: {
show: true,
fontSize: 14,
color: '#469CCC'
},
data: xData
},
yAxis: [{ yAxis: [{
type: 'value', data: this.staff.map(item => item.name).reverse()
max: 'dataMax',
axisLine: {
show: true,
lineStyle: {
color: 'rgba(17, 63, 116, 1)'
}
},
splitLine: {
show: true,
lineStyle: {
color: 'rgba(17, 63, 116, 1)'
}
},
axisTick: {
show: false
},
axisLabel: {
formatter: '{value}%',
textStyle: {
fontSize: 14,
fontFamily: 'Century Gothic',
fontWeight: 400,
color: '#469CCC'
}
},
boundaryGap: ['20%', '20%']
}] }]
}
}
}
},
getEdu () {
this.eduConfig = {
option: {
base: {
color: [],
legend: {
show: false
}
}, },
seriesData: [ seriesData: [
{ {
type: 'bar', type: 'pie',
barWidth: 6, name: '师资力量',
itemStyle: { itemStyle: {
color: new this.echarts.graphic.LinearGradient(0, 0, 0, 1, [ normal: {
{ label: {
offset: 1, show: false
color: '#24E8FF'
}, },
{ labelLine: {
offset: 0, show: false
color: '#00BEFf' },
} shadowBlur: 0,
]), shadowColor: '#3EB8F7'
shadowOffsetY: 0, }
shadowOffsetX: 0,
barBorderRadius: [3, 3, 0, 0]
},
label: {
show: false
}, },
data: Data clockWise: false,
hoverAnimation: false,
center: ['38%', '50%'],
radius: ['65%', '78%'],
data: [
{
value: this.edu[0].value,
label: {
normal: {
rich: {
a: {
color: '#fff',
align: 'center',
fontSize: 30,
fontWeight: '400'
},
b: {
color: '#fff',
align: 'center',
fontWeight: '400',
fontSize: 18
}
},
formatter: function (params) {
return '{a|' + params.value + '}\n{b|教师数}'
},
position: 'center',
show: true
}
},
itemStyle: {
normal: {
color: '#3EB8F7',
shadowColor: '#2c6cc4',
shadowBlur: 0
}
}
}, {
value: this.edu[0].value / 2 + 20,
name: 'invisible',
itemStyle: {
normal: {
color: 'rgba(0, 12, 27)'
},
emphasis: {
color: '#fff'
}
}
}
]
} }
] ]
} }
...@@ -494,96 +507,112 @@ export default { ...@@ -494,96 +507,112 @@ export default {
} }
} }
}, },
getEdu () { // 学习内容
this.eduConfig = { getlearn () {
const xData = this.learn.map(v => v.name)
const Data = this.learn.map(v => v.value)
this.learnConfig = {
layout: {
width: '100%',
height: '136px'
},
option: { option: {
base: { base: {
legend: { tooltip: {
show: false trigger: 'axis',
} axisPointer: {
type: 'line'
},
textStyle: {
color: '#ffffff'
},
backgroundColor: 'rgba(55, 128, 246, 0.2)',
borderColor: 'rgba(55, 128, 246, 0.2)'
},
grid: {
left: 0,
right: 0,
bottom: 0,
top: 10,
containLabel: true
},
xAxis: {
type: 'category',
axisTick: {
show: false
},
axisLine: {
show: false,
lineStyle: {
color: 'rgba(17, 63, 116, 1)'
}
},
splitLine: {
show: false
},
axisLabel: {
show: true,
fontSize: 14,
color: '#469CCC'
},
data: xData
},
yAxis: [{
type: 'value',
max: 'dataMax',
axisLine: {
show: true,
lineStyle: {
color: 'rgba(17, 63, 116, 1)'
}
},
splitLine: {
show: true,
lineStyle: {
color: 'rgba(17, 63, 116, 1)'
}
},
axisTick: {
show: false
},
axisLabel: {
formatter: '{value}%',
textStyle: {
fontSize: 14,
fontFamily: 'Century Gothic',
fontWeight: 400,
color: '#469CCC'
}
},
boundaryGap: ['20%', '20%']
}]
}, },
seriesData: [ seriesData: [
{ {
type: 'pie', type: 'bar',
name: '师资力量', barWidth: 6,
itemStyle: { itemStyle: {
normal: { color: new this.echarts.graphic.LinearGradient(0, 0, 0, 1, [
shadowBlur: 0, {
shadowColor: '#3EB8F7' offset: 1,
} color: '#24E8FF'
},
clockWise: false,
hoverAnimation: false,
center: ['38%', '50%'],
radius: ['65%', '78%'],
data: [
{
value: this.edu[0].value,
label: {
normal: {
rich: {
a: {
color: '#fff',
align: 'center',
fontSize: 30,
fontWeight: '400'
},
b: {
color: '#fff',
align: 'center',
fontWeight: '400',
fontSize: 18
}
},
formatter: function (params) {
return '{a|' + params.value + '}\n\n{b|教师数}'
},
position: 'center',
show: true
}
}, },
itemStyle: { {
normal: { offset: 0,
color: '#3EB8F7', color: '#00BEFf'
shadowColor: '#2c6cc4',
shadowBlur: 0
}
}
}, {
value: this.edu[0].value / 2 + 20,
name: 'invisible',
itemStyle: {
normal: {
color: 'rgba(0, 12, 27)'
},
emphasis: {
color: '#fff'
}
} }
} ]),
] barBorderRadius: [3, 3, 0, 0]
},
label: {
show: false
},
data: Data
} }
] ]
} }
} }
}, },
// 师资力量
getstaff () {
this.staffConfig = {
option: {
seriesData: [
{
data: this.staff.map(item => item.value).reverse()
}
],
base: {
yAxis: [{
data: this.staff.map(item => item.name).reverse()
}]
}
}
}
},
getActive (data) { getActive (data) {
let yData = data.map(v => v.name).reverse() let yData = data.map(v => v.name).reverse()
let y2Data = data.map(v => v.value).reverse() let y2Data = data.map(v => v.value).reverse()
......
...@@ -74,6 +74,10 @@ export default { ...@@ -74,6 +74,10 @@ export default {
} }
// 右侧数据 // 右侧数据
this.rightData = { this.rightData = {
staff: data.p12 || {}, // 师资力量
coursedata: data.p13 || {}, // 教学课程
line: data.p14 || {}, // 教学线上线下比例
learn: data.p15 || {} // 学习内容
} }
} catch (err) { } catch (err) {
console.log('managePlatform >', err) console.log('managePlatform >', err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment