Commit 028c7772 by guoxuejian

故障数量统计

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