Commit a45ce5d9 by zhangxw

跳转 防拆报警修改

1 parent 794cb2fb
<template>
<div class="">
<div class="alarm">
<div class="page_title alarm-title">
<div>
......@@ -86,11 +86,11 @@ export default {
},
data() {
return {
searchForm: { dealStatus: "", alarmLevel: "", date: new Date() },
searchForm: { dealStatus: "", alarmLevel: "", date: moment().subtract(1, "days") },
loading: false,
offPickerOptions: {
disabledDate(time){
return time.getTime() > new Date()
return time.getTime() > new Date(new Date()-24*60*60*1000)
}},
filterVisible: false,
orgInfo: {},
......@@ -98,7 +98,7 @@ export default {
columnList: [
{ label: "业务工单号/姓名/设备号/车架号", prop: "workOrderNo", formatter :row => {return this.filterText(row, ['workOrderNo', 'ownerName', 'deviceNoes', 'vin'], '/')} },
{ label: "警情等级", prop: "alarmLevel", width:"100", formatter: row => {return `${row.alarmLevel}级`} },
{ label: "报警说明&建议", prop: "ownerName", formatter: row => {return this.filterText(row, ['alarmExplain', 'alarmSuggest'], '&')} },
{ label: "报警说明&建议", prop: "ownerName", formatter: row => {return this.filterText(row, ['alarmExplain', 'alarmSuggest'], '\n', true)} },
{ label: "处理状态", prop: "dealStatus", width: "100", formatter: row => { return this.filterText(row) } },
],
GET_ALARM_LIST,
......@@ -128,7 +128,7 @@ export default {
pickDay(num) {
let date = moment(this.searchForm.date);
if (num === 1) {
if (moment().format("YYYY-MM-DD") == date.format("YYYY-MM-DD")) return;
if (moment().subtract(1, "days").format("YYYY-MM-DD") == date.format("YYYY-MM-DD")) return;
this.searchForm.date = date.add(1, "days");
} else if (num === -1) {
this.searchForm.date = date.subtract(1, "days");
......@@ -141,12 +141,13 @@ export default {
},
// 字段处理
filterText(row, filedList, type) {
filterText(row, filedList, type, hasLabel) {
let statusText = ['--', '已处理', '未处理']
if (!filedList) return statusText[row.dealStatus || 0]
let textResult = []
filedList.map(val => {
textResult.push(row[val] || '--')
let label = ['说明', '建议']
filedList.map((val, index) => {
textResult.push(hasLabel ? `<span style="overflow: hidden;text-overflow: ellipsis; white-space: nowrap;margin: 5px 0;">${label[index] + ':' + (row[val] || '--')}</span>` : `${(row[val] || '--')}`)
})
return textResult.join(` ${type} `)
},
......@@ -231,3 +232,14 @@ export default {
}
}
</style>
<style lang="scss">
.alarm{
.table_box{
.el-table{
.cell{
white-space: pre-line;
}
}
}
}
</style>
\ No newline at end of file
......@@ -504,7 +504,9 @@ export default {
},
// 跳转通用防拆报警(断电报警数据)
goTamper() {
let path = `#/alarmCenter/tamper?vin=${this.detailInfo.vin}&alarmType=1`;
let o = this.detailInfo;
let wiredSn = o.wiredSns && o.wiredSns[0] && o.wiredSns[0].sn // 第一个有线设备类型的 设备号
let path = `#/alarmCenter/tamper?sn=${wiredSn}&alarmType=1`;
// window.open(path)
var newwindow = window.open('_blank');
newwindow.location = path;
......
......@@ -101,10 +101,10 @@ export default {
data() {
return {
searchForm: {
alarmStatus: this.$route.query.alarmType && this.$route.query.vin ? '' : 1, // 从警情研判详情跳转进入 展示全部
alarmStatus: this.$route.query.alarmType && this.$route.query.sn ? '' : 1, // 从警情研判详情跳转进入 展示全部
alarmType: this.$route.query.alarmType ? this.$route.query.alarmType : ""
},
vin: this.$route.query.vin ? this.$route.query.vin:null,
sn: this.$route.query.sn ? this.$route.query.sn:null,
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
......@@ -148,10 +148,10 @@ export default {
let query = this.$route.query;
let n = moment().format("YYYY-MM-DD");
this.$set(this.searchForm, "timeDate", [n, n]);
if (query.vin) {
this.$set(this.searchForm, "keywords", query.vin);
if (query.sn) {
this.$set(this.searchForm, "keywords", query.sn);
}
if (query.vin && query.alarmType) {
if (query.sn && query.alarmType) {
this.$set(this.searchForm, "timeDate", ['', '']);
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!