Commit a45ce5d9 by zhangxw

跳转 防拆报警修改

1 parent 794cb2fb
<template> <template>
<div class=""> <div class="alarm">
<div class="page_title alarm-title"> <div class="page_title alarm-title">
<div> <div>
...@@ -86,11 +86,11 @@ export default { ...@@ -86,11 +86,11 @@ export default {
}, },
data() { data() {
return { return {
searchForm: { dealStatus: "", alarmLevel: "", date: new Date() }, searchForm: { dealStatus: "", alarmLevel: "", date: moment().subtract(1, "days") },
loading: false, loading: false,
offPickerOptions: { offPickerOptions: {
disabledDate(time){ disabledDate(time){
return time.getTime() > new Date() return time.getTime() > new Date(new Date()-24*60*60*1000)
}}, }},
filterVisible: false, filterVisible: false,
orgInfo: {}, orgInfo: {},
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
columnList: [ columnList: [
{ label: "业务工单号/姓名/设备号/车架号", prop: "workOrderNo", formatter :row => {return this.filterText(row, ['workOrderNo', 'ownerName', 'deviceNoes', 'vin'], '/')} }, { 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: "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) } }, { label: "处理状态", prop: "dealStatus", width: "100", formatter: row => { return this.filterText(row) } },
], ],
GET_ALARM_LIST, GET_ALARM_LIST,
...@@ -128,7 +128,7 @@ export default { ...@@ -128,7 +128,7 @@ export default {
pickDay(num) { pickDay(num) {
let date = moment(this.searchForm.date); let date = moment(this.searchForm.date);
if (num === 1) { 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"); this.searchForm.date = date.add(1, "days");
} else if (num === -1) { } else if (num === -1) {
this.searchForm.date = date.subtract(1, "days"); this.searchForm.date = date.subtract(1, "days");
...@@ -141,12 +141,13 @@ export default { ...@@ -141,12 +141,13 @@ export default {
}, },
// 字段处理 // 字段处理
filterText(row, filedList, type) { filterText(row, filedList, type, hasLabel) {
let statusText = ['--', '已处理', '未处理'] let statusText = ['--', '已处理', '未处理']
if (!filedList) return statusText[row.dealStatus || 0] if (!filedList) return statusText[row.dealStatus || 0]
let textResult = [] let textResult = []
filedList.map(val => { let label = ['说明', '建议']
textResult.push(row[val] || '--') 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} `) return textResult.join(` ${type} `)
}, },
...@@ -231,3 +232,14 @@ export default { ...@@ -231,3 +232,14 @@ export default {
} }
} }
</style> </style>
<style lang="scss">
.alarm{
.table_box{
.el-table{
.cell{
white-space: pre-line;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -504,7 +504,9 @@ export default { ...@@ -504,7 +504,9 @@ export default {
}, },
// 跳转通用防拆报警(断电报警数据) // 跳转通用防拆报警(断电报警数据)
goTamper() { 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) // window.open(path)
var newwindow = window.open('_blank'); var newwindow = window.open('_blank');
newwindow.location = path; newwindow.location = path;
......
...@@ -101,10 +101,10 @@ export default { ...@@ -101,10 +101,10 @@ export default {
data() { data() {
return { return {
searchForm: { 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 : "" 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, currentPage: 1,
pageSizes: [10, 20, 30, 40], pageSizes: [10, 20, 30, 40],
pageSize: 10, pageSize: 10,
...@@ -148,10 +148,10 @@ export default { ...@@ -148,10 +148,10 @@ export default {
let query = this.$route.query; let query = this.$route.query;
let n = moment().format("YYYY-MM-DD"); let n = moment().format("YYYY-MM-DD");
this.$set(this.searchForm, "timeDate", [n, n]); this.$set(this.searchForm, "timeDate", [n, n]);
if (query.vin) { if (query.sn) {
this.$set(this.searchForm, "keywords", query.vin); this.$set(this.searchForm, "keywords", query.sn);
} }
if (query.vin && query.alarmType) { if (query.sn && query.alarmType) {
this.$set(this.searchForm, "timeDate", ['', '']); 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!