update modbus db and view
This commit is contained in:
@@ -17,6 +17,7 @@ const IOModal = ({i18n, open, type, data, onSubmit, onClose}) => {
|
||||
id: data.uid || '',
|
||||
addr: '',
|
||||
num: '',
|
||||
datalen: '',
|
||||
type: ''
|
||||
};
|
||||
|
||||
@@ -26,6 +27,8 @@ const IOModal = ({i18n, open, type, data, onSubmit, onClose}) => {
|
||||
if(num && 'value' in num) json.num = num.value;
|
||||
let type = e.querySelector('select[name="io_type"]');
|
||||
if(type && 'value' in type) json.type = type.value;
|
||||
let len = e.querySelector('input[name="datalen"]');
|
||||
if(len && 'value' in len) json.datalen = len.value;
|
||||
|
||||
return json;
|
||||
}}>
|
||||
@@ -41,10 +44,13 @@ const IOModal = ({i18n, open, type, data, onSubmit, onClose}) => {
|
||||
</select>
|
||||
</Form.Field>
|
||||
<Form.Field>
|
||||
<Input name="addr" label="起始位址" defaultValue={data.addr || ''} />
|
||||
<Input name="addr" label="起始位址" defaultValue={data.addr} />
|
||||
</Form.Field>
|
||||
<Form.Field>
|
||||
<Input name="num" label="數量" defaultValue={data.num || ''} />
|
||||
<Input name="num" label="數量" defaultValue={data.num} />
|
||||
</Form.Field>
|
||||
<Form.Field>
|
||||
<Input name="datalen" label="資料長度" defaultValue={data.datalen} placeholder="長度不填則預設2"/>
|
||||
</Form.Field>
|
||||
<Grid columns={2}>
|
||||
<Grid.Column>
|
||||
|
||||
Reference in New Issue
Block a user