"use strict";
Object.defineProperty(exports, "__esModule", {
  value: !0
}), exports.default = void 0;
var _react = _interopRequireWildcard(require("react")),
  _propTypes = _interopRequireDefault(require("prop-types")),
  _amosAntd = require("amos-antd"),
  _amosFramework = require("amos-framework"),
  _rayValidate = require("ray-validate"),
  _processor = require("../../../../utils/processor"),
  _urlConsts = require("../../../../consts/urlConsts"),
  _DeviceEnum = require("./../../common/DeviceEnum"),
  _DeviceLang = require("./../../common/DeviceLang"),
  _validate = require("./../../../common/utils/validate");

function _interopRequireDefault(e) {
  return e && e.__esModule ? e : {
    default: e
  }
}

function _getRequireWildcardCache() {
  if ("function" != typeof WeakMap) return null;
  var e = new WeakMap;
  return _getRequireWildcardCache = function() {
    return e
  }, e
}

function _interopRequireWildcard(e) {
  if (e && e.__esModule) return e;
  if (null === e || "object" !== _typeof(e) && "function" != typeof e) return {
    default: e
  };
  var t = _getRequireWildcardCache();
  if (t && t.has(e)) return t.get(e);
  var a, r, n = {},
    l = Object.defineProperty && Object.getOwnPropertyDescriptor;
  for (a in e) Object.prototype.hasOwnProperty.call(e, a) && ((r = l ? Object.getOwnPropertyDescriptor(e, a) : null) && (r.get || r.set) ? Object.defineProperty(n, a, r) : n[a] = e[a]);
  return n.default = e, t && t.set(e, n), n
}

function _typeof(e) {
  return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
    return typeof e
  } : function(e) {
    return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
  })(e)
}

function _toConsumableArray(e) {
  return _arrayWithoutHoles(e) || _iterableToArray(e) || _unsupportedIterableToArray(e) || _nonIterableSpread()
}

function _nonIterableSpread() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}

function _unsupportedIterableToArray(e, t) {
  if (e) {
    if ("string" == typeof e) return _arrayLikeToArray(e, t);
    var a = Object.prototype.toString.call(e).slice(8, -1);
    return "Object" === a && e.constructor && (a = e.constructor.name), "Map" === a || "Set" === a ? Array.from(e) : "Arguments" === a || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a) ? _arrayLikeToArray(e, t) : void 0
  }
}

function _iterableToArray(e) {
  if ("undefined" != typeof Symbol && Symbol.iterator in Object(e)) return Array.from(e)
}

function _arrayWithoutHoles(e) {
  if (Array.isArray(e)) return _arrayLikeToArray(e)
}

function _arrayLikeToArray(e, t) {
  (null == t || t > e.length) && (t = e.length);
  for (var a = 0, r = new Array(t); a < t; a++) r[a] = e[a];
  return r
}

function _extends() {
  return (_extends = Object.assign || function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var a, r = arguments[t];
      for (a in r) Object.prototype.hasOwnProperty.call(r, a) && (e[a] = r[a])
    }
    return e
  }).apply(this, arguments)
}

function _classCallCheck(e, t) {
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
}

function _defineProperties(e, t) {
  for (var a = 0; a < t.length; a++) {
    var r = t[a];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  }
}

function _createClass(e, t, a) {
  return t && _defineProperties(e.prototype, t), a && _defineProperties(e, a), e
}

function _inherits(e, t) {
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, {
    constructor: {
      value: e,
      writable: !0,
      configurable: !0
    }
  }), t && _setPrototypeOf(e, t)
}

function _setPrototypeOf(e, t) {
  return (_setPrototypeOf = Object.setPrototypeOf || function(e, t) {
    return e.__proto__ = t, e
  })(e, t)
}

function _createSuper(a) {
  var r = _isNativeReflectConstruct();
  return function() {
    var e, t = _getPrototypeOf(a);
    return _possibleConstructorReturn(this, r ? (e = _getPrototypeOf(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments))
  }
}

function _possibleConstructorReturn(e, t) {
  return !t || "object" !== _typeof(t) && "function" != typeof t ? _assertThisInitialized(e) : t
}

function _assertThisInitialized(e) {
  if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e
}

function _isNativeReflectConstruct() {
  if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  if (Reflect.construct.sham) return !1;
  if ("function" == typeof Proxy) return !0;
  try {
    return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0
  } catch (e) {
    return !1
  }
}

function _getPrototypeOf(e) {
  return (_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
    return e.__proto__ || Object.getPrototypeOf(e)
  })(e)
}

function _defineProperty(e, t, a) {
  return t in e ? Object.defineProperty(e, t, {
    value: a,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[t] = a, e
}
var RadioGroup = _amosAntd.Radio.Group,
  Option = _amosFramework.Select.Option,
  FormItem = _amosAntd.Form.Item,
  dataTypeOption = (0, _DeviceLang.enums2array)(_DeviceEnum.dataTypeEnum).map(function(e) {
    return _react.default.createElement(Option, {
      key: e.key,
      value: "".concat(e.key)
    }, e.label)
  }),
  classifyOption = (0, _DeviceLang.enums2array)(_DeviceEnum.classifyEnum).map(function(e) {
    return _react.default.createElement(_amosAntd.Radio, {
      key: e.key,
      value: "".concat(e.key)
    }, e.label)
  }),
  formItemLayout = {
    labelCol: {
      xs: {
        span: 24
      },
      sm: {
        span: 5
      }
    },
    wrapperCol: {
      xs: {
        span: 24
      },
      sm: {
        span: 16
      }
    }
  },
  fieldNames = ["name", "type", "displayName", "dataType", "unit", "descr", "isRequired"],
  AddEditDeviceProperty = function() {
    _inherits(a, _react.Component);
    var t = _createSuper(a);

    function a(e) {
      var k;
      return _classCallCheck(this, a), _defineProperty(_assertThisInitialized(k = t.call(this, e)), "onEnumRangeChange", function(e) {
        k.setState({
          currentenumRange: e.target.value
        })
      }), _defineProperty(_assertThisInitialized(k), "getDynamicCode", function() {
        var e = k.props.form,
          t = e.getFieldProps,
          a = e.getFieldValue,
          r = k.props.propertyInfo,
          n = r.valueStr,
          l = r.enumRange,
          o = r.minValue,
          u = r.maxValue,
          i = r.precision,
          s = void 0 === k.state.currentenumRange ? null === l ? "" : l : k.state.currentenumRange,
          d = a("dataType"),
          c = a("type"),
          p = t("defaultAppointedInt", {
            initialValue: n ? parseInt(n) : "",
            rules: [{
              required: !0,
              message: "常量值不能为空！"
            }, {
              validator: k.checkInt
            }]
          }),
          m = t("defaultAppointedFloat", {
            initialValue: n ? parseFloat(n) : "",
            rules: [{
              required: !0,
              message: "常量值不能为空！"
            }, {
              validator: k.checkFloat
            }]
          }),
          f = t("defaultAppointedString", {
            initialValue: n || "",
            rules: [{
              required: !0,
              min: 0,
              max: 255,
              message: "最大长度255！"
            }]
          }),
          _ = t("defaultAppointedBoolean", {
            initialValue: n,
            rules: [{
              required: !0,
              message: "常量值不能为空！"
            }]
          }),
          y = t("defaultAppointedPwd", {
            initialValue: n || "",
            rules: [{
              required: !0,
              min: 0,
              max: 255,
              message: "最大长度255！"
            }]
          }),
          h = t("enumRange", {
            initialValue: s,
            rules: [{
              required: !0,
              message: "枚举范围不能为空！"
            }]
          }),
          I = t("defaultIntValue", {
            initialValue: n ? parseInt(n) : "",
            rules: [{
              required: !1,
              message: "默认值不能为空！"
            }, {
              validator: k.checkIntExcludeNull
            }]
          }),
          b = t("minIntValue", {
            initialValue: o,
            rules: [{
              validator: k.checkInt
            }]
          }),
          v = t("maxIntValue", {
            initialValue: u,
            rules: [{
              validator: k.checkInt
            }]
          }),
          e = t("defaultFloatValue", {
            initialValue: n ? parseFloat(n) : "",
            rules: [{
              required: !1,
              message: "默认值不能为空！"
            }, {
              validator: k.checkFloatExcludeNull
            }]
          }),
          r = t("minFloatValue", {
            initialValue: o,
            rules: [{
              validator: k.checkFloat
            }]
          }),
          l = t("maxFloatValue", {
            initialValue: u,
            rules: [{
              validator: k.checkFloat
            }]
          }),
          a = t("defaultEnumValue", {
            initialValue: n || "",
            rules: [{
              required: !1,
              message: "默认值不能为空！"
            }]
          }),
          o = t("defaultStringValue", {
            initialValue: n || "",
            rules: [{
              required: !1,
              min: 0,
              max: 255,
              message: "最大长度255！"
            }]
          }),
          u = t("defaultPwdValue", {
            initialValue: n || "",
            rules: [{
              required: !1,
              min: 0,
              max: 255,
              message: "最大长度255！"
            }]
          }),
          n = t("defaultBoolean", {
            initialValue: n,
            rules: [{
              required: !1,
              message: "默认值不能为空！"
            }]
          }),
          t = t("precision", {
            initialValue: void 0 === i ? 2 : i,
            rules: []
          }),
          i = [];
        if ("1" === d) "1" === c ? (i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "最小值: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, b, {
          placeholder: "最小值"
        })))), i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "最大值: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, v, {
          placeholder: "最大值"
        })))), i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "默认值: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, I, {
          placeholder: "默认值"
        }))))) : "2" === c && i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "数值: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, p, {
          placeholder: "(数值)最多支持32位整型数据"
        }))));
        else if ("3" === d) "1" === c ? i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "默认值: "
        }), _react.default.createElement(RadioGroup, n, _react.default.createElement(_amosAntd.Radio, {
          key: "1",
          value: "1"
        }, "true"), _react.default.createElement(_amosAntd.Radio, {
          key: "0",
          value: "0"
        }, "false")))) : "2" === c && i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "值: "
        }), _react.default.createElement(RadioGroup, _, _react.default.createElement(_amosAntd.Radio, {
          key: "1",
          value: "1"
        }, "true"), _react.default.createElement(_amosAntd.Radio, {
          key: "0",
          value: "0"
        }, "false"))));
        else if ("4" === d)
          if ("1" === c) {
            i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
              hasFeedback: !0,
              label: "枚举范围: "
            }), _react.default.createElement(_amosAntd.Input, _extends({}, h, {
              placeholder: "由中文英文及字符组成，字符之间以一个半角逗号作为间隔",
              onChange: k.onEnumRangeChange
            }))));
            for (var g = s.split(","), E = [], F = 0; F < g.length; F++) {
              var x = g[F];
              "" !== x && E.push(_react.default.createElement(Option, {
                key: F,
                value: "".concat(x)
              }, x))
            }
            i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
              hasFeedback: !0,
              label: "默认值: "
            }), _react.default.createElement(_amosFramework.Select, _extends({
              style: {
                width: "100%",
                height: "32px"
              }
            }, a, {
              placeholder: "请先输入枚举范围"
            }), E)))
          } else "2" === c && i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
            hasFeedback: !0,
            label: "枚举范围: "
          }), _react.default.createElement(_amosAntd.Input, _extends({}, h, {
            placeholder: "由中文英文及字符组成，字符之间以一个半角逗号作为间隔"
          }))));
        else "5" === d ? "1" === c ? i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "默认值: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, o, {
          placeholder: "默认值"
        })))) : "2" === c && i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "默认值: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, f, {
          placeholder: "默认值"
        })))) : "6" === d ? "1" === c ? i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "默认值: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, u, {
          type: "password",
          placeholder: "默认值"
        })))) : "2" === c && i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "默认值: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, y, {
          type: "password",
          placeholder: "默认值"
        })))) : "2" === d && ("1" === c ? (i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "精度: "
        }), _react.default.createElement("label", null, "小数点后"), _react.default.createElement(_amosAntd.InputNumber, _extends({
          min: 0,
          max: 32,
          defaultValue: 0
        }, t)), _react.default.createElement("label", null, "位"))), i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "最小值: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, r, {
          placeholder: "最小值"
        })))), i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "最大值: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, l, {
          placeholder: "最大值"
        })))), i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "默认值: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, e, {
          placeholder: "默认值"
        }))))) : "2" === c && i.push(_react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "数值: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, m, {
          placeholder: "(数值)最多支持小数点前后32位浮点型数据"
        })))));
        return i
      }), _defineProperty(_assertThisInitialized(k), "getDynamicCodeName", function() {
        var e = k.props.form.getFieldValue,
          t = e("dataType"),
          a = e("type"),
          e = [];
        return "1" === t ? "1" === a ? (e.push("minIntValue"), e.push("maxIntValue"), e.push("defaultIntValue")) : "2" === a && e.push("defaultAppointedInt") : "3" === t ? "1" === a ? e.push("defaultBoolean") : "2" === a && e.push("defaultAppointedBoolean") : "4" === t ? "1" === a ? (e.push("enumRange"), e.push("defaultEnumValue")) : "2" === a && e.push("enumRange") : "5" === t ? "1" === a ? e.push("defaultStringValue") : "2" === a && e.push("defaultAppointedString") : "6" === t ? "1" === a ? e.push("defaultPwdValue") : "2" === a && e.push("defaultAppointedPwd") : "2" === t && ("1" === a ? (e.push("precision"), e.push("minFloatValue"), e.push("maxFloatValue"), e.push("defaultFloatValue")) : "2" === a && e.push("defaultAppointedFloat")), e
      }), _defineProperty(_assertThisInitialized(k), "handleSubmit", function(e) {
        e.preventDefault();
        e = [].concat(fieldNames, _toConsumableArray(k.getDynamicCodeName()));
        k.props.form.validateFields(e, {}, function(e, t) {
          e || (t = (0, _validate.objOfStrPropTrim)(t), k.handleSave(t))
        })
      }), _defineProperty(_assertThisInitialized(k), "handleSave", function(e) {
        var t, a = 0,
          r = 0,
          n = "",
          l = "",
          o = 0;
        for (t in e) e.hasOwnProperty(t) && t.startsWith("min") ? a = e[t] : e.hasOwnProperty(t) && t.startsWith("max") ? r = e[t] : e.hasOwnProperty(t) && t.startsWith("default") ? n = String(e[t]) : e.hasOwnProperty(t) && "enumRange" === t ? l = e[t] : e.hasOwnProperty(t) && "precision" === t && (o = e[t]);
        var u = (new Date).getTime();
        _extends(e, {
          minValue: a,
          maxValue: r,
          valueStr: n,
          enumRange: l,
          precision: o,
          key: u
        });
        u = [{
          key: u,
          name: e.name,
          type: e.type,
          dataType: e.dataType
        }];
        void 0 === k.props.deviceId ? (k.props.addDeviceProperty(e), k.props.autoCardCalculate(u), k.props.form.resetFields(), k.props.callBack()) : k.saveDeviceProperty(e)
      }), _defineProperty(_assertThisInitialized(k), "handleCancel", function(e) {
        k.props.form.resetFields(), k.props.callBack()
      }), _defineProperty(_assertThisInitialized(k), "saveDeviceProperty", function(e) {
        var t = k.props,
          a = t.propertyInfo,
          r = t.deviceId,
          a = a ? a.id : void 0;
        _extends(e, {
          equipmentId: r,
          id: a
        }), _processor.AmosFetch.post(_urlConsts.OltSerUrl.deviceAttributeUpdate, {
          data: e
        }).then(function(e) {
          if (e.ok) return e.json();
          throw new Error("从服务端获取数据失败！")
        }).then(function(e) {
          "SUCCESS" === e.result ? _amosFramework.message.success("新增或编辑属性成功！") : _amosFramework.message.danger("新增或编辑属性失败！"), k.props.getDeviceInfoById(r), k.props.form.resetFields(), k.props.callBack()
        })
      }), _defineProperty(_assertThisInitialized(k), "checkInt", function(e, t, a) {
        var r;
        "" === t || null == t || (0, _rayValidate.isInt)(parseInt(t)) && 0 < (r = t.toString().length) && r < 33 ? a() : a("最多支持32位整型数据")
      }), _defineProperty(_assertThisInitialized(k), "checkFloat", function(e, t, a) {
        var r;
        "" === t || null == t || (0, _rayValidate.isNum)(parseInt(t)) && 0 < (r = t.toString().length) && r < 33 ? a() : a("最多支持小数点前后32位浮点型数据")
      }), _defineProperty(_assertThisInitialized(k), "checkIntExcludeNull", function(e, t, a) {
        var r;
        "" === t || null == t || (0, _rayValidate.isInt)(parseInt(t)) && 0 < (r = t.toString().length) && r < 33 ? a() : a("最多支持32位整型数据")
      }), _defineProperty(_assertThisInitialized(k), "checkFloatExcludeNull", function(e, t, a) {
        var r;
        "" === t || null == t || (0, _rayValidate.isNum)(parseInt(t)) && 0 < (r = t.toString().length) && r < 33 ? a() : a("最多支持小数点前后32位浮点型数据")
      }), k.state = {
        currentenumRange: void 0
      }, k
    }
    return _createClass(a, [{
      key: "componentDidMount",
      value: function() {}
    }, {
      key: "render",
      value: function() {
        var e = this.props.form.getFieldProps,
          t = this.props.propertyInfo,
          a = e("name", {
            initialValue: t ? t.name : "",
            rules: [{
              required: !0,
              min: 1,
              max: 20,
              message: "支持1-20位非空格字符！"
            }, {
              validator: (0, _validate.noSpaceLengthValidate)(20, !0, "属性名不能为空！")
            }]
          }),
          r = e("type", {
            initialValue: t ? "".concat(t.type) : 1,
            rules: [{
              required: !0,
              message: "分类不能为空！"
            }]
          }),
          n = e("displayName", {
            initialValue: t ? t.displayName : "",
            rules: [{
              required: !0,
              min: 1,
              max: 20,
              message: "支持1-20位非空格字符！"
            }, {
              validator: (0, _validate.noSpaceLengthValidate)(20, !0, "显示名称不能为空！")
            }]
          }),
          l = e("dataType", {
            initialValue: t ? "".concat(t.dataType) : 1,
            rules: [{
              required: !0,
              message: "数据类型不能为空！"
            }]
          }),
          o = e("unit", {
            initialValue: t ? t.unit : "",
            rules: [{
              required: !1,
              min: 1,
              max: 20,
              message: "支持1-20位非空格字符！"
            }]
          }),
          u = e("descr", {
            initialValue: t ? t.descr : "",
            rules: [{
              required: !1,
              message: "描述不能为空！"
            }]
          }),
          t = e("isRequired", {
            initialValue: !!t && t.isRequired,
            valuePropName: "checked",
            rules: []
          });
        return _react.default.createElement("div", {
          className: "device-property-add-modal"
        }, _react.default.createElement(_amosAntd.Form, {
          horizontal: !0,
          onSubmit: this.handleSubmit
        }, _react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "属性名: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, a, {
          placeholder: "属性名（支持1-20位非空格字符）"
        }))), _react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "分类: "
        }), _react.default.createElement(RadioGroup, r, classifyOption)), _react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "显示名称: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, n, {
          placeholder: "属性名（支持1-20位非空格字符）"
        }))), _react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "数据类型："
        }), _react.default.createElement(_amosFramework.Select, _extends({
          style: {
            width: "100%",
            height: "32px"
          }
        }, l), dataTypeOption)), _react.default.createElement("div", null, this.getDynamicCode()), _react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "单位: "
        }), _react.default.createElement(_amosAntd.Input, _extends({}, o, {
          placeholder: "单位（支持1-20位非空格字符）"
        }))), _react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "描述: "
        }), _react.default.createElement(_amosAntd.Input, u)), _react.default.createElement(FormItem, _extends({}, formItemLayout, {
          hasFeedback: !0,
          label: "是否必填: "
        }), _react.default.createElement(_amosAntd.Checkbox, _extends({}, t, {
          style: {
            "line-height": "31px",
            float: "left",
            "margin-left": "7px"
          }
        }))), _react.default.createElement(FormItem, {
          wrapperCol: {
            xs: {
              span: 24,
              offset: 0
            },
            sm: {
              span: 24,
              offset: 0
            }
          }
        }, _react.default.createElement(_amosAntd.Row, null, _react.default.createElement(_amosAntd.Col, {
          span: 3,
          offset: 14
        }, _react.default.createElement(_amosAntd.Button, {
          type: "primary",
          htmlType: "submit"
        }, "提交")), _react.default.createElement(_amosAntd.Col, {
          span: 3,
          offset: 1
        }, _react.default.createElement(_amosAntd.Button, {
          onClick: this.handleCancel
        }, "取消"))))))
      }
    }]), a
  }();
AddEditDeviceProperty.displayName = "AddEditDeviceProperty", AddEditDeviceProperty.propTypes = {
  form: _propTypes.default.any,
  callBack: _propTypes.default.func,
  addDeviceProperty: _propTypes.default.func,
  autoCardCalculate: _propTypes.default.func,
  deviceId: _propTypes.default.number,
  propertyInfo: _propTypes.default.any,
  getDeviceInfoById: _propTypes.default.func
}, AddEditDeviceProperty.defaultProps = {
  propertyInfo: {
    type: 1,
    dataType: 1,
    enumRange: ""
  }
};
var _default = AddEditDeviceProperty;
exports.default = AddEditDeviceProperty, module.exports = exports.default;
