|
|
@ -142,7 +142,7 @@ |
|
|
|
<el-row> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="告警设备" prop="deviceUuid"> |
|
|
|
<el-select v-model="form.deviceUuid" filterable placeholder="请选择参数" clearable @change="getParamsList"> |
|
|
|
<el-select v-model="form.deviceUuid" filterable placeholder="请选择设备" clearable @change="getParamsListDevice"> |
|
|
|
<el-option |
|
|
|
v-for="item in deviceList" |
|
|
|
:key="item.uuid" |
|
|
@ -152,9 +152,21 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="12" v-show="partionDisabled"> |
|
|
|
<el-form-item label="分区" prop="partion"> |
|
|
|
<el-select v-model="form.partion" filterable placeholder="请选择分区" clearable @change="getParamsListPartion"> |
|
|
|
<el-option |
|
|
|
v-for="item in dc_device_partion" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" v-show="paramDisabled"> |
|
|
|
<el-form-item label="告警参数" prop="paramCode"> |
|
|
|
<el-select v-model="form.paramCode" filterable placeholder="请选择参数" clearable @change="setParamsType"> |
|
|
|
<el-select v-model="form.paramCode" filterable :placeholder="paramTip" clearable @change="setParamsType"> |
|
|
|
<el-option |
|
|
|
v-for="item in paramsList" |
|
|
|
:key="item.paramCode" |
|
|
@ -173,7 +185,7 @@ |
|
|
|
</el-form> |
|
|
|
<template #footer> |
|
|
|
<div class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
|
|
<el-button type="primary" :disabled="submitDisabled" @click="submitForm">确 定</el-button> |
|
|
|
<el-button @click="cancel">取 消</el-button> |
|
|
|
</div> |
|
|
|
</template> |
|
|
@ -345,7 +357,7 @@ import {listPolicyInfo,updatePolicy,updatePolicyBatch,addPolicy,addPolicyBatch,l |
|
|
|
import lock from "@/assets/icons/svg/lock.svg"; |
|
|
|
const { proxy } = getCurrentInstance(); |
|
|
|
const router = useRouter(); |
|
|
|
const { operator_sign,dc_param_value_type,dc_alert_level } = proxy.useDict('operator_sign','dc_param_value_type','dc_alert_level'); |
|
|
|
const { operator_sign,dc_param_value_type,dc_alert_level,dc_device_partion } = proxy.useDict('operator_sign','dc_param_value_type','dc_alert_level','dc_device_partion'); |
|
|
|
const alertList = ref([]); |
|
|
|
const open = ref(false); |
|
|
|
const openPolicy = ref(false); |
|
|
@ -368,7 +380,6 @@ const statusTypeVisiable = ref(false); |
|
|
|
const sortIdVisiable = ref(false); |
|
|
|
const methodIdsVisiable = ref(false); |
|
|
|
const policyModelVisiable = ref(false); |
|
|
|
const policyEnabledVisiable = ref(false); |
|
|
|
const policyParams = ref([]); |
|
|
|
const policyAlertId = ref(""); |
|
|
|
const policyDeviceUuid = ref(""); |
|
|
@ -383,17 +394,15 @@ const levelVisiable = ref(false); |
|
|
|
const nameVisiable = ref(false); |
|
|
|
const fixedColumns = ref(false); |
|
|
|
const tableHeight = ref("0px"); |
|
|
|
const sortItemMap = ref({}); |
|
|
|
const queryParamFilter = ref({}); |
|
|
|
const sortProps = ref([]); |
|
|
|
const collapseVisible = ref(false); |
|
|
|
const paramTip = ref("请先选择设备"); |
|
|
|
const paramDisabled = ref(false); |
|
|
|
const partionDisabled = ref(false); |
|
|
|
const submitDisabled = ref(true); |
|
|
|
const alert_value = ref([ |
|
|
|
{label: '1', value: true, elTagType: 'default', elTagClass: null}, |
|
|
|
{label: '0', value: false, elTagType: 'default', elTagClass: null} |
|
|
|
]); |
|
|
|
|
|
|
|
const statusSelects = ref([]); |
|
|
|
const statusValueSelects = ref([]); |
|
|
|
const data = reactive({ |
|
|
|
form: {}, |
|
|
|
formPolicy: {}, |
|
|
@ -410,6 +419,7 @@ const data = reactive({ |
|
|
|
queryParamsParam: { |
|
|
|
deviceUuid: null, |
|
|
|
paramCode: null, |
|
|
|
partion: null, |
|
|
|
}, |
|
|
|
queryParamsPolicy:{ |
|
|
|
pageNum: 1, |
|
|
@ -433,6 +443,9 @@ const data = reactive({ |
|
|
|
paramCode: [ |
|
|
|
{ required: true, message: "参数编码不能为空", trigger: "blur" } |
|
|
|
], |
|
|
|
partion: [ |
|
|
|
{ required: true, message: "参数分区不能为空", trigger: "blur" } |
|
|
|
], |
|
|
|
}, |
|
|
|
rulesPolicy: { |
|
|
|
deviceUuid: [ |
|
|
@ -441,7 +454,8 @@ const data = reactive({ |
|
|
|
paramCode: [ |
|
|
|
{ required: true, message: "参数编码不能为空", trigger: "blur" } |
|
|
|
], |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
const { queryParamsDevice, queryParamsParam, queryParams, form, rules,queryParamsPolicy,queryPolicy, formPolicy, rulesPolicy } = toRefs(data); |
|
|
@ -550,6 +564,14 @@ function handleAdd() { |
|
|
|
reset(); |
|
|
|
getDeviceList(); |
|
|
|
open.value = true; |
|
|
|
queryParamsParam.value={ |
|
|
|
deviceUuid: null, |
|
|
|
paramCode: null, |
|
|
|
partion: null, |
|
|
|
}, |
|
|
|
partionDisabled.value = false; |
|
|
|
paramDisabled.value = false; |
|
|
|
submitDisabled.value = true; |
|
|
|
title.value = "添加设备告警"; |
|
|
|
} |
|
|
|
|
|
|
@ -621,7 +643,9 @@ function submitForm() { |
|
|
|
addAlert(form.value).then(response => { |
|
|
|
proxy.$modal.msgSuccess("新增成功"); |
|
|
|
open.value = false; |
|
|
|
debugger |
|
|
|
getList(); |
|
|
|
handlePolicy(response.data); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -696,9 +720,30 @@ function getDeviceList(){ |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function getParamsList(deviceUuid){ |
|
|
|
function getParamsListDevice(deviceUuid){ |
|
|
|
loading.value = true; |
|
|
|
queryParamsParam.value.deviceUuid = deviceUuid; |
|
|
|
if(queryParamsParam.value.partion == null){ |
|
|
|
partionDisabled.value = true; |
|
|
|
paramTip.value = "请先选择分区"; |
|
|
|
return; |
|
|
|
}else{ |
|
|
|
paramDisabled.value = true; |
|
|
|
} |
|
|
|
listAlertParamSelect(queryParamsParam.value).then(response => { |
|
|
|
paramsList.value = response.data; |
|
|
|
loading.value = false; |
|
|
|
}); |
|
|
|
} |
|
|
|
function getParamsListPartion(partion){ |
|
|
|
loading.value = true; |
|
|
|
queryParamsParam.value.partion = partion; |
|
|
|
if(queryParamsParam.value.deviceUuid == null){ |
|
|
|
paramTip.value = "请先选择设备"; |
|
|
|
return; |
|
|
|
}else{ |
|
|
|
paramDisabled.value = true; |
|
|
|
} |
|
|
|
listAlertParamSelect(queryParamsParam.value).then(response => { |
|
|
|
paramsList.value = response.data; |
|
|
|
loading.value = false; |
|
|
@ -989,6 +1034,7 @@ function setParamsType(val){ |
|
|
|
paramsList.value.forEach(item=>{ |
|
|
|
if(item.paramCode == val){ |
|
|
|
form.value.paramType = item.paramType; |
|
|
|
submitDisabled.value = false; |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|