You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1564 lines
46 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

$(function () {
var loadingHtml = ` <div class="loader">
<div class="loader-inner ball-pulse">
<div></div>
<div></div>
<div></div>
</div>
</div>`
var chartsLoadindStyle = {
text: 'loading',
color: '#4cbbff',
textColor: '#4cbbff',
maskColor: 'rgba(0, 0, 0, 0.3)',
}
var switchTime = "all"
let r2Type = 1
let r1Type = 1
let c2Type = 1
let l1Type = 1
l1(l1Type, switchTime);
l2_paihang("4")
c1(switchTime);
c2(c2Type, switchTime);
c2_huizong(c2Type, switchTime);
r1(r1Type, switchTime);
r2_jspaihang(r2Type, switchTime)
r2_jgpaihang(r2Type, switchTime)
$('body').on('click', '#switch_month', function (e) {
switchTime = "month"
$('#switch-time').children().removeClass("act")
$('#switch_month').addClass("act")
l1(l1Type, switchTime);
l2_paihang("4", switchTime);
c1(switchTime);
c2(c2Type, switchTime);
c2_huizong(c2Type, switchTime);
r1(r1Type, switchTime);
r2_jspaihang(r2Type, switchTime);
r2_jgpaihang(r2Type, switchTime);
})
$('body').on('click', '#switch_year', function (e) {
switchTime = "year"
$('#switch-time').children().removeClass("act")
$('#switch_year').addClass("act")
l1(l1Type, switchTime);
l2_paihang("4", switchTime);
c1(switchTime);
c2(c2Type, switchTime);
c2_huizong(c2Type, switchTime);
r1(r1Type, switchTime);
r2_jspaihang(r2Type, switchTime);
r2_jgpaihang(r2Type, switchTime);
})
$('body').on('click', '#switch_all', function (e) {
switchTime = "all"
$('#switch-time').children().removeClass("act")
$('#switch_all').addClass("act")
l1(l1Type, switchTime);
l2_paihang("4", switchTime);
c1(switchTime);
c2(c2Type, switchTime);
c2_huizong(c2Type, switchTime);
r1(r1Type, switchTime);
r2_jspaihang(r2Type, switchTime);
r2_jgpaihang(r2Type, switchTime);
})
// lllllllllllllllllllllllllllllllll
// 资源建设情况监测
$('body').on('click', '#zyjsqkjc_zysc', function (e) {
l1Type = 1
$('#zyjsqkjc').children().removeClass("act")
$('#zyjsqkjc_zysc').addClass("act")
l1(l1Type, switchTime);
})
$('body').on('click', '#zyjsqkjc_aygx', function (e) {
l1Type = 2
$('#zyjsqkjc').children().removeClass("act")
$('#zyjsqkjc_aygx').addClass("act")
l1(l1Type, switchTime);
})
function l1(type = 1, time = "all") {
var myChart = echarts.init(document.getElementById('l1')); // 各阶段学校数量
myChart.showLoading(chartsLoadindStyle);
let query_id = ""
if (time == "all") {
query_id = "resource_up_share_all"
query_param = []
query_group = ["year_name", "type_name"]
danwei = '年'
} else if (time == "year") {
query_id = "resource_up_share_month"
query_param = [nowYear]
query_group = ["month_name", "type_name"]
danwei = '月'
} else if (time == "month") {
query_id = "resource_up_share_day"
query_param = [nowYear, nowMonth]
query_group = ["day_name", "type_name"]
danwei = '日'
}
axios({
...axiosConf,
data: {
"access_token": "TSKP##20211130104505##a6ce11eab94df48a6ce11eab",
"query": {
"query_id": query_id,
"query_param": query_param
},
"query_cache": 0,
"query_count": [
"upload_total",
"share_total"
],
"query_format": "echarts",
"query_group": query_group
}
}).then((res) => {
const resport = res.data;
const data = JSON.parse(resport.result)
// console.log(JSON.parse(resport.result), data.groups[0]);
let seriesData = []
if (!data.datas) {
myChart.showLoading(chartsLoadindNodataStyle);
myChart.clear()
dataZoom = [{
show: false
}]
} else {
if (type == 1) {
data.groups[1].map((e, i) => {
seriesData.push({
name: e,
type: 'bar',
stack: 'total',
barMaxWidth: 18,
data: data.datas[i]
})
})
} else if (type == 2) {
data.groups[1].map((e, i) => {
seriesData.push({
name: e,
type: 'bar',
stack: 'total',
data: data.datas2[i]
})
})
}
myChart.hideLoading();
}
option = {
// height: "100px",
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
textStyle: {
color: '#01DFF4'
},
grid: {
top: 60,
bottom: 20,
right: 20
},
color: ["#0BCAEA", "#FE8E3A", "#3FDB94", "#4992FF", "#FF6E76"],
legend: {
data: data.groups[1],
top: 20,
right: 10,
itemWidth: 8,
itemHeight: 8,
textStyle: {
color: '#01DFF4'
},
},
xAxis: [
{
name: danwei,
nameTextStyle: {
padding: [0, 0, 0, -10] // 四个数字分别为上右下左与原位置距离
},
type: 'category',
data: data.groups[0],
axisLine: {
lineStyle: {
color: '#01DFF4' //更改坐标轴颜色
}
},
axisLabel: {
textStyle: {
color: '#ffffff'
},
// formatter: xAxisformatter,
interval: 0,
},
},
],
yAxis: [
{
type: 'value',
axisLabel: {
textStyle: {
color: '#ffffff', //坐标轴的颜色
},
},
},
],
series: seriesData
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
}).catch(() => {
myChart.showLoading(chartsLoadindNodataStyle);
myChart.clear()
dataZoom = [{
show: false
}]
})
window.addEventListener("resize", function () {
myChart.resize();
});
}
$('body').on('click', '#l2_xiaoxue', function (e) {
$('#xuezhi').children().removeClass("act")
$('#l2_xiaoxue').addClass("act")
l2_paihang(edu = "4")
})
$('body').on('click', '#l2_chuzhong', function (e) {
$('#xuezhi').children().removeClass("act")
$('#l2_chuzhong').addClass("act")
l2_paihang(edu = "5")
})
$('body').on('click', '#l2_gaozhong', function (e) {
$('#xuezhi').children().removeClass("act")
$('#l2_gaozhong').addClass("act")
l2_paihang(edu = "6")
})
// 学科资源共建共享排行榜
function l2_paihang(edu = "4", time = "all") {
$("#zyph").html(loadingHtml)
let query_id = ""
if (time == "all") {
query_id = "subject_top_all"
query_param = [edu, edu]
} else if (time == "year") {
query_id = "subject_top_month"
query_param = [nowYear, edu, nowYear, edu]
} else if (time == "month") {
query_id = "subject_top_day"
query_param = [nowYear, nowMonth, edu, nowYear, nowMonth, edu]
}
axios({
...axiosConf,
data: {
"access_token": "TSKP##20211130104505##a6ce11eab94df48a6ce11eab",
"query": {
"query_id": query_id,
"query_param": query_param
},
"query_cache": 0,
"query_count": [
"sub_total",
"total"
],
"query_format": "json",
"query_group": [
"subject_name",
"type_name"
]
}
}).then((res) => {
const resport = res.data;
console.log(resport);
// 根据学科遍历列表
var phHtml = ""
if (resport.result == "") {
var phHtml = `<div style="padding-top:2.5rem;color:#4cbbff;font-size:0.20rem;text-align:center">暂无数据</div>`
$("#zyph").html(phHtml)
} else {
const data = JSON.parse(resport.result);
// console.log(JSON.parse(resport.result), '学科资源共建共享排行榜 num');
// 获取学科
const xueke = [];
data.map((item) => {
xueke.push({ id: item.subject_id, name: item.subject_name, total: item.total });
})
// 去重
xuekeFil = xueke.filter((item, index) => {
return xueke.findIndex(_item => _item.id == item.id) == index;
})
// push子数据
xuekeFil.map((xuekeItem, index) => {
let nr = []
data.map((item) => {
if (item.subject_name == xuekeItem.name) {
nr.push(item)
}
})
xuekeFil[index].item = nr
})
xuekeFil.map((item, index) => {
var html = ""
for (i = 0; i <= 3; i++) {
switch (i) {
case 0: zyname = "教学资源"
break;
case 1: zyname = "试卷资源"
break;
case 2: zyname = "微课资源"
break;
case 3: zyname = "教材资源"
break;
}
if (item.item[i]) {
html += `<div><div class="title">${item.item[i].type_name ? item.item[i].type_name : ""}</div> <span>${item.item[i].sub_total ? item.item[i].sub_total : ""}</span></div>`
} else {
html += `<div><div class="title">${zyname}</div><span> 0</span></div>`
}
}
phHtml += `
<div class="ziyuanpaihang">
<img src="./images/top${index + 1}.png" alt="" class="top">
<div class="ico">
<img src="./images/${md5(item.name)}.svg" alt=""><br>
${item.name}
</div>
<div class="content">
${html}
</div>
<div class="line"></div>
<div class="total">
<span>${item.total}</span><br>资源总量
</div>
</div>`
html = ""
})
$("#zyph").html(phHtml)
}
}).catch(() => {
var phHtml = `<div style="padding-top:2.5rem;color:#4cbbff;font-size:0.20rem;text-align:center">暂无数据</div>`
$("#zyph").html(phHtml)
})
}
// ccccccccccccccccccccccccccccccccccccccccc
function c1(time) {
var myChart = echarts.init(document.getElementById('c1')); // 各阶段学校数量
myChart.showLoading(chartsLoadindStyle);
if (time === "all") {
query_id = "resource_up_down_all"
query_param = []
query_group = ["year_name", "type_name"]
} else if (time === "year") {
query_id = "resource_up_down_month"
query_param = [nowYear]
query_group = ["month_name", "type_name"]
} else if (time === "month") {
query_id = "resource_up_down_day"
query_param = [nowYear, nowMonth]
query_group = ["day_name", "type_name"]
}
axios({
...axiosConf,
data: {
"access_token": "TSKP##20211130104505##a6ce11eab94df48a6ce11eab",
"query": {
"query_id": query_id,
"query_param": query_param
},
"query_cache": 0,
"query_count": [
"upload_total",
"download_total"
],
"query_format": "echarts",
"query_group": query_group
}
}).then((res) => {
const resport = res.data;
const data = JSON.parse(resport.result)
// console.log(JSON.parse(resport.result), '运行情况监测');
if (!data.datas) {
myChart.showLoading(chartsLoadindNodataStyle);
data1 = []
data2 = []
xAxisName = []
myChart.clear()
dataZoom = [{
show: false
}]
} else {
xAxisName = data.groups[0]
data1 = data.datas[0]
data2 = data.datas2[0]
myChart.hideLoading();
}
option = {
// height: "100px",
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
textStyle: {
color: '#01DFF4'
},
grid: {
top: 40,
bottom: 40,
right: 35
},
color: ["#fcff00", "#01f0ff"],
legend: {
data: ['资源上传', '资源下载'],
textStyle: {
color: '#01DFF4'
},
},
xAxis: [
{
type: 'category',
data: xAxisName,
axisLine: {
lineStyle: {
color: '#01DFF4' //更改坐标轴颜色
}
},
axisLabel: {
rotate: 30,
color: "white"
},
splitLine: {//分割线配置
lineStyle: {
color: "rgba(219,225,255,1)",
}
}
},
],
yAxis: [
{
name: "资源上传",
type: 'value',
axisLine: {
lineStyle: {
color: '#01DFF4' //更改坐标轴颜色
}
},
splitLine: {//分割线配置
lineStyle: {
color: "#00ffff50",
}
},
axisLabel: {
color: "white"
}
},
{
splitLine: {//分割线配置
lineStyle: {
show: false,
color: "#010d5f",
}
},
name: "资源下载",
type: 'value',
axisLine: {
lineStyle: {
color: '#01DFF4' //更改坐标轴颜色
}
},
axisLabel: {
color: "white"
}
}
],
series: [
{
name: '资源上传',
type: 'line',
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#fcff00' // 100% 处的颜色
}, {
offset: 1, color: '#fcff0000' // 0% 处的颜色
}],
global: false // 缺省为 false
}
},
yAxisIndex: 0,
data: data1,
smooth: true
},
{
name: '资源下载',
type: 'line',
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#01f0ff' // 100% 处的颜色
}, {
offset: 1, color: '#01f0ff00' // 0% 处的颜色
}],
global: false // 缺省为 false
}
},
data: data2,
yAxisIndex: 1,
smooth: true
}
]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
})
.catch(() => {
myChart.showLoading(chartsLoadindNodataStyle);
data1 = []
data2 = []
xAxisName = []
myChart.clear()
dataZoom = [{
show: false
}]
})
window.addEventListener("resize", function () {
myChart.resize();
});
}
// 区域资源汇总及监测
$('body').on('click', '#qyzyhzjjc_zysc', function (e) {
c2Type = 1
$('#qyzyhzjjc').children().removeClass("act")
$('#qyzyhzjjc_zysc').addClass("act");
$("#qyzyhzjc").html(loadingHtml)
c2(c2Type, switchTime);
c2_huizong(c2Type, switchTime);
})
$('body').on('click', '#qyzyhzjjc_zyxz', function (e) {
c2Type = 2
$('#qyzyhzjjc').children().removeClass("act")
$('#qyzyhzjjc_zyxz').addClass("act")
c2(c2Type, switchTime);
c2_huizong(c2Type, switchTime);
})
$('body').on('click', '#qyzyhzjjc_zygx', function (e) {
c2Type = 3
$('#qyzyhzjjc').children().removeClass("act")
$('#qyzyhzjjc_zygx').addClass("act")
c2(c2Type, switchTime);
c2_huizong(c2Type, switchTime);
})
$('body').on('click', '#qyzyhzjjc_zytj', function (e) {
c2Type = 4
$('#qyzyhzjjc').children().removeClass("act")
$('#qyzyhzjjc_zytj').addClass("act")
c2(c2Type, switchTime);
c2_huizong(c2Type, switchTime);
})
function c2(type = 1, time = "all") {
var myChart = echarts.init(document.getElementById('c2')); // 各阶段学校数量
myChart.showLoading({
text: 'loading',
color: '#4cbbff',
textColor: '#4cbbff',
maskColor: 'rgba(0, 0, 0, 0.1)',
});
let query_id = ""
if (time == "all") {
query_id = "org_res_type_all"
query_param = []
} else if (time == "year") {
query_id = "org_res_type_month"
query_param = [nowYear]
} else if (time == "month") {
query_id = "org_res_type_day"
query_param = [nowYear, nowMonth]
}
axios({
...axiosConf,
data: {
"access_token": "TSKP##20211130104505##a6ce11eab94df48a6ce11eab",
"query": {
"query_id": query_id,
"query_param": query_param
},
"query_cache": 0,
"query_count": [
"upload_total",
"download_total",
"share_total",
"recommend_total"
],
"query_format": "echarts",
"query_group": [
"org_name",
"type_name"
]
}
}).then((res) => {
const resport = res.data;
const data = JSON.parse(resport.result)
// console.log(JSON.parse(resport.result), '运行情况监测11');
if (!data.datas) {
myChart.showLoading({
...chartsLoadindNodataStyle,
maskColor: 'rgba(0, 0, 0, 0.0)',
});
data1 = []
data2 = []
xAxisName = []
myChart.clear()
dataZoom = [{
show: false
}]
} else {
var dataCharts = []
if (type === 1) {
dataCharts = data.datas
} else if (type === 2) {
dataCharts = data.datas2
} else if (type === 3) {
dataCharts = data.datas3
} else if (type === 4) {
dataCharts = data.datas4
}
myChart.hideLoading();
}
option = {
// height: "100px",
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
textStyle: {
color: '#01DFF4'
},
grid: {
top: 60,
bottom: 80,
right: 35
},
color: ["#fcff00", "#01f0ff"],
legend: {
data: data.groups[1],
textStyle: {
color: '#01DFF4'
},
top: 35
},
xAxis: [
{
type: 'category',
data: data.groups[0],
axisLine: {
lineStyle: {
color: '#01DFF4' //更改坐标轴颜色
}
},
axisLabel: {
rotate: 35,
color: "white"
},
splitLine: {//分割线配置
lineStyle: {
color: "rgba(219,225,255,1)",
}
}
},
],
yAxis: [
{
type: 'value',
axisLine: {
lineStyle: {
color: '#01DFF4' //更改坐标轴颜色
}
},
splitLine: {//分割线配置
lineStyle: {
color: "#00ffff50",
}
},
axisLabel: {
color: "white"
}
}
],
series: [
{
name: data.groups[1][0],
type: 'line',
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#fcff00' // 100% 处的颜色
}, {
offset: 1, color: '#fcff0000' // 0% 处的颜色
}],
global: false // 缺省为 false
}
},
data: dataCharts[0],
smooth: true
},
{
name: data.groups[1][1],
type: 'line',
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#01f0ff' // 100% 处的颜色
}, {
offset: 1, color: '#01f0ff00' // 0% 处的颜色
}],
global: false // 缺省为 false
}
},
data: dataCharts[1],
smooth: true
}
]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
}).catch(() => {
myChart.showLoading({
...chartsLoadindNodataStyle,
maskColor: 'rgba(0, 0, 0, 0.0)',
});
data1 = []
data2 = []
xAxisName = []
myChart.clear()
dataZoom = [{
show: false
}]
})
window.addEventListener("resize", function () {
myChart.resize();
});
}
// 学科资源共建共享排行榜
function c2_huizong(type = 1, time = "all") {
$("#qyzyhzjc").html(loadingHtml)
let query_id = ""
if (time == "all") {
query_id = "stage_rate_all"
query_param = []
} else if (time == "year") {
query_id = "stage_rate_month"
query_param = [nowYear]
} else if (time == "month") {
query_id = "stage_rate_day"
query_param = [nowYear, nowMonth]
}
axios({
...axiosConf,
data: {
"access_token": "TSKP##20211130104505##a6ce11eab94df48a6ce11eab",
"query": {
"query_id": query_id,
"query_param": query_param
},
"query_cache": 0,
"query_count": [
"upload_total",
"download_total",
"share_total",
"recommend_total"
],
"query_format": "json",
"query_group": [
"stage_name"
]
}
}).then((res) => {
const resport = res.data;
if (resport.result == "") {
html = `<div class="item">
<div class="num">
<span style="">0</span><br>占比 0%
</div>
<div class="num edus"></div>
</div>`
$("#qyzyhzjc").html(html)
} else {
const data = JSON.parse(resport.result);
// console.log(JSON.parse(resport.result), '区域资源汇总及监测 c2');
// 获取学科
let upload_total_sum = 0
let download_total_sum = 0
let share_total_sum = 0
let recommend_total_sum = 0
data.map((item) => {
download_total_sum += Number(item.download_total)
recommend_total_sum += Number(item.recommend_total)
share_total_sum += Number(item.share_total)
upload_total_sum += Number(item.upload_total)
})
let html = ""
if (type == 1) {
data.map((item) => {
html += `<div class="item">
<div class="num">
<span style="">${item.upload_total}</span><br>占比${(item.upload_total / upload_total_sum * 100).toFixed(2) + "%"}
</div>
<div class="num edus">${item.stage_name}</div>
</div>`
})
} else if (type == 2) {
data.map((item) => {
html += `<div class="item">
<div class="num">
<span style="">${item.download_total}</span><br>占比${(item.download_total / download_total_sum * 100).toFixed(2) + "%"}
</div>
<div class="num edus">${item.stage_name}</div>
</div>`
})
} else if (type == 3) {
data.map((item) => {
html += `<div class="item">
<div class="num">
<span style="">${item.share_total}</span><br>占比${(item.share_total / share_total_sum * 100).toFixed(2) + "%"}
</div>
<div class="num edus">${item.stage_name}</div>
</div>`
})
} else if (type == 4) {
data.map((item) => {
html += `<div class="item">
<div class="num">
<span style="">${item.recommend_total}</span><br>占比${recommend_total_sum ? (item.recommend_total / recommend_total_sum * 100).toFixed(2) : 0 + "%"}
</div>
<div class="num edus">${item.stage_name}</div>
</div>`
})
}
$("#qyzyhzjc").html(html)
}
}).catch(() => {
html = `<div class="item">
<div class="num">
<span style="">0</span><br>占比 0%
</div>
<div class="num edus"></div>
</div>`
$("#qyzyhzjc").html(html)
})
}
// rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
// 资源建设情况监测
$('body').on('click', '#zyyyqkjc_zyxz', function (e) {
r1Type = 1
$('#zyyyqkjc').children().removeClass("act")
$('#zyyyqkjc_zyxz').addClass("act")
r1(r1Type, switchTime);
})
$('body').on('click', '#zyyyqkjc_zytj', function (e) {
r1Type = 2
$('#zyyyqkjc').children().removeClass("act")
$('#zyyyqkjc_zytj').addClass("act")
r1(r1Type, switchTime);
})
function r1(type = 1, time = "all") {
var myChart = echarts.init(document.getElementById('r1')); // 各阶段学校数量
myChart.showLoading(chartsLoadindStyle);
let query_id = ""
if (time == "all") {
query_id = "resource_down_rec_all"
query_param = []
query_group = ["year_name", "type_name"]
danwei = '年'
} else if (time == "year") {
query_id = "resource_down_rec_month"
query_param = [nowYear]
query_group = ["month_name", "type_name"]
danwei = '月'
} else if (time == "month") {
query_id = "resource_down_rec_day"
query_param = [nowYear, nowMonth]
query_group = ["day_name", "type_name"]
danwei = '日'
}
axios({
...axiosConf,
data: {
"access_token": "TSKP##20211130104505##a6ce11eab94df48a6ce11eab",
"query": {
"query_id": query_id,
"query_param": query_param
},
"query_cache": 0,
"query_count": [
"download_total",
"recommend_total"
],
"query_format": "echarts",
"query_group": query_group
}
}).then((res) => {
const resport = res.data;
const data = JSON.parse(resport.result)
let seriesData = []
if (!data.datas) {
myChart.showLoading(chartsLoadindNodataStyle);
data1 = []
data2 = []
xAxisName = []
myChart.clear()
dataZoom = [{
show: false
}]
} else {
if (type == 1) {
data.groups[1].map((e, i) => {
seriesData.push({
name: e,
type: 'bar',
stack: 'total',
barMaxWidth: 18,
data: data.datas[i]
})
})
} else if (type == 2) {
data.groups[1].map((e, i) => {
seriesData.push({
name: e,
type: 'bar',
stack: 'total',
data: data.datas2[i]
})
})
}
myChart.hideLoading();
}
option = {
// height: "100px",
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
textStyle: {
color: '#01DFF4'
},
grid: {
top: 60,
bottom: 20,
right: 20
},
color: ["#0BCAEA", "#FE8E3A", "#3FDB94", "#4992FF", "#FF6E76"],
legend: {
data: data.groups[1],
top: 20,
right: 10,
itemWidth: 8,
itemHeight: 8,
textStyle: {
color: '#01DFF4'
},
},
xAxis: [
{
name: danwei,
nameTextStyle: {
padding: [0, 0, 0, -10] // 四个数字分别为上右下左与原位置距离
},
type: 'category',
data: data.groups[0],
axisLine: {
lineStyle: {
color: '#01DFF4' //更改坐标轴颜色
}
},
axisLabel: {
interval: 0,
textStyle: {
color: '#ffffff'
},
// formatter: xAxisformatter
},
},
],
yAxis: [
{
type: 'value',
axisLabel: {
textStyle: {
color: '#ffffff', //坐标轴的颜色
},
},
},
],
// dataZoom: [
// {
// type: "slider",   //slider:滑块  inside:内置,依靠鼠标滚轮或者双击缩放
// xAxisIndex: 0,   //显示x轴滑块
// height: "15px",
// end: 80,
// top: "85%"
// }
// ],
series: seriesData
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
}).catch(() => {
myChart.showLoading(chartsLoadindNodataStyle);
data1 = []
data2 = []
xAxisName = []
myChart.clear()
dataZoom = [{
show: false
}]
})
window.addEventListener("resize", function () {
myChart.resize();
});
}
$('body').on('click', '#r2_zysc', function (e) {
r2Type = 1
$('#r2_paihang').children().removeClass("act")
$('#r2_zysc').addClass("act")
r2_jspaihang(r2Type, switchTime)
r2_jgpaihang(r2Type, switchTime)
})
$('body').on('click', '#r2_zyxz', function (e) {
r2Type = 2
$('#r2_paihang').children().removeClass("act")
$('#r2_zyxz').addClass("act")
r2_jspaihang(r2Type, switchTime)
r2_jgpaihang(r2Type, switchTime)
})
// 学科资源共建共享排行榜
function r2_jspaihang(type = 1, time = "all") {
$("#gjgx_js_paihang").html(loadingHtml)
$("#gjgx_jg_paihang").html(loadingHtml)
let params = {}
if (type == 1) {
query_id = "teacher_up_top_"
query_count = [
"upload_total",
"share_total"
]
name1 = "资源上传"
name2 = "资源分享"
} else if (type == 2) {
query_id = "teacher_down_top_"
query_count = [
"download_total",
"recommend_total"
]
name1 = "资源下载"
name2 = "资源推荐"
}
if (time == "all") {
query_id = query_id + "all"
query_param = []
} else if (time == "year") {
query_id = query_id + "month"
query_param = [nowYear]
} else if (time == "month") {
query_id = query_id + "day"
query_param = [nowYear, nowMonth]
}
axios({
...axiosConf,
data: {
"access_token": "TSKP##20211130104505##a6ce11eab94df48a6ce11eab",
"query": {
"query_id": query_id,
"query_param": query_param
},
"query_cache": 0,
"query_count": query_count,
"query_format": "json",
"query_group": [
"person_name",
"org_name"
]
}
}).then((res) => {
const resport = res.data;
// console.log(JSON.parse(resport.result), '资源共建共享应用排行榜 上传');
let html = ""
if (resport.result == "") {
html = `<div style="height:1.8rem;color:#4cbbff;font-size:0.20rem;text-align:center;display:flex; align-items:center; justify-content:center;">暂无数据</div>`
$("#gjgx_js_paihang").html(html)
} else {
const data = JSON.parse(resport.result);
data.map((item, index) => {
if (type == 1) {
total = item.upload_total
} else if (type == 2) {
total = item.download_total
}
html += ` <div class="list">
<div class="top"><img src="./images/t${index + 1}.png" /></div>
<div class="head" style="width:1rem"><span class="name">${item.person_name}</span><br><p class="school">${item.org_name}</p></div>
<div class="total"><span class="num">${total ? total : 0}</span><br><span class="num-name">${name1}</span>
</div>
<div class="total"><span class="num">${item.share_total ? item.share_total : 0}</span><br><span class="num-name">${name2}</span>
</div>
</div>`
})
// console.log(phHtml);
$("#gjgx_js_paihang").html(html)
}
}).catch(() => {
html = `<div style="height:1.8rem;color:#4cbbff;font-size:0.20rem;text-align:center;display:flex; align-items:center; justify-content:center;">暂无数据</div>`
$("#gjgx_js_paihang").html(html)
})
}
function r2_jgpaihang(type = 1, time = "year") {
let params = {}
let query_id = ""
let query_param = []
if (type == 1) {
query_id = "org_up_top_"
query_count = [
"upload_total",
"share_total"
]
name1 = "资源上传"
name2 = "资源分享"
} else if (type == 2) {
query_id = "org_down_top_"
query_count = [
"download_total",
"recommend_total"
]
name1 = "资源下载"
name2 = "资源推荐"
}
if (time == "all") {
query_id = query_id + "all"
query_param = []
} else if (time == "year") {
query_id = query_id + "month"
query_param = [nowYear]
} else if (time == "month") {
query_id = query_id + "day"
query_param = [nowYear, nowMonth]
}
axios({
...axiosConf,
data: {
"access_token": "TSKP##20211130104505##a6ce11eab94df48a6ce11eab",
"query": {
"query_id": query_id,
"query_param": query_param
},
"query_cache": 0,
"query_count": query_count,
"query_format": "json",
"query_group": [
"org_name"
]
}
}).then((res) => {
const resport = res.data;
// console.log(JSON.parse(resport.result), '资源共建共享应用排行榜 机构');
let html = ""
let total = ""
if (resport.result == "") {
html = `<div style="height:2.2rem;color:#4cbbff;font-size:0.20rem;text-align:center;display:flex; align-items:center; justify-content:center;">暂无数据</div>`
$("#gjgx_jg_paihang").html(html)
} else {
const data = JSON.parse(resport.result);
data.map((item, index) => {
if (type == 1) {
total = item.upload_total
} else if (type == 2) {
total = item.download_total
}
html += `
<div class="list">
<img src="./images/top${index + 1}.png" alt="" class="top1" />
<div class="top"><img src="./images/school_ico.svg" class="ico" /></div>
<div class="head"><span class="name">${item.org_name}</span></div>
<div class="total"><span class="num">${total ? total : 0}</span><br><span class="num-name">${name1}</span>
</div>
<div class="total"><span class="num">${item.share_total ? item.share_total : 0}</span><br><span class="num-name">${name2}</span>
</div>
</div>`
})
// console.log(phHtml);
$("#gjgx_jg_paihang").html(html)
}
}).catch(() => {
html = `<div style="height:2.2rem;color:#4cbbff;font-size:0.20rem;text-align:center;display:flex; align-items:center; justify-content:center;">暂无数据</div>`
$("#gjgx_jg_paihang").html(html)
})
}
})