提交: pc 端 开放 告警预警记录 处理 以及创建工单权限
This commit is contained in:
parent
650d3fe4ec
commit
2e6eac7cc4
|
@ -60,3 +60,13 @@ export function addAlarmRecord(data) {
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 处理报警记录
|
||||||
|
export function handlerRecord(data) {
|
||||||
|
return request({
|
||||||
|
url: '/iot/record/batch-update',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -1,206 +0,0 @@
|
||||||
<template>
|
|
||||||
<!-- 告警记录功能 -->
|
|
||||||
<div class="app-container alarm-record">
|
|
||||||
<el-form
|
|
||||||
:model="queryParams"
|
|
||||||
ref="queryForm"
|
|
||||||
:inline="true"
|
|
||||||
v-show="showSearch"
|
|
||||||
label-width="68px"
|
|
||||||
>
|
|
||||||
<el-form-item label="报警时间" prop="alarmTime">
|
|
||||||
<el-date-picker
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
v-model="queryParams.alarmTime"
|
|
||||||
type="date"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
placeholder="选择报警时间"
|
|
||||||
></el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="告警类型" prop="typeName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.typeName"
|
|
||||||
placeholder="请输入告警类型"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</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-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['iot:record:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="recordList">
|
|
||||||
<el-table-column type="index" label="序号" align="center" :index="indexFormatter" width="80px"></el-table-column>
|
|
||||||
<el-table-column label="设备名称" align="left" width="200px" prop="deviceName" />
|
|
||||||
<el-table-column label="设备当前值" align="left" width="200px" prop="currentValue" />
|
|
||||||
<el-table-column label="推送内容" align="left" prop="alarmContent" />
|
|
||||||
<el-table-column label="报警时间" align="center" prop="alarmTime" width="120">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.alarmTime, '{y}-{m}-{d}') }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="处理状态" width="100px" align="center" prop="processStatus">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ stateFormatter(scope.row) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="处理结果" align="left" width="150px" prop="processResult" />
|
|
||||||
<el-table-column label="处理时间" align="center" prop="processTime" width="120">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.processTime, '{y}-{m}-{d}') }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="告警类型" align="left" width="150px" prop="typeName" />
|
|
||||||
<!-- <el-table-column label="类型编码" align="left" width="150px" prop="typeCode" /> -->
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
listRecord,
|
|
||||||
getRecord,
|
|
||||||
exportRecord
|
|
||||||
} from "@/api/alarm/record";
|
|
||||||
import Editor from "@/components/Editor";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "Record",
|
|
||||||
components: {
|
|
||||||
Editor
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 报警记录表格数据
|
|
||||||
recordList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
typeName: null,
|
|
||||||
typeCode: null,
|
|
||||||
alarmDivide: 'ALARM'
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
stateFormatter(val) {
|
|
||||||
switch (val.processStatus) {
|
|
||||||
case '1':
|
|
||||||
return '已处理';
|
|
||||||
|
|
||||||
case '0':
|
|
||||||
return '未处理11';
|
|
||||||
|
|
||||||
case '2':
|
|
||||||
return '误报';
|
|
||||||
|
|
||||||
default:
|
|
||||||
return '未处理'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
indexFormatter(val) {
|
|
||||||
return (
|
|
||||||
val + 1 + (this.queryParams.pageNum - 1) * this.queryParams.pageSize
|
|
||||||
);
|
|
||||||
},
|
|
||||||
/** 查询报警记录列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listRecord(this.queryParams).then(response => {
|
|
||||||
this.recordList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 根据id获取记录详情
|
|
||||||
getRecordInfo(id) {
|
|
||||||
getRecord(id).then(res => {
|
|
||||||
this.form = res.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = `告警记录详情`;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
const queryParams = this.queryParams;
|
|
||||||
this.$confirm("是否确认导出所有报警记录数据项?", "警告", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning"
|
|
||||||
})
|
|
||||||
.then(function() {
|
|
||||||
return exportRecord(queryParams);
|
|
||||||
})
|
|
||||||
.then(response => {
|
|
||||||
this.download(response.msg);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
|
@ -1,412 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container alarm-type">
|
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
|
||||||
<!-- <el-form-item label="编码" prop="typeCode">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.typeCode"
|
|
||||||
placeholder="请输入报警类型编码"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>-->
|
|
||||||
<el-form-item label="标签">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.tag"
|
|
||||||
placeholder="请输入报警标签"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="名称" prop="typeName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.typeName"
|
|
||||||
placeholder="请输入报警类型名称"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</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-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['iot:type:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<!-- <el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['iot:type:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col> -->
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['iot:type:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<!-- <el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['iot:type:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col> -->
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table
|
|
||||||
v-loading="loading"
|
|
||||||
@sort-change="sortChange"
|
|
||||||
:data="alarmTypeList"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="编码" align="center" sortable="custom" prop="typeCode" />
|
|
||||||
<el-table-column label="名称" align="center" sortable="custom" prop="typeName" />
|
|
||||||
<el-table-column label="设备类型" align="center" prop="deviceTypeName" />
|
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span v-if="scope.row.status === 1">启用</span>
|
|
||||||
<span v-else>关闭</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="200" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
v-if="scope.row.tenantId === tenantId"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['iot:type:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-if="scope.row.tenantId === tenantId"
|
|
||||||
v-hasPermi="['iot:type:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改告警类型对话框 -->
|
|
||||||
<el-dialog class="eldialog-wrap" :close-on-click-modal="false" :title="title" :visible.sync="open" width="500px" >
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="名称" prop="typeName">
|
|
||||||
<el-input v-model="form.typeName" placeholder="请输入报警类型名称" />
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="编码" prop="typeCode">
|
|
||||||
<el-input v-model="form.typeCode" placeholder="请输入编码" />
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="标签" prop="tag">
|
|
||||||
<el-input v-model="form.tag" placeholder="请输入标签" />
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="设备类型" prop="deviceType">
|
|
||||||
<el-select
|
|
||||||
v-model="form.deviceType"
|
|
||||||
style="width: 100%;"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入报警设备类型"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="(keys, vals) in deviceTypeList"
|
|
||||||
:label="keys"
|
|
||||||
:value="vals"
|
|
||||||
:key="vals"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="状态">
|
|
||||||
<el-switch
|
|
||||||
v-model="form.status"
|
|
||||||
active-color="#13ce66"
|
|
||||||
inactive-color="#dad5d5"
|
|
||||||
active-value="1"
|
|
||||||
inactive-value="0"
|
|
||||||
></el-switch>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button size="mini" type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button size="mini" @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
listAlarmType,
|
|
||||||
getAlarmType,
|
|
||||||
delAlarmType,
|
|
||||||
addAlarmType,
|
|
||||||
updateAlarmType
|
|
||||||
} from "@/api/alarm/alarmType";
|
|
||||||
import { listDeviceTypeList } from "@/api/iot/device";
|
|
||||||
// import { selectedProdmodel } from "@/api/device/prodmodel";
|
|
||||||
export default {
|
|
||||||
name: "AlarmType",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 告警类型表格数据
|
|
||||||
alarmTypeList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
typeCode: undefined,
|
|
||||||
typeName: undefined,
|
|
||||||
tag: undefined,
|
|
||||||
orderByColumn: "",
|
|
||||||
isAsc: "desc"
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
typeName: [
|
|
||||||
{ required: true, message: "类型名称不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
tag: [{ required: true, message: "告警标签不能为空", trigger: "blur" }]
|
|
||||||
},
|
|
||||||
tenantId: "",
|
|
||||||
deviceTypeList: []
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.tenantId = this.$store.getters.tenantId;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 查询设备类型列表
|
|
||||||
getDeviceTypeList() {
|
|
||||||
listDeviceTypeList().then(response => {
|
|
||||||
this.deviceTypeList = response.data;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
sortChange(column) {
|
|
||||||
const sort = {
|
|
||||||
isAsc: column.order === "descending" ? "desc" : "asc",
|
|
||||||
orderByColumn: column.prop
|
|
||||||
};
|
|
||||||
this.queryParams = Object.assign(this.queryParams, sort);
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 获取物模型列表
|
|
||||||
getModelList() {
|
|
||||||
// selectedProdmodel().then(res => {
|
|
||||||
// this.deviceTypeList = res.data;
|
|
||||||
// });
|
|
||||||
},
|
|
||||||
/** 查询告警类型列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listAlarmType(this.queryParams).then(response => {
|
|
||||||
this.alarmTypeList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
deviceType: undefined,
|
|
||||||
typeCode: undefined,
|
|
||||||
typeName: undefined,
|
|
||||||
status: "1",
|
|
||||||
tag: ""
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.typeId);
|
|
||||||
this.single = selection.length != 1;
|
|
||||||
this.multiple = !selection.length;
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.getDeviceTypeList();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加告警类型";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
this.getDeviceTypeList();
|
|
||||||
const typeId = row.typeId || this.ids;
|
|
||||||
getAlarmType(typeId).then(response => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.form.status = response.data.status.toString();
|
|
||||||
this.title = "修改告警类型";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm: function() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.typeId != undefined) {
|
|
||||||
updateAlarmType(this.form).then(response => {
|
|
||||||
if (response.code === 200) {
|
|
||||||
this.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addAlarmType(this.form).then(response => {
|
|
||||||
if (response.code === 200) {
|
|
||||||
this.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const typeIds = row.typeId || this.ids;
|
|
||||||
this.$confirm(
|
|
||||||
// '是否确认删除告警类型编号为"' + typeIds + '"的数据项?',
|
|
||||||
"是否删除该选项",
|
|
||||||
"警告",
|
|
||||||
{
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning"
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.then(function() {
|
|
||||||
return delAlarmType(typeIds);
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.msgSuccess("删除成功");
|
|
||||||
})
|
|
||||||
.catch(function() {});
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download(
|
|
||||||
"iot/alarmType/export",
|
|
||||||
{
|
|
||||||
...this.queryParams
|
|
||||||
},
|
|
||||||
`iot_alarmType.xlsx`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss">
|
|
||||||
.alarm-type {
|
|
||||||
.eldialog-wrap {
|
|
||||||
.el-dialog__header {
|
|
||||||
border-bottom: 1px solid #747373;
|
|
||||||
}
|
|
||||||
.el-dialog__body {
|
|
||||||
padding: 0px;
|
|
||||||
}
|
|
||||||
.el-form {
|
|
||||||
padding: 20px;
|
|
||||||
padding-right: 40px;
|
|
||||||
}
|
|
||||||
.el-dialog__footer {
|
|
||||||
height: 60px;
|
|
||||||
border-top: 1px solid #747373;
|
|
||||||
text-align: right;
|
|
||||||
width: 100%;
|
|
||||||
padding: 0px;
|
|
||||||
padding-top: 15px;
|
|
||||||
.el-button + .el-button {
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
.el-button {
|
|
||||||
padding-top: 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.form-params-wrap {
|
|
||||||
height: 100%;
|
|
||||||
width: calc(100% + 110px);
|
|
||||||
position: relative;
|
|
||||||
top: 35px;
|
|
||||||
left: -90px;
|
|
||||||
max-height: 250px;
|
|
||||||
overflow: auto;
|
|
||||||
padding: 10px;
|
|
||||||
border: 1px solid #009688;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,200 +0,0 @@
|
||||||
<template>
|
|
||||||
<!-- 告警记录功能 -->
|
|
||||||
<div class="app-container alarm-record">
|
|
||||||
<el-form
|
|
||||||
:model="queryParams"
|
|
||||||
ref="queryForm"
|
|
||||||
:inline="true"
|
|
||||||
v-show="showSearch"
|
|
||||||
label-width="68px"
|
|
||||||
>
|
|
||||||
<el-form-item label="报警时间" prop="alarmTime">
|
|
||||||
<el-date-picker
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
v-model="queryParams.alarmTime"
|
|
||||||
type="date"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
placeholder="选择报警时间"
|
|
||||||
></el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="告警类型" prop="typeName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.typeName"
|
|
||||||
placeholder="请输入告警类型"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</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-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['iot:record:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="recordList">
|
|
||||||
<el-table-column type="index" label="序号" align="center" :index="indexFormatter" width="80px"></el-table-column>
|
|
||||||
<el-table-column label="设备名称" align="left" width="200px" prop="deviceName" />
|
|
||||||
<el-table-column label="设备当前值" align="left" width="200px" prop="currentValue" />
|
|
||||||
<el-table-column label="推送内容" align="left" prop="alarmContent" />
|
|
||||||
<el-table-column label="报警时间" align="center" prop="alarmTime" width="120">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.alarmTime, '{y}-{m}-{d}') }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="处理状态"
|
|
||||||
width="100px"
|
|
||||||
align="center"
|
|
||||||
prop="processState"
|
|
||||||
:formatter="stateFormatter"
|
|
||||||
/>
|
|
||||||
<el-table-column label="处理结果" align="left" width="150px" prop="processResult" />
|
|
||||||
<el-table-column label="处理时间" align="center" prop="processTime" width="120">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.processTime, '{y}-{m}-{d}') }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="告警类型" align="left" width="150px" prop="typeName" />
|
|
||||||
<!-- <el-table-column label="类型编码" align="left" width="150px" prop="typeCode" /> -->
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { listRecord, getRecord, exportRecord } from "@/api/alarm/record";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "WarningRecord",
|
|
||||||
components: {},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 报警记录表格数据
|
|
||||||
recordList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
typeName: null,
|
|
||||||
typeCode: null,
|
|
||||||
alarmDivide: "WARNING"
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
stateFormatter(val) {
|
|
||||||
switch (val.processStatus) {
|
|
||||||
case '1':
|
|
||||||
return '已处理';
|
|
||||||
|
|
||||||
case '0':
|
|
||||||
return '未处理';
|
|
||||||
|
|
||||||
case '2':
|
|
||||||
return '误报';
|
|
||||||
|
|
||||||
default:
|
|
||||||
return '未处理'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
indexFormatter(val) {
|
|
||||||
return (
|
|
||||||
val + 1 + (this.queryParams.pageNum - 1) * this.queryParams.pageSize
|
|
||||||
);
|
|
||||||
},
|
|
||||||
/** 查询报警记录列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listRecord(this.queryParams).then(response => {
|
|
||||||
this.recordList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 根据id获取记录详情
|
|
||||||
getRecordInfo(id) {
|
|
||||||
getRecord(id).then(res => {
|
|
||||||
this.form = res.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = `告警记录详情`;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
const queryParams = this.queryParams;
|
|
||||||
this.$confirm("是否确认导出所有报警记录数据项?", "警告", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning"
|
|
||||||
})
|
|
||||||
.then(function() {
|
|
||||||
return exportRecord(queryParams);
|
|
||||||
})
|
|
||||||
.then(response => {
|
|
||||||
this.download(response.msg);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
|
@ -82,7 +82,7 @@ import trendWrap from "./profile/trend";
|
||||||
import MapWrap from "./profile/mapWrap";
|
import MapWrap from "./profile/mapWrap";
|
||||||
import MapWrapPersonal from "./profile/personalCenter";
|
import MapWrapPersonal from "./profile/personalCenter";
|
||||||
import { iotWebSocketAlarmBaseUrl } from "@/config/env";
|
import { iotWebSocketAlarmBaseUrl } from "@/config/env";
|
||||||
import Cookies from 'js-cookie'
|
import Cookies from "js-cookie";
|
||||||
|
|
||||||
import { getWarningAnalysis, homeCount, appProjectList } from "@/api/app";
|
import { getWarningAnalysis, homeCount, appProjectList } from "@/api/app";
|
||||||
export default {
|
export default {
|
||||||
|
@ -136,12 +136,16 @@ export default {
|
||||||
$route(to, from) {
|
$route(to, from) {
|
||||||
if (from.fullPath === "/index") {
|
if (from.fullPath === "/index") {
|
||||||
document.getElementById("con_lf_top_div").style.background = "#fff";
|
document.getElementById("con_lf_top_div").style.background = "#fff";
|
||||||
document.getElementById("con_lf_top_div").style.height = "calc(100vh - 84px)";
|
document.getElementById("con_lf_top_div").style.height =
|
||||||
document.getElementById("con_lf_top_div").style.minHeight = "calc(100vh - 84px)";
|
"calc(100vh - 84px)";
|
||||||
|
document.getElementById("con_lf_top_div").style.minHeight =
|
||||||
|
"calc(100vh - 84px)";
|
||||||
} else if (to.fullPath === "/index") {
|
} else if (to.fullPath === "/index") {
|
||||||
document.getElementById("con_lf_top_div").style.background = "#010e45";
|
document.getElementById("con_lf_top_div").style.background = "#010e45";
|
||||||
document.getElementById("con_lf_top_div").style.height = "calc(100vh - 84px)";
|
document.getElementById("con_lf_top_div").style.height =
|
||||||
document.getElementById("con_lf_top_div").style.minHeight = "calc(100vh - 84px)";
|
"calc(100vh - 84px)";
|
||||||
|
document.getElementById("con_lf_top_div").style.minHeight =
|
||||||
|
"calc(100vh - 84px)";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -200,25 +204,21 @@ export default {
|
||||||
},
|
},
|
||||||
resize_window() {
|
resize_window() {
|
||||||
if (this.fullscreen) {
|
if (this.fullscreen) {
|
||||||
// this.scalseNumX = Math.min(
|
this.scalseNumX = Number(document.documentElement.clientWidth / 1920);
|
||||||
// Number(document.documentElement.clientHeight / 1080),
|
this.scalseNumY = Number(document.documentElement.clientHeight / 1080);
|
||||||
// Number(document.documentElement.clientWidth / 1920)
|
|
||||||
// );
|
|
||||||
this.scalseNumX = Number(document.documentElement.clientWidth / 1920)
|
|
||||||
this.scalseNumY = Number(document.documentElement.clientHeight / 1080)
|
|
||||||
} else {
|
} else {
|
||||||
// this.scalseNumX = Math.min(
|
|
||||||
// Number(document.documentElement.clientHeight / 1080),
|
|
||||||
// Number(document.documentElement.clientWidth / 1920) - Number(200 / 1920)
|
|
||||||
// );
|
|
||||||
if (document.documentElement.clientWidth < 993) {
|
if (document.documentElement.clientWidth < 993) {
|
||||||
this.scalseNumX = Number(document.documentElement.clientWidth / 1920) - (Cookies.get("sidebarStatus") == '1'?
|
this.scalseNumX =
|
||||||
Number(200 / 1920) : 0)
|
Number(document.documentElement.clientWidth / 1920) -
|
||||||
|
(Cookies.get("sidebarStatus") !== "0" ? Number(200 / 1920) : 0);
|
||||||
} else {
|
} else {
|
||||||
this.scalseNumX = Number(document.documentElement.clientWidth / 1920) - (Cookies.get("sidebarStatus") == '1'?
|
this.scalseNumX =
|
||||||
Number(200 / 1920) : Number(54 / 1920))
|
Number(document.documentElement.clientWidth / 1920) -
|
||||||
|
(Cookies.get("sidebarStatus") !== "0"
|
||||||
|
? Number(200 / 1920)
|
||||||
|
: Number(54 / 1920));
|
||||||
}
|
}
|
||||||
this.scalseNumY = Number(document.documentElement.clientHeight / 1080)
|
this.scalseNumY = Number(document.documentElement.clientHeight / 1080);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 查询项目列表
|
// 查询项目列表
|
||||||
|
@ -264,8 +264,10 @@ export default {
|
||||||
document.getElementById("app").style.background = "#fff";
|
document.getElementById("app").style.background = "#fff";
|
||||||
document.getElementById("con_lf_top_div").style.background = "#fff";
|
document.getElementById("con_lf_top_div").style.background = "#fff";
|
||||||
document.getElementById("con_lf_top_div").style.overflow = "auto";
|
document.getElementById("con_lf_top_div").style.overflow = "auto";
|
||||||
document.getElementById("con_lf_top_div").style.height = "calc(100vh - 84px)";
|
document.getElementById("con_lf_top_div").style.height =
|
||||||
document.getElementById("con_lf_top_div").style.minHeight = "calc(100vh - 84px)";
|
"calc(100vh - 84px)";
|
||||||
|
document.getElementById("con_lf_top_div").style.minHeight =
|
||||||
|
"calc(100vh - 84px)";
|
||||||
document.getElementById("con_lf_top_div").scrollTop = this.thisScrollTopY;
|
document.getElementById("con_lf_top_div").scrollTop = this.thisScrollTopY;
|
||||||
if (this.setIntervalGetCountOpt) {
|
if (this.setIntervalGetCountOpt) {
|
||||||
clearInterval(this.setIntervalGetCountOpt);
|
clearInterval(this.setIntervalGetCountOpt);
|
||||||
|
|
|
@ -140,20 +140,18 @@
|
||||||
class-name="small-padding fixed-width"
|
class-name="small-padding fixed-width"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- <el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
v-show="scope.row.processStatus === '1'"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['iot:record:edit']"
|
|
||||||
>处理</el-button> -->
|
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
|
v-show="scope.row.processStatus === '0'"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
>处理</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-document-add"
|
||||||
@click="handleWork(scope.row)"
|
@click="handleWork(scope.row)"
|
||||||
v-hasPermi="['iot:maintenance:add']"
|
|
||||||
>创建工单</el-button
|
>创建工单</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
|
@ -167,17 +165,46 @@
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
<dialog-template :title="title" :visible="open" @close="open = false"
|
||||||
|
class="eldialog-wrap"
|
||||||
|
width="600px"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="dialogForm"
|
||||||
|
:model="form"
|
||||||
|
slot="dialog-center"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-form-item label="处理结果:" prop="processResult">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:rows="2"
|
||||||
|
v-model="form.processResult"
|
||||||
|
placeholder="请输入处理结果"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="dialog-footer" class="dialog-footer">
|
||||||
|
<el-button size="mini" type="primary" @click="submitForm"
|
||||||
|
>确 定</el-button
|
||||||
|
>
|
||||||
|
<el-button size="mini" @click="open = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</dialog-template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listRecord, getRecord, exportRecord, addAlarmRecord } from "@/api/alarm/record";
|
import { listRecord, getRecord, exportRecord, addAlarmRecord, updateRecord, handlerRecord } from "@/api/alarm/record";
|
||||||
|
import DialogTemplate from "@/components/DialogTemplate";
|
||||||
import Editor from "@/components/Editor";
|
import Editor from "@/components/Editor";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Record",
|
name: "Record",
|
||||||
components: {
|
components: {
|
||||||
Editor,
|
Editor,
|
||||||
|
DialogTemplate
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -220,6 +247,36 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["dialogForm"].validate((v) => {
|
||||||
|
if (v) {
|
||||||
|
this.form.processTime = this.parseTime(
|
||||||
|
new Date(),
|
||||||
|
"{y}-{m}-{d} {h}:{i}:{s}"
|
||||||
|
);
|
||||||
|
this.form.processStatus = "2";
|
||||||
|
updateRecord(this.form).then((response) => {
|
||||||
|
this.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 处理告警
|
||||||
|
handleUpdate(row) {
|
||||||
|
const recordId = row.recordId || this.ids;
|
||||||
|
this.$confirm('是否设置此告警为已处理状态?', "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}).then(function() {
|
||||||
|
return handlerRecord({ 'recordIds': recordId.split(',') });
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.msgSuccess("处理成功");
|
||||||
|
})
|
||||||
|
},
|
||||||
// 转工单处理
|
// 转工单处理
|
||||||
handleWork(row) {
|
handleWork(row) {
|
||||||
console.log('addWork:', row)
|
console.log('addWork:', row)
|
||||||
|
@ -241,7 +298,7 @@ export default {
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.msgSuccess("创建成功!");
|
this.msgSuccess("创建成功!");
|
||||||
this.$router.push("/power/maintenance");
|
// this.$router.push("/power/maintenance");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
sortChange(column) {
|
sortChange(column) {
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
:default-time="['00:00:00', '23:59:59']"
|
:default-time="['00:00:00', '23:59:59']"
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期">
|
end-placeholder="结束日期"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="告警类型" prop="typeName">
|
<el-form-item label="告警类型" prop="typeName">
|
||||||
|
@ -31,8 +32,16 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
@ -45,24 +54,51 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['iot:record:export']"
|
v-hasPermi="['iot:record:export']"
|
||||||
>导出</el-button>
|
>导出</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="recordList" :default-sort="{ prop: 'alarmTime', order: 'descending' }"
|
<el-table
|
||||||
@sort-change="sortChange">
|
v-loading="loading"
|
||||||
<el-table-column type="index" label="序号" align="center" :index="indexFormatter" width="80px"></el-table-column>
|
:data="recordList"
|
||||||
<el-table-column label="设备名称" align="left" width="200px" prop="deviceName" />
|
:default-sort="{ prop: 'alarmTime', order: 'descending' }"
|
||||||
|
@sort-change="sortChange"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
type="index"
|
||||||
|
label="序号"
|
||||||
|
align="center"
|
||||||
|
:index="indexFormatter"
|
||||||
|
width="80px"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="设备名称"
|
||||||
|
align="left"
|
||||||
|
width="200px"
|
||||||
|
prop="deviceName"
|
||||||
|
/>
|
||||||
<!-- <el-table-column label="设备当前值" align="left" width="200px" prop="currentValue" >
|
<!-- <el-table-column label="设备当前值" align="left" width="200px" prop="currentValue" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap;">{{scope.row.currentValue}}</span>
|
<span style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap;">{{scope.row.currentValue}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column label="推送内容" align="left" prop="alarmContent" />
|
<el-table-column label="推送内容" align="left" prop="alarmContent" />
|
||||||
<el-table-column label="预警时间" align="center" sortable="custom" prop="alarmTime" width="150">
|
<el-table-column
|
||||||
|
label="预警时间"
|
||||||
|
align="center"
|
||||||
|
sortable="custom"
|
||||||
|
prop="alarmTime"
|
||||||
|
width="150"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.alarmTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
<span>{{
|
||||||
|
parseTime(scope.row.alarmTime, "{y}-{m}-{d} {h}:{i}:{s}")
|
||||||
|
}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
@ -72,13 +108,31 @@
|
||||||
prop="processState"
|
prop="processState"
|
||||||
:formatter="stateFormatter"
|
:formatter="stateFormatter"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="处理结果" align="left" sortable="custom" width="150px" prop="processResult" />
|
<el-table-column
|
||||||
<el-table-column label="处理时间" align="center" prop="processTime" width="150">
|
label="处理结果"
|
||||||
|
align="left"
|
||||||
|
sortable="custom"
|
||||||
|
width="150px"
|
||||||
|
prop="processResult"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="处理时间"
|
||||||
|
align="center"
|
||||||
|
prop="processTime"
|
||||||
|
width="150"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.processTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
<span>{{
|
||||||
|
parseTime(scope.row.processTime, "{y}-{m}-{d} {h}:{i}:{s}")
|
||||||
|
}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="告警类型" align="left" width="150px" prop="typeName" />
|
<el-table-column
|
||||||
|
label="告警类型"
|
||||||
|
align="left"
|
||||||
|
width="150px"
|
||||||
|
prop="typeName"
|
||||||
|
/>
|
||||||
<!-- <el-table-column label="类型编码" align="left" width="150px" prop="typeCode" /> -->
|
<!-- <el-table-column label="类型编码" align="left" width="150px" prop="typeCode" /> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="操作"
|
label="操作"
|
||||||
|
@ -87,20 +141,19 @@
|
||||||
class-name="small-padding fixed-width"
|
class-name="small-padding fixed-width"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- <el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
v-show="scope.row.processStatus === '1'"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['iot:record:edit']"
|
|
||||||
>处理</el-button> -->
|
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
|
v-show="scope.row.processStatus === '0'"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
>处理</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-document-add"
|
||||||
@click="handleWork(scope.row)"
|
@click="handleWork(scope.row)"
|
||||||
v-hasPermi="['iot:maintenance:add']"
|
|
||||||
>创建工单</el-button
|
>创建工单</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
|
@ -118,7 +171,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listRecord, getRecord, exportRecord, addAlarmRecord } from "@/api/alarm/record";
|
import {
|
||||||
|
listRecord,
|
||||||
|
getRecord,
|
||||||
|
exportRecord,
|
||||||
|
addAlarmRecord,
|
||||||
|
handlerRecord,
|
||||||
|
} from "@/api/alarm/record";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "WarningRecord",
|
name: "WarningRecord",
|
||||||
|
@ -151,19 +210,35 @@ export default {
|
||||||
typeCode: null,
|
typeCode: null,
|
||||||
beginTime: null,
|
beginTime: null,
|
||||||
endTime: null,
|
endTime: null,
|
||||||
alarmDivide: "WARNING"
|
alarmDivide: "WARNING",
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {},
|
rules: {},
|
||||||
time: []
|
time: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 处理告警
|
||||||
|
handleUpdate(row) {
|
||||||
|
const recordId = row.recordId || this.ids;
|
||||||
|
this.$confirm("是否设置此预警为已处理状态?", "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return handlerRecord({ recordIds: recordId.split(",") });
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.msgSuccess("处理成功");
|
||||||
|
});
|
||||||
|
},
|
||||||
// 转工单处理
|
// 转工单处理
|
||||||
handleWork(row) {
|
handleWork(row) {
|
||||||
this.$confirm("是否创建预警工单?", "提示", {
|
this.$confirm("是否创建预警工单?", "提示", {
|
||||||
|
@ -184,7 +259,7 @@ export default {
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.msgSuccess("创建成功!");
|
this.msgSuccess("创建成功!");
|
||||||
this.$router.push("/power/maintenance");
|
// this.$router.push("/power/maintenance");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
sortChange(column) {
|
sortChange(column) {
|
||||||
|
@ -197,8 +272,14 @@ export default {
|
||||||
},
|
},
|
||||||
queryTimeChange(val) {
|
queryTimeChange(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
this.queryParams.beginTime = this.parseTime(val[0], '{y}-{m}-{d} {h}:{i}:{s}')
|
this.queryParams.beginTime = this.parseTime(
|
||||||
this.queryParams.endTime = this.parseTime(val[1], '{y}-{m}-{d} {h}:{i}:{s}')
|
val[0],
|
||||||
|
"{y}-{m}-{d} {h}:{i}:{s}"
|
||||||
|
);
|
||||||
|
this.queryParams.endTime = this.parseTime(
|
||||||
|
val[1],
|
||||||
|
"{y}-{m}-{d} {h}:{i}:{s}"
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
this.queryParams.beginTime = null;
|
this.queryParams.beginTime = null;
|
||||||
this.queryParams.endTime = null;
|
this.queryParams.endTime = null;
|
||||||
|
@ -206,17 +287,17 @@ export default {
|
||||||
},
|
},
|
||||||
stateFormatter(val) {
|
stateFormatter(val) {
|
||||||
switch (val.processStatus) {
|
switch (val.processStatus) {
|
||||||
case '1':
|
case "1":
|
||||||
return '已处理';
|
return "已处理";
|
||||||
|
|
||||||
case '0':
|
case "0":
|
||||||
return '未处理';
|
return "未处理";
|
||||||
|
|
||||||
case '2':
|
case "2":
|
||||||
return '误报';
|
return "误报";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return '未处理'
|
return "未处理";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
indexFormatter(val) {
|
indexFormatter(val) {
|
||||||
|
@ -227,7 +308,7 @@ export default {
|
||||||
/** 查询预警记录列表 */
|
/** 查询预警记录列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listRecord(this.queryParams).then(response => {
|
listRecord(this.queryParams).then((response) => {
|
||||||
this.recordList = response.rows;
|
this.recordList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
@ -240,7 +321,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 根据id获取记录详情
|
// 根据id获取记录详情
|
||||||
getRecordInfo(id) {
|
getRecordInfo(id) {
|
||||||
getRecord(id).then(res => {
|
getRecord(id).then((res) => {
|
||||||
this.form = res.data;
|
this.form = res.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = `告警记录详情`;
|
this.title = `告警记录详情`;
|
||||||
|
@ -265,15 +346,15 @@ export default {
|
||||||
this.$confirm("是否确认导出所有预警记录数据项?", "警告", {
|
this.$confirm("是否确认导出所有预警记录数据项?", "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning",
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return exportRecord(queryParams);
|
return exportRecord(queryParams);
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container iot-device">
|
<div class="app-container iot-device">
|
||||||
<component :is="componectVal" :sourceId="sourceId"></component>
|
<component :is="componectVal" :sourceId="sourceId" :isTenant="false"></component>
|
||||||
<div v-show="componectVal === ''">
|
<div v-show="componectVal === ''">
|
||||||
<el-form
|
<el-form
|
||||||
:model="queryParams"
|
:model="queryParams"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container iot-device">
|
<div class="app-container iot-device">
|
||||||
<component :is="componectVal" :sourceId="sourceId"></component>
|
<component :is="componectVal" :sourceId="sourceId" :isTenant="false"></component>
|
||||||
<div v-show="componectVal === ''">
|
<div v-show="componectVal === ''">
|
||||||
<el-form
|
<el-form
|
||||||
:model="queryParams"
|
:model="queryParams"
|
||||||
|
@ -266,7 +266,7 @@
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<div class="to-home-wrap2" @click="toTableClick" v-show="componectVal !== ''">
|
<div :class="componectVal === 'GatewayDetail'? 'to-home-wrap2 gateway-wrap': 'to-home-wrap2 '" @click="toTableClick" v-show="componectVal !== ''">
|
||||||
<el-button icon="el-icon-d-arrow-left" title="返回列表" circle>返回列表</el-button>
|
<el-button icon="el-icon-d-arrow-left" title="返回列表" circle>返回列表</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -286,6 +286,7 @@ import { listModel, getModel } from "@/api/iot/model";
|
||||||
import SelectTableWrap from "@/components/SelectTable/index";
|
import SelectTableWrap from "@/components/SelectTable/index";
|
||||||
import DetailsWrap from "./profile/details";
|
import DetailsWrap from "./profile/details";
|
||||||
import ParamWrap from "@/components/ParamWrap/deviceParam";
|
import ParamWrap from "@/components/ParamWrap/deviceParam";
|
||||||
|
import GatewayDetail from '@/views/profile/DeviceDetailsView/index'
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
const deviceStatusOpt = {
|
const deviceStatusOpt = {
|
||||||
ONLINE: "在线",
|
ONLINE: "在线",
|
||||||
|
@ -303,7 +304,8 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
SelectTableWrap,
|
SelectTableWrap,
|
||||||
DetailsWrap,
|
DetailsWrap,
|
||||||
ParamWrap
|
ParamWrap,
|
||||||
|
GatewayDetail
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -405,7 +407,7 @@ export default {
|
||||||
},
|
},
|
||||||
handleDetails(row) {
|
handleDetails(row) {
|
||||||
this.sourceId = row.deviceId;
|
this.sourceId = row.deviceId;
|
||||||
this.componectVal = "DetailsWrap";
|
this.componectVal = row.deviceType === 'GATEWAY_CONTROLLER'? 'GatewayDetail' : "DetailsWrap";
|
||||||
},
|
},
|
||||||
// 跳转详情页
|
// 跳转详情页
|
||||||
toTableClick() {
|
toTableClick() {
|
||||||
|
@ -929,6 +931,9 @@ export default {
|
||||||
color: #1890ff;
|
color: #1890ff;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
}
|
}
|
||||||
|
.gateway-wrap {
|
||||||
|
top: 220px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.form-params-wrap::-webkit-scrollbar {
|
.form-params-wrap::-webkit-scrollbar {
|
||||||
/*滚动条整体样式*/
|
/*滚动条整体样式*/
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
:default-time="['00:00:00', '23:59:59']"
|
:default-time="['00:00:00', '23:59:59']"
|
||||||
end-placeholder="结束日期">
|
end-placeholder="结束日期"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="告警类型" prop="typeName">
|
<el-form-item label="告警类型" prop="typeName">
|
||||||
|
@ -31,8 +32,16 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
@ -45,35 +54,110 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['iot:record:export']"
|
v-hasPermi="['iot:record:export']"
|
||||||
>导出</el-button>
|
>导出</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="recordList" :default-sort="{ prop: 'alarmTime', order: 'descending' }"
|
<el-table
|
||||||
@sort-change="sortChange">
|
v-loading="loading"
|
||||||
<el-table-column type="index" label="序号" align="center" :index="indexFormatter" width="80px"></el-table-column>
|
:data="recordList"
|
||||||
<el-table-column label="设备名称" align="left" width="200px" prop="deviceName" />
|
:default-sort="{ prop: 'alarmTime', order: 'descending' }"
|
||||||
|
@sort-change="sortChange"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
type="index"
|
||||||
|
label="序号"
|
||||||
|
align="center"
|
||||||
|
:index="indexFormatter"
|
||||||
|
width="80px"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="设备名称"
|
||||||
|
align="left"
|
||||||
|
width="200px"
|
||||||
|
prop="deviceName"
|
||||||
|
/>
|
||||||
<!-- <el-table-column label="设备当前值" align="left" width="200px" prop="currentValue" >
|
<!-- <el-table-column label="设备当前值" align="left" width="200px" prop="currentValue" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap;">{{scope.row.currentValue}}</span>
|
<span style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap;">{{scope.row.currentValue}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column label="推送内容" align="left" prop="alarmContent" />
|
<el-table-column label="推送内容" align="left" prop="alarmContent" />
|
||||||
<el-table-column label="报警时间" align="center" prop="alarmTime" width="150" sortable="custom">
|
<el-table-column
|
||||||
|
label="报警时间"
|
||||||
|
align="center"
|
||||||
|
prop="alarmTime"
|
||||||
|
width="150"
|
||||||
|
sortable="custom"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.alarmTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
<span>{{
|
||||||
|
parseTime(scope.row.alarmTime, "{y}-{m}-{d} {h}:{i}:{s}")
|
||||||
|
}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="处理状态" width="100px" align="center" prop="processState" :formatter="stateFormatter"/>
|
<el-table-column
|
||||||
<el-table-column label="处理结果" align="left" width="150px" prop="processResult" />
|
label="处理状态"
|
||||||
<el-table-column label="处理时间" align="center" prop="processTime" width="150" sortable="custom">
|
width="100px"
|
||||||
|
align="center"
|
||||||
|
prop="processState"
|
||||||
|
:formatter="stateFormatter"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="处理结果"
|
||||||
|
align="left"
|
||||||
|
width="150px"
|
||||||
|
prop="processResult"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="处理时间"
|
||||||
|
align="center"
|
||||||
|
prop="processTime"
|
||||||
|
width="150"
|
||||||
|
sortable="custom"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.processTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
<span>{{
|
||||||
|
parseTime(scope.row.processTime, "{y}-{m}-{d} {h}:{i}:{s}")
|
||||||
|
}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="告警类型" align="left" width="150px" prop="typeName" />
|
<el-table-column
|
||||||
|
label="告警类型"
|
||||||
|
align="left"
|
||||||
|
width="150px"
|
||||||
|
prop="typeName"
|
||||||
|
/>
|
||||||
<!-- <el-table-column label="类型编码" align="left" width="150px" prop="typeCode" /> -->
|
<!-- <el-table-column label="类型编码" align="left" width="150px" prop="typeCode" /> -->
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
width="200"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
v-show="scope.row.processStatus === '0'"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
>处理</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-document-add"
|
||||||
|
@click="handleWork(scope.row)"
|
||||||
|
>创建工单</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
|
@ -83,21 +167,19 @@
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { listRecord, exportRecord } from "@/api/personal/alarm";
|
||||||
listRecord,
|
import { addAlarmRecord } from "@/api/alarm/tenantAlarm";
|
||||||
exportRecord
|
|
||||||
} from "@/api/personal/alarm";
|
|
||||||
import Editor from "@/components/Editor";
|
import Editor from "@/components/Editor";
|
||||||
|
import { handlerRecord } from "@/api/alarm/record";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Record",
|
name: "Record",
|
||||||
components: {
|
components: {
|
||||||
Editor
|
Editor,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -127,19 +209,58 @@ export default {
|
||||||
typeCode: null,
|
typeCode: null,
|
||||||
beginTime: null,
|
beginTime: null,
|
||||||
endTime: null,
|
endTime: null,
|
||||||
alarmDivide: 'ALARM'
|
alarmDivide: "ALARM",
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {},
|
rules: {},
|
||||||
time: []
|
time: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleUpdate(row) {
|
||||||
|
const recordId = row.recordId || this.ids;
|
||||||
|
this.$confirm("是否设置此告警为已处理状态?", "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return handlerRecord({ recordIds: recordId.split(",") });
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.msgSuccess("处理成功");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 转工单处理
|
||||||
|
handleWork(row) {
|
||||||
|
console.log("addWork:", row);
|
||||||
|
this.$confirm("是否创建告警工单?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return addAlarmRecord({
|
||||||
|
recordId: row.recordId, //告警记录id
|
||||||
|
deviceId: row.deviceId,
|
||||||
|
deviceName: row.deviceName,
|
||||||
|
faultType: "3", //固定
|
||||||
|
maintenanceStatus: "-1", //固定(工单已生成)
|
||||||
|
tenantId: null,
|
||||||
|
faultTypeName: "告警工单", //固定
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.msgSuccess("报警工单已创建!");
|
||||||
|
this.$router.push("/power/maintenancet");
|
||||||
|
});
|
||||||
|
},
|
||||||
sortChange(column) {
|
sortChange(column) {
|
||||||
const sort = {
|
const sort = {
|
||||||
isAsc: column.order === "descending" ? "desc" : "asc",
|
isAsc: column.order === "descending" ? "desc" : "asc",
|
||||||
|
@ -150,8 +271,14 @@ export default {
|
||||||
},
|
},
|
||||||
queryTimeChange(val) {
|
queryTimeChange(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
this.queryParams.beginTime = this.parseTime(val[0], '{y}-{m}-{d} {h}:{i}:{s}')
|
this.queryParams.beginTime = this.parseTime(
|
||||||
this.queryParams.endTime = this.parseTime(val[1], '{y}-{m}-{d} {h}:{i}:{s}')
|
val[0],
|
||||||
|
"{y}-{m}-{d} {h}:{i}:{s}"
|
||||||
|
);
|
||||||
|
this.queryParams.endTime = this.parseTime(
|
||||||
|
val[1],
|
||||||
|
"{y}-{m}-{d} {h}:{i}:{s}"
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
this.queryParams.beginTime = null;
|
this.queryParams.beginTime = null;
|
||||||
this.queryParams.endTime = null;
|
this.queryParams.endTime = null;
|
||||||
|
@ -159,17 +286,17 @@ export default {
|
||||||
},
|
},
|
||||||
stateFormatter(val) {
|
stateFormatter(val) {
|
||||||
switch (val.processStatus) {
|
switch (val.processStatus) {
|
||||||
case '1':
|
case "1":
|
||||||
return '已处理';
|
return "已处理";
|
||||||
|
|
||||||
case '0':
|
case "0":
|
||||||
return '未处理';
|
return "未处理";
|
||||||
|
|
||||||
case '2':
|
case "2":
|
||||||
return '误报';
|
return "误报";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return '未处理'
|
return "未处理";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
indexFormatter(val) {
|
indexFormatter(val) {
|
||||||
|
@ -180,7 +307,7 @@ export default {
|
||||||
/** 查询报警记录列表 */
|
/** 查询报警记录列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listRecord(this.queryParams).then(response => {
|
listRecord(this.queryParams).then((response) => {
|
||||||
this.recordList = response.rows;
|
this.recordList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
@ -210,15 +337,15 @@ export default {
|
||||||
this.$confirm("是否确认导出所有报警记录数据项?", "警告", {
|
this.$confirm("是否确认导出所有报警记录数据项?", "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning",
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return exportRecord(queryParams);
|
return exportRecord(queryParams);
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container iot-device">
|
<div class="app-container iot-device">
|
||||||
<component :is="componectVal" :sourceId="sourceId"></component>
|
<component :is="componectVal" :sourceId="sourceId" :isTenant="true"></component>
|
||||||
<div v-show="componectVal === ''">
|
<div v-show="componectVal === ''">
|
||||||
<el-form
|
<el-form
|
||||||
:model="queryParams"
|
:model="queryParams"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container iot-device">
|
<div class="app-container iot-device">
|
||||||
<component :is="componectVal" :sourceId="sourceId"></component>
|
<component :is="componectVal" :sourceId="sourceId" :isTenant="true"></component>
|
||||||
<div v-show="componectVal === ''">
|
<div v-show="componectVal === ''">
|
||||||
<el-form
|
<el-form
|
||||||
:model="queryParams"
|
:model="queryParams"
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="to-home-wrap2" @click="toTableClick" v-show="componectVal !== ''">
|
<div :class="componectVal === 'GatewayDetail'? 'to-home-wrap2 gateway-wrap': 'to-home-wrap2 '" @click="toTableClick" v-show="componectVal !== ''">
|
||||||
<el-button icon="el-icon-d-arrow-left" title="返回列表" circle>返回列表</el-button>
|
<el-button icon="el-icon-d-arrow-left" title="返回列表" circle>返回列表</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -129,6 +129,7 @@ import {
|
||||||
} from "@/api/personal/device";
|
} from "@/api/personal/device";
|
||||||
// import { listDeviceTypeList } from "@/api/tenant/device";
|
// import { listDeviceTypeList } from "@/api/tenant/device";
|
||||||
import DetailsWrap from "./profile/details";
|
import DetailsWrap from "./profile/details";
|
||||||
|
import GatewayDetail from '@/views/profile/DeviceDetailsView/index'
|
||||||
const deviceStatusOpt = {
|
const deviceStatusOpt = {
|
||||||
ONLINE: "在线",
|
ONLINE: "在线",
|
||||||
OFFLINE: "离线",
|
OFFLINE: "离线",
|
||||||
|
@ -143,7 +144,8 @@ const lineTypeOpt = {
|
||||||
export default {
|
export default {
|
||||||
name: "Device_oneself",
|
name: "Device_oneself",
|
||||||
components: {
|
components: {
|
||||||
DetailsWrap
|
DetailsWrap,
|
||||||
|
GatewayDetail
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -217,7 +219,7 @@ export default {
|
||||||
},
|
},
|
||||||
handleDetails(row) {
|
handleDetails(row) {
|
||||||
this.sourceId = row.deviceId;
|
this.sourceId = row.deviceId;
|
||||||
this.componectVal = "DetailsWrap";
|
this.componectVal = row.deviceType === 'GATEWAY_CONTROLLER'? 'GatewayDetail' : "DetailsWrap";
|
||||||
},
|
},
|
||||||
// 跳转详情页
|
// 跳转详情页
|
||||||
toTableClick() {
|
toTableClick() {
|
||||||
|
@ -346,6 +348,9 @@ export default {
|
||||||
color: #1890ff;
|
color: #1890ff;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
}
|
}
|
||||||
|
.gateway-wrap {
|
||||||
|
top: 220px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.form-params-wrap::-webkit-scrollbar {
|
.form-params-wrap::-webkit-scrollbar {
|
||||||
/*滚动条整体样式*/
|
/*滚动条整体样式*/
|
||||||
|
|
|
@ -18,7 +18,8 @@
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
:default-time="['00:00:00', '23:59:59']"
|
:default-time="['00:00:00', '23:59:59']"
|
||||||
end-placeholder="结束日期">
|
end-placeholder="结束日期"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="告警类型" prop="typeName">
|
<el-form-item label="告警类型" prop="typeName">
|
||||||
|
@ -31,8 +32,16 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
|
@ -45,24 +54,51 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['iot:record:export']"
|
v-hasPermi="['iot:record:export']"
|
||||||
>导出</el-button>
|
>导出</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="recordList" :default-sort="{ prop: 'alarmTime', order: 'descending' }"
|
<el-table
|
||||||
@sort-change="sortChange">
|
v-loading="loading"
|
||||||
<el-table-column type="index" label="序号" align="center" :index="indexFormatter" width="80px"></el-table-column>
|
:data="recordList"
|
||||||
<el-table-column label="设备名称" align="left" width="200px" prop="deviceName" />
|
:default-sort="{ prop: 'alarmTime', order: 'descending' }"
|
||||||
|
@sort-change="sortChange"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
type="index"
|
||||||
|
label="序号"
|
||||||
|
align="center"
|
||||||
|
:index="indexFormatter"
|
||||||
|
width="80px"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="设备名称"
|
||||||
|
align="left"
|
||||||
|
width="200px"
|
||||||
|
prop="deviceName"
|
||||||
|
/>
|
||||||
<!-- <el-table-column label="设备当前值" align="left" width="200px" prop="currentValue" >
|
<!-- <el-table-column label="设备当前值" align="left" width="200px" prop="currentValue" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap;">{{scope.row.currentValue}}</span>
|
<span style="text-overflow: ellipsis; overflow: hidden; white-space: nowrap;">{{scope.row.currentValue}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column label="推送内容" align="left" prop="alarmContent" />
|
<el-table-column label="推送内容" align="left" prop="alarmContent" />
|
||||||
<el-table-column label="预警时间" align="center" prop="alarmTime" width="150" sortable="custom">
|
<el-table-column
|
||||||
|
label="预警时间"
|
||||||
|
align="center"
|
||||||
|
prop="alarmTime"
|
||||||
|
width="150"
|
||||||
|
sortable="custom"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.alarmTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
<span>{{
|
||||||
|
parseTime(scope.row.alarmTime, "{y}-{m}-{d} {h}:{i}:{s}")
|
||||||
|
}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
@ -72,14 +108,56 @@
|
||||||
prop="processState"
|
prop="processState"
|
||||||
:formatter="stateFormatter"
|
:formatter="stateFormatter"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="处理结果" align="left" width="150px" prop="processResult" />
|
<el-table-column
|
||||||
<el-table-column label="处理时间" align="center" prop="processTime" width="150" sortable="custom">
|
label="处理结果"
|
||||||
|
align="left"
|
||||||
|
width="150px"
|
||||||
|
prop="processResult"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="处理时间"
|
||||||
|
align="center"
|
||||||
|
prop="processTime"
|
||||||
|
width="150"
|
||||||
|
sortable="custom"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.processTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
<span>{{
|
||||||
|
parseTime(scope.row.processTime, "{y}-{m}-{d} {h}:{i}:{s}")
|
||||||
|
}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="告警类型" align="left" width="150px" prop="typeName" />
|
<el-table-column
|
||||||
|
label="告警类型"
|
||||||
|
align="left"
|
||||||
|
width="150px"
|
||||||
|
prop="typeName"
|
||||||
|
/>
|
||||||
<!-- <el-table-column label="类型编码" align="left" width="150px" prop="typeCode" /> -->
|
<!-- <el-table-column label="类型编码" align="left" width="150px" prop="typeCode" /> -->
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
width="200"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
v-show="scope.row.processStatus === '0'"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
>处理</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-document-add"
|
||||||
|
@click="handleWork(scope.row)"
|
||||||
|
>创建工单</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
|
@ -94,6 +172,8 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listRecord, exportRecord } from "@/api/personal/alarm";
|
import { listRecord, exportRecord } from "@/api/personal/alarm";
|
||||||
|
import { addAlarmRecord } from "@/api/alarm/tenantAlarm";
|
||||||
|
import { handlerRecord } from "@/api/alarm/record";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "WarningRecord",
|
name: "WarningRecord",
|
||||||
|
@ -126,13 +206,13 @@ export default {
|
||||||
typeCode: null,
|
typeCode: null,
|
||||||
beginTime: null,
|
beginTime: null,
|
||||||
endTime: null,
|
endTime: null,
|
||||||
alarmDivide: "WARNING"
|
alarmDivide: "WARNING",
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {},
|
rules: {},
|
||||||
time: []
|
time: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -147,10 +227,56 @@ export default {
|
||||||
this.queryParams = Object.assign(this.queryParams, sort);
|
this.queryParams = Object.assign(this.queryParams, sort);
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
|
// 处理告警
|
||||||
|
handleUpdate(row) {
|
||||||
|
const recordId = row.recordId || this.ids;
|
||||||
|
this.$confirm("是否设置此预警为已处理状态?", "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return handlerRecord({ recordIds: recordId.split(",") });
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.msgSuccess("处理成功");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 转工单处理
|
||||||
|
handleWork(row) {
|
||||||
|
console.log("addWork:", row);
|
||||||
|
this.$confirm("是否创建预警工单?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return addAlarmRecord({
|
||||||
|
recordId: row.recordId, //告警记录id
|
||||||
|
deviceId: row.deviceId,
|
||||||
|
deviceName: row.deviceName,
|
||||||
|
faultType: "4", //固定
|
||||||
|
maintenanceStatus: "-1", //固定(工单已生成)
|
||||||
|
tenantId: null,
|
||||||
|
faultTypeName: "预警工单", //固定
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.msgSuccess("创建成功!");
|
||||||
|
this.$router.push("/power/maintenancet");
|
||||||
|
});
|
||||||
|
},
|
||||||
queryTimeChange(val) {
|
queryTimeChange(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
this.queryParams.beginTime = this.parseTime(val[0], '{y}-{m}-{d} {h}:{i}:{s}')
|
this.queryParams.beginTime = this.parseTime(
|
||||||
this.queryParams.endTime = this.parseTime(val[1], '{y}-{m}-{d} {h}:{i}:{s}')
|
val[0],
|
||||||
|
"{y}-{m}-{d} {h}:{i}:{s}"
|
||||||
|
);
|
||||||
|
this.queryParams.endTime = this.parseTime(
|
||||||
|
val[1],
|
||||||
|
"{y}-{m}-{d} {h}:{i}:{s}"
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
this.queryParams.beginTime = null;
|
this.queryParams.beginTime = null;
|
||||||
this.queryParams.endTime = null;
|
this.queryParams.endTime = null;
|
||||||
|
@ -158,17 +284,17 @@ export default {
|
||||||
},
|
},
|
||||||
stateFormatter(val) {
|
stateFormatter(val) {
|
||||||
switch (val.processStatus) {
|
switch (val.processStatus) {
|
||||||
case '1':
|
case "1":
|
||||||
return '已处理';
|
return "已处理";
|
||||||
|
|
||||||
case '0':
|
case "0":
|
||||||
return '未处理';
|
return "未处理";
|
||||||
|
|
||||||
case '2':
|
case "2":
|
||||||
return '误报';
|
return "误报";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return '未处理'
|
return "未处理";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
indexFormatter(val) {
|
indexFormatter(val) {
|
||||||
|
@ -179,7 +305,7 @@ export default {
|
||||||
/** 查询预警记录列表 */
|
/** 查询预警记录列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listRecord(this.queryParams).then(response => {
|
listRecord(this.queryParams).then((response) => {
|
||||||
this.recordList = response.rows;
|
this.recordList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
@ -209,15 +335,15 @@ export default {
|
||||||
this.$confirm("是否确认导出所有预警记录数据项?", "警告", {
|
this.$confirm("是否确认导出所有预警记录数据项?", "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning",
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return exportRecord(queryParams);
|
return exportRecord(queryParams);
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
<el-tab-pane label="设备信息" name="info">
|
<el-tab-pane label="设备信息" name="info">
|
||||||
<div class="tabs-body">
|
<div class="tabs-body">
|
||||||
<info-wrap :infoData="infoData" @updateInfo="updateInfo($event)" />
|
<info-wrap :infoData="infoData" :isTenant="isTenant" @updateInfo="updateInfo($event)" />
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="触发器" name="trigger">
|
<el-tab-pane label="触发器" name="trigger">
|
||||||
|
@ -62,7 +62,7 @@ import DeviceSelect from './deviceSelectNav'
|
||||||
import ModelOat from './modelOat'
|
import ModelOat from './modelOat'
|
||||||
export default {
|
export default {
|
||||||
name: "DetailsWrap",
|
name: "DetailsWrap",
|
||||||
props: ["sourceId"],
|
props: ["sourceId", "isTenant"],
|
||||||
components: {
|
components: {
|
||||||
InfoWrap,
|
InfoWrap,
|
||||||
DeviceLog,
|
DeviceLog,
|
||||||
|
|
|
@ -3,22 +3,33 @@
|
||||||
<div class="group-list-info">
|
<div class="group-list-info">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<div class="top-label">
|
<div class="top-label">
|
||||||
<svg-icon icon-class="A_product1" style="margin-right: 2px; height: 20px; width: 20px;" />设备信息
|
<svg-icon
|
||||||
|
icon-class="A_product1"
|
||||||
|
style="margin-right: 2px; height: 20px; width: 20px"
|
||||||
|
/>设备信息
|
||||||
<span
|
<span
|
||||||
v-if="updateState === false"
|
v-if="updateState === false"
|
||||||
style="margin: 0px 15px 0 10px; font-weight: 200; font-size: 14px;"
|
style="margin: 0px 15px 0 10px; font-weight: 200; font-size: 14px"
|
||||||
>设备名称:{{infoData.deviceName}}</span>
|
>设备名称:{{ infoData.deviceName }}</span
|
||||||
|
>
|
||||||
<span
|
<span
|
||||||
v-if="updateState === true"
|
v-if="updateState === true"
|
||||||
style="margin: 0px 5px 0 10px; font-weight: 200; font-size: 14px;"
|
style="margin: 0px 5px 0 10px; font-weight: 200; font-size: 14px"
|
||||||
>设备名称:</span>
|
>设备名称:</span
|
||||||
|
>
|
||||||
<el-input v-if="updateState === true" v-model="temp.deviceName" />
|
<el-input v-if="updateState === true" v-model="temp.deviceName" />
|
||||||
<el-button
|
<el-button
|
||||||
v-if="updateState === false"
|
v-if="updateState === false"
|
||||||
type="text"
|
type="text"
|
||||||
@click.stop="handleUpdate(infoData)"
|
@click.stop="handleUpdate(infoData)"
|
||||||
>编辑</el-button>
|
>编辑</el-button
|
||||||
<el-button v-if="updateState === true" type="text" @click.stop="submit">确定</el-button>
|
>
|
||||||
|
<el-button
|
||||||
|
v-if="updateState === true"
|
||||||
|
type="text"
|
||||||
|
@click.stop="submit"
|
||||||
|
>确定</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="top-button">
|
<!-- <div class="top-button">
|
||||||
<el-button type="primary" @click="download" size="small">下载本地模拟器</el-button>
|
<el-button type="primary" @click="download" size="small">下载本地模拟器</el-button>
|
||||||
|
@ -31,7 +42,12 @@
|
||||||
<div class="title">设备ID</div>
|
<div class="title">设备ID</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<span class="name">{{ infoData.deviceId }}</span>
|
<span class="name">{{ infoData.deviceId }}</span>
|
||||||
<el-button type="text" size="small" @click.stop="copyTexts(infoData.deviceId)">复制</el-button>
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.stop="copyTexts(infoData.deviceId)"
|
||||||
|
>复制</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-row-col">
|
<div class="table-row-col">
|
||||||
|
@ -44,29 +60,35 @@
|
||||||
<div class="title">设备密码</div>
|
<div class="title">设备密码</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<!-- <span v-show="!showDevicePassword" class="centent">********</span> -->
|
<!-- <span v-show="!showDevicePassword" class="centent">********</span> -->
|
||||||
<span
|
<span class="centent secret" :title="infoData.devicePassword">{{
|
||||||
class="centent secret"
|
infoData.devicePassword
|
||||||
:title="infoData.devicePassword"
|
}}</span>
|
||||||
>{{infoData.devicePassword}}</span>
|
<el-button type="text" size="small" v-if="isTenant === false" @click.stop="upldatePassword"
|
||||||
<el-button type="text" size="small" @click.stop="upldatePassword">修改密码</el-button>
|
>修改密码</el-button
|
||||||
<!-- <el-button
|
>
|
||||||
|
<div v-else>
|
||||||
|
<el-button
|
||||||
v-show="!showDevicePassword"
|
v-show="!showDevicePassword"
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
@click.stop="showDevicePassword = true"
|
@click.stop="showDevicePassword = true"
|
||||||
>显示</el-button>
|
>显示</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
v-show="showDevicePassword"
|
v-show="showDevicePassword"
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
@click.stop="copyTexts(infoData.devicePassword)"
|
@click.stop="copyTexts(infoData.devicePassword)"
|
||||||
>复制</el-button>
|
>复制</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
v-show="showDevicePassword"
|
v-show="showDevicePassword"
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
@click.stop="showDevicePassword = false"
|
@click.stop="showDevicePassword = false"
|
||||||
>隐藏</el-button>-->
|
>隐藏</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -75,7 +97,12 @@
|
||||||
<div class="title">产品PK</div>
|
<div class="title">产品PK</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<span class="name">{{ infoData.prodKey }}</span>
|
<span class="name">{{ infoData.prodKey }}</span>
|
||||||
<el-button type="text" size="small" @click.stop="copyTexts(infoData.prodKey)">复制</el-button>
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.stop="copyTexts(infoData.prodKey)"
|
||||||
|
>复制</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -91,25 +118,29 @@
|
||||||
v-show="showProdSecret"
|
v-show="showProdSecret"
|
||||||
class="centent secret"
|
class="centent secret"
|
||||||
:title="infoData.deviceSecret"
|
:title="infoData.deviceSecret"
|
||||||
>{{infoData.deviceSecret}}</span>
|
>{{ infoData.deviceSecret }}</span
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
v-show="!showProdSecret"
|
v-show="!showProdSecret"
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
@click.stop="showProdSecret = true"
|
@click.stop="showProdSecret = true"
|
||||||
>显示</el-button>
|
>显示</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
v-show="showProdSecret"
|
v-show="showProdSecret"
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
@click.stop="copyTexts(infoData.deviceSecret)"
|
@click.stop="copyTexts(infoData.deviceSecret)"
|
||||||
>复制</el-button>
|
>复制</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
v-show="showProdSecret"
|
v-show="showProdSecret"
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
@click.stop="showProdSecret = false"
|
@click.stop="showProdSecret = false"
|
||||||
>隐藏</el-button>
|
>隐藏</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -121,36 +152,44 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="table-row-col">
|
<div class="table-row-col">
|
||||||
<div class="title">当前状态</div>
|
<div class="title">当前状态</div>
|
||||||
<div class="content" v-if="infoData.deviceState === 'ONLINE'">在线</div>
|
<div class="content" v-if="infoData.deviceState === 'ONLINE'">
|
||||||
<div class="content" v-else-if="infoData.deviceState === 'OFFLINE'">离线</div>
|
在线
|
||||||
<div class="content" v-else-if="infoData.deviceState === 'OUTLINE'">脱线</div>
|
</div>
|
||||||
<div class="content" v-else-if="infoData.deviceState === 'UNACTIVE'">未激活</div>
|
<div class="content" v-else-if="infoData.deviceState === 'OFFLINE'">
|
||||||
|
离线
|
||||||
|
</div>
|
||||||
|
<div class="content" v-else-if="infoData.deviceState === 'OUTLINE'">
|
||||||
|
脱线
|
||||||
|
</div>
|
||||||
|
<div class="content" v-else-if="infoData.deviceState === 'UNACTIVE'">
|
||||||
|
未激活
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table-row-col">
|
<div class="table-row-col">
|
||||||
<div class="title">创建时间</div>
|
<div class="title">创建时间</div>
|
||||||
<div class="content">{{infoData.createTime || '--'}}</div>
|
<div class="content">{{ infoData.createTime || "--" }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table-row">
|
<div class="table-row">
|
||||||
<div class="table-row-col">
|
<div class="table-row-col">
|
||||||
<div class="title">芯片ID</div>
|
<div class="title">芯片ID</div>
|
||||||
<div class="content">{{infoData.uId || '--'}}</div>
|
<div class="content">{{ infoData.uId || "--" }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-row-col">
|
<div class="table-row-col">
|
||||||
<div class="title">主板ID</div>
|
<div class="title">主板ID</div>
|
||||||
<div class="content">{{infoData.boaId || '--'}}</div>
|
<div class="content">{{ infoData.boaId || "--" }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table-row-col">
|
<div class="table-row-col">
|
||||||
<div class="title">组装ID</div>
|
<div class="title">组装ID</div>
|
||||||
<div class="content">{{infoData.assId || '--'}}</div>
|
<div class="content">{{ infoData.assId || "--" }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table-row">
|
<div class="table-row">
|
||||||
<div class="table-row-col" style="flex: 3 1 0%;">
|
<div class="table-row-col" style="flex: 3 1 0%">
|
||||||
<div class="title">设备图片</div>
|
<div class="title">设备图片</div>
|
||||||
<div class="content">--</div>
|
<div class="content">--</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -166,11 +205,18 @@
|
||||||
>
|
>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
<el-form-item label="设备密码:" prop="devicePassword">
|
<el-form-item label="设备密码:" prop="devicePassword">
|
||||||
<el-input v-model="form.devicePassword" @input="inputI" placeholder="选填--设备密码" clearable />
|
<el-input
|
||||||
|
v-model="form.devicePassword"
|
||||||
|
@input="inputI"
|
||||||
|
placeholder="选填--设备密码"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button size="mini" type="primary" @click="submitForm">确 定</el-button>
|
<el-button size="mini" type="primary" @click="submitForm"
|
||||||
|
>确 定</el-button
|
||||||
|
>
|
||||||
<el-button size="mini" @click="open = false">取 消</el-button>
|
<el-button size="mini" @click="open = false">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -180,7 +226,7 @@
|
||||||
import { updateDevice, resetPssword } from "@/api/iot/device";
|
import { updateDevice, resetPssword } from "@/api/iot/device";
|
||||||
export default {
|
export default {
|
||||||
name: "DeviceInfo",
|
name: "DeviceInfo",
|
||||||
props: ["infoData"],
|
props: ["infoData", "isTenant"],
|
||||||
data() {
|
data() {
|
||||||
const validatorNull = (rule, value, callback) => {
|
const validatorNull = (rule, value, callback) => {
|
||||||
callback();
|
callback();
|
||||||
|
@ -193,22 +239,22 @@ export default {
|
||||||
showDevicePassword: false,
|
showDevicePassword: false,
|
||||||
temp: {
|
temp: {
|
||||||
deviceName: "",
|
deviceName: "",
|
||||||
deviceId: undefined
|
deviceId: undefined,
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
devicePassword: [
|
devicePassword: [
|
||||||
{
|
{
|
||||||
required: false,
|
required: false,
|
||||||
validator: this.devicePassword,
|
validator: this.devicePassword,
|
||||||
trigger: "blur"
|
trigger: "blur",
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
devicePassword: ""
|
devicePassword: "",
|
||||||
},
|
},
|
||||||
title: "",
|
title: "",
|
||||||
open: false
|
open: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -232,15 +278,15 @@ export default {
|
||||||
},
|
},
|
||||||
// 修改设备密码 提交
|
// 修改设备密码 提交
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
resetPssword(this.form).then(response => {
|
resetPssword(this.form).then((response) => {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess("修改成功");
|
this.msgSuccess("修改成功");
|
||||||
}
|
}
|
||||||
this.$emit("updateInfo", {
|
this.$emit("updateInfo", {
|
||||||
deviceId: this.infoData.deviceId
|
deviceId: this.infoData.deviceId,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -258,28 +304,28 @@ export default {
|
||||||
newTemp() {
|
newTemp() {
|
||||||
this.temp = {
|
this.temp = {
|
||||||
deviceName: "",
|
deviceName: "",
|
||||||
deviceId: undefined
|
deviceId: undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
// 下载本地模拟器 -- 暂未开放
|
// 下载本地模拟器 -- 暂未开放
|
||||||
download() {},
|
download() {},
|
||||||
submit() {
|
submit() {
|
||||||
if (this.temp.deviceName && this.temp.deviceId) {
|
if (this.temp.deviceName && this.temp.deviceId) {
|
||||||
updateDevice(this.temp).then(response => {
|
updateDevice(this.temp).then((response) => {
|
||||||
this.updateState = false;
|
this.updateState = false;
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess("修改成功");
|
this.msgSuccess("修改成功");
|
||||||
}
|
}
|
||||||
this.$emit("updateInfo", {
|
this.$emit("updateInfo", {
|
||||||
deviceId: this.infoData.deviceId,
|
deviceId: this.infoData.deviceId,
|
||||||
deviceName: this.infoData.deviceName
|
deviceName: this.infoData.deviceName,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.msgError("设备名称不能为空!");
|
this.msgError("设备名称不能为空!");
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -125,23 +125,28 @@
|
||||||
width="200px"
|
width="200px"
|
||||||
prop="typeName"
|
prop="typeName"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="操作" width="200" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
width="200"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- <el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
v-show="scope.row.processStatus === '1'"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['iot:record:edit']"
|
|
||||||
>处理</el-button> -->
|
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
|
v-show="scope.row.processStatus === '0'"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
>处理</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-document-add"
|
||||||
@click="handleWork(scope.row)"
|
@click="handleWork(scope.row)"
|
||||||
v-hasPermi="['iot:maintenance:add']"
|
>创建工单</el-button
|
||||||
>创建工单</el-button>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -195,6 +200,8 @@ import {
|
||||||
delRecord,
|
delRecord,
|
||||||
addAlarmRecord,
|
addAlarmRecord,
|
||||||
} from "@/api/alarm/tenantAlarm";
|
} from "@/api/alarm/tenantAlarm";
|
||||||
|
import { handlerRecord } from "@/api/alarm/record";
|
||||||
|
|
||||||
import Editor from "@/components/Editor";
|
import Editor from "@/components/Editor";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -244,6 +251,22 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 处理告警
|
||||||
|
handleUpdate(row) {
|
||||||
|
const recordId = row.recordId || this.ids;
|
||||||
|
this.$confirm("是否设置此告警为已处理状态?", "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return handlerRecord({ recordIds: recordId.split(",") });
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.msgSuccess("处理成功");
|
||||||
|
});
|
||||||
|
},
|
||||||
sortChange(column) {
|
sortChange(column) {
|
||||||
const sort = {
|
const sort = {
|
||||||
isAsc: column.order === "descending" ? "desc" : "asc",
|
isAsc: column.order === "descending" ? "desc" : "asc",
|
||||||
|
@ -306,7 +329,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 转工单处理
|
// 转工单处理
|
||||||
handleWork(row) {
|
handleWork(row) {
|
||||||
console.log('addWork:', row)
|
console.log("addWork:", row);
|
||||||
this.$confirm("是否创建告警工单?", "提示", {
|
this.$confirm("是否创建告警工单?", "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
|
@ -324,19 +347,10 @@ export default {
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.msgSuccess("创建成功!");
|
this.msgSuccess("报警工单已创建!");
|
||||||
this.$router.push("/power/maintenancet");
|
this.$router.push("/power/maintenancet");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 处理告警
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.resetFomr();
|
|
||||||
getRecord(row.recordId).then((res) => {
|
|
||||||
this.form = res.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "告警处理";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
resetFomr() {
|
resetFomr() {
|
||||||
this.form = {
|
this.form = {
|
||||||
processResult: "",
|
processResult: "",
|
||||||
|
|
|
@ -131,20 +131,19 @@
|
||||||
class-name="small-padding fixed-width"
|
class-name="small-padding fixed-width"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- <el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
v-show="scope.row.processStatus === '1'"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['iot:record:edit']"
|
|
||||||
>处理</el-button> -->
|
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
|
v-show="scope.row.processStatus === '0'"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
>处理</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-document-add"
|
||||||
@click="handleWork(scope.row)"
|
@click="handleWork(scope.row)"
|
||||||
v-hasPermi="['iot:maintenance:add']"
|
|
||||||
>创建工单</el-button
|
>创建工单</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
|
@ -201,6 +200,7 @@ import {
|
||||||
addAlarmRecord,
|
addAlarmRecord,
|
||||||
} from "@/api/alarm/tenantAlarm";
|
} from "@/api/alarm/tenantAlarm";
|
||||||
import Editor from "@/components/Editor";
|
import Editor from "@/components/Editor";
|
||||||
|
import { handlerRecord } from "@/api/alarm/record";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Warning",
|
name: "Warning",
|
||||||
|
@ -303,6 +303,22 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 处理告警
|
||||||
|
handleUpdate(row) {
|
||||||
|
const recordId = row.recordId || this.ids;
|
||||||
|
this.$confirm("是否设置此预警为已处理状态?", "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return handlerRecord({ recordIds: recordId.split(",") });
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.msgSuccess("处理成功");
|
||||||
|
});
|
||||||
|
},
|
||||||
// 转工单处理
|
// 转工单处理
|
||||||
handleWork(row) {
|
handleWork(row) {
|
||||||
console.log("addWork:", row);
|
console.log("addWork:", row);
|
||||||
|
@ -327,15 +343,6 @@ export default {
|
||||||
this.$router.push("/power/maintenancet");
|
this.$router.push("/power/maintenancet");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 处理预警
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.resetFomr();
|
|
||||||
getRecord(row.recordId).then((res) => {
|
|
||||||
this.form = res.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "预警处理";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
resetFomr() {
|
resetFomr() {
|
||||||
this.form = {
|
this.form = {
|
||||||
processResult: "",
|
processResult: "",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container iot-device">
|
<div class="app-container iot-device">
|
||||||
<component :is="componectVal" :sourceId="sourceId"></component>
|
<component :is="componectVal" :sourceId="sourceId" :isTenant="true"></component>
|
||||||
<div v-show="componectVal === ''">
|
<div v-show="componectVal === ''">
|
||||||
<el-form
|
<el-form
|
||||||
:model="queryParams"
|
:model="queryParams"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container iot-device">
|
<div class="app-container iot-device">
|
||||||
<component :is="componectVal" :sourceId="sourceId"></component>
|
<component :is="componectVal" :sourceId="sourceId" :isTenant="true"></component>
|
||||||
<div v-show="componectVal === ''">
|
<div v-show="componectVal === ''">
|
||||||
<el-form
|
<el-form
|
||||||
:model="queryParams"
|
:model="queryParams"
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="to-home-wrap2" @click="toTableClick" v-show="componectVal !== ''">
|
<div :class="componectVal === 'GatewayDetail'? 'to-home-wrap2 gateway-wrap': 'to-home-wrap2 '" @click="toTableClick" v-show="componectVal !== ''">
|
||||||
<el-button icon="el-icon-d-arrow-left" title="返回列表" circle>返回列表</el-button>
|
<el-button icon="el-icon-d-arrow-left" title="返回列表" circle>返回列表</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -123,6 +123,7 @@ import {
|
||||||
listDeviceTypeList
|
listDeviceTypeList
|
||||||
} from "@/api/tenant/device";
|
} from "@/api/tenant/device";
|
||||||
import DetailsWrap from './profile/details'
|
import DetailsWrap from './profile/details'
|
||||||
|
import GatewayDetail from '@/views/profile/DeviceDetailsView/index'
|
||||||
const deviceStatusOpt = {
|
const deviceStatusOpt = {
|
||||||
ONLINE: "在线",
|
ONLINE: "在线",
|
||||||
OFFLINE: "离线",
|
OFFLINE: "离线",
|
||||||
|
@ -137,7 +138,8 @@ const lineTypeOpt = {
|
||||||
export default {
|
export default {
|
||||||
name: "Device",
|
name: "Device",
|
||||||
components: {
|
components: {
|
||||||
DetailsWrap
|
DetailsWrap,
|
||||||
|
GatewayDetail
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -203,7 +205,8 @@ export default {
|
||||||
},
|
},
|
||||||
handleDetails(row) {
|
handleDetails(row) {
|
||||||
this.sourceId = row.deviceId;
|
this.sourceId = row.deviceId;
|
||||||
this.componectVal = "DetailsWrap";
|
// this.componectVal = "DetailsWrap";
|
||||||
|
this.componectVal = row.deviceType === 'GATEWAY_CONTROLLER'? 'GatewayDetail' : "DetailsWrap";
|
||||||
},
|
},
|
||||||
// 跳转详情页
|
// 跳转详情页
|
||||||
toTableClick() {
|
toTableClick() {
|
||||||
|
@ -310,7 +313,7 @@ export default {
|
||||||
height: 20px;
|
height: 20px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 30px;
|
right: 30px;
|
||||||
top: 30px;
|
top: 50px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -335,6 +338,9 @@ export default {
|
||||||
color: #1890ff;
|
color: #1890ff;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
}
|
}
|
||||||
|
.gateway-wrap {
|
||||||
|
top: 220px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.form-params-wrap::-webkit-scrollbar {
|
.form-params-wrap::-webkit-scrollbar {
|
||||||
/*滚动条整体样式*/
|
/*滚动条整体样式*/
|
||||||
|
|
Loading…
Reference in New Issue