|
@@ -129,9 +129,9 @@
|
|
|
<div class="grid-demo">
|
|
|
<div class="row layui-form row2">
|
|
|
<div style="width:100%;float: left;">
|
|
|
- <div class="c1 label"> 粒度:</div>
|
|
|
+ <div class="c1 label"> 时间粒度:</div>
|
|
|
<div class="timeTypeDiv c1" style="width: 10%;">
|
|
|
- <select name="timeType" id="timeType" lay-filter="timeType" onchange="console.log('555555555555555555')">
|
|
|
+ <select name="timeType" id="timeType" lay-filter="timeType">
|
|
|
<option value="QUATER" selected>15分钟</option>
|
|
|
<option value="HOUR">小时</option>
|
|
|
<option value="DAY">天</option>
|
|
@@ -149,6 +149,7 @@
|
|
|
<div style="width:100%;float: left;">
|
|
|
<div class="column" id="searchType" style="width:auto;float: left;">
|
|
|
<input type="radio" name="where" value="AREA" title="按地市查询" lay-filter="where" checked>
|
|
|
+ <input type="radio" name="where" value="AGG" title="按地市汇聚查询" lay-filter="where">
|
|
|
<input type="radio" name="where" value="ECI" title="按eci查询" lay-filter="where" >
|
|
|
</div>
|
|
|
<div style="width:70%;float: left;">
|
|
@@ -169,17 +170,17 @@
|
|
|
const host = window.location.host
|
|
|
const username = window.sessionStorage.getItem('userName')
|
|
|
const socket = new WebSocket(`ws://${host}/ws?username=${username}`);
|
|
|
- socket.onopen = (event) => {
|
|
|
- console.log(event)
|
|
|
- }
|
|
|
+ // socket.onopen = (event) => {
|
|
|
+ // console.log(event)
|
|
|
+ // }
|
|
|
|
|
|
socket.onclose = (event) => {
|
|
|
- console.log(event)
|
|
|
+ // console.log(event)
|
|
|
logout()
|
|
|
}
|
|
|
|
|
|
socket.onerror = (event) => {
|
|
|
- console.log(event)
|
|
|
+ // console.log(event)
|
|
|
logout()
|
|
|
}
|
|
|
|
|
@@ -228,11 +229,11 @@
|
|
|
});
|
|
|
let dateArray = '';
|
|
|
let timeType = $('#timeType').val()
|
|
|
- console.log('timeType: ', timeType);
|
|
|
+ // console.log('timeType: ', timeType);
|
|
|
let date = new Date();
|
|
|
- if(timeType == 'QUATER'){
|
|
|
+ if(timeType === 'QUATER'){
|
|
|
dateArray= formatDate(date) + ' ' + '00:00:00' + ' - ' + formatDate(date) + ' ' + '00:15:00';
|
|
|
- console.log('dateArray: ', dateArray);
|
|
|
+ // console.log('dateArray: ', dateArray);
|
|
|
}
|
|
|
|
|
|
initTreeCity(tree)
|
|
@@ -246,7 +247,7 @@
|
|
|
// console.log('ooooo')
|
|
|
// handleChange(data.value)
|
|
|
form.render('select'); // 渲染select,固定写法
|
|
|
- if(data.value == 'QUATER'){
|
|
|
+ if(data.value === 'QUATER'){
|
|
|
dateArray= formatDate(date) + ' ' + '00:00:00' + ' - ' + formatDate(date) + ' ' + '00:15:00';
|
|
|
// console.log('dateArray: ', dateArray);
|
|
|
laydate.render({
|
|
@@ -255,11 +256,11 @@
|
|
|
range: true,
|
|
|
value: dateArray,
|
|
|
ready: function(date){
|
|
|
- console.log(date); //得到初始的日期时间对象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
|
|
|
+ // console.log(date); //得到初始的日期时间对象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
- if(data.value == 'HOUR'){
|
|
|
+ if(data.value === 'HOUR'){
|
|
|
// console.log('xiaoshi')
|
|
|
dateArray= formatDate(date) + ' ' + '00:00:00' + ' - ' + formatDate(date) + ' ' + '01:00:00';
|
|
|
// console.log('dateArray: ', dateArray);
|
|
@@ -269,11 +270,11 @@
|
|
|
range: true,
|
|
|
value: dateArray,
|
|
|
ready: function(date){
|
|
|
- console.log(date); //得到初始的日期时间对象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
|
|
|
+ // console.log(date); //得到初始的日期时间对象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
- if(data.value == 'DAY'){
|
|
|
+ if(data.value === 'DAY'){
|
|
|
// console.log('xiaoshi')
|
|
|
dateArray= formatDate(date) + ' ' + '00:00:00' + ' - ' + formatDate(date) + ' ' + '23:59:59';
|
|
|
// console.log('dateArray: ', dateArray);
|
|
@@ -283,7 +284,7 @@
|
|
|
range: true,
|
|
|
value: dateArray,
|
|
|
ready: function(date){
|
|
|
- console.log(date); //得到初始的日期时间对象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
|
|
|
+ // console.log(date); //得到初始的日期时间对象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
|
|
|
},
|
|
|
});
|
|
|
}
|
|
@@ -295,10 +296,10 @@
|
|
|
range: true,
|
|
|
value: dateArray,
|
|
|
ready: function(date){
|
|
|
- console.log(date); //得到初始的日期时间对象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
|
|
|
+ // console.log(date); //得到初始的日期时间对象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
|
|
|
},
|
|
|
change: function(value, date){
|
|
|
- console.log('date: ', date);
|
|
|
+ // console.log('date: ', date);
|
|
|
|
|
|
}
|
|
|
});
|
|
@@ -470,7 +471,7 @@
|
|
|
"indicators": [...indicators],
|
|
|
"timeType": timeType,
|
|
|
"startTime": startTime,
|
|
|
- "endTime": endTime
|
|
|
+ "endTime": endTime,
|
|
|
})
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
@@ -526,15 +527,20 @@
|
|
|
alert('请填写eci')
|
|
|
return;
|
|
|
}
|
|
|
- if (searchType === 'AREA' && tree.getChecked('Id1').length === 0) {
|
|
|
+ if ((searchType === 'AREA' || searchType === 'AGG') && tree.getChecked('Id1').length === 0) {
|
|
|
alert('请选择地市')
|
|
|
return;
|
|
|
}
|
|
|
+ const timeType = $('#timeType').val()
|
|
|
+ if (searchType === 'AGG' && !(timeType === 'DAY' || timeType === 'HOUR')) {
|
|
|
+ alert('汇聚只有天和小时粒度')
|
|
|
+ return
|
|
|
+ }
|
|
|
const checkData1 = tree.getChecked('Id1')?.[0]?.children;
|
|
|
let lte
|
|
|
let nblte
|
|
|
let includeOther = false
|
|
|
- checkData1.forEach?.(t => {
|
|
|
+ checkData1?.forEach?.(t => {
|
|
|
if (t?.id === 'LTE') {
|
|
|
lte = t
|
|
|
}
|
|
@@ -545,21 +551,21 @@
|
|
|
includeOther = true
|
|
|
}
|
|
|
})
|
|
|
- console.log(lte)
|
|
|
- console.log(nblte)
|
|
|
+ // console.log(lte)
|
|
|
+ // console.log(nblte)
|
|
|
const lteQuxians = new Set()
|
|
|
let lteCitys = new Set()
|
|
|
- lte?.children.forEach?.(eee => {
|
|
|
+ lte?.children?.forEach?.(eee => {
|
|
|
lteCitys.add(eee.title)
|
|
|
- eee?.children.forEach?.(ee => {
|
|
|
+ eee?.children?.forEach?.(ee => {
|
|
|
lteQuxians.add(ee.title)
|
|
|
})
|
|
|
})
|
|
|
const nblteQuxians = new Set()
|
|
|
let nblteCitys = new Set()
|
|
|
- nblte?.children.forEach?.(eee => {
|
|
|
+ nblte?.children?.forEach?.(eee => {
|
|
|
nblteCitys.add(eee.title)
|
|
|
- eee?.children.forEach?.(ee => {
|
|
|
+ eee?.children?.forEach?.(ee => {
|
|
|
nblteQuxians.add(ee.title)
|
|
|
})
|
|
|
})
|
|
@@ -573,12 +579,11 @@
|
|
|
checkData2= tree.getChecked('Id4')?.[0]?.children ;
|
|
|
}
|
|
|
const indicators = new Set();
|
|
|
- checkData2.forEach(eee => {
|
|
|
- eee.children.forEach(ee => {
|
|
|
+ checkData2?.forEach?.(eee => {
|
|
|
+ eee.children?.forEach?.(ee => {
|
|
|
indicators.add(ee.id)
|
|
|
})
|
|
|
});
|
|
|
- let timeType = $('#timeType').val()
|
|
|
let sdate = $('#time1').val()
|
|
|
const [startTime, endTime] = sdate.split(' - ')
|
|
|
renderTable(includeOther, condition, searchType, table, lteCitys, lteQuxians, nblteCitys, nblteQuxians,
|
|
@@ -613,8 +618,8 @@
|
|
|
return
|
|
|
}
|
|
|
const indicators = new Set()
|
|
|
- checkedData.forEach(eee => {
|
|
|
- eee.children.forEach(ee => {
|
|
|
+ checkedData?.forEach?.(eee => {
|
|
|
+ eee.children?.forEach?.(ee => {
|
|
|
indicators.add(ee.id)
|
|
|
})
|
|
|
});
|
|
@@ -644,24 +649,25 @@
|
|
|
// 修改指标模板
|
|
|
var templateId;
|
|
|
function editTemplate() {
|
|
|
- console.log('xiugai')
|
|
|
+ // console.log('xiugai')
|
|
|
const checkedData = tree?.getChecked('Id3')?.[0]?.children
|
|
|
- console.log('checkedData: ', checkedData);
|
|
|
- if(!checkedData || checkedData.length <= 0){
|
|
|
+ // console.log('checkedData: ', checkedData);
|
|
|
+ if (!checkedData || checkedData.length <= 0) {
|
|
|
alert('请选择要修改的指标模板!')
|
|
|
return
|
|
|
- }else if(checkedData.length > 1){
|
|
|
+ }
|
|
|
+ if (checkedData.length > 1) {
|
|
|
alert('请选择一个要修改的指标模板!')
|
|
|
return
|
|
|
- }else{
|
|
|
- layer.open({
|
|
|
+ }
|
|
|
+ layer.open({
|
|
|
type: 1,
|
|
|
- title:"修改指标模板",
|
|
|
+ title: "修改指标模板",
|
|
|
content: $("#add-template"),
|
|
|
area: ['600px', '600px'],
|
|
|
btn: ['确定'],
|
|
|
shadeClose: true,
|
|
|
- success: function(layero, index){
|
|
|
+ success: function (layero, index) {
|
|
|
let data = checkedData[0].id;
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
@@ -673,10 +679,10 @@
|
|
|
templateId = r.data.id;
|
|
|
$('#templateName').val(r.data.templateName);
|
|
|
let arr = [];
|
|
|
- r.data.list.map(item=>{
|
|
|
+ r.data.list.map(item => {
|
|
|
arr.push(item.id)
|
|
|
})
|
|
|
- console.log('arr: ', arr);
|
|
|
+ // console.log('arr: ', arr);
|
|
|
tree.setChecked('Id2', arr)
|
|
|
return
|
|
|
}
|
|
@@ -684,7 +690,7 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- yes: function(index, layero){
|
|
|
+ yes: function (index, layero) {
|
|
|
const templateName = $('#templateName').val()
|
|
|
if (!templateName || templateName.length <= 0) {
|
|
|
alert('请输入模板名称!')
|
|
@@ -696,8 +702,8 @@
|
|
|
return
|
|
|
}
|
|
|
const indicators = new Set()
|
|
|
- checkedData.forEach(eee => {
|
|
|
- eee.children.forEach(ee => {
|
|
|
+ checkedData?.forEach?.(eee => {
|
|
|
+ eee.children?.forEach?.(ee => {
|
|
|
indicators.add(ee.id)
|
|
|
})
|
|
|
});
|
|
@@ -723,7 +729,6 @@
|
|
|
});
|
|
|
},
|
|
|
});
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
// 删除指标模板
|
|
@@ -734,7 +739,7 @@
|
|
|
return
|
|
|
}
|
|
|
const ids = new Set()
|
|
|
- checkedData.forEach(t => {
|
|
|
+ checkedData?.forEach?.(t => {
|
|
|
ids.add(t.id)
|
|
|
});
|
|
|
const dataJson = JSON.stringify({
|