Commit 028c7772 by guoxuejian

故障数量统计

parent 1c34c412
......@@ -372,7 +372,7 @@
var map = new ol.Map({
target: 'map-container',
layers: [
new ol.layer.Tile({
id: "bla",
type: "raster",
......@@ -393,7 +393,7 @@
maxZoom: 20,
})
});
let stationMarker = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([109.989707717209782, 35.130936020636923])),
name: "国家电投澄城璞地光伏发电站",
......@@ -558,7 +558,7 @@
</div>
<!-- <div class="accumulated" id="aggregate-value">累计发电量:0万kWh</div> -->
</div>
<script type="text/javascript">
// 获取当前时间
......@@ -653,7 +653,7 @@
labelLine: {
show: false,
},
data: orderData
}
]
......@@ -686,10 +686,11 @@
// 获取当前月份天数
var days = getDays()[0] - getDays()[1];
console.log(days);
let daysList = [ '逆变器', '箱变', '汇流箱']
let daysList = ['逆变器', '箱变', '汇流箱']
let showDataList = Array(days).fill(0)
let emergencyOption = {
color: '#0079fe',
tooltip: {
......@@ -757,70 +758,70 @@
}
],
series: [
{
name: '危机',
type: 'bar',
itemStyle: {
normal: {
show: true,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#f7734e'
}, {
offset: 1,
color: '#e12945'
}]),
// barBorderRadius: 50,
borderWidth: 0,
}
},
zlevel: 2,
barWidth: '10%',
data: [8, 15, 10]
{
name: '危机',
type: 'bar',
itemStyle: {
normal: {
show: true,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#f7734e'
}, {
offset: 1,
color: '#e12945'
}]),
// barBorderRadius: 50,
borderWidth: 0,
}
},
zlevel: 2,
barWidth: '10%',
data: [0, 0, 0]
},
{
name: '紧急',
type: 'bar',
barWidth: '10%',
itemStyle: {
normal: {
show: true,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#96d668'
}, {
offset: 1,
color: '#01babc'
}]),
// barBorderRadius: 50,
borderWidth: 0,
}
},
zlevel: 2,
barGap: '100%',
data: [8, 17, 26]
name: '紧急',
type: 'bar',
barWidth: '10%',
itemStyle: {
normal: {
show: true,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#96d668'
}, {
offset: 1,
color: '#01babc'
}]),
// barBorderRadius: 50,
borderWidth: 0,
}
},
zlevel: 2,
barGap: '100%',
data: [0, 0, 0]
},
{
name: '一般',
type: 'bar',
barWidth: '10%',
itemStyle: {
normal: {
show: true,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#1a98f8'
}, {
offset: 1,
color: '#7049f0'
}]),
// barBorderRadius: 50,
borderWidth: 0,
}
},
zlevel: 2,
barGap: '100%',
data: [8, 17, 26]
name: '一般',
type: 'bar',
barWidth: '10%',
itemStyle: {
normal: {
show: true,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#1a98f8'
}, {
offset: 1,
color: '#7049f0'
}]),
// barBorderRadius: 50,
borderWidth: 0,
}
},
zlevel: 2,
barGap: '100%',
data: [0, 0, 0]
}
]
......@@ -1290,6 +1291,12 @@
repairFinish: 0,
}
const emergencyOptionData = {
'危机': [0, 0, 0],
'紧急': [0, 0, 0],
'一般': [0, 0, 0]
}
function uploadCompleteStatus() {
loadDataStatus.uploadCompleteStatus = true
$.ajax({
......@@ -1593,6 +1600,78 @@
});
}
function updateRepairOrderCountDataWithLevel() {
loadDataStatus.updateRepairOrderCountDataWithLevel = true
$.ajax({
type: "GET",
url: "/api/blade-repairRecord/repairRecord/getOrderTypeCount",
success: function (result) {
// [
// {
// "deviceType": "1",
// "count": 9,
// "alarmLevel": 7
// },
// {
// "deviceType": "3",
// "count": 2,
// "alarmLevel": 7
// },
// {
// "deviceType": "1",
// "count": 1,
// "alarmLevel": 8
// },
// {
// "deviceType": "1",
// "count": 1,
// "alarmLevel": 9
// }
// ]
// deviceType: 1 逆变器 3 箱变 0 汇流箱
// alarmLevel: 7 一般 8 紧急 9 危机
for (let key in emergencyOptionData) {
emergencyOptionData[key] = [0, 0, 0]
}
for (let i = 0; i < result.data.length; i++) {
let item = result.data[i]
let deviceType = item.deviceType
let alarmLevel = item.alarmLevel
let count = item.count
let deviceIdnexMap = {
"1": 0,// 逆变器
"3": 1,// 箱变
"0": 2,// 汇流箱
}
let alarmLevelIndexMap = {
// 7: 2,// 一般
// 8: 1,// 紧急
// 9: 0,// 危机
7: "一般",// 2
8: "紧急",// 1
9: "危机",// 0
}
emergencyOptionData[alarmLevelIndexMap[alarmLevel]][deviceIdnexMap[deviceType]] = count
}
console.log('updateRepairOrderData', result);
// 3 random numbers for test
// emergencyOption["series"][0]["data"] = [Math.floor(Math.random() * 10), Math.floor(Math.random() * 10), Math.floor(Math.random() * 10)]
// emergencyOption["series"][1]["data"] = [Math.floor(Math.random() * 10), Math.floor(Math.random() * 10), Math.floor(Math.random() * 10)]
// emergencyOption["series"][2]["data"] = [Math.floor(Math.random() * 10), Math.floor(Math.random() * 10), Math.floor(Math.random() * 10)]
emergencyOption["series"][0]["data"] = emergencyOptionData["危机"]
emergencyOption["series"][1]["data"] = emergencyOptionData["紧急"]
emergencyOption["series"][2]["data"] = emergencyOptionData["一般"]
emergencyChart.setOption(emergencyOption);
},
// 失败或者超时的回调函数
error: function (xhr, status, error) {
loadDataStatus.updateRepairOrderCountDataWithLevel = false
}
});
}
function updateRepairDayOrderData() {
loadDataStatus.updateRepairDayOrderData = true
$.ajax({
......@@ -1623,8 +1702,6 @@
});
}
function updateRepairWeekOrderData() {
loadDataStatus.updateRepairWeekOrderData = true
$.ajax({
......@@ -1649,8 +1726,6 @@
});
}
// 更新全部工单完成率
// api/blade-deviceAccount/deviceAccount/list?current=1&size=10
function updateAllOrdersFinishedRateData() {
......@@ -1693,6 +1768,7 @@
uploadDeviceAccountData: false,
updateInspectionMonthOrderData: false,
updateRepairMonthOrderData: false,
updateRepairOrderCountDataWithLevel: false,
updateInspectionDayOrderData: false,
updateRepairDayOrderData: false,
updateInspectionWeekOrderData: false,
......@@ -1712,6 +1788,8 @@
updateRepairMonthOrderData();
updateRepairOrderCountDataWithLevel();
updateInspectionDayOrderData();
updateRepairDayOrderData();
......@@ -1751,6 +1829,9 @@
if (!loadDataStatus.updateRepairMonthOrderData) {
updateRepairMonthOrderData()
}
if (!loadDataStatus.updateRepairOrderCountDataWithLevel) {
updateRepairOrderCountDataWithLevel()
}
// updateRepairMonthOrderData();
if (!loadDataStatus.updateInspectionDayOrderData) {
updateInspectionDayOrderData()
......
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