|
@@ -37,7 +37,9 @@ function init(data) {
|
|
$('.train_join').text(data.train_join);
|
|
$('.train_join').text(data.train_join);
|
|
this.geo(data);
|
|
this.geo(data);
|
|
this.monitor(data);
|
|
this.monitor(data);
|
|
|
|
+ this.pieAge(data);
|
|
this.pie(data);
|
|
this.pie(data);
|
|
|
|
+ this.userType(data);
|
|
this.user(data);
|
|
this.user(data);
|
|
this.order(data);
|
|
this.order(data);
|
|
this.sale(data);
|
|
this.sale(data);
|
|
@@ -139,18 +141,29 @@ function geo(data) {
|
|
|
|
|
|
function monitor(data) {
|
|
function monitor(data) {
|
|
|
|
|
|
-
|
|
+ $('.monitor').on('click', ' a', function () {
|
|
-
|
|
+
|
|
-
|
|
+ $(this).addClass('active').siblings().removeClass('active');
|
|
-
|
|
+
|
|
-
|
|
+ var index = $(this).index();
|
|
-
|
|
+
|
|
-
|
|
+ $('.content').eq(index).show().siblings('.content').hide();
|
|
-
|
|
+ });
|
|
|
|
|
|
let comjobs = data.comjobs;
|
|
let comjobs = data.comjobs;
|
|
var html = '';
|
|
var html = '';
|
|
- comjobs.forEach(function(item) {
|
|
+ comjobs.hot.forEach(function(item) {
|
|
|
|
+ html += `<div class="row">`;
|
|
|
|
+ html += `<span class="col">${item.title}</span>`;
|
|
|
|
+ html += `<span class="col">${item.worker.ftitle}</span>`;
|
|
|
|
+ html += `<span class="col">${item.bwagall || '面谈'}</span>`;
|
|
|
|
+ html += `<span class="icon-dot"></span>`;
|
|
|
|
+ html += `</div>`;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $('.monitor .marquee.hot').html(html);
|
|
|
|
+ html = '';
|
|
|
|
+ comjobs.new.forEach(function(item) {
|
|
html += `<div class="row">`;
|
|
html += `<div class="row">`;
|
|
html += `<span class="col">${item.title}</span>`;
|
|
html += `<span class="col">${item.title}</span>`;
|
|
html += `<span class="col">${item.company}</span>`;
|
|
html += `<span class="col">${item.company}</span>`;
|
|
@@ -159,7 +172,7 @@ function monitor(data) {
|
|
html += `</div>`;
|
|
html += `</div>`;
|
|
});
|
|
});
|
|
|
|
|
|
- $('.monitor .marquee').html(html);
|
|
+ $('.monitor .marquee.new').html(html);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -173,6 +186,62 @@ function monitor(data) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function pieAge(data) {
|
|
|
|
+ let eduction = data.user_age;
|
|
|
|
+ let unknown = 0;
|
|
|
|
+ let total = 0;
|
|
|
|
+ eduction.map((item, index) => {
|
|
|
|
+ if (item.name == '其他') {
|
|
|
|
+ unknown += item.count;
|
|
|
|
+ eduction.splice(index, 1);
|
|
|
|
+ } else {
|
|
|
|
+ total += item.count;
|
|
|
|
+ item.value = item.count;
|
|
|
|
+ }
|
|
|
|
+ return item;
|
|
|
|
+ });
|
|
|
|
+ console.log(eduction)
|
|
|
|
+ $('.age-unknown').text(unknown);
|
|
|
|
+ $('.age-total').text(total);
|
|
|
|
+ var myechartAge = echarts.init($('.pie.age')[0]);
|
|
|
|
+ option = {
|
|
|
|
+
|
|
|
|
+ tooltip: {
|
|
|
|
+
|
|
|
|
+ trigger: 'item',
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ formatter: "{a} <br/>{b} : {c} ({d}%)"
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ series: [{
|
|
|
|
+
|
|
|
|
+ name: '年龄',
|
|
|
|
+
|
|
|
|
+ type: 'pie',
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ radius: ['10%', '70%'],
|
|
|
|
+
|
|
|
|
+ center: ['50%', '50%'],
|
|
|
|
+
|
|
|
|
+ roseType: 'radius',
|
|
|
|
+
|
|
|
|
+ data: eduction,
|
|
|
|
+
|
|
|
|
+ label: {
|
|
|
|
+ fontSize: 10
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ labelLine: {
|
|
|
|
+ length: 8,
|
|
|
|
+ length2: 10
|
|
|
|
+ }
|
|
|
|
+ }],
|
|
|
|
+ color: ['#006cff', '#60cda0', '#ed8884', '#ff9f7f', '#0096ff', '#9fe6b8', '#32c5e9', '#1d9dff']
|
|
|
|
+ };
|
|
|
|
+ myechartAge.setOption(option);
|
|
|
|
+}
|
|
function pie(data) {
|
|
function pie(data) {
|
|
let eduction = data.eduction;
|
|
let eduction = data.eduction;
|
|
let unknown = 0;
|
|
let unknown = 0;
|
|
@@ -189,7 +258,7 @@ function pie(data) {
|
|
});
|
|
});
|
|
$('.edu-unknown').text(unknown);
|
|
$('.edu-unknown').text(unknown);
|
|
$('.edu-total').text(total);
|
|
$('.edu-total').text(total);
|
|
- var myechart = echarts.init($('.pie')[0]);
|
|
+ var myechart = echarts.init($('.pie.edu')[0]);
|
|
option = {
|
|
option = {
|
|
|
|
|
|
tooltip: {
|
|
tooltip: {
|
|
@@ -228,6 +297,164 @@ function pie(data) {
|
|
};
|
|
};
|
|
myechart.setOption(option);
|
|
myechart.setOption(option);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+function userType(data) {
|
|
|
|
+ let cate = data.type;
|
|
|
|
+ let titleArr = [];
|
|
|
|
+ let countArr = [];
|
|
|
|
+ let total = 0;
|
|
|
|
+ let count = cate.length;
|
|
|
|
+
|
|
|
|
+ var hiddenItem = {
|
|
|
|
+ name: '',
|
|
|
|
+ value: 10,
|
|
|
|
+
|
|
|
|
+ itemStyle: {
|
|
|
|
+ color: '#254065'
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ emphasis: {
|
|
|
|
+ itemStyle: {
|
|
|
|
+ color: '#254065'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ tooltip: {
|
|
|
|
+ extraCssText: 'opacity:0'
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ let titleAttr = {
|
|
|
|
+ 1: '按月',
|
|
|
|
+ 2: '按时',
|
|
|
|
+ 3: '按件',
|
|
|
|
+ 4: '按项目',
|
|
|
|
+ 5: '其他',
|
|
|
|
+ }
|
|
|
|
+ cate.forEach((item, index) => {
|
|
|
|
+ if (index < 5 || index + 5 >= count) {
|
|
|
|
+ titleArr.push(titleAttr[item.wtype])
|
|
|
|
+ countArr.push(item.count)
|
|
|
|
+ } else if (count > 10 && index == 5) {
|
|
|
|
+
|
|
|
|
+ let arr = []
|
|
|
|
+ for (let i = 5; i < count - 5; i++) {
|
|
|
|
+ arr.push(i)
|
|
|
|
+ }
|
|
|
|
+ let randomArr = [];
|
|
|
|
+ while (randomArr.length < 3) {
|
|
|
|
+ let temp = (Math.random() * arr.length) >> 0;
|
|
|
|
+ randomArr.push(arr.splice(temp, 1)[0]);
|
|
|
|
+ }
|
|
|
|
+ randomArr.forEach((randomIndex) => {
|
|
|
|
+ titleArr.push(titleAttr[cate[randomIndex].wtype])
|
|
|
|
+ countArr.push(cate[randomIndex].count)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ total += item.count
|
|
|
|
+ });
|
|
|
|
+ $('.type-count').text(count)
|
|
|
|
+ $('.type-total').text(total)
|
|
|
|
+
|
|
|
|
+ option = {
|
|
|
|
+
|
|
|
|
+ tooltip: {
|
|
|
|
+
|
|
|
|
+ trigger: 'item',
|
|
|
|
+
|
|
|
|
+ axisPointer: {
|
|
|
|
+
|
|
|
|
+ type: 'shadow'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ grid: {
|
|
|
|
+
|
|
|
|
+ left: '0',
|
|
|
|
+ right: '3%',
|
|
|
|
+ bottom: '3%',
|
|
|
|
+ top: '5%',
|
|
|
|
+
|
|
|
|
+ containLabel: true,
|
|
|
|
+
|
|
|
|
+ show: true,
|
|
|
|
+
|
|
|
|
+ borderColor: 'rgba(0, 240, 255, 0.3)'
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ xAxis: [{
|
|
|
|
+
|
|
|
|
+ type: 'category',
|
|
|
|
+
|
|
|
|
+ data: titleArr,
|
|
|
|
+
|
|
|
|
+ axisTick: {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ alignWithLabel: false,
|
|
|
|
+ show: false
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ axisLabel: {
|
|
|
|
+ color: '#4c9bfd'
|
|
|
|
+ }
|
|
|
|
+ }],
|
|
|
|
+
|
|
|
|
+ yAxis: [{
|
|
|
|
+
|
|
|
|
+ type: 'value',
|
|
|
|
+ axisTick: {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ alignWithLabel: false,
|
|
|
|
+ show: false
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ axisLabel: {
|
|
|
|
+ color: '#4c9bfd'
|
|
|
|
+ },
|
|
|
|
+ splitLine: {
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: 'rgba(0, 240, 255, 0.3)'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ }],
|
|
|
|
+
|
|
|
|
+ series: [
|
|
|
|
+
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ itemStyle: {
|
|
|
|
+
|
|
|
|
+ color: new echarts.graphic.LinearGradient(
|
|
|
|
+
|
|
|
|
+ 0, 0, 0, 1,
|
|
|
|
+ [{
|
|
|
|
+ offset: 0,
|
|
|
|
+ color: '#00fffb'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ offset: 1,
|
|
|
|
+ color: '#0061ce'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ )
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ name: '岗位统计',
|
|
|
|
+
|
|
|
|
+ type: 'bar',
|
|
|
|
+
|
|
|
|
+ barWidth: '60%',
|
|
|
|
+
|
|
|
|
+ data: countArr
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ };
|
|
|
|
+ var myechart = echarts.init($('.users .bar.type')[0]);
|
|
|
|
+ myechart.setOption(option);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
function user(data) {
|
|
function user(data) {
|
|
let cate = data.cate;
|
|
let cate = data.cate;
|
|
@@ -375,7 +602,7 @@ function user(data) {
|
|
}
|
|
}
|
|
]
|
|
]
|
|
};
|
|
};
|
|
- var myechart = echarts.init($('.users .bar')[0]);
|
|
+ var myechart = echarts.init($('.users .bar.cate')[0]);
|
|
myechart.setOption(option);
|
|
myechart.setOption(option);
|
|
}
|
|
}
|
|
|
|
|