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); }
import { BizSelect, IconFont } from '@zgfe/business-lib';
import { InputNumber, Tooltip } from 'antd';
import React from 'react';
import { classPrefix } from '.';
import arrow from '../images/arrow.png';
import arrow2 from '../images/arrow2.png';
import sourceImg from '../images/source.png';
import targetImg from '../images/target.png';
var FusionField = function FusionField(_ref) {
  var value = _ref.value,
    label = _ref.label,
    tableColumns = _ref.tableColumns,
    sourceType = _ref.sourceType,
    defaultTarget = _ref.defaultTarget,
    _onChange = _ref.onChange;
  return /*#__PURE__*/React.createElement("div", {
    className: classPrefix
  }, /*#__PURE__*/React.createElement(BizSelect, {
    options: (tableColumns || []).filter(function (item) {
      return !sourceType || sourceType === item.webType;
    }),
    className: "".concat(classPrefix, "-box-width"),
    placeholder: "\u8BF7\u9009\u62E9".concat(label),
    labelField: "label",
    keyField: "name",
    enableSearch: true,
    value: {
      name: value
    },
    onChange: function onChange(data) {
      return _onChange && _onChange(data.name);
    }
  }), /*#__PURE__*/React.createElement("img", {
    className: "".concat(classPrefix, "-arrow-width"),
    src: arrow
  }), /*#__PURE__*/React.createElement("div", {
    className: "".concat(classPrefix, "-box-width ").concat(classPrefix, "-box-span")
  }, defaultTarget));
};
var FusionFieldTitle = function FusionFieldTitle() {
  return /*#__PURE__*/React.createElement("div", {
    className: classPrefix
  }, /*#__PURE__*/React.createElement("div", {
    className: "".concat(classPrefix, "-box ").concat(classPrefix, "-box-width")
  }, /*#__PURE__*/React.createElement("img", {
    src: sourceImg
  }), /*#__PURE__*/React.createElement("div", {
    className: "".concat(classPrefix, "-box-container")
  }, /*#__PURE__*/React.createElement("div", {
    className: "".concat(classPrefix, "-box-title")
  }, "\u6765\u6E90\u8868"), /*#__PURE__*/React.createElement("div", {
    className: "".concat(classPrefix, "-box-content")
  }, "\u9009\u62E9\u6570\u636E\u96C6\u5B57\u6BB5\u5EFA\u7ACB\u6620\u5C04\u5173\u7CFB"))), /*#__PURE__*/React.createElement("div", {
    className: "".concat(classPrefix, "-center ").concat(classPrefix, "-arrow-width")
  }, /*#__PURE__*/React.createElement("img", {
    className: "".concat(classPrefix, "-center-img1"),
    src: arrow
  }), /*#__PURE__*/React.createElement("img", {
    className: "".concat(classPrefix, "-center-img2"),
    src: arrow2
  })), /*#__PURE__*/React.createElement("div", {
    className: "".concat(classPrefix, "-box ").concat(classPrefix, "-box-width")
  }, /*#__PURE__*/React.createElement("img", {
    src: targetImg
  }), /*#__PURE__*/React.createElement("div", {
    className: "".concat(classPrefix, "-box-container")
  }, /*#__PURE__*/React.createElement("div", {
    className: "".concat(classPrefix, "-box-title")
  }, "\u76EE\u6807\u8868"), /*#__PURE__*/React.createElement("div", {
    className: "".concat(classPrefix, "-box-content")
  }, "\u6765\u6E90\u8868\u6570\u636E\u5BFC\u5165\u5230\u8BF8\u845B\u5E73\u53F0"))));
};
var FusionRerun = function FusionRerun(props) {
  var _props$value, _props$value2;
  var _onChange2 = function onChange(data, type) {
    props.onChange && props.onChange(_objectSpread(_objectSpread({}, props.value), {}, _defineProperty({}, type, data)));
  };
  return /*#__PURE__*/React.createElement("div", {
    className: "".concat(classPrefix, "-rerun")
  }, "\u91CD\u8DD1", /*#__PURE__*/React.createElement(InputNumber, {
    value: (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.time,
    precision: 0,
    min: 1,
    max: 10,
    onChange: function onChange(data) {
      return _onChange2(data, 'time');
    }
  }), "\u6B21\uFF0C\u6BCF\u6B21\u95F4\u9694", /*#__PURE__*/React.createElement(InputNumber, {
    value: (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.minutes,
    precision: 0,
    min: 1,
    max: 60,
    onChange: function onChange(data) {
      return _onChange2(data, 'minutes');
    }
  }), "\u5206\u949F", /*#__PURE__*/React.createElement(Tooltip, {
    title: "\u4EFB\u52A1\u5931\u8D25\u540E\uFF0C\u7CFB\u7EDF\u4F1A\u9ED8\u8BA4\u53D1\u8D77\u4E00\u6B21\u91CD\r\n\u8BD5\uFF0C\u5EF6\u7EED\u4E0A\u4E00\u6B21\u7684\u4EFB\u52A1\u3002\u53EF\u4EE5\u81EA\u5B9A\u4E49\r\n\u8BBE\u7F6E\u6570\u636E\u96C6\u540C\u6B65\u5931\u8D25\u91CD\u8BD5\u6B21\u6570\u548C\u91CD\u8DDD\r\n\u65F6\u95F4\u95F4\u9694\uFF0C\u63D0\u5347\u4EFB\u52A1\u6210\u529F\u7387\u3002"
  }, /*#__PURE__*/React.createElement(IconFont, {
    type: "tishi"
  })));
};
export { FusionField, FusionFieldTitle, FusionRerun };