diff --git a/src/views/model/alert/deviceparamalert.vue b/src/views/model/alert/deviceparamalert.vue index a62342d..e38df3b 100644 --- a/src/views/model/alert/deviceparamalert.vue +++ b/src/views/model/alert/deviceparamalert.vue @@ -142,7 +142,7 @@ - + - + + + + + + + + - + @@ -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; } }) }