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