From 3c01fbf17c07dd3df265874d5fd32856ea86ea20 Mon Sep 17 00:00:00 2001 From: MeterSphere Bot <78466014+metersphere-bot@users.noreply.github.com> Date: Thu, 28 Nov 2024 14:04:38 +0800 Subject: [PATCH] feat(theme): darkTheme (#34438) Co-authored-by: baiqi --- frontend/src/App.vue | 5 +- frontend/src/assets/style/arco-reset.less | 84 +++++++--- frontend/src/assets/style/global.less | 1 + frontend/src/assets/style/var.less | 13 +- .../business/ms-batch-form/index.vue | 2 +- .../components/business/ms-comment/input.vue | 3 +- .../components/business/ms-comment/style.less | 2 +- .../ms-common-script/ms-script-menu.vue | 5 +- .../ms-message/MessageCenterDrawer.vue | 4 +- .../components/reviewStatusTrigger.vue | 3 +- .../ms-minders/caseReviewMinder/index.vue | 2 +- .../ms-minders/featureCaseMinder/basInfo.vue | 2 +- .../ms-minders/featureCaseMinder/bugList.vue | 2 +- .../testPlanFeatureCaseMinder/bugList.vue | 2 +- .../testPlanFeatureCaseMinder/index.vue | 2 +- .../ms-minders/testPlanMinder/index.vue | 2 +- .../business/ms-params-input/index.vue | 2 +- .../ms-personal-drawer/components/apiKey.vue | 3 +- .../components/baseInfo.vue | 3 +- .../components/tripartite.vue | 3 +- .../components/business/ms-select/index.less | 3 +- .../business/ms-thumbnail-card/index.vue | 3 +- .../components/business/ms-transfer/index.vue | 2 +- .../src/components/business/ms-tree/index.vue | 4 +- .../business/ms-user-group-comp/authTable.vue | 6 +- .../ms-user-group-comp/msUserGroupLeft.vue | 2 +- .../src/components/pure/flow-editor/index.vue | 30 ---- .../components/pure/ms-back-button/index.vue | 3 +- .../src/components/pure/ms-card/index.vue | 11 +- .../components/pure/ms-code-editor/index.vue | 15 +- .../components/pure/ms-description/index.vue | 4 +- .../src/components/pure/ms-drawer/index.vue | 6 +- .../components/pure/ms-editable-tab/index.vue | 2 +- .../components/pure/ms-form-table/index.vue | 4 +- .../pure/ms-minder-editor/main/header.vue | 5 +- .../pure/ms-minder-editor/main/mainEditor.vue | 40 ++++- .../pure/ms-minder-editor/main/navigator.vue | 13 +- .../ms-minder-editor/menu/nodeFloatMenu.vue | 5 +- .../pure/ms-minder-editor/minderEditor.vue | 3 +- .../pure/ms-minder-editor/script/editor.ts | 1 + .../pure/ms-minder-editor/style/editor.less | 6 +- .../components/pure/ms-pagination/style.less | 2 +- .../pure/ms-rich-text/MsRichText.vue | 6 +- .../extensions/mention/MentionList.vue | 3 +- .../pure/ms-separate-radio-button/index.vue | 3 +- .../components/pure/ms-split-box/index.vue | 4 +- .../components/pure/ms-table/base-table.vue | 41 ++++- .../pure/ms-table/comp/defaultFilter.vue | 3 + .../src/components/pure/ms-tag/ms-tag.vue | 6 +- .../components/pure/ms-upload/fileList.vue | 2 +- .../src/components/pure/ms-upload/index.vue | 3 +- frontend/src/components/pure/navbar/index.vue | 36 +++++ frontend/src/locale/en-US/settings.ts | 2 +- frontend/src/locale/zh-CN/settings.ts | 2 +- frontend/src/store/modules/app/index.ts | 6 +- frontend/src/store/modules/app/types.ts | 1 + frontend/src/utils/theme.ts | 151 +++++++++++++++++- .../api-test/components/apiMethodName.vue | 2 +- .../api-test/components/condition/list.vue | 6 +- .../components/fastExtraction/index.vue | 17 +- .../views/api-test/components/paramTable.vue | 3 +- .../components/requestComposition/index.vue | 6 +- .../response/result/index.vue | 4 +- .../response/result/resValueScript.vue | 3 +- .../response/result/tiledDisplay.vue | 6 +- .../api-test/management/components/import.vue | 3 +- .../management/api/apiExportModal.vue | 3 +- .../management/api/apiSharePreview.vue | 4 +- .../components/management/api/shareButton.vue | 3 +- .../case/tabContent/tabCaseExecuteHistory.vue | 2 +- .../src/views/api-test/management/index.vue | 8 +- .../report/component/caseReportCom.vue | 11 +- .../report/component/caseReportDrawer.vue | 12 +- .../report/component/reportDetailDrawer.vue | 16 +- .../report/component/reportStatus.vue | 2 +- .../api-test/report/component/scenarioCom.vue | 12 +- .../report/component/step/readOnlyTree.vue | 25 +-- .../report/component/step/stepTree.vue | 15 +- .../views/api-test/report/exportCasePDF.vue | 2 +- .../api-test/report/exportScenarioPDF.vue | 2 +- .../views/api-test/report/shareCaseIndex.vue | 12 +- .../components/common/csvParamsTable.vue | 2 +- .../components/common/customApiDrawer.vue | 8 +- .../components/common/customCaseDrawer.vue | 8 +- .../exportScenario/scenarioExportModal.vue | 3 +- .../common/importApiDrawer/index.vue | 2 +- .../components/common/loopPagination.vue | 6 +- .../components/common/responsePopover.vue | 9 +- .../common/scriptOperationDrawer.vue | 8 +- .../scenario/components/executeHistory.vue | 2 +- .../api-test/scenario/components/import.vue | 3 +- .../scenario/components/step/stepTree.vue | 6 +- .../src/views/api-test/scenario/index.vue | 10 +- .../src/views/api-test/scenario/recycle.vue | 10 +- frontend/src/views/base/invite/index.vue | 2 +- .../components/bug-detail-drawer.vue | 2 +- .../views/bug-management/createSuccess.vue | 7 +- .../components/caseDetailDrawer.vue | 4 +- .../components/createSuccess.vue | 7 +- .../components/recycleCaseTable.vue | 2 +- .../components/stepDetailTrigger.vue | 2 +- .../caseManagementFeature/index.vue | 8 +- .../case-management/caseReview/caseDetail.vue | 6 +- .../case-management/caseReview/detail.vue | 2 +- .../src/views/login/components/login-form.vue | 27 ++-- .../environmental/components/EnvGroupBox.vue | 4 +- .../environmental/components/EnvParamBox.vue | 8 +- .../components/envParams/DatabaseTab.vue | 73 +++++---- .../components/envParams/HttpTab.vue | 22 +-- .../components/envParams/popUp/apiTree.vue | 4 +- .../environmental/index.vue | 3 +- .../fileManagement/components/rightBox.vue | 4 +- .../fileManagement/index.vue | 3 +- .../components/messageList.vue | 2 +- .../components/messagePreview.vue | 18 ++- .../components/robotList.vue | 3 +- .../messageManagement/edit.vue | 5 +- .../projectAndPermission/basicInfos/index.vue | 6 +- .../projectAndPermission/index.vue | 4 +- .../projectAndPermission/member/index.vue | 6 +- .../menuManagement/menuManagement.vue | 3 + .../projectVersion/index.vue | 2 +- .../userGroup/projectUserGroup.vue | 4 +- .../userGroup/userDrawer.vue | 9 ++ .../components/serviceList.vue | 4 +- .../organization/serviceIntegration/index.vue | 2 +- .../template/components/addTemplate.vue | 2 +- .../template/components/templateItem.vue | 7 +- .../template/components/workflowCard.vue | 2 +- .../system/config/components/baseConfig.vue | 2 +- .../config/components/memoryCleanup.vue | 6 +- .../system/config/components/pageConfig.vue | 15 +- .../system/config/components/qrCodeConfig.vue | 4 +- .../system/log/components/logCards.vue | 2 +- .../pluginManager/components/pluginTable.vue | 6 +- .../setting/system/resourcePool/index.vue | 2 +- .../src/views/setting/system/user/index.vue | 2 +- .../component/executeResultStatus.vue | 2 +- .../component/testPlanExecuteResultDrawer.vue | 3 +- .../report/detail/component/config.vue | 6 +- .../component/system-card/testSetTable.vue | 2 +- .../component/system-card/testTableIndex.vue | 3 +- .../report/detail/component/viewReport.vue | 13 +- .../test-plan/report/detail/exportPDF.vue | 11 +- .../testPlan/detail/executeResultDrawer.vue | 4 +- .../views/workbench/components/notData.vue | 3 +- .../homePage/components/cardSettingDrawer.vue | 5 +- .../homePage/components/cardSettingList.vue | 6 +- .../src/views/workbench/homePage/index.vue | 3 +- 149 files changed, 819 insertions(+), 390 deletions(-) delete mode 100644 frontend/src/components/pure/flow-editor/index.vue diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 18a95793a0..6cf075a536 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -20,7 +20,7 @@ import { getQueryVariable, getUrlParameterWidthRegExp } from '@/utils'; import { setLoginExpires, setLongType, setToken } from '@/utils/auth'; import { getLocalStorage, setLocalStorage } from '@/utils/local-storage'; - import { setFavicon, watchStyle, watchTheme } from '@/utils/theme'; + import { setFavicon } from '@/utils/theme'; import { getLarkCallback, getLarkSuiteCallback, getPublicKeyRequest } from './api/modules/user'; import { hasAnyPermission } from './utils/permission'; @@ -42,9 +42,6 @@ } }); - // 初始化平台风格和主题色 - watchStyle(appStore.pageConfig.style, appStore.pageConfig); - watchTheme(appStore.pageConfig.theme, appStore.pageConfig); setFavicon(GetPlatformIconUrl); onBeforeMount(async () => { diff --git a/frontend/src/assets/style/arco-reset.less b/frontend/src/assets/style/arco-reset.less index 1f68aac3bf..b60e34b86a 100644 --- a/frontend/src/assets/style/arco-reset.less +++ b/frontend/src/assets/style/arco-reset.less @@ -17,6 +17,10 @@ } } } +.arco-table-td { + border-color: var(--color-text-n9); + color: var(--color-text-1); +} .ms-table-row-disabled { td:not(.arco-table-col-fixed-right, .arco-table-checkbox), &:hover, @@ -26,13 +30,33 @@ background-color: var(--color-text-n8) !important; } } +.arco-table-header, +.arco-table-tr, +.arco-table-th { + background-color: var(--color-text-fff); +} +.arco-table-th { + border-color: var(--color-text-n8) !important; +} +.arco-table-td, +.arco-table-scroll-y { + border-color: var(--color-text-n8) !important; +} /** Tabs 组件样式 **/ +.arco-tabs, +.arco-tabs-nav { + border-color: var(--color-text-n8); +} .arco-tabs-nav-add-btn { font-size: var(--font-size-body-3); } .arco-tabs-tab { padding: 12px 0 !important; + color: var(--color-text-2); + &-active { + color: rgb(var(--primary-5)); + } &:hover { .arco-tabs-tab-title::before { background-color: inherit !important; @@ -58,9 +82,10 @@ @apply overflow-hidden; } .arco-modal { - @apply overflow-hidden bg-white; + @apply overflow-hidden; padding: 24px; + background-color: var(--color-text-fff); .arco-modal-header { @apply h-auto items-baseline border-b-0 p-0; @@ -298,6 +323,7 @@ .arco-select { width: 100%; border: 1px solid var(--color-text-n8); + border-color: var(--color-text-n8) !important; background-color: var(--color-text-fff); &:not( :disabled, @@ -308,16 +334,19 @@ .arco-picker-disabled ):hover { border-color: rgb(var(--primary-5)) !important; - background-color: white; - } - input::placeholder { - color: var(--color-text-brand); + background-color: var(--color-text-fff); } } +input::placeholder { + color: var(--color-text-brand) !important; +} .arco-select-view-multiple.arco-select-view-size-medium { overflow: hidden; // 防止多选输入过多,撑开 height: 32px; } +.arco-select-view-prefix { + color: var(--color-text-brand) !important; +} .arco-input-tag-disabled, .arco-select-view-disabled, .arco-textarea-disabled, @@ -379,12 +408,11 @@ } .arco-input-prepend, .arco-input-append { - @apply bg-white; + background-color: var(--color-text-fff); .arco-input-number-step-button { - @apply !bg-white; - border: 1px solid var(--color-text-n8) !important; border-radius: var(--border-radius-small) !important; + background-color: var(--color-text-fff) !important; .btn-outline-sec-hover(); .btn-outline-sec-active(); &:disabled { @@ -430,14 +458,14 @@ .arco-input-wrapper:not(.arco-input-disabled), .arco-select-view:not(.arco-select-view-disabled), .arco-textarea-wrapper:not(.arco-textarea-disabled) { - background: white; + background: var(--color-text-fff); } } .arco-input-wrapper:not(.arco-input-disabled), .arco-select-view:not(.arco-select-view-disabled), .arco-textarea-wrapper:not(.arco-textarea-disabled) { border-color: var(--color-text-input-border); - background: white; + background: var(--color-text-fff); } } .arco-form-item-message { @@ -493,10 +521,11 @@ .arco-checkbox-disabled.arco-checkbox-checked, .arco-checkbox-disabled.arco-checkbox-checked:hover { .arco-checkbox-icon { - @apply bg-white text-white; + @apply text-white; border-color: var(--color-text-input-border) !important; background: var(--color-text-n8) !important; + background-color: var(--color-text-fff); &::after { background-color: var(--color-text-4); } @@ -522,9 +551,8 @@ line-height: 20px; } .arco-radio-checked { - @apply bg-white; - color: rgb(var(--primary-5)); + background-color: var(--color-text-fff); } } .arco-radio-group-size-medium { @@ -547,12 +575,11 @@ } .arco-radio-checked:not(.arco-radio-disabled) { .arco-radio-icon { - @apply !bg-white; - width: 16px; height: 16px; - line-height: 16px; border: 1px solid rgb(var(--primary-6)); + background-color: var(--color-text-fff) !important; + line-height: 16px; &::after { top: 2px; left: 2px; @@ -703,9 +730,8 @@ margin: 1px; } .arco-radio-checked { - @apply bg-white; - color: rgb(var(--primary-5)); + background-color: var(--color-text-fff); } } .arco-radio-checked.arco-radio-disabled { @@ -719,12 +745,11 @@ } .arco-radio-checked:not(.arco-radio-disabled) { .arco-radio-icon { - @apply !bg-white; - width: 16px; height: 16px; - line-height: 16px; border: 1px solid rgb(var(--primary-6)); + background-color: var(--color-text-fff) !important; + line-height: 16px; &::after { top: 2px; left: 2px; @@ -745,6 +770,9 @@ font-size: 12px; line-height: 16px; } +.arco-popover-popup-content { + border-color: var(--color-text-n8); +} /** 链接 **/ .arco-link-status-normal { @@ -867,6 +895,8 @@ /** tooltip **/ .arco-tooltip-content { @apply break-all; + + color: var(--color-text-fff); } .arco-trigger-arrow { border-bottom-right-radius: var(--border-radius-mini) !important; @@ -930,3 +960,15 @@ flex-direction: row; margin: 12px; } + +/** 分割线 **/ +.arco-divider-horizontal, +.arco-divider-vertical { + border-color: var(--color-text-n8); +} + +/** 级联选择器 **/ +.arco-cascader-panel, +.arco-cascader-panel-column { + border-color: var(--color-text-n8) !important; +} diff --git a/frontend/src/assets/style/global.less b/frontend/src/assets/style/global.less index 3189ad143c..76506cd2e4 100644 --- a/frontend/src/assets/style/global.less +++ b/frontend/src/assets/style/global.less @@ -129,6 +129,7 @@ body { .arco-trigger-popup-wrapper { .arco-popover-popup-content { padding: 4px 8px; + border-color: var(--color-text-n8); } } diff --git a/frontend/src/assets/style/var.less b/frontend/src/assets/style/var.less index 69af717c40..125a7ba169 100644 --- a/frontend/src/assets/style/var.less +++ b/frontend/src/assets/style/var.less @@ -26,10 +26,9 @@ } .btn-outline-primary-disabled() { &:disabled { - @apply !bg-white; - border: 1px solid rgb(var(--primary-3)) !important; color: rgb(var(--primary-3)) !important; + background-color: var(--color-text-fff) !important; } } .btn-outline-sec-hover() { @@ -42,7 +41,7 @@ .btn-outline-sec-default() { border-color: var(--color-text-brand) !important; color: var(--color-text-1) !important; - background-color: white !important; + background-color: var(--color-text-fff) !important; } .btn-outline-sec-active() { &:not(:disabled):active { @@ -53,10 +52,9 @@ } .btn-outline-sec-disabled() { &:disabled { - @apply !bg-white; - border: 1px solid var(--color-text-input-border) !important; color: var(--color-text-4) !important; + background-color: var(--color-text-fff) !important; } } .btn-outline-danger-default() { @@ -79,10 +77,9 @@ } .btn-outline-danger-disabled() { &:disabled { - @apply !bg-white; - border: 1px solid rgb(var(--danger-2)) !important; color: rgb(var(--danger-2)); + background-color: var(--color-text-fff) !important; } } @@ -216,6 +213,7 @@ z-index: 1; width: 100%; height: 10px; + background-color: transparent; box-shadow: none; transition: box-shadow 0.1s cubic-bezier(0, 0, 1, 1); content: ''; @@ -231,6 +229,7 @@ z-index: 1; width: 100%; height: 10px; + background-color: transparent; box-shadow: none; transition: box-shadow 0.1s cubic-bezier(0, 0, 1, 1); content: ''; diff --git a/frontend/src/components/business/ms-batch-form/index.vue b/frontend/src/components/business/ms-batch-form/index.vue index d79e546508..442248dfaf 100644 --- a/frontend/src/components/business/ms-batch-form/index.vue +++ b/frontend/src/components/business/ms-batch-form/index.vue @@ -399,7 +399,7 @@ @apply rounded; } .dragChosenClass { - background: white; + background: var(--color-text-fff); opacity: 1 !important; @apply rounded; .minus { diff --git a/frontend/src/components/business/ms-comment/input.vue b/frontend/src/components/business/ms-comment/input.vue index 536d2cc054..c691cd8490 100644 --- a/frontend/src/components/business/ms-comment/input.vue +++ b/frontend/src/components/business/ms-comment/input.vue @@ -115,8 +115,9 @@ diff --git a/frontend/src/components/business/ms-minders/caseReviewMinder/index.vue b/frontend/src/components/business/ms-minders/caseReviewMinder/index.vue index bee11f2a04..f99aa0dd5c 100644 --- a/frontend/src/components/business/ms-minders/caseReviewMinder/index.vue +++ b/frontend/src/components/business/ms-minders/caseReviewMinder/index.vue @@ -41,7 +41,7 @@