Commit fcc523a1 authored by cui's avatar cui

预警统计逻辑修改

parent 30c76b98
...@@ -2611,6 +2611,7 @@ def alarm_count_info(request): ...@@ -2611,6 +2611,7 @@ def alarm_count_info(request):
for sys in sysList: for sys in sysList:
for i in alarm_list_all: for i in alarm_list_all:
if sys in eval(i.alarm_system): if sys in eval(i.alarm_system):
if i not in new_list:
new_list.append(i) new_list.append(i)
alarm_list = new_list alarm_list = new_list
else: else:
...@@ -2620,6 +2621,8 @@ def alarm_count_info(request): ...@@ -2620,6 +2621,8 @@ def alarm_count_info(request):
sys_list = eval(alarm.alarm_system) sys_list = eval(alarm.alarm_system)
for sys in sys_list: for sys in sys_list:
sys = sys.decode('utf-8') sys = sys.decode('utf-8')
if sysList:
if sys in sysList:
if result.has_key(sys): if result.has_key(sys):
pass pass
else: else:
...@@ -2637,6 +2640,24 @@ def alarm_count_info(request): ...@@ -2637,6 +2640,24 @@ def alarm_count_info(request):
result[sys]['main_weekend'] += 1 result[sys]['main_weekend'] += 1
elif alarm.alarm_level == u'次要' and alarm.if_workday == u'4': elif alarm.alarm_level == u'次要' and alarm.if_workday == u'4':
result[sys]['normal_weekend'] += 1 result[sys]['normal_weekend'] += 1
else:
if result.has_key(sys):
pass
else:
result[sys] = {'bad_work': 0, 'main_work': 0, 'normal_work': 0,
'bad_weekend': 0, 'main_weekend': 0, 'normal_weekend': 0}
if alarm.alarm_level == u'严重' and alarm.if_workday == u'3':
result[sys]['bad_work'] += 1
elif alarm.alarm_level == u'主要' and alarm.if_workday == u'3':
result[sys]['main_work'] += 1
elif alarm.alarm_level == u'次要' and alarm.if_workday == u'3':
result[sys]['normal_work'] += 1
elif alarm.alarm_level == u'严重' and alarm.if_workday == u'4':
result[sys]['bad_weekend'] += 1
elif alarm.alarm_level == u'主要' and alarm.if_workday == u'4':
result[sys]['main_weekend'] += 1
elif alarm.alarm_level == u'次要' and alarm.if_workday == u'4':
result[sys]['normal_weekend'] += 1
data_list = [] data_list = []
for key,value in result.items(): for key,value in result.items():
total = 0 total = 0
......
...@@ -96,7 +96,6 @@ ...@@ -96,7 +96,6 @@
} }
} }
} }
console.log(finallist)
let newdata = { let newdata = {
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
...@@ -105,7 +104,8 @@ ...@@ -105,7 +104,8 @@
axios.post('${SITE_URL}alarm_count_info/', newdata).then(res => { axios.post('${SITE_URL}alarm_count_info/', newdata).then(res => {
this.AlarmCountData = res.data.results; this.AlarmCountData = res.data.results;
this.total = res.data.count this.total = res.data.count
}) });
console.log(this.AlarmCountData)
}, },
async listOut(){ async listOut(){
console.log(!this.AlarmCountData.length) console.log(!this.AlarmCountData.length)
......
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