import { BizSelect } from '@zgfe/business-lib';
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: "name",
    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"))));
};
export { FusionField, FusionFieldTitle };