Browse Source

优化一些小问题

pull/11096/head
期贤 2 years ago
parent
commit
985b920a71
  1. 6
      src/pages/account/center/index.tsx
  2. 3
      src/pages/dashboard/analysis/components/IntroduceRow.tsx
  3. 2
      src/pages/dashboard/analysis/components/TopSearch.tsx
  4. 4
      src/pages/dashboard/monitor/index.tsx
  5. 29
      src/pages/dashboard/workplace/index.tsx
  6. 12
      src/services/ant-design-pro/api.ts

6
src/pages/account/center/index.tsx

@ -1,6 +1,6 @@
import { ClusterOutlined, ContactsOutlined, HomeOutlined, PlusOutlined } from '@ant-design/icons'; import { ClusterOutlined, ContactsOutlined, HomeOutlined, PlusOutlined } from '@ant-design/icons';
import { GridContent } from '@ant-design/pro-components'; import { GridContent } from '@ant-design/pro-components';
import { Link, useRequest } from '@umijs/max'; import { useRequest } from '@umijs/max';
import { Avatar, Card, Col, Divider, Input, InputRef, Row, Tag } from 'antd'; import { Avatar, Card, Col, Divider, Input, InputRef, Row, Tag } from 'antd';
import React, { useRef, useState } from 'react'; import React, { useRef, useState } from 'react';
import useStyles from './Center.style'; import useStyles from './Center.style';
@ -226,10 +226,10 @@ const Center: React.FC = () => {
{currentUser.notice && {currentUser.notice &&
currentUser.notice.map((item) => ( currentUser.notice.map((item) => (
<Col key={item.id} lg={24} xl={12}> <Col key={item.id} lg={24} xl={12}>
<Link to={item.href}> <a href={item.href}>
<Avatar size="small" src={item.logo} /> <Avatar size="small" src={item.logo} />
{item.member} {item.member}
</Link> </a>
</Col> </Col>
))} ))}
</Row> </Row>

3
src/pages/dashboard/analysis/components/IntroduceRow.tsx

@ -76,7 +76,7 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
fillOpacity: 0.6, fillOpacity: 0.6,
width: '100%', width: '100%',
}} }}
padding={[0, 0, 0, 0]} padding={-20}
data={visitData} data={visitData}
/> />
</ChartCard> </ChartCard>
@ -98,6 +98,7 @@ const IntroduceRow = ({ loading, visitData }: { loading: boolean; visitData: Dat
<Column <Column
xField="x" xField="x"
yField="y" yField="y"
padding={-20}
axis={false} axis={false}
height={46} height={46}
data={visitData} data={visitData}

2
src/pages/dashboard/analysis/components/TopSearch.tsx

@ -117,6 +117,7 @@ const TopSearch = ({
shapeField="smooth" shapeField="smooth"
height={45} height={45}
axis={false} axis={false}
padding={-12}
style={{ fill: 'linear-gradient(-90deg, white 0%, #6294FA 100%)', fillOpacity: 0.4 }} style={{ fill: 'linear-gradient(-90deg, white 0%, #6294FA 100%)', fillOpacity: 0.4 }}
data={visitData2} data={visitData2}
/> />
@ -151,6 +152,7 @@ const TopSearch = ({
yField="y" yField="y"
shapeField="smooth" shapeField="smooth"
height={45} height={45}
padding={-12}
style={{ fill: 'linear-gradient(-90deg, white 0%, #6294FA 100%)', fillOpacity: 0.4 }} style={{ fill: 'linear-gradient(-90deg, white 0%, #6294FA 100%)', fillOpacity: 0.4 }}
data={visitData2} data={visitData2}
axis={false} axis={false}

4
src/pages/dashboard/monitor/index.tsx

@ -90,9 +90,9 @@ const Monitor: FC = () => {
thresholds: [20, 40, 60, 80, 100], thresholds: [20, 40, 60, 80, 100],
} as any } as any
} }
padding={[0, 0, 0, 0]} padding={-16}
style={{ style={{
textContent: () => ``, textContent: () => '优',
}} }}
meta={{ meta={{
color: { color: {

29
src/pages/dashboard/workplace/index.tsx

@ -124,6 +124,7 @@ const Workplace: FC = () => {
</List.Item> </List.Item>
); );
}; };
return ( return (
<PageContainer <PageContainer
content={ content={
@ -168,13 +169,13 @@ const Workplace: FC = () => {
title={ title={
<div className={styles.cardTitle}> <div className={styles.cardTitle}>
<Avatar size="small" src={item.logo} /> <Avatar size="small" src={item.logo} />
<Link to={item.href}>{item.title}</Link> <Link to={item.href || '/'}>{item.title}</Link>
</div> </div>
} }
description={item.description} description={item.description}
/> />
<div className={styles.projectItemContent}> <div className={styles.projectItemContent}>
<Link to={item.memberLink}>{item.member || ''}</Link> <Link to={item.memberLink || '/'}>{item.member || ''}</Link>
{item.updatedAt && ( {item.updatedAt && (
<span className={styles.datetime} title={item.updatedAt}> <span className={styles.datetime} title={item.updatedAt}>
{dayjs(item.updatedAt).fromNow()} {dayjs(item.updatedAt).fromNow()}
@ -234,13 +235,13 @@ const Workplace: FC = () => {
shapeField="smooth" shapeField="smooth"
area={{ area={{
style: { style: {
fillOpacity: 0.4 fillOpacity: 0.4,
} },
}} }}
axis={{ axis={{
y: { y: {
gridStrokeOpacity: 0.5, gridStrokeOpacity: 0.5,
} },
}} }}
legend={{ legend={{
color: { color: {
@ -262,14 +263,16 @@ const Workplace: FC = () => {
> >
<div className={styles.members}> <div className={styles.members}>
<Row gutter={48}> <Row gutter={48}>
{projectNotice.map((item) => ( {projectNotice.map((item) => {
<Col span={12} key={`members-item-${item.id}`}> return (
<Link to={item.href}> <Col span={12} key={`members-item-${item.id}`}>
<Avatar src={item.logo} size="small" /> <a>
<span className={styles.member}>{item.member}</span> <Avatar src={item.logo} size="small" />
</Link> <span className={styles.member}>{item.member.substring(0, 3)}</span>
</Col> </a>
))} </Col>
);
})}
</Row> </Row>
</div> </div>
</Card> </Card>

12
src/services/ant-design-pro/api.ts

@ -64,10 +64,10 @@ export async function rule(
export async function updateRule(options?: { [key: string]: any }) { export async function updateRule(options?: { [key: string]: any }) {
return request<API.RuleListItem>('/api/rule', { return request<API.RuleListItem>('/api/rule', {
method: 'POST', method: 'POST',
data:{ data: {
method: 'update', method: 'update',
...(options || {}), ...(options || {}),
} },
}); });
} }
@ -75,10 +75,10 @@ export async function updateRule(options?: { [key: string]: any }) {
export async function addRule(options?: { [key: string]: any }) { export async function addRule(options?: { [key: string]: any }) {
return request<API.RuleListItem>('/api/rule', { return request<API.RuleListItem>('/api/rule', {
method: 'POST', method: 'POST',
data:{ data: {
method: 'post', method: 'post',
...(options || {}), ...(options || {}),
} },
}); });
} }
@ -86,9 +86,9 @@ export async function addRule(options?: { [key: string]: any }) {
export async function removeRule(options?: { [key: string]: any }) { export async function removeRule(options?: { [key: string]: any }) {
return request<Record<string, any>>('/api/rule', { return request<Record<string, any>>('/api/rule', {
method: 'POST', method: 'POST',
data:{ data: {
method: 'delete', method: 'delete',
...(options || {}), ...(options || {}),
} },
}); });
} }

Loading…
Cancel
Save