|
|
@ -1,6 +1,6 @@ |
|
|
|
<template> |
|
|
|
<div class="app-container"> |
|
|
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="80px" class="my-custom-form" > |
|
|
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px" class="my-custom-form" > |
|
|
|
<el-row> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="数据类型" prop="paramType"> |
|
|
@ -15,16 +15,58 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="界限值" prop="beginValue"> |
|
|
|
<el-form-item label="设备名称" prop="deviceName"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.beginValue" |
|
|
|
placeholder="请输入界限值" |
|
|
|
v-model="queryParams.deviceName" |
|
|
|
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> |
|
|
|
<el-col :span="4" v-show="collapseVisible"> |
|
|
|
<el-form-item label="设备Id" prop="deviceId"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.deviceId" |
|
|
|
placeholder="请输入设备Id" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" v-show="collapseVisible"> |
|
|
|
<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" v-show="collapseVisible"> |
|
|
|
<el-form-item label="告警方式" prop="methodIds"> |
|
|
|
<el-select v-model="queryParams.methodIds" multiple placeholder="请选择告警方式ID" clearable> |
|
|
|
<el-option |
|
|
|
v-for="item in methodList" |
|
|
|
:key="item.id" |
|
|
|
:label="item.methodName" |
|
|
|
:value="item.id" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" v-show="collapseVisible"> |
|
|
|
<el-form-item label="是否告警" prop="alertFlag"> |
|
|
|
<el-select v-model="queryParams.alertFlag" placeholder="请选择是否告警" clearable> |
|
|
|
<el-option |
|
|
@ -36,6 +78,48 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" v-show="collapseVisible"> |
|
|
|
<el-form-item label="浮点值" prop="floatValue"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.floatValue" |
|
|
|
placeholder="请输入浮点值" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" v-show="collapseVisible"> |
|
|
|
<el-form-item label="整数值" prop="intValue"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.intValue" |
|
|
|
placeholder="请输入整数值" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" v-show="collapseVisible"> |
|
|
|
<el-form-item label="开关值" prop="boolValue"> |
|
|
|
<el-select v-model="form.value" placeholder="请选择开关值"> |
|
|
|
<el-option |
|
|
|
v-for="dict in dc_alert_value" |
|
|
|
:key="dict.label" |
|
|
|
:label="dict.label" |
|
|
|
:value="parseFloat(dict.label)" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" v-show="collapseVisible"> |
|
|
|
<el-form-item label="字符值" prop="stringValue"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.stringValue" |
|
|
|
placeholder="请输入字符值" |
|
|
|
clearable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" v-show="collapseVisible"> |
|
|
|
<el-form-item label="策略ID" prop="alertId"> |
|
|
|
<el-input |
|
|
@ -73,23 +157,12 @@ |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" v-show="collapseVisible"> |
|
|
|
<el-col :span="4" v-show="collapseVisible"> |
|
|
|
<el-form-item label="排序" prop="sortId"> |
|
|
|
<el-input-number v-model="queryParams.sortId" :min="1" :max="1000" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" v-show="collapseVisible"> |
|
|
|
<el-form-item label="告警方式" prop="methodId"> |
|
|
|
<el-select v-model="queryParams.methodId" placeholder="请选择告警方式ID" clearable> |
|
|
|
<el-option |
|
|
|
v-for="item in methodList" |
|
|
|
:key="item.id" |
|
|
|
:label="item.methodName" |
|
|
|
:value="item.id" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="6" class="childTextAlignRight"> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |
|
|
@ -113,7 +186,7 @@ |
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="policyList" @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="id" /> --> |
|
|
|
<el-table-column label="设备名称" align="center" prop="deviceName" :width="120"/> |
|
|
|
<el-table-column label="中台设备ID" align="center" prop="deviceId" /> |
|
|
|
<el-table-column label="参数名称" align="center" prop="paramName" :width="120"/>】 |
|
|
@ -123,7 +196,14 @@ |
|
|
|
<dict-tag :options="dc_param_value_type" :value="scope.row.paramType"/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="控制值" align="center" prop="beginValue" /> |
|
|
|
<el-table-column label="浮点值" align="center" prop="floatValue" /> |
|
|
|
<el-table-column label="整数值" align="center" prop="intValue" /> |
|
|
|
<el-table-column label="开关值" align="center" prop="boolValue" > |
|
|
|
<template #default="scope"> |
|
|
|
{{getBoolValueDic(scope.row.boolValue)}} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="字符值" align="center" prop="stringValue" /> |
|
|
|
<!-- <el-table-column label="结束值" align="center" prop="endValue" /> --> |
|
|
|
<el-table-column label="是否告警" align="center" prop="alertFlag" > |
|
|
|
<template #default="scope"> |
|
|
@ -138,9 +218,9 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="排序" align="center" prop="sortId" /> |
|
|
|
<el-table-column label="告警方式" align="center" prop="methodId" > |
|
|
|
<el-table-column label="告警方式" align="center" prop="methodIds" > |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ getMethodName(scope.row.methodId) }}</span> |
|
|
|
<span>{{ getMethodName(scope.row.methodIds) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -229,7 +309,7 @@ import { selectDeviceParamPolicy, listPolicy, getPolicy, delPolicy, addPolicy, u |
|
|
|
import { listMethod } from "@/api/model/method"; |
|
|
|
const { proxy } = getCurrentInstance(); |
|
|
|
const router = useRouter(); |
|
|
|
const { dc_param_value_type } = proxy.useDict('dc_param_value_type'); |
|
|
|
const { dc_param_value_type,dc_bool_value } = proxy.useDict('dc_param_value_type','dc_bool_value'); |
|
|
|
const policyList = ref([]); |
|
|
|
const open = ref(false); |
|
|
|
const loading = ref(true); |
|
|
@ -365,7 +445,7 @@ function submitForm() { |
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
|
function handleExport() { |
|
|
|
proxy.download('model/policy/export', { |
|
|
|
proxy.download('model/dcBusiAlertParamPolicy/export', { |
|
|
|
...queryParams.value |
|
|
|
}, `policy_${new Date().getTime()}.xlsx`) |
|
|
|
} |
|
|
@ -381,12 +461,18 @@ function initializeDeviceUuid(){ |
|
|
|
form.value.alertId = router.currentRoute._value.query.id; |
|
|
|
} |
|
|
|
|
|
|
|
function getMethodName(methodId){ |
|
|
|
function getMethodName(methodIds){ |
|
|
|
let methodNameTable = ""; |
|
|
|
methodList.value.forEach(item=>{ |
|
|
|
if(item.id == methodId){ |
|
|
|
methodNameTable = item.methodName; |
|
|
|
}; |
|
|
|
let methodIdList = methodIds?.split(","); |
|
|
|
methodIdList?.forEach(methodId=>{ |
|
|
|
methodList.value.forEach(item=>{ |
|
|
|
if(item.id == methodId){ |
|
|
|
if(methodNameTable != ""){ |
|
|
|
methodNameTable += ","; |
|
|
|
} |
|
|
|
methodNameTable = item.methodName; |
|
|
|
}; |
|
|
|
}) |
|
|
|
}) |
|
|
|
return methodNameTable; |
|
|
|
} |
|
|
@ -427,6 +513,21 @@ const calculateTableHeight = () => { |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
function toggleCollapse() { |
|
|
|
collapseVisible.value = !collapseVisible.value; |
|
|
|
if(collapseVisible.value){ |
|
|
|
editName.value = "折叠筛选项"; |
|
|
|
}else{ |
|
|
|
editName.value = "更多筛选项" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function getBoolValueDic(bool) { |
|
|
|
if(bool){ |
|
|
|
return "1"; |
|
|
|
} |
|
|
|
return "0"; |
|
|
|
} |
|
|
|
|
|
|
|
initializeDeviceUuid(); |
|
|
|
getList(); |
|
|
|