"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"), _typeof = require("@babel/runtime/helpers/typeof");

Object.defineProperty(exports, "__esModule", {
  value: !0
}), exports.default = void 0;

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")), _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")), _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")), _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")), _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")), _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")), _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")), _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")), _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")), _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");

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

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

function _createSuper(e) {
  var t = _isNativeReflectConstruct();
  return function() {
    var a, l = (0, _getPrototypeOf2.default)(e);
    if (t) {
      var r = (0, _getPrototypeOf2.default)(this).constructor;
      a = Reflect.construct(l, arguments, r);
    } else a = l.apply(this, arguments);
    return (0, _possibleConstructorReturn2.default)(this, a);
  };
}

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

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.capacatyclassifyEnum).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" ], AddEditCapacityProperty = function(e) {
  (0, _inherits2.default)(a, e);
  var t = _createSuper(a);
  function a(e) {
    var l;
    return (0, _classCallCheck2.default)(this, a), l = t.call(this, e), (0, _defineProperty2.default)((0, 
    _assertThisInitialized2.default)(l), "onEnumRangeChange", (function(e) {
      l.setState({
        currentenumRange: e.target.value
      });
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(l), "getDynamicCode", (function() {
      var e = l.props.propertyInfo, t = e.valueStr, a = e.enumRange, r = e.minValue, u = e.maxValue, n = e.precision, d = void 0 === l.state.currentenumRange ? null === a ? "" : a : l.state.currentenumRange, s = l.props.form, o = s.getFieldProps, i = s.getFieldValue, c = i("dataType"), m = i("type"), p = o("defaultAppointedInt", {
        initialValue: t ? parseInt(t) : "",
        rules: [ {
          required: !0,
          message: "常量值不能为空！"
        }, {
          validator: l.checkInt
        } ]
      }), f = o("defaultAppointedFloat", {
        initialValue: t ? parseFloat(t) : "",
        rules: [ {
          required: !0,
          message: "常量值不能为空！"
        }, {
          validator: l.checkFloat
        } ]
      }), _ = o("defaultAppointedString", {
        initialValue: t || "",
        rules: [ {
          required: !0,
          min: 0,
          max: 255,
          message: "最大长度255！"
        } ]
      }), h = o("defaultAppointedBoolean", {
        initialValue: t,
        rules: [ {
          required: !0,
          message: "常量值不能为空！"
        } ]
      }), y = o("defaultAppointedPwd", {
        initialValue: t || "",
        rules: [ {
          required: !0,
          min: 0,
          max: 255,
          message: "最大长度255！"
        } ]
      }), I = o("enumRange", {
        initialValue: d,
        rules: [ {
          required: !0,
          message: "枚举范围不能为空！"
        } ]
      }), b = o("defaultIntValue", {
        initialValue: t ? parseInt(t) : "",
        rules: [ {
          required: !1,
          message: "默认值不能为空！"
        }, {
          validator: l.checkIntExcludeNull
        } ]
      }), E = o("minIntValue", {
        initialValue: r,
        rules: [ {
          validator: l.checkInt
        } ]
      }), F = o("maxIntValue", {
        initialValue: u,
        rules: [ {
          validator: l.checkInt
        } ]
      }), x = o("defaultFloatValue", {
        initialValue: t ? parseFloat(t) : "",
        rules: [ {
          required: !1,
          message: "默认值不能为空！"
        }, {
          validator: l.checkFloatExcludeNull
        } ]
      }), v = o("minFloatValue", {
        initialValue: r,
        rules: [ {
          validator: l.checkFloat
        } ]
      }), g = o("maxFloatValue", {
        initialValue: u,
        rules: [ {
          validator: l.checkFloat
        } ]
      }), k = o("defaultEnumValue", {
        rules: [ {
          required: !1,
          message: "默认值不能为空！"
        } ]
      }), A = o("defaultStringValue", {
        initialValue: t || "",
        rules: [ {
          required: !1,
          min: 0,
          max: 255,
          message: "最大长度255！"
        } ]
      }), V = o("defaultPwdValue", {
        initialValue: t || "",
        rules: [ {
          required: !1,
          min: 0,
          max: 255,
          message: "最大长度255！"
        } ]
      }), q = o("defaultBoolean", {
        initialValue: t,
        rules: [ {
          required: !1,
          message: "默认值不能为空！"
        } ]
      }), C = o("precision", {
        initialValue: void 0 === n ? 2 : n,
        rules: []
      }), R = o("minIntOutput", {
        initialValue: r,
        rules: [ {
          validator: l.checkIntExcludeNull
        } ]
      }), P = o("maxIntOutput", {
        initialValue: u,
        rules: [ {
          validator: l.checkIntExcludeNull
        } ]
      }), O = o("precisionOutput", {
        initialValue: void 0 === n ? 2 : n,
        rules: []
      }), L = o("minFloatOutput", {
        initialValue: r,
        rules: [ {
          validator: l.checkFloatExcludeNull
        } ]
      }), T = o("maxFloatOutput", {
        initialValue: u,
        rules: [ {
          validator: l.checkFloatExcludeNull
        } ]
      }), w = o("enumRangeOutput", {
        initialValue: d,
        rules: [ {
          required: !1,
          message: "枚举范围不能为空！"
        } ]
      }), D = [];
      if ("1" === c) "1" === m ? (D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "最小值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, E, {
        placeholder: "最小值"
      })))), D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "最大值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, F, {
        placeholder: "最大值"
      })))), D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "默认值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, b, {
        placeholder: "默认值"
      }))))) : "2" === m ? D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "数值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, p, {
        placeholder: "(数值)最多支持32位整型数据"
      })))) : "4" === m && (D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "最小值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, R, {
        placeholder: "最小值"
      })))), D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "最大值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, P, {
        placeholder: "最大值"
      }))))); else if ("3" === c) "1" === m ? D.push(_react.default.createElement(FormItem, (0, 
      _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "默认值: "
      }), _react.default.createElement(RadioGroup, q, _react.default.createElement(_amosAntd.Radio, {
        key: "1",
        value: "1"
      }, "true"), _react.default.createElement(_amosAntd.Radio, {
        key: "0",
        value: "0"
      }, "false")))) : "2" === m && D.push(_react.default.createElement(FormItem, (0, 
      _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "值: "
      }), _react.default.createElement(RadioGroup, h, _react.default.createElement(_amosAntd.Radio, {
        key: "1",
        value: "1"
      }, "true"), _react.default.createElement(_amosAntd.Radio, {
        key: "0",
        value: "0"
      }, "false")))); else if ("4" === c) if ("1" === m) {
        D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
          hasFeedback: !0,
          label: "枚举范围: "
        }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, I, {
          placeholder: "由中文英文及字符组成，字符之间以一个半角逗号作为间隔",
          onChange: l.onEnumRangeChange
        }))));
        for (var S = d.split(","), N = [], z = 0; z < S.length; z++) {
          var B = S[z];
          "" !== B && N.push(_react.default.createElement(Option, {
            key: z,
            value: "".concat(B)
          }, B));
        }
        D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
          hasFeedback: !0,
          label: "默认值: "
        }), _react.default.createElement(_amosFramework.Select, (0, _extends2.default)({
          style: {
            width: "100%",
            height: "32px"
          }
        }, k, {
          placeholder: "请先输入枚举范围"
        }), N)));
      } else "2" === m ? D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "枚举范围: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, I, {
        placeholder: "由中文英文及字符组成，字符之间以一个半角逗号作为间隔"
      })))) : "4" === m && D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "枚举范围: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, w, {
        placeholder: "由中文英文及字符组成，字符之间以一个半角逗号作为间隔"
      })))); else "5" === c ? "1" === m ? D.push(_react.default.createElement(FormItem, (0, 
      _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "默认值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, A, {
        placeholder: "默认值"
      })))) : "2" === m && D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "默认值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, _, {
        placeholder: "默认值"
      })))) : "6" === c ? "1" === m ? D.push(_react.default.createElement(FormItem, (0, 
      _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "默认值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, V, {
        type: "password",
        placeholder: "默认值"
      })))) : "2" === m && D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "默认值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, y, {
        type: "password",
        placeholder: "默认值"
      })))) : "2" === c && ("1" === m ? (D.push(_react.default.createElement(FormItem, (0, 
      _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "精度: "
      }), _react.default.createElement("label", null, "小数点后"), _react.default.createElement(_amosAntd.InputNumber, (0, 
      _extends2.default)({
        min: 0,
        max: 32,
        defaultValue: 0
      }, C)), _react.default.createElement("label", null, "位"))), D.push(_react.default.createElement(FormItem, (0, 
      _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "最小值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, v, {
        placeholder: "最小值"
      })))), D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "最大值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, g, {
        placeholder: "最大值"
      })))), D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "默认值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, x, {
        placeholder: "默认值"
      }))))) : "2" === m ? D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "数值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, f, {
        placeholder: "(数值)最多支持小数点前后32位浮点型数据"
      })))) : "4" === m && (D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "精度: "
      }), _react.default.createElement("label", null, "小数点后"), _react.default.createElement(_amosAntd.InputNumber, (0, 
      _extends2.default)({
        min: 0,
        max: 32,
        defaultValue: 0
      }, O)), _react.default.createElement("label", null, "位"))), D.push(_react.default.createElement(FormItem, (0, 
      _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "最小值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, L, {
        placeholder: "最小值"
      })))), D.push(_react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "最大值: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, T, {
        placeholder: "最大值"
      }))))));
      return D;
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(l), "getDynamicCodeName", (function() {
      var e = l.props.form.getFieldValue, t = e("dataType"), a = e("type"), r = [];
      return "1" === t ? "1" === a ? (r.push("minIntValue"), r.push("maxIntValue"), r.push("defaultIntValue")) : "2" === a ? r.push("defaultAppointedInt") : "4" === a && (r.push("minIntOutput"), 
      r.push("maxIntOutput")) : "3" === t ? "1" === a ? r.push("defaultBoolean") : "2" === a && r.push("defaultAppointedBoolean") : "4" === t ? "1" === a ? (r.push("enumRange"), 
      r.push("defaultEnumValue")) : "2" === a ? r.push("enumRange") : "4" === a && r.push("enumRangeOutput") : "5" === t ? "1" === a ? r.push("defaultStringValue") : "2" === a && r.push("defaultAppointedString") : "6" === t ? "1" === a ? r.push("defaultPwdValue") : "2" === a && r.push("defaultAppointedPwd") : "2" === t && ("1" === a ? (r.push("precision"), 
      r.push("minFloatValue"), r.push("maxFloatValue"), r.push("defaultFloatValue")) : "2" === a ? r.push("defaultAppointedFloat") : "4" === a && (r.push("precisionOutput"), 
      r.push("minFloatOutput"), r.push("maxFloatOutput"))), r;
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(l), "handleSubmit", (function(e) {
      e.preventDefault();
      var t = [].concat(fieldNames, (0, _toConsumableArray2.default)(l.getDynamicCodeName()));
      l.props.form.validateFields(t, {}, (function(e, t) {
        e || l.handleSave(t);
      }));
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(l), "handleSave", (function(e) {
      var t = l.props.propertyInfo, a = 0, r = 0, u = "", n = "", d = 0;
      for (var s in e) e.hasOwnProperty(s) && s.startsWith("min") ? a = e[s] : e.hasOwnProperty(s) && s.startsWith("max") ? r = e[s] : e.hasOwnProperty(s) && s.startsWith("default") ? u = String(e[s]) : e.hasOwnProperty(s) && s.startsWith("enumRange") ? n = e[s] : e.hasOwnProperty(s) && s.startsWith("precision") && (d = e[s]);
      var o = (new Date).getTime();
      u = null === u ? "" : u, (0, _extends2.default)(e, {
        minValue: a,
        maxValue: r,
        valueStr: u,
        enumRange: n,
        precision: d,
        key: o
      });
      var i = [ {
        key: o,
        name: e.name,
        type: e.type,
        dataType: e.dataType
      } ];
      void 0 === l.props.deviceId ? (l.props.addCapacityProperty(e), l.props.autoCardCalculate(i), 
      l.props.form.resetFields(), l.props.callBack()) : (t.id && (e.id = t.id), l.saveCapacityProperty(e));
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(l), "handleCancel", (function(e) {
      l.props.form.resetFields(), l.props.callBack();
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(l), "checkInt", (function(e, t, a) {
      if ("" === t || null == t) a(); else if ((0, _rayValidate.isInt)(parseInt(t))) {
        var l = t.toString().length;
        l >= 0 && l < 33 ? a() : a("最多支持32位整型数据");
      } else a("最多支持32位整型数据");
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(l), "checkFloat", (function(e, t, a) {
      if ("" === t || null == t) a(); else if ((0, _rayValidate.isNum)(parseInt(t))) {
        var l = t.toString().length;
        l > 0 && l < 33 ? a() : a("最多支持小数点前后32位浮点型数据");
      } else a("最多支持小数点前后32位浮点型数据");
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(l), "checkIntExcludeNull", (function(e, t, a) {
      if ("" === t || null == t) a(); else if ((0, _rayValidate.isInt)(parseInt(t))) {
        var l = t.toString().length;
        l > 0 && l < 33 ? a() : a("最多支持32位整型数据");
      } else a("最多支持32位整型数据");
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(l), "checkFloatExcludeNull", (function(e, t, a) {
      if ("" === t || null == t) a(); else if ((0, _rayValidate.isNum)(parseInt(t))) {
        var l = t.toString().length;
        l > 0 && l < 33 ? a() : a("最多支持小数点前后32位浮点型数据");
      } else a("最多支持小数点前后32位浮点型数据");
    })), (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(l), "saveCapacityProperty", (function(e) {
      var t = l.props.deviceId;
      (0, _extends2.default)(e, {
        cpblId: l.props.capacityId
      }), _processor.AmosFetch.post(_urlConsts.OltSerUrl.capacityPropertyUpdate, {
        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("新增属性失败！"), 
        l.props.getDeviceInfoById(t), l.props.form.resetFields(), l.props.callBack();
      }));
    })), l.state = {
      currentenumRange: void 0
    }, l;
  }
  return (0, _createClass2.default)(a, [ {
    key: "componentDidMount",
    value: function() {}
  }, {
    key: "render",
    value: function() {
      var e = this.props, t = e.form, a = e.propertyInfo, l = a.name, r = a.type, u = a.displayName, n = a.dataType, d = a.unit, s = a.descr, o = t.getFieldProps, i = o("name", {
        initialValue: l || "",
        rules: [ {
          required: !0,
          min: 1,
          max: 50,
          message: "支持1-20位非空格字符！"
        } ]
      }), c = o("type", {
        initialValue: "".concat(r),
        rules: [ {
          required: !0,
          message: "分类不能为空！"
        } ]
      }), m = o("displayName", {
        initialValue: u || "",
        rules: [ {
          required: !0,
          min: 1,
          max: 20,
          message: "支持1-20位非空格字符！"
        } ]
      }), p = o("dataType", {
        initialValue: "".concat(n),
        rules: [ {
          required: !0,
          message: "数据类型不能为空！"
        } ]
      }), f = o("unit", {
        initialValue: d || "",
        rules: [ {
          required: !1,
          min: 1,
          max: 20,
          message: "支持1-20位非空格字符！"
        } ]
      }), _ = o("descr", {
        initialValue: s || "",
        rules: [ {
          required: !1,
          message: "描述不能为空！"
        } ]
      }), h = o("isRequired", {
        initialValue: !!a && a.isRequired,
        valuePropName: "checked",
        rules: []
      });
      return _react.default.createElement("div", {
        className: "device-interface-add-modal"
      }, _react.default.createElement(_amosAntd.Form, {
        horizontal: !0,
        onSubmit: this.handleSubmit
      }, _react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "属性名: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, i, {
        placeholder: "属性名（支持1-20位非空格字符）"
      }))), _react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "分类: "
      }), _react.default.createElement(RadioGroup, c, classifyOption)), _react.default.createElement(FormItem, (0, 
      _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "显示名称: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, m, {
        placeholder: "属性名（支持1-20位非空格字符）"
      }))), _react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "数据类型："
      }), _react.default.createElement(_amosFramework.Select, (0, _extends2.default)({
        style: {
          width: "100%",
          height: "32px"
        }
      }, p), dataTypeOption)), _react.default.createElement("div", null, this.getDynamicCode()), _react.default.createElement(FormItem, (0, 
      _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "单位: "
      }), _react.default.createElement(_amosAntd.Input, (0, _extends2.default)({}, f, {
        placeholder: "单位（支持1-20位非空格字符）"
      }))), _react.default.createElement(FormItem, (0, _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "描述: "
      }), _react.default.createElement(_amosAntd.Input, _)), _react.default.createElement(FormItem, (0, 
      _extends2.default)({}, formItemLayout, {
        hasFeedback: !0,
        label: "是否必填: "
      }), _react.default.createElement(_amosAntd.Checkbox, (0, _extends2.default)({}, h, {
        style: {
          lineHeight: "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;
}(_react.Component);

AddEditCapacityProperty.displayName = "AddEditCapacityProperty", AddEditCapacityProperty.propTypes = {
  form: _propTypes.default.any,
  callBack: _propTypes.default.func,
  addCapacityProperty: _propTypes.default.func,
  autoCardCalculate: _propTypes.default.func,
  deviceId: _propTypes.default.number,
  capacityId: _propTypes.default.number,
  getDeviceInfoById: _propTypes.default.func,
  propertyInfo: _propTypes.default.any
}, AddEditCapacityProperty.defaultProps = {
  propertyInfo: {
    type: "1",
    dataType: "1",
    enumRange: ""
  }
};

var _default = AddEditCapacityProperty;

exports.default = _default;