fix: 修复采集器断开文案以及PLC地址回显

This commit is contained in:
jackhoo_98 2023-03-24 15:36:25 +08:00
parent 62bd45e624
commit 32e78e9fc0
2 changed files with 32 additions and 9 deletions

View File

@ -57,8 +57,18 @@
v-model:value="formData.pointKey"
:min="0"
:max="255"
:precision="0"
/>
</j-form-item>
<p
style="color: #616161"
v-if="formData.configuration.function && formData.pointKey"
>
PLC地址:{{
InitAddress[formData.configuration.function] +
formData.pointKey
}}
</p>
<j-form-item
label="寄存器数量"
:name="['configuration', 'parameter', 'quantity']"
@ -70,6 +80,7 @@
v-model:value="formData.configuration.parameter.quantity"
:min="1"
:max="255"
:precision="0"
@blur="changeQuantity"
/>
</j-form-item>
@ -258,6 +269,12 @@ const collectorId = props.data.collectorId;
const provider = props.data.provider;
const oldPointKey = props.data.pointKey;
const InitAddress = {
Coils: 1,
HoldingRegisters: 40001,
InputRegisters: 30001,
};
const formData = ref({
name: '',
configuration: {
@ -371,9 +388,20 @@ const getProviderList = async () => {
value: item.id,
label: item.name,
}));
setProviderList(formData.value.configuration.function);
};
getProviderList();
const setProviderList = (value: string | undefined) => {
providerList.value =
value === 'HoldingRegisters'
? providerListAll.value
: providerListAll.value.filter(
(item: any) => item.value !== 'bool',
);
};
watch(
() => formData.value.configuration.parameter.quantity,
(value) => {
@ -384,14 +412,9 @@ watch(
watch(
() => formData.value.configuration.function,
(value) => {
providerList.value =
value === 'HoldingRegisters'
? providerListAll.value
: providerListAll.value.filter(
(item: any) => item.value !== 'bool',
);
setProviderList(value);
},
{ deep: true },
{ immediate: true, deep: true },
);
watch(
() => props.data,

View File

@ -77,7 +77,7 @@
v-model:value="formData.circuitBreaker.type"
:options="[
{ label: '降频', value: 'LowerFrequency' },
{ label: '断', value: 'Break' },
{ label: '', value: 'Break' },
{ label: '忽略', value: 'Ignore' },
]"
@change="changeCardSelectType"
@ -203,7 +203,7 @@ const getTypeTooltip = (value: string) =>
value === 'LowerFrequency'
? '连续20次异常降低连接频率至原有频率的1/10重试间隔不超过1分钟故障处理后自动恢复至设定连接频率'
: value === 'Break'
? '连续10分钟异常停止采集数据进入断状态,设备重新启用后恢复采集状态'
? '连续10分钟异常停止采集数据进入状态,设备重新启用后恢复采集状态'
: '忽略异常保持原采集频率超时时间为5s';
const handleCancel = () => {