import React from 'react'; import { Modal, Form, Input, Button, Checkbox, Grid } from 'semantic-ui-react'; const WristbandModal = ({ i18n, open, type, data, closeModal, submitModal }) => { return (
{ e.preventDefault(); submitModal(type, d.formData); }} serializer={e => { let json = { name: '', identity: '', monitor: 0, notify: 0, id: type == 1 ? data.uid : '', mac: '' }; let mac = e.querySelector('input[name="mac"]'); if(mac && 'value' in mac) json.mac = mac.value; let name = e.querySelector('input[name="name"]'); if(name && 'value' in name) json.name = name.value; let identity = e.querySelector('input[name="identity"]'); if(identity && 'value' in identity) json.identity = identity.value; let monitor = e.querySelector('input[name="monitor"]'); if(monitor && 'checked' in monitor) json.monitor = monitor.checked ? 1 : 0; let notify = e.querySelector('input[name="notify"]'); if(notify && 'checked' in notify) json.notify = notify.checked ? 1 : 0; return json; }}>