Browse Source

fix:输入限制空格 数值范围

temp
zhaohy 3 months ago
parent
commit
129ef8845a
  1. 11
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue
  2. 20
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue
  3. 12
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue
  4. 21
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue
  5. 10
      hx-ai-intelligent/src/view/alarmManagement/energyAlarm/status.vue
  6. 8
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue

11
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue

@ -76,6 +76,7 @@
style="height: 32px"
placeholder="请输入异常描述"
:autoSize="{ minRows: 1, maxRows: 1 }"
@keydown="handleKeyDown"
show-count
:maxlength="30" />
</a-form-item>
@ -107,8 +108,8 @@
<a-input-number
style="width: 110px; margin-left: 6px"
placeholder="请输入数值"
:min="-99999999.99"
:max="99999999.99"
:min="-9999999999.99"
:max="9999999999.99"
:precision="2"
v-model:value="infoObject.alarmList[index - 1].num" />
<div
@ -294,6 +295,12 @@
infoObject.value.enableRules = 1;
}
};
const handleKeyDown = (event: KeyboardEvent) => {
// Check if the pressed key is a space
if (event.code === 'Space') {
event.preventDefault();
}
};
//
const toggle = async (value: any, info: any) => {
let enumData = await getEnum({ params: { enumType: 'LogicEnum' } });

20
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue

@ -13,7 +13,12 @@
</div>
<a-form ref="formRef" :model="infoObject" :rules="rules">
<a-form-item name="alarmTitle" label="告警标题">
<ns-input allowClear v-model:value="infoObject.alarmTitle" placeholder="请输入告警标题" />
<ns-input
allowClear
:maxlength="20"
v-model:value="infoObject.alarmTitle"
@keydown="handleKeyDown"
placeholder="请输入告警标题" />
</a-form-item>
<a-form-item label="告警频率" name="alarmFrequency">
<a-select
@ -25,7 +30,11 @@
@change="handleChangeAlarmFrequency" />
</a-form-item>
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
<ns-input-number v-model:value="infoObject.repetitions" placeholder="请输入重复次数" />
<ns-input-number
v-model:value="infoObject.repetitions"
:min="0"
:max="99"
placeholder="请输入重复次数" />
</a-form-item>
<a-form-item label="优先级" name="priority">
<a-select
@ -153,6 +162,13 @@
AlarmFrequencyEnum.value = enumData.data.AlarmFrequencyEnum;
intervalDurationUnitData.value = enumData.data.IntervalDurationUnitEnum;
};
//
const handleKeyDown = (event: KeyboardEvent) => {
// Check if the pressed key is a space
if (event.code === 'Space') {
event.preventDefault();
}
};
const toggle = (value: any) => {
//
getMenu();

12
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue

@ -95,6 +95,7 @@
placeholder="请输入异常描述"
:autoSize="{ minRows: 1, maxRows: 1 }"
show-count
@keydown="handleKeyDown"
:maxlength="30" />
</a-form-item>
<a-form-item label="规则类型" name="ruleType">
@ -118,8 +119,8 @@
<a-input-number
style="width: 110px; margin-left: 6px"
placeholder="请输入数值"
:min="-99999999.99"
:max="99999999.99"
:min="-9999999999.99"
:max="9999999999.99"
:precision="2"
v-model:value="infoObject.alarmList[index - 1].num" />
<div
@ -276,6 +277,13 @@
infoObject.value.enableRules = 1;
}
};
//
const handleKeyDown = (event: KeyboardEvent) => {
// Check if the pressed key is a space
if (event.code === 'Space') {
event.preventDefault();
}
};
const emit = defineEmits(['editObject']);
// id

21
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue

@ -13,7 +13,12 @@
</div>
<a-form ref="formRef" :model="infoObject" :rules="rules">
<a-form-item name="alarmTitle" label="告警标题">
<ns-input allowClear v-model:value="infoObject.alarmTitle" placeholder="请输入告警标题" />
<ns-input
:maxlength="20"
allowClear
v-model:value="infoObject.alarmTitle"
@keydown="handleKeyDown"
placeholder="请输入告警标题" />
</a-form-item>
<a-form-item label="告警频率" name="alarmFrequency">
<a-select
@ -27,7 +32,7 @@
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
<ns-input-number
v-model:value="infoObject.repetitions"
:min="0"
:min="1"
:max="99"
placeholder="请输入重复次数" />
</a-form-item>
@ -38,8 +43,9 @@
<ns-input-number
style="width: 100%"
v-model:value="infoObject.intervalDuration"
:min="0"
:min="1"
:max="99"
@keydown="handleKeyDown"
placeholder="请输入间隔时长">
<template #addonAfter>
<a-select
@ -55,7 +61,7 @@
<ns-input-number
allowClear
style="width: 100%"
:min="0"
:min="1"
:max="999"
v-model:value="infoObject.monitorTime"
placeholder="请输入监测时长">
@ -258,6 +264,13 @@
priority: [{ required: true, message: '请选择优先级', trigger: 'change' }],
// monitorTimeUnit: [{ required: true, message: '', trigger: 'change' }],
};
//
const handleKeyDown = (event: KeyboardEvent) => {
// Check if the pressed key is a space
if (event.code === 'Space') {
event.preventDefault();
}
};
//
const changeSwitch = () => {
switch (infoObject.value.enableRules) {

10
hx-ai-intelligent/src/view/alarmManagement/energyAlarm/status.vue

@ -29,9 +29,10 @@
<a-form-item label="备注" name="remarks">
<a-textarea
v-model:value="infoObject.remarks"
placeholder="请输入异常描述"
placeholder="请输入备注"
:disabled="showEdit"
style="width: 85%"
@keydown="handleKeyDown"
:autoSize="{ minRows: 9, maxRows: 9 }" />
</a-form-item>
</a-form>
@ -166,6 +167,12 @@
}
});
};
const handleKeyDown = (event) => {
// Check if the pressed key is a space
if (event.code === 'Space') {
event.preventDefault();
}
};
return {
infoObject,
changeShowEdit,
@ -178,6 +185,7 @@
visible,
logList,
config,
handleKeyDown,
handleClose,
toggle,
};

8
hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue

@ -32,6 +32,7 @@
placeholder="请输入备注"
:disabled="showEdit"
style="width: 85%"
@keydown="handleKeyDown"
:autoSize="{ minRows: 4, maxRows: 4 }" />
</a-form-item>
</a-form>
@ -125,6 +126,12 @@
showEdit.value = !showEdit.value;
}
};
const handleKeyDown = (event) => {
// Check if the pressed key is a space
if (event.code === 'Space') {
event.preventDefault();
}
};
const toggle = async (data) => {
equipmentAlarm.value = { ...data };
visible.value = true;
@ -173,6 +180,7 @@
changeShowEdit,
showEdit,
equipmentAlarm,
handleKeyDown,
stateOptions,
btnClick,
visible,

Loading…
Cancel
Save