import React, { useMemo, useState, forwardRef, useImperativeHandle, useRef, } from "react"; import styles from "./entry.module.scss"; import "./style/global.less"; import Easy from "./pages/Alarm/components/easy"; import Complex from "./pages/Alarm/components/complex"; import Detail from "./pages/Alarm/components/detail"; import { getAntdToken } from "./utils/theme"; import ThemeWrapper from "./utils/theme/ThemeWrapper"; import { ConfigProvider, App } from "antd"; import zhCN from "antd/es/locale/zh_CN"; import "./utils/theme/customStyle.less"; import "dayjs/locale/zh-cn"; import dayjs from "dayjs"; dayjs.locale("zh-cn"); const EasyConfig = forwardRef((props, ref) => { const { editId = -1, onConfirm, groupList, pointId, readonly, style } = props; const compRef = useRef(null); const [themeName, setThemeName] = useState(); const antdToken = useMemo(() => { if (themeName) { return getAntdToken(themeName); } }, [themeName]); useImperativeHandle(ref, () => { return { ok: compRef?.current?.ok, }; }); return ( {themeName && ( )} ); }); const ComplexConfig = forwardRef((props, ref) => { const { editId = -1, onConfirm, groupList, showList, style, rightStyle } = props; const compRef = useRef(null); const [themeName, setThemeName] = useState(); const antdToken = useMemo(() => { if (themeName) { return getAntdToken(themeName); } }, [themeName]); useImperativeHandle(ref, () => { return { ok: compRef?.current?.ok, }; }); return ( {themeName && ( )} ); }); const DetailModal = (props) => { const [themeName, setThemeName] = useState(); const antdToken = useMemo(() => { if (themeName) { return getAntdToken(themeName); } }, [themeName]); return ( {themeName && ( )} ); }; export default { EasyConfig, ComplexConfig, DetailModal, };