|
|
@@ -29,24 +29,39 @@
|
|
|
|
|
|
<el-dialog :visible.sync="alarmDialog" title="报警信息" append-to-body>
|
|
|
<!-- @look="handleClick" -->
|
|
|
- <more-infos :columns="tableColumns" :table-data="alarmData" :pagination="pagination" :total="alarmTotal" @size-change="handleSizeChange" @curr-change="handleCurrentChange" @confirm="handleClick">
|
|
|
+ <more-infos
|
|
|
+ :columns="tableColumns"
|
|
|
+ :table-data="alarmData"
|
|
|
+ :pagination="pagination"
|
|
|
+ :total="alarmTotal"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @curr-change="handleCurrentChange"
|
|
|
+ @confirm="handleClick"
|
|
|
+ >
|
|
|
<template slot="filters">
|
|
|
<el-row type="flex" align="middle" :gutter="10">
|
|
|
- <el-col :span="5" style="display: flex; justify-content:flex-start; align-items:center;">
|
|
|
+ <el-col :span="5" style="display: flex; justify-content: flex-start; align-items: center">
|
|
|
<span style="width: 45px">类型</span>
|
|
|
<el-select v-model="filter.warnType" style="width: 120px" size="small" clearable>
|
|
|
<el-option v-for="type in types" :key="type.ccode" :value="type.ccode" :label="type.cname" />
|
|
|
</el-select>
|
|
|
</el-col>
|
|
|
- <el-col :span="5" style="display: flex; justify-content:flex-start; align-items:center;">
|
|
|
+ <el-col :span="5" style="display: flex; justify-content: flex-start; align-items: center">
|
|
|
<span style="width: 45px">状态:</span>
|
|
|
<el-select v-model="filter.isconfirm" style="width: 120px" size="small">
|
|
|
<el-option v-for="option in options" :key="option.value" :value="option.value" :label="option.label" />
|
|
|
</el-select>
|
|
|
</el-col>
|
|
|
- <el-col :span="12" style="display: flex; justify-content:flex-start; align-items:center;">
|
|
|
+ <el-col :span="12" style="display: flex; justify-content: flex-start; align-items: center">
|
|
|
<span style="width: 45px">时间:</span>
|
|
|
- <el-date-picker v-model="filter.timeRange" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" size="small" />
|
|
|
+ <el-date-picker
|
|
|
+ v-model="filter.timeRange"
|
|
|
+ type="datetimerange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
</el-col>
|
|
|
<el-col :span="2">
|
|
|
<el-button size="small" type="primary" @click="clickAlarmData">查询</el-button>
|
|
|
@@ -202,18 +217,18 @@ export default {
|
|
|
this.clear()
|
|
|
},
|
|
|
created() {
|
|
|
- this.dataRefreh()
|
|
|
- this.getWarnType()
|
|
|
+ // this.dataRefreh()
|
|
|
+ // this.getWarnType()
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getTableData()
|
|
|
+ // this.getTableData()
|
|
|
// this.getAlarmData()
|
|
|
- window.onresize = () => {
|
|
|
- return (() => {
|
|
|
- this.getTableHeight()
|
|
|
- })()
|
|
|
- }
|
|
|
- this.getTableHeight()
|
|
|
+ // window.onresize = () => {
|
|
|
+ // return (() => {
|
|
|
+ // this.getTableHeight()
|
|
|
+ // })()
|
|
|
+ // }
|
|
|
+ // this.getTableHeight()
|
|
|
},
|
|
|
methods: {
|
|
|
/**
|
|
|
@@ -221,7 +236,7 @@ export default {
|
|
|
*/
|
|
|
getWarnType() {
|
|
|
// 转入外部流程
|
|
|
- getCodeParent({ pCid: '845' }).then(res => {
|
|
|
+ getCodeParent({ pCid: '845' }).then((res) => {
|
|
|
const data = res.result
|
|
|
this.types = this.getCodeOf(data, 845)
|
|
|
})
|
|
|
@@ -231,7 +246,7 @@ export default {
|
|
|
* @description 筛选码表数据
|
|
|
*/
|
|
|
getCodeOf(data, id) {
|
|
|
- const code = data.filter(val => {
|
|
|
+ const code = data.filter((val) => {
|
|
|
return val.id === id
|
|
|
})
|
|
|
return code[0].codeList
|
|
|
@@ -250,10 +265,10 @@ export default {
|
|
|
// Object.assign(query, that.filter)
|
|
|
const query = { current: 1, size: 10, isconfirm: '0' }
|
|
|
console.log('首页报警10调:' + JSON.stringify(query))
|
|
|
- alarmList(query).then(res => {
|
|
|
+ alarmList(query).then((res) => {
|
|
|
console.log(res)
|
|
|
if (res.code !== -1) {
|
|
|
- res.result.records.forEach((item, index) => item.order = index + 1)
|
|
|
+ res.result.records.forEach((item, index) => (item.order = index + 1))
|
|
|
that.tableData = res.result.records
|
|
|
}
|
|
|
})
|
|
|
@@ -271,7 +286,8 @@ export default {
|
|
|
|
|
|
// 追加分页参数
|
|
|
const query = {
|
|
|
- current: this.pagination.current, size: that.pagination.size
|
|
|
+ current: this.pagination.current,
|
|
|
+ size: that.pagination.size
|
|
|
}
|
|
|
that.postProblems.warnType = that.filter.warnType
|
|
|
that.postProblems.isconfirm = that.filter.isconfirm
|
|
|
@@ -280,10 +296,12 @@ export default {
|
|
|
Object.assign(query, that.postProblems)
|
|
|
console.log('page参数:' + JSON.stringify(query))
|
|
|
|
|
|
- alarmList(query).then(res => {
|
|
|
+ alarmList(query).then((res) => {
|
|
|
console.log(res)
|
|
|
if (res.code !== -1) {
|
|
|
- res.result.records.forEach((item, index) => item.order = ((that.pagination.current - 1) * that.pagination.size) + index + 1)
|
|
|
+ res.result.records.forEach(
|
|
|
+ (item, index) => (item.order = (that.pagination.current - 1) * that.pagination.size + index + 1)
|
|
|
+ )
|
|
|
that.alarmData = res.result.records
|
|
|
that.alarmTotal = res.result.total
|
|
|
}
|
|
|
@@ -304,7 +322,7 @@ export default {
|
|
|
const _loginId = this.$store.state.user.userId // 登录账号编号
|
|
|
|
|
|
const query = { id: _loginId, wanrIds: _id }
|
|
|
- handleWarn(query).then(res => {
|
|
|
+ handleWarn(query).then((res) => {
|
|
|
console.log(res)
|
|
|
if (res.code !== -1) {
|
|
|
console.log('确认成功')
|
|
|
@@ -338,8 +356,8 @@ export default {
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * @description 计算开始、结束时间
|
|
|
- */
|
|
|
+ * @description 计算开始、结束时间
|
|
|
+ */
|
|
|
getDateDiff() {
|
|
|
if (this.arrayIsNull(this.filter.timeRange)) {
|
|
|
this.postProblems.startTime = ''
|
|
|
@@ -387,17 +405,16 @@ export default {
|
|
|
* @description 判断数组是否为空
|
|
|
*/
|
|
|
arrayIsNull(aryList) {
|
|
|
- return (typeof (aryList) === 'undefined' || aryList == null || aryList.length == 0)
|
|
|
+ return typeof aryList === 'undefined' || aryList == null || aryList.length == 0
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- // 去除自定义表格header和body不对其方式
|
|
|
- .userTable{
|
|
|
- width: 100%;
|
|
|
- position:absolute;
|
|
|
- }
|
|
|
+// 去除自定义表格header和body不对其方式
|
|
|
+.userTable {
|
|
|
+ width: 100%;
|
|
|
+ position: absolute;
|
|
|
+}
|
|
|
</style>
|