diff --git a/package.json b/package.json
index 382a13f..752837c 100644
--- a/package.json
+++ b/package.json
@@ -22,6 +22,8 @@
"bizcharts": "^4.1.15",
"classnames": "^2.3.1",
"copy-to-clipboard": "^3.3.1",
+ "echarts": "^6.0.0",
+ "echarts-for-react": "^3.0.2",
"install": "^0.13.0",
"lodash": "^4.17.21",
"mockjs": "^1.1.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e5d29fa..8eb05e9 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -41,6 +41,12 @@ importers:
copy-to-clipboard:
specifier: ^3.3.1
version: 3.3.3
+ echarts:
+ specifier: ^6.0.0
+ version: 6.0.0
+ echarts-for-react:
+ specifier: ^3.0.2
+ version: 3.0.2(echarts@6.0.0)(react@17.0.2)
install:
specifier: ^0.13.0
version: 0.13.0
@@ -2273,6 +2279,15 @@ packages:
earcut@2.2.4:
resolution: {integrity: sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==}
+ echarts-for-react@3.0.2:
+ resolution: {integrity: sha512-DRwIiTzx8JfwPOVgGttDytBqdp5VzCSyMRIxubgU/g2n9y3VLUmF2FK7Icmg/sNVkv4+rktmrLN9w22U2yy3fA==}
+ peerDependencies:
+ echarts: ^3.0.0 || ^4.0.0 || ^5.0.0
+ react: ^15.0.0 || >=16.0.0
+
+ echarts@6.0.0:
+ resolution: {integrity: sha512-Tte/grDQRiETQP4xz3iZWSvoHrkCQtwqd6hs+mifXcjrCuo2iKWbajFObuLJVBlDIJlOzgQPd1hsaKt/3+OMkQ==}
+
electron-to-chromium@1.5.200:
resolution: {integrity: sha512-rFCxROw7aOe4uPTfIAx+rXv9cEcGx+buAF4npnhtTqCJk5KDFRnh3+KYj7rdVh6lsFt5/aPs+Irj9rZ33WMA7w==}
@@ -4242,6 +4257,9 @@ packages:
tslib@1.14.1:
resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
+ tslib@2.3.0:
+ resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==}
+
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
@@ -4500,6 +4518,9 @@ packages:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}
+ zrender@6.0.0:
+ resolution: {integrity: sha512-41dFXEEXuJpNecuUQq6JlbybmnHaqqpGlbH1yxnA5V9MMP4SbohSVZsJIwz+zdjQXSSlR1Vc34EgH1zxyTDvhg==}
+
zustand@4.5.7:
resolution: {integrity: sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==}
engines: {node: '>=12.7.0'}
@@ -7599,6 +7620,18 @@ snapshots:
earcut@2.2.4: {}
+ echarts-for-react@3.0.2(echarts@6.0.0)(react@17.0.2):
+ dependencies:
+ echarts: 6.0.0
+ fast-deep-equal: 3.1.3
+ react: 17.0.2
+ size-sensor: 1.0.2
+
+ echarts@6.0.0:
+ dependencies:
+ tslib: 2.3.0
+ zrender: 6.0.0
+
electron-to-chromium@1.5.200: {}
elliptic@6.6.1:
@@ -9841,6 +9874,8 @@ snapshots:
tslib@1.14.1: {}
+ tslib@2.3.0: {}
+
tslib@2.8.1: {}
tsutils@3.21.0(typescript@4.4.4):
@@ -10138,6 +10173,10 @@ snapshots:
yocto-queue@0.1.0: {}
+ zrender@6.0.0:
+ dependencies:
+ tslib: 2.3.0
+
zustand@4.5.7(@types/react@17.0.2)(react@17.0.2):
dependencies:
use-sync-external-store: 1.5.0(react@17.0.2)
diff --git a/src/components/NavBar/index.tsx b/src/components/NavBar/index.tsx
index 41a4210..33cb447 100644
--- a/src/components/NavBar/index.tsx
+++ b/src/components/NavBar/index.tsx
@@ -8,7 +8,7 @@ import {
Menu,
Divider,
Message,
- Button,
+ Button
} from '@arco-design/web-react';
import {
IconLanguage,
@@ -22,13 +22,12 @@ import {
IconDashboard,
IconInteraction,
IconTag,
- IconLoading,
+ IconLoading
} from '@arco-design/web-react/icon';
import { useSelector, useDispatch } from 'react-redux';
import { GlobalState } from '@/store';
import { GlobalContext } from '@/context';
import useLocale from '@/utils/useLocale';
-import Logo from '@/assets/logo.svg';
import MessageBox from '@/components/MessageBox';
import IconButton from './IconButton';
import Settings from '../Settings';
@@ -36,6 +35,8 @@ import styles from './style/index.module.less';
import defaultLocale from '@/locale';
import useStorage from '@/utils/useStorage';
import { generatePermission } from '@/routes';
+import { Image } from '@arco-design/web-react';
+import logoImage from '@/public/assets/logo.png';
function Navbar({ show }: { show: boolean }) {
const t = useLocale();
@@ -66,9 +67,9 @@ function Navbar({ show }: { show: boolean }) {
payload: {
userInfo: {
...userInfo,
- permissions: generatePermission(role),
- },
- },
+ permissions: generatePermission(role)
+ }
+ }
});
}, [role]);
@@ -144,8 +145,12 @@ function Navbar({ show }: { show: boolean }) {
-
-
Arco Pro
+

+
工业软件组件化构建开发与运行支撑环境
@@ -160,13 +165,13 @@ function Navbar({ show }: { show: boolean }) {
triggerElement={} />}
options={[
{ label: '中文', value: 'zh-CN' },
- { label: 'English', value: 'en-US' },
+ { label: 'English', value: 'en-US' }
]}
value={lang}
triggerProps={{
autoAlignPopupWidth: false,
autoAlignPopupMinWidth: true,
- position: 'br',
+ position: 'br'
}}
trigger="hover"
onChange={(value) => {
diff --git a/src/components/NavBar/style/index.module.less b/src/components/NavBar/style/index.module.less
index 797dd38..e64f5fe 100644
--- a/src/components/NavBar/style/index.module.less
+++ b/src/components/NavBar/style/index.module.less
@@ -15,7 +15,7 @@
.logo {
display: flex;
align-items: center;
- width: 200px;
+ //width: 200px;
padding-left: 20px;
box-sizing: border-box;
}
diff --git a/src/locale/index.ts b/src/locale/index.ts
index 9572fef..9a5a496 100644
--- a/src/locale/index.ts
+++ b/src/locale/index.ts
@@ -27,7 +27,7 @@ const i18n = {
'menu.user.switchRoles': 'Switch Roles',
'menu.user.role.admin': 'Admin',
'menu.user.role.user': 'General User',
- 'menu.dashboard.workplace': 'Workplace',
+ 'menu.dashboard.workplace': 'Home',
'menu.scene': 'All Engineering',
'menu.application': 'All Applications',
'menu.instance': 'Application Instance',
@@ -92,7 +92,7 @@ const i18n = {
'menu.user.switchRoles': '切换角色',
'menu.user.role.admin': '管理员',
'menu.user.role.user': '普通用户',
- 'menu.dashboard.workplace': '工作台',
+ 'menu.dashboard.workplace': '首页',
'menu.scene': '所有工程',
'menu.application': '所有应用',
'menu.instance': '应用实例',
diff --git a/src/pages/dashboard/workplace/content-percentage.tsx b/src/pages/dashboard/workplace/content-percentage.tsx
deleted file mode 100644
index e28fceb..0000000
--- a/src/pages/dashboard/workplace/content-percentage.tsx
+++ /dev/null
@@ -1,88 +0,0 @@
-import React, { useState, useEffect } from 'react';
-import { Card, Spin, Typography } from '@arco-design/web-react';
-import { DonutChart } from 'bizcharts';
-import axios from 'axios';
-import useLocale from '@/utils/useLocale';
-import locale from './locale';
-
-function PopularContent() {
- const t = useLocale(locale);
- const [data, setData] = useState([]);
- const [loading, setLoading] = useState(true);
-
- const fetchData = () => {
- setLoading(true);
- axios
- .get('/api/workplace/content-percentage')
- .then((res) => {
- setData(res.data);
- })
- .finally(() => {
- setLoading(false);
- });
- };
-
- useEffect(() => {
- fetchData();
- }, []);
-
- return (
-
-
- {t['workplace.contentPercentage']}
-
-
- `${(v.percent * 100).toFixed(0)}%`,
- style: {
- fill: '#86909C',
- fontSize: 14,
- },
- }}
- legend={{
- position: 'bottom',
- }}
- statistic={{
- title: {
- style: {
- fontSize: '14px',
- lineHeight: 2,
- color: 'rgb(--var(color-text-1))',
- },
- formatter: () => '内容量',
- },
- content: {
- style: {
- fontSize: '16px',
- color: 'rgb(--var(color-text-1))',
- },
- formatter: (_, data) => {
- const sum = data.reduce((a, b) => a + b.count, 0);
- return Number(sum).toLocaleString();
- },
- },
- }}
- />
-
-
- );
-}
-
-export default PopularContent;
diff --git a/src/pages/dashboard/workplace/docs.tsx b/src/pages/dashboard/workplace/docs.tsx
deleted file mode 100644
index 443643c..0000000
--- a/src/pages/dashboard/workplace/docs.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react';
-import { Link, Card, Typography } from '@arco-design/web-react';
-import useLocale from '@/utils/useLocale';
-import locale from './locale';
-import styles from './style/docs.module.less';
-
-const links = {
- react: 'https://arco.design/react/docs/start',
- vue: 'https://arco.design/vue/docs/start',
- designLab: 'https://arco.design/themes',
- materialMarket: 'https://arco.design/material/',
-};
-function QuickOperation() {
- const t = useLocale(locale);
-
- return (
-
-
- {t['workplace.docs']}
- {t['workplace.seeMore']}
-
-
- {Object.entries(links).map(([key, value]) => (
-
- {t[`workplace.${key}`]}
-
- ))}
-
-
- );
-}
-
-export default QuickOperation;
\ No newline at end of file
diff --git a/src/pages/dashboard/workplace/index.tsx b/src/pages/dashboard/workplace/index.tsx
index e06f23e..c518007 100644
--- a/src/pages/dashboard/workplace/index.tsx
+++ b/src/pages/dashboard/workplace/index.tsx
@@ -1,17 +1,12 @@
import React from 'react';
import { Grid, Space } from '@arco-design/web-react';
import Overview from './overview';
-import PopularContents from './popular-contents';
-import ContentPercentage from './content-percentage';
import Shortcuts from './shortcuts';
import Announcement from './announcement';
import Carousel from './carousel';
-import Docs from './docs';
import styles from './style/index.module.less';
import './mock';
-const { Row, Col } = Grid;
-
const gutter = 16;
function Workplace() {
@@ -19,20 +14,11 @@ function Workplace() {
);
diff --git a/src/pages/dashboard/workplace/locale/index.ts b/src/pages/dashboard/workplace/locale/index.ts
index be8bf4a..1e6c813 100644
--- a/src/pages/dashboard/workplace/locale/index.ts
+++ b/src/pages/dashboard/workplace/locale/index.ts
@@ -34,7 +34,7 @@ const i18n = {
'workplace.designLab': 'DesignLab',
'workplace.materialMarket': 'MaterialMarket',
'workplace.react': 'React Quick Start',
- 'workplace.vue': 'Vue Quick Start',
+ 'workplace.vue': 'Vue Quick Start'
},
'zh-CN': {
'workplace.welcomeBack': '欢迎回来,',
@@ -63,7 +63,7 @@ const i18n = {
'workplace.marketing': '内容投放',
'workplace.recent': '最近访问',
'workplace.announcement': '公告',
- 'workplace.activity': '活动',
+ 'workplace.activity': '上新',
'workplace.info': '消息',
'workplace.notice': '通知',
'workplace.docs': '文档中心',
@@ -71,8 +71,8 @@ const i18n = {
'workplace.designLab': '风格配置平台',
'workplace.materialMarket': '物料市场',
'workplace.react': 'React 组件库',
- 'workplace.vue': 'Vue 组件库',
- },
+ 'workplace.vue': 'Vue 组件库'
+ }
};
export default i18n;
diff --git a/src/pages/dashboard/workplace/mock/index.ts b/src/pages/dashboard/workplace/mock/index.ts
index 3a55f6f..58541d8 100644
--- a/src/pages/dashboard/workplace/mock/index.ts
+++ b/src/pages/dashboard/workplace/mock/index.ts
@@ -13,10 +13,10 @@ setupMock({
}));
};
return {
- allContents: '373.5w+',
- liveContents: '368',
- increaseComments: '8874',
- growthRate: '2.8%',
+ allContents: '15',
+ liveContents: '174',
+ increaseComments: '82',
+ growthRate: '4,888',
chartData: getLineData(),
};
});
@@ -89,12 +89,12 @@ setupMock({
{
type: 'activity',
key: '1',
- content: '内容最新优惠活动',
+ content: '组件库新增10+个组件'
},
{
type: 'info',
key: '2',
- content: '新增内容尚未通过审核,详情请点击查看。',
+ content: '定时任务执行成功1次,失败0次。'
},
{
type: 'notice',
diff --git a/src/pages/dashboard/workplace/overview.tsx b/src/pages/dashboard/workplace/overview.tsx
index 6c3e7e9..db5131c 100644
--- a/src/pages/dashboard/workplace/overview.tsx
+++ b/src/pages/dashboard/workplace/overview.tsx
@@ -5,7 +5,7 @@ import {
Typography,
Divider,
Skeleton,
- Link,
+ Link
} from '@arco-design/web-react';
import { useSelector } from 'react-redux';
import { IconCaretUp } from '@arco-design/web-react/icon';
@@ -90,7 +90,7 @@ function Overview() {
}
- title={t['workplace.totalOnlyData']}
+ title="工程数量"
count={data.allContents}
loading={loading}
unit={t['workplace.pecs']}
@@ -100,7 +100,7 @@ function Overview() {
}
- title={t['workplace.contentInMarket']}
+ title="组件数量"
count={data.liveContents}
loading={loading}
unit={t['workplace.pecs']}
@@ -110,7 +110,7 @@ function Overview() {
}
- title={t['workplace.comments']}
+ title="应用数量"
count={data.increaseComments}
loading={loading}
unit={t['workplace.pecs']}
@@ -120,15 +120,8 @@ function Overview() {
}
- title={t['workplace.growth']}
- count={
-
- {data.growthRate}{' '}
-
-
- }
+ title="应用实例数量"
+ count={data.growthRate}
loading={loading}
/>
@@ -138,16 +131,12 @@ function Overview() {
- {t['workplace.contentData']}
-
- ({t['workplace.1year']})
-
+ 应用修改记录
- {t['workplace.seeMore']}
-
+ {/**/}
);
diff --git a/src/pages/dashboard/workplace/popular-contents.tsx b/src/pages/dashboard/workplace/popular-contents.tsx
deleted file mode 100644
index f0f8b46..0000000
--- a/src/pages/dashboard/workplace/popular-contents.tsx
+++ /dev/null
@@ -1,115 +0,0 @@
-import React, { useState, useEffect, useCallback } from 'react';
-import { Link, Card, Radio, Table, Typography } from '@arco-design/web-react';
-import { IconCaretDown, IconCaretUp } from '@arco-design/web-react/icon';
-import axios from 'axios';
-import useLocale from '@/utils/useLocale';
-import locale from './locale';
-import styles from './style/popular-contents.module.less';
-
-function PopularContent() {
- const t = useLocale(locale);
- const [type, setType] = useState(0);
- const [data, setData] = useState([]);
- const [loading, setLoading] = useState(true);
- const [page, setPage] = useState(1);
- const [total, setTotal] = useState(0);
-
- const fetchData = useCallback(() => {
- setLoading(true);
- axios
- .get(
- `/api/workplace/popular-contents?page=${page}&pageSize=5&category=${type}`
- )
- .then((res) => {
- setData(res.data.list);
- setTotal(res.data.total);
- })
- .finally(() => {
- setLoading(false);
- });
- }, [page, type]);
-
- useEffect(() => {
- fetchData();
- }, [page, fetchData]);
-
- const columns = [
- {
- title: t['workplace.column.rank'],
- dataIndex: 'rank',
- width: 65,
- },
- {
- title: t['workplace.column.title'],
- dataIndex: 'title',
- render: (x) => (
-
- {x}
-
- ),
- },
- {
- title: t['workplace.column.pv'],
- dataIndex: 'pv',
- width: 100,
- render: (text) => {
- return `${text / 1000}k`;
- },
- },
- {
- title: t['workplace.column.increase'],
- dataIndex: 'increase',
- sorter: (a, b) => a.increase - b.increase,
- width: 110,
- render: (text) => {
- return (
-
- {`${(text * 100).toFixed(2)}%`}
-
- {text < 0 ? (
-
- ) : (
-
- )}
-
-
- );
- },
- },
- ];
-
- return (
-
-
-
- {t['workplace.popularContents']}
-
- {t['workplace.seeMore']}
-
-
- {
- setPage(pagination.current);
- }}
- pagination={{ total, current: page, pageSize: 5, simple: true }}
- />
-
- );
-}
-
-export default PopularContent;
diff --git a/src/pages/dashboard/workplace/shortcuts.tsx b/src/pages/dashboard/workplace/shortcuts.tsx
index 94101cc..370c2c8 100644
--- a/src/pages/dashboard/workplace/shortcuts.tsx
+++ b/src/pages/dashboard/workplace/shortcuts.tsx
@@ -4,14 +4,19 @@ import {
Card,
Divider,
Message,
- Typography,
+ Typography
} from '@arco-design/web-react';
import {
+ IconArchive,
+ IconCustomerService,
+ IconSelectAll,
+ IconBook,
+ IconApps,
IconFile,
IconStorage,
IconSettings,
IconMobile,
- IconFire,
+ IconFire
} from '@arco-design/web-react/icon';
import useLocale from '@/utils/useLocale';
import locale from './locale';
@@ -24,46 +29,61 @@ function Shortcuts() {
{
title: t['workplace.contentMgmt'],
key: 'Content Management',
- icon: ,
+ icon:
},
{
title: t['workplace.contentStatistic'],
key: 'Content Statistic',
- icon: ,
+ icon:
},
{
title: t['workplace.advancedMgmt'],
key: 'Advanced Management',
- icon: ,
+ icon:
},
{
title: t['workplace.onlinePromotion'],
key: 'Online Promotion',
- icon: ,
+ icon:
},
{
title: t['workplace.marketing'],
key: 'Marketing',
- icon: ,
- },
+ icon:
+ }
];
const recentShortcuts = [
{
- title: t['workplace.contentStatistic'],
- key: 'Content Statistic',
- icon: ,
+ title: '工程页',
+ key: 1,
+ icon:
},
{
- title: t['workplace.contentMgmt'],
- key: 'Content Management',
- icon: ,
+ title: '应用页',
+ key: 2,
+ icon:
},
{
- title: t['workplace.advancedMgmt'],
- key: 'Advanced Management',
- icon: ,
+ title: '应用编排',
+ key: 3,
+ icon:
+ },
+ {
+ title: '新手指引',
+ key: 4,
+ icon:
},
+ {
+ title: '常见问题',
+ key: 5,
+ icon:
+ },
+ {
+ title: '用户文档',
+ key: 6,
+ icon:
+ }
];
function onClickShortcut(key) {
@@ -72,31 +92,31 @@ function Shortcuts() {
You clicked {key}
- ),
+ )
});
}
return (
-
-
- {t['workplace.shortcuts']}
-
- {t['workplace.seeMore']}
-
-
- {shortcuts.map((shortcut) => (
-
onClickShortcut(shortcut.key)}
- >
-
{shortcut.icon}
-
{shortcut.title}
-
- ))}
-
-
+ {/**/}
+ {/* */}
+ {/* {t['workplace.shortcuts']}*/}
+ {/* */}
+ {/* {t['workplace.seeMore']}*/}
+ {/*
*/}
+ {/**/}
+ {/* {shortcuts.map((shortcut) => (*/}
+ {/*
onClickShortcut(shortcut.key)}*/}
+ {/* >*/}
+ {/*
{shortcut.icon}
*/}
+ {/*
{shortcut.title}
*/}
+ {/*
*/}
+ {/* ))}*/}
+ {/*
*/}
+ {/**/}
{t['workplace.recent']}
{recentShortcuts.map((shortcut) => (
diff --git a/src/public/assets/logo.png b/src/public/assets/logo.png
new file mode 100644
index 0000000..e2d30f3
Binary files /dev/null and b/src/public/assets/logo.png differ