diff --git a/biome.json b/biome.json index 00e41234..a7800711 100644 --- a/biome.json +++ b/biome.json @@ -14,6 +14,8 @@ "!**/dist/**", "!**/server/**", "!**/public/**", + "!**/coverage/**", + "!**/node_modules/**", "!biome.json" ] }, diff --git a/config/config.ts b/config/config.ts index 311f2329..96b747cd 100644 --- a/config/config.ts +++ b/config/config.ts @@ -45,13 +45,9 @@ export default defineConfig({ * @name 主题的配置 * @description 虽然叫主题,但是其实只是 less 的变量设置 * @doc antd的主题设置 https://ant.design/docs/react/customize-theme-cn - * @doc umi 的theme 配置 https://umijs.org/docs/api/config#theme + * @doc umi 的 theme 配置 https://umijs.org/docs/api/config#theme */ - theme: { - // 如果不想要 configProvide 动态设置主题需要把这个设置为 default - // 只有设置为 variable, 才能使用 configProvide 动态设置主色调 - 'root-entry-name': 'variable', - }, + // theme: { '@primary-color': '#1DA57A' } /** * @name moment 的国际化配置 * @description 如果对国际化没有要求,打开之后能减少js的包大小 diff --git a/src/loading.tsx b/src/loading.tsx index 4b651c0a..21a2747f 100644 --- a/src/loading.tsx +++ b/src/loading.tsx @@ -1,5 +1,7 @@ import { Skeleton } from 'antd'; -const Loading: React.FC = () => ; +const Loading: React.FC = () => ( + +); export default Loading; diff --git a/src/pages/account/center/components/ArticleListContent/index.style.ts b/src/pages/account/center/components/ArticleListContent/index.style.ts index c993635f..aea3ddbf 100644 --- a/src/pages/account/center/components/ArticleListContent/index.style.ts +++ b/src/pages/account/center/components/ArticleListContent/index.style.ts @@ -10,8 +10,10 @@ const useStyles = createStyles(({ token }) => { marginTop: '16px', color: token.colorTextSecondary, lineHeight: '22px', + display: 'flex', + gap: '8px', + alignItems: 'center', '& > em': { - marginLeft: '16px', color: token.colorTextDisabled, fontStyle: 'normal', }, diff --git a/src/pages/account/center/components/Articles/index.tsx b/src/pages/account/center/components/Articles/index.tsx index 1048d4c3..d2a69eee 100644 --- a/src/pages/account/center/components/Articles/index.tsx +++ b/src/pages/account/center/components/Articles/index.tsx @@ -31,6 +31,9 @@ const Articles: React.FC = () => { rowKey="id" itemLayout="vertical" dataSource={listData?.list || []} + style={{ + margin: '0 -24px', + }} renderItem={(item) => ( { loading={loading} > {!loading && currentUser && ( -
+ <>
{currentUser.name}
@@ -255,14 +254,14 @@ const Center: React.FC = () => { ))}
-
+ )} { diff --git a/src/pages/dashboard/analysis/components/ProportionSales.tsx b/src/pages/dashboard/analysis/components/ProportionSales.tsx index 57f9b79e..4466481a 100644 --- a/src/pages/dashboard/analysis/components/ProportionSales.tsx +++ b/src/pages/dashboard/analysis/components/ProportionSales.tsx @@ -1,6 +1,5 @@ import { Pie } from '@ant-design/plots'; -import { Card, Radio, Typography } from 'antd'; -import type { RadioChangeEvent } from 'antd/es/radio'; +import { Card, Segmented, Typography } from 'antd'; import numeral from 'numeral'; import React from 'react'; import type { DataItem } from '../data.d'; @@ -18,14 +17,14 @@ const ProportionSales = ({ dropdownGroup: React.ReactNode; salesType: 'all' | 'online' | 'stores'; salesPieData: DataItem[]; - handleChangeSalesType?: (e: RadioChangeEvent) => void; + handleChangeSalesType?: (value: 'all' | 'online' | 'stores') => void; }) => { const { styles } = useStyles(); return ( {dropdownGroup} -
- - 全部渠道 - 线上 - 门店 - -
+ } > -
- 销售额 - { - return `${item.x}: ${numeral(item.y).format('0,0')}`; - }, - }} - /> -
+ 销售额 + + `${item.x}: ${numeral(item.y).format('0,0')}`, + }} + />
); }; diff --git a/src/pages/dashboard/analysis/components/SalesCard.tsx b/src/pages/dashboard/analysis/components/SalesCard.tsx index 8a91d236..a3621619 100644 --- a/src/pages/dashboard/analysis/components/SalesCard.tsx +++ b/src/pages/dashboard/analysis/components/SalesCard.tsx @@ -39,180 +39,182 @@ const SalesCard = ({ return ( -
- - - + + - } - size="large" - tabBarStyle={{ - marginBottom: 24, - }} - items={[ - { - key: 'sales', - label: '销售额', - children: ( - - -
- -
- - -
-

门店销售额排名

-
    - {rankingListData.map((item, i) => ( -
  • - - {i + 1} - - - {item.title} - - {numeral(item.total).format('0,0')} -
  • - ))} -
-
- -
- ), - }, - { - key: 'views', - label: '访问量', - children: ( - - -
- -
- - -
-

门店访问量排名

-
    - {rankingListData.map((item, i) => ( -
  • - - {i + 1} - - - {item.title} - - {numeral(item.total).format('0,0')} -
  • - ))} -
-
- -
- ), - }, - ]} - /> -
+ + + } + size="large" + tabBarStyle={{ + marginBottom: 24, + }} + items={[ + { + key: 'sales', + label: '销售额', + children: ( + + +
+ +
+ + +
+

门店销售额排名

+
    + {rankingListData.map((item, i) => ( +
  • + + {i + 1} + + + {item.title} + + {numeral(item.total).format('0,0')} +
  • + ))} +
+
+ +
+ ), + }, + { + key: 'views', + label: '访问量', + children: ( + + +
+ +
+ + +
+

门店访问量排名

+
    + {rankingListData.map((item, i) => ( +
  • + + {i + 1} + + + {item.title} + + {numeral(item.total).format('0,0')} +
  • + ))} +
+
+ +
+ ), + }, + ]} + />
); }; diff --git a/src/pages/dashboard/analysis/index.tsx b/src/pages/dashboard/analysis/index.tsx index 3e5d7a5b..3c72d870 100644 --- a/src/pages/dashboard/analysis/index.tsx +++ b/src/pages/dashboard/analysis/index.tsx @@ -90,8 +90,8 @@ const Analysis: FC = () => { ); - const handleChangeSalesType = (e: RadioChangeEvent) => { - setSalesType(e.target.value); + const handleChangeSalesType = (value: SalesType) => { + setSalesType(value); }; const handleTabChange = (key: string) => { setCurrentTabKey(key);