"use strict";

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = _default;
var _react = _interopRequireWildcard(require("react"));
var _FormModal = _interopRequireDefault(require("../../../../FormModal"));
var _config = _interopRequireDefault(require("../../../../../_mapUtil/config"));
var _config2 = _interopRequireDefault(require("../../config"));
var _service = _interopRequireDefault(require("../../service"));
var _PublicService = _interopRequireDefault(require("../../../../../_mapUtil/PublicService"));
var _request = _interopRequireDefault(require("../../../../../_mapUtil/request"));
var _message = _interopRequireDefault(require("antd/lib/message"));
var _button = _interopRequireDefault(require("antd/lib/button"));
var _index = _interopRequireDefault(require("./index.less"));
var _lodash = _interopRequireDefault(require("lodash"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _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 _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } /**
 * 创建内部工单
 */
var processParams = _config2["default"].processParams,
  getAddModalValue = _config2["default"].getAddModalValue,
  getDetailsModalValue = _config2["default"].getDetailsModalValue,
  getImportModalValue = _config2["default"].getImportModalValue,
  getSelectShow = _config2["default"].getSelectShow,
  getTreeSelectShow = _config2["default"].getTreeSelectShow;
var getSourceData = _service["default"].getSourceData,
  getSourceSmallData = _service["default"].getSourceSmallData,
  getOrderNatureData = _service["default"].getOrderNatureData,
  getOrderCategoryData = _service["default"].getOrderCategoryData,
  getOrderAddress = _service["default"].getOrderAddress,
  getOrderTypeData = _service["default"].getOrderTypeData;

// export const MyAnchor = ({ title, href }) => {
//   return <div id={href}>{title}</div>;
// };

function _default(props) {
  var goBack = props.goBack,
    modalType = props.modalType,
    _props$modal = props.modal,
    modal = _props$modal === void 0 ? {} : _props$modal,
    _props$detailsVal = props.detailsVal,
    detailsVal = _props$detailsVal === void 0 ? {} : _props$detailsVal,
    caseSource = props.caseSource,
    _props$column = props.column,
    column = _props$column === void 0 ? 3 : _props$column,
    isProcess = props.isProcess,
    _props$title = props.title,
    title = _props$title === void 0 ? '工单' : _props$title,
    _props$extraParams = props.extraParams,
    extraParams = _props$extraParams === void 0 ? {} : _props$extraParams;
  var paramsItems = (processParams === null || processParams === void 0 ? void 0 : processParams[modalType]) || {};
  var myForm = (0, _react.useRef)();
  // 下拉选数据
  var _useState = (0, _react.useState)([]),
    _useState2 = _slicedToArray(_useState, 2),
    sourceData = _useState2[0],
    setSourceData = _useState2[1]; // 工单来源
  var _useState3 = (0, _react.useState)('04'),
    _useState4 = _slicedToArray(_useState3, 2),
    sourceValue = _useState4[0],
    setSourceValue = _useState4[1]; // 来源值
  var _useState5 = (0, _react.useState)([]),
    _useState6 = _slicedToArray(_useState5, 2),
    orderNatureData = _useState6[0],
    setOrderNatureData = _useState6[1]; // 工单性质
  var _useState7 = (0, _react.useState)([]),
    _useState8 = _slicedToArray(_useState7, 2),
    orderCategoryData = _useState8[0],
    setOrderCategoryData = _useState8[1]; // 工单类别
  var _useState9 = (0, _react.useState)([]),
    _useState10 = _slicedToArray(_useState9, 2),
    keyAreaData = _useState10[0],
    setKeyAreaData = _useState10[1]; // 事发区域
  // 新增表单参数
  var _useState11 = (0, _react.useState)(false),
    _useState12 = _slicedToArray(_useState11, 2),
    modalLoading = _useState12[0],
    setModalLoading = _useState12[1];
  var _useState13 = (0, _react.useState)(false),
    _useState14 = _slicedToArray(_useState13, 2),
    modalBtnLoading = _useState14[0],
    setModalBtnLoading = _useState14[1];
  var _useState15 = (0, _react.useState)({}),
    _useState16 = _slicedToArray(_useState15, 2),
    formData = _useState16[0],
    setFormData = _useState16[1]; // 弹框详情

  (0, _react.useEffect)(function () {
    if (modalType !== 'Import') {
      getSourceSelect();
      getOrderNatureSelect();
      getOrderCategorySelect();
      getOrderAddressSelect({
        levelEnd: 3
      }, function (data) {
        setKeyAreaData(data);
      }); // 事发区域
    }
  }, []);

  // 整理详情信息
  (0, _react.useEffect)(function () {
    if (detailsVal) {
      handleDetails();
      getSourceSelect();
      getOrderNatureSelect();
      getOrderCategorySelect();
      getOrderAddressSelect({
        levelEnd: 3
      }, function (data) {
        setKeyAreaData(data);
        getTreeSelectShow({
          options: data,
          value: 'hzDistrictDivisionId',
          label: '事发区域',
          modalType: 'Import',
          myForm: myForm,
          detailsVal: detailsVal
        });
      }); // 事发区域
    }
  }, [detailsVal]);

  // 整理详情展示信息
  var handleDetails = function handleDetails() {
    var formItems = getItems() || [];
    if (caseSource && modalType === 'Details') {
      // 详情
      if (title === '工单') {
        setSourceValue(caseSource); // 详情更改工单类型
      }
      var modalVal = getDetailsModalValue({
        formItems: formItems,
        formValue: detailsVal
      }) || {};
      setFormData(modalVal);
    }
  };

  // 工单来源
  var getSourceSelect = function getSourceSelect() {
    getSourceData(_objectSpread({}, extraParams)).then(function (res) {
      var list = [];
      if (String(res === null || res === void 0 ? void 0 : res.result) === '0' && res !== null && res !== void 0 && res.data) {
        list = _PublicService["default"].transformOptions({
          data: (res === null || res === void 0 ? void 0 : res.data) || [],
          valueIndex: 'code',
          labelIndex: 'name',
          paramsAll: true
        });
      }
      setSourceData(list);
    });
  };

  // 工单性质
  var getOrderNatureSelect = function getOrderNatureSelect() {
    getOrderNatureData(_objectSpread({}, extraParams)).then(function (res) {
      var list = [];
      if (String(res === null || res === void 0 ? void 0 : res.result) === '0' && res !== null && res !== void 0 && res.data) {
        list = _PublicService["default"].transformOptions({
          data: (res === null || res === void 0 ? void 0 : res.data) || [],
          valueIndex: 'id',
          labelIndex: 'level',
          paramsAll: true
        });
      }
      setOrderNatureData(list);
      getSelectShow({
        options: list,
        value: 'urgencyLevelId',
        label: '诉求性质',
        modalType: 'Import',
        myForm: myForm,
        detailsVal: detailsVal
      });
    });
  };

  //递归
  var _renderTree = function renderTree(data) {
    data.label = data === null || data === void 0 ? void 0 : data.name;
    data.title = data === null || data === void 0 ? void 0 : data.name;
    data.value = data === null || data === void 0 ? void 0 : data.key;
    if (['root', 'type'].includes(data === null || data === void 0 ? void 0 : data.type)) {
      data.disabled = true;
    }
    if (data.children && data.children.length) {
      data.disabled = true;
      data.children.map(function (val) {
        _renderTree(val);
      });
    }
    return data;
  };

  // 工单类别
  var getOrderCategorySelect = function getOrderCategorySelect() {
    getOrderCategoryData(_objectSpread({}, extraParams)).then(function (res) {
      var list = [];
      if (String(res === null || res === void 0 ? void 0 : res.result) === '0' && res !== null && res !== void 0 && res.data) {
        list = [res === null || res === void 0 ? void 0 : res.data] || [];
        list && list.length && list.map(function (item) {
          _renderTree(item);
        });
      }
      setOrderCategoryData(list);
      getTreeSelectShow({
        options: list,
        value: 'eventAndComponentManageId',
        label: '工单类别',
        modalType: 'Import',
        myForm: myForm,
        detailsVal: detailsVal
      });
    });
  };

  // 获取事发区域、所属街道、所属社区
  var getOrderAddressSelect = function getOrderAddressSelect() {
    var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var callBack = arguments.length > 1 ? arguments[1] : undefined;
    getOrderAddress(params).then(function (res) {
      var list = [];
      if (String(res === null || res === void 0 ? void 0 : res.result) === '0' && res !== null && res !== void 0 && res.data) {
        list = [res === null || res === void 0 ? void 0 : res.data] || [];
        list && list.length && list.map(function (item) {
          _renderTree(item);
        });
      }
      callBack && callBack(list);
    });
  };

  // 更改工单来源
  var handleSource = function handleSource(value) {
    setSourceValue(value);
    clearFormData({
      hzDistrictDivisionId: undefined
    });
  };

  // 表单联动清空数据
  var clearFormData = function clearFormData() {
    var _myForm$current;
    var formParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    (myForm === null || myForm === void 0 || (_myForm$current = myForm.current) === null || _myForm$current === void 0 || (_myForm$current = _myForm$current.form) === null || _myForm$current === void 0 ? void 0 : _myForm$current.setFieldsValue) && myForm.current.form.setFieldsValue(formParams);
  };
  function onSave() {
    var _myForm$current2;
    (myForm === null || myForm === void 0 || (_myForm$current2 = myForm.current) === null || _myForm$current2 === void 0 || (_myForm$current2 = _myForm$current2.form) === null || _myForm$current2 === void 0 ? void 0 : _myForm$current2.validateFields) && myForm.current.form.validateFields().then(function (val) {
      var _val, _val2;
      // let val = myForm?.current?.form?.getFieldsValue() || {};
      // val.processDefinitionKey = 'customer_service_process';
      if ((_val = val) !== null && _val !== void 0 && _val.location && ((_val2 = val) === null || _val2 === void 0 ? void 0 : _val2.location) !== 'undefined,undefined') {
        var _val3, _val4;
        val.geoLocationDTO = {
          shapeType: 'point',
          coordinateType: 'wgs84',
          lngLats: (_val3 = val) === null || _val3 === void 0 ? void 0 : _val3.location
        };
        (_val4 = val) === null || _val4 === void 0 || delete _val4.location;
      } else {
        return _message["default"].warning('请去事发位置打点！', 2);
      }

      // 获取下拉选数据中对应的值
      var formItems = getItems() || [];
      val = getAddModalValue({
        formItems: formItems,
        formValue: val
      });
      var url = (paramsItems === null || paramsItems === void 0 ? void 0 : paramsItems.orderUrl) || '';
      if (url) {
        setModalBtnLoading(true);
        _request["default"].post(url, {
          body: _objectSpread({
            val: val
          }, extraParams),
          headers: {
            ticket: true
          }
        }).then(function (res) {
          if ((res === null || res === void 0 ? void 0 : res.result) === 0) {
            _message["default"].success('操作成功');
            onCancel();
          }
          setModalBtnLoading(false);
        });
      }
    });
  }

  // 关闭弹框
  var onCancel = function onCancel() {
    goBack && goBack();
  };
  var getDetailsForm = function getDetailsForm() {
    var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
    var formItems = _lodash["default"].cloneDeep(items);
    formItems.map(function (item) {
      var _item$items;
      if (item !== null && item !== void 0 && (_item$items = item.items) !== null && _item$items !== void 0 && _item$items.length) {
        item === null || item === void 0 || item.items.map(function (val) {
          if (['textArea', 'vtxUpload', 'fileUpload'].includes(val === null || val === void 0 ? void 0 : val.type)) {
            val.weights = column;
          } else if (val !== null && val !== void 0 && val.currentWeights) {
            val.weights = column;
          }
        });
      }
    });
    return formItems || [];
  };

  // 获取新增工单表单字段
  var getItems = function getItems() {
    var list = {
      '04': [
      // 巡检
      {
        type: 'card',
        label: '基本信息',
        items: [{
          type: 'select',
          label: "".concat(title, "\u6765\u6E90\u5C0F\u7C7B"),
          paramName: 'caseSource',
          itemProps: {
            options: sourceData,
            onChange: handleSource
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'input',
          label: "".concat(title, "\u7F16\u53F7"),
          paramName: 'taskNo',
          formItemLayout: {
            rules: [_objectSpread(_objectSpread({}, _config["default"].reg.required), _config["default"].reg.code)]
          }
        }, {
          type: 'input',
          label: "".concat(title, "\u540D\u79F0"),
          paramName: 'taskName',
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required), _objectSpread({}, _config["default"].reg.lengthMax(40))]
          }
        }, {
          type: 'select',
          label: "".concat(title, "\u6027\u8D28"),
          paramName: 'urgencyLevelId',
          paramNameStr: 'urgencyLevel',
          itemProps: {
            options: orderNatureData
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'treeSelect',
          label: "".concat(title, "\u7C7B\u522B"),
          paramName: 'eventAndComponentManageId',
          itemProps: {
            treeData: orderCategoryData,
            treeDefaultExpandAll: true
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'input',
          label: "\u4E8B\u53D1\u5BF9\u8C61",
          paramName: 'objName'
        }, {
          type: 'treeSelect',
          label: '事发区域',
          paramName: 'hzDistrictDivisionId',
          paramNameStr: 'hzDistrictDivisionName',
          itemProps: {
            treeData: keyAreaData,
            treeDefaultExpandAll: true
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }].concat(_toConsumableArray(modalType !== 'Details' ? [{
          type: 'mapLocation',
          label: '事发位置',
          showType: 'button',
          buttonLabel: '去地图',
          paramName: 'location',
          showAddress: 'address',
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }] : []), [{
          type: 'input',
          label: '事发地址',
          paramName: 'address',
          currentWeights: true,
          itemProps: {
            placeholder: '',
            disabled: true
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'textArea',
          label: "".concat(title, "\u63CF\u8FF0"),
          paramName: 'caseDesc',
          itemProps: {
            maxLength: 200
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          },
          weights: 3
        }, {
          type: 'vtxUpload',
          label: '照片',
          paramName: 'photo',
          formItemLayout: {
            initialValue: formData.photo || []
          },
          weights: 3,
          itemProps: {
            maxLength: 6,
            maxSize: 100 * 1024 * 1024,
            accept: '.jpg, .jpeg, .png'
          }
        }, {
          type: 'fileUpload',
          label: '附件',
          paramName: 'attach',
          weights: 3,
          fileView: true,
          formItemLayout: {
            initialValue: formData.attach || []
          },
          itemProps: {
            maxLength: 5,
            maxSize: 50 * 1024 * 1024,
            type: ['doc', 'docx', 'pdf', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'zip', 'rar', 'mp3', 'mp4'],
            accept: ['.doc', '.docx', '.pdf', '.xls', '.xlsx', '.ppt', '.pptx', '.txt', '.zip', '.rar', '.mp3', '.mp4']
          }
        }])
      }],
      '05': [
      // 预警
      {
        type: 'card',
        label: '基本信息',
        items: [].concat(_toConsumableArray(modalType === 'Details' ? [{
          type: 'select',
          label: "".concat(title, "\u6765\u6E90\u5C0F\u7C7B"),
          paramName: 'caseSource',
          itemProps: {
            options: sourceData,
            onChange: handleSource
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'input',
          label: "".concat(title, "\u7F16\u53F7"),
          paramName: 'taskNo',
          formItemLayout: {
            rules: [_objectSpread(_objectSpread({}, _config["default"].reg.required), _config["default"].reg.code)]
          }
        }] : []), [{
          type: 'input',
          label: "".concat(title, "\u540D\u79F0"),
          paramName: 'taskName',
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required), _objectSpread({}, _config["default"].reg.lengthMax(40))]
          }
        }, {
          type: 'select',
          label: "".concat(title, "\u6027\u8D28"),
          paramName: 'urgencyLevelId',
          paramNameStr: 'urgencyLevel',
          itemProps: {
            options: orderNatureData
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'treeSelect',
          label: "".concat(title, "\u7C7B\u522B"),
          paramName: 'eventAndComponentManageId',
          itemProps: {
            treeData: orderCategoryData,
            treeDefaultExpandAll: true
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'input',
          label: "\u4E8B\u53D1\u5BF9\u8C61",
          paramName: 'objName'
        }, {
          type: 'treeSelect',
          label: '事发区域',
          paramName: 'hzDistrictDivisionId',
          paramNameStr: 'hzDistrictDivisionName',
          itemProps: {
            treeData: keyAreaData,
            treeDefaultExpandAll: true
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }], _toConsumableArray(modalType !== 'Details' ? [{
          type: 'mapLocation',
          label: '事发位置',
          showType: 'button',
          buttonLabel: '去地图',
          paramName: 'location',
          showAddress: 'address',
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }] : []), [{
          type: 'input',
          label: '事发地址',
          paramName: 'address',
          currentWeights: true,
          itemProps: {
            placeholder: '',
            disabled: true
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'textArea',
          label: "".concat(title, "\u63CF\u8FF0"),
          paramName: 'caseDesc',
          itemProps: {
            maxLength: 200
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          },
          weights: 3
        }, {
          type: 'vtxUpload',
          label: '照片',
          paramName: 'photo',
          formItemLayout: {
            initialValue: formData.photo || []
          },
          weights: 3,
          itemProps: {
            maxLength: 6,
            maxSize: 100 * 1024 * 1024,
            accept: '.jpg, .jpeg, .png'
          }
        }, {
          type: 'fileUpload',
          label: '附件',
          paramName: 'attach',
          weights: 3,
          fileView: true,
          formItemLayout: {
            initialValue: formData.attach || []
          },
          itemProps: {
            maxLength: 5,
            maxSize: 50 * 1024 * 1024,
            type: ['doc', 'docx', 'pdf', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'zip', 'rar', 'mp3', 'mp4'],
            accept: ['.doc', '.docx', '.pdf', '.xls', '.xlsx', '.ppt', '.pptx', '.txt', '.zip', '.rar', '.mp3', '.mp4']
          }
        }])
      }],
      '06': [
      // 故障
      {
        type: 'card',
        label: '基本信息',
        items: [].concat(_toConsumableArray(modalType === 'Details' ? [{
          type: 'select',
          label: "".concat(title, "\u6765\u6E90\u5C0F\u7C7B"),
          paramName: 'caseSource',
          itemProps: {
            options: sourceData,
            onChange: handleSource
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'input',
          label: "".concat(title, "\u7F16\u53F7"),
          paramName: 'taskNo',
          formItemLayout: {
            rules: [_objectSpread(_objectSpread({}, _config["default"].reg.required), _config["default"].reg.code)]
          }
        }] : []), [{
          type: 'input',
          label: "".concat(title, "\u540D\u79F0"),
          paramName: 'taskName',
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required), _objectSpread({}, _config["default"].reg.lengthMax(40))]
          }
        }, {
          type: 'select',
          label: "".concat(title, "\u6027\u8D28"),
          paramName: 'urgencyLevelId',
          paramNameStr: 'urgencyLevel',
          itemProps: {
            options: orderNatureData
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'treeSelect',
          label: "".concat(title, "\u7C7B\u522B"),
          paramName: 'eventAndComponentManageId',
          itemProps: {
            treeData: orderCategoryData,
            treeDefaultExpandAll: true
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'input',
          label: "\u6545\u969C\u6765\u6E90",
          paramName: 'faultSourceName',
          itemProps: {
            disabled: true
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'datePicker',
          label: "\u6545\u969C\u5F00\u59CB\u65F6\u95F4",
          paramName: 'faultStartTime',
          itemProps: {
            disabled: true,
            showTime: {
              format: 'HH:mm:ss'
            },
            format: 'YYYY-MM-DD HH:mm:ss'
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'input',
          label: "\u6545\u969C\u8BBE\u5907\u540D\u79F0",
          paramName: 'objName',
          itemProps: {
            disabled: true
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'input',
          label: "\u6545\u969C\u90E8\u4F4D",
          paramName: 'faultLocation',
          itemProps: {
            disabled: true
          }
        }, {
          type: 'input',
          label: "\u6240\u5C5E\u8BBE\u65BD",
          paramName: 'facilityName',
          itemProps: {
            disabled: true
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'treeSelect',
          label: '事发区域',
          paramName: 'hzDistrictDivisionId',
          paramNameStr: 'hzDistrictDivisionName',
          itemProps: {
            treeData: keyAreaData,
            treeDefaultExpandAll: true
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }], _toConsumableArray(modalType !== 'Details' ? [{
          type: 'mapLocation',
          label: '事发位置',
          showType: 'button',
          buttonLabel: '去地图',
          paramName: 'location',
          showAddress: 'address',
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }] : []), [{
          type: 'input',
          label: '事发地址',
          paramName: 'address',
          currentWeights: true,
          itemProps: {
            placeholder: '',
            disabled: true
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          }
        }, {
          type: 'textArea',
          label: "".concat(title, "\u63CF\u8FF0"),
          paramName: 'caseDesc',
          itemProps: {
            maxLength: 200
          },
          formItemLayout: {
            rules: [_objectSpread({}, _config["default"].reg.required)]
          },
          weights: 3
        }, {
          type: 'vtxUpload',
          label: '照片',
          paramName: 'photo',
          formItemLayout: {
            initialValue: formData.photo || []
          },
          weights: 3,
          itemProps: {
            maxLength: 6,
            maxSize: 100 * 1024 * 1024,
            accept: '.jpg, .jpeg, .png'
          }
        }, {
          type: 'fileUpload',
          label: '附件',
          paramName: 'attach',
          weights: 3,
          fileView: true,
          formItemLayout: {
            initialValue: formData.attach || []
          },
          itemProps: {
            maxLength: 5,
            maxSize: 50 * 1024 * 1024,
            type: ['doc', 'docx', 'pdf', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'zip', 'rar', 'mp3', 'mp4'],
            accept: ['.doc', '.docx', '.pdf', '.xls', '.xlsx', '.ppt', '.pptx', '.txt', '.zip', '.rar', '.mp3', '.mp4']
          }
        }])
      }]
    };
    return (list === null || list === void 0 ? void 0 : list[sourceValue]) || (list === null || list === void 0 ? void 0 : list['04']);
  };
  var currentItems = getItems() || [];
  var items = modalType === 'Details' ? getDetailsForm(currentItems) : currentItems;
  var disabled = modalType === 'Details';
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(_index["default"].createOrderWrap, " ").concat(isProcess && _index["default"].createOrderWrapOther)
  }, /*#__PURE__*/_react["default"].createElement(_FormModal["default"], _extends({
    width: 1200,
    column: column,
    ref: myForm,
    visible: true,
    formData: formData,
    title: "",
    items: items,
    isShowModal: false,
    disabled: disabled,
    footerShow: !disabled,
    modalLoading: modalLoading,
    modalBtnLoading: modalBtnLoading,
    formStyle: {
      width: '100%'
    }
  }, modal)), disabled ? null : /*#__PURE__*/_react["default"].createElement("div", {
    className: _index["default"].orderButton
  }, /*#__PURE__*/_react["default"].createElement(_button["default"], {
    onClick: onCancel,
    loading: modalBtnLoading
  }, "\u53D6\u6D88"), /*#__PURE__*/_react["default"].createElement(_button["default"], {
    type: "primary",
    onClick: onSave,
    loading: modalBtnLoading
  }, "\u786E\u5B9A")));
}
//# sourceMappingURL=index.js.map
