// 【重要】必须使用 const Component 作为组件变量名 // ONE-OS 小程序 - 年审管理(待处理 / 历史记录 + 筛选抽屉) const { useState, useMemo, useEffect, useRef, useCallback } = React; const moment = window.moment || window.dayjs; const COLOR_PRIMARY = '#16D1A1'; const COLOR_PRIMARY_DEEP = '#00BFA5'; const COLOR_TEXT = '#1D2129'; const COLOR_MUTED = '#86909C'; const COLOR_LINE = '#E5E6EB'; const COLOR_BG = '#FFFFFF'; const COLOR_PAGE = '#F2F3F5'; const COLOR_WARN = '#FF7D00'; const COLOR_DANGER = '#F53F3F'; const FONT_FAMILY = '-apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", STHeiti, sans-serif'; /** 兼容 Axhub:antd 可能是 default 导出或子集包,避免解构出 undefined 导致 React #130 */ const resolveAntdBundle = () => { const raw = window.antd; if (!raw) return {}; if (raw.default && typeof raw.default === 'object') { return { ...raw, ...raw.default }; } return raw; }; const antd = resolveAntdBundle(); const FallbackTag = ({ children, className, style, color }) => ( {children} ); const FallbackInputNumber = ({ value, onChange, placeholder, min, precision, bordered, controls }) => ( { const raw = e.target.value; if (onChange) onChange(raw === '' ? null : Number(raw)); }} /> ); const FallbackUpload = ({ children, className, onChange, fileList, multiple, accept, beforeUpload, showUploadList }) => ( ); const FallbackDrawer = ({ open, title, placement, width, height, onClose, children, footer, styles }) => open ? (
e.stopPropagation()} role="dialog" >
{title}
{children}
{footer ?
{footer}
: null}
) : null; const FallbackModal = ({ open, title, children, footer, onCancel, centered, width, bodyStyle }) => open ? (
e.stopPropagation()} role="dialog" >
{title}
{children}
{footer ? (
{footer}
) : null}
) : null; const FallbackInput = ({ value, onChange, readOnly, placeholder, bordered, disabled, className, onFocus, style }) => ( onChange && onChange(e)} onFocus={onFocus} style={{ width: '100%', border: bordered === false ? 'none' : undefined, ...style }} /> ); const FallbackSelect = ({ value, onChange, options, placeholder, bordered, allowClear }) => ( ); const FallbackButton = ({ children, onClick, type, block, size, disabled, style }) => ( ); const Drawer = antd.Drawer || FallbackDrawer; const Input = antd.Input || FallbackInput; const Select = antd.Select || FallbackSelect; const Button = antd.Button || FallbackButton; const Tag = antd.Tag || FallbackTag; const Modal = antd.Modal || FallbackModal; const message = antd.message || { success: (t) => window.alert(t), error: (t) => window.alert(t), warning: (t) => window.alert(t), info: (t) => window.alert(t) }; const InputNumber = antd.InputNumber || (Input && Input.Number) || FallbackInputNumber; const Upload = antd.Upload || FallbackUpload; const Image = antd.Image; const FallbackTextArea = ({ value, onChange, placeholder, bordered, rows }) => (