import { inject } from 'vue'; import PropTypes from '../_util/vue-types'; import { getComponent } from '../_util/props-util'; import { defaultConfigProvider } from '../config-provider'; import CheckCircleFilled from '@ant-design/icons-vue/CheckCircleFilled'; import CloseCircleFilled from '@ant-design/icons-vue/CloseCircleFilled'; import ExclamationCircleFilled from '@ant-design/icons-vue/ExclamationCircleFilled'; import WarningFilled from '@ant-design/icons-vue/WarningFilled'; import noFound from './noFound'; import serverError from './serverError'; import unauthorized from './unauthorized'; export const IconMap = { success: CheckCircleFilled, error: CloseCircleFilled, info: ExclamationCircleFilled, warning: WarningFilled, }; export const ExceptionMap = { '404': noFound, '500': serverError, '403': unauthorized, }; // ExceptionImageMap keys const ExceptionStatus = Object.keys(ExceptionMap); export const ResultProps = { prefixCls: PropTypes.string, icon: PropTypes.any, status: PropTypes.oneOf(['success', 'error', 'info', 'warning', '404', '403', '500']).def('info'), title: PropTypes.any, subTitle: PropTypes.any, extra: PropTypes.any, }; const renderIcon = (prefixCls, { status, icon }) => { if (ExceptionStatus.includes(`${status}`)) { const SVGComponent = ExceptionMap[status]; return (
); } const IconComponent = IconMap[status]; const iconNode = icon ||