function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
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 };