feat: 首页颜色修改

develop
JINGYJ 1 year ago
parent 05029c8680
commit e2b2a1c973

@ -28,6 +28,24 @@ const offendingTabData: Record<string, any>[] = [
]; ];
// const topItemStyle = { marginBottom: 24, height: 190 }; // 每个卡片独立样式 // const topItemStyle = { marginBottom: 24, height: 190 }; // 每个卡片独立样式
// 前三排名颜色样式
const handleRanking = (value: number) => {
switch (value) {
case 0:
return styles.rankFirst
break;
case 1:
return styles.rankSecond
break;
case 2:
return styles.rankThird
break;
default:
return ''
break;
}
};
/**子组件 childComp */ /**子组件 childComp */
const RankListCard: React.FC = ({ const RankListCard: React.FC = ({
rankingListData, rankingListData,
@ -38,7 +56,8 @@ const RankListCard: React.FC = ({
<ul className={styles.rankingList}> <ul className={styles.rankingList}>
{rankingListData.map((item, i) => ( {rankingListData.map((item, i) => (
<li key={item.title}> <li key={item.title}>
<span className={`${styles.rankingItemNumber} ${i < 3 ? styles.active : ''}`}> {/* <span className={`${styles.rankingItemNumber} ${i < 3 ? styles.active : ''}`}> */}
<span className={`${styles.rankingItemNumber} ${handleRanking(i)}`}>
{i + 1} {i + 1}
</span> </span>
<span className={styles.rankingItemTitle} title={item.title}> <span className={styles.rankingItemTitle} title={item.title}>
@ -67,7 +86,7 @@ const BannerInfoCard: React.FC = ({
// const { initialState } = useModel('@@initialState'); // const { initialState } = useModel('@@initialState');
return ( return (
<div className="bannerInfoCard_wrap"> <div className="bannerInfoCard_wrap">
<ProCard key="resize-observer" bordered wrap gutter={24} style={{marginTop: 24}}> <ProCard key="resize-observer" bordered wrap gutter={24} style={{marginTop: 24, marginBottom: 24}}>
<Tabs <Tabs
tabBarExtraContent={ tabBarExtraContent={
<div className={styles.salesExtraWrap}> <div className={styles.salesExtraWrap}>
@ -103,6 +122,7 @@ const BannerInfoCard: React.FC = ({
<div className={styles.salesBar}> <div className={styles.salesBar}>
{/* TODO 替换使用reactEchart */} {/* TODO 替换使用reactEchart */}
<Column <Column
color="rgba(4, 99, 242, 1)"
height={300} height={300}
forceFit forceFit
data={offendingData as any} data={offendingData as any}

@ -143,6 +143,7 @@ const DonutChart: React.FC = () => {
name: '类别名称', name: '类别名称',
type: 'pie', type: 'pie',
radius: ['50%', '80%'], // 控制环形图大小 radius: ['50%', '80%'], // 控制环形图大小
color: ["#FF8110", "#FFB404", "#3250FF"],
avoidLabelOverlap: false, avoidLabelOverlap: false,
label: { label: {
show: false, show: false,
@ -159,7 +160,7 @@ const DonutChart: React.FC = () => {
show: false, show: false,
}, },
data: [ data: [
{ value: 235, name: '玩手机' }, { value: 235, name: '玩手机'},
{ value: 510, name: '打瞌睡' }, { value: 510, name: '打瞌睡' },
{ value: 134, name: '离岗' }, { value: 134, name: '离岗' },
], ],

@ -17,7 +17,10 @@ const { Statistic } = StatisticCard;
/**styles 组件样式配置 */ /**styles 组件样式配置 */
const topColSpanProps = { sm: 24, md: 12, lg: 6 }; // 每个卡片项栅格配置 const topColSpanProps = { sm: 24, md: 12, lg: 6 }; // 每个卡片项栅格配置
const topItemStyle = { marginBottom: 24, height: 190 }; // 每个卡片独立样式 const topItemStyle = { marginBottom: 24, height: 190, backgroundColor: 'rgba(255, 233, 214, 1)' }; // 每个卡片独立样式
const topItemStyle1 = { marginBottom: 24, height: 190, backgroundColor: 'rgba(214, 225, 255, 1)' }; // 每个卡片独立样式
const topItemStyle2 = { marginBottom: 24, height: 190, backgroundColor: 'rgba(221, 213, 253, 1)' }; // 每个卡片独立样式
const topItemStyle3 = { marginBottom: 24, height: 190, backgroundColor: 'rgba(214, 239, 255, 1)' }; // 每个卡片独立样式
const topItemHeadStyle = { padding: 15 }; const topItemHeadStyle = { padding: 15 };
const chartsStyle = { const chartsStyle = {
height: 84 height: 84
@ -49,7 +52,7 @@ const NavInfoCardList: React.FC = () => {
boxShadow boxShadow
> >
<StatisticCard <StatisticCard
bodyStyle={{ padding: 0 }} bodyStyle={{ padding: 0, backgroundColor: 'rgba(255, 233, 214, 1)' }}
statistic={{ statistic={{
value: 1102893, value: 1102893,
style: chartsStyle, style: chartsStyle,
@ -64,7 +67,7 @@ const NavInfoCardList: React.FC = () => {
<> <>
<Divider style={{ margin: 5 }} /> <Divider style={{ margin: 5 }} />
<Space> <Space>
<StatisticCard bodyStyle={{ padding: 0 }}> <StatisticCard bodyStyle={{ padding: 0, backgroundColor: 'rgba(255, 233, 214, 1)' }}>
<Statistic title="日异常量" value="0.00%" /> <Statistic title="日异常量" value="0.00%" />
</StatisticCard> </StatisticCard>
</Space> </Space>
@ -87,11 +90,11 @@ const NavInfoCardList: React.FC = () => {
</> </>
} }
colSpan={topColSpanProps} colSpan={topColSpanProps}
style={topItemStyle} style={topItemStyle1}
boxShadow boxShadow
> >
<StatisticCard <StatisticCard
bodyStyle={{ padding: 0 }} bodyStyle={{ padding: 0, backgroundColor: 'rgba(214, 225, 255, 1)' }}
statistic={{ statistic={{
value: 467, value: 467,
style: chartsStyle, style: chartsStyle,
@ -114,7 +117,7 @@ const NavInfoCardList: React.FC = () => {
<> <>
<Divider style={{ margin: 5 }} /> <Divider style={{ margin: 5 }} />
<Space> <Space>
<StatisticCard bodyStyle={{ padding: 0 }}> <StatisticCard bodyStyle={{ padding: 0, backgroundColor: 'rgba(214, 225, 255, 1)' }}>
<Statistic title="设备量" value="0.00%" /> <Statistic title="设备量" value="0.00%" />
</StatisticCard> </StatisticCard>
</Space> </Space>
@ -137,11 +140,11 @@ const NavInfoCardList: React.FC = () => {
</> </>
} }
colSpan={topColSpanProps} colSpan={topColSpanProps}
style={topItemStyle} style={topItemStyle2}
boxShadow boxShadow
> >
<StatisticCard <StatisticCard
bodyStyle={{ padding: 0 }} bodyStyle={{ padding: 0, backgroundColor: 'rgba(221, 213, 253, 1)' }}
statistic={{ statistic={{
value: 3048, value: 3048,
style:chartsStyle, style:chartsStyle,
@ -162,7 +165,7 @@ const NavInfoCardList: React.FC = () => {
<> <>
<Divider style={{ margin: 5 }} /> <Divider style={{ margin: 5 }} />
<Space> <Space>
<StatisticCard bodyStyle={{ padding: 0 }}> <StatisticCard bodyStyle={{ padding: 0, backgroundColor: 'rgba(221, 213, 253, 1)' }}>
<Statistic title="覆盖网点率" value="0.00%" /> <Statistic title="覆盖网点率" value="0.00%" />
</StatisticCard> </StatisticCard>
</Space> </Space>
@ -185,11 +188,11 @@ const NavInfoCardList: React.FC = () => {
</> </>
} }
colSpan={topColSpanProps} colSpan={topColSpanProps}
style={topItemStyle} style={topItemStyle3}
boxShadow boxShadow
> >
<StatisticCard <StatisticCard
bodyStyle={{ padding: 0 }} bodyStyle={{ padding: 0, backgroundColor: 'rgba(214, 239, 255, 1)' }}
statistic={{ statistic={{
value: 893, value: 893,
style:chartsStyle, style:chartsStyle,
@ -218,7 +221,7 @@ const NavInfoCardList: React.FC = () => {
chart={ chart={
<> <>
<Divider style={{ margin: 5 }} /> <Divider style={{ margin: 5 }} />
<Space style={{ marginTop: 0 }}> <Space style={{ marginTop: 0, backgroundColor: 'rgba(214, 239, 255, 1)' }}>
<Statistic title="周同比" value="12%" trend="up" /> <Statistic title="周同比" value="12%" trend="up" />
<Statistic title="日同比" value="11%" trend="down" /> <Statistic title="日同比" value="11%" trend="down" />
</Space> </Space>

@ -47,11 +47,24 @@
line-height: 20px; line-height: 20px;
text-align: center; text-align: center;
background-color: @tag-default-bg; background-color: @tag-default-bg;
border-radius: 20px; // border-radius: 20px;
border-radius: 2px;
&.active { &.active {
color: #fff; color: #fff;
background-color: #314659; background-color: #314659;
} }
&.rankFirst {
color: #fff;
background-color: rgba(224, 40, 40, 1);
}
&.rankSecond {
color: #fff;
background-color: rgba(255, 172, 64, 1);
}
&.rankThird {
color: #fff;
background-color: rgba(250, 219, 20, 1);
}
} }
.rankingItemTitle { .rankingItemTitle {
flex: 1; flex: 1;

Loading…
Cancel
Save