延时0.2秒加载
This commit is contained in:
parent
93cff61aeb
commit
6cfb560d38
175
web/src/x.min.js
vendored
175
web/src/x.min.js
vendored
@ -3265,100 +3265,97 @@ var X = window.X || {
|
||||
var eventdata=[];
|
||||
var index = d.length;
|
||||
for(let i in d){
|
||||
X.api("ck/"+d[i]['model']+"_model","post",{report_id:d[i]['report_id']},function(val){
|
||||
// console.log(val);
|
||||
if(d[i]['model'] == "event"){
|
||||
// 事件分析
|
||||
if(d[i]['graph_size'] == 'small'){
|
||||
X.eventsmall(val,function(data){//表格数据处理
|
||||
data['name'] = d[i]['name'];
|
||||
data['modeltype'] = d[i]['graph_type'];
|
||||
data['id'] = d[i]['report_id'];
|
||||
data['modelsize'] = d[i]['graph_size'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}else {
|
||||
if(d[i]['graph_type'] == 'table'){
|
||||
//表格样式
|
||||
X.eventtable(val,function(data){//表格数据处理
|
||||
data['name'] = d[i]['name'];
|
||||
data['modeltype'] = d[i]['graph_type'];
|
||||
data['id'] = d[i]['report_id'];
|
||||
data['modelsize'] = d[i]['graph_size'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}else if(d[i]['graph_type'] == 'echarts'){
|
||||
//图形
|
||||
X.eventchart(val,function(data){
|
||||
data['name'] = d[i]['name'];
|
||||
data['modeltype'] = d[i]['graph_type'];
|
||||
data['id'] = d[i]['report_id'];
|
||||
data['modelsize'] = d[i]['graph_size'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
index --;
|
||||
console.log(eventdata);
|
||||
if(index <= 0){
|
||||
X.template("modeltable","chart-box",eventdata,function(){
|
||||
for(let i in eventdata){
|
||||
if(eventdata[i]['modeltype'] == 'echarts' && eventdata[i]['modelsize'] != 'small' ){
|
||||
var myChart = echarts.init(document.getElementById(eventdata[i]['id']));
|
||||
var option = {
|
||||
title: {
|
||||
text: ''
|
||||
},
|
||||
color: X.DATA.echartscolor,
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
type:'scroll',
|
||||
data: eventdata[i]['legenddata']
|
||||
},
|
||||
grid: {
|
||||
left: '2%',
|
||||
right: '2%',
|
||||
bottom: '2%',
|
||||
top: '10%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: eventdata[i]['xAxisData']
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value'
|
||||
}
|
||||
],
|
||||
series: eventdata[i]['seriesData']
|
||||
};
|
||||
myChart.setOption(option,true);
|
||||
setTimeout(
|
||||
X.api("ck/"+d[i]['model']+"_model","post",{report_id:d[i]['report_id']},function(val){
|
||||
// console.log(val);
|
||||
if(d[i]['model'] == "event"){
|
||||
// 事件分析
|
||||
if(d[i]['graph_size'] == 'small'){
|
||||
X.eventsmall(val,function(data){//表格数据处理
|
||||
data['name'] = d[i]['name'];
|
||||
data['modeltype'] = d[i]['graph_type'];
|
||||
data['id'] = d[i]['report_id'];
|
||||
data['modelsize'] = d[i]['graph_size'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}else {
|
||||
if(d[i]['graph_type'] == 'table'){
|
||||
//表格样式
|
||||
X.eventtable(val,function(data){//表格数据处理
|
||||
data['name'] = d[i]['name'];
|
||||
data['modeltype'] = d[i]['graph_type'];
|
||||
data['id'] = d[i]['report_id'];
|
||||
data['modelsize'] = d[i]['graph_size'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}else if(d[i]['graph_type'] == 'echarts'){
|
||||
//图形
|
||||
X.eventchart(val,function(data){
|
||||
data['name'] = d[i]['name'];
|
||||
data['modeltype'] = d[i]['graph_type'];
|
||||
data['id'] = d[i]['report_id'];
|
||||
data['modelsize'] = d[i]['graph_size'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
index --;
|
||||
console.log(eventdata);
|
||||
if(index <= 0){
|
||||
X.template("modeltable","chart-box",eventdata,function(){
|
||||
for(let i in eventdata){
|
||||
if(eventdata[i]['modeltype'] == 'echarts' && eventdata[i]['modelsize'] != 'small' ){
|
||||
var myChart = echarts.init(document.getElementById(eventdata[i]['id']));
|
||||
var option = {
|
||||
title: {
|
||||
text: ''
|
||||
},
|
||||
color: X.DATA.echartscolor,
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
type:'scroll',
|
||||
data: eventdata[i]['legenddata']
|
||||
},
|
||||
grid: {
|
||||
left: '2%',
|
||||
right: '2%',
|
||||
bottom: '2%',
|
||||
top: '10%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: eventdata[i]['xAxisData']
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value'
|
||||
}
|
||||
],
|
||||
series: eventdata[i]['seriesData']
|
||||
};
|
||||
myChart.setOption(option,true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}),"200");//延时0.2秒调用
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
|
@ -244,100 +244,97 @@
|
||||
var eventdata=[];
|
||||
var index = d.length;
|
||||
for(let i in d){
|
||||
X.api("ck/"+d[i]['model']+"_model","post",{report_id:d[i]['report_id']},function(val){
|
||||
// console.log(val);
|
||||
if(d[i]['model'] == "event"){
|
||||
// 事件分析
|
||||
if(d[i]['graph_size'] == 'small'){
|
||||
X.eventsmall(val,function(data){//表格数据处理
|
||||
data['name'] = d[i]['name'];
|
||||
data['modeltype'] = d[i]['graph_type'];
|
||||
data['id'] = d[i]['report_id'];
|
||||
data['modelsize'] = d[i]['graph_size'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}else {
|
||||
if(d[i]['graph_type'] == 'table'){
|
||||
//表格样式
|
||||
X.eventtable(val,function(data){//表格数据处理
|
||||
data['name'] = d[i]['name'];
|
||||
data['modeltype'] = d[i]['graph_type'];
|
||||
data['id'] = d[i]['report_id'];
|
||||
data['modelsize'] = d[i]['graph_size'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}else if(d[i]['graph_type'] == 'echarts'){
|
||||
//图形
|
||||
X.eventchart(val,function(data){
|
||||
data['name'] = d[i]['name'];
|
||||
data['modeltype'] = d[i]['graph_type'];
|
||||
data['id'] = d[i]['report_id'];
|
||||
data['modelsize'] = d[i]['graph_size'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
index --;
|
||||
console.log(eventdata);
|
||||
if(index <= 0){
|
||||
X.template("modeltable","chart-box",eventdata,function(){
|
||||
for(let i in eventdata){
|
||||
if(eventdata[i]['modeltype'] == 'echarts' && eventdata[i]['modelsize'] != 'small' ){
|
||||
var myChart = echarts.init(document.getElementById(eventdata[i]['id']));
|
||||
var option = {
|
||||
title: {
|
||||
text: ''
|
||||
},
|
||||
color: X.DATA.echartscolor,
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
type:'scroll',
|
||||
data: eventdata[i]['legenddata']
|
||||
},
|
||||
grid: {
|
||||
left: '2%',
|
||||
right: '2%',
|
||||
bottom: '2%',
|
||||
top: '10%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: eventdata[i]['xAxisData']
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value'
|
||||
}
|
||||
],
|
||||
series: eventdata[i]['seriesData']
|
||||
};
|
||||
myChart.setOption(option,true);
|
||||
setTimeout(
|
||||
X.api("ck/"+d[i]['model']+"_model","post",{report_id:d[i]['report_id']},function(val){
|
||||
// console.log(val);
|
||||
if(d[i]['model'] == "event"){
|
||||
// 事件分析
|
||||
if(d[i]['graph_size'] == 'small'){
|
||||
X.eventsmall(val,function(data){//表格数据处理
|
||||
data['name'] = d[i]['name'];
|
||||
data['modeltype'] = d[i]['graph_type'];
|
||||
data['id'] = d[i]['report_id'];
|
||||
data['modelsize'] = d[i]['graph_size'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}else {
|
||||
if(d[i]['graph_type'] == 'table'){
|
||||
//表格样式
|
||||
X.eventtable(val,function(data){//表格数据处理
|
||||
data['name'] = d[i]['name'];
|
||||
data['modeltype'] = d[i]['graph_type'];
|
||||
data['id'] = d[i]['report_id'];
|
||||
data['modelsize'] = d[i]['graph_size'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}else if(d[i]['graph_type'] == 'echarts'){
|
||||
//图形
|
||||
X.eventchart(val,function(data){
|
||||
data['name'] = d[i]['name'];
|
||||
data['modeltype'] = d[i]['graph_type'];
|
||||
data['id'] = d[i]['report_id'];
|
||||
data['modelsize'] = d[i]['graph_size'];
|
||||
eventdata.push(data);
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
index --;
|
||||
console.log(eventdata);
|
||||
if(index <= 0){
|
||||
X.template("modeltable","chart-box",eventdata,function(){
|
||||
for(let i in eventdata){
|
||||
if(eventdata[i]['modeltype'] == 'echarts' && eventdata[i]['modelsize'] != 'small' ){
|
||||
var myChart = echarts.init(document.getElementById(eventdata[i]['id']));
|
||||
var option = {
|
||||
title: {
|
||||
text: ''
|
||||
},
|
||||
color: X.DATA.echartscolor,
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
type:'scroll',
|
||||
data: eventdata[i]['legenddata']
|
||||
},
|
||||
grid: {
|
||||
left: '2%',
|
||||
right: '2%',
|
||||
bottom: '2%',
|
||||
top: '10%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: eventdata[i]['xAxisData']
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value'
|
||||
}
|
||||
],
|
||||
series: eventdata[i]['seriesData']
|
||||
};
|
||||
myChart.setOption(option,true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}),"200");//延时0.2秒调用
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user