|
@@ -40,6 +40,7 @@ const { dictData: readFuncCode, getDictData: getReadFuncCode } = useDictData(Dic
|
|
const { dictData: isHighFreqParam, getDictData: getIsHighFreqParam } = useDictData(DictCode.IsHighFreqParam);
|
|
const { dictData: isHighFreqParam, getDictData: getIsHighFreqParam } = useDictData(DictCode.IsHighFreqParam);
|
|
|
|
|
|
const customParamsForm = reactive<Partial<ProtocolParamInfo>>({
|
|
const customParamsForm = reactive<Partial<ProtocolParamInfo>>({
|
|
|
|
+ paramName: '',
|
|
gatewayParamName: '',
|
|
gatewayParamName: '',
|
|
gatewayParamCode: '',
|
|
gatewayParamCode: '',
|
|
unit: '',
|
|
unit: '',
|
|
@@ -96,6 +97,13 @@ const rules = computed<FormRules<ProtocolParamInfo>>(() => {
|
|
trigger: 'blur',
|
|
trigger: 'blur',
|
|
},
|
|
},
|
|
],
|
|
],
|
|
|
|
+ readFuncCode: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: t('common.plzSelect', { name: t('setupProtocol.protocolParamFields.readFunctionCode') }),
|
|
|
|
+ trigger: 'blur',
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
addrLength: [
|
|
addrLength: [
|
|
{
|
|
{
|
|
required: true,
|
|
required: true,
|
|
@@ -170,6 +178,10 @@ onMounted(() => {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+const handleParamNameChange = () => {
|
|
|
|
+ customParamsForm.paramName = customParamsForm.gatewayParamName;
|
|
|
|
+};
|
|
|
|
+
|
|
const handleReadWriteTypeChange = (_value: SelectValue, option: DefaultOptionType) => {
|
|
const handleReadWriteTypeChange = (_value: SelectValue, option: DefaultOptionType) => {
|
|
customParamsForm.readWriteTypeCode = option.key;
|
|
customParamsForm.readWriteTypeCode = option.key;
|
|
};
|
|
};
|
|
@@ -255,6 +267,7 @@ defineExpose({
|
|
v-model:value="customParamsForm.gatewayParamName"
|
|
v-model:value="customParamsForm.gatewayParamName"
|
|
class="protocol-input"
|
|
class="protocol-input"
|
|
:placeholder="$t('common.plzEnter')"
|
|
:placeholder="$t('common.plzEnter')"
|
|
|
|
+ @change="handleParamNameChange"
|
|
/>
|
|
/>
|
|
</AFormItem>
|
|
</AFormItem>
|
|
</ACol>
|
|
</ACol>
|
|
@@ -282,7 +295,7 @@ defineExpose({
|
|
</AFormItem>
|
|
</AFormItem>
|
|
</ACol>
|
|
</ACol>
|
|
<ACol :span="8">
|
|
<ACol :span="8">
|
|
- <AFormItem :label="$t('setupProtocol.protocolParamFields.readWriteType')" name="readWriteType">
|
|
|
|
|
|
+ <AFormItem :label="$t('setupProtocol.protocolParamFields.readWriteType')">
|
|
<ASelect
|
|
<ASelect
|
|
v-model:value="customParamsForm.readWriteType"
|
|
v-model:value="customParamsForm.readWriteType"
|
|
class="protocol-input"
|
|
class="protocol-input"
|
|
@@ -296,7 +309,7 @@ defineExpose({
|
|
</AFormItem>
|
|
</AFormItem>
|
|
</ACol>
|
|
</ACol>
|
|
<ACol :span="8">
|
|
<ACol :span="8">
|
|
- <AFormItem :label="$t('setupProtocol.protocolParamFields.parsingType')" name="parsingType">
|
|
|
|
|
|
+ <AFormItem :label="$t('setupProtocol.protocolParamFields.parsingType')">
|
|
<ASelect
|
|
<ASelect
|
|
v-model:value="customParamsForm.parsingType"
|
|
v-model:value="customParamsForm.parsingType"
|
|
class="protocol-input"
|
|
class="protocol-input"
|
|
@@ -336,7 +349,7 @@ defineExpose({
|
|
</AFormItem>
|
|
</AFormItem>
|
|
</ACol>
|
|
</ACol>
|
|
<ACol v-if="isModbusProtocol" :span="8">
|
|
<ACol v-if="isModbusProtocol" :span="8">
|
|
- <AFormItem :label="$t('setupProtocol.protocolParamFields.addressLength')" name="addrLength">
|
|
|
|
|
|
+ <AFormItem :label="$t('setupProtocol.protocolParamFields.addressLength')">
|
|
<AInputNumber
|
|
<AInputNumber
|
|
v-model:value="customParamsForm.addrLength"
|
|
v-model:value="customParamsForm.addrLength"
|
|
class="protocol-input"
|
|
class="protocol-input"
|
|
@@ -379,7 +392,7 @@ defineExpose({
|
|
</AFormItem>
|
|
</AFormItem>
|
|
</ACol>
|
|
</ACol>
|
|
<ACol v-if="isS7Protocol" :span="8">
|
|
<ACol v-if="isS7Protocol" :span="8">
|
|
- <AFormItem :label="$t('setupProtocol.protocolParamFields.wordLength')" name="wordLength">
|
|
|
|
|
|
+ <AFormItem :label="$t('setupProtocol.protocolParamFields.wordLength')">
|
|
<ASelect
|
|
<ASelect
|
|
v-model:value="customParamsForm.wordLength"
|
|
v-model:value="customParamsForm.wordLength"
|
|
class="protocol-input"
|
|
class="protocol-input"
|