feat: 优化报警状态显示,合并一级和二级报警为统一显示

This commit is contained in:
LokerL 2024-12-15 20:11:42 +08:00
parent 285df1f96b
commit e98809b93a
11 changed files with 119 additions and 149 deletions

View File

@ -53,10 +53,10 @@
</el-table-column>
<el-table-column prop="zt" label="报警状态" header-align="center" align="center">
<template slot-scope="scope">
<span v-if="scope.row.zt == '一级报警'" style="color: #c00808">
{{ scope.row.zt }}
<span v-if="scope.row.zt === '一级报警' || scope.row.zt === '二级报警'" style="color: #c00808">
报警
</span>
<span v-if="scope.row.zt == '二级报警'" style="color: #e23434">
<span v-else style="color: #000">
{{ scope.row.zt }}
</span>
</template>

View File

@ -28,13 +28,13 @@
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="dataList" height="700px">
<el-table-column prop="factoryName" label="安装企业" header-align="center" align="center" />
<el-table-column prop="name" label="设备名称" header-align="center" align="center" />
@ -56,10 +56,10 @@
</el-table-column>
<el-table-column prop="zt" label="报警状态" header-align="center" align="center">
<template slot-scope="scope">
<span v-if="scope.row.zt == '一级报警'" style="color: #c00808;">
{{ scope.row.zt }}
<span v-if="scope.row.zt === '一级报警' || scope.row.zt === '二级报警'" style="color: #c00808">
报警
</span>
<span v-if="scope.row.zt == '二级报警'" style="color: #e23434;">
<span v-else style="color: #000">
{{ scope.row.zt }}
</span>
</template>
@ -92,17 +92,17 @@
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!--发送通知-->
<send-msg :deviceInfo="deviceInfo" v-if="isOpenMsg" :isOpenMsg="isOpenMsg" @closeMsg="closeMsg"></send-msg>
<!--处理报警-->
<deal-alarm :deviceInfo="deviceInfo" v-if="isOpenAlarm" :isOpenAlarm="isOpenAlarm" @closeAlarm="closeAlarm"></deal-alarm>
</div>
</template>
<script>
import store from "@/store";
import { listAlarm } from "@/api/demostrate/monitor";
@ -147,7 +147,7 @@
factoryId:null,
},
userName: '',
};
},
created() {
@ -435,11 +435,10 @@
},
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
}
};
</script>

View File

@ -28,13 +28,13 @@
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="dataList" height="700px">
<el-table-column prop="factoryName" label="安装企业" header-align="center" align="center" />
<el-table-column prop="name" label="设备名称" header-align="center" align="center" />
@ -56,10 +56,10 @@
</el-table-column>
<el-table-column prop="zt" label="报警状态" header-align="center" align="center">
<template slot-scope="scope">
<span v-if="scope.row.zt == '一级报警'" style="color: #c00808;">
{{ scope.row.zt }}
<span v-if="scope.row.zt === '一级报警' || scope.row.zt === '二级报警'" style="color: #c00808">
报警
</span>
<span v-if="scope.row.zt == '二级报警'" style="color: #e23434;">
<span v-else style="color: #000">
{{ scope.row.zt }}
</span>
</template>
@ -92,17 +92,17 @@
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!--发送通知-->
<send-msg :deviceInfo="deviceInfo" v-if="isOpenMsg" :isOpenMsg="isOpenMsg" @closeMsg="closeMsg"></send-msg>
<!--处理报警-->
<deal-alarm :deviceInfo="deviceInfo" v-if="isOpenAlarm" :isOpenAlarm="isOpenAlarm" @closeAlarm="closeAlarm"></deal-alarm>
</div>
</template>
<script>
import store from "@/store";
import { listAlarm } from "@/api/demostrate/monitor";
@ -147,7 +147,7 @@
factoryId:null,
},
userName: '',
};
},
created() {
@ -435,11 +435,10 @@
},
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
}
};
</script>

View File

@ -28,7 +28,7 @@
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -56,10 +56,10 @@
</el-table-column>
<el-table-column prop="zt" label="报警状态" header-align="center" align="center">
<template slot-scope="scope">
<span v-if="scope.row.zt == '一级报警'" style="color: #c00808;">
{{ scope.row.zt }}
<span v-if="scope.row.zt === '一级报警' || scope.row.zt === '二级报警'" style="color: #c00808">
报警
</span>
<span v-if="scope.row.zt == '二级报警'" style="color: #e23434;">
<span v-else style="color: #000">
{{ scope.row.zt }}
</span>
</template>
@ -102,7 +102,7 @@
</div>
</template>
<script>
import store from "@/store";
import { listAlarm } from "@/api/demostrate/monitor";
@ -209,11 +209,10 @@ export default {
},
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
}
};
</script>

View File

@ -30,7 +30,7 @@
<el-table-column prop="sn" label="设备编号" header-align="center" align="center" />
<el-table-column prop="reportTime" label="上报时间" header-align="center" align="center" />
<!-- <el-table-column prop="wd" label="设备温度" header-align="center" align="center"/>-->
<el-table-column prop="power" label="设备电量" header-align="center" align="center"/>
<el-table-column prop="power" label="设备电量" header-align="center" align="center"/>
<el-table-column prop="zl" label="传感器类型" header-align="center" align="center" />
<el-table-column prop="lc" label="量程" header-align="center" align="center" />
<el-table-column prop="ds" label="传感器读数" header-align="center" align="center">
@ -45,20 +45,17 @@
</el-table-column>
<el-table-column prop="zt" label="报警状态" header-align="center" align="center">
<template slot-scope="scope">
<span v-if="scope.row.zt == '一级报警'" style="color: #c00808;">
<span v-if="scope.row.zt === '一级报警' || scope.row.zt === '二级报警'" style="color: #c00808">
报警
</span>
<span v-else style="color: #000">
{{ scope.row.zt }}
</span>
<span v-else-if="scope.row.zt == '二级报警'" style="color: #e23434;">
{{ scope.row.zt }}
</span>
<span v-else>
{{ scope.row.zt }}
</span>
</template>
</el-table-column>
<el-table-column prop="dbz" label="低报值" header-align="center" align="center" />
<el-table-column prop="gbz" label="高报值" header-align="center" align="center" />
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@ -66,7 +63,7 @@
</div>
</template>
<script>
import store from "@/store";
import { listAlarmHistory } from "@/api/demostrate/monitor";
@ -152,10 +149,9 @@ export default {
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
}
};
</script>

View File

@ -41,13 +41,10 @@
<el-table-column prop="zt" label="报警状态" header-align="center" align="center">
<template slot-scope="scope">
<span v-if="scope.row.zt == '一级报警'" style="color: #c00808;">
{{ scope.row.zt }}
<span v-if="scope.row.zt === '一级报警' || scope.row.zt === '二级报警'" style="color: #c00808">
报警
</span>
<span v-else-if="scope.row.zt == '二级报警'" style="color: #e23434;">
{{ scope.row.zt }}
</span>
<span v-else>
<span v-else style="color: #000">
{{ scope.row.zt }}
</span>
</template>

View File

@ -7,7 +7,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="设备编号">
<el-input v-model="queryParams.sn"></el-input>
</el-form-item>
@ -21,14 +21,14 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="dataList" height="600px">
<el-table-column prop="factoryName" label="安装企业" header-align="center" align="center" />
<el-table-column prop="sn" label="设备编号" header-align="center" align="center" />
<el-table-column prop="reportTime" label="上报时间" header-align="center" align="center" />
<!-- <el-table-column prop="wd" label="设备温度" header-align="center" align="center"/>-->
<el-table-column prop="power" label="设备电量" header-align="center" align="center"/>
<el-table-column prop="power" label="设备电量" header-align="center" align="center"/>
<el-table-column prop="zl" label="传感器类型" header-align="center" align="center" />
<el-table-column prop="lc" label="量程" header-align="center" align="center" />
<el-table-column prop="ds" label="传感器读数" header-align="center" align="center">
@ -43,28 +43,25 @@
</el-table-column>
<el-table-column prop="zt" label="报警状态" header-align="center" align="center">
<template slot-scope="scope">
<span v-if="scope.row.zt == '一级报警'" style="color: #c00808;">
<span v-if="scope.row.zt === '一级报警' || scope.row.zt === '二级报警'" style="color: #c00808">
报警
</span>
<span v-else style="color: #000">
{{ scope.row.zt }}
</span>
<span v-else-if="scope.row.zt == '二级报警'" style="color: #e23434;">
{{ scope.row.zt }}
</span>
<span v-else>
{{ scope.row.zt }}
</span>
</template>
</el-table-column>
<el-table-column prop="dbz" label="低报值" header-align="center" align="center" />
<el-table-column prop="gbz" label="高报值" header-align="center" align="center" />
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</div>
</template>
<script>
import store from "@/store";
import { listAlarmHistory } from "@/api/demostrate/monitor";
@ -90,7 +87,7 @@
endTime: null,
factoryId:null,
},
};
},
created() {
@ -149,7 +146,7 @@
this.loading = false;
this.total = 3389;
this.dataList=[ {
"sn": "ZABB6210850989ZA",
"isDeal": null,
"name": null,
@ -367,10 +364,9 @@
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
}
};
</script>

View File

@ -7,7 +7,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="设备编号">
<el-input v-model="queryParams.sn"></el-input>
</el-form-item>
@ -21,14 +21,14 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="dataList" height="600px">
<el-table-column prop="factoryName" label="安装企业" header-align="center" align="center" />
<el-table-column prop="sn" label="设备编号" header-align="center" align="center" />
<el-table-column prop="reportTime" label="上报时间" header-align="center" align="center" />
<!-- <el-table-column prop="wd" label="设备温度" header-align="center" align="center"/>-->
<el-table-column prop="power" label="设备电量" header-align="center" align="center"/>
<el-table-column prop="power" label="设备电量" header-align="center" align="center"/>
<el-table-column prop="zl" label="传感器类型" header-align="center" align="center" />
<el-table-column prop="lc" label="量程" header-align="center" align="center" />
<el-table-column prop="ds" label="传感器读数" header-align="center" align="center">
@ -43,28 +43,25 @@
</el-table-column>
<el-table-column prop="zt" label="报警状态" header-align="center" align="center">
<template slot-scope="scope">
<span v-if="scope.row.zt == '一级报警'" style="color: #c00808;">
<span v-if="scope.row.zt === '一级报警' || scope.row.zt === '二级报警'" style="color: #c00808">
报警
</span>
<span v-else style="color: #000">
{{ scope.row.zt }}
</span>
<span v-else-if="scope.row.zt == '二级报警'" style="color: #e23434;">
{{ scope.row.zt }}
</span>
<span v-else>
{{ scope.row.zt }}
</span>
</template>
</el-table-column>
<el-table-column prop="dbz" label="低报值" header-align="center" align="center" />
<el-table-column prop="gbz" label="高报值" header-align="center" align="center" />
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</div>
</template>
<script>
import store from "@/store";
import { listAlarmHistory } from "@/api/demostrate/monitor";
@ -90,7 +87,7 @@
endTime: null,
factoryId:null,
},
};
},
created() {
@ -366,10 +363,9 @@
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
}
};
</script>

View File

@ -7,7 +7,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="设备编号">
<el-input v-model="queryParams.sn"></el-input>
</el-form-item>
@ -21,14 +21,14 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="dataList" height="600px">
<el-table-column prop="factoryName" label="安装企业" header-align="center" align="center" />
<el-table-column prop="sn" label="设备编号" header-align="center" align="center" />
<el-table-column prop="reportTime" label="上报时间" header-align="center" align="center" />
<!-- <el-table-column prop="wd" label="设备温度" header-align="center" align="center"/>-->
<el-table-column prop="power" label="设备电量" header-align="center" align="center"/>
<el-table-column prop="power" label="设备电量" header-align="center" align="center"/>
<el-table-column prop="zl" label="传感器类型" header-align="center" align="center" />
<el-table-column prop="lc" label="量程" header-align="center" align="center" />
<el-table-column prop="ds" label="传感器读数" header-align="center" align="center">
@ -43,28 +43,25 @@
</el-table-column>
<el-table-column prop="zt" label="报警状态" header-align="center" align="center">
<template slot-scope="scope">
<span v-if="scope.row.zt == '一级报警'" style="color: #c00808;">
<span v-if="scope.row.zt === '一级报警' || scope.row.zt === '二级报警'" style="color: #c00808">
报警
</span>
<span v-else style="color: #000">
{{ scope.row.zt }}
</span>
<span v-else-if="scope.row.zt == '二级报警'" style="color: #e23434;">
{{ scope.row.zt }}
</span>
<span v-else>
{{ scope.row.zt }}
</span>
</template>
</el-table-column>
<el-table-column prop="dbz" label="低报值" header-align="center" align="center" />
<el-table-column prop="gbz" label="高报值" header-align="center" align="center" />
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</div>
</template>
<script>
import store from "@/store";
import { listAlarmHistory } from "@/api/demostrate/monitor";
@ -90,7 +87,7 @@
endTime: null,
factoryId:null,
},
};
},
created() {
@ -366,10 +363,9 @@
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
}
};
</script>

View File

@ -7,7 +7,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="设备编号">
<el-input v-model="queryParams.sn"></el-input>
</el-form-item>
@ -21,14 +21,14 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="dataList" height="600px">
<el-table-column prop="factoryName" label="安装企业" header-align="center" align="center" />
<el-table-column prop="sn" label="设备编号" header-align="center" align="center" />
<el-table-column prop="reportTime" label="上报时间" header-align="center" align="center" />
<!-- <el-table-column prop="wd" label="设备温度" header-align="center" align="center"/>-->
<el-table-column prop="power" label="设备电量" header-align="center" align="center"/>
<el-table-column prop="power" label="设备电量" header-align="center" align="center"/>
<el-table-column prop="zl" label="传感器类型" header-align="center" align="center" />
<el-table-column prop="lc" label="量程" header-align="center" align="center" />
<el-table-column prop="ds" label="传感器读数" header-align="center" align="center">
@ -43,28 +43,25 @@
</el-table-column>
<el-table-column prop="zt" label="报警状态" header-align="center" align="center">
<template slot-scope="scope">
<span v-if="scope.row.zt == '一级报警'" style="color: #c00808;">
<span v-if="scope.row.zt === '一级报警' || scope.row.zt === '二级报警'" style="color: #c00808">
报警
</span>
<span v-else style="color: #000">
{{ scope.row.zt }}
</span>
<span v-else-if="scope.row.zt == '二级报警'" style="color: #e23434;">
{{ scope.row.zt }}
</span>
<span v-else>
{{ scope.row.zt }}
</span>
</template>
</el-table-column>
<el-table-column prop="dbz" label="低报值" header-align="center" align="center" />
<el-table-column prop="gbz" label="高报值" header-align="center" align="center" />
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</div>
</template>
<script>
import store from "@/store";
import { listAlarmHistory } from "@/api/demostrate/monitor";
@ -90,7 +87,7 @@
endTime: null,
factoryId:null,
},
};
},
created() {
@ -149,7 +146,7 @@
this.loading = false;
this.total = 3389;
this.dataList=[ {
"sn": "ZABB6210850989ZA",
"isDeal": null,
"name": null,
@ -367,10 +364,9 @@
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
}
};
</script>

View File

@ -7,7 +7,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="设备编号">
<el-input v-model="queryParams.sn"></el-input>
</el-form-item>
@ -21,14 +21,14 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="dataList" height="600px">
<el-table-column prop="factoryName" label="安装企业" header-align="center" align="center" />
<el-table-column prop="sn" label="设备编号" header-align="center" align="center" />
<el-table-column prop="reportTime" label="上报时间" header-align="center" align="center" />
<!-- <el-table-column prop="wd" label="设备温度" header-align="center" align="center"/>-->
<el-table-column prop="power" label="设备电量" header-align="center" align="center"/>
<el-table-column prop="power" label="设备电量" header-align="center" align="center"/>
<el-table-column prop="zl" label="传感器类型" header-align="center" align="center" />
<el-table-column prop="lc" label="量程" header-align="center" align="center" />
<el-table-column prop="ds" label="传感器读数" header-align="center" align="center">
@ -43,28 +43,25 @@
</el-table-column>
<el-table-column prop="zt" label="报警状态" header-align="center" align="center">
<template slot-scope="scope">
<span v-if="scope.row.zt == '一级报警'" style="color: #c00808;">
<span v-if="scope.row.zt === '一级报警' || scope.row.zt === '二级报警'" style="color: #c00808">
报警
</span>
<span v-else style="color: #000">
{{ scope.row.zt }}
</span>
<span v-else-if="scope.row.zt == '二级报警'" style="color: #e23434;">
{{ scope.row.zt }}
</span>
<span v-else>
{{ scope.row.zt }}
</span>
</template>
</el-table-column>
<el-table-column prop="dbz" label="低报值" header-align="center" align="center" />
<el-table-column prop="gbz" label="高报值" header-align="center" align="center" />
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</div>
</template>
<script>
import store from "@/store";
import { listAlarmHistory } from "@/api/demostrate/monitor";
@ -90,7 +87,7 @@
endTime: null,
factoryId:null,
},
};
},
created() {
@ -366,10 +363,9 @@
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
}
};
</script>