feat(iot):增加 modbus 配置 50%

This commit is contained in:
YunaiV
2026-02-14 09:19:43 +08:00
parent 722afc85df
commit 38597dd19d
11 changed files with 1245 additions and 12 deletions

View File

@@ -127,16 +127,26 @@ export function useBasicFormSchema(
rules: 'required',
},
{
fieldName: 'codecType',
label: '数据格式',
component: 'RadioGroup',
fieldName: 'protocolType',
label: '协议类型',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.IOT_CODEC_TYPE, 'string'),
buttonStyle: 'solid',
optionType: 'button',
options: getDictOptions(DICT_TYPE.IOT_PROTOCOL_TYPE, 'string'),
placeholder: '请选择协议类型',
},
rules: 'required',
},
{
fieldName: 'serializeType',
label: '序列化类型',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.IOT_SERIALIZE_TYPE, 'string'),
placeholder: '请选择序列化类型',
},
help: 'iot-gateway-server 默认根据接入的协议类型确定数据格式,仅 MQTT、EMQX 协议支持自定义序列化类型',
rules: 'required',
},
// TODO @haohao这个貌似不需要
{
fieldName: 'status',

View File

@@ -57,8 +57,17 @@ async function copyToClipboard(text: string) {
<Descriptions.Item label="创建时间">
{{ formatDate(product.createTime) }}
</Descriptions.Item>
<Descriptions.Item label="数据格式">
{{ product.codecType || '-' }}
<Descriptions.Item label="协议类型">
<DictTag
:type="DICT_TYPE.IOT_PROTOCOL_TYPE"
:value="product.protocolType"
/>
</Descriptions.Item>
<Descriptions.Item label="序列化类型">
<DictTag
:type="DICT_TYPE.IOT_SERIALIZE_TYPE"
:value="product.serializeType"
/>
</Descriptions.Item>
<Descriptions.Item label="产品状态">
<DictTag :type="DICT_TYPE.IOT_PRODUCT_STATUS" :value="product.status" />