"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _config = _interopRequireDefault(require("../../../_mapUtil/config"));
var _dayjs = _interopRequireDefault(require("dayjs"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
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); }
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); } /**
 * 流程相关参数
 */
// 获取下拉选数据的对应显示值
var getSelectName = function getSelectName(_ref) {
  var _ref$currentItem = _ref.currentItem,
    currentItem = _ref$currentItem === void 0 ? {} : _ref$currentItem,
    _ref$formValue = _ref.formValue,
    formValue = _ref$formValue === void 0 ? {} : _ref$formValue;
  var _formValue = formValue;
  var options = (currentItem === null || currentItem === void 0 ? void 0 : currentItem.options) || [];
  var item = options.find(function (val) {
    return val.value === (formValue === null || formValue === void 0 ? void 0 : formValue[currentItem === null || currentItem === void 0 ? void 0 : currentItem.paramName]);
  }) || {};
  var selectName = item === null || item === void 0 ? void 0 : item.label;
  _formValue["".concat(currentItem === null || currentItem === void 0 ? void 0 : currentItem.paramNameStr)] = selectName;
  return _formValue;
};

// 获取下拉选数据的对应显示值
var getTreeSelectName = function getTreeSelectName(_ref2) {
  var _ref2$currentItem = _ref2.currentItem,
    currentItem = _ref2$currentItem === void 0 ? {} : _ref2$currentItem,
    _ref2$formValue = _ref2.formValue,
    formValue = _ref2$formValue === void 0 ? {} : _ref2$formValue;
  var _formValue = formValue,
    selectName = '';
  var _renderTree = function renderTree(data) {
    var _data$children;
    if ((data === null || data === void 0 ? void 0 : data.value) === (formValue === null || formValue === void 0 ? void 0 : formValue[currentItem === null || currentItem === void 0 ? void 0 : currentItem.paramName])) {
      selectName = data === null || data === void 0 ? void 0 : data.label;
    } else if (data !== null && data !== void 0 && (_data$children = data.children) !== null && _data$children !== void 0 && _data$children.length) {
      data.children.map(function (v) {
        _renderTree(v);
      });
    }
  };
  var options = (currentItem === null || currentItem === void 0 ? void 0 : currentItem.options) || [];
  if (options && options.length) {
    options.map(function (val) {
      _renderTree(val);
    });
  }
  _formValue[currentItem === null || currentItem === void 0 ? void 0 : currentItem.paramNameStr] = selectName;
  return _formValue;
};

// 根据工单导入信息下拉选获取对应值
var getSelectValue = function getSelectValue(_ref3) {
  var _ref3$value = _ref3.value,
    value = _ref3$value === void 0 ? '' : _ref3$value,
    _ref3$options = _ref3.options,
    options = _ref3$options === void 0 ? [] : _ref3$options;
  var item = (options === null || options === void 0 ? void 0 : options.find(function (val) {
    return val.label === value;
  })) || {};
  return item === null || item === void 0 ? void 0 : item.value;
};

// 根据工单导入信息下拉树获取对应值
var getTreeSelectValue = function getTreeSelectValue(_ref4) {
  var _ref4$value = _ref4.value,
    value = _ref4$value === void 0 ? '' : _ref4$value,
    _ref4$options = _ref4.options,
    options = _ref4$options === void 0 ? [] : _ref4$options;
  var currentValue = '';
  var _renderTree2 = function renderTree(data) {
    var _data$children2;
    if ((data === null || data === void 0 ? void 0 : data.label) === value) {
      currentValue = data === null || data === void 0 ? void 0 : data.value;
    } else if (data !== null && data !== void 0 && (_data$children2 = data.children) !== null && _data$children2 !== void 0 && _data$children2.length) {
      data.children.map(function (v) {
        _renderTree2(v);
      });
    }
  };
  options && options.length && options.map(function (val) {
    _renderTree2(val);
  });
  return currentValue;
};

// 根据value获取树下拉的名称
var getTreeSelectNameByValue = function getTreeSelectNameByValue(_ref5) {
  var _ref5$value = _ref5.value,
    value = _ref5$value === void 0 ? '' : _ref5$value,
    _ref5$options = _ref5.options,
    options = _ref5$options === void 0 ? [] : _ref5$options;
  var currentName = '';
  var _renderTree3 = function renderTree(data) {
    var _data$children3;
    if ((data === null || data === void 0 ? void 0 : data.value) === value) {
      currentName = data === null || data === void 0 ? void 0 : data.label;
    } else if (data !== null && data !== void 0 && (_data$children3 = data.children) !== null && _data$children3 !== void 0 && _data$children3.length) {
      data.children.map(function (v) {
        _renderTree3(v);
      });
    }
  };
  options && options.length && options.map(function (val) {
    _renderTree3(val);
  });
  return currentName;
};
var _default = exports["default"] = {
  // 工单流程接口及其他相关配置参数
  // 客服工单
  serviceProcessParams: {
    CreateTicket: {
      // 创建工单
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/report")
    },
    Import: {
      // 创建工单--导入
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/report")
    },
    InfoRecall: {
      // 信息中心撤回
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hang/zhou/centerWithdrawCompany")
    },
    Recall: {
      // 子公司撤回
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hang/zhou/companyWithdrawDept")
    },
    Payout: {
      // 信息中心派发
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hang/zhou/dispatch")
    },
    Redeploy: {
      // 子公司转派
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hang/zhou/companyDispatch")
    },
    UnitDispose: {
      // 子公司直接处置
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hang/zhou/companyDispose")
    },
    Dispose: {
      // 部门处置
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hang/zhou/orgDispose")
    },
    UnitFeedback: {
      // 子公司反馈
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hang/zhou/companyFeedback")
    },
    TimeOutApply: {
      // 延期申请
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/audit/record/apply")
    },
    Written: {
      // 批示
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/command")
    },
    TimeOutCheck: {
      // 延期审核
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/audit/record/approve")
    },
    OrderCheck: {
      // 子公司审核--二级审核
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hang/zhou/companyAudit")
    },
    InfoOrderCheck: {
      // 信息中心审核--一级审核
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hang/zhou/audit")
    },
    OrderTwoManage: {
      // 工单二次办理
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hang/zhou/disposeAgain")
    },
    PayReturn: {
      // 回访
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/callback")
    },
    PressToDo: {
      // 催办
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/urgeDispose")
    },
    BackOut: {
      // 信息中心撤销
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hang/zhou/revocation"),
      isParams: true
    },
    Back: {
      // 子公司部门退回
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hang/zhou/orgWithdraw"),
      isParams: true
    },
    unitBack: {
      // 子公司退回
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hang/zhou/companyWithdraw"),
      isParams: true
    }
  },
  // 内部工单
  processParams: {
    CreateTicket: {
      // 创建工单
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/report")
    },
    Import: {
      // 创建工单
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/report")
    },
    Payout: {
      // 待派发
      status: '派发',
      isNeedProcess: true,
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/completeProcess")
    },
    Dispose: {
      // 处置
      status: '处置',
      isNeedProcess: true,
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hangZhouDisposeProcess")
    },
    TimeOutApply: {
      // 延期申请
      status: '派发',
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/audit/record/apply")
    },
    Written: {
      // 批示
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/command")
    },
    TimeOutCheck: {
      // 延期审核
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/audit/record/approve")
    },
    OrderCheck: {
      // 工单审核
      isNeedProcess: true,
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/completeProcess")
    },
    OrderTwoManage: {
      // 工单二次办理
      status: '二次办理',
      isNeedProcess: true,
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/completeProcess")
      // orderUrl: `${config.publicUrlZHXT}/case/info/mainDispose`,
    },
    PayReturn: {
      // 回访
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/callback")
    },
    Recall: {
      // 撤回
      status: '撤回',
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/hangZhouWithdrawProcess")
    },
    PressToDo: {
      // 催办
      status: '催办',
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/urgeDispose")
    },
    BackOut: {
      // 撤销
      status: '撤销',
      isNeedProcess: true,
      orderUrl: "".concat(_config["default"].publicUrlZHXT, "/case/info/completeProcess")
    },
    otherProcess: {
      // 其他流程
      orderUrl: "".concat(_config["default"].publicUrlSJGD, "/api/workOrder/caseCompleteProcess")
    }
  },
  // 工单详情流程信息对应类型获取表单展示
  processDetailParams: function processDetailParams() {
    var modalVal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var operateTypeCode = modalVal.operateTypeCode,
      operateContent = modalVal.operateContent;
    var list = {
      // '-1': 'Report', // 上报
      '3': 'Payout',
      // 信息中心派发
      '4': 'Dispose',
      // 公司部门处置
      '6': 'OrderCheck',
      //  子公司审核---二级审核
      '8': 'OrderTwoManage',
      //  二次办理
      '15': 'UnitFeedback',
      //  子公司反馈
      '103': 'TimeOutApply',
      //  延期申请
      '101': 'Written',
      //  督办批示、派发批示
      '102': 'PayReturn',
      //  回访
      '106': 'Recall',
      //  子公司撤回
      '105': 'PressToDo',
      //  催办
      '104': 'TimeOutCheck',
      // 延期审核
      // '107': 'PunchCard', // 打卡
      // '10': 'BackOut', //  撤销
      // '11': 'Written', //  批示
      // '8': 'EndOrder', // 已办结
      // '0': 'InfoRecall', //  信息中心撤回
      // '0': 'UnitDispose', //  子公司处置
      // '0': 'Redeploy', //  转派
      // '0': 'Back', //  子公司退回、子公司部门退回
      '7': 'InfoOrderCheck' //  信息中心审核---一级审核
      // '0': 'OrderCheckBack', //  审核退回
    };
    var modalType = (list === null || list === void 0 ? void 0 : list[operateTypeCode]) || '';
    if (operateContent.indexOf('转派') !== -1) {
      modalType = 'Redeploy';
    }
    //  else if(operateContent.indexOf('') !== -1){
    //   modalType = ''
    // }
    return modalType;
  },
  //
  processOperateTypeName: {
    // '-1': 'Report', // 上报
    '3': '派发',
    // 派发
    '4': '处置',
    // 处置
    // '6': '延期审核', // 延期审核
    // '7': '撤销', //  撤销
    // '103': '延期申请', //  延期申请
    '105': '催办',
    //  催办
    '106': '撤回',
    //  撤回
    // '101': '督办批示', //  批示
    // '101': '派发批示', //  批示
    '7': '审核',
    //  审核
    '102': '回访',
    //  回访
    '110': '到场' //  打卡
    // '8': '二次办理', //  二次办理
  },
  // 片区等级
  districtLevelList: [{
    key: '1',
    value: '一级'
  }, {
    key: '2',
    value: '二级'
  }, {
    key: '3',
    value: '三级'
  }, {
    key: '4',
    value: '四级'
  }],
  // 客服工单
  processOperateTypeNameService: function processOperateTypeNameService() {
    var processVal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var list = {
      // '-1': 'Report', // 上报
      '3': '派发',
      // 派发
      '4': '处置',
      // 处置
      // '6': '延期审核', // 延期审核
      // '7': '撤销', //  撤销
      // '103': '延期申请', //  延期申请
      '105': '催办',
      //  催办
      '106': '撤回',
      //  撤回
      // '101': '督办批示', //  批示
      // '101': '派发批示', //  批示
      '7': '审核',
      //  审核
      '102': '回访',
      //  回访
      '110': '到场',
      //  打卡
      '15': '反馈' //  子公司反馈
      // '8': '二次办理', //  二次办理
    };
    var name = (list === null || list === void 0 ? void 0 : list[processVal === null || processVal === void 0 ? void 0 : processVal.operateTypeCode]) || (processVal === null || processVal === void 0 ? void 0 : processVal.operateType);
    var reg = new RegExp('待', 'g');
    name = name.replace(reg, '');
    return name;
  },
  // 获取表单中对应的值 formItems表单所有字段、
  getAddModalValue: function getAddModalValue(_ref6) {
    var _ref6$formItems = _ref6.formItems,
      formItems = _ref6$formItems === void 0 ? [] : _ref6$formItems,
      _ref6$formValue = _ref6.formValue,
      formValue = _ref6$formValue === void 0 ? {} : _ref6$formValue;
    var _formValue = formValue;
    formItems && formItems && formItems.map(function (item) {
      if (item !== null && item !== void 0 && item.items && item !== null && item !== void 0 && item.items.length) {
        item === null || item === void 0 || item.items.map(function (val) {
          var currentItem = {};
          if (val.type === 'select') {
            var _val$itemProps;
            currentItem = _objectSpread(_objectSpread({}, val), {}, {
              options: (val === null || val === void 0 || (_val$itemProps = val.itemProps) === null || _val$itemProps === void 0 ? void 0 : _val$itemProps.options) || [],
              paramNameStr: (val === null || val === void 0 ? void 0 : val.paramNameStr) || "".concat(val === null || val === void 0 ? void 0 : val.paramName, "Str")
            });
            _formValue = getSelectName({
              formValue: formValue,
              currentItem: currentItem
            });
          } else if (val.type === 'treeSelect') {
            var _val$itemProps2;
            currentItem = _objectSpread(_objectSpread({}, val), {}, {
              options: (val === null || val === void 0 || (_val$itemProps2 = val.itemProps) === null || _val$itemProps2 === void 0 ? void 0 : _val$itemProps2.treeData) || [],
              paramNameStr: (val === null || val === void 0 ? void 0 : val.paramNameStr) || "".concat(val === null || val === void 0 ? void 0 : val.paramName, "Str")
            });
            _formValue = getTreeSelectName({
              formValue: formValue,
              currentItem: currentItem
            });
          } else if (val.type === 'datePicker') {
            // 时间
            _formValue[val === null || val === void 0 ? void 0 : val.paramName] = formValue !== null && formValue !== void 0 && formValue[val === null || val === void 0 ? void 0 : val.paramName] ? (0, _dayjs["default"])(formValue === null || formValue === void 0 ? void 0 : formValue[val === null || val === void 0 ? void 0 : val.paramName]).format('YYYY-MM-DD HH:mm:ss') : '';
          } else if (['vtxUpload', 'fileUpload'].includes(val.type)) {
            var _formValue$val$paramN;
            // 附件、图片
            if (formValue !== null && formValue !== void 0 && (_formValue$val$paramN = formValue[val === null || val === void 0 ? void 0 : val.paramName]) !== null && _formValue$val$paramN !== void 0 && _formValue$val$paramN.length) {
              _formValue[val === null || val === void 0 ? void 0 : val.paramName] = formValue !== null && formValue !== void 0 && formValue[val === null || val === void 0 ? void 0 : val.paramName] ? JSON.stringify(formValue === null || formValue === void 0 ? void 0 : formValue[val === null || val === void 0 ? void 0 : val.paramName]) : '';
            } else {
              delete _formValue[val === null || val === void 0 ? void 0 : val.paramName];
            }
          }
        });
      } else {
        var currentItem = {};
        if (item.type === 'select') {
          var _item$itemProps;
          currentItem = _objectSpread(_objectSpread({}, item), {}, {
            options: (item === null || item === void 0 || (_item$itemProps = item.itemProps) === null || _item$itemProps === void 0 ? void 0 : _item$itemProps.options) || [],
            paramNameStr: (item === null || item === void 0 ? void 0 : item.paramNameStr) || "".concat(item === null || item === void 0 ? void 0 : item.paramName, "Str")
          });
          _formValue = getSelectName({
            formValue: formValue,
            currentItem: currentItem
          });
        } else if (item.type === 'treeSelect') {
          var _item$itemProps2;
          currentItem = _objectSpread(_objectSpread({}, item), {}, {
            options: (item === null || item === void 0 || (_item$itemProps2 = item.itemProps) === null || _item$itemProps2 === void 0 ? void 0 : _item$itemProps2.treeData) || [],
            paramNameStr: (item === null || item === void 0 ? void 0 : item.paramNameStr) || "".concat(item === null || item === void 0 ? void 0 : item.paramName, "Str")
          });
          _formValue = getTreeSelectName({
            formValue: formValue,
            currentItem: currentItem
          });
        } else if (item.type === 'datePicker') {
          // 时间
          _formValue[item === null || item === void 0 ? void 0 : item.paramName] = formValue !== null && formValue !== void 0 && formValue[item === null || item === void 0 ? void 0 : item.paramName] ? (0, _dayjs["default"])(formValue === null || formValue === void 0 ? void 0 : formValue[item === null || item === void 0 ? void 0 : item.paramName]).format('YYYY-MM-DD HH:mm:ss') : '';
        } else if (['vtxUpload', 'fileUpload'].includes(item.type)) {
          var _formValue$item$param;
          // 附件、图片
          if (formValue !== null && formValue !== void 0 && (_formValue$item$param = formValue[item === null || item === void 0 ? void 0 : item.paramName]) !== null && _formValue$item$param !== void 0 && _formValue$item$param.length) {
            _formValue[item === null || item === void 0 ? void 0 : item.paramName] = formValue !== null && formValue !== void 0 && formValue[item === null || item === void 0 ? void 0 : item.paramName] ? JSON.stringify(formValue === null || formValue === void 0 ? void 0 : formValue[item === null || item === void 0 ? void 0 : item.paramName]) : '';
          } else {
            delete _formValue[item === null || item === void 0 ? void 0 : item.paramName];
          }
        }
      }
    });
    return _formValue;
  },
  // 获取详情表单数据展示
  getDetailsModalValue: function getDetailsModalValue(_ref7) {
    var _ref7$formItems = _ref7.formItems,
      formItems = _ref7$formItems === void 0 ? [] : _ref7$formItems,
      _ref7$formValue = _ref7.formValue,
      formValue = _ref7$formValue === void 0 ? {} : _ref7$formValue;
    var _formValue = formValue;
    formItems && formItems && formItems.map(function (item) {
      if (item !== null && item !== void 0 && item.items && item !== null && item !== void 0 && item.items.length) {
        item === null || item === void 0 || item.items.map(function (val) {
          var currentItem = [];
          if (['fileUpload', 'vtxUpload'].includes(val === null || val === void 0 ? void 0 : val.type)) {
            var _formValue$val$paramN2;
            currentItem = formValue !== null && formValue !== void 0 && (_formValue$val$paramN2 = formValue[val === null || val === void 0 ? void 0 : val.paramName]) !== null && _formValue$val$paramN2 !== void 0 && _formValue$val$paramN2.length ? JSON.parse(formValue === null || formValue === void 0 ? void 0 : formValue[val === null || val === void 0 ? void 0 : val.paramName]) : [];
            _formValue[val === null || val === void 0 ? void 0 : val.paramName] = currentItem;
          }
        });
      } else {
        var currentItem = [];
        if (['fileUpload', 'vtxUpload'].includes(item === null || item === void 0 ? void 0 : item.type)) {
          var _formValue$item$param2;
          currentItem = formValue !== null && formValue !== void 0 && (_formValue$item$param2 = formValue[item === null || item === void 0 ? void 0 : item.paramName]) !== null && _formValue$item$param2 !== void 0 && _formValue$item$param2.length ? JSON.parse(formValue === null || formValue === void 0 ? void 0 : formValue[item === null || item === void 0 ? void 0 : item.paramName]) : [];
          _formValue[item === null || item === void 0 ? void 0 : item.paramName] = currentItem;
        }
      }
    });
    return _formValue;
  },
  // 导入工单表单信息整理
  getImportModalValue: function getImportModalValue(_ref8) {
    var _ref8$formItems = _ref8.formItems,
      formItems = _ref8$formItems === void 0 ? [] : _ref8$formItems,
      _ref8$formValue = _ref8.formValue,
      formValue = _ref8$formValue === void 0 ? {} : _ref8$formValue;
    var _formValue = {};
    var formValueKeys = Object.keys(formValue) || [];
    formItems && formItems && formItems.map(function (item) {
      if (item !== null && item !== void 0 && item.items && item !== null && item !== void 0 && item.items.length) {
        item === null || item === void 0 || item.items.map(function (val) {
          var label = val === null || val === void 0 ? void 0 : val.label;
          if (Array.isArray(val === null || val === void 0 ? void 0 : val.exportLabel)) {
            val === null || val === void 0 || val.exportLabel.map(function (v) {
              if (formValue !== null && formValue !== void 0 && formValue[v]) {
                label = v;
              }
            });
          } else if (val !== null && val !== void 0 && val.exportLabel) {
            label = val === null || val === void 0 ? void 0 : val.exportLabel;
          }
          if (formValueKeys.includes(label) && formValue !== null && formValue !== void 0 && formValue[label]) {
            if (val.type === 'select') {
              var _val$itemProps3;
              _formValue[val === null || val === void 0 ? void 0 : val.paramName] = getSelectValue({
                value: formValue === null || formValue === void 0 ? void 0 : formValue[label],
                options: (val === null || val === void 0 || (_val$itemProps3 = val.itemProps) === null || _val$itemProps3 === void 0 ? void 0 : _val$itemProps3.options) || []
              });
            } else if (val.type === 'treeSelect') {
              var _val$itemProps4;
              var value = '';
              if (val !== null && val !== void 0 && val.handleValue) {
                var _formValue$label;
                value = (formValue === null || formValue === void 0 || (_formValue$label = formValue[label]) === null || _formValue$label === void 0 || (_formValue$label = _formValue$label.split(val.handleValue)) === null || _formValue$label === void 0 ? void 0 : _formValue$label[1]) || '';
              } else {
                value = formValue === null || formValue === void 0 ? void 0 : formValue[label];
              }
              _formValue[val === null || val === void 0 ? void 0 : val.paramName] = getTreeSelectValue({
                value: value,
                options: (val === null || val === void 0 || (_val$itemProps4 = val.itemProps) === null || _val$itemProps4 === void 0 ? void 0 : _val$itemProps4.treeData) || []
              });
            } else if ((val === null || val === void 0 ? void 0 : val.type) === 'datePicker') {
              _formValue[val === null || val === void 0 ? void 0 : val.paramName] = (0, _dayjs["default"])(formValue === null || formValue === void 0 ? void 0 : formValue[label]);
            } else if (['fileUpload', 'vtxUpload'].includes(val === null || val === void 0 ? void 0 : val.type)) {
              var _value2 = (formValue === null || formValue === void 0 ? void 0 : formValue[label]) || [];
              var list = [];
              if (_value2 !== null && _value2 !== void 0 && _value2.length) {
                _value2.map(function (item) {
                  list.push({
                    id: item
                  });
                });
              }
              _formValue[val === null || val === void 0 ? void 0 : val.paramName] = list;
            } else {
              if (['补充备注', '备注'].includes(label)) {
                _formValue[val === null || val === void 0 ? void 0 : val.paramName] = "".concat(formValue === null || formValue === void 0 ? void 0 : formValue['备注'], " ").concat(formValue === null || formValue === void 0 ? void 0 : formValue['补充备注']);
              } else {
                _formValue[val === null || val === void 0 ? void 0 : val.paramName] = formValue === null || formValue === void 0 ? void 0 : formValue[label];
              }
            }
          }
        });
      }
    });
    return _formValue;
  },
  getTreeSelectValue: getTreeSelectValue,
  getTreeSelectNameByValue: getTreeSelectNameByValue,
  // 下拉选回显
  getSelectShow: function getSelectShow(_ref9) {
    var myForm = _ref9.myForm,
      _ref9$options = _ref9.options,
      options = _ref9$options === void 0 ? [] : _ref9$options,
      value = _ref9.value,
      label = _ref9.label,
      modalType = _ref9.modalType,
      _ref9$detailsVal = _ref9.detailsVal,
      detailsVal = _ref9$detailsVal === void 0 ? {} : _ref9$detailsVal;
    if (modalType === 'Import') {
      var _myForm$current;
      var currentInfo = (options === null || options === void 0 ? void 0 : options.find(function (val) {
        return (val === null || val === void 0 ? void 0 : val.label) === (detailsVal === null || detailsVal === void 0 ? void 0 : detailsVal[label]);
      })) || {};
      (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(_defineProperty({}, value, currentInfo === null || currentInfo === void 0 ? void 0 : currentInfo.value));
    }
  },
  // 下拉树回显
  getTreeSelectShow: function getTreeSelectShow(_ref10) {
    var _ref10$options = _ref10.options,
      options = _ref10$options === void 0 ? [] : _ref10$options,
      value = _ref10.value,
      label = _ref10.label,
      modalType = _ref10.modalType,
      myForm = _ref10.myForm,
      _ref10$detailsVal = _ref10.detailsVal,
      detailsVal = _ref10$detailsVal === void 0 ? {} : _ref10$detailsVal;
    if (modalType === 'Import') {
      var _myForm$current2;
      var currentValue = detailsVal === null || detailsVal === void 0 ? void 0 : detailsVal[label];
      if (label === '事发区域') {
        var _detailsVal$事发区域;
        if ((detailsVal === null || detailsVal === void 0 || (_detailsVal$事发区域 = detailsVal['事发区域']) === null || _detailsVal$事发区域 === void 0 ? void 0 : _detailsVal$事发区域.indexOf('市')) !== -1) {
          var _detailsVal$事发区域2;
          currentValue = (detailsVal === null || detailsVal === void 0 || (_detailsVal$事发区域2 = detailsVal['事发区域']) === null || _detailsVal$事发区域2 === void 0 || (_detailsVal$事发区域2 = _detailsVal$事发区域2.split('市')) === null || _detailsVal$事发区域2 === void 0 ? void 0 : _detailsVal$事发区域2[1]) || '';
        }
      }
      var _value = getTreeSelectValue({
        value: currentValue,
        options: options
      });
      (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.setFieldsValue) && myForm.current.form.setFieldsValue(_defineProperty({}, value, _value));
    }
  },
  // 获取办理类型---区分派发、转派
  getManageType: function getManageType(_ref11) {
    var modalType = _ref11.modalType;
    var depType = 'bm';
    if (['Payout', 'RePayout', 'OrderTwoManage', 'InfoOrderCheck'].includes(modalType)) {
      // 派发、重新派发、再次办理、信息中心审核不通过
      depType = 'gs';
    }
    return depType;
  },
  // 接口请求传参方式调整
  changeUrlParams: function changeUrlParams() {
    var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var _params = '';
    var keys = Object.keys(params) || [];
    (keys === null || keys === void 0 ? void 0 : keys.length) && keys.map(function (item, index) {
      if (index === 0) {
        _params = "?".concat(item, "=").concat(params === null || params === void 0 ? void 0 : params[item]);
      } else {
        _params += "&".concat(item, "=").concat(params === null || params === void 0 ? void 0 : params[item]);
      }
    });
    return _params;
  },
  // 流程详情类型判断
  processTypeJudge: function processTypeJudge(_ref12) {
    var _flagList$filter;
    var _ref12$typeList = _ref12.typeList,
      typeList = _ref12$typeList === void 0 ? [] : _ref12$typeList,
      _ref12$processVal = _ref12.processVal,
      processVal = _ref12$processVal === void 0 ? {} : _ref12$processVal;
    var flagList = [],
      flag = false;
    typeList.map(function (item) {
      var _processVal$operateCo;
      if ((processVal === null || processVal === void 0 || (_processVal$operateCo = processVal.operateContent) === null || _processVal$operateCo === void 0 ? void 0 : _processVal$operateCo.indexOf(item)) !== -1) {
        flagList.push(true);
      } else {
        flagList.push(false);
      }
    });
    flag = ((_flagList$filter = flagList.filter(function (val) {
      return val === true;
    })) === null || _flagList$filter === void 0 ? void 0 : _flagList$filter.length) > 0;
    return flag;
  }
};
//# sourceMappingURL=config.js.map
