@aliretail/react-materials-components
Version:
44 lines (40 loc) • 1.59 kB
JavaScript
import _Dialog from "@alifd/next/es/dialog";
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["actTitle", "children"];
import * as React from 'react';
import DetailTable from "../DetailTable/index";
import { COM_PREFIX } from "../../properties";
export default function MarketingOperationLogDialog(props) {
var _props$actTitle = props.actTitle,
actTitle = _props$actTitle === void 0 ? '' : _props$actTitle,
children = props.children,
others = _objectWithoutPropertiesLoose(props, _excluded);
var _React$useState = React.useState(false),
visible = _React$useState[0],
setVisible = _React$useState[1]; // 打开弹窗
var openDialog = function openDialog() {
setVisible(true);
};
return /*#__PURE__*/React.createElement("div", {
className: COM_PREFIX
}, children && /*#__PURE__*/React.cloneElement(children, {
onClick: function onClick() {
openDialog();
}
}), /*#__PURE__*/React.createElement(_Dialog, {
title: "\u64CD\u4F5C\u65E5\u5FD7",
className: COM_PREFIX + "-dialog",
visible: visible,
footer: false,
onClose: function onClose() {
setVisible(false);
}
}, /*#__PURE__*/React.createElement("p", {
className: COM_PREFIX + "-formItem"
}, "\u6D3B\u52A8\u540D\u79F0\uFF1A", /*#__PURE__*/React.createElement("span", null, actTitle)), /*#__PURE__*/React.createElement(DetailTable, _extends({}, others, {
extTableProps: {
tableWidth: 1000
}
}))));
}