|
@@ -165,6 +165,9 @@
|
|
|
>查看数据</el-link
|
|
>查看数据</el-link
|
|
|
>
|
|
>
|
|
|
</p>
|
|
</p>
|
|
|
|
|
+ <template v-if="item.alarm_count > 1">
|
|
|
|
|
+ <el-badge title="同类型报警次数" class="alarm_count" :value="item.alarm_count" />
|
|
|
|
|
+ </template>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -333,7 +336,7 @@ export default {
|
|
|
offset: 'r',
|
|
offset: 'r',
|
|
|
scrollbar: false,
|
|
scrollbar: false,
|
|
|
closeBtn: 0,
|
|
closeBtn: 0,
|
|
|
- area: ['350px', '600px'],
|
|
|
|
|
|
|
+ area: ['356px', '600px'],
|
|
|
content: $('#global_alarm_push'),
|
|
content: $('#global_alarm_push'),
|
|
|
cancel: () => {
|
|
cancel: () => {
|
|
|
this.layer_isOpen = false
|
|
this.layer_isOpen = false
|
|
@@ -469,7 +472,27 @@ export default {
|
|
|
// let hh = this.$dayjs(re_msg.occur_time).format('HH')
|
|
// let hh = this.$dayjs(re_msg.occur_time).format('HH')
|
|
|
// if (hh_keys.includes(hh)) return
|
|
// if (hh_keys.includes(hh)) return
|
|
|
// }
|
|
// }
|
|
|
- this.new_alarm_list.unshift(re_msg)
|
|
|
|
|
|
|
+ // this.new_alarm_list.unshift(re_msg)
|
|
|
|
|
+ let new_re_msg = _.cloneDeep(re_msg)
|
|
|
|
|
+ new_re_msg.alarm_count = 1
|
|
|
|
|
+ let target_data = this.new_alarm_list.find(item => {
|
|
|
|
|
+ return item.up == re_msg.up && item.tag == re_msg.tag && item.type == re_msg.type
|
|
|
|
|
+ })
|
|
|
|
|
+ if (target_data) {
|
|
|
|
|
+ target_data.alarm_count += 1
|
|
|
|
|
+ let target_data_unix = this.$dayjs(target_data.occur_time).valueOf()
|
|
|
|
|
+ let re_msg_unix = this.$dayjs(re_msg.occur_time).valueOf()
|
|
|
|
|
+ // 同类型报警,取最新一条报警的内容展示
|
|
|
|
|
+ if (target_data_unix < re_msg_unix) {
|
|
|
|
|
+ for (let key in re_msg) {
|
|
|
|
|
+ if (key != 'alarm_count') {
|
|
|
|
|
+ target_data[key] = re_msg[key]
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.new_alarm_list.unshift(new_re_msg)
|
|
|
|
|
+ }
|
|
|
if ('sunroof' in re_msg) {
|
|
if ('sunroof' in re_msg) {
|
|
|
if (re_msg.sunroof == 1) return
|
|
if (re_msg.sunroof == 1) return
|
|
|
}
|
|
}
|