import { Row, Col, Card, Grid, Button } from "antd"; import Mcard from "./mcard"; import Mtable from "./mtable"; import getPrem from "@/utils/getPrem"; //权限判断fn import { ExportOutlined } from "@ant-design/icons"; const { useBreakpoint } = Grid; function isString(obj) { return obj.constructor === String ? true : false; } // const tableprops = { // ...props, // addconfig: { // premkey: "sysDepartment_save", // disabled:true, // btnprops:{}, // onClick: () => { // alert(0) // }, // }, // exportconfig:{ // premkey: "sysDepartment_save", // btnprops:{ // }, // onClick: () => { // alert(1) // }, // }, // pageextra: activeTabKey == "1" ? "add" : "none", // tabList: [ // { // tab: "未完成", // key: "1" // }, { // tab: "已完成", // key: "2" // } // ], // activeTabKey, // onTabChange // } export default (props) => { const screens = useBreakpoint(); const actionbtn = { add: ( ), export: ( ), }; //右上角 pageextra 类型 1.reactDom 2.string 以逗号隔开 为none时不显示 const renderextra = () => { if (props.pageextra && !isString(props.pageextra)) { return props.pageextra; } else if (props.pageextra === "none") { return
; } else if (props.pageextra) { let strarr = props.pageextra ? props.pageextra.split(",") : ["add"]; return strarr.map((it, i) => { return (
{actionbtn[it]}
); }); } }; // screens.xs ? ( //
// {props.children && ( //
{props.children}
// )} //
// //
//
// ) : return (
{props.withCard === false ? (
{(props.childposition == "left" || !props.childposition) && props.children}
{props.childposition == "top" && props.children}
{(props.childposition == "right" || !props.childposition) && props.children}
) : ( {renderextra()}
} activeTabKey={props.activeTabKey} tabList={props.tabList} onTabChange={props.onTabChange} >
{(props.childposition == "left" || !props.childposition) && props.children}
{props.childposition == "top" && props.children}
{(props.childposition == "right" || !props.childposition) && props.children}
)} ); };