From fa7e8eb8c506316f999052bf92fce45074871aff Mon Sep 17 00:00:00 2001 From: yuyang Date: Tue, 12 Apr 2022 11:37:23 +0800 Subject: [PATCH 01/10] Feat/spellcheck (#64) * feat(ci): spell check * chore: ignore check file * chore: ignore file --- .github/configs/typos_config.toml | 4 ++++ .github/workflows/pr-spelling.temp.yml | 14 ++++++++++++++ src/configs/style.ts | 0 .../Result/BrowserIncompatible/index.module.less | 2 +- src/pages/Result/BrowserIncompatible/index.tsx | 2 +- 5 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .github/configs/typos_config.toml create mode 100644 .github/workflows/pr-spelling.temp.yml create mode 100644 src/configs/style.ts diff --git a/.github/configs/typos_config.toml b/.github/configs/typos_config.toml new file mode 100644 index 0000000..a935ba0 --- /dev/null +++ b/.github/configs/typos_config.toml @@ -0,0 +1,4 @@ +files.extend-exclude = [ + "package-lock.json", + "src/configs/color.ts" +] \ No newline at end of file diff --git a/.github/workflows/pr-spelling.temp.yml b/.github/workflows/pr-spelling.temp.yml new file mode 100644 index 0000000..48cd8cf --- /dev/null +++ b/.github/workflows/pr-spelling.temp.yml @@ -0,0 +1,14 @@ +# force copy from tencent/tdesign +name: pr-spell-check +on: [pull_request] + +jobs: + run: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Check spelling + uses: crate-ci/typos@master + with: + config: .github/configs/typos_config.toml diff --git a/src/configs/style.ts b/src/configs/style.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/Result/BrowserIncompatible/index.module.less b/src/pages/Result/BrowserIncompatible/index.module.less index cc49cf1..c35e2e0 100644 --- a/src/pages/Result/BrowserIncompatible/index.module.less +++ b/src/pages/Result/BrowserIncompatible/index.module.less @@ -34,7 +34,7 @@ justify-content: space-between; color: var(--td-text-color-secondary); - .recommandContainer { + .recommendContainer { position: absolute; display: flex; align-items: center; diff --git a/src/pages/Result/BrowserIncompatible/index.tsx b/src/pages/Result/BrowserIncompatible/index.tsx index e6dfa55..bbff5ec 100644 --- a/src/pages/Result/BrowserIncompatible/index.tsx +++ b/src/pages/Result/BrowserIncompatible/index.tsx @@ -12,7 +12,7 @@ const BrowserIncompatible = () => (
-
+
TDesign Starter 推荐以下主流浏览器
From 149ef1f262d7a4f342e003f9990001e04fbc98a8 Mon Sep 17 00:00:00 2001 From: xucz Date: Sun, 1 May 2022 17:28:29 +0800 Subject: [PATCH 02/10] =?UTF-8?q?feat:=20=E5=88=87=E6=8D=A2=E8=87=B3TDesig?= =?UTF-8?q?n=20Card?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 76 ++++++++++++------- package.json | 2 +- src/components/Board/index.module.less | 12 +-- src/components/Board/index.tsx | 44 ++++++----- .../Base/components/MiddleChart.module.less | 6 ++ .../Dashboard/Base/components/MiddleChart.tsx | 7 +- .../Base/components/Overview.module.less | 6 ++ .../Dashboard/Base/components/Overview.tsx | 19 +++-- .../Base/components/RankList.module.less | 6 ++ .../Dashboard/Base/components/RankList.tsx | 16 ++-- .../Dashboard/Base/components/TopPanel.tsx | 10 +-- .../Detail/components/MonthPurchase.tsx | 5 +- .../Detail/components/PurchaseTrend.tsx | 7 +- .../Detail/components/Satisfaction.tsx | 10 +-- src/pages/Dashboard/Detail/index.module.less | 8 ++ src/pages/Dashboard/Detail/index.tsx | 3 +- src/pages/Detail/Advanced/components/Base.tsx | 6 +- .../Detail/Advanced/components/Detail.tsx | 20 ++--- .../Detail/Advanced/components/Product.tsx | 5 +- .../Detail/Advanced/components/Progress.tsx | 5 +- src/pages/User/index.module.less | 13 ---- src/pages/User/index.tsx | 20 +++-- 22 files changed, 167 insertions(+), 139 deletions(-) create mode 100644 src/pages/Dashboard/Detail/index.module.less diff --git a/package-lock.json b/package-lock.json index 8d6b8bc..7a6cd6a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1384,7 +1384,7 @@ }, "@juggle/resize-observer": { "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@juggle/resize-observer/-/resize-observer-3.3.1.tgz", + "resolved": "https://mirrors.tencent.com/npm/@juggle%2fresize-observer/-/resize-observer-3.3.1.tgz", "integrity": "sha512-zMM9Ds+SawiUkakS7y94Ymqx+S0ORzpG3frZirN3l+UlXUmSUR7hF4wxCVqW+ei94JzV5kt0uXBcoOEAuiydrw==" }, "@nodelib/fs.scandir": { @@ -1415,7 +1415,7 @@ }, "@popperjs/core": { "version": "2.11.5", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", + "resolved": "https://mirrors.tencent.com/npm/@popperjs%2fcore/-/core-2.11.5.tgz", "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==" }, "@reduxjs/toolkit": { @@ -1719,6 +1719,16 @@ "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" }, + "@types/sortablejs": { + "version": "1.10.7", + "resolved": "https://mirrors.tencent.com/npm/@types%2fsortablejs/-/sortablejs-1.10.7.tgz", + "integrity": "sha512-lGCwwgpj8zW/ZmaueoPVSP7nnc9t8VqVWXS+ASX3eoUUENmiazv0rlXyTRludXzuX9ALjPsMqBu85TgJNWbTOg==" + }, + "@types/tinycolor2": { + "version": "1.4.3", + "resolved": "https://mirrors.tencent.com/npm/@types%2ftinycolor2/-/tinycolor2-1.4.3.tgz", + "integrity": "sha512-Kf1w9NE5HEgGxCRyIcRXR/ZYtDv0V8FVPtYHwLxl0O+maGX0erE77pQlD0gpP+/KByMZ87mOA79SjifhSB3PjQ==" + }, "@types/zrender": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/zrender/-/zrender-4.0.1.tgz", @@ -2236,7 +2246,7 @@ }, "clipboard": { "version": "2.0.10", - "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.10.tgz", + "resolved": "https://mirrors.tencent.com/npm/clipboard/-/clipboard-2.0.10.tgz", "integrity": "sha512-cz3m2YVwFz95qSEbCDi2fzLN/epEN9zXBvfgAoGkvGOJZATMl9gtTDVOtBYkx2ODUJl2kvmud7n32sV2BpYR4g==", "requires": { "good-listener": "^1.2.2", @@ -2419,7 +2429,7 @@ }, "delegate": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", + "resolved": "https://mirrors.tencent.com/npm/delegate/-/delegate-3.2.0.tgz", "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" }, "dir-glob": { @@ -2442,7 +2452,7 @@ }, "dom-helpers": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "resolved": "https://mirrors.tencent.com/npm/dom-helpers/-/dom-helpers-5.2.1.tgz", "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", "requires": { "@babel/runtime": "^7.8.7", @@ -3392,7 +3402,7 @@ }, "good-listener": { "version": "1.2.2", - "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", + "resolved": "https://mirrors.tencent.com/npm/good-listener/-/good-listener-1.2.2.tgz", "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", "requires": { "delegate": "^3.1.2" @@ -4161,7 +4171,7 @@ }, "performance-now": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "resolved": "https://mirrors.tencent.com/npm/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, "picocolors": { @@ -4261,7 +4271,7 @@ }, "raf": { "version": "3.4.1", - "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", + "resolved": "https://mirrors.tencent.com/npm/raf/-/raf-3.4.1.tgz", "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", "requires": { "performance-now": "^2.1.0" @@ -4288,7 +4298,7 @@ }, "react-fast-compare": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.0.tgz", + "resolved": "https://mirrors.tencent.com/npm/react-fast-compare/-/react-fast-compare-3.2.0.tgz", "integrity": "sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==" }, "react-is": { @@ -4298,7 +4308,7 @@ }, "react-popper": { "version": "2.2.5", - "resolved": "https://registry.npmjs.org/react-popper/-/react-popper-2.2.5.tgz", + "resolved": "https://mirrors.tencent.com/npm/react-popper/-/react-popper-2.2.5.tgz", "integrity": "sha512-kxGkS80eQGtLl18+uig1UIf9MKixFSyPxglsgLBxlYnyDf65BiY9B3nZSc6C9XUNDgStROB0fMQlTEz1KxGddw==", "requires": { "react-fast-compare": "^3.0.1", @@ -4350,7 +4360,7 @@ }, "react-transition-group": { "version": "4.4.2", - "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.2.tgz", + "resolved": "https://mirrors.tencent.com/npm/react-transition-group/-/react-transition-group-4.4.2.tgz", "integrity": "sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg==", "requires": { "@babel/runtime": "^7.5.5", @@ -4549,7 +4559,7 @@ }, "select": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", + "resolved": "https://mirrors.tencent.com/npm/select/-/select-1.1.2.tgz", "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=" }, "semver": { @@ -4595,6 +4605,11 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, + "sortablejs": { + "version": "1.15.0", + "resolved": "https://mirrors.tencent.com/npm/sortablejs/-/sortablejs-1.15.0.tgz", + "integrity": "sha512-bv9qgVMjUMf89wAvM6AxVvS/4MX3sPeN0+agqShejLU5z5GX4C75ow1O2e5k4L6XItUyAK3gH6AxSbXrOM5e8w==" + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -4707,12 +4722,14 @@ } }, "tdesign-react": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/tdesign-react/-/tdesign-react-0.30.1.tgz", - "integrity": "sha512-zWSc32xN2OnXfsCkb3PCEoss/7ean8msXna8zt/NHivjcfa9sdxIJC+j29pTZigroVNhfDYWfAn0a6Eyh2ACLA==", + "version": "0.32.2", + "resolved": "https://mirrors.tencent.com/npm/tdesign-react/-/tdesign-react-0.32.2.tgz", + "integrity": "sha512-dORzKN0nmEVh/AlCdzJF4g5/rSWUbW51cNj50wMnGsAonCkixCewVUKHeK6XWQFoIbau+2GQXSTky/qdDoDKDA==", "requires": { "@babel/runtime": "~7.17.2", "@popperjs/core": "~2.11.2", + "@types/sortablejs": "^1.10.7", + "@types/tinycolor2": "^1.4.3", "classnames": "~2.3.1", "clipboard": "~2.0.8", "dayjs": "~1.10.8", @@ -4721,7 +4738,9 @@ "raf": "~3.4.1", "react-popper": "~2.2.5", "react-transition-group": "~4.4.1", - "tdesign-icons-react": "~0.0.9", + "sortablejs": "^1.15.0", + "tdesign-icons-react": "^0.0.10", + "tinycolor2": "^1.4.2", "tslib": "~2.3.1", "use-resize-observer": "^8.0.0", "uuid": "~8.3.2", @@ -4730,13 +4749,13 @@ "dependencies": { "dayjs": { "version": "1.10.8", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.8.tgz", + "resolved": "https://mirrors.tencent.com/npm/dayjs/-/dayjs-1.10.8.tgz", "integrity": "sha512-wbNwDfBHHur9UOzNUjeKUOJ0fCb0a52Wx0xInmQ7Y8FstyajiV1NmK1e00cxsr9YrE9r7yAChE0VvpuY5Rnlow==" }, "tdesign-icons-react": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/tdesign-icons-react/-/tdesign-icons-react-0.0.9.tgz", - "integrity": "sha512-BJbYIzmlfr34gDxNBS2a1xNeuaHN1X/eMVAEZhAu+2XypzSuqnwTDasD2uxd2pRpVHJ+AHhF0NUp2mxJy8QXpA==", + "version": "0.0.10", + "resolved": "https://mirrors.tencent.com/npm/tdesign-icons-react/-/tdesign-icons-react-0.0.10.tgz", + "integrity": "sha512-azFKwQ09rj1MXIgfJlTNpkvjXvFmPFhbb1FLkL2qbn+1IQ0IpCFV48C1TIWkANsmvMNIo3YxApOrBtcLB9fV0g==", "requires": { "@babel/runtime": "^7.16.5", "classnames": "^2.2.6" @@ -4744,7 +4763,7 @@ }, "tslib": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "resolved": "https://mirrors.tencent.com/npm/tslib/-/tslib-2.3.1.tgz", "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" } } @@ -4757,9 +4776,14 @@ }, "tiny-emitter": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "resolved": "https://mirrors.tencent.com/npm/tiny-emitter/-/tiny-emitter-2.1.0.tgz", "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" }, + "tinycolor2": { + "version": "1.4.2", + "resolved": "https://mirrors.tencent.com/npm/tinycolor2/-/tinycolor2-1.4.2.tgz", + "integrity": "sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==" + }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -4906,7 +4930,7 @@ }, "use-resize-observer": { "version": "8.0.0", - "resolved": "https://registry.npmjs.org/use-resize-observer/-/use-resize-observer-8.0.0.tgz", + "resolved": "https://mirrors.tencent.com/npm/use-resize-observer/-/use-resize-observer-8.0.0.tgz", "integrity": "sha512-n0iKSeiQpJCyaFh5JA0qsVLBIovsF4EIIR1G6XiBwKJN66ZrD4Oj62bjcuTAATPKiSp6an/2UZZxCf/67fk3sQ==", "requires": { "@juggle/resize-observer": "^3.3.1" @@ -4920,7 +4944,7 @@ }, "uuid": { "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "resolved": "https://mirrors.tencent.com/npm/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" }, "v8-compile-cache": { @@ -4931,7 +4955,7 @@ }, "validator": { "version": "13.7.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", + "resolved": "https://mirrors.tencent.com/npm/validator/-/validator-13.7.0.tgz", "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==" }, "vite": { @@ -5029,7 +5053,7 @@ }, "warning": { "version": "4.0.3", - "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", + "resolved": "https://mirrors.tencent.com/npm/warning/-/warning-4.0.3.tgz", "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", "requires": { "loose-envify": "^1.0.0" diff --git a/package.json b/package.json index 8c1de2b..3fe5208 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "react-redux": "^7.2.4", "react-router-dom": "^6.3.0", "tdesign-icons-react": "0.0.9", - "tdesign-react": "^0.30.1", + "tdesign-react": "^0.32.2", "tvision-color": "^1.3.1" }, "browserslist": { diff --git a/src/components/Board/index.module.less b/src/components/Board/index.module.less index 1665e93..7ce8c1e 100644 --- a/src/components/Board/index.module.less +++ b/src/components/Board/index.module.less @@ -1,7 +1,3 @@ -.panel { - height: 160px -} - .boardPanelDark { background: var(--td-brand-color)!important; .boardTitle, .boardItemLeft, .boardItemDesc, .trendColorUp, .trendColorDown, .boardItemBottom { @@ -12,7 +8,10 @@ } } -.boardTitle {} +.boardTitle{ + line-height: 22px; + color: var(--td-text-color-secondary); +} .boardItem { display: flex; @@ -27,9 +26,6 @@ line-height: 44px; } -.boardItemRight { -} - .boardItemBottom { display: flex; justify-content: space-between; diff --git a/src/components/Board/index.tsx b/src/components/Board/index.tsx index 6775a60..3c38c98 100644 --- a/src/components/Board/index.tsx +++ b/src/components/Board/index.tsx @@ -1,36 +1,39 @@ import React from 'react'; import { ChevronRightIcon } from 'tdesign-icons-react'; -import Card from 'components/Card'; +import { Card } from 'tdesign-react'; import classnames from 'classnames'; import Style from './index.module.less'; -type TTrend = 'up' | 'down'; +export enum ETrend { + up, + down, +} export interface IBoardProps extends React.HTMLAttributes { title?: string; count?: string; Icon?: React.ReactElement; desc?: string; - trend?: TTrend; + trend?: ETrend; trendNum?: string; dark?: boolean; border?: boolean; } -export const TrendIcon = ({ trend, trendNum }: { trend?: TTrend; trendNum?: string | number }) => ( +export const TrendIcon = ({ trend, trendNum }: { trend?: ETrend; trendNum?: string | number }) => (
- {trend === 'up' ? ( + {trend === ETrend.up ? ( @@ -46,26 +49,27 @@ export const TrendIcon = ({ trend, trendNum }: { trend?: TTrend; trendNum?: stri
); -const Board = ({ title, count, desc, trend, trendNum, Icon, dark, border }: IBoardProps) => ( +const Board = ({ title, count, desc, trend, trendNum, Icon, dark }: IBoardProps) => ( {title}
} - className={classnames(Style.panel, { + header + className={classnames({ [Style.boardPanelDark]: dark, })} - border={border} - size='small' + footer={ +
+
+ {desc} + +
+ +
+ } >
{count}
{Icon}
-
-
- {desc} - -
- -
); diff --git a/src/pages/Dashboard/Base/components/MiddleChart.module.less b/src/pages/Dashboard/Base/components/MiddleChart.module.less index 0c8afcd..0516953 100644 --- a/src/pages/Dashboard/Base/components/MiddleChart.module.less +++ b/src/pages/Dashboard/Base/components/MiddleChart.module.less @@ -1,3 +1,9 @@ .middleChartPanel { margin-top: 16px; + :global { + .t-card__title { + font-weight: 700; + font-size: 20px; + } + } } diff --git a/src/pages/Dashboard/Base/components/MiddleChart.tsx b/src/pages/Dashboard/Base/components/MiddleChart.tsx index 3b4291e..728e691 100644 --- a/src/pages/Dashboard/Base/components/MiddleChart.tsx +++ b/src/pages/Dashboard/Base/components/MiddleChart.tsx @@ -1,8 +1,7 @@ import React, { useState } from 'react'; -import { Col, Row } from 'tdesign-react'; +import { Col, Row, Card } from 'tdesign-react'; import ReactEcharts from 'echarts-for-react'; import useDynamicChart from 'utils/hooks/useDynamicChart'; -import Card from 'components/Card'; import LastWeekDatePicker from 'components/DatePicker'; import { getLineChartOptions, getPieChartOptions } from '../chart'; import Style from './MiddleChart.module.less'; @@ -32,12 +31,12 @@ const MiddleChart = () => { return ( - + - + diff --git a/src/pages/Dashboard/Base/components/Overview.module.less b/src/pages/Dashboard/Base/components/Overview.module.less index 745fe90..dba03da 100644 --- a/src/pages/Dashboard/Base/components/Overview.module.less +++ b/src/pages/Dashboard/Base/components/Overview.module.less @@ -2,4 +2,10 @@ background-color: var(--td-bg-color-container); border-radius: 3px; margin-top: 16px; + :global { + .t-card__title { + font-weight: 700; + font-size: 20px; + } + } } diff --git a/src/pages/Dashboard/Base/components/Overview.tsx b/src/pages/Dashboard/Base/components/Overview.tsx index 6bdcf3a..0ebd5b5 100644 --- a/src/pages/Dashboard/Base/components/Overview.tsx +++ b/src/pages/Dashboard/Base/components/Overview.tsx @@ -1,9 +1,8 @@ import React, { useState } from 'react'; -import { Button, Col, Row } from 'tdesign-react'; +import { Button, Col, Row, Card } from 'tdesign-react'; import ReactEcharts from 'echarts-for-react'; import useDynamicChart from 'utils/hooks/useDynamicChart'; -import Card from 'components/Card'; -import Board from 'components/Board'; +import Board, { ETrend } from 'components/Board'; import LastWeekDatePicker from 'components/DatePicker'; import { getBarChartOptions } from '../chart'; import Style from './Overview.module.less'; @@ -25,7 +24,7 @@ const Overview = (): React.ReactElement => {
- + { - 导出数据}> + 导出数据}> - + - + diff --git a/src/pages/Dashboard/Base/components/RankList.module.less b/src/pages/Dashboard/Base/components/RankList.module.less index c214369..8bfaae9 100644 --- a/src/pages/Dashboard/Base/components/RankList.module.less +++ b/src/pages/Dashboard/Base/components/RankList.module.less @@ -1,5 +1,11 @@ .rankListPanel { margin-top: 16px; + :global { + .t-card__title { + font-weight: 700; + font-size: 20px; + } + } } .rankIndex { diff --git a/src/pages/Dashboard/Base/components/RankList.tsx b/src/pages/Dashboard/Base/components/RankList.tsx index 6abb207..3a2854a 100644 --- a/src/pages/Dashboard/Base/components/RankList.tsx +++ b/src/pages/Dashboard/Base/components/RankList.tsx @@ -2,8 +2,8 @@ import React from 'react'; import { Col, Radio, Row, Table, Button } from 'tdesign-react'; import { TdPrimaryTableProps } from 'tdesign-react/es/table'; import classnames from 'classnames'; -import Board from 'components/Card'; -import { TrendIcon } from 'components/Board'; +import { Card } from 'tdesign-react'; +import { TrendIcon, ETrend } from 'components/Board'; import { PURCHASE_TREND_LIST, SALE_TREND_LIST } from '../constant'; import Style from './RankList.module.less'; @@ -37,7 +37,7 @@ const SALE_COLUMNS: TdPrimaryTableProps['columns'] = [ colKey: 'growUp', width: 100, title: '较上周', - render: ({ row }) => , + render: ({ row }) => , }, { align: 'center', @@ -88,7 +88,7 @@ const PURCHASE_COLUMNS: TdPrimaryTableProps['columns'] = [ colKey: 'growUp', width: 100, title: '较上周', - render: ({ row }) => , + render: ({ row }) => , }, { align: 'center', @@ -119,14 +119,14 @@ const PURCHASE_COLUMNS: TdPrimaryTableProps['columns'] = [ const RankList = () => ( - + - + - +
- + ); diff --git a/src/pages/Dashboard/Base/components/TopPanel.tsx b/src/pages/Dashboard/Base/components/TopPanel.tsx index 3d2b577..438748a 100644 --- a/src/pages/Dashboard/Base/components/TopPanel.tsx +++ b/src/pages/Dashboard/Base/components/TopPanel.tsx @@ -2,7 +2,7 @@ import React, { memo } from 'react'; import { Col, Row } from 'tdesign-react'; import { UsergroupIcon, FileIcon } from 'tdesign-icons-react'; import ReactEcharts from 'echarts-for-react'; -import Board, { IBoardProps } from 'components/Board'; +import Board, { ETrend, IBoardProps } from 'components/Board'; import useDynamicChart from 'utils/hooks/useDynamicChart'; import { MICRO_CHART_OPTIONS_BAR, MICRO_CHART_OPTIONS_LINE } from '../chart'; import Style from './TopPanel.module.less'; @@ -36,21 +36,21 @@ const PANE_LIST: Array = [ { title: '总收入', count: '¥ 28,425.00', - trend: 'up', + trend: ETrend.up, trendNum: '20.5%', Icon: , }, { title: '总退款', count: '¥ 768.00', - trend: 'down', + trend: ETrend.down, trendNum: '20.5%', Icon: , }, { title: '活跃用户(个)', count: '1126', - trend: 'down', + trend: ETrend.down, trendNum: '20.5%', Icon: (
@@ -61,7 +61,7 @@ const PANE_LIST: Array = [ { title: '产生订单(个)', count: '527', - trend: 'down', + trend: ETrend.down, trendNum: '20.5%', Icon: (
diff --git a/src/pages/Dashboard/Detail/components/MonthPurchase.tsx b/src/pages/Dashboard/Detail/components/MonthPurchase.tsx index c0e6bb8..a767c51 100644 --- a/src/pages/Dashboard/Detail/components/MonthPurchase.tsx +++ b/src/pages/Dashboard/Detail/components/MonthPurchase.tsx @@ -1,11 +1,10 @@ import React from 'react'; +import { Col, Row, Card } from 'tdesign-react'; import Board from 'components/Board'; -import { Col, Row } from 'tdesign-react'; -import Card from 'components/Card'; import { PANE_LIST } from '../constant'; const MonthPurchase = () => ( - + {PANE_LIST.map((item) => (
diff --git a/src/pages/Dashboard/Detail/components/PurchaseTrend.tsx b/src/pages/Dashboard/Detail/components/PurchaseTrend.tsx index e3b4747..fc40d42 100644 --- a/src/pages/Dashboard/Detail/components/PurchaseTrend.tsx +++ b/src/pages/Dashboard/Detail/components/PurchaseTrend.tsx @@ -1,8 +1,7 @@ import React, { useState } from 'react'; -import { Button, Col, Dropdown, Row, Tag } from 'tdesign-react'; +import { Button, Col, Dropdown, Row, Tag, Card } from 'tdesign-react'; import { Icon } from 'tdesign-icons-react'; import ReactEcharts from 'echarts-for-react'; -import Board from 'components/Card'; import LastWeekDatePicker from 'components/DatePicker'; import useDynamicChart from 'utils/hooks/useDynamicChart'; import { PRODUCT_LIST } from '../constant'; @@ -75,14 +74,14 @@ const PurchaseTrend = () => { return ( - + - + diff --git a/src/pages/Dashboard/Detail/components/Satisfaction.tsx b/src/pages/Dashboard/Detail/components/Satisfaction.tsx index 5059f95..b634776 100644 --- a/src/pages/Dashboard/Detail/components/Satisfaction.tsx +++ b/src/pages/Dashboard/Detail/components/Satisfaction.tsx @@ -1,8 +1,7 @@ import React, { useState } from 'react'; -import { Button } from 'tdesign-react'; +import { Button, Card } from 'tdesign-react'; import ReactEcharts from 'echarts-for-react'; import LastWeekDatePicker from 'components/DatePicker'; -import Board from 'components/Card'; import useDynamicChart from 'utils/hooks/useDynamicChart'; import { getScatterChartOptions } from '../chart'; import Style from './Satisfaction.module.less'; @@ -21,9 +20,10 @@ const Satisfaction = () => { return (
- {LastWeekDatePicker(onTimeChange)} @@ -36,7 +36,7 @@ const Satisfaction = () => { lazyUpdate={true} style={{ height: 374 }} /> - +
); }; diff --git a/src/pages/Dashboard/Detail/index.module.less b/src/pages/Dashboard/Detail/index.module.less new file mode 100644 index 0000000..e30e046 --- /dev/null +++ b/src/pages/Dashboard/Detail/index.module.less @@ -0,0 +1,8 @@ +.panel { + :global { + .t-card__title { + font-weight: 700; + font-size: 20px; + } + } +} diff --git a/src/pages/Dashboard/Detail/index.tsx b/src/pages/Dashboard/Detail/index.tsx index 9b54da1..8f6307b 100644 --- a/src/pages/Dashboard/Detail/index.tsx +++ b/src/pages/Dashboard/Detail/index.tsx @@ -3,9 +3,10 @@ import PageBox from 'components/PageBox'; import MonthPurchase from './components/MonthPurchase'; import PurchaseTrend from './components/PurchaseTrend'; import PurchaseSatisfaction from './components/Satisfaction'; +import Style from './index.module.less'; export default memo(() => ( - + diff --git a/src/pages/Detail/Advanced/components/Base.tsx b/src/pages/Detail/Advanced/components/Base.tsx index 4684b1c..9d37df5 100644 --- a/src/pages/Detail/Advanced/components/Base.tsx +++ b/src/pages/Detail/Advanced/components/Base.tsx @@ -1,11 +1,11 @@ import React from 'react'; +import { Card } from 'tdesign-react'; import classnames from 'classnames'; import { dataInfo } from '../consts'; -import Card from 'components/Card'; import Style from './Base.module.less'; const Base = () => ( - +
{dataInfo.map((item) => (
@@ -16,7 +16,7 @@ const Base = () => ( [Style.pdf]: item.type === 'link', })} > - {item.type === 'status' && } + {item.type === 'status' && } {item.value}
diff --git a/src/pages/Detail/Advanced/components/Detail.tsx b/src/pages/Detail/Advanced/components/Detail.tsx index b6b2c8e..e8f1ece 100644 --- a/src/pages/Detail/Advanced/components/Detail.tsx +++ b/src/pages/Detail/Advanced/components/Detail.tsx @@ -1,18 +1,16 @@ import React from 'react'; -import { Button, Table, Tag } from 'tdesign-react'; +import { Button, Table, Tag, Card } from 'tdesign-react'; import { dataBuyList, total } from '../consts'; -import Card from 'components/Card'; import Style from '../index.module.less'; const Detail = () => ( - +
( { align: 'left', width: 200, - minWidth: 200, ellipsis: true, colKey: 'name', title: '产品名称', @@ -38,34 +35,30 @@ const Detail = () => ( { align: 'left', width: 200, - minWidth: 200, ellipsis: true, colKey: 'code', title: '产品编号', }, { align: 'left', - width: 200, - minWidth: 200, + width: 100, ellipsis: true, colKey: 'amount', title: '采购数量', cell({ row }) { - return <>{row.amount}; + return row.amount; }, }, { align: 'left', width: 200, - minWidth: 200, ellipsis: true, colKey: 'department', title: '申请部门', }, { align: 'left', - width: 300, - minWidth: 300, + width: 500, ellipsis: true, colKey: 'createtime', title: '创建时间', @@ -73,8 +66,7 @@ const Detail = () => ( { align: 'left', fixed: 'right', - width: 200, - minWidth: 200, + width: 300, colKey: 'op', title: '操作', cell() { diff --git a/src/pages/Detail/Advanced/components/Product.tsx b/src/pages/Detail/Advanced/components/Product.tsx index 61f25c1..3c36f5b 100644 --- a/src/pages/Detail/Advanced/components/Product.tsx +++ b/src/pages/Detail/Advanced/components/Product.tsx @@ -1,11 +1,10 @@ import React from 'react'; -import { Col, Row } from 'tdesign-react'; -import Card from 'components/Card'; +import { Col, Row, Card } from 'tdesign-react'; import ProductCard from './ProductCard'; import Style from '../index.module.less'; const Product = () => ( - +
diff --git a/src/pages/Detail/Advanced/components/Progress.tsx b/src/pages/Detail/Advanced/components/Progress.tsx index 5bdb215..4b1e3d5 100644 --- a/src/pages/Detail/Advanced/components/Progress.tsx +++ b/src/pages/Detail/Advanced/components/Progress.tsx @@ -1,13 +1,12 @@ import React from 'react'; -import { Steps } from 'tdesign-react'; +import { Steps, Card } from 'tdesign-react'; import { dataStep, stepCurrent } from '../consts'; -import Card from 'components/Card'; import Style from '../index.module.less'; const { StepItem } = Steps; const Progress = () => ( - + {dataStep.map((item) => ( diff --git a/src/pages/User/index.module.less b/src/pages/User/index.module.less index 2204bf9..12711a0 100644 --- a/src/pages/User/index.module.less +++ b/src/pages/User/index.module.less @@ -42,19 +42,6 @@ .statistics { margin-top: 16px; padding-top: 20px; - .title { - font-size: 20px; - line-height: 24px; - font-weight: 500; - color: var(--td-text-color-primary); - - .unit { - font-size: 14px; - line-height: 22px; - margin-left: 4px; - color: var(--td-text-color-placeholder); - } - } } // 职位信息 diff --git a/src/pages/User/index.tsx b/src/pages/User/index.tsx index 7fe6e64..4c4c6a3 100644 --- a/src/pages/User/index.tsx +++ b/src/pages/User/index.tsx @@ -1,10 +1,9 @@ import React, { memo } from 'react'; -import { Row, Col, Button, List } from 'tdesign-react'; +import { Row, Col, Button, List, Card } from 'tdesign-react'; import { IconFont } from 'tdesign-icons-react'; import { BrowserRouterProps } from 'react-router-dom'; import ReactEcharts from 'echarts-for-react'; import PageBox from 'components/PageBox'; -import Card from 'components/Card'; import { TEAMS } from './consts'; import { visitData } from './chart'; import ProductA from 'assets/svg/assets-product-1.svg?component'; @@ -31,18 +30,19 @@ const User: React.FC = () => { Hi,Image 下午好,今天是你加入鹅厂的第 100 天~ - + } + header > @@ -87,11 +87,7 @@ const User: React.FC = () => { - -
- 主页访问数据 - (次) -
+ @@ -106,7 +102,8 @@ const User: React.FC = () => { @@ -123,7 +120,8 @@ const User: React.FC = () => { From 81fa7002008ac0b6b4d0b4189807cecbd32107ed Mon Sep 17 00:00:00 2001 From: xucz Date: Sun, 1 May 2022 17:29:56 +0800 Subject: [PATCH 03/10] feat: upd --- package-lock.json | 38 +++++++++---------- .../Dashboard/Base/components/RankList.tsx | 3 +- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7a6cd6a..ea094d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1384,7 +1384,7 @@ }, "@juggle/resize-observer": { "version": "3.3.1", - "resolved": "https://mirrors.tencent.com/npm/@juggle%2fresize-observer/-/resize-observer-3.3.1.tgz", + "resolved": "https://registry.npmjs.org/@juggle/resize-observer/-/resize-observer-3.3.1.tgz", "integrity": "sha512-zMM9Ds+SawiUkakS7y94Ymqx+S0ORzpG3frZirN3l+UlXUmSUR7hF4wxCVqW+ei94JzV5kt0uXBcoOEAuiydrw==" }, "@nodelib/fs.scandir": { @@ -1415,7 +1415,7 @@ }, "@popperjs/core": { "version": "2.11.5", - "resolved": "https://mirrors.tencent.com/npm/@popperjs%2fcore/-/core-2.11.5.tgz", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==" }, "@reduxjs/toolkit": { @@ -2246,7 +2246,7 @@ }, "clipboard": { "version": "2.0.10", - "resolved": "https://mirrors.tencent.com/npm/clipboard/-/clipboard-2.0.10.tgz", + "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.10.tgz", "integrity": "sha512-cz3m2YVwFz95qSEbCDi2fzLN/epEN9zXBvfgAoGkvGOJZATMl9gtTDVOtBYkx2ODUJl2kvmud7n32sV2BpYR4g==", "requires": { "good-listener": "^1.2.2", @@ -2429,7 +2429,7 @@ }, "delegate": { "version": "3.2.0", - "resolved": "https://mirrors.tencent.com/npm/delegate/-/delegate-3.2.0.tgz", + "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" }, "dir-glob": { @@ -2452,7 +2452,7 @@ }, "dom-helpers": { "version": "5.2.1", - "resolved": "https://mirrors.tencent.com/npm/dom-helpers/-/dom-helpers-5.2.1.tgz", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", "requires": { "@babel/runtime": "^7.8.7", @@ -3402,7 +3402,7 @@ }, "good-listener": { "version": "1.2.2", - "resolved": "https://mirrors.tencent.com/npm/good-listener/-/good-listener-1.2.2.tgz", + "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", "requires": { "delegate": "^3.1.2" @@ -4171,7 +4171,7 @@ }, "performance-now": { "version": "2.1.0", - "resolved": "https://mirrors.tencent.com/npm/performance-now/-/performance-now-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, "picocolors": { @@ -4271,7 +4271,7 @@ }, "raf": { "version": "3.4.1", - "resolved": "https://mirrors.tencent.com/npm/raf/-/raf-3.4.1.tgz", + "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", "requires": { "performance-now": "^2.1.0" @@ -4298,7 +4298,7 @@ }, "react-fast-compare": { "version": "3.2.0", - "resolved": "https://mirrors.tencent.com/npm/react-fast-compare/-/react-fast-compare-3.2.0.tgz", + "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.0.tgz", "integrity": "sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==" }, "react-is": { @@ -4308,7 +4308,7 @@ }, "react-popper": { "version": "2.2.5", - "resolved": "https://mirrors.tencent.com/npm/react-popper/-/react-popper-2.2.5.tgz", + "resolved": "https://registry.npmjs.org/react-popper/-/react-popper-2.2.5.tgz", "integrity": "sha512-kxGkS80eQGtLl18+uig1UIf9MKixFSyPxglsgLBxlYnyDf65BiY9B3nZSc6C9XUNDgStROB0fMQlTEz1KxGddw==", "requires": { "react-fast-compare": "^3.0.1", @@ -4360,7 +4360,7 @@ }, "react-transition-group": { "version": "4.4.2", - "resolved": "https://mirrors.tencent.com/npm/react-transition-group/-/react-transition-group-4.4.2.tgz", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.2.tgz", "integrity": "sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg==", "requires": { "@babel/runtime": "^7.5.5", @@ -4559,7 +4559,7 @@ }, "select": { "version": "1.1.2", - "resolved": "https://mirrors.tencent.com/npm/select/-/select-1.1.2.tgz", + "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=" }, "semver": { @@ -4749,7 +4749,7 @@ "dependencies": { "dayjs": { "version": "1.10.8", - "resolved": "https://mirrors.tencent.com/npm/dayjs/-/dayjs-1.10.8.tgz", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.8.tgz", "integrity": "sha512-wbNwDfBHHur9UOzNUjeKUOJ0fCb0a52Wx0xInmQ7Y8FstyajiV1NmK1e00cxsr9YrE9r7yAChE0VvpuY5Rnlow==" }, "tdesign-icons-react": { @@ -4763,7 +4763,7 @@ }, "tslib": { "version": "2.3.1", - "resolved": "https://mirrors.tencent.com/npm/tslib/-/tslib-2.3.1.tgz", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" } } @@ -4776,7 +4776,7 @@ }, "tiny-emitter": { "version": "2.1.0", - "resolved": "https://mirrors.tencent.com/npm/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" }, "tinycolor2": { @@ -4930,7 +4930,7 @@ }, "use-resize-observer": { "version": "8.0.0", - "resolved": "https://mirrors.tencent.com/npm/use-resize-observer/-/use-resize-observer-8.0.0.tgz", + "resolved": "https://registry.npmjs.org/use-resize-observer/-/use-resize-observer-8.0.0.tgz", "integrity": "sha512-n0iKSeiQpJCyaFh5JA0qsVLBIovsF4EIIR1G6XiBwKJN66ZrD4Oj62bjcuTAATPKiSp6an/2UZZxCf/67fk3sQ==", "requires": { "@juggle/resize-observer": "^3.3.1" @@ -4944,7 +4944,7 @@ }, "uuid": { "version": "8.3.2", - "resolved": "https://mirrors.tencent.com/npm/uuid/-/uuid-8.3.2.tgz", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" }, "v8-compile-cache": { @@ -4955,7 +4955,7 @@ }, "validator": { "version": "13.7.0", - "resolved": "https://mirrors.tencent.com/npm/validator/-/validator-13.7.0.tgz", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==" }, "vite": { @@ -5053,7 +5053,7 @@ }, "warning": { "version": "4.0.3", - "resolved": "https://mirrors.tencent.com/npm/warning/-/warning-4.0.3.tgz", + "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", "requires": { "loose-envify": "^1.0.0" diff --git a/src/pages/Dashboard/Base/components/RankList.tsx b/src/pages/Dashboard/Base/components/RankList.tsx index 3a2854a..9f4fe40 100644 --- a/src/pages/Dashboard/Base/components/RankList.tsx +++ b/src/pages/Dashboard/Base/components/RankList.tsx @@ -1,8 +1,7 @@ import React from 'react'; -import { Col, Radio, Row, Table, Button } from 'tdesign-react'; +import { Col, Radio, Row, Table, Button, Card } from 'tdesign-react'; import { TdPrimaryTableProps } from 'tdesign-react/es/table'; import classnames from 'classnames'; -import { Card } from 'tdesign-react'; import { TrendIcon, ETrend } from 'components/Board'; import { PURCHASE_TREND_LIST, SALE_TREND_LIST } from '../constant'; import Style from './RankList.module.less'; From e3a4443c06a49bf71479dd6a1693037e668106b8 Mon Sep 17 00:00:00 2001 From: xucz Date: Sun, 1 May 2022 17:36:14 +0800 Subject: [PATCH 04/10] =?UTF-8?q?feat:=20=E6=A0=B7=E5=BC=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Board/index.module.less | 1 + src/components/Card/index.module.less | 54 ------------------- src/components/Card/index.tsx | 49 ----------------- .../Dashboard/Base/components/Overview.tsx | 2 +- 4 files changed, 2 insertions(+), 104 deletions(-) delete mode 100644 src/components/Card/index.module.less delete mode 100644 src/components/Card/index.tsx diff --git a/src/components/Board/index.module.less b/src/components/Board/index.module.less index 7ce8c1e..4bbe808 100644 --- a/src/components/Board/index.module.less +++ b/src/components/Board/index.module.less @@ -10,6 +10,7 @@ .boardTitle{ line-height: 22px; + font-size: 14px; color: var(--td-text-color-secondary); } diff --git a/src/components/Card/index.module.less b/src/components/Card/index.module.less deleted file mode 100644 index a7ae085..0000000 --- a/src/components/Card/index.module.less +++ /dev/null @@ -1,54 +0,0 @@ -.cardPanel { - padding: 24px 32px; - background: var(--td-bg-color-container); - border-radius: 3px; - width: 100%; - display: flex; - flex-direction: column; - position: relative; -} - -.cardPanelBorder { - border: solid 1px var(--td-component-border); -} - -.top { - height: 32px; - display: flex; - margin-bottom: 8px; - justify-content: space-between; -} - -.left { - display: flex; -} - -.cardTitle { - display: flex; - justify-content: space-between; - font-size: 20px; - line-height: 24px; - font-weight: 500; - color: var(--td-text-color-primary); -} - -.cardTitleSmall { - font-size: 14px; - line-height: 22px; - color: var(--td-text-color-secondary); -} - -.cardDescription { - font-size: 14px; - color: var(--td-brand-color); - color: var(--td-text-color-placeholder); - line-height: 22px; - margin-left: 4px; -} - -.cardContainer { - flex: 1; - display: flex; - flex-direction: column; - justify-content: space-between; -} diff --git a/src/components/Card/index.tsx b/src/components/Card/index.tsx deleted file mode 100644 index 8475bb2..0000000 --- a/src/components/Card/index.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import React from 'react'; -import classnames from 'classnames'; -import Style from './index.module.less'; - -export interface ICardProps { - title?: React.ReactNode; - description?: React.ReactNode; - operation?: React.ReactNode; - className?: string; - border?: boolean; - size?: 'small' | 'large'; -} - -const Card = ({ - title, - description, - operation, - children, - border, - className, - size, -}: React.PropsWithChildren) => ( -
-
-
-
- {title} -
-
{description}
-
-
{operation}
-
-
{children}
-
-); - -export default React.memo(Card); diff --git a/src/pages/Dashboard/Base/components/Overview.tsx b/src/pages/Dashboard/Base/components/Overview.tsx index 0ebd5b5..34c7d26 100644 --- a/src/pages/Dashboard/Base/components/Overview.tsx +++ b/src/pages/Dashboard/Base/components/Overview.tsx @@ -34,7 +34,7 @@ const Overview = (): React.ReactElement => {
- 导出数据}> + 导出数据} header> Date: Sun, 1 May 2022 17:47:33 +0800 Subject: [PATCH 05/10] =?UTF-8?q?feat:=20=E4=BB=A3=E7=A0=81=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/components/Content.tsx | 2 +- src/pages/Detail/Advanced/components/Detail.tsx | 2 +- src/pages/Detail/Base/index.tsx | 9 ++++----- src/pages/Detail/Deploy/components/BottomTable.tsx | 5 ++--- src/pages/Detail/Deploy/components/TopChart.tsx | 6 +++--- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/layouts/components/Content.tsx b/src/layouts/components/Content.tsx index 49ebec5..8c5aa49 100644 --- a/src/layouts/components/Content.tsx +++ b/src/layouts/components/Content.tsx @@ -39,7 +39,7 @@ const renderRoutes = (routes: IRouter[], parentPath = ''): React.ReactNode[] => if (redirect) { // 重定向 - return } />; + return } />; } if (Component) { diff --git a/src/pages/Detail/Advanced/components/Detail.tsx b/src/pages/Detail/Advanced/components/Detail.tsx index e8f1ece..3dc9898 100644 --- a/src/pages/Detail/Advanced/components/Detail.tsx +++ b/src/pages/Detail/Advanced/components/Detail.tsx @@ -83,7 +83,7 @@ const Detail = () => ( }, }, ]} - rowKey='index' + rowKey='id' tableLayout='auto' verticalAlign='top' hover diff --git a/src/pages/Detail/Base/index.tsx b/src/pages/Detail/Base/index.tsx index ff4acc5..856c6fe 100644 --- a/src/pages/Detail/Base/index.tsx +++ b/src/pages/Detail/Base/index.tsx @@ -1,8 +1,7 @@ import React, { memo } from 'react'; -import { Steps } from 'tdesign-react'; +import { Steps, Card } from 'tdesign-react'; import classnames from 'classnames'; import PageBox from 'components/PageBox'; -import Card from 'components/Card'; import { dataInfo, dataStep } from './consts'; import Style from './index.module.less'; @@ -10,7 +9,7 @@ const { StepItem } = Steps; export default memo(() => ( - +
{dataInfo.map((item) => (
@@ -21,14 +20,14 @@ export default memo(() => ( [Style.pdf]: item.type === 'link', })} > - {item.type === 'status' && } + {item.type === 'status' && } {item.value}
))}
- +
{dataStep.map((item) => ( diff --git a/src/pages/Detail/Deploy/components/BottomTable.tsx b/src/pages/Detail/Deploy/components/BottomTable.tsx index e923c25..c63884f 100644 --- a/src/pages/Detail/Deploy/components/BottomTable.tsx +++ b/src/pages/Detail/Deploy/components/BottomTable.tsx @@ -1,8 +1,7 @@ import React, { useEffect, useState } from 'react'; -import { Table } from 'tdesign-react'; +import { Table, Card } from 'tdesign-react'; import { TableSort, TdPrimaryTableProps } from 'tdesign-react/es/table'; import request from 'utils/request'; -import Card from 'components/Card'; import { TABLE_COLUMNS } from '../constant'; import ManagementPopup from './ManagementPopup'; import Style from './BottomTable.module.less'; @@ -55,7 +54,7 @@ const BottomTable = () => { return ( <> - +
{ tabChange(val === 'month')}> 本周 本月 From 80aa4626d8a438ca63c259803b40c29c1c7e9e42 Mon Sep 17 00:00:00 2001 From: xucz Date: Sun, 1 May 2022 17:55:35 +0800 Subject: [PATCH 06/10] =?UTF-8?q?feat:=20=E4=BB=A3=E7=A0=81=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/index.module.less | 4 ++++ .../Base/components/MiddleChart.module.less | 6 ------ .../Dashboard/Base/components/Overview.module.less | 6 ------ .../Dashboard/Base/components/RankList.module.less | 6 ------ src/pages/Dashboard/Detail/constant.ts | 14 +++++++------- src/pages/Dashboard/Detail/index.module.less | 8 -------- src/pages/Dashboard/Detail/index.tsx | 3 +-- src/pages/Detail/Deploy/components/TopChart.tsx | 2 +- 8 files changed, 13 insertions(+), 36 deletions(-) delete mode 100644 src/pages/Dashboard/Detail/index.module.less diff --git a/src/layouts/index.module.less b/src/layouts/index.module.less index 58e5d94..7f4735b 100644 --- a/src/layouts/index.module.less +++ b/src/layouts/index.module.less @@ -11,5 +11,9 @@ background-clip: content-box; background-color: #EEEEEE; } + .t-card__title { + font-weight: 700; + font-size: 20px; + } } } diff --git a/src/pages/Dashboard/Base/components/MiddleChart.module.less b/src/pages/Dashboard/Base/components/MiddleChart.module.less index 0516953..0c8afcd 100644 --- a/src/pages/Dashboard/Base/components/MiddleChart.module.less +++ b/src/pages/Dashboard/Base/components/MiddleChart.module.less @@ -1,9 +1,3 @@ .middleChartPanel { margin-top: 16px; - :global { - .t-card__title { - font-weight: 700; - font-size: 20px; - } - } } diff --git a/src/pages/Dashboard/Base/components/Overview.module.less b/src/pages/Dashboard/Base/components/Overview.module.less index dba03da..745fe90 100644 --- a/src/pages/Dashboard/Base/components/Overview.module.less +++ b/src/pages/Dashboard/Base/components/Overview.module.less @@ -2,10 +2,4 @@ background-color: var(--td-bg-color-container); border-radius: 3px; margin-top: 16px; - :global { - .t-card__title { - font-weight: 700; - font-size: 20px; - } - } } diff --git a/src/pages/Dashboard/Base/components/RankList.module.less b/src/pages/Dashboard/Base/components/RankList.module.less index 8bfaae9..c214369 100644 --- a/src/pages/Dashboard/Base/components/RankList.module.less +++ b/src/pages/Dashboard/Base/components/RankList.module.less @@ -1,11 +1,5 @@ .rankListPanel { margin-top: 16px; - :global { - .t-card__title { - font-weight: 700; - font-size: 20px; - } - } } .rankIndex { diff --git a/src/pages/Dashboard/Detail/constant.ts b/src/pages/Dashboard/Detail/constant.ts index 399abe0..4381a4a 100644 --- a/src/pages/Dashboard/Detail/constant.ts +++ b/src/pages/Dashboard/Detail/constant.ts @@ -1,41 +1,41 @@ -import { IBoardProps } from 'components/Board'; +import { IBoardProps, ETrend } from 'components/Board'; export const PANE_LIST: Array = [ { title: '总申请数(次)', count: '1126', trendNum: '10%', - trend: 'up', + trend: ETrend.up, }, { title: '供应商数量(个)', count: '13', trendNum: '13%', - trend: 'down', + trend: ETrend.down, }, { title: '采购商品品类(类)', count: '4', trendNum: '10%', - trend: 'up', + trend: ETrend.up, }, { title: '申请人数量(人)', count: '90', trendNum: '44%', - trend: 'down', + trend: ETrend.down, }, { title: '申请完成率(%)', count: '80.5', trendNum: '70%', - trend: 'up', + trend: ETrend.up, }, { title: '到货及时率(%)', count: '78', trendNum: '16%', - trend: 'up', + trend: ETrend.up, }, ]; diff --git a/src/pages/Dashboard/Detail/index.module.less b/src/pages/Dashboard/Detail/index.module.less deleted file mode 100644 index e30e046..0000000 --- a/src/pages/Dashboard/Detail/index.module.less +++ /dev/null @@ -1,8 +0,0 @@ -.panel { - :global { - .t-card__title { - font-weight: 700; - font-size: 20px; - } - } -} diff --git a/src/pages/Dashboard/Detail/index.tsx b/src/pages/Dashboard/Detail/index.tsx index 8f6307b..9b54da1 100644 --- a/src/pages/Dashboard/Detail/index.tsx +++ b/src/pages/Dashboard/Detail/index.tsx @@ -3,10 +3,9 @@ import PageBox from 'components/PageBox'; import MonthPurchase from './components/MonthPurchase'; import PurchaseTrend from './components/PurchaseTrend'; import PurchaseSatisfaction from './components/Satisfaction'; -import Style from './index.module.less'; export default memo(() => ( - + diff --git a/src/pages/Detail/Deploy/components/TopChart.tsx b/src/pages/Detail/Deploy/components/TopChart.tsx index befec34..ff45043 100644 --- a/src/pages/Detail/Deploy/components/TopChart.tsx +++ b/src/pages/Detail/Deploy/components/TopChart.tsx @@ -19,7 +19,7 @@ const TopChart = () => { return ( - +
From 36b0a09ccc63db58bc8356739120b375d9eb68ea Mon Sep 17 00:00:00 2001 From: xucz Date: Sun, 1 May 2022 17:57:49 +0800 Subject: [PATCH 07/10] =?UTF-8?q?feat:=20=E5=88=A0=E9=99=A4=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/configs/style.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/configs/style.ts diff --git a/src/configs/style.ts b/src/configs/style.ts deleted file mode 100644 index e69de29..0000000 From 07c81a193cef289ba05bfcba986c67102452619a Mon Sep 17 00:00:00 2001 From: xucz Date: Wed, 4 May 2022 15:34:11 +0800 Subject: [PATCH 08/10] =?UTF-8?q?feat:=20=E6=A0=B7=E5=BC=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Board/index.tsx | 3 ++- src/layouts/components/Header.module.less | 2 +- src/pages/Dashboard/Base/components/RankList.tsx | 12 ++++++------ .../Dashboard/Detail/components/PurchaseTrend.tsx | 2 +- src/pages/List/Base/index.tsx | 9 +-------- src/pages/List/Select/index.tsx | 2 -- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/components/Board/index.tsx b/src/components/Board/index.tsx index 3c38c98..9afbf5b 100644 --- a/src/components/Board/index.tsx +++ b/src/components/Board/index.tsx @@ -49,13 +49,14 @@ export const TrendIcon = ({ trend, trendNum }: { trend?: ETrend; trendNum?: stri ); -const Board = ({ title, count, desc, trend, trendNum, Icon, dark }: IBoardProps) => ( +const Board = ({ title, count, desc, trend, trendNum, Icon, dark, border }: IBoardProps) => ( {title}} header className={classnames({ [Style.boardPanelDark]: dark, })} + bordered={border} footer={
diff --git a/src/layouts/components/Header.module.less b/src/layouts/components/Header.module.less index 5e36a08..efb0b56 100644 --- a/src/layouts/components/Header.module.less +++ b/src/layouts/components/Header.module.less @@ -6,5 +6,5 @@ z-index: 101; display: flex; justify-content: space-between; - //border-bottom: 1px solid var(--td-gray-color-10); + border-bottom: 1px solid var(--td-component-stroke); } diff --git a/src/pages/Dashboard/Base/components/RankList.tsx b/src/pages/Dashboard/Base/components/RankList.tsx index 9f4fe40..ee8a3fc 100644 --- a/src/pages/Dashboard/Base/components/RankList.tsx +++ b/src/pages/Dashboard/Base/components/RankList.tsx @@ -20,7 +20,7 @@ const SALE_COLUMNS: TdPrimaryTableProps['columns'] = [ title: '排名', width: 80, fixed: 'left', - render: ({ rowIndex }) => ( + cell: ({ rowIndex }) => ( {rowIndex + 1} ), }, @@ -36,7 +36,7 @@ const SALE_COLUMNS: TdPrimaryTableProps['columns'] = [ colKey: 'growUp', width: 100, title: '较上周', - render: ({ row }) => , + cell: ({ row }) => , }, { align: 'center', @@ -56,7 +56,7 @@ const SALE_COLUMNS: TdPrimaryTableProps['columns'] = [ fixed: 'right', title: '操作', width: 80, - render: ({ row }) => ( + cell: ({ row }) => ( @@ -71,7 +71,7 @@ const PURCHASE_COLUMNS: TdPrimaryTableProps['columns'] = [ title: '排名', width: 80, fixed: 'left', - render: ({ rowIndex }) => ( + cell: ({ rowIndex }) => ( {rowIndex + 1} ), }, @@ -87,7 +87,7 @@ const PURCHASE_COLUMNS: TdPrimaryTableProps['columns'] = [ colKey: 'growUp', width: 100, title: '较上周', - render: ({ row }) => , + cell: ({ row }) => , }, { align: 'center', @@ -107,7 +107,7 @@ const PURCHASE_COLUMNS: TdPrimaryTableProps['columns'] = [ title: '操作', fixed: 'right', width: 80, - render: ({ row }) => ( + cell: ({ row }) => ( diff --git a/src/pages/Dashboard/Detail/components/PurchaseTrend.tsx b/src/pages/Dashboard/Detail/components/PurchaseTrend.tsx index fc40d42..519b089 100644 --- a/src/pages/Dashboard/Detail/components/PurchaseTrend.tsx +++ b/src/pages/Dashboard/Detail/components/PurchaseTrend.tsx @@ -27,7 +27,7 @@ const ProductTrend = ({ type, isSetup, description, name, icon }: IProductTrendP

{name}

{description}

- +