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
+ +
工业软件组件化构建开发与运行支撑环境
); 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