fast(我的项目、告警管理): 我的设备、告警记录、预警记录添加项目查询和项目显示、屏蔽项目详情的设备管理和安全监管,调整设备标签删除逻辑
This commit is contained in:
parent
c4c2c0c31d
commit
e8b5a0c30f
|
@ -131,7 +131,11 @@
|
|||
type="index"
|
||||
width="80px"
|
||||
></el-table-column>
|
||||
<el-table-column align="left" label="设备名称" prop="deviceName" />
|
||||
<el-table-column align="left" label="设备名称" prop="deviceName" >
|
||||
<template slot-scope="scope">
|
||||
<el-link :underline="false" type="primary" @click="handleDetails(scope.row)">{{ scope.row.deviceName }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="所属型号" prop="modelName" />
|
||||
<el-table-column align="left" label="设备key" prop="deviceKey" />
|
||||
<el-table-column
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
<el-table
|
||||
v-loading="loading"
|
||||
:data="spaceList"
|
||||
:default-sort = "{prop: 'orderNum', order: 'ascending'}"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
default-expand-all
|
||||
row-key="labelCode"
|
||||
|
@ -53,7 +52,7 @@
|
|||
<el-table-column :index="indexFormatter" align="center" label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column align="left" label="标签名称" prop="labelKey" />
|
||||
<el-table-column :formatter="statusFormat" align="center" label="标签类型" prop="labelType" />
|
||||
<el-table-column align="center" label="排序" prop="orderNum" sortable/>
|
||||
<el-table-column align="center" label="排序" prop="orderNum" />
|
||||
<el-table-column align="left" class-name="small-padding fixed-width" label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -148,7 +147,38 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|||
import DialogTemplate from "@/components/DialogTemplate";
|
||||
import { addTagGroup, delTagGroup, listTagGroup, updateTagGroup } from "@/api/iot/tagGroup";
|
||||
import { listTagType } from "@/api/iot/tagType";
|
||||
function handleTree(data, id, parentId, children, rootId) {
|
||||
id = id || 'id';
|
||||
parentId = parentId || 'parentId';
|
||||
children = children || 'children';
|
||||
rootId = rootId || Math.min.apply(Math, data.map(item => {
|
||||
return item[parentId];
|
||||
})) || 0;
|
||||
|
||||
// 对源数据深度克隆
|
||||
const cloneData = JSON.parse(JSON.stringify(data));
|
||||
|
||||
// 循环所有项
|
||||
const treeData = cloneData.filter(father => {
|
||||
let branchArr = cloneData.filter(child => {
|
||||
// 返回每一项的子级数组
|
||||
return father[id] === child[parentId];
|
||||
});
|
||||
|
||||
// 按 orderNum 排序子节点
|
||||
branchArr.sort((a, b) => a.orderNum - b.orderNum);
|
||||
|
||||
// 如果子节点数组不为空,将其赋值给父节点的 children 属性
|
||||
if (branchArr.length > 0) {
|
||||
father[children] = branchArr;
|
||||
}
|
||||
|
||||
// 返回第一层
|
||||
return father[parentId] === rootId;
|
||||
});
|
||||
|
||||
return treeData.length > 0 ? treeData : data;
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "TagGroup",
|
||||
|
@ -280,8 +310,8 @@ export default {
|
|||
this.queryParams.projectId = this.infoData.projectId;
|
||||
listTagGroup(this.queryParams).then(response => {
|
||||
this.dataList = response.rows || [];
|
||||
this.spaceList = this.handleTree(response.rows, "labelCode", "parentId");
|
||||
this.querySpaceOptions = this.handleTree(response.rows, "labelCode", "parentId");
|
||||
this.spaceList = handleTree(response.rows, "labelCode", "parentId");
|
||||
this.querySpaceOptions = handleTree(response.rows, "labelCode", "parentId");
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
@ -297,10 +327,12 @@ export default {
|
|||
};
|
||||
},
|
||||
handleTreeInput(e){
|
||||
console.log("e++++++++++++++",e)
|
||||
if(e!=undefined){
|
||||
|
||||
this.dataList.forEach(item=>{
|
||||
if(item.labelCode == e){
|
||||
this.form.labelName = item.labelKey;
|
||||
this.form.labelName = this.statusFormat({labelType:item.labelType});
|
||||
this.form.labelType = item.labelType;
|
||||
}
|
||||
})
|
||||
|
@ -324,7 +356,7 @@ export default {
|
|||
listTagGroup(param).then(response => {
|
||||
this.querySpaceOptions = [];
|
||||
const data = { labelCode: 0, labelKey: "顶级节点", children: [] };
|
||||
data.children = this.handleTree(response.rows, "labelCode", "parentId");
|
||||
data.children = handleTree(response.rows, "labelCode", "parentId");
|
||||
this.querySpaceOptions.push(data);
|
||||
});
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="app-container">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button v-if="tagData.isDefault !=='Y' && infoData && infoData.projectRole !== 'personal'" v-hasPermi="['iot:label:edit']" icon="el-icon-plus" plain size="mini" type="primary" @click="handleAdd" >新增标签</el-button>
|
||||
<el-button v-if="tagData.isDefault !=='Y' && infoData && infoData.projectRole !== 'personal'" v-hasPermi="['iot:label:edit']" icon="el-icon-plus" plain size="mini" type="primary" @click="handleAdd" >新增设备</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
@ -357,13 +357,17 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
let labelCodes = this.getAllLabelCodes(this.tagData)
|
||||
let arr = this.tagData.ancestors.split(',');
|
||||
arr.shift()
|
||||
arr.shift()
|
||||
arr.push(...labelCodes);
|
||||
this.$confirm("是否将该设备移出该标签?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(function() {
|
||||
return delTagGroupdevice({ deviceKey: row.deviceKey,labelCodes:labelCodes.join()});
|
||||
return delTagGroupdevice({ deviceKey: row.deviceKey,labelCodes:arr});
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
|
|
|
@ -44,12 +44,12 @@
|
|||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button icon="el-icon-edit" size="mini" type="text" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- >删除</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
|
@ -302,81 +302,81 @@ export default {
|
|||
icon: "iconfont iconxiangmugl",
|
||||
template: "EObjectContainer",
|
||||
},
|
||||
{
|
||||
label: "设备管理",
|
||||
key: "EDeviceManage",
|
||||
icon: "iconfont iconwumoxing",
|
||||
template: "EDeviceManage",
|
||||
},
|
||||
{
|
||||
label: "安全监管",
|
||||
key: "safety",
|
||||
icon: "iconfont iconanquangl",
|
||||
template: "ENavLayout",
|
||||
children: [
|
||||
// 漏电流 温度 漏电报警 温度报警 漏保自检 短路报警 过欠压 过流过载 电弧报警 三相报警 异常状态 分合闸警示
|
||||
{
|
||||
label: "全部报警",
|
||||
key: "EAlarmManage",
|
||||
template: "EAlarmManage",
|
||||
},
|
||||
{
|
||||
label: "漏电流",
|
||||
key: "leakage",
|
||||
template: "ELeakageCurrent",
|
||||
},
|
||||
{
|
||||
label: "温度",
|
||||
key: "A006,A007,A008,A009,B004,B005,B006,B007",
|
||||
template: "ESafetyTemplate",
|
||||
},
|
||||
{
|
||||
label: "漏电报警",
|
||||
key: "A002,B002",
|
||||
template: "ESafetyTemplate",
|
||||
},
|
||||
{
|
||||
label: "漏保自检",
|
||||
key: "A002,B004",
|
||||
template: "ESafetyTemplate",
|
||||
},
|
||||
{
|
||||
label: "短路报警",
|
||||
key: "A001,B004",
|
||||
template: "ESafetyTemplate",
|
||||
},
|
||||
{
|
||||
label: "过欠压",
|
||||
key: "A005,A004,B000,B001",
|
||||
template: "ESafetyTemplate",
|
||||
},
|
||||
{
|
||||
label: "过流过载",
|
||||
key: "A003,A013,B003,B009",
|
||||
template: "ESafetyTemplate",
|
||||
},
|
||||
{
|
||||
label: "电弧报警",
|
||||
key: "A014,B010",
|
||||
template: "ESafetyTemplate",
|
||||
},
|
||||
{
|
||||
label: "三相报警",
|
||||
key: "A015,B011",
|
||||
template: "ESafetyTemplate",
|
||||
},
|
||||
{
|
||||
label: "异常状态",
|
||||
key: "A010",
|
||||
template: "EDebuff",
|
||||
},
|
||||
{
|
||||
label: "分合闸警示",
|
||||
key: "A011",
|
||||
template: "EDeviceSwitchWarning",
|
||||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// label: "设备管理",
|
||||
// key: "EDeviceManage",
|
||||
// icon: "iconfont iconwumoxing",
|
||||
// template: "EDeviceManage",
|
||||
// },
|
||||
// {
|
||||
// label: "安全监管",
|
||||
// key: "safety",
|
||||
// icon: "iconfont iconanquangl",
|
||||
// template: "ENavLayout",
|
||||
// children: [
|
||||
// // 漏电流 温度 漏电报警 温度报警 漏保自检 短路报警 过欠压 过流过载 电弧报警 三相报警 异常状态 分合闸警示
|
||||
// {
|
||||
// label: "全部报警",
|
||||
// key: "EAlarmManage",
|
||||
// template: "EAlarmManage",
|
||||
// },
|
||||
// {
|
||||
// label: "漏电流",
|
||||
// key: "leakage",
|
||||
// template: "ELeakageCurrent",
|
||||
// },
|
||||
// {
|
||||
// label: "温度",
|
||||
// key: "A006,A007,A008,A009,B004,B005,B006,B007",
|
||||
// template: "ESafetyTemplate",
|
||||
// },
|
||||
// {
|
||||
// label: "漏电报警",
|
||||
// key: "A002,B002",
|
||||
// template: "ESafetyTemplate",
|
||||
// },
|
||||
// {
|
||||
// label: "漏保自检",
|
||||
// key: "A002,B004",
|
||||
// template: "ESafetyTemplate",
|
||||
// },
|
||||
// {
|
||||
// label: "短路报警",
|
||||
// key: "A001,B004",
|
||||
// template: "ESafetyTemplate",
|
||||
// },
|
||||
// {
|
||||
// label: "过欠压",
|
||||
// key: "A005,A004,B000,B001",
|
||||
// template: "ESafetyTemplate",
|
||||
// },
|
||||
// {
|
||||
// label: "过流过载",
|
||||
// key: "A003,A013,B003,B009",
|
||||
// template: "ESafetyTemplate",
|
||||
// },
|
||||
// {
|
||||
// label: "电弧报警",
|
||||
// key: "A014,B010",
|
||||
// template: "ESafetyTemplate",
|
||||
// },
|
||||
// {
|
||||
// label: "三相报警",
|
||||
// key: "A015,B011",
|
||||
// template: "ESafetyTemplate",
|
||||
// },
|
||||
// {
|
||||
// label: "异常状态",
|
||||
// key: "A010",
|
||||
// template: "EDebuff",
|
||||
// },
|
||||
// {
|
||||
// label: "分合闸警示",
|
||||
// key: "A011",
|
||||
// template: "EDeviceSwitchWarning",
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
label: "能源管理",
|
||||
key: "energyManage",
|
||||
|
|
|
@ -2,23 +2,33 @@
|
|||
<!-- 告警记录功能 -->
|
||||
<div class="app-container alarm-record">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
v-show="showSearch"
|
||||
ref="queryForm"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
:model="queryParams"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="报警时间" prop="alarmTime">
|
||||
<el-form-item label="所属项目" prop="inProject">
|
||||
<el-select v-model="queryParams.inProject" clearable placeholder="请选择所属项目" size="small">
|
||||
<el-option
|
||||
v-for="(item, index) in inProjectList"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="告警时间" prop="alarmTime">
|
||||
<el-date-picker
|
||||
v-model="time"
|
||||
size="small"
|
||||
@change="queryTimeChange"
|
||||
clearable
|
||||
type="datetimerange"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
clearable
|
||||
end-placeholder="结束日期"
|
||||
range-separator="至"
|
||||
size="small"
|
||||
start-placeholder="开始日期"
|
||||
type="datetimerange"
|
||||
@change="queryTimeChange"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
@ -26,17 +36,17 @@
|
|||
<el-form-item label="告警类型" prop="typeName">
|
||||
<el-input
|
||||
v-model="queryParams.typeName"
|
||||
placeholder="请输入告警类型"
|
||||
clearable
|
||||
placeholder="请输入告警类型"
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
|
@ -44,10 +54,10 @@
|
|||
>重置</el-button
|
||||
>
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
plain
|
||||
size="mini"
|
||||
type="warning"
|
||||
@click="handleExport"
|
||||
>导出</el-button
|
||||
>
|
||||
|
@ -61,23 +71,23 @@
|
|||
@sort-change="sortChange"
|
||||
>
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
align="center"
|
||||
:index="indexFormatter"
|
||||
width="80px"
|
||||
align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="60"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="设备名称"
|
||||
align="left"
|
||||
width="200px"
|
||||
label="设备名称"
|
||||
prop="deviceName"
|
||||
/>
|
||||
<el-table-column align="center" label="所属项目" prop="inProjectName" />
|
||||
<!-- <el-table-column label="设备当前值" align="left" width="200px" prop="currentValue" /> -->
|
||||
<el-table-column label="推送内容" align="left" prop="alarmContent" />
|
||||
<el-table-column align="left" label="推送内容" prop="alarmContent" />
|
||||
<el-table-column
|
||||
label="报警时间"
|
||||
align="center"
|
||||
label="报警时间"
|
||||
prop="alarmTime"
|
||||
sortable="custom"
|
||||
width="150"
|
||||
|
@ -89,19 +99,17 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="处理状态"
|
||||
width="100px"
|
||||
align="center"
|
||||
prop="processStatus"
|
||||
:formatter="stateFormatter"
|
||||
/>
|
||||
<el-table-column label="处理结果" align="left" prop="processResult" />
|
||||
<el-table-column
|
||||
label="处理时间"
|
||||
align="center"
|
||||
label="处理状态"
|
||||
prop="processStatus"
|
||||
/>
|
||||
<el-table-column align="left" label="处理结果" prop="processResult" />
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="处理时间"
|
||||
prop="processTime"
|
||||
sortable="custom"
|
||||
width="150"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
|
@ -110,30 +118,28 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="告警类型"
|
||||
align="left"
|
||||
width="200px"
|
||||
label="告警类型"
|
||||
prop="typeName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="200"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-show="scope.row.processStatus === '0'"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
v-show="scope.row.processStatus === '0'"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>处理</el-button
|
||||
>
|
||||
<el-button
|
||||
icon="el-icon-document-add"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-document-add"
|
||||
@click="handleWork(scope.row)"
|
||||
>创建工单</el-button
|
||||
>
|
||||
|
@ -143,17 +149,17 @@
|
|||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-dialog
|
||||
class="eldialog-wrap"
|
||||
:close-on-click-modal="false"
|
||||
:title="title"
|
||||
:visible.sync="open"
|
||||
class="eldialog-wrap"
|
||||
width="600px"
|
||||
>
|
||||
<el-form
|
||||
|
@ -164,10 +170,10 @@
|
|||
>
|
||||
<el-form-item label="处理结果:" prop="processResult">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
v-model="form.processResult"
|
||||
:rows="2"
|
||||
placeholder="请输入处理结果"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
@ -193,6 +199,7 @@ import {
|
|||
import { handlerRecord } from "@/api/alarm/record";
|
||||
|
||||
import Editor from "@/components/Editor";
|
||||
import { listProject } from "@/api/tenant/project";
|
||||
|
||||
export default {
|
||||
name: "Record",
|
||||
|
@ -225,6 +232,7 @@ export default {
|
|||
pageSize: 10,
|
||||
typeName: null,
|
||||
typeCode: null,
|
||||
inProject: null,
|
||||
beginTime: null,
|
||||
endTime: null,
|
||||
alarmDivide: "ALARM",
|
||||
|
@ -236,13 +244,26 @@ export default {
|
|||
// 表单校验
|
||||
rules: {},
|
||||
time: [],
|
||||
inProjectList:[],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.newTime();
|
||||
this.getList();
|
||||
this.getInProjectList();
|
||||
},
|
||||
methods: {
|
||||
// 查询所属项目列表
|
||||
getInProjectList() {
|
||||
listProject({
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
orderByColumn: 'createTime',
|
||||
isAsc: 'desc'
|
||||
}).then(response => {
|
||||
this.inProjectList = response.rows;
|
||||
});
|
||||
},
|
||||
// 处理告警
|
||||
handleUpdate(row) {
|
||||
const recordId = row.recordId || this.ids;
|
||||
|
|
|
@ -2,40 +2,50 @@
|
|||
<!-- 预警记录功能 -->
|
||||
<div class="app-container alarm-record">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
v-show="showSearch"
|
||||
ref="queryForm"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
:model="queryParams"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="所属项目" prop="inProject">
|
||||
<el-select v-model="queryParams.inProject" clearable placeholder="请选择所属项目" size="small">
|
||||
<el-option
|
||||
v-for="(item, index) in inProjectList"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警时间" prop="alarmTime">
|
||||
<el-date-picker
|
||||
v-model="time"
|
||||
size="small"
|
||||
@change="queryTimeChange"
|
||||
clearable
|
||||
type="datetimerange"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
clearable
|
||||
end-placeholder="结束日期"
|
||||
range-separator="至"
|
||||
size="small"
|
||||
start-placeholder="开始日期"
|
||||
type="datetimerange"
|
||||
@change="queryTimeChange"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警类型" prop="typeName">
|
||||
<el-input
|
||||
v-model="queryParams.typeName"
|
||||
placeholder="请输入预警类型"
|
||||
clearable
|
||||
placeholder="请输入预警类型"
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
|
@ -43,10 +53,10 @@
|
|||
>重置</el-button
|
||||
>
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
plain
|
||||
size="mini"
|
||||
type="warning"
|
||||
@click="handleExport"
|
||||
>导出</el-button
|
||||
>
|
||||
|
@ -60,26 +70,26 @@
|
|||
@sort-change="sortChange"
|
||||
>
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
align="center"
|
||||
:index="indexFormatter"
|
||||
width="80px"
|
||||
align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="60"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="设备名称"
|
||||
align="left"
|
||||
width="200px"
|
||||
label="设备名称"
|
||||
prop="deviceName"
|
||||
/>
|
||||
<el-table-column align="center" label="所属项目" prop="inProjectName" />
|
||||
<!-- <el-table-column label="设备当前值" align="left" width="200px" prop="currentValue" /> -->
|
||||
<el-table-column label="推送内容" align="left" prop="alarmContent" />
|
||||
<el-table-column align="left" label="推送内容" prop="alarmContent" />
|
||||
<el-table-column
|
||||
label="预警时间"
|
||||
align="center"
|
||||
label="预警时间"
|
||||
prop="alarmTime"
|
||||
width="150"
|
||||
sortable="custom"
|
||||
width="150"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
|
@ -88,19 +98,17 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="处理状态"
|
||||
width="100px"
|
||||
align="center"
|
||||
prop="processStatus"
|
||||
:formatter="stateFormatter"
|
||||
/>
|
||||
<el-table-column label="处理结果" align="left" prop="processResult" />
|
||||
<el-table-column
|
||||
label="处理时间"
|
||||
align="center"
|
||||
sortable="custom"
|
||||
label="处理状态"
|
||||
prop="processStatus"
|
||||
/>
|
||||
<el-table-column align="left" label="处理结果" prop="processResult" />
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="处理时间"
|
||||
prop="processTime"
|
||||
width="150"
|
||||
sortable="custom"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
|
@ -109,30 +117,28 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="预警类型"
|
||||
align="left"
|
||||
width="200px"
|
||||
label="预警类型"
|
||||
prop="typeName"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="200"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-show="scope.row.processStatus === '0'"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
v-show="scope.row.processStatus === '0'"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>处理</el-button
|
||||
>
|
||||
<el-button
|
||||
icon="el-icon-document-add"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-document-add"
|
||||
@click="handleWork(scope.row)"
|
||||
>创建工单</el-button
|
||||
>
|
||||
|
@ -142,17 +148,17 @@
|
|||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-dialog
|
||||
class="eldialog-wrap"
|
||||
:close-on-click-modal="false"
|
||||
:title="title"
|
||||
:visible.sync="open"
|
||||
class="eldialog-wrap"
|
||||
width="600px"
|
||||
>
|
||||
<el-form
|
||||
|
@ -163,10 +169,10 @@
|
|||
>
|
||||
<el-form-item label="处理结果:" prop="processResult">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
v-model="form.processResult"
|
||||
:rows="2"
|
||||
placeholder="请输入处理结果"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
@ -191,6 +197,7 @@ import {
|
|||
} from "@/api/alarm/tenantAlarm";
|
||||
import Editor from "@/components/Editor";
|
||||
import { handlerRecord } from "@/api/alarm/record";
|
||||
import { listProject } from "@/api/tenant/project";
|
||||
|
||||
export default {
|
||||
name: "Warning",
|
||||
|
@ -223,6 +230,7 @@ export default {
|
|||
pageSize: 10,
|
||||
typeName: null,
|
||||
typeCode: null,
|
||||
inProject: null,
|
||||
beginTime: null,
|
||||
endTime: null,
|
||||
alarmDivide: "WARNING",
|
||||
|
@ -234,12 +242,26 @@ export default {
|
|||
// 表单校验
|
||||
rules: {},
|
||||
time: [],
|
||||
// 弹出层标题
|
||||
inProjectList:[],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getInProjectList();
|
||||
},
|
||||
methods: {
|
||||
// 查询所属项目列表
|
||||
getInProjectList() {
|
||||
listProject({
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
orderByColumn: 'createTime',
|
||||
isAsc: 'desc'
|
||||
}).then(response => {
|
||||
this.inProjectList = response.rows;
|
||||
});
|
||||
},
|
||||
sortChange(column) {
|
||||
const sort = {
|
||||
isAsc: column.order === "descending" ? "desc" : "asc",
|
||||
|
|
|
@ -9,6 +9,16 @@
|
|||
:model="queryParams"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="所属项目" prop="inProject">
|
||||
<el-select v-model="queryParams.inProject" clearable placeholder="请选择所属项目" size="small">
|
||||
<el-option
|
||||
v-for="(item, index) in inProjectList"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceName">
|
||||
<el-input
|
||||
v-model="queryParams.deviceName"
|
||||
|
@ -70,9 +80,14 @@
|
|||
type="index"
|
||||
width="80px"
|
||||
></el-table-column>
|
||||
<el-table-column align="left" label="设备名称" prop="deviceName" />
|
||||
<el-table-column align="left" label="所属型号" prop="modelName" />
|
||||
<el-table-column align="left" label="设备名称" prop="deviceName" >
|
||||
<template slot-scope="scope">
|
||||
<el-link :underline="false" type="primary" @click="handleDetails(scope.row)">{{ scope.row.deviceName }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="left" label="设备key" prop="deviceKey" />
|
||||
<el-table-column align="left" label="所属型号" prop="modelName" />
|
||||
<el-table-column align="center" label="所属项目" prop="inProjectName" />
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="设备码"
|
||||
|
@ -144,6 +159,7 @@ import {
|
|||
import DetailsWrap from './profile/details'
|
||||
import GatewayDetail from '@/views/profile/DeviceDetailsView/index'
|
||||
import JsBarcode from "jsbarcode";
|
||||
import { listProject } from "@/api/tenant/project";
|
||||
const deviceStatusOpt = {
|
||||
ONLINE: "在线",
|
||||
OFFLINE: "离线",
|
||||
|
@ -188,6 +204,7 @@ export default {
|
|||
// 设备表格数据
|
||||
deviceList: [],
|
||||
// 弹出层标题
|
||||
inProjectList:[],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
|
@ -196,6 +213,7 @@ export default {
|
|||
parentId: null,
|
||||
deviceName: null,
|
||||
deviceState: null,
|
||||
inProject: null,
|
||||
deviceType: null,
|
||||
orderByColumn: "createTime",
|
||||
isAsc: "desc"
|
||||
|
@ -209,6 +227,7 @@ export default {
|
|||
this.handleDetails(this.$route.query)
|
||||
}
|
||||
this.getDeviceTypeList();
|
||||
this.getInProjectList();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
|
@ -250,6 +269,17 @@ export default {
|
|||
this.form.parentName = "";
|
||||
}
|
||||
},
|
||||
// 查询所属项目列表
|
||||
getInProjectList() {
|
||||
listProject({
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
orderByColumn: 'createTime',
|
||||
isAsc: 'desc'
|
||||
}).then(response => {
|
||||
this.inProjectList = response.rows;
|
||||
});
|
||||
},
|
||||
// 查询设备类型列表
|
||||
getDeviceTypeList() {
|
||||
listDeviceTypeList().then(response => {
|
||||
|
|
Loading…
Reference in New Issue