Commit 0fb8d9f6 authored by 涂茜's avatar 涂茜

fix: update empty

parent f8ce6bcb
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
"registry": "https://g.civnet.cn:4873" "registry": "https://g.civnet.cn:4873"
}, },
"dependencies": { "dependencies": {
"@wisdom-components/Empty": "^1.3.4", "@wisdom-components/Empty": "^1.3.3",
"@wisdom-components/basictable": "^1.2.0", "@wisdom-components/basictable": "^1.2.0",
"@wisdom-components/timerangepicker": "^1.3.4", "@wisdom-components/timerangepicker": "^1.3.4",
"classnames": "^2.2.6", "classnames": "^2.2.6",
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"test": "echo \"Error: run tests from root\" && exit 1" "test": "echo \"Error: run tests from root\" && exit 1"
}, },
"dependencies": { "dependencies": {
"@wisdom-components/Empty": "^1.3.4", "@wisdom-components/Empty": "^1.3.3",
"classnames": "^2.2.6" "classnames": "^2.2.6"
} }
} }
...@@ -2,6 +2,7 @@ import React, { useContext } from 'react'; ...@@ -2,6 +2,7 @@ import React, { useContext } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { ConfigProvider } from 'antd'; import { ConfigProvider } from 'antd';
import Icon from '@ant-design/icons';
import { ReactComponent as noDataLight } from './assets/noDataLight.svg'; import { ReactComponent as noDataLight } from './assets/noDataLight.svg';
import { ReactComponent as noDataDark } from './assets/noDataDark.svg'; import { ReactComponent as noDataDark } from './assets/noDataDark.svg';
import errorLight from './assets/errorLight.png'; import errorLight from './assets/errorLight.png';
...@@ -9,14 +10,6 @@ import errorDark from './assets/errorDark.png'; ...@@ -9,14 +10,6 @@ import errorDark from './assets/errorDark.png';
import './index.less'; import './index.less';
const IconBase = ({ icon: SvgIcon }) => {
const SvgAttributes = {
width: '100%',
height: '100%',
};
return <SvgIcon {...SvgAttributes} />;
};
const Empty = ({ description, image, theme, size, statusCode, imageStyle, children }) => { const Empty = ({ description, image, theme, size, statusCode, imageStyle, children }) => {
const alt = description ? description : 'empty'; const alt = description ? description : 'empty';
const des = description ? description : DESC_DATA[`${statusCode}`]; const des = description ? description : DESC_DATA[`${statusCode}`];
...@@ -28,7 +21,7 @@ const Empty = ({ description, image, theme, size, statusCode, imageStyle, childr ...@@ -28,7 +21,7 @@ const Empty = ({ description, image, theme, size, statusCode, imageStyle, childr
if (typeof image === 'string') { if (typeof image === 'string') {
if (statusCode == '0') { if (statusCode == '0') {
imageNode = <IconBase icon={IMAGE_DATA[theme][0]} />; imageNode = <Icon component={IMAGE_DATA[theme][0]} />;
} else { } else {
let imageSrc = image ? image : IMAGE_DATA[theme][1]; let imageSrc = image ? image : IMAGE_DATA[theme][1];
imageNode = <img alt={alt} src={imageSrc} />; imageNode = <img alt={alt} src={imageSrc} />;
......
...@@ -11,6 +11,16 @@ ...@@ -11,6 +11,16 @@
img { img {
height: 100%; height: 100%;
} }
.anticon {
display: block;
height: 100%;
svg {
width: 100%;
height: 100%;
}
}
} }
&-des { &-des {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"test": "echo \"Error: run tests from root\" && exit 1" "test": "echo \"Error: run tests from root\" && exit 1"
}, },
"dependencies": { "dependencies": {
"@wisdom-components/Empty": "^1.3.4", "@wisdom-components/Empty": "^1.3.3",
"@wisdom-components/basictable": "^1.2.0", "@wisdom-components/basictable": "^1.2.0",
"@wisdom-components/timerangepicker": "^1.3.4", "@wisdom-components/timerangepicker": "^1.3.4",
"classnames": "^2.2.6", "classnames": "^2.2.6",
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"test": "echo \"Error: run tests from root\" && exit 1" "test": "echo \"Error: run tests from root\" && exit 1"
}, },
"dependencies": { "dependencies": {
"@wisdom-components/Empty": "^1.3.4", "@wisdom-components/Empty": "^1.3.3",
"classnames": "^2.2.6" "classnames": "^2.2.6"
} }
} }
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"test": "echo \"Error: run tests from root\" && exit 1" "test": "echo \"Error: run tests from root\" && exit 1"
}, },
"dependencies": { "dependencies": {
"@wisdom-components/Empty": "^1.3.4", "@wisdom-components/Empty": "^1.3.3",
"classnames": "^2.2.6" "classnames": "^2.2.6"
} }
} }
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"test": "echo \"Error: run tests from root\" && exit 1" "test": "echo \"Error: run tests from root\" && exit 1"
}, },
"dependencies": { "dependencies": {
"@wisdom-components/Empty": "^1.3.4", "@wisdom-components/Empty": "^1.3.3",
"classnames": "^2.2.6" "classnames": "^2.2.6"
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment