|
|
@ -1,141 +1,154 @@ |
|
|
|
<template> |
|
|
|
<div class="app-container"> |
|
|
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px" class="my-custom-form"> |
|
|
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" class="my-custom-form"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="设备编号" prop="deviceUuid"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.deviceUuid" |
|
|
|
placeholder="请输入设备编号" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="设备名称" prop="deviceName"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.deviceName" |
|
|
|
placeholder="请输入设备名称" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="参数编码" prop="paramCode"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.paramCode" |
|
|
|
placeholder="请输入参数编码" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="参数名称" prop="paramName"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.paramName" |
|
|
|
placeholder="请输入参数名称" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-col :span="4" class="card-box"> |
|
|
|
<div class="head-container"> |
|
|
|
<el-input v-model="deptName" placeholder="请输入部门名称" clearable prefix-icon="Search" style="margin-bottom: 20px" /> |
|
|
|
</div> |
|
|
|
<div class="head-container"> |
|
|
|
<el-tree :data="deptOptions" :props="{ label: 'label', children: 'children' }" :expand-on-click-node="false" |
|
|
|
:filter-node-method="filterNode" ref="deptTreeRef" node-key="id" highlight-current default-expand-all |
|
|
|
@node-click="handleNodeClick" /> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item class="childTextAlignCenter"> |
|
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |
|
|
|
<el-button type="info" plain icon="Refresh" @click="resetQuery">重置</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-col :span="20"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="设备编号" prop="deviceUuid" label-width="auto"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.deviceUuid" |
|
|
|
placeholder="请输入设备编号" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="设备名称" prop="deviceName" label-width="auto"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.deviceName" |
|
|
|
placeholder="请输入设备名称" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="参数编码" prop="paramCode" label-width="auto"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.paramCode" |
|
|
|
placeholder="请输入参数编码" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="参数名称" prop="paramName" label-width="auto"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.paramName" |
|
|
|
placeholder="请输入参数名称" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item class="childTextAlignLeft"> |
|
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |
|
|
|
<el-button type="info" plain icon="Refresh" @click="resetQuery">重置</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="10" class="mb8"> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="success" |
|
|
|
icon="Plus" |
|
|
|
@click="handleAdd" |
|
|
|
>新增</el-button> |
|
|
|
</el-col> |
|
|
|
<!-- <el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="success" |
|
|
|
icon="Edit" |
|
|
|
@click="handleUpdate" |
|
|
|
>修改</el-button> |
|
|
|
</el-col> --> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="success" |
|
|
|
icon="Delete" |
|
|
|
@click="handleDelete" |
|
|
|
>删除</el-button> |
|
|
|
</el-col> |
|
|
|
<!-- <el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
icon="Download" |
|
|
|
@click="handleExport" |
|
|
|
>导出</el-button> |
|
|
|
</el-col> --> |
|
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-table ref="deviceParamsTable" v-loading="loading" :data="alertList" @selection-change="handleSelectionChange" :max-height="tableHeight" :border="true" :column-width-draggable="true"> |
|
|
|
<el-table-column type="selection" width="55" align="center" fixed="left" /> |
|
|
|
<!-- <el-table-column label="主键" align="center" prop="id" /> --> |
|
|
|
<el-table-column label="设备编号" align="center" prop="deviceUuid" :fixed="fixedColumns?'left':false"> |
|
|
|
<template #header> |
|
|
|
<div class="fixed-column-header" style="text-align: center;display: block;" @dblclick="toggleFixedColumns"> |
|
|
|
<span style="text-align: center;display: block;">设备编号<img style="width:10px;margin-left:5px" v-show="fixedColumns" :src="lock" alt="Image"/></span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="设备名称" align="center" prop="deviceName" :width="120"/> |
|
|
|
<el-table-column label="参数名称" align="center" prop="paramName" :width="120"/> |
|
|
|
<el-table-column label="参数类型" align="center" prop="paramType" :width="120"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :options="dc_param_value_type" :value="scope.row.paramType"/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="参数编码" align="center" prop="paramCode" /> |
|
|
|
<el-table-column label="是否告警" align="center" prop="enabled" :width="120"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-switch v-model="scope.row.enabled" :active-value="1" :inactive-value="0" @change="changeEnabled(scope.row)"/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" :width="300" :fixed="fixedColumns?'right':false"> |
|
|
|
<template #header> |
|
|
|
<div class="fixed-column-header" style="text-align: center;display: block;" @dblclick="toggleFixedColumns"> |
|
|
|
<span style="text-align: center;display: block;">操作<img style="width:10px;margin-left:5px" v-show="fixedColumns" :src="lock" alt="Image"/></span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<template #default="scope"> |
|
|
|
<el-button |
|
|
|
type="text" |
|
|
|
icon="Edit" |
|
|
|
@click="handlePolicy(scope.row)" |
|
|
|
>维护告警策略</el-button> |
|
|
|
<el-button |
|
|
|
type="text" |
|
|
|
icon="Delete" |
|
|
|
@click="handleDelete(scope.row)" |
|
|
|
>删除</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<pagination |
|
|
|
v-show="total>0" |
|
|
|
:total="total" |
|
|
|
v-model:page="queryParams.pageNum" |
|
|
|
v-model:limit="queryParams.pageSize" |
|
|
|
@pagination="getList" |
|
|
|
class="paddingBothLeftRight" |
|
|
|
/> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8"> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="success" |
|
|
|
icon="Plus" |
|
|
|
@click="handleAdd" |
|
|
|
>新增</el-button> |
|
|
|
</el-col> |
|
|
|
<!-- <el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="success" |
|
|
|
icon="Edit" |
|
|
|
@click="handleUpdate" |
|
|
|
>修改</el-button> |
|
|
|
</el-col> --> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="success" |
|
|
|
icon="Delete" |
|
|
|
@click="handleDelete" |
|
|
|
>删除</el-button> |
|
|
|
</el-col> |
|
|
|
<!-- <el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
icon="Download" |
|
|
|
@click="handleExport" |
|
|
|
>导出</el-button> |
|
|
|
</el-col> --> |
|
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-table ref="deviceParamsTable" v-loading="loading" :data="alertList" @selection-change="handleSelectionChange" :max-height="tableHeight" :border="true" :column-width-draggable="true"> |
|
|
|
<el-table-column type="selection" width="55" align="center" fixed="left" /> |
|
|
|
<!-- <el-table-column label="主键" align="center" prop="id" /> --> |
|
|
|
<el-table-column label="设备编号" align="center" prop="deviceUuid" :fixed="fixedColumns?'left':false"> |
|
|
|
<template #header> |
|
|
|
<div class="fixed-column-header" style="text-align: center;display: block;" @dblclick="toggleFixedColumns"> |
|
|
|
<span style="text-align: center;display: block;">设备编号<img style="width:10px;margin-left:5px" v-show="fixedColumns" :src="lock" alt="Image"/></span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="设备名称" align="center" prop="deviceName" :width="120"/> |
|
|
|
<el-table-column label="参数名称" align="center" prop="paramName" :width="120"/> |
|
|
|
<el-table-column label="参数类型" align="center" prop="paramType" :width="120"> |
|
|
|
<template #default="scope"> |
|
|
|
<dict-tag :options="dc_param_value_type" :value="scope.row.paramType"/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="参数编码" align="center" prop="paramCode" /> |
|
|
|
<el-table-column label="是否告警" align="center" prop="enabled" :width="120"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-switch v-model="scope.row.enabled" :active-value="1" :inactive-value="0" @change="changeEnabled(scope.row)"/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" :width="300" :fixed="fixedColumns?'right':false"> |
|
|
|
<template #header> |
|
|
|
<div class="fixed-column-header" style="text-align: center;display: block;" @dblclick="toggleFixedColumns"> |
|
|
|
<span style="text-align: center;display: block;">操作<img style="width:10px;margin-left:5px" v-show="fixedColumns" :src="lock" alt="Image"/></span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<template #default="scope"> |
|
|
|
<el-button |
|
|
|
type="text" |
|
|
|
icon="Edit" |
|
|
|
@click="handlePolicy(scope.row)" |
|
|
|
>维护告警策略</el-button> |
|
|
|
<el-button |
|
|
|
type="text" |
|
|
|
icon="Delete" |
|
|
|
@click="handleDelete(scope.row)" |
|
|
|
>删除</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<pagination |
|
|
|
v-show="total>0" |
|
|
|
:total="total" |
|
|
|
v-model:page="queryParams.pageNum" |
|
|
|
v-model:limit="queryParams.pageSize" |
|
|
|
@pagination="getList" |
|
|
|
class="paddingBothLeftRight" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 添加或修改设备告警对话框 --> |
|
|
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body> |
|
|
|
<el-form ref="alertRef" :model="form" :rules="rules" label-width="80px"> |
|
|
@ -330,6 +343,7 @@ import { listModelEnabledNoPage } from "@/api/model/alertmodel"; |
|
|
|
import { ElMessageBox } from 'element-plus'; |
|
|
|
import {listPolicyInfo,updatePolicy,updatePolicyBatch,addPolicy,addPolicyBatch,listAlertParamSelect } from "@/api/model/policy"; |
|
|
|
import lock from "@/assets/icons/svg/lock.svg"; |
|
|
|
import { deptTreeSelect } from "@/api/system/user"; |
|
|
|
const { proxy } = getCurrentInstance(); |
|
|
|
const router = useRouter(); |
|
|
|
const { dc_operator_sign,dc_param_value_type,dc_alert_level,dc_device_partion } = proxy.useDict('dc_operator_sign','dc_param_value_type','dc_alert_level','dc_device_partion'); |
|
|
@ -374,6 +388,8 @@ const paramTip = ref("请先选择设备"); |
|
|
|
const paramDisabled = ref(false); |
|
|
|
const partionDisabled = ref(false); |
|
|
|
const submitDisabled = ref(true); |
|
|
|
const deptOptions = ref([]); |
|
|
|
const deptName = ref(null); |
|
|
|
const names = ref([]); |
|
|
|
const alert_value = ref([ |
|
|
|
{label: '1', value: true, elTagType: 'default', elTagClass: null}, |
|
|
@ -522,6 +538,8 @@ function handleQuery() { |
|
|
|
/** 重置按钮操作 */ |
|
|
|
function resetQuery() { |
|
|
|
proxy.resetForm("queryRef"); |
|
|
|
queryParams.value.orgCode = null; |
|
|
|
queryParamsDevice.value.orgCode = null; |
|
|
|
handleQuery(); |
|
|
|
} |
|
|
|
|
|
|
@ -1335,7 +1353,32 @@ const calculateTableHeight = () => { |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
function getDeptTree() { |
|
|
|
deptTreeSelect().then(response => { |
|
|
|
deptOptions.value = response.data; |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
/** 节点单击事件 */ |
|
|
|
function handleNodeClick(data) { |
|
|
|
queryParams.value.orgCode = data.id; |
|
|
|
queryParamsDevice.value.orgCode = data.id; |
|
|
|
handleQuery(); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** 通过条件过滤节点 */ |
|
|
|
const filterNode = (value, data) => { |
|
|
|
if (!value) return true; |
|
|
|
return data.label.indexOf(value) !== -1; |
|
|
|
}; |
|
|
|
/** 根据名称筛选部门树 */ |
|
|
|
watch(deptName, val => { |
|
|
|
proxy.$refs["deptTreeRef"].filter(val); |
|
|
|
}); |
|
|
|
|
|
|
|
getList(); |
|
|
|
|
|
|
|
|
|
|
|
getList(); |
|
|
|
getDeptTree(); |
|
|
|
</script> |
|
|
|