"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _CloudDownloadOutlined = _interopRequireDefault(require("@ant-design/icons/CloudDownloadOutlined"));
var _MyModal = _interopRequireDefault(require("../../../../MyModal"));
var _index = _interopRequireDefault(require("./index.less"));
var _propTypes = _interopRequireDefault(require("prop-types"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
// 文件预览

function FileView(_ref) {
  var onModalClose = _ref.onModalClose,
    visible = _ref.visible,
    fileId = _ref.fileId,
    fileUrl = _ref.fileUrl;
  var onDownLoad = function onDownLoad() {
    if (fileId) {
      window.open("/cloudFile/common/downloadFile?id=".concat(fileId));
    }
  };
  return /*#__PURE__*/_react["default"].createElement(_MyModal["default"], {
    width: 1000,
    height: 700,
    style: {
      top: '100px'
    },
    visible: visible,
    moveable: false,
    title: /*#__PURE__*/_react["default"].createElement("div", {
      className: _index["default"].title
    }, /*#__PURE__*/_react["default"].createElement("span", null, "\u6587\u4EF6\u9884\u89C8"), /*#__PURE__*/_react["default"].createElement("span", {
      style: {
        marginRight: '60PX',
        cursor: 'pointer',
        color: '#1686DE'
      },
      onClick: onDownLoad
    }, "\u4E0B\u8F7D", /*#__PURE__*/_react["default"].createElement(_CloudDownloadOutlined["default"], {
      style: {
        marginLeft: '10px'
      }
    }))),
    cockpit: false,
    footer: null,
    onCancel: function onCancel() {
      onModalClose && onModalClose();
    }
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "iframe-content"
  }, /*#__PURE__*/_react["default"].createElement("iframe", {
    src: fileUrl,
    width: "100%",
    height: "700",
    frameBorder: "0"
  })));
}
FileView.propTypes = {
  onModalClose: _propTypes["default"].func,
  visible: _propTypes["default"].bool,
  fileId: _propTypes["default"].string,
  fileUrl: _propTypes["default"].string
};
var _default = exports["default"] = FileView;
//# sourceMappingURL=FileView.js.map
